MONC
Functions/Subroutines | Variables
timestepper_mod Module Reference

Performs the actual time stepping over groups of components. Each group can be the whole (which is one call per component per timestep) or column, which calls components for each column of the timestep. Groups are executed sequentially in the order that they have been configured (which is already set up in the registry) More...

Functions/Subroutines

subroutine, public init_timestepper ()
 Initialises the timestepper by prefetching the groups in the order that they will be executed, this is for optimised execution in the timestep calls. More...
 
subroutine, public timestep (current_state)
 Performs a timestep, which is comprised of executing each group of components in the order that they have been configured in. The components in a group can be called, depending on the type, just once per timestep (WHOLE) or per column (COLUMN). More...
 
subroutine, public finalise_timestepper ()
 Finalises the timestepper by cleaning up allocated memory. More...
 
subroutine timestep_column (current_state, group_descriptor)
 Performs timestepping for a group of components on a per column basis. Each component in the group is executed for every column. More...
 
subroutine timestep_whole (current_state, group_descriptor)
 Executes a timestep for components in a group which are designed to be executed once per timestep. More...
 
subroutine update_state_sitation_flags (current_state)
 Updates the states situation flags for easy retrieval in the components that are run per timestep. More...
 

Variables

type(group_descriptor_type), dimension(:), allocatable group_descriptors
 Prefetched ordered group descriptors. More...
 

Detailed Description

Performs the actual time stepping over groups of components. Each group can be the whole (which is one call per component per timestep) or column, which calls components for each column of the timestep. Groups are executed sequentially in the order that they have been configured (which is already set up in the registry)

Function/Subroutine Documentation

◆ finalise_timestepper()

subroutine, public timestepper_mod::finalise_timestepper

Finalises the timestepper by cleaning up allocated memory.

Definition at line 44 of file timestepper.F90.

45  deallocate(group_descriptors)
Here is the caller graph for this function:

◆ init_timestepper()

subroutine, public timestepper_mod::init_timestepper

Initialises the timestepper by prefetching the groups in the order that they will be executed, this is for optimised execution in the timestep calls.

Definition at line 22 of file timestepper.F90.

23  call get_ordered_groups(group_descriptors)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ timestep()

subroutine, public timestepper_mod::timestep ( type(model_state_type), intent(inout)  current_state)

Performs a timestep, which is comprised of executing each group of components in the order that they have been configured in. The components in a group can be called, depending on the type, just once per timestep (WHOLE) or per column (COLUMN).

Parameters
current_stateThe current model state

Definition at line 29 of file timestepper.F90.

30  type(model_state_type), intent(inout) :: current_state
31 
32  integer :: i
33 
34  do i=1,size(group_descriptors)
35  if (group_descriptors(i)%type == group_type_whole) then
36  call timestep_whole(current_state, group_descriptors(i))
37  else if (group_descriptors(i)%type == group_type_column) then
38  call timestep_column(current_state, group_descriptors(i))
39  end if
40  end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ timestep_column()

subroutine timestepper_mod::timestep_column ( type(model_state_type), intent(inout)  current_state,
type(group_descriptor_type), intent(in)  group_descriptor 
)
private

Performs timestepping for a group of components on a per column basis. Each component in the group is executed for every column.

Parameters
current_stateThe current model state
group_descriptorDescription of the group of components to execute

Definition at line 52 of file timestepper.F90.

53  type(model_state_type), intent(inout) :: current_state
54  type(group_descriptor_type), intent(in) :: group_descriptor
55 
56  current_state%column_global_x=current_state%local_grid%start(x_index) - current_state%local_grid%halo_size(x_index)
57  current_state%column_local_x=1
58  do while (current_state%column_global_x .le. &
59  current_state%local_grid%end(x_index)+current_state%local_grid%halo_size(x_index))
60  current_state%column_global_y = current_state%local_grid%start(y_index) - current_state%local_grid%halo_size(y_index)
61  current_state%column_local_y=1
62  do while (current_state%column_global_y .le. &
63  current_state%local_grid%end(y_index)+current_state%local_grid%halo_size(y_index))
64  call update_state_sitation_flags(current_state)
65  call execute_timestep_callbacks(current_state, group_descriptor%id)
66  current_state%column_global_y = current_state%column_global_y + 1
67  current_state%column_local_y = current_state%column_local_y + 1
68  end do
69  current_state%column_global_x = current_state%column_global_x + 1
70  current_state%column_local_x = current_state%column_local_x + 1
71  end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ timestep_whole()

subroutine timestepper_mod::timestep_whole ( type(model_state_type), intent(inout)  current_state,
type(group_descriptor_type), intent(in)  group_descriptor 
)
private

Executes a timestep for components in a group which are designed to be executed once per timestep.

Parameters
current_stateThe current model state
group_descriptorDescription of the group of components to execute

Definition at line 77 of file timestepper.F90.

78  type(model_state_type), intent(inout) :: current_state
79  type(group_descriptor_type), intent(in) :: group_descriptor
80 
81  call execute_timestep_callbacks(current_state, group_descriptor%id)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_state_sitation_flags()

subroutine timestepper_mod::update_state_sitation_flags ( type(model_state_type), intent(inout)  current_state)
private

Updates the states situation flags for easy retrieval in the components that are run per timestep.

Parameters
stateThe current model state

Definition at line 87 of file timestepper.F90.

88  type(model_state_type), intent(inout) :: current_state
89 
90  current_state%first_timestep_column = (current_state%column_local_x == 1 .and. current_state%column_local_y == 1)
91  current_state%last_timestep_column = (current_state%column_global_x == &
92  current_state%local_grid%end(x_index) + current_state%local_grid%halo_size(x_index) .and. &
93  current_state%column_global_y == current_state%local_grid%end(y_index) + current_state%local_grid%halo_size(y_index))
94 
95  current_state%first_nonhalo_timestep_column = (current_state%column_local_x == current_state%local_grid%halo_size(x_index)+1 &
96  .and. current_state%column_local_y == current_state%local_grid%halo_size(y_index)+1)
97 
98  current_state%halo_column = current_state%column_local_y .lt. current_state%local_grid%local_domain_start_index(y_index) .or.&
99  current_state%column_local_x .lt. current_state%local_grid%local_domain_start_index(x_index) .or.&
100  current_state%column_local_y .gt. current_state%local_grid%local_domain_end_index(y_index) .or.&
101  current_state%column_local_x .gt. current_state%local_grid%local_domain_end_index(x_index)
Here is the caller graph for this function:

Variable Documentation

◆ group_descriptors

type(group_descriptor_type), dimension(:), allocatable timestepper_mod::group_descriptors
private

Prefetched ordered group descriptors.

Definition at line 15 of file timestepper.F90.

15  type(group_descriptor_type), dimension(:), allocatable :: group_descriptors
grids_mod::x_index
integer, parameter, public x_index
Definition: grids.F90:14
grids_mod::y_index
integer, parameter, public y_index
Definition: grids.F90:14