You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Linked UKCAThis PR is linked to a MetOffice/ukca PR
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Testing
trac.log
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review