<div dir="ltr">Hello, Dennis, <div><br></div><div>Thanks for helping me fix the WRAPIT error. It works fine now! But I have a new question here. My NCL script can not plot my output (w_bin). I use &quot;gsn_csm_contour&quot; to plot the velocity frequency changes with time and submit the job to yellowstone. The error message is:</div><div>-------------------------------</div><div><div>warning:ContourPlotInitialize: X coordinates out of data range: defaulting</div><div>warning:ContourPlotInitialize: Zero X coordinate span: defaulting:[errno=1104]</div></div><div>----------------------------</div><div>I think my output from WRAPIT is correct. And I use &quot;gsn_csm_contour&quot; to plot before. Never have this error before. </div><div>I attached my scripts and .out file of the job.</div><div>Please help me check the problem. Thank you very much!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 10:09 AM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</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>Yes. WRAPIT does not need any &#39;local&#39; fortran variables. They can be placed after the &#39;C NCLEND&#39; delimeter<br><br></div>Good Luck<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 30, 2016 at 1:59 PM, Ying Song <span dir="ltr">&lt;<a href="mailto:ysong4@slu.edu" target="_blank">ysong4@slu.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for the reply!<div><br></div><div>You are right, Dennis. The error is caused by nbin-1, it is fixed now. I want to make sure I understand you correctly. You mean the local variables such as bins, bcnt, and npts need to be defined in .f script but not in stub file. Stub file only care about the variables pass into or out the fortran subroutine? </div><div><br></div><div>Also, thanks for sending the binning function information also. Let me take a look!</div></div><div class="m_-9055544700929588413HOEnZb"><div class="m_-9055544700929588413h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 30, 2016 at 2:02 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</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>Forgot: NCL has some binning functions<br><br><a href="http://www.ncl.ucar.edu/Applications/" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/</a><br><br></div><div>Under &quot;Data Analysis&quot; ... click &quot;Binning&quot;<br><br></div><div>See the examples. They use the following functions:<br></div><div><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/bin_sum.shtml" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Built-in/bin_sum.<wbr>shtml</a><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/bin_avg.shtml" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Built-in/bin_avg.<wbr>shtml</a><br></div></div><div class="m_-9055544700929588413m_-5261918918499294580HOEnZb"><div class="m_-9055544700929588413m_-5261918918499294580h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 30, 2016 at 12:31 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</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>WRAPIT is not a complete fortran-77 parser. WRAPIT  strictly looks at the arguments being passed between NCL 
(written in C) and the fortran subroutine. The types and sizes must 
match. <br><br>WRAPIT does not understand fortran &#39;dynamic&#39; array sizing. Also, WRAPIT does not allow things like redefining the array extent such as: foo(-N:N). A stub file or is one way of addressing these limitations. NOTE: the stub file could be a valid fortran subroutine containing the NCL delimeters [ C NCLFORTSTART and C NCLEND ] that handles assorted issues in the fortran world.<br></div><div><br></div><div>That sadi:<br><br></div><div>I speculate that the issue is the &#39;nbin-1&#39; id the array declarations. Maybe, add and &#39;nbin1&#39; argument where <br></div><div>     nbin1 = nbin-1<br></div><div>and make the stub file be<br></div><div><br>C NCLFORTSTART<br>        subroutine wacftd(nxx,nyx,nkx,ntx,nbin,nb<wbr>in1, wa,bfra)<br>        integer nxx,nyx,nkx,ntx,nbin, nbin1<br>        real wa(nxx,nyx,nkx,ntx)           <wbr>         ! input variable<br><br>c c c real bins(ntx,nbin),bcnt(ntx,nbin-1<wbr>), bfra(ntx,nbin-1)<br>        real  bfra(ntx,nbin1)               <wbr>            ! return variable<br>C NCLEND<br></div><div>C WRAPIT will not look at the following. <br></div><div>       integer npts<br></div><div>       real bins(ntx,nbin), bcnt(ntx,nbin-1)    ! local  ... fortran compiler handles this<br><br></div><div>       npts = nxx*nyx*nkx<br></div><div><br></div><div>This would have to be added to the NCL script calling the subroutine as a shared object.<br></div><div>Further, variable &#39;bins&#39; is not being passed to-from the NCL script. I can an<br></div><div><br>---<br></div><div>Re: PARAMETER statements<br><br></div><div>WRAPIT  strictly looks at the arguments being passed between NCL (written in C) and the fortran subroutine. The types and sizes must match.<br><br>C NCLFORTSTART<br>        subroutine fooo(nxx,nyx,nkx,ntx,nbin, ........wa,.....)<br>        integer nxx,nyx,nkx,ntx,nbin, nbin1<br>        real wa(nxx,nyx,nkx,ntx)           <wbr>         ! input variable<br></div><div>C NCLEND<br></div><div>        integer ii, jj                           ! WRAPIT does not care about the following<br></div><div>        parameter (ii=30, jj=999)     ! baecause they are not passed into or out the subroutine<br></div><div>        double precision work(ii,jj)<br></div><div><br>---<br><br><br></div><div>You do not have to have a stub file. A minor rearrangement <br><br><br>C NCLFORTSTART<br>        subroutine wacftd(nxx,nyx,nkx,ntx,nbin,nb<wbr>in1, wa,bfra)<br>        integer nxx,nyx,nkx,ntx,nbin, nbin1<br>        real wa(nxx,nyx,nkx,ntx)           <wbr>         ! input variable<br>        real  bfra(ntx,nbin1)               <wbr>            ! return variable<br>C NCLEND<br>       real bins(ntx,nbin),bcnt(ntx,nbin-1<wbr>)<br><br><br></div><div><br></div><div>Good luck<br></div><div><br><br></div><div><br><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Fri, Dec 30, 2016 at 11:33 AM, Ying Song <span dir="ltr">&lt;<a href="mailto:ysong4@slu.edu" target="_blank">ysong4@slu.edu</a>&gt;</span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-9055544700929588413m_-5261918918499294580m_3516964414673751136h5"><div dir="ltr">Hello,<div><br></div><div>I am using WRAPIT in NCL to calculate velocity frequency, following the ex01. After running the command: </div><div>WRAPIT cftd.stub cftd.f</div><div>The error shows below:<br></div><div>++++++++++++++++++++</div><div><div>WRAPIT Version: 120209</div><div>A syntax error occurred while parsing: 1</div><div>COMPILING cftd.f</div><div>LINKING</div><div>END WRAPIT</div><div>++++++++++++++++++++</div><div>I think there are some problems in my cftd.f script but I can not find it. So I write this email asking for help!</div><div><br></div><div>cftd.f and cftd.stub are attached. Thank you very much! </div><span class="m_-9055544700929588413m_-5261918918499294580m_3516964414673751136m_-5771820590071887262HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-9055544700929588413m_-5261918918499294580m_3516964414673751136m_-5771820590071887262m_-7294998241295014218gmail_signature"><div dir="ltr"><div>Ying Song, PhD, Post Doctoral Fellow </div><div>Department of Earth and Atmospheric Sciences</div><div>Saint Louis University</div><div><br></div><div><a href="mailto:ysong4@slu.edu" target="_blank">ysong4@slu.edu</a></div><div><br></div></div></div>
</font></span></div></div>
<br></div></div><span>______________________________<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></span></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-9055544700929588413m_-5261918918499294580gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ying Song, PhD, Post Doctoral Fellow </div><div>Department of Earth and Atmospheric Sciences</div><div>Saint Louis University</div><div><br></div><div><a href="mailto:ysong4@slu.edu" target="_blank">ysong4@slu.edu</a></div><div><br></div></div></div>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ying Song, PhD, Post Doctoral Fellow </div><div>Department of Earth and Atmospheric Sciences</div><div>Saint Louis University</div><div><br></div><div><a href="mailto:ysong4@slu.edu" target="_blank">ysong4@slu.edu</a></div><div><br></div></div></div>
</div>