Skip to content

Conversation

@joewallwork
Copy link
Contributor

@joewallwork joewallwork commented Nov 24, 2025

Have XiosRead_test read output of XiosWrite_test

Fixes #990
Merges into #996

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

From the issue:

Currently, the XIOS write test checks that a file with the expected name is created, but doesn't check its contents.

To facilitate this change, XiosWrite_test was set to be a dependency of XiosRead_test in core/test/CMakeLists.txt. As a result, if any subset of the test suite is run that includes both of them is run then the write test will come first.


Change Description

The main code change required to support the revised testing was to set the values for the x- and y- dimensions of each domain. These aren't actually used in the model so I just set them to coincide with the local index values. I also needed to correct the names for the axis dimensions. With these changes, the XiosWrite_test produces output that's accepted by the XiosRead_test.

As part of the PR, I dropped the split frequency functionality from the test with the intention of re-enabling it in a follow-up PR that addresses #898.


Documentation Impact

None


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 Nov 24, 2025
@joewallwork joewallwork added bug Something isn't working enhancement New feature or request ICCS Tasks or reviews for the ICCS team labels Nov 24, 2025
@joewallwork joewallwork linked an issue Nov 24, 2025 that may be closed by this pull request
@joewallwork joewallwork changed the title Have XIOS read test read output of write test Have XIOSRead_test read output of XiosWrite_test Nov 25, 2025
@joewallwork joewallwork changed the title Have XIOSRead_test read output of XiosWrite_test Have XiosRead_test read output of XiosWrite_test Nov 25, 2025
@joewallwork
Copy link
Contributor Author

It turns out that the reason the tests fail is that XIOS appends the names of dimensions associated with domains with the domain name, e.g., x becomes x_HDomain and yvertex becomes yvertex_VertexDomain. The same behaviour doesn't hold for axes. I've contacted the developers to ask if this could be changed, perhaps with a switch. Otherwise, we'd have to either (a) replace all uses of domains with axes, or (b) rename the dimensions as something like x_h, y_h, x_vertex, y_vertex (and x_cg and y_cg would already be okay), which would be inconsistent with the naming scheme up until now.

@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 issue990_xios_write-then-read-take3 branch from c16977a to 690b99a Compare December 1, 2025 12:08
@joewallwork
Copy link
Contributor Author

[Rebased on top of issue850_xios-restructure.]

@joewallwork joewallwork force-pushed the issue990_xios_write-then-read-take3 branch from 3ebf95c to 7613cc1 Compare December 1, 2025 12:33
Copy link
Collaborator

@timspainNERSC timspainNERSC left a comment

Choose a reason for hiding this comment

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

I think the canonical and alternate names in ModelArrayDetails.cpp should be swapped. Everything else looks ready to be merged.

Comment on lines 30 to 33
{ ModelArray::Dimension::X, { "xdim", "x_dim", 0, 0, 0 } },
{ ModelArray::Dimension::Y, { "ydim", "y_dim", 0, 0, 0 } },
{ ModelArray::Dimension::XVERTEX, { "xvertex", "x_vertex", 1, 1, 0 } }, // defined as x + 1
{ ModelArray::Dimension::YVERTEX, { "yvertex", "y_vertex", 1, 1, 0 } }, // defined as y + 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest using x_dim as the primary name, as that is the name that will be used in files written using the legacy code path. It would be good if the XIOS code path could read these files by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I've addressed this in fa86c47. I also changed old_names to be alt_names and updated accordingly in 183435f.

@joewallwork joewallwork force-pushed the issue990_xios_write-then-read-take3 branch from 18f5410 to 97aa780 Compare December 2, 2025 09:42
@joewallwork joewallwork force-pushed the issue990_xios_write-then-read-take3 branch 2 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
@joewallwork
Copy link
Contributor Author

Okay after quite a bit of debugging I figured out the errors in the integration tests.

Base automatically changed from issue850_xios-restructure to develop December 2, 2025 17:50
Copy link
Collaborator

@timspainNERSC timspainNERSC left a comment

Choose a reason for hiding this comment

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

I'm going to approve this, but everywhere you have changed x& y to xdim & ydim should really be changed to x_dim & y_dim, since these are the primary names for these dimensions. That they were not changed is my oversight when I originally changed the names, so thanks for fixing that :).

Comment on lines 43 to 44
static const std::string xName = "xdim";
static const std::string yName = "ydim";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these should be x_dim and y_dim, the primary names. I must not have changed this when making the original move from x,y to xdim, ydim.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

Comment on lines 40 to 41
xDim = ncFile.createDimension("xdim", nx)
yDim = ncFile.createDimension("ydim", ny)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, these should be the primary names and should have been changed when I moved from x, y to xdim, ydim.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the changes here again should be the primary x_dim, y_dim names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the changes here again should be the primary x_dim, y_dim names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the changes here again should be the primary x_dim, y_dim names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the changes here again should be the primary x_dim, y_dim names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the changes here again should be the primary x_dim, y_dim names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the changes here again should be the primary x_dim, y_dim names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the changes here again should be the primary x_dim, y_dim names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Both the changes here again should be the primary x_dim, y_dim names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1a41099.

@joewallwork
Copy link
Contributor Author

I'm going to approve this, but everywhere you have changed x& y to xdim & ydim should really be changed to x_dim & y_dim, since these are the primary names for these dimensions. That they were not changed is my oversight when I originally changed the names, so thanks for fixing that :).

Ah okay no problem, I'll switch them before merging.

@joewallwork joewallwork merged commit fc80a62 into develop Dec 4, 2025
9 checks passed
@joewallwork joewallwork deleted the issue990_xios_write-then-read-take3 branch December 4, 2025 13:02
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

Development

Successfully merging this pull request may close these issues.

Rework XIOS tests to write then read

3 participants