diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d186d921a..8314c000f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -7,14 +7,6 @@ body: attributes: value: | Thanks for taking the time to fill out this bug report! - - type: input - id: contact - attributes: - label: Contact Details - description: How can we get in touch with you if we need more info? - placeholder: e.g. email@example.com @octocat - validations: - required: false - type: dropdown id: version attributes: @@ -24,7 +16,7 @@ body: - main default: 0 validations: - required: true + required: true - type: input id: linked-issues attributes: diff --git a/.github/ISSUE_TEMPLATE/custom_issue.yml b/.github/ISSUE_TEMPLATE/custom_issue.yml index 2feebab5e..18f5b5e15 100644 --- a/.github/ISSUE_TEMPLATE/custom_issue.yml +++ b/.github/ISSUE_TEMPLATE/custom_issue.yml @@ -7,14 +7,6 @@ body: attributes: value: | Thanks for taking the time to help improve LFRic Apps. - - type: input - id: contact - attributes: - label: Contact Details - description: How can we get in touch with you if we need more info? - placeholder: e.g. email@example.com @octocat - validations: - required: false - type: input id: linked-issues attributes: diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml index 9b3011e84..cc9d98f3e 100644 --- a/.github/ISSUE_TEMPLATE/documentation.yml +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -1,5 +1,5 @@ name: Documentation Issue -description: Report an issue with the LFRic Apps documentation or suggest an improvement. +description: Report an issue with the LFRic Apps documentation or suggest an improvement. labels: ["documentation"] type: task body: @@ -7,14 +7,6 @@ body: attributes: value: | Thanks for taking the time to help improve the LFRic Apps documentation. - - type: input - id: contact - attributes: - label: Contact Details - description: How can we get in touch with you if we need more info? - placeholder: e.g. email@example.com @octocat - validations: - required: false - type: input id: linked-issues attributes: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b7e5f2a21..920e1419c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -22,26 +22,19 @@ Code Reviewer: ## Code Quality Checklist -(_Some checks are automatically carried out via the CI pipeline_) - - [ ] I have performed a self-review of my own code -- [ ] My code follows the project's style guidelines - [style guidelines](https://metoffice.github.io/lfric_core/how_to_contribute/index.html#how-to-contribute-index) -- [ ] Comments have been included that aid undertanding and enhance the - readability of the code +- [ ] My code follows the project's [style guidelines](https://metoffice.github.io/lfric_core/how_to_contribute/index.html#how-to-contribute-index) +- [ ] 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 (eg. kgo changes) -- [ ] I have added tests to cover new functionality as appropriate (eg. system - tests, unit tests, etc.) -- [ ] Any new tests have been assigned an appropriate amount of compute resource - and have tests 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) +- [ ] I have tested this change locally, using the LFRic Core rose-stem suite +- [ ] If required (e.g. API changes) I have also run the LFRic Apps test suite using this branch +- [ ] 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) @@ -57,30 +50,21 @@ Code Reviewer: ## Performance Impact -- [ ] Performance of the code has been considered and, if applicable, suitable - performance measurements have been conducted +- [ ] 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](https://metoffice.github.io/simulation-systems/FurtherDetails/ai.html) - (including attribution labels) +- [ ] 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](https://metoffice.github.io/simulation-systems/FurtherDetails/ai.html) (including attribution labels) ## Documentation -- [ ] Where appropriate I have updated documentation related to this change and - confirmed that it builds correctly +- [ ] 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 (eg. PsyKAl-lite, Kernal - inteface, optimisation scripts, LFRic data structure code) then please - contact the - [tooscollabdevteam@metoffice.gov.uk](tooscollabdevteam@metoffice.gov.uk) +- [ ] 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](tooscollabdevteam@metoffice.gov.uk) # Sci/Tech Review @@ -92,7 +76,7 @@ Code Reviewer: - [ ] 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_ +(_Please alert the code reviewer via a tag when you have approved the SR_) # Code Review diff --git a/.github/workflows/ru_deploy-docs.yml b/.github/workflows/ru_deploy-docs.yml index 2867b69d7..b38957771 100644 --- a/.github/workflows/ru_deploy-docs.yml +++ b/.github/workflows/ru_deploy-docs.yml @@ -11,6 +11,7 @@ on: jobs: deploy: + if: ${{ github.repository == 'MetOffice/lfric_apps' }} environment: name: github-pages permissions: diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d0f7ae14d..dfa1df3a0 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,6 +1,11 @@ # Contributors - -| GitHub user | Real Name | Affiliation | Date | -| ----------- | --------- | ----------- | ---- | -| james-bruten-mo | James Bruten | Met Office | 2025-12-09 | -| jennyhickson | Jenny Hickson | Met Office | 2025-12-10 | +| GitHub user | Real Name | Affiliation | Date | +| --------------- | --------------- | ----------- | ---------- | +| james-bruten-mo | James Bruten | Met Office | 2025-12-09 | +| jennyhickson | Jenny Hickson | Met Office | 2025-12-10 | +| mike-hobson | Mike Hobson | Met Office | 2025-12-17 | +| mo-marqh | mark Hedley | Met Office | 2025-12-11 | +| yaswant | Yaswant Pradhan | Met Office | 2025-12-16 | +| oakleybrunt | Oakley Brunt | Met Office | 2025-12-19 | +| harry-shepherd | Harry Shepherd | Met Office | 2026-01-08 | +| timgraham-Met | Tim Graham | Met Office | 2026-01-15 | diff --git a/applications/adjoint_tests/source/adjoint_tests.f90 b/applications/adjoint_tests/source/adjoint_tests.f90 index 2118e5f2c..5fa5b2232 100644 --- a/applications/adjoint_tests/source/adjoint_tests.f90 +++ b/applications/adjoint_tests/source/adjoint_tests.f90 @@ -10,7 +10,7 @@ program adjoint_tests - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use driver_collections_mod, only : init_collections, final_collections use driver_comm_mod, only : init_comm, final_comm use driver_config_mod, only : init_config, final_config @@ -33,6 +33,8 @@ program adjoint_tests character(*), parameter :: application_name = "adjoint_tests" character(:), allocatable :: filename + call parse_command_line( filename ) + modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, table_len=10 ) @@ -55,7 +57,7 @@ program adjoint_tests call modeldb%io_contexts%initialise(application_name, 100) call init_comm( application_name, modeldb ) - call get_initial_filename( filename ) + call init_config( filename, gungho_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), application_name ) diff --git a/applications/gravity_wave/source/gravity_wave.f90 b/applications/gravity_wave/source/gravity_wave.f90 index 2c269c11e..e1a988dd0 100644 --- a/applications/gravity_wave/source/gravity_wave.f90 +++ b/applications/gravity_wave/source/gravity_wave.f90 @@ -11,7 +11,7 @@ program gravity_wave - use cli_mod, only: get_initial_filename + use cli_mod, only: parse_command_line use driver_modeldb_mod, only: modeldb_type use driver_collections_mod, only: init_collections, final_collections use driver_comm_mod, only: init_comm, final_comm @@ -32,11 +32,12 @@ program gravity_wave character(*), parameter :: program_name = "gravity_wave" character(:), allocatable :: filename + call parse_command_line( filename ) + call modeldb%configuration%initialise( program_name, table_len=10 ) modeldb%mpi => global_mpi call init_comm( program_name, modeldb ) - call get_initial_filename( filename ) call init_config( filename, gravity_wave_required_namelists, & modeldb%configuration ) deallocate( filename ) diff --git a/applications/gungho_model/source/gungho_model.f90 b/applications/gungho_model/source/gungho_model.f90 index 4367d93c4..da2050f69 100644 --- a/applications/gungho_model/source/gungho_model.f90 +++ b/applications/gungho_model/source/gungho_model.f90 @@ -15,7 +15,7 @@ program gungho_model - use cli_mod, only: get_initial_filename + use cli_mod, only: parse_command_line use derived_config_mod, only: l_esm_couple use driver_collections_mod, only: init_collections, final_collections use driver_comm_mod, only: init_comm, final_comm @@ -41,6 +41,8 @@ program gungho_model character(*), parameter :: application_name = "gungho_model" character(:), allocatable :: filename + call parse_command_line( filename ) + modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, & @@ -66,7 +68,7 @@ program gungho_model call modeldb%io_contexts%initialise(application_name, 100) call init_comm( application_name, modeldb ) - call get_initial_filename( filename ) + call init_config( filename, gungho_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), application_name ) diff --git a/applications/jedi_lfric_tests/source/jedi_forecast.f90 b/applications/jedi_lfric_tests/source/jedi_forecast.f90 index e375fc5ec..00150b30d 100644 --- a/applications/jedi_lfric_tests/source/jedi_forecast.f90 +++ b/applications/jedi_lfric_tests/source/jedi_forecast.f90 @@ -19,7 +19,7 @@ ! contact darth@metofice.gov.uk for advice. program jedi_forecast - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use constants_mod, only : PRECISION_REAL, i_def, str_def use field_collection_mod, only : field_collection_type use log_mod, only : log_event, log_scratch_space, & @@ -57,7 +57,7 @@ program jedi_forecast character(*), parameter :: program_name = "jedi_forecast" ! Infrastructure config - call get_initial_filename( filename ) + call parse_command_line( filename ) ! Run object - handles initialization and finalization of required ! infrastructure. Initialize external libraries such as XIOS diff --git a/applications/jedi_lfric_tests/source/jedi_forecast_pseudo.f90 b/applications/jedi_lfric_tests/source/jedi_forecast_pseudo.f90 index 0463708c3..cec71e9d4 100644 --- a/applications/jedi_lfric_tests/source/jedi_forecast_pseudo.f90 +++ b/applications/jedi_lfric_tests/source/jedi_forecast_pseudo.f90 @@ -19,7 +19,7 @@ ! contact darth@metofice.gov.uk for advice. program jedi_forecast_pseudo - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use constants_mod, only : PRECISION_REAL, i_def, str_def use field_collection_mod, only : field_collection_type use log_mod, only : log_event, log_scratch_space, & @@ -56,7 +56,7 @@ program jedi_forecast_pseudo character(*), parameter :: program_name = "jedi_forecast_pseudo" ! Infrastructure configuration - call get_initial_filename( filename ) + call parse_command_line( filename ) ! Run object - handles initialization and finalization of required ! infrastructure. Initialize external libraries such as XIOS diff --git a/applications/jedi_lfric_tests/source/jedi_id_tlm_tests.f90 b/applications/jedi_lfric_tests/source/jedi_id_tlm_tests.f90 index 307801cab..ed8b0db66 100644 --- a/applications/jedi_lfric_tests/source/jedi_id_tlm_tests.f90 +++ b/applications/jedi_lfric_tests/source/jedi_id_tlm_tests.f90 @@ -46,7 +46,7 @@ ! contact darth@metofice.gov.uk for advice. program jedi_id_tlm_tests - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use constants_mod, only : PRECISION_REAL, i_def, str_def, r_def use field_collection_mod, only : field_collection_type use log_mod, only : log_event, log_scratch_space, & @@ -96,7 +96,7 @@ program jedi_id_tlm_tests character(*), parameter :: program_name = "jedi_id_tlm_tests" ! Infrastructure configuration - call get_initial_filename( filename ) + call parse_command_line( filename ) ! Run object - handles initialization and finalization of required ! infrastructure. Initialize external libraries such as XIOS diff --git a/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 b/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 index 57ad20f79..2937a18de 100644 --- a/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 +++ b/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 @@ -15,7 +15,7 @@ !> program jedi_lfric_tests - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use driver_collections_mod, only : init_collections, final_collections use driver_comm_mod, only : init_comm, final_comm use driver_config_mod, only : init_config, final_config @@ -38,6 +38,8 @@ program jedi_lfric_tests character(*), parameter :: application_name = "jedi_lfric_tests" character(:), allocatable :: filename + call parse_command_line( filename ) + modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, table_len=10 ) @@ -60,7 +62,7 @@ program jedi_lfric_tests call modeldb%io_contexts%initialise(application_name, 100) call init_comm( application_name, modeldb ) - call get_initial_filename( filename ) + call init_config( filename, gungho_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), application_name ) diff --git a/applications/jedi_lfric_tests/source/jedi_tlm_forecast_tl.f90 b/applications/jedi_lfric_tests/source/jedi_tlm_forecast_tl.f90 index a5467606a..b3c2aa004 100644 --- a/applications/jedi_lfric_tests/source/jedi_tlm_forecast_tl.f90 +++ b/applications/jedi_lfric_tests/source/jedi_tlm_forecast_tl.f90 @@ -21,7 +21,7 @@ ! contact darth@metofice.gov.uk for advice. program jedi_tlm_forecast_tl - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use constants_mod, only : PRECISION_REAL, i_def, str_def use field_collection_mod, only : field_collection_type use log_mod, only : log_event, log_scratch_space, & @@ -61,15 +61,15 @@ program jedi_tlm_forecast_tl character(*), parameter :: program_name = "jedi_tlm_forecast_tl" + ! Infrastructure config + call parse_command_line( filename ) + call log_event( 'Running ' // program_name // ' ...', LOG_LEVEL_ALWAYS ) write(log_scratch_space,'(A)') & 'Application built with '//trim(PRECISION_REAL)// & '-bit real numbers' call log_event( log_scratch_space, LOG_LEVEL_ALWAYS ) - ! Infrastructure config - call get_initial_filename( filename ) - ! Run object - handles initialization and finalization of required ! infrastructure. Initialize external libraries such as XIOS call jedi_run%initialise( program_name, model_communicator ) diff --git a/applications/jedi_lfric_tests/source/jedi_tlm_tests.f90 b/applications/jedi_lfric_tests/source/jedi_tlm_tests.f90 index f2266fdb5..da7f0342b 100644 --- a/applications/jedi_lfric_tests/source/jedi_tlm_tests.f90 +++ b/applications/jedi_lfric_tests/source/jedi_tlm_tests.f90 @@ -34,7 +34,7 @@ program jedi_tlm_tests - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use constants_mod, only : PRECISION_REAL, i_def, str_def, r_def use field_collection_mod, only : field_collection_type use log_mod, only : log_event, log_scratch_space, & @@ -82,7 +82,7 @@ program jedi_tlm_tests character(*), parameter :: program_name = "jedi_tlm_tests" ! Infrastructure config - call get_initial_filename( filename ) + call parse_command_line( filename ) ! Run object - handles initialization and finalization of required ! infrastructure. Initialize external libraries such as XIOS diff --git a/applications/jules/source/jules.f90 b/applications/jules/source/jules.f90 index 5f824fa7c..5b2ca853a 100644 --- a/applications/jules/source/jules.f90 +++ b/applications/jules/source/jules.f90 @@ -16,7 +16,7 @@ program jules - use cli_mod, only: get_initial_filename + use cli_mod, only: parse_command_line use driver_collections_mod, only: init_collections, final_collections use driver_comm_mod, only: init_comm, final_comm use driver_config_mod, only: init_config, final_config @@ -38,6 +38,8 @@ program jules character(:), allocatable :: filename + call parse_command_line( filename ) + modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, & @@ -63,7 +65,6 @@ program jules call modeldb%io_contexts%initialise(application_name, 100) call init_comm( application_name, modeldb ) - call get_initial_filename( filename ) call init_config( filename, gungho_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), application_name ) diff --git a/applications/lfric2lfric/source/lfric2lfric.F90 b/applications/lfric2lfric/source/lfric2lfric.F90 index 1f09afac8..c40c5cc3d 100644 --- a/applications/lfric2lfric/source/lfric2lfric.F90 +++ b/applications/lfric2lfric/source/lfric2lfric.F90 @@ -14,7 +14,7 @@ program lfric2lfric - use cli_mod, only: get_initial_filename + use cli_mod, only: parse_command_line use constants_mod, only: precision_real use driver_collections_mod, only: init_collections, final_collections use driver_config_mod, only: init_config, final_config @@ -46,6 +46,8 @@ program lfric2lfric type(coupling_type) :: coupler #endif + call parse_command_line( filename ) + call modeldb%configuration%initialise( program_name, table_len=10 ) write(log_scratch_space,'(A)') & @@ -65,7 +67,6 @@ program lfric2lfric call modeldb%values%add_key_value('coupling_dst', coupler) #endif call init_comm( program_name, modeldb ) - call get_initial_filename( filename ) call init_config( filename, lfric2lfric_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), program_name ) diff --git a/applications/lfric_atm/metadata/grid_def_main.xml b/applications/lfric_atm/metadata/grid_def_main.xml index bf68a5bcf..82be6b892 100644 --- a/applications/lfric_atm/metadata/grid_def_main.xml +++ b/applications/lfric_atm/metadata/grid_def_main.xml @@ -101,6 +101,11 @@ + + + + + diff --git a/applications/lfric_atm/source/lfric_atm.f90 b/applications/lfric_atm/source/lfric_atm.f90 index e9b74a91a..8f314f64d 100644 --- a/applications/lfric_atm/source/lfric_atm.f90 +++ b/applications/lfric_atm/source/lfric_atm.f90 @@ -16,7 +16,7 @@ program lfric_atm - use cli_mod, only: get_initial_filename + use cli_mod, only: parse_command_line use driver_collections_mod, only: init_collections, final_collections use driver_comm_mod, only: init_comm, final_comm use driver_config_mod, only: init_config, final_config @@ -42,6 +42,9 @@ program lfric_atm integer(tik) :: timing_handle_global type(namelist_type), pointer :: io_nml logical :: lsubroutine_timers + + call parse_command_line( filename ) + modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, & @@ -67,7 +70,7 @@ program lfric_atm call modeldb%io_contexts%initialise(application_name, 100) call init_comm( application_name, modeldb ) - call get_initial_filename( filename ) + call init_config( filename, gungho_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), application_name ) diff --git a/applications/lfric_coupled/source/lfric_coupled.f90 b/applications/lfric_coupled/source/lfric_coupled.f90 index 6efc6bf31..16b5d7375 100644 --- a/applications/lfric_coupled/source/lfric_coupled.f90 +++ b/applications/lfric_coupled/source/lfric_coupled.f90 @@ -16,7 +16,7 @@ program lfric_coupled - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use coupler_mod, only : set_cpl_name use driver_collections_mod, only : init_collections, final_collections use driver_comm_mod, only : init_comm, final_comm @@ -38,6 +38,8 @@ program lfric_coupled character(:), allocatable :: filename + call parse_command_line( filename ) + modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, table_len=10 ) @@ -63,7 +65,7 @@ program lfric_coupled call set_cpl_name(modeldb, cpl_component_name) call init_comm( application_name, modeldb ) - call get_initial_filename( filename ) + call init_config( filename, gungho_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), application_name ) diff --git a/applications/linear_model/source/linear_model.f90 b/applications/linear_model/source/linear_model.f90 index a8d448b35..e58099d46 100644 --- a/applications/linear_model/source/linear_model.f90 +++ b/applications/linear_model/source/linear_model.f90 @@ -14,7 +14,7 @@ program linear_model - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use driver_collections_mod, only : init_collections, final_collections use driver_comm_mod, only : init_comm, final_comm use driver_config_mod, only : init_config, final_config @@ -37,6 +37,8 @@ program linear_model character(*), parameter :: application_name = "linear_model" character(:), allocatable :: filename + call parse_command_line( filename ) + modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, table_len=10 ) @@ -59,7 +61,7 @@ program linear_model call modeldb%io_contexts%initialise(application_name, 100) call init_comm( application_name, modeldb ) - call get_initial_filename( filename ) + call init_config( filename, gungho_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), application_name ) diff --git a/applications/name_transport/optimisation/niwa-xc50/psykal/global.py b/applications/name_transport/optimisation/niwa-xc50/psykal/global.py index 02c220077..ee3d076f9 120000 --- a/applications/name_transport/optimisation/niwa-xc50/psykal/global.py +++ b/applications/name_transport/optimisation/niwa-xc50/psykal/global.py @@ -1 +1 @@ -./../../meto-xc40/psykal/global.py \ No newline at end of file +../../meto-ex1a/psykal/global.py diff --git a/applications/name_transport/source/name_transport.f90 b/applications/name_transport/source/name_transport.f90 index d6b22502a..7f8faab1d 100644 --- a/applications/name_transport/source/name_transport.f90 +++ b/applications/name_transport/source/name_transport.f90 @@ -9,7 +9,7 @@ program name_transport - use cli_mod, only: get_initial_filename + use cli_mod, only: parse_command_line use constants_mod, only: i_def, r_def use driver_collections_mod, only: init_collections, final_collections use driver_comm_mod, only: init_comm, final_comm @@ -37,10 +37,11 @@ program name_transport character(*), parameter :: program_name = "name_transport" character(:), allocatable :: filename + call parse_command_line( filename ) + call modeldb%configuration%initialise( program_name, table_len=10 ) modeldb%mpi => global_mpi call init_comm( program_name, modeldb ) - call get_initial_filename( filename ) call init_config( filename, name_transport_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), program_name ) diff --git a/applications/ngarch/source/ngarch.f90 b/applications/ngarch/source/ngarch.f90 index 691f84968..919eec564 100644 --- a/applications/ngarch/source/ngarch.f90 +++ b/applications/ngarch/source/ngarch.f90 @@ -8,7 +8,7 @@ !> @details Runs a GungHo model with a custom step method program ngarch - use cli_mod, only : get_initial_filename + use cli_mod, only : parse_command_line use driver_collections_mod, only : init_collections, final_collections use constants_mod, only : precision_real use driver_comm_mod, only : init_comm, final_comm @@ -32,6 +32,8 @@ program ngarch character(*), parameter :: application_name = "ngarch" character(:), allocatable :: filename + call parse_command_line( filename ) + call modeldb%configuration%initialise( application_name, table_len=10 ) call modeldb%values%initialise( 'values', 5 ) @@ -56,7 +58,6 @@ program ngarch modeldb%mpi => global_mpi call init_comm( application_name, modeldb ) - call get_initial_filename( filename ) call init_config( filename, & ngarch_required_namelists, & modeldb%configuration ) diff --git a/applications/shallow_water/source/shallow_water.f90 b/applications/shallow_water/source/shallow_water.f90 index 7118a3408..c74a664b5 100644 --- a/applications/shallow_water/source/shallow_water.f90 +++ b/applications/shallow_water/source/shallow_water.f90 @@ -14,7 +14,7 @@ program shallow_water - use cli_mod, only: get_initial_filename + use cli_mod, only: parse_command_line use driver_collections_mod, only: init_collections, final_collections use driver_comm_mod, only: init_comm, final_comm use driver_config_mod, only: init_config, final_config @@ -40,6 +40,8 @@ program shallow_water type(modeldb_type) :: modeldb character(:), allocatable :: filename + call parse_command_line( filename ) + modeldb%mpi => global_mpi call modeldb%configuration%initialise( program_name, table_len=10 ) @@ -56,7 +58,6 @@ program shallow_water call modeldb%io_contexts%initialise(program_name, 100) call init_comm( program_name, modeldb ) - call get_initial_filename( filename ) call init_config( filename, shallow_water_required_namelists, & modeldb%configuration ) call init_logger( global_mpi%get_comm(), program_name ) diff --git a/applications/solver/source/solver.F90 b/applications/solver/source/solver.F90 index 466603082..9c06cb220 100644 --- a/applications/solver/source/solver.F90 +++ b/applications/solver/source/solver.F90 @@ -14,7 +14,7 @@ program solver use add_mesh_map_mod, only: assign_mesh_maps use constants_mod, only: i_def, r_def, PRECISION_REAL, str_def use convert_to_upper_mod, only: convert_to_upper - use cli_mod, only: get_initial_filename + use cli_mod, only: parse_command_line use create_mesh_mod, only: create_mesh, create_extrusion use driver_collections_mod, only: init_collections, final_collections use driver_config_mod, only: init_config, final_config @@ -102,6 +102,8 @@ program solver ! Driver layer init !----------------------------------------------------------------------------- + call parse_command_line( filename ) + ! Initialise MPI communicatios and get a valid communicator call create_comm(comm) @@ -114,7 +116,6 @@ program solver total_ranks = global_mpi%get_comm_size() local_rank = global_mpi%get_comm_rank() - call get_initial_filename( filename ) call configuration%initialise( program_name, table_len=10 ) call init_config( filename, solver_required_namelists, & configuration ) diff --git a/applications/transport/source/transport.f90 b/applications/transport/source/transport.f90 index 5530b1cba..a4ea8347a 100644 --- a/applications/transport/source/transport.f90 +++ b/applications/transport/source/transport.f90 @@ -8,7 +8,7 @@ !> run_transport() and finalise_transport(). program transport - use cli_mod, only: get_initial_filename + use cli_mod, only: parse_command_line use constants_mod, only: i_def, r_def use driver_collections_mod, only: init_collections, final_collections use driver_comm_mod, only: init_comm, final_comm @@ -34,10 +34,11 @@ program transport character(*), parameter :: program_name = "transport" character(:), allocatable :: filename + call parse_command_line( filename ) + call modeldb%configuration%initialise( program_name, table_len=10 ) modeldb%mpi => global_mpi call init_comm( program_name, modeldb ) - call get_initial_filename( filename ) call init_config( filename, transport_required_namelists, & modeldb%configuration ) call init_logger( modeldb%mpi%get_comm(), program_name ) diff --git a/build/local_build.py b/build/local_build.py index 2c9d445e4..988efe3e6 100755 --- a/build/local_build.py +++ b/build/local_build.py @@ -17,6 +17,8 @@ import subprocess import argparse import yaml +from pathlib import Path +import shutil def subprocess_run(command): @@ -82,14 +84,11 @@ def determine_project_path(project, root_dir): ) -def clone_dependency(values, temp_dep): +def clone_dependency(source, ref, temp_dep): """ Clone the physics dependencies into a temporary directory """ - source = values["source"] - ref = values["ref"] - commands = ( f"git -C {temp_dep} init", f"git -C {temp_dep} remote add origin {source}", @@ -110,7 +109,10 @@ def get_lfric_core(core_source, working_dir): if core_source["source"].endswith(".git"): print("Cloning LFRic Core from Github") - lfric_core_loc = f"{working_dir}/scratch/core" + lfric_core_loc = Path(working_dir) / "scratch" / "core" + if lfric_core_loc.exists(): + shutil.rmtree(lfric_core_loc) + lfric_core_loc.mkdir(parents=True) clone_dependency(core_source["source"], core_source["ref"], lfric_core_loc) print("rsyncing the exported lfric_core source") else: diff --git a/dependencies.yaml b/dependencies.yaml index caab36487..473a2c6ee 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -31,7 +31,7 @@ lfric_apps: lfric_core: source: git@github.com:MetOffice/lfric_core.git - ref: 2025.12.1 + ref: 5d4d72f0e35f00e71b1757df6beadec21ece97f0 moci: source: git@github.com:MetOffice/moci.git diff --git a/interfaces/jules_interface/source/algorithm/init_surface_fields_alg_mod.x90 b/interfaces/jules_interface/source/algorithm/init_surface_fields_alg_mod.x90 index aa8b0e98c..1f5c984ec 100644 --- a/interfaces/jules_interface/source/algorithm/init_surface_fields_alg_mod.x90 +++ b/interfaces/jules_interface/source/algorithm/init_surface_fields_alg_mod.x90 @@ -154,7 +154,7 @@ contains canopy_height, tile_temperature, & tile_lw_grey_albedo ), & ! Sea ice conductivity will use either this fixed value or - ! it will get overwritten by the coupler + ! it will get overwritten by the coupler or process_inputs setval_c(sea_ice_conductivity, default_conductivity ), & ! Initialise melt ponds to zero setval_c(melt_pond_fraction, 0.0_r_def ), & diff --git a/interfaces/jules_interface/source/algorithm/process_inputs_alg_mod.x90 b/interfaces/jules_interface/source/algorithm/process_inputs_alg_mod.x90 index 3c14f2e81..81f89675f 100644 --- a/interfaces/jules_interface/source/algorithm/process_inputs_alg_mod.x90 +++ b/interfaces/jules_interface/source/algorithm/process_inputs_alg_mod.x90 @@ -15,7 +15,10 @@ module process_inputs_alg_mod use initialization_config_mod, only: sst_source, sst_source_start_dump, & init_option, init_option_fd_start_dump, & - snow_source, snow_source_surf + snow_source, snow_source_surf, & + sea_ice_source, & + sea_ice_source_start_dump, & + sea_ice_source_surf use io_config_mod, only: checkpoint_read use section_choice_config_mod, only: surface, surface_jules, & radiation, radiation_socrates @@ -26,6 +29,8 @@ module process_inputs_alg_mod use process_ssi_kernel_mod, only: process_ssi_kernel_type use process_soil_kernel_mod, only: process_soil_kernel_type use process_snow_kernel_mod, only: process_snow_kernel_type + use initial_ice_conductivity_kernel_mod, & + only: initial_ice_conductivity_kernel_type use jules_snow_mod, only: nsmax use jules_control_init_mod, only: n_land_tile, & first_sea_tile, n_sea_tile, & @@ -37,6 +42,8 @@ module process_inputs_alg_mod use set_topography_kernel_mod, only: set_topography_kernel_type use sci_geometric_constants_mod, & only: get_latitude_fv + use log_mod, only : log_event, log_scratch_space, & + LOG_LEVEL_ERROR implicit none @@ -70,6 +77,7 @@ contains type( field_type ), pointer :: land_tile_fraction => null() type( field_type ), pointer :: sea_ice_fraction => null() type( field_type ), pointer :: sea_ice_thickness => null() + type( field_type ), pointer :: sea_ice_conductivity => null() type( field_type ), pointer :: tile_fraction => null() type( field_type ), pointer :: tstar_sea => null() @@ -126,11 +134,19 @@ contains integer( i_def ) :: n_horizon_angle, n_horizon_layer + if (checkpoint_read) then + ! This algorithm should only be called on a new run + ! i.e. checkpoint_read==.false.) + ! Add a check here in case anyone adds code that breaks this + write(log_scratch_space,'(A)') & + 'process_input_args: should not be called if checkpoint_read==.true.' + call log_event(log_scratch_space, LOG_LEVEL_ERROR) + end if + if (surface == surface_jules) then ! Only needed on cold start from UM - if (init_option == init_option_fd_start_dump .and. & - .not. checkpoint_read) then + if (init_option == init_option_fd_start_dump) then call ancil_fields%get_field('land_area_fraction', land_area_fraction) call ancil_fields%get_field('land_tile_fraction', land_tile_fraction) call fd_fields%get_field('land_tile_temp', land_tile_temp) @@ -139,10 +155,11 @@ contains call surface_fields%get_field('canopy_water', canopy_water) end if - ! For coupled models the sea ice fraction comes from the input - ! dump but for atmosphere only models they are provided by an - ! ancillary file - if (l_couple_sea_ice) then + ! For coupled models the sea ice fraction usually comes from the input + ! dump. + ! For atmosphere only models or coupled models with inland lakes it is + ! provided by an ancillary file + if (sea_ice_source == sea_ice_source_start_dump) then call fd_fields%get_field('sea_ice_fraction', sea_ice_fraction) else call ancil_fields%get_field('sea_ice_fraction', sea_ice_fraction) @@ -157,8 +174,7 @@ contains end if call surface_fields%get_field('tile_temperature', tile_temperature) - if (init_option == init_option_fd_start_dump .and. & - .not. checkpoint_read) then + if (init_option == init_option_fd_start_dump) then call soil_fields%get_field('soil_moist_sat', soil_moist_sat) call soil_fields%get_field('soil_moist_wilt', soil_moist_wilt) call soil_fields%get_field('mean_topog_index', mean_topog_index) @@ -176,8 +192,8 @@ contains call soil_fields%get_field('frozen_soil_moisture', frozen_soil_moisture) end if - if ( (init_option == init_option_fd_start_dump .and. & - .not. checkpoint_read) .or. (snow_source == snow_source_surf)) then + if ( (init_option == init_option_fd_start_dump) .or. & + (snow_source == snow_source_surf)) then ! need to add .or. use_surf_analysis here call snow_fields%get_field('tile_snow_mass', tile_snow_mass) call snow_fields%get_field('tile_snow_rgrain', tile_snow_rgrain) @@ -213,8 +229,7 @@ contains latitude => get_latitude_fv( W3, twod_mesh%get_id() ) ! Surface fields - if (init_option == init_option_fd_start_dump .and. & - .not. checkpoint_read) then + if (init_option == init_option_fd_start_dump) then ! These only need processing when cold-starting from the UM call invoke(process_land_kernel_type( land_area_fraction, & land_tile_fraction, & @@ -235,9 +250,20 @@ contains multi_insert_kernel_type(tile_temperature, tstar_sea, & first_sea_tile, n_sea_tile )) + ! In a coupled model with inland lakes we need to initialise the sea-ice + ! conductivity. This will be overwritten by values from SI3 except at + ! lake points. + if ((sea_ice_source == sea_ice_source_surf ) .and. & + (l_couple_sea_ice)) then + call surface_fields%get_field('sea_ice_conductivity', & + sea_ice_conductivity) + call invoke(initial_ice_conductivity_kernel_type(sea_ice_fraction, & + sea_ice_thickness, & + sea_ice_conductivity)) + endif + ! Soil fields - if (init_option == init_option_fd_start_dump .and. & - .not. checkpoint_read) then + if (init_option == init_option_fd_start_dump) then ! These only need processing when cold-starting from the UM call invoke(process_soil_kernel_type( soil_moist_sat, & soil_moist_wilt, & @@ -256,8 +282,8 @@ contains end if ! Snow fields - if ((init_option == init_option_fd_start_dump .and. & - .not. checkpoint_read) .or. snow_source == snow_source_surf) then + if ((init_option == init_option_fd_start_dump) .or. & + (snow_source == snow_source_surf)) then ! These only need processing when cold-starting from the UM call invoke(multi_insert_kernel_type(tile_snow_mass, tile_snow_mass_in,& 1, n_land_tile), & @@ -284,8 +310,7 @@ contains if (radiation == radiation_socrates .and. & topography /= topography_flat .and. & - init_option == init_option_fd_start_dump .and. & - .not. checkpoint_read) then + init_option == init_option_fd_start_dump) then call ancil_fields%get_field('grad_x_orog', grad_x_orog) call ancil_fields%get_field('grad_y_orog', grad_y_orog) diff --git a/interfaces/jules_interface/source/kernel/initial_ice_conductivity_kernel_mod.F90 b/interfaces/jules_interface/source/kernel/initial_ice_conductivity_kernel_mod.F90 new file mode 100644 index 000000000..6fd780e6a --- /dev/null +++ b/interfaces/jules_interface/source/kernel/initial_ice_conductivity_kernel_mod.F90 @@ -0,0 +1,73 @@ +!------------------------------------------------------------------------------- +! (c) Crown copyright 2020 Met Office. All rights reserved. +! The file LICENCE, distributed with this code, contains details of the terms +! under which the code may be used. +!------------------------------------------------------------------------------- +!> @brief Initialise Jules surface fields on tiles +!> @details Non-standard Surface fields (pseudo-levels) aren't as yet not +!> implemented in LFRic. As an interim measure Higher-order W3 fields have +!> been used to mimic psuedo-level field behaviour. This code is written +!> based on this interim measure and will need to be updated when +!> suitable infrastructure is available (Ticket #2081) +module initial_ice_conductivity_kernel_mod + use argument_mod, only: arg_type, & + GH_FIELD, GH_REAL, GH_INTEGER, & + GH_WRITE, CELL_COLUMN, & + ANY_DISCONTINUOUS_SPACE_1, & + ANY_DISCONTINUOUS_SPACE_2 + use constants_mod, only: r_def, i_def + use kernel_mod, only: kernel_type + use jules_control_init_mod, only: n_sea_ice_tile, first_sea_ice_tile + use jules_sea_seaice_config_mod, only: therm_cond_sice => kappai + implicit none + private + !> Kernel metadata for Psyclone + type, public, extends(kernel_type) :: initial_ice_conductivity_kernel_type + private + type(arg_type) :: meta_args(3) = (/ & + arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_1), & + arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_1), & + arg_type(GH_FIELD, GH_REAL, GH_WRITE, ANY_DISCONTINUOUS_SPACE_1) & + /) + integer :: operates_on = CELL_COLUMN + contains + procedure, nopass :: initial_ice_conductivity_code + end type initial_ice_conductivity_kernel_type + public :: initial_ice_conductivity_code +contains + !> @param[in] nlayers The number of layers + !> @param[in,out] sea_ice_fraction Sea Ice Fractions on categories + !> @param[in,out] sea_ice_thickness Sea Ice Thickness on categories + !> @param[in,out] sea_ice_conductivity Sea Ice Conductivity on categories + !> @param[in] ndf_ice Number of DOFs per cell for tiles + !> @param[in] undf_ice Number of total DOFs for tiles + !> @param[in] map_ice Dofmap for cell for surface tiles + subroutine initial_ice_conductivity_code(nlayers, & + sea_ice_fraction, & + sea_ice_thickness, & + sea_ice_conductivity, & + ndf_ice, undf_ice, map_ice) + implicit none + ! Arguments + integer(kind=i_def), intent(in) :: nlayers + integer(kind=i_def), intent(in) :: ndf_ice, undf_ice + integer(kind=i_def), intent(in) :: map_ice(ndf_ice) + real(kind=r_def), intent(inout) :: sea_ice_fraction(undf_ice) + real(kind=r_def), intent(inout) :: sea_ice_thickness(undf_ice) + real(kind=r_def), intent(inout) :: sea_ice_conductivity(undf_ice) + ! Internal variables + integer(kind=i_def) :: i + real(kind=r_def) :: min_ice_thick, max_ice_cond + !Taken from UM recon value + max_ice_cond = 25.0_r_def + min_ice_thick = 8.0_r_def * therm_cond_sice/max_ice_cond + do i=0,n_sea_ice_tile-1 + if (sea_ice_thickness(map_ice(1)+i) >= min_ice_thick) then + sea_ice_conductivity(map_ice(1)+i) = (8.0_r_def * therm_cond_sice) & + / sea_ice_thickness(map_ice(1)+i) + else + sea_ice_conductivity(map_ice(1)+i) = max_ice_cond + endif + end do + end subroutine initial_ice_conductivity_code +end module initial_ice_conductivity_kernel_mod diff --git a/interfaces/jules_interface/source/support/jules_physics_init_mod.f90 b/interfaces/jules_interface/source/support/jules_physics_init_mod.f90 index 7b4153e1f..6fd0481bc 100644 --- a/interfaces/jules_interface/source/support/jules_physics_init_mod.f90 +++ b/interfaces/jules_interface/source/support/jules_physics_init_mod.f90 @@ -331,6 +331,9 @@ subroutine jules_physics_init() ! l_ctile is implicitly true by design of LFRic and should not be changed l_ctile = .true. l_iceformdrag_lupkes = l_iceformdrag_lupkes_in + ! l_saldep_freeze should always be set to false as it no longer affects + ! the coupled model except at lake points (which aren't coupled). + l_saldep_freeze = .false. l_stability_lupkes = l_stability_lupkes_in l_sice_heatflux = l_sice_heatflux_in ! Code has not been included to support this being false as configurations @@ -352,7 +355,6 @@ subroutine jules_physics_init() l_sice_meltponds_cice = .true. l_tstar_sice_new = .false. l_cice_alb = .true. - l_saldep_freeze = .true. l_sice_multilayers = .true. l_sice_scattering = .true. l_ssice_albedo = .true. @@ -364,7 +366,6 @@ subroutine jules_physics_init() l_sice_meltponds_cice = .false. l_tstar_sice_new = .true. l_cice_alb = .false. - l_saldep_freeze = .false. l_sice_multilayers = .false. l_sice_scattering = .false. l_ssice_albedo = .false. diff --git a/rose-stem/app/lfric_atm/file/file_def_ancil_surf.xml b/rose-stem/app/lfric_atm/file/file_def_ancil_surf.xml index ef4833322..7553e3709 100644 --- a/rose-stem/app/lfric_atm/file/file_def_ancil_surf.xml +++ b/rose-stem/app/lfric_atm/file/file_def_ancil_surf.xml @@ -8,8 +8,8 @@ - - + + diff --git a/rose-stem/app/lfric_atm/opt/rose-app-da.conf b/rose-stem/app/lfric_atm/opt/rose-app-da.conf index cc0635967..e304c0987 100644 --- a/rose-stem/app/lfric_atm/opt/rose-app-da.conf +++ b/rose-stem/app/lfric_atm/opt/rose-app-da.conf @@ -3,7 +3,7 @@ source=$ROSE_SUITE_DIR/app/lfric_atm/file/iodef_gal_nwp_cycling.xml [namelist:files] iau_path='$BIG_DATA_DIR/start_dumps/basic-gal/yak/20210324T0600Z_um2lfric_iau_000001' -sea_ice_ancil_path='$BIG_DATA_DIR/start_dumps/basic-gal/yak/seaice_ugrid_postqa_fixed' +sea_ice_ancil_path='/data/users/tim.graham/LFRIC_SEA_ICE_ANCIL/seaice_ugrid_postqa_fixed' snow_analysis_ancil_path='$BIG_DATA_DIR/start_dumps/basic-gal/yak/20210324T0600Z_glu_snow_um2lfric_fixed' sst_ancil_path='$BIG_DATA_DIR/start_dumps/basic-gal/yak/sst_ugrid_postqa_fixed' start_dump_directory='$BIG_DATA_DIR/start_dumps/basic-gal/yak/Ticket354' diff --git a/rose-stem/app/lfric_atm/opt/rose-app-eda.conf b/rose-stem/app/lfric_atm/opt/rose-app-eda.conf index 0921925c3..ad3a5947e 100644 --- a/rose-stem/app/lfric_atm/opt/rose-app-eda.conf +++ b/rose-stem/app/lfric_atm/opt/rose-app-eda.conf @@ -8,7 +8,7 @@ iau_path='$BIG_DATA_DIR/start_dumps/basic-gal/yak/20210324T0600Z_um2lfric_iau_00 iau_pert_path='$BIG_DATA_DIR/IAU/Global/iau_pertinc_start' iau_sst_path='$BIG_DATA_DIR/IAU/Global/um2lfric_sstpert' iau_surf_path='$BIG_DATA_DIR/IAU/Global/um2lfric_landda' -sea_ice_ancil_path='$BIG_DATA_DIR/start_dumps/basic-gal/yak/seaice_ugrid_postqa_fixed' +sea_ice_ancil_path='/data/users/tim.graham/LFRIC_SEA_ICE_ANCIL/seaice_ugrid_postqa_fixed' snow_analysis_ancil_path='$BIG_DATA_DIR/start_dumps/basic-gal/yak/20210324T0600Z_glu_snow_um2lfric_fixed' sst_ancil_path='$BIG_DATA_DIR/start_dumps/basic-gal/yak/sst_ugrid_postqa_fixed' start_dump_directory='$BIG_DATA_DIR/start_dumps/basic-gal/yak/Ticket354' diff --git a/rose-stem/app/lfric_coupled_atmosphere/rose-app.conf b/rose-stem/app/lfric_coupled_atmosphere/rose-app.conf index ce50c6fa3..bfd59014d 100644 --- a/rose-stem/app/lfric_coupled_atmosphere/rose-app.conf +++ b/rose-stem/app/lfric_coupled_atmosphere/rose-app.conf @@ -575,7 +575,7 @@ ls_option='none' model_eos_height=100 n_orog_smooth=0 read_w2h_wind=.false. -sea_ice_source='ancillary' +sea_ice_source='start_dump' snow_source='start_dump' sst_source='ancillary' w0_orography_mapping=.false. diff --git a/science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf b/science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf index 15f3d9684..47cca48e3 100644 --- a/science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf +++ b/science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf @@ -3231,7 +3231,7 @@ help=The sea ice fraction (and thickness if amip_ice_thick is false) can either =The iodef file must be consistent with this setting, specifying = seaice from either a static ancillary file or a SURF-derived ancillary file. sort-key=01a -values='ancillary', 'surf' +values='ancillary','start_dump','surf' [namelist:initialization=snow_source] compulsory=true diff --git a/science/gungho/source/driver/create_fd_prognostics_mod.f90 b/science/gungho/source/driver/create_fd_prognostics_mod.f90 index a6cb31880..10634b35a 100644 --- a/science/gungho/source/driver/create_fd_prognostics_mod.f90 +++ b/science/gungho/source/driver/create_fd_prognostics_mod.f90 @@ -29,7 +29,9 @@ module create_fd_prognostics_mod ancil_option_updating, & read_w2h_wind, & sst_source, & - sst_source_start_dump + sst_source_start_dump, & + sea_ice_source, & + sea_ice_source_start_dump use nlsizes_namelist_mod, only : sm_levels use jules_control_init_mod, only : n_land_tile, n_sea_ice_tile use jules_physics_init_mod, only : snow_lev_tile @@ -261,7 +263,7 @@ subroutine create_fd_prognostics( mesh, twod_mesh, fd_field_collection, & ! For coupled models get the sea ice fraction and thickness from the ! dump - if (l_couple_sea_ice) then + if (l_couple_sea_ice .and. (sea_ice_source == sea_ice_source_start_dump)) then call setup_ancil_field("sea_ice_fraction", depository, & fd_field_collection, mesh, twod_mesh, & twod=.true., ndata=n_sea_ice_tile) diff --git a/science/gungho/source/driver/gungho_init_fields_mod.X90 b/science/gungho/source/driver/gungho_init_fields_mod.X90 index db9e0d3db..7baa8bd08 100644 --- a/science/gungho/source/driver/gungho_init_fields_mod.X90 +++ b/science/gungho/source/driver/gungho_init_fields_mod.X90 @@ -917,11 +917,11 @@ subroutine create_model_data( modeldb, & call depository%remove_field("grad_y_orog") end if if (ancil_option == ancil_option_fixed) then - if (sst_source /= sst_source_start_dump) then - call ancil_fields%remove_field("tstar_sea") - call depository%remove_field("tstar_sea") - end if if (.not. l_esm_couple) then + if (sst_source /= sst_source_start_dump) then + call ancil_fields%remove_field("tstar_sea") + call depository%remove_field("tstar_sea") + end if call ancil_fields%remove_field("sea_ice_fraction") call depository%remove_field("sea_ice_fraction") end if diff --git a/science/gungho/source/driver/gungho_setup_io_mod.F90 b/science/gungho/source/driver/gungho_setup_io_mod.F90 index c169f4323..0ca0c2c16 100644 --- a/science/gungho/source/driver/gungho_setup_io_mod.F90 +++ b/science/gungho/source/driver/gungho_setup_io_mod.F90 @@ -116,6 +116,8 @@ module gungho_setup_io_mod ls_option_file, & sst_source, & sst_source_start_dump, & + sea_ice_source, & + sea_ice_source_start_dump, & coarse_aerosol_ancil, & coarse_orography_ancil, & coarse_ozone_ancil, & @@ -358,6 +360,7 @@ subroutine init_gungho_files( files_list, modeldb ) end if ! Set sea surface temperature ancil filename from namelist + ! This can still be needed for coupled models for inland lakes if (sst_source /= sst_source_start_dump) then if (sst_ancil_path(1:1) == '/') then write(ancil_fname,'(A)') trim(sst_ancil_path) @@ -371,7 +374,8 @@ subroutine init_gungho_files( files_list, modeldb ) end if ! Set sea ice ancil filename from namelist - if (.not. l_couple_sea_ice) then + ! This can still be needed for coupled models for inland lakes + if (sea_ice_source /= sea_ice_source_start_dump) then if (sea_ice_ancil_path(1:1) == '/') then write(ancil_fname,'(A)') trim(sea_ice_ancil_path) else diff --git a/science/gungho/source/driver/init_ancils_mod.f90 b/science/gungho/source/driver/init_ancils_mod.f90 index 9d0eb0487..bff44337e 100644 --- a/science/gungho/source/driver/init_ancils_mod.f90 +++ b/science/gungho/source/driver/init_ancils_mod.f90 @@ -26,7 +26,7 @@ module init_ancils_mod use fs_continuity_mod, only : W3, WTheta use pure_abstract_field_mod, only : pure_abstract_field_type use lfric_xios_time_axis_mod, only : time_axis_type - use jules_control_init_mod, only : n_land_tile + use jules_control_init_mod, only : n_land_tile, n_sea_ice_tile use jules_physics_init_mod, only : snow_lev_tile use jules_surface_types_mod, only : npft use dust_parameters_mod, only : ndiv @@ -40,7 +40,8 @@ module init_ancils_mod init_option_fd_start_dump, & snow_source, & snow_source_surf, & - sea_ice_source, & + sea_ice_source, & + sea_ice_source_start_dump, & sea_ice_source_surf use aerosol_config_mod, only : glomap_mode, & glomap_mode_climatology, & @@ -239,7 +240,7 @@ subroutine create_fd_ancils( depository, ancil_fields, mesh, & end if !===== SEA ICE ANCILS ===== - if (.not. l_couple_sea_ice) then + if (sea_ice_source /= sea_ice_source_start_dump) then if (sea_ice_source == sea_ice_source_surf) then call sea_ice_time_axis%initialise("sea_ice_time", file_id="sea_ice_ancil", & interp_flag=.false., pop_freq="daily", & @@ -250,10 +251,12 @@ subroutine create_fd_ancils( depository, ancil_fields, mesh, & end if if (.not. amip_ice_thick) then call setup_ancil_field("sea_ice_thickness", depository, ancil_fields, & - mesh, twod_mesh, twod=.true., time_axis=sea_ice_time_axis) + mesh, twod_mesh, twod=.true., ndata=n_sea_ice_tile, & + time_axis=sea_ice_time_axis) end if call setup_ancil_field("sea_ice_fraction", depository, ancil_fields, & - mesh, twod_mesh, twod=.true., time_axis=sea_ice_time_axis) + mesh, twod_mesh, twod=.true., ndata=n_sea_ice_tile, & + time_axis=sea_ice_time_axis) call ancil_times_list%insert_item(sea_ice_time_axis) endif