<div dir="ltr"><div><div>I don't know for certain here -- do you get any errors?<br><br><br></div><div>After you define pltres = True, you might try adding:<br><br></div><div>pltres@gsnDraw = False<br></div><div>pltres@gsnFrame = False<br><br></div><div>Also, note that you overwrite your variable "plot" with two successive calls to wrf_map_overlays. I suspect you want to combine those into one call to overlay the 4 contour/vector plots.<br><br></div><div>Finally, are you certain your shapefile is in lat/lon? You can try something like:<br><br></div><div>ncl_filedump -v x shape.shp<br>ncl_filedump -v y shape.shp<br></div><div><br>to see if the x/y coordinates look like valid lon/lats for you area of interest.<br><br></div><div>Hope that helps...<br></div><div>Rick<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 14, 2016 at 10:45 AM, Kerandi, Noah Misati (IMK) <span dir="ltr"><<a href="mailto:noah.kerandi@kit.edu" target="_blank">noah.kerandi@kit.edu</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" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear all,</p>
<p>I have tried one example of ncl script for plotting surface wind (see below) to attach a shape file to a wrf output plot however with no success.</p>
<p>The shape file doesn't get attached to the two plots.</p>
<p>I will be glad if somebody moves me out from this state.</p>
<p>Thank you.<br>
</p>
<p><br>
</p>
<div>
<div><font size="2">
<div>Noah <br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br>
;load "./WRFUserARW.ncl"<br>
<br>
begin<br>
; ; This needs to have a ".nc" appended, so just do it.<br>
a = addfile("file","r")<br>
<br>
<br>
<br>
; We generate plots, but what kind do we prefer?<br>
type = "x11"<br>
;type = "pdf"<br>
;type = "ps"<br>
; type = "ncgm"<br>
wks = gsn_open_wks(type,"~/test")<br>
<br>
; Set some basic resources<br>
res = True<br>
<br>
res@MainTitle = "Surface wind 10m"<br>
<br>
<br>
mpres = True<br>
<br>
; Set some Basic Plot options<br>
res = True<br>
<br>
<br>
res@Footer = False<br>
<br>
mpres = True<br>
pltres = True ; Basic overlay plot options<br>
<br>
<br>
mpres@mpNationalLineColor = "Black"<br>
mpres@mpUSStateLineColor = "Black"<br>
;mpres@mpGridLineColor = "Black"<br>
mpres@mpLimbLineColor = "Black"<br>
mpres@mpPerimLineColor = "Black"<br>
mpres@mpGeophysicalLineThicknessF = 2.5<br>
;mpres@mpGridLineThicknessF = 2.0<br>
;mpres@mpLimbLineThicknessF = 2.5<br>
mpres@mpNationalLineThicknessF = 2.5<br>
mpres@mpDataBaseVersion = "MediumRes"<br>
<br>
mpres@mpFillBoundarySets ="AllBoundaries"<br>
mpres@mpOutlineBoundarySets = "National"<br>
<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>
; What times and how many time steps are in the data set?<br>
times = wrf_user_getvar(a,"times",-1) ; get all times in the file<br>
ntimes = dimsizes(times) ; number of times in the file<br>
shp = new(ntimes,graphic)<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>
do it = 0,ntimes-1,2 ; TIME LOOP<br>
<br>
print("Working on time: " + times(it) )<br>
res@TimeLabel = times(it) ; Set Valid time to use on plots<br>
<br>
<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
; First get the variables we will need <br>
<br>
slp = wrf_user_getvar(a,"slp",it) ; slp<br>
wrf_smooth_2d( slp, 3 ) ; smooth slp<br>
tc = wrf_user_getvar(a,"tc",it) ; 3D tc <br>
td = wrf_user_getvar(a,"td",it) ; 3D td <br>
u = wrf_user_getvar(a,"ua",it) ; 3D U at mass points<br>
v = wrf_user_getvar(a,"va",it) ; 3D V at mass points<br>
td2 = wrf_user_getvar(a,"td2",it) ; Td2 in C<br>
tc2 = wrf_user_getvar(a,"T2",it) ; T2 in Kelvin<br>
tc2 = tc2-273.16 ; T2 in C<br>
u10 = wrf_user_getvar(a,"U10",it) ; u at 10 m, mass point<br>
v10 = wrf_user_getvar(a,"V10",it) ; v at 10 m, mass point<br>
rh = wrf_user_getvar(a,"rh",it) ; <br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <br>
<br>
<br>
;tf2 = 1.8*tc2+32. ; Turn temperature into Fahrenheit<br>
tc2@description = "Surface Temperature"<br>
tc2@units = "~F34~0~F~C" <br>
;td_f = 1.8*td2+32. ; Turn temperature into Fahrenheit<br>
td2@description = "Surface Dew Point Temp" <br>
td2@units = "~F34~0~F~C"<br>
;u10 = u10*1.94386 ; Turn wind into knots<br>
;v10 = v10*1.94386<br>
u10@units = "m/s"<br>
v10@units = "m/s"<br>
<br>
<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>
; Plotting options for T <br>
opts = res <br>
opts@cnFillOn = True <br>
opts@ContourParameters = (/ 0., 30., 5./)<br>
opts@gsnSpreadColorEnd = -3 ; End third from the last color in color map<br>
contour_tc = wrf_contour(a,wks,tc2,opts)<br>
<br>
delete(opts)<br>
<br>
<br>
; Plotting options for Td<br>
opts = res <br>
opts@cnFillOn = True <br>
opts@cnLinesOn = True<br>
opts@cnLineLabelsOn = True<br>
opts@ContourParameters = (/ 0., 30., 5./) <br>
opts@cnLineLabelBackgroundColor = -1<br>
opts@gsnSpreadColorEnd = -3 ; End third from the last color in color map<br>
contour_td = wrf_contour(a,wks,td2,opts)<br>
<br>
delete(opts)<br>
<br>
<br>
; Plotting options for SLP <br>
opts = res <br>
;opts@cnLineColor = "Blue"<br>
;opts@cnHighLabelsOn = True<br>
;opts@cnLowLabelsOn = True<br>
opts@ContourParameters = (/ 1000., 1200., 2. /)<br>
;opts@cnLineLabelBackgroundColor = -1<br>
;opts@gsnContourLineThicknessesScale = 2.0<br>
contour_psl = wrf_contour(a,wks,slp,opts)<br>
<br>
delete(opts)<br>
<br>
<br>
; Plotting options for Wind Vectors <br>
<br>
opts = res <br>
opts@FieldTitle = "Wind" ; overwrite Field Title<br>
opts@NumVectors = 47 ; wind barb density<br>
opts@vcRefAnnoOrthogonalPosF = 0.02 ; move ref vector up<br>
opts@vcWindBarbColor = "black" ; Draw wins barbs in white<br>
opts@vcRefMagnitudeF = 10.0 ; define vector ref mag<br>
opts@vcRefLengthF = 0.045 ; define length of vec ref<br>
opts@vcGlyphStyle = "CurlyVector" ; turn on curly vectors<br>
opts@vcMinDistanceF = 0.055 ; thin out windbarbs<br>
<br>
opts@vcRefAnnoOn =True<br>
opts@gsnFrame = False ; so we can draw time stamp<br>
opts@vcRefAnnoSide = "Right"<br>
vector = wrf_vector(a,wks,u10,v10,opts)<br>
<br>
delete(opts) <br>
<br>
<br>
; MAKE PLOTS <br>
<br>
plot = wrf_map_overlays(a,wks,(/contour_tc,contour_psl,vector/),pltres,mpres)
<br>
<br>
<br>
plot= wrf_map_overlays(a,wks,(/contour_td,vector/),pltres,mpres)<br>
;define shapefiles <br>
shp_filename = ("./shape.shp")<br>
;-- set shapefile resources<br>
shpres = True<br>
shpres@gsLineThicknessF = 3.9 ;-- increase line thickness<br>
shpres@gsLineColor = "Purple" ;-- line colorgsLineThicknessF<br>
<br>
shp= gsn_add_shapefile_polylines(wks,plot,shp_filename,shpres)<br>
draw(plot) <br>
frame(wks)<br>
end do ; END OF TIME LOOP<br>
<br>
end<br>
<br>
</div>
</font></div>
</div>
</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>