Merge pull request #66 from mtasaka/test-grib_lam_bf-use-ieee-on-linux32

tests/grib_lam_bf: use ieee instead of ieee64 for linux 32 bit
This commit is contained in:
shahramn 2022-02-01 19:41:28 +00:00 committed by GitHub
commit aad2ed2933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);