2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
position offsetSection1;
|
2014-06-21 21:28:40 +00:00
|
|
|
section_length[4] section1Length ;
|
2013-03-25 12:04:10 +00:00
|
|
|
meta section1Pointer section_pointer(offsetSection1,section1Length,1);
|
|
|
|
|
|
|
|
unsigned[1] numberOfSection = 1 :read_only;
|
|
|
|
|
2017-02-16 18:08:25 +00:00
|
|
|
codetable[2] centre 'common/c-11.table' : dump,string_type;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias identificationOfOriginatingGeneratingCentre=centre;
|
|
|
|
meta centreDescription codetable_title(centre);
|
|
|
|
|
|
|
|
alias parameter.centre=centre;
|
|
|
|
alias ls.centre=centre;
|
|
|
|
alias originatingCentre=centre;
|
|
|
|
|
|
|
|
unsigned[2] subCentre : dump;
|
|
|
|
|
|
|
|
_if (subCentre==98 ) {
|
2021-02-06 13:07:35 +00:00
|
|
|
alias centreForLocal=subCentre;
|
2013-03-25 12:04:10 +00:00
|
|
|
} else {
|
2021-02-06 13:07:35 +00:00
|
|
|
alias centreForLocal=centre;
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
|
|
|
|
2021-02-02 15:13:01 +00:00
|
|
|
codetable[1] tablesVersion 'grib2/tables/1.0.table' = tablesVersionLatestOfficial : edition_specific;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias gribMasterTablesVersionNumber=tablesVersion;
|
|
|
|
|
|
|
|
transient masterDir="grib2/tables/[tablesVersion]";
|
2019-08-07 17:03:40 +00:00
|
|
|
if (tablesVersion > tablesVersionLatest) {
|
|
|
|
transient masterDir="grib2/tables/[tablesVersionLatest]";
|
|
|
|
}
|
2013-03-25 12:04:10 +00:00
|
|
|
when (tablesVersion!=255) {
|
|
|
|
set masterDir="grib2/tables/[tablesVersion]";
|
|
|
|
} else {
|
|
|
|
set masterDir="grib2/tables/4";
|
|
|
|
}
|
|
|
|
|
2019-01-04 14:27:20 +00:00
|
|
|
codetable[1] localTablesVersion 'grib2/tables/local/[centreForLocal]/1.1.table' ;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias versionNumberOfGribLocalTables=localTablesVersion;
|
|
|
|
|
|
|
|
transient localDir="";
|
2019-01-04 14:27:20 +00:00
|
|
|
if (localTablesVersion != 0 and localTablesVersion != 255) {
|
2014-04-11 16:42:16 +00:00
|
|
|
transient localDir="grib2/tables/local/[centre]/[localTablesVersion]";
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
|
|
|
|
2019-01-02 16:39:33 +00:00
|
|
|
# Significance of Reference Time
|
2013-03-25 12:04:10 +00:00
|
|
|
codetable[1] significanceOfReferenceTime ('1.2.table',masterDir,localDir) = 1 : dump;
|
|
|
|
|
2021-02-06 13:07:35 +00:00
|
|
|
# Year (4 digits)
|
|
|
|
unsigned[2] year;
|
|
|
|
unsigned[1] month;
|
|
|
|
unsigned[1] day;
|
|
|
|
unsigned[1] hour;
|
|
|
|
unsigned[1] minute;
|
|
|
|
unsigned[1] second;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2021-02-06 13:07:35 +00:00
|
|
|
meta dataDate g2date(year,month,day) : dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias mars.date = dataDate;
|
|
|
|
alias ls.date = dataDate;
|
|
|
|
|
|
|
|
meta julianDay julian_day(dataDate,hour,minute,second) : edition_specific;
|
|
|
|
|
2021-02-06 13:07:35 +00:00
|
|
|
meta dataTime time(hour,minute,second) : dump;
|
2013-03-25 12:04:10 +00:00
|
|
|
alias mars.time = dataTime;
|
|
|
|
|
2019-01-02 16:39:33 +00:00
|
|
|
# Production status of processed data in this GRIB message
|
2013-03-25 12:04:10 +00:00
|
|
|
codetable[1] productionStatusOfProcessedData ('1.3.table',masterDir,localDir) : dump;
|
|
|
|
|
2019-01-02 16:39:33 +00:00
|
|
|
# Type of processed data in this GRIB message
|
2013-03-25 12:04:10 +00:00
|
|
|
codetable[1] typeOfProcessedData ('1.4.table',masterDir,localDir) = 255 : dump,string_type,no_fail;
|
|
|
|
|
|
|
|
alias ls.dataType=typeOfProcessedData;
|
|
|
|
|
|
|
|
meta md5Section1 md5(offsetSection1,section1Length);
|
|
|
|
|
2013-08-01 15:42:45 +00:00
|
|
|
meta selectStepTemplateInterval select_step_template(productDefinitionTemplateNumber,0); # 0 -> not instant
|
|
|
|
meta selectStepTemplateInstant select_step_template(productDefinitionTemplateNumber,1); # 1 -> instant
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
transient stepTypeInternal="instant" : hidden,no_copy;
|
|
|
|
|
|
|
|
concept stepType {
|
|
|
|
"instant" = {selectStepTemplateInstant=1; stepTypeInternal="instant";}
|
|
|
|
"avg" = {selectStepTemplateInterval=1; stepTypeInternal="avg";}
|
|
|
|
"avgd" = {selectStepTemplateInterval=1; stepTypeInternal="avgd";}
|
|
|
|
"accum" = {selectStepTemplateInterval=1; stepTypeInternal="accum";}
|
|
|
|
"max" = {selectStepTemplateInterval=1; stepTypeInternal="max";}
|
|
|
|
"min" = {selectStepTemplateInterval=1; stepTypeInternal="min";}
|
|
|
|
"diff" = {selectStepTemplateInterval=1; stepTypeInternal="diff";}
|
2018-12-19 15:13:11 +00:00
|
|
|
"sdiff" = {selectStepTemplateInterval=1; stepTypeInternal="sdiff";}
|
2013-03-25 12:04:10 +00:00
|
|
|
"rms" = {selectStepTemplateInterval=1; stepTypeInternal="rms";}
|
|
|
|
"sd" = {selectStepTemplateInterval=1; stepTypeInternal="sd";}
|
|
|
|
"cov" = {selectStepTemplateInterval=1; stepTypeInternal="cov";}
|
|
|
|
"ratio" = {selectStepTemplateInterval=1; stepTypeInternal="ratio";}
|
2018-12-19 12:10:33 +00:00
|
|
|
"stdanom" = {selectStepTemplateInterval=1; stepTypeInternal="stdanom";}
|
2018-12-19 15:19:37 +00:00
|
|
|
"sum" = {selectStepTemplateInterval=1; stepTypeInternal="sum";}
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
|
|
|
|
2019-01-15 10:52:03 +00:00
|
|
|
# 0=atmospheric chemical constituents
|
|
|
|
# 1=atmospheric chemical constituents based on a distribution function
|
2021-03-17 19:01:02 +00:00
|
|
|
# 2=atmospheric chemical constituents with source or sink
|
2019-01-15 10:52:03 +00:00
|
|
|
meta is_chemical g2_chemical(productDefinitionTemplateNumber, stepType, 0);
|
|
|
|
meta is_chemical_distfn g2_chemical(productDefinitionTemplateNumber, stepType, 1);
|
2021-03-17 19:01:02 +00:00
|
|
|
meta is_chemical_srcsink g2_chemical(productDefinitionTemplateNumber, stepType, 2);
|
2019-01-15 10:52:03 +00:00
|
|
|
|
|
|
|
# 0=aerosol
|
|
|
|
# 1=optical properties of aerosol
|
|
|
|
meta is_aerosol g2_aerosol(productDefinitionTemplateNumber, stepType, 0);
|
|
|
|
meta is_aerosol_optical g2_aerosol(productDefinitionTemplateNumber, stepType, 1);
|
2018-12-19 15:13:11 +00:00
|
|
|
|
2014-11-13 16:47:32 +00:00
|
|
|
transient setCalendarId = 0 ;
|
|
|
|
transient deleteCalendarId = 0 ;
|
|
|
|
alias calendarIdPresent = zero;
|
|
|
|
if ( ((section1Length > 21) or setCalendarId > 0) and deleteCalendarId == 0) {
|
|
|
|
alias calendarIdPresent = present;
|
|
|
|
codetable[2] calendarIdentificationTemplateNumber ('1.5.table',masterDir,localDir) : dump,string_type,no_fail;
|
|
|
|
template calendarIdentification "grib2/template.1.[calendarIdentificationTemplateNumber:l].def";
|
|
|
|
}
|
|
|
|
|
2020-05-26 15:57:32 +00:00
|
|
|
constant conceptsMasterDir="grib2" : hidden;
|
|
|
|
constant conceptsLocalDirAll="grib2/localConcepts/[centre:s]" : hidden;
|
|
|
|
constant conceptsLocalDirECMF="grib2/localConcepts/ecmf" : hidden;
|
2020-10-05 14:32:01 +00:00
|
|
|
|
2020-10-05 15:05:49 +00:00
|
|
|
# ECC-806: Local concepts precedence order
|
2020-10-05 14:32:01 +00:00
|
|
|
if (preferLocalConcepts) {
|
2020-10-05 15:05:49 +00:00
|
|
|
constant conceptsDir1 = conceptsMasterDir : hidden;
|
|
|
|
constant conceptsDir2 = conceptsLocalDirAll : hidden;
|
2020-10-05 14:32:01 +00:00
|
|
|
} else {
|
2020-10-05 15:05:49 +00:00
|
|
|
constant conceptsDir1 = conceptsLocalDirAll : hidden;
|
|
|
|
constant conceptsDir2 = conceptsMasterDir : hidden;
|
2020-10-05 14:32:01 +00:00
|
|
|
}
|