RMNLIB |
(EZINTERPV PACKAGE INTRODUCTION) |
EzInterpv is just a front end to the Interp1D package. Therefore, to understand the basic intent of EzInterpv, please refer to the Interp1D introduction. The interface to EzInterpv has been designed to resemble that of the ezscint package. Most of the functionality of the Interp1D package is available through the EzInterpv interface. The advantage of using EzInterpv is that multiple interpolations are automated, using an interface with a familiar feel.
PURPOSE:
The vertical interpolation package performs interpolations in one dimension, using the 1D interpolation package for the basic interpolation routines. Many interpolations that are completely independent, aside from using the same co-ordinates, are stacked together in a second dimension and are performed in one pass through the facility. For all but the 'generic', gridType, the interpolation / extrapolation is linear in Ln(P); this yields better interpolations with meteorological data. For the 'surface' and 'surfacewind' extrapolation types, the EXTRApolation is linear in Z.
SETS OF INTERPOLATIONS:
i.
A single point is interpolated from the values
at the many vertical levels at a single horizontal co-ordinate. Use
N_ViqkdefIfc_X(numVLevels=1, ...) N_VidefsetIfc_X(hNumPts=1, ...)
ii.
Several points at different vertical levels (and a single
horizontal co-ordinate) can be interpolated from a single set of
values at the many vertical levels at a single horizontal
co-ordinate. Use N_ViqkdefIfc_X(numVLevels=n, ...)
N_VidefsetIfc_X(hNumPts=1, ...)
iii.
The interpolation set ii
can be repeated at many horizontal co-ordinates all in the same run.
The vertical levels at which input values are supplied are constant
for each horizontal co-ordinate, except for the adjustment to Ps
at each horizontal location; the vertical levels at which output
values are interpolated are also constant for each horizontal
co-ordinate (Where the z-values are specified for these levels, using
the extended interface, the values must be repeated for each
horizontal location). Otherwise, each horizontal co-ordinate is
independent of the others. Use N_VidefsetIfc_X(hNumPts=m, ...)
iv.
The interpolation set iii can be repeated for several
observable properties. This requires calling N_VisintIfc_X() once for
each observable property. However, the calls to N_ViqkdefIfc() and
N_VidefsetIfc_X() need not be repeated.
USE OF THE SOFTWARE:
1. While it is not mandatory, your life will be
easier if your code 'include's two files (r.compile will find
them):
#include < ViConstants_f90.h >, which defines some
handy constants
#include < VertInterp_f90.h >, which
declares the functions and defines their interfaces
2. Define the
vertical grid (co-ordinates) of the input data. Use N_ViqkdefIfc_X,
the grid constructor.
3. Define the vertical grid of the output
data. Again, use N_ViqkdefIfc_X.
4. Tell the interpolator which
input and output grids you want to use and define the horizontal grid
including some physical parameters on that grid. Use N_VidefsetIfc_X
and the indices returned in steps 2 and 3.
5. Tell the
interpolator which interpolation algorithm you want to use. Use
N_VisetoptIfc.
6. To perform the interpolation, use
N_VisintIfc_X.
CAVEATS:
- The grid that contains the known observable values
must be ordered: either ascending or descending vertical levels.
-
It can be noted that in the case where the vertical levels are
exactly the same, the software explicitly does nothing (as opposed to
performing the interpolation which should give exactly the same
result).
- This package cannot be called from fortran77 using the
unextended interface. Fortran77 users must either use the extended
interface or else access directly the Interp1D routines on which
ez_interpv is based.
ERROR VALUES:
Values that are returned as error indications can be found in $ARMNLIB/include/ViConstants_f90.h (This is a copy of the values actually compiled, in VertInterpConstants.cdk90). A value of 0 means that there is no error. The values are:
! errors from the VerticalInterpolation class
integer, parameter :: N_VI_VIERR_FAILED_ALLOCATION =100, &
N_VI_VIERR_UNDEFINED_GRID_REQD =101, &
N_VI_VIERR_GRIDS_NOT_SELECTED =102, &
N_VI_VIERR_BAD_INTERPTYP_4_DATA =103, &
N_VI_VIERR_UNRECOGNIZED_OPTION =104, &
N_VI_VIERR_UNRECOGNIZED_VALUE =105, &
N_VI_VIERR_LN_PRESS_CONVERSION =106, &
N_VI_VIERR_MISSING_SURFACE_DATA =108, &
! errors from VerticalGrid class
N_VI_VGERR_HYBRID_TO_PRES_CONVN =200, &
N_VI_VGERR_FAILED_ALLOCATION =201, &
N_VI_VGERR_PTOP_MISSING =202, &
! errors from the Interface routines
N_IFC_VGRID_REPOSITORY_OVERFLOW =300, &
N_IFC_REPOSITORY_INVALID_INDEX =301, &
N_IFC_INVALID_DIMENSION =302
Return to RPN home page
Return to product index
Last
updated: January 27, 2010