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