Skip to content

PC2 response to horizontal mixing#464

Open
iboutle wants to merge 6 commits intoMetOffice:mainfrom
iboutle:pc2_smag
Open

PC2 response to horizontal mixing#464
iboutle wants to merge 6 commits intoMetOffice:mainfrom
iboutle:pc2_smag

Conversation

@iboutle
Copy link
Copy Markdown
Contributor

@iboutle iboutle commented Apr 29, 2026

PR Summary

Sci/Tech Reviewer: MichaelWhitall
Code Reviewer: Oakley Brunt (@oakleybrunt)

Closes #242

When using the PC2 cloud-scheme in model-configurations which include horizontal turbulent mixing (aka 3D Smagorinsky or blended boundary-layer), currently the horizontal mixing calculation does not update the PC2 cloud-fraction prognostic consistent with cloud water content. This will be allowing the cloud water and fraction prognostics to become inconsistent with eachother, which can cause numerical problems elsewhere (e.g. increasing cloud water without increasing fraction can lead to silly large in-cloud water contents, which rain-out spuriously).

For vertical turbulent mixing (aka the boundary-layer scheme), PC2 already updates the cloud water content and fraction consistently by assuming the mixing increment acts as a homogeneous forcing. For now we will just implement the same approach for the horizontal mixing, for consistency.

I have switched on Smagorinsky + the new option in the comorph_tb test to protect the new code, hence this has changed KGOs. The KGO change to other jobs on the ex1a arises because we have split up a single line of code that multiplied the Smagorinsky increment by dt and added it back to the main increment into 2 lines - the multiplication by dt needs to happen before the PC2 code is called, and adding the increment back needs to happen after this.

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)

trac.log

Test Suite Results - lfric_apps - pc2_smag/run1

Suite Information

Item Value
Suite Name pc2_smag/run1
Suite User ian.boutle
Workflow Start 2026-04-30T11:51:37
Groups Run developer', 'lfric_atm_extra
Dependency Reference Main Like
casim MetOffice/casim@2026.03.2 True
jules MetOffice/jules@2026.03.2 True
lfric_apps iboutle/lfric_apps@pc2_smag 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 - 1310

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

@iboutle iboutle added this to the Summer 2026 milestone Apr 29, 2026
@iboutle iboutle self-assigned this Apr 29, 2026
@iboutle iboutle added KGO This PR contains changes to KGO macro This PR contains a metadata upgrade macro labels Apr 29, 2026
@iboutle iboutle marked this pull request as ready for review April 30, 2026 12:52
@github-actions github-actions Bot requested a review from MichaelWhitall April 30, 2026 12:53
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Macro all fine

Copy link
Copy Markdown
Contributor

@DanStoneMO DanStoneMO left a comment

Choose a reason for hiding this comment

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

Can confirm JEDI works fine with this, no linked PR is needed for lfric-jedi

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

Labels

KGO This PR contains changes to KGO macro This PR contains a metadata upgrade macro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PC2 homogeneous forcing by turbulent horizontal diffusion

4 participants