(git:6344619)
Loading...
Searching...
No Matches
input_cp2k_xc.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 xc section of the input
10!> \par History
11!> 10.2009 moved out of input_cp2k_dft [jgh]
12!> \author fawzi
13! **************************************************************************************************
15 USE bibliography, ONLY: &
24 USE input_constants, ONLY: &
43 USE input_val_types, ONLY: char_t,&
44 integer_t,&
45 real_t
46 USE kinds, ONLY: dp
47 USE string_utilities, ONLY: s2a
48 USE xc_input_constants, ONLY: &
59#include "./base/base_uses.f90"
60
61 IMPLICIT NONE
62 PRIVATE
63
64 LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
65 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_xc'
66
68
69CONTAINS
70
71! **************************************************************************************************
72!> \brief creates the structure of the section needed to select the xc functional
73!> \param section the section that will be created
74!> \author fawzi
75! **************************************************************************************************
76 SUBROUTINE create_xc_fun_section(section)
77 TYPE(section_type), POINTER :: section
78
79 TYPE(keyword_type), POINTER :: keyword
80 TYPE(section_type), POINTER :: subsection
81
82 cpassert(.NOT. ASSOCIATED(section))
83 CALL section_create(section, __location__, name="xc_functional", &
84 description="The eXchange-Correlation functional to use. In case of hybrid functionals, all scaling "// &
85 "parameters and potential types have to be specified in the HF section except from a few "// &
86 "predefined combinations (see _SECTION_PARAMETERS_ below). CP2K does NOT set it up "// &
87 "automatically not even for LibXC functionals.", &
88 n_keywords=0, n_subsections=4, repeats=.false., &
92
93 NULLIFY (subsection, keyword)
94 CALL keyword_create( &
95 keyword, __location__, name="_SECTION_PARAMETERS_", &
96 description="Shortcut for the most common functional combinations. These make use of the implementations provided by "// &
97 "native CP2K (without LibXC). In case of hybrid functionals (B3LYP, PBE0), set the "// &
98 "accuracy-related and system-dependent parameters in the HF section (especially MAX_MEMORY, EPS_SCHWARZ, "// &
99 "CUTOFF_RADIUS, POTENTIAL_TYPE) as these are not set automatically.", &
100 usage="&xc_functional BLYP", &
101 enum_c_vals=s2a("B3LYP", "PBE0", "BLYP", "BP", "PADE", "LDA", "PBE", &
102 "TPSS", "HCTH120", "OLYP", "BEEFVDW", "NO_SHORTCUT", "NONE"), &
105 enum_desc=s2a("B3LYP", &
106 "PBE0 (see note in section XC/XC_FUNCTIONAL/PBE)", &
107 "BLYP", "BP", "PADE", "Alias for PADE", &
108 "PBE (see note in section XC/XC_FUNCTIONAL/PBE)", &
109 "TPSS (not available with LSD, use LIBXC version instead)", "HCTH120", "OLYP", &
110 "BEEFVDW", "NO_SHORTCUT", "NONE"), &
111 default_i_val=xc_funct_no_shortcut, &
112 lone_keyword_i_val=xc_funct_no_shortcut)
113 CALL section_add_keyword(section, keyword)
114 CALL keyword_release(keyword)
115
116 CALL section_create(subsection, __location__, name="BECKE88", &
117 description="Uses the Becke 88 exchange functional", &
118 n_keywords=0, n_subsections=0, repeats=.false., &
119 citations=[becke1988])
120 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
121 description="activates the functional", &
122 lone_keyword_l_val=.true., default_l_val=.false.)
123 CALL section_add_keyword(subsection, keyword)
124 CALL keyword_release(keyword)
125 CALL keyword_create( &
126 keyword, __location__, name="scale_x", &
127 description="scales the exchange part of the functional", &
128 default_r_val=1._dp)
129 CALL section_add_keyword(subsection, keyword)
130 CALL keyword_release(keyword)
131
132 CALL section_add_subsection(section, subsection)
133 CALL section_release(subsection)
134
135 CALL section_create(subsection, __location__, name="LYP_ADIABATIC", &
136 description="Uses the LYP correlation functional in an adiabatic fashion", &
137 n_keywords=0, n_subsections=0, repeats=.false., &
138 citations=[lee1988])
139 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
140 description="activates the functional", &
141 lone_keyword_l_val=.true., default_l_val=.false.)
142 CALL section_add_keyword(subsection, keyword)
143 CALL keyword_release(keyword)
144 CALL keyword_create(keyword, __location__, name="LAMBDA", &
145 description="Defines the parameter of the adiabatic curve.", &
146 default_r_val=1._dp)
147 CALL section_add_keyword(subsection, keyword)
148 CALL keyword_release(keyword)
149
150 CALL section_add_subsection(section, subsection)
151 CALL section_release(subsection)
152
153 CALL section_create(subsection, __location__, name="BECKE88_LR_ADIABATIC", &
154 description="Uses the Becke 88 longrange exchange functional in an adiabatic fashion", &
155 n_keywords=0, n_subsections=0, repeats=.false., &
156 citations=[becke1988])
157 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
158 description="activates the functional", &
159 lone_keyword_l_val=.true., default_l_val=.false.)
160 CALL section_add_keyword(subsection, keyword)
161 CALL keyword_release(keyword)
162 CALL keyword_create(keyword, __location__, name="scale_x", &
163 description="scales the exchange part of the functional", &
164 default_r_val=1._dp)
165 CALL section_add_keyword(subsection, keyword)
166 CALL keyword_release(keyword)
167 CALL keyword_create(keyword, __location__, name="OMEGA", &
168 description="Potential parameter in erf(omega*r)/r", &
169 default_r_val=1._dp)
170 CALL section_add_keyword(subsection, keyword)
171 CALL keyword_release(keyword)
172 CALL keyword_create(keyword, __location__, name="LAMBDA", &
173 description="Defines the parameter of the adiabatic curve", &
174 default_r_val=1._dp)
175 CALL section_add_keyword(subsection, keyword)
176 CALL keyword_release(keyword)
177
178 CALL section_add_subsection(section, subsection)
179 CALL section_release(subsection)
180
181 CALL section_create(subsection, __location__, name="BECKE88_LR", &
182 description="Uses the Becke 88 longrange exchange functional", &
183 n_keywords=0, n_subsections=0, repeats=.false., &
184 citations=[becke1988])
185 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
186 description="activates the functional", &
187 lone_keyword_l_val=.true., default_l_val=.false.)
188 CALL section_add_keyword(subsection, keyword)
189 CALL keyword_release(keyword)
190 CALL keyword_create(keyword, __location__, name="scale_x", &
191 description="scales the exchange part of the functional", &
192 default_r_val=1._dp)
193 CALL section_add_keyword(subsection, keyword)
194 CALL keyword_release(keyword)
195 CALL keyword_create(keyword, __location__, name="OMEGA", &
196 description="Potential parameter in erf(omega*r)/r", &
197 default_r_val=1._dp)
198 CALL section_add_keyword(subsection, keyword)
199 CALL keyword_release(keyword)
200
201 CALL section_add_subsection(section, subsection)
202 CALL section_release(subsection)
203
204 CALL section_create(subsection, __location__, name="LYP", &
205 description="Uses the LYP functional", &
206 n_keywords=0, n_subsections=0, repeats=.false., &
207 citations=[lee1988])
208 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
209 description="activates the functional", &
210 lone_keyword_l_val=.true., default_l_val=.false.)
211 CALL section_add_keyword(subsection, keyword)
212 CALL keyword_release(keyword)
213 CALL keyword_create(keyword, __location__, name="scale_c", &
214 description="scales the correlation part of the functional", &
215 default_r_val=1._dp)
216 CALL section_add_keyword(subsection, keyword)
217 CALL keyword_release(keyword)
218 CALL section_add_subsection(section, subsection)
219 CALL section_release(subsection)
220
221 CALL section_create(subsection, __location__, name="PADE", &
222 description="Uses the PADE functional", &
223 n_keywords=0, n_subsections=0, repeats=.false., &
224 citations=[goedecker1996])
225 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
226 description="activates the functional", &
227 lone_keyword_l_val=.true., default_l_val=.false.)
228 CALL section_add_keyword(subsection, keyword)
229 CALL keyword_release(keyword)
230 CALL section_add_subsection(section, subsection)
231 CALL section_release(subsection)
232
233 CALL section_create(subsection, __location__, name="HCTH", &
234 description="Uses the HCTH class of functionals", &
235 n_keywords=0, n_subsections=0, repeats=.false.)
236 CALL keyword_create(keyword, __location__, name="PARAMETER_SET", &
237 description="Which version of the parameters should be used", &
238 usage="PARAMETER_SET 407", &
239 enum_c_vals=["93 ", "120", "147", "407", "HLE"], &
240 enum_i_vals=[93, 120, 147, 407, 408], &
241 default_i_val=120)
242 CALL section_add_keyword(subsection, keyword)
243 CALL keyword_release(keyword)
244 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
245 description="activates the functional", &
246 lone_keyword_l_val=.true., default_l_val=.false.)
247 CALL section_add_keyword(subsection, keyword)
248 CALL keyword_release(keyword)
249 CALL section_add_subsection(section, subsection)
250 CALL section_release(subsection)
251
252 CALL section_create(subsection, __location__, name="OPTX", &
253 description="Uses the OPTX functional", &
254 n_keywords=0, n_subsections=0, repeats=.false.)
255 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
256 description="activates the functional", &
257 lone_keyword_l_val=.true., default_l_val=.false.)
258 CALL section_add_keyword(subsection, keyword)
259 CALL keyword_release(keyword)
260 CALL keyword_create(keyword, __location__, name="scale_x", &
261 description="scales the exchange part of the functional", &
262 default_r_val=1._dp)
263 CALL section_add_keyword(subsection, keyword)
264 CALL keyword_release(keyword)
265 CALL keyword_create(keyword, __location__, name="a1", &
266 description="OPTX a1 coefficient", &
267 default_r_val=1.05151_dp)
268 CALL section_add_keyword(subsection, keyword)
269 CALL keyword_release(keyword)
270 CALL keyword_create(keyword, __location__, name="a2", &
271 description="OPTX a2 coefficient", &
272 default_r_val=1.43169_dp)
273 CALL section_add_keyword(subsection, keyword)
274 CALL keyword_release(keyword)
275 CALL keyword_create(keyword, __location__, name="gamma", &
276 description="OPTX gamma coefficient", &
277 default_r_val=0.006_dp)
278 CALL section_add_keyword(subsection, keyword)
279 CALL keyword_release(keyword)
280 CALL section_add_subsection(section, subsection)
281 CALL section_release(subsection)
282
283 CALL libxc_add_sections(section)
284
285 CALL section_create(subsection, __location__, name="CS1", &
286 description="Uses the CS1 functional", &
287 n_keywords=0, n_subsections=0, repeats=.false.)
288 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
289 description="activates the functional", &
290 lone_keyword_l_val=.true., default_l_val=.false.)
291 CALL section_add_keyword(subsection, keyword)
292 CALL keyword_release(keyword)
293 CALL section_add_subsection(section, subsection)
294 CALL section_release(subsection)
295
296 CALL section_create(subsection, __location__, name="XGGA", &
297 description="Uses one of the XGGA functionals (optimized versions of "// &
298 "some of these functionals might be available outside this section).", &
299 n_keywords=1, n_subsections=0, repeats=.false.)
300 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
301 description="activates the functional", &
302 lone_keyword_l_val=.true., default_l_val=.false.)
303 CALL section_add_keyword(subsection, keyword)
304 CALL keyword_release(keyword)
305 CALL keyword_create(keyword, __location__, name="FUNCTIONAL", &
306 description="Which one of the XGGA functionals should be used", &
307 usage="FUNCTIONAL PW86X", &
308 enum_c_vals=[ &
309 "BECKE88X", &
310 "PW86X ", &
311 "PW91X ", &
312 "PBEX ", &
313 "REV_PBEX", &
314 "OPTX ", &
315 "EV93 "], &
317 default_i_val=xgga_b88x)
318 CALL section_add_keyword(subsection, keyword)
319 CALL keyword_release(keyword)
320 CALL section_add_subsection(section, subsection)
321 CALL section_release(subsection)
322
323 CALL section_create(subsection, __location__, name="KE_GGA", &
324 description="Uses one of the KE_GGA functionals (optimized versions of "// &
325 "some of these functionals might be available outside this section). "// &
326 "These functionals are needed for the computation of the kinetic "// &
327 "energy in the Kim-Gordon method.", &
328 n_keywords=1, n_subsections=0, repeats=.false.)
329 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
330 description="activates the functional", &
331 lone_keyword_l_val=.true., default_l_val=.false.)
332 CALL section_add_keyword(subsection, keyword)
333 CALL keyword_release(keyword)
334 CALL keyword_create(keyword, __location__, name="FUNCTIONAL", &
335 description="Which one of the KE_GGA functionals should be used", &
336 usage="FUNCTIONAL (OL1|OL2|LLP|PW86|PW91|LC|T92|PBE)", &
337 enum_c_vals=["OL1 ", "OL2 ", "LLP ", "PW86", "PW91", "LC ", "T92 ", "PBE "], &
338 enum_i_vals=[ke_ol1, ke_ol2, ke_llp, ke_pw86, ke_pw91, ke_lc, ke_t92, ke_pbe], &
339 enum_desc=s2a("Uses first Ou-Yang and Levy functional, currently not producing correct results", &
340 "Uses second Ou-Yang and Levy functional, currently not producing correct results", &
341 "Uses Lee, Lee, and Parr functional", &
342 "Uses Perdew and Wang's 1986 functional", &
343 "Uses Perdew and Wang's 1991 functional", &
344 "Uses Lembarki and Chermette functional", &
345 "Uses Thakkar functional", &
346 "Uses the 1996 functional of Perdew, Burke and Ernzerhof"), &
347 default_i_val=ke_llp)
348 CALL section_add_keyword(subsection, keyword)
349 CALL keyword_release(keyword)
350 CALL section_add_subsection(section, subsection)
351 CALL section_release(subsection)
352
353 CALL section_create(subsection, __location__, name="P86C", &
354 description="Uses the P86C functional", &
355 n_keywords=0, n_subsections=0, repeats=.false.)
356 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
357 description="activates the functional", &
358 lone_keyword_l_val=.true., default_l_val=.false.)
359 CALL section_add_keyword(subsection, keyword)
360 CALL keyword_release(keyword)
361 CALL keyword_create(keyword, __location__, name="scale_c", &
362 description="scales the correlation part of the functional", &
363 default_r_val=1._dp)
364 CALL section_add_keyword(subsection, keyword)
365 CALL keyword_release(keyword)
366 CALL section_add_subsection(section, subsection)
367 CALL section_release(subsection)
368
369 CALL section_create(subsection, __location__, name="PW92", &
370 description="Uses the PerdewWang correlation functional.", &
371 n_keywords=1, n_subsections=0, repeats=.false.)
372 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
373 description="activates the functional", &
374 lone_keyword_l_val=.true., default_l_val=.false.)
375 CALL section_add_keyword(subsection, keyword)
376 CALL keyword_release(keyword)
377 CALL keyword_create(keyword, __location__, name="SCALE", &
378 description="Scaling of the energy functional", &
379 default_r_val=1.0_dp)
380 CALL section_add_keyword(subsection, keyword)
381 CALL keyword_release(keyword)
382 CALL keyword_create(keyword, __location__, name="PARAMETRIZATION", &
383 description="Which one of parametrizations should be used", &
384 usage="PARAMETRIZATION DMC", &
385 enum_c_vals=[ &
386 "ORIGINAL", &
387 "DMC ", &
388 "VMC "], &
389 enum_i_vals=[c_pw92, c_pw92dmc, c_pw92vmc], &
390 default_i_val=c_pw92)
391 CALL section_add_keyword(subsection, keyword)
392 CALL keyword_release(keyword)
393 CALL section_add_subsection(section, subsection)
394 CALL section_release(subsection)
395
396 CALL section_create(subsection, __location__, name="PZ81", &
397 description="Uses the PZ functional.", &
398 n_keywords=1, n_subsections=0, repeats=.false., &
399 citations=[perdew1981, ortiz1994])
400 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
401 description="activates the functional", &
402 lone_keyword_l_val=.true., default_l_val=.false.)
403 CALL section_add_keyword(subsection, keyword)
404 CALL keyword_release(keyword)
405 CALL keyword_create(keyword, __location__, name="PARAMETRIZATION", &
406 description="Which one of parametrizations should be used", &
407 usage="PARAMETRIZATION DMC", &
408 enum_c_vals=[ &
409 "ORIGINAL", &
410 "DMC ", &
411 "VMC "], &
412 enum_i_vals=[c_pz, c_pzdmc, c_pzvmc], &
413 default_i_val=pz_orig)
414 CALL section_add_keyword(subsection, keyword)
415 CALL keyword_release(keyword)
416 CALL keyword_create(keyword, __location__, name="scale_c", &
417 description="scales the correlation part of the functional", &
418 default_r_val=1._dp)
419 CALL section_add_keyword(subsection, keyword)
420 CALL keyword_release(keyword)
421 CALL section_add_subsection(section, subsection)
422 CALL section_release(subsection)
423
424 CALL section_create(subsection, __location__, name="TFW", &
425 description="Uses the TFW functional", &
426 n_keywords=0, n_subsections=0, repeats=.false.)
427 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
428 description="activates the functional", &
429 lone_keyword_l_val=.true., default_l_val=.false.)
430 CALL section_add_keyword(subsection, keyword)
431 CALL keyword_release(keyword)
432 CALL section_add_subsection(section, subsection)
433 CALL section_release(subsection)
434
435 CALL section_create(subsection, __location__, name="TF", &
436 description="Uses the TF functional", &
437 n_keywords=0, n_subsections=0, repeats=.false.)
438 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
439 description="activates the functional", &
440 lone_keyword_l_val=.true., default_l_val=.false.)
441 CALL section_add_keyword(subsection, keyword)
442 CALL keyword_release(keyword)
443 CALL section_add_subsection(section, subsection)
444 CALL section_release(subsection)
445
446 CALL section_create(subsection, __location__, name="VWN", &
447 description="Uses the VWN functional", &
448 n_keywords=0, n_subsections=0, repeats=.false., &
449 citations=[vosko1980])
450 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
451 description="activates the functional", &
452 lone_keyword_l_val=.true., default_l_val=.false.)
453 CALL section_add_keyword(subsection, keyword)
454 CALL keyword_release(keyword)
455 CALL keyword_create(keyword, __location__, name="scale_c", &
456 description="scales the correlation part of the functional", &
457 default_r_val=1._dp)
458 CALL section_add_keyword(subsection, keyword)
459 CALL keyword_release(keyword)
460
461 CALL keyword_create(keyword, __location__, name="FUNCTIONAL_TYPE", &
462 description="Which version of the VWN functional should be used", &
463 usage="FUNCTIONAL_TYPE VWN5", &
464 enum_c_vals=s2a("VWN5", "VWN3"), &
465 enum_i_vals=[do_vwn5, do_vwn3], &
466 enum_desc=s2a("This is the recommended (correct) version of the VWN functional", &
467 "This version is the default in Gaussian, but not recommended. "// &
468 "Notice that it is also employed in Gaussian's default version of B3LYP"), &
469 default_i_val=do_vwn5)
470
471 CALL section_add_keyword(subsection, keyword)
472 CALL keyword_release(keyword)
473 CALL section_add_subsection(section, subsection)
474 CALL section_release(subsection)
475
476 CALL section_create(subsection, __location__, name="XALPHA", &
477 description="Uses the XALPHA (SLATER) functional.", &
478 n_keywords=1, n_subsections=0, repeats=.false.)
479 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
480 description="activates the functional", &
481 lone_keyword_l_val=.true., default_l_val=.false.)
482 CALL section_add_keyword(subsection, keyword)
483 CALL keyword_release(keyword)
484 CALL keyword_create(keyword, __location__, name="XA", &
485 description="Value of the xa parameter (this does not change the exponent, "// &
486 "just the mixing)", &
487 usage="XA 0.7", default_r_val=2._dp/3._dp)
488 CALL section_add_keyword(subsection, keyword)
489 CALL keyword_release(keyword)
490 CALL keyword_create(keyword, __location__, name="scale_x", &
491 description="scales the exchange part of the functional", &
492 default_r_val=1._dp)
493 CALL section_add_keyword(subsection, keyword)
494 CALL keyword_release(keyword)
495 CALL section_add_subsection(section, subsection)
496 CALL section_release(subsection)
497
498 CALL section_create(subsection, __location__, name="TPSS", &
499 description="Uses the TPSS functional. Note, that there is no LSD version available. "// &
500 "In such cases, use the LIBXC version instead.", &
501 n_keywords=0, n_subsections=0, repeats=.false., &
502 citations=[tao2003])
503 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
504 description="Activates the functional", &
505 lone_keyword_l_val=.true., default_l_val=.false.)
506 CALL section_add_keyword(subsection, keyword)
507 CALL keyword_release(keyword)
508 CALL keyword_create(keyword, __location__, name="scale_x", &
509 description="scales the exchange part of the functional", &
510 default_r_val=1._dp)
511 CALL section_add_keyword(subsection, keyword)
512 CALL keyword_release(keyword)
513 CALL keyword_create(keyword, __location__, name="scale_c", &
514 description="scales the correlation part of the functional", &
515 default_r_val=1._dp)
516 CALL section_add_keyword(subsection, keyword)
517 CALL keyword_release(keyword)
518 CALL section_add_subsection(section, subsection)
519 CALL section_release(subsection)
520
521 CALL section_create(subsection, __location__, name="PBE", &
522 description="Uses the PBE functional", &
523 n_keywords=0, n_subsections=0, repeats=.false., &
524 citations=[perdew1996, zhang1998, perdew2008])
525 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
526 description="activates the functional", &
527 lone_keyword_l_val=.true., default_l_val=.false.)
528 CALL section_add_keyword(subsection, keyword)
529 CALL keyword_release(keyword)
530 CALL keyword_create(keyword, __location__, name="parametrization", &
531 description="switches between the different "// &
532 "parametrizations of the functional. "// &
533 "Note: Beta parameters used have only 5 significant digits, "// &
534 "as published. For higher precision and program comparison "// &
535 "use the LIBXC library.", &
536 enum_i_vals=[xc_pbe_orig, xc_pbe_rev, xc_pbe_sol], &
537 enum_c_vals=["ORIG ", "revPBE", "PBEsol"], &
538 enum_desc=["original PBE ", &
539 "revised PBE (revPBE) ", &
540 "PBE for solids and surfaces (PBEsol)"], &
541 default_i_val=xc_pbe_orig)
542 CALL section_add_keyword(subsection, keyword)
543 CALL keyword_release(keyword)
544 CALL keyword_create(keyword, __location__, name="scale_x", &
545 description="scales the exchange part of the functional", &
546 default_r_val=1._dp)
547 CALL section_add_keyword(subsection, keyword)
548 CALL keyword_release(keyword)
549 CALL keyword_create(keyword, __location__, name="scale_c", &
550 description="scales the correlation part of the functional", &
551 default_r_val=1._dp)
552 CALL section_add_keyword(subsection, keyword)
553 CALL keyword_release(keyword)
554 CALL section_add_subsection(section, subsection)
555 CALL section_release(subsection)
556
557 CALL create_gauxc_section(subsection)
558 CALL section_add_subsection(section, subsection)
559 CALL section_release(subsection)
560
561 CALL section_create(subsection, __location__, name="XWPBE", &
562 description="Uses the short range PBE functional", &
563 n_keywords=0, n_subsections=0, repeats=.false., &
564 citations=[heyd2004])
565 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
566 description="activates the functional", &
567 lone_keyword_l_val=.true., default_l_val=.false.)
568 CALL section_add_keyword(subsection, keyword)
569 CALL keyword_release(keyword)
570 CALL keyword_create(keyword, __location__, name="scale_x", &
571 description="scales the exchange part of the functional", &
572 default_r_val=1._dp)
573 CALL section_add_keyword(subsection, keyword)
574 CALL keyword_release(keyword)
575 CALL keyword_create(keyword, __location__, name="scale_x0", &
576 description="scales the exchange part of the original hole PBE-functional", &
577 default_r_val=0.0_dp)
578 CALL section_add_keyword(subsection, keyword)
579 CALL keyword_release(keyword)
580 CALL keyword_create(keyword, __location__, name="omega", &
581 description="screening parameter", &
582 default_r_val=1._dp)
583 CALL section_add_keyword(subsection, keyword)
584 CALL keyword_release(keyword)
585 CALL section_add_subsection(section, subsection)
586 CALL section_release(subsection)
587
588 CALL section_create(subsection, __location__, name="BECKE97", &
589 description="Uses the Becke 97 exchange correlation functional", &
590 n_keywords=0, n_subsections=0, repeats=.false., &
591 citations=[becke1997, grimme2006])
592 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
593 description="activates the functional", &
594 lone_keyword_l_val=.true., default_l_val=.false.)
595 CALL section_add_keyword(subsection, keyword)
596 CALL keyword_release(keyword)
597 CALL keyword_create(keyword, __location__, name="scale_x", &
598 description="scales the exchange part of the functional, if -1 the default for the given parametrization is used", &
599 default_r_val=-1._dp)
600 CALL section_add_keyword(subsection, keyword)
601 CALL keyword_release(keyword)
602 CALL keyword_create(keyword, __location__, name="scale_c", &
603 description="scales the correlation part of the functional", &
604 default_r_val=1._dp)
605 CALL section_add_keyword(subsection, keyword)
606 CALL keyword_release(keyword)
607 CALL keyword_create(keyword, __location__, name="parametrization", &
608 description="switches between the B97 and Grimme parametrization ", &
610 enum_c_vals=["ORIG ", "B97GRIMME ", "B97_GRIMME", "wB97X-V ", "B97-3c "], &
611 default_i_val=xc_b97_orig)
612 CALL section_add_keyword(subsection, keyword)
613 CALL keyword_release(keyword)
614
615 CALL section_add_subsection(section, subsection)
616 CALL section_release(subsection)
617
618 CALL section_create(subsection, __location__, name="BECKE_ROUSSEL", &
619 description="Becke Roussel exchange hole model. Can be used "// &
620 "as long range correction with a truncated coulomb potential", &
621 n_keywords=0, n_subsections=0, repeats=.false., &
622 citations=[beckeroussel1989, proynov2007])
623 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
624 description="activates the functional", &
625 lone_keyword_l_val=.true., default_l_val=.false.)
626 CALL section_add_keyword(subsection, keyword)
627 CALL keyword_release(keyword)
628 CALL keyword_create(keyword, __location__, name="scale_x", &
629 description="scales the exchange part of the functional", &
630 default_r_val=1._dp)
631 CALL section_add_keyword(subsection, keyword)
632 CALL keyword_release(keyword)
633 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS", &
634 description="Defines the cutoff radius for the truncation. "// &
635 "If put to zero, the standard full range potential will be used", &
636 usage="CUTOFF_RADIUS 2.0", default_r_val=0.0_dp)
637 CALL section_add_keyword(subsection, keyword)
638 CALL keyword_release(keyword)
639 CALL keyword_create(keyword, __location__, name="GAMMA", &
640 description="Parameter in the exchange hole. "// &
641 "Usually this is put to 1.0 or 0.8", &
642 usage="GAMMA 0.8", default_r_val=1.0_dp)
643 CALL section_add_keyword(subsection, keyword)
644 CALL keyword_release(keyword)
645 CALL section_add_subsection(section, subsection)
646 CALL section_release(subsection)
647
648 CALL section_create(subsection, __location__, name="LDA_HOLE_T_C_LR", &
649 description="LDA exchange hole model in truncated coulomb potential", &
650 n_keywords=0, n_subsections=0, repeats=.false.)
651 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
652 description="activates the functional", &
653 lone_keyword_l_val=.true., default_l_val=.false.)
654 CALL section_add_keyword(subsection, keyword)
655 CALL keyword_release(keyword)
656 CALL keyword_create(keyword, __location__, name="SCALE_X", &
657 description="scales the exchange part of the functional", &
658 default_r_val=1._dp)
659 CALL section_add_keyword(subsection, keyword)
660 CALL keyword_release(keyword)
661 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS", &
662 description="Defines cutoff for lower integration boundary", &
663 default_r_val=0.0_dp, unit_str="angstrom")
664 CALL section_add_keyword(subsection, keyword)
665 CALL keyword_release(keyword)
666 CALL section_add_subsection(section, subsection)
667 CALL section_release(subsection)
668
669 CALL section_create(subsection, __location__, name="PBE_HOLE_T_C_LR", &
670 description="PBE exchange hole model in trucanted coulomb potential", &
671 n_keywords=0, n_subsections=0, repeats=.false.)
672 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
673 description="activates the functional", &
674 lone_keyword_l_val=.true., default_l_val=.false.)
675 CALL section_add_keyword(subsection, keyword)
676 CALL keyword_release(keyword)
677 CALL keyword_create(keyword, __location__, name="SCALE_X", &
678 description="scales the exchange part of the functional", &
679 default_r_val=1._dp)
680 CALL section_add_keyword(subsection, keyword)
681 CALL keyword_release(keyword)
682 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS", &
683 description="Defines cutoff for lower integration boundary", &
684 default_r_val=1.0_dp, unit_str="angstrom")
685 CALL section_add_keyword(subsection, keyword)
686 CALL keyword_release(keyword)
687 CALL section_add_subsection(section, subsection)
688 CALL section_release(subsection)
689
690 CALL section_create(subsection, __location__, name="GV09", &
691 description="Combination of three different exchange hole models", &
692 n_keywords=0, n_subsections=0, repeats=.false.)
693 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
694 description="activates the functional", &
695 lone_keyword_l_val=.true., default_l_val=.false.)
696 CALL section_add_keyword(subsection, keyword)
697 CALL keyword_release(keyword)
698 CALL keyword_create(keyword, __location__, name="SCALE_X", &
699 description="scales the exchange part of the functional", &
700 default_r_val=1._dp)
701 CALL section_add_keyword(subsection, keyword)
702 CALL keyword_release(keyword)
703 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS", &
704 description="Defines cutoff for lower integration boundary", &
705 default_r_val=0.0_dp, unit_str="angstrom")
706 CALL section_add_keyword(subsection, keyword)
707 CALL keyword_release(keyword)
708 CALL keyword_create(keyword, __location__, name="GAMMA", &
709 description="Parameter for Becke Roussel hole", &
710 default_r_val=1.0_dp)
711 CALL section_add_keyword(subsection, keyword)
712 CALL keyword_release(keyword)
713 CALL section_add_subsection(section, subsection)
714 CALL section_release(subsection)
715
716 CALL section_create(subsection, __location__, name="BEEF", & !rk: BEEF Exchange
717 description="Uses the BEEFvdW exchange functional", &
718 n_keywords=0, n_subsections=0, repeats=.false., &
719 citations=[wellendorff2012])
720 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
721 description="activates the functional", &
722 lone_keyword_l_val=.true., default_l_val=.false.)
723 CALL section_add_keyword(subsection, keyword)
724 CALL keyword_release(keyword)
725 CALL keyword_create(keyword, __location__, name="scale_x", &
726 description="scales the exchange part of the functional", &
727 default_r_val=1._dp)
728 CALL section_add_keyword(subsection, keyword)
729 CALL keyword_release(keyword)
730 CALL section_add_subsection(section, subsection)
731 CALL section_release(subsection)
732
733 END SUBROUTINE create_xc_fun_section
734
735! **************************************************************************************************
736!> \brief creates the structure of the section needed to select an xc potential
737!> \param section the section that will be created
738!> \author thomas chassaing
739! **************************************************************************************************
740 SUBROUTINE create_xc_potential_section(section)
741 TYPE(section_type), POINTER :: section
742
743 TYPE(keyword_type), POINTER :: keyword
744 TYPE(section_type), POINTER :: subsection
745
746 cpassert(.NOT. ASSOCIATED(section))
747 CALL section_create(section, __location__, name="xc_potential", &
748 description="The xc potential to use (CAREFUL: xc potential here refers "// &
749 "to potentials that are not derived from an xc functional, but rather are "// &
750 "modelled directly. Therefore there is no consistent xc energy available. "// &
751 "To still get an energy expression, see ENERGY below", &
752 n_keywords=1, n_subsections=1, repeats=.false.)
753
754 NULLIFY (subsection, keyword)
755 CALL section_create(subsection, __location__, name="SAOP", &
756 description="Uses the SAOP potential", &
757 n_keywords=3, n_subsections=0, repeats=.true.)
758 CALL keyword_create(keyword, __location__, name="ALPHA", &
759 description="Value of the alpha parameter (default = 1.19).", &
760 usage="ALPHA 1.19", default_r_val=1.19_dp)
761 CALL section_add_keyword(subsection, keyword)
762 CALL keyword_release(keyword)
763 CALL keyword_create(keyword, __location__, name="BETA", &
764 description="Value of the beta parameter (default = 0.01).", &
765 usage="BETA 0.01", default_r_val=0.01_dp)
766 CALL section_add_keyword(subsection, keyword)
767 CALL keyword_release(keyword)
768 CALL keyword_create(keyword, __location__, name="K_RHO", &
769 description="Value of the K_rho parameter (default = 0.42).", &
770 usage="K_RHO 0.42", default_r_val=0.42_dp)
771 CALL section_add_keyword(subsection, keyword)
772 CALL keyword_release(keyword)
773 CALL section_add_subsection(section, subsection)
774 CALL section_release(subsection)
775
776 CALL keyword_create(keyword, __location__, name="ENERGY", &
777 description="How to determine the total energy.", &
778 usage="ENERGY [NONE,XC_FUNCTIONAL,SUM_EIGENVALUES", &
779 enum_c_vals=s2a("NONE", "XC_FUNCTIONAL", "FUNCTIONAL", "SUM_EIGENVALUES", "SOE"), &
780 enum_i_vals=[xc_pot_energy_none, &
785 default_i_val=xc_pot_energy_none)
786 CALL section_add_keyword(section, keyword)
787 CALL keyword_release(keyword)
788
789 END SUBROUTINE create_xc_potential_section
790
791! **************************************************************************************************
792!> \brief creates the structure of the section needed to select an xc kernel
793!> \param section the section that will be created
794!> \author JGH
795! **************************************************************************************************
796 SUBROUTINE create_xc_kernel_section(section)
797 TYPE(section_type), POINTER :: section
798
799 TYPE(keyword_type), POINTER :: keyword
800
801 cpassert(.NOT. ASSOCIATED(section))
802 CALL section_create(section, __location__, name="XC_KERNEL", &
803 description="The xc kernel to use (CAREFUL: xc kernel here refers "// &
804 "to kernels that are not derived from an xc functional, but rather are "// &
805 "modelled directly. This kernel will be used in a TDDFPT calculation. "// &
806 "Cannot be combined with XC_FUNCTIONAL or XC_POTENTIAL.", &
807 n_keywords=1, n_subsections=1, repeats=.false.)
808
809 NULLIFY (keyword)
810 CALL keyword_create( &
811 keyword, __location__, name="_SECTION_PARAMETERS_", &
812 description="Selection of kernel functionals.", &
813 usage="&XC_KERNEL LDAfxc", &
814 enum_c_vals=s2a("PADEfxc", "LDAfxc", "GGAfxc", "NONE"), &
816 enum_desc=s2a("Fxc based on LDA PADE approximation", &
817 "Fxc based on LDA functionals", &
818 "Fxc model from fit to PBE functional", &
819 "NONE"), &
820 default_i_val=fxc_none, &
821 lone_keyword_i_val=fxc_none)
822 CALL section_add_keyword(section, keyword)
823 CALL keyword_release(keyword)
824
825 CALL keyword_create(keyword, __location__, name="PARAMETER", &
826 description="List of parameters specific to the kernel function", &
827 usage="PARAMETER <REAL> .. <REAL>", &
828 type_of_var=real_t, n_var=-1)
829 CALL section_add_keyword(section, keyword)
830 CALL keyword_release(keyword)
831 CALL keyword_create(keyword, __location__, name="GAMMA", &
832 description="B97 GAMMA parameters [gx, gab, gaa]", &
833 usage="GAMMA <REAL> <REAL> <REAL>", &
834 default_r_vals=[0.004_dp, 0.006_dp, 0.2_dp], &
835 type_of_var=real_t, n_var=3)
836 CALL section_add_keyword(section, keyword)
837 CALL keyword_release(keyword)
838 CALL keyword_create(keyword, __location__, name="C_XAA", &
839 description="B97 C parameters for exchange", &
840 usage="C_XAA <REAL> <REAL> <REAL>", &
841 default_r_vals=[1.0_dp, 0.63_dp, 0.94_dp], &
842 type_of_var=real_t, n_var=3)
843 CALL section_add_keyword(section, keyword)
844 CALL keyword_release(keyword)
845 CALL keyword_create(keyword, __location__, name="C_CAB", &
846 description="B97 C parameters for same spin correlation.", &
847 usage="C_CAB <REAL> <REAL> <REAL>", &
848 default_r_vals=[1.0_dp, 0.75_dp, -4.60_dp], &
849 type_of_var=real_t, n_var=3)
850 CALL section_add_keyword(section, keyword)
851 CALL keyword_release(keyword)
852 CALL keyword_create(keyword, __location__, name="C_CAA", &
853 description="B97 C parameters for opposite spin correlation.", &
854 usage="C_CAA <REAL> <REAL> <REAL>", &
855 default_r_vals=[0.17_dp, 2.35_dp, -2.55_dp], &
856 type_of_var=real_t, n_var=3)
857 CALL section_add_keyword(section, keyword)
858 CALL keyword_release(keyword)
859 CALL keyword_create(keyword, __location__, name="SCALE_X", &
860 description="Scaling parameter for exchange kernel.", &
861 usage="SCALE_X 0.2", default_r_val=1.0_dp)
862 CALL section_add_keyword(section, keyword)
863 CALL keyword_release(keyword)
864 CALL keyword_create(keyword, __location__, name="SCALE_C", &
865 description="Scaling parameter for correlation kernel.", &
866 usage="SCALE_C 0.2", default_r_val=1.0_dp)
867 CALL section_add_keyword(section, keyword)
868 CALL keyword_release(keyword)
869
870 END SUBROUTINE create_xc_kernel_section
871
872! **************************************************************************************************
873!> \brief creates the structure of the section needed to select an hfx kernel
874!> \param section the section that will be created
875!> \author JGH
876! **************************************************************************************************
877 SUBROUTINE create_hfx_kernel_section(section)
878 TYPE(section_type), POINTER :: section
879
880 TYPE(keyword_type), POINTER :: keyword
881 TYPE(section_type), POINTER :: subsection
882
883 cpassert(.NOT. ASSOCIATED(section))
884 CALL section_create(section, __location__, name="HFX_KERNEL", &
885 description="The hfx kernel to use. Cannot be combined with HF section.", &
886 n_keywords=1, n_subsections=2, repeats=.false.)
887
888 NULLIFY (subsection, keyword)
889 CALL keyword_create(keyword, __location__, name="DO_HFXSR", &
890 description="Switch to use the HFXSR (short range) kernel.", &
891 usage="DO_HFXSR T/F", default_l_val=.false., &
892 lone_keyword_l_val=.true.)
893 CALL section_add_keyword(section, keyword)
894 CALL keyword_release(keyword)
895 NULLIFY (subsection, keyword)
896 CALL keyword_create(keyword, __location__, name="HFXSR_PRIMBAS", &
897 description="Default number of primitives in ADMM basis in HFXSR. "// &
898 "0 indicates the use of a contracted minimal basis. ", &
899 usage="HFXSR_PRIMBAS 3", default_i_val=0)
900 CALL section_add_keyword(section, keyword)
901 CALL keyword_release(keyword)
902
903 CALL create_hfx_section(subsection)
904 CALL section_add_subsection(section, subsection)
905 CALL section_release(subsection)
906
907 CALL section_create(subsection, __location__, name="HFXLR", &
908 description="Uses the HFXLR (long range) kernel", &
909 n_keywords=2, n_subsections=0, repeats=.false.)
910 CALL keyword_create(keyword, __location__, name="RCUT", &
911 description="Value of lower range cutoff of interaction [Bohr]", &
912 usage="RCUT 5.00", default_r_val=6.00_dp, unit_str="bohr")
913 CALL section_add_keyword(subsection, keyword)
914 CALL keyword_release(keyword)
915 CALL keyword_create(keyword, __location__, name="SCALE", &
916 description="Scaling parameter for HFX kernel.", &
917 usage="SCALE 0.25", default_r_val=1.00_dp)
918 CALL section_add_keyword(subsection, keyword)
919 CALL keyword_release(keyword)
920 CALL section_add_subsection(section, subsection)
921 CALL section_release(subsection)
922
923 END SUBROUTINE create_hfx_kernel_section
924! **************************************************************************************************
925!> \brief creates the structure of the section needed for vdW potentials
926!> \param section the section that will be created
927!> \author jgh
928! **************************************************************************************************
929 SUBROUTINE create_vdw_potential_section(section)
930 TYPE(section_type), POINTER :: section
931
932 TYPE(keyword_type), POINTER :: keyword
933 TYPE(section_type), POINTER :: newsection, print_key, subsection
934
935 cpassert(.NOT. ASSOCIATED(section))
936 CALL section_create(section, __location__, name="vdw_potential", &
937 description="This section combines all possible additional dispersion "// &
938 "corrections to the normal XC functionals. This can be more functionals "// &
939 "or simple empirical pair potentials. ", &
940 citations=[grimme2006, tran2013], &
941 n_keywords=1, n_subsections=1, repeats=.false.)
942
943 NULLIFY (subsection, keyword)
944 CALL keyword_create(keyword, __location__, name="POTENTIAL_TYPE", &
945 variants=s2a("DISPERSION_FUNCTIONAL"), &
946 description="Type of dispersion/vdW functional or potential to use", &
947 usage="POTENTIAL_TYPE (NONE|PAIR_POTENTIAL|NON_LOCAL)", &
948 enum_c_vals=s2a("NONE", "PAIR_POTENTIAL", "NON_LOCAL"), &
950 enum_desc=s2a("No dispersion/van der Waals functional.", &
951 "Pair potential van der Waals density functional, "// &
952 "including Grimme's empirical DFT-D methods.", &
953 "Nonlocal van der Waals density functional; more "// &
954 "rigorous in principle, but significantly more "// &
955 "time-consuming."), &
956 default_i_val=xc_vdw_fun_none)
957 CALL section_add_keyword(section, keyword)
958 CALL keyword_release(keyword)
959
960 CALL section_create(subsection, __location__, name="PAIR_POTENTIAL", &
961 description="Information on the pair potential to calculate dispersion", &
962 n_keywords=5, n_subsections=0, repeats=.true.)
963 CALL keyword_create(keyword, __location__, name="R_CUTOFF", &
964 variants=s2a("D3_CUTOFF", "D4_3B_CUTOFF"), &
965 description="Range of potential. The cutoff will be 2 times this value. "// &
966 "In the case of D4 it will be used for the 3-body term", &
967 usage="R_CUTOFF 20.0", default_r_val=20.0_dp, &
968 unit_str="angstrom")
969 CALL section_add_keyword(subsection, keyword)
970 CALL keyword_release(keyword)
971 CALL keyword_create(keyword, __location__, name="D4_CUTOFF", &
972 description="Range of potential. The cutoff will be 2 times this value. "// &
973 "Only used for the 2-body term of D4", &
974 usage="D4_CUTOFF 30.0", default_r_val=20.0_dp, &
975 unit_str="angstrom")
976 CALL section_add_keyword(subsection, keyword)
977 CALL keyword_release(keyword)
978 CALL keyword_create(keyword, __location__, name="D4_CUTOFF_WIDTH", &
979 variants=["D4_2B_CUTOFF_WIDTH"], &
980 description="Width of the smooth cutoff for the 2-body term of D4. "// &
981 "A value of zero disables smoothing.", &
982 usage="D4_CUTOFF_WIDTH 0.05", default_r_val=0.05_dp, &
983 unit_str="bohr")
984 CALL section_add_keyword(subsection, keyword)
985 CALL keyword_release(keyword)
986 CALL keyword_create(keyword, __location__, name="D4_3B_CUTOFF_WIDTH", &
987 description="Width of the smooth cutoff for the 3-body term of D4. "// &
988 "A value of zero disables smoothing.", &
989 usage="D4_3B_CUTOFF_WIDTH 0.0", default_r_val=0.0_dp, &
990 unit_str="bohr")
991 CALL section_add_keyword(subsection, keyword)
992 CALL keyword_release(keyword)
993 CALL keyword_create(keyword, __location__, name="D4_CN_CUTOFF", &
994 description="Coordination number cutoff for D4", &
995 usage="D4_CN_CUTOFF 30.0", default_r_val=-1.0_dp, &
996 unit_str="angstrom")
997 CALL section_add_keyword(subsection, keyword)
998 CALL keyword_release(keyword)
999 CALL keyword_create(keyword, __location__, name="TYPE", &
1000 description="Type of potential", &
1002 usage="TYPE (DFTD2|DFTD2(CHG)|DFTD3|DFTD3(BJ)|DFTD4)", &
1003 enum_c_vals=s2a("DFTD2", "DFTD2(CHG)", "DFTD3", "DFTD3(BJ)", "DFTD4"), &
1006 enum_desc=s2a("Grimme D2 method", &
1007 "D2 with Chai-Head-Gordon damping (wB97X-D, a=6, alpha=12)", &
1008 "Grimme D3 method (zero damping)", &
1009 "Grimme D3 method (Becke-Johnson damping)", &
1010 "Grimme D4 method"), &
1011 default_i_val=vdw_pairpot_dftd3bj)
1012 CALL section_add_keyword(subsection, keyword)
1013 CALL keyword_release(keyword)
1014 CALL keyword_create(keyword, __location__, name="PARAMETER_FILE_NAME", &
1015 description="Name of the parameter file, may include a path (not used for D4)", &
1016 usage="PARAMETER_FILE_NAME <FILENAME>", &
1017 default_lc_val="dftd3.dat")
1018 CALL section_add_keyword(subsection, keyword)
1019 CALL keyword_release(keyword)
1020 CALL keyword_create(keyword, __location__, name="REFERENCE_FUNCTIONAL", &
1021 description="Use parameters for this specific density functional. "// &
1022 "For DFTD2(CHG), use WB97X-D. "// &
1023 "For available DFT-D4 functionals and parameters see: "// &
1024 "<https://github.com/dftd4/dftd4/blob/main/src/dftd4/param.f90>. "// &
1025 "For available D3 and D3(BJ) parameters see: "// &
1026 "<https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3>. "// &
1027 "For Skala with D3(BJ), SKALA selects the B3LYP D3(BJ) parameters.", &
1028 usage="REFERENCE_FUNCTIONAL <functional>", &
1029 type_of_var=char_t)
1030 CALL section_add_keyword(subsection, keyword)
1031 CALL keyword_release(keyword)
1032 CALL keyword_create(keyword, __location__, name="D4_REFERENCE_CODE", &
1033 description="Calculate D4 energy using external library entirely. "// &
1034 "Not recommended if you are using an MPI version of CP2K, because "// &
1035 "DFT-D4 package does not support MPI parallelization. Note that "// &
1036 "the external library is always needed no matter if this option "// &
1037 "is triggered or not.", &
1038 usage="D4_REFERENCE_CODE", default_l_val=.false., &
1039 lone_keyword_l_val=.true.)
1040 CALL section_add_keyword(subsection, keyword)
1041 CALL keyword_release(keyword)
1042 CALL keyword_create(keyword, __location__, name="D4_DEBUG", &
1043 description="Debug output for D4 method using reference code; "// &
1044 "requires D4_REFERENCE_CODE F to work and VERBOSE_OUTPUT T to "// &
1045 "show the debugging result.", &
1046 usage="D4_DEBUG", default_l_val=.false., &
1047 lone_keyword_l_val=.true.)
1048 CALL section_add_keyword(subsection, keyword)
1049 CALL keyword_release(keyword)
1050 CALL keyword_create(keyword, __location__, name="D3_REFERENCE_CODE", &
1051 description="Use D3 damping parameters from s-dftd3 library instead of built-in values. "// &
1052 "Requires s-dftd3 library to be compiled in.", &
1053 usage="D3_REFERENCE_CODE", default_l_val=.false., &
1054 lone_keyword_l_val=.true.)
1055 CALL section_add_keyword(subsection, keyword)
1056 CALL keyword_release(keyword)
1057 CALL keyword_create(keyword, __location__, name="D2_SCALING", &
1058 variants=["SCALING"], &
1059 description="XC Functional dependent scaling parameter. If omitted, CP2K attempts"// &
1060 " to guess the xc functional that is in use and sets the associated scaling parameter.", &
1061 usage="SCALING 0.2", default_r_val=0._dp)
1062 CALL section_add_keyword(subsection, keyword)
1063 CALL keyword_release(keyword)
1064 CALL keyword_create(keyword, __location__, name="D2_EXP_PRE", &
1065 variants=["EXP_PRE"], &
1066 description="Prefactor in exponential damping factor (DFT-D2 potential). "// &
1067 "Not applicable to DFTD2(CHG).", &
1068 usage="D2_EXP_PRE 20.", default_r_val=20._dp)
1069 CALL section_add_keyword(subsection, keyword)
1070 CALL keyword_release(keyword)
1071 CALL keyword_create(keyword, __location__, name="EPS_CN", &
1072 description="Cutoff value for coordination number function (DFT-D3 method)", &
1073 usage="EPS_CN 1.e-6_dp", default_r_val=1.e-6_dp)
1074 CALL section_add_keyword(subsection, keyword)
1075 CALL keyword_release(keyword)
1076 CALL keyword_create(keyword, __location__, name="D3_SCALING", &
1077 description="XC Functional dependent scaling parameters (s6,sr6,s8) for the DFT-D3 method."// &
1078 " If omitted, CP2K attempts"// &
1079 " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1080 usage="D3_SCALING 1.0 1.0 1.0", n_var=3, &
1081 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp])
1082 CALL section_add_keyword(subsection, keyword)
1083 CALL keyword_release(keyword)
1084 CALL keyword_create(keyword, __location__, name="D3BJ_SCALING", &
1085 description="XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D3(BJ) method."// &
1086 " If omitted, CP2K attempts"// &
1087 " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1088 usage="D3BJ_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
1089 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1090 CALL section_add_keyword(subsection, keyword)
1091 CALL keyword_release(keyword)
1092 CALL keyword_create(keyword, __location__, name="D4_SCALING", &
1093 description="XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D4 method."// &
1094 " If omitted, CP2K attempts"// &
1095 " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1096 usage="D4_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
1097 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1098 CALL section_add_keyword(subsection, keyword)
1099 CALL keyword_release(keyword)
1100 CALL keyword_create(keyword, __location__, name="CALCULATE_C9_TERM", &
1101 description="Calculate C9 terms in DFT-D3 model", &
1102 usage="CALCULATE_C9_TERM", default_l_val=.false., &
1103 lone_keyword_l_val=.true.)
1104 CALL section_add_keyword(subsection, keyword)
1105 CALL keyword_release(keyword)
1106 CALL keyword_create(keyword, __location__, name="REFERENCE_C9_TERM", &
1107 description="Calculate C9 terms in DFT-D3 model using reference coordination numbers", &
1108 usage="REFERENCE_C9_TERM", default_l_val=.false., &
1109 lone_keyword_l_val=.true.)
1110 CALL section_add_keyword(subsection, keyword)
1111 CALL keyword_release(keyword)
1112 CALL keyword_create(keyword, __location__, name="FACTOR_S9_TERM", &
1113 description="S9 prefactor of the many-body term in the DFT-D4 method.", &
1114 usage="FACTOR_S9_TERM 1.e-0", default_r_val=1.00_dp)
1115 CALL section_add_keyword(subsection, keyword)
1116 CALL keyword_release(keyword)
1117 CALL keyword_create(keyword, __location__, name="LONG_RANGE_CORRECTION", &
1118 description="Calculate a long range correction to the DFT-D3 model."// &
1119 " WARNING: Use with care! Only for isotropic dense systems.", &
1120 usage="LONG_RANGE_CORRECTION", default_l_val=.false., &
1121 lone_keyword_l_val=.true.)
1122 CALL section_add_keyword(subsection, keyword)
1123 CALL keyword_release(keyword)
1124 CALL keyword_create(keyword, __location__, name="SHORT_RANGE_CORRECTION", &
1125 description="Calculate a short-range bond correction to the DFT-D3 model", &
1126 usage="SHORT_RANGE_CORRECTION", default_l_val=.false., &
1127 lone_keyword_l_val=.true.)
1128 CALL section_add_keyword(subsection, keyword)
1129 CALL keyword_release(keyword)
1130 CALL keyword_create(keyword, __location__, name="SHORT_RANGE_CORRECTION_PARAMETERS", &
1131 description="Parameters for the short-range bond correction to the DFT-D3 model. "// &
1132 "s*(za*zb)^t1*EXP(-g*dr*r0ab^t2), parameters: s, g, t1, t2 "// &
1133 "Defaults: s=0.08, g=10.0, t1=0.5, t2=-1.0 ", &
1134 usage="SHORT_RANGE_CORRECTION_PARAMETERS", default_r_vals=[0.08_dp, 10.0_dp, 0.5_dp, -1.0_dp], &
1135 n_var=4, type_of_var=real_t)
1136 CALL section_add_keyword(subsection, keyword)
1137 CALL keyword_release(keyword)
1138 ! KG molecular corrections
1139 CALL keyword_create(keyword, __location__, name="MOLECULE_CORRECTION", &
1140 description="Calculate a intermolecular correction to the DFT-D3 model", &
1141 usage="MOLECULE_CORRECTION", default_l_val=.false., &
1142 lone_keyword_l_val=.true.)
1143 CALL section_add_keyword(subsection, keyword)
1144 CALL keyword_release(keyword)
1145 CALL keyword_create(keyword, __location__, name="MOLECULE_CORRECTION_C8", &
1146 description="Calculate a intermolecular correction to the C8 term in the DFT-D3 model", &
1147 usage="MOLECULE_CORRECTION_C8 1.0 ", default_r_val=0.0_dp)
1148 CALL section_add_keyword(subsection, keyword)
1149 CALL keyword_release(keyword)
1150 CALL keyword_create(keyword, __location__, name="VERBOSE_OUTPUT", &
1151 description="Extensive output for the DFT-D2 and DFT-D3 models."// &
1152 " Needs PRINT_DFTD section to be specified.", &
1153 usage="VERBOSE_OUTPUT", default_l_val=.false., &
1154 lone_keyword_l_val=.true.)
1155 CALL section_add_keyword(subsection, keyword)
1156 CALL keyword_release(keyword)
1157
1158 ! Set coordination numbers by atom numbers
1159 CALL keyword_create(keyword, __location__, name="D3_EXCLUDE_KIND", &
1160 description="Specifies the atomic kinds excluded in the DFT-D3 calculation.", &
1161 usage="D3_EXCLUDE_KIND kind1 kind2 ... ", repeats=.false., &
1162 n_var=-1, type_of_var=integer_t)
1163 CALL section_add_keyword(subsection, keyword)
1164 CALL keyword_release(keyword)
1165
1166 ! Ignore selected pair interactins
1167 CALL keyword_create(keyword, __location__, name="D3_EXCLUDE_KIND_PAIR", &
1168 description="Specifies the atomic kinds for interactions excluded from the DFT-D3 calculation.", &
1169 usage="D3_EXCLUDE_KIND_PAIR kind1 kind2 ", repeats=.true., &
1170 n_var=2, type_of_var=integer_t)
1171 CALL section_add_keyword(subsection, keyword)
1172 CALL keyword_release(keyword)
1173
1174 ! Set coordination numbers by atom kinds
1175 CALL keyword_create(keyword, __location__, name="KIND_COORDINATION_NUMBERS", &
1176 description="Specifies the coordination number for a kind for the C9 term in DFT-D3.", &
1177 usage="KIND_COORDINATION_NUMBERS CN kind ", repeats=.true., &
1178 n_var=-1, type_of_var=char_t)
1179 CALL section_add_keyword(subsection, keyword)
1180 CALL keyword_release(keyword)
1181 ! Set coordination numbers by atom numbers
1182 CALL keyword_create(keyword, __location__, name="ATOM_COORDINATION_NUMBERS", &
1183 description="Specifies the coordination number of a set of atoms for the C9 term in DFT-D3.", &
1184 usage="ATOM_COORDINATION_NUMBERS CN atom1 atom2 ... ", repeats=.true., &
1185 n_var=-1, type_of_var=char_t)
1186 CALL section_add_keyword(subsection, keyword)
1187 CALL keyword_release(keyword)
1188
1189 ! parameter specification atom by atom
1190 CALL keyword_create(keyword, __location__, name="ATOMPARM", &
1191 description="Specifies parameters for atom types (in atomic units). If "// &
1192 "not provided default parameters are used (DFT-D2).", &
1193 usage="ATOMPARM <ELEMENT> <C6_parameter> <vdw_radii>", &
1194 repeats=.true., n_var=-1, type_of_var=char_t)
1195 CALL section_add_keyword(subsection, keyword)
1196 CALL keyword_release(keyword)
1197
1198 NULLIFY (print_key)
1199 CALL cp_print_key_section_create(print_key, __location__, "PRINT_DFTD", &
1200 description="Controls the printing of some info about DFTD contributions", &
1201 print_level=high_print_level, add_last=add_last_numeric, filename="")
1202 CALL section_add_subsection(subsection, print_key)
1203 CALL section_release(print_key)
1204
1205 NULLIFY (newsection)
1206 CALL create_eeq_control_section(newsection)
1207 CALL section_add_subsection(subsection, newsection)
1208 CALL section_release(newsection)
1209
1210 CALL section_add_subsection(section, subsection)
1211 CALL section_release(subsection)
1212
1213 ! nonlocal section
1214 NULLIFY (subsection, keyword)
1215 CALL section_create(subsection, __location__, name="NON_LOCAL", &
1216 description="Information on the non local part of dispersion functionals. "// &
1217 "Correct functionals require a corresponding setting of XC_FUNCTIONAL.", &
1218 n_keywords=0, n_subsections=0, repeats=.true.)
1219
1220 CALL keyword_create(keyword, __location__, name="TYPE", &
1221 description="Type of functional (the corresponding kernel data file should be selected). "// &
1222 "Allows for common forms such as vdW-DF, vdW-DF2, optB88-vdW, rVV10.", &
1223 usage="TYPE DRSLL", &
1224 enum_c_vals=s2a("DRSLL", "LMKLL", "RVV10"), &
1225 enum_i_vals=[vdw_nl_drsll, vdw_nl_lmkll, vdw_nl_rvv10], &
1226 enum_desc=s2a("Dion-Rydberg-Schroeder-Langreth-Lundqvist nonlocal van der Waals density functional", &
1227 "Lee-Murray-Kong-Lundqvist-Langreth nonlocal van der Waals density functional", &
1228 "Revised Vydrov-van Voorhis nonlocal van der Waals density functional"), &
1229 citations=[tran2013], &
1230 default_i_val=vdw_nl_drsll)
1231 CALL section_add_keyword(subsection, keyword)
1232 CALL keyword_release(keyword)
1233 CALL keyword_create(keyword, __location__, name="VERBOSE_OUTPUT", &
1234 description="Extensive output for non local functionals", &
1235 usage="VERBOSE_OUTPUT", default_l_val=.false., &
1236 lone_keyword_l_val=.true.)
1237 CALL section_add_keyword(subsection, keyword)
1238 CALL keyword_release(keyword)
1239 CALL keyword_create(keyword, __location__, name="KERNEL_FILE_NAME", &
1240 description="Name of the kernel data file, may include a path. "// &
1241 "vdW_kernel_table.dat is for DRSLL and LMKLL and "// &
1242 "rVV10_kernel_table.dat is for rVV10.", &
1243 usage="KERNEL_FILE_NAME <FILENAME>", &
1244 default_lc_val="vdW_kernel_table.dat")
1245 CALL section_add_keyword(subsection, keyword)
1246 CALL keyword_release(keyword)
1247 CALL keyword_create(keyword, __location__, name="CUTOFF", &
1248 description="The cutoff of the FFT grid used in the calculation "// &
1249 "of the nonlocal vdW functional [Ry].", &
1250 usage="CUTOFF 300", &
1251 default_r_val=-1._dp, unit_str="Ry")
1252 CALL section_add_keyword(subsection, keyword)
1253 CALL keyword_release(keyword)
1254 CALL keyword_create(keyword, __location__, name="PARAMETERS", &
1255 description="Parameters b and C of the rVV10 functional", &
1256 usage="PARAMETERS 6.3 0.0093", &
1257 type_of_var=real_t, default_r_vals=[6.3_dp, 0.0093_dp], n_var=2)
1258 CALL section_add_keyword(subsection, keyword)
1259 CALL keyword_release(keyword)
1260 CALL keyword_create(keyword, __location__, name="SCALE", &
1261 description="Scales the energy contribution of the rVV10 functional", &
1262 usage="SCALE 1.0", &
1263 type_of_var=real_t, default_r_val=1.0_dp)
1264 CALL section_add_keyword(subsection, keyword)
1265 CALL keyword_release(keyword)
1266
1267 CALL section_add_subsection(section, subsection)
1268 CALL section_release(subsection)
1269
1270 END SUBROUTINE create_vdw_potential_section
1271
1272! **************************************************************************************************
1273!> \brief creates the structure of the section needed for gCP potentials
1274!> \param section the section that will be created
1275!> \author jgh
1276! **************************************************************************************************
1277 SUBROUTINE create_gcp_potential_section(section)
1278 TYPE(section_type), POINTER :: section
1279
1280 TYPE(keyword_type), POINTER :: keyword
1281
1282 cpassert(.NOT. ASSOCIATED(section))
1283 CALL section_create(section, __location__, name="gcp_potential", &
1284 description="This section combines geometrical counterpoise potentials."// &
1285 " This is a simple empirical pair potential to correct for BSSE. ", &
1286 citations=[kruse2012], &
1287 n_keywords=1, n_subsections=1, repeats=.false.)
1288
1289 NULLIFY (keyword)
1290 CALL keyword_create(keyword, __location__, name="PARAMETER_FILE_NAME", &
1291 description="Name of the parameter file, may include a path", &
1292 usage="PARAMETER_FILE_NAME <FILENAME>", &
1293 default_lc_val="---")
1294 CALL section_add_keyword(section, keyword)
1295 CALL keyword_release(keyword)
1296
1297 CALL keyword_create(keyword, __location__, name="GLOBAL_PARAMETERS", &
1298 description="Global parameters of the gCP method."// &
1299 " Parameters are sigma, alpha, beta, eta from the original paper.", &
1300 usage="GLOBAL_PARAMETERS 1.0 1.0 1.0 1.0", n_var=4, &
1301 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1302 CALL section_add_keyword(section, keyword)
1303 CALL keyword_release(keyword)
1304
1305 CALL keyword_create(keyword, __location__, name="DELTA_ENERGY", &
1306 description="Specify the delta energy [Hartree] term for an atom kind", &
1307 usage="DELTA_ENERGY type value", &
1308 type_of_var=char_t, repeats=.true., n_var=-1, default_c_vals=["XX ", "0.0"])
1309 CALL section_add_keyword(section, keyword)
1310 CALL keyword_release(keyword)
1311
1312 CALL keyword_create(keyword, __location__, name="VERBOSE", &
1313 description="Verbose output for gCP calculation", &
1314 usage="VERBOSE logical_value", &
1315 default_l_val=.true., lone_keyword_l_val=.true.)
1316 CALL section_add_keyword(section, keyword)
1317 CALL keyword_release(keyword)
1318
1319 END SUBROUTINE create_gcp_potential_section
1320
1321! **************************************************************************************************
1322!> \brief creates the structure of the GAUXC section
1323!> \param section the section that will be created
1324!> \author fawzi
1325! **************************************************************************************************
1326 SUBROUTINE create_gauxc_section(section)
1327 TYPE(section_type), POINTER :: section
1328
1329 TYPE(keyword_type), POINTER :: keyword
1330
1331 cpassert(.NOT. ASSOCIATED(section))
1332 CALL section_create(section, __location__, name="GAUXC", &
1333 description="Use exchange-correlation functionals provided by GauXC. "// &
1334 "The current CP2K bridge uses GauXC's molecular quadrature. Periodic inputs "// &
1335 "are limited to isolated validation cells and are not compact periodic "// &
1336 "material calculations.", &
1337 n_keywords=30, n_subsections=0, repeats=.false.)
1338
1339 NULLIFY (keyword)
1340
1341 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
1342 description="activates the functional", &
1343 lone_keyword_l_val=.true., default_l_val=.false.)
1344 CALL section_add_keyword(section, keyword)
1345 CALL keyword_release(keyword)
1346
1347 CALL keyword_create(keyword, __location__, name="FUNCTIONAL", &
1348 description="Functional name used to create the GauXC integrator. "// &
1349 "If MODEL is set, this optional base functional defaults to PBE and "// &
1350 "does not need to be specified for MODEL SKALA inputs.", &
1351 default_c_val="PBE")
1352 CALL section_add_keyword(section, keyword)
1353 CALL keyword_release(keyword)
1354
1355 CALL keyword_create(keyword, __location__, name="MODEL", &
1356 description="GauXC Skala model name or path. Use NONE for conventional GauXC. "// &
1357 "MODEL SKALA selects the installed Skala-1.1 model when available; "// &
1358 "other Skala models are supplied as .fun files or model names. "// &
1359 "NLCC pseudopotentials are rejected by the direct molecular GauXC "// &
1360 "Skala path. Pseudopotential GAPW PAW_ONE_CENTER and the CP2K-native "// &
1361 "SKALA grid path include NLCC in their reconstructed primitive fields.", &
1362 usage="MODEL SKALA", &
1363 default_c_val="NONE")
1364 CALL section_add_keyword(section, keyword)
1365 CALL keyword_release(keyword)
1366
1367 CALL keyword_create( &
1368 keyword, __location__, name="PSEUDOPOTENTIAL_GAPW_REPRESENTATION", &
1369 description="Select the density representation used by an active GauXC model for "// &
1370 "METHOD GAPW/GAPW_XC kinds with GTH or ECP pseudopotentials. "// &
1371 "DIRECT_VALENCE treats those kinds as GPW_TYPE and evaluates the model on "// &
1372 "the direct valence density; this is the default for non-local models such "// &
1373 "as Skala. PAW_ONE_CENTER combines the smooth and all hard-minus-soft "// &
1374 "one-center primitive fields before one model evaluation, retaining all 15 pairwise "// &
1375 "spin-gradient cross terms (14 additional to the smooth-density baseline) and the "// &
1376 "non-local couplings. PAW_ONE_CENTER_SPLIT is a diagnostic that evaluates smooth, hard, "// &
1377 "and soft fields separately. CP2K_DEFAULT retains the representation selected "// &
1378 "by KIND%GPW_TYPE, basis hardness, and DFT%QS%FORCE_PAW. All-electron kinds "// &
1379 "and conventional GauXC MODEL NONE calculations are unaffected. In a mixed "// &
1380 "all-electron/pseudopotential calculation, the selector applies per kind: "// &
1381 "all-electron kinds retain their one-center reconstruction while pseudopotential "// &
1382 "kinds follow the selected representation. No mixed-system-specific input is needed.", &
1383 usage="PSEUDOPOTENTIAL_GAPW_REPRESENTATION DIRECT_VALENCE", &
1384 enum_c_vals=s2a("DIRECT_VALENCE", "PAW_ONE_CENTER", "CP2K_DEFAULT", &
1385 "PAW_ONE_CENTER_SPLIT"), &
1388 enum_desc=s2a("Use the direct pseudopotential valence density", &
1389 "Reconstruct the GAPW primitive fields before model evaluation", &
1390 "Use the representation selected by the ordinary CP2K GAPW rules", &
1391 "Diagnose the separate smooth plus hard-minus-soft energy expression"), &
1392 default_i_val=skala_gapw_direct_valence)
1393 CALL section_add_keyword(section, keyword)
1394 CALL keyword_release(keyword)
1395
1396 CALL keyword_create(keyword, __location__, name="GRID", &
1397 description="Atomic grid size for GauXC. Skala defaults to SUPERFINE "// &
1398 "unless this keyword is set explicitly.", &
1399 usage="GRID fine", &
1400 enum_c_vals=s2a("FINE", "ULTRAFINE", "SUPERFINE", "GM3", "GM5"), &
1401 enum_i_vals=[1, 2, 3, 4, 5], &
1402 enum_desc=s2a("Fine grid (default)", &
1403 "Ultra fine grid", &
1404 "Super fine grid", &
1405 "GM3 grid", &
1406 "GM5 grid"), &
1407 default_i_val=1)
1408 CALL section_add_keyword(section, keyword)
1409 CALL keyword_release(keyword)
1410
1411 CALL keyword_create(keyword, __location__, name="RADIAL_QUADRATURE", &
1412 description="Radial quadrature scheme for GauXC", &
1413 usage="RADIAL_QUADRATURE muraknowles", &
1414 enum_c_vals=s2a("MURAKNOWLES", "BECKE", "TREUTLERAHLRICHS", "MURRAYHANDYLAMING"), &
1415 enum_i_vals=[1, 2, 3, 4], &
1416 enum_desc=s2a("Mura-Knowles radial quadrature (default)", &
1417 "Becke radial quadrature", &
1418 "Treutler-Ahlrichs radial quadrature", &
1419 "Murray-Handy-Laming radial quadrature"), &
1420 default_i_val=1)
1421 CALL section_add_keyword(section, keyword)
1422 CALL keyword_release(keyword)
1423
1424 CALL keyword_create(keyword, __location__, name="PRUNING_SCHEME", &
1425 description="Pruning scheme for GauXC. Skala defaults to UNPRUNED "// &
1426 "unless this keyword is set explicitly.", &
1427 usage="PRUNING_SCHEME robust", &
1428 enum_c_vals=s2a("ROBUST", "TREUTLER", "UNPRUNED"), &
1429 enum_i_vals=[1, 2, 3], &
1430 enum_desc=s2a("Robust pruning (default)", &
1431 "Treutler pruning", &
1432 "Unpruned grid"), &
1433 default_i_val=1)
1434 CALL section_add_keyword(section, keyword)
1435 CALL keyword_release(keyword)
1436
1437 CALL keyword_create(keyword, __location__, name="BATCH_SIZE", &
1438 description="Batch size for GauXC evaluation", &
1439 usage="BATCH_SIZE 512", &
1440 default_i_val=512)
1441 CALL section_add_keyword(section, keyword)
1442 CALL keyword_release(keyword)
1443
1444 CALL keyword_create(keyword, __location__, name="DEVICE_RUNTIME_FILL_FRACTION", &
1445 description="Fraction of currently available GPU memory preallocated by "// &
1446 "a GauXC device runtime. Lower values leave more memory for Skala "// &
1447 "Torch inference; this keyword is used only with LB_EXECUTION_SPACE DEVICE.", &
1448 usage="DEVICE_RUNTIME_FILL_FRACTION 0.1", &
1449 default_r_val=0.1_dp)
1450 CALL section_add_keyword(section, keyword)
1451 CALL keyword_release(keyword)
1452
1453 CALL keyword_create(keyword, __location__, name="MODEL_ATOM_CHUNK_SIZE", &
1454 description="Atom chunk size for GauXC Skala Torch inference. "// &
1455 "A positive value evaluates the Torch model atom block by atom block; "// &
1456 "zero disables chunking; the default leaves GauXC's model-specific policy "// &
1457 "or the GAUXC_ONEDFT_ATOM_CHUNK_SIZE environment variable in control.", &
1458 usage="MODEL_ATOM_CHUNK_SIZE 3", &
1459 default_i_val=-1)
1460 CALL section_add_keyword(section, keyword)
1461 CALL keyword_release(keyword)
1462
1463 CALL keyword_create(keyword, __location__, name="PERIODIC_REFERENCE", &
1464 description="Explicitly opt into the limited isolated-cell GauXC reference "// &
1465 "path for periodic CP2K inputs. This path is restricted to Gamma-only, "// &
1466 "single-image METHOD GPW calculations with GTH pseudopotentials and uses "// &
1467 "GauXC's molecular quadrature; compact periodic materials require a "// &
1468 "dedicated periodic GauXC interface.", &
1469 usage="PERIODIC_REFERENCE T", &
1470 default_l_val=.false., lone_keyword_l_val=.true.)
1471 CALL section_add_keyword(section, keyword)
1472 CALL keyword_release(keyword)
1473
1474 CALL keyword_create(keyword, __location__, name="NATIVE_GRID", &
1475 description="Experimental CP2K-native real-space-grid path for SKALA "// &
1476 "TorchScript models. This bypasses GauXC molecular quadrature and supports "// &
1477 "isolated, partially periodic, and fully periodic METHOD GPW cells with "// &
1478 "GTH/ECP pseudopotentials and METHOD GAPW/GAPW_XC cells. GAPW with "// &
1479 "GTH/ECP pseudopotentials supports direct-valence and PAW-like one-center "// &
1480 "density representations; GAPW all-electron reconstructs the all-electron "// &
1481 "primitive fields. The current implementation is limited "// &
1482 "to a single GAUXC functional and provides energy, VXC, and experimental "// &
1483 "analytical nuclear-gradient/stress evaluations. K-point runs use CP2K's "// &
1484 "standard k-point and symmetry-reduction infrastructure; CPU k-point "// &
1485 "runs require mutually compatible BLAS, ScaLAPACK, OpenMP, and LibTorch "// &
1486 "runtimes, while CUDA evaluation is selected explicitly. "// &
1487 "Energy/VXC runs split the Torch evaluation into atom blocks by default "// &
1488 "and route dynamic features and gradients between MPI ranks. "// &
1489 "PAW-like GAPW+GTH/ECP and METHOD GAPW_XC combine selectable hard/soft "// &
1490 "primitive fields before constructing the nonlinear SKALA features. ROKS, "// &
1491 "ADMM, and non-k-point multiple-image calculations are not implemented.", &
1492 usage="NATIVE_GRID T", &
1493 default_l_val=.false., lone_keyword_l_val=.true.)
1494 CALL section_add_keyword(section, keyword)
1495 CALL keyword_release(keyword)
1496
1497 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_MODEL_FP64", &
1498 description="Promote float32 numerical state and explicit floating-point casts "// &
1499 "in the native SKALA TorchScript model to double precision. Trained parameter "// &
1500 "values are retained exactly. This improves SCF and geometry-derivative "// &
1501 "consistency for mixed-precision exports. Disable to retain the export's "// &
1502 "original numerical precision.", &
1503 usage="NATIVE_GRID_MODEL_FP64 T", &
1504 default_l_val=.true., lone_keyword_l_val=.true.)
1505 CALL section_add_keyword(section, keyword)
1506 CALL keyword_release(keyword)
1507
1508 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_USE_CUDA", &
1509 description="Evaluate the experimental CP2K-native SKALA GPW TorchScript "// &
1510 "model on CUDA when libtorch CUDA support is available. This requires a "// &
1511 "CUDA-compatible SKALA model export; MODEL SKALA first checks "// &
1512 "GAUXC_SKALA_CUDA_MODEL in this mode and otherwise falls back to "// &
1513 "SKALA_MODEL. The portable default uses CPU tensors.", &
1514 usage="NATIVE_GRID_USE_CUDA T", &
1515 default_l_val=.false., lone_keyword_l_val=.true.)
1516 CALL section_add_keyword(section, keyword)
1517 CALL keyword_release(keyword)
1518
1519 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_CUDA_DEVICE", &
1520 description="CUDA device used by the experimental CP2K-native SKALA GPW "// &
1521 "TorchScript path when NATIVE_GRID_USE_CUDA is enabled. A negative value "// &
1522 "maps the MPI-local rank to one of the CUDA devices visible to the process; "// &
1523 "CUDA exports with device-specific TorchScript constants may require a "// &
1524 "rank-local CUDA_VISIBLE_DEVICES list. A non-negative value selects that "// &
1525 "visible CUDA device explicitly.", &
1526 usage="NATIVE_GRID_CUDA_DEVICE -1", &
1527 default_i_val=-1)
1528 CALL section_add_keyword(section, keyword)
1529 CALL keyword_release(keyword)
1530
1531 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_ATOM_PARTITION", &
1532 description="Atom partition used to build the experimental CP2K-native "// &
1533 "SKALA COMMON_GRID feature block. HARD assigns each native grid point to "// &
1534 "the nearest periodic atom and is intended for legacy energy/VXC-only runs. "// &
1535 "SMOOTH uses a Becke-like fuzzy-cell partition on the native grid and creates "// &
1536 "weighted atom rows. Internal atom-grid weights vanish through a smooth taper "// &
1537 "when sparse rows reach the partition cutoff. Analytical atom forces and stress "// &
1538 "include both the partition and taper derivatives in the SKALA feature response.", &
1539 usage="NATIVE_GRID_ATOM_PARTITION SMOOTH", &
1540 enum_c_vals=s2a("HARD", "SMOOTH"), &
1541 enum_i_vals=[1, 2], &
1542 enum_desc=s2a("Assign each grid point to the nearest atom", &
1543 "Use a smooth Becke-like native-grid atom partition"), &
1544 default_i_val=2)
1545 CALL section_add_keyword(section, keyword)
1546 CALL keyword_release(keyword)
1547
1548 CALL keyword_create( &
1549 keyword, __location__, name="NATIVE_GRID_LAYOUT", &
1550 description="Select the numerical layout for native-grid Skala irrespective of the "// &
1551 "electronic core representation. ATOM_COMPOSITE, the default, evaluates complete "// &
1552 "atom-centered radial/Lebedev blocks. GPW and pseudopotential direct-valence fields "// &
1553 "are interpolated from CP2K's plane-wave grid; GAPW primitive fields are combined "// &
1554 "before nonlinear feature construction. The matching interpolation, partition, and "// &
1555 "one-center adjoints return VXC, forces, and stress to CP2K. Mixed all-electron and "// &
1556 "pseudopotential kinds use the same syntax and are reconstructed per kind. COMMON_GRID retains "// &
1557 "evaluation on CP2K's regular real-space grid as a cutoff-sensitive reference and "// &
1558 "diagnostic layout; mixed core representations require ATOM_COMPOSITE.", &
1559 usage="NATIVE_GRID_LAYOUT ATOM_COMPOSITE", &
1560 enum_c_vals=s2a("COMMON_GRID", "ATOM_COMPOSITE"), &
1562 enum_desc=s2a("Evaluate on the common regular real-space grid", &
1563 "Use image-partitioned atom-centered grids"), &
1564 default_i_val=skala_gapw_atom_composite_grid)
1565 CALL section_add_keyword(section, keyword)
1566 CALL keyword_release(keyword)
1567
1568 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_DENSITY_PARTITION", &
1569 description="Hard/soft one-center primitive-field contribution used by "// &
1570 "METHOD GAPW and METHOD GAPW_XC. With PAW_ONE_CENTER, HARD_MINUS_SOFT "// &
1571 "combines smooth, hard, and soft density, gradient, and kinetic-energy-density "// &
1572 "fields before a single nonlinear SKALA evaluation. It is the default. For "// &
1573 "pseudopotential PAW/one-center GAPW this is distinct from KIND%GPW_TYPE, "// &
1574 "which uses the regular-grid valence-density approximation. "// &
1575 "HARD_ONLY, SOFT_ONLY, and NONE are diagnostic variants.", &
1576 usage="NATIVE_GRID_GAPW_DENSITY_PARTITION HARD_MINUS_SOFT", &
1577 enum_c_vals=s2a("HARD_MINUS_SOFT", "HARD_ONLY", "SOFT_ONLY", "NONE"), &
1578 enum_i_vals=[1, 2, 3, 4], &
1579 enum_desc=s2a("Use the hard-minus-soft GAPW one-center correction", &
1580 "Use only the hard one-center density", &
1581 "Use only the soft one-center density with the GAPW sign", &
1582 "Disable the GAPW one-center SKALA correction"), &
1583 default_i_val=1)
1584 CALL section_add_keyword(section, keyword)
1585 CALL keyword_release(keyword)
1586
1587 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_COMPOSITE_REFERENCE", &
1588 description="Evaluate native-grid SKALA for METHOD GAPW or GAPW_XC on "// &
1589 "rho and tau reconstructed as smooth plus hard-minus-soft before nonlinear "// &
1590 "feature construction on one common regular grid. No separate one-center "// &
1591 "SKALA energy is added. This expensive, cutoff-sensitive diagnostic is "// &
1592 "intended to validate the nonlinear hard/soft cross terms.", &
1593 usage="NATIVE_GRID_GAPW_COMPOSITE_REFERENCE T", &
1594 default_l_val=.false., lone_keyword_l_val=.true.)
1595 CALL section_add_keyword(section, keyword)
1596 CALL keyword_release(keyword)
1597
1598 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_COMPOSITE_DIRECT_AO", &
1599 description="Use direct full-ORB rho and tau collocation for the native-grid "// &
1600 "GAPW composite diagnostic. This is the variational all-electron "// &
1601 "counterpart of the reconstructed smooth plus hard-minus-soft fields and "// &
1602 "provides a reference for their common-grid adjoint.", &
1603 usage="NATIVE_GRID_GAPW_COMPOSITE_DIRECT_AO T", &
1604 default_l_val=.false., lone_keyword_l_val=.true.)
1605 CALL section_add_keyword(section, keyword)
1606 CALL keyword_release(keyword)
1607
1608 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_ATOM_COMPOSITE_REFERENCE", &
1609 description="Replace the native smooth plus separate GAPW one-center SKALA "// &
1610 "terms by one atom-centered evaluation of smooth plus hard-minus-soft "// &
1611 "primitive fields before nonlinear feature construction. The smooth PW "// &
1612 "and one-center VXC adjoints are returned consistently. MPI ranks assemble "// &
1613 "the atom rows collectively; one communicator root evaluates the model and "// &
1614 "broadcasts the energy and feature adjoints.", &
1615 usage="NATIVE_GRID_GAPW_ATOM_COMPOSITE_REFERENCE T", &
1616 default_l_val=.false., lone_keyword_l_val=.true.)
1617 CALL section_add_keyword(section, keyword)
1618 CALL keyword_release(keyword)
1619
1620 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_ATOM_COMPOSITE_DIAGNOSTIC", &
1621 description="Evaluate an energy-only GAPW diagnostic on the combined "// &
1622 "smooth plus one-center hard-minus-soft density before nonlinear SKALA "// &
1623 "feature construction. The smooth native-grid density is interpolated to "// &
1624 "the atom-centered GAPW quadrature and all atomic grids are evaluated in "// &
1625 "one model call. This single-rank diagnostic does not replace the active "// &
1626 "XC energy or potential.", &
1627 usage="NATIVE_GRID_GAPW_ATOM_COMPOSITE_DIAGNOSTIC T", &
1628 default_l_val=.false., lone_keyword_l_val=.true.)
1629 CALL section_add_keyword(section, keyword)
1630 CALL keyword_release(keyword)
1631
1632 CALL keyword_create(keyword, __location__, &
1633 name="NATIVE_GRID_GAPW_ATOM_COMPOSITE_COMPONENTS", &
1634 description="Select which one-center hard-minus-soft fields enter the "// &
1635 "atom-composite SKALA diagnostic. FULL combines rho, gradient, and tau; "// &
1636 "RHO_GRAD and TAU isolate the corresponding reconstruction; SMOOTH "// &
1637 "uses only interpolated smooth fields.", &
1638 usage="NATIVE_GRID_GAPW_ATOM_COMPOSITE_COMPONENTS FULL", &
1639 enum_c_vals=s2a("FULL", "RHO_GRAD", "TAU", "SMOOTH"), &
1640 enum_i_vals=[1, 2, 3, 4], &
1641 enum_desc=s2a("Combine rho, gradient, and tau corrections", &
1642 "Combine only rho and gradient corrections", &
1643 "Combine only the tau correction", &
1644 "Use only interpolated smooth fields"), &
1645 default_i_val=1)
1646 CALL section_add_keyword(section, keyword)
1647 CALL keyword_release(keyword)
1648
1649 CALL keyword_create(keyword, __location__, &
1650 name="NATIVE_GRID_GAPW_ATOM_COMPOSITE_FD_STEP", &
1651 description="Central finite-difference step used by the atom-composite "// &
1652 "feature-VXC diagnostic.", &
1653 usage="NATIVE_GRID_GAPW_ATOM_COMPOSITE_FD_STEP 3.0E-3", &
1654 default_r_val=3.0e-3_dp)
1655 CALL section_add_keyword(section, keyword)
1656 CALL keyword_release(keyword)
1657
1658 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_ATOM_CHUNKS", &
1659 description="Split the experimental CP2K-native SKALA GPW TorchScript "// &
1660 "evaluation into contiguous atom blocks. MPI runs evaluate one atom block per "// &
1661 "rank, while single-rank runs can still use atom subchunks to reduce peak CUDA "// &
1662 "memory. Dynamic feature rows and VXC gradients are routed between their "// &
1663 "local grid and atom-block owner ranks. This is enabled by default; set it to "// &
1664 "false to retain the replicated global feature block. ATOM_COMPOSITE also "// &
1665 "subchunks energy, VXC, force, and stress evaluations along independent atomic "// &
1666 "blocks; COMMON_GRID analytical force and stress runs retain the full "// &
1667 "differentiable tensor graph.", &
1668 usage="NATIVE_GRID_ATOM_CHUNKS T", &
1669 default_l_val=.true., lone_keyword_l_val=.true.)
1670 CALL section_add_keyword(section, keyword)
1671 CALL keyword_release(keyword)
1672
1673 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_ATOM_CHUNK_ROUTING", &
1674 description="Compatibility alias for the routed experimental CP2K-native "// &
1675 "SKALA GPW atom chunks. This implies NATIVE_GRID_ATOM_CHUNKS.", &
1676 usage="NATIVE_GRID_ATOM_CHUNK_ROUTING T", &
1677 default_l_val=.false., lone_keyword_l_val=.true.)
1678 CALL section_add_keyword(section, keyword)
1679 CALL keyword_release(keyword)
1680
1681 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_ATOM_CHUNK_MAX_ROWS", &
1682 description="Maximum number of atom-grid rows evaluated by one TorchScript "// &
1683 "call in the experimental CP2K-native SKALA GPW atom-chunk path. A positive "// &
1684 "value splits each rank-local atom chunk into contiguous atom subchunks "// &
1685 "whose padded Torch row count stays below the limit. Atomic blocks are not "// &
1686 "divided, so one block can exceed the requested limit. Zero disables "// &
1687 "subchunking; -1 selects an automatic padded-row cap.", &
1688 usage="NATIVE_GRID_ATOM_CHUNK_MAX_ROWS 250000", &
1689 default_i_val=-1)
1690 CALL section_add_keyword(section, keyword)
1691 CALL keyword_release(keyword)
1692
1693 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_DIAGNOSTICS", &
1694 description="Print diagnostic integrals of the CP2K-native SKALA GPW feature "// &
1695 "block, including electron count, spin moment, and summed grid weights.", &
1696 usage="NATIVE_GRID_DIAGNOSTICS T", &
1697 default_l_val=.false., lone_keyword_l_val=.true.)
1698 CALL section_add_keyword(section, keyword)
1699 CALL keyword_release(keyword)
1700
1701 CALL keyword_create(keyword, __location__, name="MOLECULAR_VIRIAL", &
1702 description="Print a molecular XC virial diagnostic computed from GauXC "// &
1703 "nuclear gradients. This is not an analytical periodic stress tensor.", &
1704 usage="MOLECULAR_VIRIAL T", &
1705 default_l_val=.false., lone_keyword_l_val=.true.)
1706 CALL section_add_keyword(section, keyword)
1707 CALL keyword_release(keyword)
1708
1709 CALL keyword_create(keyword, __location__, name="MOLECULAR_VIRIAL_DEBUG", &
1710 description="Check the GauXC molecular XC virial diagnostic against a "// &
1711 "finite-difference affine scaling of the molecular coordinates.", &
1712 usage="MOLECULAR_VIRIAL_DEBUG T", &
1713 default_l_val=.false., lone_keyword_l_val=.true.)
1714 CALL section_add_keyword(section, keyword)
1715 CALL keyword_release(keyword)
1716
1717 CALL keyword_create(keyword, __location__, name="MOLECULAR_VIRIAL_DEBUG_DX", &
1718 description="Dimensionless finite-difference step for MOLECULAR_VIRIAL_DEBUG.", &
1719 usage="MOLECULAR_VIRIAL_DEBUG_DX 1.0E-4", &
1720 default_r_val=1.0e-4_dp)
1721 CALL section_add_keyword(section, keyword)
1722 CALL keyword_release(keyword)
1723
1724 CALL keyword_create(keyword, __location__, name="LB_EXECUTION_SPACE", &
1725 description="Execution space for load balancer in GauXC", &
1726 usage="LB_EXECUTION_SPACE host", &
1727 enum_c_vals=s2a("HOST", "DEVICE"), &
1728 enum_i_vals=[1, 2], &
1729 enum_desc=s2a("Run on host (default)", &
1730 "Run on device"), &
1731 default_i_val=1)
1732 CALL section_add_keyword(section, keyword)
1733 CALL keyword_release(keyword)
1734
1735 CALL keyword_create(keyword, __location__, name="INT_EXECUTION_SPACE", &
1736 description="Execution space for integrator in GauXC", &
1737 usage="INT_EXECUTION_SPACE host", &
1738 enum_c_vals=s2a("HOST", "DEVICE"), &
1739 enum_i_vals=[1, 2], &
1740 enum_desc=s2a("Run on host (default)", &
1741 "Run on device"), &
1742 default_i_val=1)
1743 CALL section_add_keyword(section, keyword)
1744 CALL keyword_release(keyword)
1745
1746 CALL keyword_create(keyword, __location__, name="LWD_KERNEL", &
1747 description="Local work driver kernel used by the GauXC integrator. "// &
1748 "AUTO uses SCHEME1-CUTLASS for device SKALA when GauXC provides it "// &
1749 "and otherwise uses GauXC's default for the selected execution space. "// &
1750 "DEFAULT always uses GauXC's default. "// &
1751 "Device builds with CUTLASS support can use SCHEME1-CUTLASS to run "// &
1752 "the grouped local potential update through CUTLASS.", &
1753 usage="LWD_KERNEL AUTO", &
1754 default_c_val="AUTO")
1755 CALL section_add_keyword(section, keyword)
1756 CALL keyword_release(keyword)
1757
1758 CALL keyword_create(keyword, __location__, name="SKALA_RUNTIME", &
1759 description="MPI communicator policy for GauXC Skala. AUTO uses "// &
1760 "the force-evaluation communicator for closed-shell calculations and a "// &
1761 "rank-local replicated runtime for open-shell calculations. MPI forces the "// &
1762 "force-evaluation communicator. SELF forces the previous replicated mode.", &
1763 usage="SKALA_RUNTIME AUTO", &
1764 enum_c_vals=s2a("AUTO", "MPI", "SELF"), &
1765 enum_i_vals=[1, 2, 3], &
1766 enum_desc=s2a("Closed-shell MPI, open-shell replicated (default)", &
1767 "Use the force-evaluation MPI communicator", &
1768 "Use rank-local replicated GauXC runtimes"), &
1769 default_i_val=1)
1770 CALL section_add_keyword(section, keyword)
1771 CALL keyword_release(keyword)
1772
1773 CALL keyword_create(keyword, __location__, name="MODEL_GRADIENT_RUNTIME", &
1774 description="MPI communicator policy for GauXC Skala nuclear gradients. "// &
1775 "AUTO uses distributed analytical gradients when the GauXC PR #222 fix is "// &
1776 "verified and energy/VXC uses MPI; otherwise it retains rank-local gradients. "// &
1777 "MPI requires verified support and an MPI energy/VXC runtime. SELF forces "// &
1778 "rank-local gradients. AUTO never overrides SKALA_RUNTIME's open-shell safeguard.", &
1779 usage="MODEL_GRADIENT_RUNTIME AUTO", &
1780 enum_c_vals=s2a("AUTO", "MPI", "SELF"), &
1781 enum_i_vals=[1, 2, 3], &
1782 enum_desc=s2a("Use verified MPI gradients or safe replicated fallback (default)", &
1783 "Use the force-evaluation MPI communicator when supported", &
1784 "Use rank-local replicated gradient runtimes"), &
1785 default_i_val=1)
1786 CALL section_add_keyword(section, keyword)
1787 CALL keyword_release(keyword)
1788
1789 CALL keyword_create(keyword, __location__, name="FORCE_NUMERICAL_GRADIENT", &
1790 description="Force central finite differences for the GauXC molecular XC "// &
1791 "nuclear gradient, using a displacement of 1.0E-4 bohr at fixed AO density. "// &
1792 "Diagnostic option; costs six XC energy evaluations per atom. Does not "// &
1793 "affect NATIVE_GRID or the CP2K one-center contribution.", &
1794 usage="FORCE_NUMERICAL_GRADIENT T", &
1795 default_l_val=.false., lone_keyword_l_val=.true.)
1796 CALL section_add_keyword(section, keyword)
1797 CALL keyword_release(keyword)
1798
1799 CALL keyword_create(keyword, __location__, name="OUTPUT_PATH", &
1800 description="Optional path to an existing directory for GauXC HDF5 debug output. "// &
1801 "If set, molecule and basis set data are written as separate HDF5 files.", &
1802 usage="OUTPUT_PATH /path/to/output", &
1803 default_c_val="")
1804 CALL section_add_keyword(section, keyword)
1805 CALL keyword_release(keyword)
1806
1807 END SUBROUTINE create_gauxc_section
1808
1809! **************************************************************************************************
1810!> \brief creates the input section for the xc part
1811!> \param section the section to create
1812!> \author fawzi
1813! **************************************************************************************************
1814 SUBROUTINE create_xc_section(section)
1815 TYPE(section_type), POINTER :: section
1816
1817 INTEGER :: default_libxc_backend
1818 TYPE(keyword_type), POINTER :: keyword
1819 TYPE(section_type), POINTER :: subsection
1820
1821 cpassert(.NOT. ASSOCIATED(section))
1822 CALL section_create(section, __location__, name="xc", &
1823 description="Parameters needed for the calculation of the eXchange and Correlation potential", &
1824 n_keywords=6, n_subsections=2, repeats=.false.)
1825
1826 NULLIFY (subsection, keyword)
1827
1828 CALL keyword_create(keyword, __location__, name="density_cutoff", &
1829 description="The cutoff on the density used by the xc calculation", &
1830 usage="density_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1831 CALL section_add_keyword(section, keyword)
1832 CALL keyword_release(keyword)
1833
1834 CALL keyword_create(keyword, __location__, name="gradient_cutoff", &
1835 description="The cutoff on the gradient of the density used by the "// &
1836 "xc calculation", &
1837 usage="gradient_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1838 CALL section_add_keyword(section, keyword)
1839 CALL keyword_release(keyword)
1840
1841 CALL keyword_create(keyword, __location__, name="DENSITY_SMOOTH_CUTOFF_RANGE", &
1842 description="Parameter for the smoothing procedure in xc calculation", &
1843 usage="DENSITY_SMOOTH_CUTOFF_RANGE {real}", default_r_val=0.0_dp)
1844 CALL section_add_keyword(section, keyword)
1845 CALL keyword_release(keyword)
1846
1847 CALL keyword_create(keyword, __location__, name="tau_cutoff", &
1848 description="The cutoff on tau used by the xc calculation", &
1849 usage="tau_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1850 CALL section_add_keyword(section, keyword)
1851 CALL keyword_release(keyword)
1852
1853 ! The GPU backend is the default on builds with a device path; HOST is the
1854 ! only option without one, and DEVICE aborts when no GPU is usable.
1855#if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_LIBXC)
1856 default_libxc_backend = do_libxc_gpu
1857#else
1858 default_libxc_backend = do_libxc_cpu
1859#endif
1860 CALL keyword_create(keyword, __location__, name="LIBXC_GPU_BACKEND", &
1861 description="Runtime device/host backend selection for LibXC. "// &
1862 "DEVICE selects the GPU backend (the default on GPU "// &
1863 "builds), HOST the CPU backend. DEVICE is an error "// &
1864 "(abort) when no usable GPU is found at runtime; HOST "// &
1865 "always runs.", &
1866 usage="LIBXC_GPU_BACKEND HOST", &
1867 default_i_val=default_libxc_backend, &
1868 enum_i_vals=[do_libxc_gpu, do_libxc_cpu], &
1869 enum_c_vals=s2a("DEVICE", "HOST"), &
1870 enum_desc=s2a("LibXC GPU backend", "LibXC CPU backend"))
1871 CALL section_add_keyword(section, keyword)
1872 CALL keyword_release(keyword)
1873
1874 CALL section_create(subsection, __location__, name="xc_grid", & !FM to do
1875 description="The xc parameters used when calculating the xc on the grid", &
1876 n_keywords=6, n_subsections=0, repeats=.false.)
1877 CALL keyword_create(keyword, __location__, name="xc_smooth_rho", &
1878 description="The density smoothing used for the xc calculation", &
1879 usage="xc_smooth_rho nn10", default_i_val=xc_rho_no_smooth, &
1880 enum_c_vals=s2a("NONE", "NN50", "NN10", "SPLINE2", "NN6", "SPLINE3", "NN4"), &
1881 enum_i_vals=[xc_rho_no_smooth, xc_rho_nn50, xc_rho_nn10, &
1884 CALL section_add_keyword(subsection, keyword)
1885 CALL keyword_release(keyword)
1886
1887 CALL keyword_create(keyword, __location__, name="xc_deriv", &
1888 description="The method used to compute the derivatives", &
1889 usage="xc_deriv NN10_SMOOTH", default_i_val=xc_deriv_pw, &
1890 enum_c_vals=s2a("PW", "SPLINE3", "SPLINE2", "NN50_SMOOTH", "NN10_SMOOTH", &
1891 "SPLINE2_SMOOTH", "NN6_SMOOTH", "SPLINE3_SMOOTH", "NN4_SMOOTH", "COLLOCATE"), &
1896 CALL section_add_keyword(subsection, keyword)
1897 CALL keyword_release(keyword)
1898
1899 CALL keyword_create(keyword, __location__, name="use_finer_grid", &
1900 description="Uses a finer grid only to calculate the xc", &
1901 usage="use_finer_grid", default_l_val=.false., &
1902 lone_keyword_l_val=.true.)
1903 CALL section_add_keyword(subsection, keyword)
1904 CALL keyword_release(keyword)
1905
1906 CALL keyword_create(keyword, __location__, name="fine_grid_factor", &
1907 description="Factor by which the XC grid cutoff is increased when USE_FINER_GRID is active. "// &
1908 "This setting has no effect unless USE_FINER_GRID is enabled. The default of 4.0 preserves "// &
1909 "the historical finer XC grid. Smaller factors can reduce the finer-grid cost, but should "// &
1910 "be checked together with the regular MGRID cutoff convergence.", &
1911 usage="FINE_GRID_FACTOR 4.0", default_r_val=4.0_dp, &
1912 variants=["FINE_XC_FACTOR"])
1913 CALL section_add_keyword(subsection, keyword)
1914 CALL keyword_release(keyword)
1915
1916 CALL keyword_create(keyword, __location__, name="2ND_DERIV_ANALYTICAL", &
1917 description="Use analytical formulas or finite differences for 2nd derivatives of XC", &
1918 usage="2ND_DERIV_ANALYTICAL logical", default_l_val=.true., &
1919 lone_keyword_l_val=.true.)
1920 CALL section_add_keyword(section, keyword)
1921 CALL keyword_release(keyword)
1922
1923 CALL keyword_create(keyword, __location__, name="3RD_DERIV_ANALYTICAL", &
1924 description="Use analytical formulas or finite differences for 3rd derivatives of XC", &
1925 usage="3RD_DERIV_ANALYTICAL logical", default_l_val=.false., &
1926 lone_keyword_l_val=.true.)
1927 CALL section_add_keyword(section, keyword)
1928 CALL keyword_release(keyword)
1929
1930 CALL keyword_create(keyword, __location__, name="STEP_SIZE", &
1931 description="Step size in terms of the first order potential for the numerical "// &
1932 "evaluation of XC derivatives", &
1933 usage="STEP_SIZE 1.0E-3", default_r_val=1e-3_dp)
1934 CALL section_add_keyword(section, keyword)
1935 CALL keyword_release(keyword)
1936
1937 CALL keyword_create(keyword, __location__, name="NSTEPS", &
1938 description="Number of steps to consider in each direction for the numerical "// &
1939 "evaluation of XC derivatives. Must be a value from 1 to 4 (Default: 3).", &
1940 usage="NSTEPS 4", default_i_val=3)
1941 CALL section_add_keyword(section, keyword)
1942 CALL keyword_release(keyword)
1943
1944 CALL section_add_subsection(section, subsection)
1945 CALL section_release(subsection)
1946
1947 CALL create_xc_fun_section(subsection)
1948 CALL section_add_subsection(section, subsection)
1949 CALL section_release(subsection)
1950
1951 CALL create_hfx_section(subsection)
1952 CALL section_add_subsection(section, subsection)
1953 CALL section_release(subsection)
1954
1955 CALL create_mp2_section(subsection)
1956 CALL section_add_subsection(section, subsection)
1957 CALL section_release(subsection)
1958
1959 CALL create_adiabatic_section(subsection)
1960 CALL section_add_subsection(section, subsection)
1961 CALL section_release(subsection)
1962
1963 CALL create_xc_potential_section(subsection)
1964 CALL section_add_subsection(section, subsection)
1965 CALL section_release(subsection)
1966
1967 CALL create_xc_kernel_section(subsection)
1968 CALL section_add_subsection(section, subsection)
1969 CALL section_release(subsection)
1970
1971 CALL create_hfx_kernel_section(subsection)
1972 CALL section_add_subsection(section, subsection)
1973 CALL section_release(subsection)
1974
1975 CALL create_vdw_potential_section(subsection)
1976 CALL section_add_subsection(section, subsection)
1977 CALL section_release(subsection)
1978
1979 CALL create_gcp_potential_section(subsection)
1980 CALL section_add_subsection(section, subsection)
1981 CALL section_release(subsection)
1982
1983 END SUBROUTINE create_xc_section
1984
1985! **************************************************************************************************
1986!> \brief creates the section for adiabatic hybrid functionals
1987!> \param section ...
1988!> \author Manuel Guidon
1989! **************************************************************************************************
1990 SUBROUTINE create_adiabatic_section(section)
1991 TYPE(section_type), POINTER :: section
1992
1993 TYPE(keyword_type), POINTER :: keyword
1994
1995 cpassert(.NOT. ASSOCIATED(section))
1996 CALL section_create(section, __location__, name="ADIABATIC_RESCALING", &
1997 description="Parameters for self interaction corrected hybrid functionals", &
1998 n_keywords=0, n_subsections=0, repeats=.false.)
1999 NULLIFY (keyword)
2000 CALL keyword_create( &
2001 keyword, __location__, &
2002 name="FUNCTIONAL_TYPE", &
2003 description="Which Hybrid functional should be used. "// &
2004 "(Has to be consistent with the definitions in XC and HF).", &
2005 usage="FUNCTIONAL_TYPE MCY3", &
2006 enum_c_vals=s2a("MCY3"), &
2007 enum_i_vals=[do_adiabatic_hybrid_mcy3], &
2008 enum_desc=s2a("Use MCY3 hybrid functional"), &
2009 default_i_val=do_adiabatic_hybrid_mcy3)
2010 CALL section_add_keyword(section, keyword)
2011 CALL keyword_release(keyword)
2012
2013 NULLIFY (keyword)
2014 CALL keyword_create( &
2015 keyword, __location__, &
2016 name="LAMBDA", &
2017 description="The point to be used along the adiabatic curve (0 &lt; &lambda; &lt; 1)", &
2018 usage="LAMBDA 0.71", &
2019 default_r_val=0.71_dp)
2020 CALL section_add_keyword(section, keyword)
2021 CALL keyword_release(keyword)
2022
2023 NULLIFY (keyword)
2024 CALL keyword_create( &
2025 keyword, __location__, &
2026 name="OMEGA", &
2027 description="Long-range parameter", &
2028 usage="OMEGA 0.2", &
2029 default_r_val=0.2_dp)
2030 CALL section_add_keyword(section, keyword)
2031 CALL keyword_release(keyword)
2032
2033 NULLIFY (keyword)
2034 CALL keyword_create( &
2035 keyword, __location__, &
2036 name="FUNCTIONAL_MODEL", &
2037 description="Which model for the coupling constant integration should be used. ", &
2038 usage="FUNCTIONAL_MODEL PADE", &
2039 enum_c_vals=s2a("PADE"), &
2040 enum_i_vals=[do_adiabatic_model_pade], &
2041 enum_desc=s2a("Use pade model: W(lambda)=a+(b*lambda)/(1+c*lambda)"), &
2042 default_i_val=do_adiabatic_model_pade)
2043 CALL section_add_keyword(section, keyword)
2044 CALL keyword_release(keyword)
2045 END SUBROUTINE create_adiabatic_section
2046
2047END MODULE input_cp2k_xc
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public goedecker1996
integer, save, public chai2008
integer, save, public perdew1996
integer, save, public proynov2007
integer, save, public heyd2004
integer, save, public wellendorff2012
integer, save, public caldeweyher2020
integer, save, public grimme2006
integer, save, public becke1997
integer, save, public perdew2008
integer, save, public vosko1980
integer, save, public beckeroussel1989
integer, save, public perdew1981
integer, save, public tao2003
integer, save, public tran2013
integer, save, public ortiz1994
integer, save, public lee1988
integer, save, public grimme2011
integer, save, public kruse2012
integer, save, public grimme2010
integer, save, public becke1988
integer, save, public zhang1998
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str, do_backup)
creates a print_key section
integer, parameter, public high_print_level
integer, parameter, public add_last_numeric
Input definition and setup for EEQ model.
Definition eeq_input.F:12
subroutine, public create_eeq_control_section(section)
...
Definition eeq_input.F:51
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public xc_funct_tpss
integer, parameter, public xc_funct_bp
integer, parameter, public xc_funct_olyp
integer, parameter, public vdw_nl_rvv10
integer, parameter, public xc_vdw_fun_none
integer, parameter, public xc_funct_pbe
integer, parameter, public fxc_funct_pade
integer, parameter, public fxc_funct_gga
integer, parameter, public vdw_pairpot_dftd3
integer, parameter, public xc_funct_no_shortcut
integer, parameter, public do_adiabatic_hybrid_mcy3
integer, parameter, public do_libxc_gpu
integer, parameter, public xc_vdw_fun_nonloc
integer, parameter, public vdw_pairpot_dftd2chg
integer, parameter, public xc_funct_pbe0
integer, parameter, public fxc_none
integer, parameter, public vdw_pairpot_dftd4
integer, parameter, public xc_funct_beefvdw
integer, parameter, public xc_funct_pade
integer, parameter, public xc_funct_blyp
integer, parameter, public vdw_nl_drsll
integer, parameter, public xc_pot_energy_xc_functional
integer, parameter, public xc_pot_energy_none
integer, parameter, public do_adiabatic_model_pade
integer, parameter, public xc_pot_energy_sum_eigenvalues
integer, parameter, public vdw_nl_lmkll
integer, parameter, public gaussian
integer, parameter, public vdw_pairpot_dftd2
integer, parameter, public fxc_funct_lda
integer, parameter, public do_libxc_cpu
integer, parameter, public xc_vdw_fun_pairpot
integer, parameter, public xc_funct_b3lyp
integer, parameter, public xc_none
integer, parameter, public vdw_pairpot_dftd3bj
integer, parameter, public xc_funct_hcth120
integer, parameter, public slater
function that builds the hartree fock exchange section of the input
subroutine, public create_hfx_section(section)
creates the input section for the hf part
input section for MP2
subroutine, public create_mp2_section(section)
creates the input section for the mp2 part
function that build the xc section of the input
subroutine, public create_xc_section(section)
creates the input section for the xc part
subroutine, public create_xc_fun_section(section)
creates the structure of the section needed to select the xc functional
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 real_t
integer, parameter, public char_t
integer, parameter, public integer_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Utilities for string manipulations.
input constants for xc
integer, parameter, public xc_deriv_spline2_smooth
integer, parameter, public xc_rho_spline2_smooth
integer, parameter, public c_pw92
integer, parameter, public ke_ol1
integer, parameter, public xc_deriv_collocate
integer, parameter, public ke_ol2
integer, parameter, public xc_rho_spline3_smooth
integer, parameter, public xc_deriv_nn10_smooth
integer, parameter, public skala_gapw_atom_composite_grid
integer, parameter, public xc_pbe_orig
integer, parameter, public xc_deriv_pw
integer, parameter, public xc_pbe_rev
integer, parameter, public xgga_opt
integer, parameter, public xc_b97_mardirossian
integer, parameter, public xc_b97_orig
integer, parameter, public do_vwn5
integer, parameter, public xgga_revpbe
integer, parameter, public ke_pw91
integer, parameter, public ke_pbe
integer, parameter, public skala_gapw_direct_valence
integer, parameter, public skala_gapw_paw_one_center
integer, parameter, public xgga_pw86
integer, parameter, public c_pz
integer, parameter, public c_pw92vmc
integer, parameter, public xc_deriv_spline2
integer, parameter, public pz_orig
integer, parameter, public xc_rho_nn10
integer, parameter, public ke_pw86
integer, parameter, public xgga_pw91
integer, parameter, public xc_deriv_nn50_smooth
integer, parameter, public xc_b97_grimme
integer, parameter, public xc_deriv_spline3
integer, parameter, public c_pzvmc
integer, parameter, public skala_gapw_common_grid
integer, parameter, public xc_pbe_sol
integer, parameter, public xc_rho_nn50
integer, parameter, public ke_lc
integer, parameter, public xgga_ev93
integer, parameter, public xalpha
integer, parameter, public ke_llp
integer, parameter, public xc_deriv_spline3_smooth
integer, parameter, public skala_gapw_cp2k_default
integer, parameter, public xc_b97_3c
integer, parameter, public ke_t92
integer, parameter, public xgga_pbex
integer, parameter, public c_pw92dmc
integer, parameter, public skala_gapw_paw_one_center_split
integer, parameter, public do_vwn3
integer, parameter, public xgga_b88x
integer, parameter, public c_pzdmc
integer, parameter, public xc_rho_no_smooth
calculates a functional from libxc and its derivatives
Definition xc_libxc.F:29
subroutine, public libxc_add_sections(section)
...
Definition xc_libxc.F:267
represent a keyword in the input
represent a section of the input file