2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-16 14:03:40 +00:00
|
|
|
# Type of first fixed surface
|
2023-07-24 18:45:26 +00:00
|
|
|
codetable[1] typeOfFirstFixedSurface ('4.5.table',masterDir,localDir) : dump,edition_specific,string_type;
|
2013-03-25 12:04:10 +00:00
|
|
|
meta unitsOfFirstFixedSurface codetable_units(typeOfFirstFixedSurface) : dump;
|
|
|
|
meta nameOfFirstFixedSurface codetable_title(typeOfFirstFixedSurface) : dump;
|
|
|
|
|
2023-08-16 14:03:40 +00:00
|
|
|
# Scale factor of first fixed surface
|
2023-07-24 18:45:26 +00:00
|
|
|
signed[1] scaleFactorOfFirstFixedSurface = missing() : can_be_missing,dump,edition_specific;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-16 14:03:40 +00:00
|
|
|
# Scaled value of first fixed surface
|
2023-07-24 18:45:26 +00:00
|
|
|
unsigned[4] scaledValueOfFirstFixedSurface = missing() : can_be_missing,dump,edition_specific;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-16 14:03:40 +00:00
|
|
|
# Type of second fixed surface
|
2023-07-24 18:45:26 +00:00
|
|
|
codetable[1] typeOfSecondFixedSurface ('4.5.table',masterDir,localDir) = 255 : dump,edition_specific;
|
2013-04-11 10:39:04 +00:00
|
|
|
meta unitsOfSecondFixedSurface codetable_units(typeOfSecondFixedSurface) : dump;
|
|
|
|
meta nameOfSecondFixedSurface codetable_title(typeOfSecondFixedSurface) : dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-16 14:03:40 +00:00
|
|
|
# Scale factor of second fixed surface
|
2023-07-24 18:45:26 +00:00
|
|
|
signed[1] scaleFactorOfSecondFixedSurface = missing() : can_be_missing,dump,edition_specific;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2023-08-16 14:03:40 +00:00
|
|
|
# Scaled value of second fixed surface
|
2023-07-24 18:45:26 +00:00
|
|
|
unsigned[4] scaledValueOfSecondFixedSurface = missing() : can_be_missing,dump,edition_specific;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
transient pressureUnits="hPa";
|
|
|
|
|
2024-06-22 12:41:31 +00:00
|
|
|
concept vertical.typeOfLevel (unknown,"typeOfLevelConcept.def",conceptsDir2,conceptsDir1);
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
alias levelType=typeOfFirstFixedSurface;
|
|
|
|
|
2015-03-11 14:00:13 +00:00
|
|
|
if (typeOfSecondFixedSurface == 255) {
|
|
|
|
# Only one surface
|
2013-03-25 12:04:10 +00:00
|
|
|
meta level g2level(typeOfFirstFixedSurface,
|
|
|
|
scaleFactorOfFirstFixedSurface,
|
|
|
|
scaledValueOfFirstFixedSurface,
|
|
|
|
pressureUnits) :dump;
|
2015-03-11 14:00:13 +00:00
|
|
|
transient bottomLevel=level; # Do not use alias (see GRIB-725)
|
|
|
|
transient topLevel=level;
|
2013-03-25 12:04:10 +00:00
|
|
|
} else {
|
2015-03-11 14:00:13 +00:00
|
|
|
# Two surfaces
|
2013-03-25 12:04:10 +00:00
|
|
|
meta topLevel g2level(typeOfFirstFixedSurface,
|
|
|
|
scaleFactorOfFirstFixedSurface,
|
|
|
|
scaledValueOfFirstFixedSurface,
|
|
|
|
pressureUnits) :dump;
|
|
|
|
meta bottomLevel g2level(typeOfSecondFixedSurface,
|
|
|
|
scaleFactorOfSecondFixedSurface,
|
|
|
|
scaledValueOfSecondFixedSurface,
|
|
|
|
pressureUnits) :dump;
|
2015-03-11 14:00:13 +00:00
|
|
|
alias level=topLevel; # (see GRIB-725)
|
2022-02-22 17:27:41 +00:00
|
|
|
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
|
|
|
alias ls.level=level;
|
|
|
|
alias vertical.level=level;
|
|
|
|
alias vertical.bottomLevel=bottomLevel;
|
|
|
|
alias vertical.topLevel=topLevel;
|
|
|
|
|
2023-11-22 10:51:00 +00:00
|
|
|
alias extraDim=false;
|
2013-03-25 12:04:10 +00:00
|
|
|
if (defined(extraDimensionPresent)) {
|
2013-07-23 17:06:45 +00:00
|
|
|
if (extraDimensionPresent) {
|
2023-11-22 10:51:00 +00:00
|
|
|
alias extraDim=true;
|
2013-07-23 17:06:45 +00:00
|
|
|
}
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
|
|
|
if (extraDim) {
|
2013-07-23 17:06:45 +00:00
|
|
|
alias mars.levelist = dimension;
|
|
|
|
alias mars.levtype = dimensionType;
|
2013-03-25 12:04:10 +00:00
|
|
|
} else {
|
2014-07-16 13:47:24 +00:00
|
|
|
# See GRIB-74 why we store the pressureUnits in a transient
|
|
|
|
transient tempPressureUnits=pressureUnits;
|
2024-04-15 15:31:43 +00:00
|
|
|
# Same as typeOfLevel != "surface" but much quicker to evaluate
|
|
|
|
# than via the concept
|
|
|
|
if ( ! (typeOfFirstFixedSurface == 1 && typeOfSecondFixedSurface == 255) ) {
|
2014-07-16 13:47:24 +00:00
|
|
|
if (tempPressureUnits is "Pa") {
|
2013-07-23 17:06:45 +00:00
|
|
|
meta marsLevel scale(level,one,hundred) : read_only;
|
|
|
|
alias mars.levelist=marsLevel;
|
|
|
|
} else {
|
|
|
|
alias mars.levelist = level;
|
|
|
|
}
|
|
|
|
}
|
2022-01-27 19:04:41 +00:00
|
|
|
# ECC-1333: levtype should be read-only in GRIB2
|
2023-10-02 11:54:37 +00:00
|
|
|
concept mars.levtype(unknown,"marsLevtypeConcept.def",conceptsDir2,conceptsDir1):no_copy, read_only;
|
2013-07-23 17:06:45 +00:00
|
|
|
# GRIB-372: levelist alias does not pertain to surface parameters
|
2024-04-17 14:32:58 +00:00
|
|
|
transient tempLevtype = levtype; # Faster to copy the concept so we evaluate it once
|
|
|
|
if (tempLevtype is "sfc" || tempLevtype is "o2d") {
|
2013-07-23 17:06:45 +00:00
|
|
|
unalias mars.levelist;
|
|
|
|
}
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
2018-12-17 17:07:12 +00:00
|
|
|
|
2022-11-03 17:13:19 +00:00
|
|
|
# See ECC-854, ECC-1435, ECC-1451, ECC-1462
|
2022-08-04 10:19:22 +00:00
|
|
|
if( (typeOfFirstFixedSurface == 151 && typeOfSecondFixedSurface == 151) ||
|
|
|
|
(typeOfFirstFixedSurface == 152 && typeOfSecondFixedSurface == 152) ||
|
2022-11-03 17:13:19 +00:00
|
|
|
(typeOfFirstFixedSurface == 168 && typeOfSecondFixedSurface == 168) ||
|
2022-08-04 10:19:22 +00:00
|
|
|
(typeOfFirstFixedSurface == 114 && typeOfSecondFixedSurface == 114) ) {
|
2018-12-17 17:07:12 +00:00
|
|
|
alias mars.levelist = bottomLevel;
|
2022-10-10 15:21:15 +00:00
|
|
|
alias ls.level = bottomLevel;
|
|
|
|
alias vertical.level = bottomLevel;
|
2018-12-17 17:07:12 +00:00
|
|
|
}
|
|
|
|
|
2013-03-25 12:04:10 +00:00
|
|
|
alias ls.typeOfLevel=typeOfLevel;
|