The packing codes are used in the PAKSPEC.CODE record field and specify the packing method for the data. Each code is stored in an integer at least 32 bits long.
Only two packing methods are currently defined. They
both apply to gridded fields only. The first one has a
code value of 1 and is called NMC scaling. This method
packs data for each of the grid points of the last
Level 1 dimension over all of the other
Level 1 dimensions. For example, if the
Level 1 dimensions consist of an array of
, then the data will be packed over the
values for each of the six grid points in
the third dimension of the array. This method needs two
parameters for each grid point to unpack the data. One
parameter is the midpoint of the data,
defined as
The other parameter is a scaling factor, given as
The data are then packed by using
The packed data values and the
parameter are short integers. The parameter
is a
floating-point number. These
parameters are stored as
in the
PAKVAL.INFO field.
Note that
and
are vectors. To unpack the
data, the reverse procedure is followed:
The second packing method is somewhat similar to the first. There are three parameters. The first is a pointer into the Level 1 indices to indicate which dimension the packing applies. Using the example above, this value would be 2 (assuming a starting point of 0.) The next two parameters are very similar to the two parameters above. The first parameter is the minimum value of the data and the second is a scaling factor, given as
The data are then packed by using
The packed data are short integers, while the two parameters are
floating-point values. The
parameters are stored as
in the PAKVAL.INFO field. Note that
and
are vectors. To unpack
the data, the reverse procedure is followed:
The advantage to the first method is that more precision is retained than in the second method. The disadvantage is that exponentiation must be used in unpacking the data, which is a slow and computationally costly step.