ECC-1903: Attempting with MTG2SwitchConcept. Not sure the if defined statement in parameters.def is working as expected.

This commit is contained in:
Matthew Griffith 2024-08-30 10:36:07 +00:00
parent 833d6dfe51
commit 71be88aca3
9 changed files with 72 additions and 45 deletions

View File

@ -0,0 +1,13 @@
# (C) Copyright 2005- ECMWF.
# ECMWF specific section 2 extras
transient tablesVersionMTG2Switch=33: hidden;
# MTG2
if (tablesVersion <= [tablesVersionMTG2Switch]) {
transient MTG2SwitchDefault = 0;
} else {
transient MTG2SwitchDefault = 1;
}
concept MTG2Switch(MTG2SwitchDefault, "MTG2SwitchConcept.def", conceptsDir2,conceptsDir1): no_copy;

View File

@ -0,0 +1,25 @@
# Concept MTG2Switch
# 0 = pre-MTG2 encoding used
# 1 = post-MTG2 encoding used
# 2 = post-MTG2 encoding with paramId + chemId used
# OD
0 = {tablesVersion=35; productionStatusOfProcessedData=0; modelVersion='cy50r1';}
1 = {tablesVersion=35; productionStatusOfProcessedData=1; modelVersion='cy50r1';}
1 = {tablesVersion=35; productionStatusOfProcessedData=0; modelVersion='cy50r2';}
# MC
2 = {tablesVersion=35; productionStatusOfProcessedData=1; modelVersion='cy50r1'; class=mc;}
2 = {tablesVersion=35; productionStatusOfProcessedData=0; modelVersion='cy50r2'; class=mc;}
# RD
0 = {tablesVersion=35; productionStatusOfProcessedData=2; modelVersion='cy50r1';}
1 = {tablesVersion=35; productionStatusOfProcessedData=2; modelVersion='cy50r1'; typeOfProcessedData=9;}
1 = {tablesVersion=35; productionStatusOfProcessedData=2; modelVersion='cy50r2';}
# SEAS6
1 = {tablesVersion=34; productionStatusOfProcessedData=0; modelVersion='cy49r2';}
# ERA6
1 = {tablesVersion=34; productionStatusOfProcessedData=3; modelVersion='cy49r2'; marsClass=e6;}
# EAC5
2 = {tablesVersion=34; productionStatusOfProcessedData=3; modelVersion='cy49r2'; marsClass=mc;}
2 = {tablesVersion=34; productionStatusOfProcessedData=3; modelVersion='cy49r2'; marsClass=cr;}

View File

@ -1,4 +1,10 @@
'cy49r1' = { generatingProcessIdentifier = 155; }
'cy50r2' = { generatingProcessIdentifier = 161; }
'cy50r1' = { generatingProcessIdentifier = 160; }
'cy49r2' = { generatingProcessIdentifier = 159; }
'cy49r1' = { generatingProcessIdentifier = 158; }
'cy48r3' = { generatingProcessIdentifier = 157; }
'climatedt' = { generatingProcessIdentifier = 156; }
'cy48r2' = { generatingProcessIdentifier = 155; }
'cy48r1' = { generatingProcessIdentifier = 154; }
'cy47r3' = { generatingProcessIdentifier = 153; }
'cy47r2' = { generatingProcessIdentifier = 152; }

View File

@ -2,66 +2,46 @@
transient dummyc=0: hidden;
# MTG2 switch at tablesVersion 36
# If MTG2Switch is defined we may need to look at pre-MTG2 definitions. Otherwise look at new definitions
transient tablesVersionMTG2Switch=36: hidden;
if ( defined(MTG2Switch) ) {
concept paramIdLegacyECMF(defaultParameter,"paramId.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy,hidden;
# pre-MTG2
if ( MTG2Switch == 0) {
# pre-MTG2
if ( tablesVersion <= tablesVersionMTG2Switch ) {
concept paramIdLegacyECMF(defaultParameter,"paramId.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy,hidden;
concept paramIdECMF (paramIdLegacyECMF,"paramId.[tablesVersionMTG2Switch].def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy;
concept paramId (paramIdECMF,"paramId.[tablesVersionMTG2Switch].def",conceptsDir2,conceptsDir1): long_type;
concept paramIdECMF (paramIdLegacyECMF,"paramId.[tablesVersionMTG2Switch].def",conceptsMasterDir,conceptsLocalDirECMF): long_type,no_copy;
concept paramId (paramIdECMF,"paramId.[tablesVersionMTG2Switch].def",conceptsDir2,conceptsDir1): long_type;
concept shortNameLegacyECMF(defaultShortName,"shortName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden;
concept shortNameECMF (shortNameLegacyECMF,"shortName.[tablesVersionMTG2Switch].def",conceptsMasterDir,conceptsLocalDirECMF): no_copy;
concept ls.shortName (shortNameECMF,"shortName.[tablesVersionMTG2Switch].def",conceptsDir2,conceptsDir1): no_copy,dump;
# post-MTG2
concept unitsLegacyECMF(defaultName,"units.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden,read_only;
concept unitsECMF (unitsLegacyECMF,"units.[tablesVersionMTG2Switch].def",conceptsMasterDir,conceptsLocalDirECMF): no_copy, read_only;
concept units (unitsECMF,"units.[tablesVersionMTG2Switch].def",conceptsDir2,conceptsDir1): no_copy, read_only;
concept nameLegacyECMF(defaultName,"name.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden;
concept nameECMF(nameLegacyECMF,"name.[tablesVersionMTG2Switch].def",conceptsMasterDir,conceptsLocalDirECMF): no_copy;
concept name(nameECMF,"name.[tablesVersionMTG2Switch].def",conceptsDir2,conceptsDir1): no_copy,dump;
}
# All other cases other than pre-MTG2 fall here
} else {
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 paramId (paramIdECMF,"paramId.def",conceptsDir2,conceptsDir1): long_type;
}
concept shortNameLegacyECMF(defaultShortName,"shortName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden;
# pre-MTG2
if ( tablesVersion <= tablesVersionMTG2Switch ) {
concept shortNameECMF (shortNameLegacyECMF,"shortName.[tablesVersionMTG2Switch].def",conceptsMasterDir,conceptsLocalDirECMF): no_copy;
concept ls.shortName (shortNameECMF,"shortName.[tablesVersionMTG2Switch].def",conceptsDir2,conceptsDir1): no_copy,dump;
} else {
concept shortNameLegacyECMF(defaultShortName,"shortName.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden;
concept shortNameECMF (shortNameLegacyECMF,"shortName.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy;
concept ls.shortName (shortNameECMF,"shortName.def",conceptsDir2,conceptsDir1): no_copy,dump;
}
concept unitsLegacyECMF(defaultName,"units.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden,read_only;
# pre-MTG2
if ( tablesVersion <= tablesVersionMTG2Switch ) {
concept unitsECMF (unitsLegacyECMF,"units.[tablesVersionMTG2Switch].def",conceptsMasterDir,conceptsLocalDirECMF): no_copy, read_only;
concept units (unitsECMF,"units.[tablesVersionMTG2Switch].def",conceptsDir2,conceptsDir1): no_copy, read_only;
} else {
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 units (unitsECMF,"units.def",conceptsDir2,conceptsDir1): no_copy, read_only;
}
concept nameLegacyECMF(defaultName,"name.legacy.def",conceptsMasterDir,conceptsLocalDirECMF): no_copy,hidden;
# pre-MTG2
if ( tablesVersion <= tablesVersionMTG2Switch ) {
concept nameECMF(nameLegacyECMF,"name.[tablesVersionMTG2Switch].def",conceptsMasterDir,conceptsLocalDirECMF): no_copy;
concept name(nameECMF,"name.[tablesVersionMTG2Switch].def",conceptsDir2,conceptsDir1): no_copy,dump;
} else {
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;

View File

@ -51,5 +51,8 @@ if ( addEmptySection2 == 0 ) {
}
}
# Hook for local extras
template_nofail extras "grib2/local/[centre]/section2_extras.def";
section_padding section2Padding : read_only;