diff --git a/src/accessor/grib_accessor_class_g2end_step.cc b/src/accessor/grib_accessor_class_g2end_step.cc index 7d3c2c225..78fdfb129 100644 --- a/src/accessor/grib_accessor_class_g2end_step.cc +++ b/src/accessor/grib_accessor_class_g2end_step.cc @@ -309,7 +309,7 @@ static int unpack_multiple_time_ranges_double_(grib_accessor* a, double* val, si long the_coded_unit = arr_coded_unit[i]; long the_coded_time_range = arr_coded_time_range[i]; - eccodes::Step time_range{ the_coded_unit, the_coded_time_range }; + eccodes::Step time_range{the_coded_time_range, the_coded_unit}; *val = (start_step + time_range).value(eccodes::Unit(step_units)); return GRIB_SUCCESS; diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index a49a90a6a..0f543cb79 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -62,6 +62,11 @@ fi instantaneous_field=$data_dir/reduced_gaussian_surface.grib2 accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2 +# ECC-18XX: Bad step initialisatino +${tools_dir}/grib_set -s productDefinitionTemplateNumber=11,forecastTime=2184,indicatorOfUnitForForecastTime=1,lengthOfTimeRange=720,indicatorOfUnitForTimeRange=1,typeOfTimeIncrement=2,numberOfTimeRange=2 $accumulated_field $temp +${tools_dir}/grib_ls $temp +grib_check_key_equals $temp "-p stepRange" "2184-2904" + # ECC-1228: Changing template with negative forecast time ${tools_dir}/grib_set -s stepRange=-48s--24s $accumulated_field $temp ${tools_dir}/grib_set -s productDefinitionTemplateNumber=8 $temp $temp2