Hi,
There was a thread about this previously, but the answer was supposedly
"attached" in a way that I can not see it. I am thus re-asking it in the
hopes that I can find a solution to my problem. The old thread is here:
http://www.ncl.ucar.edu/Support/talk_archives/2012/3174.html#start
In a nutshell, I am trying to "zoom in" on an area in my principal WRF
domain and plot 10-m wind vectors. I get the map to plot correctly in the
background, but the vectors that are plotted are those of the principal
domain.
How can I get the vectors to correctly plot in the area I've selected?
Thanks!
begin
; target date
year="2012"
month="07"
day="11"
; options
domain=3
Plot=True
; open the WRF file
wrfDir="/data/r009/user/daniel/WRFV3.4.1/"+year+"/run_"+month+"/"
wrfName="wrfout_d0"+domain+"_"+year+"-"+month+"-"+day+"_12-00-00.nc"
wrfout=wrfDir+wrfName
print("Opening file: "+wrfout+" ...")
a = addfile(wrfout,"r")
; 10-m u, v component wind
u10 = a->U10 ; (time, south_north, west_east)
v10 = a->V10
lat2d = a->XLAT(0,:,:) ; time invariant
lon2d = a->XLONG(0,:,:)
times = chartostring(a->Times)
ntim = dimsizes(times)
if (Plot) then
wks = gsn_open_wks("ps","stream") ; open a ps file
res = True ; plot mods desired
res@gsnAddCyclic = False
res@mpOutlineDrawOrder = "PostDraw" ; draw continental outline last
minlon = -119.142151
maxlon = -116.291199
minlat = 33.56886
maxlat = 34.474864
; res@vfXArray = lon2d
; res@vfYArray = lat2d
res@tfDoNDCOverlay = True
res@mpProjection = "LambertConformal"
res@mpLambertParallel1F = a@TRUELAT1
res@mpLambertParallel2F = a@TRUELAT2
res@mpLambertMeridianF = a@CEN_LON
res@mpLimitMode = "LatLon"
res@mpMinLonF = minlon ;
res@mpMaxLonF = maxlon;
res@mpMinLatF = minlat;
res@mpMaxLatF = maxlat;
res@vfYCStartV = minlat ; Define lat/lon corners
res@vfXCStartV = minlon ;for vector plot.
res@vfXCEndV = maxlon
res@vfYCEndV = maxlat
res@gsnPaperOrientation = "portrait"
res@gsnMaximize = True
res@tfDoNDCOverlay = True
res@vcLevelSelectionMode = "ManualLevels"
res@vcMinLevelValF = 0.5
res@vcMaxLevelValF = 7.0
res@vcLevelSpacingF = 0.5
res@vcMinDistanceF = 0.017 ; thin out vectors
res@vcRefMagnitudeF = 5.0 ; define vector ref mag
res@vcRefLengthF = 0.045 ; define length of vec
ref
;
; Annotation info for vectors.
;
res@vcRefAnnoZone = 4
res@vcRefAnnoFont = "Helvetica-Bold"
res@vcRefAnnoFontColor = "Black"
res@vcRefAnnoString1 = "$VMG$ ms~S~-1~N~"
res@vcRefAnnoString2On = False
res@vcRefAnnoBackgroundColor = "LightGray"
res@vcRefAnnoPerimOn = False
res@mpDataBaseVersion = "Medium"
res@mpOutlineBoundarySets = "GeophysicalAndUSStates"
res@mpDataBaseVersion = "Ncarg4_1"
res@mpDataSetName = "Earth..2"
res@mpFillOn = False ; turn off map fill
res@mpOutlineOn = True
res@mpOutlineSpecifiers = (/"Land","California"/)
res@mpMaskOutlineSpecifiers = (/"water"/)
do ihr = 0, ntim-1
res@tiMainString = "WRF-ARW 10-m winds"; title
res@gsnLeftString = times(ihr)+" local time"
plot = gsn_csm_vector_map (wks, u10(ihr,:,:), v10(ihr,:,:), res)
end do
end if
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 24 15:26:27 2013
This archive was generated by hypermail 2.1.8 : Fri Nov 01 2013 - 08:58:14 MDT