RMNLIB |
(INTERP1D_NEARESTNEIGHBOUR_X) |
|
SUBROUTINE INTERP1D_NEARESTNEIGHBOUR_X(numInterpSets, srcNumLevels, destNumLevels, src_ijDim, dst_ijDim, vLevelSource, stateSource, stateDerivSource, posnDestInSrc, vLevelDestn, stateDestn, stateDerivDestn, extrapEnableDown, extrapEnableUp, extrapGuideDown, extrapGuideUp, flux, numExtArraysIn, numExtArraysOut, ExtArraysIn, ExtArraysOut)
integer, intent(in) :: numInterpSets integer, intent(in) :: srcNumLevels integer, intent(in) :: destNumLevels integer, intent(in) :: src_ijDim integer, intent(in) :: dst_ijDim real, dimension(src_ijDim, srcNumLevels), intent(in) :: vLevelSource real, dimension(src_ijDim, srcNumLevels), intent(in) :: stateSource real, dimension(src_ijDim, srcNumLevels), intent(in) :: stateDerivSource integer, dimension(dst_ijDim, destNumLevels), intent(in) :: posnDestInSrc real, dimension(dst_ijDim, destNumLevels), intent(in) :: vLevelDestn real, dimension(dst_ijDim, destNumLevels), intent(out) :: stateDestn real, dimension(dst_ijDim, destNumLevels), intent(out) :: stateDerivDestn logical, intent(in) :: extrapEnableDown, extrapEnableUp real, intent(in) :: extrapGuideDown, extrapGuideUp external flux integer, intent(in) :: numExtArraysIn integer, intent(in) :: numExtArraysOut real, dimension(src_ijDim, numExtArraysIn), intent(in) :: ExtArraysIn real, dimension(dst_ijDim, numExtArraysOut), intent(out) :: ExtArraysOut
DESCRIPTION For each destination level, a state value is interpolated, using a nearest-neighbour method, from the state value at the closest source level. The nearest-neighbour method consists of identifying the source co-ordinate that is closest to the sought co-ordinate, and assigning the state value of that source co-ordinate as the sought value. In the case of this particular algorithm, clamping the values beyond the source levels to the nearest source value (as do the other interpolation algorithms) is identical to the nearest-neighbour algorithm. Therefore, this is done automatically, independently of extrapEnableDown and extrapEnableUp. These values could be overwritten by any of the extrapolation routines.
Author: Jeff Blezius - revised Oct 2003
ARGUMENTS
It can be noted that the arguments to all of the Interp1D_* and Extrap1D_* routines are identical, for ease of switching a call from one to another of them. You should examine the generic description of the arguments. The following are uses of the generic arguments that are specific to this routine:
Input: | |
stateDerivSource(src_ijDim, srcNumLevels) | unused |
extrapEnableDown | unused |
extrapEnableUp | unused |
extrapGuideDown | unused |
extrapGuideUp | unused |
flux | unused |
ExtArraysIn | unused |
Output: | |
stateDerivDestn(dst_ijDim, dstNumLevels) | unused |
ExtArraysOut | unused |