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
142 call messages_write(
'Info: Allocating ground state wave-functions')
145 if (st%parallel_in_states)
then
146 call messages_experimental(
'State parallelization for ground state calculations', namespace=namespace)
149 if (hm%pcm%run_pcm)
then
150 if (.not.
is_close(hm%pcm%epsilon_infty, hm%pcm%epsilon_0) .and. hm%pcm%tdlevel /=
pcm_td_eq)
then
151 message(1) =
'Non-equilbrium PCM is not active in a time-independent run.'
152 message(2) =
'You set epsilon_infty /= epsilon_0, but epsilon_infty is not relevant for CalculationMode = gs.'
153 message(3) =
'By definition, the ground state is in equilibrium with the solvent.'
154 message(4) =
'Therefore, the only relevant dielectric constant is the static one.'
155 message(5) =
'Nevertheless, the dynamical PCM response matrix is evaluated for benchamarking purposes.'
164 .and. st%dom_st_kpt_mpi_grp%comm /= mpi_comm_null)
then
165 call st%dom_st_kpt_mpi_grp%barrier()
174 subroutine electrons_gs_load_from_restart(namespace, scf, gr, mc, st, hm, ks, space, ions, ext_partners, fromScratch)
176 type(
scf_t),
intent(inout) :: scf
177 type(
grid_t),
intent(inout) :: gr
181 type(
v_ks_t),
intent(inout) :: ks
183 type(
ions_t),
intent(in) :: ions
185 logical,
intent(inout) :: fromscratch
194 exact = (ks%theory_level ==
rdmft))
211 subroutine electrons_gs_initialize(namespace, scf, rdm, gr, mc, st, hm, ions, ks, space, ext_partners, fromScratch)
213 type(
scf_t),
intent(inout) :: scf
214 type(
rdm_t),
intent(inout) :: rdm
215 type(
grid_t),
intent(inout) :: gr
219 type(
ions_t),
intent(in) :: ions
220 type(
v_ks_t),
intent(inout) :: ks
223 logical,
intent(in) :: fromscratch
226 logical :: restart_init_data_type_dump
233 if (ks%theory_level /=
rdmft)
then
234 call scf_init(scf, namespace, gr, ions, st, mc, hm, space)
236 restart_init_data_type_dump = scf%max_iter > 0
238 restart_init_data_type_dump = .
true.
241 if (fromscratch .and. ks%theory_level /=
rdmft)
then
242 call lcao_run(namespace, space, gr, ions, ext_partners, st, ks, hm, lmm_r = scf%lmm_r)
251 call v_ks_h_setup(namespace, space, gr, ions, ext_partners, st, ks, hm, &
252 calc_eigenval = .false., calc_current = .false.)
255 if (restart_init_data_type_dump)
then
262 if (st%pack_states .and. hm%apply_packed())
then
266 if (ks%theory_level ==
rdmft)
then
267 call rdmft_init(rdm, namespace, gr, st, hm, mc, space, fromscratch)
270 if (.not. fromscratch)
then
271 call scf_load(scf, namespace, space, gr, ions, ext_partners, st, ks, hm, scf%restart_load)
272 call scf%restart_load%end()
278 subroutine electrons_gs_run(namespace, scf, rdm, mc, gr, ions, ext_partners, st, ks, hm, outp, space)
280 type(
scf_t),
intent(inout) :: scf
281 type(
rdm_t),
intent(inout) :: rdm
283 type(
grid_t),
intent(inout) :: gr
284 type(
ions_t),
intent(inout) :: ions
287 type(
v_ks_t),
intent(inout) :: ks
295 if (ks%theory_level ==
rdmft)
then
296 call scf_rdmft(rdm, namespace, space, gr, ions, ext_partners, st, ks, hm, outp, scf%restart_dump)
299 call scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp=outp, &
300 restart_dump=scf%restart_dump)
302 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_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_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)
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, 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.