ECC-1855: Fix step initialisation

This commit is contained in:
Eugen Betke 2024-07-02 19:29:17 +00:00
parent f0a46c9c3c
commit 5a932544af
2 changed files with 6 additions and 1 deletions

View File

@ -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<double>(eccodes::Unit(step_units));
return GRIB_SUCCESS;

View File

@ -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