<div dir="ltr"><div><div><div><div>Kyle is correct. <br><br></div>Basically the 6.3.0 shea_util.ncl had &#39;&#39;back-door&#39; interfaces  to older versions pot_vort_isobaric and pot_vort_hybrid. These were used for old testing. Unfortunately, they were not deleted. As &#39;they&#39; ...my bad!<br><br>Please download:   <br>    <a href="http://www.cgd.ucar.edu/~shea/contributed.ncl_640">http://www.cgd.ucar.edu/~shea/contributed.ncl_640</a><br>   <br><br></div>Place these in some directory, load these files in your script. If these files are in the same directory as your script ...<br><br></div>load &quot;./contributed.ncl_640&quot;<br></div><div>... your_script...<br></div><div><br>===<br><br><br></div><div>The shea_util.ncl_640 need not be loaded. If you decide to do so,<br> <a href="http://www.cgd.ucar.edu/~shea/shea_util.ncl_640">http://www.cgd.ucar.edu/~shea/shea_util.ncl_640</a><br><br>load &quot;./contributed.ncl_640&quot;<br>load &quot;./shea_util.ncl_640&quot;<br></div><div>... your_script ...<br><br>===<br></div><div>If your script still fails, you can upload your script and data files to:<br><br></div><div>ftp <a href="http://ftp.cgd.ucar.edu">ftp.cgd.ucar.edu</a><br></div><div>anonymous<br></div><div>your_email<br></div><div>cd incoming<br></div><div>put ...<br></div><div>put ...<br>...<br></div><div>quit<br><br></div><div>Then, after successful transfer. let me know.<br><br></div><div>Cheers<br></div><div>D<br></div><div><br></div><div><div><br><br><div><div><br><br><br><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 9, 2016 at 10:26 PM, Kyle Griffin <span dir="ltr">&lt;<a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.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">Hi Daniel,<div><br></div><div>OK, I finally read your email in all the detail I should have the first time and found what should likely be an easy fix (this is the 3rd time I&#39;ve written this email - probably shouldn&#39;t reply to the list at this hour!). </div><div><br></div><div>You&#39;re reading a version in from shea_util.ncl, which is an older, out of date, and unsupported version of pot_vort_isobaric (anything in shea_util.ncl is unsupported, technically - and note the file and line numbers in your error message). The safe guards for static stability that you&#39;ve likely seen Dennis and I discuss in previous posts have been fully implemented in the contributed.ncl version that became officially supported in the 6.3.0 release. I suggest you either comment out your load of shea_util.ncl (if possible) or ensure that you load contributed.ncl after you load shea_util.ncl - this should ensure the older function is redefined when you load contributed.ncl.</div><div><br></div><div>Hope that is an easy fix and that your calculations will work now.</div><div><br></div><div><br></div><div>Kyle</div><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Wed, Mar 9, 2016 at 6:57 PM Daniel Swain &lt;<a href="mailto:danielswain2@gmail.com" target="_blank">danielswain2@gmail.com</a>&gt; wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><span style="font-size:12.8px">Hello,</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">I&#39;m currently attempting to use the built-in NCL function to calculate potential vorticity (&quot;pot_vort_isobaric&quot;). Unfortunately, I am repeatedly getting a divide by zero error:</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">&quot;</span><br style="font-size:12.8px"><span style="font-size:12.8px">fatal:divide: Division by 0, Can&#39;t continue</span><br style="font-size:12.8px"><span style="font-size:12.8px">fatal:Div: operator failed, can&#39;t continue</span><br style="font-size:12.8px"><span style="font-size:12.8px">fatal:[&quot;Execute.c&quot;:8575]:</span><span style="font-size:12.8px">Execute: Error occurred at or near line 3892 in file $NCARG_ROOT/lib/ncarg/</span><span style="font-size:12.8px">nclscripts/csm/shea_util.ncl</span><br style="font-size:12.8px"><span style="font-size:12.8px">fatal:[&quot;Execute.c&quot;:8575]:</span><span style="font-size:12.8px">Execute: Error occurred at or near line 3909 in file $NCARG_ROOT/lib/ncarg/</span><span style="font-size:12.8px">nclscripts/csm/shea_util.ncl</span><br style="font-size:12.8px"><span style="font-size:12.8px">&quot;</span><br style="font-size:12.8px"><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I have confirmed that my original units are in hPa (thus the *100 hPa-&gt; Pa conversion should be correct), and that the original latitudes were north-&gt;south (so the lat flip should also be correct). I&#39;m assuming this occurring during the static stability calculation (as mentioned in previous ncl-talk discussions), but I&#39;m not sure whether there has yet been a resolution.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I&#39;ve attempted this with data from different years, but eventually a zero division error always crops up. A short sample script is below, and representative data files have been uploaded to the FTP site with the same names as below.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I&#39;m currently using NCL version 6.3.0.<br><br>Thanks very much for any advice!</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">~Daniel<br><br>&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot;<br><br>begin</div><div style="font-size:12.8px"><br>infile1 = addfile (&quot;<a href="http://air.2013.nc/" target="_blank">air.2013.nc</a>&quot;, &quot;r&quot;)<br>infile2 = addfile (&quot;<a href="http://uwnd.2013.nc/" target="_blank">uwnd.2013.nc</a>&quot;, &quot;r&quot;)<br>infile3 = addfile (&quot;<a href="http://vwnd.2013.nc/" target="_blank">vwnd.2013.nc</a>&quot;, &quot;r&quot;)<br><br>     U   = infile2-&gt;uwnd   ; (time,lev,lat,lon)<br>     V   = infile3-&gt;vwnd<br>     T   = infile1-&gt;air    ; K<br><br>     lev = T&amp;level  ; hPa<br>     lev = lev*100 ; convert units<br>     lev@units = &quot;Pa&quot;<br><br>     U   = U(:,:,::-1,:)    ; reorder to South -&gt; North<br>     V   = V(:,:,::-1,:)<br>     T   = T(:,:,::-1,:)<br><br>     lat = T&amp;lat<br>     gridType  = 0          ; Gaussian grid<br>     opt = 0<br>     pvort = pot_vort_isobaric(lev,U,V,T,lat, gridType, opt)<br><br>outfile1=addfile(&quot;<a href="http://pvort.2013.nc/" target="_blank">pvort.2013.nc</a>&quot;,&quot;c&quot;)<br>outfile1-&gt;pvort = pvort</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">end</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">&quot;</div></div></div></div>
_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
</blockquote></div></div>
<br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>