chemId/paramId split: 0 is a valid chemId. Use -1

This commit is contained in:
shahramn 2024-06-17 10:50:06 +01:00
parent aeee112cb1
commit 444e26d077
3 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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