Convection diagnostics needed for PS49 - #676
Conversation
Adds two single level diagnostics giving the ICAO standard atmosphere height, in kft, of the base and the top of the lowest convective cloud in the column: convection__lowest_conv_cloud_base_icao_height convection__lowest_conv_cloud_top_icao_height These are the "lowest cloud" counterparts of the existing convection__conv_cloud_base_icao_height and convection__conv_cloud_top_icao_height diagnostics, and are computed in exactly the same way: icao_heights_kernel is applied to the existing convection__pres_lowest_cv_base and convection__pres_lowest_cv_top pressure diagnostics, which are activated as dependencies when either of the new heights is requested. Those pressures are already set to the missing data indicator in columns with no convective cloud, which icao_heights_kernel passes straight through, so unconverged columns are flagged as missing rather than given a spurious height. Both the Gregory-Rowntree and the CoMorph diagnostics paths are updated, and the new fields are added to the three hourly standard level output stream alongside the existing ICAO heights. Some of the content of this change has been produced with the assistance of Anthropic Claude Opus 5 (Claude Code).
Adds a single level diagnostic, convection__cape_undilute, giving the convective available potential energy of an undilute parcel ascent in J/kg. The quantity is already computed by conv_diag, which in LFRic is called from bl_exp_kernel rather than from the convection scheme, so the diagnostic is plumbed out of the explicit boundary layer kernel following the pattern of the existing zht and oblen diagnostics: a new write-only single level field is added to the kernel metadata and is only filled when the field has been requested. The field is added to the three hourly standard level output stream, and to the coupled atmosphere field definitions alongside the existing diluted CAPE. Some of the content of this change has been produced with the assistance of Anthropic Claude Opus 5 (Claude Code).
|
Your CLA signature was found on the base branch, but you appear to have modified the CONTRIBUTORS.md file in this PR. Please do not edit the CONTRIBUTORS.md file. If you have already signed the CLA, revert changes to the file and your signature will be picked up. |
MichaelWhitall
left a comment
There was a problem hiding this comment.
Hi thanks for this;
I'm slightly nervous that this change has been written by AI and sci/tech reviewed by someone (me) who doesn't really understand the LFRic diagnostic system in-which the changes are made? But I've had a go, hopefully code-owners who are more in-the-know can check this over too?
Cheers!
Mike
| "parcel_buoyancy", "qsat_at_lcl", "bl_type_ind", "visc_m_blend", | ||
| "visc_h_blend", "zh_2d", "zhsc_2d", "ntml_2d", "cumulus_2d", | ||
| "rh_crit", "mix_len_bm", "dsldzm", "wvar", "zht", "oblen", | ||
| "cape_undilute_2d", |
There was a problem hiding this comment.
Can you explain what this is doing? Why are we telling PsyClone to "ignore dependencies" specifically for the undilute cape diagnostic output by conv_diag?
There was a problem hiding this comment.
I'm not sure - I'm hoping Hacka Fett (@christophermaynard) is going to say whether this is correct or not (it is at least consistent with what happens for the other diagnostic fields!)
Don't worry, the AI has very much been supervised to produce exactly what I would have done if hand-coding it! |
MichaelWhitall
left a comment
There was a problem hiding this comment.
I think this all looks OK to me, given the extra info provided in replies to my comments :) Still pending an explanation on the optimisation change in "script_options.py" (just done as the same was done for other diagnostics in the BL explicit kernel), but Chris can cover that in his code-owner review for optimisation...
sci/tech review approved
PR Summary
Sci/Tech Reviewer: MichaelWhitall
Code Reviewer: Ed Hone (@EdHone)
Some plots of the new diagnostics:



closes #643
Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_apps - conv_icao_cape_diags/run1
Suite Information
Task Information
✅ succeeded tasks - 1221
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review