57 subroutine electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, fromScratch)
58 type(namespace_t),
intent(in) :: namespace
59 type(multicomm_t),
intent(in) :: mc
60 type(grid_t),
intent(inout) :: gr
61 type(ions_t),
intent(inout) :: ions
62 type(partner_list_t),
intent(in) :: ext_partners
63 type(states_elec_t),
intent(inout) :: st
64 type(v_ks_t),
intent(inout) :: ks
65 type(hamiltonian_elec_t),
intent(inout) :: hm
66 type(output_t),
intent(in) :: outp
67 type(electron_space_t),
intent(in) :: space
68 logical,
intent(inout) :: fromScratch
71 type(restart_t) :: restart_load, restart_dump
74 logical :: restart_init_dump
76 push_sub(ground_state_run_legacy)
78 call messages_write(
'Info: Allocating ground state wave-functions')
81 if (st%parallel_in_states)
then
82 call messages_experimental(
'State parallelization for ground state calculations', namespace=namespace)
85 if (hm%pcm%run_pcm)
then
86 if (.not.
is_close(hm%pcm%epsilon_infty, hm%pcm%epsilon_0) .and. hm%pcm%tdlevel /=
pcm_td_eq)
then
87 message(1) =
'Non-equilbrium PCM is not active in a time-independent run.'
88 message(2) =
'You set epsilon_infty /= epsilon_0, but epsilon_infty is not relevant for CalculationMode = gs.'
89 message(3) =
'By definition, the ground state is in equilibrium with the solvent.'
90 message(4) =
'Therefore, the only relevant dielectric constant is the static one.'
91 message(5) =
'Nevertheless, the dynamical PCM response matrix is evaluated for benchamarking purposes.'
100 .and. st%dom_st_kpt_mpi_grp%comm /= mpi_comm_null)
then
101 call st%dom_st_kpt_mpi_grp%barrier()
106 if (.not. fromscratch)
then
110 exact = (ks%theory_level ==
rdmft))
112 call states_elec_load(restart_load, namespace, space, st, gr, hm%kpoints, ierr)
127 if (ks%theory_level /=
rdmft)
then
128 call scf_init(scfv, namespace, gr, ions, st, mc, hm, space)
130 restart_init_dump = scfv%max_iter > 0
132 restart_init_dump = .
true.
135 if (fromscratch .and. ks%theory_level /=
rdmft)
then
136 call lcao_run(namespace, space, gr, ions, ext_partners, st, ks, hm, lmm_r = scfv%lmm_r)
141 call v_ks_h_setup(namespace, space, gr, ions, ext_partners, st, ks, hm, &
142 calc_eigenval = .false., calc_current = .false.)
145 if (restart_init_dump)
then
152 if (st%pack_states .and. hm%apply_packed())
then
157 if (ks%theory_level ==
rdmft)
then
158 call rdmft_init(rdm, namespace, gr, st, mc, space, fromscratch)
159 call scf_rdmft(rdm, namespace, space, gr, ions, ext_partners, st, ks, hm, outp, restart_dump)
162 if (.not. fromscratch)
then
163 if (restart_init_dump)
then
164 call scf_run(scfv, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp, &
165 restart_load=restart_load, restart_dump=restart_dump)
167 call scf_run(scfv, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp, restart_load=restart_load)
171 if (restart_init_dump)
then
172 call scf_run(scfv, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp, restart_dump=restart_dump)
174 call scf_run(scfv, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp)
181 if (restart_init_dump)
then
185 if (st%pack_states .and. hm%apply_packed())
then
192 pop_sub(ground_state_run_legacy)
subroutine, public electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, fromScratch)
This module implements the underlying real-space grid.
integer, parameter, public rdmft
This module defines classes and functions for interaction partners.
subroutine, public write_canonicalized_xyz_file(dir, fname, space, latt, pos, atoms, box, namespace)
Write canonicalized xyz file with atom labels and positions in Angstroms. Includes information about ...
subroutine, public lcao_run(namespace, space, gr, ions, ext_partners, st, ks, hm, st_start, lmm_r)
This module is intended to contain "only mathematical" functions and procedures.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_warning(no_lines, all_nodes, namespace)
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
subroutine, public messages_new_line()
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_experimental(name, namespace)
type(mpi_comm), parameter, public mpi_comm_undefined
used to indicate a communicator has not been initialized
This module handles the communicators for the various parallelization strategies.
this module contains the output system
integer, parameter, public pcm_td_eq
subroutine, public rdmft_end(rdm)
subroutine, public rdmft_init(rdm, namespace, gr, st, mc, space, fromScratch)
subroutine, public scf_rdmft(rdm, namespace, space, gr, ions, ext_partners, st, ks, hm, outp, restart_dump)
integer, parameter, public restart_gs
subroutine, public restart_init(restart, namespace, data_type, type, mc, ierr, mesh, dir, exact)
Initializes a restart object.
integer, parameter, public restart_type_dump
integer, parameter, public restart_type_load
subroutine, public restart_end(restart)
subroutine, public scf_state_info(namespace, st)
subroutine, public scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp, verbosity, iters_done, restart_load, restart_dump)
subroutine, public scf_init(scf, namespace, gr, ions, st, mc, hm, space)
subroutine, public scf_end(scf)
subroutine, public states_elec_deallocate_wfns(st)
Deallocates the KS wavefunctions defined within a states_elec_t structure.
subroutine, public states_elec_allocate_wfns(st, mesh, wfs_type, skip, packed)
Allocates the KS wavefunctions defined within a states_elec_t structure.
This module handles reading and writing restart information for the states_elec_t.
subroutine, public states_elec_load(restart, namespace, space, st, mesh, kpoints, ierr, iter, lr, lowest_missing, label, verbose, skip)
returns in ierr: <0 => Fatal error, or nothing read =0 => read all wavefunctions >0 => could only rea...
subroutine, public v_ks_h_setup(namespace, space, gr, ions, ext_partners, st, ks, hm, calc_eigenval, calc_current)