<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div id="inlineImage0" style="display: inline-block"><script type="jsv#2667_"></script> <span contenteditable="true">Hello<br><br>I wanted to place two wind vector plots in one figure, see below.<br>For the 1st plot, the black wind vectors are nicely in the map, but for the 2nd plot, red wind vectors are everywhere in the wks. <br>How can I control the wind vectors for the 2nd plot to be in the map?<br> </span> <div initwidth="715" initheight="684" class="inlineImage" style="display: inline-block" unselectable="on" contenteditable="false"><img src="cid:inlineImage0" height="684" width="715"></div> <span contenteditable="true"><br>Here is my script:<br></span><br><pre>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
do idomain = 2,2; 3,3; 1,1;3
fmap = addfile("/nsftor1/xhu/2011SeptDFW/2011Aug_Irene/WRFV3.6.1/wrffnl2dWSM6_UCM_YSU.2011082500/wrfinput_d0"+idomain+".nc","r")
figurename_xhu = "wrf_d0"+idomain+"_MADISmetarWindVector_24"; +nfiles
wks = gsn_open_wks("eps" ,figurename_xhu) ; eps,pdf,x11,ncgm,eeps
gsn_define_colormap(wks,"cosam") ; select color map
idate_pick = (/8, 27/)
do idaten = 0, 1; 7, 8 ; 31,31; 26,29
idate = idate_pick(idaten)
system("rm 2011*00")
if (idate.gt.9) then
system("ln -sf /nsftor/xhu/WRF-UCM/MADIS/madis.201108/madis.201108"+idate+"/metar/2011*00 .")
else
system("ln -sf /nsftor/xhu/WRF-UCM/MADIS/madis.201108/madis.2011080"+idate+"/metar/2011*00 .")
end if
folder = "20110827"
files = systemfunc("ls 2011*00")
do nfiles = 12,12; 0 , dimsizes(files)-1
filename =files(nfiles);
f=addfile(filename+".nc","r")
file_site_char= stringtochar(filename)
time_string = charactertostring (file_site_char(0:12))
res = True ; plot mods desired
res@vpWidthF = 0.4
if (idaten.eq.0) then
res@pmLegendDisplayMode = "Always" ; create a legend
; res@tiYAxisString = "Ozone, ppbv"
res@vpXF =0.1
res@tmYLLabelsOn = True
else
res@tmYLLabelsOn = False
res@pmLegendDisplayMode = "Never" ; create a legend
; res@tiYAxisString = "Temperature, ~S~o~N~C"
res@vpXF =0.5069385706
end if
; res@gsnMaximize = True
res@gsnPaperOrientation = "portrait"
WRF_map_c(fmap, res, 0) ; reads info from file
res@tfDoNDCOverlay = True
res@pmTickMarkDisplayMode = "Always" ; turn on tickmarks
; res@tmXTOn = False ; turn off top labels
; res@tmYROn = False ; turn off right labels
res@tmYRMajorOutwardLengthF = 0
res@tmYLMajorOutwardLengthF = 0
res@tmYLMinorOutwardLengthF = 0
res@tmXBMajorOutwardLengthF = 0
res@tmXBMinorOutwardLengthF = 0
res@tmYRLabelsOn = False
res@tmXTLabelsOn = False
res@tmYLLabelStride = 2
res@tmXBLabelStride = 2
res@tmXBLabelFontHeightF = 0.0108
res@tmYLLabelFontHeightF = 0.0108
res@tiMainFuncCode = "~"
; res@tiMainString = "metar data at "+time_string
res@gsnLeftString = "Wind Vector"
res@gsnRightString = "metar data at "+time_string
res@gsnFrame = False
res@gsnDraw = False
plot = gsn_csm_map(wks,res)
; draw(plot)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lat = f->latitude
lon = f->longitude
WSP_obs = f->windSpeed
WDR_obs = f->windDir
rad = 4.0*atan(1.0)/180.
U = -WSP_obs*sin(rad*WDR_obs)
V = -WSP_obs*cos(rad*WDR_obs)
wmsetp("wbs", .03) ; Increase the size of the barb.
wmsetp("ARS - arrow size",3.0)
; wmsetp("vrn - size of reference vector on plot in NDC space", 0.03)
wmsetp("vrs - size of reference vector in user space", 4.3)
if (idomain.eq.1) then
wmsetp("vrn - size of reference vector on plot in NDC space", 0.015)
else
wmsetp("vrn - size of reference vector on plot in NDC space", 0.02)
end if
wmsetp("ARL - scale factor for length of arrow tail",3.)
; wmsetp("vch - arrow head size",0.01)
wmsetp("vch - arrow head size",0.0051)
if (idaten.eq.0) then
wmsetp("vcc",1)
else
wmsetp("vcc",11)
end if
wmsetp("vcw - linewidth scale",1.)
wmvectmap(wks, lat, lon, U, V) ; Plot barbs.
; wmvlbl(wks,0.8,0.3)
wmvlbl(wks,0.295,0.3)
draw(plot)
delete(lat)
delete(lon)
delete(WSP_obs)
delete(WDR_obs)
delete(U)
delete(V)
end do ; nfiles
end do ; idate
frame(wks) ; Advance the frame.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
print("finish "+figurename_xhu)
end do ; idomain
end
Thanks a lot!<br>Xiaoming <br></pre><span contenteditable="true"> </span><script type="jsv/2667_"></script></div>                                            </div></body>
</html>