Skip to content

Commit

Permalink
Merge branch 'hotfix/2.39.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Jan 24, 2025
2 parents 912a0f7 + c3615db commit 9466b13
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.39.1
2.39.2
10 changes: 6 additions & 4 deletions definitions/grib2/local/ecmf/section4_extras.def
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# (C) Copyright 2005- ECMWF.

# See ECC-1846
# 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)
# 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;

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;
if ( defined(marsClass) && (marsClass is "ai" || marsClass is "ml") ) {
alias ls.model = modelName;
alias mars.model = modelName;
}
}
8 changes: 7 additions & 1 deletion definitions/grib2/localConcepts/ecmf/modelNameConcept.def
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
'IFS' = {
backgroundProcess = 255;
}
'AIFS' = {
'aifs-single-mse' = {
backgroundProcess = 1;
}
'aifs-ens-crps' = {
backgroundProcess = 2;
}
'aifs-ens-diff' = {
backgroundProcess = 3;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'v1' = { generatingProcessIdentifier = 1; }
'v2' = { generatingProcessIdentifier = 2; }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'v1' = { generatingProcessIdentifier = 1; }
'v2' = { generatingProcessIdentifier = 2; }
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=176;}
'sfc' = {typeOfFirstFixedSurface=177; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=188; typeOfSecondFixedSurface=189;}

'sfc' = {typeOfFirstFixedSurface=254;}
2 changes: 2 additions & 0 deletions definitions/grib2/localConcepts/era6/typeOfLevelConcept.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Concept typeOfLevel
'abstractLevel' = {typeOfFirstFixedSurface=254;}
4 changes: 4 additions & 0 deletions definitions/grib2/marsLevtypeConcept.def
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@
'sol' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=187;}
'sfc' = {typeOfFirstFixedSurface=187; typeOfSecondFixedSurface=185;}

'sfc' = {typeOfFirstFixedSurface=107; scaleFactorOfFirstFixedSurface=2; scaledValueOfFirstFixedSurface=27315;}
'sfc' = {typeOfFirstFixedSurface=107; scaleFactorOfFirstFixedSurface=2; scaledValueOfFirstFixedSurface=27415;}
'sfc' = {typeOfFirstFixedSurface=107; scaleFactorOfFirstFixedSurface=2; scaledValueOfFirstFixedSurface=27465;}
20 changes: 16 additions & 4 deletions tests/grib_modelName.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ 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 v1"
grib_check_key_equals $tempGrib modelName,modelVersion "aifs-single-mse v1"

${tools_dir}/grib_set -s generatingProcessIdentifier=154 $sample $tempGrib
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
# 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" ]
Expand All @@ -40,8 +40,19 @@ ${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 ) = "unknown" ]
[ $( ${tools_dir}/grib_get -f -p modelVersion $temp2Grib ) = "not_found" ]
[ $( ${tools_dir}/grib_get -f -p modelName $temp2Grib ) = "aifs-ens-diff" ]
[ $( ${tools_dir}/grib_get -f -p modelVersion $temp2Grib ) = "v1" ]


# 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'

${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'


# Keys are read-only (may change this later)
set +e
Expand All @@ -61,3 +72,4 @@ grep -q "Value is read only" $tempLog

# Clean up
rm -f $tempGrib $tempFilt $tempLog $tempOut $tempRef
rm -f $temp2Grib

0 comments on commit 9466b13

Please sign in to comment.