(git:ccc2433)
qs_environment_methods.F
Go to the documentation of this file.
1 !--------------------------------------------------------------------------------------------------!
2 ! CP2K: A general program to perform molecular dynamics simulations !
3 ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 ! !
5 ! SPDX-License-Identifier: GPL-2.0-or-later !
6 !--------------------------------------------------------------------------------------------------!
7 
8 ! **************************************************************************************************
9 !> \brief qs_environment methods that use many other modules
10 !> \par History
11 !> 09.2002 created [fawzi]
12 !> - local atom distribution (25.06.2003,MK)
13 !> \author Fawzi Mohamed
14 ! **************************************************************************************************
16  USE atomic_kind_types, ONLY: atomic_kind_type
17  USE cell_types, ONLY: cell_type
18  USE cp_blacs_env, ONLY: cp_blacs_env_type
19  USE cp_control_types, ONLY: dft_control_type
21  USE dbcsr_api, ONLY: dbcsr_distribution_type
23  distribution_2d_type
25  USE ewald_environment_types, ONLY: ewald_environment_type
27  USE ewald_pw_types, ONLY: ewald_pw_type
28  USE input_constants, ONLY: do_ppl_grid
29  USE kinds, ONLY: dp
30  USE message_passing, ONLY: mp_para_env_type
31  USE molecule_kind_types, ONLY: molecule_kind_type
32  USE molecule_types, ONLY: molecule_type
33  USE particle_types, ONLY: particle_type
34  USE pw_env_methods, ONLY: pw_env_create,&
36  USE pw_env_types, ONLY: pw_env_get,&
38  pw_env_type
39  USE pw_pool_types, ONLY: pw_pool_type
40  USE pw_types, ONLY: pw_c1d_gs_type,&
41  pw_r3d_rs_type
43  qs_charges_type
44  USE qs_environment_types, ONLY: get_qs_env,&
45  qs_environment_type,&
47  USE qs_kind_types, ONLY: has_nlcc,&
48  qs_kind_type
49  USE qs_ks_types, ONLY: get_ks_env,&
50  qs_ks_env_type,&
55  USE qs_rho0_types, ONLY: rho0_mpole_type
56  USE scf_control_types, ONLY: scf_control_type
57 #include "./base/base_uses.f90"
58 
59  IMPLICIT NONE
60  PRIVATE
61 
62  LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
63  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_environment_methods'
64 
65  PUBLIC :: qs_env_rebuild_pw_env, &
66  qs_env_setup, &
68 !***
69 CONTAINS
70 
71 ! **************************************************************************************************
72 !> \brief initializes various components of the qs_env, that need only
73 !> atomic_kind_set, cell, dft_control, scf_control, c(i)%nmo,
74 !> c(i)%nao, and particle_set to be initialized.
75 !> The previous components of qs_env must be valid.
76 !> Initializes pools, charges and pw_env.
77 !> \param qs_env the qs_env to set up
78 !> \par History
79 !> 10.2002 created [fawzi]
80 !> \author Fawzi Mohamed
81 ! **************************************************************************************************
82  SUBROUTINE qs_env_setup(qs_env)
83 
84  TYPE(qs_environment_type), POINTER :: qs_env
85 
86  CHARACTER(len=*), PARAMETER :: routinen = 'qs_env_setup'
87 
88  INTEGER :: handle, nhistory, nvariables
89  REAL(kind=dp), DIMENSION(:, :), POINTER :: gradient_history, outer_scf_history, &
90  variable_history
91  TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
92  TYPE(cell_type), POINTER :: cell
93  TYPE(cp_blacs_env_type), POINTER :: blacs_env
94  TYPE(dbcsr_distribution_type), POINTER :: dbcsr_dist
95  TYPE(dft_control_type), POINTER :: dft_control
96  TYPE(distribution_2d_type), POINTER :: distribution_2d
97  TYPE(molecule_kind_type), DIMENSION(:), POINTER :: molecule_kind_set
98  TYPE(molecule_type), DIMENSION(:), POINTER :: molecule_set
99  TYPE(mp_para_env_type), POINTER :: para_env
100  TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
101  TYPE(qs_charges_type), POINTER :: qs_charges
102  TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
103  TYPE(qs_ks_env_type), POINTER :: ks_env
104  TYPE(scf_control_type), POINTER :: scf_control
105 
106  CALL timeset(routinen, handle)
107 
108  NULLIFY (qs_kind_set, atomic_kind_set, dft_control, scf_control, qs_charges, para_env, &
109  distribution_2d, molecule_kind_set, molecule_set, particle_set, cell, &
110  ks_env, blacs_env)
111 
112  CALL get_qs_env(qs_env=qs_env, &
113  qs_kind_set=qs_kind_set, &
114  atomic_kind_set=atomic_kind_set, &
115  dft_control=dft_control, &
116  molecule_kind_set=molecule_kind_set, &
117  molecule_set=molecule_set, &
118  particle_set=particle_set, &
119  scf_control=scf_control, &
120  para_env=para_env, &
121  blacs_env=blacs_env, &
122  cell=cell, &
123  ks_env=ks_env)
124 
125  cpassert(ASSOCIATED(qs_kind_set))
126  cpassert(ASSOCIATED(atomic_kind_set))
127  cpassert(ASSOCIATED(dft_control))
128  cpassert(ASSOCIATED(scf_control))
129  ! allocate qs_charges
130  ALLOCATE (qs_charges)
131  CALL qs_charges_create(qs_charges, nspins=dft_control%nspins)
132  CALL set_qs_env(qs_env, qs_charges=qs_charges)
133 
134  ! outer scf setup
135  IF (scf_control%outer_scf%have_scf) THEN
136  nvariables = outer_loop_variables_count(scf_control)
137  nhistory = scf_control%outer_scf%extrapolation_order
138  ALLOCATE (outer_scf_history(nvariables, nhistory))
139  ALLOCATE (gradient_history(nvariables, 2))
140  gradient_history = 0.0_dp
141  ALLOCATE (variable_history(nvariables, 2))
142  variable_history = 0.0_dp
143  CALL set_qs_env(qs_env, outer_scf_history=outer_scf_history, &
144  gradient_history=gradient_history, &
145  variable_history=variable_history)
146  CALL set_qs_env(qs_env, outer_scf_ihistory=0)
147  END IF
148 
149  ! set up pw_env
150  CALL qs_env_rebuild_pw_env(qs_env)
151 
152  ! rebuilds fm_pools
153 
154  ! XXXX should get rid of the mpools
155  IF (ASSOCIATED(qs_env%mos)) THEN
156  CALL mpools_rebuild_fm_pools(qs_env%mpools, mos=qs_env%mos, &
157  blacs_env=blacs_env, para_env=para_env)
158  END IF
159 
160  ! create 2d distribution
161 
162  CALL distribute_molecules_2d(cell=cell, &
163  atomic_kind_set=atomic_kind_set, &
164  qs_kind_set=qs_kind_set, &
165  particle_set=particle_set, &
166  molecule_kind_set=molecule_kind_set, &
167  molecule_set=molecule_set, &
168  distribution_2d=distribution_2d, &
169  blacs_env=blacs_env, &
170  force_env_section=qs_env%input)
171 
172  ! and use it to create the dbcsr_dist, which should be the sole user of distribution_2d by now.
173  ALLOCATE (dbcsr_dist)
174  CALL cp_dbcsr_dist2d_to_dist(distribution_2d, dbcsr_dist)
175  CALL set_ks_env(ks_env, dbcsr_dist=dbcsr_dist)
176 
177  ! also keep distribution_2d in qs_env
178  CALL set_ks_env(ks_env, distribution_2d=distribution_2d)
179  CALL distribution_2d_release(distribution_2d)
180 
181  CALL timestop(handle)
182 
183  END SUBROUTINE qs_env_setup
184 
185 ! **************************************************************************************************
186 !> \brief rebuilds the pw_env in the given qs_env, allocating it if necessary
187 !> \param qs_env the qs_env whose pw_env has to be rebuilt
188 !> \par History
189 !> 10.2002 created [fawzi]
190 !> \author Fawzi Mohamed
191 ! **************************************************************************************************
192  SUBROUTINE qs_env_rebuild_pw_env(qs_env)
193  TYPE(qs_environment_type), POINTER :: qs_env
194 
195  CHARACTER(len=*), PARAMETER :: routinen = 'qs_env_rebuild_pw_env'
196 
197  INTEGER :: handle
198  LOGICAL :: nlcc
199  TYPE(cell_type), POINTER :: cell
200  TYPE(dft_control_type), POINTER :: dft_control
201  TYPE(ewald_environment_type), POINTER :: ewald_env
202  TYPE(ewald_pw_type), POINTER :: ewald_pw
203  TYPE(pw_c1d_gs_type), POINTER :: rho_core, rho_nlcc_g
204  TYPE(pw_env_type), POINTER :: new_pw_env
205  TYPE(pw_pool_type), POINTER :: auxbas_pw_pool
206  TYPE(pw_r3d_rs_type), POINTER :: embed_pot, external_vxc, rho_nlcc, &
207  spin_embed_pot, v_hartree_rspace, vee, &
208  vppl
209  TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
210  TYPE(qs_ks_env_type), POINTER :: ks_env
211  TYPE(rho0_mpole_type), POINTER :: rho0_mpole
212 
213  CALL timeset(routinen, handle)
214  ! rebuild pw_env
215  NULLIFY (dft_control, cell, ks_env, v_hartree_rspace, auxbas_pw_pool)
216  NULLIFY (rho0_mpole)
217  NULLIFY (ewald_env, ewald_pw, new_pw_env, external_vxc, rho_core, rho_nlcc, rho_nlcc_g, vee, vppl, &
218  embed_pot, spin_embed_pot)
219 
220  CALL get_qs_env(qs_env, ks_env=ks_env, pw_env=new_pw_env)
221  IF (.NOT. ASSOCIATED(new_pw_env)) THEN
222  CALL pw_env_create(new_pw_env)
223  CALL set_ks_env(ks_env, pw_env=new_pw_env)
224  CALL pw_env_release(new_pw_env)
225  END IF
226 
227  CALL get_qs_env(qs_env, pw_env=new_pw_env, dft_control=dft_control, &
228  cell=cell)
229 
230  IF (any(new_pw_env%cell_hmat /= cell%hmat)) THEN
231  ! only rebuild if necessary
232  new_pw_env%cell_hmat = cell%hmat
233  CALL pw_env_rebuild(new_pw_env, qs_env=qs_env)
234 
235  ! reallocate rho_core
236  CALL get_qs_env(qs_env, pw_env=new_pw_env, rho_core=rho_core)
237  cpassert(ASSOCIATED(new_pw_env))
238  IF (dft_control%qs_control%gapw) THEN
239  IF (ASSOCIATED(rho_core)) THEN
240  CALL rho_core%release()
241  DEALLOCATE (rho_core)
242  END IF
243  IF (dft_control%qs_control%gapw_control%nopaw_as_gpw) THEN
244  ALLOCATE (rho_core)
245  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
246  CALL auxbas_pw_pool%create_pw(rho_core)
247  CALL set_ks_env(ks_env, rho_core=rho_core)
248  END IF
249  CALL get_qs_env(qs_env=qs_env, rho0_mpole=rho0_mpole)
250  CALL rho0_s_grid_create(new_pw_env, rho0_mpole)
251  ELSE IF (dft_control%qs_control%semi_empirical) THEN
252  IF (dft_control%qs_control%se_control%do_ewald .OR. &
253  dft_control%qs_control%se_control%do_ewald_gks) THEN
254  ! rebuild Ewald environment
255  CALL get_qs_env(qs_env=qs_env, ewald_env=ewald_env, ewald_pw=ewald_pw)
256  CALL ewald_pw_grid_update(ewald_pw, ewald_env, cell%hmat)
257  END IF
258  ELSE IF (dft_control%qs_control%dftb) THEN
259  IF (dft_control%qs_control%dftb_control%do_ewald) THEN
260  ! rebuild Ewald environment
261  CALL get_qs_env(qs_env=qs_env, ewald_env=ewald_env, ewald_pw=ewald_pw)
262  CALL ewald_pw_grid_update(ewald_pw, ewald_env, cell%hmat)
263  END IF
264  ELSE IF (dft_control%qs_control%xtb) THEN
265  IF (dft_control%qs_control%xtb_control%do_ewald) THEN
266  ! rebuild Ewald environment
267  CALL get_qs_env(qs_env=qs_env, ewald_env=ewald_env, ewald_pw=ewald_pw)
268  CALL ewald_pw_grid_update(ewald_pw, ewald_env, cell%hmat)
269  END IF
270  ELSE
271  IF (ASSOCIATED(rho_core)) THEN
272  CALL rho_core%release()
273  DEALLOCATE (rho_core)
274  END IF
275  ALLOCATE (rho_core)
276  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
277  CALL auxbas_pw_pool%create_pw(rho_core)
278  CALL set_ks_env(ks_env, rho_core=rho_core)
279  END IF
280 
281  ! reallocate vppl (realspace grid of local pseudopotential
282  IF (dft_control%qs_control%do_ppl_method == do_ppl_grid) THEN
283  NULLIFY (vppl)
284  CALL get_qs_env(qs_env, pw_env=new_pw_env, vppl=vppl)
285  IF (ASSOCIATED(vppl)) THEN
286  CALL vppl%release()
287  ELSE
288  ALLOCATE (vppl)
289  END IF
290  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
291  CALL auxbas_pw_pool%create_pw(vppl)
292  CALL set_ks_env(ks_env, vppl=vppl)
293  END IF
294 
295  ! reallocate rho_nlcc
296  CALL get_qs_env(qs_env=qs_env, qs_kind_set=qs_kind_set)
297  nlcc = has_nlcc(qs_kind_set)
298  IF (nlcc) THEN
299  ! the realspace version
300  NULLIFY (rho_nlcc)
301  CALL get_qs_env(qs_env, pw_env=new_pw_env, rho_nlcc=rho_nlcc)
302  IF (ASSOCIATED(rho_nlcc)) THEN
303  CALL rho_nlcc%release()
304  ELSE
305  ALLOCATE (rho_nlcc)
306  END IF
307  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
308  CALL auxbas_pw_pool%create_pw(rho_nlcc)
309  CALL set_ks_env(ks_env, rho_nlcc=rho_nlcc)
310  ! the g-space version
311  NULLIFY (rho_nlcc_g)
312  CALL get_qs_env(qs_env, pw_env=new_pw_env, rho_nlcc_g=rho_nlcc_g)
313  IF (ASSOCIATED(rho_nlcc_g)) THEN
314  CALL rho_nlcc_g%release()
315  ELSE
316  ALLOCATE (rho_nlcc_g)
317  END IF
318  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
319  CALL auxbas_pw_pool%create_pw(rho_nlcc_g)
320  CALL set_ks_env(ks_env, rho_nlcc_g=rho_nlcc_g)
321  END IF
322 
323  ! reallocate vee: external electrostatic potential
324  IF (dft_control%apply_external_potential) THEN
325  NULLIFY (vee)
326  CALL get_qs_env(qs_env, pw_env=new_pw_env, vee=vee)
327  IF (ASSOCIATED(vee)) THEN
328  CALL vee%release()
329  DEALLOCATE (vee)
330  END IF
331  ALLOCATE (vee)
332  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
333  CALL auxbas_pw_pool%create_pw(vee)
334  CALL set_ks_env(ks_env, vee=vee)
335  dft_control%eval_external_potential = .true.
336  END IF
337 
338  ! ZMP Reallocate external_vxc: external vxc potential
339  IF (dft_control%apply_external_vxc) THEN
340  NULLIFY (external_vxc)
341  CALL get_qs_env(qs_env, pw_env=new_pw_env, external_vxc=external_vxc)
342  IF (ASSOCIATED(external_vxc)) THEN
343  CALL external_vxc%release()
344  ELSE
345  ALLOCATE (external_vxc)
346  END IF
347  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
348  CALL auxbas_pw_pool%create_pw(external_vxc)
349  CALL set_qs_env(qs_env, external_vxc=external_vxc)
350  dft_control%read_external_vxc = .true.
351  END IF
352 
353  ! Embedding Reallocate: embed_pot
354  IF (dft_control%apply_embed_pot) THEN
355  NULLIFY (embed_pot)
356  CALL get_qs_env(qs_env, pw_env=new_pw_env, embed_pot=embed_pot)
357  IF (ASSOCIATED(embed_pot)) THEN
358  CALL embed_pot%release()
359  ELSE
360  ALLOCATE (embed_pot)
361  END IF
362  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
363  CALL auxbas_pw_pool%create_pw(embed_pot)
364  CALL set_qs_env(qs_env, embed_pot=embed_pot)
365 
366  NULLIFY (spin_embed_pot)
367  CALL get_qs_env(qs_env, pw_env=new_pw_env, spin_embed_pot=spin_embed_pot)
368  IF (ASSOCIATED(spin_embed_pot)) THEN
369  CALL spin_embed_pot%release()
370  DEALLOCATE (spin_embed_pot)
371  ELSE
372  ALLOCATE (spin_embed_pot)
373  END IF
374  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
375  CALL auxbas_pw_pool%create_pw(spin_embed_pot)
376  CALL set_qs_env(qs_env, spin_embed_pot=spin_embed_pot)
377  END IF
378 
379  CALL get_ks_env(ks_env, v_hartree_rspace=v_hartree_rspace)
380  IF (ASSOCIATED(v_hartree_rspace)) THEN
381  CALL v_hartree_rspace%release()
382  DEALLOCATE (v_hartree_rspace)
383  END IF
384  CALL get_qs_env(qs_env, pw_env=new_pw_env)
385  CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
386  ALLOCATE (v_hartree_rspace)
387  CALL auxbas_pw_pool%create_pw(v_hartree_rspace)
388  CALL set_ks_env(ks_env, v_hartree_rspace=v_hartree_rspace)
389  END IF
390 
391  !update the time in the poisson environment, to update time dependant constraints
392  new_pw_env%poisson_env%parameters%dbc_params%time = qs_env%sim_time
393 
394  CALL timestop(handle)
395 
396  END SUBROUTINE qs_env_rebuild_pw_env
397 
398 ! **************************************************************************************************
399 !> \brief ...
400 !> \param qs_env ...
401 !> \param time ...
402 !> \param itimes ...
403 ! **************************************************************************************************
404  SUBROUTINE qs_env_time_update(qs_env, time, itimes)
405  TYPE(qs_environment_type), POINTER :: qs_env
406  REAL(kind=dp), INTENT(IN) :: time
407  INTEGER, INTENT(IN) :: itimes
408 
409  TYPE(dft_control_type), POINTER :: dft_control
410 
411  qs_env%sim_time = time
412  qs_env%sim_step = itimes
413 
414  CALL get_qs_env(qs_env=qs_env, dft_control=dft_control)
415 
416  IF (dft_control%apply_external_potential) THEN
417  IF (.NOT. dft_control%expot_control%static) THEN
418  dft_control%eval_external_potential = .true.
419  END IF
420  END IF
421 
422  END SUBROUTINE qs_env_time_update
423 
424 END MODULE qs_environment_methods
Define the atomic kind types and their sub types.
Handles all functions related to the CELL.
Definition: cell_types.F:15
methods related to the blacs parallel environment
Definition: cp_blacs_env.F:15
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_dist2d_to_dist(dist2d, dist)
Creates a DBCSR distribution from a distribution_2d.
stores a mapping of 2D info (e.g. matrix) on a 2D processor distribution (i.e. blacs grid) where cpus...
subroutine, public distribution_2d_release(distribution_2d)
...
Distribution methods for atoms, particles, or molecules.
subroutine, public distribute_molecules_2d(cell, atomic_kind_set, particle_set, qs_kind_set, molecule_kind_set, molecule_set, distribution_2d, blacs_env, force_env_section)
Distributes the particle pairs creating a 2d distribution optimally suited for quickstep.
subroutine, public ewald_pw_grid_update(ewald_pw, ewald_env, cell_hmat)
Rescales pw_grids for given box, if necessary.
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_ppl_grid
Defines the basic variable types.
Definition: kinds.F:23
integer, parameter, public dp
Definition: kinds.F:34
Interface to the message passing library MPI.
Define the molecule kind structure types and the corresponding functionality.
Define the data structure for the molecule information.
Define the data structure for the particle information.
methods of pw_env that have dependence on qs_env
subroutine, public pw_env_rebuild(pw_env, qs_env, external_para_env)
rebuilds the pw_env data (necessary if cell or cutoffs change)
subroutine, public pw_env_create(pw_env)
creates a pw_env, if qs_env is given calls pw_env_rebuild
container for various plainwaves related things
Definition: pw_env_types.F:14
subroutine, public pw_env_release(pw_env, para_env)
releases the given pw_env (see doc/ReferenceCounting.html)
Definition: pw_env_types.F:176
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
Definition: pw_env_types.F:113
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Definition: pw_pool_types.F:24
container for information about total charges on the grids
subroutine, public qs_charges_create(qs_charges, nspins, total_rho_core_rspace, total_rho_gspace)
creates a charges object
qs_environment methods that use many other modules
subroutine, public qs_env_time_update(qs_env, time, itimes)
...
subroutine, public qs_env_setup(qs_env)
initializes various components of the qs_env, that need only atomic_kind_set, cell,...
subroutine, public qs_env_rebuild_pw_env(qs_env)
rebuilds the pw_env in the given qs_env, allocating it if necessary
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_RI_aux_kp, matrix_s, matrix_s_RI_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, WannierCentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, rhs)
Get the QUICKSTEP environment.
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, ewald_env, ewald_pw, mpools, rho_external, external_vxc, mask, scf_control, rel_control, qs_charges, ks_env, ks_qmmm_env, wf_history, scf_env, active_space, input, oce, rho_atom_set, rho0_atom_set, rho0_mpole, run_rtp, rtp, rhoz_set, rhoz_tot, ecoul_1c, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, efield, linres_control, xas_env, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, ls_scf_env, do_transport, transport_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, gcp_env, mp2_env, bs_env, kg_env, force, kpoints, WannierCentres, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, rhs)
Set the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
Definition: qs_kind_types.F:23
logical function, public has_nlcc(qs_kind_set)
finds if a given qs run needs to use nlcc
subroutine, public get_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, complex_ks, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_RI_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_RI_aux_kp, matrix_ks_im_kp, rho, rho_xc, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, task_list, task_list_soft, kpoints, do_kpoints, atomic_kind_set, qs_kind_set, cell, cell_ref, use_ref_cell, particle_set, energy, force, local_particles, local_molecules, molecule_kind_set, molecule_set, subsys, cp_subsys, virial, results, atprop, nkind, natom, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env, nelectron_total, nelectron_spin)
...
Definition: qs_ks_types.F:330
subroutine, public set_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, complex_ks, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_RI_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_RI_aux_kp, matrix_ks_im_kp, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, kpoints, sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, task_list, task_list_soft, subsys, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env)
...
Definition: qs_ks_types.F:567
wrapper for the pools of matrixes
subroutine, public mpools_rebuild_fm_pools(mpools, mos, blacs_env, para_env, nmosub)
rebuilds the pools of the (ao x mo, ao x ao , mo x mo) full matrixes
Routines for performing an outer scf loop.
Definition: qs_outer_scf.F:14
integer function, public outer_loop_variables_count(scf_control, cdft_control)
returns the number of variables that is employed in the outer loop. with a CDFT constraint this value...
Definition: qs_outer_scf.F:69
subroutine, public rho0_s_grid_create(pw_env, rho0_mpole)
...
parameters that control an scf iteration