47 class(system_t),
pointer,
public :: system
49 type(algorithm_iterator_t) :: scf_start
53 real(real64),
public :: dt
54 real(real64),
public :: final_time =
m_zero
57 logical,
public :: inside_scf = .false.
58 logical,
public :: predictor_corrector = .false.
59 integer,
public :: scf_count
60 integer,
public :: max_scf_count
61 integer,
public :: accumulated_loop_ticks
62 real(real64),
public :: scf_tol
76 character(len=ALGO_LABEL_LEN),
public,
parameter :: &
77 START_SCF_LOOP =
'START_SCF_LOOP', &
81 type(algorithmic_operation_t),
public,
parameter :: &
93 class(propagator_t),
intent(inout) :: this
94 type(algorithmic_operation_t),
intent(in) :: operation
98 select case (operation%id)
101 this%accumulated_loop_ticks = this%accumulated_loop_ticks + 1
104 case (start_scf_loop)
105 assert(this%predictor_corrector)
107 call this%save_scf_start()
108 this%inside_scf = .
true.
109 this%accumulated_loop_ticks = 0
112 write(
message(1),
'(a,i3,a)')
"Debug: -- SCF iter ", this%scf_count,
" for '" + trim(this%system%namespace%get()) +
"'"
119 if (this%scf_count == this%max_scf_count)
then
121 message(1) =
"Debug: -- Max SCF Iter reached for '" + trim(this%system%namespace%get()) +
"'"
124 this%inside_scf = .false.
128 if (this%system%is_tolerance_reached(this%scf_tol))
then
130 message(1) =
"Debug: -- SCF tolerance reached for '" + trim(this%system%namespace%get()) +
"'"
133 this%inside_scf = .false.
137 call this%rewind_scf_loop()
140 call this%system%reset_iteration_counters(this%accumulated_loop_ticks)
141 this%accumulated_loop_ticks = 0
143 write(
message(1),
'(a,i3,a,a)')
"Debug: -- SCF iter ", this%scf_count,
" for '" + trim(this%system%namespace%get()),
"'"
163 clock_ = this%system%iteration + 1
176 this%iteration =
clock_t(time_step=this%dt/this%algo_steps)
177 this%system%iteration =
clock_t(time_step=this%dt)
188 this%scf_start = this%iter
203 this%iter = this%scf_start
205 this%scf_count = this%scf_count + 1
216 write(
message(1),
'(a6,1x,a14,1x,a13,1x,a10,1x,a15)')
'Iter',
'Time',
'Energy',
'SC Steps',
'Elapsed Time'
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.
type(algorithmic_operation_t), parameter, public op_end_scf_loop
This module implements the abstract system type.
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.