From 2e45994e84dd6450bfd1ab81bba7caa2a7ae28e5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 10 Mar 2021 16:10:33 +0000 Subject: [PATCH] ECC-1216: GRIB2: Add 'time' to the 'ls' namespace for local time templates --- definitions/grib2/template.4.localtime.def | 9 ++++++--- tests/grib_ecc-1212.sh | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/definitions/grib2/template.4.localtime.def b/definitions/grib2/template.4.localtime.def index 28de28173..82c32f48c 100644 --- a/definitions/grib2/template.4.localtime.def +++ b/definitions/grib2/template.4.localtime.def @@ -44,6 +44,12 @@ localTimeForecastList list(numberOfForecastsUsedInLocalTime) unsigned[4] timeIncrement=0 : dump; } +alias ls.time=dataTime; +# See ECC-707 +transient lsdate_bug = 1: hidden; +transient lstime_bug = 1: hidden; + + if (numberOfForecastsUsedInLocalTime == 1) { meta dateOfForecastUsedInLocalTime g2date(yearOfForecastUsedInLocalTime, monthOfForecastUsedInLocalTime, dayOfForecastUsedInLocalTime) : dump; meta timeOfForecastUsedInLocalTime time(hourOfForecastUsedInLocalTime, minuteOfForecastUsedInLocalTime, secondOfForecastUsedInLocalTime) : dump; @@ -73,6 +79,3 @@ if (numberOfForecastsUsedInLocalTime == 1) { alias mars.step = endStep; } - -# See ECC-707 -transient lsdate_bug = 1: hidden; diff --git a/tests/grib_ecc-1212.sh b/tests/grib_ecc-1212.sh index ede61bd1a..148dad121 100755 --- a/tests/grib_ecc-1212.sh +++ b/tests/grib_ecc-1212.sh @@ -73,12 +73,13 @@ grib_check_key_equals $tempGrib dateOfForecastUsedInLocalTime '20200804' grib_check_key_equals $tempGrib timeOfForecastUsedInLocalTime '0' -# Check grib_ls output +# Check "ls" namespace ${tools_dir}/grib_get -n ls $tempGrib > $tempOut -echo "2 ecmf 20200805 an regular_ll surface 0 t grid_simple" > $tempRef +# edition centre date time dataType gridType typeOfLevel level shortName packingType +echo "2 ecmf 20200805 1200 an regular_ll surface 0 t grid_simple" > $tempRef cat $tempOut -diff $tempRef $tempOut +diff -w $tempRef $tempOut # Clean up -rm -f $tempGrib $tempFilt $tempOut $tempRef +#rm -f $tempGrib $tempFilt $tempOut $tempRef