[ncl-talk] Location of built-in functions wrf_td and wrf_tk

Mary Haley haley at ucar.edu
Tue Nov 4 08:34:44 MST 2014


The wrf_xxxx computational functions are built-in functions, which means
they are part of the "ncl" executable, and not NCL scripting code.

In this case, they are part of the "wrf_user.f" Fortran code that's in
$NCARG/ni/src/lib/nfpfort.

"wrf_tk" is associated with the "dcomputetk" subroutine and "wrf_td" is
"dcomputetd".

For the bulk of the scientific computational routines built into "ncl", the
C wrappers are in $NCARG/ni/src/lib/nfp, and the Fortran code in
$NCARG/ni/src/lib/nfpfort.  The way to find the Fortran code associated
with a C wrapper is to:

   -  Search for the NCL function name in $NCARG/ni/src/lib/nfp:

  cd $NCARG/ni/src/lib/nfp
  grep wrf_tk *.c

[Ignore the "wrapper.c" file, because this is just a prototyping routine
for all wrappers.]

You will see that "wrf_tk" is referenced in "wrfW.c".

   - Open wrfW.c with a UNIX editor and search for:

NhlErrorTypes wrf_tk

This is the main wrapper code for "wrf_tk".


   - In this code, search for any calls to "NGCALLF", which is the macro
   that calls the Fortran routine from this C wrapper:

/*                                                                    *
Call Fortran routine.
 */
 NGCALLF(dcomputetk,DCOMPUTETK)(tmp_t,tmp_p,tmp_theta,&inx);


   - Now that you have the Fortran routine name, you can cd to "../nfpfort"
   to search for this Fortran subroutine:

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

--Mary

On Mon, Nov 3, 2014 at 4:08 PM, 李嘉鹏 <lijpbasin at 126.com> wrote:

> Thomas, you can search for files containing wrf_td or wrf_tk, if they are
> not in $NCARG_ROOT/lib/ncarg/nclscripts/, then they are probably builtins.
>
>     grep -e wrf_tk -e wrf_td -R $NCARG_ROOT/lib/ncarg/nclscripts
>
> 于 2014年11月4日 格林尼治标准时间+0800上午5时29分16秒, Thomas Robinson <ter at hawaii.edu> 写到:
> >Hello All,
> >I am wondering where the functions wrf_td and wrf_tk are in the ncl
> >file
> >directory.  I found this
> >    $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
> >which has wrf_getvar and calls wrf_td, but not wrf_td.  Does anyone
> >know
> >where wrf_td and wrf_tk are installed?
> >
> >    -Tom
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >ncl-talk mailing list
> >List instructions, subscriber options, unsubscribe:
> >http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> _______________________________________________
> ncl-talk mailing list
> 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/20141104/7d61796a/attachment.html 


More information about the ncl-talk mailing list