RMNLIB

(INTERP1D PACKAGE INTRODUCTION)



The goal of the 1-D interpolation, in the context of meteorology, is to determine observable values at particular levels in a vertical column of the atmosphere, given values of the same observable at a different set of vertical levels in the same column of the atmosphere. Within the context of vertical interpolation, each column of the atmosphere is completely independent of those around it.

There are many instances at the CMC where one-dimensional interpolation is needed. Prior to the existence of the Interp1D package, an independent interpolation code had been written for each instance. Code maintenance is always easier when not more than one copy of any given algorithm exists. Therefore, the Interp1D package should ease code maintenance, provided that its use is phased in as old code needs to be adjusted. The Interp1D package will also ease the writing of new code, in the obvious manner.

While these are general 1-D interpolation routines, they are natural in the context of interpolating meteorological data in the vertical direction. The related horizontal interpolation is a 2-D problem and is handled by the ezscint package.

In contrast with the ezscint package, the Interp1D package addresses a simpler problem. Therefore, the user interface to the Interp1D package is at a lower level of abstraction. This is simply a set of routines which interpolate (or extrapolate) a set of data. The only exception is the routine, Interp1D_FindPos, which must be called prior to any of the other routines.

Although there does not exist a routine to do it, the software package performs clamped extrapolation; that is to say that extrapolated values are clamped at the source value closest to it. This functionality is implicitly contained in each of the interpolation routines, and is accessed by disabling extrapolation with the interpolation algorithm.

To better understand the software, consider first the simplest interpolation that one could desire: to interpolate a single value at a particular co-ordinate location, given values at many co-ordinate locations (i.e. in a column). This can be accomplished by any of the interpolation routines by supplying an array of known values at an array of co-ordinates, and the co-ordinate where a value is desired.

If one has many such points (i.e. a column) to estimate by interpolation of the same known values at many co-ordinate locations, this can be accomplished by a single call to the same routine by supplying an array of co-ordinates where values are desired.

If one has the previous task to perform many times over with different sets of known values (as would exist, for example, at different horizontal positions), this can also be accomplished by a single call to the same routine. In this case, each of the arrays becomes two dimensional, with the new dimension being the first in the ordered pair because of the context of meteorological data. This is perhaps not instinctive. To illustrate, the previous case with 1-D arrays is considered. Expressed in the required 2-D notation, it becomes: array(1,n). It is the first subscript that counts the multiple sets of input values.

In the context of meteorology, it is common to perform this task several times over, once for each observable property of the atmosphere. In this case, the interpolation routine would need to be called once for each observable property. However, if (as is likely in the meteorological context) the observable values are always known at the same co-ordinates, and always desired at the same co-ordinates, then the first part of the work, that done by Interp1D_FindPos need be done only once.

N.B.:

For link instructions, please see "Use of the Software" in the ezinterpv introduction.

It is the responsibility of the user to ensure that the arrays that he supplies are large enough to contain the number of points that he indicates; specifically referring to the arguments of the routines, numInterpSets is the minimum first dimension on all arrays, and the second dimensions vSrcDim>=srcNumLevels, vDstDim>=dstNumLevels, and posnDim>=dstNumLevels.

It is assumed that the source vertical levels are in either ascending or descending order. The destination vertical levels may be in any order; the determination of the location of each destination level is completely independent of all the others.



Return to RPN Libraries home page
Return to product index
Last updated: June 23, 2006