NCL Home > Documentation > Functions > WRF, Interpolation


Interpolates a three-dimensional WRF-ARW field to a horizontal plane at the specified vertical level(s).

Available in version 6.6.0 and later.


load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"      ; These two libraries are automatically
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"    ; loaded from NCL V6.4.0 onward.
                                                              ; No need for user to explicitly load.

	function wrf_user_interp_level (
		var3d           : numeric,  
		vert            : numeric,  
		desired_levels  : numeric,  
		opt         [1] : logical   

	return_val  :  numeric



A three-dimensional WRF-ARW field to be interpolated. The rightmost dimensions of this array should be nz x ny x nx.


A three-dimensional array of vertical coordinates for var3d, typically pressure or height. The dimensionality must be the same as var3d.

If vert is pressure, the units may be either hPa or Pa. If vert is height, then the units of the field must be in m.


The desired vertical level(s). This can be a single value (e.g. 500), a sequence of values (e.g. (/1000, 850, 700, 500, 250/)), or a multi-dimensional array where the rightmost two dimensions (ny x nx) must match var3d, and any leftmost dimensions match field3d's (e.g. planetary boundary layer). Must be in the same units as the vert parameter.


A logical scalar that can optionally contain attributes. See description below.


Documentation under construction.

This function interpolates a three-dimensional variable to a horizontal plane at the specified vertical level, which can be in height or pressure coordinates.

Optional attribute available via opt:

  • inc2dlevs - If set to True, then the return value will have an attribute called level that is set to the value of the input parameter desired_levels

See Also



Example 1

  a = addfile("","r")

  time = 1
  ht     = wrf_user_getvar(a, "z",time)        ; grid point height
  p      = wrf_user_getvar(a, "pressure",time) ; total pressure
  ht_500 = wrf_user_interp_level(ht,p, 500,False)