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