<div dir="ltr">Hi Evelyn,<div><br></div><div>I discovered a problem in the code snippet you sent me yesterday. The data is not actually interpolating to that new z; only the axis label is changing. See below. Do the arguments for the variables being plotted change as well? Right now I have them still referencing z</div><div><br></div><div><font face="monospace, monospace"> dbz_plane = wrf_user_intrp3d(dbz,z,"v",plane,0.,opts)</font></div><div><font face="monospace, monospace"> thes_plane = wrf_user_intrp3d(thes,z,"v",plane,0.,opts)</font></div><div><font face="monospace, monospace"> ww_plane = wrf_user_intrp3d(ww,z,"v",plane,0.,opts)</font></div><div> </div><div>but if I switch one to zz, I get a dimension mismatch error: <font face="monospace, monospace">fatal:Number of subscripts do not match number of dimensions of variable,(3) Subscripts used, (2) Subscripts expected</font></div><div><br></div><div>Is it right that both of the first arguments in the call to wrf_user_intrp3d when defining zz should be z?</div><div><br></div><div><div> <font face="monospace, monospace">zz = wrf_user_intrp3d(z,z,"v",plane,0.,opts) ; interpolate z -> zz</font></div></div><div><br></div><div>Thanks,</div><div>Ryan</div><div><br></div><div><img src="cid:ii_1549c4b0b24419ba" alt="Inline image 1" width="562" height="561"><br></div><div><img src="cid:ii_1549c4bca13c4f3a" alt="Inline image 2" width="562" height="558"><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 4:30 PM, Evelyn Grell - NOAA Affiliate <span dir="ltr"><<a href="mailto:evelyn.grell@noaa.gov" target="_blank">evelyn.grell@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 class="gmail_default" style="font-family:tahoma,sans-serif">Ryan,</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Glad to hear that it is working!</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I realize that the example is not exactly intuitive. I didn't see why z was interpolated at first, but it is necessary.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">You can actually change that hard-wired # of vertical levels if you go into the code in your </div><div class="gmail_default"><font face="tahoma, sans-serif">$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl</font><br></div><div class="gmail_default"><font face="tahoma, sans-serif">The limit of 100 doesn't give very good resolution in the boundary layer.</font></div><div class="gmail_default"><font face="tahoma, sans-serif">Alternatively, you can limit the number of levels that you send to the interpolation....</font></div><div class="gmail_default">But for now, enjoy your success!</div><span class="HOEnZb"><font color="#888888"><div class="gmail_default"><br></div><div class="gmail_default">Evelyn</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 12:12 PM, Ryan Connelly <span dir="ltr"><<a href="mailto:rconne01@gmail.com" target="_blank">rconne01@gmail.com</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 Evelyn,<div><br></div><div>This worked. Thank you! Your comments were especially helpful.</div><span><font color="#888888"><div><br></div><div>Ryan</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 11:28 AM, Evelyn Grell - NOAA Affiliate <span dir="ltr"><<a href="mailto:evelyn.grell@noaa.gov" target="_blank">evelyn.grell@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 class="gmail_default" style="font-family:tahoma,sans-serif">Ryan,</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Your dbz array has been vertically interpolated, using <span style="font-family:arial,sans-serif">wrf_user_intrp3d. This routine has a hard-wired number of vertical levels set to 100. </span></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default">Since you want to plot from 0-10 km, you should follow the example for a limited vertical extent:</div><div class="gmail_default"><a href="http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/CROSS_SECTION/wrf_CrossSection4.htm" target="_blank"> http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/CROSS_SECTION/wrf_CrossSection4.htm</a></div><div class="gmail_default">in which your height (z) is also vertically interpolated to these 100 levels. If you follow what happens to zz in the online example, I think you will get what you want. I have extracted the required lines and added a few comments to what they have already.</div><div class="gmail_default"><br></div><div class="gmail_default"><pre> ; get height info for labels
zmin = 0.
zmax = 10. ; We are only interested in the first 10km
nz = floattoint(zmax/2 + 1) ; nz = # of tick marks (you want 6)</pre><pre> </pre><pre><span style="font-family:arial,sans-serif"> ; Find the index where 10km is - only need to do this once</span><br></pre><pre>
zz = wrf_user_intrp3d(z,z,"v",plane,angle,opts) ; interpolate z -> zz
b = ind(zz(:,0) .gt. zmax*1000. ) ; get 1st index above zmax
zspan = b(0) - 1 <span style="font-family:arial,sans-serif"> </span><font face="monospace, monospace"> ; level index to use</font></pre><pre><font face="monospace, monospace"> </font><span style="font-family:arial,sans-serif"> </span><span style="font-family:monospace,monospace"> delete(zz)</span></pre><pre> delete(b)
<br></pre><pre><span style="font-family:arial,sans-serif">.....</span><br></pre><pre><span style="font-family:arial,sans-serif"> </span><font face="monospace, monospace"> opts_xy@tmYLValues = fspan(0,zspan,nz) ; Create tick marks</font><br></pre><pre> opts_xy@tmYLLabels = sprintf("%.1f",fspan(zmin,zmax,nz)) ; Create labels</pre><pre>Then when you actually do the plotting, you must set the max index to limit the vertical dimension:</pre><pre> contour_dbz = wrf_contour(a,wks,dbz_plane(0:zspan,:),opts_xy)</pre><pre>Good luck,</pre><pre>Evelyn</pre><pre><br></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Sun, May 8, 2016 at 8:22 PM, Ryan Connelly <span dir="ltr"><<a href="mailto:rconne01@gmail.com" target="_blank">rconne01@gmail.com</a>></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>I produce a vertical plane of, in this case, simulated reflectivity. I want to then manually define the y axis (in this case z) to have tick marks every 2 km from 0 to 10 km. This is proving surprisingly difficult. </div><div><br></div><div>This WRF run has 39 vertical levels, yet somehow a PrintVarSummary of the newly-created plane (below) reveals that its vertical extent is "100". 100 whats? Not 100 vertical levels, not 100 meters or 100 km, not 100 hPa...</div><div><br></div><div>I figured out how to use the tmYLValues and tmYLLabels options in xy plotting resources (also below) to define where to put tick marks and what to label them, to get me the 2-4-6-8-10 that I want, <b>but my problem is: how do I get them to match the actual vertical coordinate of the data (meters or km)?</b> Right now, I can put in any numbers I want and it'll put them there, but the contours don't move, so the actual height of the data is not changing, and remains unknown.</div><div><br></div><div><div><font face="monospace, monospace">Variable: dbz_plane</font></div><div><font face="monospace, monospace">Type: float</font></div><div><font face="monospace, monospace">Total Size: 60400 bytes</font></div><div><font face="monospace, monospace"> 15100 values</font></div><div><font face="monospace, monospace">Number of Dimensions: 2</font></div><div><font face="monospace, monospace">Dimensions and sizes: [Vertical | 100] x [Horizontal | 151]</font></div><div><font face="monospace, monospace">Coordinates:</font></div><div><font face="monospace, monospace">Number Of Attributes: 4</font></div><div><font face="monospace, monospace"> _FillValue : 9.96921e+36</font></div><div><font face="monospace, monospace"> units : dBZ</font></div><div><font face="monospace, monospace"> description : Reflectivity</font></div><div><font face="monospace, monospace"> Orientation : Cross-Section: (27,254) to (142,156)</font></div><div><br></div><div>****************************************************</div><div><br></div><div><div><font face="monospace, monospace"> ; Options for XY Plots</font></div><div><font face="monospace, monospace"> opts_xy = res</font></div><div><font face="monospace, monospace"> opts_xy@tiYAxisString = "Height (km)"</font></div><div><font face="monospace, monospace"> opts_xy@cnMissingValPerimOn = True</font></div><div><font face="monospace, monospace"> opts_xy@cnMissingValFillColor = 0</font></div><div><font face="monospace, monospace"> opts_xy@cnMissingValFillPattern = 11</font></div><div><font face="monospace, monospace"> opts_xy@tmYLMode = "Explicit"</font></div><div><font face="monospace, monospace"> ;opts_xy@tmYLValues = fspan(0,100,6) ; Create tick marks</font></div><div><font face="monospace, monospace"> ;opts_xy@tmYLLabels = fspan(0,10,6) ; Create labels</font></div><div><font face="monospace, monospace"> opts_xy@tiXAxisFontHeightF = 0.020</font></div><div><font face="monospace, monospace"> opts_xy@tiYAxisFontHeightF = 0.020</font></div><div><font face="monospace, monospace"> opts_xy@tmXBMajorLengthF = 0.02</font></div><div><font face="monospace, monospace"> opts_xy@tmYLMajorLengthF = 0.02</font></div><div><font face="monospace, monospace"> opts_xy@tmYLLabelFontHeightF = 0.015</font></div><div><font face="monospace, monospace"> opts_xy@PlotOrientation = dbz_plane@Orientation</font></div></div><div><br></div><div><br></div><div>Thanks,</div><div>Ryan</div><span><font color="#888888"><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></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>