<div dir="ltr"><div class="gmail_default" style="font-size:small">Thanks for the cleaner script.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Your problem is with this line:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">
<p class=""> z_plane@lon2d = hgt@lat2d</p><p class="">You are assigning the "lat2d" attribute to a "lon2d" attribute. It should be:</p><p class="">
</p><p class=""> z_plane@lon2d = hgt@lon2d</p><p class="">--Mary</p><p class=""><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 11:01 PM, Kerwyn Texeira <span dir="ltr"><<a href="mailto:ktish86@gmail.com" target="_blank">ktish86@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"><div><div><div><div>Hi ncl-talk,<br><br></div>I'm still having the issue of not being able to plot geopotential height at 600hpa with winds overlaying zoomed in terrain. I am able to plot winds overlay zoomed in terrain but not winds and geopotential height contours overlaying zoomed in terrain at 600hpa. I have cleaned up my script as best as I can and re ran and still no results. I have attached a plot of what I'm getting. Does anyone have an idea what is missing from my script? Your help will be greatly appreciated. <br><br></div>Thanks,<br></div>Kerwyn<br><br></div>Script:<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/wrf/WRFUserARW.ncl"<br> <br>begin<br> a = addfile("./wrfout_d03_2014-01-11_22:40:<a href="http://00.nc" target="_blank">00.nc</a>","r")<br><br> it = 0<br> hgt = wrf_user_getvar(a, "HGT", it)<br> hgt@lat2d = wrf_user_getvar(a, "XLAT", it)<br> hgt@lon2d = wrf_user_getvar(a, "XLONG", it)<br> u = wrf_user_getvar(a, "ua", it)<br> v = wrf_user_getvar(a, "va", it)<br> p = wrf_user_getvar(a, "pressure", it)<br> qc = wrf_user_getvar(a, "QCLOUD", it)<br> qr = wrf_user_getvar(a, "QRAIN", it)<br> qs = wrf_user_getvar(a, "QSNOW", it)<br> qi = wrf_user_getvar(a, "QICE", it)<br> pre = wrf_user_getvar(a, "RAINNC", it)<br> z = wrf_user_getvar(a, "z", it)<br><br> u_wind = wrf_user_intrp3d(u, p, "h", 600., 0.0, False)<br> v_wind = wrf_user_intrp3d(v, p, "h", 600., 0.0, False)<br> qcl = wrf_user_intrp3d(qc, p, "h", 600., 0.0, False)<br> qrn = wrf_user_intrp3d(qr, p, "h", 600., 0.0, False)<br> qsn = wrf_user_intrp3d(qs, p, "h", 600., 0.0, False)<br> qice = wrf_user_intrp3d(qi, p, "h", 600., 0.0, False)<br> z_plane = wrf_user_intrp3d(z, p, "h", 600., 0.0, False)<br><br> qcl = qcl*1000<br> qrn = qrn*1000<br> qsn = qsn*1000<br> qice = qice*1000<br> precip = pre*0.03937<br> froz = qice + qsn<br> melt = qcl + qrn<br> <br> froz@lon2d = hgt@lon2d<br> froz@lat2d = hgt@lat2d<br> <br> melt@lon2d = hgt@lon2d<br> melt@lat2d = hgt@lat2d<br> <br> z_plane@lon2d = hgt@lat2d<br> z_plane@lat2d = hgt@lat2d <br><br> spd = (u_wind*u_wind + v_wind*v_wind)^(0.5) ;m/s<br> u_wind = u_wind*1.94384449<br> v_wind = v_wind*1.94384449<br><br> u_wind@lon2d = hgt@lon2d<br> u_wind@lat2d = hgt@lat2d<br><br> v_wind@lon2d = hgt@lon2d<br> v_wind@lat2d = hgt@lat2d<br><br> ; spd = spd*1.94384449<br> ; spd@units = "Wind Speed"<br> ; spd@units = "kts"<br> <br> wks_type = "png"<br> wks_type@wkWidth = 2500<br> wks_type@wkHeight = 2500<br> wks = gsn_open_wks(wks_type,"geo") ; send graphics to PNG file<br> <br> <br> gsn_define_colormap(wks,"matlab_jet") <br> <br> res = True<br> res@gsnDraw = False ; do not draw the plot<br> res@gsnFrame = False ; do not advance the frame<br> res@cnLineLabelsOn = False ; do not use line labels<br> res@cnFillOn = True ; color fill<br> res@cnLinesOn = False ; do not draw contour lines<br> res@tiMainString = ""<br> res@pmTickMarkDisplayMode = "Always"<br> res@mpProjection = "CylindricalEquidistant" ;The default<br> res@mpDataBaseVersion = "MediumRes"<br> res@mpOutlineOn =True<br> res@lbOrientation = "Vertical"<br> res@tiMainOffsetYF = -0.03<br> res@mpFillOn = False<br> res@mpOutlineOn = True ; turn the map outline on<br> res@mpMinLatF = 37.85 ; Zoomed in Lat and Lon<br> res@mpMaxLatF = 38.50<br> res@mpMinLonF = -120.0<br> res@mpMaxLonF = -119.35<br> res@gsnLeftString = ""<br> res@gsnCenterString = "Geopotential Height at 600 hpa on Jan 11 at 22:40UTC"<br> res@gsnStringFontHeightF = 0.020<br> res@gsnRightString = ""<br> res@gsnMaximize = True<br> res@mpShapeMode = "FreeAspect" <br> res@lbTitleString = "Terrain (m)"<br> res@lbTitlePosition = "Right"<br> res@lbTitleDirection = "Across"<br> res@lbTitleAngleF = 90.<br> res@lbTitleFontHeightF = 0.015<br> res@gsnAddCyclic = False <br><br> ;------wind vectors<br> res2 = True<br> res2@gsnDraw = False<br> res2@gsnFrame = False<br> res2@vcWindBarbLineThicknessF= 3.0<br> res2@vcRefLengthF= 0.018<br> res2@vcRefMagnitudeF= 10<br> res2@vcMinDistanceF = 0.05<br> res2@vcGlyphStyle = "WindBarb"<br> res2@gsnLeftString = ""<br> res2@gsnRightString = ""<br> res2@vcRefAnnoOn = False<br> res2@gsnAddCyclic = False<br><br><br>;------Melted<br>;res4 = True<br>;res4@cnLineColor = "Black"<br>;res4@gsnContourLineThicknessesScale = 2.0<br>;res4@cnLineLabelBackgroundColor = -1 ; transparent<br>;res4@cnInfoLabelOn = False<br>;res4@cnLevelSelectionMode = "ExplicitLevels"<br>;res4@cnLevels = (/0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0/)<br>;res4@cnLineLabelFontHeightF = 0.01<br>;res4@cnLineLabelDensityF =2 <br>;res4@cnLineLabelsOn = True<br>;res4@gsnAddCyclic = False<br>;liquid = gsn_csm_contour(wks,melt,res4)<br><br>;------Geopotential Height<br>res5 = True<br>res5@gsnDraw = False<br>res5@gsnFrame = False<br>res5@cnLineColor = "Black"<br>res5@gsnContourLineThicknessesScale = 3.0<br>res5@gsnAddCyclic = False<br>res5@gsnLeftString = ""<br>res5@gsnRightString = ""<br>res5@cnInfoLabelOn = False<br>geo = gsn_csm_contour(wks, z_plane, res5)<br><br><br>contour = gsn_csm_contour_map(wks,hgt,res)<br>vector = gsn_csm_vector(wks,u_wind,v_wind,res2)<br>overlay(contour, geo)<br>overlay(contour, vector)<br><br>plres = True<br>plres@gsLineColor = "blue"<br>plres@gsLineThicknessF = 3.0<br><br>lat = (/38.05, 38.05/)<br>lon = (/-120.10, -119.35/)<br><br>a = gsn_add_polyline(wks,contour,lon,lat,plres)<br><br>pltres = True<br>pltres@gsLineColor = "Black"<br>pltres@gsLineThicknessF = 3.0<br><br>lat1 = (/38.27, 38.27/)<br>lon1 = (/-120.10, -119.35/)<br><br>b = gsn_add_polyline(wks,contour,lon1,lat1,pltres)<br><br>draw(contour)<br>frame(wks)<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br><br><br>end<br> <br><br></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>