int2p

Function for interpolating from one set of pressure levels to another set using linear or ln(p) interpolation.


Synopsis

    function int2p(
        pin       : float,
        xin       : float,
        pout      : float,
        linlog[1] : integer
    )


Arguments

pin
input pressure levels in decreasing order (array of any dimensions, last dimension is npin)
xin
data at input pressure levels (array of same dimensions as pin)
linlog
linear interpolation in pressure (=1) or linear interpolation in ln(p) (!=1)
pout
output pressure levels in decreasing order (array of same dimensions as pin, only last dimension is replaced by npout)

Description

Function for interpolating from one set of pressure levels to another set using linear or ln(p) interpolation. The results are returned in a float array the same dimensions as pout. Missing values are allowed, but they are ignored.


Example

begin
  pi =(/ 1000.,925.,850.,700.,600.,500.,400.,300.,250., \
          200.,150.,100.,70.,50.,30.,20.,10. /)

  po =(/ 1000.,950.,900.,850.,800.,750.,700.,600.,500., \
          425.,400.,300.,250.,200.,100.,85.,70.,50.,40.,\
           30.,25.,20.,15.,10. /)

  pi@_FillValue = -999.9

  xi   = pi
  nin  = dimsizes(pi)
  nout = dimsizes(po)
  linlog = 1

  pi(2) = pi@_FillValue
  pi(10) = pi@_FillValue

  xo = int2p (pi,xi,po,linlog)
  print(xo)
end

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$Revision: 1.6 $ $Date: 1999/01/05 22:20:47 $