Skip to content

smooth lambda#476

Open
Adrian Lock (Adrian-Lock) wants to merge 10 commits intoMetOffice:mainfrom
Adrian-Lock:main905c_smooth_lambda
Open

smooth lambda#476
Adrian Lock (Adrian-Lock) wants to merge 10 commits intoMetOffice:mainfrom
Adrian-Lock:main905c_smooth_lambda

Conversation

@Adrian-Lock
Copy link
Copy Markdown
Contributor

@Adrian-Lock Adrian Lock (Adrian-Lock) commented May 1, 2026

PR Summary

Sci/Tech Reviewer: P-Burns
Code Reviewer: Pierre Siddall (@Pierre-siddall)

Add a new option for free_atm_mix to calculate a vertically smoother mixing length. Under the existing options, the mixing length is constant within turbulent layers (defined as where the Richardson number is subcritical), except as it approaches the surface where it tends towards the height above the surface. This reduction represents the suppression of the scale of vertical mixing by the physical presence of the boundary. In this new option we apply the same principle to the top and bottom boundaries of every turbulent layer, thereby making smoother transitions in the mixing length between layers of the atmosphere.

closes #159

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)

I have activated the new option in the comorph_dev configuration and so the kgo is broken for those tasks.

trac.log

Test Suite Results - lfric_apps - main905c_smooth_lambda/run7

Suite Information

Item Value
Suite Name main905c_smooth_lambda/run7
Suite User adrian.lock
Workflow Start 2026-05-06T11:50:57
Groups Run all
Dependency Reference Main Like
casim MetOffice/casim@2026.03.2 True
jules MetOffice/jules@2026.03.2 True
lfric_apps Adrian-Lock/lfric_apps@main905c_smooth_lambda False
lfric_core MetOffice/lfric_core@3c8ccc6 True
moci MetOffice/moci@2026.03.2 True
SimSys_Scripts MetOffice/SimSys_Scripts@cab3315 True
socrates MetOffice/socrates@2026.03.2 True
socrates-spectral MetOffice/socrates-spectral@2026.03.2 True
ukca MetOffice/ukca@1cdb9c2 True

Task Information

❌ failed tasks - 6
Task State
check_lfric_atm_nwp_comorph_dev-C12_azspice_gnu_fast-debug-32bit-crun1 failed
check_lfric_atm_nwp_comorph_dev-C12_ex1a_cce_fast-debug-32bit-crun1 failed
check_lfric_atm_scm_comorph_dev_bomex-BiP2x2-50000x50000_azspice_gnu_fast-debug-32bit failed
check_lfric_atm_scm_comorph_dev_bomex-BiP2x2-50000x50000_ex1a_cce_fast-debug-32bit failed
check_lfric_atm_scm_comorph_dev_toga-BiP2x2-50000x50000_azspice_gnu_fast-debug-32bit failed
check_lfric_atm_scm_comorph_dev_toga-BiP2x2-50000x50000_ex1a_cce_fast-debug-32bit failed
✅ succeeded tasks - 1529
⌛ 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

Needs to be added to the Boundary Layer documentation paper but will have to wait until it is ported. I've opened issue #481 to do this separately.

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

!$OMP turb_length, blending_option, rmlmax2) &
!$OMP private( i, k )
!$OMP do SCHEDULE(STATIC)
!$OMP PARALLEL do DEFAULT(none) SCHEDULE(STATIC) &
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 don't think he will automatically get pinged, but it would be worth asking Benjamin Went (@MetBenjaminWent) if he's happy with the openMP changes/additions here

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 Ian, will do!

Comment thread science/physics_schemes/source/boundary_layer/ex_coef.F90
@Pierre-siddall Pierre Siddall (Pierre-siddall) added the optimisation This PR adds optimisations or edits OpenMP code label May 5, 2026
@github-actions github-actions Bot requested a review from P-Burns May 6, 2026 09:43
Comment thread science/physics_schemes/source/boundary_layer/ex_coef.F90
@Adrian-Lock Adrian Lock (Adrian-Lock) added this to the Summer 2026 milestone May 7, 2026
@Adrian-Lock Adrian Lock (Adrian-Lock) added the KGO This PR contains changes to KGO label May 7, 2026
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 optimisation This PR adds optimisations or edits OpenMP code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new option for a smoother calculation of mixing length

6 participants