[Wrf-users] interpolation for idealized case run

Ioana Colfescu ioana.colfescu at ncas.ac.uk
Mon Dec 4 06:03:36 MST 2017


Hi,
I'm running one of the idealized cases - hill2d simulations in WRF.
I'm looking at gravity waves produces by a mountain in the domain and
trying to plot both the mountain and the wave on the same plot. When I do
this there are W values inside the mountain which is obviously not correct.

I should probably interpolate the W as well as Z to height levels ? I m
trying to do that but my fields are all 2D ( NTxNZxNX) and the NCL-Wrf
functions are asking for an at least 3D field.
Is there any function I could use to interpolate the output from an
idealized simulation to height/pressure levels ?

My code and a printout of the code is below:

 a = addfile("wrfout_d01_0001-01-01_00:00:00","r")
  type = "pdf"
  times  = wrf_user_list_times(a)  ; get times in the file
  ntimes = dimsizes(times)         ; number of times in the file
  time = -1
  u_in   = wrf_user_getvar(a,"ua",time)    ; ua is u averaged to mass points
  v_in   = wrf_user_getvar(a,"va",time)    ; va is v averaged to mass points
  w_in   = wrf_user_getvar(a,"wa",time)    ; vertical velocity
  th_in  = wrf_user_getvar(a,"th",time)    ; get temperature (C)
  z_in   = wrf_user_getvar(a, "z",time)    ; grid point height
  ter_in    = wrf_user_getvar(a,"HGT",time)   ; need terrain height
sometimes
  printVarSummary(ter_in)

  u   =  u_in(:,:,0,:)
  v   =  v_in(:,:,0,:)
  w   =  w_in(:,:,0,:)
  th  = th_in(:,:,0,:)
  z   =  z_in(:,:,0,:)
;  ter = ter_in(:,:,0,:)
 dimsrh=dimsizes(w)
  printVarSummary(w)
  printVarSummary(z)
  printVarSummary(ter_in)
;; shold interpolate terrain and w to the same z or pressure coordinates
  w!1="height"
  w&height=z(0,:,0)

;  printVarSummary(z)
;  printVarSummary(ter)
;  printVarSummary(w)
;
;  w_plane = wrf_user_vert_interp(a,w(0,:,:),"ght_msl",z(0,:,0),False)
;;  printVarSummary(w_plane)


Printout:

Variable: ter_in
Type: float
Total Size: 11256 bytes
            2814 values
Number of Dimensions: 3
Dimensions and sizes:    [Time | 7] x [south_north | 2] x [west_east | 201]
Coordinates:
Number Of Attributes: 6
  FieldType :    104
  MemoryOrder :    XY
  description :    Terrain Height
  units :    m
  stagger :
  coordinates :    XLONG XLAT XTIME

Variable: w
Type: float
Total Size: 337680 bytes
            84420 values
Number of Dimensions: 3
Dimensions and sizes:    [Time | 7] x [bottom_top | 60] x [west_east | 201]
Coordinates:
Number Of Attributes: 6
  FieldType :    104
  MemoryOrder :    XYZ
  description :    z-wind component
  units :    m s-1
  stagger :
  coordinates :    XLONG XLAT

Variable: z
Type: float
Total Size: 337680 bytes
            84420 values
Number of Dimensions: 3
Dimensions and sizes:    [Time | 7] x [bottom_top | 60] x [west_east | 201]
Coordinates:
Number Of Attributes: 6
  FieldType :    104
  MemoryOrder :    XYZ
  description :    Height
  units :    m
  stagger :
  coordinates :    XLONG XLAT

Variable: ter_in
Type: float
Total Size: 11256 bytes
            2814 values
Number of Dimensions: 3
Dimensions and sizes:    [Time | 7] x [south_north | 2] x [west_east | 201]
Coordinates:
Number Of Attributes: 6
  FieldType :    104
  MemoryOrder :    XY
  description :    Terrain Height
  units :    m
  stagger :
  coordinates :    XLONG XLAT XTIME

Thanks,
Ioana

*Ioana Colfescu  *
Research Scientist
National Centre for Atmospheric Science
School of Earth and Environment
University of Leeds
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/wrf-users/attachments/20171204/16a10a55/attachment.html>


More information about the Wrf-users mailing list