Skip to content

Stable diags #11, #21, #24#483

Open
Byron Blay (bblay-mo) wants to merge 14 commits into
MetOffice:mainfrom
bblay-mo:stable_diags_11_21_24
Open

Stable diags #11, #21, #24#483
Byron Blay (bblay-mo) wants to merge 14 commits into
MetOffice:mainfrom
bblay-mo:stable_diags_11_21_24

Conversation

@bblay-mo
Copy link
Copy Markdown

@bblay-mo Byron Blay (bblay-mo) commented May 6, 2026

PR Summary

Three Section 20 aviation diagnostics created from plev_geopot.

Output from suite u-dy804:

geopotential thickness

0 0

snow probability

(That ticket contains a incorrect link to the um code, which should be pws_snow_prob_diag.F90.)
0

icao cloud heights

Note: we have not found a UM Section 20 example of these two fields for comparison.
0
0

Sci/Tech Reviewer:
Code Reviewer: Alistair Pirrie (@mo-alistairp)

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

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

@github-actions github-actions Bot added the cla-signed The CLA has been signed as part of this PR - added by GA label May 6, 2026
real(r_def), parameter :: isa_press_bot = 101325.0_r_def

! Pressure (Pa) at 11,000 gpm.
real(r_def), parameter :: isa_press_mid = 22632.0_r_def
Copy link
Copy Markdown
Author

@bblay-mo Byron Blay (bblay-mo) May 14, 2026

Choose a reason for hiding this comment

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

Claude says isa_press_mid should be 22632.1 and isa_press_top should be 5474.89. Should we do anything?

! Subtract geopotential heights at 850 and 500 hPa from that at 1000 hPa.
!
! Snow probability:
! Implement Boyden (1964), using 850 and 1000 hPa.
Copy link
Copy Markdown
Author

@bblay-mo Byron Blay (bblay-mo) May 14, 2026

Choose a reason for hiding this comment

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

Claude doesn't ... "think" the code further down matches the Boyden equation.


call conv_cloud_base_icao_height%write_field()

! Is it necessary/safe to remove this field now?
Copy link
Copy Markdown
Author

@bblay-mo Byron Blay (bblay-mo) May 14, 2026

Choose a reason for hiding this comment

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

Need steering on this question please.



! Process every DOF in this cell.
do df = 1, result_ndf
Copy link
Copy Markdown
Author

@bblay-mo Byron Blay (bblay-mo) May 14, 2026

Choose a reason for hiding this comment

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

Might be worth having a chat/steer about if/when we can skip this loop, as does the other kernel in this PR.

! Lapse rate (degreeC/km) for levels below 11,000 gpm.
real(r_def), parameter :: isa_lapse_ratel = 6.5e-03_r_def

! Lapse rate (degreeC/km) for levels above 20,000 gpm.
Copy link
Copy Markdown
Author

@bblay-mo Byron Blay (bblay-mo) May 14, 2026

Choose a reason for hiding this comment

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

This comment, as copied from the UM, said 11,000. Claude spotted the error. Worth mentioning just in case.

if(snow_probability_flag .and. i850 /= -1) then
gph_850 = plev_geopot(source_map(df) + i850-1)
snow_probability(result_map(df)) = &
5220.0_r_def + 3.86666_r_def*gph_1000 - 4.0_r_def*gph_850
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The earliest I've been able to track these magic numbers so far is here.

<field field_ref="forcing__dt_force" />
</file>

<file id="lfric_aviation" name="lfric_aviation" output_freq="6h" convention="UGRID" enabled=".TRUE.">
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Couldn't find documentation for the <file> and <field_group> tags.

</field_group>

<!-- Section 20 Aviation diagnostics -->
<field_group operation="instant" freq_op="6h">
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

KGO? I got the impression there isn't any yet?

@bblay-mo Byron Blay (bblay-mo) marked this pull request as ready for review May 20, 2026 09:22
@bblay-mo Byron Blay (bblay-mo) requested a review from a team as a code owner May 20, 2026 09:22
@bblay-mo Byron Blay (bblay-mo) requested review from Ricky Wong (mo-rickywong) and removed request for a team May 20, 2026 09:22
plev_geopot_clim_flag = diag_samp('plev__geopot_clim')
plev_geopot_flag = init_diag(plev_geopot, 'plev__geopot', activate=plev_geopot_clim_flag)
if ((plev_geopot_flag .or. plev_geopot_clim_flag) .and. use_xios_io) then
plev_geopot_flag = init_diag(plev_geopot, 'plev__geopot', &
Copy link
Copy Markdown
Author

@bblay-mo Byron Blay (bblay-mo) May 20, 2026

Choose a reason for hiding this comment

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

Just an observation: From a software engineering perspective, this module (and others) should probably not know anything about the aviation module. I think it's a pattern which can lead to a rat's nest of dependencies. One solution might be to express field dependencies in a centralised place, which init_diag could check for itself, without needing the activate arg. Is that worth raising in a ticket somewhere?

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants