<div dir="ltr">Yes:<br><br><div>      return( [/pv, s, theta, dthdp, dudp, dvdp, dtdx, dtdy/])<br></div><div>to this:</div><div>      return( [/pv, s, theta/] )<br></div><div><br></div><div><br>I think the following is fine.<br><br>vr  = vr + conform(vr,f,nlt)     ; absolute vorticity  <br><br></div><div>Try the attached.<br><br>----<br></div><div>Place the attached script in the directory in which you are running the script.<br></div><div>*If* uou already habe 'load' statement, make sure that the following is the last 'load'<br><br></div><div>Cheers D <br></div><div><br></div><div>load "./pot_vort.ncl'<br></div><div>;---> your script follows<br><br></div><div>D<br></div><div><br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 9, 2018 at 4:50 PM, Adam Phillips <span dir="ltr"><<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@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">Hi Zhuxiao,<div>For b) It looks to me like there is an error in pot_vort_hybrid when one sets opt = 1, as the function tries to return a number of arrays that are not defined within the function. I would recommend copying pot_vort_isobaric from $NCARG_ROOT/lib/ncarg/ncl<wbr>scripts/csm/contributed.ncl to the top of your script and rename the function pot_vort_isobaric2. Alter your script to call pot_vort_isobaric2. Then, change the following line from this:</div><div>      return( [/pv, s, theta, dthdp, dudp, dvdp, dtdx, dtdy/])<br></div><div>to this:</div><div>      return( [/pv, s, theta/] )<br></div><div><br></div><div>And b) should be solved. </div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">For a) Make sure that the order of files specified in fils is correct. (Specifically, check that the times are increasing between the files.) If they are correct this might indicate another issue with the function.  If that's the case you can more easily debug the issue by creating the <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">pot_vort_isobaric2 function as stated above and putting in place a few printVarSummary statements above the offending line:</span></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">printVarSummary(vr)</span></span></div><div>printVarSummary(f)</div><div>print(nlt)</div><div>vr  = vr + conform(vr,f,nlt)     ; absolute vorticity   Line 15551 in contributed.<br></div><div><br></div><div>Hope that helps. I will file a bug report on issue b).</div><div>Adam</div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 9, 2018 at 4:07 PM, Zhuxiao Li - NOAA Affiliate <span dir="ltr"><<a href="mailto:zhuxiao.li@noaa.gov" target="_blank">zhuxiao.li@noaa.gov</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><div>Hi there,</div><div><br></div><div>I have got the following two problems when try to apply function of pot_vort_hybrid to calcualted Potential Vorticity by a simple NCL code as attached (please have a look at first). </div><div><br></div><div>I can get PV(only) for one time slot () with the setting 'opt = 0'.</div><div><br></div><div>While, a) when I want to cat the NetCDF files, for example cat 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">2013031700.nc4</span>

4</span> and  

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">2013031701.nc4 (see my NCL code), I got the following err message:</span></div><div>   </div><div>>warning:Aggregated dimension coordinate values are non-monotonic; check aggregated file >ordering<br></div><div><br></div><div>>fatal:conform: the dimension sizes of the second argument do not match those indicated by the >third argument</div><div>>fatal:["Execute.c":8640]:Exec<wbr>ute: Error occurred at or near line 15551 in file >/home/Adam.Kubaryk/local/lib/<wbr>ncarg/nclscripts/csm/contribut<wbr>ed.ncl</div><div>>fatal:["Execute.c":8640]:Exec<wbr>ute: Error occurred at or near line 43 in file >PV_wind_polar_WAM_4UT_3days_5<wbr>lev_SW_0317.ncl</div></div><div><br></div><div><br></div><div>b) if I use 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">2013031700.nc4 only, while set 'opt = 1', I get the following error message:</span></div><div><br></div><div>>fatal:Variable (dtdy) is undefined</div><div>>fatal:["Execute.c":8640]:Exec<wbr>ute: Error occurred at or near line 15562 in file >/home/Adam.Kubaryk/local/lib/<wbr>ncarg/nclscripts/csm/contribut<wbr>ed.ncl</div><div><br></div><div>>fatal:["Execute.c":8640]:Exec<wbr>ute: Error occurred at or near line 43 in file >PV_wind_polar_WAM_4UT_3days_5<wbr>lev_SW_0317.ncl</div><div><br></div><div>Could you tell me the reasons and give me the solution(s)?</div><div><br></div><div>Thanks very much in advance!</div><div>Zhuxiao</div><div><br></div><div><br></div><div>P.S. my NetCDF file format:</div><div><div><br></div><div>netcdf sigf371.2013030100 {</div><div>dimensions:</div><div>        lon = 192 ;</div><div>        lat = 94 ;</div><div>        lev = 1 ;</div><div>        lev_2 = 150 ;</div><div>        time = UNLIMITED ; // (1 currently)</div></div><div><div>        float p(time, lev_2, lat, lon) ;</div><div>                p:long_name = "pressure (Pa)" ;</div><div>                p:grid_type = "gaussian" ;</div><div>                p:_FillValue = -9.99e+33f ;</div><div>                p:missing_value = -9.99e+33f ;</div></div><div><br></div><div>By the way, I set gridType = 1,  I also tried gridType= 0, got the same error message for each issue.  </div><div><br></div><div><br></div><div><br></div><div><br></div></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_6614349078241231251gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/<wbr>asphilli/</a>   </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</font></span></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>