From 3c2688382be807ddc8bb56aeaab60a6768ad3983 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 25 Apr 2018 16:12:35 +0100 Subject: [PATCH 1/2] ECC-481: test added --- tests/CMakeLists.txt | 1 + tests/bufr_subTypes.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 tests/bufr_subTypes.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6214de6ed..c9030c71c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -53,6 +53,7 @@ list( APPEND tests_no_data_reqd julian bufr_ecc-359 bufr_ecc-517 + bufr_subTypes grib_efas ) # These tests do require data downloads diff --git a/tests/bufr_subTypes.sh b/tests/bufr_subTypes.sh new file mode 100755 index 000000000..e157d87b6 --- /dev/null +++ b/tests/bufr_subTypes.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Copyright 2005-2018 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.sh + +label="bufr_subTypes" +fBufr3Input=$ECCODES_SAMPLES_PATH/BUFR3_local.tmpl +fBufr4Input=$ECCODES_SAMPLES_PATH/BUFR4_local.tmpl +fBufrOutput=${label}".bufr.tmp" + +inputs="$fBufr3Input $fBufr4Input" +for fin in $inputs; do + ${tools_dir}/bufr_set -s oldSubtype=2,newSubtype=300 $fin $fBufrOutput + res=`${tools_dir}/bufr_get -p rdbSubtype,oldSubtype,newSubtype $fBufrOutput` + [ "$res" = "2 2 300" ] + + ${tools_dir}/bufr_set -s oldSubtype=255,newSubtype=300 $fin $fBufrOutput + res=`${tools_dir}/bufr_get -p rdbSubtype,oldSubtype,newSubtype $fBufrOutput` + [ "$res" = "300 255 300" ] +done + + +rm -f $fBufrOutput From 9a6d266bbfcbf0ae17046a8892426da2b645609c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Apr 2018 12:30:58 +0100 Subject: [PATCH 2/2] ECC-663: EFAS mars.step for type 'go' fixed --- definitions/mars/grib.efas.go.def | 2 ++ tests/grib_efas.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/definitions/mars/grib.efas.go.def b/definitions/mars/grib.efas.go.def index 9def2ce65..0b56d2c73 100644 --- a/definitions/mars/grib.efas.go.def +++ b/definitions/mars/grib.efas.go.def @@ -1,4 +1,6 @@ # EFAS Gridded observations +alias mars.step = startStep; + alias mars.date = dateOfForecast; alias mars.time = timeOfForecast; diff --git a/tests/grib_efas.sh b/tests/grib_efas.sh index 4809c1cf3..6cfa61121 100755 --- a/tests/grib_efas.sh +++ b/tests/grib_efas.sh @@ -66,7 +66,7 @@ grib_check_key_equals $temp1 anoffset 25 grib_check_key_equals $temp1 anoffsetFirst,anoffsetLast,anoffsetFrequency "MISSING MISSING MISSING" # ECC-663: MARS step -types="an fu" +types="an fu go" for t in $types; do ${tools_dir}/grib_set -s setLocalDefinition=1,localDefinitionNumber=41,type=$t,stepType=accum,stepRange=12-36,paramId=260268 \ $sample $temp1 @@ -74,7 +74,7 @@ for t in $types; do #${tools_dir}/grib_dump -Da $temp1 | grep mars.step done -types="go fc pf cf" +types="fc pf cf" for t in $types; do ${tools_dir}/grib_set -s setLocalDefinition=1,localDefinitionNumber=41,type=$t,stepType=accum,stepRange=12-36,paramId=260268 \ $sample $temp1