Skip to content

Conversation

@joewallwork
Copy link
Contributor

@joewallwork joewallwork commented Nov 11, 2025

File behaviour for restarts and diagnostics

Fixes #935
Fixes #977
Fixes #997
Fixes #898
Merges into #999

Task List

  • Defined the tests that specify a complete and functioning change (It may help to create a design specification & test specification)
  • Implemented the source code change that satisfies the tests
  • Documented the feature by providing worked example
  • Completed the pre-Request checklist below

Change Description

This PR fixes several things related to how restarts and diagnostics are configured with XIOS:

  1. Diagnostics are created by averaging all timesteps included in an output file dump.
  2. Restart file output frequency and split frequency are aligned so that each output file dump only includes a single timestep's worth of data.
  3. Restart files are only read once.
  4. Handle file patterns in filenames.

Whilst file patterns are made consistent with what's used elsewhere in nextSIM-DG, the output filenames show the range of datetimes separated by a hyphen.

In this PR, I also overhauled the createFile member function, inlining many of the setters with only a single call site.


Test Description

Tests are updated to account for the new behaviour.

TODO - to test the diagnostics are written out.

I decided to drop XiosFile_test because it is no longer needed. This meant that we could drop the annoying unittest special case.


Documentation Impact

TODO


Pre-Request Checklist

  • The requirements of this pull request are fully captured in an issue or design specification and are linked and summarised in the description of this PR
  • No new warnings are generated
  • The documentation has been updated (or an issue has been created to track the corresponding change)
  • Methods and Tests are commented such that they can be understood without having to obtain additional context
  • This PR/Issue is labelled as a bug/feature/enhancement/breaking change
  • This change conforms to the conventions described in the README

@joewallwork joewallwork self-assigned this Nov 11, 2025
@joewallwork joewallwork added bug Something isn't working enhancement New feature or request ICCS Tasks or reviews for the ICCS team labels Nov 11, 2025
@joewallwork joewallwork mentioned this pull request Nov 11, 2025
11 tasks
@joewallwork joewallwork force-pushed the issue935_xios-landmask branch from 5ae4048 to 8b5f23a Compare November 18, 2025 13:25
@joewallwork joewallwork changed the base branch from develop to issue990_xios_write-then-read-take3 November 25, 2025 13:43
@joewallwork joewallwork force-pushed the issue935_xios-landmask branch from 8b5f23a to dfa80d5 Compare November 25, 2025 13:43
Otherwise, it will be zeroed in file splits after the first
@joewallwork joewallwork force-pushed the issue990_xios_write-then-read-take3 branch from 3582343 to c16977a Compare November 25, 2025 15:30
@joewallwork joewallwork force-pushed the issue935_xios-landmask branch from dfa80d5 to 33e0a3e Compare November 25, 2025 17:33
@joewallwork joewallwork force-pushed the issue990_xios_write-then-read-take3 branch 4 times, most recently from 183435f to 279efaa Compare December 2, 2025 10:50
@joewallwork joewallwork force-pushed the issue990_xios_write-then-read-take3 branch from 279efaa to e157a0c Compare December 2, 2025 12:01
Base automatically changed from issue990_xios_write-then-read-take3 to develop December 4, 2025 13:02
config << "stop = 2023-03-17T23:11:00Z" << std::endl;
config << "time_step = P0-0T01:30:00" << std::endl;
config << "init_file = " << restartFilename << std::endl;
config << "restart_period = P0-0T01:30:00" << std::endl;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The restart period needs to be provided, otherwise XIOS stalls.

@joewallwork
Copy link
Contributor Author

Superseded by #1002.

@joewallwork joewallwork closed this Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request ICCS Tasks or reviews for the ICCS team

Projects

None yet

2 participants