NCL Home > Documentation > Functions > Interpolation

int2p_n_Wrap

Interpolates pressure levels to a different set of pressure levels and returns 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 int2p_n_Wrap (
		pin        : numeric,  
		xin        : numeric,  
		pout       : numeric,  
		linlog [1] : integer,  
		pdim   [1] : integer   
	)

	return_val  :  numeric

Arguments

pin

An array of any dimensionality containing input pressure levels. If multi-dimensional, the level dimension must be in the pdim-th position and the values must be monotonically increasing or decreasing.

xin

An array of any dimensionality containing the data to be interpolated. If pin is multi-dimensional, then these two arrays have the same dimension sizes. The level dimension must be in the pdim-th position.

pout

An array of any dimensionality containing output pressure levels with values monotonically increasing or decreasing. If multi-dimensional, the level dimension must be in the pdim-th dimension and all other dimensions must be the same as xin. If one-dimensional, then all of xin will be interpolated to the same levels. Must have the same units as pin.

linlog

A scalar integer indicating the type of interpolation:

abs(linlog) == 1 --> linear interpolation
abs(linlog) != 1 --> log interpolation

If linlog is negative, then extrapolation to levels outside the range of pin will occur. Use extrapolation with caution.

pdim

A scalar integer indicating which dimension of xin is the level dimension. Dimension numbering starts at 0.

Description

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