2025.12.1 drivers x3 port#50
Open
Harry Shepherd (harry-shepherd) wants to merge 4 commits into
Open
Conversation
Sam Clarke-Green (t00sa)
left a comment
Collaborator
There was a problem hiding this comment.
See suggestion inline. It's a style question, so it's up to you whether you want to go with it or not
Comment on lines
+69
to
+76
| if xios_version == '3': | ||
| # The appropriate variable is clients_code_id | ||
| line = '<variable id="clients_code_id" type="string" >' \ | ||
| + oasis_components+'</variable>' | ||
| else: | ||
| # For XIOS2/2.5 the appropriate variable is oasis_codes_id | ||
| line = '<variable id="oasis_codes_id" type="string" >' \ | ||
| + oasis_components+'</variable>' |
Collaborator
There was a problem hiding this comment.
If you don't need to pad the IDs to get them to line up and you're happy to go with f-strings, you can simplify things a bit:
Suggested change
| if xios_version == '3': | |
| # The appropriate variable is clients_code_id | |
| line = '<variable id="clients_code_id" type="string" >' \ | |
| + oasis_components+'</variable>' | |
| else: | |
| # For XIOS2/2.5 the appropriate variable is oasis_codes_id | |
| line = '<variable id="oasis_codes_id" type="string" >' \ | |
| + oasis_components+'</variable>' | |
| # Variable name changes at version 3 | |
| vname = "clients_code_id" if xios_version == '3' else "oasis_codes_id" | |
| line = f'<variable id="{vname}" type="string" >{oasis_components}</variable>' |
Sam Clarke-Green (t00sa)
requested changes
Apr 27, 2026
Sam Clarke-Green (t00sa)
left a comment
Collaborator
There was a problem hiding this comment.
Not sure where we are with this - I suspect I might have pressed the comment button rather than the changes one! Can you take a look at the comments in-line and see what you think?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Code Reviewer: Sam Clarke-Green (@t00sa)
There is an aim to move all NGMS workflows to use XIOS3 (version 3 of the XML IO server). As part of the control of the coupled model, the XIOS driver contains lines to ensure that the
iodef.xmlcontrol file is set up correctly to run a coupled model. However a variable name has changed between the XIOS2/XIOS2.5 versions, and the XIOS3 versions.This is further complicated by the fact that the coupled model drivers need to deal with these earlier versions for use with the UM based coupled model used in both climate and operational NWP workflows.
I have modified the XIOS driver, to set the control variable to:
oasis_codes_idfor non-XIOS3 runsclients_code_idfor XIOS3 runs.XIOS3 based runs must specify an environment variable
XIOS_VERSION=3. This defaults to2in the case of not being set.This change has been tested in XIOS2 mode with the
lfric_coupledtest in LFRic apps trunk, and in the same test in the XIOS3 prototype test in the branch of LFRic apps used in tcd-XIOS3-extras/issue/49By merging main in the branch, I could test using the
driversgroup of MOCI rose-stem.Code Quality Checklist
(Some checks are automatically carried out via the CI pipeline)
readability of the code
Testing
acceptable (eg. kgo changes)
tests, unit tests, etc.)
Security Considerations
Performance Impact
performance measurements have been conducted
AI Assistance and Attribution
of Generative AI tool name (e.g., Met Office Github Copilot Enterprise,
Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the
Simulation Systems AI policy
(including attribution labels)
Documentation
confirmed that it builds correctly
Code Review