Skip to content

Improved blending of 1D and 3D turbulence schemes - #752

Merged
James Bruten (james-bruten-mo) merged 40 commits into
MetOffice:mainfrom
Adrian-Lock:vn3.2_blending_opt4
Oct 23, 2026
Merged

James Bruten (james-bruten-mo) merged 40 commits into
MetOffice:mainfrom
Adrian-Lock:vn3.2_blending_opt4

Conversation

@Adrian-Lock

@Adrian-Lock Adrian Lock (Adrian-Lock) commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

PR Summary

Sci/Tech Reviewer: Shusuke Nishimoto (@mo-snishimoto)
Code Reviewer: Ricky Wong (@mo-rickywong)

RMED problem #111 and development ticket #113 document problems found with the scale-aware wind gust diagnostic (stash 3515) that are much improved by these revisions to the method= 'blend_cth_shcu_only' option for how the 1D column and 3D Smagorinsky turbulence schemes are blended as a function of resolution. There is also potential for small benefit from including an additional new option (cap_blended_ml) to cap the blended length scale to be at most the physical length scale from the 1D scheme.

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 - testmain_blending_opt4/run1

Suite Information

Item Value
Suite Name testmain_blending_opt4/run1
Suite User adrian.lock
Workflow Start 2026-09-09T21:53:29
Groups Run developer
Dependency Reference Main Like
casim MetOffice/casim@2026.07.1 True
jules MetOffice/jules@2026.07.1 True
lfric_apps Adrian-Lock/lfric_apps@testmain_blending_opt4 False
lfric_core MetOffice/lfric_core@3e965e8 True
moci MetOffice/moci@2026.07.1 True
SimSys_Scripts MetOffice/SimSys_Scripts@77a5166 True
socrates MetOffice/socrates@2026.07.1 True
socrates-spectral MetOffice/socrates-spectral@2026.07.1 True
ukca MetOffice/ukca@9fc2b6d True

Task Information

❌ failed tasks - 3
Task State
check_lfric_atm_ral_dev-seuk_MG_azspice_gnu_fast-debug-32bit-crun1 failed
check_lfric_atm_ral_dev-seuk_MG_ex1a_cce_fast-debug-32bit-crun1 failed
kgo_groups_checker failed
✅ succeeded tasks - 1220
⌛ waiting tasks - 2
Task State
housekeep_azspice waiting
housekeep_ex1a waiting

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 HPC Optimisation 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

@github-actions github-actions Bot added the cla-modified The CLA has been modified as part of this PR - added by GA label Sep 2, 2026

@iboutle iboutle left a comment

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.

Thanks Adrian,

My main comment is around the new test being introduced. blopt4 is a bit opaque, especially given this magic number doesn't really mean anything in the lfric namelist. But also, I'm reluctant to end up with a plethora of different tests for every individual namelist option. So...

  • how about calling the test raldev, and it can be built on with other things aimed at future RAL releases
  • In the optional config, instead of duplicating everything from the ral3 config, just include the bits which you need that are different from the ral3 config, and then include both when setting up the test.
  • Call the optional config something descriptive like blend_shcu or suchlike.
    • To get the metadata checker not to fail, you may have to include slightly more than you need here, as it needs to be a valid config that can be applied to the base app. That probably just means including the options needed to switch Smagorinsky on, since that is off in the base app.

Thanks!

@Adrian-Lock

Adrian Lock (Adrian-Lock) commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Sorry, that was co-pilot's suggestion to rename the branch, which it claimed would mean github would then automatically update the PR to the new name. Rather than close the PR, which is what it actually did! Presumably it interpreted the rename as a deletion of the vn3.2 branch.
At least it would let me reinstate the old vn3.2 branch and then reopen this PR.
Interestingly I now have a copy of my vn3.2 branch ("main_blending_opt4" that I attempted to rename it to) but that's going to be even more confusing if I upgrade my vn3.2 branch to main, so I'll just delete that one! Sorry about this...

Adrian, Have you been using CoPilot on this change? you haven't marked the summary as using AI assistance and you need to be explicit about what AI assistance you were using. Policy on this is still unclear, I think Yash may be putting an update out. This may have to be on hold until the situation has some clarity.

No CoPilot, or other AI, was used on the code change at all. I tried taking advice from CoPilot on how to merge my vn3.2 branch up to main in a separate branch but keeping the same PR. But that turned out to be bad advice that I reverted and just upgraded my "vn3.2"-named branch to main instead.

Co-authored-by: Ricky Wong <141156427+mo-rickywong@users.noreply.github.com>
Co-authored-by: Ricky Wong <141156427+mo-rickywong@users.noreply.github.com>
Co-authored-by: Ricky Wong <141156427+mo-rickywong@users.noreply.github.com>
Agreed it wasn't clear - I hope this rephrase is ok?
Second attempt to get this comment making sense
Another tweak to the phrasing
@Adrian-Lock

Copy link
Copy Markdown
Contributor Author

Thanks Ricky Wong (@mo-rickywong) for spotting all those. I've had a go at fixing them, mostly taking your suggestions but having a go at my own word-smithing in others. Are those ok now? In case you find it helpful, the full set of changes I've made are here

@mo-rickywong Ricky Wong (mo-rickywong) left a comment

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.

Few other changes spotted

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.

Suggested change
description=Smagorinsky(Smag) subgrid mixing scheme option

Values titles have been abbreviated inconsistently for space I presume. Add the short hand and make titles consistent (the fully word is in the help as it should be)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

values='3d_smag', '2d_smag', 'blend_smag_fa','blend_1dbl_fa'
trigger=namelist:mixing=shallow_cu_maxtop: 'blend_cth_shcu_only' ;
=namelist:mixing=cap_blended_ml: 'blend_smag_fa', 'blend_1dbl_fa', 'blend_cth_shcu_only' ;
value-titles=3D Smagorinsky, 2D Smagorinsky + 1D BL, Blended scheme + Smag above,

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.

Suggested change
value-titles=3D Smagorinsky, 2D Smagorinsky + 1D BL, Blended scheme + Smag above,
value-titles=3D Smag, 2D Smag + 1D BL, Blended scheme + Smag above,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines +3806 to +3807
help=Cap the magnitude of the blended 1D-3D mixing length
=by the 1D mixing length.

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 a comment, the way this reads, to the unfamiliar reader it the D could be read as "Dimensional", consider rewording?

Actually re-reading this, not sure it makes to me, please reword.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've tried a wholesale reworking of this help, which I hope is clearer - thanks for pointing out


[namelist:mixing=cap_blended_ml]
compulsory=true
description=Cap the blended mixing length by the 1D

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.

Suggested change
description=Cap the blended mixing length by the 1D
description=Cap the blended mixing length at 1D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

compulsory=true
description=Max. permitted cloud top height for shallow cloud blending
help=The maximum permitted cloud top height (in metres) for shallow cumulus clouds
=to be diagosed. This is used in the blending weight length-scale calculation

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.

Suggested change
=to be diagosed. This is used in the blending weight length-scale calculation
=to be diagnosed. This is used in the blending weight length-scale calculation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Doh! Done

More improvements to the meta data and help panels
@github-actions github-actions Bot added the cla-modified The CLA has been modified as part of this PR - added by GA label Sep 30, 2026
@Adrian-Lock

Copy link
Copy Markdown
Contributor Author

Thanks again, Ricky Wong (@mo-rickywong), for spotting those. Hopefully all covered in this latest commit

@Adrian-Lock

Copy link
Copy Markdown
Contributor Author

Hi Ricky Wong (@mo-rickywong), I just spotted this PR is down as "with the developer to make changes". I'd attempted to respond to your comments 2 weeks ago but have no idea how to revert the PR to "in code review", if that's even something I'm meant to do. Apologies for not understanding the process well enough but it would be good to get this PR through your review, even if we are thinking of waiting until after #742 for the commit. Thanks

@james-bruten-mo

Copy link
Copy Markdown
Collaborator

Hi Ricky Wong (Ricky Wong (@mo-rickywong)), I just spotted this PR is down as "with the developer to make changes". I'd attempted to respond to your comments 2 weeks ago but have no idea how to revert the PR to "in code review", if that's even something I'm meant to do. Apologies for not understanding the process well enough but it would be good to get this PR through your review, even if we are thinking of waiting until after #742 for the commit. Thanks

Hi Adrian,

When you're ready for another review, please click the little "circle" icon next to their name in the top right. That'll then set the state back to Review and notify the reviewer

@mo-rickywong

Copy link
Copy Markdown
Contributor

There is still requested changes over looked, minor case settings. These were in the previous passes, I've not added new requests. There isn't anything fundamentally wrong as far as I can see with the rest of it, though was waiting to getting to running green on trunk before approving and putting on the queue for commit.

@mo-rickywong Ricky Wong (mo-rickywong) left a comment

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.

Not sure if git is submitting these or not

@Adrian-Lock

Copy link
Copy Markdown
Contributor Author

There is still requested changes over looked, minor case settings. These were in the previous passes, I've not added new requests. There isn't anything fundamentally wrong as far as I can see with the rest of it, though was waiting to getting to running green on trunk before approving and putting on the queue for commit.

I've added a comment against that particular request now, hoping my changed phrasing is good enough? Happy to iterate, though

@Adrian-Lock

Copy link
Copy Markdown
Contributor Author

Thanks for chasing Ricky Wong (@mo-rickywong) and I hope I have now covered all your concerns. I'm not sure of the protocol but I'm assuming I leave it to you to formally "resolve" the comments?

@mo-rickywong

Copy link
Copy Markdown
Contributor

Looks to have updated, the new kgo file is failing at head of trunk so it will need a KGO update on commit.

Approved

@mo-rickywong Ricky Wong (mo-rickywong) left a comment

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.

Looks okay now

@github-actions github-actions Bot removed the cla-modified The CLA has been modified as part of this PR - added by GA label Oct 23, 2026
@james-bruten-mo
James Bruten (james-bruten-mo) merged commit cb385a8 into MetOffice:main Oct 23, 2026
5 checks passed
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.

7 participants