<div dir="ltr"><div><div><div><div>A little 'secret' ....<br><br></div>%> less $NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl<br><br></div>Search for SPECX_ANAL and SPECXY_ANAL..<br><br></div>These are (one-dimensional) NCL versions of the fortran code. They may be easier to follow.<br><br></div>Good luck<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 13, 2017 at 1:19 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Sophie,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Here are the steps:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">1) Clone the NCL source code from:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="https://github.com/NCAR/ncl" target="_blank">https://github.com/NCAR/ncl</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">or download it from:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="https://www.earthsystemgrid.org/dataset/ncl.640.src/file.html" target="_blank">https://www.earthsystemgrid.or<wbr>g/dataset/ncl.640.src/file.htm<wbr>l</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">2) Look in the ni/src/lib/nfp directory for the C wrapper file that contains this function (using specx_anal as an example):</div><br><font face="monospace, monospace">cd ni/src/lib/nfp<br>grep specx_anal_W *.c </font><br><br>3) Look at the C file (specxW.c) <div class="gmail_default" style="font-size:small;display:inline">for a line like this:</div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline"><font face="monospace, monospace">NhlErrorTypes specx_anal_W( void )</font></div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">and then start searching for a call to NGCALLF to</div> see what Fortran routine this function depends on<div class="gmail_default" style="font-size:small;display:inline">. </div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">In this case, it is:</div></div><div><div><br></div><div><div><font face="monospace, monospace">NGCALLF(dspecx,DSPECX)(dx,&inx<wbr>,iopt,jave,dpct,&scl,work,&ilw<wbr>ork,</font></div><div><font face="monospace, monospace"> frq_tmp,spcx_tmp,&inspc,sinfo<wbr>,&ier);</font></div><div><br></div><div><div class="gmail_default" style="font-size:small">4) Cd to the nfpfort directory and search for this routine in the Fortran file directory:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">cd ../nfpfort<br>grep -i dspecx *.f</font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Oct 12, 2017 at 8:18 PM, <span dir="ltr"><<a href="mailto:qinmingyue@mail.iap.ac.cn" target="_blank">qinmingyue@mail.iap.ac.cn</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hi all,<div> </div><div>Where can i find the code for ncl built-in function like eofunc,specx_anal and so on?</div><div>I want to know the detailed calculation steps of the functions.</div><div><br></div><div>Sophie</div><div>PhD student</div><div>Institute of Atmospheric Physics</div><div><br></div><div><br></div><br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>