Octopus
algorithm_oct_m Module Reference

This module implements the basic elements defining algorithms. More...

Detailed Description

This module implements the basic elements defining algorithms.

An algorithm is composed of algorithmic operations that are repeated in a loop.

Unsurprisingly, those repetitions are called iterations. The way how one keeps track of the iterations is with iteration counters.

Then each iteration is divided into algorithmic steps, and there is one interaction update per algorithmic step. The concept of algorithmic step is necessary to ensure that the couplings are updated at the right iteration, knowing that some systems might execute algorithms with a different number of algorithmic steps and/or have a different granularity.

Data Types

interface  algorithm_finished
 indicate whether the algorithm has finished one time step More...
 
interface  algorithm_init_iteration_counters
 initializes the algorithm and system iteration counters More...
 
type  algorithm_iterator_t
 Iterator to loop over the algorithmic operations of an algorithm. More...
 
type  algorithm_t
 An algorithm is a list of algorithmic operations executed sequentially. More...
 
type  algorithmic_operation_t
 Descriptor of one algorithmic operation. More...
 

Functions/Subroutines

subroutine algorithm_add_operation (this, operation)
 add an algorithmic operation to the list More...
 
logical function algorithm_do_operation (this, operation)
 try to perform one operation of the algorithm. If successfull return .true. More...
 
subroutine algorithm_update_elapsed_time (this)
 The elapsed time is used for the output of run time information. More...
 
subroutine algorithm_rewind (this)
 Reset the algorithm to the first operation. More...
 
subroutine algorithm_next (this)
 move to the next algorithmic operation More...
 
type(algorithmic_operation_t) function algorithm_get_current_operation (this)
 return the current algorithmic operation. More...
 
type(algorithmic_operation_t) function algorithm_iterator_get_next (this)
 Get the next algorithmic operation from the iterator. More...
 

Variables

integer, parameter, public algo_label_len = 50
 
character(len=algo_label_len), parameter, public skip = 'SKIP'
 Operations that can be used by any algorithm and, therefore, should be implemented by all systems. More...
 
character(len=algo_label_len), parameter, public update_couplings = 'UPDATE_COUPLINGS'
 
character(len=algo_label_len), parameter, public update_interactions = 'UPDATE_INTERACTIONS'
 
character(len=algo_label_len), parameter, public iteration_done = 'ITERATION_DONE'
 
character(len=algo_label_len), parameter, public rewind_algorithm = 'REWIND_ALGORITHM'
 
type(algorithmic_operation_t), parameter, public op_skip = algorithmic_operation_t(SKIP, 'Skipping algorithmic operation')
 
type(algorithmic_operation_t), parameter, public op_update_couplings = algorithmic_operation_t(UPDATE_COUPLINGS, 'Algorithmic operation - Updating couplings')
 
type(algorithmic_operation_t), parameter, public op_update_interactions = algorithmic_operation_t(UPDATE_INTERACTIONS, 'Algorithmic operation - Updating interactions')
 
type(algorithmic_operation_t), parameter, public op_iteration_done = algorithmic_operation_t(ITERATION_DONE, 'Iteration finished')
 
type(algorithmic_operation_t), parameter, public op_rewind_algorithm = algorithmic_operation_t(REWIND_ALGORITHM, 'Rewind algorithm')
 

Function/Subroutine Documentation

◆ algorithm_add_operation()

subroutine algorithm_oct_m::algorithm_add_operation ( class(algorithm_t), intent(inout)  this,
type(algorithmic_operation_t), intent(in)  operation 
)
private

add an algorithmic operation to the list

Definition at line 259 of file algorithm.F90.

◆ algorithm_do_operation()

logical function algorithm_oct_m::algorithm_do_operation ( class(algorithm_t), intent(inout)  this,
type(algorithmic_operation_t), intent(in)  operation 
)
private

try to perform one operation of the algorithm. If successfull return .true.

Definition at line 273 of file algorithm.F90.

◆ algorithm_update_elapsed_time()

subroutine algorithm_oct_m::algorithm_update_elapsed_time ( class(algorithm_t), intent(inout)  this)
private

The elapsed time is used for the output of run time information.

Definition at line 287 of file algorithm.F90.

◆ algorithm_rewind()

subroutine algorithm_oct_m::algorithm_rewind ( class(algorithm_t), intent(inout)  this)
private

Reset the algorithm to the first operation.

Definition at line 300 of file algorithm.F90.

◆ algorithm_next()

subroutine algorithm_oct_m::algorithm_next ( class(algorithm_t), intent(inout)  this)
private

move to the next algorithmic operation

Definition at line 317 of file algorithm.F90.

◆ algorithm_get_current_operation()

type(algorithmic_operation_t) function algorithm_oct_m::algorithm_get_current_operation ( class(algorithm_t), intent(in)  this)
private

return the current algorithmic operation.

Definition at line 330 of file algorithm.F90.

◆ algorithm_iterator_get_next()

type(algorithmic_operation_t) function algorithm_oct_m::algorithm_iterator_get_next ( class(algorithm_iterator_t), intent(inout)  this)
private

Get the next algorithmic operation from the iterator.

This function is necessary to specialize the deferred method of the linked list.

Definition at line 345 of file algorithm.F90.

Variable Documentation

◆ algo_label_len

integer, parameter, public algorithm_oct_m::algo_label_len = 50

Definition at line 157 of file algorithm.F90.

◆ skip

character(len=algo_label_len), parameter, public algorithm_oct_m::skip = 'SKIP'

Operations that can be used by any algorithm and, therefore, should be implemented by all systems.

Definition at line 172 of file algorithm.F90.

◆ update_couplings

character(len=algo_label_len), parameter, public algorithm_oct_m::update_couplings = 'UPDATE_COUPLINGS'

Definition at line 172 of file algorithm.F90.

◆ update_interactions

character(len=algo_label_len), parameter, public algorithm_oct_m::update_interactions = 'UPDATE_INTERACTIONS'

Definition at line 172 of file algorithm.F90.

◆ iteration_done

character(len=algo_label_len), parameter, public algorithm_oct_m::iteration_done = 'ITERATION_DONE'

Definition at line 172 of file algorithm.F90.

◆ rewind_algorithm

character(len=algo_label_len), parameter, public algorithm_oct_m::rewind_algorithm = 'REWIND_ALGORITHM'

Definition at line 172 of file algorithm.F90.

◆ op_skip

type(algorithmic_operation_t), parameter, public algorithm_oct_m::op_skip = algorithmic_operation_t(SKIP, 'Skipping algorithmic operation')

Definition at line 179 of file algorithm.F90.

◆ op_update_couplings

type(algorithmic_operation_t), parameter, public algorithm_oct_m::op_update_couplings = algorithmic_operation_t(UPDATE_COUPLINGS, 'Algorithmic operation - Updating couplings')

Definition at line 179 of file algorithm.F90.

◆ op_update_interactions

type(algorithmic_operation_t), parameter, public algorithm_oct_m::op_update_interactions = algorithmic_operation_t(UPDATE_INTERACTIONS, 'Algorithmic operation - Updating interactions')

Definition at line 179 of file algorithm.F90.

◆ op_iteration_done

type(algorithmic_operation_t), parameter, public algorithm_oct_m::op_iteration_done = algorithmic_operation_t(ITERATION_DONE, 'Iteration finished')

Definition at line 179 of file algorithm.F90.

◆ op_rewind_algorithm

type(algorithmic_operation_t), parameter, public algorithm_oct_m::op_rewind_algorithm = algorithmic_operation_t(REWIND_ALGORITHM, 'Rewind algorithm')

Definition at line 179 of file algorithm.F90.