eccodes/definitions/grib2/section.4.def

120 lines
3.7 KiB
Modula-2
Raw Permalink Normal View History

2020-01-28 14:32:34 +00:00
# (C) Copyright 2005- ECMWF.
2019-04-25 12:26:15 +00:00
2013-03-25 12:04:10 +00:00
transient timeRangeIndicator=0 : no_copy,hidden;
transient is_localtime=0 : no_copy,hidden;
2013-03-25 12:04:10 +00:00
position offsetSection4;
section_length[4] section4Length ;
2013-03-25 12:04:10 +00:00
meta section4Pointer section_pointer(offsetSection4,section4Length,4);
unsigned[1] numberOfSection = 4:read_only;
2021-02-06 13:07:35 +00:00
unsigned[2] NV : dump ;
2013-03-25 12:04:10 +00:00
alias numberOfVerticalCoordinateValues=NV ;
alias numberOfCoordinatesValues=NV;
# For table 4.5, code 150 Generalized vertical height coordinate
alias numberOfVerticalGridDescriptors=NV ;
# Product Definition Template Number
transient neitherPresent = 0;
if (centre==7 || centre==46) {
alias disableGrib1LocalSection=true;
2013-03-25 12:04:10 +00:00
}
concept datasetForLocal(unknown) {
"tigge" = {productionStatusOfProcessedData=4;}
"tigge" = {productionStatusOfProcessedData=5;}
"s2s" = {productionStatusOfProcessedData=6;}
"s2s" = {productionStatusOfProcessedData=7;}
2024-02-01 16:08:38 +00:00
"cerise" = {marsClass="ci";}
"era6" = {marsClass="e6";} # for ERA6 parameters with constituentType
"hydro" = {marsClass="ce";} # EFAS/GLOFAS
"hydro" = {marsClass="ul";} # ULYSSES
2022-02-14 12:38:02 +00:00
"fire" = {marsClass="gw";} # Global Wildfire awareness system
"uerra" = {productionStatusOfProcessedData=8;} # UERRA
"uerra" = {productionStatusOfProcessedData=9;}
"uerra" = {productionStatusOfProcessedData=10;} # CARRA/CERRA
"uerra" = {productionStatusOfProcessedData=11;}
"destine" = {productionStatusOfProcessedData=12;} # Destination Earth
"destine" = {productionStatusOfProcessedData=13;}
"era" = {marsClass="e2";}
"era" = {marsClass="e4";}
"era" = {marsClass="ea";}
"era" = {marsClass="ei";}
"era" = {marsClass="em";}
"era" = {marsClass="ep";}
"era" = {marsClass="er";}
"era" = {marsClass="et";}
"era" = {marsClass="l5";}
"unknown" = { dummy=1; }
}
if (!(datasetForLocal is "unknown")) {
2021-09-21 14:28:31 +00:00
constant conceptsDir2 = "grib2/localConcepts/[datasetForLocal]": hidden;
constant conceptsDir1 = "grib2": hidden;
}
2013-03-25 12:04:10 +00:00
codetable[2] productDefinitionTemplateNumber('4.0.table',masterDir,localDir) : dump;
if (section2Used == 1) {
when (new()) {
set_nofail productDefinitionTemplateNumber=productDefinitionTemplateNumberInternal;
}
}
transient genVertHeightCoords = 0;
if (productDefinitionTemplateNumber >= 32768) {
template productDefinition "grib2/local/[centreForLocal]/template.4.[productDefinitionTemplateNumber:l].def";
} else {
template productDefinition "grib2/template.4.[productDefinitionTemplateNumber:l].def";
}
2013-03-25 12:04:10 +00:00
if (defined(marsStream) && defined(marsType)) {
template_nofail marsKeywords1 "mars/grib.[marsStream:s].[marsType:s].def";
2013-03-25 12:04:10 +00:00
}
template parameters "grib2/parameters.def";
# Hook for local extras
template_nofail extras "grib2/local/[centre]/section4_extras.def";
2013-03-25 12:04:10 +00:00
# Detect if this is for Generalized vertical height coordinates
if (defined(typeOfFirstFixedSurface)) {
if (typeOfFirstFixedSurface == 150) {
transient genVertHeightCoords = 1;
transient PVPresent = 0;
2013-03-25 12:04:10 +00:00
}
}
if (genVertHeightCoords) {
# Generalized vertical height coordinate case
2021-02-06 13:07:35 +00:00
ieeefloat nlev : dump ;
ieeefloat numberOfVGridUsed : dump;
byte[16] uuidOfVGrid : dump;
alias numberOfVerticalCoordinateValues = nlev;
alias numberOfCoordinatesValues = nlev;
alias numberOfVerticalGridDescriptors = nlev;
2013-03-25 12:04:10 +00:00
}
else {
if (NV == 0){
2013-03-25 12:04:10 +00:00
transient PVPresent = 0;
} else {
transient PVPresent = 1;
}
# See GRIB-547
if (PVPresent || NV>0){
2013-03-25 12:04:10 +00:00
ieeefloat pv[numberOfCoordinatesValues] : dump;
alias vertical.pv=pv;
}
# GRIB-534: To easily remove vertical coordinates, set this key to 1
concept_nofail deletePV(unknown) {
"1" = { PVPresent=0; NV=0; }
}
2013-03-25 12:04:10 +00:00
}
meta md5Section4 md5(offsetSection4,section4Length);