-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#no step in type an | ||
unalias mars.step; | ||
|
||
if (class is "od") { alias mars.system = systemNumber; } | ||
if (class is "me") { alias mars.system = systemNumber; } | ||
if (class is "en") { alias mars.system = systemNumber; } | ||
if (class is "c3") { alias mars.system = systemNumber; } | ||
if (class is "ci") { alias mars.system = systemNumber; } | ||
alias mars.number = perturbationNumber; | ||
alias mars.method = methodNumber; | ||
|
||
if (!(class is "gw")) { # ECC-1448 | ||
alias mars.origin = centre; | ||
} | ||
|
||
# See ECC-624 | ||
if (centre == 80 && subCentre == 98 && class is "c3") { | ||
constant cnmc_cmcc = 'cmcc'; | ||
alias mars.origin = cnmc_cmcc; | ||
} | ||
|
||
if (class is "ci") { unalias mars.method; } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alias mars.step = stepRange; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alias mars.step = stepRange; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alias mars.step = stepRange; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if (levtype is "o2d" || levtype is "o3d") { | ||
alias mars.step = stepRange; | ||
} else { | ||
alias mars.step = endStep; | ||
} | ||
|
||
alias mars.number = perturbationNumber; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
# (C) Copyright 2005- ECMWF. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by | ||
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. | ||
# | ||
|
||
. ./include.ctest.sh | ||
|
||
REDIRECT=/dev/null | ||
|
||
# ECC-1829: Add MARS support for stream & type combinations required for AIFS ensemble | ||
|
||
label="grib_ecc-1829_test" | ||
temp_grib=temp.$label.grib | ||
mars_sample=temp.$label.mars.grib | ||
sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl | ||
|
||
# Setup GRIB2 message with MARS keys | ||
${tools_dir}/grib_set -s setLocalDefinition=1,grib2LocalSectionNumber=1 $sample_grib2 $mars_sample | ||
|
||
# Now set ensemble related keys and check number key is present | ||
${tools_dir}/grib_set -s stream=oper,type=pf,productDefinitionTemplateNumber=1 $mars_sample $temp_grib | ||
grib_check_key_exists $temp_grib mars.number | ||
|
||
# Now set keys and check stepRange is used for mars.step for o2d and o3d fields, and that number is still present | ||
${tools_dir}/grib_set -s stream=oper,type=pf,productDefinitionTemplateNumber=11,param=263101,typeOfLevel=oceanSurface,startStep=0,endStep=6 $mars_sample $temp_grib | ||
grib_check_key_exists $temp_grib mars.number | ||
grib_check_key_equals $temp_grib "step" "0-6" | ||
${tools_dir}/grib_set -s stream=oper,type=pf,productDefinitionTemplateNumber=11,param=263501,typeOfLevel=oceanModel,level=1,startStep=0,endStep=6 $mars_sample $temp_grib | ||
grib_check_key_exists $temp_grib mars.number | ||
grib_check_key_equals $temp_grib "step" "0-6" | ||
|
||
# Now set keys and check stepRange is used for type efi data (just need any template with stat proc keys) | ||
${tools_dir}/grib_set -s stream=oper,type=efi,productDefinitionTemplateNumber=12,startStep=0,endStep=6 $mars_sample $temp_grib | ||
grib_check_key_equals $temp_grib "step" "0-6" | ||
|
||
# Now set keys and check stepRange is used for type em data | ||
${tools_dir}/grib_set -s stream=oper,type=em,productDefinitionTemplateNumber=12,startStep=0,endStep=6 $mars_sample $temp_grib | ||
grib_check_key_equals $temp_grib "step" "0-6" | ||
|
||
# Now set keys and check stepRange is used for type es data | ||
${tools_dir}/grib_set -s stream=oper,type=es,productDefinitionTemplateNumber=12,startStep=0,endStep=6 $mars_sample $temp_grib | ||
grib_check_key_equals $temp_grib "step" "0-6" | ||
|
||
# Clean up | ||
rm -f $temp_grib $mars_sample |