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 95700 : 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 95700 : 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 1148400 : Tao2003, Wellendorff2012])
88 :
89 95700 : 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 95700 : lone_keyword_i_val=xc_funct_no_shortcut)
109 95700 : CALL section_add_keyword(section, keyword)
110 95700 : 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 191400 : citations=[Becke1988])
116 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
117 : description="activates the functional", &
118 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
119 95700 : CALL section_add_keyword(subsection, keyword)
120 95700 : CALL keyword_release(keyword)
121 : CALL keyword_create( &
122 : keyword, __LOCATION__, name="scale_x", &
123 : description="scales the exchange part of the functional", &
124 95700 : default_r_val=1._dp)
125 95700 : CALL section_add_keyword(subsection, keyword)
126 95700 : CALL keyword_release(keyword)
127 :
128 95700 : CALL section_add_subsection(section, subsection)
129 95700 : 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 191400 : citations=[Lee1988])
135 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
136 : description="activates the functional", &
137 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
138 95700 : CALL section_add_keyword(subsection, keyword)
139 95700 : CALL keyword_release(keyword)
140 : CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
141 : description="Defines the parameter of the adiabatic curve.", &
142 95700 : default_r_val=1._dp)
143 95700 : CALL section_add_keyword(subsection, keyword)
144 95700 : CALL keyword_release(keyword)
145 :
146 95700 : CALL section_add_subsection(section, subsection)
147 95700 : 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 191400 : citations=[Becke1988])
153 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
154 : description="activates the functional", &
155 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
156 95700 : CALL section_add_keyword(subsection, keyword)
157 95700 : CALL keyword_release(keyword)
158 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
159 : description="scales the exchange part of the functional", &
160 95700 : default_r_val=1._dp)
161 95700 : CALL section_add_keyword(subsection, keyword)
162 95700 : CALL keyword_release(keyword)
163 : CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
164 : description="Potential parameter in erf(omega*r)/r", &
165 95700 : default_r_val=1._dp)
166 95700 : CALL section_add_keyword(subsection, keyword)
167 95700 : CALL keyword_release(keyword)
168 : CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
169 : description="Defines the parameter of the adiabatic curve", &
170 95700 : default_r_val=1._dp)
171 95700 : CALL section_add_keyword(subsection, keyword)
172 95700 : CALL keyword_release(keyword)
173 :
174 95700 : CALL section_add_subsection(section, subsection)
175 95700 : 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 191400 : citations=[Becke1988])
181 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
182 : description="activates the functional", &
183 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
184 95700 : CALL section_add_keyword(subsection, keyword)
185 95700 : CALL keyword_release(keyword)
186 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
187 : description="scales the exchange part of the functional", &
188 95700 : default_r_val=1._dp)
189 95700 : CALL section_add_keyword(subsection, keyword)
190 95700 : CALL keyword_release(keyword)
191 : CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
192 : description="Potential parameter in erf(omega*r)/r", &
193 95700 : default_r_val=1._dp)
194 95700 : CALL section_add_keyword(subsection, keyword)
195 95700 : CALL keyword_release(keyword)
196 :
197 95700 : CALL section_add_subsection(section, subsection)
198 95700 : 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 191400 : citations=[Lee1988])
204 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
205 : description="activates the functional", &
206 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
207 95700 : CALL section_add_keyword(subsection, keyword)
208 95700 : CALL keyword_release(keyword)
209 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
210 : description="scales the correlation part of the functional", &
211 95700 : default_r_val=1._dp)
212 95700 : CALL section_add_keyword(subsection, keyword)
213 95700 : CALL keyword_release(keyword)
214 95700 : CALL section_add_subsection(section, subsection)
215 95700 : 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 191400 : citations=[Goedecker1996])
221 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
222 : description="activates the functional", &
223 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
224 95700 : CALL section_add_keyword(subsection, keyword)
225 95700 : CALL keyword_release(keyword)
226 95700 : CALL section_add_subsection(section, subsection)
227 95700 : CALL section_release(subsection)
228 :
229 : CALL section_create(subsection, __LOCATION__, name="HCTH", &
230 : description="Uses the HCTH class of functionals", &
231 95700 : 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 574200 : default_i_val=120)
238 95700 : CALL section_add_keyword(subsection, keyword)
239 95700 : CALL keyword_release(keyword)
240 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
241 : description="activates the functional", &
242 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
243 95700 : CALL section_add_keyword(subsection, keyword)
244 95700 : CALL keyword_release(keyword)
245 95700 : CALL section_add_subsection(section, subsection)
246 95700 : CALL section_release(subsection)
247 :
248 : CALL section_create(subsection, __LOCATION__, name="OPTX", &
249 : description="Uses the OPTX functional", &
250 95700 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
251 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
252 : description="activates the functional", &
253 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
254 95700 : CALL section_add_keyword(subsection, keyword)
255 95700 : CALL keyword_release(keyword)
256 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
257 : description="scales the exchange part of the functional", &
258 95700 : default_r_val=1._dp)
259 95700 : CALL section_add_keyword(subsection, keyword)
260 95700 : CALL keyword_release(keyword)
261 : CALL keyword_create(keyword, __LOCATION__, name="a1", &
262 : description="OPTX a1 coefficient", &
263 95700 : default_r_val=1.05151_dp)
264 95700 : CALL section_add_keyword(subsection, keyword)
265 95700 : CALL keyword_release(keyword)
266 : CALL keyword_create(keyword, __LOCATION__, name="a2", &
267 : description="OPTX a2 coefficient", &
268 95700 : default_r_val=1.43169_dp)
269 95700 : CALL section_add_keyword(subsection, keyword)
270 95700 : CALL keyword_release(keyword)
271 : CALL keyword_create(keyword, __LOCATION__, name="gamma", &
272 : description="OPTX gamma coefficient", &
273 95700 : default_r_val=0.006_dp)
274 95700 : CALL section_add_keyword(subsection, keyword)
275 95700 : CALL keyword_release(keyword)
276 95700 : CALL section_add_subsection(section, subsection)
277 95700 : CALL section_release(subsection)
278 :
279 95700 : CALL libxc_add_sections(section)
280 :
281 : CALL section_create(subsection, __LOCATION__, name="CS1", &
282 : description="Uses the CS1 functional", &
283 95700 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
284 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
285 : description="activates the functional", &
286 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
287 95700 : CALL section_add_keyword(subsection, keyword)
288 95700 : CALL keyword_release(keyword)
289 95700 : CALL section_add_subsection(section, subsection)
290 95700 : 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 95700 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
296 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
297 : description="activates the functional", &
298 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
299 95700 : CALL section_add_keyword(subsection, keyword)
300 95700 : 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 765600 : default_i_val=xgga_b88x)
314 95700 : CALL section_add_keyword(subsection, keyword)
315 95700 : CALL keyword_release(keyword)
316 95700 : CALL section_add_subsection(section, subsection)
317 95700 : 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 95700 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
325 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
326 : description="activates the functional", &
327 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
328 95700 : CALL section_add_keyword(subsection, keyword)
329 95700 : 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 861300 : default_i_val=ke_llp)
344 95700 : CALL section_add_keyword(subsection, keyword)
345 95700 : CALL keyword_release(keyword)
346 95700 : CALL section_add_subsection(section, subsection)
347 95700 : CALL section_release(subsection)
348 :
349 : CALL section_create(subsection, __LOCATION__, name="P86C", &
350 : description="Uses the P86C functional", &
351 95700 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
352 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
353 : description="activates the functional", &
354 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
355 95700 : CALL section_add_keyword(subsection, keyword)
356 95700 : CALL keyword_release(keyword)
357 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
358 : description="scales the correlation part of the functional", &
359 95700 : default_r_val=1._dp)
360 95700 : CALL section_add_keyword(subsection, keyword)
361 95700 : CALL keyword_release(keyword)
362 95700 : CALL section_add_subsection(section, subsection)
363 95700 : CALL section_release(subsection)
364 :
365 : CALL section_create(subsection, __LOCATION__, name="PW92", &
366 : description="Uses the PerdewWang correlation functional.", &
367 95700 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
368 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
369 : description="activates the functional", &
370 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
371 95700 : CALL section_add_keyword(subsection, keyword)
372 95700 : CALL keyword_release(keyword)
373 : CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
374 : description="Scaling of the energy functional", &
375 95700 : default_r_val=1.0_dp)
376 95700 : CALL section_add_keyword(subsection, keyword)
377 95700 : 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 382800 : default_i_val=c_pw92)
387 95700 : CALL section_add_keyword(subsection, keyword)
388 95700 : CALL keyword_release(keyword)
389 95700 : CALL section_add_subsection(section, subsection)
390 95700 : 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 287100 : citations=[Perdew1981, Ortiz1994])
396 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
397 : description="activates the functional", &
398 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
399 95700 : CALL section_add_keyword(subsection, keyword)
400 95700 : 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 382800 : default_i_val=pz_orig)
410 95700 : CALL section_add_keyword(subsection, keyword)
411 95700 : CALL keyword_release(keyword)
412 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
413 : description="scales the correlation part of the functional", &
414 95700 : default_r_val=1._dp)
415 95700 : CALL section_add_keyword(subsection, keyword)
416 95700 : CALL keyword_release(keyword)
417 95700 : CALL section_add_subsection(section, subsection)
418 95700 : CALL section_release(subsection)
419 :
420 : CALL section_create(subsection, __LOCATION__, name="TFW", &
421 : description="Uses the TFW functional", &
422 95700 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
423 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
424 : description="activates the functional", &
425 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
426 95700 : CALL section_add_keyword(subsection, keyword)
427 95700 : CALL keyword_release(keyword)
428 95700 : CALL section_add_subsection(section, subsection)
429 95700 : CALL section_release(subsection)
430 :
431 : CALL section_create(subsection, __LOCATION__, name="TF", &
432 : description="Uses the TF functional", &
433 95700 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
434 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
435 : description="activates the functional", &
436 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
437 95700 : CALL section_add_keyword(subsection, keyword)
438 95700 : CALL keyword_release(keyword)
439 95700 : CALL section_add_subsection(section, subsection)
440 95700 : 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 191400 : citations=[Vosko1980])
446 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
447 : description="activates the functional", &
448 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
449 95700 : CALL section_add_keyword(subsection, keyword)
450 95700 : CALL keyword_release(keyword)
451 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
452 : description="scales the correlation part of the functional", &
453 95700 : default_r_val=1._dp)
454 95700 : CALL section_add_keyword(subsection, keyword)
455 95700 : 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 95700 : default_i_val=do_vwn5)
466 :
467 95700 : CALL section_add_keyword(subsection, keyword)
468 95700 : CALL keyword_release(keyword)
469 95700 : CALL section_add_subsection(section, subsection)
470 95700 : CALL section_release(subsection)
471 :
472 : CALL section_create(subsection, __LOCATION__, name="XALPHA", &
473 : description="Uses the XALPHA (SLATER) functional.", &
474 95700 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
475 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
476 : description="activates the functional", &
477 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
478 95700 : CALL section_add_keyword(subsection, keyword)
479 95700 : 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 95700 : usage="XA 0.7", default_r_val=2._dp/3._dp)
484 95700 : CALL section_add_keyword(subsection, keyword)
485 95700 : CALL keyword_release(keyword)
486 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
487 : description="scales the exchange part of the functional", &
488 95700 : default_r_val=1._dp)
489 95700 : CALL section_add_keyword(subsection, keyword)
490 95700 : CALL keyword_release(keyword)
491 95700 : CALL section_add_subsection(section, subsection)
492 95700 : 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 191400 : citations=[Tao2003])
499 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
500 : description="Activates the functional", &
501 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
502 95700 : CALL section_add_keyword(subsection, keyword)
503 95700 : CALL keyword_release(keyword)
504 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
505 : description="scales the exchange part of the functional", &
506 95700 : default_r_val=1._dp)
507 95700 : CALL section_add_keyword(subsection, keyword)
508 95700 : CALL keyword_release(keyword)
509 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
510 : description="scales the correlation part of the functional", &
511 95700 : default_r_val=1._dp)
512 95700 : CALL section_add_keyword(subsection, keyword)
513 95700 : CALL keyword_release(keyword)
514 95700 : CALL section_add_subsection(section, subsection)
515 95700 : 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 382800 : citations=[Perdew1996, Zhang1998, Perdew2008])
521 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
522 : description="activates the functional", &
523 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
524 95700 : CALL section_add_keyword(subsection, keyword)
525 95700 : 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 669900 : default_i_val=xc_pbe_orig)
538 95700 : CALL section_add_keyword(subsection, keyword)
539 95700 : CALL keyword_release(keyword)
540 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
541 : description="scales the exchange part of the functional", &
542 95700 : default_r_val=1._dp)
543 95700 : CALL section_add_keyword(subsection, keyword)
544 95700 : CALL keyword_release(keyword)
545 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
546 : description="scales the correlation part of the functional", &
547 95700 : default_r_val=1._dp)
548 95700 : CALL section_add_keyword(subsection, keyword)
549 95700 : CALL keyword_release(keyword)
550 95700 : CALL section_add_subsection(section, subsection)
551 95700 : CALL section_release(subsection)
552 :
553 : CALL section_create(subsection, __LOCATION__, name="XWPBE", &
554 : description="Uses the short range PBE functional", &
555 : n_keywords=0, n_subsections=0, repeats=.FALSE., &
556 191400 : citations=[Heyd2004])
557 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
558 : description="activates the functional", &
559 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
560 95700 : CALL section_add_keyword(subsection, keyword)
561 95700 : CALL keyword_release(keyword)
562 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
563 : description="scales the exchange part of the functional", &
564 95700 : default_r_val=1._dp)
565 95700 : CALL section_add_keyword(subsection, keyword)
566 95700 : CALL keyword_release(keyword)
567 : CALL keyword_create(keyword, __LOCATION__, name="scale_x0", &
568 : description="scales the exchange part of the original hole PBE-functional", &
569 95700 : default_r_val=0.0_dp)
570 95700 : CALL section_add_keyword(subsection, keyword)
571 95700 : CALL keyword_release(keyword)
572 : CALL keyword_create(keyword, __LOCATION__, name="omega", &
573 : description="screening parameter", &
574 95700 : default_r_val=1._dp)
575 95700 : CALL section_add_keyword(subsection, keyword)
576 95700 : CALL keyword_release(keyword)
577 95700 : CALL section_add_subsection(section, subsection)
578 95700 : CALL section_release(subsection)
579 :
580 : CALL section_create(subsection, __LOCATION__, name="BECKE97", &
581 : description="Uses the Becke 97 exchange correlation functional", &
582 : n_keywords=0, n_subsections=0, repeats=.FALSE., &
583 287100 : citations=[Becke1997, Grimme2006])
584 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
585 : description="activates the functional", &
586 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
587 95700 : CALL section_add_keyword(subsection, keyword)
588 95700 : CALL keyword_release(keyword)
589 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
590 : description="scales the exchange part of the functional, if -1 the default for the given parametrization is used", &
591 95700 : default_r_val=-1._dp)
592 95700 : CALL section_add_keyword(subsection, keyword)
593 95700 : CALL keyword_release(keyword)
594 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
595 : description="scales the correlation part of the functional", &
596 95700 : default_r_val=1._dp)
597 95700 : CALL section_add_keyword(subsection, keyword)
598 95700 : CALL keyword_release(keyword)
599 : CALL keyword_create(keyword, __LOCATION__, name="parametrization", &
600 : description="switches between the B97 and Grimme parametrization ", &
601 : enum_i_vals=[xc_b97_orig, xc_b97_grimme, xc_b97_grimme, xc_b97_mardirossian, xc_b97_3c], &
602 : enum_c_vals=["ORIG ", "B97GRIMME ", "B97_GRIMME", "wB97X-V ", "B97-3c "], &
603 574200 : default_i_val=xc_b97_orig)
604 95700 : CALL section_add_keyword(subsection, keyword)
605 95700 : CALL keyword_release(keyword)
606 :
607 95700 : CALL section_add_subsection(section, subsection)
608 95700 : CALL section_release(subsection)
609 :
610 : CALL section_create(subsection, __LOCATION__, name="BECKE_ROUSSEL", &
611 : description="Becke Roussel exchange hole model. Can be used "// &
612 : "as long range correction with a truncated coulomb potential", &
613 : n_keywords=0, n_subsections=0, repeats=.FALSE., &
614 287100 : citations=[BeckeRoussel1989, Proynov2007])
615 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
616 : description="activates the functional", &
617 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
618 95700 : CALL section_add_keyword(subsection, keyword)
619 95700 : CALL keyword_release(keyword)
620 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
621 : description="scales the exchange part of the functional", &
622 95700 : default_r_val=1._dp)
623 95700 : CALL section_add_keyword(subsection, keyword)
624 95700 : CALL keyword_release(keyword)
625 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
626 : description="Defines the cutoff radius for the truncation. "// &
627 : "If put to zero, the standard full range potential will be used", &
628 95700 : usage="CUTOFF_RADIUS 2.0", default_r_val=0.0_dp)
629 95700 : CALL section_add_keyword(subsection, keyword)
630 95700 : CALL keyword_release(keyword)
631 : CALL keyword_create(keyword, __LOCATION__, name="GAMMA", &
632 : description="Parameter in the exchange hole. "// &
633 : "Usually this is put to 1.0 or 0.8", &
634 95700 : usage="GAMMA 0.8", default_r_val=1.0_dp)
635 95700 : CALL section_add_keyword(subsection, keyword)
636 95700 : CALL keyword_release(keyword)
637 95700 : CALL section_add_subsection(section, subsection)
638 95700 : CALL section_release(subsection)
639 :
640 : CALL section_create(subsection, __LOCATION__, name="LDA_HOLE_T_C_LR", &
641 : description="LDA exchange hole model in truncated coulomb potential", &
642 95700 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
643 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
644 : description="activates the functional", &
645 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
646 95700 : CALL section_add_keyword(subsection, keyword)
647 95700 : CALL keyword_release(keyword)
648 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
649 : description="scales the exchange part of the functional", &
650 95700 : default_r_val=1._dp)
651 95700 : CALL section_add_keyword(subsection, keyword)
652 95700 : CALL keyword_release(keyword)
653 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
654 : description="Defines cutoff for lower integration boundary", &
655 95700 : default_r_val=0.0_dp, unit_str="angstrom")
656 95700 : CALL section_add_keyword(subsection, keyword)
657 95700 : CALL keyword_release(keyword)
658 95700 : CALL section_add_subsection(section, subsection)
659 95700 : CALL section_release(subsection)
660 :
661 : CALL section_create(subsection, __LOCATION__, name="PBE_HOLE_T_C_LR", &
662 : description="PBE exchange hole model in trucanted coulomb potential", &
663 95700 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
664 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
665 : description="activates the functional", &
666 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
667 95700 : CALL section_add_keyword(subsection, keyword)
668 95700 : CALL keyword_release(keyword)
669 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
670 : description="scales the exchange part of the functional", &
671 95700 : default_r_val=1._dp)
672 95700 : CALL section_add_keyword(subsection, keyword)
673 95700 : CALL keyword_release(keyword)
674 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
675 : description="Defines cutoff for lower integration boundary", &
676 95700 : default_r_val=1.0_dp, unit_str="angstrom")
677 95700 : CALL section_add_keyword(subsection, keyword)
678 95700 : CALL keyword_release(keyword)
679 95700 : CALL section_add_subsection(section, subsection)
680 95700 : CALL section_release(subsection)
681 :
682 : CALL section_create(subsection, __LOCATION__, name="GV09", &
683 : description="Combination of three different exchange hole models", &
684 95700 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
685 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
686 : description="activates the functional", &
687 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
688 95700 : CALL section_add_keyword(subsection, keyword)
689 95700 : CALL keyword_release(keyword)
690 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
691 : description="scales the exchange part of the functional", &
692 95700 : default_r_val=1._dp)
693 95700 : CALL section_add_keyword(subsection, keyword)
694 95700 : CALL keyword_release(keyword)
695 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
696 : description="Defines cutoff for lower integration boundary", &
697 95700 : default_r_val=0.0_dp, unit_str="angstrom")
698 95700 : CALL section_add_keyword(subsection, keyword)
699 95700 : CALL keyword_release(keyword)
700 : CALL keyword_create(keyword, __LOCATION__, name="GAMMA", &
701 : description="Parameter for Becke Roussel hole", &
702 95700 : default_r_val=1.0_dp)
703 95700 : CALL section_add_keyword(subsection, keyword)
704 95700 : CALL keyword_release(keyword)
705 95700 : CALL section_add_subsection(section, subsection)
706 95700 : CALL section_release(subsection)
707 :
708 : CALL section_create(subsection, __LOCATION__, name="BEEF", & !rk: BEEF Exchange
709 : description="Uses the BEEFvdW exchange functional", &
710 : n_keywords=0, n_subsections=0, repeats=.FALSE., &
711 191400 : citations=[Wellendorff2012])
712 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
713 : description="activates the functional", &
714 95700 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
715 95700 : CALL section_add_keyword(subsection, keyword)
716 95700 : CALL keyword_release(keyword)
717 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
718 : description="scales the exchange part of the functional", &
719 95700 : default_r_val=1._dp)
720 95700 : CALL section_add_keyword(subsection, keyword)
721 95700 : CALL keyword_release(keyword)
722 95700 : CALL section_add_subsection(section, subsection)
723 95700 : CALL section_release(subsection)
724 :
725 95700 : END SUBROUTINE create_xc_fun_section
726 :
727 : ! **************************************************************************************************
728 : !> \brief creates the structure of the section needed to select an xc potential
729 : !> \param section the section that will be created
730 : !> \author thomas chassaing
731 : ! **************************************************************************************************
732 76560 : SUBROUTINE create_xc_potential_section(section)
733 : TYPE(section_type), POINTER :: section
734 :
735 : TYPE(keyword_type), POINTER :: keyword
736 : TYPE(section_type), POINTER :: subsection
737 :
738 76560 : CPASSERT(.NOT. ASSOCIATED(section))
739 : CALL section_create(section, __LOCATION__, name="xc_potential", &
740 : description="The xc potential to use (CAREFUL: xc potential here refers "// &
741 : "to potentials that are not derived from an xc functional, but rather are "// &
742 : "modelled directly. Therefore there is no consistent xc energy available. "// &
743 : "To still get an energy expression, see ENERGY below", &
744 76560 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
745 :
746 76560 : NULLIFY (subsection, keyword)
747 : CALL section_create(subsection, __LOCATION__, name="SAOP", &
748 : description="Uses the SAOP potential", &
749 76560 : n_keywords=3, n_subsections=0, repeats=.TRUE.)
750 : CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
751 : description="Value of the alpha parameter (default = 1.19).", &
752 76560 : usage="ALPHA 1.19", default_r_val=1.19_dp)
753 76560 : CALL section_add_keyword(subsection, keyword)
754 76560 : CALL keyword_release(keyword)
755 : CALL keyword_create(keyword, __LOCATION__, name="BETA", &
756 : description="Value of the beta parameter (default = 0.01).", &
757 76560 : usage="BETA 0.01", default_r_val=0.01_dp)
758 76560 : CALL section_add_keyword(subsection, keyword)
759 76560 : CALL keyword_release(keyword)
760 : CALL keyword_create(keyword, __LOCATION__, name="K_RHO", &
761 : description="Value of the K_rho parameter (default = 0.42).", &
762 76560 : usage="K_RHO 0.42", default_r_val=0.42_dp)
763 76560 : CALL section_add_keyword(subsection, keyword)
764 76560 : CALL keyword_release(keyword)
765 76560 : CALL section_add_subsection(section, subsection)
766 76560 : CALL section_release(subsection)
767 :
768 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY", &
769 : description="How to determine the total energy.", &
770 : usage="ENERGY [NONE,XC_FUNCTIONAL,SUM_EIGENVALUES", &
771 : enum_c_vals=s2a("NONE", "XC_FUNCTIONAL", "FUNCTIONAL", "SUM_EIGENVALUES", "SOE"), &
772 : enum_i_vals=[xc_pot_energy_none, &
773 : xc_pot_energy_xc_functional, &
774 : xc_pot_energy_xc_functional, &
775 : xc_pot_energy_sum_eigenvalues, &
776 : xc_pot_energy_sum_eigenvalues], &
777 76560 : default_i_val=xc_pot_energy_none)
778 76560 : CALL section_add_keyword(section, keyword)
779 76560 : CALL keyword_release(keyword)
780 :
781 76560 : END SUBROUTINE create_xc_potential_section
782 :
783 : ! **************************************************************************************************
784 : !> \brief creates the structure of the section needed to select an xc kernel
785 : !> \param section the section that will be created
786 : !> \author JGH
787 : ! **************************************************************************************************
788 76560 : SUBROUTINE create_xc_kernel_section(section)
789 : TYPE(section_type), POINTER :: section
790 :
791 : TYPE(keyword_type), POINTER :: keyword
792 :
793 76560 : CPASSERT(.NOT. ASSOCIATED(section))
794 : CALL section_create(section, __LOCATION__, name="XC_KERNEL", &
795 : description="The xc kernel to use (CAREFUL: xc kernel here refers "// &
796 : "to kernels that are not derived from an xc functional, but rather are "// &
797 : "modelled directly. This kernel will be used in a TDDFPT calculation. "// &
798 : "Cannot be combined with XC_FUNCTIONAL or XC_POTENTIAL.", &
799 76560 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
800 :
801 76560 : NULLIFY (keyword)
802 : CALL keyword_create( &
803 : keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
804 : description="Selection of kernel functionals.", &
805 : usage="&XC_KERNEL LDAfxc", &
806 : enum_c_vals=s2a("PADEfxc", "LDAfxc", "GGAfxc", "NONE"), &
807 : enum_i_vals=[fxc_funct_pade, fxc_funct_lda, fxc_funct_gga, fxc_none], &
808 : enum_desc=s2a("Fxc based on LDA PADE approximation", &
809 : "Fxc based on LDA functionals", &
810 : "Fxc model from fit to PBE functional", &
811 : "NONE"), &
812 : default_i_val=fxc_none, &
813 76560 : lone_keyword_i_val=fxc_none)
814 76560 : CALL section_add_keyword(section, keyword)
815 76560 : CALL keyword_release(keyword)
816 :
817 : CALL keyword_create(keyword, __LOCATION__, name="PARAMETER", &
818 : description="List of parameters specific to the kernel function", &
819 : usage="PARAMETER <REAL> .. <REAL>", &
820 76560 : type_of_var=real_t, n_var=-1)
821 76560 : CALL section_add_keyword(section, keyword)
822 76560 : CALL keyword_release(keyword)
823 : CALL keyword_create(keyword, __LOCATION__, name="GAMMA", &
824 : description="B97 GAMMA parameters [gx, gab, gaa]", &
825 : usage="GAMMA <REAL> <REAL> <REAL>", &
826 : default_r_vals=[0.004_dp, 0.006_dp, 0.2_dp], &
827 76560 : type_of_var=real_t, n_var=3)
828 76560 : CALL section_add_keyword(section, keyword)
829 76560 : CALL keyword_release(keyword)
830 : CALL keyword_create(keyword, __LOCATION__, name="C_XAA", &
831 : description="B97 C parameters for exchange", &
832 : usage="C_XAA <REAL> <REAL> <REAL>", &
833 : default_r_vals=[1.0_dp, 0.63_dp, 0.94_dp], &
834 76560 : type_of_var=real_t, n_var=3)
835 76560 : CALL section_add_keyword(section, keyword)
836 76560 : CALL keyword_release(keyword)
837 : CALL keyword_create(keyword, __LOCATION__, name="C_CAB", &
838 : description="B97 C parameters for same spin correlation.", &
839 : usage="C_CAB <REAL> <REAL> <REAL>", &
840 : default_r_vals=[1.0_dp, 0.75_dp, -4.60_dp], &
841 76560 : type_of_var=real_t, n_var=3)
842 76560 : CALL section_add_keyword(section, keyword)
843 76560 : CALL keyword_release(keyword)
844 : CALL keyword_create(keyword, __LOCATION__, name="C_CAA", &
845 : description="B97 C parameters for opposite spin correlation.", &
846 : usage="C_CAA <REAL> <REAL> <REAL>", &
847 : default_r_vals=[0.17_dp, 2.35_dp, -2.55_dp], &
848 76560 : type_of_var=real_t, n_var=3)
849 76560 : CALL section_add_keyword(section, keyword)
850 76560 : CALL keyword_release(keyword)
851 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
852 : description="Scaling parameter for exchange kernel.", &
853 76560 : usage="SCALE_X 0.2", default_r_val=1.0_dp)
854 76560 : CALL section_add_keyword(section, keyword)
855 76560 : CALL keyword_release(keyword)
856 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_C", &
857 : description="Scaling parameter for correlation kernel.", &
858 76560 : usage="SCALE_C 0.2", default_r_val=1.0_dp)
859 76560 : CALL section_add_keyword(section, keyword)
860 76560 : CALL keyword_release(keyword)
861 :
862 76560 : END SUBROUTINE create_xc_kernel_section
863 :
864 : ! **************************************************************************************************
865 : !> \brief creates the structure of the section needed to select an hfx kernel
866 : !> \param section the section that will be created
867 : !> \author JGH
868 : ! **************************************************************************************************
869 76560 : SUBROUTINE create_hfx_kernel_section(section)
870 : TYPE(section_type), POINTER :: section
871 :
872 : TYPE(keyword_type), POINTER :: keyword
873 : TYPE(section_type), POINTER :: subsection
874 :
875 76560 : CPASSERT(.NOT. ASSOCIATED(section))
876 : CALL section_create(section, __LOCATION__, name="HFX_KERNEL", &
877 : description="The hfx kernel to use. Cannot be combined with HF section.", &
878 76560 : n_keywords=1, n_subsections=2, repeats=.FALSE.)
879 :
880 76560 : NULLIFY (subsection, keyword)
881 : CALL keyword_create(keyword, __LOCATION__, name="DO_HFXSR", &
882 : description="Switch to use the HFXSR (short range) kernel.", &
883 : usage="DO_HFXSR T/F", default_l_val=.FALSE., &
884 76560 : lone_keyword_l_val=.TRUE.)
885 76560 : CALL section_add_keyword(section, keyword)
886 76560 : CALL keyword_release(keyword)
887 76560 : NULLIFY (subsection, keyword)
888 : CALL keyword_create(keyword, __LOCATION__, name="HFXSR_PRIMBAS", &
889 : description="Default number of primitives in ADMM basis in HFXSR. "// &
890 : "0 indicates the use of a contracted minimal basis. ", &
891 76560 : usage="HFXSR_PRIMBAS 3", default_i_val=0)
892 76560 : CALL section_add_keyword(section, keyword)
893 76560 : CALL keyword_release(keyword)
894 :
895 76560 : CALL create_hfx_section(subsection)
896 76560 : CALL section_add_subsection(section, subsection)
897 76560 : CALL section_release(subsection)
898 :
899 : CALL section_create(subsection, __LOCATION__, name="HFXLR", &
900 : description="Uses the HFXLR (long range) kernel", &
901 76560 : n_keywords=2, n_subsections=0, repeats=.FALSE.)
902 : CALL keyword_create(keyword, __LOCATION__, name="RCUT", &
903 : description="Value of lower range cutoff of interaction [Bohr]", &
904 76560 : usage="RCUT 5.00", default_r_val=6.00_dp, unit_str="bohr")
905 76560 : CALL section_add_keyword(subsection, keyword)
906 76560 : CALL keyword_release(keyword)
907 : CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
908 : description="Scaling parameter for HFX kernel.", &
909 76560 : usage="SCALE 0.25", default_r_val=1.00_dp)
910 76560 : CALL section_add_keyword(subsection, keyword)
911 76560 : CALL keyword_release(keyword)
912 76560 : CALL section_add_subsection(section, subsection)
913 76560 : CALL section_release(subsection)
914 :
915 76560 : END SUBROUTINE create_hfx_kernel_section
916 : ! **************************************************************************************************
917 : !> \brief creates the structure of the section needed for vdW potentials
918 : !> \param section the section that will be created
919 : !> \author jgh
920 : ! **************************************************************************************************
921 76560 : SUBROUTINE create_vdw_potential_section(section)
922 : TYPE(section_type), POINTER :: section
923 :
924 : TYPE(keyword_type), POINTER :: keyword
925 : TYPE(section_type), POINTER :: newsection, print_key, subsection
926 :
927 76560 : CPASSERT(.NOT. ASSOCIATED(section))
928 : CALL section_create(section, __LOCATION__, name="vdw_potential", &
929 : description="This section combines all possible additional dispersion "// &
930 : "corrections to the normal XC functionals. This can be more functionals "// &
931 : "or simple empirical pair potentials. ", &
932 : citations=[grimme2006, Tran2013], &
933 229680 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
934 :
935 76560 : NULLIFY (subsection, keyword)
936 : CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_TYPE", &
937 : variants=s2a("DISPERSION_FUNCTIONAL"), &
938 : description="Type of dispersion/vdW functional or potential to use", &
939 : usage="POTENTIAL_TYPE (NONE|PAIR_POTENTIAL|NON_LOCAL)", &
940 : enum_c_vals=s2a("NONE", "PAIR_POTENTIAL", "NON_LOCAL"), &
941 : enum_i_vals=[xc_vdw_fun_none, xc_vdw_fun_pairpot, xc_vdw_fun_nonloc], &
942 : enum_desc=s2a("No dispersion/van der Waals functional.", &
943 : "Pair potential van der Waals density functional, "// &
944 : "including Grimme's empirical DFT-D methods.", &
945 : "Nonlocal van der Waals density functional; more "// &
946 : "rigorous in principle, but significantly more "// &
947 : "time-consuming."), &
948 76560 : default_i_val=xc_vdw_fun_none)
949 76560 : CALL section_add_keyword(section, keyword)
950 76560 : CALL keyword_release(keyword)
951 :
952 : CALL section_create(subsection, __LOCATION__, name="PAIR_POTENTIAL", &
953 : description="Information on the pair potential to calculate dispersion", &
954 76560 : n_keywords=5, n_subsections=0, repeats=.TRUE.)
955 : CALL keyword_create(keyword, __LOCATION__, name="R_CUTOFF", &
956 : variants=s2a("D3_CUTOFF", "D4_3B_CUTOFF"), &
957 : description="Range of potential. The cutoff will be 2 times this value. "// &
958 : "In the case of D4 it will be used for the 3-body term", &
959 : usage="R_CUTOFF 20.0", default_r_val=20.0_dp, &
960 76560 : unit_str="angstrom")
961 76560 : CALL section_add_keyword(subsection, keyword)
962 76560 : CALL keyword_release(keyword)
963 : CALL keyword_create(keyword, __LOCATION__, name="D4_CUTOFF", &
964 : description="Range of potential. The cutoff will be 2 times this value. "// &
965 : "Only used for the 2-body term of D4", &
966 : usage="D4_CUTOFF 30.0", default_r_val=20.0_dp, &
967 76560 : unit_str="angstrom")
968 76560 : CALL section_add_keyword(subsection, keyword)
969 76560 : CALL keyword_release(keyword)
970 : CALL keyword_create(keyword, __LOCATION__, name="D4_CN_CUTOFF", &
971 : description="Coordination number cutoff for D4", &
972 : usage="D4_CN_CUTOFF 30.0", default_r_val=-1.0_dp, &
973 76560 : unit_str="angstrom")
974 76560 : CALL section_add_keyword(subsection, keyword)
975 76560 : CALL keyword_release(keyword)
976 : CALL keyword_create(keyword, __LOCATION__, name="TYPE", &
977 : description="Type of potential", &
978 : citations=[grimme2006, grimme2010, grimme2011, Caldeweyher2020], &
979 : usage="TYPE (DFTD2|DFTD3|DFTD3(BJ)|DFTD4)", &
980 : enum_c_vals=s2a("DFTD2", "DFTD3", "DFTD3(BJ)", "DFTD4"), &
981 : enum_i_vals=[vdw_pairpot_dftd2, vdw_pairpot_dftd3, &
982 : vdw_pairpot_dftd3bj, vdw_pairpot_dftd4], &
983 : enum_desc=s2a("Grimme D2 method", &
984 : "Grimme D3 method (zero damping)", &
985 : "Grimme D3 method (Becke-Johnson damping)", &
986 : "Grimme D4 method"), &
987 382800 : default_i_val=vdw_pairpot_dftd3bj)
988 76560 : CALL section_add_keyword(subsection, keyword)
989 76560 : CALL keyword_release(keyword)
990 : CALL keyword_create(keyword, __LOCATION__, name="PARAMETER_FILE_NAME", &
991 : description="Name of the parameter file, may include a path (not used for D4)", &
992 : usage="PARAMETER_FILE_NAME <FILENAME>", &
993 76560 : default_lc_val="dftd3.dat")
994 76560 : CALL section_add_keyword(subsection, keyword)
995 76560 : CALL keyword_release(keyword)
996 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_FUNCTIONAL", &
997 : description="Use parameters for this specific density functional. "// &
998 : "For available D3 and D3(BJ) parameters see: "// &
999 : "<https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3>. "// &
1000 : "For the defintion of D4 parameters see: "// &
1001 : "<https://github.com/dftd4/dftd4>.", &
1002 : usage="REFERENCE_FUNCTIONAL <functional>", &
1003 76560 : type_of_var=char_t)
1004 76560 : CALL section_add_keyword(subsection, keyword)
1005 76560 : CALL keyword_release(keyword)
1006 : CALL keyword_create(keyword, __LOCATION__, name="D4_REFERENCE_CODE", &
1007 : description="Calculate D4 energy using external library entirely. "// &
1008 : "Not recommended if you are using an MPI version of CP2K, because "// &
1009 : "DFT-D4 package does not support MPI parallelization. However, "// &
1010 : "if D4_DEBUG is triggered, you will need to switch this on. Note "// &
1011 : "that the external library is always needed no matter if this "// &
1012 : "option is triggered or not.", &
1013 : usage="D4_REFERENCE_CODE", default_l_val=.FALSE., &
1014 76560 : lone_keyword_l_val=.TRUE.)
1015 76560 : CALL section_add_keyword(subsection, keyword)
1016 76560 : CALL keyword_release(keyword)
1017 : CALL keyword_create(keyword, __LOCATION__, name="D4_DEBUG", &
1018 : description="Debug output for D4 method using reference code.", &
1019 : usage="D4_DEBUG", default_l_val=.FALSE., &
1020 76560 : lone_keyword_l_val=.TRUE.)
1021 76560 : CALL section_add_keyword(subsection, keyword)
1022 76560 : CALL keyword_release(keyword)
1023 : CALL keyword_create(keyword, __LOCATION__, name="D2_SCALING", &
1024 : variants=["SCALING"], &
1025 : description="XC Functional dependent scaling parameter. If omitted, CP2K attempts"// &
1026 : " to guess the xc functional that is in use and sets the associated scaling parameter.", &
1027 153120 : usage="SCALING 0.2", default_r_val=0._dp)
1028 76560 : CALL section_add_keyword(subsection, keyword)
1029 76560 : CALL keyword_release(keyword)
1030 : CALL keyword_create(keyword, __LOCATION__, name="D2_EXP_PRE", &
1031 : variants=["EXP_PRE"], &
1032 : description="Prefactor in exponential damping factor (DFT-D2 potential)", &
1033 153120 : usage="D2_EXP_PRE 20.", default_r_val=20._dp)
1034 76560 : CALL section_add_keyword(subsection, keyword)
1035 76560 : CALL keyword_release(keyword)
1036 : CALL keyword_create(keyword, __LOCATION__, name="EPS_CN", &
1037 : description="Cutoff value for coordination number function (DFT-D3 method)", &
1038 76560 : usage="EPS_CN 1.e-6_dp", default_r_val=1.e-6_dp)
1039 76560 : CALL section_add_keyword(subsection, keyword)
1040 76560 : CALL keyword_release(keyword)
1041 : CALL keyword_create(keyword, __LOCATION__, name="D3_SCALING", &
1042 : description="XC Functional dependent scaling parameters (s6,sr6,s8) for the DFT-D3 method."// &
1043 : " If omitted, CP2K attempts"// &
1044 : " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1045 : usage="D3_SCALING 1.0 1.0 1.0", n_var=3, &
1046 76560 : default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp])
1047 76560 : CALL section_add_keyword(subsection, keyword)
1048 76560 : CALL keyword_release(keyword)
1049 : CALL keyword_create(keyword, __LOCATION__, name="D3BJ_SCALING", &
1050 : description="XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D3(BJ) method."// &
1051 : " If omitted, CP2K attempts"// &
1052 : " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1053 : usage="D3BJ_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
1054 76560 : default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1055 76560 : CALL section_add_keyword(subsection, keyword)
1056 76560 : CALL keyword_release(keyword)
1057 : CALL keyword_create(keyword, __LOCATION__, name="D4_SCALING", &
1058 : description="XC Functional dependent scaling parameters (s6,a1,s8,a2) for the DFT-D4 method."// &
1059 : " If omitted, CP2K attempts"// &
1060 : " to guess the xc functional from REFERENCE_FUNCTIONAL and sets the associated scaling parameter.", &
1061 : usage="D4_SCALING 1.0 1.0 1.0 1.0", n_var=4, &
1062 76560 : default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1063 76560 : CALL section_add_keyword(subsection, keyword)
1064 76560 : CALL keyword_release(keyword)
1065 : CALL keyword_create(keyword, __LOCATION__, name="CALCULATE_C9_TERM", &
1066 : description="Calculate C9 terms in DFT-D3 model", &
1067 : usage="CALCULATE_C9_TERM", default_l_val=.FALSE., &
1068 76560 : lone_keyword_l_val=.TRUE.)
1069 76560 : CALL section_add_keyword(subsection, keyword)
1070 76560 : CALL keyword_release(keyword)
1071 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_C9_TERM", &
1072 : description="Calculate C9 terms in DFT-D3 model using reference coordination numbers", &
1073 : usage="REFERENCE_C9_TERM", default_l_val=.FALSE., &
1074 76560 : lone_keyword_l_val=.TRUE.)
1075 76560 : CALL section_add_keyword(subsection, keyword)
1076 76560 : CALL keyword_release(keyword)
1077 : CALL keyword_create(keyword, __LOCATION__, name="FACTOR_S9_TERM", &
1078 : description="S9 prefactor of the many-body term in the DFT-D4 method.", &
1079 76560 : usage="FACTOR_S9_TERM 1.e-0", default_r_val=1.00_dp)
1080 76560 : CALL section_add_keyword(subsection, keyword)
1081 76560 : CALL keyword_release(keyword)
1082 : CALL keyword_create(keyword, __LOCATION__, name="LONG_RANGE_CORRECTION", &
1083 : description="Calculate a long range correction to the DFT-D3 model."// &
1084 : " WARNING: Use with care! Only for isotropic dense systems.", &
1085 : usage="LONG_RANGE_CORRECTION", default_l_val=.FALSE., &
1086 76560 : lone_keyword_l_val=.TRUE.)
1087 76560 : CALL section_add_keyword(subsection, keyword)
1088 76560 : CALL keyword_release(keyword)
1089 : CALL keyword_create(keyword, __LOCATION__, name="SHORT_RANGE_CORRECTION", &
1090 : description="Calculate a short-range bond correction to the DFT-D3 model", &
1091 : usage="SHORT_RANGE_CORRECTION", default_l_val=.FALSE., &
1092 76560 : lone_keyword_l_val=.TRUE.)
1093 76560 : CALL section_add_keyword(subsection, keyword)
1094 76560 : CALL keyword_release(keyword)
1095 : CALL keyword_create(keyword, __LOCATION__, name="SHORT_RANGE_CORRECTION_PARAMETERS", &
1096 : description="Parameters for the short-range bond correction to the DFT-D3 model. "// &
1097 : "s*(za*zb)^t1*EXP(-g*dr*r0ab^t2), parameters: s, g, t1, t2 "// &
1098 : "Defaults: s=0.08, g=10.0, t1=0.5, t2=-1.0 ", &
1099 : usage="SHORT_RANGE_CORRECTION_PARAMETERS", default_r_vals=[0.08_dp, 10.0_dp, 0.5_dp, -1.0_dp], &
1100 76560 : n_var=4, type_of_var=real_t)
1101 76560 : CALL section_add_keyword(subsection, keyword)
1102 76560 : CALL keyword_release(keyword)
1103 : ! KG molecular corrections
1104 : CALL keyword_create(keyword, __LOCATION__, name="MOLECULE_CORRECTION", &
1105 : description="Calculate a intermolecular correction to the DFT-D3 model", &
1106 : usage="MOLECULE_CORRECTION", default_l_val=.FALSE., &
1107 76560 : lone_keyword_l_val=.TRUE.)
1108 76560 : CALL section_add_keyword(subsection, keyword)
1109 76560 : CALL keyword_release(keyword)
1110 : CALL keyword_create(keyword, __LOCATION__, name="MOLECULE_CORRECTION_C8", &
1111 : description="Calculate a intermolecular correction to the C8 term in the DFT-D3 model", &
1112 76560 : usage="MOLECULE_CORRECTION_C8 1.0 ", default_r_val=0.0_dp)
1113 76560 : CALL section_add_keyword(subsection, keyword)
1114 76560 : CALL keyword_release(keyword)
1115 : CALL keyword_create(keyword, __LOCATION__, name="VERBOSE_OUTPUT", &
1116 : description="Extensive output for the DFT-D2 and DFT-D3 models."// &
1117 : " Needs PRINT_DFTD section to be specified.", &
1118 : usage="VERBOSE_OUTPUT", default_l_val=.FALSE., &
1119 76560 : lone_keyword_l_val=.TRUE.)
1120 76560 : CALL section_add_keyword(subsection, keyword)
1121 76560 : CALL keyword_release(keyword)
1122 :
1123 : ! Set coordination numbers by atom numbers
1124 : CALL keyword_create(keyword, __LOCATION__, name="D3_EXCLUDE_KIND", &
1125 : description="Specifies the atomic kinds excluded in the DFT-D3 calculation.", &
1126 : usage="D3_EXCLUDE_KIND kind1 kind2 ... ", repeats=.FALSE., &
1127 76560 : n_var=-1, type_of_var=integer_t)
1128 76560 : CALL section_add_keyword(subsection, keyword)
1129 76560 : CALL keyword_release(keyword)
1130 :
1131 : ! Ignore selected pair interactins
1132 : CALL keyword_create(keyword, __LOCATION__, name="D3_EXCLUDE_KIND_PAIR", &
1133 : description="Specifies the atomic kinds for interactions excluded from the DFT-D3 calculation.", &
1134 : usage="D3_EXCLUDE_KIND_PAIR kind1 kind2 ", repeats=.TRUE., &
1135 76560 : n_var=2, type_of_var=integer_t)
1136 76560 : CALL section_add_keyword(subsection, keyword)
1137 76560 : CALL keyword_release(keyword)
1138 :
1139 : ! Set coordination numbers by atom kinds
1140 : CALL keyword_create(keyword, __LOCATION__, name="KIND_COORDINATION_NUMBERS", &
1141 : description="Specifies the coordination number for a kind for the C9 term in DFT-D3.", &
1142 : usage="KIND_COORDINATION_NUMBERS CN kind ", repeats=.TRUE., &
1143 76560 : n_var=-1, type_of_var=char_t)
1144 76560 : CALL section_add_keyword(subsection, keyword)
1145 76560 : CALL keyword_release(keyword)
1146 : ! Set coordination numbers by atom numbers
1147 : CALL keyword_create(keyword, __LOCATION__, name="ATOM_COORDINATION_NUMBERS", &
1148 : description="Specifies the coordination number of a set of atoms for the C9 term in DFT-D3.", &
1149 : usage="ATOM_COORDINATION_NUMBERS CN atom1 atom2 ... ", repeats=.TRUE., &
1150 76560 : n_var=-1, type_of_var=char_t)
1151 76560 : CALL section_add_keyword(subsection, keyword)
1152 76560 : CALL keyword_release(keyword)
1153 :
1154 : ! parameter specification atom by atom
1155 : CALL keyword_create(keyword, __LOCATION__, name="ATOMPARM", &
1156 : description="Specifies parameters for atom types (in atomic units). If "// &
1157 : "not provided default parameters are used (DFT-D2).", &
1158 : usage="ATOMPARM <ELEMENT> <C6_parameter> <vdw_radii>", &
1159 76560 : repeats=.TRUE., n_var=-1, type_of_var=char_t)
1160 76560 : CALL section_add_keyword(subsection, keyword)
1161 76560 : CALL keyword_release(keyword)
1162 :
1163 76560 : NULLIFY (print_key)
1164 : CALL cp_print_key_section_create(print_key, __LOCATION__, "PRINT_DFTD", &
1165 : description="Controls the printing of some info about DFTD contributions", &
1166 76560 : print_level=high_print_level, add_last=add_last_numeric, filename="")
1167 76560 : CALL section_add_subsection(subsection, print_key)
1168 76560 : CALL section_release(print_key)
1169 :
1170 76560 : NULLIFY (newsection)
1171 76560 : CALL create_eeq_control_section(newsection)
1172 76560 : CALL section_add_subsection(subsection, newsection)
1173 76560 : CALL section_release(newsection)
1174 :
1175 76560 : CALL section_add_subsection(section, subsection)
1176 76560 : CALL section_release(subsection)
1177 :
1178 : ! nonlocal section
1179 76560 : NULLIFY (subsection, keyword)
1180 : CALL section_create(subsection, __LOCATION__, name="NON_LOCAL", &
1181 : description="Information on the non local part of dispersion functionals. "// &
1182 : "Correct functionals require a corresponding setting of XC_FUNCTIONAL.", &
1183 76560 : n_keywords=0, n_subsections=0, repeats=.TRUE.)
1184 :
1185 : CALL keyword_create(keyword, __LOCATION__, name="TYPE", &
1186 : description="Type of functional (the corresponding kernel data file should be selected). "// &
1187 : "Allows for common forms such as vdW-DF, vdW-DF2, optB88-vdW, rVV10.", &
1188 : usage="TYPE DRSLL", &
1189 : enum_c_vals=s2a("DRSLL", "LMKLL", "RVV10"), &
1190 : enum_i_vals=[vdw_nl_DRSLL, vdw_nl_LMKLL, vdw_nl_RVV10], &
1191 : enum_desc=s2a("Dion-Rydberg-Schroeder-Langreth-Lundqvist nonlocal van der Waals density functional", &
1192 : "Lee-Murray-Kong-Lundqvist-Langreth nonlocal van der Waals density functional", &
1193 : "Revised Vydrov-van Voorhis nonlocal van der Waals density functional"), &
1194 : citations=[Tran2013], &
1195 153120 : default_i_val=vdw_nl_DRSLL)
1196 76560 : CALL section_add_keyword(subsection, keyword)
1197 76560 : CALL keyword_release(keyword)
1198 : CALL keyword_create(keyword, __LOCATION__, name="VERBOSE_OUTPUT", &
1199 : description="Extensive output for non local functionals", &
1200 : usage="VERBOSE_OUTPUT", default_l_val=.FALSE., &
1201 76560 : lone_keyword_l_val=.TRUE.)
1202 76560 : CALL section_add_keyword(subsection, keyword)
1203 76560 : CALL keyword_release(keyword)
1204 : CALL keyword_create(keyword, __LOCATION__, name="KERNEL_FILE_NAME", &
1205 : description="Name of the kernel data file, may include a path. "// &
1206 : "vdW_kernel_table.dat is for DRSLL and LMKLL and "// &
1207 : "rVV10_kernel_table.dat is for rVV10.", &
1208 : usage="KERNEL_FILE_NAME <FILENAME>", &
1209 76560 : default_lc_val="vdW_kernel_table.dat")
1210 76560 : CALL section_add_keyword(subsection, keyword)
1211 76560 : CALL keyword_release(keyword)
1212 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF", &
1213 : description="The cutoff of the FFT grid used in the calculation "// &
1214 : "of the nonlocal vdW functional [Ry].", &
1215 : usage="CUTOFF 300", &
1216 76560 : default_r_val=-1._dp, unit_str="Ry")
1217 76560 : CALL section_add_keyword(subsection, keyword)
1218 76560 : CALL keyword_release(keyword)
1219 : CALL keyword_create(keyword, __LOCATION__, name="PARAMETERS", &
1220 : description="Parameters b and C of the rVV10 functional", &
1221 : usage="PARAMETERS 6.3 0.0093", &
1222 76560 : type_of_var=real_t, default_r_vals=[6.3_dp, 0.0093_dp], n_var=2)
1223 76560 : CALL section_add_keyword(subsection, keyword)
1224 76560 : CALL keyword_release(keyword)
1225 : CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
1226 : description="Scales the energy contribution of the rVV10 functional", &
1227 : usage="SCALE 1.0", &
1228 76560 : type_of_var=real_t, default_r_val=1.0_dp)
1229 76560 : CALL section_add_keyword(subsection, keyword)
1230 76560 : CALL keyword_release(keyword)
1231 :
1232 76560 : CALL section_add_subsection(section, subsection)
1233 76560 : CALL section_release(subsection)
1234 :
1235 76560 : END SUBROUTINE create_vdw_potential_section
1236 :
1237 : ! **************************************************************************************************
1238 : !> \brief creates the structure of the section needed for gCP potentials
1239 : !> \param section the section that will be created
1240 : !> \author jgh
1241 : ! **************************************************************************************************
1242 76560 : SUBROUTINE create_gcp_potential_section(section)
1243 : TYPE(section_type), POINTER :: section
1244 :
1245 : TYPE(keyword_type), POINTER :: keyword
1246 :
1247 76560 : CPASSERT(.NOT. ASSOCIATED(section))
1248 : CALL section_create(section, __LOCATION__, name="gcp_potential", &
1249 : description="This section combines geometrical counterpoise potentials."// &
1250 : " This is a simple empirical pair potential to correct for BSSE. ", &
1251 : citations=[Kruse2012], &
1252 153120 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
1253 :
1254 76560 : NULLIFY (keyword)
1255 : CALL keyword_create(keyword, __LOCATION__, name="PARAMETER_FILE_NAME", &
1256 : description="Name of the parameter file, may include a path", &
1257 : usage="PARAMETER_FILE_NAME <FILENAME>", &
1258 76560 : default_lc_val="---")
1259 76560 : CALL section_add_keyword(section, keyword)
1260 76560 : CALL keyword_release(keyword)
1261 :
1262 : CALL keyword_create(keyword, __LOCATION__, name="GLOBAL_PARAMETERS", &
1263 : description="Global parameters of the gCP method."// &
1264 : " Parameters are sigma, alpha, beta, eta from the original paper.", &
1265 : usage="GLOBAL_PARAMETERS 1.0 1.0 1.0 1.0", n_var=4, &
1266 76560 : default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp])
1267 76560 : CALL section_add_keyword(section, keyword)
1268 76560 : CALL keyword_release(keyword)
1269 :
1270 : CALL keyword_create(keyword, __LOCATION__, name="DELTA_ENERGY", &
1271 : description="Specify the delta energy [Hartree] term for an atom kind", &
1272 : usage="DELTA_ENERGY type value", &
1273 229680 : type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=["XX ", "0.0"])
1274 76560 : CALL section_add_keyword(section, keyword)
1275 76560 : CALL keyword_release(keyword)
1276 :
1277 : CALL keyword_create(keyword, __LOCATION__, name="VERBOSE", &
1278 : description="Verbose output for gCP calculation", &
1279 : usage="VERBOSE logical_value", &
1280 76560 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1281 76560 : CALL section_add_keyword(section, keyword)
1282 76560 : CALL keyword_release(keyword)
1283 :
1284 76560 : END SUBROUTINE create_gcp_potential_section
1285 :
1286 : ! **************************************************************************************************
1287 : !> \brief creates the input section for the xc part
1288 : !> \param section the section to create
1289 : !> \author fawzi
1290 : ! **************************************************************************************************
1291 76560 : SUBROUTINE create_xc_section(section)
1292 : TYPE(section_type), POINTER :: section
1293 :
1294 : TYPE(keyword_type), POINTER :: keyword
1295 : TYPE(section_type), POINTER :: subsection
1296 :
1297 76560 : CPASSERT(.NOT. ASSOCIATED(section))
1298 : CALL section_create(section, __LOCATION__, name="xc", &
1299 : description="Parameters needed for the calculation of the eXchange and Correlation potential", &
1300 76560 : n_keywords=5, n_subsections=2, repeats=.FALSE.)
1301 :
1302 76560 : NULLIFY (subsection, keyword)
1303 :
1304 : CALL keyword_create(keyword, __LOCATION__, name="density_cutoff", &
1305 : description="The cutoff on the density used by the xc calculation", &
1306 76560 : usage="density_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1307 76560 : CALL section_add_keyword(section, keyword)
1308 76560 : CALL keyword_release(keyword)
1309 :
1310 : CALL keyword_create(keyword, __LOCATION__, name="gradient_cutoff", &
1311 : description="The cutoff on the gradient of the density used by the "// &
1312 : "xc calculation", &
1313 76560 : usage="gradient_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1314 76560 : CALL section_add_keyword(section, keyword)
1315 76560 : CALL keyword_release(keyword)
1316 :
1317 : CALL keyword_create(keyword, __LOCATION__, name="DENSITY_SMOOTH_CUTOFF_RANGE", &
1318 : description="Parameter for the smoothing procedure in xc calculation", &
1319 76560 : usage="DENSITY_SMOOTH_CUTOFF_RANGE {real}", default_r_val=0.0_dp)
1320 76560 : CALL section_add_keyword(section, keyword)
1321 76560 : CALL keyword_release(keyword)
1322 :
1323 : CALL keyword_create(keyword, __LOCATION__, name="tau_cutoff", &
1324 : description="The cutoff on tau used by the xc calculation", &
1325 76560 : usage="tau_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1326 76560 : CALL section_add_keyword(section, keyword)
1327 76560 : CALL keyword_release(keyword)
1328 :
1329 : CALL section_create(subsection, __LOCATION__, name="xc_grid", & !FM to do
1330 : description="The xc parameters used when calculating the xc on the grid", &
1331 76560 : n_keywords=5, n_subsections=0, repeats=.FALSE.)
1332 : CALL keyword_create(keyword, __LOCATION__, name="xc_smooth_rho", &
1333 : description="The density smoothing used for the xc calculation", &
1334 : usage="xc_smooth_rho nn10", default_i_val=xc_rho_no_smooth, &
1335 : enum_c_vals=s2a("NONE", "NN50", "NN10", "SPLINE2", "NN6", "SPLINE3", "NN4"), &
1336 : enum_i_vals=[xc_rho_no_smooth, xc_rho_nn50, xc_rho_nn10, &
1337 : xc_rho_spline2_smooth, xc_rho_spline2_smooth, xc_rho_spline3_smooth, &
1338 76560 : xc_rho_spline3_smooth])
1339 76560 : CALL section_add_keyword(subsection, keyword)
1340 76560 : CALL keyword_release(keyword)
1341 :
1342 : CALL keyword_create(keyword, __LOCATION__, name="xc_deriv", &
1343 : description="The method used to compute the derivatives", &
1344 : usage="xc_deriv NN10_SMOOTH", default_i_val=xc_deriv_pw, &
1345 : enum_c_vals=s2a("PW", "SPLINE3", "SPLINE2", "NN50_SMOOTH", "NN10_SMOOTH", &
1346 : "SPLINE2_SMOOTH", "NN6_SMOOTH", "SPLINE3_SMOOTH", "NN4_SMOOTH", "COLLOCATE"), &
1347 : enum_i_vals=[xc_deriv_pw, xc_deriv_spline3, xc_deriv_spline2, &
1348 : xc_deriv_nn50_smooth, xc_deriv_nn10_smooth, xc_deriv_spline2_smooth, &
1349 : xc_deriv_spline2_smooth, xc_deriv_spline3_smooth, xc_deriv_spline3_smooth, &
1350 76560 : xc_deriv_collocate])
1351 76560 : CALL section_add_keyword(subsection, keyword)
1352 76560 : CALL keyword_release(keyword)
1353 :
1354 : CALL keyword_create(keyword, __LOCATION__, name="use_finer_grid", &
1355 : description="Uses a finer grid only to calculate the xc", &
1356 : usage="use_finer_grid", default_l_val=.FALSE., &
1357 76560 : lone_keyword_l_val=.TRUE.)
1358 76560 : CALL section_add_keyword(subsection, keyword)
1359 76560 : CALL keyword_release(keyword)
1360 :
1361 : CALL keyword_create(keyword, __LOCATION__, name="2ND_DERIV_ANALYTICAL", &
1362 : description="Use analytical formulas or finite differences for 2nd derivatives of XC", &
1363 : usage="2ND_DERIV_ANALYTICAL logical", default_l_val=.TRUE., &
1364 76560 : lone_keyword_l_val=.TRUE.)
1365 76560 : CALL section_add_keyword(section, keyword)
1366 76560 : CALL keyword_release(keyword)
1367 :
1368 : CALL keyword_create(keyword, __LOCATION__, name="3RD_DERIV_ANALYTICAL", &
1369 : description="Use analytical formulas or finite differences for 3rd derivatives of XC", &
1370 : usage="3RD_DERIV_ANALYTICAL logical", default_l_val=.TRUE., &
1371 76560 : lone_keyword_l_val=.TRUE.)
1372 76560 : CALL section_add_keyword(section, keyword)
1373 76560 : CALL keyword_release(keyword)
1374 :
1375 : CALL keyword_create(keyword, __LOCATION__, name="STEP_SIZE", &
1376 : description="Step size in terms of the first order potential for the numerical "// &
1377 : "evaluation of XC derivatives", &
1378 76560 : usage="STEP_SIZE 1.0E-3", default_r_val=1e-3_dp)
1379 76560 : CALL section_add_keyword(section, keyword)
1380 76560 : CALL keyword_release(keyword)
1381 :
1382 : CALL keyword_create(keyword, __LOCATION__, name="NSTEPS", &
1383 : description="Number of steps to consider in each direction for the numerical "// &
1384 : "evaluation of XC derivatives. Must be a value from 1 to 4 (Default: 3).", &
1385 76560 : usage="NSTEPS 4", default_i_val=3)
1386 76560 : CALL section_add_keyword(section, keyword)
1387 76560 : CALL keyword_release(keyword)
1388 :
1389 76560 : CALL section_add_subsection(section, subsection)
1390 76560 : CALL section_release(subsection)
1391 :
1392 76560 : CALL create_xc_fun_section(subsection)
1393 76560 : CALL section_add_subsection(section, subsection)
1394 76560 : CALL section_release(subsection)
1395 :
1396 76560 : CALL create_hfx_section(subsection)
1397 76560 : CALL section_add_subsection(section, subsection)
1398 76560 : CALL section_release(subsection)
1399 :
1400 76560 : CALL create_mp2_section(subsection)
1401 76560 : CALL section_add_subsection(section, subsection)
1402 76560 : CALL section_release(subsection)
1403 :
1404 76560 : CALL create_adiabatic_section(subsection)
1405 76560 : CALL section_add_subsection(section, subsection)
1406 76560 : CALL section_release(subsection)
1407 :
1408 76560 : CALL create_xc_potential_section(subsection)
1409 76560 : CALL section_add_subsection(section, subsection)
1410 76560 : CALL section_release(subsection)
1411 :
1412 76560 : CALL create_xc_kernel_section(subsection)
1413 76560 : CALL section_add_subsection(section, subsection)
1414 76560 : CALL section_release(subsection)
1415 :
1416 76560 : CALL create_hfx_kernel_section(subsection)
1417 76560 : CALL section_add_subsection(section, subsection)
1418 76560 : CALL section_release(subsection)
1419 :
1420 76560 : CALL create_vdw_potential_section(subsection)
1421 76560 : CALL section_add_subsection(section, subsection)
1422 76560 : CALL section_release(subsection)
1423 :
1424 76560 : CALL create_gcp_potential_section(subsection)
1425 76560 : CALL section_add_subsection(section, subsection)
1426 76560 : CALL section_release(subsection)
1427 :
1428 76560 : END SUBROUTINE create_xc_section
1429 :
1430 : ! **************************************************************************************************
1431 : !> \brief creates the section for adiabatic hybrid functionals
1432 : !> \param section ...
1433 : !> \author Manuel Guidon
1434 : ! **************************************************************************************************
1435 76560 : SUBROUTINE create_adiabatic_section(section)
1436 : TYPE(section_type), POINTER :: section
1437 :
1438 : TYPE(keyword_type), POINTER :: keyword
1439 :
1440 76560 : CPASSERT(.NOT. ASSOCIATED(section))
1441 : CALL section_create(section, __LOCATION__, name="ADIABATIC_RESCALING", &
1442 : description="Parameters for self interaction corrected hybrid functionals", &
1443 76560 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
1444 76560 : NULLIFY (keyword)
1445 : CALL keyword_create( &
1446 : keyword, __LOCATION__, &
1447 : name="FUNCTIONAL_TYPE", &
1448 : description="Which Hybrid functional should be used. "// &
1449 : "(Has to be consistent with the definitions in XC and HF).", &
1450 : usage="FUNCTIONAL_TYPE MCY3", &
1451 : enum_c_vals=s2a("MCY3"), &
1452 : enum_i_vals=[do_adiabatic_hybrid_mcy3], &
1453 : enum_desc=s2a("Use MCY3 hybrid functional"), &
1454 76560 : default_i_val=do_adiabatic_hybrid_mcy3)
1455 76560 : CALL section_add_keyword(section, keyword)
1456 76560 : CALL keyword_release(keyword)
1457 :
1458 76560 : NULLIFY (keyword)
1459 : CALL keyword_create( &
1460 : keyword, __LOCATION__, &
1461 : name="LAMBDA", &
1462 : description="The point to be used along the adiabatic curve (0 < λ < 1)", &
1463 : usage="LAMBDA 0.71", &
1464 76560 : default_r_val=0.71_dp)
1465 76560 : CALL section_add_keyword(section, keyword)
1466 76560 : CALL keyword_release(keyword)
1467 :
1468 76560 : NULLIFY (keyword)
1469 : CALL keyword_create( &
1470 : keyword, __LOCATION__, &
1471 : name="OMEGA", &
1472 : description="Long-range parameter", &
1473 : usage="OMEGA 0.2", &
1474 76560 : default_r_val=0.2_dp)
1475 76560 : CALL section_add_keyword(section, keyword)
1476 76560 : CALL keyword_release(keyword)
1477 :
1478 76560 : NULLIFY (keyword)
1479 : CALL keyword_create( &
1480 : keyword, __LOCATION__, &
1481 : name="FUNCTIONAL_MODEL", &
1482 : description="Which model for the coupling constant integration should be used. ", &
1483 : usage="FUNCTIONAL_MODEL PADE", &
1484 : enum_c_vals=s2a("PADE"), &
1485 : enum_i_vals=[do_adiabatic_model_pade], &
1486 : enum_desc=s2a("Use pade model: W(lambda)=a+(b*lambda)/(1+c*lambda)"), &
1487 76560 : default_i_val=do_adiabatic_model_pade)
1488 76560 : CALL section_add_keyword(section, keyword)
1489 76560 : CALL keyword_release(keyword)
1490 76560 : END SUBROUTINE create_adiabatic_section
1491 :
1492 : END MODULE input_cp2k_xc
|