Skip to content

Casim hail diagnostic - #27

Merged
James Bruten (james-bruten-mo) merged 9 commits into
MetOffice:mainfrom
paulfield2024:casim_hail_diagnostic
Oct 30, 2026
Merged

James Bruten (james-bruten-mo) merged 9 commits into
MetOffice:mainfrom
paulfield2024:casim_hail_diagnostic

Conversation

@paulfield2024

@paulfield2024 paulfield2024 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

PR Summary

** Fix a bug in the hail diagnostic **

Sci/Tech Reviewer: Paul Barrett (@paul-barrett)
Code Reviewer: James Bruten (@james-bruten-mo)

Added 2 limiters to the hail diagnostic. One to set the change of particle size to 0 if the size goes negative. The second is in the melting equation which just limits the delta temperature to positive values in the profile. This fixed the failure from PS48 that i was given.

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • 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

Testing

  • If shared files have been modified, I have run the UM and LFRic Apps rose
    stem suites
  • If any tests fail (rose-stem or CI) the reason is understood and
    acceptable (eg. kgo changes)
  • I have added tests to cover new functionality as appropriate (eg. system
    tests, unit tests, etc.)

trac.log

Test Suite Results - um - casim_hail_diagnostic/run4

Suite Information

Item Value
Suite Name casim_hail_diagnostic/run4
Suite User paul.field
Workflow Start 2026-10-29T18:01:32
Groups Run developer,casim
Dependency Reference Main Like
casim paulfield2024/casim@casim_hail_diagnostic True
jules MetOffice/jules@main True
moci MetOffice/moci@main True
mule MetOffice/mule@main True
shumlib MetOffice/shumlib@main True
socrates MetOffice/socrates@main True
SimSys_Scripts MetOffice/SimSys_Scripts@main True
ukca MetOffice/ukca@main True
um paulfield2024/um@d7019a7 True
um_aux MetOffice/um_aux@main True
um_meta MetOffice/um_meta@main True

Approvals

Code Owners

  • No UM Code Owners Required

Config Owners

No UM Config Owners Required

Task Information

✅ succeeded tasks - 979

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

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

@paulfield2024 paulfield2024 added this to the Autumn 2026 milestone Oct 28, 2026
@github-actions github-actions Bot added the cla-modified The CLA has been modified as part of this PR - added by GA label Oct 28, 2026
@github-actions github-actions Bot removed the cla-modified The CLA has been modified as part of this PR - added by GA label Oct 29, 2026
@paulfield2024

Copy link
Copy Markdown
Contributor Author

added trac.log now - all passed

@paulfield2024

Copy link
Copy Markdown
Contributor Author

Hello James - thanks for picking this up.
I think i was able to make the casim branch and do the rose-stem off the latest main for um and casim from about an hour ago. Let me know if anything wrong!

Comment thread src/hail_diag_fast_mod.F90 Outdated
da=(Kw0*t*dz/Lf/rhoi/v)/ &
((a0-a)*a/a0+(Kw0/(C*(Ka+Lv*Dv*beta)))*a**2/a0)

IF ( Re .gt. 0.0 ) THEN

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

not sure why Re could be negative - is this just sign convention for particles terminal velocity vs updraughts? Every other parameter must be postive?

Comment thread src/hail_diag_fast_mod.F90 Outdated
da=(Kw0*t*dz/Lf/rhoi/v)/ &
((a0-a)*a/a0+(Kw0/(C*(Ka+Lv*Dv*beta)))*a**2/a0)

IF ( Re .gt. 0.0 ) THEN

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why would Reynolds number be negative - is this just fixing some numerical errors, or is it when "fall"speed is upwards?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

could just have an a .gt. 0. check before calling the mason_melt routine?

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.

yep - done that now in the elf4299 change. Moved the if out of mason_melting and into the loop that calls mason_melting.

The ensemble test still passes.

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.

updated the rose-stem trac.log with new branch. All passes still.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

great, looks good to me

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

looks good to me, ready for CR James Bruten (@james-bruten-mo)

v=a_v*(2.0*a*100.0)**b_v * sqrt(rho0/rhoa(k)) !diam in cm
da=mason_melt(a,a0,dz_in(k),t(k)-T0,v,rhoi,rhoa(k))
a=a-da
if ( a .gt. 0.0 ) then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maintains style of the hail check (a .gt. 0.0), happy with that

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.

The changes look sensible to me. I'll rerun the testing suites then get it on

@james-bruten-mo
James Bruten (james-bruten-mo) merged commit deab1a0 into MetOffice:main Oct 30, 2026
17 of 22 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.

3 participants