[ncl-talk] ncl built-in function code

Mary Haley haley at ucar.edu
Fri Oct 13 13:19:46 MDT 2017


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171013/25d6bd94/attachment.html>


More information about the ncl-talk mailing list