63 subroutine electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, fromScratch)
64 type(namespace_t),
intent(in) :: namespace
65 type(multicomm_t),
intent(in) :: mc
66 type(grid_t),
intent(inout) :: gr
67 type(ions_t),
intent(inout) :: ions
68 type(partner_list_t),
intent(in) :: ext_partners
69 type(states_elec_t),
intent(inout) :: st
70 type(v_ks_t),
intent(inout) :: ks
71 type(hamiltonian_elec_t),
intent(inout) :: hm
72 type(output_t),
intent(in) :: outp
73 type(electron_space_t),
intent(in) :: space
74 logical,
intent(inout) :: fromScratch
79 push_sub(ground_state_run_legacy)
83 if (.not. fromscratch)
then
84 call gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromscratch)
87 call gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromscratch)
89 call gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
93 pop_sub(ground_state_run_legacy)
98 type(v_ks_t),
intent(inout) :: ks
99 type(scf_t),
intent(inout) :: scf
100 type(rdm_t),
intent(inout) :: rdm
101 type(states_elec_t),
intent(inout) :: st
102 type(hamiltonian_elec_t),
intent(inout) :: hm
106 if (ks%theory_level ==
rdmft)
then
116 if (st%pack_states .and. hm%apply_packed())
then
128 type(namespace_t),
intent(in) :: namespace
129 type(grid_t),
intent(inout) :: gr
130 type(states_elec_t),
intent(inout) :: st
131 type(hamiltonian_elec_t),
intent(inout) :: hm
132 type(scf_t),
intent(inout) :: scf
133 type(v_ks_t),
intent(inout) :: ks
134 type(ions_t),
intent(inout) :: ions
135 type(multicomm_t),
intent(in) :: mc
136 type(electron_space_t),
intent(in) :: space
140 call messages_write(
'Info: Allocating ground state wave-functions')
143 if (st%parallel_in_states)
then
144 call messages_experimental(
'State parallelization for ground state calculations', namespace=namespace)
147 if (hm%pcm%run_pcm)
then
148 if (.not.
is_close(hm%pcm%epsilon_infty, hm%pcm%epsilon_0) .and. hm%pcm%tdlevel /=
pcm_td_eq)
then
149 message(1) =
'Non-equilbrium PCM is not active in a time-independent run.'
150 message(2) =
'You set epsilon_infty /= epsilon_0, but epsilon_infty is not relevant for CalculationMode = gs.'
151 message(3) =
'By definition, the ground state is in equilibrium with the solvent.'
152 message(4) =
'Therefore, the only relevant dielectric constant is the static one.'
153 message(5) =
'Nevertheless, the dynamical PCM response matrix is evaluated for benchamarking purposes.'
162 .and. st%dom_st_kpt_mpi_grp%comm /= mpi_comm_null)
then
163 call st%dom_st_kpt_mpi_grp%barrier()
172 subroutine gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromScratch)
174 type(
scf_t),
intent(inout) :: scf
175 type(
grid_t),
intent(inout) :: gr
179 type(
v_ks_t),
intent(inout) :: ks
181 type(
ions_t),
intent(in) :: ions
183 logical,
intent(inout) :: fromscratch
192 exact = (ks%theory_level ==
rdmft))
194 call states_elec_load(scf%restart_load, namespace, space, st, gr, hm%kpoints, ierr)
209 subroutine gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromScratch)
211 type(
scf_t),
intent(inout) :: scf
212 type(
rdm_t),
intent(inout) :: rdm
213 type(
grid_t),
intent(inout) :: gr
217 type(
ions_t),
intent(in) :: ions
218 type(
v_ks_t),
intent(inout) :: ks
221 logical,
intent(in) :: fromscratch
224 logical :: restart_init_dump
231 if (ks%theory_level /=
rdmft)
then
232 call scf_init(scf, namespace, gr, ions, st, mc, hm, space)
234 restart_init_dump = scf%max_iter > 0
236 restart_init_dump = .
true.
239 if (fromscratch .and. ks%theory_level /=
rdmft)
then
240 call lcao_run(namespace, space, gr, ions, ext_partners, st, ks, hm, lmm_r = scf%lmm_r)
245 call v_ks_h_setup(namespace, space, gr, ions, ext_partners, st, ks, hm, &
246 calc_eigenval = .false., calc_current = .false.)
249 if (restart_init_dump)
then
256 if (st%pack_states .and. hm%apply_packed())
then
260 if (ks%theory_level ==
rdmft)
then
261 call rdmft_init(rdm, namespace, gr, st, mc, space, fromscratch)
264 if (.not. fromscratch)
then
265 call scf_load(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, scf%restart_load)
272 subroutine gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
274 type(
scf_t),
intent(inout) :: scf
275 type(
rdm_t),
intent(inout) :: rdm
277 type(
grid_t),
intent(inout) :: gr
278 type(
ions_t),
intent(inout) :: ions
281 type(
v_ks_t),
intent(inout) :: ks
289 if (ks%theory_level ==
rdmft)
then
290 call scf_rdmft(rdm, namespace, space, gr, ions, ext_partners, st, ks, hm, outp, scf%restart_dump)
293 call scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp, &
294 restart_dump=scf%restart_dump)
296 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.
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 ...
A module to handle KS potential, without the external potential.
integer, parameter, public rdmft
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 low-level part of 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.