<div dir="ltr"><div>Hi All,<br><br>For a month now I have been having trouble overlay windbards on zoomed terrain with specified lat and lon in ncl.<span> I do not want the entire domain plotted with winds. If so, I would have used the multiOverlay.ncl script which works perfectly for many overlay for the entire domain. No images are being plotted with the script below. I'm not getting any fatal errors. I'm using NCL version 6.2.1. All I'm getting is the following; warning:wkImageFileName is not a resource in the given object<br>warning:wkImageFormat is not a resource in the given object.<br><br> </span>I would like some help with this script please.<span> </span>I looked online for a script to help with this (overlay on zoomed in terrain with specified lat and lon) but I’m having trouble finding it.<span>
</span><span>
</span>Any advice will be greatly appreciated. Thanks, Kerwyn<br><br></div>Script:<br><br>;*************************************************<br>; overlay_1.ncl<br>;<br>; Concepts illustrated:<br>; - Overlaying line contours on filled contours<br>; - Explicitly setting contour levels<br>; - Selecting a different color map<br>;<br>;*************************************************<br>;<br>; These files are loaded by default in NCL V6.2.0 and newer<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_21:00:<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><br> u_wind = wrf_user_intrp3d(u, p, "h", 650., 0.0, False)<br> v_wind = wrf_user_intrp3d(v, p, "h", 650., 0.0, False)<br> <br><br>; spd = (u_wind*u_wind + v_wind*v_wind)^(0.5) ;m/s<br>; spd@units = "Wind Speed"<br>; spd@units = "m/s"<br><br><br> wks = gsn_open_wks("png","test") ; send graphics to PNG file<br> gsn_define_colormap(wks,"BlAqGrYeOrRe")<br> <br> <br> res1 = True<br> res1@mpFillOn = False<br> res1@mpMaxLatF = 37.75 ; specify the plot domain<br> res1@mpMinLatF = 38.20 ; <br> res1@mpMinLonF = -120.00 ;<br> res1@mpMaxLonF = -119.10 ;<br> res1@mpOutlineOn = True ; turn the map outline on<br> res1@gsnDraw = False ; do not draw the plot<br> res1@gsnFrame = False ; do not advance the frame<br> res1@csnLinesOn = True<br> res1@tiMainString = a<br><br> res1@mpProjection = "CylindricalEquidistant" ;The default<br> res1@pmTickMarkDisplayMode = "Always"<br> res1@mpDataBaseVersion = "MediumRes"<br> res1@mpOutlineOn =True<br> res1@lbOrientation = "Vertical"<br> res1@tiMainOffsetYF = -0.03<br> res1@mpShapeMode = "FreeAspect"<br> res1@vpWidthF = 0.9<br> res1@vpHeightF = 0.9<br><br>; res@cnLevelSelectionMode = "ExplicitLevels" ; use explicit levels<br>; res@cnLevels = ispan(215,265,5) ; set the contour levels<br> res1@cnLineLabelsOn = False ; do not use line labels<br> res1@cnFillOn = True ; color fill<br> res1@cnLinesOn = False ; do not draw contour lines<br>; res@cnFillPalette = "BlueDarkRed18"<br><br> res1@gsnAddCyclic = False<br><br> map = wrf_map(wks, a, True)<br><br> contour = gsn_csm_contour_map(wks,hgt,res1) <br> <br> ;------wind vectors<br> res2 = True<br> res2@FieldTitle = "Winds"<br> res2@NumVectors = 47<br> res2@vcWindBarbLineThicknessF= 2.5<br> vector = wrf_vector(a, wks, u_wind, v_wind, res2)<br><br> wrf_map_overlay(wks,map,(/vector, contour/),True)<br> <br>end<br></div>