diff --git a/definitions/grib2/local/ecmf/section4_extras.def b/definitions/grib2/local/ecmf/section4_extras.def index 49351d8b9..c1315beaf 100644 --- a/definitions/grib2/local/ecmf/section4_extras.def +++ b/definitions/grib2/local/ecmf/section4_extras.def @@ -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; - # alias ls.model = modelName; - # alias mars.model = modelName; - } +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; } diff --git a/definitions/grib2/localConcepts/destine/modelNameConcept.def b/definitions/grib2/localConcepts/destine/modelNameConcept.def new file mode 100644 index 000000000..94f0797e4 --- /dev/null +++ b/definitions/grib2/localConcepts/destine/modelNameConcept.def @@ -0,0 +1,18 @@ +'IFS' = { + backgroundProcess = 255; +} +'AIFS' = { + backgroundProcess = 1; +} +'ICON' = { + backgroundProcess = 2; +} +'ALARO' = { + backgroundProcess = 3; +} +'AROME' = { + backgroundProcess = 4; +} +'HARMONIE-AROME' = { + backgroundProcess = 5; +} \ No newline at end of file diff --git a/definitions/grib2/localConcepts/destine/modelVersionConcept.AIFS.def b/definitions/grib2/localConcepts/destine/modelVersionConcept.AIFS.def new file mode 100644 index 000000000..b06e75f21 --- /dev/null +++ b/definitions/grib2/localConcepts/destine/modelVersionConcept.AIFS.def @@ -0,0 +1,2 @@ +'v1' = { generatingProcessIdentifier = 1; } +'v2' = { generatingProcessIdentifier = 2; } diff --git a/definitions/grib2/localConcepts/destine/modelVersionConcept.ALARO.def b/definitions/grib2/localConcepts/destine/modelVersionConcept.ALARO.def new file mode 100644 index 000000000..742d5c1bb --- /dev/null +++ b/definitions/grib2/localConcepts/destine/modelVersionConcept.ALARO.def @@ -0,0 +1,3 @@ +'cy49t2' = { generatingProcessIdentifier = 3; } +'cy48t3' = { generatingProcessIdentifier = 2; } +'cy46h1' = { generatingProcessIdentifier = 1; } diff --git a/definitions/grib2/localConcepts/destine/modelVersionConcept.AROME.def b/definitions/grib2/localConcepts/destine/modelVersionConcept.AROME.def new file mode 100644 index 000000000..742d5c1bb --- /dev/null +++ b/definitions/grib2/localConcepts/destine/modelVersionConcept.AROME.def @@ -0,0 +1,3 @@ +'cy49t2' = { generatingProcessIdentifier = 3; } +'cy48t3' = { generatingProcessIdentifier = 2; } +'cy46h1' = { generatingProcessIdentifier = 1; } diff --git a/definitions/grib2/localConcepts/destine/modelVersionConcept.HARMONIE-AROME.def b/definitions/grib2/localConcepts/destine/modelVersionConcept.HARMONIE-AROME.def new file mode 100644 index 000000000..742d5c1bb --- /dev/null +++ b/definitions/grib2/localConcepts/destine/modelVersionConcept.HARMONIE-AROME.def @@ -0,0 +1,3 @@ +'cy49t2' = { generatingProcessIdentifier = 3; } +'cy48t3' = { generatingProcessIdentifier = 2; } +'cy46h1' = { generatingProcessIdentifier = 1; } diff --git a/definitions/grib2/localConcepts/destine/modelVersionConcept.IFS.def b/definitions/grib2/localConcepts/destine/modelVersionConcept.IFS.def new file mode 100644 index 000000000..2bbe0ee20 --- /dev/null +++ b/definitions/grib2/localConcepts/destine/modelVersionConcept.IFS.def @@ -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; } \ No newline at end of file diff --git a/tests/grib_modelName.sh b/tests/grib_modelName.sh index d0dde3cc4..598ac974f 100755 --- a/tests/grib_modelName.sh +++ b/tests/grib_modelName.sh @@ -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