Skip to content

Processed diagnostics needed for PS49 - #673

Open
iboutle wants to merge 7 commits into
MetOffice:mainfrom
iboutle:pv_theta_diags
Open

Processed diagnostics needed for PS49#673
iboutle wants to merge 7 commits into
MetOffice:mainfrom
iboutle:pv_theta_diags

Conversation

@iboutle

@iboutle iboutle commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Sci/Tech Reviewer: mo-cjsmith
Code Reviewer: Steve Mullerworth (@stevemullerworth)

Diagnostics requested by R2O for downstream users as part of PS49

UM stashcode LFRic id
15212 processed__u50m
15213 processed__v50m
15214 processed__pv_on_theta_levs
15215 processed__theta_on_pv2

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:
Screenshot from 2026-07-29 10-42-20
Screenshot from 2026-07-29 10-40-23
Screenshot from 2026-07-29 10-38-20
Screenshot from 2026-07-29 10-37-49

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 - pv_theta_diags/run1

Suite Information

Item Value
Suite Name pv_theta_diags/run1
Suite User ian.boutle
Workflow Start 2026-07-28T13:09:49
Groups Run developer', 'lfric_atm_nwp_gal9_oper-C224_MG_ex1a_cce_production-32bit
Dependency Reference Main Like
casim MetOffice/casim@2026.07.1 True
jules MetOffice/jules@2026.07.1 True
lfric_apps iboutle/lfric_apps@pv_theta_diags False
lfric_core MetOffice/lfric_core@2026.07.1 True
moci MetOffice/moci@2026.07.1 True
SimSys_Scripts MetOffice/SimSys_Scripts@2026.07.1 True
socrates MetOffice/socrates@2026.07.1 True
socrates-spectral MetOffice/socrates-spectral@2026.07.1 True
ukca MetOffice/ukca@2026.07.1 True

Task Information

✅ succeeded tasks - 1213

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

Ubuntu and others added 6 commits July 27, 2026 12:54
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).
@github-actions github-actions Bot added the cla-modified The CLA has been modified as part of this PR - added by GA label Jul 28, 2026
@iboutle iboutle added this to the Autumn 2026 milestone Jul 28, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Hello iboutle!

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
iboutle marked this pull request as ready for review July 29, 2026 10:14
@iboutle
iboutle requested review from a team and Alex Brown (atb1995) as code owners July 29, 2026 10:14
@iboutle
iboutle requested review from Andrew Coughtrie (andrewcoughtrie) and removed request for a team July 29, 2026 10:14
@github-actions
github-actions Bot requested a review from mo-cjsmith July 29, 2026 10:14

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.

Code Owner Review

I'm happy with the changes to the files I am listed as code owner of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-modified The CLA has been modified as part of this PR - added by GA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants