[ncl-talk] After using wrf_user_vert_interp - warning:VectorPlotInitialize: no valid values in vector field; VectorPlot not possible

Trostel, John M. john.trostel at gtri.gatech.edu
Tue May 2 09:03:58 MDT 2017


I am trying to use the wrf utility "wrf_user_vert_interp" to interpolate some WRF output to heights AGL


    u  = wrf_user_getvar(a,"ua",-1)        ; u averaged to mass points
    v  = wrf_user_getvar(a,"va",-1)        ; v averaged to mass points
    z  = wrf_user_getvar(a, "z",-1)        ; grid point height
  printVarSummary(u)
  printVarSummary(v)

; The specific height levels that we want the data interpolated to.
; And interpolate to these levels
  height_levels = (/ 1000., 2000., 3000., 4000. /) ; height levels to plot - in meter
  nlevels       = dimsizes(height_levels)     ; number of height levels

  u_plane  = wrf_user_vert_interp( a,u,"ght_agl",height_levels,False)
  v_plane  = wrf_user_vert_interp( a,v,"ght_agl",height_levels,False)

When I try to plot the new wind vectors at these levels I get the error:

"warning:VectorPlotInitialize: no valid values in vector field; VectorPlot not possible"

and get an empty vector plot (the contour plot is fine).  Any clue why this happens?

do level = 0,nlevels-1                 ; LOOP OVER LEVELS

      height = height_levels(level)
      height = height*3.2084

    ; Add some level into to the plot
      res at PlotLevelID = height + " ft"

  opts = True                                  ; Set some Basic Plot options

  ter = wrf_user_getvar(a,"HGT_M",0)           ; Read the variable to memory
  ter_zoom = ter(y_start:y_end,x_start:x_end)   ; need (:, for z-data

  ter_zoom = ter_zoom*3.2084

  ter_zoom at units = "feet"

  opts at cnFillOn = True                          ; Create a color fill plot
  opts at ContourParameters = (/ 0., 10000., 200. /) ; Set the levels

  contour_zoom = wrf_contour(a,wks,ter_zoom,opts)
  delete(opts)

    ; Plotting options for Wind Vectors
      opts = res
      opts at FieldTitle = "Wind"   ; overwrite Field Title
      opts at NumVectors = 50       ; wind barb density
      vector = wrf_vector(a,wks,u_plane(it,{height_levels(level)},y_start:y_end,x_start:x_end),v_plane(it,{height_levels(level)},y_start:y_end,x_start:x_end),opts)
      delete(opts)


    ; MAKE PLOTS
      plot = wrf_map_overlays(a,wks,(/contour_zoom,vector/),pltres,mpres)


    end do      ; END OF LEVEL LOOP


?



--
John Trostel
Director - Severe Storms Research Center
Georgia Tech Research Institute
Atlanta, GA 30332-0857
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170502/3462ae16/attachment.html 


More information about the ncl-talk mailing list