From b319f6ef433569c8d73e00439fc75c07276abc74 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 11 May 2018 16:05:56 +0100 Subject: [PATCH] ECC-689: GRIB decode performance: remove redundant keys from GRIB2 messages --- definitions/boot.def | 8 +------- definitions/grib1/boot.def | 6 ++++++ tests/grib1to2.sh | 10 ++++++++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/definitions/boot.def b/definitions/boot.def index f41ab73cb..abebf4f09 100644 --- a/definitions/boot.def +++ b/definitions/boot.def @@ -24,19 +24,13 @@ constant zero=0 : hidden; constant one=1 : hidden; constant two=1 : hidden; constant three=1 : hidden; -constant eight=8 : hidden; constant hundred=100 : hidden; -constant eleven=11 : hidden; constant true="true" :hidden; constant false="false" : hidden; transient truncateLaplacian=0 : hidden; constant marsDir="mars" : no_copy,hidden; constant present=1 : hidden; -constant epsPoint=1 : hidden; -constant epsContinous=11 : hidden; -constant epsStatisticsPoint=2 : hidden; -constant epsStatisticsContinous=12 : hidden; -alias epsStatistics=zero : hidden; +# alias epsStatistics=zero : hidden; constant defaultParameter = 0 : hidden; constant defaultName="unknown" :hidden; diff --git a/definitions/grib1/boot.def b/definitions/grib1/boot.def index ffb46fa6f..6f8e8d66a 100644 --- a/definitions/grib1/boot.def +++ b/definitions/grib1/boot.def @@ -9,6 +9,12 @@ constant ieeeFloats = 0 : hidden, edition_specific; transient eps=0; +constant eight=8 : hidden; +constant eleven=11 : hidden; +constant epsPoint=1 : hidden; +constant epsContinous=11 : hidden; +constant epsStatisticsPoint=2 : hidden; +constant epsStatisticsContinous=12 : hidden; meta headersOnly headers_only(); diff --git a/tests/grib1to2.sh b/tests/grib1to2.sh index b6b868c38..f4829ef58 100755 --- a/tests/grib1to2.sh +++ b/tests/grib1to2.sh @@ -51,6 +51,7 @@ do done # ECC-457 ECMWF total precipitation +# ---------------------------------- input=${data_dir}/tp_ecmwf.grib output=temp.grib1to2.grib ${tools_dir}/grib_set -s edition=2 $input $output @@ -58,6 +59,15 @@ res=`${tools_dir}/grib_get -w count=1 -p edition,paramId,units $output` [ "$res" = "2 228228 kg m**-2" ] rm -f $output +# Local Definition 30 +# -------------------- +sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +${tools_dir}/grib_set -s setLocalDefinition=1,localDefinitionNumber=30,stepType=accum,edition=2 $sample_g1 $output +grib_check_key_equals $output productDefinitionTemplateNumber 11 +${tools_dir}/grib_set -s setLocalDefinition=1,localDefinitionNumber=30,type=em,stepType=accum,edition=2 $sample_g1 $output +grib_check_key_equals $output productDefinitionTemplateNumber 12 +rm -f $output + #sed "s:toolsdir:${tools_dir}/:" ${tools_dir}/grib1to2.txt > ${tools_dir}/grib1to2.test #chmod +x ${tools_dir}/grib1to2.test #${tools_dir}/grib1to2.test -f ${data_dir}/test.grib1 ${data_dir}/test.grib2