Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
| GitHub user | Real Name | Affiliation | Date |
| --------------- | ----------------- | ----------- | ---------- |
| james-bruten-mo | James Bruten | Met Office | 2025-12-09 |
| jedbakerMO | Jed Baker | Met Office | 2025-12-29 |
| 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 |
Expand All @@ -11,4 +12,4 @@
| DrTVockerodtMO | Terence Vockerodt | Met Office | 2026-01-08 |
| MetBenjaminWent | Benjamin Went | Met Office | 2026-01-15 |
| timgraham-Met | Tim Graham | Met Office | 2026-01-15 |
| mo-alistairp | Alistair Pirrie | Met Office | 2026-01-19 |
| mo-alistairp | Alistair Pirrie | Met Office | 2026-01-19 |
20 changes: 17 additions & 3 deletions applications/adjoint_tests/source/adjoint_tests.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,23 @@ program adjoint_tests
use log_mod, only : log_event, &
log_level_trace, &
log_scratch_space
use timing_mod, only: init_timing, final_timing
use io_config_mod, only: timer_output_path
use namelist_mod, only: namelist_type

implicit none

! Model run working data set
type (modeldb_type) :: modeldb

character(*), parameter :: application_name = "adjoint_tests"
character(:), allocatable :: filename
character(*), parameter :: application_name = "adjoint_tests"
character(:), allocatable :: filename

call parse_command_line( filename )
type(namelist_type), pointer :: io_nml

logical :: lsubroutine_timers

call parse_command_line( filename )
modeldb%mpi => global_mpi

call modeldb%configuration%initialise( application_name, table_len=10 )
Expand All @@ -61,6 +67,13 @@ program adjoint_tests
call init_config( filename, gungho_required_namelists, &
modeldb%configuration )
call init_logger( modeldb%mpi%get_comm(), application_name )

io_nml => modeldb%configuration%get_namelist('io')
call io_nml%get_value('subroutine_timers', lsubroutine_timers)
call init_timing( modeldb%mpi%get_comm(), lsubroutine_timers, &
application_name, timer_output_path )
nullify( io_nml )

call init_collections()
call init_time( modeldb )
deallocate( filename )
Expand All @@ -77,6 +90,7 @@ program adjoint_tests

call final_time( modeldb )
call final_collections()
call final_timing( application_name )
call final_logger( application_name )
call final_config()
call final_comm( modeldb )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ module adjt_mixed_operator_alg_mod
use mixed_operator_alg_mod, only: mixed_operator_type
use adj_mixed_operator_alg_mod, only: adj_mixed_operator_type
use adj_semi_implicit_solver_alg_mod, only: construct_solver_state
use io_config_mod, only: subroutine_timers
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF
use finite_element_config_mod, only: element_order_h, element_order_v
use function_space_collection_mod, only: function_space_collection
use moist_dyn_mod, only: num_moist_factors
Expand Down Expand Up @@ -84,8 +84,10 @@ contains
real(kind=r_def) :: relative_diff, relative_diff_r_solver
real(kind=r_def), parameter :: overall_tolerance = 1000.0_r_def
real(kind=r_def), parameter :: eps = 1e-30_r_def
integer(kind=tik) :: id

if ( LPROF ) call start_timing( id, 'adjt_mixed_operator_alg' )

if (subroutine_timers) call timer('adjt_mixed_operator_alg')

! --------------------------------------------------------------------------
! Setup
Expand Down Expand Up @@ -216,7 +218,7 @@ contains
call log_event( log_scratch_space, LOG_LEVEL_ERROR )
end if

if (subroutine_timers) call timer('adjt_mixed_operator_alg')
if ( LPROF ) call stop_timing(id, 'adjt_mixed_operator_alg' )

end subroutine adjt_mixed_operator_alg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module adjt_mixed_schur_preconditioner_alg_mod
igh_p, igh_t, igh_d, igh_u
use sci_iterative_solver_mod, only: abstract_iterative_solver_type, &
bicgstab_type
use io_config_mod, only: subroutine_timers
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF
use finite_element_config_mod, only: element_order_h, element_order_v
use function_space_collection_mod, only: function_space_collection
use copy_field_alg_mod, only: copy_field
Expand Down Expand Up @@ -126,8 +126,9 @@ contains
real(kind=r_def) :: machine_tol, machine_tol_r_solver
real(kind=r_def) :: relative_diff, relative_diff_r_solver
real(kind=r_def), parameter :: eps = 1e-30_r_def
integer(kind=tik) :: id

if (subroutine_timers) call timer('adjt_mixed_schur_preconditioner_alg')
if ( LPROF ) call start_timing( id, 'adjt_mixed_schur_preconditioner_alg' )

! --------------------------------------------------------------------------
! Setup
Expand Down Expand Up @@ -305,7 +306,7 @@ contains
deallocate( pressure_preconditioner, pressure_solver, mixed_preconditioner, &
adj_pressure_preconditioner, adj_pressure_solver, adj_mixed_preconditioner )

if (subroutine_timers) call timer('adjt_mixed_schur_preconditioner_alg')
if ( LPROF ) call stop_timing( id, 'adjt_mixed_schur_preconditioner_alg' )

end subroutine adjt_mixed_schur_preconditioner_alg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ module adjt_mixed_solver_alg_mod
igh_p, igh_t, igh_d, igh_u
use mixed_operator_alg_mod, only: mixed_operator_type
use adj_mixed_operator_alg_mod, only: adj_mixed_operator_type
use io_config_mod, only: subroutine_timers
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF
use finite_element_config_mod, only: element_order_h, element_order_v
use function_space_collection_mod, only: function_space_collection
use copy_field_alg_mod, only: copy_field
Expand Down Expand Up @@ -143,8 +143,9 @@ contains
real(kind=r_def) :: machine_tol, machine_tol_r_solver
real(kind=r_def) :: relative_diff, relative_diff_r_solver
real(kind=r_def), parameter :: eps = 1e-30_r_def
integer(tik) :: id

if (subroutine_timers) call timer('adjt_mixed_solver_alg')
if ( LPROF ) call start_timing( id, 'adjt_mixed_solver_alg' )

! --------------------------------------------------------------------------
! Setup
Expand Down Expand Up @@ -336,7 +337,7 @@ contains
deallocate( pressure_preconditioner, pressure_solver, mixed_preconditioner, mixed_solver, &
adj_pressure_preconditioner, adj_pressure_solver, adj_mixed_preconditioner, adj_mixed_solver )

if (subroutine_timers) call timer('adjt_mixed_solver_alg')
if ( LPROF ) call stop_timing( id, 'adjt_mixed_solver_alg' )

end subroutine adjt_mixed_solver_alg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ module adjt_pressure_precon_alg_mod
use derived_config_mod, only: bundle_size
use field_indices_mod, only: isol_p, isol_u, isol_w, isol_uv, &
igh_p, igh_t, igh_d, igh_u
use io_config_mod, only: subroutine_timers
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF
use finite_element_config_mod, only: element_order_h, element_order_v
use function_space_collection_mod, only: function_space_collection
use copy_field_alg_mod, only: copy_field
Expand Down Expand Up @@ -115,8 +115,9 @@ contains
real(kind=r_def) :: machine_tol, machine_tol_r_solver
real(kind=r_def) :: relative_diff, relative_diff_r_solver
real(kind=r_def), parameter :: eps = 1e-30_r_def
integer(tik) :: id

if (subroutine_timers) call timer('adjt_pressure_precon_alg')
if ( LPROF ) call start_timing( id, 'adjt_pressure_precon_alg' )

! --------------------------------------------------------------------------
! Setup
Expand Down Expand Up @@ -276,7 +277,7 @@ contains

deallocate( pressure_preconditioner, adj_pressure_preconditioner )

if (subroutine_timers) call timer('adjt_pressure_preconditioner_alg')
if ( LPROF ) call stop_timing( id, 'adjt_pressure_precon_alg' )

end subroutine adjt_pressure_precon_alg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module adjt_semi_implicit_solver_step_alg_mod
use derived_config_mod, only: bundle_size
use field_indices_mod, only: isol_p, isol_u, isol_w, isol_uv, &
igh_p, igh_t, igh_d, igh_u
use io_config_mod, only: subroutine_timers
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF
use finite_element_config_mod, only: element_order_h, element_order_v
use adj_semi_implicit_solver_alg_mod, only: adj_semi_implicit_solver_type
use semi_implicit_solver_alg_mod, only: semi_implicit_solver_alg_step
Expand Down Expand Up @@ -100,8 +100,9 @@ contains
type(field_type), pointer :: panel_id
real(kind=r_def) :: initial_time
integer(kind=i_def) :: i
integer(kind=tik) :: id

if (subroutine_timers) call timer('adjt_semi_implicit_solver_step_alg')
if ( LPROF ) call start_timing( id, 'adjt_semi_implicit_solver_step_alg' )

! --------------------------------------------------------------------------
! Setup
Expand Down Expand Up @@ -258,7 +259,7 @@ contains

call adj_semi_implicit_solver%finalise()

if (subroutine_timers) call timer('adjt_semi_implicit_solver_step_alg')
if ( LPROF ) call stop_timing( id, 'adjt_semi_implicit_solver_step_alg' )

end subroutine adjt_semi_implicit_solver_step_alg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module atlt_si_timestep_alg_mod
use reference_element_mod, only: T
use formulation_config_mod, only: moisture_formulation, &
moisture_formulation_dry
use io_config_mod, only: subroutine_timers
use derived_config_mod, only: bundle_size
use fs_continuity_mod, only: Wtheta, W2, W3
use moist_dyn_factors_alg_mod, only: moist_dyn_factors_alg
Expand All @@ -30,7 +29,8 @@ module atlt_si_timestep_alg_mod
use mr_indices_mod, only: nummr
use moist_dyn_mod, only: num_moist_factors, gas_law
use field_indices_mod, only: igh_u, igh_t, igh_d, igh_p
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF
use tl_si_timestep_alg_mod, only: tl_semi_implicit_alg_init, &
tl_semi_implicit_alg_step, &
tl_semi_implicit_alg_final
Expand Down Expand Up @@ -115,8 +115,9 @@ contains
real(kind=r_def) :: machine_tol, machine_tol_r_solver
real(kind=r_def) :: relative_diff, relative_diff_r_solver
real(kind=r_def), parameter :: eps = 1e-30_r_def
integer(kind=tik) :: id

if (subroutine_timers) call timer('atlt_si_timestep_alg')
if ( LPROF ) call start_timing( id, 'atlt_si_timestep_alg' )

! --------------------------------------------------------------------------
! Setup
Expand Down Expand Up @@ -370,7 +371,7 @@ contains
call tl_semi_implicit_alg_final()
call atl_si_timestep%finalise()

if (subroutine_timers) call timer('atlt_si_timestep_alg')
if ( LPROF ) call stop_timing( id, 'atlt_si_timestep_alg' )

end subroutine atlt_si_timestep_alg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ module gravity_wave_alg_mod
use field_indices_mod, only: igw_u, igw_p, igw_b

use copy_field_alg_mod, only: copy_field
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF

implicit none

Expand Down Expand Up @@ -525,12 +526,12 @@ contains
real(kind=r_second) :: dt
real(kind=r_def) :: bvf_square
integer(kind=i_def) :: b_space
logical(kind=l_def) :: subroutine_timers

! Auxiliary constants to group invokes
real(kind=r_def) :: const1, const2
integer(tik) :: id

if ( subroutine_timers ) call timer('gravity_wave_alg')
if ( LPROF ) call start_timing( id, 'gravity_wave_alg' )

! Pointers to namelists
timestepping_nml => modeldb%configuration%get_namelist('timestepping')
Expand All @@ -540,7 +541,6 @@ contains
! Obtain namelist parameters
call timestepping_nml%get_value( 'dt', dt )
call initial_temperature_nml%get_value( 'bvf_square', bvf_square )
call io_nml%get_value( 'subroutine_timers', subroutine_timers )

!=== Do a single timestep ==============================================!
mesh => wind%get_mesh()
Expand Down Expand Up @@ -638,7 +638,7 @@ contains

nullify( mesh )

if ( subroutine_timers ) call timer('gravity_wave_alg')
if ( LPROF ) call stop_timing( id, 'gravity_wave_alg' )

end subroutine gravity_wave_alg_step

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
module gw_mixed_diag_precon_alg_mod

use constants_mod, only: i_def
use io_config_mod, only: subroutine_timers
use log_mod, only: log_event, &
LOG_LEVEL_ERROR, &
LOG_LEVEL_INFO, &
Expand All @@ -26,7 +25,8 @@ module gw_mixed_diag_precon_alg_mod
use copy_field_alg_mod, only: copy_field
use sci_preconditioner_mod, only: abstract_preconditioner_type
use sci_r_solver_field_vector_mod, only: r_solver_field_vector_type
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF
use vector_mod, only: abstract_vector_type

implicit none
Expand Down Expand Up @@ -174,8 +174,9 @@ contains
y_vec_u => null(), &
y_vec_p => null(), &
y_vec_b => null()
integer(tik) :: id

if ( subroutine_timers ) call timer('gw_mixed_diag_precon_alg')
if ( LPROF ) call start_timing( id, 'gw_mixed_diag_precon_alg' )

select type(x)
type is(r_solver_field_vector_type)
Expand Down Expand Up @@ -212,7 +213,7 @@ contains

nullify( x_vec_u, x_vec_p, x_vec_b, y_vec_u, y_vec_p, y_vec_b )

if ( subroutine_timers ) call timer('gw_mixed_diag_precon_alg')
if ( LPROF ) call stop_timing( id, 'gw_mixed_diag_precon_alg' )

end subroutine apply_gw_mixed_diag_preconditioner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ module gw_mixed_schur_precon_alg_mod
use sci_preconditioner_mod, only: abstract_preconditioner_type
use sci_r_solver_field_vector_mod, only: r_solver_field_vector_type
use field_indices_mod, only: igw_u, igw_p, igw_b
use io_config_mod, only: subroutine_timers
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF
use log_mod, only: log_event, &
LOG_LEVEL_ERROR, &
LOG_LEVEL_INFO, &
Expand Down Expand Up @@ -350,9 +350,10 @@ contains
type(r_solver_field_type), pointer :: y_vec_u => null(), &
y_vec_p => null(), &
y_vec_b => null()
integer(tik) :: id


if ( subroutine_timers ) call timer('gw_mixed_schur_precon_alg')
if ( LPROF ) call start_timing( id, 'gw_mixed_schur_precon_alg' )

select type(x)
type is(r_solver_field_vector_type)
Expand Down Expand Up @@ -399,7 +400,7 @@ contains

nullify( y_vec_u, y_vec_p, y_vec_b )

if ( subroutine_timers ) call timer('gw_mixed_schur_precon_alg')
if ( LPROF ) call stop_timing( id, 'gw_mixed_schur_precon_alg' )

end subroutine apply_gw_mixed_schur_preconditioner

Expand Down
Loading