diff --git a/definitions/grib2/boot.def b/definitions/grib2/boot.def index b92116397..c3e5d876d 100644 --- a/definitions/grib2/boot.def +++ b/definitions/grib2/boot.def @@ -20,6 +20,7 @@ constant grib2divider = 1000000; alias extraDimensionPresent = zero; transient angleSubdivisions = grib2divider; # micro degrees transient forceStepUnits = 255 : hidden; +transient minus_one = -1: hidden; meta gts_header gts_header() : no_copy,hidden,read_only; meta gts_TTAAii gts_header(20,6) : no_copy,hidden,read_only; diff --git a/definitions/grib2/parameters.def b/definitions/grib2/parameters.def index aa2b41abe..6f4fdfccb 100644 --- a/definitions/grib2/parameters.def +++ b/definitions/grib2/parameters.def @@ -27,7 +27,8 @@ concept cfVarNameECMF (cfVarNameLegacyECMF,"cfVarName.def",conceptsMasterDir,con concept cfVarName (cfVarNameECMF,"cfVarName.def",conceptsDir2,conceptsDir1): no_copy,dump; if (tablesVersion >= 31 ) { - concept chemId (zero,"chemId.def",conceptsDir2,conceptsDir1): no_copy,long_type,dump; + # Note: 0 is a valid chemId + concept chemId (minus_one,"chemId.def",conceptsDir2,conceptsDir1): no_copy,long_type,dump; concept chemName (unknown,"chemName.def",conceptsDir2,conceptsDir1): no_copy,dump; concept chemShortName (unknown,"chemShortName.def",conceptsDir2,conceptsDir1): no_copy,dump; concept chemFormula (unknown,"chemFormula.def",conceptsDir2,conceptsDir1): no_copy,dump; diff --git a/tests/grib2_paramid_chemid_split.sh b/tests/grib2_paramid_chemid_split.sh index 05a1a9dd0..0732ed51e 100755 --- a/tests/grib2_paramid_chemid_split.sh +++ b/tests/grib2_paramid_chemid_split.sh @@ -42,7 +42,7 @@ result=$( ${tools_dir}/grib_get -f -p is_chemical $tempGribB ) # Test non-chemical e.g. temperature. Now chem keys are present but unknown ${tools_dir}/grib_set -s tablesVersion=32,discipline=0,parameterCategory=0,parameterNumber=0 $sample $tempGribA -grib_check_key_equals $tempGribA "chemId,chemName,chemShortName" "0 unknown unknown" +grib_check_key_equals $tempGribA "chemId,chemName,chemShortName" "-1 unknown unknown" # Clean up