Skip to content

Conversation

@joewallwork
Copy link
Contributor

@joewallwork joewallwork commented Jan 8, 2026

XIOS: Separate out testing of restarts and diagnostics

Fixes #977
Fixes #1003
Refinement of #1002

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

Test Description

This PR separates the XIOS reading and writing tests out by type. In addition, we add a read test for the diagnostic outputs and check that they are time-averaged.


Change Description

Code changes are made to account for the case where only one XIOS domain is used when writing. This is required due to an unfortunate consequence of the way XIOS appends the domain name only if there are two or more domains.

In detail: if only one domain type is used then the output file will use x and y dimensions, rather than the versions appended with _<dimName>. We account for this by assuming that x and y imply x_dim and y_dim if encountered in an input file.


Documentation Impact

n/a


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
  • 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 8, 2026
@joewallwork joewallwork added enhancement New feature or request ICCS Tasks or reviews for the ICCS team labels Jan 8, 2026
@joewallwork joewallwork marked this pull request as ready for review January 9, 2026 09:31
Comment on lines +199 to +213
#ifdef USE_XIOS
// Account for the fact that XIOS writes dimensions differently if only one
// discretisation is written out. If the dimension is still null at this point then we
// assume that the only discretisation used is HDomain-based, i.e., HField, DGField, or
// DGSField.
if (dim.isNull()) {
if (dimensionSpec.name == "x_dim") {
dim = ncFile.getDim("x");
} else if (dimensionSpec.name == "y_dim") {
dim = ncFile.getDim("y");
} else {
continue;
}
}
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is fixed by #1015, which ensures that XIOS never writes out files with x or y as dimensions.

joewallwork added a commit that referenced this pull request Jan 13, 2026
Comment on lines +965 to +971
{ "yx", ModelArray::Type::H },
{ "ydimxdim", ModelArray::Type::H },
{ "y_dimx_dim", ModelArray::Type::H },
{ "yxdg_comp", ModelArray::Type::DG },
{ "ydimxdimdg_comp", ModelArray::Type::DG },
{ "y_dimx_dimdg_comp", ModelArray::Type::DG },
{ "yxdgstress_comp", ModelArray::Type::DGSTRESS },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes will also be reverted in #1015.

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: Case of only one field type Diagnostic files should default to averaging in XIOS

2 participants