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