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
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
| --------------- | ---------------- | ----------- | ---------- |
| andrewcoughtrie | Andrew Coughtrie | Met Office | 2025.12.12 |
| 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 |
| mo-marqh | Mark Hedley | Met Office | 2025-12-11 |
| mike-hobson | Mike Hobson | Met Office | 2025-12-17 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ module io_demo_constants_mod
use fs_continuity_mod, only: W2
use function_space_collection_mod, only: function_space_collection
use function_space_mod, only: function_space_type
use io_config_mod, only: subroutine_timers
use log_mod, only: log_event, LOG_LEVEL_TRACE, &
LOG_LEVEL_ERROR
use mesh_mod, only: mesh_type
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF

! Kernels
use sci_calc_dA_at_w2_kernel_mod, only: calc_dA_at_w2_kernel_type
Expand Down Expand Up @@ -61,8 +61,9 @@ contains
type(mesh_type), pointer, intent(in) :: mesh
type(field_type), target, intent(in) :: chi(:)
type(field_type), target, intent(in) :: panel_id
integer(tik) :: id

if ( subroutine_timers ) call timer('io_demo_constants_alg')
if ( LPROF ) call start_timing( id, 'io_demo_constants_alg' )
call log_event( "io_demo: creating runtime constants", LOG_LEVEL_TRACE )

!============================= dx_at_w2 setup =============================!
Expand All @@ -72,7 +73,7 @@ contains
call log_event( "io_demo: runtime constants created", LOG_LEVEL_TRACE )


if ( subroutine_timers ) call timer('io_demo_constants_alg')
if ( LPROF ) call stop_timing( id, 'io_demo_constants_alg' )
call log_event( "io_demo: created FEM constants", LOG_LEVEL_TRACE )

end subroutine create_io_demo_constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module multifile_io_mod
use inventory_by_mesh_mod, only: inventory_by_mesh_type
use io_context_collection_mod, only: io_context_collection_type
use io_context_mod, only: io_context_type, callback_clock_arg
use io_config_mod, only: use_xios_io, subroutine_timers
use io_config_mod, only: use_xios_io
use log_mod, only: log_event, log_level_error, &
log_level_trace, log_level_info, &
log_scratch_space
Expand Down
22 changes: 16 additions & 6 deletions applications/io_demo/source/io_demo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@ program io_demo
log_level_trace, &
log_scratch_space
use random_number_generator_mod, only : random_number_generator_type
use io_demo_mod, only : io_demo_required_namelists
use io_demo_driver_mod, only : initialise, step, finalise
use io_demo_mod, only : io_demo_required_namelists
use io_demo_driver_mod, only : initialise, step, finalise
use timing_mod, only : init_timing, final_timing
use io_config_mod, only : timer_output_path
use namelist_mod, only : namelist_type

implicit none

! The technical and scientific state
type(modeldb_type) :: modeldb
character(*), parameter :: program_name = "io_demo"
character(:), allocatable :: filename
integer, parameter :: default_seed = 123456789
type(modeldb_type) :: modeldb
character(*), parameter :: program_name = "io_demo"
character(:), allocatable :: filename
type(namelist_type), pointer :: io_nml
logical :: lsubroutine_timers
integer, parameter :: default_seed = 123456789
type(random_number_generator_type), pointer :: rng

call parse_command_line( filename )
Expand All @@ -49,6 +54,10 @@ program io_demo
deallocate( filename )

call init_logger( modeldb%mpi%get_comm(), program_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, program_name, timer_output_path )
nullify( io_nml )
call init_collections()
call init_time(modeldb)

Expand All @@ -70,6 +79,7 @@ program io_demo
call finalise( program_name, modeldb )
call final_time(modeldb)
call final_collections()
call final_timing( program_name )
call final_logger( program_name )
call final_config()
call final_comm( modeldb )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ module simple_diffusion_constants_mod
use fs_continuity_mod, only: W2
use function_space_collection_mod, only: function_space_collection
use function_space_mod, only: function_space_type
use io_config_mod, only: subroutine_timers
use log_mod, only: log_event, LOG_LEVEL_TRACE, &
LOG_LEVEL_ERROR
use mesh_mod, only: mesh_type
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF

! Kernels
use sci_calc_da_at_w2_kernel_mod, only: calc_dA_at_w2_kernel_type
Expand Down Expand Up @@ -61,8 +61,9 @@ contains
type(mesh_type), pointer, intent(in) :: mesh
type(field_type), target, intent(in) :: chi(:)
type(field_type), target, intent(in) :: panel_id
integer(tik) :: id

if ( subroutine_timers ) call timer('simple_diffusion_constants_alg')
if ( LPROF ) call start_timing( id, 'simple_diffusion_constants_alg' )
call log_event( "simple_diffusion: creating runtime constants", LOG_LEVEL_TRACE )

!============================= dx_at_w2 setup =============================!
Expand All @@ -72,7 +73,7 @@ contains
call log_event( "simple_diffusion: runtime constants created", LOG_LEVEL_TRACE )


if ( subroutine_timers ) call timer('simple_diffusion_constants_alg')
if ( LPROF ) call stop_timing( id, 'simple_diffusion_constants_alg' )
call log_event( "simple_diffusion: created FEM constants", LOG_LEVEL_TRACE )

end subroutine create_simple_diffusion_constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ module skeleton_constants_mod
use function_space_collection_mod, only: function_space_collection
use function_space_mod, only: function_space_type
use inventory_by_mesh_mod, only: inventory_by_mesh_type
use io_config_mod, only: subroutine_timers
use log_mod, only: log_event, LOG_LEVEL_INFO, &
LOG_LEVEL_ERROR
use mesh_mod, only: mesh_type
use operator_mod, only: operator_type
use quadrature_xyoz_mod, only: quadrature_xyoz_type
use quadrature_rule_gaussian_mod, only: quadrature_rule_gaussian_type
use timer_mod, only: timer
use timing_mod, only: start_timing, stop_timing, &
tik, LPROF

! Configuration
use finite_element_config_mod, only: element_order_h, &
Expand Down Expand Up @@ -109,8 +109,9 @@ contains
type(function_space_type), pointer :: w2v_fs => null()
type(function_space_type), pointer :: w3_fs => null()
type(function_space_type), pointer :: wtheta_fs => null()
integer(tik) :: id

if ( subroutine_timers ) call timer('skeleton_constants_alg')
if ( LPROF ) call start_timing( id, 'skeleton_constants_alg' )
call log_event( "Skeleton: creating runtime constants", LOG_LEVEL_INFO )

!======================== Create quadrature object ========================!
Expand Down Expand Up @@ -178,7 +179,7 @@ contains
mm_w0, mm_w1, mm_w2, mm_w2b, mm_w3, mm_wtheta, grad, curl, div, &
broken_div )

if ( subroutine_timers ) call timer('skeleton_constants_alg')
if ( LPROF ) call stop_timing( id, 'skeleton_constants_alg' )
call log_event( "Skeleton: created FEM constants", LOG_LEVEL_INFO )

end subroutine create_skeleton_constants
Expand Down
66 changes: 0 additions & 66 deletions components/driver/source/driver_timer_mod.f90

This file was deleted.

18 changes: 11 additions & 7 deletions components/lfric-xios/source/lfric_xios_action_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
module lfric_xios_action_mod

use constants_mod, only : str_def
use timing_mod, only : start_timing, stop_timing, tik, LPROF

implicit none

Expand Down Expand Up @@ -36,7 +37,6 @@ subroutine advance(context, model_clock)
!> is old enough to not have xios_get_current_context forwarded through the
!> xios module.
use icontext, only : xios_get_current_context
use timer_mod, only : timer
use xios, only : xios_context, &
xios_set_current_context, &
xios_update_calendar
Expand All @@ -50,6 +50,8 @@ subroutine advance(context, model_clock)
type(lfric_xios_file_type), pointer :: file => null()
type(xios_context) :: xios_context_handle
type(linked_list_type), pointer :: filelist
integer(tik) :: id
logical :: profiling

! Get the handle of the current context (Not necessarily the one passed to this routine).
! This is used to reset the context on return.
Expand All @@ -76,9 +78,10 @@ subroutine advance(context, model_clock)
end if

! Update XIOS calendar
if (context%get_timer_flag()) call timer('xios_update_calendar')
profiling = (context%get_timer_flag() .and. LPROF )
if ( profiling ) call start_timing( id, 'xios_update_calendar' )
call xios_update_calendar( model_clock%get_step() - model_clock%get_first_step() + 1 )
if (context%get_timer_flag()) call timer('xios_update_calendar')
if ( profiling ) call stop_timing( id, 'xios_update_calendar' )

! Read all files that need to be read from
filelist => context%get_filelist()
Expand Down Expand Up @@ -126,7 +129,6 @@ subroutine advance_read_only(context, model_clock)
!> is old enough to not have xios_get_current_context forwarded through the
!> xios module.
use icontext, only : xios_get_current_context
use timer_mod, only : timer
use xios, only : xios_context, &
xios_date, &
xios_set_current_context, &
Expand All @@ -143,6 +145,8 @@ subroutine advance_read_only(context, model_clock)
type(lfric_xios_file_type), pointer :: file => null()
type(xios_context) :: xios_context_handle
type(linked_list_type), pointer :: filelist
integer(tik) :: id
logical :: profiling

! Get the handle of the current context (Not necessarily the one passed to this routine).
! This is used to reset the context on return.
Expand All @@ -153,10 +157,10 @@ subroutine advance_read_only(context, model_clock)
call context%set_current()
call context%tick_context_clock()
! Update XIOS calendar
if (context%get_timer_flag()) call timer('xios_update_calendar')

profiling = ( context%get_timer_flag() .and. LPROF )
if ( profiling ) call start_timing( id, 'xios_update_calendar' )
call xios_update_calendar( context%get_context_clock_step() )
if (context%get_timer_flag()) call timer('xios_update_calendar')
if ( profiling ) call stop_timing( id, 'xios_update_calendar' )

! Read all files that need to be read from
filelist => context%get_filelist()
Expand Down
Loading