Skip to content

Drop XiosOutput section#1063

Open
joewallwork wants to merge 24 commits intoissue1056_xios-read-all-inputsfrom
issue1056_drop-xios-output-section
Open

Drop XiosOutput section#1063
joewallwork wants to merge 24 commits intoissue1056_xios-read-all-inputsfrom
issue1056_drop-xios-output-section

Conversation

@joewallwork
Copy link
Copy Markdown
Contributor

@joewallwork joewallwork commented Mar 13, 2026

Drop XiosOutput section

Fixes #1056
Merges into #1057

Task List

  • Linked an issue above that captures the requirements of this PR
  • Defined the tests that specify a complete and functioning change
  • Implemented the source code change that satisfies the tests
  • Commented all code so that it can be understood without additional context
  • No new warnings are generated or they are mentioned below
  • The documentation has been updated (or an issue has been created to do so)
  • Relevant labels (e.g., enhancement, bug) have been applied to this PR
  • This change conforms to the conventions described in the README

Change Description

This PR allows us to drop the temporary XiosOutput config section. In order to achieve this, I needed to ensure that each module that defines a getStatePrognostic member function also sets XIOS field types appropriately.


Test Description

I noticed that some fields were slipping through the cracks in the XIOS tests so I made them more robust. That is, I added checks that the expected fields are all found in any input files.

I also dropped damage from the test input file to check that it gets set up automatically during model configuration, as expected.


Documentation Impact

The XIOS docs page has been updated accordingly.

@joewallwork joewallwork self-assigned this Mar 13, 2026
@joewallwork joewallwork added enhancement New feature or request ICCS Tasks or reviews for the ICCS team labels Mar 13, 2026
Comment thread core/src/modules/include/IDynamics.hpp Outdated
Comment on lines +63 to +65
// FIXME: We need to write out u and v to get a perfect restart
// xiosHandler.setPrognosticFieldType(uName, ModelArray::Type::H);
// xiosHandler.setPrognosticFieldType(vName, ModelArray::Type::H);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note to self to complete this before marking the PR as ready for review.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The issue I was having here has to do with the u and v fields being expected to be type Model::Array::U and Model::Array::V, which I hadn't accounted for. Working on a fix.

@timspainNERSC: It seems to me that these types are duplicates of Model::Array::H. Is that the case or are there distinguishing factors?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the current set up, these are indeed duplicates of HField. The design exists to be able to extend nextSIM-DG with other dynamics cores (such as the Lagrangian) where the u and/or v arrays might have different dimensions from the h arrays.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay good to know, thanks. I think it would be best to do this separately from this PR. I opened issue #1066 for tackling this and added a reference in the code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed by #1068.

Comment thread core/src/modules/include/IStructure.hpp Outdated
Comment thread core/src/Xios.cpp Outdated
@joewallwork joewallwork linked an issue Mar 13, 2026 that may be closed by this pull request
Comment on lines +32 to +39
const bool spherical = true; // TODO: Determine this
if (spherical) {
xiosHandler.setPrognosticFieldType(latitudeName, ModelArray::Type::H);
xiosHandler.setPrognosticFieldType(longitudeName, ModelArray::Type::H);
} else {
xiosHandler.setPrognosticFieldType(xName, ModelArray::Type::H);
xiosHandler.setPrognosticFieldType(yName, ModelArray::Type::H);
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Question for reviewer: I see that there's an enum for this in ParametricMesh but not in ParametricGrid. It feels like it would make sense to align this - would that be agreeable? The difficulty I'm having is that I want to determine the coordinate system upon constructing ParametricGrid, when there likely isn't a ModelState I can query.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The sphericity versus planarity of the coordinate system is currently determined by the restart file. A solution would be to peek inside the restart file to check if there is a longitude field (=> spherical coordinates) and if there is not, an x field, the lack of which would be an error. The ModelMetadata class does something similar to get the dimensions around ModelMetadata.cpp:200.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. Done in 1f33b5e.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also throw the recommended error in 88a9d74.

@joewallwork joewallwork marked this pull request as ready for review March 19, 2026 11:08
Comment on lines +69 to +70
bool configuredRestarts = false; // Guard to avoid repeated configuration
bool configuredTime = false; // Guard to avoid repeated configuration
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is XIOS configuration not idempotent? The rest of the model can be configured multiple times without ill effect.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately not. Parts of it could be made so if we wanted that but the context is problematic because it cannot be overwritten.

Copy link
Copy Markdown
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.

This all seems in order.

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.

Avoid XiosInput and XiosOutput config sections

2 participants