(git:c29306b)
Loading...
Searching...
No Matches
input_cp2k_tb.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 function that build the dft section of the input
10!> \par History
11!> 10.2005 moved out of input_cp2k [fawzi]
12!> \author fawzi
13! **************************************************************************************************
15 USE bibliography, ONLY: &
19 USE input_constants, ONLY: &
32 USE input_val_types, ONLY: char_t
33 USE kinds, ONLY: dp
34 USE string_utilities, ONLY: s2a
35#include "./base/base_uses.f90"
36
37 IMPLICIT NONE
38 PRIVATE
39
40 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_tb'
41
43
44CONTAINS
45
46! **************************************************************************************************
47!> \brief ...
48!> \param section ...
49! **************************************************************************************************
50 SUBROUTINE create_dftb_control_section(section)
51 TYPE(section_type), POINTER :: section
52
53 TYPE(keyword_type), POINTER :: keyword
54 TYPE(section_type), POINTER :: subsection
55
56 cpassert(.NOT. ASSOCIATED(section))
57 CALL section_create(section, __location__, name="DFTB", &
58 description="Parameters needed to set up the DFTB methods", &
59 n_keywords=1, n_subsections=1, repeats=.false., &
61
62 NULLIFY (subsection)
63 CALL create_dftb_parameter_section(subsection)
64 CALL section_add_subsection(section, subsection)
65 CALL section_release(subsection)
66
67 NULLIFY (keyword)
68 CALL keyword_create(keyword, __location__, name="self_consistent", &
69 description="Use self-consistent method", &
70 citations=[elstner1998], &
71 usage="SELF_CONSISTENT", default_l_val=.true.)
72 CALL section_add_keyword(section, keyword)
73 CALL keyword_release(keyword)
74
75 CALL keyword_create(keyword, __location__, name="orthogonal_basis", &
76 description="Assume orthogonal basis set", &
77 usage="ORTHOGONAL_BASIS", default_l_val=.false.)
78 CALL section_add_keyword(section, keyword)
79 CALL keyword_release(keyword)
80
81 CALL keyword_create(keyword, __location__, name="do_ewald", &
82 description="Deprecated debug override for the DFTB Ewald treatment. "// &
83 "By default the setting is inferred from SUBSYS/CELL/PERIODIC. "// &
84 "If set to TRUE, the DFT/POISSON section must use a periodic Poisson solver.", &
85 usage="DO_EWALD", default_l_val=.false., lone_keyword_l_val=.true., &
86 deprecation_notice="Use SUBSYS/CELL/PERIODIC to select periodicity. "// &
87 "DO_EWALD is retained only as a debug override for the DFTB Ewald path.")
88 CALL section_add_keyword(section, keyword)
89 CALL keyword_release(keyword)
90
91 CALL keyword_create(keyword, __location__, name="dispersion", &
92 description="Use dispersion correction", &
93 citations=[zhechkov2005], lone_keyword_l_val=.true., &
94 usage="DISPERSION", default_l_val=.false.)
95 CALL section_add_keyword(section, keyword)
96 CALL keyword_release(keyword)
97
98 CALL keyword_create(keyword, __location__, name="DIAGONAL_DFTB3", &
99 description="Use a diagonal version of the 3rd order energy correction (DFTB3) ", &
100 lone_keyword_l_val=.true., &
101 usage="DIAGONAL_DFTB3", default_l_val=.false.)
102 CALL section_add_keyword(section, keyword)
103 CALL keyword_release(keyword)
104
105 CALL keyword_create(keyword, __location__, name="HB_SR_GAMMA", &
106 description="Uses a modified version for the GAMMA within the SCC-DFTB scheme, "// &
107 "specifically tuned for hydrogen bonds.", &
108 citations=[hu2007], lone_keyword_l_val=.true., &
109 usage="HB_SR_GAMMA", default_l_val=.false.)
110 CALL section_add_keyword(section, keyword)
111 CALL keyword_release(keyword)
112
113 CALL keyword_create(keyword, __location__, name="eps_disp", &
114 description="Define accuracy of dispersion interaction", &
115 usage="EPS_DISP", default_r_val=0.0001_dp)
116 CALL section_add_keyword(section, keyword)
117 CALL keyword_release(keyword)
118
119 CALL add_tb_scc_mixer_keywords(section, "CP2K-internal DFTB", &
120 "AUTO keeps the existing CP2K density/SCF mixing path for DFTB.")
121
122 END SUBROUTINE create_dftb_control_section
123
124! **************************************************************************************************
125!> \brief ...
126!> \param section ...
127! **************************************************************************************************
128 SUBROUTINE create_xtb_control_section(section)
129 TYPE(section_type), POINTER :: section
130
131 TYPE(keyword_type), POINTER :: keyword
132 TYPE(section_type), POINTER :: subsection
133
134 cpassert(.NOT. ASSOCIATED(section))
135 CALL section_create(section, __location__, name="xTB", &
136 description="Parameters needed to set up the xTB methods", &
137 n_keywords=1, n_subsections=1, repeats=.false., &
138 citations=[grimme2017])
139
140 NULLIFY (subsection)
141 CALL create_xtb_parameter_section(subsection)
142 CALL section_add_subsection(section, subsection)
143 CALL section_release(subsection)
144
145 CALL create_xtb_nonbonded_section(subsection)
146 CALL section_add_subsection(section, subsection)
147 CALL section_release(subsection)
148
149 CALL create_eeq_control_section(subsection)
150 CALL section_add_subsection(section, subsection)
151 CALL section_release(subsection)
152
153 CALL create_xtb_tblite_section(subsection)
154 CALL section_add_subsection(section, subsection)
155 CALL section_release(subsection)
156
157 NULLIFY (keyword)
158 CALL keyword_create(keyword, __location__, name="GFN_TYPE", &
159 description="Selects the xTB backend. GFN_TYPE 1 uses the CP2K-internal GFN1-xTB "// &
160 "implementation. GFN_TYPE TBLITE uses the tblite backend and requires an XTB/TBLITE "// &
161 "section, where the actual tblite method is selected.", &
162 usage="GFN_TYPE (0|1|TBLITE)", &
163 enum_c_vals=s2a("0", "1", "TBLITE"), &
164 enum_i_vals=[0, gfn1xtb, gfn_tblite], &
165 enum_desc=s2a("Use the CP2K-internal GFN0-xTB implementation.", &
166 "Use the CP2K-internal GFN1-xTB implementation.", &
167 "Use the CP2K/tblite backend; requires XTB/TBLITE."), &
168 default_i_val=gfn1xtb)
169 CALL section_add_keyword(section, keyword)
170 CALL keyword_release(keyword)
171
172 CALL add_tb_scc_mixer_keywords(section, "CP2K-internal xTB", &
173 "AUTO keeps the CP2K charge mixer for CP2K-internal xTB.")
174
175 CALL keyword_create(keyword, __location__, name="DO_EWALD", &
176 description="Deprecated debug override for the xTB Ewald treatment. "// &
177 "By default the setting is inferred from SUBSYS/CELL/PERIODIC. "// &
178 "If set to TRUE for CP2K-internal xTB, the DFT/POISSON section must use a periodic "// &
179 "Poisson solver. For CP2K/tblite, the periodic long-range treatment is performed "// &
180 "inside tblite.", &
181 usage="DO_EWALD", default_l_val=.false., lone_keyword_l_val=.true., &
182 deprecation_notice="Use SUBSYS/CELL/PERIODIC to select periodicity. "// &
183 "DO_EWALD is retained only as a debug override for the CP2K-internal xTB Ewald path.")
184 CALL section_add_keyword(section, keyword)
185 CALL keyword_release(keyword)
186
187 CALL keyword_create(keyword, __location__, name="STO_NG", &
188 description="Provides the order of the Slater orbital expansion in GTOs.", &
189 usage="STO_NG 3", default_i_val=6)
190 CALL section_add_keyword(section, keyword)
191 CALL keyword_release(keyword)
192
193 CALL keyword_create(keyword, __location__, name="HYDROGEN_STO_NG", &
194 description="Number of GTOs for Hydrogen basis expansion.", &
195 usage="HYDROGEN_STO_NG 3", default_i_val=4)
196 CALL section_add_keyword(section, keyword)
197 CALL keyword_release(keyword)
198
199 CALL keyword_create(keyword, __location__, name="USE_HALOGEN_CORRECTION", &
200 description="Use XB interaction term", &
201 usage="USE_HALOGEN_CORRECTION T", default_l_val=.true., lone_keyword_l_val=.true.)
202 CALL section_add_keyword(section, keyword)
203 CALL keyword_release(keyword)
204
205 CALL keyword_create(keyword, __location__, name="DO_NONBONDED", &
206 description="Controls the computation of real-space "// &
207 "(short-range) nonbonded interactions as correction to xTB.", &
208 usage="DO_NONBONDED T", default_l_val=.false., lone_keyword_l_val=.true.)
209 CALL section_add_keyword(section, keyword)
210 CALL keyword_release(keyword)
211
212 CALL keyword_create(keyword, __location__, name="VDW_POTENTIAL", &
213 description="vdW potential to be used: NONE, DFTD3, DFTD4. "// &
214 "Defaults: DFTD3(gfn1), DFTD4(gfn0, gfn2).", &
215 usage="VDW_POTENTIAL type", default_c_val="")
216 CALL section_add_keyword(section, keyword)
217 CALL keyword_release(keyword)
218
219 CALL keyword_create(keyword, __location__, name="COULOMB_INTERACTION", &
220 description="Use Coulomb interaction terms (electrostatics + TB3); for debug only", &
221 usage="COULOMB_INTERACTION T", default_l_val=.true., lone_keyword_l_val=.true.)
222 CALL section_add_keyword(section, keyword)
223 CALL keyword_release(keyword)
224
225 CALL keyword_create(keyword, __location__, name="COULOMB_LR", &
226 description="Use Coulomb LR (1/r) interaction terms; for debug only", &
227 usage="COULOMB_LR T", default_l_val=.true., lone_keyword_l_val=.true.)
228 CALL section_add_keyword(section, keyword)
229 CALL keyword_release(keyword)
230
231 CALL keyword_create(keyword, __location__, name="TB3_INTERACTION", &
232 description="Use TB3 interaction terms; for debug only", &
233 usage="TB3_INTERACTION T", default_l_val=.true., lone_keyword_l_val=.true.)
234 CALL section_add_keyword(section, keyword)
235 CALL keyword_release(keyword)
236
237 CALL keyword_create(keyword, __location__, name="CHECK_ATOMIC_CHARGES", &
238 description="Stop calculation if atomic charges are outside chemical range.", &
239 usage="CHECK_ATOMIC_CHARGES T", default_l_val=.true., lone_keyword_l_val=.true.)
240 CALL section_add_keyword(section, keyword)
241 CALL keyword_release(keyword)
242
243 CALL keyword_create(keyword, __location__, name="VARIATIONAL_DIPOLE", &
244 description="gfn0-xTB use dipole definition from energy derivative.", &
245 usage="VARIATIONAL_DIPOLE T", default_l_val=.false., lone_keyword_l_val=.true.)
246 CALL section_add_keyword(section, keyword)
247 CALL keyword_release(keyword)
248
249 CALL keyword_create(keyword, __location__, name="EPS_PAIRPOTENTIAL", &
250 description="Accuracy for the repulsive pair potential.", &
251 usage="EPS_PAIRPOTENTIAL 1.0E-8", default_r_val=1.0e-10_dp)
252 CALL section_add_keyword(section, keyword)
253 CALL keyword_release(keyword)
254
255 CALL keyword_create(keyword, __location__, name="EN_SHIFT_TYPE", &
256 description="Shift function for electronegativity in EEQ method. "// &
257 "[Select/Molecule/Crystal] Default Select from periodicity.", &
258 usage="EN_SHIFT_TYPE [Select/Molecule/Crystal]", &
259 n_var=1, type_of_var=char_t, default_c_val="Molecule")
260 CALL section_add_keyword(section, keyword)
261 CALL keyword_release(keyword)
262
263 END SUBROUTINE create_xtb_control_section
264
265! **************************************************************************************************
266!> \brief ...
267!> \param section ...
268! **************************************************************************************************
269 SUBROUTINE create_dftb_parameter_section(section)
270
271 TYPE(section_type), POINTER :: section
272
273 TYPE(keyword_type), POINTER :: keyword
274
275 cpassert(.NOT. ASSOCIATED(section))
276
277 CALL section_create(section, __location__, name="PARAMETER", &
278 description="Information on where to find DFTB parameters", &
279 n_keywords=1, n_subsections=0, repeats=.false.)
280
281 NULLIFY (keyword)
282 CALL keyword_create(keyword, __location__, name="SK_FILE", &
283 description="Define parameter file for atom pair", &
284 usage="SK_FILE a1 a2 filename", &
285 n_var=3, type_of_var=char_t, repeats=.true.)
286 CALL section_add_keyword(section, keyword)
287 CALL keyword_release(keyword)
288
289 CALL keyword_create(keyword, __location__, name="PARAM_FILE_PATH", &
290 description="Specify the directory with the DFTB parameter files. "// &
291 "Used in combination with the filenames specified in the file "// &
292 "given in PARAM_FILE_NAME.", usage="PARAM_FILE_PATH pathname", &
293 n_var=1, type_of_var=char_t, default_c_val="./")
294 CALL section_add_keyword(section, keyword)
295 CALL keyword_release(keyword)
296
297 CALL keyword_create(keyword, __location__, name="PARAM_FILE_NAME", &
298 description="Specify file that contains the names of "// &
299 "Slater-Koster tables: A plain text file, each line has the "// &
300 'format "ATOM1 ATOM2 filename.spl".', &
301 usage="PARAM_FILE_NAME filename", &
302 n_var=1, type_of_var=char_t, default_c_val="")
303 CALL section_add_keyword(section, keyword)
304 CALL keyword_release(keyword)
305
306 CALL keyword_create(keyword, __location__, name="DISPERSION_TYPE", &
307 description="Use dispersion correction of the specified type."// &
308 " Dispersion correction has to be switched on in the DFTB section.", &
309 usage="DISPERSION_TYPE (UFF|D3|D3(BJ)|D2)", &
310 enum_c_vals=s2a("UFF", "D3", "D3(BJ)", "D2"), &
312 enum_desc=s2a("Uses the UFF force field for a pair potential dispersion correction.", &
313 "Uses the Grimme D3 method (simplified) for a pair potential dispersion correction.", &
314 "Uses the Grimme D3 method (simplified) with Becke-Johnson attenuation.", &
315 "Uses the Grimme D2 method for pair potential dispersion correction."), &
316 default_i_val=dispersion_uff)
317 CALL section_add_keyword(section, keyword)
318 CALL keyword_release(keyword)
319
320 CALL keyword_create(keyword, __location__, name="UFF_FORCE_FIELD", &
321 description="Name of file with UFF parameters that will be used "// &
322 "for the dispersion correction. Needs to be specified when "// &
323 "DISPERSION==.TRUE., otherwise cp2k crashes with a Segmentation "// &
324 "Fault.", usage="UFF_FORCE_FIELD filename", &
325 n_var=1, type_of_var=char_t, default_c_val="")
326 CALL section_add_keyword(section, keyword)
327 CALL keyword_release(keyword)
328
329 CALL keyword_create(keyword, __location__, name="DISPERSION_PARAMETER_FILE", &
330 description="Specify file that contains the atomic dispersion "// &
331 "parameters for the D3 method", &
332 usage="DISPERSION_PARAMETER_FILE filename", &
333 n_var=1, type_of_var=char_t, default_c_val="")
334 CALL section_add_keyword(section, keyword)
335 CALL keyword_release(keyword)
336
337 CALL keyword_create(keyword, __location__, name="DISPERSION_RADIUS", &
338 description="Define radius of dispersion interaction", &
339 usage="DISPERSION_RADIUS", default_r_val=15._dp)
340 CALL section_add_keyword(section, keyword)
341 CALL keyword_release(keyword)
342
343 CALL keyword_create(keyword, __location__, name="COORDINATION_CUTOFF", &
344 description="Define cutoff for coordination number calculation", &
345 usage="COORDINATION_CUTOFF", default_r_val=1.e-6_dp)
346 CALL section_add_keyword(section, keyword)
347 CALL keyword_release(keyword)
348
349 CALL keyword_create(keyword, __location__, name="D3_SCALING", &
350 description="Scaling parameters (s6,sr6,s8) for the D3 dispersion method,", &
351 usage="D3_SCALING 1.0 1.0 1.0", n_var=3, default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp])
352 CALL section_add_keyword(section, keyword)
353 CALL keyword_release(keyword)
354
355 CALL keyword_create(keyword, __location__, name="D3BJ_SCALING", &
356 description="Scaling parameters (s6,a1,s8,a2) for the D3(BJ) dispersion method,", &
357 usage="D3BJ_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
358 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
359 CALL section_add_keyword(section, keyword)
360 CALL keyword_release(keyword)
361
362 CALL keyword_create(keyword, __location__, name="D2_SCALING", &
363 description="Scaling parameter for the D2 dispersion method,", &
364 usage="D2_SCALING 1.0", default_r_val=1.0_dp)
365 CALL section_add_keyword(section, keyword)
366 CALL keyword_release(keyword)
367
368 CALL keyword_create(keyword, __location__, name="D2_EXP_PRE", &
369 description="Exp prefactor for damping for the D2 dispersion method,", &
370 usage="D2_EXP_PRE 2.0", default_r_val=2.0_dp)
371 CALL section_add_keyword(section, keyword)
372 CALL keyword_release(keyword)
373
374 CALL keyword_create(keyword, __location__, name="HB_SR_PARAM", &
375 description="Uses a modified version for the GAMMA within the SCC-DFTB scheme, "// &
376 "specifically tuned for hydrogen bonds. Specify the exponent used in the exponential.", &
377 usage="HB_SR_PARAM {real}", default_r_val=4.0_dp)
378 CALL section_add_keyword(section, keyword)
379 CALL keyword_release(keyword)
380
381 END SUBROUTINE create_dftb_parameter_section
382
383! **************************************************************************************************
384!> \brief ...
385!> \param section ...
386! **************************************************************************************************
387 SUBROUTINE create_xtb_parameter_section(section)
388
389 TYPE(section_type), POINTER :: section
390
391 TYPE(keyword_type), POINTER :: keyword
392
393 cpassert(.NOT. ASSOCIATED(section))
394
395 CALL section_create(section, __location__, name="PARAMETER", &
396 description="Information on and where to find xTB parameters", &
397 n_keywords=1, n_subsections=0, repeats=.false.)
398
399 NULLIFY (keyword)
400 CALL keyword_create(keyword, __location__, name="PARAM_FILE_PATH", &
401 description="Specify the directory with the xTB parameter file. ", &
402 usage="PARAM_FILE_PATH pathname", &
403 n_var=1, type_of_var=char_t, default_c_val="")
404 CALL section_add_keyword(section, keyword)
405 CALL keyword_release(keyword)
406
407 CALL keyword_create(keyword, __location__, name="PARAM_FILE_NAME", &
408 description="Specify file that contains all xTB default parameters. ", &
409 usage="PARAM_FILE_NAME filename", &
410 n_var=1, type_of_var=char_t, default_c_val="xTB_parameters")
411 CALL section_add_keyword(section, keyword)
412 CALL keyword_release(keyword)
413
414 CALL keyword_create(keyword, __location__, name="DISPERSION_PARAMETER_FILE", &
415 description="Specify file that contains the atomic dispersion "// &
416 "parameters for the D3 method", &
417 usage="DISPERSION_PARAMETER_FILE filename", &
418 n_var=1, type_of_var=char_t, default_c_val="dftd3.dat")
419 CALL section_add_keyword(section, keyword)
420 CALL keyword_release(keyword)
421
422 CALL keyword_create(keyword, __location__, name="DISPERSION_RADIUS", &
423 description="Define radius of dispersion interaction", &
424 usage="DISPERSION_RADIUS", default_r_val=15._dp)
425 CALL section_add_keyword(section, keyword)
426 CALL keyword_release(keyword)
427
428 CALL keyword_create(keyword, __location__, name="COORDINATION_CUTOFF", &
429 description="Define cutoff for coordination number calculation", &
430 usage="COORDINATION_CUTOFF", default_r_val=1.e-6_dp)
431 CALL section_add_keyword(section, keyword)
432 CALL keyword_release(keyword)
433
434 CALL keyword_create(keyword, __location__, name="D3BJ_SCALING", &
435 description="Scaling parameters (s6,s8) for the D3 dispersion method.", &
436 usage="D3BJ_SCALING 1.0 2.4", n_var=2, default_r_vals=[1.0_dp, 2.4_dp])
437 CALL section_add_keyword(section, keyword)
438 CALL keyword_release(keyword)
439
440 CALL keyword_create(keyword, __location__, name="D3BJ_PARAM", &
441 description="Becke-Johnson parameters (a1, a2 for the D3 dispersion method.", &
442 usage="D3BJ_PARAM 0.63 5.0", n_var=2, default_r_vals=[0.63_dp, 5.0_dp])
443 CALL section_add_keyword(section, keyword)
444 CALL keyword_release(keyword)
445
446 CALL keyword_create(keyword, __location__, name="HUCKEL_CONSTANTS", &
447 description="Huckel parameters (s, p, d, sp, 2sH).", &
448 usage="HUCKEL_CONSTANTS 1.85 2.25 2.00 2.08 2.85", n_var=5, &
449 default_r_vals=[1.85_dp, 2.25_dp, 2.00_dp, 2.08_dp, 2.85_dp])
450 CALL section_add_keyword(section, keyword)
451 CALL keyword_release(keyword)
452
453 CALL keyword_create(keyword, __location__, name="COULOMB_CONSTANTS", &
454 description="Scaling parameters for Coulomb interactions (electrons, nuclei).", &
455 usage="COULOMB_CONSTANTS 2.00 1.50", n_var=2, &
456 default_r_vals=[2.00_dp, 1.50_dp])
457 CALL section_add_keyword(section, keyword)
458 CALL keyword_release(keyword)
459
460 CALL keyword_create(keyword, __location__, name="CN_CONSTANTS", &
461 description="Scaling parameters for Coordination number correction term.", &
462 usage="CN_CONSTANTS 0.006 -0.003 -0.005", n_var=3, &
463 default_r_vals=[0.006_dp, -0.003_dp, -0.005_dp])
464 CALL section_add_keyword(section, keyword)
465 CALL keyword_release(keyword)
466
467 CALL keyword_create(keyword, __location__, name="EN_CONSTANTS", &
468 description="Scaling parameters for electronegativity correction term.", &
469 usage="EN_CONSTANTS -0.007 0.000 0.000", n_var=3, &
470 default_r_vals=[-0.007_dp, 0.000_dp, 0.000_dp])
471 CALL section_add_keyword(section, keyword)
472 CALL keyword_release(keyword)
473
474 CALL keyword_create(keyword, __location__, name="BEN_CONSTANT", &
475 description="Scaling parameter for electronegativity correction term.", &
476 usage="BEN_CONSTANT 4.0", n_var=1, &
477 default_r_val=4.0_dp)
478 CALL section_add_keyword(section, keyword)
479 CALL keyword_release(keyword)
480
481 CALL keyword_create(keyword, __location__, name="ENSCALE", &
482 description="Scaling parameter repulsive energy (dEN in exponential).", &
483 usage="ENSCALE 0.01", n_var=1, &
484 default_r_val=0.0_dp)
485 CALL section_add_keyword(section, keyword)
486 CALL keyword_release(keyword)
487
488 CALL keyword_create(keyword, __location__, name="HALOGEN_BINDING", &
489 description="Scaling parameters for electronegativity correction term.", &
490 usage="HALOGEN_BINDING 1.30 0.44", n_var=2, default_r_vals=[1.30_dp, 0.44_dp])
491 CALL section_add_keyword(section, keyword)
492 CALL keyword_release(keyword)
493
494 CALL keyword_create(keyword, __location__, name="KAB_PARAM", &
495 description="Specifies the specific Kab value for types A and B.", &
496 usage="KAB_PARAM kind1 kind2 value ", repeats=.true., &
497 n_var=-1, type_of_var=char_t)
498 CALL section_add_keyword(section, keyword)
499 CALL keyword_release(keyword)
500
501 CALL keyword_create(keyword, __location__, name="XB_RADIUS", &
502 description="Specifies the radius [Bohr] of the XB pair interaction in xTB.", &
503 usage="XB_RADIUS 20.0 ", repeats=.false., &
504 n_var=1, default_r_val=20.0_dp)
505 CALL section_add_keyword(section, keyword)
506 CALL keyword_release(keyword)
507
508 CALL keyword_create(keyword, __location__, name="COULOMB_SR_CUT", &
509 description="Maximum range of short range part of Coulomb interaction.", &
510 usage="COULOMB_SR_CUT 20.0 ", repeats=.false., &
511 n_var=1, default_r_val=20.0_dp)
512 CALL section_add_keyword(section, keyword)
513 CALL keyword_release(keyword)
514
515 CALL keyword_create(keyword, __location__, name="COULOMB_SR_EPS", &
516 description="Cutoff for short range part of Coulomb interaction.", &
517 usage="COULOMB_SR_EPS 1.E-3 ", repeats=.false., &
518 n_var=1, default_r_val=1.0e-03_dp)
519 CALL section_add_keyword(section, keyword)
520 CALL keyword_release(keyword)
521
522 CALL keyword_create(keyword, __location__, name="SRB_PARAMETER", &
523 description="SRB parameters (ksrb, esrb, gscal, c1, c2, shift).", &
524 usage="SRB_PARAMETER -0.0129 3.48 0.51 -1.71 2.11 0.0537", n_var=6, &
525 default_r_vals=[-0.0129_dp, 3.4847_dp, 0.5097_dp, &
526 -1.70549806_dp, 2.10878369_dp, 0.0537_dp])
527 CALL section_add_keyword(section, keyword)
528 CALL keyword_release(keyword)
529
530 END SUBROUTINE create_xtb_parameter_section
531! **************************************************************************************************
532!> \brief ...
533!> \param section ...
534! **************************************************************************************************
535 SUBROUTINE create_xtb_nonbonded_section(section)
536 TYPE(section_type), POINTER :: section
537
538 TYPE(keyword_type), POINTER :: keyword
539 TYPE(section_type), POINTER :: subsection
540
541 cpassert(.NOT. ASSOCIATED(section))
542 CALL section_create(section, __location__, name="NONBONDED", &
543 description="This section specifies the input parameters for NON-BONDED interactions.", &
544 n_keywords=1, n_subsections=0, repeats=.false.)
545 NULLIFY (subsection)
546
547 CALL create_genpot_section(subsection)
548 CALL section_add_subsection(section, subsection)
549 CALL section_release(subsection)
550
551 NULLIFY (keyword)
552 CALL keyword_create(keyword, __location__, name="DX", &
553 description="Parameter used for computing the derivative with the Ridders' method.", &
554 usage="DX <REAL>", default_r_val=0.1_dp, unit_str="bohr")
555 CALL section_add_keyword(section, keyword)
556 CALL keyword_release(keyword)
557
558 CALL keyword_create(keyword, __location__, name="ERROR_LIMIT", &
559 description="Checks that the error in computing the derivative is not larger than "// &
560 "the value set; in case error is larger a warning message is printed.", &
561 usage="ERROR_LIMIT <REAL>", default_r_val=1.0e-12_dp)
562 CALL section_add_keyword(section, keyword)
563 CALL keyword_release(keyword)
564
565 END SUBROUTINE create_xtb_nonbonded_section
566! **************************************************************************************************
567!> \brief Creates the &TBLITE section
568!> \param section the section to create
569!> \author JVP
570! **************************************************************************************************
571 SUBROUTINE create_xtb_tblite_section(section)
572 TYPE(section_type), POINTER :: section
573
574 TYPE(keyword_type), POINTER :: keyword
575 TYPE(section_type), POINTER :: subsection
576
577 cpassert(.NOT. ASSOCIATED(section))
578 CALL section_create(section, __location__, name="TBLITE", &
579 description="Section used to specify options for an xTB computation using tblite. "// &
580 "This section is required when XTB/GFN_TYPE is set to TBLITE. "// &
581 "Periodicity follows SUBSYS/CELL/PERIODIC; the deprecated XTB/DO_EWALD keyword "// &
582 "is read consistently with CP2K-internal xTB for diagnostics/debugging.", &
583 n_keywords=1, n_subsections=1, repeats=.false., citations=[caldeweyher2017, caldeweyher2020, &
585
586 NULLIFY (keyword)
587 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
588 description="Marks the tblite options section as present. The tblite backend is selected "// &
589 "with XTB/GFN_TYPE TBLITE.", &
590 lone_keyword_l_val=.true., default_l_val=.false.)
591 CALL section_add_keyword(section, keyword)
592 CALL keyword_release(keyword)
593
594 NULLIFY (keyword)
595 CALL keyword_create(keyword, __location__, name="METHOD", &
596 description="Selection of the method used in tblite.", &
597 usage="METHOD (GFN1|GFN2|IPEA1)", &
598 enum_c_vals=s2a("GFN1", "GFN2", "IPEA1"), &
599 enum_i_vals=[gfn1xtb, gfn2xtb, ipea1xtb], &
600 enum_desc=s2a("Uses the GFN1-XTB method by Grimme.", &
601 "Uses the GFN2-XTB method by Grimme.", &
602 "Uses the IEPEA1 method by Grimme."), &
603 default_i_val=gfn2xtb)
604 CALL section_add_keyword(section, keyword)
605 CALL keyword_release(keyword)
606
607 CALL add_tb_scc_mixer_keywords(section, "CP2K/tblite xTB", &
608 "AUTO uses tblite's internal SCC mixer.")
609
610 NULLIFY (keyword)
611 CALL keyword_create(keyword, __location__, name="REFERENCE_CLI", &
612 description="Enable the native tblite CLI reference check. If true, the "// &
613 "XTB/TBLITE/REFERENCE_CLI section must be present. The reference check is also "// &
614 "enabled whenever that section is present. This diagnostic path is skipped for "// &
615 "CP2K multi-k-point calculations, because the native tblite CLI does not reproduce "// &
616 "CP2K KPOINTS sampling.", &
617 usage="REFERENCE_CLI", default_l_val=.false., lone_keyword_l_val=.true.)
618 CALL section_add_keyword(section, keyword)
619 CALL keyword_release(keyword)
620
621 NULLIFY (subsection)
622 CALL create_xtb_reference_cli_section(subsection)
623 CALL section_add_subsection(section, subsection)
624 CALL section_release(subsection)
625
626 END SUBROUTINE create_xtb_tblite_section
627
628! **************************************************************************************************
629!> \brief Adds common SCC-mixer keywords for TB methods.
630!> \param section section receiving the keywords
631!> \param TARGET method/path description for the manual text
632!> \param auto_desc AUTO behavior for this section
633! **************************************************************************************************
634 SUBROUTINE add_tb_scc_mixer_keywords(section, TARGET, auto_desc)
635 TYPE(section_type), POINTER :: section
636 CHARACTER(LEN=*), INTENT(IN) :: target, auto_desc
637
638 TYPE(keyword_type), POINTER :: keyword
639
640 NULLIFY (keyword)
641 CALL keyword_create(keyword, __location__, name="SCC_MIXER", &
642 description="Selects the SCC variable mixer for "//TARGET//" calculations. "// &
643 auto_desc//" TBLITE forces the tblite modified Broyden SCC mixer, CP2K forces CP2K "// &
644 "charge mixing, and NONE updates SCC variables without mixing.", &
645 usage="SCC_MIXER (AUTO|TBLITE|CP2K|NONE)", &
646 enum_c_vals=s2a("AUTO", "TBLITE", "CP2K", "NONE"), &
649 enum_desc=s2a("Default method-dependent choice.", &
650 "Use the tblite modified Broyden SCC mixer.", &
651 "Use CP2K charge mixing for SCC variables.", &
652 "Do not mix SCC variables; for debugging."), &
653 default_i_val=tblite_scc_mixer_auto)
654 CALL section_add_keyword(section, keyword)
655 CALL keyword_release(keyword)
656
657 CALL keyword_create(keyword, __location__, name="TBLITE_MIXER_DAMPING", &
658 description="Damping parameter for the tblite modified Broyden SCC mixer. "// &
659 "Only active when the effective SCC mixer is TBLITE, either explicitly or via AUTO. "// &
660 "The iteration limit is taken from DFT/SCF/MAX_SCF.", &
661 usage="TBLITE_MIXER_DAMPING 0.4", default_r_val=0.4_dp)
662 CALL section_add_keyword(section, keyword)
663 CALL keyword_release(keyword)
664
665 END SUBROUTINE add_tb_scc_mixer_keywords
666
667! **************************************************************************************************
668!> \brief Creates the &REFERENCE_CLI section used to compare against native tblite.
669!> \param section the section to create
670! **************************************************************************************************
671 SUBROUTINE create_xtb_reference_cli_section(section)
672 TYPE(section_type), POINTER :: section
673
674 TYPE(keyword_type), POINTER :: keyword
675
676 cpassert(.NOT. ASSOCIATED(section))
677 CALL section_create(section, __location__, name="REFERENCE_CLI", &
678 description="Run the native tblite command line interface as a reference "// &
679 "for CP2K/tblite energies, nuclear gradients, and optionally virials. "// &
680 "The section is a lone section: if it is present, the reference check is enabled.", &
681 n_keywords=1, n_subsections=0, repeats=.false.)
682
683 NULLIFY (keyword)
684 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
685 description="Activates the native tblite CLI reference check when the section is present.", &
686 lone_keyword_l_val=.true., default_l_val=.false.)
687 CALL section_add_keyword(section, keyword)
688 CALL keyword_release(keyword)
689
690 CALL keyword_create(keyword, __location__, name="PROGRAM_NAME", &
691 description="Executable name or path for the native tblite command line program.", &
692 usage="PROGRAM_NAME tblite", n_var=1, type_of_var=char_t, default_c_val="tblite")
693 CALL section_add_keyword(section, keyword)
694 CALL keyword_release(keyword)
695
696 CALL keyword_create(keyword, __location__, name="WORK_DIRECTORY", &
697 description="Directory used for temporary native tblite CLI input and output files.", &
698 usage="WORK_DIRECTORY .", n_var=1, type_of_var=char_t, default_c_val=".")
699 CALL section_add_keyword(section, keyword)
700 CALL keyword_release(keyword)
701
702 CALL keyword_create(keyword, __location__, name="PREFIX", &
703 description="Prefix for temporary native tblite CLI input and output files.", &
704 usage="PREFIX tblite-reference", n_var=1, type_of_var=char_t, &
705 default_c_val="tblite-reference")
706 CALL section_add_keyword(section, keyword)
707 CALL keyword_release(keyword)
708
709 CALL keyword_create(keyword, __location__, name="KEEP_FILES", &
710 description="Keep the temporary native tblite CLI input and output files.", &
711 usage="KEEP_FILES T", default_l_val=.false., lone_keyword_l_val=.true.)
712 CALL section_add_keyword(section, keyword)
713 CALL keyword_release(keyword)
714
715 CALL keyword_create(keyword, __location__, name="ERROR_LIMIT", &
716 description="Tolerance for reporting reference CLI deviations.", &
717 usage="ERROR_LIMIT 1.0E-8", default_r_val=1.0e-8_dp)
718 CALL section_add_keyword(section, keyword)
719 CALL keyword_release(keyword)
720
721 CALL keyword_create(keyword, __location__, name="STOP_ON_ERROR", &
722 description="Abort if a checked reference CLI deviation exceeds ERROR_LIMIT.", &
723 usage="STOP_ON_ERROR T", default_l_val=.false., lone_keyword_l_val=.true.)
724 CALL section_add_keyword(section, keyword)
725 CALL keyword_release(keyword)
726
727 CALL keyword_create(keyword, __location__, name="CHECK_ENERGY", &
728 description="Compare CP2K/tblite energy against the native tblite CLI energy.", &
729 usage="CHECK_ENERGY T", default_l_val=.true., lone_keyword_l_val=.true.)
730 CALL section_add_keyword(section, keyword)
731 CALL keyword_release(keyword)
732
733 CALL keyword_create(keyword, __location__, name="CHECK_FORCES", &
734 description="Compare CP2K/tblite nuclear gradients against native tblite CLI gradients.", &
735 usage="CHECK_FORCES T", default_l_val=.true., lone_keyword_l_val=.true.)
736 CALL section_add_keyword(section, keyword)
737 CALL keyword_release(keyword)
738
739 CALL keyword_create(keyword, __location__, name="CHECK_VIRIAL", &
740 description="Compare CP2K/tblite virial against the native tblite CLI virial.", &
741 usage="CHECK_VIRIAL T", default_l_val=.false., lone_keyword_l_val=.true.)
742 CALL section_add_keyword(section, keyword)
743 CALL keyword_release(keyword)
744
745 CALL keyword_create(keyword, __location__, name="ACCURACY", &
746 description="Value passed to native tblite as --acc.", &
747 usage="ACCURACY 1.0", default_r_val=1.0_dp)
748 CALL section_add_keyword(section, keyword)
749 CALL keyword_release(keyword)
750
751 CALL keyword_create(keyword, __location__, name="ITERATIONS", &
752 description="Value passed to native tblite as --iterations.", &
753 usage="ITERATIONS 250", default_i_val=250)
754 CALL section_add_keyword(section, keyword)
755 CALL keyword_release(keyword)
756
757 END SUBROUTINE create_xtb_reference_cli_section
758
759END MODULE input_cp2k_tb
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public caldeweyher2020
integer, save, public caldeweyher2017
integer, save, public grimme2017
integer, save, public elstner1998
integer, save, public hu2007
integer, save, public asgeirsson2017
integer, save, public porezag1995
integer, save, public bannwarth2019
integer, save, public seifert1996
integer, save, public zhechkov2005
Input definition and setup for EEQ model.
Definition eeq_input.F:12
subroutine, public create_eeq_control_section(section)
...
Definition eeq_input.F:50
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public dispersion_d3
integer, parameter, public gfn1xtb
integer, parameter, public dispersion_uff
integer, parameter, public tblite_scc_mixer_cp2k
integer, parameter, public tblite_scc_mixer_none
integer, parameter, public ipea1xtb
integer, parameter, public dispersion_d3bj
integer, parameter, public tblite_scc_mixer_tblite
integer, parameter, public tblite_scc_mixer_auto
integer, parameter, public gfn_tblite
integer, parameter, public dispersion_d2
integer, parameter, public gfn2xtb
integer, parameter, public slater
creates the mm section of the input
subroutine, public create_genpot_section(section)
This section specifies the input parameters for a generic potential form.
function that build the dft section of the input
subroutine, public create_dftb_control_section(section)
...
subroutine, public create_xtb_control_section(section)
...
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations, deprecation_notice)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
subroutine, public section_add_subsection(section, subsection)
adds a subsection to the given section
recursive subroutine, public section_release(section)
releases the given keyword list (see doc/ReferenceCounting.html)
a wrapper for basic fortran types.
integer, parameter, public char_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Utilities for string manipulations.
represent a keyword in the input
represent a section of the input file