Home > atmlab > math > interpp.m

interpp

PURPOSE ^

------------------------------------------------------------------------

SYNOPSIS ^

function X = interpp(pp,Xp,p)

DESCRIPTION ^

------------------------------------------------------------------------
 NAME:    interpp

          Makes log-linear interpolation. That is, the x-dimension is
          converted to log before doing the interpolation.

          The profiles are assumed to be constant outside the end points.

          A typical application of the function is interpolation of
          atmospheric vertical profiles.

 FORMAT:  X = interpp(pp,Xp,p)

 RETURN:  X          interpolated profiles
 IN:      pp         original pressure levels
          Xp         original profiles
          p          new pressure levels 
------------------------------------------------------------------------

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

interpp.m

SOURCE CODE ^

0001 %------------------------------------------------------------------------
0002 % NAME:    interpp
0003 %
0004 %          Makes log-linear interpolation. That is, the x-dimension is
0005 %          converted to log before doing the interpolation.
0006 %
0007 %          The profiles are assumed to be constant outside the end points.
0008 %
0009 %          A typical application of the function is interpolation of
0010 %          atmospheric vertical profiles.
0011 %
0012 % FORMAT:  X = interpp(pp,Xp,p)
0013 %
0014 % RETURN:  X          interpolated profiles
0015 % IN:      pp         original pressure levels
0016 %          Xp         original profiles
0017 %          p          new pressure levels
0018 %------------------------------------------------------------------------
0019 
0020 % HISTORY: 2005-05-11  Moved to Atmlab by PE.
0021 %          2000-01-04  Moved from Norns to AMI
0022 %          1999-11-02  Created by Patrick Eriksson.
0023 
0024 
0025 function X = interpp(pp,Xp,p)
0026 
0027 pp    = vec2col(pp);
0028 np    = length(pp);
0029 
0030 X    = interp1([1e3;log(pp);-1e3],[Xp(1,:);Xp;Xp(np,:)],log(p));
0031

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005