Changing the sampling period in an accumulated diagnostic prevents merging of cubes
- Dominant language
- Python
- Stars
- 33
- Forks
- 19
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 30
Description
The metadata for cubes of accumulated diagnostics contain information on the model's timestep since we typically accumulate values every timestep. This prevents the merging of cubes if the timestep is changed in the middle of a run. Generally, the timestep will be fixed, but in long or operational runs it may occasionally be necessary to run with a short timestep to nurse the simulation past a crash. It is most likely to occur when setting up a new simulation and trying to select an optimal timestep. Whether it is truly a bug is debatable (strictly, the cubes are different), but it is at least worth recording the issue for future reference.
Here is an example of a cube that could be affected:
surface_microphysical_rainfall_amount / (kg m-2) (time: 6; grid_latitude: 672; grid_longitude: 672)
Dimension coordinates:
time x - -
grid_latitude - x -
grid_longitude - - x
Auxiliary coordinates:
forecast_period x - -
Scalar coordinates:
forecast_reference_time 2022-12-01 00:00:00
Cell methods:
0 time: sum (interval: 60 s)
1 time: sum (interval: 60 s)
Attributes:
Conventions 'CF-1.7'
STASH m01s04i201
description 'Created by xios'
interval_operation '60 s'
interval_write '1 h'
online_operation 'accumulate'
title 'Created by xios'
The timestep appears in the cell methods and the attribute interval_operation.
The bug may be recreated by changing the timestep part way through a run and verifying over an interval bracketing the change.
On balance, I would probably prefer a change of timestep not to prevent merging in such a case.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with an accumulated diagnostic whose timestep changes part way through a run, then verify over an interval bracketing the change. Inspect the cube-merging logic and how it compares cell methods and the interval_operation attribute. Done means compatible accumulated cubes merge despite a timestep change, with existing behavior preserved for genuinely incompatible cubes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100