Skip to content

Commit 01e2436

Browse files
committed
ECC-2241: Updated 50r1 to include tablesVersion 34 and 36 and updated test accordingly.
1 parent ef4b9dd commit 01e2436

File tree

2 files changed

+93
-6
lines changed

2 files changed

+93
-6
lines changed

definitions/grib2/localConcepts/ecmf/MTG2SwitchConcept.def

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,64 @@
1818
# We only need the concepts which differ from the default below.
1919
# These are all for 50r1 (255 + 161, 255 + 109, 255 + 209; GRIBmix), where we have the newer model but still want the pre-MTG2 behaviour
2020
# and for AIFS, where we have the newer tablesVersion but still want the pre-MTG2 behaviour
21+
# ECC-2241: Data has already been produced as cy50r1 with tablesVersion 34, and tablesVersion 36 may also be used.
22+
# To this end we should extend the 50r1 switch functionality to include tablesVersion 34 and 36.
2123

22-
# OD
24+
## OD 50r1 ##
25+
# tv34
26+
0 = {tablesVersion=34; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=161;}
27+
0 = {tablesVersion=34; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=109;}
28+
0 = {tablesVersion=34; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=209;}
29+
# tv35
2330
0 = {tablesVersion=35; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=161;}
2431
0 = {tablesVersion=35; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=109;}
2532
0 = {tablesVersion=35; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=209;}
26-
# RD
33+
# tv36
34+
0 = {tablesVersion=36; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=161;}
35+
0 = {tablesVersion=36; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=109;}
36+
0 = {tablesVersion=36; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=209;}
37+
## OD 50r3 ##
38+
# tv35 only
39+
0 = {tablesVersion=35; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=163;}
40+
0 = {tablesVersion=35; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=111;}
41+
0 = {tablesVersion=35; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=211;}
42+
## RD 50r1 ##
43+
# tv34
44+
0 = {tablesVersion=34; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=161;}
45+
0 = {tablesVersion=34; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=109;}
46+
0 = {tablesVersion=34; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=209;}
47+
# tv35
2748
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=161;}
2849
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=109;}
2950
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=209;}
30-
# MC
51+
# tv36
52+
0 = {tablesVersion=36; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=161;}
53+
0 = {tablesVersion=36; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=109;}
54+
0 = {tablesVersion=36; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=209;}
55+
## RD 50r3 ##
56+
# tv35 only
57+
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=163;}
58+
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=111;}
59+
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=211;}
60+
## MC ##
61+
# tv35 only
3162
0 = {tablesVersion=35; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=161; marsClass=19;}
3263
0 = {tablesVersion=35; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=109; marsClass=19;}
3364
0 = {tablesVersion=35; productionStatusOfProcessedData=0; backgroundProcess=255; generatingProcessIdentifier=209; marsClass=19;}
34-
# CR
65+
## CR ##
66+
# tv35 only
3567
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=161; marsClass=36;}
3668
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=109; marsClass=36;}
3769
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=209; marsClass=36;}
38-
# GG
70+
## GG ##
71+
# tv35 only
3972
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=161; marsClass=44;}
4073
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=109; marsClass=44;}
4174
0 = {tablesVersion=35; productionStatusOfProcessedData=2; backgroundProcess=255; generatingProcessIdentifier=209; marsClass=44;}
42-
# AI
75+
## AI ##
76+
# tv34
4377
0 = {tablesVersion=34; productionStatusOfProcessedData=0; marsClass=51;}
78+
# tv35
4479
0 = {tablesVersion=35; productionStatusOfProcessedData=0; marsClass=51;}
80+
# tv36
81+
0 = {tablesVersion=36; productionStatusOfProcessedData=0; marsClass=51;}

tests/grib_mtg2_switch.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,56 @@ ${tools_dir}/grib_filter -o ${cases[*]: -1} $tempFilt $base_grib2
14761476
# MTG2Switch=2
14771477
expected+=("1 2 2")
14781478

1479+
## CASE 60: ECMWF OD CY50R1 pre-mtg2 (tv34) ##
1480+
# tablesVersion=34
1481+
# productionStatusOfProcessedData=0
1482+
# backgroundProcess=255
1483+
# generatingProcessIdentifier=161
1484+
cases+=(temp.$label.case60.grib2)
1485+
1486+
cat >$tempFilt<<EOF
1487+
set setLocalDefinition=1;
1488+
set grib2LocalSectionNumber=1;
1489+
set tablesVersion=34;
1490+
set productionStatusOfProcessedData=0;
1491+
set backgroundProcess=255;
1492+
set generatingProcessIdentifier=161;
1493+
write;
1494+
EOF
1495+
1496+
${tools_dir}/grib_filter -o ${cases[*]: -1} $tempFilt $base_grib2
1497+
1498+
# Expected result
1499+
# MTG2SwitchViaTablesVersion=1
1500+
# MTG2SwitchDefault=1
1501+
# MTG2Switch=0
1502+
expected+=("1 1 0")
1503+
1504+
## CASE 61: ECMWF OD CY50R1 pre-mtg2 (tv36) ##
1505+
# tablesVersion=36
1506+
# productionStatusOfProcessedData=0
1507+
# backgroundProcess=255
1508+
# generatingProcessIdentifier=161
1509+
cases+=(temp.$label.case61.grib2)
1510+
1511+
cat >$tempFilt<<EOF
1512+
set setLocalDefinition=1;
1513+
set grib2LocalSectionNumber=1;
1514+
set tablesVersion=36;
1515+
set productionStatusOfProcessedData=0;
1516+
set backgroundProcess=255;
1517+
set generatingProcessIdentifier=161;
1518+
write;
1519+
EOF
1520+
1521+
${tools_dir}/grib_filter -o ${cases[*]: -1} $tempFilt $base_grib2
1522+
1523+
# Expected result
1524+
# MTG2SwitchViaTablesVersion=1
1525+
# MTG2SwitchDefault=1
1526+
# MTG2Switch=0
1527+
expected+=("1 1 0")
1528+
14791529
# Test different cases
14801530

14811531
for i in "${!cases[@]}"; do

0 commit comments

Comments
 (0)