- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑
Description:
An input
array is copied to an output array under control of a supplied AXES vector. Axes of the output array
may be in a different order to those of the input array, and it may be required to expand along a new
dimension or collapse along an existing combination (being replaced by the mean of all non-bad
values).
Invocation
CALL KPG1_MANIx( NDIMI, DIMI, IN, NDIMO, DIMO, AXES, COLOFF, EXPOFF,
OUT, STATUS )
Arguments
NDIMI = INTEGER (Given)
The dimensionality of the
input array.
DIMI( NDIMI ) = INTEGER (Given)
The shape of the input array.
IN(
) = ?
(Given)
The input data array, vectorised. The number of elements is given by the product of the
elements of DIMI.
NDIMO = INTEGER (Given)
The dimensionality of the output array (the
number of elements in AXES).
DIMO( NDIMO ) = INTEGER (Given)
The dimensions of the output
array. Information about the extent of the expanded dimesions, as well as information implicit in
DIMI and AXES, is held here.
AXES( NDIMO ) = INTEGER (Given)
An array determining
how the output array is copied from the input array. The I’
th element determines the
source of the I’
th dimension of the output array. If it is zero, a new dimension will grow
there. Otherwise, it gives the index of a dimension of the input array to copy.
COLOFF(
) =
INTEGER (Returned)
Workspace. This array must have at least as many elements as the
product of all the dimensions of the input array along which it is to be collapsed; that is
the product of each element of DIMI whose index does not appear in AXES.
EXPOFF(
) =
INTEGER (Returned)
Workspace. This array must have at least as many elements as the
product of all the newly expanded dimensions in the output array; that is the product
of each element of DIMO for which the corresponding element of AXES is zero.
OUT(
) = ?
(Returned)
The output array, vectorised. The number of elements written is given by the product
of the elements of NDIMO.
STATUS = INTEGER (Given)
The global status
Notes:
-
There is a routine for all numeric data types: replace "
x"
in the routine name by B, D, I,
R, UB, UW, or W as appropriate. The IN and OUT arguments must have the data type
specified.
-
The assumption that NDF__MXDIM = 7 is hard coded into this routine.
-
A few arithmetic operations could be saved, at the expense of the code’
s clarity, by calculating the
various array offsets at the same time as the next position vectors at various places in this routine.
Since this routine is unlikely to be a computational bottleneck I have favoured clarity over optimal
performance.
- ←Prev
- KAPLIBS – Internal subroutines used within the KAPPA package.
- Next→
- TOC ↑