Radaer api la side - part two initialisation - #698
Alan J Hewitt (alanjhewitt) wants to merge 48 commits into
Conversation
|
|
||
| """ | ||
| Copy this template and complete to add your macro | ||
| class vn32_t683(MacroUpgrade): |
There was a problem hiding this comment.
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
|
Hi Mohit, This development is now ready for SciTech review. Regards, Alan |
iboutle
left a comment
There was a problem hiding this comment.
A couple of minor points
| ["namelist:aerosol", | ||
| "glomap_mode"]) | ||
|
|
||
| if glomap_mode == "'dust_and_clim'": |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
Mohit Dalvi (mcdalvi)
left a comment
There was a problem hiding this comment.
Passing back to Alan
| !> @brief RADAER initialisation subroutine for science configuration | ||
|
|
||
| module um_radaer_init_mod | ||
|
|
There was a problem hiding this comment.
I am aware this is a legacy thing, but for new modules/ routines could the 'um_' prefix be avoided?
There was a problem hiding this comment.
yes, i can change this. i will make it a separate commit so that changes in this file can still be seen.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 | ||
|
|
There was a problem hiding this comment.
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 ) |
There was a problem hiding this comment.
The message could be clarified that the option passed in is not supported.
Mohit Dalvi (mcdalvi)
left a comment
There was a problem hiding this comment.
Thanks Alan, Sci-tech Review passed
Pierre Siddall (Pierre-siddall)
left a comment
There was a problem hiding this comment.
Hi Alan J Hewitt (@alanjhewitt), thanks for this, this mostly looks good to me bar what I think may be a small typo in one of the restructured text files and combining two blocks of repeated code into a single conditional statement. Let me know if I've missed any context with these. Otherwise when these are fixed I'll be happy to approve this PR.
| else if ( glomap_mode == glomap_mode_dust_and_clim ) then | ||
| ! dust_and_clim runs with a diffent mode_setup between ukca and radaer | ||
| ! this is always fixed to ukca_i_sussbcocdu_7mode. | ||
| i_mode_setup_radaer_local = ukca_i_sussbcocdu_7mode | ||
|
|
||
| ! Tune BC turned off | ||
| i_ukca_tune_bc_local = ukca_i_ukca_tune_bc_off | ||
|
|
||
| ! Dust ageing not allowed for dust only ukca | ||
| l_dust_mp_ageing_local = .false. | ||
|
|
||
| ! sustrat turned on | ||
| l_ukca_radaer_sustrat_local = .true. | ||
|
|
||
| call ukca_radaer_lfric_init( i_mode_setup_radaer_local, & | ||
| i_ukca_tune_bc_local, & | ||
| l_dust_mp_ageing_local, & | ||
| l_ukca_radaer_sustrat_local ) | ||
|
|
||
| else if ( glomap_mode == glomap_mode_radaer_test ) then | ||
| ! This was developed for aqua planet runs and may be redundant | ||
| ! For now fix this to ukca_i_sussbcocdu_7mode. | ||
| i_mode_setup_radaer_local = ukca_i_sussbcocdu_7mode | ||
|
|
||
| ! Tune BC turned off | ||
| i_ukca_tune_bc_local = ukca_i_ukca_tune_bc_off | ||
|
|
||
| ! Dust ageing turned off | ||
| l_dust_mp_ageing_local = .false. | ||
|
|
||
| ! sustrat turned on | ||
| l_ukca_radaer_sustrat_local = .true. | ||
|
|
||
| call ukca_radaer_lfric_init( i_mode_setup_radaer_local, & | ||
| i_ukca_tune_bc_local, & | ||
| l_dust_mp_ageing_local, & | ||
| l_ukca_radaer_sustrat_local ) |
There was a problem hiding this comment.
Given there are two else if statements which run the same block of code it makes sense to combine these using an OR operator.
| else if ( glomap_mode == glomap_mode_dust_and_clim ) then | |
| ! dust_and_clim runs with a diffent mode_setup between ukca and radaer | |
| ! this is always fixed to ukca_i_sussbcocdu_7mode. | |
| i_mode_setup_radaer_local = ukca_i_sussbcocdu_7mode | |
| ! Tune BC turned off | |
| i_ukca_tune_bc_local = ukca_i_ukca_tune_bc_off | |
| ! Dust ageing not allowed for dust only ukca | |
| l_dust_mp_ageing_local = .false. | |
| ! sustrat turned on | |
| l_ukca_radaer_sustrat_local = .true. | |
| call ukca_radaer_lfric_init( i_mode_setup_radaer_local, & | |
| i_ukca_tune_bc_local, & | |
| l_dust_mp_ageing_local, & | |
| l_ukca_radaer_sustrat_local ) | |
| else if ( glomap_mode == glomap_mode_radaer_test ) then | |
| ! This was developed for aqua planet runs and may be redundant | |
| ! For now fix this to ukca_i_sussbcocdu_7mode. | |
| i_mode_setup_radaer_local = ukca_i_sussbcocdu_7mode | |
| ! Tune BC turned off | |
| i_ukca_tune_bc_local = ukca_i_ukca_tune_bc_off | |
| ! Dust ageing turned off | |
| l_dust_mp_ageing_local = .false. | |
| ! sustrat turned on | |
| l_ukca_radaer_sustrat_local = .true. | |
| call ukca_radaer_lfric_init( i_mode_setup_radaer_local, & | |
| i_ukca_tune_bc_local, & | |
| l_dust_mp_ageing_local, & | |
| l_ukca_radaer_sustrat_local ) | |
| else if ( glomap_mode == glomap_mode_dust_and_clim .or. glomap_mode == glomap_mode_radaer_test ) then | |
| ! dust_and_clim runs with a diffent mode_setup between ukca and radaer | |
| ! this is always fixed to ukca_i_sussbcocdu_7mode. | |
| i_mode_setup_radaer_local = ukca_i_sussbcocdu_7mode | |
| ! Tune BC turned off | |
| i_ukca_tune_bc_local = ukca_i_ukca_tune_bc_off | |
| ! Dust ageing not allowed for dust only ukca | |
| l_dust_mp_ageing_local = .false. | |
| ! sustrat turned on | |
| l_ukca_radaer_sustrat_local = .true. | |
| call ukca_radaer_lfric_init( i_mode_setup_radaer_local, & | |
| i_ukca_tune_bc_local, & | |
| l_dust_mp_ageing_local, & | |
| l_ukca_radaer_sustrat_local ) |
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 SUBCOCSSDU_7mode (previously setting 8 in the UM).
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
Testing
Test Suite Results - lfric_apps - BoB_radaer_api_la_side_5y/run1
Suite Information
Task Information
✅ succeeded tasks - 1602
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
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
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review