(git:9dda3dd)
Loading...
Searching...
No Matches
mscfg_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 Subroutines to perform calculations on molecules from a bigger
10!> system. Useful to generate a high-quality MO guess for systems
11!> of many molecules with complex electronic structure, to bootstrap
12!> ALMO simulations, etc.
13!> \par History
14!> 10.2014 Rustam Z Khaliullin
15!> 09.2018 ALMO smearing support and ALMO diag+molecular_guess patch [Ruben Staub]
16!> \author Rustam Z Khaliullin
17! **************************************************************************************************
21 USE cp_dbcsr_api, ONLY: dbcsr_copy,&
23 dbcsr_type_no_symmetry
37 do_qs,&
51 USE qs_energy, ONLY: qs_energies
53 USE qs_environment, ONLY: qs_init
58 USE qs_mo_types, ONLY: get_mo_set,&
60#include "./base/base_uses.f90"
61
62 IMPLICIT NONE
63 PRIVATE
64
65 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'mscfg_methods'
66
68
69CONTAINS
70
71! **************************************************************************************************
72!> \brief Prepare data for calculations on isolated molecules.
73!> \param globenv ...
74!> \param force_env ...
75!> \par History
76!> 10.2014 created [Rustam Z Khaliullin]
77!> \author Rustam Z Khaliullin
78! **************************************************************************************************
79 SUBROUTINE loop_over_molecules(globenv, force_env)
80
81 TYPE(global_environment_type), POINTER :: globenv
82 TYPE(force_env_type), POINTER :: force_env
83
84 INTEGER :: nmols
85 INTEGER, ALLOCATABLE, DIMENSION(:) :: charge_of_frag, first_atom_of_frag, &
86 last_atom_of_frag, multip_of_frag
87 TYPE(molecule_type), DIMENSION(:), POINTER :: molecule_set
88 TYPE(qs_environment_type), POINTER :: qs_env
89
90 CALL force_env_get(force_env, qs_env=qs_env)
91 cpassert(ASSOCIATED(qs_env))
92 CALL get_qs_env(qs_env, &
93 molecule_set=molecule_set)
94
95 nmols = SIZE(molecule_set)
96
97 ALLOCATE (first_atom_of_frag(nmols))
98 ALLOCATE (last_atom_of_frag(nmols))
99 ALLOCATE (charge_of_frag(nmols))
100 ALLOCATE (multip_of_frag(nmols))
101
102 CALL get_molecule_set_info(molecule_set, &
103 mol_to_first_atom=first_atom_of_frag, &
104 mol_to_last_atom=last_atom_of_frag, &
105 mol_to_charge=charge_of_frag, &
106 mol_to_multiplicity=multip_of_frag)
107
108 CALL calcs_on_isolated_molecules(force_env, globenv, nmols, &
109 first_atom_of_frag, last_atom_of_frag, charge_of_frag, multip_of_frag)
110
111 DEALLOCATE (first_atom_of_frag)
112 DEALLOCATE (last_atom_of_frag)
113 DEALLOCATE (charge_of_frag)
114 DEALLOCATE (multip_of_frag)
115
116 END SUBROUTINE loop_over_molecules
117
118! **************************************************************************************************
119!> \brief Run calculations on isolated molecules. The ideas for setting up
120!> the calculations are borrowed from BSSE files
121!> \param force_env ...
122!> \param globenv ...
123!> \param nfrags ...
124!> \param first_atom_of_frag ...
125!> \param last_atom_of_frag ...
126!> \param charge_of_frag ...
127!> \param multip_of_frag ...
128!> \par History
129!> 10.2014 created
130!> 09.2018 ALMO smearing support, and ALMO diag+molecular_guess patch [Ruben Staub]
131!> \author Rustam Z Khaliullin
132! **************************************************************************************************
133 SUBROUTINE calcs_on_isolated_molecules(force_env, globenv, nfrags, &
134 first_atom_of_frag, last_atom_of_frag, charge_of_frag, multip_of_frag)
135
136 TYPE(force_env_type), POINTER :: force_env
137 TYPE(global_environment_type), POINTER :: globenv
138 INTEGER, INTENT(IN) :: nfrags
139 INTEGER, DIMENSION(:), INTENT(INOUT) :: first_atom_of_frag, last_atom_of_frag, &
140 charge_of_frag, multip_of_frag
141
142 CHARACTER(LEN=*), PARAMETER :: routinen = 'calcs_on_isolated_molecules'
143
144 CHARACTER(LEN=default_string_length) :: name
145 CHARACTER(LEN=default_string_length), &
146 DIMENSION(:), POINTER :: atom_type
147 INTEGER :: first_atom, force_method, global_charge, global_multpl, handle, i, ifrag, imo, &
148 isize, j, k, last_atom, my_targ, nb_eigenval_stored, nmo, nmo_of_frag, nmosets_of_frag, &
149 tot_added_mos, tot_isize
150 INTEGER, DIMENSION(:), POINTER :: atom_index, atom_list
151 LOGICAL :: global_almo_scf_keyword, smear_almo_scf
152 TYPE(almo_scf_env_type), POINTER :: almo_scf_env
153 TYPE(cp_subsys_type), POINTER :: subsys, subsys_loc
154 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos, mos_of_frag
155 TYPE(molecular_scf_guess_env_type), POINTER :: mscfg_env
156 TYPE(mp_para_env_type), POINTER :: para_env
157 TYPE(particle_list_type), POINTER :: particles
158 TYPE(qs_energy_type), POINTER :: qs_energy
159 TYPE(qs_environment_type), POINTER :: qs_env, qs_env_loc
160 TYPE(section_vals_type), POINTER :: dft_section, force_env_section, &
161 qs_section, root_section, scf_section, &
162 subsys_section
163
164 CALL timeset(routinen, handle)
165
166 NULLIFY (subsys_loc, subsys, particles, para_env, atom_index, atom_type, &
167 force_env_section, qs_env_loc, mscfg_env, qs_env, qs_energy)
168 CALL force_env_get(force_env, force_env_section=force_env_section, &
169 qs_env=qs_env)
170 CALL section_vals_val_get(force_env_section, "METHOD", i_val=force_method)
171 cpassert(force_method == do_qs)
172 root_section => force_env%root_section
173 subsys_section => section_vals_get_subs_vals(force_env_section, "SUBSYS")
174 dft_section => section_vals_get_subs_vals(force_env_section, "DFT")
175 !
176 ! Save several global settings to restore them after the loop:
177 ! charge, multiplicity, ALMO flag
178 !
179 CALL section_vals_val_get(dft_section, "CHARGE", i_val=global_charge)
180 CALL section_vals_val_get(dft_section, "MULTIPLICITY", i_val=global_multpl)
181 qs_section => section_vals_get_subs_vals(dft_section, "QS")
182 CALL section_vals_val_get(qs_section, "ALMO_SCF", l_val=global_almo_scf_keyword)
183 !
184 ! Get access to critical data before the loop
185 !
186 CALL force_env_get(force_env=force_env, subsys=subsys, para_env=para_env)
187 CALL cp_subsys_get(subsys, particles=particles)
188 CALL get_qs_env(qs_env, mscfg_env=mscfg_env, almo_scf_env=almo_scf_env)
189 cpassert(ASSOCIATED(mscfg_env))
190 IF (global_almo_scf_keyword) THEN !! Check if smearing is on, and retrieve smearing parameters accordingly
191 smear_almo_scf = qs_env%scf_control%smear%do_smear
192 IF (smear_almo_scf) THEN
193 scf_section => section_vals_get_subs_vals(dft_section, "SCF")
194 CALL section_vals_val_get(scf_section, "added_mos", i_val=tot_added_mos) !! Get total number of added MOs
195 tot_isize = last_atom_of_frag(nfrags) - first_atom_of_frag(1) + 1 !! Get total number of atoms (assume consecutive atoms)
196 !! Check that number of added MOs matches the number of atoms
197 !! (to ensure compatibility, since each fragment will be computed with such parameters)
198 IF (tot_isize /= tot_added_mos) THEN
199 cpabort("ALMO smearing currently requires ADDED_MOS == total number of atoms")
200 END IF
201 !! Get total number of MOs
202 CALL get_qs_env(qs_env, mos=mos)
203 IF (SIZE(mos) > 1) cpabort("Unrestricted ALMO methods are NYI") !! Unrestricted ALMO is not implemented yet
204 CALL get_mo_set(mo_set=mos(1), nmo=nmo)
205 !! Initialize storage of MO energies for ALMO smearing
206 cpassert(ASSOCIATED(almo_scf_env))
207 ALLOCATE (almo_scf_env%mo_energies(nmo, SIZE(mos)))
208 ALLOCATE (almo_scf_env%kTS(SIZE(mos)))
209 nb_eigenval_stored = 0 !! Keep track of how many eigenvalues were stored in mo_energies
210 END IF
211 ELSE
212 smear_almo_scf = .false.
213 END IF
214 !
215 ! These flags determine the options of molecular runs (e.g. cell size)
216 !
217 !!!LATER is_fast_dirty = mscfg_env%is_fast_dirty - shrink the cell
218 !!!LATER is_crystal = mscfg_env%is_crystal - remove periodicity
219 !
220 ! Prepare storage for the results
221 ! Until molecular_scf_guess_env is destroyed it will keep
222 ! the results of fragment calculations
223 !
224 CALL molecular_scf_guess_env_init(mscfg_env, nfrags)
225
226 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
227 !
228 ! Start the loop over molecules
229 !
230 ! Here is the list of modifications necessary to run isolated molecules:
231 ! * Atom list of a subsystem and their names
232 ! * Charge and multiplicity of a subsystem
233 ! * ALMO SCF flag off (unless several levels of recursion is desired)
234 ! * Smaller cell can be provided if a fast-and-dirty approach is ok
235 ! * Set ADDED_MOS to number of atoms in the fragment, if smearing requested (VASP default)
236 ! * ... add your own and explain it here ...
237 !
238 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
239 DO ifrag = 1, nfrags
240 !
241 ! Turn ALMO SCF flag off
242 !
243 CALL section_vals_val_set(qs_section, "ALMO_SCF", l_val=.false.)
244 !
245 ! Setup the charge and multiplicity of the molecule
246 !
247
248 IF (almo_scf_env%activate(1) == 1) THEN
249 multip_of_frag(ifrag) = almo_scf_env%multiplicity_of_domain(ifrag)
250 charge_of_frag(ifrag) = almo_scf_env%charge_of_domain(ifrag)
251 ELSE
252 CALL section_vals_val_set(dft_section, "CHARGE", i_val=charge_of_frag(ifrag))
253 CALL section_vals_val_set(dft_section, "MULTIPLICITY", i_val=multip_of_frag(ifrag))
254 END IF
255
256 !
257 ! Create a list of atoms in the current molecule
258 !
259 ! Assume that atoms arranged consecutively (in ALMO SCF it is always the case)
260 ! It is important to have a linear scaling procedure here
261 first_atom = first_atom_of_frag(ifrag)
262 last_atom = last_atom_of_frag(ifrag)
263 isize = last_atom - first_atom + 1
264 ALLOCATE (atom_index(isize))
265 atom_index(1:isize) = [(i, i=first_atom, last_atom)]
266 !
267 ! Get atom type names
268 !
269 ALLOCATE (atom_type(isize))
270 DO j = 1, isize
271 my_targ = atom_index(j)
272 DO k = 1, SIZE(particles%els)
273 CALL get_atomic_kind(particles%els(k)%atomic_kind, atom_list=atom_list, name=name)
274 IF (any(atom_list == my_targ)) EXIT
275 END DO
276 atom_type(j) = name
277 END DO
278 !
279 ! If smearing requested, setup ADDED_MOS correctly for each fragment (i.e. number of atoms in fragment)
280 !
281 IF (smear_almo_scf) THEN
282 CALL section_vals_val_set(scf_section, "added_mos", i_val=isize)
283 END IF
284 !
285 ! Create the environment of a subsystem
286 !
287 CALL create_small_subsys(subsys_loc, big_subsys=subsys, small_para_env=para_env, &
288 small_cell=subsys%cell, sub_atom_index=atom_index, &
289 sub_atom_kind_name=atom_type, para_env=para_env, &
290 force_env_section=force_env_section, subsys_section=subsys_section)
291 ALLOCATE (qs_env_loc)
292 CALL qs_env_create(qs_env_loc, globenv)
293 CALL qs_init(qs_env_loc, para_env, root_section, globenv=globenv, cp_subsys=subsys_loc, &
294 force_env_section=force_env_section, subsys_section=subsys_section, &
295 use_motion_section=.false., multip=multip_of_frag(ifrag), charge=charge_of_frag(ifrag))
296 CALL cp_subsys_release(subsys_loc)
297
298 !
299 ! Print-out fragment info
300 !
301 CALL print_frag_info(atom_index, atom_type, ifrag, nfrags, &
302 charge_of_frag(ifrag), multip_of_frag(ifrag))
303 !
304 ! Run calculations on a subsystem
305 !
306 CALL qs_energies(qs_env_loc)
307 !
308 ! Get the desired results (energy and MOs) out
309 !
310 CALL get_qs_env(qs_env_loc, mos=mos_of_frag, energy=qs_energy)
311 !
312 ! Store all desired results of fragment calculations in the fragment_env
313 ! of the qs_env to use them later as needed
314 !
315 mscfg_env%energy_of_frag(ifrag) = qs_energy%total
316 nmosets_of_frag = SIZE(mos_of_frag)
317 cpassert(nmosets_of_frag <= mscfg_max_moset_size)
318 mscfg_env%nmosets_of_frag(ifrag) = nmosets_of_frag
319 DO imo = 1, nmosets_of_frag
320 !! Forcing compatibility for ALMO smearing
321 IF (global_almo_scf_keyword) THEN
322 !! Manually add compatibility between ALMO SCF and diag SCF (used for smearing compatibility)
323 !! MOs are required to compute ALMO orbitals, but not stored with diag SCF algorithm...
324 !! RS-WARNING: Should be properly fixed, this is just a raw fix.
325 CALL copy_fm_to_dbcsr(mos_of_frag(imo)%mo_coeff, &
326 mos_of_frag(imo)%mo_coeff_b)
327 IF (smear_almo_scf) THEN
328 !! Store MOs energies for ALMO smearing purpose
329 nmo_of_frag = SIZE(mos_of_frag(imo)%eigenvalues)
330 almo_scf_env%mo_energies(nb_eigenval_stored + 1:nb_eigenval_stored + nmo_of_frag, imo) &
331 = mos_of_frag(imo)%eigenvalues(:)
332 !! update stored energies offset. Assumes nmosets_of_frag == 1 (general smearing ALMO assumption)
333 nb_eigenval_stored = nb_eigenval_stored + nmo_of_frag
334 END IF
335 END IF !! ALMO
336
337 ! the matrices have been allocated already - copy the results there
338 CALL dbcsr_create(mscfg_env%mos_of_frag(ifrag, imo), &
339 template=mos_of_frag(imo)%mo_coeff_b, &
340 matrix_type=dbcsr_type_no_symmetry)
341 CALL dbcsr_copy(mscfg_env%mos_of_frag(ifrag, imo), &
342 mos_of_frag(imo)%mo_coeff_b)
343 END DO
344 !
345 ! Clean up
346 !
347 NULLIFY (qs_energy)
348 CALL qs_env_release(qs_env_loc)
349 DEALLOCATE (qs_env_loc)
350 DEALLOCATE (atom_index)
351 DEALLOCATE (atom_type)
352
353 END DO
354
355 CALL section_vals_val_set(dft_section, "CHARGE", i_val=global_charge)
356 CALL section_vals_val_set(dft_section, "MULTIPLICITY", i_val=global_multpl)
357 CALL section_vals_val_set(qs_section, "ALMO_SCF", l_val=global_almo_scf_keyword)
358
359 CALL timestop(handle)
360
361 END SUBROUTINE calcs_on_isolated_molecules
362
363! **************************************************************************************************
364!> \brief Print info about fragment
365!> \param atom_index ...
366!> \param atom_type ...
367!> \param frag ...
368!> \param nfrags ...
369!> \param charge ...
370!> \param multpl ...
371!> \par History
372!> 07.2005 created as a part of BSSE calculations [tlaino]
373!> 10.2014 adapted to ALMO guess calculations [Rustam Z Khaliullin]
374!> \author Rustam Z Khaliullin
375! **************************************************************************************************
376 SUBROUTINE print_frag_info(atom_index, atom_type, frag, nfrags, charge, &
377 multpl)
378
379 INTEGER, DIMENSION(:), POINTER :: atom_index
380 CHARACTER(len=default_string_length), &
381 DIMENSION(:), POINTER :: atom_type
382 INTEGER, INTENT(IN) :: frag, nfrags, charge, multpl
383
384 CHARACTER(len=11) :: chari
385 INTEGER :: i, iw
386 TYPE(cp_logger_type), POINTER :: logger
387
388 NULLIFY (logger)
389 logger => cp_get_default_logger()
390 IF (logger%para_env%is_source()) THEN
391 iw = cp_logger_get_default_unit_nr(logger, local=.true.)
392 ELSE
393 iw = -1
394 END IF
395
396 IF (iw > 0) THEN
397
398 WRITE (unit=iw, fmt="(/,T2,A)") repeat("-", 79)
399 WRITE (unit=iw, fmt="(T2,A,T80,A)") "-", "-"
400 WRITE (unit=iw, fmt="(T2,A,T5,A,T25,A,T40,I11,T53,A,T67,I11,T80,A)") &
401 "-", "MOLECULAR GUESS:", "FRAGMENT", frag, "OUT OF", nfrags, "-"
402 WRITE (unit=iw, fmt="(T2,A,T25,A,T40,I11,T53,A,T67,I11,T80,A)") "-", "CHARGE", charge, "MULTIPLICITY", &
403 multpl, "-"
404 WRITE (unit=iw, fmt="(T2,A,T80,A)") "-", "-"
405 WRITE (unit=iw, fmt="(T2,A,T25,A,T53,A,T80,A)") "-", "ATOM INDEX", "ATOM NAME", "-"
406 WRITE (unit=iw, fmt="(T2,A,T25,A,T53,A,T80,A)") "-", "----------", "---------", "-"
407 DO i = 1, SIZE(atom_index)
408 WRITE (chari, '(I11)') atom_index(i)
409 WRITE (unit=iw, fmt="(T2,A,T25,A,T53,A,T80,A)") "-", adjustl(chari), trim(atom_type(i)), "-"
410 END DO
411 WRITE (unit=iw, fmt="(T2,A)") repeat("-", 79)
412 END IF
413
414 END SUBROUTINE print_frag_info
415
416! **************************************************************************************************
417!> \brief Is the loop over molecules requested?
418!> \param force_env ...
419!> \return ...
420!> \par History
421!> 10.2014 created [Rustam Z. Khaliullin]
422!> \author Rustam Z. Khaliullin
423! **************************************************************************************************
424 FUNCTION do_mol_loop(force_env)
425
426 TYPE(force_env_type), POINTER :: force_env
427 LOGICAL :: do_mol_loop
428
429 INTEGER :: almo_guess_type, frz_term_type, &
430 method_name_id, scf_guess_type
431 LOGICAL :: almo_scf_is_on, is_crystal, is_fast_dirty
432 TYPE(molecular_scf_guess_env_type), POINTER :: mscfg_env
433 TYPE(qs_environment_type), POINTER :: qs_env
434 TYPE(section_vals_type), POINTER :: force_env_section, subsection
435
436 do_mol_loop = .false.
437 ! What kind of options are we using in the loop ?
438 is_fast_dirty = .true.
439 is_crystal = .false.
440 almo_scf_is_on = .false.
441
442 NULLIFY (qs_env, mscfg_env, force_env_section, subsection)
443 CALL force_env_get(force_env, force_env_section=force_env_section)
444 CALL section_vals_val_get(force_env_section, "METHOD", i_val=method_name_id)
445
446 IF (method_name_id == do_qs) THEN
447
448 CALL force_env_get(force_env, qs_env=qs_env)
449 cpassert(ASSOCIATED(qs_env))
450
451 CALL get_qs_env(qs_env, mscfg_env=mscfg_env)
452 cpassert(ASSOCIATED(mscfg_env))
453
454 !!!! RZK-warning: All decisions are based on the values of input keywords
455 !!!! The real danger is that many of these keywords might not be even
456 !!!! in control of the job. They might be simply present in the input
457 !!!! This section must be re-written more accurately
458
459 ! check ALMO SCF guess option
460 NULLIFY (subsection)
461 subsection => section_vals_get_subs_vals(force_env_section, "DFT%ALMO_SCF")
462 CALL section_vals_val_get(subsection, "ALMO_SCF_GUESS", i_val=almo_guess_type)
463 ! check whether ALMO SCF is on
464 NULLIFY (subsection)
465 subsection => section_vals_get_subs_vals(force_env_section, "DFT%QS")
466 CALL section_vals_val_get(subsection, "ALMO_SCF", l_val=almo_scf_is_on)
467
468 ! check SCF guess option
469 NULLIFY (subsection)
470 subsection => section_vals_get_subs_vals(force_env_section, "DFT%SCF")
471 CALL section_vals_val_get(subsection, "SCF_GUESS", i_val=scf_guess_type)
472
473 ! check ALMO EDA options
474 NULLIFY (subsection)
475 !!!LATER subsection => section_vals_get_subs_vals(force_env_section,"DFT%ALMO_SCF%ALMO_DA")
476 !!!LATER CALL section_vals_val_get(subsection,"FRZ_TERM",i_val=frz_term_type)
477 frz_term_type = almo_frz_none
478
479 ! Are we doing the loop ?
480 IF (scf_guess_type == molecular_guess .OR. & ! SCF guess is molecular
481 (almo_guess_type == molecular_guess .AND. almo_scf_is_on) .OR. & ! ALMO SCF guess is molecular
482 frz_term_type /= almo_frz_none) THEN ! ALMO FRZ term is requested
483
484 do_mol_loop = .true.
485
486 ! If we are calculating molecular guess it is OK to do fast and dirty loop
487 ! It is NOT ok to be sloppy with ALMO EDA calculations of the FRZ term
488 IF (frz_term_type /= almo_frz_none) THEN
489 is_fast_dirty = .false.
490 IF (frz_term_type == almo_frz_crystal) THEN
491 is_crystal = .true.
492 END IF
493 END IF
494
495 END IF
496
497 mscfg_env%is_fast_dirty = is_fast_dirty
498 mscfg_env%is_crystal = is_crystal
499
500 END IF
501
502 RETURN
503
504 END FUNCTION do_mol_loop
505
506END MODULE mscfg_methods
507
Types for all ALMO-based methods.
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
DBCSR operations in CP2K.
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
Initialize a small environment for a particular calculation.
subroutine, public create_small_subsys(small_subsys, big_subsys, small_cell, small_para_env, sub_atom_index, sub_atom_kind_name, para_env, force_env_section, subsys_section, ignore_outside_box)
updates the molecule information of the given subsys
types that represent a subsys, i.e. a part of the system
subroutine, public cp_subsys_release(subsys)
releases a subsys (see doc/ReferenceCounting.html)
subroutine, public cp_subsys_get(subsys, ref_count, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell)
returns information about various attributes of the given subsys
Interface for the force calculations.
recursive subroutine, public force_env_get(force_env, in_use, fist_env, qs_env, meta_env, fp_env, subsys, para_env, potential_energy, additional_potential, kinetic_energy, harmonic_shell, kinetic_shell, cell, sub_force_env, qmmm_env, qmmmx_env, eip_env, pwdft_env, globenv, input, force_env_section, method_name_id, root_section, mixed_env, nnp_env, embed_env, ipi_env)
returns various attributes about the force environment
Define type storing the global information of a run. Keep the amount of stored data small....
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public molecular_guess
integer, parameter, public almo_frz_crystal
integer, parameter, public almo_frz_none
integer, parameter, public do_qs
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_vals_val_set(section_vals, keyword_name, i_rep_section, i_rep_val, val, l_val, i_val, r_val, c_val, l_vals_ptr, i_vals_ptr, r_vals_ptr, c_vals_ptr)
sets the requested value
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public default_string_length
Definition kinds.F:57
Interface to the message passing library MPI.
Define the data structure for the molecule information.
subroutine, public get_molecule_set_info(molecule_set, atom_to_mol, mol_to_first_atom, mol_to_last_atom, mol_to_nelectrons, mol_to_nbasis, mol_to_charge, mol_to_multiplicity)
returns information about molecules in the set.
Subroutines to perform calculations on molecules from a bigger system. Useful to generate a high-qual...
subroutine, public loop_over_molecules(globenv, force_env)
Prepare data for calculations on isolated molecules.
logical function, public do_mol_loop(force_env)
Is the loop over molecules requested?
Types used to generate the molecular SCF guess.
Definition mscfg_types.F:14
integer, parameter, public mscfg_max_moset_size
Definition mscfg_types.F:30
subroutine, public molecular_scf_guess_env_init(env, nfrags)
Allocates data.
Definition mscfg_types.F:66
represent a simple array based list of the given type
Perform a QUICKSTEP wavefunction optimization (single point)
Definition qs_energy.F:14
subroutine, public qs_energies(qs_env, consistent_energies, calc_forces)
Driver routine for QUICKSTEP single point wavefunction optimization.
Definition qs_energy.F:70
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 qs_env_release(qs_env)
releases the given qs_env (see doc/ReferenceCounting.html)
subroutine, public qs_env_create(qs_env, globenv)
allocates and intitializes a qs_env
subroutine, public qs_init(qs_env, para_env, root_section, globenv, cp_subsys, kpoint_env, qmmm, qmmm_env_qm, force_env_section, subsys_section, use_motion_section, silent, multip, charge)
Read the input and the database files for the setup of the QUICKSTEP environment.
Definition and initialisation of the mo data type.
Definition qs_mo_types.F:22
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count)
Get the components of a MO set data structure.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
represents a system: atoms, molecules, their pos,vel,...
wrapper to abstract the force evaluation of the various methods
contains the initially parsed file and the initial parallel environment
stores all the informations relevant to an mpi environment