<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.<wbr>org/dataset/ncl.640.src/file.<wbr>html</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,&<wbr>inx,iopt,jave,dpct,&scl,work,&<wbr>ilwork,</font></div><div><font face="monospace, monospace"> frq_tmp,spcx_tmp,&inspc,<wbr>sinfo,&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">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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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>______________________________<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>