<div dir="ltr"><div><div><div><div>Kyle is correct. <br><br></div>Basically the 6.3.0 shea_util.ncl had ''back-door' interfaces to older versions pot_vort_isobaric and pot_vort_hybrid. These were used for old testing. Unfortunately, they were not deleted. As 'they' ...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 "./contributed.ncl_640"<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 "./contributed.ncl_640"<br>load "./shea_util.ncl_640"<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"><<a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.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">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've written this email - probably shouldn't reply to the list at this hour!). </div><div><br></div><div>You'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'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 <<a href="mailto:danielswain2@gmail.com" target="_blank">danielswain2@gmail.com</a>> 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'm currently attempting to use the built-in NCL function to calculate potential vorticity ("pot_vort_isobaric"). 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">"</span><br style="font-size:12.8px"><span style="font-size:12.8px">fatal:divide: Division by 0, Can't continue</span><br style="font-size:12.8px"><span style="font-size:12.8px">fatal:Div: operator failed, can't continue</span><br style="font-size:12.8px"><span style="font-size:12.8px">fatal:["Execute.c":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:["Execute.c":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">"</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-> Pa conversion should be correct), and that the original latitudes were north->south (so the lat flip should also be correct). I'm assuming this occurring during the static stability calculation (as mentioned in previous ncl-talk discussions), but I'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'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'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>"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br><br>begin</div><div style="font-size:12.8px"><br>infile1 = addfile ("<a href="http://air.2013.nc/" target="_blank">air.2013.nc</a>", "r")<br>infile2 = addfile ("<a href="http://uwnd.2013.nc/" target="_blank">uwnd.2013.nc</a>", "r")<br>infile3 = addfile ("<a href="http://vwnd.2013.nc/" target="_blank">vwnd.2013.nc</a>", "r")<br><br> U = infile2->uwnd ; (time,lev,lat,lon)<br> V = infile3->vwnd<br> T = infile1->air ; K<br><br> lev = T&level ; hPa<br> lev = lev*100 ; convert units<br> lev@units = "Pa"<br><br> U = U(:,:,::-1,:) ; reorder to South -> North<br> V = V(:,:,::-1,:)<br> T = T(:,:,::-1,:)<br><br> lat = T&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("<a href="http://pvort.2013.nc/" target="_blank">pvort.2013.nc</a>","c")<br>outfile1->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">"</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>