66 subroutine electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, fromScratch)
67 type(namespace_t),
intent(in) :: namespace
68 type(multicomm_t),
intent(in) :: mc
69 type(grid_t),
intent(inout) :: gr
70 type(ions_t),
intent(inout) :: ions
71 type(partner_list_t),
intent(in) :: ext_partners
72 type(states_elec_t),
intent(inout) :: st
73 type(v_ks_t),
intent(inout) :: ks
74 type(hamiltonian_elec_t),
intent(inout) :: hm
75 type(output_t),
intent(in) :: outp
76 type(electron_space_t),
intent(in) :: space
77 logical,
intent(inout) :: fromScratch
86 if (.not. fromscratch)
then
87 call electrons_gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromscratch)
90 call electrons_gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromscratch)
92 call electrons_gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
102 type(v_ks_t),
intent(inout) :: ks
103 type(scf_t),
intent(inout) :: scf
104 type(rdm_t),
intent(inout) :: rdm
105 type(states_elec_t),
intent(inout) :: st
106 type(hamiltonian_elec_t),
intent(inout) :: hm
110 if (ks%theory_level ==
rdmft)
then
117 call scf%restart_dump%end()
120 if (st%pack_states .and. hm%apply_packed())
then
132 type(namespace_t),
intent(in) :: namespace
133 type(grid_t),
intent(inout) :: gr
134 type(states_elec_t),
intent(inout) :: st
135 type(hamiltonian_elec_t),
intent(inout) :: hm
136 type(scf_t),
intent(inout) :: scf
137 type(v_ks_t),
intent(inout) :: ks
138 type(ions_t),
intent(inout) :: ions
139 type(multicomm_t),
intent(in) :: mc
140 type(electron_space_t),
intent(in) :: space
144 call messages_write(
'Info: Allocating ground state wave-functions')
147 if (st%parallel_in_states)
then
148 call messages_experimental(
'State parallelization for ground state calculations', namespace=namespace)
151 if (hm%pcm%run_pcm)
then
152 if (.not.
is_close(hm%pcm%epsilon_infty, hm%pcm%epsilon_0) .and. hm%pcm%tdlevel /=
pcm_td_eq)
then
153 message(1) =
'Non-equilbrium PCM is not active in a time-independent run.'
154 message(2) =
'You set epsilon_infty /= epsilon_0, but epsilon_infty is not relevant for CalculationMode = gs.'
155 message(3) =
'By definition, the ground state is in equilibrium with the solvent.'
156 message(4) =
'Therefore, the only relevant dielectric constant is the static one.'
157 message(5) =
'Nevertheless, the dynamical PCM response matrix is evaluated for benchamarking purposes.'
166 .and. st%dom_st_kpt_mpi_grp%comm /= mpi_comm_null)
then
167 call st%dom_st_kpt_mpi_grp%barrier()
176 subroutine electrons_gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromScratch)
178 type(
scf_t),
intent(inout) :: scf
179 type(
grid_t),
intent(inout) :: gr
183 type(
v_ks_t),
intent(inout) :: ks
185 type(
ions_t),
intent(in) :: ions
187 logical,
intent(inout) :: fromscratch
198 call states_elec_load(scf%restart_load, namespace, space, st, gr, hm%kpoints, ierr)
213 subroutine electrons_gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromScratch)
215 type(
scf_t),
intent(inout) :: scf
216 type(
rdm_t),
intent(inout) :: rdm
217 type(
grid_t),
intent(inout) :: gr
221 type(
ions_t),
intent(in) :: ions
222 type(
v_ks_t),
intent(inout) :: ks
225 logical,
intent(in) :: fromscratch
228 logical :: restart_init_data_type_dump
235 if (ks%theory_level /=
rdmft)
then
236 call scf_init(scf, namespace, gr, ions, st, mc, hm, space)
238 restart_init_data_type_dump = scf%max_iter > 0
240 restart_init_data_type_dump = .
true.
243 if (fromscratch .and. ks%theory_level /=
rdmft)
then
244 call lcao_run(namespace, space, gr, ions, ext_partners, st, ks, hm, lmm_r = scf%lmm_r)
253 call v_ks_h_setup(namespace, space, gr, ions, ext_partners, st, ks, hm, &
254 calc_eigenval = .false., calc_current = .false.)
257 if (restart_init_data_type_dump)
then
264 if (st%pack_states .and. hm%apply_packed())
then
268 if (ks%theory_level ==
rdmft)
then
269 call rdmft_init(rdm, namespace, gr, st, hm, mc, space, fromscratch)
272 if (.not. fromscratch)
then
273 call scf_load(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, scf%restart_load)
274 call scf%restart_load%end()
280 subroutine electrons_gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
282 type(
scf_t),
intent(inout) :: scf
283 type(
rdm_t),
intent(inout) :: rdm
285 type(
grid_t),
intent(inout) :: gr
286 type(
ions_t),
intent(inout) :: ions
289 type(
v_ks_t),
intent(inout) :: ks
297 if (ks%theory_level ==
rdmft)
then
298 call scf_rdmft(rdm, namespace, space, gr, ions, ext_partners, st, ks, hm, outp, scf%restart_dump)
301 call scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp, &
302 restart_dump=scf%restart_dump)
304 call scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp)
A set of subroutines for performing the parts of a ground state calculation with an electrons system....
subroutine electrons_gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
subroutine, public electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, fromScratch)
Run a ground state calculation for a system of electrons.
subroutine, public electrons_gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromScratch)
subroutine, public electrons_gs_allocate_wavefunctions(namespace, gr, st, hm, scf, ks, ions, mc, space)
subroutine, public electrons_gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromScratch)
subroutine, public electrons_gs_cleanup(ks, scf, rdm, st, hm)
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.
A module to handle KS potential, without the external potential.
integer, parameter, public rdmft
real(real64), parameter, public default_eigenval
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, hm, 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
integer, parameter, public restart_type_dump
integer, parameter, public restart_type_load
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.