47 c_pw92,
c_pw92dmc,
c_pw92vmc,
c_pz,
c_pzdmc,
c_pzvmc,
do_vwn3,
do_vwn5,
ke_lc,
ke_llp, &
55#include "./base/base_uses.f90"
60 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
61 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_xc'
78 cpassert(.NOT.
ASSOCIATED(section))
80 description=
"The eXchange-Correlation functional to use. In case of hybrid functionals, all scaling "// &
81 "parameters and potential types have to be specified in the HF section except from a few "// &
82 "predefined combinations (see _SECTION_PARAMETERS_ below). CP2K does NOT set it up "// &
83 "automatically not even for LibXC functionals.", &
84 n_keywords=0, n_subsections=4, repeats=.false., &
89 NULLIFY (subsection, keyword)
91 keyword, __location__, name=
"_SECTION_PARAMETERS_", &
92 description=
"Shortcut for the most common functional combinations. These make use of the implementations provided by "// &
93 "native CP2K (without LibXC). In case of hybrid functionals (B3LYP, PBE0), set the "// &
94 "accuracy-related and system-dependent parameters in the HF section (especially MAX_MEMORY, EPS_SCHWARZ, "// &
95 "CUTOFF_RADIUS, POTENTIAL_TYPE) as these are not set automatically.", &
96 usage=
"&xc_functional BLYP", &
97 enum_c_vals=
s2a(
"B3LYP",
"PBE0",
"BLYP",
"BP",
"PADE",
"LDA",
"PBE", &
98 "TPSS",
"HCTH120",
"OLYP",
"BEEFVDW",
"NO_SHORTCUT",
"NONE"), &
101 enum_desc=
s2a(
"B3LYP", &
102 "PBE0 (see note in section XC/XC_FUNCTIONAL/PBE)", &
103 "BLYP",
"BP",
"PADE",
"Alias for PADE", &
104 "PBE (see note in section XC/XC_FUNCTIONAL/PBE)", &
105 "TPSS (not available with LSD, use LIBXC version instead)",
"HCTH120",
"OLYP", &
106 "BEEFVDW",
"NO_SHORTCUT",
"NONE"), &
113 description=
"Uses the Becke 88 exchange functional", &
114 n_keywords=0, n_subsections=0, repeats=.false., &
116 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
117 description=
"activates the functional", &
118 lone_keyword_l_val=.true., default_l_val=.false.)
122 keyword, __location__, name=
"scale_x", &
123 description=
"scales the exchange part of the functional", &
131 CALL section_create(subsection, __location__, name=
"LYP_ADIABATIC", &
132 description=
"Uses the LYP correlation functional in an adiabatic fashion", &
133 n_keywords=0, n_subsections=0, repeats=.false., &
135 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
136 description=
"activates the functional", &
137 lone_keyword_l_val=.true., default_l_val=.false.)
141 description=
"Defines the parameter of the adiabatic curve.", &
149 CALL section_create(subsection, __location__, name=
"BECKE88_LR_ADIABATIC", &
150 description=
"Uses the Becke 88 longrange exchange functional in an adiabatic fashion", &
151 n_keywords=0, n_subsections=0, repeats=.false., &
153 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
154 description=
"activates the functional", &
155 lone_keyword_l_val=.true., default_l_val=.false.)
159 description=
"scales the exchange part of the functional", &
164 description=
"Potential parameter in erf(omega*r)/r", &
169 description=
"Defines the parameter of the adiabatic curve", &
177 CALL section_create(subsection, __location__, name=
"BECKE88_LR", &
178 description=
"Uses the Becke 88 longrange exchange functional", &
179 n_keywords=0, n_subsections=0, repeats=.false., &
181 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
182 description=
"activates the functional", &
183 lone_keyword_l_val=.true., default_l_val=.false.)
187 description=
"scales the exchange part of the functional", &
192 description=
"Potential parameter in erf(omega*r)/r", &
201 description=
"Uses the LYP functional", &
202 n_keywords=0, n_subsections=0, repeats=.false., &
204 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
205 description=
"activates the functional", &
206 lone_keyword_l_val=.true., default_l_val=.false.)
210 description=
"scales the correlation part of the functional", &
218 description=
"Uses the PADE functional", &
219 n_keywords=0, n_subsections=0, repeats=.false., &
221 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
222 description=
"activates the functional", &
223 lone_keyword_l_val=.true., default_l_val=.false.)
230 description=
"Uses the HCTH class of functionals", &
231 n_keywords=0, n_subsections=0, repeats=.false.)
232 CALL keyword_create(keyword, __location__, name=
"PARAMETER_SET", &
233 description=
"Which version of the parameters should be used", &
234 usage=
"PARAMETER_SET 407", &
235 enum_c_vals=[
"93 ",
"120",
"147",
"407",
"HLE"], &
236 enum_i_vals=[93, 120, 147, 407, 408], &
240 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
241 description=
"activates the functional", &
242 lone_keyword_l_val=.true., default_l_val=.false.)
249 description=
"Uses the OPTX functional", &
250 n_keywords=0, n_subsections=0, repeats=.false.)
251 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
252 description=
"activates the functional", &
253 lone_keyword_l_val=.true., default_l_val=.false.)
257 description=
"scales the exchange part of the functional", &
262 description=
"OPTX a1 coefficient", &
263 default_r_val=1.05151_dp)
267 description=
"OPTX a2 coefficient", &
268 default_r_val=1.43169_dp)
272 description=
"OPTX gamma coefficient", &
273 default_r_val=0.006_dp)
282 description=
"Uses the CS1 functional", &
283 n_keywords=0, n_subsections=0, repeats=.false.)
284 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
285 description=
"activates the functional", &
286 lone_keyword_l_val=.true., default_l_val=.false.)
293 description=
"Uses one of the XGGA functionals (optimized versions of "// &
294 "some of these functionals might be available outside this section).", &
295 n_keywords=1, n_subsections=0, repeats=.false.)
296 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
297 description=
"activates the functional", &
298 lone_keyword_l_val=.true., default_l_val=.false.)
302 description=
"Which one of the XGGA functionals should be used", &
303 usage=
"FUNCTIONAL PW86X", &
320 description=
"Uses one of the KE_GGA functionals (optimized versions of "// &
321 "some of these functionals might be available outside this section). "// &
322 "These functionals are needed for the computation of the kinetic "// &
323 "energy in the Kim-Gordon method.", &
324 n_keywords=1, n_subsections=0, repeats=.false.)
325 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
326 description=
"activates the functional", &
327 lone_keyword_l_val=.true., default_l_val=.false.)
331 description=
"Which one of the KE_GGA functionals should be used", &
332 usage=
"FUNCTIONAL (OL1|OL2|LLP|PW86|PW91|LC|T92|PBE)", &
333 enum_c_vals=[
"OL1 ",
"OL2 ",
"LLP ",
"PW86",
"PW91",
"LC ",
"T92 ",
"PBE "], &
335 enum_desc=
s2a(
"Uses first Ou-Yang and Levy functional, currently not producing correct results", &
336 "Uses second Ou-Yang and Levy functional, currently not producing correct results", &
337 "Uses Lee, Lee, and Parr functional", &
338 "Uses Perdew and Wang's 1986 functional", &
339 "Uses Perdew and Wang's 1991 functional", &
340 "Uses Lembarki and Chermette functional", &
341 "Uses Thakkar functional", &
342 "Uses the 1996 functional of Perdew, Burke and Ernzerhof"), &
350 description=
"Uses the P86C functional", &
351 n_keywords=0, n_subsections=0, repeats=.false.)
352 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
353 description=
"activates the functional", &
354 lone_keyword_l_val=.true., default_l_val=.false.)
358 description=
"scales the correlation part of the functional", &
366 description=
"Uses the PerdewWang correlation functional.", &
367 n_keywords=1, n_subsections=0, repeats=.false.)
368 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
369 description=
"activates the functional", &
370 lone_keyword_l_val=.true., default_l_val=.false.)
374 description=
"Scaling of the energy functional", &
375 default_r_val=1.0_dp)
378 CALL keyword_create(keyword, __location__, name=
"PARAMETRIZATION", &
379 description=
"Which one of parametrizations should be used", &
380 usage=
"PARAMETRIZATION DMC", &
393 description=
"Uses the PZ functional.", &
394 n_keywords=1, n_subsections=0, repeats=.false., &
396 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
397 description=
"activates the functional", &
398 lone_keyword_l_val=.true., default_l_val=.false.)
401 CALL keyword_create(keyword, __location__, name=
"PARAMETRIZATION", &
402 description=
"Which one of parametrizations should be used", &
403 usage=
"PARAMETRIZATION DMC", &
413 description=
"scales the correlation part of the functional", &
421 description=
"Uses the TFW functional", &
422 n_keywords=0, n_subsections=0, repeats=.false.)
423 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
424 description=
"activates the functional", &
425 lone_keyword_l_val=.true., default_l_val=.false.)
432 description=
"Uses the TF functional", &
433 n_keywords=0, n_subsections=0, repeats=.false.)
434 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
435 description=
"activates the functional", &
436 lone_keyword_l_val=.true., default_l_val=.false.)
443 description=
"Uses the VWN functional", &
444 n_keywords=0, n_subsections=0, repeats=.false., &
446 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
447 description=
"activates the functional", &
448 lone_keyword_l_val=.true., default_l_val=.false.)
452 description=
"scales the correlation part of the functional", &
457 CALL keyword_create(keyword, __location__, name=
"FUNCTIONAL_TYPE", &
458 description=
"Which version of the VWN functional should be used", &
459 usage=
"FUNCTIONAL_TYPE VWN5", &
460 enum_c_vals=
s2a(
"VWN5",
"VWN3"), &
462 enum_desc=
s2a(
"This is the recommended (correct) version of the VWN functional", &
463 "This version is the default in Gaussian, but not recommended. "// &
464 "Notice that it is also employed in Gaussian's default version of B3LYP"), &
473 description=
"Uses the XALPHA (SLATER) functional.", &
474 n_keywords=1, n_subsections=0, repeats=.false.)
475 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
476 description=
"activates the functional", &
477 lone_keyword_l_val=.true., default_l_val=.false.)
481 description=
"Value of the xa parameter (this does not change the exponent, "// &
482 "just the mixing)", &
483 usage=
"XA 0.7", default_r_val=2._dp/3._dp)
487 description=
"scales the exchange part of the functional", &
495 description=
"Uses the TPSS functional. Note, that there is no LSD version available. "// &
496 "In such cases, use the LIBXC version instead.", &
497 n_keywords=0, n_subsections=0, repeats=.false., &
499 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
500 description=
"Activates the functional", &
501 lone_keyword_l_val=.true., default_l_val=.false.)
505 description=
"scales the exchange part of the functional", &
510 description=
"scales the correlation part of the functional", &
518 description=
"Uses the PBE functional", &
519 n_keywords=0, n_subsections=0, repeats=.false., &
521 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
522 description=
"activates the functional", &
523 lone_keyword_l_val=.true., default_l_val=.false.)
526 CALL keyword_create(keyword, __location__, name=
"parametrization", &
527 description=
"switches between the different "// &
528 "parametrizations of the functional. "// &
529 "Note: Beta parameters used have only 5 significant digits, "// &
530 "as published. For higher precision and program comparison "// &
531 "use the LIBXC library.", &
533 enum_c_vals=[
"ORIG ",
"revPBE",
"PBEsol"], &
534 enum_desc=[
"original PBE ", &
535 "revised PBE (revPBE) ", &
536 "PBE for solids and surfaces (PBEsol)"], &
541 description=
"scales the exchange part of the functional", &
546 description=
"scales the correlation part of the functional", &
553 CALL create_gauxc_section(subsection)
558 description=
"Uses the short range PBE functional", &
559 n_keywords=0, n_subsections=0, repeats=.false., &
561 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
562 description=
"activates the functional", &
563 lone_keyword_l_val=.true., default_l_val=.false.)
567 description=
"scales the exchange part of the functional", &
572 description=
"scales the exchange part of the original hole PBE-functional", &
573 default_r_val=0.0_dp)
577 description=
"screening parameter", &
585 description=
"Uses the Becke 97 exchange correlation functional", &
586 n_keywords=0, n_subsections=0, repeats=.false., &
588 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
589 description=
"activates the functional", &
590 lone_keyword_l_val=.true., default_l_val=.false.)
594 description=
"scales the exchange part of the functional, if -1 the default for the given parametrization is used", &
595 default_r_val=-1._dp)
599 description=
"scales the correlation part of the functional", &
603 CALL keyword_create(keyword, __location__, name=
"parametrization", &
604 description=
"switches between the B97 and Grimme parametrization ", &
606 enum_c_vals=[
"ORIG ",
"B97GRIMME ",
"B97_GRIMME",
"wB97X-V ",
"B97-3c "], &
614 CALL section_create(subsection, __location__, name=
"BECKE_ROUSSEL", &
615 description=
"Becke Roussel exchange hole model. Can be used "// &
616 "as long range correction with a truncated coulomb potential", &
617 n_keywords=0, n_subsections=0, repeats=.false., &
619 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
620 description=
"activates the functional", &
621 lone_keyword_l_val=.true., default_l_val=.false.)
625 description=
"scales the exchange part of the functional", &
629 CALL keyword_create(keyword, __location__, name=
"CUTOFF_RADIUS", &
630 description=
"Defines the cutoff radius for the truncation. "// &
631 "If put to zero, the standard full range potential will be used", &
632 usage=
"CUTOFF_RADIUS 2.0", default_r_val=0.0_dp)
636 description=
"Parameter in the exchange hole. "// &
637 "Usually this is put to 1.0 or 0.8", &
638 usage=
"GAMMA 0.8", default_r_val=1.0_dp)
644 CALL section_create(subsection, __location__, name=
"LDA_HOLE_T_C_LR", &
645 description=
"LDA exchange hole model in truncated coulomb potential", &
646 n_keywords=0, n_subsections=0, repeats=.false.)
647 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
648 description=
"activates the functional", &
649 lone_keyword_l_val=.true., default_l_val=.false.)
653 description=
"scales the exchange part of the functional", &
657 CALL keyword_create(keyword, __location__, name=
"CUTOFF_RADIUS", &
658 description=
"Defines cutoff for lower integration boundary", &
659 default_r_val=0.0_dp, unit_str=
"angstrom")
665 CALL section_create(subsection, __location__, name=
"PBE_HOLE_T_C_LR", &
666 description=
"PBE exchange hole model in trucanted coulomb potential", &
667 n_keywords=0, n_subsections=0, repeats=.false.)
668 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
669 description=
"activates the functional", &
670 lone_keyword_l_val=.true., default_l_val=.false.)
674 description=
"scales the exchange part of the functional", &
678 CALL keyword_create(keyword, __location__, name=
"CUTOFF_RADIUS", &
679 description=
"Defines cutoff for lower integration boundary", &
680 default_r_val=1.0_dp, unit_str=
"angstrom")
687 description=
"Combination of three different exchange hole models", &
688 n_keywords=0, n_subsections=0, repeats=.false.)
689 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
690 description=
"activates the functional", &
691 lone_keyword_l_val=.true., default_l_val=.false.)
695 description=
"scales the exchange part of the functional", &
699 CALL keyword_create(keyword, __location__, name=
"CUTOFF_RADIUS", &
700 description=
"Defines cutoff for lower integration boundary", &
701 default_r_val=0.0_dp, unit_str=
"angstrom")
705 description=
"Parameter for Becke Roussel hole", &
706 default_r_val=1.0_dp)
713 description=
"Uses the BEEFvdW exchange functional", &
714 n_keywords=0, n_subsections=0, repeats=.false., &
716 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
717 description=
"activates the functional", &
718 lone_keyword_l_val=.true., default_l_val=.false.)
722 description=
"scales the exchange part of the functional", &
736 SUBROUTINE create_xc_potential_section(section)
742 cpassert(.NOT.
ASSOCIATED(section))
744 description=
"The xc potential to use (CAREFUL: xc potential here refers "// &
745 "to potentials that are not derived from an xc functional, but rather are "// &
746 "modelled directly. Therefore there is no consistent xc energy available. "// &
747 "To still get an energy expression, see ENERGY below", &
748 n_keywords=1, n_subsections=1, repeats=.false.)
750 NULLIFY (subsection, keyword)
752 description=
"Uses the SAOP potential", &
753 n_keywords=3, n_subsections=0, repeats=.true.)
755 description=
"Value of the alpha parameter (default = 1.19).", &
756 usage=
"ALPHA 1.19", default_r_val=1.19_dp)
760 description=
"Value of the beta parameter (default = 0.01).", &
761 usage=
"BETA 0.01", default_r_val=0.01_dp)
765 description=
"Value of the K_rho parameter (default = 0.42).", &
766 usage=
"K_RHO 0.42", default_r_val=0.42_dp)
773 description=
"How to determine the total energy.", &
774 usage=
"ENERGY [NONE,XC_FUNCTIONAL,SUM_EIGENVALUES", &
775 enum_c_vals=
s2a(
"NONE",
"XC_FUNCTIONAL",
"FUNCTIONAL",
"SUM_EIGENVALUES",
"SOE"), &
785 END SUBROUTINE create_xc_potential_section
792 SUBROUTINE create_xc_kernel_section(section)
797 cpassert(.NOT.
ASSOCIATED(section))
799 description=
"The xc kernel to use (CAREFUL: xc kernel here refers "// &
800 "to kernels that are not derived from an xc functional, but rather are "// &
801 "modelled directly. This kernel will be used in a TDDFPT calculation. "// &
802 "Cannot be combined with XC_FUNCTIONAL or XC_POTENTIAL.", &
803 n_keywords=1, n_subsections=1, repeats=.false.)
807 keyword, __location__, name=
"_SECTION_PARAMETERS_", &
808 description=
"Selection of kernel functionals.", &
809 usage=
"&XC_KERNEL LDAfxc", &
810 enum_c_vals=
s2a(
"PADEfxc",
"LDAfxc",
"GGAfxc",
"NONE"), &
812 enum_desc=
s2a(
"Fxc based on LDA PADE approximation", &
813 "Fxc based on LDA functionals", &
814 "Fxc model from fit to PBE functional", &
822 description=
"List of parameters specific to the kernel function", &
823 usage=
"PARAMETER <REAL> .. <REAL>", &
824 type_of_var=
real_t, n_var=-1)
828 description=
"B97 GAMMA parameters [gx, gab, gaa]", &
829 usage=
"GAMMA <REAL> <REAL> <REAL>", &
830 default_r_vals=[0.004_dp, 0.006_dp, 0.2_dp], &
831 type_of_var=
real_t, n_var=3)
835 description=
"B97 C parameters for exchange", &
836 usage=
"C_XAA <REAL> <REAL> <REAL>", &
837 default_r_vals=[1.0_dp, 0.63_dp, 0.94_dp], &
838 type_of_var=
real_t, n_var=3)
842 description=
"B97 C parameters for same spin correlation.", &
843 usage=
"C_CAB <REAL> <REAL> <REAL>", &
844 default_r_vals=[1.0_dp, 0.75_dp, -4.60_dp], &
845 type_of_var=
real_t, n_var=3)
849 description=
"B97 C parameters for opposite spin correlation.", &
850 usage=
"C_CAA <REAL> <REAL> <REAL>", &
851 default_r_vals=[0.17_dp, 2.35_dp, -2.55_dp], &
852 type_of_var=
real_t, n_var=3)
856 description=
"Scaling parameter for exchange kernel.", &
857 usage=
"SCALE_X 0.2", default_r_val=1.0_dp)
861 description=
"Scaling parameter for correlation kernel.", &
862 usage=
"SCALE_C 0.2", default_r_val=1.0_dp)
866 END SUBROUTINE create_xc_kernel_section
873 SUBROUTINE create_hfx_kernel_section(section)
879 cpassert(.NOT.
ASSOCIATED(section))
881 description=
"The hfx kernel to use. Cannot be combined with HF section.", &
882 n_keywords=1, n_subsections=2, repeats=.false.)
884 NULLIFY (subsection, keyword)
886 description=
"Switch to use the HFXSR (short range) kernel.", &
887 usage=
"DO_HFXSR T/F", default_l_val=.false., &
888 lone_keyword_l_val=.true.)
891 NULLIFY (subsection, keyword)
892 CALL keyword_create(keyword, __location__, name=
"HFXSR_PRIMBAS", &
893 description=
"Default number of primitives in ADMM basis in HFXSR. "// &
894 "0 indicates the use of a contracted minimal basis. ", &
895 usage=
"HFXSR_PRIMBAS 3", default_i_val=0)
904 description=
"Uses the HFXLR (long range) kernel", &
905 n_keywords=2, n_subsections=0, repeats=.false.)
907 description=
"Value of lower range cutoff of interaction [Bohr]", &
908 usage=
"RCUT 5.00", default_r_val=6.00_dp, unit_str=
"bohr")
912 description=
"Scaling parameter for HFX kernel.", &
913 usage=
"SCALE 0.25", default_r_val=1.00_dp)
919 END SUBROUTINE create_hfx_kernel_section
925 SUBROUTINE create_vdw_potential_section(section)
929 TYPE(
section_type),
POINTER :: newsection, print_key, subsection
931 cpassert(.NOT.
ASSOCIATED(section))
932 CALL section_create(section, __location__, name=
"vdw_potential", &
933 description=
"This section combines all possible additional dispersion "// &
934 "corrections to the normal XC functionals. This can be more functionals "// &
935 "or simple empirical pair potentials. ", &
937 n_keywords=1, n_subsections=1, repeats=.false.)
939 NULLIFY (subsection, keyword)
940 CALL keyword_create(keyword, __location__, name=
"POTENTIAL_TYPE", &
941 variants=
s2a(
"DISPERSION_FUNCTIONAL"), &
942 description=
"Type of dispersion/vdW functional or potential to use", &
943 usage=
"POTENTIAL_TYPE (NONE|PAIR_POTENTIAL|NON_LOCAL)", &
944 enum_c_vals=
s2a(
"NONE",
"PAIR_POTENTIAL",
"NON_LOCAL"), &
946 enum_desc=
s2a(
"No dispersion/van der Waals functional.", &
947 "Pair potential van der Waals density functional, "// &
948 "including Grimme's empirical DFT-D methods.", &
949 "Nonlocal van der Waals density functional; more "// &
950 "rigorous in principle, but significantly more "// &
951 "time-consuming."), &
956 CALL section_create(subsection, __location__, name=
"PAIR_POTENTIAL", &
957 description=
"Information on the pair potential to calculate dispersion", &
958 n_keywords=5, n_subsections=0, repeats=.true.)
960 variants=
s2a(
"D3_CUTOFF",
"D4_3B_CUTOFF"), &
961 description=
"Range of potential. The cutoff will be 2 times this value. "// &
962 "In the case of D4 it will be used for the 3-body term", &
963 usage=
"R_CUTOFF 20.0", default_r_val=20.0_dp, &
968 description=
"Range of potential. The cutoff will be 2 times this value. "// &
969 "Only used for the 2-body term of D4", &
970 usage=
"D4_CUTOFF 30.0", default_r_val=20.0_dp, &
975 description=
"Coordination number cutoff for D4", &
976 usage=
"D4_CN_CUTOFF 30.0", default_r_val=-1.0_dp, &
981 description=
"Type of potential", &
983 usage=
"TYPE (DFTD2|DFTD3|DFTD3(BJ)|DFTD4)", &
984 enum_c_vals=
s2a(
"DFTD2",
"DFTD3",
"DFTD3(BJ)",
"DFTD4"), &
987 enum_desc=
s2a(
"Grimme D2 method", &
988 "Grimme D3 method (zero damping)", &
989 "Grimme D3 method (Becke-Johnson damping)", &
990 "Grimme D4 method"), &
994 CALL keyword_create(keyword, __location__, name=
"PARAMETER_FILE_NAME", &
995 description=
"Name of the parameter file, may include a path (not used for D4)", &
996 usage=
"PARAMETER_FILE_NAME <FILENAME>", &
997 default_lc_val=
"dftd3.dat")
1000 CALL keyword_create(keyword, __location__, name=
"REFERENCE_FUNCTIONAL", &
1001 description=
"Use parameters for this specific density functional. "// &
1002 "For available DFT-D4 functionals and parameters see: "// &
1003 "<https://github.com/dftd4/dftd4/blob/main/src/dftd4/param.f90>. "// &
1004 "For available D3 and D3(BJ) parameters see: "// &
1005 "<https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3>. "// &
1006 "For Skala with D3(BJ), SKALA selects the B3LYP D3(BJ) parameters.", &
1007 usage=
"REFERENCE_FUNCTIONAL <functional>", &
1011 CALL keyword_create(keyword, __location__, name=
"D4_REFERENCE_CODE", &
1012 description=
"Calculate D4 energy using external library entirely. "// &
1013 "Not recommended if you are using an MPI version of CP2K, because "// &
1014 "DFT-D4 package does not support MPI parallelization. However, "// &
1015 "if D4_DEBUG is triggered, you will need to switch this on. Note "// &
1016 "that the external library is always needed no matter if this "// &
1017 "option is triggered or not.", &
1018 usage=
"D4_REFERENCE_CODE", default_l_val=.false., &
1019 lone_keyword_l_val=.true.)
1023 description=
"Debug output for D4 method using reference code.", &
1024 usage=
"D4_DEBUG", default_l_val=.false., &
1025 lone_keyword_l_val=.true.)
1028 CALL keyword_create(keyword, __location__, name=
"D3_REFERENCE_CODE", &
1029 description=
"Use D3 damping parameters from s-dftd3 library instead of built-in values. "// &
1030 "Requires s-dftd3 library to be compiled in.", &
1031 usage=
"D3_REFERENCE_CODE", default_l_val=.false., &
1032 lone_keyword_l_val=.true.)
1036 variants=[
"SCALING"], &
1037 description=
"XC Functional dependent scaling parameter. If omitted, CP2K attempts"// &
1038 " to guess the xc functional that is in use and sets the associated scaling parameter.", &
1039 usage=
"SCALING 0.2", default_r_val=0._dp)
1043 variants=[
"EXP_PRE"], &
1044 description=
"Prefactor in exponential damping factor (DFT-D2 potential)", &
1045 usage=
"D2_EXP_PRE 20.", default_r_val=20._dp)
1049 description=
"Cutoff value for coordination number function (DFT-D3 method)", &
1050 usage=
"EPS_CN 1.e-6_dp", default_r_val=1.e-6_dp)
1054 description=
"XC Functional dependent scaling parameters (s6,sr6,s8) for the DFT-D3 method."// &
1055 " If omitted, CP2K attempts"// &
1056 " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1057 usage=
"D3_SCALING 1.0 1.0 1.0", n_var=3, &
1058 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp])
1061 CALL keyword_create(keyword, __location__, name=
"D3BJ_SCALING", &
1062 description=
"XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D3(BJ) method."// &
1063 " If omitted, CP2K attempts"// &
1064 " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1065 usage=
"D3BJ_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
1066 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1070 description=
"XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D4 method."// &
1071 " If omitted, CP2K attempts"// &
1072 " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1073 usage=
"D4_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
1074 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1077 CALL keyword_create(keyword, __location__, name=
"CALCULATE_C9_TERM", &
1078 description=
"Calculate C9 terms in DFT-D3 model", &
1079 usage=
"CALCULATE_C9_TERM", default_l_val=.false., &
1080 lone_keyword_l_val=.true.)
1083 CALL keyword_create(keyword, __location__, name=
"REFERENCE_C9_TERM", &
1084 description=
"Calculate C9 terms in DFT-D3 model using reference coordination numbers", &
1085 usage=
"REFERENCE_C9_TERM", default_l_val=.false., &
1086 lone_keyword_l_val=.true.)
1089 CALL keyword_create(keyword, __location__, name=
"FACTOR_S9_TERM", &
1090 description=
"S9 prefactor of the many-body term in the DFT-D4 method.", &
1091 usage=
"FACTOR_S9_TERM 1.e-0", default_r_val=1.00_dp)
1094 CALL keyword_create(keyword, __location__, name=
"LONG_RANGE_CORRECTION", &
1095 description=
"Calculate a long range correction to the DFT-D3 model."// &
1096 " WARNING: Use with care! Only for isotropic dense systems.", &
1097 usage=
"LONG_RANGE_CORRECTION", default_l_val=.false., &
1098 lone_keyword_l_val=.true.)
1101 CALL keyword_create(keyword, __location__, name=
"SHORT_RANGE_CORRECTION", &
1102 description=
"Calculate a short-range bond correction to the DFT-D3 model", &
1103 usage=
"SHORT_RANGE_CORRECTION", default_l_val=.false., &
1104 lone_keyword_l_val=.true.)
1107 CALL keyword_create(keyword, __location__, name=
"SHORT_RANGE_CORRECTION_PARAMETERS", &
1108 description=
"Parameters for the short-range bond correction to the DFT-D3 model. "// &
1109 "s*(za*zb)^t1*EXP(-g*dr*r0ab^t2), parameters: s, g, t1, t2 "// &
1110 "Defaults: s=0.08, g=10.0, t1=0.5, t2=-1.0 ", &
1111 usage=
"SHORT_RANGE_CORRECTION_PARAMETERS", default_r_vals=[0.08_dp, 10.0_dp, 0.5_dp, -1.0_dp], &
1112 n_var=4, type_of_var=
real_t)
1116 CALL keyword_create(keyword, __location__, name=
"MOLECULE_CORRECTION", &
1117 description=
"Calculate a intermolecular correction to the DFT-D3 model", &
1118 usage=
"MOLECULE_CORRECTION", default_l_val=.false., &
1119 lone_keyword_l_val=.true.)
1122 CALL keyword_create(keyword, __location__, name=
"MOLECULE_CORRECTION_C8", &
1123 description=
"Calculate a intermolecular correction to the C8 term in the DFT-D3 model", &
1124 usage=
"MOLECULE_CORRECTION_C8 1.0 ", default_r_val=0.0_dp)
1127 CALL keyword_create(keyword, __location__, name=
"VERBOSE_OUTPUT", &
1128 description=
"Extensive output for the DFT-D2 and DFT-D3 models."// &
1129 " Needs PRINT_DFTD section to be specified.", &
1130 usage=
"VERBOSE_OUTPUT", default_l_val=.false., &
1131 lone_keyword_l_val=.true.)
1136 CALL keyword_create(keyword, __location__, name=
"D3_EXCLUDE_KIND", &
1137 description=
"Specifies the atomic kinds excluded in the DFT-D3 calculation.", &
1138 usage=
"D3_EXCLUDE_KIND kind1 kind2 ... ", repeats=.false., &
1144 CALL keyword_create(keyword, __location__, name=
"D3_EXCLUDE_KIND_PAIR", &
1145 description=
"Specifies the atomic kinds for interactions excluded from the DFT-D3 calculation.", &
1146 usage=
"D3_EXCLUDE_KIND_PAIR kind1 kind2 ", repeats=.true., &
1152 CALL keyword_create(keyword, __location__, name=
"KIND_COORDINATION_NUMBERS", &
1153 description=
"Specifies the coordination number for a kind for the C9 term in DFT-D3.", &
1154 usage=
"KIND_COORDINATION_NUMBERS CN kind ", repeats=.true., &
1155 n_var=-1, type_of_var=
char_t)
1159 CALL keyword_create(keyword, __location__, name=
"ATOM_COORDINATION_NUMBERS", &
1160 description=
"Specifies the coordination number of a set of atoms for the C9 term in DFT-D3.", &
1161 usage=
"ATOM_COORDINATION_NUMBERS CN atom1 atom2 ... ", repeats=.true., &
1162 n_var=-1, type_of_var=
char_t)
1168 description=
"Specifies parameters for atom types (in atomic units). If "// &
1169 "not provided default parameters are used (DFT-D2).", &
1170 usage=
"ATOMPARM <ELEMENT> <C6_parameter> <vdw_radii>", &
1171 repeats=.true., n_var=-1, type_of_var=
char_t)
1177 description=
"Controls the printing of some info about DFTD contributions", &
1182 NULLIFY (newsection)
1191 NULLIFY (subsection, keyword)
1192 CALL section_create(subsection, __location__, name=
"NON_LOCAL", &
1193 description=
"Information on the non local part of dispersion functionals. "// &
1194 "Correct functionals require a corresponding setting of XC_FUNCTIONAL.", &
1195 n_keywords=0, n_subsections=0, repeats=.true.)
1198 description=
"Type of functional (the corresponding kernel data file should be selected). "// &
1199 "Allows for common forms such as vdW-DF, vdW-DF2, optB88-vdW, rVV10.", &
1200 usage=
"TYPE DRSLL", &
1201 enum_c_vals=
s2a(
"DRSLL",
"LMKLL",
"RVV10"), &
1203 enum_desc=
s2a(
"Dion-Rydberg-Schroeder-Langreth-Lundqvist nonlocal van der Waals density functional", &
1204 "Lee-Murray-Kong-Lundqvist-Langreth nonlocal van der Waals density functional", &
1205 "Revised Vydrov-van Voorhis nonlocal van der Waals density functional"), &
1210 CALL keyword_create(keyword, __location__, name=
"VERBOSE_OUTPUT", &
1211 description=
"Extensive output for non local functionals", &
1212 usage=
"VERBOSE_OUTPUT", default_l_val=.false., &
1213 lone_keyword_l_val=.true.)
1216 CALL keyword_create(keyword, __location__, name=
"KERNEL_FILE_NAME", &
1217 description=
"Name of the kernel data file, may include a path. "// &
1218 "vdW_kernel_table.dat is for DRSLL and LMKLL and "// &
1219 "rVV10_kernel_table.dat is for rVV10.", &
1220 usage=
"KERNEL_FILE_NAME <FILENAME>", &
1221 default_lc_val=
"vdW_kernel_table.dat")
1225 description=
"The cutoff of the FFT grid used in the calculation "// &
1226 "of the nonlocal vdW functional [Ry].", &
1227 usage=
"CUTOFF 300", &
1228 default_r_val=-1._dp, unit_str=
"Ry")
1232 description=
"Parameters b and C of the rVV10 functional", &
1233 usage=
"PARAMETERS 6.3 0.0093", &
1234 type_of_var=
real_t, default_r_vals=[6.3_dp, 0.0093_dp], n_var=2)
1238 description=
"Scales the energy contribution of the rVV10 functional", &
1239 usage=
"SCALE 1.0", &
1240 type_of_var=
real_t, default_r_val=1.0_dp)
1247 END SUBROUTINE create_vdw_potential_section
1254 SUBROUTINE create_gcp_potential_section(section)
1259 cpassert(.NOT.
ASSOCIATED(section))
1260 CALL section_create(section, __location__, name=
"gcp_potential", &
1261 description=
"This section combines geometrical counterpoise potentials."// &
1262 " This is a simple empirical pair potential to correct for BSSE. ", &
1264 n_keywords=1, n_subsections=1, repeats=.false.)
1267 CALL keyword_create(keyword, __location__, name=
"PARAMETER_FILE_NAME", &
1268 description=
"Name of the parameter file, may include a path", &
1269 usage=
"PARAMETER_FILE_NAME <FILENAME>", &
1270 default_lc_val=
"---")
1274 CALL keyword_create(keyword, __location__, name=
"GLOBAL_PARAMETERS", &
1275 description=
"Global parameters of the gCP method."// &
1276 " Parameters are sigma, alpha, beta, eta from the original paper.", &
1277 usage=
"GLOBAL_PARAMETERS 1.0 1.0 1.0 1.0", n_var=4, &
1278 default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1282 CALL keyword_create(keyword, __location__, name=
"DELTA_ENERGY", &
1283 description=
"Specify the delta energy [Hartree] term for an atom kind", &
1284 usage=
"DELTA_ENERGY type value", &
1285 type_of_var=
char_t, repeats=.true., n_var=-1, default_c_vals=[
"XX ",
"0.0"])
1290 description=
"Verbose output for gCP calculation", &
1291 usage=
"VERBOSE logical_value", &
1292 default_l_val=.true., lone_keyword_l_val=.true.)
1296 END SUBROUTINE create_gcp_potential_section
1303 SUBROUTINE create_gauxc_section(section)
1308 cpassert(.NOT.
ASSOCIATED(section))
1310 description=
"Use exchange-correlation functionals provided by GauXC. "// &
1311 "The current CP2K bridge uses GauXC's molecular quadrature. Periodic inputs "// &
1312 "are limited to isolated validation cells and are not compact periodic "// &
1313 "material calculations.", &
1314 n_keywords=27, n_subsections=0, repeats=.false.)
1318 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
1319 description=
"activates the functional", &
1320 lone_keyword_l_val=.true., default_l_val=.false.)
1325 description=
"Functional name used to create the GauXC integrator. "// &
1326 "If MODEL is set, this optional base functional defaults to PBE and "// &
1327 "does not need to be specified for MODEL SKALA inputs.", &
1328 default_c_val=
"PBE")
1333 description=
"GauXC OneDFT model name or path. Use NONE for conventional GauXC. "// &
1334 "MODEL SKALA selects the installed Skala-1.1 model when available; "// &
1335 "other OneDFT models are supplied as .fun files or model names. "// &
1336 "NLCC pseudopotentials are rejected in the molecular GauXC OneDFT/SKALA "// &
1337 "path; use the CP2K-native SKALA grid path for NLCC calculations.", &
1338 usage=
"MODEL SKALA", &
1339 default_c_val=
"NONE")
1344 description=
"Atomic grid size for GauXC. OneDFT/SKALA defaults to SUPERFINE "// &
1345 "unless this keyword is set explicitly.", &
1346 usage=
"GRID fine", &
1347 enum_c_vals=
s2a(
"FINE",
"ULTRAFINE",
"SUPERFINE",
"GM3",
"GM5"), &
1348 enum_i_vals=[1, 2, 3, 4, 5], &
1349 enum_desc=
s2a(
"Fine grid (default)", &
1350 "Ultra fine grid", &
1351 "Super fine grid", &
1358 CALL keyword_create(keyword, __location__, name=
"RADIAL_QUADRATURE", &
1359 description=
"Radial quadrature scheme for GauXC", &
1360 usage=
"RADIAL_QUADRATURE muraknowles", &
1361 enum_c_vals=
s2a(
"MURAKNOWLES",
"BECKE",
"TREUTLERAHLRICHS",
"MURRAYHANDYLAMING"), &
1362 enum_i_vals=[1, 2, 3, 4], &
1363 enum_desc=
s2a(
"Mura-Knowles radial quadrature (default)", &
1364 "Becke radial quadrature", &
1365 "Treutler-Ahlrichs radial quadrature", &
1366 "Murray-Handy-Laming radial quadrature"), &
1371 CALL keyword_create(keyword, __location__, name=
"PRUNING_SCHEME", &
1372 description=
"Pruning scheme for GauXC. OneDFT/SKALA defaults to UNPRUNED "// &
1373 "unless this keyword is set explicitly.", &
1374 usage=
"PRUNING_SCHEME robust", &
1375 enum_c_vals=
s2a(
"ROBUST",
"TREUTLER",
"UNPRUNED"), &
1376 enum_i_vals=[1, 2, 3], &
1377 enum_desc=
s2a(
"Robust pruning (default)", &
1378 "Treutler pruning", &
1385 description=
"Batch size for GauXC evaluation", &
1386 usage=
"BATCH_SIZE 512", &
1391 CALL keyword_create(keyword, __location__, name=
"DEVICE_RUNTIME_FILL_FRACTION", &
1392 description=
"Fraction of currently available GPU memory preallocated by "// &
1393 "a GauXC device runtime. Lower values leave more memory for OneDFT/SKALA "// &
1394 "Torch inference; this keyword is used only with LB_EXECUTION_SPACE DEVICE.", &
1395 usage=
"DEVICE_RUNTIME_FILL_FRACTION 0.1", &
1396 default_r_val=0.1_dp)
1400 CALL keyword_create(keyword, __location__, name=
"ONEDFT_ATOM_CHUNK_SIZE", &
1401 description=
"Atom chunk size for GauXC OneDFT/SKALA Torch inference. "// &
1402 "A positive value evaluates the Torch model atom block by atom block; "// &
1403 "zero disables chunking; the default leaves GauXC's model-specific policy "// &
1404 "or the GAUXC_ONEDFT_ATOM_CHUNK_SIZE environment variable in control.", &
1405 usage=
"ONEDFT_ATOM_CHUNK_SIZE 3", &
1410 CALL keyword_create(keyword, __location__, name=
"PERIODIC_REFERENCE", &
1411 description=
"Explicitly opt into the limited isolated-cell GauXC reference "// &
1412 "path for periodic CP2K inputs. This path is restricted to Gamma-only, "// &
1413 "single-image METHOD GPW calculations with GTH pseudopotentials and uses "// &
1414 "GauXC's molecular quadrature; compact periodic materials require a "// &
1415 "dedicated periodic GauXC interface.", &
1416 usage=
"PERIODIC_REFERENCE T", &
1417 default_l_val=.false., lone_keyword_l_val=.true.)
1422 description=
"Experimental CP2K-native GPW real-space-grid path for SKALA "// &
1423 "TorchScript models. This bypasses GauXC molecular quadrature and supports "// &
1424 "isolated, partially periodic, and fully periodic METHOD GPW cells with "// &
1425 "GTH/ECP pseudopotentials and METHOD GAPW/GAPW_XC cells. GAPW with "// &
1426 "GTH/ECP pseudopotentials can use KIND%GPW_TYPE regular-grid features or "// &
1427 "the GAPW one-center XC correction; GAPW all-electron uses the "// &
1428 "all-electron regular-grid density. The current implementation is limited "// &
1429 "to a single GAUXC functional and provides energy, VXC, and experimental "// &
1430 "analytical nuclear-gradient/stress evaluations. K-point runs use CP2K's "// &
1431 "standard k-point and symmetry-reduction infrastructure; the CPU "// &
1432 "TorchScript path may require preloading libtorch_cpu.so before OpenBLAS, "// &
1433 "whereas CUDA k-point runs should not preload CPU-only Torch libraries. "// &
1434 "MPI runs collect a global atom-partitioned feature block by default; "// &
1435 "NATIVE_GRID_ATOM_CHUNKS can split the Torch evaluation by atom block. "// &
1436 "PAW/one-center GAPW+GTH/ECP and METHOD GAPW_XC use CP2K's GAPW hard/soft "// &
1437 "one-center XC correction with a selectable "// &
1438 "NATIVE_GRID_GAPW_DENSITY_PARTITION. ROKS, ADMM, and non-k-point "// &
1439 "multiple-image calculations are not implemented.", &
1440 usage=
"NATIVE_GRID T", &
1441 default_l_val=.false., lone_keyword_l_val=.true.)
1445 CALL keyword_create(keyword, __location__, name=
"NATIVE_GRID_USE_CUDA", &
1446 description=
"Evaluate the experimental CP2K-native SKALA GPW TorchScript "// &
1447 "model on CUDA when libtorch CUDA support is available. This requires a "// &
1448 "CUDA-compatible SKALA model export; MODEL SKALA first checks "// &
1449 "GAUXC_SKALA_CUDA_MODEL in this mode and otherwise falls back to "// &
1450 "GAUXC_SKALA_MODEL. The portable default uses CPU tensors.", &
1451 usage=
"NATIVE_GRID_USE_CUDA T", &
1452 default_l_val=.false., lone_keyword_l_val=.true.)
1456 CALL keyword_create(keyword, __location__, name=
"NATIVE_GRID_CUDA_DEVICE", &
1457 description=
"CUDA device used by the experimental CP2K-native SKALA GPW "// &
1458 "TorchScript path when NATIVE_GRID_USE_CUDA is enabled. A negative value "// &
1459 "maps the MPI-local rank to one of the CUDA devices visible to the process; "// &
1460 "CUDA exports with device-specific TorchScript constants may require a "// &
1461 "rank-local CUDA_VISIBLE_DEVICES list. A non-negative value selects that "// &
1462 "visible CUDA device explicitly.", &
1463 usage=
"NATIVE_GRID_CUDA_DEVICE -1", &
1468 CALL keyword_create(keyword, __location__, name=
"NATIVE_GRID_ATOM_PARTITION", &
1469 description=
"Atom partition used to build the experimental CP2K-native "// &
1470 "SKALA regular-grid feature block. HARD assigns each native grid point to "// &
1471 "the nearest periodic atom and is intended for legacy energy/VXC-only runs. "// &
1472 "SMOOTH uses a Becke-like fuzzy-cell partition on the native grid and creates "// &
1473 "weighted atom rows. Analytical atom forces and stress use the differentiable "// &
1474 "SMOOTH partition internally because the corresponding partition-weight "// &
1475 "derivatives enter the SKALA feature response.", &
1476 usage=
"NATIVE_GRID_ATOM_PARTITION SMOOTH", &
1477 enum_c_vals=
s2a(
"HARD",
"SMOOTH"), &
1478 enum_i_vals=[1, 2], &
1479 enum_desc=
s2a(
"Assign each grid point to the nearest atom", &
1480 "Use a smooth Becke-like native-grid atom partition"), &
1485 CALL keyword_create(keyword, __location__, name=
"NATIVE_GRID_GAPW_DENSITY_PARTITION", &
1486 description=
"Hard/soft one-center density contribution used by METHOD "// &
1487 "GAPW and METHOD GAPW_XC in OneDFT/SKALA atomic-grid corrections. "// &
1488 "HARD_MINUS_SOFT evaluates the SKALA model on hard and soft atomic "// &
1489 "densities separately and adds the GAPW hard-minus-soft correction; this "// &
1490 "is the default because it follows CP2K's GAPW XC expression. For "// &
1491 "pseudopotential PAW/one-center GAPW this is distinct from KIND%GPW_TYPE, "// &
1492 "which uses the regular-grid valence-density approximation. "// &
1493 "HARD_ONLY, SOFT_ONLY, and NONE are diagnostic variants.", &
1494 usage=
"NATIVE_GRID_GAPW_DENSITY_PARTITION HARD_MINUS_SOFT", &
1495 enum_c_vals=
s2a(
"HARD_MINUS_SOFT",
"HARD_ONLY",
"SOFT_ONLY",
"NONE"), &
1496 enum_i_vals=[1, 2, 3, 4], &
1497 enum_desc=
s2a(
"Use the hard-minus-soft GAPW one-center correction", &
1498 "Use only the hard one-center density", &
1499 "Use only the soft one-center density with the GAPW sign", &
1500 "Disable the GAPW one-center SKALA correction"), &
1505 CALL keyword_create(keyword, __location__, name=
"NATIVE_GRID_ATOM_CHUNKS", &
1506 description=
"Split the experimental CP2K-native SKALA GPW TorchScript "// &
1507 "evaluation into contiguous atom blocks. MPI runs evaluate one atom block per "// &
1508 "rank, while single-rank runs can still use atom subchunks to reduce peak CUDA "// &
1509 "memory. Dynamic feature rows and VXC gradients are routed between their "// &
1510 "local grid and atom-block owner ranks. Analytical force and stress runs use "// &
1511 "the full differentiable tensor graph instead of routed atom chunks.", &
1512 usage=
"NATIVE_GRID_ATOM_CHUNKS T", &
1513 default_l_val=.false., lone_keyword_l_val=.true.)
1517 CALL keyword_create(keyword, __location__, name=
"NATIVE_GRID_ATOM_CHUNK_ROUTING", &
1518 description=
"Compatibility alias for the routed experimental CP2K-native "// &
1519 "SKALA GPW atom chunks. This implies NATIVE_GRID_ATOM_CHUNKS.", &
1520 usage=
"NATIVE_GRID_ATOM_CHUNK_ROUTING T", &
1521 default_l_val=.false., lone_keyword_l_val=.true.)
1525 CALL keyword_create(keyword, __location__, name=
"NATIVE_GRID_ATOM_CHUNK_MAX_ROWS", &
1526 description=
"Maximum number of atom-grid rows evaluated by one TorchScript "// &
1527 "call in the experimental CP2K-native SKALA GPW atom-chunk path. A positive "// &
1528 "value splits each rank-local atom chunk into contiguous atom subchunks to "// &
1529 "reduce peak CUDA memory use; zero disables subchunking; -1 selects an "// &
1530 "automatic CUDA-oriented row cap.", &
1531 usage=
"NATIVE_GRID_ATOM_CHUNK_MAX_ROWS 250000", &
1536 CALL keyword_create(keyword, __location__, name=
"NATIVE_GRID_DIAGNOSTICS", &
1537 description=
"Print diagnostic integrals of the CP2K-native SKALA GPW feature "// &
1538 "block, including electron count, spin moment, and summed grid weights.", &
1539 usage=
"NATIVE_GRID_DIAGNOSTICS T", &
1540 default_l_val=.false., lone_keyword_l_val=.true.)
1544 CALL keyword_create(keyword, __location__, name=
"MOLECULAR_VIRIAL", &
1545 description=
"Print a molecular XC virial diagnostic computed from GauXC "// &
1546 "nuclear gradients. This is not an analytical periodic stress tensor.", &
1547 usage=
"MOLECULAR_VIRIAL T", &
1548 default_l_val=.false., lone_keyword_l_val=.true.)
1552 CALL keyword_create(keyword, __location__, name=
"MOLECULAR_VIRIAL_DEBUG", &
1553 description=
"Check the GauXC molecular XC virial diagnostic against a "// &
1554 "finite-difference affine scaling of the molecular coordinates.", &
1555 usage=
"MOLECULAR_VIRIAL_DEBUG T", &
1556 default_l_val=.false., lone_keyword_l_val=.true.)
1560 CALL keyword_create(keyword, __location__, name=
"MOLECULAR_VIRIAL_DEBUG_DX", &
1561 description=
"Dimensionless finite-difference step for MOLECULAR_VIRIAL_DEBUG.", &
1562 usage=
"MOLECULAR_VIRIAL_DEBUG_DX 1.0E-4", &
1563 default_r_val=1.0e-4_dp)
1567 CALL keyword_create(keyword, __location__, name=
"LB_EXECUTION_SPACE", &
1568 description=
"Execution space for load balancer in GauXC", &
1569 usage=
"LB_EXECUTION_SPACE host", &
1570 enum_c_vals=
s2a(
"HOST",
"DEVICE"), &
1571 enum_i_vals=[1, 2], &
1572 enum_desc=
s2a(
"Run on host (default)", &
1578 CALL keyword_create(keyword, __location__, name=
"INT_EXECUTION_SPACE", &
1579 description=
"Execution space for integrator in GauXC", &
1580 usage=
"INT_EXECUTION_SPACE host", &
1581 enum_c_vals=
s2a(
"HOST",
"DEVICE"), &
1582 enum_i_vals=[1, 2], &
1583 enum_desc=
s2a(
"Run on host (default)", &
1590 description=
"Local work driver kernel used by the GauXC integrator. "// &
1591 "DEFAULT uses GauXC's default for the selected execution space. "// &
1592 "Device builds with CUTLASS support can use SCHEME1-CUTLASS to run "// &
1593 "the grouped local potential update through CUTLASS.", &
1594 usage=
"LWD_KERNEL DEFAULT", &
1595 default_c_val=
"DEFAULT")
1599 CALL keyword_create(keyword, __location__, name=
"SKALA_RUNTIME", &
1600 description=
"MPI communicator policy for GauXC OneDFT/SKALA. AUTO uses "// &
1601 "the force-evaluation communicator for closed-shell calculations and a "// &
1602 "rank-local replicated runtime for open-shell calculations. MPI forces the "// &
1603 "force-evaluation communicator. SELF forces the previous replicated mode.", &
1604 usage=
"SKALA_RUNTIME AUTO", &
1605 enum_c_vals=
s2a(
"AUTO",
"MPI",
"SELF"), &
1606 enum_i_vals=[1, 2, 3], &
1607 enum_desc=
s2a(
"Closed-shell MPI, open-shell replicated (default)", &
1608 "Use the force-evaluation MPI communicator", &
1609 "Use rank-local replicated GauXC runtimes"), &
1614 CALL keyword_create(keyword, __location__, name=
"ONEDFT_GRADIENT_RUNTIME", &
1615 description=
"MPI communicator policy for GauXC OneDFT/SKALA nuclear gradients. "// &
1616 "AUTO keeps the conservative rank-local gradient runtime when energy/VXC uses "// &
1617 "the MPI communicator. MPI uses the force-evaluation communicator for gradients "// &
1618 "and requires GauXC support for distributed OneDFT/SKALA gradients. SELF forces "// &
1619 "rank-local replicated gradient runtimes.", &
1620 usage=
"ONEDFT_GRADIENT_RUNTIME AUTO", &
1621 enum_c_vals=
s2a(
"AUTO",
"MPI",
"SELF"), &
1622 enum_i_vals=[1, 2, 3], &
1623 enum_desc=
s2a(
"Conservative replicated gradient runtime (default)", &
1624 "Use the force-evaluation MPI communicator when supported", &
1625 "Use rank-local replicated gradient runtimes"), &
1631 description=
"Optional path to an existing directory for GauXC HDF5 debug output. "// &
1632 "If set, molecule and basis set data are written as separate HDF5 files.", &
1633 usage=
"OUTPUT_PATH /path/to/output", &
1638 END SUBROUTINE create_gauxc_section
1651 cpassert(.NOT.
ASSOCIATED(section))
1653 description=
"Parameters needed for the calculation of the eXchange and Correlation potential", &
1654 n_keywords=5, n_subsections=2, repeats=.false.)
1656 NULLIFY (subsection, keyword)
1658 CALL keyword_create(keyword, __location__, name=
"density_cutoff", &
1659 description=
"The cutoff on the density used by the xc calculation", &
1660 usage=
"density_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1664 CALL keyword_create(keyword, __location__, name=
"gradient_cutoff", &
1665 description=
"The cutoff on the gradient of the density used by the "// &
1667 usage=
"gradient_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1671 CALL keyword_create(keyword, __location__, name=
"DENSITY_SMOOTH_CUTOFF_RANGE", &
1672 description=
"Parameter for the smoothing procedure in xc calculation", &
1673 usage=
"DENSITY_SMOOTH_CUTOFF_RANGE {real}", default_r_val=0.0_dp)
1678 description=
"The cutoff on tau used by the xc calculation", &
1679 usage=
"tau_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1684 description=
"The xc parameters used when calculating the xc on the grid", &
1685 n_keywords=6, n_subsections=0, repeats=.false.)
1686 CALL keyword_create(keyword, __location__, name=
"xc_smooth_rho", &
1687 description=
"The density smoothing used for the xc calculation", &
1689 enum_c_vals=
s2a(
"NONE",
"NN50",
"NN10",
"SPLINE2",
"NN6",
"SPLINE3",
"NN4"), &
1697 description=
"The method used to compute the derivatives", &
1698 usage=
"xc_deriv NN10_SMOOTH", default_i_val=
xc_deriv_pw, &
1699 enum_c_vals=
s2a(
"PW",
"SPLINE3",
"SPLINE2",
"NN50_SMOOTH",
"NN10_SMOOTH", &
1700 "SPLINE2_SMOOTH",
"NN6_SMOOTH",
"SPLINE3_SMOOTH",
"NN4_SMOOTH",
"COLLOCATE"), &
1708 CALL keyword_create(keyword, __location__, name=
"use_finer_grid", &
1709 description=
"Uses a finer grid only to calculate the xc", &
1710 usage=
"use_finer_grid", default_l_val=.false., &
1711 lone_keyword_l_val=.true.)
1715 CALL keyword_create(keyword, __location__, name=
"fine_grid_factor", &
1716 description=
"Factor by which the XC grid cutoff is increased when USE_FINER_GRID is active. "// &
1717 "This setting has no effect unless USE_FINER_GRID is enabled. The default of 4.0 preserves "// &
1718 "the historical finer XC grid. Smaller factors can reduce the finer-grid cost, but should "// &
1719 "be checked together with the regular MGRID cutoff convergence.", &
1720 usage=
"FINE_GRID_FACTOR 4.0", default_r_val=4.0_dp, &
1721 variants=[
"FINE_XC_FACTOR"])
1725 CALL keyword_create(keyword, __location__, name=
"2ND_DERIV_ANALYTICAL", &
1726 description=
"Use analytical formulas or finite differences for 2nd derivatives of XC", &
1727 usage=
"2ND_DERIV_ANALYTICAL logical", default_l_val=.true., &
1728 lone_keyword_l_val=.true.)
1732 CALL keyword_create(keyword, __location__, name=
"3RD_DERIV_ANALYTICAL", &
1733 description=
"Use analytical formulas or finite differences for 3rd derivatives of XC", &
1734 usage=
"3RD_DERIV_ANALYTICAL logical", default_l_val=.true., &
1735 lone_keyword_l_val=.true.)
1740 description=
"Step size in terms of the first order potential for the numerical "// &
1741 "evaluation of XC derivatives", &
1742 usage=
"STEP_SIZE 1.0E-3", default_r_val=1e-3_dp)
1747 description=
"Number of steps to consider in each direction for the numerical "// &
1748 "evaluation of XC derivatives. Must be a value from 1 to 4 (Default: 3).", &
1749 usage=
"NSTEPS 4", default_i_val=3)
1768 CALL create_adiabatic_section(subsection)
1772 CALL create_xc_potential_section(subsection)
1776 CALL create_xc_kernel_section(subsection)
1780 CALL create_hfx_kernel_section(subsection)
1784 CALL create_vdw_potential_section(subsection)
1788 CALL create_gcp_potential_section(subsection)
1799 SUBROUTINE create_adiabatic_section(section)
1804 cpassert(.NOT.
ASSOCIATED(section))
1805 CALL section_create(section, __location__, name=
"ADIABATIC_RESCALING", &
1806 description=
"Parameters for self interaction corrected hybrid functionals", &
1807 n_keywords=0, n_subsections=0, repeats=.false.)
1810 keyword, __location__, &
1811 name=
"FUNCTIONAL_TYPE", &
1812 description=
"Which Hybrid functional should be used. "// &
1813 "(Has to be consistent with the definitions in XC and HF).", &
1814 usage=
"FUNCTIONAL_TYPE MCY3", &
1815 enum_c_vals=
s2a(
"MCY3"), &
1817 enum_desc=
s2a(
"Use MCY3 hybrid functional"), &
1824 keyword, __location__, &
1826 description=
"The point to be used along the adiabatic curve (0 < λ < 1)", &
1827 usage=
"LAMBDA 0.71", &
1828 default_r_val=0.71_dp)
1834 keyword, __location__, &
1836 description=
"Long-range parameter", &
1837 usage=
"OMEGA 0.2", &
1838 default_r_val=0.2_dp)
1844 keyword, __location__, &
1845 name=
"FUNCTIONAL_MODEL", &
1846 description=
"Which model for the coupling constant integration should be used. ", &
1847 usage=
"FUNCTIONAL_MODEL PADE", &
1848 enum_c_vals=
s2a(
"PADE"), &
1850 enum_desc=
s2a(
"Use pade model: W(lambda)=a+(b*lambda)/(1+c*lambda)"), &
1854 END SUBROUTINE create_adiabatic_section
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
Defines the basic variable types.
integer, parameter, public dp
Utilities for string manipulations.
calculates a functional from libxc and its derivatives
subroutine, public libxc_add_sections(section)
...