Skip to content

Improve umdp3 checks I : Fixing the easy to deal with false failure flags.#228

Draft
R Sharp (r-sharp) wants to merge 36 commits intoMetOffice:mainfrom
r-sharp:Improve_umdp3_checks_I
Draft

Improve umdp3 checks I : Fixing the easy to deal with false failure flags.#228
R Sharp (r-sharp) wants to merge 36 commits intoMetOffice:mainfrom
r-sharp:Improve_umdp3_checks_I

Conversation

@r-sharp
Copy link
Copy Markdown
Contributor

@r-sharp R Sharp (r-sharp) commented Apr 29, 2026

PR Summary

Sci/Tech Reviewer:
Code Reviewer:

The purpose of this change is to reduce the number of files the UMDP3 checker flags as failing incorrectly.
Prior to this change, a fun on the full UM reported 780 failures, this branch reduces that to 311.

With some reasonable unit tests in place, looking at the full output form running the UMDP3 checker on a clone of the UM was showing 780 files failing, out of 2406 checked.
Closer inspection of the detailed output (of which there was a lot) revealed a few common failure themes.

  • Array assignation at declaration (using "= [1, 2, 3, 4]") was triggering failures in the uppercase variable checker, as having split on ',' then "3".upper() == "3". Initially ignoring only nuerical variable names reduced this but "4]" still failed. This has now been fixed
  • There appeared to be a lot of "unseparated keywords", mostly "endif". Closer inspection revealed these to be "#endif". So the tests which were being tripped up by cpp directives now have a call to strip cpp directives from the line (match on r"^#.*")
  • The unit tests, for the checks that were finding false failures, have (hopefully) had an example of the lines causing the issue added.
  • While updating the unit tests it became apparent that re-ordering the assertions gave better information upopn failure. Instead of checking the overview first, and then the detail, check the details first, then the overview is a belt and braces that something that should have been spotted isn't being missed.

The changes here have reduced the failure count to 311.

The next obvious ones appera to be the "deprecated intrinsics" check is spotting a lot of what are actually badly named variables. Particulalry "LONG"

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

  • This change has been tested appropriately (please describe)

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)

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)

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
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Security considerations have been addressed
  • Performance impact is acceptable

R Sharp (r-sharp) and others added 30 commits March 24, 2026 17:36
… changing it so that lines which previously passed now fail, they're going to get a jolly hard stare....
R Sharp (r-sharp) and others added 6 commits April 29, 2026 20:44
Mostly typos and tidying. All changes suggested by reviewers and very sensible they were too.

Co-authored-by: James Bruten <109733895+james-bruten-mo@users.noreply.github.com>
Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>
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.

3 participants