<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Hey Joe, </div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Think you just need to use vfXArray and vfYArray instead of the commented sfXArray, sfYArray for res_vec. </div><div class="gmail_default" style="font-family:verdana,sans-serif">v for vector, s for scalar. <br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Quick test with that shows they all overlay as expected with those 2 resources. </div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Alan</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 12, 2017 at 1:26 PM, Joe Grim <span dir="ltr"><<a href="mailto:grim@ucar.edu" target="_blank">grim@ucar.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">Hi,<div><br></div><div>I am in the midst of creating a suite of operational weather plots for the ATEC project I am working on. We are replacing RIP plots with NCL plots, since NCL is much more versatile. I need the scripts to be as flexible as possible, since there are a wide variety of plots. Therefore, I am drawing each layer of a plot and overlaying them. For example, in the plot I am trying to create, there is a map, shaded contour plot, solid contour lines, dashed contour lines, and wind barbs. It all plots perfectly, except for the wind barbs are missing. I have tried to use numerous examples on the NCL website as templates, and then adapting them, but none of them will draw the wind barbs either. I am trying to avoid using plotting functions that plot scalars and vectors within the same function, so the plotting system can be as flexible as possible.</div><div><br></div><div>Here is my script. The input file is on my website, here: <a href="http://joeandfrede.com/ncl/wrfout_d01_2017-09-23_12_00_00.RTC_P+FCST" target="_blank">http://joeandfrede.com/ncl/<wbr>wrfout_d01_2017-09-23_12_00_<wbr>00.RTC_P+FCST</a>. Could someone tell me what I am missing or doing wrong? Thanks on my part, and the whole ATEC project.</div><div><br></div><div>Joe</div><div><br></div><div><div>; This script is used to test ideas for plotting in NCL</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"</div><div>begin</div><div> PlotType = "png"</div><div> in_file = "wrfout_d01_2017-09-23_12:00:<wbr>00.RTC_P+FCST"</div><div> ncdf_in = addfile(in_file+".nc","r")</div><div> times = wrf_user_list_times(ncdf_in) ; get times in the file</div><div> ntimes = dimsizes(times) ; number of times in the file</div><div> T2 = wrf_user_getvar(ncdf_in,"T2",<wbr>0)</div><div> rh2 = wrf_user_getvar(ncdf_in,"rh2",<wbr>0)</div><div> XLAT = wrf_user_getvar(ncdf_in,"XLAT"<wbr>,0)</div><div> XLONG = wrf_user_getvar(ncdf_in,"<wbr>XLONG",0)</div><div> U10 = wrf_user_getvar(ncdf_in,"U10",<wbr>0)</div><div> V10 = wrf_user_getvar(ncdf_in,"V10",<wbr>0)</div><div> slp = wrf_user_getvar(ncdf_in,"slp",<wbr>0)</div><div> dims = dimsizes(XLAT)</div><div> nlat = dims(0)</div><div> nlon = dims(1)</div><div><br></div><div>; Create plot</div><div> PlotName = "T2_RH2_WND10_v2"</div><div> wks = gsn_open_wks(PlotType,<wbr>PlotName)</div><div> gsn_define_colormap(wks,"<wbr>BlAqGrYeOrReVi200")</div><div><br></div><div> res_sha = True</div><div> res_sha@cnFillOn = True</div><div> res_sha@gsnDraw = False</div><div> res_sha@gsnFrame = False</div><div> res_sha@gsnSpreadColors = True</div><div> res_sha@cnInfoLabelOn = False</div><div> res_sha@sfXArray = XLONG</div><div> res_sha@sfYArray = XLAT</div><div><br></div><div> res_con = True</div><div> res_con@cnLineColor = "NavyBlue"</div><div> res_con@cnLineThicknessF = 3</div><div> res_con@gsnDraw = False</div><div> res_con@gsnFrame = False</div><div> res_con@cnInfoLabelOn = False</div><div> res_con@<wbr>gsnLeftStringOrthogonalPosF = 0.05</div><div> res_con@<wbr>gsnRightStringOrthogonalPosF = 0.05</div><div> res_con@sfXArray = XLONG</div><div> res_con@sfYArray = XLAT</div><div><br></div><div> res_dash = True</div><div> res_dash@cnLineColor = "red4"</div><div> res_dash@cnLineThicknessF = 3</div><div> res_dash@<wbr>gsnContourPosLineDashPattern = 1</div><div> res_dash@gsnDraw = False</div><div> res_dash@gsnFrame = False</div><div> res_dash@cnInfoLabelOn = False</div><div> res_dash@<wbr>gsnLeftStringOrthogonalPosF = 0.1</div><div> res_dash@<wbr>gsnRightStringOrthogonalPosF = 0.1</div><div> res_dash@sfXArray = XLONG</div><div> res_dash@sfYArray = XLAT</div><div><br></div><div> res_vec = True</div><div> res_vec@gsnDraw = False</div><div> res_vec@gsnFrame = False</div><div> res_vec@vcGlyphStyle = "WindBarb"</div><div> res_vec@vcMinDistanceF = 0.02</div><div> res_vec@vcRefLengthF = 0.02</div><div> res_vec@<wbr>gsnLeftStringOrthogonalPosF = 0.15</div><div> res_vec@<wbr>gsnRightStringOrthogonalPosF = 0.15</div><div> res_vec@vcRefAnnoOn = False</div><div> res_vec@vcMinFracLengthF = 0.2</div><div> ;res_vec@vcVectorDrawOrder = "Postdraw"</div><div> ;res_vec@sfXArray = XLONG</div><div> ;res_vec@sfYArray = XLAT</div><div><br></div><div> res_map = True</div><div> res_map@gsnDraw = False</div><div> res_map@gsnFrame = False</div><div> res_map@mpLimitMode = "Corners" ; corner method of zoom</div><div> res_map@mpLeftCornerLatF = XLAT(0,0) ; left corner</div><div> res_map@mpLeftCornerLonF = XLONG(0,0) ; left corner</div><div> res_map@mpRightCornerLatF = XLAT(nlat-1,nlon-1) ; right corner</div><div> res_map@mpRightCornerLonF = XLONG(nlat-1,nlon-1) ; right corner</div><div> res_map@mpProjection = "LambertConformal" ; choose projection</div><div> res_map@mpLambertParallel1F = ncdf_in@TRUELAT1</div><div> res_map@mpLambertParallel2F = ncdf_in@TRUELAT2</div><div> res_map@mpLambertMeridianF = ncdf_in@STAND_LON</div><div> res_map@tfDoNDCOverlay = True ; native grid, no transform</div><div> ;res_map@mpOutlineDrawOrder = "Predraw"</div><div> ;res_map@mpFillDrawOrder = "Predraw"</div><div> res_map@mpFillOn = False</div><div><br></div><div> plot_sha = gsn_csm_contour(wks,T2,res_<wbr>sha)</div><div> plot_con = gsn_csm_contour(wks,rh2,res_<wbr>con)</div><div> plot_dash = gsn_csm_contour(wks,slp,res_<wbr>dash)</div><div> plot_vec = gsn_csm_vector(wks,U10,V10,<wbr>res_vec)</div><div> plot_map = gsn_csm_map(wks,res_map)</div><div> ;res_map = res_vec</div><div> ;plot_map = gsn_csm_vector_map(wks,U10,<wbr>V10,res_map)</div><div><br></div><div> overlay(plot_map,plot_sha)</div><div> overlay(plot_map,plot_con)</div><div> overlay(plot_map,plot_dash)</div><div> overlay(plot_map,plot_vec)</div><div><br></div><div> draw(plot_map)</div><div> frame(wks)</div><div><br></div><div> print("Created plot: "+PlotName+"."+PlotType)</div></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>