From a0f8af1ae64a89a02b837d2b75413d08afc9b5df Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 1 Apr 2023 18:43:29 +0100 Subject: [PATCH] ECC-1563: GRIB2: Introduce new local section 4 templates for extra large ensembles --- .../grib2/{ => local/ecmf}/template.4.65533.def | 0 .../grib2/{ => local/ecmf}/template.4.65534.def | 0 definitions/grib2/tables/local/ecmf/1/4.0.table | 4 ++-- tests/grib2_templates.sh | 15 ++++++++++++++- 4 files changed, 16 insertions(+), 3 deletions(-) rename definitions/grib2/{ => local/ecmf}/template.4.65533.def (100%) rename definitions/grib2/{ => local/ecmf}/template.4.65534.def (100%) diff --git a/definitions/grib2/template.4.65533.def b/definitions/grib2/local/ecmf/template.4.65533.def similarity index 100% rename from definitions/grib2/template.4.65533.def rename to definitions/grib2/local/ecmf/template.4.65533.def diff --git a/definitions/grib2/template.4.65534.def b/definitions/grib2/local/ecmf/template.4.65534.def similarity index 100% rename from definitions/grib2/template.4.65534.def rename to definitions/grib2/local/ecmf/template.4.65534.def diff --git a/definitions/grib2/tables/local/ecmf/1/4.0.table b/definitions/grib2/tables/local/ecmf/1/4.0.table index 191faf786..f929a952b 100644 --- a/definitions/grib2/tables/local/ecmf/1/4.0.table +++ b/definitions/grib2/tables/local/ecmf/1/4.0.table @@ -1,3 +1,3 @@ # Code table 4.0 - Product definition template number -65533 65533 individual member for large ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time -65534 65534 Individual member for large ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval +65533 65533 Individual member for large ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time +65534 65534 Individual member for large ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer, in a continuous or non-continuous interval diff --git a/tests/grib2_templates.sh b/tests/grib2_templates.sh index 0e709621c..403010e2a 100755 --- a/tests/grib2_templates.sh +++ b/tests/grib2_templates.sh @@ -16,6 +16,7 @@ temp1=temp1.$label.grib2 temp2=temp2.$label.grib2 temp=temp.$label.grib2 tempFilt=temp.$label.filt +tempText=temp.$label.txt sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl @@ -123,5 +124,17 @@ $tools_dir/grib_compare -b productDefinitionTemplateNumber $temp1 $temp2 $tools_dir/grib_set -s productDefinitionTemplateNumber=40033 $sample2 $temp $tools_dir/grib_set -s productDefinitionTemplateNumber=40034 $sample2 $temp +# ECC-1563: new local section 4 templates for extra large ensembles +$tools_dir/grib_set -s localTablesVersion=1,productDefinitionTemplateNumber=65533,perturbationNumber=2e8 $sample2 $temp +grib_check_key_equals $temp perturbationNumber '200000000' +$tools_dir/grib_dump -O -p section_4 $temp > $tempText +grep -q "Individual member for large ensemble forecast.*point in time" $tempText -rm -f $temp $temp1 $temp2 $tempFilt +$tools_dir/grib_set -s localTablesVersion=1,productDefinitionTemplateNumber=65534,perturbationNumber=2e8 $sample2 $temp +grib_check_key_equals $temp perturbationNumber,typeOfStatisticalProcessing '200000000 255' +$tools_dir/grib_dump -O -p section_4 $temp > $tempText +grep -q "Individual member for large ensemble forecast.*continuous or non-continuous interval" $tempText + + +# Clean up +rm -f $temp $temp1 $temp2 $tempFilt $tempText