PyNGL Home > Functions > CCSM

Ngl.vinth2p

Interpolates CCSM hybrid coordinates to pressure coordinates.

Prototype

array = Ngl.vinth2p(datai, hbcofa, hbcofb, plevo, 
                     psfc, intyp, p0, ii, kxtrp)

Arguments

datai

A NumPy array of 3 or 4 dimensions. This array needs to contain a level dimension in hybrid coordinates. The order of the dimensions is specific. The three rightmost dimensions must be level x lat x lon [e.g. TS(time,lev,lat,lon)]. The order of the level dimension must be top-to-bottom.

hbcofa

A one-dimensional NumPy array or Python list containing the hybrid A coefficients. Must have the same dimension as the level dimension of datai. The order must be top-to-bottom.

hbcofb

A one-dimensional NumPy array or Python list containing the hybrid B coefficients. Must have the same dimension as the level dimension of datai. The order must be top-to-bottom.

plevo

A one-dimensional NumPy array of output pressure levels in mb.

psfc

A multi-dimensional NumPy array of surface pressures in Pa. Must have the same dimension sizes as the corresponding dimensions of datai.

intyp

A scalar integer value equal to the interpolation type: 1 = LINEAR, 2 = LOG, 3 = LOG LOG.

p0

A scalar value equal to surface reference pressure in mb.

ii

Not used at this time. Set to 1.

kxtrp

A logical value. If False, then no extrapolation is done when the pressure level is outside of the range of psfc.

Return value

array

A multi-dimensional NumPy array of the same shape as datai, except that the input level coordinate has been replaced by plevo.

Description

This function interpolates CCSM hybrid coordinates to pressure coordinates. The type of interpolation is currently a variant of transformed pressure coordinates with the interpolation type specified by intyp. All hybrid coordinate values are transformed to pressure values. If datai is on midlevels, then hyam/hybm coefficients should be input; If datai is on interfaces, then hyai/hybi) coefficients should be input.

This is the exact routine used within the CCSM Processor. Note that the units for psfc are Pascals (Pa) whereas the units for plevo and p0 are millibars (mb).

Examples

See the PyNGL script vinth2p.py.