Work in progress!
Clocks are essential to keep things synchronized. This is also the case in Octopus, where instances of the
clock_t type are used to ensure that different systems stay in sync during time propagation. Clocks are used to determine whether quantities or interactions need to be updated in a propagation step.
The smallest unit of time in Octopus is one
type clock_t private integer :: tick !< internal clock counter which is incremented by one when the clock is advanced FLOAT :: time_step !< physical simulation time increment which corresponds to a single clock tick FLOAT :: time_ !< physical simulation time contains procedure :: print => clock_print !< print internal state of the clock procedure :: print_str => clock_print_str !< print internal state of the clock to a string procedure :: set_time => clock_set_time !< set the clock only to the time of a given input clock procedure :: copy => clock_copy !< set the clock to the state of a given input clock procedure :: get_tick => clock_get_tick !< get value of internal clock counter procedure :: time => clock_time !< get the current physical simulation time of the clock procedure :: reset => clock_reset !< set the internal clock counter back to zero procedure :: clock_is_equal generic :: operator(.eq.) => clock_is_equal procedure :: clock_is_different generic :: operator(/=) => clock_is_different procedure :: clock_is_earlier generic :: operator(.lt.) => clock_is_earlier procedure :: clock_is_later generic :: operator(.gt.) => clock_is_later procedure :: clock_is_equal_or_earlier generic :: operator(.le.) => clock_is_equal_or_earlier procedure :: clock_is_equal_or_later generic :: operator(.ge.) => clock_is_equal_or_later procedure :: clock_copy generic :: assignment(=) => clock_copy procedure :: clock_add_tick generic :: operator(+) => clock_add_tick procedure :: clock_subtract_tick generic :: operator(-) => clock_subtract_tick procedure :: restart_write => clock_restart_write procedure :: restart_read => clock_restart_read end type clock_t