Skip to content

Separate model checksum and finalise#441

Open
Steven Sandbach (ss421) wants to merge 4 commits intoMetOffice:mainfrom
ss421:gungho_finalise_model
Open

Separate model checksum and finalise#441
Steven Sandbach (ss421) wants to merge 4 commits intoMetOffice:mainfrom
ss421:gungho_finalise_model

Conversation

@ss421
Copy link
Copy Markdown

@ss421 Steven Sandbach (ss421) commented Apr 20, 2026

PR Summary

Sci/Tech Reviewer: cjohnson-pi
Code Reviewer:

This is a small followup refactor that I suggested in: https://code.metoffice.gov.uk/trac/lfric/ticket/4351 (and copied to: #439). It separates the finalization and checksum of the model. The motivation here is for slightly cleaner interface as the checksum is only needed with running the full model and is not needed in the integration tests and JEDI.

The current solution is the inclusion of an optional that does the checksum if it is present. Here the checksum is explicitly called.

Code Quality Checklist

  • 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
  • All automated checks in the CI pipeline have completed successfully

Testing

  • I have tested this change locally, using the LFRic Apps rose-stem suite
  • 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)

Tested via: cylc vip -z group=developer -S USE_MIRRORS=true -n gungho_finalise_model ./rose-stem and the trac.log is copied below.

trac.log

Test Suite Results - lfric_apps - gungho_finalise_model/run1

Suite Information

Item Value
Suite Name gungho_finalise_model/run1
Suite User steven.sandbach
Workflow Start 2026-04-17T16:23:14
Groups Run developer
Dependency Reference Main Like
casim MetOffice/casim@2026.03.2 True
jules MetOffice/jules@2026.03.2 True
lfric_apps ss421/lfric_apps@gungho_finalise_model False
lfric_core MetOffice/lfric_core@2026.03.2 True
moci MetOffice/moci@2026.03.2 True
SimSys_Scripts MetOffice/SimSys_Scripts@2026.03.2 True
socrates MetOffice/socrates@2026.03.2 True
socrates-spectral MetOffice/socrates-spectral@2026.03.2 True
ukca MetOffice/ukca@2026.03.2 True

Task Information

✅ succeeded tasks - 1164

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 TCD Team

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

@ss421 Steven Sandbach (ss421) requested review from mo-lucy-gordon and removed request for a team April 20, 2026 09:13
@github-actions github-actions bot added the cla-required The CLA has not yet been signed by the author of this PR - added by GA label Apr 20, 2026
@github-actions github-actions bot added cla-signed The CLA has been signed as part of this PR - added by GA and removed cla-required The CLA has not yet been signed by the author of this PR - added by GA labels Apr 20, 2026
@ss421
Copy link
Copy Markdown
Author

To agree to the CLA, please add your details (GitHub username, Real Name, Affiliation, and Date) to the CONTRIBUTORS.md file (create one, if required) in the development branch for this PR. After signing the CLA, you won't need to do this again for future PRs.

Updated via: 3aa8f09

@ss421 Steven Sandbach (ss421) changed the title Add checksum_model routine Separate model checksum and finalise Apr 20, 2026
prognostic_fields => modeldb%fields%get_field_collection( &
"prognostic_fields")
diagnostic_fields => modeldb%fields%get_field_collection( &
"diagnostic_fields")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are diagnostic fields used?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

They do not appear to be used. Removed via: 20c12fc

moisture_fields => modeldb%fields%get_field_collection("moisture_fields")
call moisture_fields%get_field("mr", mr_array)
mr => mr_array%bundle
fd_fields => modeldb%fields%get_field_collection("fd_fields")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are fd_fields used?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

They do not appear to be used. Removed via: 20c12fc

call prognostic_fields%get_field('theta', theta)
call prognostic_fields%get_field('u', u)
call prognostic_fields%get_field('rho', rho)
call prognostic_fields%get_field('exner', exner)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Its curious that exner is listed here, but not actually used in the checksum. Ideally it should be added. But that would mean ALL the kgos would change. Its probably not necessary, given that we've used this code for a long time. Perhaps a comment can be added.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added a comment in: 20c12fc. I could open an issue and reference it via the comment? I dont mind making that change but equally could assign the issue to someone - can you advise?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I discussed with others in dynamics research and we agree that given that we've managed so far without exner in the checksum, its not a priority to add it in. And therefore best to just leave as is. But thanks for adding the comment to highlight that its not actually used in the checksum.

Copy link
Copy Markdown
Contributor

@cjohnson-pi cjohnson-pi left a comment

Choose a reason for hiding this comment

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

As Sci/Tech reviewer, I've had a more thorough look and have added a few comments.

@ss421
Copy link
Copy Markdown
Author

Steven Sandbach (ss421) commented Apr 20, 2026

As Sci/Tech reviewer, I've had a more thorough look and have added a few comments.

Thanks for the review - apologies for adding you as Sci-Tech review before you agreed. I did that because you had reviewed the code and previously discussed the change I made the assumption...

I've updated as suggested and am rerunning the test suite via: cylc vip -z group=developer -S USE_MIRRORS=true -n gungho_finalise_model ./rose-stem - I don't expect any issues though.... The output will be here

@ss421
Copy link
Copy Markdown
Author

I've updated as suggested and am rerunning the test suite via: cylc vip -z group=developer -S USE_MIRRORS=true -n gungho_finalise_model ./rose-stem - I don't expect any issues though.... The output will be here

All test are now running. I did need to make an extra commit: d986f6a because I left whitespace in the previous commit. Also note a number of tasks failed but on re-trigger they were successful. Let me know if there is anything else you would like me to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants