Skip to content

Radaer api la side - part two initialisation - #698

Open
Alan J Hewitt (alanjhewitt) wants to merge 45 commits into
MetOffice:mainfrom
alanjhewitt:radaer_api_la_side_5
Open

Radaer api la side - part two initialisation#698
Alan J Hewitt (alanjhewitt) wants to merge 45 commits into
MetOffice:mainfrom
alanjhewitt:radaer_api_la_side_5

Conversation

@alanjhewitt

@alanjhewitt Alan J Hewitt (alanjhewitt) commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Sci/Tech Reviewer: Mohit Dalvi (@mcdalvi)
Code Reviewer: Pierre Siddall (@Pierre-siddall)

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 two of two development.

In part two, the previously hard coded lists (from part one) are instead generated from user settings based on the value of i_mode_setup if running with setting "ukca". For settings "glomap_clim" and "dust_and_clim", the user is not allowed to set i_mode_setup as this will always be setting "8" aka SUBCOCSSDU7mode.

These lists are to be determined during the initialisation step and saved for the rest of the run.

I will also include some documentation to describe the RADAER API.

It was not intended but RADAER was previously hardcoded with l_ukca_radaer_sustrat set as true. As this ticket includes this as a namelist item, I have set made this default to true for all current suites. This is a legitimate science option, although later some suites may wish to turn this off.

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 - BoB_radaer_api_la_side_5w/run1

Suite Information

Item Value
Suite Name BoB_radaer_api_la_side_5w/run1
Suite User alan.j.hewitt
Workflow Start 2026-08-27T15:55:01
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@BoB_radaer_api_la_side_5w False
lfric_core MetOffice/lfric_core@60fc29a True
moci MetOffice/moci@2026.07.1 True
SimSys_Scripts MetOffice/SimSys_Scripts@77a5166 True
socrates MetOffice/socrates@2026.07.1 True
socrates-spectral MetOffice/socrates-spectral@2026.07.1 True
ukca alanjhewitt/ukca@radaer_api_ukca_side_5 True

Task Information

✅ succeeded tasks - 1602

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

Please see build of documentation here

https://wwwspice/~alan.j.hewitt/lfric_apps/radaer_api_la_side_5/html/science_guide/radaer/index.html

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
Alan J Hewitt (alanjhewitt) marked this pull request as draft August 7, 2026 09:57
@alanjhewitt Alan J Hewitt (alanjhewitt) added documentation Improvements or additions to documentation Linked UKCA This PR is linked to a MetOffice/ukca PR macro This PR contains a metadata upgrade macro labels Aug 7, 2026

"""
Copy this template and complete to add your macro
class vn32_t683(MacroUpgrade):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Given the metadata changes, this is the only file where you should add an upgrade macro. When apply_macros.py gets run, it will copy the macro to all relevant places based on the metadata inheritance. Please revert all the other changes to versions.py files.

LFRic macro guidance: https://metoffice.github.io/simulation-systems/Development/macros.html#upgrade-macros-in-lfric

@github-actions github-actions Bot added the cla-modified The CLA has been modified as part of this PR - added by GA label Aug 24, 2026
@alanjhewitt

Copy link
Copy Markdown
Contributor Author

Hi Mohit,

This development is now ready for SciTech review.

Regards, Alan

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

A couple of minor points

["namelist:aerosol",
"glomap_mode"])

if glomap_mode == "'dust_and_clim'":

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.

I would suggest removing this and just setting mode_setup=SUBCOCSSDU_7mode in the upgrade macro. The value when dust and clim is selected is irrelevant because it's trigger ignored, but doing this makes duonly_2mode the default value in the GUI, and I think 7mode would be the better default to appear when someone switches on ukca.

! sustrat turned on
l_ukca_radaer_sustrat_local = .true.

if ( l_radaer) then

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.

Should this whole routine just be wrapped in "if l_radaer", i.e. the call from gungho_model_mod, rather than repeated instances inside the routine?

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

Passing back to Alan

!> @brief RADAER initialisation subroutine for science configuration

module um_radaer_init_mod

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.

I am aware this is a legacy thing, but for new modules/ routines could the 'um_' prefix be avoided?

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.

yes, i can change this. i will make it a separate commit so that changes in this file can still be seen.

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.

update - it turns out that "git mv" command preserves history.

use ukca_radaer_lfric_init_mod, only: ukca_radaer_lfric_init

use ukca_config_specification_mod, only: i_sussbcocdu_7mode, &
i_du_2mode

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.

UKCA variables and routines are expected to be accessed only via ukca_api_mod and usually aliased with a ukca_ prefix to differentiate from local variables.


use ukca_config_specification_mod, only: i_sussbcocdu_7mode, &
i_du_2mode

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.

UKCA variables expected to be accessed only via ukca_api_mod.

case default
write( log_scratch_space, '(A,I0)' ) &
'Developers should include additional mode settings here: ', mode_setup
call log_event( log_scratch_space, LOG_LEVEL_ERROR )

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.

The message could be clarified that the option passed in is not supported.

@github-actions

Copy link
Copy Markdown

⚠️ Hello Alan J Hewitt (@alanjhewitt)!

Your CLA signature was found on the base branch, but you appear to have modified the CONTRIBUTORS.md file in this PR.

Please do not edit the CONTRIBUTORS.md file. If you have already signed the CLA, revert changes to the file and your signature will be picked up.

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

Labels

cla-modified The CLA has been modified as part of this PR - added by GA documentation Improvements or additions to documentation Linked UKCA This PR is linked to a MetOffice/ukca PR macro This PR contains a metadata upgrade macro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants