75 integer,
parameter :: LR = 1,
fd = 2
82 type(namespace_t),
intent(in) :: namespace
121 subroutine run(namespace, calc_mode_id)
122 type(namespace_t),
intent(in) :: namespace
123 integer,
intent(in) :: calc_mode_id
125 type(partner_list_t) :: partners
126 class(system_t),
pointer :: systems
127 type(system_factory_t) :: system_factory
128 type(interactions_factory_t) :: interactions_factory
129 logical :: from_scratch
131 type(partner_iterator_t) :: iter
132 type(system_list_t) :: flat_list
133 class(interaction_partner_t),
pointer :: partner
134 real(real64) :: largest_dt, largest_allowed_time
144 if (calc_mode_id == option__calculationmode__recipe)
then
157 if (calc_mode_id == option__calculationmode__test)
then
171 systems => electrons_t(namespace, generate_epot = calc_mode_id /= option__calculationmode__dummy)
175 call systems%init_parallelization(
mpi_world)
178 select type (systems)
181 partners = systems%list
190 type is (electrons_t)
191 call partners%add(systems)
195 select type (systems)
197 select case (calc_mode_id)
198 case (option__calculationmode__gs)
200 case (option__calculationmode__td)
225 if(calc_mode_id == option__calculationmode__td)
then
227 select type (sys => systems)
231 largest_allowed_time =
m_zero
233 call sys%get_flat_list(flat_list)
235 call iter%start(flat_list)
236 do while (iter%has_next())
237 select type (subsystem => iter%get_next())
239 select type (subalgorithm => subsystem%algo)
241 largest_dt = max(largest_dt, subalgorithm%dt)
246 select type(prop => systems%algo)
248 largest_allowed_time =
floor(prop%final_time / largest_dt)* largest_dt
253 call iter%start(flat_list)
254 do while (iter%has_next())
255 select type(subsystem => iter%get_next())
257 select type (subalgorithm => subsystem%algo)
259 if(
floor(subalgorithm%final_time/subalgorithm%dt) * subalgorithm%dt > largest_allowed_time )
then
260 write(
message(1), *)
"Incommensurate propagation time: The calculation would run into a deadlock, as a system with"
261 write(
message(2), *)
"a smaller timestep would attempt a timestep beyond the last step" &
262 //
" of a system with a larger time step."
263 write(
message(3), *)
"Please, adjust the TDPropagationTime and/or the TDTimeStep variables of the systems."
265 write(
message(5), *)
"With the current timesteps, the TDPropagationTime should be ", largest_allowed_time
281 call systems%create_interactions(interactions_factory, partners)
284 select type (systems)
287 if ((debug%interaction_graph .or. debug%interaction_graph_full) .and.
mpi_world%is_root())
then
288 iunit_out = io_open(
'debug/interaction_graph.dot', systems%namespace, action=
'write')
289 write(iunit_out,
'(a)')
'digraph {'
290 call systems%write_interaction_graph(iunit_out, debug%interaction_graph_full)
291 write(iunit_out,
'(a)')
'}'
292 call io_close(iunit_out)
296 if (.not. systems%process_is_slave())
then
312 call parse_variable(namespace,
'FromScratch', .false., from_scratch)
316 select case (calc_mode_id)
317 case (option__calculationmode__gs)
318 select type (systems)
321 type is (electrons_t)
322 call systems%ground_state_run(from_scratch)
324 case (option__calculationmode__unocc)
326 case (option__calculationmode__td)
327 select type (systems)
330 type is (electrons_t)
333 case (option__calculationmode__go)
335 case (option__calculationmode__opt_control)
337 case (option__calculationmode__em_resp)
344 case (option__calculationmode__casida)
346 case (option__calculationmode__vdw)
347 call vdw_run(systems, from_scratch)
348 case (option__calculationmode__vib_modes)
355 case (option__calculationmode__one_shot)
356 message(1) =
"CalculationMode = one_shot is obsolete. Please use gs with MaximumIter = 0."
358 case (option__calculationmode__kdotp)
360 case (option__calculationmode__dummy)
361 case (option__calculationmode__invert_ks)
363 case (option__calculationmode__recipe)
370 select type (systems)
373 call iter%start(partners)
374 do while (iter%has_next())
375 select type(ptr => iter%get_next())
378 safe_deallocate_p(partner)
381 safe_deallocate_p(partner)
384 safe_deallocate_p(partner)
390 safe_deallocate_p(systems)
404 integer,
intent(in) :: calc_mode_id
408 select case (calc_mode_id)
409 case (option__calculationmode__gs, option__calculationmode__go, option__calculationmode__unocc)
415 case (option__calculationmode__td)
418 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)
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 kdotp_lr_run(system, from_scratch)
subroutine, public load_lasers(partners, namespace)
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_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)
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.
This module implements a unit-test like runmode for Octopus.
subroutine, public test_run(namespace)
Components and integration test runner.
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)
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.