(git:c641773)
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 correction using external library entirely. "// &
1034 "Switch off to use native reimplementation in CP2K. Note that the "// &
1035 "external library is always needed no matter if this option is "// &
1036 "triggered or not.", &
1037 usage="D4_REFERENCE_CODE", default_l_val=.true., &
1038 lone_keyword_l_val=.true.)
1039 CALL section_add_keyword(subsection, keyword)
1040 CALL keyword_release(keyword)
1041 CALL keyword_create(keyword, __location__, name="D4_DEBUG", &
1042 description="Debug output for D4 method using reference code; "// &
1043 "requires D4_REFERENCE_CODE F to work and VERBOSE_OUTPUT T to "// &
1044 "show the debugging result.", &
1045 usage="D4_DEBUG", default_l_val=.false., &
1046 lone_keyword_l_val=.true.)
1047 CALL section_add_keyword(subsection, keyword)
1048 CALL keyword_release(keyword)
1049 CALL keyword_create(keyword, __location__, name="D3_REFERENCE_CODE", &
1050 description="Use D3 damping parameters from s-dftd3 library instead of built-in values. "// &
1051 "Requires s-dftd3 library to be compiled in.", &
1052 usage="D3_REFERENCE_CODE", default_l_val=.false., &
1053 lone_keyword_l_val=.true.)
1054 CALL section_add_keyword(subsection, keyword)
1055 CALL keyword_release(keyword)
1056 CALL keyword_create(keyword, __location__, name="D2_SCALING", &
1057 variants=["SCALING"], &
1058 description="XC Functional dependent scaling parameter. If omitted, CP2K attempts"// &
1059 " to guess the xc functional that is in use and sets the associated scaling parameter.", &
1060 usage="SCALING 0.2", default_r_val=0._dp)
1061 CALL section_add_keyword(subsection, keyword)
1062 CALL keyword_release(keyword)
1063 CALL keyword_create(keyword, __location__, name="D2_EXP_PRE", &
1064 variants=["EXP_PRE"], &
1065 description="Prefactor in exponential damping factor (DFT-D2 potential). "// &
1066 "Not applicable to DFTD2(CHG).", &
1067 usage="D2_EXP_PRE 20.", default_r_val=20._dp)
1068 CALL section_add_keyword(subsection, keyword)
1069 CALL keyword_release(keyword)
1070 CALL keyword_create(keyword, __location__, name="EPS_CN", &
1071 description="Cutoff value for coordination number function (DFT-D3 method)", &
1072 usage="EPS_CN 1.e-6_dp", default_r_val=1.e-6_dp)
1073 CALL section_add_keyword(subsection, keyword)
1074 CALL keyword_release(keyword)
1075 CALL keyword_create(keyword, __location__, name="D3_SCALING", &
1076 description="XC Functional dependent scaling parameters (s6,sr6,s8) for the DFT-D3 method."// &
1077 " If omitted, CP2K attempts"// &
1078 " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1079 usage="D3_SCALING 1.0 1.0 1.0", n_var=3, &
1080 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp])
1081 CALL section_add_keyword(subsection, keyword)
1082 CALL keyword_release(keyword)
1083 CALL keyword_create(keyword, __location__, name="D3BJ_SCALING", &
1084 description="XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D3(BJ) method."// &
1085 " If omitted, CP2K attempts"// &
1086 " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1087 usage="D3BJ_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
1088 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1089 CALL section_add_keyword(subsection, keyword)
1090 CALL keyword_release(keyword)
1091 CALL keyword_create(keyword, __location__, name="D4_SCALING", &
1092 description="XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D4 method."// &
1093 " If omitted, CP2K attempts"// &
1094 " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1095 usage="D4_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
1096 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1097 CALL section_add_keyword(subsection, keyword)
1098 CALL keyword_release(keyword)
1099 CALL keyword_create(keyword, __location__, name="CALCULATE_C9_TERM", &
1100 description="Calculate C9 terms in DFT-D3 model", &
1101 usage="CALCULATE_C9_TERM", default_l_val=.false., &
1102 lone_keyword_l_val=.true.)
1103 CALL section_add_keyword(subsection, keyword)
1104 CALL keyword_release(keyword)
1105 CALL keyword_create(keyword, __location__, name="REFERENCE_C9_TERM", &
1106 description="Calculate C9 terms in DFT-D3 model using reference coordination numbers", &
1107 usage="REFERENCE_C9_TERM", default_l_val=.false., &
1108 lone_keyword_l_val=.true.)
1109 CALL section_add_keyword(subsection, keyword)
1110 CALL keyword_release(keyword)
1111 CALL keyword_create(keyword, __location__, name="FACTOR_S9_TERM", &
1112 description="S9 prefactor of the many-body term in the DFT-D4 method.", &
1113 usage="FACTOR_S9_TERM 1.e-0", default_r_val=1.00_dp)
1114 CALL section_add_keyword(subsection, keyword)
1115 CALL keyword_release(keyword)
1116 CALL keyword_create(keyword, __location__, name="LONG_RANGE_CORRECTION", &
1117 description="Calculate a long range correction to the DFT-D3 model."// &
1118 " WARNING: Use with care! Only for isotropic dense systems.", &
1119 usage="LONG_RANGE_CORRECTION", default_l_val=.false., &
1120 lone_keyword_l_val=.true.)
1121 CALL section_add_keyword(subsection, keyword)
1122 CALL keyword_release(keyword)
1123 CALL keyword_create(keyword, __location__, name="SHORT_RANGE_CORRECTION", &
1124 description="Calculate a short-range bond correction to the DFT-D3 model", &
1125 usage="SHORT_RANGE_CORRECTION", default_l_val=.false., &
1126 lone_keyword_l_val=.true.)
1127 CALL section_add_keyword(subsection, keyword)
1128 CALL keyword_release(keyword)
1129 CALL keyword_create(keyword, __location__, name="SHORT_RANGE_CORRECTION_PARAMETERS", &
1130 description="Parameters for the short-range bond correction to the DFT-D3 model. "// &
1131 "s*(za*zb)^t1*EXP(-g*dr*r0ab^t2), parameters: s, g, t1, t2 "// &
1132 "Defaults: s=0.08, g=10.0, t1=0.5, t2=-1.0 ", &
1133 usage="SHORT_RANGE_CORRECTION_PARAMETERS", default_r_vals=[0.08_dp, 10.0_dp, 0.5_dp, -1.0_dp], &
1134 n_var=4, type_of_var=real_t)
1135 CALL section_add_keyword(subsection, keyword)
1136 CALL keyword_release(keyword)
1137 ! KG molecular corrections
1138 CALL keyword_create(keyword, __location__, name="MOLECULE_CORRECTION", &
1139 description="Calculate a intermolecular correction to the DFT-D3 model", &
1140 usage="MOLECULE_CORRECTION", default_l_val=.false., &
1141 lone_keyword_l_val=.true.)
1142 CALL section_add_keyword(subsection, keyword)
1143 CALL keyword_release(keyword)
1144 CALL keyword_create(keyword, __location__, name="MOLECULE_CORRECTION_C8", &
1145 description="Calculate a intermolecular correction to the C8 term in the DFT-D3 model", &
1146 usage="MOLECULE_CORRECTION_C8 1.0 ", default_r_val=0.0_dp)
1147 CALL section_add_keyword(subsection, keyword)
1148 CALL keyword_release(keyword)
1149 CALL keyword_create(keyword, __location__, name="VERBOSE_OUTPUT", &
1150 description="Extensive output for the DFT-D2 and DFT-D3 models."// &
1151 " Needs PRINT_DFTD section to be specified.", &
1152 usage="VERBOSE_OUTPUT", default_l_val=.false., &
1153 lone_keyword_l_val=.true.)
1154 CALL section_add_keyword(subsection, keyword)
1155 CALL keyword_release(keyword)
1156
1157 ! Set coordination numbers by atom numbers
1158 CALL keyword_create(keyword, __location__, name="D3_EXCLUDE_KIND", &
1159 description="Specifies the atomic kinds excluded in the DFT-D3 calculation.", &
1160 usage="D3_EXCLUDE_KIND kind1 kind2 ... ", repeats=.false., &
1161 n_var=-1, type_of_var=integer_t)
1162 CALL section_add_keyword(subsection, keyword)
1163 CALL keyword_release(keyword)
1164
1165 ! Ignore selected pair interactins
1166 CALL keyword_create(keyword, __location__, name="D3_EXCLUDE_KIND_PAIR", &
1167 description="Specifies the atomic kinds for interactions excluded from the DFT-D3 calculation.", &
1168 usage="D3_EXCLUDE_KIND_PAIR kind1 kind2 ", repeats=.true., &
1169 n_var=2, type_of_var=integer_t)
1170 CALL section_add_keyword(subsection, keyword)
1171 CALL keyword_release(keyword)
1172
1173 ! Set coordination numbers by atom kinds
1174 CALL keyword_create(keyword, __location__, name="KIND_COORDINATION_NUMBERS", &
1175 description="Specifies the coordination number for a kind for the C9 term in DFT-D3.", &
1176 usage="KIND_COORDINATION_NUMBERS CN kind ", repeats=.true., &
1177 n_var=-1, type_of_var=char_t)
1178 CALL section_add_keyword(subsection, keyword)
1179 CALL keyword_release(keyword)
1180 ! Set coordination numbers by atom numbers
1181 CALL keyword_create(keyword, __location__, name="ATOM_COORDINATION_NUMBERS", &
1182 description="Specifies the coordination number of a set of atoms for the C9 term in DFT-D3.", &
1183 usage="ATOM_COORDINATION_NUMBERS CN atom1 atom2 ... ", repeats=.true., &
1184 n_var=-1, type_of_var=char_t)
1185 CALL section_add_keyword(subsection, keyword)
1186 CALL keyword_release(keyword)
1187
1188 ! parameter specification atom by atom
1189 CALL keyword_create(keyword, __location__, name="ATOMPARM", &
1190 description="Specifies parameters for atom types (in atomic units). If "// &
1191 "not provided default parameters are used (DFT-D2).", &
1192 usage="ATOMPARM <ELEMENT> <C6_parameter> <vdw_radii>", &
1193 repeats=.true., n_var=-1, type_of_var=char_t)
1194 CALL section_add_keyword(subsection, keyword)
1195 CALL keyword_release(keyword)
1196
1197 NULLIFY (print_key)
1198 CALL cp_print_key_section_create(print_key, __location__, "PRINT_DFTD", &
1199 description="Controls the printing of some info about DFTD contributions", &
1200 print_level=high_print_level, add_last=add_last_numeric, filename="")
1201 CALL section_add_subsection(subsection, print_key)
1202 CALL section_release(print_key)
1203
1204 NULLIFY (newsection)
1205 CALL create_eeq_control_section(newsection)
1206 CALL section_add_subsection(subsection, newsection)
1207 CALL section_release(newsection)
1208
1209 CALL section_add_subsection(section, subsection)
1210 CALL section_release(subsection)
1211
1212 ! nonlocal section
1213 NULLIFY (subsection, keyword)
1214 CALL section_create(subsection, __location__, name="NON_LOCAL", &
1215 description="Information on the non local part of dispersion functionals. "// &
1216 "Correct functionals require a corresponding setting of XC_FUNCTIONAL.", &
1217 n_keywords=0, n_subsections=0, repeats=.true.)
1218
1219 CALL keyword_create(keyword, __location__, name="TYPE", &
1220 description="Type of functional (the corresponding kernel data file should be selected). "// &
1221 "Allows for common forms such as vdW-DF, vdW-DF2, optB88-vdW, rVV10.", &
1222 usage="TYPE DRSLL", &
1223 enum_c_vals=s2a("DRSLL", "LMKLL", "RVV10"), &
1224 enum_i_vals=[vdw_nl_drsll, vdw_nl_lmkll, vdw_nl_rvv10], &
1225 enum_desc=s2a("Dion-Rydberg-Schroeder-Langreth-Lundqvist nonlocal van der Waals density functional", &
1226 "Lee-Murray-Kong-Lundqvist-Langreth nonlocal van der Waals density functional", &
1227 "Revised Vydrov-van Voorhis nonlocal van der Waals density functional"), &
1228 citations=[tran2013], &
1229 default_i_val=vdw_nl_drsll)
1230 CALL section_add_keyword(subsection, keyword)
1231 CALL keyword_release(keyword)
1232 CALL keyword_create(keyword, __location__, name="VERBOSE_OUTPUT", &
1233 description="Extensive output for non local functionals", &
1234 usage="VERBOSE_OUTPUT", default_l_val=.false., &
1235 lone_keyword_l_val=.true.)
1236 CALL section_add_keyword(subsection, keyword)
1237 CALL keyword_release(keyword)
1238 CALL keyword_create(keyword, __location__, name="KERNEL_FILE_NAME", &
1239 description="Name of the kernel data file, may include a path. "// &
1240 "vdW_kernel_table.dat is for DRSLL and LMKLL and "// &
1241 "rVV10_kernel_table.dat is for rVV10.", &
1242 usage="KERNEL_FILE_NAME <FILENAME>", &
1243 default_lc_val="vdW_kernel_table.dat")
1244 CALL section_add_keyword(subsection, keyword)
1245 CALL keyword_release(keyword)
1246 CALL keyword_create(keyword, __location__, name="CUTOFF", &
1247 description="The cutoff of the FFT grid used in the calculation "// &
1248 "of the nonlocal vdW functional [Ry].", &
1249 usage="CUTOFF 300", &
1250 default_r_val=-1._dp, unit_str="Ry")
1251 CALL section_add_keyword(subsection, keyword)
1252 CALL keyword_release(keyword)
1253 CALL keyword_create(keyword, __location__, name="PARAMETERS", &
1254 description="Parameters b and C of the rVV10 functional", &
1255 usage="PARAMETERS 6.3 0.0093", &
1256 type_of_var=real_t, default_r_vals=[6.3_dp, 0.0093_dp], n_var=2)
1257 CALL section_add_keyword(subsection, keyword)
1258 CALL keyword_release(keyword)
1259 CALL keyword_create(keyword, __location__, name="SCALE", &
1260 description="Scales the energy contribution of the rVV10 functional", &
1261 usage="SCALE 1.0", &
1262 type_of_var=real_t, default_r_val=1.0_dp)
1263 CALL section_add_keyword(subsection, keyword)
1264 CALL keyword_release(keyword)
1265
1266 CALL section_add_subsection(section, subsection)
1267 CALL section_release(subsection)
1268
1269 END SUBROUTINE create_vdw_potential_section
1270
1271! **************************************************************************************************
1272!> \brief creates the structure of the section needed for gCP potentials
1273!> \param section the section that will be created
1274!> \author jgh
1275! **************************************************************************************************
1276 SUBROUTINE create_gcp_potential_section(section)
1277 TYPE(section_type), POINTER :: section
1278
1279 TYPE(keyword_type), POINTER :: keyword
1280
1281 cpassert(.NOT. ASSOCIATED(section))
1282 CALL section_create(section, __location__, name="gcp_potential", &
1283 description="This section combines geometrical counterpoise potentials."// &
1284 " This is a simple empirical pair potential to correct for BSSE. ", &
1285 citations=[kruse2012], &
1286 n_keywords=1, n_subsections=1, repeats=.false.)
1287
1288 NULLIFY (keyword)
1289 CALL keyword_create(keyword, __location__, name="PARAMETER_FILE_NAME", &
1290 description="Name of the parameter file, may include a path", &
1291 usage="PARAMETER_FILE_NAME <FILENAME>", &
1292 default_lc_val="---")
1293 CALL section_add_keyword(section, keyword)
1294 CALL keyword_release(keyword)
1295
1296 CALL keyword_create(keyword, __location__, name="GLOBAL_PARAMETERS", &
1297 description="Global parameters of the gCP method."// &
1298 " Parameters are sigma, alpha, beta, eta from the original paper.", &
1299 usage="GLOBAL_PARAMETERS 1.0 1.0 1.0 1.0", n_var=4, &
1300 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1301 CALL section_add_keyword(section, keyword)
1302 CALL keyword_release(keyword)
1303
1304 CALL keyword_create(keyword, __location__, name="DELTA_ENERGY", &
1305 description="Specify the delta energy [Hartree] term for an atom kind", &
1306 usage="DELTA_ENERGY type value", &
1307 type_of_var=char_t, repeats=.true., n_var=-1, default_c_vals=["XX ", "0.0"])
1308 CALL section_add_keyword(section, keyword)
1309 CALL keyword_release(keyword)
1310
1311 CALL keyword_create(keyword, __location__, name="VERBOSE", &
1312 description="Verbose output for gCP calculation", &
1313 usage="VERBOSE logical_value", &
1314 default_l_val=.true., lone_keyword_l_val=.true.)
1315 CALL section_add_keyword(section, keyword)
1316 CALL keyword_release(keyword)
1317
1318 END SUBROUTINE create_gcp_potential_section
1319
1320! **************************************************************************************************
1321!> \brief creates the structure of the GAUXC section
1322!> \param section the section that will be created
1323!> \author fawzi
1324! **************************************************************************************************
1325 SUBROUTINE create_gauxc_section(section)
1326 TYPE(section_type), POINTER :: section
1327
1328 TYPE(keyword_type), POINTER :: keyword
1329
1330 cpassert(.NOT. ASSOCIATED(section))
1331 CALL section_create(section, __location__, name="GAUXC", &
1332 description="Use exchange-correlation functionals provided by GauXC. "// &
1333 "The current CP2K bridge uses GauXC's molecular quadrature. Periodic inputs "// &
1334 "are limited to isolated validation cells and are not compact periodic "// &
1335 "material calculations.", &
1336 n_keywords=30, n_subsections=0, repeats=.false.)
1337
1338 NULLIFY (keyword)
1339
1340 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
1341 description="activates the functional", &
1342 lone_keyword_l_val=.true., default_l_val=.false.)
1343 CALL section_add_keyword(section, keyword)
1344 CALL keyword_release(keyword)
1345
1346 CALL keyword_create(keyword, __location__, name="FUNCTIONAL", &
1347 description="Functional name used to create the GauXC integrator. "// &
1348 "If MODEL is set, this optional base functional defaults to PBE and "// &
1349 "does not need to be specified for MODEL SKALA inputs.", &
1350 default_c_val="PBE")
1351 CALL section_add_keyword(section, keyword)
1352 CALL keyword_release(keyword)
1353
1354 CALL keyword_create(keyword, __location__, name="MODEL", &
1355 description="GauXC Skala model name or path. Use NONE for conventional GauXC. "// &
1356 "MODEL SKALA selects the installed Skala-1.1 model when available; "// &
1357 "other Skala models are supplied as .fun files or model names. "// &
1358 "NLCC pseudopotentials are rejected by the direct molecular GauXC "// &
1359 "Skala path. Pseudopotential GAPW PAW_ONE_CENTER and the CP2K-native "// &
1360 "SKALA grid path include NLCC in their reconstructed primitive fields.", &
1361 usage="MODEL SKALA", &
1362 default_c_val="NONE")
1363 CALL section_add_keyword(section, keyword)
1364 CALL keyword_release(keyword)
1365
1366 CALL keyword_create( &
1367 keyword, __location__, name="PSEUDOPOTENTIAL_GAPW_REPRESENTATION", &
1368 description="Select the density representation used by an active GauXC model for "// &
1369 "METHOD GAPW/GAPW_XC kinds with GTH or ECP pseudopotentials. "// &
1370 "DIRECT_VALENCE treats those kinds as GPW_TYPE and evaluates the model on "// &
1371 "the direct valence density; this is the default for non-local models such "// &
1372 "as Skala. PAW_ONE_CENTER combines the smooth and all hard-minus-soft "// &
1373 "one-center primitive fields before one model evaluation, retaining all 15 pairwise "// &
1374 "spin-gradient cross terms (14 additional to the smooth-density baseline) and the "// &
1375 "non-local couplings. PAW_ONE_CENTER_SPLIT is a diagnostic that evaluates smooth, hard, "// &
1376 "and soft fields separately. CP2K_DEFAULT retains the representation selected "// &
1377 "by KIND%GPW_TYPE, basis hardness, and DFT%QS%FORCE_PAW. All-electron kinds "// &
1378 "and conventional GauXC MODEL NONE calculations are unaffected. In a mixed "// &
1379 "all-electron/pseudopotential calculation, the selector applies per kind: "// &
1380 "all-electron kinds retain their one-center reconstruction while pseudopotential "// &
1381 "kinds follow the selected representation. No mixed-system-specific input is needed.", &
1382 usage="PSEUDOPOTENTIAL_GAPW_REPRESENTATION DIRECT_VALENCE", &
1383 enum_c_vals=s2a("DIRECT_VALENCE", "PAW_ONE_CENTER", "CP2K_DEFAULT", &
1384 "PAW_ONE_CENTER_SPLIT"), &
1387 enum_desc=s2a("Use the direct pseudopotential valence density", &
1388 "Reconstruct the GAPW primitive fields before model evaluation", &
1389 "Use the representation selected by the ordinary CP2K GAPW rules", &
1390 "Diagnose the separate smooth plus hard-minus-soft energy expression"), &
1391 default_i_val=skala_gapw_direct_valence)
1392 CALL section_add_keyword(section, keyword)
1393 CALL keyword_release(keyword)
1394
1395 CALL keyword_create(keyword, __location__, name="GRID", &
1396 description="Atomic grid size for GauXC. Skala defaults to SUPERFINE "// &
1397 "unless this keyword is set explicitly.", &
1398 usage="GRID fine", &
1399 enum_c_vals=s2a("FINE", "ULTRAFINE", "SUPERFINE", "GM3", "GM5"), &
1400 enum_i_vals=[1, 2, 3, 4, 5], &
1401 enum_desc=s2a("Fine grid (default)", &
1402 "Ultra fine grid", &
1403 "Super fine grid", &
1404 "GM3 grid", &
1405 "GM5 grid"), &
1406 default_i_val=1)
1407 CALL section_add_keyword(section, keyword)
1408 CALL keyword_release(keyword)
1409
1410 CALL keyword_create(keyword, __location__, name="RADIAL_QUADRATURE", &
1411 description="Radial quadrature scheme for GauXC", &
1412 usage="RADIAL_QUADRATURE muraknowles", &
1413 enum_c_vals=s2a("MURAKNOWLES", "BECKE", "TREUTLERAHLRICHS", "MURRAYHANDYLAMING"), &
1414 enum_i_vals=[1, 2, 3, 4], &
1415 enum_desc=s2a("Mura-Knowles radial quadrature (default)", &
1416 "Becke radial quadrature", &
1417 "Treutler-Ahlrichs radial quadrature", &
1418 "Murray-Handy-Laming radial quadrature"), &
1419 default_i_val=1)
1420 CALL section_add_keyword(section, keyword)
1421 CALL keyword_release(keyword)
1422
1423 CALL keyword_create(keyword, __location__, name="PRUNING_SCHEME", &
1424 description="Pruning scheme for GauXC. Skala defaults to UNPRUNED "// &
1425 "unless this keyword is set explicitly.", &
1426 usage="PRUNING_SCHEME robust", &
1427 enum_c_vals=s2a("ROBUST", "TREUTLER", "UNPRUNED"), &
1428 enum_i_vals=[1, 2, 3], &
1429 enum_desc=s2a("Robust pruning (default)", &
1430 "Treutler pruning", &
1431 "Unpruned grid"), &
1432 default_i_val=1)
1433 CALL section_add_keyword(section, keyword)
1434 CALL keyword_release(keyword)
1435
1436 CALL keyword_create(keyword, __location__, name="BATCH_SIZE", &
1437 description="Batch size for GauXC evaluation", &
1438 usage="BATCH_SIZE 512", &
1439 default_i_val=512)
1440 CALL section_add_keyword(section, keyword)
1441 CALL keyword_release(keyword)
1442
1443 CALL keyword_create(keyword, __location__, name="DEVICE_RUNTIME_FILL_FRACTION", &
1444 description="Fraction of currently available GPU memory preallocated by "// &
1445 "a GauXC device runtime. Lower values leave more memory for Skala "// &
1446 "Torch inference; this keyword is used only with LB_EXECUTION_SPACE DEVICE.", &
1447 usage="DEVICE_RUNTIME_FILL_FRACTION 0.1", &
1448 default_r_val=0.1_dp)
1449 CALL section_add_keyword(section, keyword)
1450 CALL keyword_release(keyword)
1451
1452 CALL keyword_create(keyword, __location__, name="MODEL_ATOM_CHUNK_SIZE", &
1453 description="Atom chunk size for GauXC Skala Torch inference. "// &
1454 "A positive value evaluates the Torch model atom block by atom block; "// &
1455 "zero disables chunking; the default leaves GauXC's model-specific policy "// &
1456 "or the GAUXC_ONEDFT_ATOM_CHUNK_SIZE environment variable in control.", &
1457 usage="MODEL_ATOM_CHUNK_SIZE 3", &
1458 default_i_val=-1)
1459 CALL section_add_keyword(section, keyword)
1460 CALL keyword_release(keyword)
1461
1462 CALL keyword_create(keyword, __location__, name="PERIODIC_REFERENCE", &
1463 description="Explicitly opt into the limited isolated-cell GauXC reference "// &
1464 "path for periodic CP2K inputs. This path is restricted to Gamma-only, "// &
1465 "single-image METHOD GPW calculations with GTH pseudopotentials and uses "// &
1466 "GauXC's molecular quadrature; compact periodic materials require a "// &
1467 "dedicated periodic GauXC interface.", &
1468 usage="PERIODIC_REFERENCE T", &
1469 default_l_val=.false., lone_keyword_l_val=.true.)
1470 CALL section_add_keyword(section, keyword)
1471 CALL keyword_release(keyword)
1472
1473 CALL keyword_create(keyword, __location__, name="NATIVE_GRID", &
1474 description="Experimental CP2K-native real-space-grid path for SKALA "// &
1475 "TorchScript models. This bypasses GauXC molecular quadrature and supports "// &
1476 "isolated, partially periodic, and fully periodic METHOD GPW cells with "// &
1477 "GTH/ECP pseudopotentials and METHOD GAPW/GAPW_XC cells. GAPW with "// &
1478 "GTH/ECP pseudopotentials supports direct-valence and PAW-like one-center "// &
1479 "density representations; GAPW all-electron reconstructs the all-electron "// &
1480 "primitive fields. The current implementation is limited "// &
1481 "to a single GAUXC functional and provides energy, VXC, and experimental "// &
1482 "analytical nuclear-gradient/stress evaluations. K-point runs use CP2K's "// &
1483 "standard k-point and symmetry-reduction infrastructure; CPU k-point "// &
1484 "runs require mutually compatible BLAS, ScaLAPACK, OpenMP, and LibTorch "// &
1485 "runtimes, while CUDA evaluation is selected explicitly. "// &
1486 "Energy/VXC runs split the Torch evaluation into atom blocks by default "// &
1487 "and route dynamic features and gradients between MPI ranks. "// &
1488 "PAW-like GAPW+GTH/ECP and METHOD GAPW_XC combine selectable hard/soft "// &
1489 "primitive fields before constructing the nonlinear SKALA features. ROKS, "// &
1490 "ADMM, and non-k-point multiple-image calculations are not implemented.", &
1491 usage="NATIVE_GRID T", &
1492 default_l_val=.false., lone_keyword_l_val=.true.)
1493 CALL section_add_keyword(section, keyword)
1494 CALL keyword_release(keyword)
1495
1496 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_MODEL_FP64", &
1497 description="Promote float32 numerical state and explicit floating-point casts "// &
1498 "in the native SKALA TorchScript model to double precision. Trained parameter "// &
1499 "values are retained exactly. This improves SCF and geometry-derivative "// &
1500 "consistency for mixed-precision exports. Disable to retain the export's "// &
1501 "original numerical precision.", &
1502 usage="NATIVE_GRID_MODEL_FP64 T", &
1503 default_l_val=.true., lone_keyword_l_val=.true.)
1504 CALL section_add_keyword(section, keyword)
1505 CALL keyword_release(keyword)
1506
1507 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_USE_CUDA", &
1508 description="Evaluate the experimental CP2K-native SKALA GPW TorchScript "// &
1509 "model on CUDA when libtorch CUDA support is available. This requires a "// &
1510 "CUDA-compatible SKALA model export; MODEL SKALA first checks "// &
1511 "GAUXC_SKALA_CUDA_MODEL in this mode and otherwise falls back to "// &
1512 "SKALA_MODEL. The portable default uses CPU tensors.", &
1513 usage="NATIVE_GRID_USE_CUDA T", &
1514 default_l_val=.false., lone_keyword_l_val=.true.)
1515 CALL section_add_keyword(section, keyword)
1516 CALL keyword_release(keyword)
1517
1518 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_CUDA_DEVICE", &
1519 description="CUDA device used by the experimental CP2K-native SKALA GPW "// &
1520 "TorchScript path when NATIVE_GRID_USE_CUDA is enabled. A negative value "// &
1521 "maps the MPI-local rank to one of the CUDA devices visible to the process; "// &
1522 "CUDA exports with device-specific TorchScript constants may require a "// &
1523 "rank-local CUDA_VISIBLE_DEVICES list. A non-negative value selects that "// &
1524 "visible CUDA device explicitly.", &
1525 usage="NATIVE_GRID_CUDA_DEVICE -1", &
1526 default_i_val=-1)
1527 CALL section_add_keyword(section, keyword)
1528 CALL keyword_release(keyword)
1529
1530 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_ATOM_PARTITION", &
1531 description="Atom partition used to build the experimental CP2K-native "// &
1532 "SKALA COMMON_GRID feature block. HARD assigns each native grid point to "// &
1533 "the nearest periodic atom and is intended for legacy energy/VXC-only runs. "// &
1534 "SMOOTH uses a Becke-like fuzzy-cell partition on the native grid and creates "// &
1535 "weighted atom rows. Internal atom-grid weights vanish through a smooth taper "// &
1536 "when sparse rows reach the partition cutoff. Analytical atom forces and stress "// &
1537 "include both the partition and taper derivatives in the SKALA feature response.", &
1538 usage="NATIVE_GRID_ATOM_PARTITION SMOOTH", &
1539 enum_c_vals=s2a("HARD", "SMOOTH"), &
1540 enum_i_vals=[1, 2], &
1541 enum_desc=s2a("Assign each grid point to the nearest atom", &
1542 "Use a smooth Becke-like native-grid atom partition"), &
1543 default_i_val=2)
1544 CALL section_add_keyword(section, keyword)
1545 CALL keyword_release(keyword)
1546
1547 CALL keyword_create( &
1548 keyword, __location__, name="NATIVE_GRID_LAYOUT", &
1549 description="Select the numerical layout for native-grid Skala irrespective of the "// &
1550 "electronic core representation. ATOM_COMPOSITE, the default, evaluates complete "// &
1551 "atom-centered radial/Lebedev blocks. GPW and pseudopotential direct-valence fields "// &
1552 "are interpolated from CP2K's plane-wave grid; GAPW primitive fields are combined "// &
1553 "before nonlinear feature construction. The matching interpolation, partition, and "// &
1554 "one-center adjoints return VXC, forces, and stress to CP2K. Mixed all-electron and "// &
1555 "pseudopotential kinds use the same syntax and are reconstructed per kind. COMMON_GRID retains "// &
1556 "evaluation on CP2K's regular real-space grid as a cutoff-sensitive reference and "// &
1557 "diagnostic layout; mixed core representations require ATOM_COMPOSITE.", &
1558 usage="NATIVE_GRID_LAYOUT ATOM_COMPOSITE", &
1559 enum_c_vals=s2a("COMMON_GRID", "ATOM_COMPOSITE"), &
1561 enum_desc=s2a("Evaluate on the common regular real-space grid", &
1562 "Use image-partitioned atom-centered grids"), &
1563 default_i_val=skala_gapw_atom_composite_grid)
1564 CALL section_add_keyword(section, keyword)
1565 CALL keyword_release(keyword)
1566
1567 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_DENSITY_PARTITION", &
1568 description="Hard/soft one-center primitive-field contribution used by "// &
1569 "METHOD GAPW and METHOD GAPW_XC. With PAW_ONE_CENTER, HARD_MINUS_SOFT "// &
1570 "combines smooth, hard, and soft density, gradient, and kinetic-energy-density "// &
1571 "fields before a single nonlinear SKALA evaluation. It is the default. For "// &
1572 "pseudopotential PAW/one-center GAPW this is distinct from KIND%GPW_TYPE, "// &
1573 "which uses the regular-grid valence-density approximation. "// &
1574 "HARD_ONLY, SOFT_ONLY, and NONE are diagnostic variants.", &
1575 usage="NATIVE_GRID_GAPW_DENSITY_PARTITION HARD_MINUS_SOFT", &
1576 enum_c_vals=s2a("HARD_MINUS_SOFT", "HARD_ONLY", "SOFT_ONLY", "NONE"), &
1577 enum_i_vals=[1, 2, 3, 4], &
1578 enum_desc=s2a("Use the hard-minus-soft GAPW one-center correction", &
1579 "Use only the hard one-center density", &
1580 "Use only the soft one-center density with the GAPW sign", &
1581 "Disable the GAPW one-center SKALA correction"), &
1582 default_i_val=1)
1583 CALL section_add_keyword(section, keyword)
1584 CALL keyword_release(keyword)
1585
1586 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_COMPOSITE_REFERENCE", &
1587 description="Evaluate native-grid SKALA for METHOD GAPW or GAPW_XC on "// &
1588 "rho and tau reconstructed as smooth plus hard-minus-soft before nonlinear "// &
1589 "feature construction on one common regular grid. No separate one-center "// &
1590 "SKALA energy is added. This expensive, cutoff-sensitive diagnostic is "// &
1591 "intended to validate the nonlinear hard/soft cross terms.", &
1592 usage="NATIVE_GRID_GAPW_COMPOSITE_REFERENCE T", &
1593 default_l_val=.false., lone_keyword_l_val=.true.)
1594 CALL section_add_keyword(section, keyword)
1595 CALL keyword_release(keyword)
1596
1597 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_COMPOSITE_DIRECT_AO", &
1598 description="Use direct full-ORB rho and tau collocation for the native-grid "// &
1599 "GAPW composite diagnostic. This is the variational all-electron "// &
1600 "counterpart of the reconstructed smooth plus hard-minus-soft fields and "// &
1601 "provides a reference for their common-grid adjoint.", &
1602 usage="NATIVE_GRID_GAPW_COMPOSITE_DIRECT_AO T", &
1603 default_l_val=.false., lone_keyword_l_val=.true.)
1604 CALL section_add_keyword(section, keyword)
1605 CALL keyword_release(keyword)
1606
1607 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_ATOM_COMPOSITE_REFERENCE", &
1608 description="Replace the native smooth plus separate GAPW one-center SKALA "// &
1609 "terms by one atom-centered evaluation of smooth plus hard-minus-soft "// &
1610 "primitive fields before nonlinear feature construction. The smooth PW "// &
1611 "and one-center VXC adjoints are returned consistently. MPI ranks assemble "// &
1612 "the atom rows collectively; one communicator root evaluates the model and "// &
1613 "broadcasts the energy and feature adjoints.", &
1614 usage="NATIVE_GRID_GAPW_ATOM_COMPOSITE_REFERENCE T", &
1615 default_l_val=.false., lone_keyword_l_val=.true.)
1616 CALL section_add_keyword(section, keyword)
1617 CALL keyword_release(keyword)
1618
1619 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_GAPW_ATOM_COMPOSITE_DIAGNOSTIC", &
1620 description="Evaluate an energy-only GAPW diagnostic on the combined "// &
1621 "smooth plus one-center hard-minus-soft density before nonlinear SKALA "// &
1622 "feature construction. The smooth native-grid density is interpolated to "// &
1623 "the atom-centered GAPW quadrature and all atomic grids are evaluated in "// &
1624 "one model call. This single-rank diagnostic does not replace the active "// &
1625 "XC energy or potential.", &
1626 usage="NATIVE_GRID_GAPW_ATOM_COMPOSITE_DIAGNOSTIC T", &
1627 default_l_val=.false., lone_keyword_l_val=.true.)
1628 CALL section_add_keyword(section, keyword)
1629 CALL keyword_release(keyword)
1630
1631 CALL keyword_create(keyword, __location__, &
1632 name="NATIVE_GRID_GAPW_ATOM_COMPOSITE_COMPONENTS", &
1633 description="Select which one-center hard-minus-soft fields enter the "// &
1634 "atom-composite SKALA diagnostic. FULL combines rho, gradient, and tau; "// &
1635 "RHO_GRAD and TAU isolate the corresponding reconstruction; SMOOTH "// &
1636 "uses only interpolated smooth fields.", &
1637 usage="NATIVE_GRID_GAPW_ATOM_COMPOSITE_COMPONENTS FULL", &
1638 enum_c_vals=s2a("FULL", "RHO_GRAD", "TAU", "SMOOTH"), &
1639 enum_i_vals=[1, 2, 3, 4], &
1640 enum_desc=s2a("Combine rho, gradient, and tau corrections", &
1641 "Combine only rho and gradient corrections", &
1642 "Combine only the tau correction", &
1643 "Use only interpolated smooth fields"), &
1644 default_i_val=1)
1645 CALL section_add_keyword(section, keyword)
1646 CALL keyword_release(keyword)
1647
1648 CALL keyword_create(keyword, __location__, &
1649 name="NATIVE_GRID_GAPW_ATOM_COMPOSITE_FD_STEP", &
1650 description="Central finite-difference step used by the atom-composite "// &
1651 "feature-VXC diagnostic.", &
1652 usage="NATIVE_GRID_GAPW_ATOM_COMPOSITE_FD_STEP 3.0E-3", &
1653 default_r_val=3.0e-3_dp)
1654 CALL section_add_keyword(section, keyword)
1655 CALL keyword_release(keyword)
1656
1657 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_ATOM_CHUNKS", &
1658 description="Split the experimental CP2K-native SKALA GPW TorchScript "// &
1659 "evaluation into contiguous atom blocks. MPI runs evaluate one atom block per "// &
1660 "rank, while single-rank runs can still use atom subchunks to reduce peak CUDA "// &
1661 "memory. Dynamic feature rows and VXC gradients are routed between their "// &
1662 "local grid and atom-block owner ranks. This is enabled by default; set it to "// &
1663 "false to retain the replicated global feature block. ATOM_COMPOSITE also "// &
1664 "subchunks energy, VXC, force, and stress evaluations along independent atomic "// &
1665 "blocks; COMMON_GRID analytical force and stress runs retain the full "// &
1666 "differentiable tensor graph.", &
1667 usage="NATIVE_GRID_ATOM_CHUNKS T", &
1668 default_l_val=.true., lone_keyword_l_val=.true.)
1669 CALL section_add_keyword(section, keyword)
1670 CALL keyword_release(keyword)
1671
1672 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_ATOM_CHUNK_ROUTING", &
1673 description="Compatibility alias for the routed experimental CP2K-native "// &
1674 "SKALA GPW atom chunks. This implies NATIVE_GRID_ATOM_CHUNKS.", &
1675 usage="NATIVE_GRID_ATOM_CHUNK_ROUTING T", &
1676 default_l_val=.false., lone_keyword_l_val=.true.)
1677 CALL section_add_keyword(section, keyword)
1678 CALL keyword_release(keyword)
1679
1680 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_ATOM_CHUNK_MAX_ROWS", &
1681 description="Maximum number of atom-grid rows evaluated by one TorchScript "// &
1682 "call in the experimental CP2K-native SKALA GPW atom-chunk path. A positive "// &
1683 "value splits each rank-local atom chunk into contiguous atom subchunks "// &
1684 "whose padded Torch row count stays below the limit. Atomic blocks are not "// &
1685 "divided, so one block can exceed the requested limit. Zero disables "// &
1686 "subchunking; -1 selects an automatic padded-row cap.", &
1687 usage="NATIVE_GRID_ATOM_CHUNK_MAX_ROWS 250000", &
1688 default_i_val=-1)
1689 CALL section_add_keyword(section, keyword)
1690 CALL keyword_release(keyword)
1691
1692 CALL keyword_create(keyword, __location__, name="NATIVE_GRID_DIAGNOSTICS", &
1693 description="Print diagnostic integrals of the CP2K-native SKALA GPW feature "// &
1694 "block, including electron count, spin moment, and summed grid weights.", &
1695 usage="NATIVE_GRID_DIAGNOSTICS T", &
1696 default_l_val=.false., lone_keyword_l_val=.true.)
1697 CALL section_add_keyword(section, keyword)
1698 CALL keyword_release(keyword)
1699
1700 CALL keyword_create(keyword, __location__, name="MOLECULAR_VIRIAL", &
1701 description="Print a molecular XC virial diagnostic computed from GauXC "// &
1702 "nuclear gradients. This is not an analytical periodic stress tensor.", &
1703 usage="MOLECULAR_VIRIAL T", &
1704 default_l_val=.false., lone_keyword_l_val=.true.)
1705 CALL section_add_keyword(section, keyword)
1706 CALL keyword_release(keyword)
1707
1708 CALL keyword_create(keyword, __location__, name="MOLECULAR_VIRIAL_DEBUG", &
1709 description="Check the GauXC molecular XC virial diagnostic against a "// &
1710 "finite-difference affine scaling of the molecular coordinates.", &
1711 usage="MOLECULAR_VIRIAL_DEBUG T", &
1712 default_l_val=.false., lone_keyword_l_val=.true.)
1713 CALL section_add_keyword(section, keyword)
1714 CALL keyword_release(keyword)
1715
1716 CALL keyword_create(keyword, __location__, name="MOLECULAR_VIRIAL_DEBUG_DX", &
1717 description="Dimensionless finite-difference step for MOLECULAR_VIRIAL_DEBUG.", &
1718 usage="MOLECULAR_VIRIAL_DEBUG_DX 1.0E-4", &
1719 default_r_val=1.0e-4_dp)
1720 CALL section_add_keyword(section, keyword)
1721 CALL keyword_release(keyword)
1722
1723 CALL keyword_create(keyword, __location__, name="LB_EXECUTION_SPACE", &
1724 description="Execution space for load balancer in GauXC", &
1725 usage="LB_EXECUTION_SPACE host", &
1726 enum_c_vals=s2a("HOST", "DEVICE"), &
1727 enum_i_vals=[1, 2], &
1728 enum_desc=s2a("Run on host (default)", &
1729 "Run on device"), &
1730 default_i_val=1)
1731 CALL section_add_keyword(section, keyword)
1732 CALL keyword_release(keyword)
1733
1734 CALL keyword_create(keyword, __location__, name="INT_EXECUTION_SPACE", &
1735 description="Execution space for integrator in GauXC", &
1736 usage="INT_EXECUTION_SPACE host", &
1737 enum_c_vals=s2a("HOST", "DEVICE"), &
1738 enum_i_vals=[1, 2], &
1739 enum_desc=s2a("Run on host (default)", &
1740 "Run on device"), &
1741 default_i_val=1)
1742 CALL section_add_keyword(section, keyword)
1743 CALL keyword_release(keyword)
1744
1745 CALL keyword_create(keyword, __location__, name="LWD_KERNEL", &
1746 description="Local work driver kernel used by the GauXC integrator. "// &
1747 "AUTO uses SCHEME1-CUTLASS for device SKALA when GauXC provides it "// &
1748 "and otherwise uses GauXC's default for the selected execution space. "// &
1749 "DEFAULT always uses GauXC's default. "// &
1750 "Device builds with CUTLASS support can use SCHEME1-CUTLASS to run "// &
1751 "the grouped local potential update through CUTLASS.", &
1752 usage="LWD_KERNEL AUTO", &
1753 default_c_val="AUTO")
1754 CALL section_add_keyword(section, keyword)
1755 CALL keyword_release(keyword)
1756
1757 CALL keyword_create(keyword, __location__, name="SKALA_RUNTIME", &
1758 description="MPI communicator policy for GauXC Skala. AUTO uses "// &
1759 "the force-evaluation communicator for closed-shell calculations and a "// &
1760 "rank-local replicated runtime for open-shell calculations. MPI forces the "// &
1761 "force-evaluation communicator. SELF forces the previous replicated mode.", &
1762 usage="SKALA_RUNTIME AUTO", &
1763 enum_c_vals=s2a("AUTO", "MPI", "SELF"), &
1764 enum_i_vals=[1, 2, 3], &
1765 enum_desc=s2a("Closed-shell MPI, open-shell replicated (default)", &
1766 "Use the force-evaluation MPI communicator", &
1767 "Use rank-local replicated GauXC runtimes"), &
1768 default_i_val=1)
1769 CALL section_add_keyword(section, keyword)
1770 CALL keyword_release(keyword)
1771
1772 CALL keyword_create(keyword, __location__, name="MODEL_GRADIENT_RUNTIME", &
1773 description="MPI communicator policy for GauXC Skala nuclear gradients. "// &
1774 "AUTO uses distributed analytical gradients when the GauXC PR #222 fix is "// &
1775 "verified and energy/VXC uses MPI; otherwise it retains rank-local gradients. "// &
1776 "MPI requires verified support and an MPI energy/VXC runtime. SELF forces "// &
1777 "rank-local gradients. AUTO never overrides SKALA_RUNTIME's open-shell safeguard.", &
1778 usage="MODEL_GRADIENT_RUNTIME AUTO", &
1779 enum_c_vals=s2a("AUTO", "MPI", "SELF"), &
1780 enum_i_vals=[1, 2, 3], &
1781 enum_desc=s2a("Use verified MPI gradients or safe replicated fallback (default)", &
1782 "Use the force-evaluation MPI communicator when supported", &
1783 "Use rank-local replicated gradient runtimes"), &
1784 default_i_val=1)
1785 CALL section_add_keyword(section, keyword)
1786 CALL keyword_release(keyword)
1787
1788 CALL keyword_create(keyword, __location__, name="FORCE_NUMERICAL_GRADIENT", &
1789 description="Force central finite differences for the GauXC molecular XC "// &
1790 "nuclear gradient, using a displacement of 1.0E-4 bohr at fixed AO density. "// &
1791 "Diagnostic option; costs six XC energy evaluations per atom. Does not "// &
1792 "affect NATIVE_GRID or the CP2K one-center contribution.", &
1793 usage="FORCE_NUMERICAL_GRADIENT T", &
1794 default_l_val=.false., lone_keyword_l_val=.true.)
1795 CALL section_add_keyword(section, keyword)
1796 CALL keyword_release(keyword)
1797
1798 CALL keyword_create(keyword, __location__, name="OUTPUT_PATH", &
1799 description="Optional path to an existing directory for GauXC HDF5 debug output. "// &
1800 "If set, molecule and basis set data are written as separate HDF5 files.", &
1801 usage="OUTPUT_PATH /path/to/output", &
1802 default_c_val="")
1803 CALL section_add_keyword(section, keyword)
1804 CALL keyword_release(keyword)
1805
1806 END SUBROUTINE create_gauxc_section
1807
1808! **************************************************************************************************
1809!> \brief creates the input section for the xc part
1810!> \param section the section to create
1811!> \author fawzi
1812! **************************************************************************************************
1813 SUBROUTINE create_xc_section(section)
1814 TYPE(section_type), POINTER :: section
1815
1816 INTEGER :: default_libxc_backend
1817 TYPE(keyword_type), POINTER :: keyword
1818 TYPE(section_type), POINTER :: subsection
1819
1820 cpassert(.NOT. ASSOCIATED(section))
1821 CALL section_create(section, __location__, name="xc", &
1822 description="Parameters needed for the calculation of the eXchange and Correlation potential", &
1823 n_keywords=6, n_subsections=2, repeats=.false.)
1824
1825 NULLIFY (subsection, keyword)
1826
1827 CALL keyword_create(keyword, __location__, name="density_cutoff", &
1828 description="The cutoff on the density used by the xc calculation", &
1829 usage="density_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1830 CALL section_add_keyword(section, keyword)
1831 CALL keyword_release(keyword)
1832
1833 CALL keyword_create(keyword, __location__, name="gradient_cutoff", &
1834 description="The cutoff on the gradient of the density used by the "// &
1835 "xc calculation", &
1836 usage="gradient_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1837 CALL section_add_keyword(section, keyword)
1838 CALL keyword_release(keyword)
1839
1840 CALL keyword_create(keyword, __location__, name="DENSITY_SMOOTH_CUTOFF_RANGE", &
1841 description="Parameter for the smoothing procedure in xc calculation", &
1842 usage="DENSITY_SMOOTH_CUTOFF_RANGE {real}", default_r_val=0.0_dp)
1843 CALL section_add_keyword(section, keyword)
1844 CALL keyword_release(keyword)
1845
1846 CALL keyword_create(keyword, __location__, name="tau_cutoff", &
1847 description="The cutoff on tau used by the xc calculation", &
1848 usage="tau_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1849 CALL section_add_keyword(section, keyword)
1850 CALL keyword_release(keyword)
1851
1852 ! The GPU backend is the default on builds with a device path; HOST is the
1853 ! only option without one, and DEVICE aborts when no GPU is usable.
1854#if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_LIBXC)
1855 default_libxc_backend = do_libxc_gpu
1856#else
1857 default_libxc_backend = do_libxc_cpu
1858#endif
1859 CALL keyword_create(keyword, __location__, name="LIBXC_GPU_BACKEND", &
1860 description="Runtime device/host backend selection for LibXC. "// &
1861 "DEVICE selects the GPU backend (the default on GPU "// &
1862 "builds), HOST the CPU backend. DEVICE is an error "// &
1863 "(abort) when no usable GPU is found at runtime; HOST "// &
1864 "always runs.", &
1865 usage="LIBXC_GPU_BACKEND HOST", &
1866 default_i_val=default_libxc_backend, &
1867 enum_i_vals=[do_libxc_gpu, do_libxc_cpu], &
1868 enum_c_vals=s2a("DEVICE", "HOST"), &
1869 enum_desc=s2a("LibXC GPU backend", "LibXC CPU backend"))
1870 CALL section_add_keyword(section, keyword)
1871 CALL keyword_release(keyword)
1872
1873 CALL section_create(subsection, __location__, name="xc_grid", & !FM to do
1874 description="The xc parameters used when calculating the xc on the grid", &
1875 n_keywords=6, n_subsections=0, repeats=.false.)
1876 CALL keyword_create(keyword, __location__, name="xc_smooth_rho", &
1877 description="The density smoothing used for the xc calculation", &
1878 usage="xc_smooth_rho nn10", default_i_val=xc_rho_no_smooth, &
1879 enum_c_vals=s2a("NONE", "NN50", "NN10", "SPLINE2", "NN6", "SPLINE3", "NN4"), &
1880 enum_i_vals=[xc_rho_no_smooth, xc_rho_nn50, xc_rho_nn10, &
1883 CALL section_add_keyword(subsection, keyword)
1884 CALL keyword_release(keyword)
1885
1886 CALL keyword_create(keyword, __location__, name="xc_deriv", &
1887 description="The method used to compute the derivatives", &
1888 usage="xc_deriv NN10_SMOOTH", default_i_val=xc_deriv_pw, &
1889 enum_c_vals=s2a("PW", "SPLINE3", "SPLINE2", "NN50_SMOOTH", "NN10_SMOOTH", &
1890 "SPLINE2_SMOOTH", "NN6_SMOOTH", "SPLINE3_SMOOTH", "NN4_SMOOTH", "COLLOCATE"), &
1895 CALL section_add_keyword(subsection, keyword)
1896 CALL keyword_release(keyword)
1897
1898 CALL keyword_create(keyword, __location__, name="use_finer_grid", &
1899 description="Uses a finer grid only to calculate the xc", &
1900 usage="use_finer_grid", default_l_val=.false., &
1901 lone_keyword_l_val=.true.)
1902 CALL section_add_keyword(subsection, keyword)
1903 CALL keyword_release(keyword)
1904
1905 CALL keyword_create(keyword, __location__, name="fine_grid_factor", &
1906 description="Factor by which the XC grid cutoff is increased when USE_FINER_GRID is active. "// &
1907 "This setting has no effect unless USE_FINER_GRID is enabled. The default of 4.0 preserves "// &
1908 "the historical finer XC grid. Smaller factors can reduce the finer-grid cost, but should "// &
1909 "be checked together with the regular MGRID cutoff convergence.", &
1910 usage="FINE_GRID_FACTOR 4.0", default_r_val=4.0_dp, &
1911 variants=["FINE_XC_FACTOR"])
1912 CALL section_add_keyword(subsection, keyword)
1913 CALL keyword_release(keyword)
1914
1915 CALL keyword_create(keyword, __location__, name="2ND_DERIV_ANALYTICAL", &
1916 description="Use analytical formulas or finite differences for 2nd derivatives of XC", &
1917 usage="2ND_DERIV_ANALYTICAL logical", default_l_val=.true., &
1918 lone_keyword_l_val=.true.)
1919 CALL section_add_keyword(section, keyword)
1920 CALL keyword_release(keyword)
1921
1922 CALL keyword_create(keyword, __location__, name="3RD_DERIV_ANALYTICAL", &
1923 description="Use analytical formulas or finite differences for 3rd derivatives of XC", &
1924 usage="3RD_DERIV_ANALYTICAL logical", default_l_val=.false., &
1925 lone_keyword_l_val=.true.)
1926 CALL section_add_keyword(section, keyword)
1927 CALL keyword_release(keyword)
1928
1929 CALL keyword_create(keyword, __location__, name="STEP_SIZE", &
1930 description="Step size in terms of the first order potential for the numerical "// &
1931 "evaluation of XC derivatives", &
1932 usage="STEP_SIZE 1.0E-3", default_r_val=1e-3_dp)
1933 CALL section_add_keyword(section, keyword)
1934 CALL keyword_release(keyword)
1935
1936 CALL keyword_create(keyword, __location__, name="NSTEPS", &
1937 description="Number of steps to consider in each direction for the numerical "// &
1938 "evaluation of XC derivatives. Must be a value from 1 to 4 (Default: 3).", &
1939 usage="NSTEPS 4", default_i_val=3)
1940 CALL section_add_keyword(section, keyword)
1941 CALL keyword_release(keyword)
1942
1943 CALL section_add_subsection(section, subsection)
1944 CALL section_release(subsection)
1945
1946 CALL create_xc_fun_section(subsection)
1947 CALL section_add_subsection(section, subsection)
1948 CALL section_release(subsection)
1949
1950 CALL create_hfx_section(subsection)
1951 CALL section_add_subsection(section, subsection)
1952 CALL section_release(subsection)
1953
1954 CALL create_mp2_section(subsection)
1955 CALL section_add_subsection(section, subsection)
1956 CALL section_release(subsection)
1957
1958 CALL create_adiabatic_section(subsection)
1959 CALL section_add_subsection(section, subsection)
1960 CALL section_release(subsection)
1961
1962 CALL create_xc_potential_section(subsection)
1963 CALL section_add_subsection(section, subsection)
1964 CALL section_release(subsection)
1965
1966 CALL create_xc_kernel_section(subsection)
1967 CALL section_add_subsection(section, subsection)
1968 CALL section_release(subsection)
1969
1970 CALL create_hfx_kernel_section(subsection)
1971 CALL section_add_subsection(section, subsection)
1972 CALL section_release(subsection)
1973
1974 CALL create_vdw_potential_section(subsection)
1975 CALL section_add_subsection(section, subsection)
1976 CALL section_release(subsection)
1977
1978 CALL create_gcp_potential_section(subsection)
1979 CALL section_add_subsection(section, subsection)
1980 CALL section_release(subsection)
1981
1982 END SUBROUTINE create_xc_section
1983
1984! **************************************************************************************************
1985!> \brief creates the section for adiabatic hybrid functionals
1986!> \param section ...
1987!> \author Manuel Guidon
1988! **************************************************************************************************
1989 SUBROUTINE create_adiabatic_section(section)
1990 TYPE(section_type), POINTER :: section
1991
1992 TYPE(keyword_type), POINTER :: keyword
1993
1994 cpassert(.NOT. ASSOCIATED(section))
1995 CALL section_create(section, __location__, name="ADIABATIC_RESCALING", &
1996 description="Parameters for self interaction corrected hybrid functionals", &
1997 n_keywords=0, n_subsections=0, repeats=.false.)
1998 NULLIFY (keyword)
1999 CALL keyword_create( &
2000 keyword, __location__, &
2001 name="FUNCTIONAL_TYPE", &
2002 description="Which Hybrid functional should be used. "// &
2003 "(Has to be consistent with the definitions in XC and HF).", &
2004 usage="FUNCTIONAL_TYPE MCY3", &
2005 enum_c_vals=s2a("MCY3"), &
2006 enum_i_vals=[do_adiabatic_hybrid_mcy3], &
2007 enum_desc=s2a("Use MCY3 hybrid functional"), &
2008 default_i_val=do_adiabatic_hybrid_mcy3)
2009 CALL section_add_keyword(section, keyword)
2010 CALL keyword_release(keyword)
2011
2012 NULLIFY (keyword)
2013 CALL keyword_create( &
2014 keyword, __location__, &
2015 name="LAMBDA", &
2016 description="The point to be used along the adiabatic curve (0 &lt; &lambda; &lt; 1)", &
2017 usage="LAMBDA 0.71", &
2018 default_r_val=0.71_dp)
2019 CALL section_add_keyword(section, keyword)
2020 CALL keyword_release(keyword)
2021
2022 NULLIFY (keyword)
2023 CALL keyword_create( &
2024 keyword, __location__, &
2025 name="OMEGA", &
2026 description="Long-range parameter", &
2027 usage="OMEGA 0.2", &
2028 default_r_val=0.2_dp)
2029 CALL section_add_keyword(section, keyword)
2030 CALL keyword_release(keyword)
2031
2032 NULLIFY (keyword)
2033 CALL keyword_create( &
2034 keyword, __location__, &
2035 name="FUNCTIONAL_MODEL", &
2036 description="Which model for the coupling constant integration should be used. ", &
2037 usage="FUNCTIONAL_MODEL PADE", &
2038 enum_c_vals=s2a("PADE"), &
2039 enum_i_vals=[do_adiabatic_model_pade], &
2040 enum_desc=s2a("Use pade model: W(lambda)=a+(b*lambda)/(1+c*lambda)"), &
2041 default_i_val=do_adiabatic_model_pade)
2042 CALL section_add_keyword(section, keyword)
2043 CALL keyword_release(keyword)
2044 END SUBROUTINE create_adiabatic_section
2045
2046END 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