Skip to content

Conversation

@joewallwork
Copy link
Contributor

Merges into #1010.

Currently in #1010 we have the following issue with writing fields with XIOS:

  • If there are multiple fields that are (between them) based on two or more XIOS domains then the dimension names get appended with those domain names. By naming the domains dim, vertex, and cg, this gives rise to dimensions x_dim, y_dim, x_vertex, y_vertex, x_cg, and y_cg.
  • If the fields being written out are only based on one XIOS domain then the appendment doesn't happen, meaning we just have x and y.

The workaround in that PR handles dimensions x or y in a file being read by assuming they correspond to x_dim and y_dim. Ideally, we would avoid having x or y alone in any files and instead make a post-processing of the output file after it is written with XIOS.

That's achieved in this PR via a post-processing step. Upon finalising the XIOS context, we:

  1. Count how many different XIOS domains were used for writing out. If there was exactly one then we proceed to tackle the issue.
  2. Loop overall output files that might have been written by XIOS and check they exist.
  3. For any such files that exist, rename the dimensions and variables as appropriate and write out.

To achieve this, I had to implement subtraction of a Duration from a TimePoint because of how XIOS presents the time window suffices.

@joewallwork joewallwork self-assigned this Jan 13, 2026
@joewallwork joewallwork added the enhancement New feature or request label Jan 13, 2026
@joewallwork joewallwork added the ICCS Tasks or reviews for the ICCS team label Jan 13, 2026
@joewallwork joewallwork moved this from Todo to In Progress in neXtSIM_DG overview Jan 13, 2026
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With XIOS, if dimensions are unused then they aren't written out into the file. As such, if only HFields get written out (as in XiosWriteDiagnostic_test) then only x_dim and y_dim will be in the file, even if x_vertex etc. have been defined. As such, I converted an error to a warning here to allow for only a subset of the dimensions being defined in an input file. If no dimensions at all are found then an error gets thrown.

@joewallwork joewallwork moved this from In Progress to Review required in neXtSIM_DG overview Jan 13, 2026
@joewallwork joewallwork marked this pull request as ready for review January 13, 2026 15:52
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

Status: Review required

Development

Successfully merging this pull request may close these issues.

3 participants