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