From 9c3bb208e01f5069ae715ac535c9a2df5ff9b923 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 8 Dec 2015 17:47:24 +0000 Subject: [PATCH] GRIB-873: Encoding of simulated satellite data in grib2 --- definitions/Makefile.am | 1 + definitions/grib1/mars_labeling.def | 2 +- .../grib2/grib2LocalSectionNumber.98.table | 1 + definitions/grib2/local.98.192.def | 20 +++++++++++++++++++ src/grib_accessor_class_local_definition.c | 1 + 5 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 definitions/grib2/local.98.192.def diff --git a/definitions/Makefile.am b/definitions/Makefile.am index 2e04303d7..d46b14039 100644 --- a/definitions/Makefile.am +++ b/definitions/Makefile.am @@ -7836,6 +7836,7 @@ dist_definitionsgrib2_DATA = \ grib2/local.98.15.def\ grib2/local.98.16.def\ grib2/local.98.18.def\ + grib2/local.98.192.def\ grib2/local.98.20.def\ grib2/local.98.21.def\ grib2/local.98.24.def\ diff --git a/definitions/grib1/mars_labeling.def b/definitions/grib1/mars_labeling.def index a69ea33dd..63fc30abd 100644 --- a/definitions/grib1/mars_labeling.def +++ b/definitions/grib1/mars_labeling.def @@ -20,5 +20,5 @@ alias mars.type = marsType; alias mars.stream = marsStream; alias mars.expver = experimentVersionNumber; -alias mars.domain = globalDomain; # For now... +alias mars.domain = globalDomain; # For now... diff --git a/definitions/grib2/grib2LocalSectionNumber.98.table b/definitions/grib2/grib2LocalSectionNumber.98.table index 7857b0c8f..c26fccce9 100644 --- a/definitions/grib2/grib2LocalSectionNumber.98.table +++ b/definitions/grib2/grib2LocalSectionNumber.98.table @@ -17,4 +17,5 @@ 36 36 MARS labelling for long window 4DVar system 38 38 4D variational increments for long window 4DVar system 39 39 4DVar model errors for long window 4Dvar system +192 192 Multiple ECMWF local definitions 300 300 Multi-dimensional parameters diff --git a/definitions/grib2/local.98.192.def b/definitions/grib2/local.98.192.def new file mode 100644 index 000000000..583ab2f68 --- /dev/null +++ b/definitions/grib2/local.98.192.def @@ -0,0 +1,20 @@ +# Copyright 2005-2015 ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +# GRIB2 Local Definition 192: Multiple ECMWF local definitions + +unsigned[1] numberOfLocalDefinitions = 2 : dump; + +if (numberOfLocalDefinitions == 2 ) { + unsigned[1] subLocalDefinitionNumber1 = 1 : dump; + template subDefinitions1 "grib2/local.98.[subLocalDefinitionNumber1].def"; + + unsigned[1] subLocalDefinitionNumber2 = 24 : dump; + template subDefinitions2 "grib2/local.98.[subLocalDefinitionNumber2].def"; +} diff --git a/src/grib_accessor_class_local_definition.c b/src/grib_accessor_class_local_definition.c index 2f8d0bc52..cf5ceb93c 100644 --- a/src/grib_accessor_class_local_definition.c +++ b/src/grib_accessor_class_local_definition.c @@ -281,6 +281,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len) case 28: /* COSMO local area EPS */ case 38: /* 4D variational increments for long window 4Dvar system */ case 39: /* 4DVar model errors for long window 4Dvar system */ + case 192: /* Multiple ECMWF local definitions */ if (isInstant) { productDefinitionTemplateNumberNew=0; } else {