(git:cccd2f3)
Loading...
Searching...
No Matches
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-2026 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! **************************************************************************************************
17 USE cell_types, ONLY: cell_type
29 USE kinds, ONLY: dp
34 USE pw_env_methods, ONLY: pw_env_create,&
36 USE pw_env_types, ONLY: pw_env_get,&
40 USE pw_types, ONLY: pw_c1d_gs_type,&
47 USE qs_kind_types, ONLY: has_nlcc,&
49 USE qs_ks_types, ONLY: get_ks_env,&
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, &
68!***
69CONTAINS
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, xcint_weights
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, xcint_weights)
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 .AND. &
265 (.NOT. dft_control%qs_control%xtb_control%do_tblite)) THEN
266 IF (dft_control%qs_control%xtb_control%do_ewald) THEN
267 ! rebuild Ewald environment
268 CALL get_qs_env(qs_env=qs_env, ewald_env=ewald_env, ewald_pw=ewald_pw)
269 CALL ewald_pw_grid_update(ewald_pw, ewald_env, cell%hmat)
270 END IF
271 ELSE
272 IF (ASSOCIATED(rho_core)) THEN
273 CALL rho_core%release()
274 DEALLOCATE (rho_core)
275 END IF
276 ALLOCATE (rho_core)
277 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
278 CALL auxbas_pw_pool%create_pw(rho_core)
279 CALL set_ks_env(ks_env, rho_core=rho_core)
280 END IF
281
282 ! reallocate vppl (realspace grid of local pseudopotential
283 IF (dft_control%qs_control%do_ppl_method == do_ppl_grid) THEN
284 NULLIFY (vppl)
285 CALL get_qs_env(qs_env, pw_env=new_pw_env, vppl=vppl)
286 IF (ASSOCIATED(vppl)) THEN
287 CALL vppl%release()
288 ELSE
289 ALLOCATE (vppl)
290 END IF
291 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
292 CALL auxbas_pw_pool%create_pw(vppl)
293 CALL set_ks_env(ks_env, vppl=vppl)
294 END IF
295
296 ! reallocate rho_nlcc
297 CALL get_qs_env(qs_env=qs_env, qs_kind_set=qs_kind_set)
298 nlcc = has_nlcc(qs_kind_set)
299 IF (nlcc) THEN
300 ! the realspace version
301 NULLIFY (rho_nlcc)
302 CALL get_qs_env(qs_env, pw_env=new_pw_env, rho_nlcc=rho_nlcc)
303 IF (ASSOCIATED(rho_nlcc)) THEN
304 CALL rho_nlcc%release()
305 ELSE
306 ALLOCATE (rho_nlcc)
307 END IF
308 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
309 CALL auxbas_pw_pool%create_pw(rho_nlcc)
310 CALL set_ks_env(ks_env, rho_nlcc=rho_nlcc)
311 ! the g-space version
312 NULLIFY (rho_nlcc_g)
313 CALL get_qs_env(qs_env, pw_env=new_pw_env, rho_nlcc_g=rho_nlcc_g)
314 IF (ASSOCIATED(rho_nlcc_g)) THEN
315 CALL rho_nlcc_g%release()
316 ELSE
317 ALLOCATE (rho_nlcc_g)
318 END IF
319 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
320 CALL auxbas_pw_pool%create_pw(rho_nlcc_g)
321 CALL set_ks_env(ks_env, rho_nlcc_g=rho_nlcc_g)
322 END IF
323
324 ! reallocate xcint_weights
325 IF (dft_control%qs_control%gapw .OR. dft_control%qs_control%gapw_xc) THEN
326 IF (dft_control%qs_control%gapw_control%accurate_xcint) THEN
327 CALL set_ks_env(ks_env, exc_accint=.true.)
328 NULLIFY (xcint_weights)
329 CALL get_qs_env(qs_env, pw_env=new_pw_env, xcint_weights=xcint_weights)
330 IF (ASSOCIATED(xcint_weights)) THEN
331 CALL xcint_weights%release()
332 ELSE
333 ALLOCATE (xcint_weights)
334 END IF
335 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
336 CALL auxbas_pw_pool%create_pw(xcint_weights)
337 CALL set_ks_env(ks_env, xcint_weights=xcint_weights)
338 END IF
339 END IF
340
341 ! reallocate vee: external electrostatic potential
342 IF (dft_control%apply_external_potential .AND. .NOT. qs_env%mimic) THEN
343 NULLIFY (vee)
344 CALL get_qs_env(qs_env, pw_env=new_pw_env, vee=vee)
345 IF (ASSOCIATED(vee)) THEN
346 CALL vee%release()
347 DEALLOCATE (vee)
348 END IF
349 ALLOCATE (vee)
350 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
351 CALL auxbas_pw_pool%create_pw(vee)
352 CALL set_ks_env(ks_env, vee=vee)
353 dft_control%eval_external_potential = .true.
354 END IF
355
356 ! ZMP Reallocate external_vxc: external vxc potential
357 IF (dft_control%apply_external_vxc) THEN
358 NULLIFY (external_vxc)
359 CALL get_qs_env(qs_env, pw_env=new_pw_env, external_vxc=external_vxc)
360 IF (ASSOCIATED(external_vxc)) THEN
361 CALL external_vxc%release()
362 ELSE
363 ALLOCATE (external_vxc)
364 END IF
365 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
366 CALL auxbas_pw_pool%create_pw(external_vxc)
367 CALL set_qs_env(qs_env, external_vxc=external_vxc)
368 dft_control%read_external_vxc = .true.
369 END IF
370
371 ! Embedding Reallocate: embed_pot
372 IF (dft_control%apply_embed_pot) THEN
373 NULLIFY (embed_pot)
374 CALL get_qs_env(qs_env, pw_env=new_pw_env, embed_pot=embed_pot)
375 IF (ASSOCIATED(embed_pot)) THEN
376 CALL embed_pot%release()
377 ELSE
378 ALLOCATE (embed_pot)
379 END IF
380 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
381 CALL auxbas_pw_pool%create_pw(embed_pot)
382 CALL set_qs_env(qs_env, embed_pot=embed_pot)
383
384 NULLIFY (spin_embed_pot)
385 CALL get_qs_env(qs_env, pw_env=new_pw_env, spin_embed_pot=spin_embed_pot)
386 IF (ASSOCIATED(spin_embed_pot)) THEN
387 CALL spin_embed_pot%release()
388 DEALLOCATE (spin_embed_pot)
389 ELSE
390 ALLOCATE (spin_embed_pot)
391 END IF
392 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
393 CALL auxbas_pw_pool%create_pw(spin_embed_pot)
394 CALL set_qs_env(qs_env, spin_embed_pot=spin_embed_pot)
395 END IF
396
397 CALL get_ks_env(ks_env, v_hartree_rspace=v_hartree_rspace)
398 IF (ASSOCIATED(v_hartree_rspace)) THEN
399 CALL v_hartree_rspace%release()
400 DEALLOCATE (v_hartree_rspace)
401 END IF
402 CALL get_qs_env(qs_env, pw_env=new_pw_env)
403 CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool)
404 ALLOCATE (v_hartree_rspace)
405 CALL auxbas_pw_pool%create_pw(v_hartree_rspace)
406 CALL set_ks_env(ks_env, v_hartree_rspace=v_hartree_rspace)
407 END IF
408
409 !update the time in the poisson environment, to update time dependant constraints
410 new_pw_env%poisson_env%parameters%dbc_params%time = qs_env%sim_time
411
412 CALL timestop(handle)
413
414 END SUBROUTINE qs_env_rebuild_pw_env
415
416! **************************************************************************************************
417!> \brief ...
418!> \param qs_env ...
419!> \param time ...
420!> \param itimes ...
421! **************************************************************************************************
422 SUBROUTINE qs_env_time_update(qs_env, time, itimes)
423 TYPE(qs_environment_type), POINTER :: qs_env
424 REAL(kind=dp), INTENT(IN) :: time
425 INTEGER, INTENT(IN) :: itimes
426
427 TYPE(dft_control_type), POINTER :: dft_control
428
429 qs_env%sim_time = time
430 qs_env%sim_step = itimes
431
432 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control)
433
434 IF (dft_control%apply_external_potential) THEN
435 IF (.NOT. dft_control%expot_control%static) THEN
436 dft_control%eval_external_potential = .true.
437 END IF
438 END IF
439
440 END SUBROUTINE qs_env_time_update
441
442END 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
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
subroutine, public pw_env_release(pw_env, para_env)
releases the given pw_env (see doc/ReferenceCounting.html)
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
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
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, mimic, 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_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, 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, xcint_weights, 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, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_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, harris_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, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, mimic, 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, rhoz_cneo_set, 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, harris_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, eeq, rhs, do_rixs, tb_tblite)
Set the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
logical function, public has_nlcc(qs_kind_set)
finds if a given qs run needs to use nlcc
subroutine, public set_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, exc_accint, 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, xcint_weights, 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_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, task_list, task_list_soft, subsys, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env)
...
subroutine, public get_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, exc_accint, 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, xcint_weights, 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_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, 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)
...
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.
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...
subroutine, public rho0_s_grid_create(pw_env, rho0_mpole)
...
parameters that control an scf iteration
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
Definition cell_types.F:60
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
distributes pairs on a 2d grid of processors
stores all the informations relevant to an mpi environment
contained for different pw related things
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Container for information about total charges on the grids.
Provides all information about a quickstep kind.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...