Encoding of spherical harmonics when truncation less than 20

This commit is contained in:
Pedro Maciel 2019-01-10 19:24:40 -07:00
parent 6ce3607c1e
commit 5b9fd7f621
1 changed files with 4 additions and 3 deletions

View File

@ -1202,9 +1202,10 @@ grib_handle* grib_util_set_spec2(grib_handle* h,
{
SET_STRING_VALUE("packingType", "spectral_complex");
packingTypeIsSet=1;
SET_LONG_VALUE("JS", 20);
SET_LONG_VALUE("KS", 20);
SET_LONG_VALUE("MS", 20);
long JS = spec->truncation < 20 ? spec->truncation : 20;
SET_LONG_VALUE("JS", JS);
SET_LONG_VALUE("KS", JS);
SET_LONG_VALUE("MS", JS);
if (packing_spec->packing == GRIB_UTIL_PACKING_USE_PROVIDED && editionNumber==2 ) {
SET_LONG_VALUE("computeLaplacianOperator", 1);
} else if ((!(*err) && strcmp(input_grid_type,"sh")) || packing_spec->computeLaplacianOperator ) {