Skip to content

Conversation

@joewallwork
Copy link
Contributor

@joewallwork joewallwork commented Jan 14, 2026

XIOS: allow reading and writing in the same run

Fixes #1007
Merges into #1011

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
  • Updated the README or other documentation
  • Completed the pre-Request checklist below

Change Description

In order to allow the reading and writing of a field in the same run, it turned out that I needed to create an additional field for the reading and to associate the two together with a field reference. They point to the same data but it allows the field for reading to have different I/O properties, e.g., "instant", "averaging", "once". It does not appear to be required to create an additional field for writing - you can just use the 'base' field.

To facilitate the creation of the inherited field, this PR adds a createInheritedField member function. Helper functions getFileIOType and setFieldOperation are also introduced.


Test Description

To demonstrate that the functionality does indeed work, I've introduced an additional test XiosReadWriteRestarts_test. It reads the xios_test_input.nc file in as a restart in ModelState format, writes it back out as a restart dump, and then checks the corresponding files exist.

I also removed XiosField_test as it's no longer needed.


Documentation Impact

A developer note has been added in the XIOS doc page.


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 Jan 14, 2026
@joewallwork joewallwork added enhancement New feature or request ICCS Tasks or reviews for the ICCS team labels Jan 14, 2026
@joewallwork joewallwork linked an issue Jan 14, 2026 that may be closed by this pull request
@joewallwork
Copy link
Contributor Author

How bizarre. The tests all pass on my machine (even after removing the build directory and rebuilding). I'll debug this next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ICCS Tasks or reviews for the ICCS team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XIOS: Allow a field to be both read and written

2 participants