Skip to content

Commit

Permalink
Merge branch 'hotfix/2.39.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Feb 11, 2025
2 parents 51025f1 + 1058093 commit ed5cb9d
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.39.2
2.39.3
2 changes: 1 addition & 1 deletion definitions/grib2/local/ecmf/section4_extras.def
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This is only read when centre=ecmf, so can remove if statement that was here
# This is ecmf local so we shouldnt use MasterDir. Instead we look for pseudocentre (conceptsDir2) then centre (conceptsLocalDirAll)

concept modelName(unknown, "modelNameConcept.def", conceptsDir2, conceptsLocalDirAll): no_copy, dump, read_only;
concept modelName(unknown, "modelNameConcept.def", conceptsDir2, conceptsLocalDirAll): no_copy, dump;

if (modelName isnot "unknown") {
concept modelVersion(unknown, "modelVersionConcept.[modelName].def", conceptsDir2, conceptsLocalDirAll): no_copy, dump, read_only;
Expand Down
12 changes: 9 additions & 3 deletions definitions/grib2/localConcepts/ecmf/modelNameConcept.def
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
'IFS' = {
backgroundProcess = 255;
}
'aifs-single-mse' = {
'aifs-single' = {
backgroundProcess = 1;
}
'aifs-ens-crps' = {
'aifs-ens' = {
backgroundProcess = 2;
}
'aifs-ens-diff' = {
'aifs-single-mse' = {
backgroundProcess = 3;
}
'aifs-ens-crps' = {
backgroundProcess = 4;
}
'aifs-ens-diff' = {
backgroundProcess = 5;
}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
'v1' = { generatingProcessIdentifier = 1; }
'v2' = { generatingProcessIdentifier = 2; }
'v0.1' = { generatingProcessIdentifier = 1; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'aifs-ens-crps-v0.1' = { generatingProcessIdentifier = 1; }
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
'v1' = { generatingProcessIdentifier = 1; }
'v2' = { generatingProcessIdentifier = 2; }
'v0.2.0' = { generatingProcessIdentifier = 1; }
'v0.2.1' = { generatingProcessIdentifier = 2; }
'v1.0' = { generatingProcessIdentifier = 3; }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'aifs-single-mse-v0.2.0' = { generatingProcessIdentifier = 1; }
'aifs-single-mse-v0.2.1' = { generatingProcessIdentifier = 2; }
'aifs-single-mse-v1.0' = { generatingProcessIdentifier = 3; }
26 changes: 12 additions & 14 deletions tests/grib_modelName.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ tempRef=temp.$label.ref
sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl

${tools_dir}/grib_set -s generatingProcessIdentifier=1,backgroundProcess=1 $sample $tempGrib
grib_check_key_equals $tempGrib modelName,modelVersion "aifs-single-mse v1"
grib_check_key_equals $tempGrib modelName,modelVersion "aifs-single aifs-single-mse-v0.2.0"

${tools_dir}/grib_set -s generatingProcessIdentifier=154 $sample $tempGrib
# IFS is backgrounbdProcess=255 to preserve backward compatibility§
${tools_dir}/grib_set -s generatingProcessIdentifier=154,backgroundProcess=255 $sample $tempGrib
grib_check_key_equals $tempGrib modelName,modelVersion "IFS cy48r1"

${tools_dir}/grib_set -s generatingProcessIdentifier=100 $sample $tempGrib
${tools_dir}/grib_set -s generatingProcessIdentifier=100,backgroundProcess=255 $sample $tempGrib
grib_check_key_equals $tempGrib modelName,modelVersion "IFS unknown"

# Check that this only works for centre ecmf
Expand All @@ -40,27 +41,24 @@ ${tools_dir}/grib_set -s generatingProcessIdentifier=1,backgroundProcess=1,centr
${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 ) = "aifs-ens-diff" ]
[ $( ${tools_dir}/grib_get -f -p modelVersion $temp2Grib ) = "v1" ]
grib_check_key_equals $temp2Grib modelName 'aifs-single-mse'
grib_check_key_equals $temp2Grib modelVersion 'v0.2.0'


# ECC-2010
${tools_dir}/grib_set -s marsClass=ai,typeOfProcessedData=missing,backgroundProcess=1,generatingProcessIdentifier=1 \
$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl $temp2Grib
grib_check_key_equals $temp2Grib mars.model 'aifs-single-mse'
grib_check_key_equals $temp2Grib mars.model 'aifs-single'

${tools_dir}/grib_set -s marsClass=ai,typeOfProcessedData=missing,backgroundProcess=2,generatingProcessIdentifier=1 \
$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl $temp2Grib
grib_check_key_equals $temp2Grib mars.model 'aifs-ens-crps'
grib_check_key_equals $temp2Grib mars.model 'aifs-ens'


# Keys are read-only (may change this later)
set +e
${tools_dir}/grib_set -s modelName=AIFS $sample $tempGrib 2>$tempLog
status=$?
set -e
[ $status -ne 0 ]
grep -q "Value is read only" $tempLog
# modelName not read-only
${tools_dir}/grib_set -s class=ai,type=pf,stream=enfo,modelName='aifs-ens-crps' $ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl $tempGrib
grib_check_key_equals $tempGrib mars.model 'aifs-ens-crps'
grib_check_key_equals $tempGrib backgroundGeneratingProcessIdentifier 4

set +e
${tools_dir}/grib_set -s modelVersion=cy48r1 $sample $tempGrib 2>$tempLog
Expand Down

0 comments on commit ed5cb9d

Please sign in to comment.