tests/grib_lam_bf: use ieee instead of ieee64 for linux 32 bit

"unpackedSubsetPrecision" value is used for "ieee_floats".
ieee_floats=2 means bytes=8 and grib_long_to_ieee64 is used,
which is supported only when sizeof(double) == sizeof(long) .

Use unpackedSubsetPrecision=1 on linux 32 bit system, which means
grib_long_to_ieee is to be used.

Note that this test is currently disabled on Windows.
This commit is contained in:
Mamoru TASAKA 2021-12-21 17:21:55 +09:00
parent bf09266b21
commit 9900658d22
1 changed files with 10 additions and 1 deletions

View File

@ -768,7 +768,16 @@ int main(int argc, char* argv[])
GRIB_CHECK(grib_set_long(h, "biFourierResolutionSubSetParameterM", trunc[itrunc].subnmsmax), 0);
GRIB_CHECK(grib_set_long(h, "biFourierSubTruncationType", trunc[itrunc].subtrunc), 0);
GRIB_CHECK(grib_set_long(h, "biFourierPackingModeForAxes", 1), 0);
GRIB_CHECK(grib_set_long(h, "unpackedSubsetPrecision", 2), 0);
/* "unpackedSubsetPrecision" value is used for "ieee_floats".
ieee_floats=2 means bytes=8 and grib_long_to_ieee64 is used, which is supported
only when sizeof(double) == sizeof(long)
*/
long unpackedSubsetPrecision;
if (sizeof(double) == sizeof(long))
unpackedSubsetPrecision = 2;
else
unpackedSubsetPrecision = 1;
GRIB_CHECK(grib_set_long(h, "unpackedSubsetPrecision", unpackedSubsetPrecision), 0);
len = trunc[itrunc].len;
GRIB_CHECK(grib_set_double_array(h, "values", trunc[itrunc].values, len), 0);