#!/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 label="grib_ecc-1212_test" tempGrib=temp.$label.grib tempFilt=temp.$label.filt tempOut=temp.$label.out tempRef=temp.$label.ref sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl # Create a GRIB with the local time template cat > $tempFilt < $tempOut cat > $tempRef < $tempOut # edition centre date time dataType gridType typeOfLevel level shortName packingType echo "2 ecmf 20200805 1200 an regular_ll surface 0 t grid_simple" > $tempRef diff -w $tempRef $tempOut # Check "time" namespace ${tools_dir}/grib_get -n time $tempGrib > $tempOut echo "h 20200804 0000 36" > $tempRef diff -w $tempRef $tempOut # numberOfForecastsUsedInLocalTime > 1 # ------------------------------------ cat > $tempFilt < $tempOut for pdtn in 88 92 93 94 95 96 97 98; do ${tools_dir}/grib_set -s \ tablesVersion=30,productDefinitionTemplateNumber=$pdtn,numberOfForecastsUsedInLocalTime=1 \ $sample_grib2 $tempGrib grib_check_key_equals $tempGrib time.stepUnits:s,time.dataDate,time.dataTime 'h 0 0' done # Clean up rm -f $tempGrib $tempFilt $tempOut $tempRef