From cf2a975b311e3cfe265b4c080b1d8b90353acffa Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Thu, 16 May 2024 15:03:51 +0000 Subject: [PATCH] ECC-1829: Added efi, es and em types to oper stream plus added to test Remaining to decide is behaviour between using endStep vs. using stepRange consistently and consequences. --- definitions/mars/grib.oper.efi.def | 1 + definitions/mars/grib.oper.em.def | 1 + definitions/mars/grib.oper.es.def | 1 + tests/grib_ecc-1829.sh | 24 ++++++++++++++++++------ 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 definitions/mars/grib.oper.efi.def create mode 100644 definitions/mars/grib.oper.em.def create mode 100644 definitions/mars/grib.oper.es.def diff --git a/definitions/mars/grib.oper.efi.def b/definitions/mars/grib.oper.efi.def new file mode 100644 index 000000000..a4cef5d68 --- /dev/null +++ b/definitions/mars/grib.oper.efi.def @@ -0,0 +1 @@ +alias mars.step = stepRange; diff --git a/definitions/mars/grib.oper.em.def b/definitions/mars/grib.oper.em.def new file mode 100644 index 000000000..a4cef5d68 --- /dev/null +++ b/definitions/mars/grib.oper.em.def @@ -0,0 +1 @@ +alias mars.step = stepRange; diff --git a/definitions/mars/grib.oper.es.def b/definitions/mars/grib.oper.es.def new file mode 100644 index 000000000..a4cef5d68 --- /dev/null +++ b/definitions/mars/grib.oper.es.def @@ -0,0 +1 @@ +alias mars.step = stepRange; diff --git a/tests/grib_ecc-1829.sh b/tests/grib_ecc-1829.sh index 971660a71..9e075e6b8 100755 --- a/tests/grib_ecc-1829.sh +++ b/tests/grib_ecc-1829.sh @@ -19,20 +19,32 @@ temp_grib=temp.$label.grib mars_sample=temp.$label.mars.grib sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl -# Setup ensemble GRIB2 message with MARS keys +# Setup GRIB2 message with MARS keys ${tools_dir}/grib_set -s setLocalDefinition=1,grib2LocalSectionNumber=1 $sample_grib2 $mars_sample -# Set ensemble related keys and check number key is present -${tools_dir}/grib_set -s productDefinitionTemplateNumber=1,stream=oper,type=pf $mars_sample $temp_grib +# Now set ensemble related keys and check number key is present +${tools_dir}/grib_set -s stream=oper,type=pf,productDefinitionTemplateNumber=1 $mars_sample $temp_grib grib_check_key_exists $temp_grib mars.number -# Now check stepRange is used for mars.step for o2d and o3d fields, and that number is still present -${tools_dir}/grib_set -s productDefinitionTemplateNumber=11,stream=oper,type=pf,param=263101,typeOfLevel=oceanSurface,startStep=0,endStep=6 $mars_sample $temp_grib +# Now set keys and check stepRange is used for mars.step for o2d and o3d fields, and that number is still present +${tools_dir}/grib_set -s stream=oper,type=pf,productDefinitionTemplateNumber=11,param=263101,typeOfLevel=oceanSurface,startStep=0,endStep=6 $mars_sample $temp_grib grib_check_key_exists $temp_grib mars.number grib_check_key_equals $temp_grib "step" "0-6" -${tools_dir}/grib_set -s productDefinitionTemplateNumber=11,stream=oper,type=pf,param=263501,typeOfLevel=oceanModel,level=1,startStep=0,endStep=6 $mars_sample $temp_grib +${tools_dir}/grib_set -s stream=oper,type=pf,productDefinitionTemplateNumber=11,param=263501,typeOfLevel=oceanModel,level=1,startStep=0,endStep=6 $mars_sample $temp_grib grib_check_key_exists $temp_grib mars.number grib_check_key_equals $temp_grib "step" "0-6" +# Now set keys and check stepRange is used for type efi data (just need any template with stat proc keys) +${tools_dir}/grib_set -s stream=oper,type=efi,productDefinitionTemplateNumber=12,startStep=0,endStep=6 $mars_sample $temp_grib +grib_check_key_equals $temp_grib "step" "0-6" + +# Now set keys and check stepRange is used for type em data +${tools_dir}/grib_set -s stream=oper,type=em,productDefinitionTemplateNumber=12,startStep=0,endStep=6 $mars_sample $temp_grib +grib_check_key_equals $temp_grib "step" "0-6" + +# Now set keys and check stepRange is used for type es data +${tools_dir}/grib_set -s stream=oper,type=es,productDefinitionTemplateNumber=12,startStep=0,endStep=6 $mars_sample $temp_grib +grib_check_key_equals $temp_grib "step" "0-6" + # Clean up rm -f $temp_grib $mars_sample