-
Notifications
You must be signed in to change notification settings - Fork 19
XIOS: Separate out testing of restarts and diagnostics #1010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| #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 |
There was a problem hiding this comment.
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.
| { "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 }, |
There was a problem hiding this comment.
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.
timspainNERSC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As usual with the XIOS tests, I haven't done more than a check that the they look reasonable and logical. Everything else looks good.
Thanks @timspainNERSC. I'm going to wait for the current CI jobs on |
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.
XIOS: Separate out testing of restarts and diagnostics
Fixes #977
Fixes #1003
Refinement of #1002
Task List
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
xandydimensions, rather than the versions appended with_<dimName>. We account for this by assuming thatxandyimplyx_dimandy_dimif encountered in an input file.Documentation Impact
n/a
Pre-Request Checklist