Skip to content

Conversation

@alanjhewitt
Copy link
Contributor

@alanjhewitt alanjhewitt commented Jan 28, 2026

PR Summary

Sci/Tech Reviewer:
Code Reviewer: @Pierre-siddall

Developments included in this ticket

RADAER FULL DOMAIN

Reinitialise um_size: Set um_size to the number of horizontal cells before invoking the RADAER kernel, and reset it to 1 after the invocation.

Switch operation mode: Change the mode from column to domain in radaer_kernal_mod.F90 so that Psyclone can recognise the update, automatically generate the radaer_alg_mod_psy.f90 file, and provide suitable arguments for all subroutines. This enables the full horizontal and vertical domain data transfer to the RADAER code.

Update variable dimensions: Adjust variable sizes in radaer_kernal_mod.F90 to accept whole-domain data. A do loop was then introduced to initialise variables passed into key RADAER subroutines and to store the computed results, that involved a change of the data structure extents and associated loops from an "I-first" to a "K-first" approach.

Bug fix

Both the p_theta_levels and t_theta_levels pass the wrong number of dimensions to ukca_radaer_prepare.

Rafactor radaer kernel

In order to limit the number of times we switch from I-first to K-first addressing, I have made a UKCA side interface module that calls all of the UKCA side science code. I also reordered the sequence of I-first to K-first addressing.

Segmentation

All of the arrays passed to the UKCA side are now allocatable, so that correct segments can be passed with each iteration of the segmentation loop. The order of deallocation is the reverse order of allocation to prevent memory striding.

The I-first to K-first addressing changes from #841 full domain have been refactored so that the memory points to the part of memory associated with the segment for each iteration of the segment loop. This was complicated and is difficulty to describe in words, but I think will make sense when looking at the code change.

For short wave only, radaer_band_average does not need to be called for nightside segments, and this is a considerable cost save. We determine if any of the columns within each segment are on the dayside or not and pass that information to the UKCA interface code. This logical is calculated inside the segmentation loop.

Similirly, as the AOD diagnostics are optional, we only have to call the diagnostic modules if they are requested. I gather this information outside the segmentation loop.

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

@alanjhewitt alanjhewitt added the Linked UKCA This PR is linked to a MetOffice/ukca PR label Jan 28, 2026
@alanjhewitt
Copy link
Contributor Author

Hi Chirs,

I migrated the development from fcm.

There are some outstanding tasks before this development is ready.

Obtain timings for one, two, four threads.
Ben Went is looking at this 27th November. We need to include that information in the new GitHub? ticketing system, but maybe should record it in a MOSRS ticket details page for now.

Replace hand edited OpenMP directives in the radaer kernel with psyclone transformation functionality.

Replace the hard coded segment size ukca_radaer_segment_size with a namelist item of the same name.
This should be triggered by the l_radaer namelist option.

Add an integer namelist control option i_radaer_openmp to decide if we apply OpenMP in radaer.
Zero - OpenMP is off in radaer. For single thread tasks.
One - OpenMP around the Segmentation code from this ticket

Alan

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

Labels

Linked UKCA This PR is linked to a MetOffice/ukca PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants