From 438c54da661ddd083a46896090fefd94c923a2bd Mon Sep 17 00:00:00 2001 From: Ricky Wong <141156427+mo-rickywong@users.noreply.github.com> Date: Mon, 26 Jan 2026 11:43:27 +0000 Subject: [PATCH 1/4] Only changes that allow Apps to work with the purge of intermediate namelist api from core --- .../adjoint_tests/source/adjoint_tests.f90 | 8 +- .../gravity_wave_infrastructure_mod.f90 | 10 +- .../gravity_wave/source/gravity_wave.f90 | 7 +- .../gungho_model/source/gungho_model.f90 | 8 +- .../algorithm/algorithm_test.f90 | 11 +- .../jedi-interface/jedi_geometry_mod.f90 | 7 +- .../source/jedi-interface/jedi_run_mod.f90 | 25 +- .../jedi_lfric_tests/source/jedi_forecast.f90 | 5 +- .../source/jedi_forecast_pseudo.f90 | 6 +- .../source/jedi_id_tlm_tests.f90 | 6 +- .../source/jedi_lfric_tests.f90 | 9 +- .../source/jedi_tlm_forecast_tl.f90 | 6 +- .../source/jedi_tlm_tests.f90 | 5 +- applications/jules/source/jules.f90 | 9 +- .../lfric2lfric_infrastructure_mod.X90 | 2 +- .../initialisation/lfric2lfric_init_mesh.f90 | 42 +- .../lfric2lfric/source/lfric2lfric.F90 | 7 +- applications/lfric_atm/source/lfric_atm.f90 | 6 +- .../lfric_coupled/source/lfric_coupled.f90 | 8 +- .../common/lfricinp_lfric_driver_mod.f90 | 20 +- .../linear_model/source/linear_model.f90 | 7 +- .../driver/name_transport_driver_mod.f90 | 10 +- .../name_transport/source/name_transport.f90 | 9 +- applications/ngarch/source/ngarch.f90 | 12 +- .../source/driver/shallow_water_model_mod.F90 | 3 +- .../shallow_water/source/shallow_water.f90 | 8 +- applications/solver/source/solver.F90 | 11 +- .../source/driver/transport_driver_mod.f90 | 2 +- applications/transport/source/transport.f90 | 12 +- dependencies.yaml | 4 +- .../time/jedi_lfric_time_test.f90 | 12 +- .../jedi_lfric_linear_modeldb_driver_mod.f90 | 6 +- .../nl/jedi_lfric_nl_modeldb_driver_mod.f90 | 7 +- .../source/mesh/jedi_lfric_mesh_setup_mod.F90 | 7 +- .../integration-test/cma_test/cma_test.f90 | 14 +- .../gungho/source/driver/gungho_model_mod.F90 | 3 +- .../runge_kutta/runge_kutta.f90 | 7 +- .../semi_implicit/semi_implicit.f90 | 7 +- .../source/utils/check_config_api_mod.f90 | 393 ++++++++++++++++++ 39 files changed, 665 insertions(+), 76 deletions(-) create mode 100644 science/shared/source/utils/check_config_api_mod.f90 diff --git a/applications/adjoint_tests/source/adjoint_tests.f90 b/applications/adjoint_tests/source/adjoint_tests.f90 index 5fa5b2232..6b507c26c 100644 --- a/applications/adjoint_tests/source/adjoint_tests.f90 +++ b/applications/adjoint_tests/source/adjoint_tests.f90 @@ -10,6 +10,7 @@ program adjoint_tests + use check_config_api_mod, only : check_config_api 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 @@ -38,6 +39,7 @@ program adjoint_tests modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, table_len=10 ) + call modeldb%config%initialise( application_name ) call modeldb%values%initialise('values', 5) @@ -59,8 +61,12 @@ program adjoint_tests call init_comm( application_name, modeldb ) call init_config( filename, gungho_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) call init_logger( modeldb%mpi%get_comm(), application_name ) + + call check_config_api( modeldb%configuration, modeldb%config ) + call init_collections() call init_time( modeldb ) deallocate( filename ) diff --git a/applications/gravity_wave/source/driver/gravity_wave_infrastructure_mod.f90 b/applications/gravity_wave/source/driver/gravity_wave_infrastructure_mod.f90 index 46b88ddad..5ecef8fd2 100644 --- a/applications/gravity_wave/source/driver/gravity_wave_infrastructure_mod.f90 +++ b/applications/gravity_wave/source/driver/gravity_wave_infrastructure_mod.f90 @@ -197,11 +197,11 @@ subroutine initialise_infrastructure( program_name, & apply_partition_check = .true. end if - call init_mesh( modeldb%configuration, & - modeldb%mpi%get_comm_rank(), & - modeldb%mpi%get_comm_size(), & - base_mesh_names, & - extrusion, stencil_depth, & + call init_mesh( modeldb%config, & + modeldb%mpi%get_comm_rank(), & + modeldb%mpi%get_comm_size(), & + base_mesh_names, & + extrusion, stencil_depth, & apply_partition_check ) allocate( twod_names, source=base_mesh_names ) diff --git a/applications/gravity_wave/source/gravity_wave.f90 b/applications/gravity_wave/source/gravity_wave.f90 index e1a988dd0..1492a7b68 100644 --- a/applications/gravity_wave/source/gravity_wave.f90 +++ b/applications/gravity_wave/source/gravity_wave.f90 @@ -11,6 +11,7 @@ program gravity_wave + use check_config_api_mod, only: check_config_api use cli_mod, only: parse_command_line use driver_modeldb_mod, only: modeldb_type use driver_collections_mod, only: init_collections, final_collections @@ -35,11 +36,15 @@ program gravity_wave call parse_command_line( filename ) call modeldb%configuration%initialise( program_name, table_len=10 ) + call modeldb%config%initialise( program_name ) modeldb%mpi => global_mpi call init_comm( program_name, modeldb ) call init_config( filename, gravity_wave_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) + call check_config_api( modeldb%configuration, modeldb%config ) + deallocate( filename ) call init_logger( modeldb%mpi%get_comm(), program_name ) diff --git a/applications/gungho_model/source/gungho_model.f90 b/applications/gungho_model/source/gungho_model.f90 index da2050f69..6d9d5bdc5 100644 --- a/applications/gungho_model/source/gungho_model.f90 +++ b/applications/gungho_model/source/gungho_model.f90 @@ -15,6 +15,7 @@ program gungho_model + use check_config_api_mod, only: check_config_api use cli_mod, only: parse_command_line use derived_config_mod, only: l_esm_couple use driver_collections_mod, only: init_collections, final_collections @@ -47,6 +48,7 @@ program gungho_model call modeldb%configuration%initialise( application_name, & table_len=10 ) + call modeldb%config%initialise( application_name ) call modeldb%values%initialise( 'values', 5 ) ! Create the depository, prognostics and diagnostics field collections @@ -70,8 +72,12 @@ program gungho_model call init_comm( application_name, modeldb ) call init_config( filename, gungho_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) call init_logger( modeldb%mpi%get_comm(), application_name ) + + call check_config_api( modeldb%configuration, modeldb%config ) + call init_timers( application_name ) call init_collections() call init_time( modeldb ) diff --git a/applications/jedi_lfric_tests/integration-test/algorithm/algorithm_test.f90 b/applications/jedi_lfric_tests/integration-test/algorithm/algorithm_test.f90 index 9748e3f94..093539b9b 100644 --- a/applications/jedi_lfric_tests/integration-test/algorithm/algorithm_test.f90 +++ b/applications/jedi_lfric_tests/integration-test/algorithm/algorithm_test.f90 @@ -13,8 +13,10 @@ program algorithm_test use add_mesh_map_mod, only: assign_mesh_maps + use check_config_api_mod, only: check_config_api use configuration_mod, only: final_configuration, & read_configuration + use config_mod, only: config_type use constants_mod, only: i_def, r_def, str_def, l_def use create_mesh_mod, only: create_extrusion, create_mesh use test_algorithm_mod, only: test_algorithm_finalise, & @@ -52,6 +54,7 @@ program algorithm_test character(:), allocatable :: filename type(namelist_collection_type), save :: configuration + type(config_type), save :: config ! Variables used for parsing command line arguments integer :: length, status, nargs @@ -145,7 +148,11 @@ program algorithm_test ! Setup configuration, mesh, and fem call configuration%initialise( program_name, table_len=10 ) - call read_configuration( filename, configuration ) + call config%initialise( program_name ) + call read_configuration( filename, & + configuration=configuration, & + config=config ) + call check_config_api( configuration, config ) call init_collections() @@ -199,7 +206,7 @@ program algorithm_test !------------------------------------------------------------------------- stencil_depth = 1 apply_partition_check = .false. - call init_mesh( configuration, & + call init_mesh( config, & local_rank, total_ranks, & base_mesh_names, extrusion, & stencil_depth, & diff --git a/applications/jedi_lfric_tests/source/jedi-interface/jedi_geometry_mod.f90 b/applications/jedi_lfric_tests/source/jedi-interface/jedi_geometry_mod.f90 index 4fd1b473b..5e5dc3761 100644 --- a/applications/jedi_lfric_tests/source/jedi-interface/jedi_geometry_mod.f90 +++ b/applications/jedi_lfric_tests/source/jedi-interface/jedi_geometry_mod.f90 @@ -14,6 +14,7 @@ module jedi_geometry_mod use, intrinsic :: iso_fortran_env, only : real64 use calendar_mod, only : calendar_type + use config_mod, only : config_type use constants_mod, only : i_def, l_def, str_def, & r_second, i_timestep use extrusion_mod, only : extrusion_type, TWOD @@ -92,9 +93,8 @@ module jedi_geometry_mod !> @brief Initialiser for jedi_geometry_type !> -subroutine initialise( self, mpi_comm, configuration ) +subroutine initialise( self, mpi_comm, configuration, config ) ! Access config directly until modeldb ready - use driver_mesh_mod, only: init_mesh use driver_config_mod, only: init_config use jedi_lfric_mesh_setup_mod, only: initialise_mesh use jedi_lfric_tests_mod, only: jedi_lfric_tests_required_namelists @@ -104,6 +104,7 @@ subroutine initialise( self, mpi_comm, configuration ) class( jedi_geometry_type ), intent(inout) :: self integer( kind=i_def ), intent(in) :: mpi_comm type(namelist_collection_type), intent(in) :: configuration + type(config_type), intent(in) :: config ! Local type(mesh_type), pointer :: mesh @@ -121,7 +122,7 @@ subroutine initialise( self, mpi_comm, configuration ) ! Setup mesh mpi_obj = self%get_mpi_comm() - call initialise_mesh( self%mesh_name, configuration, mpi_obj ) + call initialise_mesh( self%mesh_name, configuration, config, mpi_obj ) geometry_configuration => configuration%get_namelist('jedi_geometry') ! Setup the IO diff --git a/applications/jedi_lfric_tests/source/jedi-interface/jedi_run_mod.f90 b/applications/jedi_lfric_tests/source/jedi-interface/jedi_run_mod.f90 index 8e981a2e9..cf463dc68 100644 --- a/applications/jedi_lfric_tests/source/jedi-interface/jedi_run_mod.f90 +++ b/applications/jedi_lfric_tests/source/jedi-interface/jedi_run_mod.f90 @@ -10,6 +10,8 @@ ! module jedi_run_mod + use check_config_api_mod, only : check_config_api + use config_mod, only : config_type use constants_mod, only : i_def, l_def, str_def use namelist_collection_mod, only : namelist_collection_type @@ -21,6 +23,7 @@ module jedi_run_mod private character(str_def) :: jedi_run_name type(namelist_collection_type) :: configuration + type(config_type) :: config logical(kind=l_def) :: timers_finalised contains @@ -34,6 +37,9 @@ module jedi_run_mod !> Get a pointer to the stored configuration. procedure, public :: get_configuration + !> Get a pointer to the stored config + procedure, public :: get_config + !> Just finalise subroutine timing; to get useful timing statistics from failed adjoint tests procedure, public :: finalise_timers @@ -104,18 +110,22 @@ subroutine initialise_infrastructure( self, filename, model_communicator ) ! Initialise the configuration call self%configuration%initialise( self%jedi_run_name, table_len=10 ) + call self%config%initialise( self%jedi_run_name ) ! Initialise the model communicator to setup global_mpi call init_internal_comm( model_communicator ) ! Setup the config which is curently global call init_config( filename, jedi_lfric_tests_required_namelists, & - self%configuration ) + configuration=self%configuration, & + config=self%config ) ! Initialise the logger call lfric_comm%set_comm_mpi_val(model_communicator) call init_logger( lfric_comm, self%jedi_run_name ) + call check_config_api( self%configuration, self%config ) + ! Initialise subroutine timers call init_timers( self%jedi_run_name ) self%timers_finalised = .false. @@ -137,6 +147,19 @@ function get_configuration(self) result(configuration) end function get_configuration +!> @brief Get pointer to the stored configuration +!> +!> @return config A pointer to the configuration +function get_config(self) result(config) + + class( jedi_run_type ), target, intent(inout) :: self + + type( config_type ), pointer :: config + + config => self%config + +end function get_config + !> @brief Just finalise subroutine timing; to get useful timing statistics from failed adjoint tests !> subroutine finalise_timers(self) diff --git a/applications/jedi_lfric_tests/source/jedi_forecast.f90 b/applications/jedi_lfric_tests/source/jedi_forecast.f90 index 00150b30d..fcf48de84 100644 --- a/applications/jedi_lfric_tests/source/jedi_forecast.f90 +++ b/applications/jedi_lfric_tests/source/jedi_forecast.f90 @@ -20,6 +20,7 @@ program jedi_forecast use cli_mod, only : parse_command_line + use config_mod, only : config_type 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, & @@ -47,6 +48,7 @@ program jedi_forecast ! Local type( namelist_collection_type ), pointer :: configuration + type( config_type ), pointer :: config character(:), allocatable :: filename integer( i_def ) :: model_communicator type( jedi_duration_type ) :: forecast_length @@ -76,6 +78,7 @@ program jedi_forecast ! Get the configuration configuration => jedi_run%get_configuration() + config => jedi_run%get_config() ! Get the forecast length jedi_lfric_settings_config => configuration%get_namelist('jedi_lfric_settings') @@ -83,7 +86,7 @@ program jedi_forecast call forecast_length%init(forecast_length_str) ! Create geometry - call jedi_geometry%initialise( model_communicator, configuration ) + call jedi_geometry%initialise( model_communicator, configuration, config ) ! Create state (requires the configuration file name to setup the modeldb) call jedi_state%initialise( jedi_geometry, configuration, filename ) diff --git a/applications/jedi_lfric_tests/source/jedi_forecast_pseudo.f90 b/applications/jedi_lfric_tests/source/jedi_forecast_pseudo.f90 index cec71e9d4..eb30c92c3 100644 --- a/applications/jedi_lfric_tests/source/jedi_forecast_pseudo.f90 +++ b/applications/jedi_lfric_tests/source/jedi_forecast_pseudo.f90 @@ -20,6 +20,7 @@ program jedi_forecast_pseudo use cli_mod, only : parse_command_line + use config_mod, only : config_type 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, & @@ -47,6 +48,8 @@ program jedi_forecast_pseudo ! Local type( namelist_collection_type ), pointer :: configuration + type( config_type ), pointer :: config + character(:), allocatable :: filename integer(i_def) :: model_communicator type( jedi_duration_type ) :: forecast_length @@ -75,6 +78,7 @@ program jedi_forecast_pseudo ! Get the configuration configuration => jedi_run%get_configuration() + config => jedi_run%get_config() ! Get the forecast length jedi_lfric_settings_config => configuration%get_namelist('jedi_lfric_settings') @@ -82,7 +86,7 @@ program jedi_forecast_pseudo call forecast_length%init(forecast_length_str) ! Create geometry - call jedi_geometry%initialise( model_communicator, configuration ) + call jedi_geometry%initialise( model_communicator, configuration, config ) ! Create state call jedi_state%initialise( jedi_geometry, configuration ) 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 ed8b0db66..adfa8a2b3 100644 --- a/applications/jedi_lfric_tests/source/jedi_id_tlm_tests.f90 +++ b/applications/jedi_lfric_tests/source/jedi_id_tlm_tests.f90 @@ -47,6 +47,7 @@ program jedi_id_tlm_tests use cli_mod, only : parse_command_line + use config_mod, only : config_type 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, & @@ -81,6 +82,8 @@ program jedi_id_tlm_tests ! Local type( namelist_collection_type ), pointer :: configuration + type( config_type ), pointer :: config + character(:), allocatable :: filename integer( kind=i_def ) :: model_communicator type( jedi_duration_type ) :: forecast_length @@ -115,6 +118,7 @@ program jedi_id_tlm_tests ! Get the configuration configuration => run%get_configuration() + config => run%get_config() ! Get the forecast length jedi_lfric_settings_config => configuration%get_namelist('jedi_lfric_settings') @@ -122,7 +126,7 @@ program jedi_id_tlm_tests call forecast_length%init(forecast_length_str) ! Create geometry - call geometry%initialise( model_communicator, configuration ) + call geometry%initialise( model_communicator, configuration, config ) ! Create state call state%initialise( geometry, configuration ) diff --git a/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 b/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 index 2937a18de..dd9a75c29 100644 --- a/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 +++ b/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 @@ -15,6 +15,7 @@ !> program jedi_lfric_tests + use check_config_api_mod, only : check_config_api 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 @@ -43,6 +44,7 @@ program jedi_lfric_tests modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, table_len=10 ) + call modeldb%config%initialise( application_name ) call modeldb%values%initialise('values', 5) @@ -64,8 +66,13 @@ program jedi_lfric_tests call init_comm( application_name, modeldb ) call init_config( filename, gungho_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) + call init_logger( modeldb%mpi%get_comm(), application_name ) + + call check_config_api( modeldb%configuration, modeldb%config ) + call init_timers( application_name ) call init_collections() call init_time( modeldb ) 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 b3c2aa004..728b3e04f 100644 --- a/applications/jedi_lfric_tests/source/jedi_tlm_forecast_tl.f90 +++ b/applications/jedi_lfric_tests/source/jedi_tlm_forecast_tl.f90 @@ -22,6 +22,7 @@ program jedi_tlm_forecast_tl use cli_mod, only : parse_command_line + use config_mod, only : config_type 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, & @@ -53,6 +54,8 @@ program jedi_tlm_forecast_tl ! Local type( namelist_collection_type ), pointer :: configuration + type( config_type ), pointer :: config + character(:), allocatable :: filename integer( kind=i_def ) :: model_communicator type( jedi_duration_type ) :: forecast_length @@ -81,6 +84,7 @@ program jedi_tlm_forecast_tl ! Get the configuration configuration => jedi_run%get_configuration() + config => jedi_run%get_config() ! Get the forecast length jedi_lfric_settings_config => configuration%get_namelist('jedi_lfric_settings') @@ -88,7 +92,7 @@ program jedi_tlm_forecast_tl call forecast_length%init(forecast_length_str) ! Create geometry - call jedi_geometry%initialise( model_communicator, configuration ) + call jedi_geometry%initialise( model_communicator, configuration, config ) ! Create state call jedi_state%initialise( jedi_geometry, configuration ) diff --git a/applications/jedi_lfric_tests/source/jedi_tlm_tests.f90 b/applications/jedi_lfric_tests/source/jedi_tlm_tests.f90 index da7f0342b..bfff68a72 100644 --- a/applications/jedi_lfric_tests/source/jedi_tlm_tests.f90 +++ b/applications/jedi_lfric_tests/source/jedi_tlm_tests.f90 @@ -35,6 +35,7 @@ program jedi_tlm_tests use cli_mod, only : parse_command_line + use config_mod, only : config_type 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, & @@ -67,6 +68,7 @@ program jedi_tlm_tests ! Local type( namelist_collection_type ), pointer :: configuration + type( config_type ), pointer :: config character(:), allocatable :: filename integer( kind=i_def ) :: model_communicator type( jedi_duration_type ) :: forecast_length @@ -101,6 +103,7 @@ program jedi_tlm_tests ! Get the configuration configuration => run%get_configuration() + config => run%get_config() ! Get the forecast length jedi_lfric_settings_config => configuration%get_namelist('jedi_lfric_settings') @@ -108,7 +111,7 @@ program jedi_tlm_tests call forecast_length%init(forecast_length_str) ! Create geometry - call geometry%initialise( model_communicator, configuration ) + call geometry%initialise( model_communicator, configuration, config ) ! Create state call state%initialise( geometry, configuration ) diff --git a/applications/jules/source/jules.f90 b/applications/jules/source/jules.f90 index 5b2ca853a..e772b358d 100644 --- a/applications/jules/source/jules.f90 +++ b/applications/jules/source/jules.f90 @@ -16,6 +16,7 @@ program jules + use check_config_api_mod, only: check_config_api 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 @@ -44,6 +45,7 @@ program jules call modeldb%configuration%initialise( application_name, & table_len=10 ) + call modeldb%config%initialise( application_name ) call modeldb%values%initialise( 'values', 5 ) ! Create the depository, prognostics and diagnostics field collections @@ -66,8 +68,13 @@ program jules call init_comm( application_name, modeldb ) call init_config( filename, gungho_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) + call init_logger( modeldb%mpi%get_comm(), application_name ) + + call check_config_api( modeldb%configuration, modeldb%config ) + call init_timers( application_name ) call init_collections() call init_time( modeldb ) diff --git a/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90 b/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90 index 108104c11..70f23cb84 100644 --- a/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90 +++ b/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90 @@ -316,7 +316,7 @@ contains ! Create the required meshes !----------------------------------------------------------------------- stencil_depth = get_required_stencil_depth() - call init_mesh( modeldb%configuration, & + call init_mesh( modeldb%config, modeldb%configuration, & modeldb%mpi%get_comm_rank(), & modeldb%mpi%get_comm_size(), & mesh_names, extrusion, & diff --git a/applications/lfric2lfric/source/initialisation/lfric2lfric_init_mesh.f90 b/applications/lfric2lfric/source/initialisation/lfric2lfric_init_mesh.f90 index f1134fce5..b2b544282 100644 --- a/applications/lfric2lfric/source/initialisation/lfric2lfric_init_mesh.f90 +++ b/applications/lfric2lfric/source/initialisation/lfric2lfric_init_mesh.f90 @@ -25,6 +25,7 @@ module lfric2lfric_init_mesh_mod use add_mesh_map_mod, only: assign_mesh_maps + use config_mod, only: config_type use constants_mod, only: i_def, l_def, str_max_filename use check_local_mesh_mod, only: check_local_mesh use create_mesh_mod, only: create_mesh @@ -81,17 +82,21 @@ module lfric2lfric_init_mesh_mod !> regridding method is 'map'. !> (unpartitioned mesh input only) !=============================================================================== -subroutine init_mesh( configuration, & +subroutine init_mesh( config, configuration, & local_rank, total_ranks, & mesh_names, & extrusion, & stencil_depth, & regrid_method ) + use partitioning_nml_iterator_mod, only: partitioning_nml_iterator_type + use partitioning_nml_mod, only: partitioning_nml_type + implicit none ! Arguments - type(namelist_collection_type) :: configuration + type(namelist_collection_type), intent(in) :: configuration + type(config_type), intent(in) :: config integer(kind=i_def), intent(in) :: local_rank integer(kind=i_def), intent(in) :: total_ranks @@ -108,8 +113,10 @@ subroutine init_mesh( configuration, & ! Namelist variables type(namelist_type), pointer :: lfric2lfric_nml => null() - type(namelist_type), pointer :: src_partitioning_nml => null() - type(namelist_type), pointer :: dst_partitioning_nml => null() + + type(partitioning_nml_type), pointer :: partitioning + type(partitioning_nml_type), pointer :: src_partitioning_nml + type(partitioning_nml_type), pointer :: dst_partitioning_nml ! partitioning namelist variables logical(l_def) :: generate_inner_halos(2) @@ -131,23 +138,28 @@ subroutine init_mesh( configuration, & class(panel_decomposition_type), allocatable :: decomposition_src, & decomposition_dst + type(partitioning_nml_iterator_type) :: iter !============================================================================ ! Extract and check configuration variables !============================================================================ - ! Read partitioning namelist for source and destination meshes - src_partitioning_nml => configuration%get_namelist('partitioning', & - 'source') - call src_partitioning_nml%get_value( 'generate_inner_halos', & - generate_inner_halos(src) ) + call iter%initialise(config%partitioning) + do while (iter%has_next()) + + partitioning => iter%next() + + if (trim(partitioning%get_profile_name()) == 'source') then + src_partitioning_nml => partitioning + else if (trim(partitioning%get_profile_name()) == 'destination') then + dst_partitioning_nml => partitioning + end if + end do - dst_partitioning_nml => configuration%get_namelist('partitioning', & - 'destination') - call dst_partitioning_nml%get_value( 'generate_inner_halos', & - generate_inner_halos(dst) ) + generate_inner_halos(src) = src_partitioning_nml%generate_inner_halos() + generate_inner_halos(dst) = dst_partitioning_nml%generate_inner_halos() ! Read lfric2lfric namelist - lfric2lfric_nml => configuration%get_namelist('lfric2lfric') + lfric2lfric_nml => configuration%get_namelist('lfric2lfric') call lfric2lfric_nml%get_value( 'prepartitioned_meshes', & prepartitioned ) @@ -231,7 +243,7 @@ subroutine init_mesh( configuration, & ! meshes are suitable for the supplied application ! configuration. !=========================================================== - call check_local_mesh( configuration, & + call check_local_mesh( config, & stencil_depth, & mesh_names ) diff --git a/applications/lfric2lfric/source/lfric2lfric.F90 b/applications/lfric2lfric/source/lfric2lfric.F90 index c40c5cc3d..8d119094c 100644 --- a/applications/lfric2lfric/source/lfric2lfric.F90 +++ b/applications/lfric2lfric/source/lfric2lfric.F90 @@ -15,6 +15,7 @@ program lfric2lfric use cli_mod, only: parse_command_line + use check_config_api_mod, only: check_config_api use constants_mod, only: precision_real use driver_collections_mod, only: init_collections, final_collections use driver_config_mod, only: init_config, final_config @@ -49,6 +50,7 @@ program lfric2lfric call parse_command_line( filename ) call modeldb%configuration%initialise( program_name, table_len=10 ) + call modeldb%config%initialise( program_name ) write(log_scratch_space,'(A)') & 'Application built with '// trim(precision_real) // & @@ -68,8 +70,11 @@ program lfric2lfric #endif call init_comm( program_name, modeldb ) call init_config( filename, lfric2lfric_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) + call init_logger( modeldb%mpi%get_comm(), program_name ) + call check_config_api( modeldb%configuration, modeldb%config ) call init_collections() call init_time( modeldb ) deallocate( filename ) diff --git a/applications/lfric_atm/source/lfric_atm.f90 b/applications/lfric_atm/source/lfric_atm.f90 index 8f314f64d..e20bb167f 100644 --- a/applications/lfric_atm/source/lfric_atm.f90 +++ b/applications/lfric_atm/source/lfric_atm.f90 @@ -16,6 +16,7 @@ program lfric_atm + use check_config_api_mod, only: check_config_api 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 @@ -49,6 +50,7 @@ program lfric_atm call modeldb%configuration%initialise( application_name, & table_len=10 ) + call modeldb%config%initialise( application_name ) call modeldb%values%initialise( 'values', 5 ) ! Create the depository, prognostics and diagnostics field collections @@ -72,8 +74,10 @@ program lfric_atm call init_comm( application_name, modeldb ) call init_config( filename, gungho_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) call init_logger( modeldb%mpi%get_comm(), application_name ) + call check_config_api( modeldb%configuration, modeldb%config ) call init_timers( application_name ) io_nml => modeldb%configuration%get_namelist('io') diff --git a/applications/lfric_coupled/source/lfric_coupled.f90 b/applications/lfric_coupled/source/lfric_coupled.f90 index 16b5d7375..5b050a8db 100644 --- a/applications/lfric_coupled/source/lfric_coupled.f90 +++ b/applications/lfric_coupled/source/lfric_coupled.f90 @@ -16,6 +16,7 @@ program lfric_coupled + use check_config_api_mod, only : check_config_api use cli_mod, only : parse_command_line use coupler_mod, only : set_cpl_name use driver_collections_mod, only : init_collections, final_collections @@ -43,7 +44,7 @@ program lfric_coupled modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, table_len=10 ) - + call modeldb%config%initialise( application_name ) call modeldb%values%initialise( 'values', 5 ) ! Create the depository, prognostics and diagnostics field collections @@ -67,8 +68,11 @@ program lfric_coupled call init_comm( application_name, modeldb ) call init_config( filename, gungho_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) + call init_logger( modeldb%mpi%get_comm(), application_name ) + call check_config_api( modeldb%configuration, modeldb%config ) call init_collections() call init_time( modeldb ) deallocate(filename) diff --git a/applications/lfricinputs/source/common/lfricinp_lfric_driver_mod.f90 b/applications/lfricinputs/source/common/lfricinp_lfric_driver_mod.f90 index a0630d7bf..24bd883a6 100644 --- a/applications/lfricinputs/source/common/lfricinp_lfric_driver_mod.f90 +++ b/applications/lfricinputs/source/common/lfricinp_lfric_driver_mod.f90 @@ -5,6 +5,7 @@ ! *****************************COPYRIGHT******************************* module lfricinp_lfric_driver_mod +use check_config_api_mod, only: check_config_api use constants_mod, only: i_def, r_def, l_def, r_second, str_def use log_mod, only: log_event, log_scratch_space, & LOG_LEVEL_INFO, LOG_LEVEL_ERROR, & @@ -12,6 +13,7 @@ module lfricinp_lfric_driver_mod ! LFRic Modules use add_mesh_map_mod, only: assign_mesh_maps +use config_mod, only: config_type use create_mesh_mod, only: create_mesh use driver_collections_mod, only: init_collections, final_collections use driver_mesh_mod, only: init_mesh @@ -117,6 +119,7 @@ subroutine lfricinp_initialise_lfric(program_name_arg, & type(namelist_collection_type), save :: configuration +type(config_type), save :: config type(namelist_type), pointer :: base_mesh_nml type(namelist_type), pointer :: planet_nml @@ -164,12 +167,17 @@ subroutine lfricinp_initialise_lfric(program_name_arg, & call initialise_halo_comms( comm ) call configuration%initialise( program_name_arg, table_len=10 ) +call config%initialise( program_name_arg ) + call load_configuration( lfric_nl_fname, required_lfric_namelists, & - configuration ) + configuration=configuration, & + config=config ) ! Initialise logging system call init_logger( comm, program_name ) +call check_config_api( configuration, config ) + call init_collections() write(log_scratch_space, '(2(A,I0))') 'total ranks = ', total_ranks, & @@ -234,7 +242,8 @@ subroutine lfricinp_initialise_lfric(program_name_arg, & !------------------------------------------------------------------------- stencil_depth = 2_i_def check_partitions = .false. -call init_mesh( configuration, & + +call init_mesh( config, & local_rank, total_ranks, & base_mesh_names, extrusion, & stencil_depth, check_partitions ) @@ -279,7 +288,7 @@ end subroutine lfricinp_initialise_lfric !------------------------------------------------------------------ subroutine load_configuration( lfric_nl, required_lfric_namelists, & - configuration ) + configuration, config ) ! Description: ! Reads lfric namelists and checks that all required namelists are present @@ -293,6 +302,7 @@ subroutine load_configuration( lfric_nl, required_lfric_namelists, & character(*), intent(in) :: required_lfric_namelists(:) type(namelist_collection_type), intent(INOUT) :: configuration +type(config_type), intent(INOUT) :: config logical :: okay logical, allocatable :: success_map(:) @@ -303,7 +313,9 @@ subroutine load_configuration( lfric_nl, required_lfric_namelists, & call log_event('Loading '//trim(program_name)//' configuration ...', & LOG_LEVEL_ALWAYS) -call read_configuration( lfric_nl, configuration ) +call read_configuration( lfric_nl, & + configuration=configuration, & + config=config ) okay = ensure_configuration(required_lfric_namelists, success_map) if (.not. okay) then diff --git a/applications/linear_model/source/linear_model.f90 b/applications/linear_model/source/linear_model.f90 index e58099d46..780c3715d 100644 --- a/applications/linear_model/source/linear_model.f90 +++ b/applications/linear_model/source/linear_model.f90 @@ -42,7 +42,7 @@ program linear_model modeldb%mpi => global_mpi call modeldb%configuration%initialise( application_name, table_len=10 ) - + call modeldb%config%initialise( application_name ) call modeldb%values%initialise('values', 5) ! Create the depository, prognostics and diagnostics field collections @@ -63,8 +63,11 @@ program linear_model call init_comm( application_name, modeldb ) call init_config( filename, gungho_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) + call init_logger( modeldb%mpi%get_comm(), application_name ) + call init_timers( application_name ) call init_collections() call init_time( modeldb ) diff --git a/applications/name_transport/source/driver/name_transport_driver_mod.f90 b/applications/name_transport/source/driver/name_transport_driver_mod.f90 index 94e8365c0..061dbc5e3 100644 --- a/applications/name_transport/source/driver/name_transport_driver_mod.f90 +++ b/applications/name_transport/source/driver/name_transport_driver_mod.f90 @@ -239,11 +239,11 @@ subroutine initialise_name_transport( program_name, modeldb ) stencil_depth = get_required_stencil_depth() apply_partition_check = .false. - call init_mesh( modeldb%configuration, & - modeldb%mpi%get_comm_rank(), & - modeldb%mpi%get_comm_size(), & - base_mesh_names, & - extrusion, stencil_depth, & + call init_mesh( modeldb%config, & + modeldb%mpi%get_comm_rank(), & + modeldb%mpi%get_comm_size(), & + base_mesh_names, & + extrusion, stencil_depth, & apply_partition_check ) call create_mesh( base_mesh_names, extrusion_2d, & diff --git a/applications/name_transport/source/name_transport.f90 b/applications/name_transport/source/name_transport.f90 index 7f8faab1d..4420440e7 100644 --- a/applications/name_transport/source/name_transport.f90 +++ b/applications/name_transport/source/name_transport.f90 @@ -9,6 +9,7 @@ program name_transport + use check_config_api_mod, only: check_config_api use cli_mod, only: parse_command_line use constants_mod, only: i_def, r_def use driver_collections_mod, only: init_collections, final_collections @@ -40,12 +41,18 @@ program name_transport call parse_command_line( filename ) call modeldb%configuration%initialise( program_name, table_len=10 ) + call modeldb%config%initialise( program_name ) + modeldb%mpi => global_mpi call init_comm( program_name, modeldb ) call init_config( filename, name_transport_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) + call init_logger( modeldb%mpi%get_comm(), program_name ) + call check_config_api( modeldb%configuration, modeldb%config ) + call log_event( 'Miniapp will run with default precision set as:', & log_level_info ) write(log_scratch_space, '(" r_def kind = ", I0)') kind(1.0_r_def) diff --git a/applications/ngarch/source/ngarch.f90 b/applications/ngarch/source/ngarch.f90 index 919eec564..68076a9a7 100644 --- a/applications/ngarch/source/ngarch.f90 +++ b/applications/ngarch/source/ngarch.f90 @@ -8,6 +8,7 @@ !> @details Runs a GungHo model with a custom step method program ngarch + use check_config_api_mod, only : check_config_api use cli_mod, only : parse_command_line use driver_collections_mod, only : init_collections, final_collections use constants_mod, only : precision_real @@ -35,6 +36,8 @@ program ngarch call parse_command_line( filename ) call modeldb%configuration%initialise( application_name, table_len=10 ) + call modeldb%config%initialise( application_name ) + call modeldb%values%initialise( 'values', 5 ) ! Create the field collections in modeldb @@ -58,9 +61,12 @@ program ngarch modeldb%mpi => global_mpi call init_comm( application_name, modeldb ) - call init_config( filename, & - ngarch_required_namelists, & - modeldb%configuration ) + call init_config( filename, & + ngarch_required_namelists, & + configuration=modeldb%configuration, & + config=modeldb%config ) + call check_config_api( modeldb%configuration, modeldb%config ) + deallocate( filename ) call init_logger( modeldb%mpi%get_comm(), application_name ) diff --git a/applications/shallow_water/source/driver/shallow_water_model_mod.F90 b/applications/shallow_water/source/driver/shallow_water_model_mod.F90 index f2706ce97..40ac6cf93 100644 --- a/applications/shallow_water/source/driver/shallow_water_model_mod.F90 +++ b/applications/shallow_water/source/driver/shallow_water_model_mod.F90 @@ -181,7 +181,8 @@ subroutine initialise_infrastructure( program_name, modeldb) ! --------------------------------------------------------- check_partitions = .false. stencil_depth = get_required_stencil_depth() - call init_mesh( modeldb%configuration, & + + call init_mesh( modeldb%config, & modeldb%mpi%get_comm_rank(), & modeldb%mpi%get_comm_size(), & base_mesh_names, extrusion, & diff --git a/applications/shallow_water/source/shallow_water.f90 b/applications/shallow_water/source/shallow_water.f90 index c74a664b5..b164c1b48 100644 --- a/applications/shallow_water/source/shallow_water.f90 +++ b/applications/shallow_water/source/shallow_water.f90 @@ -14,6 +14,7 @@ program shallow_water + use check_config_api_mod, only: check_config_api 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 @@ -45,6 +46,7 @@ program shallow_water modeldb%mpi => global_mpi call modeldb%configuration%initialise( program_name, table_len=10 ) + call modeldb%config%initialise( program_name ) ! Create the depository and prognostics field collections call modeldb%fields%add_empty_field_collection("depository", & @@ -59,8 +61,12 @@ program shallow_water call init_comm( program_name, modeldb ) call init_config( filename, shallow_water_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) call init_logger( global_mpi%get_comm(), program_name ) + + call check_config_api( modeldb%configuration, modeldb%config ) + call init_timers( program_name ) call init_counters( program_name ) call init_collections() diff --git a/applications/solver/source/solver.F90 b/applications/solver/source/solver.F90 index 9c06cb220..65d816094 100644 --- a/applications/solver/source/solver.F90 +++ b/applications/solver/source/solver.F90 @@ -12,6 +12,7 @@ program solver use add_mesh_map_mod, only: assign_mesh_maps + use config_mod, only: config_type 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: parse_command_line @@ -47,7 +48,6 @@ program solver use namelist_mod, only: namelist_type use sci_checksum_alg_mod, only: checksum_alg - !------------------------------------ ! Configuration modules !------------------------------------ @@ -60,6 +60,7 @@ program solver character(:), allocatable :: filename type(namelist_collection_type), SAVE :: configuration + type(config_type), SAVE :: config integer(i_def) :: total_ranks, local_rank type(lfric_comm_type) :: comm @@ -117,9 +118,13 @@ program solver local_rank = global_mpi%get_comm_rank() call configuration%initialise( program_name, table_len=10 ) + call config%initialise( program_name ) + call init_config( filename, solver_required_namelists, & - configuration ) + configuration=configuration, & + config=config ) call init_logger( comm, program_name ) + call init_collections() deallocate( filename ) @@ -185,7 +190,7 @@ program solver !----------------------------------------------------------------------- stencil_depth = 1 check_partitions = .false. - call init_mesh( configuration, & + call init_mesh( config, & local_rank, total_ranks, & base_mesh_names, extrusion, & stencil_depth, check_partitions ) diff --git a/applications/transport/source/driver/transport_driver_mod.f90 b/applications/transport/source/driver/transport_driver_mod.f90 index 2f9d4361d..666c0f1c1 100644 --- a/applications/transport/source/driver/transport_driver_mod.f90 +++ b/applications/transport/source/driver/transport_driver_mod.f90 @@ -290,7 +290,7 @@ subroutine initialise_transport( program_name, modeldb ) apply_partition_check = .true. end if - call init_mesh( modeldb%configuration, & + call init_mesh( modeldb%config, & modeldb%mpi%get_comm_rank(), & modeldb%mpi%get_comm_size(), & base_mesh_names, & diff --git a/applications/transport/source/transport.f90 b/applications/transport/source/transport.f90 index a4ea8347a..b027424ee 100644 --- a/applications/transport/source/transport.f90 +++ b/applications/transport/source/transport.f90 @@ -8,6 +8,7 @@ !> run_transport() and finalise_transport(). program transport + use check_config_api_mod, only: check_config_api use cli_mod, only: parse_command_line use constants_mod, only: i_def, r_def use driver_collections_mod, only: init_collections, final_collections @@ -36,13 +37,20 @@ program transport 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 modeldb%configuration%initialise( program_name, table_len=10 ) + call modeldb%config%initialise( program_name ) + call init_config( filename, transport_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) call init_logger( modeldb%mpi%get_comm(), program_name ) + call check_config_api( modeldb%configuration, modeldb%config ) + call log_event( 'Miniapp will run with default precision set as:', & log_level_trace ) write(log_scratch_space, '(" r_def kind = ", I0)') kind(1.0_r_def) diff --git a/dependencies.yaml b/dependencies.yaml index 473a2c6ee..e6df37946 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -30,8 +30,8 @@ lfric_apps: ref: lfric_core: - source: git@github.com:MetOffice/lfric_core.git - ref: 5d4d72f0e35f00e71b1757df6beadec21ece97f0 + source: cazld000020:/data/users/ricky.wong/GitHub/lfric_core + ref: IntermediateApiPurge moci: source: git@github.com:MetOffice/moci.git diff --git a/interfaces/jedi_lfric_interface/integration-test/time/jedi_lfric_time_test.f90 b/interfaces/jedi_lfric_interface/integration-test/time/jedi_lfric_time_test.f90 index 3f75a4c82..4e073568f 100644 --- a/interfaces/jedi_lfric_interface/integration-test/time/jedi_lfric_time_test.f90 +++ b/interfaces/jedi_lfric_interface/integration-test/time/jedi_lfric_time_test.f90 @@ -10,6 +10,8 @@ !! jedi_lfric_time_test.py. program jedi_lfric_time_test + use check_config_api_mod, only : check_config_api + use config_mod, only : config_type use configuration_mod, only : final_configuration, & read_configuration use constants_mod, only : i_def, r_def, l_def @@ -52,6 +54,7 @@ program jedi_lfric_time_test character(:), allocatable :: filename type(namelist_collection_type), save :: configuration + type(config_type), save :: config ! Variables used for parsing command line arguments integer(i_def) :: length, status, nargs @@ -172,7 +175,14 @@ program jedi_lfric_time_test ! Setup configuration, and initialise tests call configuration%initialise( program_name, table_len=10 ) - call read_configuration( filename, configuration ) + call config%initialise( program_name ) + + call read_configuration( filename, & + configuration=configuration, & + config=config ) + + call check_config_api( configuration, config ) + call test_jedi_interface_init() if ( do_test_init_string_err ) then diff --git a/interfaces/jedi_lfric_interface/source/driver/linear/jedi_lfric_linear_modeldb_driver_mod.f90 b/interfaces/jedi_lfric_interface/source/driver/linear/jedi_lfric_linear_modeldb_driver_mod.f90 index c7d2bb148..0c1192351 100644 --- a/interfaces/jedi_lfric_interface/source/driver/linear/jedi_lfric_linear_modeldb_driver_mod.f90 +++ b/interfaces/jedi_lfric_interface/source/driver/linear/jedi_lfric_linear_modeldb_driver_mod.f90 @@ -43,6 +43,7 @@ module jedi_lfric_linear_modeldb_driver_mod adjoint_step, & finalise_adjoint_model use atl_si_timestep_alg_mod, only : atl_si_timestep_type + use check_config_api_mod, only : check_config_api use constants_mod, only : r_def, l_def, str_def use driver_config_mod, only : init_config use driver_time_mod, only : init_time, final_time @@ -119,6 +120,7 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb, atl_si_ ! 1. Initialise modeldb field collections, configuration and mpi. modeldb%mpi => mpi_obj call modeldb%configuration%initialise( modeldb_name, table_len=10 ) + call modeldb%config%initialise( modeldb_name ) call modeldb%values%initialise('values', 5) @@ -139,7 +141,8 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb, atl_si_ call modeldb%io_contexts%initialise(modeldb_name, table_len=100) call init_config( filename, gungho_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) ! 2. Setup some model modeldb%values and initialise infrastructure call modeldb%values%add_key_value( 'temperature_correction_rate', 0.0_r_def ) @@ -149,6 +152,7 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb, atl_si_ ! Initialise infrastructure call init_time( modeldb ) call initialise_infrastructure( io_context_name, modeldb ) + call check_config_api( modeldb%configuration, modeldb%config ) ! Add a place to store time axes in modeldb call modeldb%values%add_key_value('model_axes', model_axes) diff --git a/interfaces/jedi_lfric_interface/source/driver/nl/jedi_lfric_nl_modeldb_driver_mod.f90 b/interfaces/jedi_lfric_interface/source/driver/nl/jedi_lfric_nl_modeldb_driver_mod.f90 index 6d1405ba6..8272ed2dd 100644 --- a/interfaces/jedi_lfric_interface/source/driver/nl/jedi_lfric_nl_modeldb_driver_mod.f90 +++ b/interfaces/jedi_lfric_interface/source/driver/nl/jedi_lfric_nl_modeldb_driver_mod.f90 @@ -22,6 +22,7 @@ !> module jedi_lfric_nl_modeldb_driver_mod + use check_config_api_mod, only : check_config_api use constants_mod, only : l_def use driver_config_mod, only : init_config use driver_time_mod, only : init_time, final_time @@ -67,6 +68,7 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb ) ! 1. Initialise modeldb field collections, configuration and mpi. modeldb%mpi => mpi_obj call modeldb%configuration%initialise( modeldb_name, table_len=10 ) + call modeldb%config%initialise( modeldb_name ) call modeldb%values%initialise('values', table_len = 5) @@ -89,7 +91,8 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb ) call modeldb%io_contexts%initialise(modeldb_name, table_len=100) call init_config( filename, gungho_required_namelists, & - modeldb%configuration ) + configuration=modeldb%configuration, & + config=modeldb%config ) ! 3. Initialise the clock and calendar call init_time( modeldb ) @@ -97,6 +100,8 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb ) ! 4. Call the gungho driver initialise call gh_initialise(modeldb_name, modeldb) + call check_config_api( modeldb%configuration, modeldb%config ) + end subroutine initialise_modeldb !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/interfaces/jedi_lfric_interface/source/mesh/jedi_lfric_mesh_setup_mod.F90 b/interfaces/jedi_lfric_interface/source/mesh/jedi_lfric_mesh_setup_mod.F90 index 24665d5b9..6857363e6 100644 --- a/interfaces/jedi_lfric_interface/source/mesh/jedi_lfric_mesh_setup_mod.F90 +++ b/interfaces/jedi_lfric_interface/source/mesh/jedi_lfric_mesh_setup_mod.F90 @@ -10,6 +10,7 @@ module jedi_lfric_mesh_setup_mod use add_mesh_map_mod, only: assign_mesh_maps use base_mesh_config_mod, only: GEOMETRY_SPHERICAL, & GEOMETRY_PLANAR + use config_mod, only: config_type use constants_mod, only: str_def, i_def, l_def, r_def use create_mesh_mod, only: create_mesh use driver_mesh_mod, only: init_mesh @@ -36,14 +37,16 @@ module jedi_lfric_mesh_setup_mod !> !> @param [out] mesh_name The name of the mesh being setup !> @param [in] configuration The geometry configuration + !> @param [in] config The geometry configuration !> @param [inout] mpi_obj The mpi communicator !> @param [in] alt_mesh_name The name of an alternative mesh_name to setup - subroutine initialise_mesh( mesh_name, configuration, mpi_obj, alt_mesh_name ) + subroutine initialise_mesh( mesh_name, configuration, config, mpi_obj, alt_mesh_name ) implicit none character(len=*), intent(out) :: mesh_name type(namelist_collection_type), intent(in) :: configuration + type(config_type), intent(in) :: config !> @todo: This should be intent in but when calling the method I get !> a compiler failure class(lfric_mpi_type), intent(inout) :: mpi_obj @@ -124,7 +127,7 @@ subroutine initialise_mesh( mesh_name, configuration, mpi_obj, alt_mesh_name ) !------------------------------------------------------------------------- stencil_depth = 2 apply_partition_check = .false. - call init_mesh( configuration, & + call init_mesh( config, & mpi_obj%get_comm_rank(), & mpi_obj%get_comm_size(), & base_mesh_names, & diff --git a/science/gungho/integration-test/cma_test/cma_test.f90 b/science/gungho/integration-test/cma_test/cma_test.f90 index 2797865da..743fca508 100644 --- a/science/gungho/integration-test/cma_test/cma_test.f90 +++ b/science/gungho/integration-test/cma_test/cma_test.f90 @@ -29,6 +29,7 @@ program cma_test test_cma_add, & test_cma_apply_inv, & test_cma_diag_DhMDhT + use config_mod, only : config_type use constants_mod, only : i_def, r_def, i_def, l_def, & r_solver, pi, str_def use derived_config_mod, only : set_derived_config @@ -65,6 +66,8 @@ program cma_test use sci_chi_transform_mod, only : init_chi_transforms, & final_chi_transforms + use check_config_api_mod, only: check_config_api + implicit none ! MPI communicator @@ -125,6 +128,7 @@ program cma_test ! Namelist and configuration variables type(namelist_collection_type), save :: configuration + type(config_type), save :: config type(namelist_type), pointer :: extrusion_nml type(namelist_type), pointer :: base_mesh_nml @@ -232,6 +236,9 @@ program cma_test end select call configuration%initialise( program_name, table_len=10 ) + call config%initialise( program_name ) + + call check_config_api( configuration, config ) deallocate(program_name) deallocate(test_flag) @@ -243,7 +250,9 @@ program cma_test call log_event( log_scratch_space, LOG_LEVEL_INFO ) allocate( success_map(size(required_configuration)) ) - call read_configuration( filename, configuration ) + call read_configuration( filename, & + configuration=configuration, & + config=config ) okay = ensure_configuration( required_configuration, success_map ) if (.not. okay) then @@ -291,7 +300,8 @@ program cma_test stencil_depth = get_required_stencil_depth() check_partitions = .false. - call init_mesh( configuration, & + + call init_mesh( config, & local_rank, total_ranks, & base_mesh_names, extrusion, & stencil_depth, check_partitions ) diff --git a/science/gungho/source/driver/gungho_model_mod.F90 b/science/gungho/source/driver/gungho_model_mod.F90 index e91f0fbd6..ee30f64fd 100644 --- a/science/gungho/source/driver/gungho_model_mod.F90 +++ b/science/gungho/source/driver/gungho_model_mod.F90 @@ -673,7 +673,8 @@ subroutine initialise_infrastructure( io_context_name, modeldb ) end if stencil_depth = get_required_stencil_depth() - call init_mesh( modeldb%configuration, & + + call init_mesh( modeldb%config, & modeldb%mpi%get_comm_rank(), & modeldb%mpi%get_comm_size(), & base_mesh_names, & diff --git a/science/linear/integration-test/runge_kutta/runge_kutta.f90 b/science/linear/integration-test/runge_kutta/runge_kutta.f90 index f460201ac..ac4fae76d 100644 --- a/science/linear/integration-test/runge_kutta/runge_kutta.f90 +++ b/science/linear/integration-test/runge_kutta/runge_kutta.f90 @@ -146,7 +146,12 @@ program runge_kutta end select call modeldb%configuration%initialise( program_name, table_len=10 ) - call read_configuration( filename, modeldb%configuration ) + call modeldb%config%initialise( program_name ) + + call read_configuration( filename, & + configuration=modeldb%configuration, & + config=modeldb%config ) + deallocate( filename ) call init_collections() diff --git a/science/linear/integration-test/semi_implicit/semi_implicit.f90 b/science/linear/integration-test/semi_implicit/semi_implicit.f90 index af625729c..572475e7f 100644 --- a/science/linear/integration-test/semi_implicit/semi_implicit.f90 +++ b/science/linear/integration-test/semi_implicit/semi_implicit.f90 @@ -133,7 +133,12 @@ program semi_implicit end select call modeldb%configuration%initialise( program_name, table_len=10 ) - call read_configuration( filename, modeldb%configuration ) + call modeldb%config%initialise( program_name) + + call read_configuration( filename, & + configuration=modeldb%configuration, & + config=modeldb%config ) + deallocate( filename ) call init_collections() diff --git a/science/shared/source/utils/check_config_api_mod.f90 b/science/shared/source/utils/check_config_api_mod.f90 new file mode 100644 index 000000000..ea0c61ce3 --- /dev/null +++ b/science/shared/source/utils/check_config_api_mod.f90 @@ -0,0 +1,393 @@ +! ADD Licence????? +!================================================================ +! Temporary code to check new and old confiuration objects return +! the same configuration values. This is to manage the transition +! of the codebase from using a namelist_collection_type to a +! config_type +!================================================================ +module check_config_api_mod + + use constants_mod, only: l_def, i_def, r_def, & + str_def, str_max_filename, & + r_second, i_medium + use config_mod, only: config_type + use log_mod, only: log_event, log_level_warning, & + log_level_info + use namelist_collection_mod, only: namelist_collection_type + use namelist_mod, only: namelist_type + + implicit none + + private + public :: check_config_api + +contains + +subroutine check_config_api( configuration, config ) + + implicit none + + type(namelist_collection_type), intent(in) :: configuration + type(config_type), intent(in) :: config + + type(namelist_type), pointer :: aerosol_nml + type(namelist_type), pointer :: base_mesh_nml + type(namelist_type), pointer :: extrusion_nml + type(namelist_type), pointer :: files_nml + + type(namelist_type), pointer :: planet_nml + type(namelist_type), pointer :: io_nml + type(namelist_type), pointer :: timestepping_nml + type(namelist_type), pointer :: time_nml + type(namelist_type), pointer :: mixed_solver_nml + type(namelist_type), pointer :: microphysics_nml + type(namelist_type), pointer :: multires_coupling_nml + type(namelist_type), pointer :: multigrid_nml + type(namelist_type), pointer :: formulation_nml + type(namelist_type), pointer :: initialization_nml + type(namelist_type), pointer :: boundaries_nml + type(namelist_type), pointer :: finite_element_nml + +! initial_temperature, bvf_square r_def +! gravity_wave_constants b_space i_def + character(str_max_filename) :: start_dump_filename + character(str_max_filename) :: checkpoint_stem_name +! lfric2lfric regrid_method i_def + character(str_def) :: prime_mesh_name + character(str_def) :: aerosol_mesh_name + character(str_def) :: orography_mesh_name + character(str_def) :: time_origin + character(str_def) :: time_start + character(str_max_filename) :: file_prefix + + logical(l_def) :: prepartitioned + integer(i_def) :: geometry + integer(i_def) :: moisture_formulation + integer(i_def) :: lbc_option + integer(i_def) :: ls_option + integer(i_def) :: init_option + integer(i_def) :: lbc_eos_height + integer(i_def) :: model_eos_height + + real(r_def) :: tau_r + real(r_def) :: atol + real(r_def) :: domain_height + real(r_def) :: planet_radius + real(r_def) :: scaled_radius + real(r_second) :: dt + integer(i_def) :: method + integer(i_def) :: nlayers + integer(i_def) :: element_order_h + integer(i_def) :: element_order_v + integer(i_medium) :: diag_freq + logical(l_def) :: nodal + logical(l_def) :: write_diag + logical(l_def) :: use_xios_io + logical(l_def) :: l_multigrid + logical(l_def) :: use_multires_coupling + logical(l_def) :: subroutine_timers + logical(l_def) :: ozone_ancil + logical(l_def) :: aero_ancil + logical(l_def) :: murk_lbc + logical(l_def) :: microphysics_casim + logical(l_def) :: read_w2h_wind + +! character(str_def), allocatable :: chain_mesh_tags(:) +! character(str_def), allocatable :: multires_coupling_mesh_tags(:) + + character(*), parameter :: message = 'Difference in config objects ' + + call log_event('Validating Config/Configuration object data.', & + log_level_info) + + if (configuration%namelist_exists('base_mesh')) then + base_mesh_nml => configuration%get_namelist('base_mesh') + + call base_mesh_nml%get_value( 'prime_mesh_name', prime_mesh_name ) + call base_mesh_nml%get_value( 'file_prefix', file_prefix ) + call base_mesh_nml%get_value( 'geometry', geometry ) + call base_mesh_nml%get_value( 'prepartitioned', prepartitioned ) + + if (prime_mesh_name /= config%base_mesh%prime_mesh_name()) then + call log_event(message//'prime_mesh_name', log_level_warning) + end if + + if (file_prefix /= config%base_mesh%file_prefix()) then + call log_event(message//'file_prefix', log_level_warning) + end if + + if (geometry /= config%base_mesh%geometry()) then + call log_event(message//'geometry', log_level_warning) + end if + + if (prepartitioned .neqv. config%base_mesh%prepartitioned()) then + call log_event(message//'prepartitioned', log_level_warning) + end if + end if + + if (configuration%namelist_exists('extrusion')) then + extrusion_nml => configuration%get_namelist('extrusion') + + call extrusion_nml%get_value( 'method', method ) + call extrusion_nml%get_value( 'planet_radius', planet_radius ) + call extrusion_nml%get_value( 'domain_height', domain_height ) + call extrusion_nml%get_value( 'number_of_layers', nlayers ) + + if (method /= config%extrusion%method()) then + call log_event(message//'method', log_level_warning) + end if + + if (planet_radius /= config%extrusion%planet_radius()) then + call log_event(message//'planet_radius', log_level_warning) + end if + + if (domain_height /= config%extrusion%domain_height()) then + call log_event(message//'domain_height', log_level_warning) + end if + + if (nlayers /= config%extrusion%number_of_layers()) then + call log_event(message//'number_of_layers', log_level_warning) + end if + end if + + if (configuration%namelist_exists('io')) then + io_nml => configuration%get_namelist('io') + + call io_nml%get_value( 'nodal_output_on_w3', nodal ) + call io_nml%get_value( 'write_diag', write_diag ) + call io_nml%get_value( 'use_xios_io', use_xios_io ) + call io_nml%get_value( 'subroutine_timers', subroutine_timers ) + call io_nml%get_value( 'diagnostic_frequency', diag_freq ) + + if (diag_freq /= config%io%diagnostic_frequency()) then + call log_event(message//'diagnostic_frequency', log_level_warning) + end if + + if (nodal .neqv. config%io%nodal_output_on_w3()) then + call log_event(message//'nodal_output_on_w3', log_level_warning) + end if + + if (write_diag .neqv. config%io%write_diag()) then + call log_event(message//'write_diag', log_level_warning) + end if + + if (use_xios_io .neqv. config%io%use_xios_io()) then + call log_event(message//'use_xios_io', log_level_warning) + end if + + if (subroutine_timers .neqv. config%io%subroutine_timers()) then + call log_event(message//'subroutine_timers', log_level_warning) + end if + end if + + if (configuration%namelist_exists('finite_element')) then + finite_element_nml => configuration%get_namelist('finite_element') + + call finite_element_nml%get_value('element_order_h', element_order_h) + call finite_element_nml%get_value('element_order_v', element_order_v) + + if (element_order_h /= config%finite_element%element_order_h()) then + call log_event( message//'element_order_h', log_level_warning ) + end if + + if (element_order_v /= config%finite_element%element_order_v()) then + call log_event( message//'element_order_v', log_level_warning ) + end if + end if + + if (configuration%namelist_exists('formulation')) then + formulation_nml => configuration%get_namelist('formulation') + + call formulation_nml%get_value('l_multigrid', l_multigrid) + call formulation_nml%get_value('moisture_formulation', moisture_formulation) + call formulation_nml%get_value('use_multires_coupling', use_multires_coupling) + + if (moisture_formulation /= config%formulation%moisture_formulation()) then + call log_event( message//'moisture_formulation', log_level_warning ) + end if + + if (l_multigrid .neqv. config%formulation%l_multigrid()) then + call log_event( message//'l_multigrid', log_level_warning ) + end if + + if (use_multires_coupling .neqv. config%formulation%use_multires_coupling()) then + call log_event( message//'use_multires_coupling', log_level_warning ) + end if + end if + + if (configuration%namelist_exists('planet')) then + planet_nml => configuration%get_namelist('planet') + + call planet_nml%get_value( 'scaled_radius', scaled_radius ) + + if (scaled_radius /= config%planet%scaled_radius()) then + call log_event( message//'scaled_radius', log_level_warning ) + end if + end if + + + if (configuration%namelist_exists('timestepping')) then + timestepping_nml => configuration%get_namelist('timestepping') + + call timestepping_nml%get_value( 'dt', dt ) + call timestepping_nml%get_value( 'tau_r', tau_r ) + + if (dt /= config%timestepping%dt()) then + call log_event( message//'dt', log_level_warning ) + end if + + if (tau_r /= config%timestepping%tau_r()) then + call log_event( message//'tau_r', log_level_warning ) + end if + + end if + + + if (configuration%namelist_exists('mixed_solver')) then + mixed_solver_nml => configuration%get_namelist('mixed_solver') + + call mixed_solver_nml%get_value('mixed_solver_a_tol', atol) + + if (atol /= config%mixed_solver%mixed_solver_a_tol()) then + call log_event( message//'mixed_solver_a_tol', log_level_warning ) + end if + end if + + + if (configuration%namelist_exists('initialization')) then + initialization_nml => configuration%get_namelist('initialization') + + call initialization_nml%get_value('ls_option', ls_option) + call initialization_nml%get_value('lbc_option', lbc_option) + call initialization_nml%get_value('coarse_aerosol_ancil', aero_ancil) + call initialization_nml%get_value('coarse_ozone_ancil', ozone_ancil) + call initialization_nml%get_value('init_option', init_option) + call initialization_nml%get_value('model_eos_height', model_eos_height) + call initialization_nml%get_value('read_w2h_wind', read_w2h_wind) + + if (ls_option /= config%initialization%ls_option()) then + call log_event( message//'ls_option', log_level_warning ) + end if + + if (lbc_option /= config%initialization%lbc_option()) then + call log_event( message//'lbc_option', log_level_warning ) + end if + + if (init_option /= config%initialization%init_option()) then + call log_event( message//'init_option', log_level_warning ) + end if + + if (aero_ancil .neqv. config%initialization%coarse_aerosol_ancil()) then + call log_event( message//'aerosol_ancil', log_level_warning ) + end if + + if (ozone_ancil .neqv. config%initialization%coarse_ozone_ancil()) then + call log_event( message//'ozone_ancil', log_level_warning ) + end if + + if (model_eos_height /= config%initialization%model_eos_height()) then + call log_event( message//'model_eos_height', log_level_warning ) + end if + + if (read_w2h_wind .neqv. config%initialization%read_w2h_wind()) then + call log_event( message//'read_w2h_wind', log_level_warning ) + end if + + end if + + + if (configuration%namelist_exists('boundaries')) then + boundaries_nml => configuration%get_namelist('boundaries') + + call boundaries_nml%get_value('lbc_eos_height', lbc_eos_height) + + if (lbc_eos_height /= config%boundaries%lbc_eos_height()) then + call log_event( message//'lbc_eos_height', log_level_warning ) + end if + end if + + if (configuration%namelist_exists('multires_coupling')) then + multires_coupling_nml => configuration%get_namelist('multires_coupling') + + call multires_coupling_nml%get_value('aerosol_mesh_name', aerosol_mesh_name) + call multires_coupling_nml%get_value('orography_mesh_name', orography_mesh_name) +! call multires_coupling_nml%get_value('multires_coupling_mesh_tags', multires_coupling_mesh_tags) + + if (orography_mesh_name /= config%multires_coupling%orography_mesh_name()) then + call log_event( message//'orography_mesh_name', log_level_warning ) + end if + +!!$ if (multires_coupling_mesh_tags /= config%multires_coupling%multires_coupling_mesh_tags()) then +!!$ call log_event( message//'multires_coupling_mesh_tags', log_level_warning ) +!!$ end if + + if (aerosol_mesh_name /= config%multires_coupling%aerosol_mesh_name()) then + call log_event( message//'aerosol_mesh_name', log_level_warning ) + end if + end if + + if (configuration%namelist_exists('aerosol')) then + aerosol_nml => configuration%get_namelist('aerosol') + + call aerosol_nml%get_value('murk_lbc', murk_lbc) + + if (murk_lbc .neqv. config%aerosol%murk_lbc()) then + call log_event( message//'murk_lbc', log_level_warning ) + end if + end if + + if (configuration%namelist_exists('multigrid')) then + multigrid_nml => configuration%get_namelist('multigrid') + +!!$ call multigrid_nml%get_value('chain_mesh__tags', chain_mesh_tags) +!!$ chain_mesh_tags_2 = config%multigrid%chain_mesh_tags() +!!$ do i=1, size(chain_mesh_tags) +!!$ if (chain_mesh_tags /= config%multigrid%chain_mesh_tags()) then +!!$ call log_event( message//'chain_mesh_tags', log_level_warning ) +!!$ end if +!!$ end do + end if + + if (configuration%namelist_exists('microphysics')) then + microphysics_nml => configuration%get_namelist('microphysics') + + call microphysics_nml%get_value('microphysics_casim', microphysics_casim) + + if (microphysics_casim .neqv. config%microphysics%microphysics_casim()) then + call log_event( message//'microphysics_casim', log_level_warning ) + end if + end if + + if (configuration%namelist_exists('time')) then + time_nml => configuration%get_namelist('time') + + call time_nml%get_value('calendar_origin', time_origin) + call time_nml%get_value('calendar_start', time_start) + + if (time_origin /= config%time%calendar_origin()) then + call log_event( message//'calendar_origin', log_level_warning ) + end if + + if (time_start /= config%time%calendar_start()) then + call log_event( message//'calendar_start', log_level_warning ) + end if + end if + + if (configuration%namelist_exists('files')) then + files_nml => configuration%get_namelist('files') + + call files_nml%get_value('start_dump_filename', start_dump_filename) + call files_nml%get_value('checkpoint_stem_name', checkpoint_stem_name) + + if (start_dump_filename /= config%files%start_dump_filename()) then + call log_event( message//'start_dump_filename', log_level_warning ) + end if + + if (checkpoint_stem_name /= config%files%checkpoint_stem_name()) then + call log_event( message//'checkpoint_stem_name', log_level_warning ) + end if + end if + +end subroutine check_config_api + +end module check_config_api_mod From d7a8d8502668edd9f6d1eb529d2baf89a59558bc Mon Sep 17 00:00:00 2001 From: Ricky Wong <141156427+mo-rickywong@users.noreply.github.com> Date: Tue, 3 Feb 2026 09:33:18 +0000 Subject: [PATCH 2/4] Update dependencies files to point to linked core --- dependencies.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.yaml b/dependencies.yaml index 90f5a82d0..3f68cf294 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -30,7 +30,7 @@ lfric_apps: ref: lfric_core: - source: cazld000020:/data/users/ricky.wong/GitHub/lfric_core + source: git@github.com:mo-rickywong/lfric_core.git ref: IntermediateApiPurge moci: From 9ad2fcdd55baeefcb164e2b49b09b37839264bff Mon Sep 17 00:00:00 2001 From: Ricky Wong <141156427+mo-rickywong@users.noreply.github.com> Date: Tue, 3 Feb 2026 10:06:43 +0000 Subject: [PATCH 3/4] Tidy up the working repo --- .../adjoint_tests/source/adjoint_tests.f90 | 1 - .../gravity_wave/source/gravity_wave.f90 | 2 - .../gungho_model/source/gungho_model.f90 | 1 - .../algorithm/algorithm_test.f90 | 2 - .../source/jedi-interface/jedi_run_mod.f90 | 1 - .../source/jedi_lfric_tests.f90 | 1 - applications/jules/source/jules.f90 | 1 - .../lfric2lfric_infrastructure_mod.X90 | 3 +- .../lfric2lfric/source/lfric2lfric.F90 | 2 - applications/lfric_atm/source/lfric_atm.f90 | 1 - .../lfric_coupled/source/lfric_coupled.f90 | 1 - .../common/lfricinp_lfric_driver_mod.f90 | 3 - .../name_transport/source/name_transport.f90 | 3 - applications/ngarch/source/ngarch.f90 | 2 - .../shallow_water/source/shallow_water.f90 | 1 - applications/transport/source/transport.f90 | 3 - .../time/jedi_lfric_time_test.f90 | 3 - .../jedi_lfric_linear_modeldb_driver_mod.f90 | 2 - .../nl/jedi_lfric_nl_modeldb_driver_mod.f90 | 3 - .../integration-test/cma_test/cma_test.f90 | 4 - .../source/utils/check_config_api_mod.f90 | 393 ------------------ 21 files changed, 2 insertions(+), 431 deletions(-) delete mode 100644 science/shared/source/utils/check_config_api_mod.f90 diff --git a/applications/adjoint_tests/source/adjoint_tests.f90 b/applications/adjoint_tests/source/adjoint_tests.f90 index 7ab159ef3..5a2448a99 100644 --- a/applications/adjoint_tests/source/adjoint_tests.f90 +++ b/applications/adjoint_tests/source/adjoint_tests.f90 @@ -10,7 +10,6 @@ program adjoint_tests - use check_config_api_mod, only : check_config_api 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 diff --git a/applications/gravity_wave/source/gravity_wave.f90 b/applications/gravity_wave/source/gravity_wave.f90 index fa152f15a..596ef3579 100644 --- a/applications/gravity_wave/source/gravity_wave.f90 +++ b/applications/gravity_wave/source/gravity_wave.f90 @@ -11,7 +11,6 @@ program gravity_wave - use check_config_api_mod, only: check_config_api use cli_mod, only: parse_command_line use driver_modeldb_mod, only: modeldb_type use driver_collections_mod, only: init_collections, final_collections @@ -47,7 +46,6 @@ program gravity_wave call init_config( filename, gravity_wave_required_namelists, & configuration=modeldb%configuration, & config=modeldb%config ) - call check_config_api( modeldb%configuration, modeldb%config ) deallocate( filename ) diff --git a/applications/gungho_model/source/gungho_model.f90 b/applications/gungho_model/source/gungho_model.f90 index 6da690e67..37bf9a6eb 100644 --- a/applications/gungho_model/source/gungho_model.f90 +++ b/applications/gungho_model/source/gungho_model.f90 @@ -15,7 +15,6 @@ program gungho_model - use check_config_api_mod, only: check_config_api use cli_mod, only: parse_command_line use derived_config_mod, only: l_esm_couple use driver_collections_mod, only: init_collections, final_collections diff --git a/applications/jedi_lfric_tests/integration-test/algorithm/algorithm_test.f90 b/applications/jedi_lfric_tests/integration-test/algorithm/algorithm_test.f90 index 093539b9b..0be6d7cd1 100644 --- a/applications/jedi_lfric_tests/integration-test/algorithm/algorithm_test.f90 +++ b/applications/jedi_lfric_tests/integration-test/algorithm/algorithm_test.f90 @@ -13,7 +13,6 @@ program algorithm_test use add_mesh_map_mod, only: assign_mesh_maps - use check_config_api_mod, only: check_config_api use configuration_mod, only: final_configuration, & read_configuration use config_mod, only: config_type @@ -152,7 +151,6 @@ program algorithm_test call read_configuration( filename, & configuration=configuration, & config=config ) - call check_config_api( configuration, config ) call init_collections() diff --git a/applications/jedi_lfric_tests/source/jedi-interface/jedi_run_mod.f90 b/applications/jedi_lfric_tests/source/jedi-interface/jedi_run_mod.f90 index c143f65c8..e5d8177d0 100644 --- a/applications/jedi_lfric_tests/source/jedi-interface/jedi_run_mod.f90 +++ b/applications/jedi_lfric_tests/source/jedi-interface/jedi_run_mod.f90 @@ -10,7 +10,6 @@ ! module jedi_run_mod - use check_config_api_mod, only : check_config_api use config_mod, only : config_type use constants_mod, only : i_def, l_def, str_def use namelist_collection_mod, only : namelist_collection_type diff --git a/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 b/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 index a3988cc8e..2da8faf95 100644 --- a/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 +++ b/applications/jedi_lfric_tests/source/jedi_lfric_tests.f90 @@ -15,7 +15,6 @@ !> program jedi_lfric_tests - use check_config_api_mod, only : check_config_api 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 diff --git a/applications/jules/source/jules.f90 b/applications/jules/source/jules.f90 index 7997e23d2..339328f54 100644 --- a/applications/jules/source/jules.f90 +++ b/applications/jules/source/jules.f90 @@ -16,7 +16,6 @@ program jules - use check_config_api_mod, only: check_config_api 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 diff --git a/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90 b/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90 index 70f23cb84..faf7d2240 100644 --- a/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90 +++ b/applications/lfric2lfric/source/initialisation/lfric2lfric_infrastructure_mod.X90 @@ -316,7 +316,8 @@ contains ! Create the required meshes !----------------------------------------------------------------------- stencil_depth = get_required_stencil_depth() - call init_mesh( modeldb%config, modeldb%configuration, & + call init_mesh( modeldb%config, & + modeldb%configuration, & modeldb%mpi%get_comm_rank(), & modeldb%mpi%get_comm_size(), & mesh_names, extrusion, & diff --git a/applications/lfric2lfric/source/lfric2lfric.F90 b/applications/lfric2lfric/source/lfric2lfric.F90 index 8d119094c..6a877c0d3 100644 --- a/applications/lfric2lfric/source/lfric2lfric.F90 +++ b/applications/lfric2lfric/source/lfric2lfric.F90 @@ -15,7 +15,6 @@ program lfric2lfric use cli_mod, only: parse_command_line - use check_config_api_mod, only: check_config_api use constants_mod, only: precision_real use driver_collections_mod, only: init_collections, final_collections use driver_config_mod, only: init_config, final_config @@ -74,7 +73,6 @@ program lfric2lfric config=modeldb%config ) call init_logger( modeldb%mpi%get_comm(), program_name ) - call check_config_api( modeldb%configuration, modeldb%config ) call init_collections() call init_time( modeldb ) deallocate( filename ) diff --git a/applications/lfric_atm/source/lfric_atm.f90 b/applications/lfric_atm/source/lfric_atm.f90 index ab185238f..41c33aadb 100644 --- a/applications/lfric_atm/source/lfric_atm.f90 +++ b/applications/lfric_atm/source/lfric_atm.f90 @@ -16,7 +16,6 @@ program lfric_atm - use check_config_api_mod, only: check_config_api 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 diff --git a/applications/lfric_coupled/source/lfric_coupled.f90 b/applications/lfric_coupled/source/lfric_coupled.f90 index 5d377706a..8043826da 100644 --- a/applications/lfric_coupled/source/lfric_coupled.f90 +++ b/applications/lfric_coupled/source/lfric_coupled.f90 @@ -16,7 +16,6 @@ program lfric_coupled - use check_config_api_mod, only : check_config_api use cli_mod, only : parse_command_line use coupler_mod, only : set_cpl_name use driver_collections_mod, only : init_collections, final_collections diff --git a/applications/lfricinputs/source/common/lfricinp_lfric_driver_mod.f90 b/applications/lfricinputs/source/common/lfricinp_lfric_driver_mod.f90 index 24bd883a6..51e577a87 100644 --- a/applications/lfricinputs/source/common/lfricinp_lfric_driver_mod.f90 +++ b/applications/lfricinputs/source/common/lfricinp_lfric_driver_mod.f90 @@ -5,7 +5,6 @@ ! *****************************COPYRIGHT******************************* module lfricinp_lfric_driver_mod -use check_config_api_mod, only: check_config_api use constants_mod, only: i_def, r_def, l_def, r_second, str_def use log_mod, only: log_event, log_scratch_space, & LOG_LEVEL_INFO, LOG_LEVEL_ERROR, & @@ -176,8 +175,6 @@ subroutine lfricinp_initialise_lfric(program_name_arg, & ! Initialise logging system call init_logger( comm, program_name ) -call check_config_api( configuration, config ) - call init_collections() write(log_scratch_space, '(2(A,I0))') 'total ranks = ', total_ranks, & diff --git a/applications/name_transport/source/name_transport.f90 b/applications/name_transport/source/name_transport.f90 index e6ddab9ee..2f2f4f8b3 100644 --- a/applications/name_transport/source/name_transport.f90 +++ b/applications/name_transport/source/name_transport.f90 @@ -9,7 +9,6 @@ program name_transport - use check_config_api_mod, only: check_config_api use cli_mod, only: parse_command_line use constants_mod, only: i_def, r_def use driver_collections_mod, only: init_collections, final_collections @@ -54,8 +53,6 @@ program name_transport call init_logger( modeldb%mpi%get_comm(), program_name ) - call check_config_api( modeldb%configuration, modeldb%config ) - call log_event( 'Miniapp will run with default precision set as:', & log_level_info ) write(log_scratch_space, '(" r_def kind = ", I0)') kind(1.0_r_def) diff --git a/applications/ngarch/source/ngarch.f90 b/applications/ngarch/source/ngarch.f90 index 1522b6fda..8e0c2fe46 100644 --- a/applications/ngarch/source/ngarch.f90 +++ b/applications/ngarch/source/ngarch.f90 @@ -8,7 +8,6 @@ !> @details Runs a GungHo model with a custom step method program ngarch - use check_config_api_mod, only : check_config_api use cli_mod, only : parse_command_line use driver_collections_mod, only : init_collections, final_collections use constants_mod, only : precision_real @@ -70,7 +69,6 @@ program ngarch ngarch_required_namelists, & configuration=modeldb%configuration, & config=modeldb%config ) - call check_config_api( modeldb%configuration, modeldb%config ) deallocate( filename ) diff --git a/applications/shallow_water/source/shallow_water.f90 b/applications/shallow_water/source/shallow_water.f90 index 61cc4bc30..a58581a5f 100644 --- a/applications/shallow_water/source/shallow_water.f90 +++ b/applications/shallow_water/source/shallow_water.f90 @@ -14,7 +14,6 @@ program shallow_water - use check_config_api_mod, only: check_config_api 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 diff --git a/applications/transport/source/transport.f90 b/applications/transport/source/transport.f90 index 02a9e34e6..5e2bbd560 100644 --- a/applications/transport/source/transport.f90 +++ b/applications/transport/source/transport.f90 @@ -8,7 +8,6 @@ !> run_transport() and finalise_transport(). program transport - use check_config_api_mod, only: check_config_api use cli_mod, only: parse_command_line use constants_mod, only: i_def, r_def use driver_collections_mod, only: init_collections, final_collections @@ -52,8 +51,6 @@ program transport config=modeldb%config ) call init_logger( modeldb%mpi%get_comm(), program_name ) - call check_config_api( modeldb%configuration, modeldb%config ) - call log_event( 'Miniapp will run with default precision set as:', & log_level_trace ) write(log_scratch_space, '(" r_def kind = ", I0)') kind(1.0_r_def) diff --git a/interfaces/jedi_lfric_interface/integration-test/time/jedi_lfric_time_test.f90 b/interfaces/jedi_lfric_interface/integration-test/time/jedi_lfric_time_test.f90 index 4e073568f..75530e3f7 100644 --- a/interfaces/jedi_lfric_interface/integration-test/time/jedi_lfric_time_test.f90 +++ b/interfaces/jedi_lfric_interface/integration-test/time/jedi_lfric_time_test.f90 @@ -10,7 +10,6 @@ !! jedi_lfric_time_test.py. program jedi_lfric_time_test - use check_config_api_mod, only : check_config_api use config_mod, only : config_type use configuration_mod, only : final_configuration, & read_configuration @@ -181,8 +180,6 @@ program jedi_lfric_time_test configuration=configuration, & config=config ) - call check_config_api( configuration, config ) - call test_jedi_interface_init() if ( do_test_init_string_err ) then diff --git a/interfaces/jedi_lfric_interface/source/driver/linear/jedi_lfric_linear_modeldb_driver_mod.f90 b/interfaces/jedi_lfric_interface/source/driver/linear/jedi_lfric_linear_modeldb_driver_mod.f90 index 0c1192351..4530bade2 100644 --- a/interfaces/jedi_lfric_interface/source/driver/linear/jedi_lfric_linear_modeldb_driver_mod.f90 +++ b/interfaces/jedi_lfric_interface/source/driver/linear/jedi_lfric_linear_modeldb_driver_mod.f90 @@ -43,7 +43,6 @@ module jedi_lfric_linear_modeldb_driver_mod adjoint_step, & finalise_adjoint_model use atl_si_timestep_alg_mod, only : atl_si_timestep_type - use check_config_api_mod, only : check_config_api use constants_mod, only : r_def, l_def, str_def use driver_config_mod, only : init_config use driver_time_mod, only : init_time, final_time @@ -152,7 +151,6 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb, atl_si_ ! Initialise infrastructure call init_time( modeldb ) call initialise_infrastructure( io_context_name, modeldb ) - call check_config_api( modeldb%configuration, modeldb%config ) ! Add a place to store time axes in modeldb call modeldb%values%add_key_value('model_axes', model_axes) diff --git a/interfaces/jedi_lfric_interface/source/driver/nl/jedi_lfric_nl_modeldb_driver_mod.f90 b/interfaces/jedi_lfric_interface/source/driver/nl/jedi_lfric_nl_modeldb_driver_mod.f90 index 8272ed2dd..75152c9a4 100644 --- a/interfaces/jedi_lfric_interface/source/driver/nl/jedi_lfric_nl_modeldb_driver_mod.f90 +++ b/interfaces/jedi_lfric_interface/source/driver/nl/jedi_lfric_nl_modeldb_driver_mod.f90 @@ -22,7 +22,6 @@ !> module jedi_lfric_nl_modeldb_driver_mod - use check_config_api_mod, only : check_config_api use constants_mod, only : l_def use driver_config_mod, only : init_config use driver_time_mod, only : init_time, final_time @@ -100,8 +99,6 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb ) ! 4. Call the gungho driver initialise call gh_initialise(modeldb_name, modeldb) - call check_config_api( modeldb%configuration, modeldb%config ) - end subroutine initialise_modeldb !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/science/gungho/integration-test/cma_test/cma_test.f90 b/science/gungho/integration-test/cma_test/cma_test.f90 index 743fca508..6509e025e 100644 --- a/science/gungho/integration-test/cma_test/cma_test.f90 +++ b/science/gungho/integration-test/cma_test/cma_test.f90 @@ -66,8 +66,6 @@ program cma_test use sci_chi_transform_mod, only : init_chi_transforms, & final_chi_transforms - use check_config_api_mod, only: check_config_api - implicit none ! MPI communicator @@ -238,8 +236,6 @@ program cma_test call configuration%initialise( program_name, table_len=10 ) call config%initialise( program_name ) - call check_config_api( configuration, config ) - deallocate(program_name) deallocate(test_flag) diff --git a/science/shared/source/utils/check_config_api_mod.f90 b/science/shared/source/utils/check_config_api_mod.f90 deleted file mode 100644 index ea0c61ce3..000000000 --- a/science/shared/source/utils/check_config_api_mod.f90 +++ /dev/null @@ -1,393 +0,0 @@ -! ADD Licence????? -!================================================================ -! Temporary code to check new and old confiuration objects return -! the same configuration values. This is to manage the transition -! of the codebase from using a namelist_collection_type to a -! config_type -!================================================================ -module check_config_api_mod - - use constants_mod, only: l_def, i_def, r_def, & - str_def, str_max_filename, & - r_second, i_medium - use config_mod, only: config_type - use log_mod, only: log_event, log_level_warning, & - log_level_info - use namelist_collection_mod, only: namelist_collection_type - use namelist_mod, only: namelist_type - - implicit none - - private - public :: check_config_api - -contains - -subroutine check_config_api( configuration, config ) - - implicit none - - type(namelist_collection_type), intent(in) :: configuration - type(config_type), intent(in) :: config - - type(namelist_type), pointer :: aerosol_nml - type(namelist_type), pointer :: base_mesh_nml - type(namelist_type), pointer :: extrusion_nml - type(namelist_type), pointer :: files_nml - - type(namelist_type), pointer :: planet_nml - type(namelist_type), pointer :: io_nml - type(namelist_type), pointer :: timestepping_nml - type(namelist_type), pointer :: time_nml - type(namelist_type), pointer :: mixed_solver_nml - type(namelist_type), pointer :: microphysics_nml - type(namelist_type), pointer :: multires_coupling_nml - type(namelist_type), pointer :: multigrid_nml - type(namelist_type), pointer :: formulation_nml - type(namelist_type), pointer :: initialization_nml - type(namelist_type), pointer :: boundaries_nml - type(namelist_type), pointer :: finite_element_nml - -! initial_temperature, bvf_square r_def -! gravity_wave_constants b_space i_def - character(str_max_filename) :: start_dump_filename - character(str_max_filename) :: checkpoint_stem_name -! lfric2lfric regrid_method i_def - character(str_def) :: prime_mesh_name - character(str_def) :: aerosol_mesh_name - character(str_def) :: orography_mesh_name - character(str_def) :: time_origin - character(str_def) :: time_start - character(str_max_filename) :: file_prefix - - logical(l_def) :: prepartitioned - integer(i_def) :: geometry - integer(i_def) :: moisture_formulation - integer(i_def) :: lbc_option - integer(i_def) :: ls_option - integer(i_def) :: init_option - integer(i_def) :: lbc_eos_height - integer(i_def) :: model_eos_height - - real(r_def) :: tau_r - real(r_def) :: atol - real(r_def) :: domain_height - real(r_def) :: planet_radius - real(r_def) :: scaled_radius - real(r_second) :: dt - integer(i_def) :: method - integer(i_def) :: nlayers - integer(i_def) :: element_order_h - integer(i_def) :: element_order_v - integer(i_medium) :: diag_freq - logical(l_def) :: nodal - logical(l_def) :: write_diag - logical(l_def) :: use_xios_io - logical(l_def) :: l_multigrid - logical(l_def) :: use_multires_coupling - logical(l_def) :: subroutine_timers - logical(l_def) :: ozone_ancil - logical(l_def) :: aero_ancil - logical(l_def) :: murk_lbc - logical(l_def) :: microphysics_casim - logical(l_def) :: read_w2h_wind - -! character(str_def), allocatable :: chain_mesh_tags(:) -! character(str_def), allocatable :: multires_coupling_mesh_tags(:) - - character(*), parameter :: message = 'Difference in config objects ' - - call log_event('Validating Config/Configuration object data.', & - log_level_info) - - if (configuration%namelist_exists('base_mesh')) then - base_mesh_nml => configuration%get_namelist('base_mesh') - - call base_mesh_nml%get_value( 'prime_mesh_name', prime_mesh_name ) - call base_mesh_nml%get_value( 'file_prefix', file_prefix ) - call base_mesh_nml%get_value( 'geometry', geometry ) - call base_mesh_nml%get_value( 'prepartitioned', prepartitioned ) - - if (prime_mesh_name /= config%base_mesh%prime_mesh_name()) then - call log_event(message//'prime_mesh_name', log_level_warning) - end if - - if (file_prefix /= config%base_mesh%file_prefix()) then - call log_event(message//'file_prefix', log_level_warning) - end if - - if (geometry /= config%base_mesh%geometry()) then - call log_event(message//'geometry', log_level_warning) - end if - - if (prepartitioned .neqv. config%base_mesh%prepartitioned()) then - call log_event(message//'prepartitioned', log_level_warning) - end if - end if - - if (configuration%namelist_exists('extrusion')) then - extrusion_nml => configuration%get_namelist('extrusion') - - call extrusion_nml%get_value( 'method', method ) - call extrusion_nml%get_value( 'planet_radius', planet_radius ) - call extrusion_nml%get_value( 'domain_height', domain_height ) - call extrusion_nml%get_value( 'number_of_layers', nlayers ) - - if (method /= config%extrusion%method()) then - call log_event(message//'method', log_level_warning) - end if - - if (planet_radius /= config%extrusion%planet_radius()) then - call log_event(message//'planet_radius', log_level_warning) - end if - - if (domain_height /= config%extrusion%domain_height()) then - call log_event(message//'domain_height', log_level_warning) - end if - - if (nlayers /= config%extrusion%number_of_layers()) then - call log_event(message//'number_of_layers', log_level_warning) - end if - end if - - if (configuration%namelist_exists('io')) then - io_nml => configuration%get_namelist('io') - - call io_nml%get_value( 'nodal_output_on_w3', nodal ) - call io_nml%get_value( 'write_diag', write_diag ) - call io_nml%get_value( 'use_xios_io', use_xios_io ) - call io_nml%get_value( 'subroutine_timers', subroutine_timers ) - call io_nml%get_value( 'diagnostic_frequency', diag_freq ) - - if (diag_freq /= config%io%diagnostic_frequency()) then - call log_event(message//'diagnostic_frequency', log_level_warning) - end if - - if (nodal .neqv. config%io%nodal_output_on_w3()) then - call log_event(message//'nodal_output_on_w3', log_level_warning) - end if - - if (write_diag .neqv. config%io%write_diag()) then - call log_event(message//'write_diag', log_level_warning) - end if - - if (use_xios_io .neqv. config%io%use_xios_io()) then - call log_event(message//'use_xios_io', log_level_warning) - end if - - if (subroutine_timers .neqv. config%io%subroutine_timers()) then - call log_event(message//'subroutine_timers', log_level_warning) - end if - end if - - if (configuration%namelist_exists('finite_element')) then - finite_element_nml => configuration%get_namelist('finite_element') - - call finite_element_nml%get_value('element_order_h', element_order_h) - call finite_element_nml%get_value('element_order_v', element_order_v) - - if (element_order_h /= config%finite_element%element_order_h()) then - call log_event( message//'element_order_h', log_level_warning ) - end if - - if (element_order_v /= config%finite_element%element_order_v()) then - call log_event( message//'element_order_v', log_level_warning ) - end if - end if - - if (configuration%namelist_exists('formulation')) then - formulation_nml => configuration%get_namelist('formulation') - - call formulation_nml%get_value('l_multigrid', l_multigrid) - call formulation_nml%get_value('moisture_formulation', moisture_formulation) - call formulation_nml%get_value('use_multires_coupling', use_multires_coupling) - - if (moisture_formulation /= config%formulation%moisture_formulation()) then - call log_event( message//'moisture_formulation', log_level_warning ) - end if - - if (l_multigrid .neqv. config%formulation%l_multigrid()) then - call log_event( message//'l_multigrid', log_level_warning ) - end if - - if (use_multires_coupling .neqv. config%formulation%use_multires_coupling()) then - call log_event( message//'use_multires_coupling', log_level_warning ) - end if - end if - - if (configuration%namelist_exists('planet')) then - planet_nml => configuration%get_namelist('planet') - - call planet_nml%get_value( 'scaled_radius', scaled_radius ) - - if (scaled_radius /= config%planet%scaled_radius()) then - call log_event( message//'scaled_radius', log_level_warning ) - end if - end if - - - if (configuration%namelist_exists('timestepping')) then - timestepping_nml => configuration%get_namelist('timestepping') - - call timestepping_nml%get_value( 'dt', dt ) - call timestepping_nml%get_value( 'tau_r', tau_r ) - - if (dt /= config%timestepping%dt()) then - call log_event( message//'dt', log_level_warning ) - end if - - if (tau_r /= config%timestepping%tau_r()) then - call log_event( message//'tau_r', log_level_warning ) - end if - - end if - - - if (configuration%namelist_exists('mixed_solver')) then - mixed_solver_nml => configuration%get_namelist('mixed_solver') - - call mixed_solver_nml%get_value('mixed_solver_a_tol', atol) - - if (atol /= config%mixed_solver%mixed_solver_a_tol()) then - call log_event( message//'mixed_solver_a_tol', log_level_warning ) - end if - end if - - - if (configuration%namelist_exists('initialization')) then - initialization_nml => configuration%get_namelist('initialization') - - call initialization_nml%get_value('ls_option', ls_option) - call initialization_nml%get_value('lbc_option', lbc_option) - call initialization_nml%get_value('coarse_aerosol_ancil', aero_ancil) - call initialization_nml%get_value('coarse_ozone_ancil', ozone_ancil) - call initialization_nml%get_value('init_option', init_option) - call initialization_nml%get_value('model_eos_height', model_eos_height) - call initialization_nml%get_value('read_w2h_wind', read_w2h_wind) - - if (ls_option /= config%initialization%ls_option()) then - call log_event( message//'ls_option', log_level_warning ) - end if - - if (lbc_option /= config%initialization%lbc_option()) then - call log_event( message//'lbc_option', log_level_warning ) - end if - - if (init_option /= config%initialization%init_option()) then - call log_event( message//'init_option', log_level_warning ) - end if - - if (aero_ancil .neqv. config%initialization%coarse_aerosol_ancil()) then - call log_event( message//'aerosol_ancil', log_level_warning ) - end if - - if (ozone_ancil .neqv. config%initialization%coarse_ozone_ancil()) then - call log_event( message//'ozone_ancil', log_level_warning ) - end if - - if (model_eos_height /= config%initialization%model_eos_height()) then - call log_event( message//'model_eos_height', log_level_warning ) - end if - - if (read_w2h_wind .neqv. config%initialization%read_w2h_wind()) then - call log_event( message//'read_w2h_wind', log_level_warning ) - end if - - end if - - - if (configuration%namelist_exists('boundaries')) then - boundaries_nml => configuration%get_namelist('boundaries') - - call boundaries_nml%get_value('lbc_eos_height', lbc_eos_height) - - if (lbc_eos_height /= config%boundaries%lbc_eos_height()) then - call log_event( message//'lbc_eos_height', log_level_warning ) - end if - end if - - if (configuration%namelist_exists('multires_coupling')) then - multires_coupling_nml => configuration%get_namelist('multires_coupling') - - call multires_coupling_nml%get_value('aerosol_mesh_name', aerosol_mesh_name) - call multires_coupling_nml%get_value('orography_mesh_name', orography_mesh_name) -! call multires_coupling_nml%get_value('multires_coupling_mesh_tags', multires_coupling_mesh_tags) - - if (orography_mesh_name /= config%multires_coupling%orography_mesh_name()) then - call log_event( message//'orography_mesh_name', log_level_warning ) - end if - -!!$ if (multires_coupling_mesh_tags /= config%multires_coupling%multires_coupling_mesh_tags()) then -!!$ call log_event( message//'multires_coupling_mesh_tags', log_level_warning ) -!!$ end if - - if (aerosol_mesh_name /= config%multires_coupling%aerosol_mesh_name()) then - call log_event( message//'aerosol_mesh_name', log_level_warning ) - end if - end if - - if (configuration%namelist_exists('aerosol')) then - aerosol_nml => configuration%get_namelist('aerosol') - - call aerosol_nml%get_value('murk_lbc', murk_lbc) - - if (murk_lbc .neqv. config%aerosol%murk_lbc()) then - call log_event( message//'murk_lbc', log_level_warning ) - end if - end if - - if (configuration%namelist_exists('multigrid')) then - multigrid_nml => configuration%get_namelist('multigrid') - -!!$ call multigrid_nml%get_value('chain_mesh__tags', chain_mesh_tags) -!!$ chain_mesh_tags_2 = config%multigrid%chain_mesh_tags() -!!$ do i=1, size(chain_mesh_tags) -!!$ if (chain_mesh_tags /= config%multigrid%chain_mesh_tags()) then -!!$ call log_event( message//'chain_mesh_tags', log_level_warning ) -!!$ end if -!!$ end do - end if - - if (configuration%namelist_exists('microphysics')) then - microphysics_nml => configuration%get_namelist('microphysics') - - call microphysics_nml%get_value('microphysics_casim', microphysics_casim) - - if (microphysics_casim .neqv. config%microphysics%microphysics_casim()) then - call log_event( message//'microphysics_casim', log_level_warning ) - end if - end if - - if (configuration%namelist_exists('time')) then - time_nml => configuration%get_namelist('time') - - call time_nml%get_value('calendar_origin', time_origin) - call time_nml%get_value('calendar_start', time_start) - - if (time_origin /= config%time%calendar_origin()) then - call log_event( message//'calendar_origin', log_level_warning ) - end if - - if (time_start /= config%time%calendar_start()) then - call log_event( message//'calendar_start', log_level_warning ) - end if - end if - - if (configuration%namelist_exists('files')) then - files_nml => configuration%get_namelist('files') - - call files_nml%get_value('start_dump_filename', start_dump_filename) - call files_nml%get_value('checkpoint_stem_name', checkpoint_stem_name) - - if (start_dump_filename /= config%files%start_dump_filename()) then - call log_event( message//'start_dump_filename', log_level_warning ) - end if - - if (checkpoint_stem_name /= config%files%checkpoint_stem_name()) then - call log_event( message//'checkpoint_stem_name', log_level_warning ) - end if - end if - -end subroutine check_config_api - -end module check_config_api_mod From 009b003631e96ca07ba4277a72f8b7a38ea29126 Mon Sep 17 00:00:00 2001 From: Ricky Wong <141156427+mo-rickywong@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:24:17 +0000 Subject: [PATCH 4/4] Add name to CONTRIBUTORS.md file --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ed1318623..337cde25b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,6 +7,7 @@ | 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 | +| mo-rickywong | Ricky Wong | Met Office | 2026-02-03 | | 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 |