ECC-1909: Added models in pseudocentre DestinE. The logic in section4_extras was bad in that MasterDir was used even though this is local. This also means pseudocentres could not use this mechanism via datasetForLocal;

To this end, I have replaced the logic to look for datasetForLocal, then for centre, as we will never have anything in MasterDir for this centre specific code (in local/ecmf);
Updated test to check everything works as expected.
This commit is contained in:
Matthew Griffith 2024-10-31 15:09:17 +00:00
parent cc51799287
commit 8714a17928
8 changed files with 68 additions and 7 deletions

View File

@ -1,12 +1,13 @@
# (C) Copyright 2005- ECMWF.
# See ECC-1846
if (centre is "ecmf" or datasetForLocal is "era6") {
concept modelName(unknown, "modelNameConcept.def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump, read_only;
# This is only read when centre=ecmf, so can remove if statement that was here
# This is ecmf local so we shouldn't use MasterDir. Instead we look for pseudocentre (conceptsDir2) then centre (conceptsLocalDirAll)
if (modelName isnot "unknown") {
concept modelVersion(unknown, "modelVersionConcept.[modelName].def", conceptsMasterDir, conceptsLocalDirAll): no_copy, dump, read_only;
concept modelName(unknown, "modelNameConcept.def", conceptsDir2, conceptsLocalDirAll): no_copy, dump, read_only;
if (modelName isnot "unknown") {
concept modelVersion(unknown, "modelVersionConcept.[modelName].def", conceptsDir2, conceptsLocalDirAll): no_copy, dump, read_only;
# alias ls.model = modelName;
# alias mars.model = modelName;
}
}

View File

@ -0,0 +1,18 @@
'IFS' = {
backgroundProcess = 255;
}
'AIFS' = {
backgroundProcess = 1;
}
'ICON' = {
backgroundProcess = 2;
}
'ALARO' = {
backgroundProcess = 3;
}
'AROME' = {
backgroundProcess = 4;
}
'HARMONIE-AROME' = {
backgroundProcess = 5;
}

View File

@ -0,0 +1,2 @@
'v1' = { generatingProcessIdentifier = 1; }
'v2' = { generatingProcessIdentifier = 2; }

View File

@ -0,0 +1,3 @@
'cy49t2' = { generatingProcessIdentifier = 3; }
'cy48t3' = { generatingProcessIdentifier = 2; }
'cy46h1' = { generatingProcessIdentifier = 1; }

View File

@ -0,0 +1,3 @@
'cy49t2' = { generatingProcessIdentifier = 3; }
'cy48t3' = { generatingProcessIdentifier = 2; }
'cy46h1' = { generatingProcessIdentifier = 1; }

View File

@ -0,0 +1,3 @@
'cy49t2' = { generatingProcessIdentifier = 3; }
'cy48t3' = { generatingProcessIdentifier = 2; }
'cy46h1' = { generatingProcessIdentifier = 1; }

View File

@ -0,0 +1,18 @@
'cy50r3' = { generatingProcessIdentifier = 163; }
'cy50r2' = { generatingProcessIdentifier = 162; }
'cy50r1' = { generatingProcessIdentifier = 161; }
'cy49r3' = { 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; }
'cy47r1' = { generatingProcessIdentifier = 151; }
'cy46r1' = { generatingProcessIdentifier = 150; }
'cy45r1' = { generatingProcessIdentifier = 149; }
'cy43r3' = { generatingProcessIdentifier = 148; }
'cy43r1' = { generatingProcessIdentifier = 147; }
'cy41r2' = { generatingProcessIdentifier = 146; }

View File

@ -14,6 +14,7 @@
label="grib_modelName_test"
tempGrib=temp.$label.grib
temp2Grib=temp2.$label.grib
tempFilt=temp.$label.filt
tempLog=temp.$label.log
tempOut=temp.$label.txt
@ -30,6 +31,18 @@ grib_check_key_equals $tempGrib modelName,modelVersion "IFS cy48r1"
${tools_dir}/grib_set -s generatingProcessIdentifier=100 $sample $tempGrib
grib_check_key_equals $tempGrib modelName,modelVersion "IFS unknown"
# Check that this only works for centre ecmf
${tools_dir}/grib_set -s generatingProcessIdentifier=1,backgroundProcess=1,centre=84 $sample $tempGrib
[ $( ${tools_dir}/grib_get -f -p modelName $tempGrib ) = "not_found" ]
[ $( ${tools_dir}/grib_get -f -p modelVersion $tempGrib ) = "not_found" ]
# Check that it works for pseudocentres (e.g. DestinE)
${tools_dir}/grib_set -s generatingProcessIdentifier=1,backgroundProcess=3,productionStatusOfProcessedData=13 $sample $tempGrib
grib_check_key_equals $tempGrib modelName,modelVersion "ALARO cy46h1"
${tools_dir}/grib_set -s productionStatusOfProcessedData=0 $tempGrib $temp2Grib
[ $( ${tools_dir}/grib_get -f -p modelName $temp2Grib ) = "unknown" ]
[ $( ${tools_dir}/grib_get -f -p modelVersion $temp2Grib ) = "not_found" ]
# Keys are read-only (may change this later)
set +e
${tools_dir}/grib_set -s modelName=AIFS $sample $tempGrib 2>$tempLog