ESMF_CFIODownBit
- GRIB-based compression pre-conditioner
This routine returns a lower precision version of the input array
x
which retains nbits
of precision. See routine
ESMF\_CFIODownBit2D
for additional details. This version for
rank 3 arrays, calls ESMF\_CFIODownBit2D()
for each vertical
level.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in) | :: | x(:,:,:) |
input array |
||
real(kind=REAL32), | intent(out) | :: | xr(:,:,:) |
precision reduced array; can if it has same kind |
||
integer, | intent(in) | :: | nbits |
number of bits per word to retain - no action if nbits<1 |
||
real, | intent(in), | optional | :: | undef | ||
logical, | intent(in), | optional | :: | flops |
if true, uses slower float point based algorithm |
|
integer, | intent(out) | :: | rc |
error code = 0 - all is well /= 0 - something went wrong |
ESMF_CFIODownBit
- GRIB-based compression pre-conditioner
This routine returns a lower precision version of the input array
x
which retains nbits
of precision. Two algorithms are
implemented: 1) a fast one writen in C which downgrades precision
by shifting xbits = 24 - nbits
bits of the mantissa, and 2) a slower
float point based algorithm which is the same algorithm as GRIB
with fixed number of bits packing. Notice that as in GRIB the scaling
factor is forced to be a power of 2 rather than a generic float.
Using this power of 2 binary scaling has the advantage of improving
the GZIP compression rates.
This routine returns an array of the same type and kind as the input array, so no data compression has taken place. The goal here is to reduce the entropy in the input array, thereby improving compression rates by the lossless algorithms implemented internally by HDF-4/5 when writing these data to a file. In fact, these GZIP’ed and pre-conditioned files have sizes comparable to the equivalent GRIB file, while being a bonafide self-describing HDF/NetCDF file.
@note Todo : Perhaps implement GRIB decimal scaling (variable number of bits).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in) | :: | x(:,:) |
input array |
||
real(kind=REAL32), | intent(out) | :: | xr(:,:) |
precision reduced array; can share storage with input array if it has same kind |
||
integer, | intent(in) | :: | nbits |
number of bits per word to retain |
||
real, | intent(in), | optional | :: | undef |
missing value |
|
logical, | intent(in), | optional | :: | flops |
if true, uses slower float point based algorithm |
|
integer, | intent(out) | :: | rc |
error code = 0 - all is well /= 0 - something went wrong |