64 integer,
parameter,
public :: ALGO_LABEL_LEN = 50
71 character(len=ALGO_LABEL_LEN) :: id
73 character(len=ALGO_LABEL_LEN) :: label
79 character(len=ALGO_LABEL_LEN),
public,
parameter :: &
86 type(algorithmic_operation_t),
public,
parameter :: &
109 type(algorithm_iterator_t),
public :: iter
110 type(algorithmic_operation_t) :: current_ops
112 type(algorithmic_operation_t),
public :: start_operation
117 type(algorithmic_operation_t),
public :: final_operation
122 integer,
public :: algo_steps
130 logical :: iteration_done
132 type(iteration_counter_t),
public :: iteration
133 real(real64) :: start_time =
m_zero
134 real(real64),
public :: elapsed_time =
m_zero
143 procedure(algorithm_finished),
deferred :: finished
144 procedure(algorithm_init_iteration_counters),
deferred :: init_iteration_counters
145 procedure(algorithm_write_output_header),
deferred :: write_output_header
146 procedure(algorithm_continues_after_finished),
deferred :: continues_after_finished
147 procedure(algorithm_print_speed),
deferred :: print_speed
155 class(algorithm_t),
intent(in) :: this
192 class(algorithm_t),
intent(inout) :: this
193 type(algorithmic_operation_t),
intent(in) :: operation
197 call this%add_copy(operation)
224 this%elapsed_time =
loct_clock() - this%start_time
239 call this%iter%start(this)
254 this%current_ops = this%iter%get_next()
265 push_sub(algorithm_get_current_operation)
267 operation = this%current_ops
269 pop_sub(algorithm_get_current_operation)
283 assert(this%has_next())
285 select type (ptr => this%get_next_ptr())
indicate whether the algorithm should continue executing after finishing, or should set a barrier
indicate whether the algorithm has finished one time step
initializes the algorithm and system iteration counters
Define which routines can be seen from the outside.
This module implements the basic elements defining algorithms.
character(len=algo_label_len), parameter, public update_interactions
character(len=algo_label_len), parameter, public rewind_algorithm
type(algorithmic_operation_t), parameter, public op_iteration_done
character(len=algo_label_len), parameter, public update_couplings
type(algorithmic_operation_t), parameter, public op_rewind_algorithm
type(algorithmic_operation_t) function algorithm_get_current_operation(this)
return the current algorithmic operation.
subroutine algorithm_rewind(this)
Reset the algorithm to the first operation.
type(algorithmic_operation_t) function algorithm_iterator_get_next(this)
Get the next algorithmic operation from the iterator.
type(algorithmic_operation_t), parameter, public op_update_couplings
character(len=algo_label_len), parameter, public iteration_done
subroutine algorithm_add_operation(this, operation)
add an algorithmic operation to the list
subroutine algorithm_update_elapsed_time(this)
The elapsed time is used for the output of run time information.
subroutine algorithm_next(this)
move to the next algorithmic operation
logical function algorithm_do_operation(this, operation)
try to perform one operation of the algorithm. If successfull return .true.
type(algorithmic_operation_t), parameter, public op_update_interactions
real(real64), parameter, public m_zero
This module implements fully polymorphic linked lists, and some specializations thereof.
Iterator to loop over the algorithmic operations of an algorithm.
An algorithm is a list of algorithmic operations executed sequentially.
Descriptor of one algorithmic operation.
This class implements an iterator for the polymorphic linked list.
This class implements a linked list of unlimited polymorphic values.