<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Stephen,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">My apologies, we updated some of our NCL scripts to use newer methods, and this particular script was inadvertently modified before the new release of NCL was out.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Simply comment this line:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"> res@tfDoNDCOverlay = "NDCViewport"<br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><br></p></div><div class="gmail_default" style="font-size:small">and uncomment this line:</div><div class="gmail_default" style="font-size:small"><br></div>; res@tfDoNDCOverlay = True ; old method <div><br></div><div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"></div><br><div class="gmail_default" style="font-size:small"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 3, 2018 at 11:12 AM, Stephen Kirby <span dir="ltr"><<a href="mailto:thinjogger@gmail.com" target="_blank">thinjogger@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">Hi,<div><br></div><div>I am getting the error seen on the subject line as I try to plot WRF data. I am using wrf_gsn_5.ncl straight out of the box from the NCL site page supporting plotting WRF output. I only changed the WRF output file to one I generated. I'm running NCL version 6.4.0.</div><div><br></div><div>I'm pasting the code below for reference and please note the error comes from this line of code:</div><div><b>contour_tf = gsn_csm_contour(wks,tf2,tf_<wbr>res)<br></b></div><div><b><br></b></div><div>and the other errors listed are:</div><div><div style="font-weight:bold">fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 3642 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl </div><div>which are these lines of code:</div><div style="font-weight:bold"><div>if(get_res_value_keep(res,"<wbr>tfDoNDCOverlay",False).<a href="http://or.ftype.ne" target="_blank">or.<wbr>ftype.ne</a>."map") then</div><div> return(False)</div><div>end if</div></div><div style="font-weight:bold"><br></div><div style="font-weight:bold">fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 13313 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl</div></div><div>which are these lines of code:</div><div><div style="font-weight:bold">if(get_lon_cyclic_point_<wbr>default(data,res2,"",False)) then</div><div style="font-weight:bold"> datanew = gsn_add_cyclic_point(data)</div><div style="font-weight:bold">else</div><div style="font-weight:bold"> datanew = data</div><div style="font-weight:bold">end if</div><div style="font-weight:bold"><br></div><div>Thanks for any tips you can provide.</div><div><br></div><div>--Steve</div></div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">;-----------------------------<wbr>------------------------------<wbr>-----------
; wrf_gsn_5.ncl
;-----------------------------<wbr>------------------------------<wbr>-----------
; Concepts illustrated:
; - Using gsn_csm scripts to plot WRF-ARW data
; - Overlaying line contours, filled contours, and vectors on a map
; - Setting the correct WRF map projection using wrf_map_resources
; - Setting lots of resources to customize a WRF plot
;-----------------------------<wbr>------------------------------<wbr>-----------
; This script is meant to show the difference between plotting WRF
; data using wrf_xxx scripts, and using gsn_csm_xxx scripts.
;
; See wrf_nogsn_5.ncl for an example of using wrf_xxxx scripts to
; plot WRF data.
;-----------------------------<wbr>------------------------------<wbr>-----------
; In NCL Versions 6.3.1 and earlier, you will get these warnings which
; you can safely ignore:
;
; warning:start_lat is not a valid resource in wrf_gsn_contour at this time
; warning:start_lon is not a valid resource in wrf_gsn_contour at this time
; warning:end_lat is not a valid resource in wrf_gsn_contour at this time
; warning:end_lon is not a valid resource in wrf_gsn_contour at this time
; warning:mpNestTime is not a valid resource in map at this time
;-----------------------------<wbr>------------------------------<wbr>-----------
; These files are loaded by default in NCL V6.2.0 and newer
; load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"
; load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"
; load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl"
begin
;---Open WRF output file
filename = "wrfout_d01_2005-12-14_13:00:<wbr>00"
a = addfile(filename,"r")
;---Read several WRF variables at first time step
it = 0
slp = wrf_user_getvar(a,"slp",it) ; sea level pressure
wrf_smooth_2d( slp, 3 ) ; smooth slp
tc = wrf_user_getvar(a,"tc",it) ; 3D temperature
u = wrf_user_getvar(a,"ua",it) ; 3D U at mass points
v = wrf_user_getvar(a,"va",it) ; 3D V at mass points
;---Now get the lowest (bottommost) level
nl = 0
tc2 = tc(nl,:,:)
u10 = u(nl,:,:)
v10 = v(nl,:,:)
tf2 = 1.8*tc2+32. ; Convert temperature to Fahrenheit
u10 = u10*1.94386 ; Convert wind into knots
v10 = v10*1.94386
;---Change the metadata
tf2@description = "Surface Temperature"
tf2@units = "degF"
u10@units = "kts"
v10@units = "kts"
wks = gsn_open_wks("png","wrf_gsn")
;---Set common resources for all plots
res = True
res@gsnFrame = False
res@gsnDraw = False
res@gsnLeftString = ""
res@gsnRightString = ""
;---Necessary for contours to be overlaid correctly on WRF projection
res@tfDoNDCOverlay = "NDCViewport"
; res@tfDoNDCOverlay = True ; old method
;---Temperature filled contour plot
tf_res = res
tf_res@cnFillOn = True
tf_res@cnLevelSelectionMode = "ExplicitLevels"
tf_res@cnLevels = ispan(-20,90,5)
tf_res@lbLabelFontHeightF = 0.015
tf_res@lbOrientation = "Vertical"
tf_res@<wbr>pmLabelBarOrthogonalPosF = -0.005
contour_tf = gsn_csm_contour(wks,tf2,tf_<wbr>res)
;---SLP line contour plot
levels = ispan(900,1100,4)
info_string = "Sea level pressure contours from 900 to 1100 by 4"
slp_res = res
slp_res@cnLineColor = "NavyBlue"
slp_res@cnLevelSelectionMode = "ExplicitLevels"
slp_res@cnLevels = levels
slp_res@<wbr>cnLineLabelBackgroundColor = -1 ; transparent
slp_res@cnLineThicknessF = 2.5
slp_res@cnHighLabelsOn = True
slp_res@cnLowLabelsOn = True
slp_res@<wbr>cnHighLabelBackgroundColor = -1
slp_res@<wbr>cnLowLabelBackgroundColor = -1
slp_res@cnInfoLabelString = info_string
slp_res@cnInfoLabelFontColor = "NavyBlue"
slp_res@cnInfoLabelPerimOn = False
contour_psl = gsn_csm_contour(wks,slp,slp_<wbr>res)
;---Wind vector plot
vec_res = res
vec_res@vcMinDistanceF = 0.02
vec_res@vcRefLengthF = 0.02
vec_res@vcMinFracLengthF = 0.2
vec_res@vcGlyphStyle = "WindBarb"
vec_res@vcRefAnnoOn = False
vector = gsn_csm_vector(wks,u10,v10,<wbr>vec_res)
;---Map plot
map_res = True
map_res@gsnFrame = False
map_res@gsnDraw = False
map_res@tiMainString = filename
map_res@gsnLeftString = tf2@description + " (" + tf2@units + ")~C~" + \
slp@description + " (" + slp@units + ")~C~" + \
"Wind (" + u10@units + ")"
map_res@<wbr>gsnLeftStringFontHeightF = 0.01
;---Set map resources based on projection on WRF output file
map_res = wrf_map_resources(a,map_res)
map = gsn_csm_map(wks,map_res)
;---Overlay plots on map and draw.
overlay(map,contour_tf)
overlay(map,contour_psl)
overlay(map,vector)
draw(map) ; This will draw all overlaid plots and the map
frame(wks)
end
</pre></div><div><br></div></div>
<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>