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