2014-11-13 16:47:32 +00:00
|
|
|
#!/bin/sh
|
2015-12-31 12:44:51 +00:00
|
|
|
# Copyright 2005-2016 ECMWF.
|
2014-11-13 16:47:32 +00:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
|
|
|
REDIRECT=/dev/null
|
|
|
|
|
|
|
|
temp1=temp1.calendar.$$
|
|
|
|
temp2=temp2.calendar.$$
|
2015-01-23 22:47:51 +00:00
|
|
|
sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
2014-11-13 16:47:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
${tools_dir}grib_set -s tablesVersion=13,setCalendarId=1,typeOfCalendar=0 $sample $temp1
|
|
|
|
check_key_equals $temp1 calendarIdPresent 1
|
|
|
|
check_key_equals $temp1 section1Length 24
|
|
|
|
check_key_equals $temp1 calendarIdentificationTemplateNumber 0
|
|
|
|
check_key_equals $temp1 typeOfCalendar 0
|
|
|
|
|
|
|
|
${tools_dir}grib_set -s tablesVersion=13,setCalendarId=1,calendarIdentificationTemplateNumber=1 $sample $temp1
|
|
|
|
check_key_equals $temp1 calendarIdPresent 1
|
|
|
|
check_key_equals $temp1 section1Length 25
|
|
|
|
check_key_equals $temp1 calendarIdentificationTemplateNumber 1
|
|
|
|
check_key_equals $temp1 numberOfTensOfThousandsOfYearsOfOffset MISSING
|
|
|
|
|
|
|
|
${tools_dir}grib_set -s tablesVersion=13,setCalendarId=1,calendarIdentificationTemplateNumber=2 $sample $temp1
|
|
|
|
check_key_equals $temp1 calendarIdPresent 1
|
|
|
|
check_key_equals $temp1 section1Length 26
|
|
|
|
check_key_equals $temp1 calendarIdentificationTemplateNumber 2
|
|
|
|
check_key_equals $temp1 typeOfCalendar 255
|
|
|
|
check_key_equals $temp1 numberOfTensOfThousandsOfYearsOfOffset MISSING
|
|
|
|
|
|
|
|
# Remove the calendar section
|
|
|
|
${tools_dir}grib_set -s deleteCalendarId=1 $temp1 $temp2
|
|
|
|
check_key_equals $temp2 section1Length 21
|
|
|
|
check_key_equals $temp2 calendarIdPresent 0
|
|
|
|
|
|
|
|
rm -f $temp1 $temp2
|