From 9f8c872a4ea9057e84920557afd4ed45ff313f46 Mon Sep 17 00:00:00 2001 From: Robert Osinski Date: Tue, 6 Aug 2024 10:33:46 +0000 Subject: [PATCH] Fixing ctest for paramtype and avoid mars.paramtype array for type chemical --- definitions/grib2/template.4.optical.def | 5 +++-- tests/grib2_paramType.sh | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/definitions/grib2/template.4.optical.def b/definitions/grib2/template.4.optical.def index e0a53ce8e..2ad403f00 100644 --- a/definitions/grib2/template.4.optical.def +++ b/definitions/grib2/template.4.optical.def @@ -7,9 +7,10 @@ if (wavelength_param_split == 1 && chem_param_split == 0){ } if (chem_param_split == 1 && wavelength_param_split == 1){ - constant paramTypeChemical = "chemical_optical" ; + # use paramTypeChemical2 to avoid creating an array for mars.paramtype as paramTypeChemical is defined in template.4.{aerosol,chemical}.def + constant paramTypeChemical2 = "chemical_optical" ; unalias mars.paramtype; - alias mars.paramtype = paramTypeChemical ; + alias mars.paramtype = paramTypeChemical2 ; } codetable[1] typeOfWavelengthInterval ('4.91.table',masterDir,localDir) : dump; diff --git a/tests/grib2_paramType.sh b/tests/grib2_paramType.sh index 89f4c42f6..3cfa088f2 100755 --- a/tests/grib2_paramType.sh +++ b/tests/grib2_paramType.sh @@ -45,11 +45,18 @@ check_param_type_is_scalar $tempGrib 'base' # Optical properties of aerosol +# without wavelength key ${tools_dir}/grib_set -s productDefinitionTemplateNumber=48,discipline=0,parameterCategory=20,parameterNumber=102 \ $sample $tempGrib ${tools_dir}/grib_dump -O -p section_4 $tempGrib > /dev/null -grib_check_key_equals $tempGrib mars.paramtype 'optical' -check_param_type_is_scalar $tempGrib 'optical' +grib_check_key_equals $tempGrib mars.paramtype 'base' +check_param_type_is_scalar $tempGrib 'base' +# with wavelength key +${tools_dir}/grib_set -s tablesVersion=33,productDefinitionTemplateNumber=48,discipline=0,parameterCategory=20,parameterNumber=102 \ + $sample $tempGrib +${tools_dir}/grib_dump -O -p section_4 $tempGrib > /dev/null +grib_check_key_equals $tempGrib mars.paramtype 'chemical_optical' +check_param_type_is_scalar $tempGrib 'chemical_optical' # Generalised tiles ${tools_dir}/grib_set -s productDefinitionTemplateNumber=113 $sample $tempGrib