Skip to content

Commit

Permalink
ECC-1855: Fix step initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Jul 30, 2024
1 parent 5b1a7a3 commit 2fb5fbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/accessor/grib_accessor_class_g2end_step.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions tests/grib_sub_hourly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ fi
instantaneous_field=$data_dir/reduced_gaussian_surface.grib2
accumulated_field=$data_dir/reduced_gaussian_sub_area.grib2

# ECC-1855: Bad step initialisation
${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-1802: Relaxation of the "Step Units Rule":
# The updated rule permits the simultaneous assignment of the same step unit to both 'stepUnits' and 'step*' keys
in="$instantaneous_field"
Expand Down

0 comments on commit 2fb5fbb

Please sign in to comment.