From f11e63fda81abdb3f3b4d4f4c7d9e555fdd2f3b6 Mon Sep 17 00:00:00 2001 From: Robert Osinski Date: Mon, 17 Jun 2024 10:17:46 +0000 Subject: [PATCH] Fix with chem/srcsink id for non chemical parameters --- definitions/grib2/boot.def | 1 + definitions/grib2/parameters.def | 59 ++++++++++++-------------------- 2 files changed, 23 insertions(+), 37 deletions(-) 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 0797caba0..56320917e 100644 --- a/definitions/grib2/parameters.def +++ b/definitions/grib2/parameters.def @@ -2,54 +2,38 @@ transient dummyc=0: hidden; -concept paramIdLegacyECMF (defaultParameter,"paramId.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy,hidden; +concept paramIdLegacyECMF(defaultParameter,"paramId.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy,hidden; concept paramIdECMF (paramIdLegacyECMF,"paramId.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy; -concept paramIdFallback (paramIdECMF,"paramId.def",conceptsDir2,conceptsDir1): long_type; +concept paramId (paramIdECMF,"paramId.def",conceptsDir2,conceptsDir1): long_type; -concept shortNameLegacyECMF (defaultShortName,"shortName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden; +concept shortNameLegacyECMF(defaultShortName,"shortName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden; concept shortNameECMF (shortNameLegacyECMF,"shortName.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy; -concept shortNameFallback (shortNameECMF,"shortName.def",conceptsDir2,conceptsDir1): no_copy,dump; +concept ls.shortName (shortNameECMF,"shortName.def",conceptsDir2,conceptsDir1): no_copy,dump; -concept unitsLegacyECMF (defaultName,"units.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden,read_only; +concept unitsLegacyECMF(defaultName,"units.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden,read_only; concept unitsECMF (unitsLegacyECMF,"units.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy, read_only; -concept unitsFallback (unitsECMF,"units.def",conceptsDir2,conceptsDir1): no_copy, read_only; +concept units (unitsECMF,"units.def",conceptsDir2,conceptsDir1): no_copy, read_only; -concept nameLegacyECMF (defaultName,"name.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden; -concept nameECMF (nameLegacyECMF,"name.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy; -concept nameFallback (nameECMF,"name.def",conceptsDir2,conceptsDir1): no_copy,dump; +concept nameLegacyECMF(defaultName,"name.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden; +concept nameECMF(nameLegacyECMF,"name.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy; +concept name(nameECMF,"name.def",conceptsDir2,conceptsDir1): no_copy,dump; -concept cfNameLegacyECMF (defaultShortName,"cfName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden; -concept cfNameECMF (cfNameLegacyECMF,"cfName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy; -concept cfNameFallback (cfNameECMF,"cfName.def",conceptsDir2,conceptsDir1) : no_copy,dump; +concept cfNameLegacyECMF(defaultShortName,"cfName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden; +concept cfNameECMF(cfNameLegacyECMF,"cfName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy; +concept cfName(cfNameECMF,"cfName.def",conceptsDir2,conceptsDir1) : no_copy,dump; -concept cfVarNameLegacyECMF (defaultShortName,"cfVarName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden; +concept cfVarNameLegacyECMF(defaultShortName,"cfVarName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden; concept cfVarNameECMF (cfVarNameLegacyECMF,"cfVarName.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy; -concept cfVarNameFallback (cfVarNameECMF,"cfVarName.def",conceptsDir2,conceptsDir1): no_copy,dump; +concept cfVarName (cfVarNameECMF,"cfVarName.def",conceptsDir2,conceptsDir1): no_copy,dump; if (tablesVersion >= 31 ) { - concept paramId (paramIdFallback,"paramId.def",conceptsDir2,conceptsDir1): long_type; - concept ls.shortName (shortNameFallback,"shortName.def",conceptsDir2,conceptsDir1): no_copy,dump; - concept units (unitsFallback,"units.def",conceptsDir2,conceptsDir1): no_copy, read_only; - concept name(nameFallback,"name.def",conceptsDir2,conceptsDir1): no_copy,dump; - concept cfName(cfNameFallback,"cfName.def",conceptsDir2,conceptsDir1) : no_copy,dump; - concept cfVarName (cfVarNameFallback,"cfVarName.def",conceptsDir2,conceptsDir1): no_copy,dump; -} -else { - alias paramId=paramIdFallback; - alias ls.shortName=shortNameFallback; - alias units=unitsFallback; - alias name=nameFallback; - alias cfName=cfNameFallback; - alias cfVarName=cfVarNameFallback; -} - -if (tablesVersion >= 31 ) { - concept chemId (unknown,"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; - if ( !(chemId is "unknown") ) { + if ( !(chemId is minus_one) ) { alias mars.chem = chemId; alias parameter.chemId = chemId; alias ls.chemShortName = chemShortName; @@ -58,11 +42,12 @@ if (tablesVersion >= 31 ) { } if (tablesVersion >= 31 ) { - concept srcSinkId (unknown,"srcSinkId.def",conceptsDir2,conceptsDir1): no_copy,long_type,dump; - concept srcSinkName (unknown,"srcSinkName.def",conceptsDir2,conceptsDir1): no_copy,dump; - concept srcSinkShortName (unknown,"srcSinkShortName.def",conceptsDir2,conceptsDir1): no_copy,dump; + # Note: 0 is a valid srcSinkId + concept srcSinkId (minus_one,"srcSinkId.def",conceptsDir2,conceptsDir1): no_copy,long_type,dump; + concept srcSinkName (unknown,"srcSinkName.def",conceptsDir2,conceptsDir1): no_copy,dump; + concept srcSinkShortName (unknown,"srcSinkShortName.def",conceptsDir2,conceptsDir1): no_copy,dump; - if ( !(srcSinkId is "unknown") ) { + if ( !(srcSinkId is minus_one) ) { alias mars.srcSink = srcSinkId; alias parameter.srcSinkId = srcSinkId; alias ls.srcSinkShortName = srcSinkShortName;