<div dir="ltr"><div class="gmail_default" style="font-size:small">I think you need to subscript your data arrays too.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you look at that olr.ncl script that I pointed you to earlier:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><a href="http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/SPECIAL/olr.ncl">http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/SPECIAL/olr.ncl</a><br></div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="">You'll see this code; note the "olr_zoom" below. This is the variable that's plotted, and not the original "olr":</div><div class="gmail_default" style=""><br></div><div class="gmail_default" style=""><div class="gmail_default"><font face="monospace, monospace">; We are interested in a zoomed area with the SW corner at 20N;90W, </font></div><div class="gmail_default"><font face="monospace, monospace">; and the NE corner at 30N;80W</font></div><div class="gmail_default"><font face="monospace, monospace">; So get the XY points of these points</font></div><div class="gmail_default"><font face="monospace, monospace"> lats = (/ 20.0, 30.0 /)</font></div><div class="gmail_default"><font face="monospace, monospace"> lons = (/ -93.0, -80.0 /)</font></div><div class="gmail_default"><font face="monospace, monospace"> loc = wrf_user_ll_to_ij(a, lons, lats, True)</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace">; loc(0,;) is west-east (x) ; loc(1,:) is south-north (y) </font></div><div class="gmail_default"><font face="monospace, monospace">; subtract one since we want to use it as an index in NCL</font></div><div class="gmail_default"><font face="monospace, monospace"> x_start = loc(0,0) - 1</font></div><div class="gmail_default"><font face="monospace, monospace"> x_end = loc(0,1) - 1</font></div><div class="gmail_default"><font face="monospace, monospace"> y_start = loc(1,0) - 1</font></div><div class="gmail_default"><font face="monospace, monospace"> y_end = loc(1,1) - 1</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> mpres1@ZoomIn = True ; set up map info for zoomed area</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres1@Xstart = x_start</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres1@Ystart = y_start</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres1@Xend = x_end</font></div><div class="gmail_default"><font face="monospace, monospace"> mpres1@Yend = y_end</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> olr = wrf_user_getvar(a,"OLR",-1) ; get olr</font></div><div class="gmail_default"><font face="monospace, monospace"> olr_zoom = olr(:,y_start:y_end,x_start:x_end) ; create a zoomed area</font></div><div class="gmail_default"><br></div></div><div class="gmail_default" style="font-size:small">You need to do something similar for your "tc" variable.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 21, 2016 at 9:52 AM, Illston, Bradley G. <span dir="ltr"><<a href="mailto:illston@ou.edu" target="_blank">illston@ou.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Mary and Will,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thank you so much for the help. I am getting closer, but things still seem a bit off after close inspection. My code is below. If I do not zoom (e.g. comment
out mpres@ZoomIn = True), I get the following image:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><a href="http://res.mesonet.org/~billston/phd/images/ncl-talk/original.png" target="_blank">http://res.mesonet.org/~billston/phd/images/ncl-talk/original.png</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">If I zoom, I get the following image:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><a href="http://res.mesonet.org/~billston/phd/images/ncl-talk/zoomed.png" target="_blank">http://res.mesonet.org/~billston/phd/images/ncl-talk/zoomed.png</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">While the “map” does zoom in, the WRF 2m air temperature field does not. You can see this by looking at the contour shapes in the NW corner, for example. I think
my code is getting very close, but just missing one final piece. Any ideas? Thank you so much for your assistance.<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Brad Illston<u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_-2693882033162241643__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">begin<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">;---Define colormap. First is background color, second is foreground color<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> colors = (/(/255, 255, 255/),(/0, 0, 0/),(/255, 255, 255/),(/088, 164, 074/),(/047,124,062/),(/055, 072, 114/),(/095,129,183/),(/094,165,212/),(/116,196,205/),(/135,099,162/),(/128,076,144/)/)
/ 255. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">;---Open WRF output file<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> a = addfile(wrf_filename,"r")<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> print(" NetCDF file = "+wrf_filename)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> print(" Output image = "+output_png)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> global_attnames = getvaratts(a) ;-- retrieve the global attributes from input file
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> do i=0,dimsizes(global_attnames)-1
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> print(global_attnames(i) + " = " + a@$global_attnames(i)$) ;-- print global attribute contents
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> end do
<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">;---Read temperature at first time step<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> tc = wrf_user_getvar(a,"T2",0)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> tc@long_name = "2m Air Temperature"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> tc@units = "C"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> tc=tc-273.15<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> wks = gsn_open_wks("png",output_png)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> gsn_define_colormap(wks,"WhiteBlueGreenYellowRed") ; choose colormap<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">; gsn_define_colormap(wks,colors)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">;---Resources for filled contour plot<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@cnFillOn = True
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@cnLinesOn = False<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@gsnMaximize = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@tiMainString = run_length + " Run (" + year + ") - " + run_date + " " + end_time + " UTC"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@Footer = False<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@FieldTitle = "2m Air Temperature"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@lbTitleOn = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@lbTitleString = ""<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@NoHeaderFooter = True ; Switch headers and footers off<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@cnLevelSelectionMode = "ExplicitLevels"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> res@cnLevels = (/10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25/)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">; res@ContourParameters = (/10,25,1/) ; Contour levels<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> contour = wrf_contour(a,wks,tc,res) ; Create contour plot<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> pltres = True ; Basic overlay plot options<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> pltres@PanelPlot = True ; Tells wrf_map_overlays not to remove overlays<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres = True ; Set map options<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@mpOutlineOn = True ; Turn on map outlines<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@mpFillOn = False ; Turn off map fill<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@mpDataBaseVersion = "Ncarg4_1"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@mpDataSetName = "Earth..2" ; For counties<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@mpOutlineBoundarySets = "GeophysicalAndUSStates"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@mpOutlineSpecifiers = (/"Land", "Oklahoma:counties"/)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@tiMainString = run_length + " Run (" + year + ") - " + run_date + " " + end_time + " UTC"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@gsnMaximize = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">; We are interested in a zoomed area so get the XY points of these points<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> lats = (/ 35.0, 36.0 /)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> lons = (/ -98.2, -96.8 /)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> loc = wrf_user_ll_to_ij(a, lons, lats, True)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">; loc(0,;) is west-east (x) ; loc(1,:) is south-north (y)
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">; subtract one since we want to use it as an index in NCL<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> x_start = loc(0,0) - 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> x_end = loc(0,1) - 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> y_start = loc(1,0) - 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> y_end = loc(1,1) - 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">; mpres@ZoomIn = True ; set up map info for zoomed area<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@Xstart = x_start<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@Ystart = y_start<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@Xend = x_end<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mpres@Yend = y_end<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">;---Create the contours over the WRF map (nothing will be drawn yet).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> plot = wrf_map_overlays(a,wks,contour,pltres,mpres)
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">;---Plot OKC Boundary<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> lnres = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> lnres@gsLineColor = "gray25"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> lnres@gsLineThicknessF = 2.0
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> okc_shp = gsn_add_shapefile_polylines(wks,plot,"resources/OKCCityLimit_outline.shp",lnres)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> polyres = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> polyres@gsMarkerIndex = 1 ; Filled circle<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> polyres@gsMarkerSizeF = 0.03<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> mesonet_points = gsn_add_shapefile_polymarkers(wks,plot,"resources/ok_mesonet_sites_active_20151014.shp",polyres)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> micronet_points = gsn_add_shapefile_polymarkers(wks,plot,"resources/OKC_Micronet.shp",polyres)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> draw(plot) ; This will draw the map and the shapefile outlines.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> frame(wks) ; Advance the frame<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">end<u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Mary Haley [mailto:<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>]
<br>
<b>Sent:</b> Thursday, April 14, 2016 1:41 PM<br>
<b>To:</b> Illston, Bradley G. <<a href="mailto:illston@ou.edu" target="_blank">illston@ou.edu</a>><br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>; Will Hobbs <<a href="mailto:will.hobbs@utas.edu.au" target="_blank">will.hobbs@utas.edu.au</a>><br>
<b>Subject:</b> Re: [ncl-talk] Zooming Functions Clarification<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Hi Brad,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">There are a few problems with the script in general.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">First, as Will pointed out, you are trying to set map resources when you create a contour plot. This is why you are getting errors.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">But, I do see that later you are calling wrf_map_overlays, which is where you want to apply the map resources. However, with the wrf_xxxx plotting scripts, you have to be careful about zooming in on the data when it's being done over a
map. The wrf_map_overlays procedure assumes that you are using the map projection that's provided on the WRF output file, and hence it doesn't really know anything about the lat/lon coordinates of your data.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If you then try to zoom in on your WRF data without telling NCL what part of your data actually corresponds to the area you are zooming in on, then your results are likely going to be incorrect.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">wrf_map_overlays recognizes a special "ZoomIn" resource that allows you to do map zooming. Please see the "olr.ncl" example at:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/SPECIAL/olr.htm" target="_blank">http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/SPECIAL/olr.htm</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The scripts on the "WRF debug" page also show how to use ZoomIn:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.ncl.ucar.edu/Applications/wrfdebug.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/wrfdebug.shtml</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If you don't want to use the wrf_contour/wrf_map_overlays plotting scripts, then you can plot your WRF data with gsn_csm_contour_map. We have some examples of this, and also show how to zoom in on your data. See wrf_gsn_3.ncl at:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.ncl.ucar.edu/Applications/wrfgsn.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/wrfgsn.shtml</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">--Mary<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Apr 13, 2016 at 9:47 PM, Will Hobbs <<a href="mailto:will.hobbs@utas.edu.au" target="_blank">will.hobbs@utas.edu.au</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black">Brad<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black">I'm not a WRF user so any suggestion here is just a guess. However, have you tried setting the resources trYMinF, trYMaxF etc instead of mpMaxLatF etc.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black">I would guess that wrf_contour() is not a map plotting function, so it wouldn't recognise the mp resources. As long as the array that you're plotting has lat/lon
coordinate dimensions the bounds set by the 'tr' resources should work fine.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black">Hope that helps<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black">Will<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">From:
</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"><Illston>, "Bradley G." <<a href="mailto:illston@ou.edu" target="_blank">illston@ou.edu</a>><br>
<b>Date: </b>Thursday, 14 April 2016 1:16 PM<br>
<b>To: </b>"<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>" <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
<b>Subject: </b>[ncl-talk] Zooming Functions Clarification<u></u><u></u></span></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="color:black">NCL Users,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">I am one to try and figure my problems on their own, but I am a bit stumped after working on this for a few days. I am trying to zoom my map in to a set
of bounding latitudes and longitudes in my domain to no avail. I kept trying various iterations utilizing ZoomIn or mpMinLatF/mpMinLonF/etc. I am not sure when you should use one and when you would use the other. Below is my latest script that works, but not
zoomed in. When I run it, I get the following warnings:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">warning:mpLimitMode is not a valid resource in /tair_24hr_2011_2008091502_contour at this time<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">warning:mpMinLonF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">warning:mpMaxLonF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">warning:mpMinLatF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">warning:mpMaxLatF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Am I mixing various gsn functions that is causing a confusion? Is there a preferred one for plotting basic WRF output (in NetCDF format) to a PNG file?
Any thoughts? Thank you so much.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Brad Illston<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">begin<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">;---Define colormap. First is background color, second is foreground color<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> colors = (/(/255, 255, 255/),(/0, 0, 0/),(/255, 255, 255/),(/088, 164, 074/),(/047,124,062/),(/055, 072, 114/),(/095,129,183/),(/094,165,212/),(/116,196,205/),(/135,099,162/),(/128,076,144/)/)
/ 255. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">;---Open WRF output file<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> a = addfile(wrf_filename,"r")<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> print(" NetCDF file = "+wrf_filename)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> print(" Output image = "+output_png)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">;---Read temperature at first time step<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> tc = wrf_user_getvar(a,"T2",0)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> tc@long_name = "2m Air Temperature"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> tc@units = "C"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> tc=tc-273.15<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> wks = gsn_open_wks("png",output_png)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> gsn_define_colormap(wks,"WhiteBlueGreenYellowRed") ; choose colormap<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">; gsn_define_colormap(wks,colors)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">;---Resources for filled contour plot<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@cnFillOn = True
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@cnLinesOn = False<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@gsnMaximize = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@tiMainString = run_length + " Run (" + year + ") - " + run_date + " " + end_time + " UTC"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@Footer = False<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@FieldTitle = "2m Air Temperature"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@lbTitleOn = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@lbTitleString = ""<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@NoHeaderFooter = True ; Switch headers and footers off<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@cnLevelSelectionMode = "ExplicitLevels"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@cnLevels = (/10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25/)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">; res@ContourParameters = (/10,25,1/) ; Contour levels<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@mpLimitMode = "LatLon"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@mpMinLatF = 35<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@mpMinLonF = -98<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@mpMaxLatF = 36<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> res@mpMaxLonF = -97<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> contour = wrf_contour(a,wks,tc,res) ; Create contour plot<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> pltres = True ; Basic overlay plot options<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> pltres@PanelPlot = True ; Tells wrf_map_overlays not to remove overlays<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> mpres = True ; Set map options<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> mpres@mpOutlineOn = True ; Turn on map outlines<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> mpres@mpFillOn = False ; Turn off map fill<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> mpres@mpDataBaseVersion = "Ncarg4_1"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> mpres@mpDataSetName = "Earth..2" ; For counties<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> mpres@mpOutlineBoundarySets = "GeophysicalAndUSStates"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> mpres@mpOutlineSpecifiers = (/"Land", "Oklahoma:counties"/)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> mpres@tiMainString = run_length + " Run (" + year + ") - " + run_date + " " + end_time + " UTC"<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> mpres@gsnMaximize = True<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">;---Create the contours over the WRF map (nothing will be drawn yet).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> plot = wrf_map_overlays(a,wks,contour,pltres,mpres)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">end<u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
<p style="line-height:10.0pt"><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:black"><br>
<br>
University of Tasmania Electronic Communications Policy (December, 2014). <br>
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained
in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
<u></u><u></u></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><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" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>