ESMF_CFIODownBit Interface

public interface ESMF_CFIODownBit

Called by

interface~~esmf_cfiodownbit~~CalledByGraph interface~esmf_cfiodownbit ESMF_CFIODownBit proc~mapl_cfiowritebundlewait MAPL_CFIOWriteBundleWait proc~mapl_cfiowritebundlewait->interface~esmf_cfiodownbit program~utdownbit utDownBit program~utdownbit->interface~esmf_cfiodownbit

Module Procedures

private subroutine ESMF_CFIODownBit3D_(x, xr, nbits, undef, flops, rc)

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.

History

  • 06Dec2006 da Silva Initial version.

Arguments

Type IntentOptional 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

private subroutine ESMF_CFIODownBit2D_(x, xr, nbits, undef, flops, rc)

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).

History

  • 06Dec2006 da Silva Initial version.

Arguments

Type IntentOptional 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