Skip to content

Conversation

@EdHone
Copy link
Contributor

@EdHone EdHone commented Jan 14, 2026

PR Summary

Sci/Tech Reviewer: @mo-marqh
Code Reviewer: @mo-lottieturner

This PR fixes a few issues in our code that are fine with XIOS2 but fail with XIOS3, namely:

  • incorrect formatting of the buffer_size_factor config parameter
  • fields in read mode files which do not have read_access=.true.

This PR fixes them and the fixes are backwards compatible with XIOS 2.
With the additional changes from #204, the lfric-xios technical tests are able to be run with both XIOS2 and XIOS3.

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • I have performed a self-review of my own code
  • My code follows the project's
    style guidelines
  • Comments have been included that aid understanding and enhance the
    readability of the code
  • My changes generate no new warnings

Testing

  • I have tested this change locally, using the LFRic Core rose-stem suite
  • If required (e.g. API changes) I have also run the LFRic Apps test suite
    using this branch
  • If any tests fail (rose-stem or CI) the reason is understood and
    acceptable (e.g. kgo changes)
  • I have added tests to cover new functionality as appropriate (e.g. system
    tests, unit tests, etc.)
  • Any new tests have been assigned an appropriate amount of compute resource
    and have been allocated to an appropriate testing group (i.e. the
    developer tests are for jobs which use a small amount of compute resource
    and complete in a matter of minutes)

trac.log

Test Suite Results - lfric_core - lfric_core-215-xios3-fixes/run2

Suite Information

Item Value
Suite Name lfric_core-215-xios3-fixes/run2
Suite User edward.hone
Workflow Start 2026-01-20T11:49:52
Groups Run developer
Dependency Reference Main Like
lfric_core EdHone/lfric_core@215-xios3-fixes False
SimSys_Scripts MetOffice/[email protected] True

Task Information

✅ succeeded tasks - 372

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable
    performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance
    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

  • Where appropriate I have updated documentation related to this change and
    confirmed that it builds correctly

PSyclone Approval

  • If you have edited any PSyclone-related code (e.g. PSyKAl-lite, Kernel
    interface, optimisation scripts, LFRic data structure code) then please
    contact the
    [email protected]

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

Please alert the code reviewer via a tag when you have approved the SR

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

@github-actions github-actions bot added the cla-signed The CLA has been signed as part of this PR - added by GA label Jan 14, 2026
@mo-marqh mo-marqh self-requested a review January 14, 2026 16:37
@mo-marqh mo-marqh self-assigned this Jan 14, 2026
Copy link
Member

@mo-marqh mo-marqh left a comment

Choose a reason for hiding this comment

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

i have sci-tech reviewed these changes.
the buffer_size¬factor is a trivial mistake fix that was ignored in XIOS2 but fails in XIOS3. So, this was always wrong. Now updated to correct for both versions.

The setting of read_access to true is essential for XIOS3 and neutral for XIOS2, the implementation is clean, with the extension of a simple xios_set_attr call to include the logical from the lfric-xios object.

@mo-marqh
Copy link
Member

@mo-lottieturner this change passes sci/tech and is now ready for code review. (it's a stand-alone lfric_core change)

Copy link
Member

@mo-marqh mo-marqh left a comment

Choose a reason for hiding this comment

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

hi @EdHone

it would be helpful if the setting of read_access was also enabled for lfric_xios created checkpoint definitions when actually restarting

e.g.

--- a/components/lfric-xios/source/lfric_xios_metafile_mod.F90
+++ b/components/lfric-xios/source/lfric_xios_metafile_mod.F90
@@ -269,6 +269,11 @@ subroutine add_field(metafile, dict_field_id, mode, operation, id_as_name, legac
           end if
         end if
       end if
+      if (mode == RESTARTING) then
+        ! Is restarting, then set read_access to True.
+        call xios_set_field_attr(field_id, read_access=.true.)
+      end if
+

@mo-marqh
Copy link
Member

reverting back to sci/tech review based on recent reanalysis

@EdHone
Copy link
Contributor Author

EdHone commented Jan 20, 2026

Branch update with the change to enable read_access for checkpointing - tested successfully against apps and core test suite successful and in PR description above.

Passing back to you @mo-marqh and then on to @mo-lottieturner

Copy link
Member

@mo-marqh mo-marqh left a comment

Choose a reason for hiding this comment

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

Excellent, thank you @EdHone

this passes Sci/Tech review and passes on to code review @mo-lottieturner

@mo-marqh
Copy link
Member

Note for code review:

Legal CLA Action is failing, but @EdHone is listed in https://github.com/MetOffice/lfric_core/blob/main/CONTRIBUTORS.md so perhaps a rebase to upstream/main would fix this

@github-actions github-actions bot added cla-modified The CLA has been modified as part of this PR - added by GA and removed cla-signed The CLA has been signed as part of this PR - added by GA labels Jan 26, 2026
@EdHone EdHone marked this pull request as draft January 26, 2026 10:52
@EdHone EdHone marked this pull request as ready for review January 26, 2026 10:55
@EdHone
Copy link
Contributor Author

EdHone commented Jan 26, 2026

Note for code review:

Legal CLA Action is failing, but @EdHone is listed in https://github.com/MetOffice/lfric_core/blob/main/CONTRIBUTORS.md so perhaps a rebase to upstream/main would fix this

Sorted now I believe - ready for CR @mo-lottieturner

@mo-lottieturner mo-lottieturner removed their assignment Jan 28, 2026
@mo-lottieturner mo-lottieturner merged commit c4c2ba9 into MetOffice:main Jan 28, 2026
6 checks passed
@jennyhickson jennyhickson added this to the Spring 2026 milestone Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-modified The CLA has been modified as part of this PR - added by GA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants