@@ -63,7 +63,23 @@ instantaneous_field=$data_dir/reduced_gaussian_surface.grib2
63
63
accumulated_field=$data_dir /reduced_gaussian_sub_area.grib2
64
64
65
65
66
+ fn=" $instantaneous_field "
67
+ low_level_keys=" forecastTime,indicatorOfUnitOfTimeRange:s"
68
+ ${tools_dir} /grib_set -s stepUnits=m,step=60 $fn $temp
69
+ grib_check_key_equals $temp " -p $low_level_keys " " 60 m"
70
+ ${tools_dir} /grib_set -s stepUnits=s $temp $temp2
71
+ grib_check_key_equals $temp2 " -p $low_level_keys " " 3600 s"
72
+ ${tools_dir} /grib_set -s stepUnits=h $temp $temp2
73
+ grib_check_key_equals $temp2 " -p $low_level_keys " " 1 h"
66
74
75
+ fn=" $accumulated_field "
76
+ low_level_keys=" forecastTime,indicatorOfUnitOfTimeRange:s,lengthOfTimeRange,indicatorOfUnitForTimeRange:s"
77
+ ${tools_dir} /grib_set -s stepUnits=m,stepRange=60-180 $fn $temp
78
+ grib_check_key_equals $temp " -p $low_level_keys " " 60 m 120 m"
79
+ ${tools_dir} /grib_set -s stepUnits=s $temp $temp2
80
+ grib_check_key_equals $temp2 " -p $low_level_keys " " 3600 s 7200 s"
81
+ ${tools_dir} /grib_set -s stepUnits=h $temp $temp2
82
+ grib_check_key_equals $temp2 " -p $low_level_keys " " 1 h 2 h"
67
83
68
84
# Check the lowercase alias 'stepunits' for a variety of step types (instant, accum etc)
69
85
${tools_dir} /grib_get -p stepunits $data_dir /tigge_cf_ecmwf.grib2
@@ -92,13 +108,6 @@ grib_check_key_equals $temp "-p $keys_step_range" "59m 59m 59 59 m"
92
108
grib_check_key_equals $temp " -p $keys_start_step " " 59m 59m 59 59 m"
93
109
grib_check_key_equals $temp " -p $keys_end_step " " 59m 59m 59 59 m"
94
110
95
- ${tools_dir} /grib_set -s stepUnits=m,step=60 $fn $temp
96
- grib_check_key_equals $temp " -p $low_level_keys " " 60 m"
97
- ${tools_dir} /grib_set -s stepUnits=s $temp $temp2
98
- grib_check_key_equals $temp2 " -p $low_level_keys " " 3600 s"
99
- ${tools_dir} /grib_set -s stepUnits=h $temp $temp2
100
- grib_check_key_equals $temp2 " -p $low_level_keys " " 1 h"
101
-
102
111
# ### stepUnits overrides the units in the low level keys
103
112
# if stepUnits=UNIT is set, then set the low level keys to UNIT
104
113
# else optimise low level keys
0 commit comments