XIOS: allow reading and writing in the same run #1017
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
XIOS: allow reading and writing in the same run
Fixes #1007
Merges into #1011
Task List
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
createInheritedFieldmember function. Helper functionsgetFileIOTypeandsetFieldOperationare also introduced.Test Description
To demonstrate that the functionality does indeed work, I've introduced an additional test
XiosReadWriteRestarts_test. It reads thexios_test_input.ncfile in as a restart inModelStateformat, writes it back out as a restart dump, and then checks the corresponding files exist.I also removed
XiosField_testas it's no longer needed.Documentation Impact
A developer note has been added in the XIOS doc page.
Pre-Request Checklist