(git:1f9fd2c)
Loading...
Searching...
No Matches
qs_dispersion_pairpot.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 Calculation of dispersion using pair potentials
10!> \author JGH
11! **************************************************************************************************
13
19 USE bibliography, ONLY: &
21 cite_reference, grimme2006, grimme2010, grimme2011
22 USE cell_types, ONLY: cell_type
33 USE eeq_input, ONLY: read_eeq_param
42 USE kinds, ONLY: default_path_length,&
44 dp
46 USE physcon, ONLY: bohr,&
47 kcalmol,&
48 kjmol
50 setcn,&
51 seten,&
52 setr0ab,&
60 USE qs_dispersion_types, ONLY: dftd2_pp,&
61 dftd3_pp,&
62 dftd4_pp,&
68 USE qs_kind_types, ONLY: get_qs_kind,&
71 USE virial_types, ONLY: virial_type
72#include "./base/base_uses.f90"
73
74 IMPLICIT NONE
75
76 PRIVATE
77
78 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_dispersion_pairpot'
79
81
82! **************************************************************************************************
83
84CONTAINS
85
86! **************************************************************************************************
87!> \brief ...
88!> \param atomic_kind_set ...
89!> \param qs_kind_set ...
90!> \param dispersion_env ...
91!> \param pp_section ...
92!> \param para_env ...
93! **************************************************************************************************
94 SUBROUTINE qs_dispersion_pairpot_init(atomic_kind_set, qs_kind_set, dispersion_env, pp_section, para_env)
95 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
96 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
97 TYPE(qs_dispersion_type), POINTER :: dispersion_env
98 TYPE(section_vals_type), OPTIONAL, POINTER :: pp_section
99 TYPE(mp_para_env_type), POINTER :: para_env
100
101 CHARACTER(len=*), PARAMETER :: routinen = 'qs_dispersion_pairpot_init'
102
103 CHARACTER(LEN=2) :: symbol
104 CHARACTER(LEN=default_path_length) :: filename
105 CHARACTER(LEN=default_string_length) :: aname, error_msg
106 CHARACTER(LEN=default_string_length), &
107 DIMENSION(:), POINTER :: tmpstringlist
108 INTEGER :: elem, handle, i, ikind, j, max_elem, &
109 maxc, n_rep, nkind, nl, vdw_pp_type, &
110 vdw_type
111 INTEGER, DIMENSION(:), POINTER :: exlist
112 LOGICAL :: at_end, explicit, found, is_available
113 REAL(kind=dp) :: dum
114 TYPE(qs_atom_dispersion_type), POINTER :: disp
115 TYPE(section_vals_type), POINTER :: eeq_section
116
117 CALL timeset(routinen, handle)
118
119 nkind = SIZE(atomic_kind_set)
120
121 vdw_type = dispersion_env%type
122 SELECT CASE (vdw_type)
123 CASE DEFAULT
124 ! do nothing
125 CASE (xc_vdw_fun_pairpot)
126 ! setup information on pair potentials
127 vdw_pp_type = dispersion_env%type
128 SELECT CASE (dispersion_env%pp_type)
129 CASE DEFAULT
130 ! do nothing
131 CASE (vdw_pairpot_dftd2)
132 CALL cite_reference(grimme2006)
133 DO ikind = 1, nkind
134 CALL get_atomic_kind(atomic_kind_set(ikind), element_symbol=symbol, z=elem)
135 ALLOCATE (disp)
136 disp%type = dftd2_pp
137 ! get filename of parameter file
138 filename = dispersion_env%parameter_file_name
139 ! check for local parameters
140 found = .false.
141 IF (PRESENT(pp_section)) THEN
142 CALL section_vals_val_get(pp_section, "ATOMPARM", n_rep_val=n_rep)
143 DO i = 1, n_rep
144 CALL section_vals_val_get(pp_section, "ATOMPARM", i_rep_val=i, &
145 c_vals=tmpstringlist)
146 IF (trim(tmpstringlist(1)) == trim(symbol)) THEN
147 ! we assume the parameters are in atomic units!
148 READ (tmpstringlist(2), *) disp%c6
149 READ (tmpstringlist(3), *) disp%vdw_radii
150 found = .true.
151 EXIT
152 END IF
153 END DO
154 END IF
155 IF (.NOT. found) THEN
156 ! check for internal parameters
157 CALL dftd2_param(elem, disp%c6, disp%vdw_radii, found)
158 END IF
159 IF (.NOT. found) THEN
160 ! check on file
161 INQUIRE (file=filename, exist=is_available)
162 IF (is_available) THEN
163 block
164 TYPE(cp_parser_type) :: parser
165 CALL parser_create(parser, filename, para_env=para_env)
166 DO
167 at_end = .false.
168 CALL parser_get_next_line(parser, 1, at_end)
169 IF (at_end) EXIT
170 CALL parser_get_object(parser, aname)
171 IF (trim(aname) == trim(symbol)) THEN
172 CALL parser_get_object(parser, disp%c6)
173 ! we have to change the units J*nm^6*mol^-1 -> Hartree*Bohr^6
174 disp%c6 = disp%c6*1000._dp*bohr**6/kjmol
175 CALL parser_get_object(parser, disp%vdw_radii)
176 disp%vdw_radii = disp%vdw_radii*bohr
177 found = .true.
178 EXIT
179 END IF
180 END DO
181 CALL parser_release(parser)
182 END block
183 END IF
184 END IF
185 IF (found) THEN
186 disp%defined = .true.
187 ELSE
188 disp%defined = .false.
189 END IF
190 ! Check if the parameter is defined
191 IF (.NOT. disp%defined) &
192 CALL cp_abort(__location__, &
193 "Dispersion parameters for element ("//trim(symbol)//") are not defined! "// &
194 "Please provide a valid set of parameters through the input section or "// &
195 "through an external file! ")
196 CALL set_qs_kind(qs_kind_set(ikind), dispersion=disp)
197 END DO
199 !DFT-D3 Method initial setup
200 CALL cite_reference(grimme2010)
201 CALL cite_reference(grimme2011)
202 CALL cite_reference(goerigk2017)
203 CALL cite_reference(wittmann2024)
204 max_elem = 103
205 maxc = 7
206 dispersion_env%max_elem = max_elem
207 dispersion_env%maxc = maxc
208 ALLOCATE (dispersion_env%maxci(max_elem))
209 ALLOCATE (dispersion_env%c6ab(max_elem, max_elem, maxc, maxc, 3))
210 ALLOCATE (dispersion_env%r0ab(max_elem, max_elem))
211 ALLOCATE (dispersion_env%rcov(max_elem))
212 ALLOCATE (dispersion_env%eneg(max_elem))
213 ALLOCATE (dispersion_env%r2r4(max_elem))
214 ALLOCATE (dispersion_env%cn(max_elem))
215
216 IF (dispersion_env%d3_reference_code) THEN
217 CALL dftd3_param_from_library(dispersion_env%c6ab, dispersion_env%maxci, &
218 dispersion_env%r0ab, dispersion_env%rcov, &
219 dispersion_env%r2r4, &
220 dispersion_env%pp_type, dispersion_env%ref_functional, &
221 dispersion_env%s6, dispersion_env%s8, &
222 dispersion_env%a1, dispersion_env%a2, &
223 dispersion_env%sr6, para_env, error=error_msg, &
224 calc_scaling=.NOT. dispersion_env%d3_scaling_explicit)
225 IF (error_msg /= "") THEN
226 CALL cp_abort(__location__, error_msg)
227 END IF
228 ELSE
229 filename = dispersion_env%parameter_file_name
230 CALL dftd3_c6_param(dispersion_env%c6ab, dispersion_env%maxci, filename, para_env)
231 CALL setrcov(dispersion_env%rcov)
232 CALL setr0ab(dispersion_env%r0ab, dispersion_env%rcov, dispersion_env%r2r4)
233 END IF
234 ! Electronegativity
235 CALL seten(dispersion_env%eneg)
236 ! the default coordination numbers
237 CALL setcn(dispersion_env%cn)
238 ! scale r4/r2 values of the atoms by sqrt(Z)
239 ! sqrt is also globally close to optimum
240 ! together with the factor 1/2 this yield reasonable
241 ! c8 for he, ne and ar. for larger Z, C8 becomes too large
242 ! which effectively mimics higher R^n terms neglected due
243 ! to stability reasons
244 IF (.NOT. dispersion_env%d3_reference_code) THEN
245 DO i = 1, max_elem
246 dum = 0.5_dp*dispersion_env%r2r4(i)*real(i, dp)**0.5_dp
247 ! store it as sqrt because the geom. av. is taken
248 dispersion_env%r2r4(i) = sqrt(dum)
249 END DO
250 END IF
251 ! parameters
252 dispersion_env%k1 = 16.0_dp
253 dispersion_env%k2 = 4._dp/3._dp
254 ! reasonable choices are between 3 and 5
255 ! this gives smoth curves with maxima around the integer values
256 ! k3=3 give for CN=0 a slightly smaller value than computed
257 ! for the free atom. This also yields to larger CN for atoms
258 ! in larger molecules but with the same chem. environment
259 ! which is physically not right
260 ! values >5 might lead to bumps in the potential
261 dispersion_env%k3 = -4._dp
262 IF (.NOT. dispersion_env%d3_reference_code) THEN
263 dispersion_env%rcov = dispersion_env%k2*dispersion_env%rcov*bohr
264 END IF
265 ! alpha default parameter
266 dispersion_env%alp = 14._dp
267 !
268 DO ikind = 1, nkind
269 CALL get_atomic_kind(atomic_kind_set(ikind), element_symbol=symbol, z=elem)
270 ALLOCATE (disp)
271 disp%type = dftd3_pp
272 IF (elem <= max_elem) THEN
273 disp%defined = .true.
274 ELSE
275 disp%defined = .false.
276 END IF
277 IF (.NOT. disp%defined) &
278 CALL cp_abort(__location__, &
279 "Dispersion parameters for element ("//trim(symbol)//") are not defined! "// &
280 "Please provide a valid set of parameters through the input section or "// &
281 "through an external file! ")
282 CALL set_qs_kind(qs_kind_set(ikind), dispersion=disp)
283 END DO
284
285 IF (PRESENT(pp_section)) THEN
286 ! Check for coordination numbers
287 CALL section_vals_val_get(pp_section, "KIND_COORDINATION_NUMBERS", n_rep_val=n_rep)
288 IF (n_rep > 0) THEN
289 ALLOCATE (dispersion_env%cnkind(n_rep))
290 DO i = 1, n_rep
291 CALL section_vals_val_get(pp_section, "KIND_COORDINATION_NUMBERS", i_rep_val=i, &
292 c_vals=tmpstringlist)
293 READ (tmpstringlist(1), *) dispersion_env%cnkind(i)%cnum
294 READ (tmpstringlist(2), *) dispersion_env%cnkind(i)%kind
295 END DO
296 END IF
297 CALL section_vals_val_get(pp_section, "ATOM_COORDINATION_NUMBERS", n_rep_val=n_rep)
298 IF (n_rep > 0) THEN
299 ALLOCATE (dispersion_env%cnlist(n_rep))
300 DO i = 1, n_rep
301 CALL section_vals_val_get(pp_section, "ATOM_COORDINATION_NUMBERS", i_rep_val=i, &
302 c_vals=tmpstringlist)
303 nl = SIZE(tmpstringlist)
304 ALLOCATE (dispersion_env%cnlist(i)%atom(nl - 1))
305 dispersion_env%cnlist(i)%natom = nl - 1
306 READ (tmpstringlist(1), *) dispersion_env%cnlist(i)%cnum
307 DO j = 1, nl - 1
308 READ (tmpstringlist(j + 1), *) dispersion_env%cnlist(i)%atom(j)
309 END DO
310 END DO
311 END IF
312 ! Check for exclusion lists
313 CALL section_vals_val_get(pp_section, "D3_EXCLUDE_KIND", explicit=explicit)
314 IF (explicit) THEN
315 CALL section_vals_val_get(pp_section, "D3_EXCLUDE_KIND", i_vals=exlist)
316 DO j = 1, SIZE(exlist)
317 ikind = exlist(j)
318 CALL get_qs_kind(qs_kind_set(ikind), dispersion=disp)
319 disp%defined = .false.
320 END DO
321 END IF
322 CALL section_vals_val_get(pp_section, "D3_EXCLUDE_KIND_PAIR", n_rep_val=n_rep)
323 dispersion_env%nd3_exclude_pair = n_rep
324 IF (n_rep > 0) THEN
325 ALLOCATE (dispersion_env%d3_exclude_pair(n_rep, 2))
326 DO i = 1, n_rep
327 CALL section_vals_val_get(pp_section, "D3_EXCLUDE_KIND_PAIR", i_rep_val=i, &
328 i_vals=exlist)
329 dispersion_env%d3_exclude_pair(i, :) = exlist
330 END DO
331 END IF
332 END IF
333 CASE (vdw_pairpot_dftd4)
334 !most checks are done by the library
335 CALL cite_reference(caldeweyher2017)
336 CALL cite_reference(caldeweyher2019)
337 CALL cite_reference(caldeweyher2020)
338 DO ikind = 1, nkind
339 CALL get_atomic_kind(atomic_kind_set(ikind), element_symbol=symbol, z=elem)
340 ALLOCATE (disp)
341 disp%type = dftd4_pp
342 disp%defined = .true.
343 CALL set_qs_kind(qs_kind_set(ikind), dispersion=disp)
344 END DO
345 ! maybe needed in cnumber calculations
346 max_elem = 103
347 maxc = 7
348 dispersion_env%max_elem = max_elem
349 dispersion_env%maxc = maxc
350 ALLOCATE (dispersion_env%maxci(max_elem))
351 ALLOCATE (dispersion_env%rcov(max_elem))
352 ALLOCATE (dispersion_env%eneg(max_elem))
353 ALLOCATE (dispersion_env%cn(max_elem))
354 ! the default covalent radii
355 CALL setrcov(dispersion_env%rcov)
356 ! the default coordination numbers
357 CALL setcn(dispersion_env%cn)
358 ! Electronegativity
359 CALL seten(dispersion_env%eneg)
360 ! parameters
361 dispersion_env%k1 = 16.0_dp
362 dispersion_env%k2 = 4._dp/3._dp
363 dispersion_env%k3 = -4._dp
364 dispersion_env%rcov = dispersion_env%k2*dispersion_env%rcov*bohr
365 dispersion_env%alp = 14._dp
366 !
367 dispersion_env%cnfun = 3
368 IF (dispersion_env%rc_cn < 0.0_dp) THEN
369 dispersion_env%rc_cn = get_cn_radius(dispersion_env)
370 END IF
371 IF (PRESENT(pp_section)) THEN
372 eeq_section => section_vals_get_subs_vals(pp_section, "EEQ")
373 CALL read_eeq_param(eeq_section, dispersion_env%eeq_sparam)
374 END IF
375 END SELECT
376 END SELECT
377
378 CALL timestop(handle)
379
380 END SUBROUTINE qs_dispersion_pairpot_init
381
382! **************************************************************************************************
383!> \brief ...
384!> \param qs_env ...
385!> \param dispersion_env ...
386!> \param energy ...
387!> \param calculate_forces ...
388!> \param atevdw ...
389! **************************************************************************************************
390 SUBROUTINE calculate_dispersion_pairpot(qs_env, dispersion_env, energy, calculate_forces, atevdw)
391
392 TYPE(qs_environment_type), POINTER :: qs_env
393 TYPE(qs_dispersion_type), POINTER :: dispersion_env
394 REAL(kind=dp), INTENT(INOUT) :: energy
395 LOGICAL, INTENT(IN) :: calculate_forces
396 REAL(kind=dp), DIMENSION(:), OPTIONAL :: atevdw
397
398 CHARACTER(LEN=*), PARAMETER :: routinen = 'calculate_dispersion_pairpot'
399
400 INTEGER :: atom_a, handle, iatom, ikind, iw, natom, &
401 nkind, unit_nr
402 INTEGER, ALLOCATABLE, DIMENSION(:) :: atom_of_kind, kind_of
403 LOGICAL :: atenergy, atex, debugall, use_virial
404 REAL(kind=dp) :: evdw, gnorm
405 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: atomic_energy
406 REAL(kind=dp), DIMENSION(3) :: fdij
407 REAL(kind=dp), DIMENSION(3, 3) :: dvirial, pv_loc, pv_virial_thread
408 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
409 TYPE(atprop_type), POINTER :: atprop
410 TYPE(cell_type), POINTER :: cell
411 TYPE(cp_logger_type), POINTER :: logger
412 TYPE(mp_para_env_type), POINTER :: para_env
413 TYPE(qs_force_type), DIMENSION(:), POINTER :: force
414 TYPE(virial_type), POINTER :: virial
415
416 energy = 0._dp
417 ! make valgrind happy
418 use_virial = .false.
419
420 IF (dispersion_env%type /= xc_vdw_fun_pairpot) THEN
421 RETURN
422 END IF
423
424 CALL timeset(routinen, handle)
425
426 NULLIFY (atomic_kind_set)
427
428 CALL get_qs_env(qs_env=qs_env, nkind=nkind, natom=natom, atomic_kind_set=atomic_kind_set, &
429 cell=cell, virial=virial, para_env=para_env, atprop=atprop)
430
431 debugall = dispersion_env%verbose
432
433 NULLIFY (logger)
434 logger => cp_get_default_logger()
435 IF (ASSOCIATED(dispersion_env%dftd_section)) THEN
436 unit_nr = cp_print_key_unit_nr(logger, dispersion_env%dftd_section, "PRINT_DFTD", &
437 extension=".dftd")
438 ELSE
439 unit_nr = -1
440 END IF
441
442 ! atomic energy and stress arrays
443 atenergy = atprop%energy
444 ! external atomic energy
445 atex = .false.
446 IF (PRESENT(atevdw)) THEN
447 atex = .true.
448 END IF
449
450 IF (unit_nr > 0) THEN
451 WRITE (unit_nr, *)
452 WRITE (unit_nr, *) " Pair potential vdW calculation"
453 IF (dispersion_env%pp_type == vdw_pairpot_dftd2) THEN
454 WRITE (unit_nr, *) " Dispersion potential type: DFT-D2"
455 WRITE (unit_nr, *) " Scaling parameter (s6) ", dispersion_env%scaling
456 WRITE (unit_nr, *) " Exponential prefactor ", dispersion_env%exp_pre
457 ELSE IF (dispersion_env%pp_type == vdw_pairpot_dftd3) THEN
458 WRITE (unit_nr, *) " Dispersion potential type: DFT-D3"
459 ELSE IF (dispersion_env%pp_type == vdw_pairpot_dftd3bj) THEN
460 WRITE (unit_nr, *) " Dispersion potential type: DFT-D3(BJ)"
461 ELSE IF (dispersion_env%pp_type == vdw_pairpot_dftd4) THEN
462 WRITE (unit_nr, *) " Dispersion potential type: DFT-D4"
463 END IF
464 END IF
465
466 CALL get_qs_env(qs_env=qs_env, force=force)
467 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
468 IF (use_virial .AND. debugall) THEN
469 dvirial = virial%pv_virial
470 END IF
471 IF (use_virial) THEN
472 pv_loc = virial%pv_virial
473 END IF
474
475 evdw = 0._dp
476 pv_virial_thread(:, :) = 0._dp
477
478 CALL get_atomic_kind_set(atomic_kind_set, atom_of_kind=atom_of_kind, kind_of=kind_of)
479
480 IF (dispersion_env%pp_type == vdw_pairpot_dftd2) THEN
481 CALL calculate_dispersion_d2_pairpot(qs_env, dispersion_env, evdw, calculate_forces, atevdw)
482 ELSEIF (dispersion_env%pp_type == vdw_pairpot_dftd3 .OR. &
483 dispersion_env%pp_type == vdw_pairpot_dftd3bj) THEN
484 CALL calculate_dispersion_d3_pairpot(qs_env, dispersion_env, evdw, calculate_forces, &
485 unit_nr, atevdw)
486 ELSEIF (dispersion_env%pp_type == vdw_pairpot_dftd4) THEN
487 IF (dispersion_env%lrc) THEN
488 cpabort("Long range correction with DFTD4 not implemented")
489 END IF
490 IF (dispersion_env%srb) THEN
491 cpabort("Short range bond correction with DFTD4 not implemented")
492 END IF
493 IF (dispersion_env%domol) THEN
494 cpabort("Molecular approximation with DFTD4 not implemented")
495 END IF
496 !
497 iw = -1
498 IF (dispersion_env%verbose) iw = cp_logger_get_default_io_unit(logger)
499 !
500 IF (atenergy .OR. atex) THEN
501 ALLOCATE (atomic_energy(natom))
502 CALL calculate_dispersion_d4_pairpot(qs_env, dispersion_env, evdw, calculate_forces, &
503 iw, atomic_energy=atomic_energy)
504 ELSE
505 CALL calculate_dispersion_d4_pairpot(qs_env, dispersion_env, evdw, calculate_forces, iw)
506 END IF
507 !
508 IF (atex) THEN
509 atevdw(1:natom) = atomic_energy(1:natom)
510 END IF
511 IF (atenergy) THEN
512 CALL atprop_array_init(atprop%atevdw, natom)
513 atprop%atevdw(1:natom) = atomic_energy(1:natom)
514 END IF
515 IF (atenergy .OR. atex) THEN
516 DEALLOCATE (atomic_energy)
517 END IF
518 END IF
519
520 ! set dispersion energy
521 CALL para_env%sum(evdw)
522 energy = evdw
523 IF (unit_nr > 0) THEN
524 WRITE (unit_nr, *) " Total vdW energy [au] :", evdw
525 WRITE (unit_nr, *) " Total vdW energy [kcal] :", evdw*kcalmol
526 WRITE (unit_nr, *)
527 END IF
528 IF (calculate_forces .AND. debugall) THEN
529 IF (unit_nr > 0) THEN
530 WRITE (unit_nr, *) " Dispersion Forces "
531 WRITE (unit_nr, *) " Atom Kind Forces "
532 END IF
533 gnorm = 0._dp
534 DO iatom = 1, natom
535 ikind = kind_of(iatom)
536 atom_a = atom_of_kind(iatom)
537 fdij(1:3) = force(ikind)%dispersion(:, atom_a)
538 CALL para_env%sum(fdij)
539 gnorm = gnorm + sum(abs(fdij))
540 IF (unit_nr > 0) WRITE (unit_nr, "(i5,i7,3F20.14)") iatom, ikind, fdij
541 END DO
542 IF (unit_nr > 0) THEN
543 WRITE (unit_nr, *)
544 WRITE (unit_nr, *) "|G| = ", gnorm
545 WRITE (unit_nr, *)
546 END IF
547 IF (use_virial) THEN
548 dvirial = virial%pv_virial - dvirial
549 CALL para_env%sum(dvirial)
550 IF (unit_nr > 0) THEN
551 WRITE (unit_nr, *) "Stress Tensor (dispersion)"
552 WRITE (unit_nr, "(3G20.12)") dvirial
553 WRITE (unit_nr, *) " Tr(P)/3 : ", (dvirial(1, 1) + dvirial(2, 2) + dvirial(3, 3))/3._dp
554 WRITE (unit_nr, *)
555 END IF
556 END IF
557 END IF
558
559 IF (calculate_forces .AND. use_virial) THEN
560 virial%pv_vdw = virial%pv_vdw + (virial%pv_virial - pv_loc)
561 END IF
562
563 IF (ASSOCIATED(dispersion_env%dftd_section)) THEN
564 CALL cp_print_key_finished_output(unit_nr, logger, dispersion_env%dftd_section, "PRINT_DFTD")
565 END IF
566
567 CALL timestop(handle)
568
569 END SUBROUTINE calculate_dispersion_pairpot
570
571END MODULE qs_dispersion_pairpot
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
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.
Holds information on atomic properties.
subroutine, public atprop_array_init(atarray, natom)
...
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public caldeweyher2020
integer, save, public grimme2006
integer, save, public caldeweyher2019
integer, save, public caldeweyher2017
integer, save, public goerigk2017
integer, save, public wittmann2024
integer, save, public grimme2011
integer, save, public grimme2010
Handles all functions related to the CELL.
Definition cell_types.F:15
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_get_next_line(parser, nline, at_end)
Read the next input line and broadcast the input information. Skip (nline-1) lines and skip also all ...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
Input definition and setup for EEQ model.
Definition eeq_input.F:12
subroutine, public read_eeq_param(eeq_section, eeq_sparam)
...
Definition eeq_input.F:110
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public vdw_pairpot_dftd3
integer, parameter, public vdw_pairpot_dftd4
integer, parameter, public vdw_pairpot_dftd2
integer, parameter, public xc_vdw_fun_pairpot
integer, parameter, public vdw_pairpot_dftd3bj
objects that represent the structure of input sections and the data contained in an input section
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 dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
integer, parameter, public default_path_length
Definition kinds.F:58
Interface to the message passing library MPI.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public kcalmol
Definition physcon.F:171
real(kind=dp), parameter, public kjmol
Definition physcon.F:168
real(kind=dp), parameter, public bohr
Definition physcon.F:147
Coordination number routines for dispersion pairpotentials.
real(kind=dp) function, public get_cn_radius(dispersion_env)
...
subroutine, public setr0ab(rout, rcov, r2r4)
...
subroutine, public setrcov(rcov)
...
subroutine, public seten(enout)
...
subroutine, public setcn(cnout)
...
Calculation of D2 dispersion.
subroutine, public calculate_dispersion_d2_pairpot(qs_env, dispersion_env, evdw, calculate_forces, atevdw)
...
subroutine, public dftd2_param(z, c6, r, found)
...
Calculation of D3 dispersion.
subroutine, public dftd3_c6_param(c6ab, maxci, filename, para_env)
...
subroutine, public calculate_dispersion_d3_pairpot(qs_env, dispersion_env, evdw, calculate_forces, unit_nr, atevdw)
...
Calculation of dispersion using pair potentials.
subroutine, public calculate_dispersion_d4_pairpot(qs_env, dispersion_env, evdw, calculate_forces, iw, atomic_energy)
...
Calculation of dispersion using pair potentials.
subroutine, public qs_dispersion_pairpot_init(atomic_kind_set, qs_kind_set, dispersion_env, pp_section, para_env)
...
subroutine, public calculate_dispersion_pairpot(qs_env, dispersion_env, energy, calculate_forces, atevdw)
...
subroutine, public dftd3_param_from_library(c6ab, maxci, r0ab, rcov, r2r4, pp_type, ref_functional, s6, s8, a1, a2, sr6, para_env, error, calc_scaling)
...
Definition of disperson types for DFT calculations.
integer, parameter, public dftd2_pp
integer, parameter, public dftd4_pp
integer, parameter, public dftd3_pp
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.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public set_qs_kind(qs_kind, paw_atom, ghost, floating, hard_radius, hard0_radius, covalent_radius, vdw_radius, lmax_rho0, zeff, no_optimize, dispersion, u_minus_j, reltmat, dftb_parameter, xtb_parameter, elec_conf, pao_basis_size)
Set the components of an atomic kind data set.
Provides all information about an atomic kind.
type for the atomic properties
Type defining parameters related to the simulation cell.
Definition cell_types.F:60
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.