NCL Home > Documentation > Functions > Meteorology

pres2hybrid_Wrap

Interpolates data on constant pressure levels to hybrid levels and retains metadata.

Prototype

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  ; This library is automatically loaded
                                                             ; from NCL V6.2.0 onward.
                                                             ; No need for user to explicitly load.

	function pres2hybrid_Wrap (
		p      [*] : numeric,  
		ps         : numeric,  
		p0     [1] : numeric,  
		xi         : numeric,  
		hyao   [*] : numeric,  
		hybo   [*] : numeric,  
		intflg [1] : integer   
	)

	return_val  :  numeric

Arguments

p

A one dimensional array specifying the pressure levels. Must be top-to-bottom order and must have the same units as ps and p0.

ps

A multi-dimensional array containing pressures. Must be at least two dimensions and one dimension smaller than xi. The level dimension is ordered top-to-bottom. Must have the same units as p0.

p0

A scalar value equal to the surface reference pressure. Must have the same units as ps and p. Typically p0=100000 [Pa] or 1000 [hPa].

xi

A multi-dimensional array containing the variable to be interpolated. The three rightmost dimensions must be (pressure) level, lat, and lon. The level dimension is ordered top-to-bottom.

hyao

A one-dimensional array containing the hybrid coefficients A associated with the return_val. Must be ordered top-to-bottom. Must be unitless.

hybo

A one-dimensional array containing the hybrid coefficients B associated with the return_val. Must be ordered top-to-bottom. Must be unitless.

intflg

A scalar integer which specifies the type of extrapolation to be used.

    =0   no extrapolation. Values set to _FillValue
    =1   values set to nearest valid value
    =2   values less than min(p) set to nearest value
         values greater than max(p) are linearly extrapolated 
    =3   values less than min(p) are linearly extrapolated
         values greater than max(p) set to nearest value 
    =4   values than min(p) are extrapolated
         values greater than max(p) are extrapolated

Description

This function is identical to pres2hybrid, except the return value will have metadata added based on metadata attached to xi and p0. See the pres2hybrid page for full documentation and examples.