67 subroutine electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, fromScratch)
68 type(namespace_t),
intent(in) :: namespace
69 type(multicomm_t),
intent(in) :: mc
70 type(grid_t),
intent(inout) :: gr
71 type(ions_t),
intent(inout) :: ions
72 type(partner_list_t),
intent(in) :: ext_partners
73 type(states_elec_t),
intent(inout) :: st
74 type(v_ks_t),
intent(inout) :: ks
75 type(hamiltonian_elec_t),
intent(inout) :: hm
76 type(output_t),
intent(in) :: outp
77 type(electron_space_t),
intent(in) :: space
78 logical,
intent(inout) :: fromScratch
87 if (.not. fromscratch)
then
88 call electrons_gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromscratch)
91 call electrons_gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromscratch)
93 call electrons_gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
103 type(v_ks_t),
intent(inout) :: ks
104 type(scf_t),
intent(inout) :: scf
105 type(rdm_t),
intent(inout) :: rdm
106 type(states_elec_t),
intent(inout) :: st
107 type(hamiltonian_elec_t),
intent(inout) :: hm
111 if (ks%theory_level ==
rdmft)
then
118 call scf%restart_dump%end()
121 if (st%pack_states .and. hm%apply_packed())
then
133 type(namespace_t),
intent(in) :: namespace
134 type(grid_t),
intent(inout) :: gr
135 type(states_elec_t),
intent(inout) :: st
136 type(hamiltonian_elec_t),
intent(inout) :: hm
137 type(scf_t),
intent(inout) :: scf
138 type(v_ks_t),
intent(inout) :: ks
143 call messages_write(
'Info: Allocating ground state wave-functions')
146 if (st%parallel_in_states)
then
147 call messages_experimental(
'State parallelization for ground state calculations', namespace=namespace)
150 if (hm%pcm%run_pcm)
then
151 if (.not.
is_close(hm%pcm%epsilon_infty, hm%pcm%epsilon_0) .and. hm%pcm%tdlevel /=
pcm_td_eq)
then
152 message(1) =
'Non-equilbrium PCM is not active in a time-independent run.'
153 message(2) =
'You set epsilon_infty /= epsilon_0, but epsilon_infty is not relevant for CalculationMode = gs.'
154 message(3) =
'By definition, the ground state is in equilibrium with the solvent.'
155 message(4) =
'Therefore, the only relevant dielectric constant is the static one.'
156 message(5) =
'Nevertheless, the dynamical PCM response matrix is evaluated for benchamarking purposes.'
165 .and. st%dom_st_kpt_mpi_grp%comm /= mpi_comm_null)
then
166 call st%dom_st_kpt_mpi_grp%barrier()
175 subroutine electrons_gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromScratch)
177 type(
scf_t),
intent(inout) :: scf
178 type(
grid_t),
intent(inout) :: gr
182 type(
v_ks_t),
intent(inout) :: ks
184 type(
ions_t),
intent(in) :: ions
186 logical,
intent(inout) :: fromscratch
195 exact = (ks%theory_level ==
rdmft))
197 call states_elec_load(scf%restart_load, namespace, space, st, gr, hm%kpoints, fixed_occ=.false., ierr=ierr)
212 subroutine electrons_gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromScratch)
214 type(
scf_t),
intent(inout) :: scf
215 type(
rdm_t),
intent(inout) :: rdm
216 type(
grid_t),
intent(inout) :: gr
220 type(
ions_t),
intent(in) :: ions
221 type(
v_ks_t),
intent(inout) :: ks
224 logical,
intent(in) :: fromscratch
227 logical :: restart_init_data_type_dump, known_lower_bound
234 if (ks%theory_level /=
rdmft)
then
235 call scf_init(scf, namespace, gr, ions, st, mc, hm, space)
237 restart_init_data_type_dump = scf%max_iter > 0
239 restart_init_data_type_dump = .
true.
242 if (fromscratch .and. ks%theory_level /=
rdmft)
then
243 call lcao_run(namespace, space, gr, ions, ext_partners, st, ks, hm, lmm_r = scf%lmm_r, &
244 known_lower_bound=known_lower_bound)
254 call v_ks_h_setup(namespace, space, gr, ions, ext_partners, st, ks, hm, &
255 calc_eigenval = .false., calc_current = .false.)
260 if (restart_init_data_type_dump)
then
267 if (st%pack_states .and. hm%apply_packed())
then
271 if (ks%theory_level ==
rdmft)
then
272 call rdmft_init(rdm, namespace, gr, st, hm, mc, space, fromscratch)
275 if (.not. fromscratch)
then
276 call scf_load(scf, namespace, space, gr, ions, ext_partners, st, ks, hm, scf%restart_load)
277 call scf%restart_load%end()
283 subroutine electrons_gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
285 type(
scf_t),
intent(inout) :: scf
286 type(
rdm_t),
intent(inout) :: rdm
288 type(
grid_t),
intent(inout) :: gr
289 type(
ions_t),
intent(inout) :: ions
292 type(
v_ks_t),
intent(inout) :: ks
300 if (ks%theory_level ==
rdmft)
then
301 call scf_rdmft(rdm, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp, scf%restart_dump)
304 call scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp, &
305 restart_dump=scf%restart_dump)
307 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, 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_allocate_wavefunctions(namespace, gr, st, hm, scf, ks, ions)
subroutine, public electrons_gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromScratch)
subroutine, public electrons_gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, 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)
integer, parameter, public rdmft
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.
real(real64), parameter, public default_eigenval
subroutine, public lcao_run(namespace, space, gr, ions, ext_partners, st, ks, hm, st_start, lmm_r, known_lower_bound)
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 scf_rdmft(rdm, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp, restart_dump)
subroutine, public rdmft_init(rdm, namespace, gr, st, hm, mc, space, fromScratch)
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_set_lower_bound_is_known(scf, known_lower_bound)
Set the flag lower_bound_is_known.
subroutine, public scf_load(scf, namespace, space, 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, fixed_occ, 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.