Skip to content

Radaer api la side - part one run time - #636

Merged
Yaswant Pradhan (yaswant) merged 15 commits into
MetOffice:mainfrom
alanjhewitt:radaer_api_la_side_3
Aug 3, 2026
Merged

Radaer api la side - part one run time#636
Yaswant Pradhan (yaswant) merged 15 commits into
MetOffice:mainfrom
alanjhewitt:radaer_api_la_side_3

Conversation

@alanjhewitt

@alanjhewitt Alan J Hewitt (alanjhewitt) commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Sci/Tech Reviewer: Mohit Dalvi (@mcdalvi)
Code Reviewer: Yaswant Pradhan (@yaswant)

I developed the original lfric to radaer functionality in 2020. Like a lot of developments back then, it was needed in a hurry and so I developed a fudged solution with technical debt.

We will need user flexibility soon to be able to run radaer with different user settings, hence this part one of two development.

In part one, I have introduced the user flexibility that is required for run time. Its already a very large change, and this is a natural break point for splitting a big PR.

Some hard-coded settings remain in the development (on the lfric_apps side the lists used by the case statement), which will be removed in the part two ticket to develop the initialisation stage functionality.

The KGO changes result from differences in 32bit r_def and 64bit r_um variables being added together in a slightly different way. Revision ab953f8 , which preserved the old adding method maintains KGO (see run1).
https://cylchub/services/cylc-review/taskjobs/alan.j.hewitt/?suite=radaer_api_la_side_3%2Frun1
Revision 4bf2d99, makes changes to the new case statement adding method which cause bit level differences.
4bf2d99
In hindsight, I should have wrapped all the elements of the old adding method with real( ... , r_um) as there would not have been a KGO change here.

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

Test Suite Results - lfric_apps - radaer_api_la_side_3/run2

Suite Information

Item Value
Suite Name radaer_api_la_side_3/run2
Suite User alan.j.hewitt
Workflow Start 2026-07-28T14:03:13
Groups Run all
Dependency Reference Main Like
casim MetOffice/casim@2026.07.1 True
jules MetOffice/jules@2026.07.1 True
lfric_apps alanjhewitt/lfric_apps@radaer_api_la_side_3 False
lfric_core MetOffice/lfric_core@2026.07.1 True
moci MetOffice/moci@2026.07.1 True
SimSys_Scripts MetOffice/SimSys_Scripts@2026.07.1 True
socrates MetOffice/socrates@2026.07.1 True
socrates-spectral MetOffice/socrates-spectral@2026.07.1 True
ukca alanjhewitt/ukca@radaer_api_ukca_side_3 True

Task Information

✅ succeeded tasks - 1594

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

@iboutle iboutle 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.

Hi Alan,

Thanks for showing clearly where the KGO changes come from - I'm now happy with this.

Just one minor comment on the code itself below.

Cheers

Ian


! pressure on theta levels
real(r_um),dimension( row_length, rows, nlayers ) :: p_theta_levels
real(r_um),dimension( row_length, rows, nlayers ) :: p_theta_levels_um

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.

Rather than adding _um here, I would suggest removing it here and elsewhere from variable names - there is now really nothing to do with the UM in this code, so labelling fields with it makes no sense. I don't think they need any subscript after because they are all unique anwyay.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is probably a legacy thing. occasionally we had to distinguish variables that were both r_def and r_um. I will get rid of it. Maybe at some point we will rename r_um

@mcdalvi Mohit Dalvi (mcdalvi) 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.

Minor comments, but agree with Ian that the '_um' should be dropped. I expect this is for mapping to the names inside the core ''ukca_radaer_xx'' routines?

@@ -389,6 +391,8 @@ subroutine radaer_code( nlayers, &

use ukca_option_mod, only: do_not_prescribe

use ukca_radaer_lfric_api_mod, only: ukca_radaer_lfric_interface

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.

Subroutine needs to be accessed via ukca_api_mod as per the API design.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We spoke offline and agreed that this is not required because this is separate from the UKCA API.


if ( .not. associated( aod_ukca_ait_sol, empty_real_data ) ) then
do k = 1, npd_ukca_aod_wavel
do i = 1, row_length
aod_ukca_ait_sol( map_aod_wavel(i) + k - 1 ) = &
aod_ukca_this_mode_um(i,k)
aod_ukca_all_modes_um(i,k,mode_ait_sol-1)

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.

Same comment as the UKCA-side change, could use of '-1' for the 3rd index be made more robust? Is there a difference in start index 0 vs 1 in the arrays?

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.

My understanding is this arises from the fact that radaer excludes the 1st UKCA mode (nucleation) and so operates on modes 2-7 in the UKCA indexing, but accommodates these in arrays of size 6, hence the -1. The only way this is likely to become an issue is if radaer wanted to include the nucleation mode ever - but I imagine lots of hard-wired things might break if we wanted to do that!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ian is correct. Nucleation has almost zero impact on radiation properties, so we will never use nucleation mode in RADAER.

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.

Thanks Alan (& Ian). It will help to add a comment for this, something like "to adjust indexing for soluble nucleation mode values that are at the first position in the array but not used here"

@github-actions github-actions Bot added the cla-modified The CLA has been modified as part of this PR - added by GA label Jul 27, 2026
@mcdalvi

Copy link
Copy Markdown
Contributor

Thanks Alan. Sci-tech Review passed
Yaswant Pradhan (@yaswant)

@mcdalvi Mohit Dalvi (mcdalvi) 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.

Sci-tech Review passed

@github-actions github-actions Bot removed the cla-modified The CLA has been modified as part of this PR - added by GA label Aug 3, 2026
@yaswant
Yaswant Pradhan (yaswant) merged commit 9d85111 into MetOffice:main Aug 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

KGO This PR contains changes to KGO Linked UKCA This PR is linked to a MetOffice/ukca PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants