62 subroutine electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, fromScratch)
63 type(namespace_t),
intent(in) :: namespace
64 type(multicomm_t),
intent(in) :: mc
65 type(grid_t),
intent(inout) :: gr
66 type(ions_t),
intent(inout) :: ions
67 type(partner_list_t),
intent(in) :: ext_partners
68 type(states_elec_t),
intent(inout) :: st
69 type(v_ks_t),
intent(inout) :: ks
70 type(hamiltonian_elec_t),
intent(inout) :: hm
71 type(output_t),
intent(in) :: outp
72 type(electron_space_t),
intent(in) :: space
73 logical,
intent(inout) :: fromScratch
78 push_sub(ground_state_run_legacy)
82 if (.not. fromscratch)
then
83 call gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromscratch)
86 call gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromscratch)
88 call gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
92 pop_sub(ground_state_run_legacy)
97 type(v_ks_t),
intent(inout) :: ks
98 type(scf_t),
intent(inout) :: scf
99 type(rdm_t),
intent(inout) :: rdm
100 type(states_elec_t),
intent(inout) :: st
101 type(hamiltonian_elec_t),
intent(inout) :: hm
105 if (ks%theory_level ==
rdmft)
then
115 if (st%pack_states .and. hm%apply_packed())
then
127 type(namespace_t),
intent(in) :: namespace
128 type(grid_t),
intent(inout) :: gr
129 type(states_elec_t),
intent(inout) :: st
130 type(hamiltonian_elec_t),
intent(inout) :: hm
131 type(scf_t),
intent(inout) :: scf
132 type(v_ks_t),
intent(inout) :: ks
133 type(ions_t),
intent(inout) :: ions
134 type(multicomm_t),
intent(in) :: mc
135 type(electron_space_t),
intent(in) :: space
139 call messages_write(
'Info: Allocating ground state wave-functions')
142 if (st%parallel_in_states)
then
143 call messages_experimental(
'State parallelization for ground state calculations', namespace=namespace)
146 if (hm%pcm%run_pcm)
then
147 if (.not.
is_close(hm%pcm%epsilon_infty, hm%pcm%epsilon_0) .and. hm%pcm%tdlevel /=
pcm_td_eq)
then
148 message(1) =
'Non-equilbrium PCM is not active in a time-independent run.'
149 message(2) =
'You set epsilon_infty /= epsilon_0, but epsilon_infty is not relevant for CalculationMode = gs.'
150 message(3) =
'By definition, the ground state is in equilibrium with the solvent.'
151 message(4) =
'Therefore, the only relevant dielectric constant is the static one.'
152 message(5) =
'Nevertheless, the dynamical PCM response matrix is evaluated for benchamarking purposes.'
161 .and. st%dom_st_kpt_mpi_grp%comm /= mpi_comm_null)
then
162 call st%dom_st_kpt_mpi_grp%barrier()
171 subroutine gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromScratch)
173 type(
scf_t),
intent(inout) :: scf
174 type(
grid_t),
intent(inout) :: gr
178 type(
v_ks_t),
intent(inout) :: ks
180 type(
ions_t),
intent(in) :: ions
182 logical,
intent(inout) :: fromscratch
191 exact = (ks%theory_level ==
rdmft))
193 call states_elec_load(scf%restart_load, namespace, space, st, gr, hm%kpoints, ierr)
208 subroutine gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromScratch)
210 type(
scf_t),
intent(inout) :: scf
211 type(
rdm_t),
intent(inout) :: rdm
212 type(
grid_t),
intent(inout) :: gr
216 type(
ions_t),
intent(in) :: ions
217 type(
v_ks_t),
intent(inout) :: ks
220 logical,
intent(in) :: fromscratch
223 logical :: restart_init_dump
230 if (ks%theory_level /=
rdmft)
then
231 call scf_init(scf, namespace, gr, ions, st, mc, hm, space)
233 restart_init_dump = scf%max_iter > 0
235 restart_init_dump = .
true.
238 if (fromscratch .and. ks%theory_level /=
rdmft)
then
239 call lcao_run(namespace, space, gr, ions, ext_partners, st, ks, hm, lmm_r = scf%lmm_r)
244 call v_ks_h_setup(namespace, space, gr, ions, ext_partners, st, ks, hm, &
245 calc_eigenval = .false., calc_current = .false.)
248 if (restart_init_dump)
then
255 if (st%pack_states .and. hm%apply_packed())
then
259 if (ks%theory_level ==
rdmft)
then
260 call rdmft_init(rdm, namespace, gr, st, mc, space, fromscratch)
263 if (.not. fromscratch)
then
264 call scf_load(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, scf%restart_load)
271 subroutine gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
273 type(
scf_t),
intent(inout) :: scf
274 type(
rdm_t),
intent(inout) :: rdm
276 type(
grid_t),
intent(inout) :: gr
277 type(
ions_t),
intent(inout) :: ions
280 type(
v_ks_t),
intent(inout) :: ks
288 if (ks%theory_level ==
rdmft)
then
289 call scf_rdmft(rdm, namespace, space, gr, ions, ext_partners, st, ks, hm, outp, scf%restart_dump)
292 call scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp, &
293 restart_dump=scf%restart_dump)
295 call scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp)
subroutine, public electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, fromScratch)
subroutine, public gs_cleanup(ks, scf, rdm, st, hm)
subroutine, public gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromScratch)
subroutine, public gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
subroutine, public gs_allocate_wavefunctions(namespace, gr, st, hm, scf, ks, ions, mc, space)
subroutine, public gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, 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_new_line()
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_experimental(name, namespace)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, 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_undefined
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_load(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, restart_load)
Loading of restarting data of the SCF cycle.
subroutine, public scf_state_info(namespace, st)
subroutine, public scf_init(scf, namespace, gr, ions, st, mc, hm, space)
subroutine, public scf_end(scf)
subroutine, public scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp, verbosity, iters_done, restart_dump)
Legacy version of the SCF code.
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)
Extension of space that contains the knowledge of the spin dimension.
Description of the grid, containing information on derivatives, stencil, and symmetries.
Stores all communicators and groups.
some variables used for the SCF cycle
The states_elec_t class contains all electronic wave functions.