Skip to content

Remove check for optional diagnostic data array - #49

Merged
James Bruten (james-bruten-mo) merged 7 commits into
MetOffice:mainfrom
mcdalvi:rem_diag_array_check
Oct 22, 2026
Merged

James Bruten (james-bruten-mo) merged 7 commits into
MetOffice:mainfrom
mcdalvi:rem_diag_array_check

Conversation

@mcdalvi

@mcdalvi Mohit Dalvi (mcdalvi) commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Summary

Sci/Tech Reviewer: Alan J Hewitt (@alanjhewitt)
Code Reviewer: James Bruten (@james-bruten-mo)

UKCA Diagnostics calculated via API are accessed by the parent model by passing in optional data arrays (diag_data_fullht_real, diag_data_flat_real) to ukca_step. Depending on the model/ type of requests there may be no diagnostics to be obtained at all, or on some timesteps. This information is passed to API via an earlier call to ukca_update_diagnostic_requests.
However, in SET_DIAG_PTRS_1D/3D_DOMAIN, there is an additional check that raises an error when the data arrays above are passed in but no diagnostics required in that call (which is a perfectly valid situation).

The error is encountered while requesting sample diagnostics from LFRic. It looks like the UM test/ real configurations had at least one diagnostic of each flat/fullht type requested on every timestep and hence did not encounter the issue so far.

This PR will remove the checks, and set up the pointers to internal diag arrays only when diagnostics are actually needed.

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • 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

Testing

  • I have tested this change locally, using the UKCA rose-stem suite
  • If shared files have been modified, I have run the UM and LFRic Apps rose stem suites
  • If any tests fail (rose-stem or CI) the reason is understood and acceptable (eg. kgo changes)
  • I have added tests to cover new functionality as appropriate (eg. system tests, unit tests, etc.)

trac.log

Test Suite Results - um - vn14.2_update_ukca_rev/run2

Suite Information

Item Value
Suite Name vn14.2_update_ukca_rev/run2
Suite User mohit.dalvi
Workflow Start 2026-09-23T22:32:09
Groups Run developer', 'ukca
Dependency Reference Main Like
casim MetOffice/casim@2026.07.1 True
jules MetOffice/jules@2026.07.1 True
moci MetOffice/moci@2026.07.1 True
mule MetOffice/mule@2026.07.1 True
shumlib MetOffice/shumlib@2026.07.1 True
socrates MetOffice/socrates@2026.07.1 True
SimSys_Scripts MetOffice/SimSys_Scripts@393eddb True
ukca mcdalvi/ukca@rem_diag_array_check True
um mcdalvi/um@vn14.2_update_ukca_rev False
um_aux MetOffice/um_aux@2026.07.1 True
um_meta MetOffice/um_meta@2026.07.1 True

Approvals

Code Owners

  • No UM Code Owners Required

Config Owners

No UM Config Owners Required

Task Information

✅ succeeded tasks - 1306

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

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

@mcdalvi Mohit Dalvi (mcdalvi) added this to the Autumn 2026 milestone Sep 17, 2026
@mcdalvi Mohit Dalvi (mcdalvi) self-assigned this Sep 17, 2026
@mcdalvi Mohit Dalvi (mcdalvi) added Linked UM This PR is linked to a MetOffice/um PR Linked Apps This PR is linked to a MetOffice/lfric_apps PR labels Sep 17, 2026
@github-actions github-actions Bot added the cla-required The CLA has not yet been signed by the author of this PR - added by GA label Sep 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me

@theabro Luke Abraham (theabro) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Many thanks - looks good to me

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

scitech approved

@james-bruten-mo

Copy link
Copy Markdown
Collaborator

I've just approved, but can you add yourself to the cla here please

@github-actions github-actions Bot added cla-signed The CLA has been signed as part of this PR - added by GA and removed cla-required The CLA has not yet been signed by the author of this PR - added by GA labels Oct 6, 2026
@james-bruten-mo
James Bruten (james-bruten-mo) merged commit 7be5459 into MetOffice:main Oct 22, 2026
4 checks passed
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 Linked Apps This PR is linked to a MetOffice/lfric_apps PR Linked UM This PR is linked to a MetOffice/um PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants