80 integer,
parameter :: LR = 1,
fd = 2
87 type(namespace_t),
intent(in) :: namespace
126 subroutine run(namespace, calc_mode_id)
127 type(namespace_t),
intent(in) :: namespace
128 integer,
intent(in) :: calc_mode_id
130 type(partner_list_t) :: partners
131 class(system_t),
pointer :: systems
132 type(system_factory_t) :: system_factory
133 type(interactions_factory_t) :: interactions_factory
134 logical :: from_scratch
136 type(partner_iterator_t) :: iter
137 type(system_list_t) :: flat_list
138 class(interaction_partner_t),
pointer :: partner
139 real(real64) :: largest_dt, largest_allowed_time
149 if (calc_mode_id == option__calculationmode__recipe)
then
162 if (calc_mode_id == option__calculationmode__test)
then
184 select type (systems)
187 partners = systems%list
197 call partners%add(systems)
209 select type (systems)
211 if (systems%hm%ep%requires_generalized_overlap)
then
212 select case (calc_mode_id)
213 case (option__calculationmode__gs, option__calculationmode__td, &
214 option__calculationmode__unocc, option__calculationmode__casida)
216 case (option__calculationmode__go)
218 case (option__calculationmode__vib_modes)
222 "Sternheimer vib_modes (ResponseMethod = lr) with ultrasoft/PAW; "//&
223 "use ResponseMethod = finite_differences", namespace=namespace)
227 "CalculationMode other than GS, TD, UNOCC, GO, Casida or "//&
228 "(finite-difference) vib_modes with ultrasoft/PAW generalized overlap", &
235 select type (systems)
237 select case (calc_mode_id)
238 case (option__calculationmode__gs)
240 case (option__calculationmode__td)
265 if(calc_mode_id == option__calculationmode__td)
then
267 select type (sys => systems)
271 largest_allowed_time =
m_zero
273 call sys%get_flat_list(flat_list)
275 call iter%start(flat_list)
276 do while (iter%has_next())
277 select type (subsystem => iter%get_next())
279 select type (subalgorithm => subsystem%algo)
281 largest_dt = max(largest_dt, subalgorithm%dt)
286 select type(prop => systems%algo)
288 largest_allowed_time =
floor(prop%final_time / largest_dt)* largest_dt
293 call iter%start(flat_list)
294 do while (iter%has_next())
295 select type(subsystem => iter%get_next())
297 select type (subalgorithm => subsystem%algo)
299 if(
floor(subalgorithm%final_time/subalgorithm%dt) * subalgorithm%dt > largest_allowed_time )
then
300 write(
message(1), *)
"Incommensurate propagation time: The calculation would run into a deadlock, as a system with"
301 write(
message(2), *)
"a smaller timestep would attempt a timestep beyond the last step" &
302 //
" of a system with a larger time step."
303 write(
message(3), *)
"Please, adjust the TDPropagationTime and/or the TDTimeStep variables of the systems."
305 write(
message(5), *)
"With the current timesteps, the TDPropagationTime should be ", largest_allowed_time
321 call systems%create_interactions(interactions_factory, partners)
324 select type (systems)
327 if ((
debug%interaction_graph .or.
debug%interaction_graph_full) .and.
mpi_world%is_root())
then
328 iunit_out =
io_open(
'debug/interaction_graph.dot', systems%namespace, action=
'write')
329 write(iunit_out,
'(a)')
'digraph {'
330 call systems%write_interaction_graph(iunit_out,
debug%interaction_graph_full)
331 write(iunit_out,
'(a)')
'}'
336 if (.not. systems%process_is_slave())
then
352 call parse_variable(namespace,
'FromScratch', .false., from_scratch)
356 select case (calc_mode_id)
357 case (option__calculationmode__gs)
358 select type (systems)
362 call systems%ground_state_run(from_scratch)
364 case (option__calculationmode__unocc)
366 case (option__calculationmode__td)
367 select type (systems)
373 case (option__calculationmode__go)
375 case (option__calculationmode__opt_control)
377 case (option__calculationmode__em_resp)
384 case (option__calculationmode__casida)
386 case (option__calculationmode__vdw)
387 call vdw_run(systems, from_scratch)
388 case (option__calculationmode__vib_modes)
395 case (option__calculationmode__one_shot)
396 message(1) =
"CalculationMode = one_shot is obsolete. Please use gs with MaximumIter = 0."
398 case (option__calculationmode__kdotp)
400 case (option__calculationmode__dummy)
401 case (option__calculationmode__invert_ks)
403 case (option__calculationmode__recipe)
410 select type (systems)
413 call iter%start(partners)
414 do while (iter%has_next())
415 select type(ptr => iter%get_next())
418 safe_deallocate_p(partner)
421 safe_deallocate_p(partner)
424 safe_deallocate_p(partner)
430 safe_deallocate_p(systems)
444 integer,
intent(in) :: calc_mode_id
448 select case (calc_mode_id)
449 case (option__calculationmode__gs, option__calculationmode__go, option__calculationmode__unocc)
455 case (option__calculationmode__td)
458 case (option__calculationmode__casida)
double floor(double __x) __attribute__((__nothrow__
subroutine, public accel_init(base_grp, namespace)
subroutine, public accel_end(namespace)
This module handles the calculation mode.
integer, parameter, public p_strategy_kpoints
parallelization in k-points
integer, parameter, public p_strategy_other
something else like e-h pairs
type(calc_mode_par_t), public calc_mode_par
Singleton instance of parallel calculation mode.
integer, parameter, public p_strategy_states
parallelization in states
This module implements the Casida equations for excited states.
subroutine, public casida_run(system, from_scratch)
type(debug_t), save, public debug
subroutine, public em_resp_run(system, from_scratch)
subroutine, public load_external_potentials(external_potentials, namespace)
subroutine, public load_external_waves(partners, namespace)
Fast Fourier Transform module. This module provides a single interface that works with different FFT ...
subroutine, public fft_all_init(namespace)
initialize the table
subroutine, public fft_all_end()
delete all plans
subroutine, public geom_opt_run(system, from_scratch)
real(real64), parameter, public m_zero
This module defines classes and functions for interaction partners.
subroutine, public invert_ks_run(system)
subroutine, public io_close(iunit, grp)
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
subroutine, public kdotp_lr_run(system, from_scratch)
subroutine, public load_lasers(partners, namespace)
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
subroutine, public messages_not_implemented(feature, namespace)
character(len=512), private msg
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
This module implements the factory for ground state algorithm.
subroutine, public mpi_debug_statistics()
type(mpi_grp_t), public mpi_world
This module handles the communicators for the various parallelization strategies.
This module implements the basic mulsisystem class, a container system for other systems.
This module implements the multisystem debug functionality.
subroutine, public multisystem_run(systems, from_scratch)
type(namespace_t), public global_namespace
This module contains the main procedure ("opt_control_run") that is used when optimal control runs ar...
subroutine, public opt_control_run(system)
logical function, public parse_is_defined(namespace, name)
subroutine, public phonons_run(system)
subroutine, public phonons_lr_run(system, from_scratch)
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
This module implements the factory for propagators.
This module implements the basic propagator framework.
subroutine, public pulpo_print()
top level module for all calculation modes
integer function get_resp_method(namespace)
query input file for the response mode.
subroutine calc_mode_parallel_strategy_init(calc_mode_id)
Calculation mode initialization (parallelization strategy)
subroutine, public run(namespace, calc_mode_id)
main routine to run all calculations: This routine parses the input file, sets up the systems and int...
subroutine, public static_pol_run(system, from_scratch)
integer, parameter, public system_multisystem
container system. (multisystem_basic_oct_m::multisystem_basic_t)
This module implements the abstract system type.
subroutine, public time_dependent_run(electrons, from_scratch)
This module defines the unit system, used for input and output.
subroutine, public unit_system_init(namespace)
subroutine, public unocc_run(system, from_scratch)
subroutine, public vdw_run(system, from_scratch)
Class describing the electron system.
This class defines the factory for minimizers.
Container class for lists of system_oct_m::system_t.
This class defines the factory for propagators.
Abstract class implementing propagators.
Abstract class for systems.