Skip to content

Add code for cloud-top height diagnostic#485

Merged
Pierre Siddall (Pierre-siddall) merged 2 commits into
MetOffice:mainfrom
Adrian-Lock:main905c_cth_diagnostic
May 19, 2026
Merged

Add code for cloud-top height diagnostic#485
Pierre Siddall (Pierre-siddall) merged 2 commits into
MetOffice:mainfrom
Adrian-Lock:main905c_cth_diagnostic

Conversation

@Adrian-Lock
Copy link
Copy Markdown
Contributor

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

Add code for cloud-top height diagnostic, mirroring existing cloud-base height

PR Summary

Sci/Tech Reviewer: Paul Barrett (@paul-barrett) -->
Code Reviewer: Pierre Siddall (@Pierre-siddall)

Only difference in how this new cloud-top height diagnostic is treated compared to cloud-base height, is in setting cloud-free columns to missing data
cld_top_altitude(map_2d(1)) = rmdi
rather than "to beyond top of model" as is done for cloud base:
cld_base_altitude(map_2d(1)) = 1.1_r_def * &
z_asl_centre_of_levels(nlayers) * &
m_to_kfeet

As an example that the new diagnostic works, I've added it to the rose stem seukv job:
CTH_seukv
which can be compared with the cloud-base height diagnostic:
CBH_seukv
These are plotted using ngview which means the colour scale is unhelpful, because it doesn’t recognise missing data, but at least the cloud is in the right place (compared to the CBH) and the max of 32.3 kfeet is plausible.

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 - main905c_cth_diagnostic/run3

Suite Information

Item Value
Suite Name main905c_cth_diagnostic/run3
Suite User adrian.lock
Workflow Start 2026-05-06T17:31:13
Groups Run developer
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_cth_diagnostic 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

✅ succeeded tasks - 1185

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

seems fine, from the perspective of this one DIAG, but should we expand use of rmdi to other DIAGS in this (and other?) routine>

map_w3 )

use science_conversions_mod, only: feet_to_metres
use missing_data_mod, only: rmdi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

surprised to see this is the first instance of rmdi in this set of diags. Should we be extending this to be used in other output in a separate PR?

! cld_top_altitude (in kilofeet)
if (.not. associated(cld_top_altitude, empty_real_data) ) then
! As a default, set cloud-top to missing data
cld_top_altitude(map_2d(1)) = rmdi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should this setting of data to missing be replicated elsewhere in this routine?
iboutle

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.

Yeah, possibly something to revisit in a separate PR - I can't remember what Cyril's reasoning was for doing it how he did originally!

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 Lock (@Adrian-Lock), as this is a small change and the code of the added do loop looks fine , I'm happy to put this through testing.

@Pierre-siddall Pierre Siddall (Pierre-siddall) merged commit 126835a into MetOffice:main May 19, 2026
6 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.

5 participants