From e6e3c58f3c3bc835268d00c781d1763a2f6cd02e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 19 Apr 2024 10:44:09 +0000 Subject: [PATCH 1/6] ECC-1806: GRIB: Change of paramId in conversion from GRIB1 to GRIB2 (Try 1) --- definitions/grib1/section.1.def | 7 +++++++ definitions/grib2/boot.def | 3 +++ src/grib_accessor_class_concept.cc | 14 ++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 2bda52ec7..4136b0395 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -325,3 +325,10 @@ if (stepTypeForConversion is "accum" || stepTypeForConversion is "max" || stepTy meta md5Section1 md5(offsetSection1,section1Length); # md5(start,length,blacklisted1,blacklisted2,...); meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,decimalScaleFactor); + +# ECC-1806 +concept_nofail paramIdForConversion(zero) { + 262000 = {gribTablesVersionNo=174;indicatorOfParameter=98; centre=98;} # 174098 -> 262000 + 262104 = {gribTablesVersionNo=151;indicatorOfParameter=163;centre=98;} # 151163 -> 262104 + 262124 = {gribTablesVersionNo=151;indicatorOfParameter=145;centre=98;} # 151145 -> 262124 +} : long_type; diff --git a/definitions/grib2/boot.def b/definitions/grib2/boot.def index d2c44fb74..7cba8747b 100644 --- a/definitions/grib2/boot.def +++ b/definitions/grib2/boot.def @@ -53,3 +53,6 @@ concept isTemplateDeprecated(false) { concept isTemplateExperimental(false) { 1 = { template_is_experimental = 1; } } + +# ECC-1806 +transient paramIdForConversion = 0; diff --git a/src/grib_accessor_class_concept.cc b/src/grib_accessor_class_concept.cc index efda63e55..cdfb31245 100644 --- a/src/grib_accessor_class_concept.cc +++ b/src/grib_accessor_class_concept.cc @@ -455,6 +455,20 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) //if(*len > 1) // return GRIB_NOT_IMPLEMENTED; + // ECC-1806: GRIB: Change of paramId in conversion from GRIB1 to GRIB2 + if (STR_EQUAL(a->name,"paramId")) { + grib_handle* h = grib_handle_of_accessor(a); + long edition = 0; + if (grib_get_long(h, "edition", &edition) == GRIB_SUCCESS && edition == 2) { + long newParamId = 0; + if (grib_get_long(h, "paramIdForConversion", &newParamId) == GRIB_SUCCESS) { + if (newParamId > 0) { + snprintf(buf, sizeof(buf), "%ld", newParamId); + } + } + } + } + s = strlen(buf) + 1; return pack_string(a, buf, &s); } From a39eb883cd2ebffb1b848f8064f07f6cfc516039 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 19 Apr 2024 14:07:51 +0100 Subject: [PATCH 2/6] ECC-1806: Add tests --- definitions/grib1/section.1.def | 6 ++-- src/grib_accessor_class_concept.cc | 11 ++++--- tests/CMakeLists.txt | 1 + tests/grib_ecc-1806.sh | 47 ++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100755 tests/grib_ecc-1806.sh diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 4136b0395..9e7cc955b 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -328,7 +328,7 @@ meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,d # ECC-1806 concept_nofail paramIdForConversion(zero) { - 262000 = {gribTablesVersionNo=174;indicatorOfParameter=98; centre=98;} # 174098 -> 262000 - 262104 = {gribTablesVersionNo=151;indicatorOfParameter=163;centre=98;} # 151163 -> 262104 - 262124 = {gribTablesVersionNo=151;indicatorOfParameter=145;centre=98;} # 151145 -> 262124 + 262000 = { gribTablesVersionNo=174;indicatorOfParameter=98; centre=98; } # 174098 -> 262000 + 262104 = { gribTablesVersionNo=151;indicatorOfParameter=163;centre=98; } # 151163 -> 262104 + 262124 = { gribTablesVersionNo=151;indicatorOfParameter=145;centre=98; } # 151145 -> 262124 } : long_type; diff --git a/src/grib_accessor_class_concept.cc b/src/grib_accessor_class_concept.cc index cdfb31245..56ec86e30 100644 --- a/src/grib_accessor_class_concept.cc +++ b/src/grib_accessor_class_concept.cc @@ -456,15 +456,18 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) // return GRIB_NOT_IMPLEMENTED; // ECC-1806: GRIB: Change of paramId in conversion from GRIB1 to GRIB2 - if (STR_EQUAL(a->name,"paramId")) { + if (STR_EQUAL(a->name, "paramId")) { grib_handle* h = grib_handle_of_accessor(a); long edition = 0; if (grib_get_long(h, "edition", &edition) == GRIB_SUCCESS && edition == 2) { long newParamId = 0; - if (grib_get_long(h, "paramIdForConversion", &newParamId) == GRIB_SUCCESS) { - if (newParamId > 0) { - snprintf(buf, sizeof(buf), "%ld", newParamId); + if (grib_get_long(h, "paramIdForConversion", &newParamId) == GRIB_SUCCESS && newParamId > 0) { + if (a->context->debug) { + const char* cclass_name = a->cclass->name; + fprintf(stderr, "ECCODES DEBUG %s::%s: Changing %s from %ld to %ld\n", + cclass_name, __func__, a->name, *val, newParamId); } + snprintf(buf, sizeof(buf), "%ld", newParamId); } } } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d3fbc795a..dac9083c1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -146,6 +146,7 @@ if( HAVE_BUILD_TOOLS ) grib_ecc-1708 grib_ecc-1691 grib_ecc-1766 + grib_ecc-1806 bufr_ecc-1028 bufr_ecc-1195 bufr_ecc-1259 diff --git a/tests/grib_ecc-1806.sh b/tests/grib_ecc-1806.sh new file mode 100755 index 000000000..b271285e3 --- /dev/null +++ b/tests/grib_ecc-1806.sh @@ -0,0 +1,47 @@ +#!/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 + +label="grib_ecc-1806_test" +tempGribA=temp.$label.1.grib +tempGribB=temp.$label.2.grib +tempFilt=temp.$label.filt +tempLog=temp.$label.log +tempRef=temp.$label.ref + +sample_grib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + +test_conversion() +{ + param1=$1 # old paramId in GRIB1 + param2=$2 # new paramId in GRIB2 + short=$3 # new shortName + ${tools_dir}/grib_set -s paramId=$param1,edition=2 $sample_grib1 $tempGribA + grib_check_key_equals $tempGribA paramId,shortName "$param2 $short" + + # The old paramId has been removed from GRIB2 + set +e + ${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGribA 2>$REDIRECT + status=$? + set -e + [ $status -ne 0 ] + +} + +test_conversion 174098 262000 sithick +test_conversion 151163 262104 t20d +test_conversion 151145 262124 zos + +# Clean up +rm -f $tempGribA $tempGribB $tempFilt $tempLog $tempRef From ce791332a5c5a340cb30a202d30ccc666397aacd Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 19 Apr 2024 18:21:30 +0100 Subject: [PATCH 3/6] ECC-1806: Further tests --- definitions/grib1/section.1.def | 17 +++++++++++--- tests/grib_ecc-1806.sh | 39 ++++++++++++++++++++++++--------- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 9e7cc955b..778910695 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -328,7 +328,18 @@ meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,d # ECC-1806 concept_nofail paramIdForConversion(zero) { - 262000 = { gribTablesVersionNo=174;indicatorOfParameter=98; centre=98; } # 174098 -> 262000 - 262104 = { gribTablesVersionNo=151;indicatorOfParameter=163;centre=98; } # 151163 -> 262104 - 262124 = { gribTablesVersionNo=151;indicatorOfParameter=145;centre=98; } # 151145 -> 262124 + 228004 = { gribTablesVersionNo=128; indicatorOfParameter=55; centre=98; } # 55 -> 228004 + 235168 = { gribTablesVersionNo=128; indicatorOfParameter=56; centre=98; } # 56 -> 235168 + 235135 = { gribTablesVersionNo=130; indicatorOfParameter=232; centre=98; } # 130232 -> 235135 + 262104 = { gribTablesVersionNo=151; indicatorOfParameter=163; centre=98; } # 151163 -> 262104 + 262124 = { gribTablesVersionNo=151; indicatorOfParameter=145; centre=98; } # 151145 -> 262124 + 235033 = { gribTablesVersionNo=172; indicatorOfParameter=146; centre=98; } # 172146 -> 235033 + 235034 = { gribTablesVersionNo=172; indicatorOfParameter=147; centre=98; } # 172147 -> 235034 + 235035 = { gribTablesVersionNo=172; indicatorOfParameter=169; centre=98; } # 172169 -> 235035 + 235036 = { gribTablesVersionNo=172; indicatorOfParameter=175; centre=98; } # 172175 -> 235036 + 235037 = { gribTablesVersionNo=172; indicatorOfParameter=176; centre=98; } # 172176 -> 235037 + 235038 = { gribTablesVersionNo=172; indicatorOfParameter=177; centre=98; } # 172177 -> 235038 + 235039 = { gribTablesVersionNo=172; indicatorOfParameter=178; centre=98; } # 172178 -> 235039 + 235040 = { gribTablesVersionNo=172; indicatorOfParameter=179; centre=98; } # 172179 -> 235040 + 262000 = { gribTablesVersionNo=174; indicatorOfParameter=98; centre=98; } # 174098 -> 262000 } : long_type; diff --git a/tests/grib_ecc-1806.sh b/tests/grib_ecc-1806.sh index b271285e3..acdc49631 100755 --- a/tests/grib_ecc-1806.sh +++ b/tests/grib_ecc-1806.sh @@ -13,11 +13,9 @@ REDIRECT=/dev/null label="grib_ecc-1806_test" -tempGribA=temp.$label.1.grib -tempGribB=temp.$label.2.grib -tempFilt=temp.$label.filt +tempGrib1=temp.$label.1.grib +tempGrib2=temp.$label.2.grib tempLog=temp.$label.log -tempRef=temp.$label.ref sample_grib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl @@ -27,21 +25,42 @@ test_conversion() param1=$1 # old paramId in GRIB1 param2=$2 # new paramId in GRIB2 short=$3 # new shortName - ${tools_dir}/grib_set -s paramId=$param1,edition=2 $sample_grib1 $tempGribA - grib_check_key_equals $tempGribA paramId,shortName "$param2 $short" - # The old paramId has been removed from GRIB2 + ${tools_dir}/grib_set -s paramId=$param1 $sample_grib1 $tempGrib1 + set +e - ${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGribA 2>$REDIRECT + ${tools_dir}/grib_set -s edition=2 $tempGrib1 $tempGrib2 2>$REDIRECT status=$? set -e - [ $status -ne 0 ] + if [ $status -ne 0 ]; then + ${tools_dir}/grib_set -s stepType=avg,edition=2 $tempGrib1 $tempGrib2 + fi + grib_check_key_equals $tempGrib2 paramId,shortName "$param2 $short" + # Check the old paramId has been removed from GRIB2 + set +e + ${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGrib2 >$tempLog 2>&1 + status=$? + set -e + [ $status -ne 0 ] + grep -q "no match for paramId" $tempLog } test_conversion 174098 262000 sithick test_conversion 151163 262104 t20d test_conversion 151145 262124 zos +test_conversion 130232 235135 mw +test_conversion 172146 235033 msshf +test_conversion 172147 235034 mslhf +test_conversion 55 228004 mean2t +test_conversion 56 235168 m2d +test_conversion 172169 235035 msdwswrf +test_conversion 172175 235036 msdwlwrf +test_conversion 172176 235037 msnswrf +test_conversion 172177 235038 msnlwrf +test_conversion 172178 235039 mtnswrf +test_conversion 172179 235040 mtnlwrf + # Clean up -rm -f $tempGribA $tempGribB $tempFilt $tempLog $tempRef +rm -f $tempGrib1 $tempGrib2 $tempLog From b81ab6324abf0b023a0d18d8e867135e2a7eab6d Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 19 Apr 2024 22:18:09 +0100 Subject: [PATCH 4/6] ECC-1806: Additional entries for stepType --- .../ecmf/stepTypeForConversion.def | 14 ++++++++++ definitions/grib1/section.1.def | 28 +++++++++---------- tests/grib_ecc-1806.sh | 17 ++++------- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def index e74860061..5b0733488 100644 --- a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def +++ b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def @@ -198,3 +198,17 @@ "accum"={gribTablesVersionNo=162;indicatorOfParameter=112;centre=98;} # vtpha "accum"={gribTablesVersionNo=162;indicatorOfParameter=113;centre=98;} +# mvv +"avg"={gribTablesVersionNo=130;indicatorOfParameter=232;centre=98;} +# msshfl +"avg"={gribTablesVersionNo=172; indicatorOfParameter=146;centre=98;} +# mslhfl +"avg"={gribTablesVersionNo=172;indicatorOfParameter=147;centre=98;} +"avg"={gribTablesVersionNo=128;indicatorOfParameter=55;centre=98;} +"avg"={gribTablesVersionNo=128;indicatorOfParameter=56;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=169;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=175;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=176;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=177;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=178;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=179;centre=98;} diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 778910695..566936ca7 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -328,18 +328,18 @@ meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,d # ECC-1806 concept_nofail paramIdForConversion(zero) { - 228004 = { gribTablesVersionNo=128; indicatorOfParameter=55; centre=98; } # 55 -> 228004 - 235168 = { gribTablesVersionNo=128; indicatorOfParameter=56; centre=98; } # 56 -> 235168 - 235135 = { gribTablesVersionNo=130; indicatorOfParameter=232; centre=98; } # 130232 -> 235135 - 262104 = { gribTablesVersionNo=151; indicatorOfParameter=163; centre=98; } # 151163 -> 262104 - 262124 = { gribTablesVersionNo=151; indicatorOfParameter=145; centre=98; } # 151145 -> 262124 - 235033 = { gribTablesVersionNo=172; indicatorOfParameter=146; centre=98; } # 172146 -> 235033 - 235034 = { gribTablesVersionNo=172; indicatorOfParameter=147; centre=98; } # 172147 -> 235034 - 235035 = { gribTablesVersionNo=172; indicatorOfParameter=169; centre=98; } # 172169 -> 235035 - 235036 = { gribTablesVersionNo=172; indicatorOfParameter=175; centre=98; } # 172175 -> 235036 - 235037 = { gribTablesVersionNo=172; indicatorOfParameter=176; centre=98; } # 172176 -> 235037 - 235038 = { gribTablesVersionNo=172; indicatorOfParameter=177; centre=98; } # 172177 -> 235038 - 235039 = { gribTablesVersionNo=172; indicatorOfParameter=178; centre=98; } # 172178 -> 235039 - 235040 = { gribTablesVersionNo=172; indicatorOfParameter=179; centre=98; } # 172179 -> 235040 - 262000 = { gribTablesVersionNo=174; indicatorOfParameter=98; centre=98; } # 174098 -> 262000 + 228004 = { gribTablesVersionNo=128; indicatorOfParameter=55; centre=98; } # 55 -> 228004 + 235168 = { gribTablesVersionNo=128; indicatorOfParameter=56; centre=98; } # 56 -> 235168 + 235135 = { gribTablesVersionNo=130; indicatorOfParameter=232; centre=98; } # 130232 -> 235135 + 262104 = { gribTablesVersionNo=151; indicatorOfParameter=163; centre=98; } # 151163 -> 262104 + 262124 = { gribTablesVersionNo=151; indicatorOfParameter=145; centre=98; } # 151145 -> 262124 + 235033 = { gribTablesVersionNo=172; indicatorOfParameter=146; centre=98; } # 172146 -> 235033 + 235034 = { gribTablesVersionNo=172; indicatorOfParameter=147; centre=98; } # 172147 -> 235034 + 235035 = { gribTablesVersionNo=172; indicatorOfParameter=169; centre=98; } # 172169 -> 235035 + 235036 = { gribTablesVersionNo=172; indicatorOfParameter=175; centre=98; } # 172175 -> 235036 + 235037 = { gribTablesVersionNo=172; indicatorOfParameter=176; centre=98; } # 172176 -> 235037 + 235038 = { gribTablesVersionNo=172; indicatorOfParameter=177; centre=98; } # 172177 -> 235038 + 235039 = { gribTablesVersionNo=172; indicatorOfParameter=178; centre=98; } # 172178 -> 235039 + 235040 = { gribTablesVersionNo=172; indicatorOfParameter=179; centre=98; } # 172179 -> 235040 + 262000 = { gribTablesVersionNo=174; indicatorOfParameter=98; centre=98; } # 174098 -> 262000 } : long_type; diff --git a/tests/grib_ecc-1806.sh b/tests/grib_ecc-1806.sh index acdc49631..596158b8d 100755 --- a/tests/grib_ecc-1806.sh +++ b/tests/grib_ecc-1806.sh @@ -17,8 +17,8 @@ tempGrib1=temp.$label.1.grib tempGrib2=temp.$label.2.grib tempLog=temp.$label.log -sample_grib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl -sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +sampleGrib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +sampleGrib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl test_conversion() { @@ -26,20 +26,13 @@ test_conversion() param2=$2 # new paramId in GRIB2 short=$3 # new shortName - ${tools_dir}/grib_set -s paramId=$param1 $sample_grib1 $tempGrib1 - - set +e - ${tools_dir}/grib_set -s edition=2 $tempGrib1 $tempGrib2 2>$REDIRECT - status=$? - set -e - if [ $status -ne 0 ]; then - ${tools_dir}/grib_set -s stepType=avg,edition=2 $tempGrib1 $tempGrib2 - fi + ${tools_dir}/grib_set -s paramId=$param1 $sampleGrib1 $tempGrib1 + ${tools_dir}/grib_set -s edition=2 $tempGrib1 $tempGrib2 grib_check_key_equals $tempGrib2 paramId,shortName "$param2 $short" # Check the old paramId has been removed from GRIB2 set +e - ${tools_dir}/grib_set -s paramId=$param1 $sample_grib2 $tempGrib2 >$tempLog 2>&1 + ${tools_dir}/grib_set -s paramId=$param1 $sampleGrib2 $tempGrib2 >$tempLog 2>&1 status=$? set -e [ $status -ne 0 ] From 9dc4707525a4e22ad74e484c3dc44a8c1c062405 Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 20 Apr 2024 13:01:54 +0100 Subject: [PATCH 5/6] ECC-1806: Entries for stepType --- .../localConcepts/ecmf/stepTypeForConversion.def | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def index 5b0733488..60530eddb 100644 --- a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def +++ b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def @@ -3,9 +3,9 @@ # get returns the LAST match # ECC-457: ECMWF Total Precipitation -"accum" = {timeRangeIndicator=0;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} -"accum" = {timeRangeIndicator=1;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} -"accum" = {timeRangeIndicator=10;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} +"accum"={timeRangeIndicator=0;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} +"accum"={timeRangeIndicator=1;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} +"accum"={timeRangeIndicator=10;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} # sro "accum"={gribTablesVersionNo=128;indicatorOfParameter=8;centre=98;} @@ -201,14 +201,22 @@ # mvv "avg"={gribTablesVersionNo=130;indicatorOfParameter=232;centre=98;} # msshfl -"avg"={gribTablesVersionNo=172; indicatorOfParameter=146;centre=98;} +"avg"={gribTablesVersionNo=172;indicatorOfParameter=146;centre=98;} # mslhfl "avg"={gribTablesVersionNo=172;indicatorOfParameter=147;centre=98;} +# mean2t24 "avg"={gribTablesVersionNo=128;indicatorOfParameter=55;centre=98;} +# mn2d24 "avg"={gribTablesVersionNo=128;indicatorOfParameter=56;centre=98;} +# msdsrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=169;centre=98;} +# msdtrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=175;centre=98;} +# msnsrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=176;centre=98;} +# msntrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=177;centre=98;} +# mtnsrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=178;centre=98;} +# mtntrf "avg"={gribTablesVersionNo=172;indicatorOfParameter=179;centre=98;} From 403ef585e034cc64250ab77b15029c8a3e1a6c2f Mon Sep 17 00:00:00 2001 From: shahramn Date: Sat, 20 Apr 2024 13:57:17 +0100 Subject: [PATCH 6/6] ECC-1806: Move the concept into its own file --- .../ecmf/paramIdForConversion.def | 31 +++++++++++++++++++ .../ecmf/stepTypeForConversion.def | 4 +-- definitions/grib1/paramIdForConversion.def | 3 ++ definitions/grib1/section.1.def | 17 +--------- 4 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 definitions/grib1/localConcepts/ecmf/paramIdForConversion.def create mode 100644 definitions/grib1/paramIdForConversion.def diff --git a/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def new file mode 100644 index 000000000..67de48733 --- /dev/null +++ b/definitions/grib1/localConcepts/ecmf/paramIdForConversion.def @@ -0,0 +1,31 @@ +# Concept paramIdForConversion for ECMWF +# ECC-1806 + +# 55 -> 228004 +228004 = {gribTablesVersionNo=128; indicatorOfParameter=55; centre=98;} +# 56 -> 235168 +235168 = {gribTablesVersionNo=128; indicatorOfParameter=56; centre=98;} +# 130232 -> 235135 +235135 = {gribTablesVersionNo=130; indicatorOfParameter=232; centre=98;} +# 151163 -> 262104 +262104 = {gribTablesVersionNo=151; indicatorOfParameter=163; centre=98;} +# 151145 -> 262124 +262124 = {gribTablesVersionNo=151; indicatorOfParameter=145; centre=98;} +# 172146 -> 235033 +235033 = {gribTablesVersionNo=172; indicatorOfParameter=146; centre=98;} +# 172147 -> 235034 +235034 = {gribTablesVersionNo=172; indicatorOfParameter=147; centre=98;} +# 172169 -> 235035 +235035 = {gribTablesVersionNo=172; indicatorOfParameter=169; centre=98;} +# 172175 -> 235036 +235036 = {gribTablesVersionNo=172; indicatorOfParameter=175; centre=98;} +# 172176 -> 235037 +235037 = {gribTablesVersionNo=172; indicatorOfParameter=176; centre=98;} +# 172177 -> 235038 +235038 = {gribTablesVersionNo=172; indicatorOfParameter=177; centre=98;} +# 172178 -> 235039 +235039 = {gribTablesVersionNo=172; indicatorOfParameter=178; centre=98;} +# 172179 -> 235040 +235040 = {gribTablesVersionNo=172; indicatorOfParameter=179; centre=98;} +# 174098 -> 262000 +262000 = {gribTablesVersionNo=174; indicatorOfParameter=98; centre=98;} diff --git a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def index 60530eddb..25aae31d8 100644 --- a/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def +++ b/definitions/grib1/localConcepts/ecmf/stepTypeForConversion.def @@ -1,8 +1,6 @@ # Concept stepTypeForConversion for ECMWF -# set uses the FIRST one -# get returns the LAST match -# ECC-457: ECMWF Total Precipitation +# ECC-457: total precipitation "accum"={timeRangeIndicator=0;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} "accum"={timeRangeIndicator=1;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} "accum"={timeRangeIndicator=10;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;} diff --git a/definitions/grib1/paramIdForConversion.def b/definitions/grib1/paramIdForConversion.def new file mode 100644 index 000000000..8cd3ea212 --- /dev/null +++ b/definitions/grib1/paramIdForConversion.def @@ -0,0 +1,3 @@ +# Concept paramIdForConversion +# See ECC-1806 +0 = {dummy=0;} diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 566936ca7..d62300f27 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -327,19 +327,4 @@ meta md5Section1 md5(offsetSection1,section1Length); meta md5Product md5(offsetSection1,section1Length,gridDefinition,section1Flags,decimalScaleFactor); # ECC-1806 -concept_nofail paramIdForConversion(zero) { - 228004 = { gribTablesVersionNo=128; indicatorOfParameter=55; centre=98; } # 55 -> 228004 - 235168 = { gribTablesVersionNo=128; indicatorOfParameter=56; centre=98; } # 56 -> 235168 - 235135 = { gribTablesVersionNo=130; indicatorOfParameter=232; centre=98; } # 130232 -> 235135 - 262104 = { gribTablesVersionNo=151; indicatorOfParameter=163; centre=98; } # 151163 -> 262104 - 262124 = { gribTablesVersionNo=151; indicatorOfParameter=145; centre=98; } # 151145 -> 262124 - 235033 = { gribTablesVersionNo=172; indicatorOfParameter=146; centre=98; } # 172146 -> 235033 - 235034 = { gribTablesVersionNo=172; indicatorOfParameter=147; centre=98; } # 172147 -> 235034 - 235035 = { gribTablesVersionNo=172; indicatorOfParameter=169; centre=98; } # 172169 -> 235035 - 235036 = { gribTablesVersionNo=172; indicatorOfParameter=175; centre=98; } # 172175 -> 235036 - 235037 = { gribTablesVersionNo=172; indicatorOfParameter=176; centre=98; } # 172176 -> 235037 - 235038 = { gribTablesVersionNo=172; indicatorOfParameter=177; centre=98; } # 172177 -> 235038 - 235039 = { gribTablesVersionNo=172; indicatorOfParameter=178; centre=98; } # 172178 -> 235039 - 235040 = { gribTablesVersionNo=172; indicatorOfParameter=179; centre=98; } # 172179 -> 235040 - 262000 = { gribTablesVersionNo=174; indicatorOfParameter=98; centre=98; } # 174098 -> 262000 -} : long_type; +concept_nofail paramIdForConversion(zero, "paramIdForConversion.def", conceptsDir2, conceptsDir1) : long_type,read_only;