NCEPLIBS-w3emc 2.12.0
|
Compute number of bits and round field. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | getbit (ibm, ibs, ids, len, mg, g, ground, gmin, gmax, nbit) |
The number of bits required to pack a given field. | |
subroutine getbit | ( | ibm, | |
ibs, | |||
ids, | |||
len, | |||
dimension(len) | mg, | ||
dimension(len) | g, | ||
dimension(len) | ground, | ||
gmin, | |||
gmax, | |||
nbit | |||
) |
The number of bits required to pack a given field.
The field is rounded off to the decimal scaling for packing. The minimum and maximum rounded field values are also returned. For particular binary and decimal scalings is computed. Grib bitmap masking for valid data is optionally used.
Program history log:
[in] | IBM | Integer bitmap flag (=0 for no bitmap). |
[in] | IBS | Integer binary scaling (e.g. ibs=3 to round field to nearest eighth value). |
[in] | IDS | Integer decimal scaling (e.g. ids=3 to round field to nearest milli-value) (note that ids and ibs can both be nonzero, e.g. ids=1 and ibs=1 rounds to the nearest twentieth). |
[in] | LEN | Integer length of the field and bitmap. |
[in] | MG | Integer (LEN) bitmap if ibm=1 (0 to skip, 1 to keep). |
[in] | G | Real (LEN) field. |
[out] | GROUND | Real (LEN) field rounded to decimal and binary scaling (set to zero where bitmap is 0 if ibm=1). |
[out] | GMIN | Real minimum valid rounded field value. |
[out] | GMAX | Real maximum valid rounded field value. |
[out] | NBIT | Integer number of bits to pack. |