Processed diagnostics needed for PS49 - #673
Open
iboutle wants to merge 7 commits into
Open
Conversation
Some of the content of this change has been produced with the assistance
of Anthropic Claude Opus 5 (Claude Code).
Adds two diagnostics:
thlev__pv Ertel potential vorticity on theta surfaces
dyn_trop__theta potential temperature on the PV = +/-2 surface
Both are vertical interpolations of fields the model already holds, so
no new science is introduced: gungho already computes Ertel PV on model
levels (W3) via potential_vorticity_diagnostic_alg, and theta_in_w3 is
already a derived field.
level_interp_mdi_kernel_mod interpolates a field onto surfaces of
constant value of a second field. It differs from the existing
pres_interp_kernel_mod in three ways:
* the bracketing level is the *highest* level at which the coordinate
field is at or below the target, so for a non-monotonic coordinate
such as |PV| the uppermost crossing is selected. This is what makes
dyn_trop__theta a dynamical tropopause rather than a boundary layer
artefact;
* columns which do not span the target are set to missing data rather
than extrapolated;
* cubic interpolation degrades to linear at both ends of the column.
Cubic interpolation is used for the theta surfaces, where the
coordinate is monotonic, and linear for the PV surface, taken against
|PV| = 2.0e-6 m2 s-1 K kg-1.
The kernel takes an array of target levels, which PSyclone cannot pass
(stfc/PSyclone#1312), so the PSy layer is hand written in
psykal_lite_phys_mod alongside invoke_pres_interp_kernel_type.
The theta_levels axis holds a single 320 K surface, following the TIGGE
standard. Both fields are added to the oper_nwp_gl output stream.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Some of the content of this change has been produced with the assistance of Anthropic Claude Opus 5 (Claude Code). Renames the two diagnostics into the processed__ namespace: thlev__pv -> processed__pv_on_theta_levs dyn_trop__theta -> processed__theta_on_pv2 The XIOS output names and the local field names in pv_surface_diags_alg_mod follow suit. The theta_levels axis now carries the 475, 425 and 315 K surfaces rather than a single 320 K surface. The axis values are listed in the order requested; the kernel treats each target level independently, so the ordering affects only the layout of the output. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adds processed__u50m and processed__v50m, the eastward and northward wind components interpolated onto a height surface 50 m above the ground. Both reuse the existing u_in_w3 and v_in_w3 derived fields and the level_interp_mdi kernel, so only the vertical coordinate is new: height_above_surface_kernel_mod subtracts the lowest Wtheta level, this being the orography, from the W3 heights above mean sea level. Interpolation is linear. 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. |
iboutle
marked this pull request as ready for review
July 29, 2026 10:14
iboutle
requested review from
Andrew Coughtrie (andrewcoughtrie)
and removed request for
a team
July 29, 2026 10:14
Andrew Coughtrie (andrewcoughtrie)
approved these changes
Jul 29, 2026
Andrew Coughtrie (andrewcoughtrie)
left a comment
Collaborator
There was a problem hiding this comment.
Code Owner Review
I'm happy with the changes to the files I am listed as code owner of.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Sci/Tech Reviewer: mo-cjsmith
Code Reviewer: Steve Mullerworth (@stevemullerworth)
Diagnostics requested by R2O for downstream users as part of PS49
N.B. The UM diagnostics 212-213 are actually incorrect - they are 50m above the lowest rho level (which typically lies at 10m in the global model). We have implemented them correctly here as 50m above the surface.
Some example output plots:




Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_apps - pv_theta_diags/run1
Suite Information
Task Information
✅ succeeded tasks - 1213
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