NCEPLIBS-w3emc 2.12.0
|
Pack positive differences in least bits. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | w3fi58 (ifield, npts, nwork, npfld, nbits, len, kmin) |
Converts an array of integer numbers into an array of positive differences (number(s) - minimum value) and packs the magnitude of each difference right-adjusted into the least number of bits that holds the largest difference. | |
subroutine w3fi58 | ( | integer, dimension(*) | ifield, |
npts, | |||
integer, dimension(*) | nwork, | ||
character*1, dimension(*) | npfld, | ||
nbits, | |||
len, | |||
kmin | |||
) |
Converts an array of integer numbers into an array of positive differences (number(s) - minimum value) and packs the magnitude of each difference right-adjusted into the least number of bits that holds the largest difference.
Program history log:
[in] | IFIELD | Array of integer data for processing. |
[in] | NPTS | Number of data values to process in IFIELD (and nwork) where, npts > 0. |
[out] | NWORK | Work array with integer difference |
[out] | NPFLD | Array for packed data (character*1) (user is responsible for an adequate dimension.) |
[out] | NBITS | Number of bits used to pack data where, 0 < nbits < 32 (the maximum difference without overflow is 2**31 -1) |
[out] | LEN | Number of packed bytes in npfld (set to 0 if no packing) where, len = (nbits * npts + 7) / 8 without remainder |
[out] | KMIN | Minimum value (subtracted from each datum). If this packed data is being used for grib data, the programer will have to convert the KMIN value to an IBM370 32 bit floating point number. |