[ncl-talk] ncl built-in function code

qinmingyue at mail.iap.ac.cn qinmingyue at mail.iap.ac.cn
Sat Oct 14 06:20:49 MDT 2017


Yeah right! I found the ncl versions.
But it seems not all built-in functions are included in this script SHEA_UTIL.NCL. For example EOF is not included.
So if I can't find the other built-in functions in the script, it means there aren't NCL versions of the fortran code, right?


Thank you for your kindly help.


Sophie  



-----原始邮件-----
发件人:"Dennis Shea" <shea at ucar.edu>
发送时间:2017-10-14 05:52:38 (星期六)
收件人: "Mary Haley" <haley at ucar.edu>
抄送: qinmingyue at mail.iap.ac.cn, "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
主题: Re: [ncl-talk] ncl built-in function code


A little 'secret' ....


%> less $NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl


Search for SPECX_ANAL   and SPECXY_ANAL..


These are (one-dimensional) NCL versions of the fortran code. They may be easier to follow.


Good luck



On Fri, Oct 13, 2017 at 1:19 PM, Mary Haley <haley at ucar.edu> wrote:

Hi Sophie,


To find the Fortran code for the NCL function, you first need to find the C wrapper for the NCL function, find out what Fortran routine it is calling, and then search for this function in another directory.


Here are the steps:




1) Clone the NCL source code from:


https://github.com/NCAR/ncl



or download it from:


https://www.earthsystemgrid.org/dataset/ncl.640.src/file.html



2) Look in the ni/src/lib/nfp directory for the C wrapper file that contains this function (using specx_anal as an example):

cd ni/src/lib/nfp
grep  specx_anal_W *.c 

3) Look at the C file (specxW.c)
​for a line like this:


NhlErrorTypes specx_anal_W( void )


and then start searching for a call to NGCALLF to
 see what Fortran routine this function depends on
​. 


In this case, it is:​


NGCALLF(dspecx,DSPECX)(dx,&inx,iopt,jave,dpct,&scl,work,&ilwork,
                       frq_tmp,spcx_tmp,&inspc,sinfo,&ier);


4) ​Cd to the nfpfort directory and search for this routine in the Fortran file directory:


cd ../nfpfort
grep -i dspecx *.f


--Mary






On Thu, Oct 12, 2017 at 8:18 PM, <qinmingyue at mail.iap.ac.cn> wrote:

Hi all,
 
Where can i find the code for ncl built-in function like eofunc,specx_anal and so on?
I want to know the detailed calculation steps of the functions.


Sophie
PhD student
Institute of Atmospheric Physics






_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk





_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171014/b249b832/attachment.html>


More information about the ncl-talk mailing list