Skip to content

Fix writing and reading coupled checkpoints#505

Open
Tim Graham (timgraham-Met) wants to merge 7 commits into
MetOffice:mainfrom
timgraham-Met:fix_cpl_chkpt
Open

Fix writing and reading coupled checkpoints#505
Tim Graham (timgraham-Met) wants to merge 7 commits into
MetOffice:mainfrom
timgraham-Met:fix_cpl_chkpt

Conversation

@timgraham-Met
Copy link
Copy Markdown
Contributor

@timgraham-Met Tim Graham (timgraham-Met) commented May 20, 2026

PR Summary

Sci/Tech Reviewer: Mike Hobson (@mike-hobson)
Code Reviewer: mo-marqh

Checkpointing in the coupled model was broken at apps3.0 when the functionality was implemented to output checkpoints at any time step. This branch fixes that functionality and ensures that in coupled mode checkpoints can only be output at coupling timesteps when it won't affect the results of the model.

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)

This development has been tested in the GC6 climate workflow (it won't run without it). There are plans in place to improve testing of the coupled model including testing restartability but we would like to fix the broken behaviour more quickly.

trac.log

Test Suite Results - lfric_apps - apps_fix_cpl_chkpt/run1

Suite Information

Item Value
Suite Name apps_fix_cpl_chkpt/run1
Suite User tim.graham
Workflow Start 2026-05-20T10:19:36
Groups Run all
Dependency Reference Main Like
casim MetOffice/casim@2026.03.1 True
jules MetOffice/jules@2026.03.1 True
lfric_apps timgraham-Met/lfric_apps@fix_cpl_chkpt False
lfric_core timgraham-Met/lfric_core@fix_cpl_chkpt True
moci MetOffice/moci@2026.03.1 True
SimSys_Scripts MetOffice/SimSys_Scripts@2026.03.1 True
socrates MetOffice/socrates@2026.03.1 True
socrates-spectral MetOffice/socrates-spectral@2026.03.1 True
ukca MetOffice/ukca@2026.03.1 True

Task Information

✅ succeeded tasks - 1511

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

@timgraham-Met Tim Graham (timgraham-Met) removed the request for review from iboutle May 20, 2026 12:39
Dan Copsey (DanCopsey) added a commit to DanCopsey/lfric_apps that referenced this pull request May 20, 2026
…ll request MetOffice#505 goes on trunk. MetOffice#505 adds all the other coupling variables but inland basin flow will be missing from MetOffice#505.
Copy link
Copy Markdown
Contributor

@mike-hobson Mike Hobson (mike-hobson) left a comment

Choose a reason for hiding this comment

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

This change (along with its core companion) fixes the checkpointing within coupled runs, so is important to get on main. It is clear and easy to understand code. There are some bits that we might want to think about improving in the future, but nothing important enough to delay getting this into the next LFRic release.

I am happy to approve this.

@mike-hobson
Copy link
Copy Markdown
Contributor

(Note: Tim Graham (@timgraham-Met) - I did a test merge onto main and ran the test suite and didn't see the failure you mentioned to me, so hopefully it will just go away when the change is brought up to head)

<field id="frozen_soil_moisture" name="frozen_soil_moisture" long_name="mass_fraction_of_frozen_water_in_saturated_soil_moisture" unit="1" domain_ref="face" axis_ref="soil_levels" />
<!-- energy correction -->
<field id="temperature_correction_rate" name="temperature_correction_rate" long_name="temperature_rate_for_energy_correction" unit="K s-1" axis_ref="scalar_axis" />
<field id="lf_icefrc" name="lf_icefrc" long_name="lf_icefrc" unit="1" domain_ref="face" axis_ref="sea_ice_categories" />
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.

Just one comment from me - this list is essentially a mix of things which are coming from coupler to atmosphere, and things going from atmosphere to coupler (the latter being the list of fields we need to checkpoint in gungho_model_mod). I wonder if it would make it easier to understand if the list were ordered as such, ie. group the fields coming in together (with a heading comment), and group the fields going out together (again with a heading comment)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants