<div dir="ltr"><div>Hi all,<br><br></div>I am trying to do a simple wrf_map_overlays, but I keep getting a blank image and I do not understand why. The field that I am trying to contour and use for vectors I get from a seperate .nc file. Also I should mention that I am not using winds for the vectors. They are the x- and y- components of my vector value (IVT : Integrated vapor transport). All the data from the .nc files is there because I checked it with ncdump. Also, I get no errors out of the output from NCL. <br>
<div><br></div><div>here is my script below:<br></div><div><br><br clear="all"><span style="color:rgb(11,83,148)">load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl&quot;</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">begin</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  case =&quot;3dvar_t1&quot;</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  if (case.eq.&quot;run3.1&quot; .or. case.eq.&quot;n3&quot;) then</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">   cmd  =&quot;ls -1 /data2/eiserloh/data/AR/&quot; + case + &quot;/wrfout_d02_2012*&quot; ;frost</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  else</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">   cmd  =&quot;ls -1 /data2/eiserloh/data/&quot; + case + &quot;/wrfout_d02_2012*&quot;    ;thunder</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  end if</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  files = systemfunc(cmd) + &quot;.nc&quot;</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  a = addfiles(files,&quot;r&quot;)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  time  = wrf_user_list_times(a)  ; get times in the files</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  lat2d=wrf_user_getvar(a[0],&quot;lat&quot;,0)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  lon2d=wrf_user_getvar(a[0],&quot;lon&quot;,0)</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  ivt_file=case+&quot;_<a href="http://ivt_6hrly.nc">ivt_6hrly.nc</a>&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  b = addfile(ivt_file,&quot;r&quot;)</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  times = b-&gt;times</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  IVT   = b-&gt;IVT</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  IVT_x = b-&gt;IVT_x</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  IVT_y = b-&gt;IVT_y</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">;  IVT@lat2d = lat2d</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;  IVT@lon2d = lon2d</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;  IVT_x@lat2d = lat2d</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">;  IVT_x@lon2d = lon2d</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;  IVT_y@lat2d = lat2d</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;  IVT_y@lon2d = lon2d</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  ntimes = dimsizes(times)</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">; We generate plots, but what kind do we prefer?</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  type = &quot;ps&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">; type = &quot;png&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  type@wkOrientation = &quot;landscape&quot;</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  wks = gsn_open_wks(type,case+&quot;_ivt&quot;)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  gsn_define_colormap(wks,&quot;BlAqGrYeOrRe&quot;)</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">; Set some basic resources</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  res          = True</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  res@gsnDraw  = False</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  res@gsnFrame = False</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  res@MainTitle = &quot; &quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  res@Footer = False</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  MTOPosF    = -0.05</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  pltres = True</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres = True</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  colr = &quot;black&quot;</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  mpres@gsnMaximize = True</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres@mpGeophysicalLineColor = colr</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres@mpNationalLineColor    = colr</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  mpres@mpUSStateLineColor     = colr</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres@mpGridLineColor        = colr</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  mpres@mpLimbLineColor        = colr</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres@mpPerimLineColor       = colr</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  mpres@mpOutlineBoundarySets  = &quot;GeophysicalandUSStates&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres@mpGeophysicalLineThicknessF  = 1.5</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  mpres@mpUSStateLineThicknessF      = 1.5</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres@mpGridLineThicknessF         = 1.0</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  mpres@mpLimbLineThicknessF         = 1.0</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres@mpNationalLineThicknessF     = 1.5</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  mpres@mpUSStateLineThicknessF      = 1.5</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres@mpGridLineDashPattern        = 1.5</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  mpres@mpDataBaseVersion        = &quot;MediumRes&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  mpres@mpDataSetName            = &quot;Earth..4&quot;</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  pltres@PanelPlot               = True</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  pltres@LatLonOverlay           = True</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">; What times and how many time steps are in the data set?</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">hour_int=6</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;  do it = 0,ntimes-1             ; TIME LOOP</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  do it =0,1</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">    f=it*hour_int</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">    print(&quot;Working on time: &quot; + time(f) )</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">    res@TimeLabel = times(it)   ; Set Valid time to use on plots</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">;     u  = wrf_user_getvar(a[f],&quot;ua&quot;,0)         ; u averaged to mass points</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;     v  = wrf_user_getvar(a[f],&quot;va&quot;,0)         ; v averaged to mass points</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">;    ws  = ((u^2)+(v^2))^(0.5)                   ; Wind speed</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">   ter  = wrf_user_getvar(a[f],&quot;ter&quot;,0) </span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">;     p  = wrf_user_getvar(a[f],&quot;pressure&quot;,0)</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">   ;mandatory pressure levels</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">;   mplevs=(/1000.,925.,850.,700.,500.,300./)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">     </span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">   ;get u at mandatory plevs for vectors for plot</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">;     u_mpls=wrf_user_intrp3d(u,p,&quot;h&quot;,mand_pres_levs,0.,False)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;     v_mpls=wrf_user_intrp3d(v,p,&quot;h&quot;,mand_pres_levs,0.,False)</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">     </span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;     u_bar=dim_sum_n(u_mpls,0) </span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;     v_bar=dim_sum_n(v_mpls,0)</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">    ; Plotting Time</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      slp = wrf_user_getvar(a[f],&quot;slp&quot;,0)  ; slp</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      res@InitTime  = False</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      res@ValidTime = False</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      res@NoHeaderFooter  = True</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      tt=slp</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      tt@description = &quot; Valid &quot; + times(it)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      tt@units = &quot;UTC&quot;</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts=res</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@ContourParameters = (/1., 2., 1./)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@cnFillColors = -1</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@lbTitleOn            = False</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@cnInfoLabelOn        = False</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@sfXArray             = lon2d</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@sfYArray             = lat2d</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      title = wrf_contour(a[f],wks,tt,opts)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      delete(opts)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">    ; Plotting options IVT contour fill                </span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts = res                          </span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@cnFillOn = True  </span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@ContourParameters = (/ 0., 800., 50. /)</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@lbOrientation        = &quot;Vertical&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@pmLabelBarSide       = &quot;Right&quot;</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@pmLabelBarOrthogonalPosF= -0.04</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@lbTitleOn            = False</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@FieldTitle           = IVT@description</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@sfXArray             = lon2d</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@sfYArray             = lat2d</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      contour = wrf_contour(a[f],wks,IVT(it,:,:),opts)</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      delete(opts)</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">    ; Plotting Opts for Terrain Contours</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts=res</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@cnFillOn=False</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@ContourParameters=(/0.,5000.,250./)</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@FieldTitle = &quot;Elevation (m)&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@cnLineLabelInterval = 0</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@sfXArray             = lon2d</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@sfYArray             = lat2d</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      terrain = wrf_contour(a[f],wks,ter,opts)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      delete(opts)</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">    ; Overplot Vectors         </span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts = res          </span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)"> ;    opts@vcGlyphStyle = &quot;LineArrow&quot;</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@FieldTitle = &quot;IVT Vectors&quot;     ; overwrite Field Title</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@NumVectors = 25                 ; wind barb density</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      opts@vfXArray             = lon2d</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      opts@vfYArray             = lat2d</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      vector = wrf_vector(a[f],wks,IVT_x(it,:,:),IVT_y(it,:,:),opts)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      delete(opts)</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">    ; MAKE PLOTS               </span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      plot = wrf_map_overlays(a[f],wks,(/contour,vector,terrain,title/),pltres,mpres)</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">      draw(plot)</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">      frame(wks)</span><br style="color:rgb(11,83,148)"><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  end do        ; END OF TIME LOOP</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)"> ; cmd = &quot;convert &quot;+case+&quot;_<a href="http://ivt.ps">ivt.ps</a> -rotate &#39;-90&lt;&#39; &quot;+case+&quot;_ivt.png&quot;</span><br style="color:rgb(11,83,148)">
<span style="color:rgb(11,83,148)">  cmd = &quot;convert &quot;+case+&quot;_<a href="http://ivt.ps">ivt.ps</a> &quot;+case+&quot;_ivt.png&quot;</span><br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">  system(cmd)</span><br style="color:rgb(11,83,148)">
<br style="color:rgb(11,83,148)"><span style="color:rgb(11,83,148)">end</span><br><br></div><div>Thanks,<br><br></div><div>-- <br><div dir="ltr">Arthur J. Eiserloh, Jr.<div>San Jose State University </div><div>Graduate Student</div>
<div>Dept. of Meteorology and Climate Science</div></div>
</div></div>