<div dir="ltr">Hi Mary,<div><br></div><div>That shows that dTdx is the problem.  (dTdx is first, dTdy second:)</div><div><br></div><div><div><font face="monospace, monospace">(0)<span class="" style="white-space:pre">        </span>min=-inf   max=inf</font></div><div><font face="monospace, monospace">(0)<span class="" style="white-space:pre">        </span>min=-24.1597   max=15.1911</font></div><br>I&#39;ll work on Dennis&#39;s suggestion now.</div><div><br></div><div>Ryan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 20, 2016 at 11:59 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><div><div><div>NOTE: I have not looked at this in detail.<br><br>[1] <br></div><div>You could not use &#39;advect_variable&#39; because it requires &quot;[t]he array <b>must be global and ordered south to north</b>.&quot; Also, this assumes a rectilinear grid (eg: fixed or gaussian)<br><br></div><div>Your data are not global   :-(<br></div><div>Yourhorizontal grid is not rectilinear.<br></div><div><br></div><div>Note: I could change &#39;&#39;advect_variable&quot; which uses spherical harmonics (hence, the global grid requirement) to derive the horizontal and latitudinal gradients tusing the 6.4.0<br>     <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/grad_latlon_cfd.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Contributed/grad_latlon_cfd.shtml</a><br></div><div>BUT that would take a day or two. <br>  </div><div>[2]<br>center_finite_diff  &quot;the issue&quot;   ..  yes and no<br><br></div>The error occurs in center_finite_diff but the issue is, I speculate, the arguments. Specifically, the use of lat and lon<br><br>====<span class=""><br><div><font face="monospace, monospace">    </font><span style="font-family:monospace,monospace">lon = wrf_user_getvar(a,&quot;lon&quot;,it)      <br></span></div><div><font face="monospace, monospace">    lat = wrf_user_getvar(a,&quot;lat&quot;,it)</font></div></span><font face="monospace, monospace"><span class=""><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div>; Interpolate to isobaric planes</div><div><br></div><div>      pressure = 850.</div><div><br></div><div>      tc_plane = wrf_user_intrp3d(tc,p,&quot;h&quot;,pressure,0.,False)</div><div>      z_plane  = wrf_user_intrp3d(z_dec,p,&quot;h&quot;,pressure,0.,False)</div><div>      u_plane  = wrf_user_intrp3d( u,p,&quot;h&quot;,pressure,0.,False)</div><div>      v_plane  = wrf_user_intrp3d( v,p,&quot;h&quot;,pressure,0.,False)</div><div><br></div><div><br></div><div>; Define variables needed to calculate temp advection<br></div><div><br></div><div>      dTdx = center_finite_diff_n(tc_plane,lon,False,0,0)</div><div>      dTdy = center_finite_diff_n(tc_plane,lat,False,0,0)</div></span><div>===<br></div></font><br></div>Maybe, <br><br><font face="monospace, monospace"><div><br></div><div>      dTdx = center_finite_diff_n(tc_plane,lon,False,0,1)  ; &lt;==<br></div><div>      dTdy = center_finite_diff_n(tc_plane,lat,False,0,0)<br><br></div></font>Or<font face="monospace, monospace"> [281] x [353]=&gt;nlat,mlon<br><br></font>            <font face="monospace, monospace">dTdx = center_finite_diff_n(tc_plane,lon(nlat/2,:),False,0,0)<br>      </font><font face="monospace, monospace">dTdy = center_finite_diff_n(tc_plane,lat(:,mlon/2),False,0,0)<br><br></font></div><font face="monospace, monospace">Note that NCL&#39;s &#39;dimension reduction&#39; (elimination of degenerate dimensions), </font><font face="monospace, monospace">lon(nlat/2,:) and </font><font face="monospace, monospace">lat(:,mlon/2) are one dimensional.<br></font></div><font face="monospace, monospace">Use printVarSummary( </font><font face="monospace, monospace">lon(nlat/2,:) ) to verify<br></font><div><div><div>       <br>[3]<br><br></div><div>[2] is a thumb in the dike approach. I think it would be best (if possible) to calculate<br><br></div><div>      lon_plane = <br></div><div>      lat_plane  =<br><br>       <font face="monospace, monospace">dTdx = center_finite_diff_n(tc_plane,lon_plane,False,0,0)<br>   </font><font face="monospace, monospace">dTdy = center_finite_diff_n(tc_plane,lat_plane,False,0,0)<br><br>[4]<br></font></div><div><font face="monospace, monospace">Maybe you could send a sample filw (one only) to<br><br></font></div><div><font face="monospace, monospace">ftp <a href="http://ftp.cgd.ucar.edu" target="_blank">ftp.cgd.ucar.edu</a><br></font></div><div><font face="monospace, monospace">anonymous<br></font></div><div><font face="monospace, monospace">your_email<br></font></div><div><font face="monospace, monospace">cd incoming<br></font></div><div><font face="monospace, monospace">put .....<br></font></div><div><font face="monospace, monospace">quit<br><br></font></div><div><font face="monospace, monospace">then let ncl_talk know the name of the file.<br></font></div><div><font face="monospace, monospace"></font></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 4:21 PM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@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 class="gmail_default" style="font-size:small">Hi Ryan,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">That makes sense why you can&#39;t upgrade.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">As for the &quot;inf&quot;, this is definitely an issue. To further determine where the problem is, I suggest doing a printMinMax on the individual variables in the calculation:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">  printMinMax(dTdx,0)</div><div class="gmail_default" style="font-size:small">  printMinMax(dTdy,0)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">  etc.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You may want to do this on every variable that you are getting with &quot;wrf_user_getvar&quot; to make sure those all look okay.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If it looks like center_finite_diff is the issue, then revisit the documentation to make sure all the input parameters are being input correctly:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/center_finite_diff.shtml" target="_blank">http://www.ncl.ucar.edu/Document/Functions/Built-in/center_finite_diff.shtml</a><span><font color="#888888"><br></font></span></div><span><font color="#888888"><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 3:53 PM, Ryan Connelly <span dir="ltr">&lt;<a href="mailto:rconne01@gmail.com" target="_blank">rconne01@gmail.com</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 Mary,<div><br></div><div>I use NCL that&#39;s installed on a shared server where WRF is configured.  I don&#39;t suspect I have permissions to remove an old version.  I recently updated to 6.3.0 on my local machine, but then I have to copy the wrfout over, which is a bit time-consuming since I&#39;m running a triple nest down to 1.333 km!  :O</div><div><br></div><div>These extra commands that you suggested certainly give a clue that I&#39;m not calculating things right:</div><div><br></div><div><div><font face="monospace, monospace">Variable: temp_adv</font></div><div><font face="monospace, monospace">Type: float</font></div><div><font face="monospace, monospace">Total Size: 396772 bytes</font></div><div><font face="monospace, monospace">            99193 values</font></div><div><font face="monospace, monospace">Number of Dimensions: 2</font></div><div><font face="monospace, monospace">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[281] x [353]</font></div><div><font face="monospace, monospace">Coordinates: </font></div><div><font face="monospace, monospace">Number Of Attributes: 1</font></div><div><font face="monospace, monospace">  _FillValue :<span style="white-space:pre-wrap">        </span>9.96921e+36</font></div><div><font face="monospace, monospace">(0)<span style="white-space:pre-wrap">        </span>min=-inf   max=inf</font></div></div><div><br></div><div><br></div><div>281x353 is my grid size, so that&#39;s good, but the infinities probably are not...</div><div><br></div><div>Thanks,</div><div>Ryan</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 10:38 AM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@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 class="gmail_default" style="font-size:small">Hi Ryan,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Is there a reason why you don&#39;t want to upgrade from V6.1.2? The version you have is over 3 years old.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I can&#39;t be sure of why your temp_adv variable is not plotting, without actually being able to run the script.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However, rather than printing the whole temp_adv array, what does the following report:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">printVarSummary(temp_adv)</div><div class="gmail_default" style="font-size:small">printMinMax(temp_adv,0)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sometimes this will give you a clue where the problem is, for example, your min/max values are off scale, or the size of the array is not what you were expecting.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can also try plotting temp_adv with a basic contour plot call:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">    plot = gsn_csm_contour(wks,temp_adv,False)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">just to make sure that the problem isn&#39;t with wrf_contour itself.</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></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Apr 18, 2016 at 12:49 PM, Ryan Connelly <span dir="ltr">&lt;<a href="mailto:rconne01@gmail.com" target="_blank">rconne01@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi,<div><br></div><div>Running 6.1.2, so can&#39;t use advect_variable without upgrading.  So instead I have...</div><div><br></div><div><div><font face="monospace, monospace">;do it = 12,30,3             ; TIME LOOP</font></div><div><font face="monospace, monospace">  do it = 12,13,1</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">    print(&quot;Working on time: &quot; + times(it) )</font></div><div><font face="monospace, monospace">    res@TimeLabel = times(it)   ; Set Valid time to use on plots</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</font></div><div><font face="monospace, monospace">; First get the variables we will need</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">    tc = wrf_user_getvar(a,&quot;tc&quot;,it)      ; 3D tc</font></div><div><font face="monospace, monospace">    td = wrf_user_getvar(a,&quot;td&quot;,it)      ; 3D td</font></div><div><font face="monospace, monospace">    u  = wrf_user_getvar(a,&quot;ua&quot;,it)      ; 3D U at mass points</font></div><div><font face="monospace, monospace">    v  = wrf_user_getvar(a,&quot;va&quot;,it)      ; 3D V at mass points</font></div><div><font face="monospace, monospace">    p  = wrf_user_getvar(a, &quot;pressure&quot;,it) ; pressure is our vertical coordinate</font></div><div><font face="monospace, monospace">    z  = wrf_user_getvar(a,&quot;z&quot;,it)       ; Full model height in meters</font></div><div><font face="monospace, monospace">       z_dec = z/10.                     ; Height in decameters</font></div><div><font face="monospace, monospace">    </font><span style="font-family:monospace,monospace">lon = wrf_user_getvar(a,&quot;lon&quot;,it)</span></div><div><font face="monospace, monospace">    lat = wrf_user_getvar(a,&quot;lat&quot;,it)</font></div></div><div><font face="monospace, monospace"><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div>; Interpolate to isobaric planes</div><div><br></div><div>      pressure = 850.</div><div><br></div><div>      tc_plane = wrf_user_intrp3d(tc,p,&quot;h&quot;,pressure,0.,False)</div><div>      z_plane  = wrf_user_intrp3d(z_dec,p,&quot;h&quot;,pressure,0.,False)</div><div>      u_plane  = wrf_user_intrp3d( u,p,&quot;h&quot;,pressure,0.,False)</div><div>      v_plane  = wrf_user_intrp3d( v,p,&quot;h&quot;,pressure,0.,False)</div><div><br></div><div><br></div><div>; Define variables needed to calculate temp advection<br></div><div><br></div><div>      dTdx = center_finite_diff_n(tc_plane,lon,False,0,0)</div><div>      dTdy = center_finite_diff_n(tc_plane,lat,False,0,0)</div><div><br></div><div>      temp_adv = u_plane*dTdx + v_plane*dTdy<br></div><div><br></div><div>      print(temp_adv)</div><div><br></div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div><br></div><div>    ; Plotting options for Tc</div><div>      opts = res</div><div>      print(&quot;Defined ops&quot;)</div><div>      opts@cnFillOn = True</div><div>      print(&quot;Turned fill on&quot;)</div><div>      opts@cnLabelMasking = True</div><div>      opts@cnInfoLabelOn = False</div><div>      opts@cnLineLabelPerimOn = False</div><div>      opts@ContourParameters = (/ -60., 60., 3./)</div><div>      print(&quot;Accepted contour parameters&quot;)</div><div>      ;opts@gsnSpreadColorEnd = -3  ; End third from the last color in color map</div><div>      contour_tc = wrf_contour(a,wks,temp_adv,opts) ; &lt;- Breaks right here</div><div>      print(&quot;wrf_contour called&quot;)</div><div>      delete(opts)</div><div>      print(&quot;opts deleted&quot;)</div><div><br></div><div>      print(&quot;Got past plotting options for Tc&quot;)</div><div><br></div><div><br></div><div><div>; MAKE PLOTS</div><div>      ;plot = wrf_map_overlays(a,wks,(/contour_tc,contour_td,contour_z/),pltres,mpres)</div><div>      plot = wrf_map_overlays(a,wks,(/contour_tc/),pltres,mpres)</div><div>      ;plot = wrf_map_overlays(a,wks,(/contour_td,vector/),pltres,mpres)</div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div><br></div><div>  end do        ; END OF TIME LOOP</div></div><div><br></div><div><br></div></font></div><div>When it prints out the full grid of temp_adv, or random indexes of the array, I get reasonable values and no reason to suspect the grid is undefined anywhere.  Yet as you can see from my print statements, the call to wrf_contour fails.  It does not throw an error; it just hangs up.  I checked with just tc_plane instead, and that completed fine, so it has to be an issue with the temp_adv grid I calculated.</div><div><br></div><div>Thanks,</div><div>Ryan<span><font color="#888888"><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><font size="1">Ryan Connelly</font></div><div dir="ltr"><div dir="ltr" style="font-size:12.8px"><font color="#000000"><font size="1">M.S. Student in Atmospheric Sciences, </font><span style="font-size:x-small">Stony Brook University</span><br></font></div><div dir="ltr" style="font-size:12.8px"><div><font color="#000000"><font size="1">B.S. in Meteorology with Minors in Mathematics and GIS, </font><span style="font-size:x-small">Valparaiso University</span></font></div></div><div><a href="mailto:rconne01@gmail.com" style="font-size:x-small" target="_blank">rconne01@gmail.com</a><br></div><div><font size="1"><a href="mailto:ryan.connelly@stonybrook.edu" target="_blank">ryan.connelly@stonybrook.edu</a></font></div></div></div></div></div></div></div></div></div></div>
</font></span></div></div>
<br></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>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><font size="1">Ryan Connelly</font></div><div dir="ltr"><div dir="ltr" style="font-size:12.8000001907349px"><font color="#000000"><font size="1">M.S. Student in Atmospheric Sciences, </font><span style="font-size:x-small">Stony Brook University</span><br></font></div><div dir="ltr" style="font-size:12.8000001907349px"><div><font color="#000000"><font size="1">B.S. in Meteorology with Minors in Mathematics and GIS, </font><span style="font-size:x-small">Valparaiso University</span></font></div></div><div><a href="mailto:rconne01@gmail.com" style="font-size:x-small" target="_blank">rconne01@gmail.com</a><br></div><div><font size="1"><a href="mailto:ryan.connelly@stonybrook.edu" target="_blank">ryan.connelly@stonybrook.edu</a></font></div></div></div></div></div></div></div></div></div></div>
</div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<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>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><font size="1">Ryan Connelly</font></div><div dir="ltr"><div dir="ltr" style="font-size:12.8000001907349px"><font color="#000000"><font size="1">M.S. Student in Atmospheric Sciences, </font><span style="font-size:x-small">Stony Brook University</span><br></font></div><div dir="ltr" style="font-size:12.8000001907349px"><div><font color="#000000"><font size="1">B.S. in Meteorology with Minors in Mathematics and GIS, </font><span style="font-size:x-small">Valparaiso University</span></font></div></div><div><a href="mailto:rconne01@gmail.com" style="font-size:x-small" target="_blank">rconne01@gmail.com</a><br></div><div><font size="1"><a href="mailto:ryan.connelly@stonybrook.edu" target="_blank">ryan.connelly@stonybrook.edu</a></font></div></div></div></div></div></div></div></div></div></div>
</div>