From 4a8bd2acb65d947932952dd9c0039d6858fd8aba Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 May 2019 12:44:41 +0100 Subject: [PATCH] ECC-924: Fixes applied by Philipe Marguinaud (new sample) --- definitions/grib2/template.7.53.def | 1 + samples/lambert_bf_grib2.tmpl | Bin 1870 -> 1874 bytes ..._accessor_class_data_g2bifourier_packing.c | 6 ++++++ 3 files changed, 7 insertions(+) diff --git a/definitions/grib2/template.7.53.def b/definitions/grib2/template.7.53.def index c5490c1f6..14a55813e 100644 --- a/definitions/grib2/template.7.53.def +++ b/definitions/grib2/template.7.53.def @@ -41,6 +41,7 @@ meta codedValues data_g2bifourier_packing( biFourierSubTruncationType, biFourierPackingModeForAxes, biFourierMakeTemplate, + totalNumberOfValuesInUnpackedSubset, numberOfValues ): read_only; diff --git a/samples/lambert_bf_grib2.tmpl b/samples/lambert_bf_grib2.tmpl index ff911025bb2912fa29b12fa636bf122688396f86..bbf5f45a889f5de1d0785267f42046ed58381a2f 100644 GIT binary patch delta 62 zcmX@dcZpBHJ;>AP|9=K11~6a`+9)uYSzehH$SYtlg$Ob*2>3EKfY@9>2n3t=F;8Fy E0FUkph5!Hn delta 58 zcmcb_caBfMJ;>AP|9=K11~6dv+bA%ZSz4YI$SYtlg$Ob*2>3EKfY@9NT$>LuPhbWB DY;FpE diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index 88952f779..66a7209c7 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -41,6 +41,7 @@ MEMBERS= const char* biFourierSubTruncationType MEMBERS= const char* biFourierDoNotPackAxes MEMBERS= const char* biFourierMakeTemplate + MEMBERS= const char* totalNumberOfValuesInUnpackedSubset MEMBERS=const char* numberOfValues END_CLASS_DEF @@ -94,6 +95,7 @@ typedef struct grib_accessor_data_g2bifourier_packing { const char* biFourierSubTruncationType; const char* biFourierDoNotPackAxes; const char* biFourierMakeTemplate; + const char* totalNumberOfValuesInUnpackedSubset; const char* numberOfValues; } grib_accessor_data_g2bifourier_packing; @@ -191,6 +193,7 @@ static void init(grib_accessor* a,const long v, grib_arguments* args) self->biFourierSubTruncationType = grib_arguments_get_name(gh,args,self->carg++); self->biFourierDoNotPackAxes = grib_arguments_get_name(gh,args,self->carg++); self->biFourierMakeTemplate = grib_arguments_get_name(gh,args,self->carg++); + self->totalNumberOfValuesInUnpackedSubset = grib_arguments_get_name(gh,args,self->carg++); /*self->numberOfValues = grib_arguments_get_name(gh,args,self->carg++);*/ a->flags |= GRIB_ACCESSOR_FLAG_DATA; @@ -931,6 +934,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len) grib_buffer_replace (a, buf, buflen, 1, 1); + if ((ret = grib_set_long_internal (gh, self->totalNumberOfValuesInUnpackedSubset, bt->n_vals_sub)) != GRIB_SUCCESS) + goto cleanup; + if ((ret = grib_set_long_internal (gh, self->number_of_values, bt->n_vals_bif)) != GRIB_SUCCESS) goto cleanup;