47 c_pw92,
c_pw92dmc,
c_pw92vmc,
c_pz,
c_pzdmc,
c_pzvmc,
do_vwn3,
do_vwn5,
ke_lc,
ke_llp, &
57#include "./base/base_uses.f90"
62 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
63 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_xc'
80 cpassert(.NOT.
ASSOCIATED(section))
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., &
91 NULLIFY (subsection, keyword)
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"), &
115 description=
"Uses the Becke 88 exchange functional", &
116 n_keywords=0, n_subsections=0, repeats=.false., &
118 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
119 description=
"activates the functional", &
120 lone_keyword_l_val=.true., default_l_val=.false.)
124 keyword, __location__, name=
"scale_x", &
125 description=
"scales the exchange part of the functional", &
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., &
137 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
138 description=
"activates the functional", &
139 lone_keyword_l_val=.true., default_l_val=.false.)
143 description=
"Defines the parameter of the adiabatic curve.", &
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., &
155 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
156 description=
"activates the functional", &
157 lone_keyword_l_val=.true., default_l_val=.false.)
161 description=
"scales the exchange part of the functional", &
166 description=
"Potential parameter in erf(omega*r)/r", &
171 description=
"Defines the parameter of the adiabatic curve", &
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., &
183 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
184 description=
"activates the functional", &
185 lone_keyword_l_val=.true., default_l_val=.false.)
189 description=
"scales the exchange part of the functional", &
194 description=
"Potential parameter in erf(omega*r)/r", &
203 description=
"Uses the LYP functional", &
204 n_keywords=0, n_subsections=0, repeats=.false., &
206 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
207 description=
"activates the functional", &
208 lone_keyword_l_val=.true., default_l_val=.false.)
212 description=
"scales the correlation part of the functional", &
220 description=
"Uses the PADE functional", &
221 n_keywords=0, n_subsections=0, repeats=.false., &
223 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
224 description=
"activates the functional", &
225 lone_keyword_l_val=.true., default_l_val=.false.)
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], &
242 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
243 description=
"activates the functional", &
244 lone_keyword_l_val=.true., default_l_val=.false.)
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.)
259 description=
"scales the exchange part of the functional", &
264 description=
"OPTX a1 coefficient", &
265 default_r_val=1.05151_dp)
269 description=
"OPTX a2 coefficient", &
270 default_r_val=1.43169_dp)
274 description=
"OPTX gamma coefficient", &
275 default_r_val=0.006_dp)
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.)
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.)
304 description=
"Which one of the XGGA functionals should be used", &
305 usage=
"FUNCTIONAL PW86X", &
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.)
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 "], &
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"), &
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.)
360 description=
"scales the correlation part of the functional", &
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.)
376 description=
"Scaling of the energy functional", &
377 default_r_val=1.0_dp)
380 CALL keyword_create(keyword, __location__, name=
"PARAMETRIZATION", &
381 description=
"Which one of parametrizations should be used", &
382 usage=
"PARAMETRIZATION DMC", &
395 description=
"Uses the PZ functional.", &
396 n_keywords=1, n_subsections=0, repeats=.false., &
398 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
399 description=
"activates the functional", &
400 lone_keyword_l_val=.true., default_l_val=.false.)
403 CALL keyword_create(keyword, __location__, name=
"PARAMETRIZATION", &
404 description=
"Which one of parametrizations should be used", &
405 usage=
"PARAMETRIZATION DMC", &
415 description=
"scales the correlation part of the functional", &
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.)
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.)
445 description=
"Uses the VWN functional", &
446 n_keywords=0, n_subsections=0, repeats=.false., &
448 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
449 description=
"activates the functional", &
450 lone_keyword_l_val=.true., default_l_val=.false.)
454 description=
"scales the correlation part of the functional", &
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"), &
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"), &
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.)
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)
489 description=
"scales the exchange part of the functional", &
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., &
501 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
502 description=
"Activates the functional", &
503 lone_keyword_l_val=.true., default_l_val=.false.)
507 description=
"scales the exchange part of the functional", &
512 description=
"scales the correlation part of the functional", &
520 description=
"Uses the PBE functional", &
521 n_keywords=0, n_subsections=0, repeats=.false., &
523 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
524 description=
"activates the functional", &
525 lone_keyword_l_val=.true., default_l_val=.false.)
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.", &
535 enum_c_vals=[
"ORIG ",
"revPBE",
"PBEsol"], &
536 enum_desc=[
"original PBE ", &
537 "revised PBE (revPBE) ", &
538 "PBE for solids and surfaces (PBEsol)"], &
543 description=
"scales the exchange part of the functional", &
548 description=
"scales the correlation part of the functional", &
555 CALL create_gauxc_section(subsection)
560 description=
"Uses the short range PBE functional", &
561 n_keywords=0, n_subsections=0, repeats=.false., &
563 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
564 description=
"activates the functional", &
565 lone_keyword_l_val=.true., default_l_val=.false.)
569 description=
"scales the exchange part of the functional", &
574 description=
"scales the exchange part of the original hole PBE-functional", &
575 default_r_val=0.0_dp)
579 description=
"screening parameter", &
587 description=
"Uses the Becke 97 exchange correlation functional", &
588 n_keywords=0, n_subsections=0, repeats=.false., &
590 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
591 description=
"activates the functional", &
592 lone_keyword_l_val=.true., default_l_val=.false.)
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)
601 description=
"scales the correlation part of the functional", &
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 "], &
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., &
621 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
622 description=
"activates the functional", &
623 lone_keyword_l_val=.true., default_l_val=.false.)
627 description=
"scales the exchange part of the functional", &
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)
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)
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.)
655 description=
"scales the exchange part of the functional", &
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")
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.)
676 description=
"scales the exchange part of the functional", &
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")
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.)
697 description=
"scales the exchange part of the functional", &
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")
707 description=
"Parameter for Becke Roussel hole", &
708 default_r_val=1.0_dp)
715 description=
"Uses the BEEFvdW exchange functional", &
716 n_keywords=0, n_subsections=0, repeats=.false., &
718 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
719 description=
"activates the functional", &
720 lone_keyword_l_val=.true., default_l_val=.false.)
724 description=
"scales the exchange part of the functional", &
738 SUBROUTINE create_xc_potential_section(section)
744 cpassert(.NOT.
ASSOCIATED(section))
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.)
752 NULLIFY (subsection, keyword)
754 description=
"Uses the SAOP potential", &
755 n_keywords=3, n_subsections=0, repeats=.true.)
757 description=
"Value of the alpha parameter (default = 1.19).", &
758 usage=
"ALPHA 1.19", default_r_val=1.19_dp)
762 description=
"Value of the beta parameter (default = 0.01).", &
763 usage=
"BETA 0.01", default_r_val=0.01_dp)
767 description=
"Value of the K_rho parameter (default = 0.42).", &
768 usage=
"K_RHO 0.42", default_r_val=0.42_dp)
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"), &
787 END SUBROUTINE create_xc_potential_section
794 SUBROUTINE create_xc_kernel_section(section)
799 cpassert(.NOT.
ASSOCIATED(section))
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.)
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", &
824 description=
"List of parameters specific to the kernel function", &
825 usage=
"PARAMETER <REAL> .. <REAL>", &
826 type_of_var=
real_t, n_var=-1)
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)
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)
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)
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)
858 description=
"Scaling parameter for exchange kernel.", &
859 usage=
"SCALE_X 0.2", default_r_val=1.0_dp)
863 description=
"Scaling parameter for correlation kernel.", &
864 usage=
"SCALE_C 0.2", default_r_val=1.0_dp)
868 END SUBROUTINE create_xc_kernel_section
875 SUBROUTINE create_hfx_kernel_section(section)
881 cpassert(.NOT.
ASSOCIATED(section))
883 description=
"The hfx kernel to use. Cannot be combined with HF section.", &
884 n_keywords=1, n_subsections=2, repeats=.false.)
886 NULLIFY (subsection, keyword)
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.)
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)
906 description=
"Uses the HFXLR (long range) kernel", &
907 n_keywords=2, n_subsections=0, repeats=.false.)
909 description=
"Value of lower range cutoff of interaction [Bohr]", &
910 usage=
"RCUT 5.00", default_r_val=6.00_dp, unit_str=
"bohr")
914 description=
"Scaling parameter for HFX kernel.", &
915 usage=
"SCALE 0.25", default_r_val=1.00_dp)
921 END SUBROUTINE create_hfx_kernel_section
927 SUBROUTINE create_vdw_potential_section(section)
931 TYPE(
section_type),
POINTER :: newsection, print_key, subsection
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. ", &
939 n_keywords=1, n_subsections=1, repeats=.false.)
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."), &
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.)
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, &
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, &
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, &
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, &
992 description=
"Coordination number cutoff for D4", &
993 usage=
"D4_CN_CUTOFF 30.0", default_r_val=-1.0_dp, &
998 description=
"Type of potential", &
1000 usage=
"TYPE (DFTD2|DFTD3|DFTD3(BJ)|DFTD4)", &
1001 enum_c_vals=
s2a(
"DFTD2",
"DFTD3",
"DFTD3(BJ)",
"DFTD4"), &
1004 enum_desc=
s2a(
"Grimme D2 method", &
1005 "Grimme D3 method (zero damping)", &
1006 "Grimme D3 method (Becke-Johnson damping)", &
1007 "Grimme D4 method"), &
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")
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>", &
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.)
1040 description=
"Debug output for D4 method using reference code.", &
1041 usage=
"D4_DEBUG", default_l_val=.false., &
1042 lone_keyword_l_val=.true.)
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.)
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)
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)
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)
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])
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])
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])
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.)
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.)
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)
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.)
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.)
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)
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.)
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)
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.)
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., &
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., &
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)
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)
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)
1194 description=
"Controls the printing of some info about DFTD contributions", &
1199 NULLIFY (newsection)
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.)
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"), &
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"), &
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.)
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")
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")
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)
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)
1264 END SUBROUTINE create_vdw_potential_section
1271 SUBROUTINE create_gcp_potential_section(section)
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. ", &
1281 n_keywords=1, n_subsections=1, repeats=.false.)
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=
"---")
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])
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"])
1307 description=
"Verbose output for gCP calculation", &
1308 usage=
"VERBOSE logical_value", &
1309 default_l_val=.true., lone_keyword_l_val=.true.)
1313 END SUBROUTINE create_gcp_potential_section
1320 SUBROUTINE create_gauxc_section(section)
1325 cpassert(.NOT.
ASSOCIATED(section))
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.)
1335 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
1336 description=
"activates the functional", &
1337 lone_keyword_l_val=.true., default_l_val=.false.)
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")
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")
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"), &
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", &
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"), &
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", &
1432 description=
"Batch size for GauXC evaluation", &
1433 usage=
"BATCH_SIZE 512", &
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)
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", &
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.)
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.)
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.)
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", &
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"), &
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"), &
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"), &
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.)
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.)
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.)
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.)
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"), &
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)
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.)
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.)
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", &
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.)
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.)
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.)
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)
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)", &
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)", &
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")
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"), &
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"), &
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", &
1780 END SUBROUTINE create_gauxc_section
1793 cpassert(.NOT.
ASSOCIATED(section))
1795 description=
"Parameters needed for the calculation of the eXchange and Correlation potential", &
1796 n_keywords=5, n_subsections=2, repeats=.false.)
1798 NULLIFY (subsection, keyword)
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)
1806 CALL keyword_create(keyword, __location__, name=
"gradient_cutoff", &
1807 description=
"The cutoff on the gradient of the density used by the "// &
1809 usage=
"gradient_cutoff 1.e-11", default_r_val=1.0e-10_dp)
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)
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)
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", &
1831 enum_c_vals=
s2a(
"NONE",
"NN50",
"NN10",
"SPLINE2",
"NN6",
"SPLINE3",
"NN4"), &
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"), &
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.)
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"])
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.)
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.)
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)
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)
1910 CALL create_adiabatic_section(subsection)
1914 CALL create_xc_potential_section(subsection)
1918 CALL create_xc_kernel_section(subsection)
1922 CALL create_hfx_kernel_section(subsection)
1926 CALL create_vdw_potential_section(subsection)
1930 CALL create_gcp_potential_section(subsection)
1941 SUBROUTINE create_adiabatic_section(section)
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.)
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"), &
1959 enum_desc=
s2a(
"Use MCY3 hybrid functional"), &
1966 keyword, __location__, &
1968 description=
"The point to be used along the adiabatic curve (0 < λ < 1)", &
1969 usage=
"LAMBDA 0.71", &
1970 default_r_val=0.71_dp)
1976 keyword, __location__, &
1978 description=
"Long-range parameter", &
1979 usage=
"OMEGA 0.2", &
1980 default_r_val=0.2_dp)
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"), &
1992 enum_desc=
s2a(
"Use pade model: W(lambda)=a+(b*lambda)/(1+c*lambda)"), &
1996 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)
...