51 class(system_t),
pointer,
public :: system
53 type(algorithm_iterator_t) :: scf_start
57 real(real64),
public :: dt
58 real(real64),
public :: final_time =
m_zero
61 logical,
public :: inside_scf = .false.
62 logical,
public :: predictor_corrector = .false.
63 integer,
public :: scf_count
64 integer,
public :: max_scf_count
65 integer,
public :: accumulated_loop_ticks
66 real(real64),
public :: scf_tol
81 character(len=ALGO_LABEL_LEN),
public,
parameter :: &
82 START_SCF_LOOP =
'START_SCF_LOOP', &
86 type(algorithmic_operation_t),
public,
parameter :: &
98 class(propagator_t),
intent(inout) :: this
99 type(algorithmic_operation_t),
intent(in) :: operation
103 select case (operation%id)
106 this%accumulated_loop_ticks = this%accumulated_loop_ticks + 1
109 case (start_scf_loop)
110 assert(this%predictor_corrector)
112 call this%save_scf_start()
113 this%inside_scf = .
true.
114 this%accumulated_loop_ticks = 0
117 write(
message(1),
'(a,i3,a)')
"Debug: -- SCF iter ", this%scf_count,
" for '" + trim(this%system%namespace%get()) +
"'"
124 if (this%scf_count == this%max_scf_count)
then
126 message(1) =
"Debug: -- Max SCF Iter reached for '" + trim(this%system%namespace%get()) +
"'"
129 this%inside_scf = .false.
133 if (this%system%is_tolerance_reached(this%scf_tol))
then
135 message(1) =
"Debug: -- SCF tolerance reached for '" + trim(this%system%namespace%get()) +
"'"
138 this%inside_scf = .false.
142 call this%rewind_scf_loop()
145 call this%system%reset_iteration_counters(this%accumulated_loop_ticks)
146 this%accumulated_loop_ticks = 0
148 write(
message(1),
'(a,i3,a,a)')
"Debug: -- SCF iter ", this%scf_count,
" for '" + trim(this%system%namespace%get()),
"'"
168 clock_ = this%system%iteration + 1
181 this%iteration =
clock_t(time_step=this%dt/this%algo_steps)
182 this%system%iteration =
clock_t(time_step=this%dt)
193 this%scf_start = this%iter
208 this%iter = this%scf_start
210 this%scf_count = this%scf_count + 1
221 write(
message(1),
'(a6,1x,a14,1x,a13,1x,a10,1x,a15)')
'Iter',
'Time',
'Energy',
'SC Steps',
'Elapsed Time'
245 real(real64) :: wall_time, simulation_time, speed_fs_per_day
249 simulation_time = this%iteration%value(elapsed=.
true.)
251 write(
message(1),
'(a,f10.3,a)')
'Propagation speed: ', speed_fs_per_day,
' fs/day'
This module implements the basic elements defining algorithms.
character(len=algo_label_len), parameter, public update_interactions
type(debug_t), save, public debug
real(real64), parameter, public m_zero
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
character(len=512), private msg
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
This module implements the basic propagator framework.
character(len=algo_label_len), parameter, public store_current_status
type(algorithmic_operation_t), parameter, public op_store_current_status
logical function propagator_continues_after_finished(this)
subroutine propagator_rewind_scf_loop(this)
Reset the iteration state to the beginning of the loop (START_SCF_LOOP) and move to next step.
subroutine propagator_write_output_header(this)
subroutine propagator_save_scf_start(this)
Save the current iteration state (START_SCF_LOOP) and move to next step.
logical function propagator_do_operation(this, operation)
Try to perform one operation of the algorithm. Return .true. if sucessful.
logical function propagator_finished(this)
indicate whether a propagation has reached the final time
character(len=algo_label_len), parameter, public end_scf_loop
subroutine propagator_init_iteration_counters(this)
Initialize the propagator and system clocks.
subroutine propagator_print_speed(this)
print iteration speed, i.e., fs/day of wall clock time
type(algorithmic_operation_t), parameter, public op_end_scf_loop
This module implements the abstract system type.
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
type(unit_t), public unit_femtosecond
Time in femtoseconds.
This module provices a simple timer class which can be used to trigger the writing of a restart file ...
real(real64) function, public walltimer_get_start_time()
Return the walltimer start time.
An algorithm is a list of algorithmic operations executed sequentially.
Descriptor of one algorithmic operation.
This class implements the iteration counter used by the multisystem algorithms. As any iteration coun...
Abstract class implementing propagators.