ECC-1829: Test for introduction of grib.oper.pf.def.

This commit is contained in:
Matthew Griffith 2024-05-15 10:56:08 +00:00 committed by shahramn
parent dfdb16b337
commit 6882914944
2 changed files with 39 additions and 0 deletions

View File

@ -148,6 +148,7 @@ if( HAVE_BUILD_TOOLS )
grib_ecc-1691 grib_ecc-1691
grib_ecc-1766 grib_ecc-1766
grib_ecc-1806 grib_ecc-1806
grib_ecc-1829
bufr_ecc-1028 bufr_ecc-1028
bufr_ecc-1195 bufr_ecc-1195
bufr_ecc-1259 bufr_ecc-1259

38
tests/grib_ecc-1829.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
# (C) Copyright 2005- 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.
#
. ./include.ctest.sh
REDIRECT=/dev/null
# ECC-1829: Add MARS support for stream & type combinations required for AIFS ensemble
label="grib_ecc-1829_test"
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
${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
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
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
grib_check_key_exists $temp_grib mars.number
grib_check_key_equals $temp_grib "step" "0-6"
# Clean up
rm -f $temp_grib $mars_sample