Skip to content

Commit

Permalink
refactor mars.levellist logc so that we don't need to unalias it later
Browse files Browse the repository at this point in the history
  • Loading branch information
sebvi committed Sep 13, 2024
1 parent db8d725 commit 5a96c85
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions definitions/grib2/template.4.horizontal.def
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ if (extraDim) {
alias mars.levelist = dimension;
alias mars.levtype = dimensionType;
} else {
# ECC-1333: levtype should be read-only in GRIB2
concept mars.levtype(unknown,"marsLevtypeConcept.def",conceptsDir2,conceptsDir1):no_copy, read_only;
# GRIB-372: levelist alias does not pertain to surface parameters
transient tempLevtype = levtype; # Faster to copy the concept so we evaluate it once

# See GRIB-74 why we store the pressureUnits in a transient
transient tempPressureUnits=pressureUnits;
# Same as typeOfLevel != "surface" but much quicker to evaluate
Expand All @@ -73,16 +78,11 @@ if (extraDim) {
meta marsLevel scale(level,one,hundred) : read_only;
alias mars.levelist=marsLevel;
} else {
if (tempLevtype isnot "sfc" && tempLevtype isnot "o2d") {
alias mars.levelist = level;
}
}
}
# ECC-1333: levtype should be read-only in GRIB2
concept mars.levtype(unknown,"marsLevtypeConcept.def",conceptsDir2,conceptsDir1):no_copy, read_only;
# GRIB-372: levelist alias does not pertain to surface parameters
transient tempLevtype = levtype; # Faster to copy the concept so we evaluate it once
if (tempLevtype is "sfc" || tempLevtype is "o2d") {
unalias mars.levelist;
}
}

# See ECC-854, ECC-1435, ECC-1451, ECC-1462
Expand Down

0 comments on commit 5a96c85

Please sign in to comment.