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 68320 : 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 68320 : 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 819840 : Tao2003, Wellendorff2012/))
86 :
87 68320 : 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 68320 : lone_keyword_i_val=xc_funct_no_shortcut)
104 68320 : CALL section_add_keyword(section, keyword)
105 68320 : 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 136640 : citations=(/Becke1988/))
111 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
112 : description="activates the functional", &
113 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
114 68320 : CALL section_add_keyword(subsection, keyword)
115 68320 : CALL keyword_release(keyword)
116 : CALL keyword_create( &
117 : keyword, __LOCATION__, name="scale_x", &
118 : description="scales the exchange part of the functional", &
119 68320 : default_r_val=1._dp)
120 68320 : CALL section_add_keyword(subsection, keyword)
121 68320 : CALL keyword_release(keyword)
122 :
123 68320 : CALL section_add_subsection(section, subsection)
124 68320 : 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 136640 : citations=(/Lee1988/))
130 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
131 : description="activates the functional", &
132 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
133 68320 : CALL section_add_keyword(subsection, keyword)
134 68320 : CALL keyword_release(keyword)
135 : CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
136 : description="Defines the parameter of the adiabatic curve.", &
137 68320 : default_r_val=1._dp)
138 68320 : CALL section_add_keyword(subsection, keyword)
139 68320 : CALL keyword_release(keyword)
140 :
141 68320 : CALL section_add_subsection(section, subsection)
142 68320 : 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 136640 : citations=(/Becke1988/))
148 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
149 : description="activates the functional", &
150 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
151 68320 : CALL section_add_keyword(subsection, keyword)
152 68320 : CALL keyword_release(keyword)
153 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
154 : description="scales the exchange part of the functional", &
155 68320 : default_r_val=1._dp)
156 68320 : CALL section_add_keyword(subsection, keyword)
157 68320 : CALL keyword_release(keyword)
158 : CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
159 : description="Potential parameter in erf(omega*r)/r", &
160 68320 : default_r_val=1._dp)
161 68320 : CALL section_add_keyword(subsection, keyword)
162 68320 : CALL keyword_release(keyword)
163 : CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
164 : description="Defines the parameter of the adiabatic curve", &
165 68320 : default_r_val=1._dp)
166 68320 : CALL section_add_keyword(subsection, keyword)
167 68320 : CALL keyword_release(keyword)
168 :
169 68320 : CALL section_add_subsection(section, subsection)
170 68320 : 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 136640 : citations=(/Becke1988/))
176 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
177 : description="activates the functional", &
178 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
179 68320 : CALL section_add_keyword(subsection, keyword)
180 68320 : CALL keyword_release(keyword)
181 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
182 : description="scales the exchange part of the functional", &
183 68320 : default_r_val=1._dp)
184 68320 : CALL section_add_keyword(subsection, keyword)
185 68320 : CALL keyword_release(keyword)
186 : CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
187 : description="Potential parameter in erf(omega*r)/r", &
188 68320 : default_r_val=1._dp)
189 68320 : CALL section_add_keyword(subsection, keyword)
190 68320 : CALL keyword_release(keyword)
191 :
192 68320 : CALL section_add_subsection(section, subsection)
193 68320 : 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 136640 : citations=(/Lee1988/))
199 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
200 : description="activates the functional", &
201 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
202 68320 : CALL section_add_keyword(subsection, keyword)
203 68320 : CALL keyword_release(keyword)
204 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
205 : description="scales the correlation part of the functional", &
206 68320 : default_r_val=1._dp)
207 68320 : CALL section_add_keyword(subsection, keyword)
208 68320 : CALL keyword_release(keyword)
209 68320 : CALL section_add_subsection(section, subsection)
210 68320 : 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 136640 : citations=(/Goedecker1996/))
216 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
217 : description="activates the functional", &
218 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
219 68320 : CALL section_add_keyword(subsection, keyword)
220 68320 : CALL keyword_release(keyword)
221 68320 : CALL section_add_subsection(section, subsection)
222 68320 : CALL section_release(subsection)
223 :
224 : CALL section_create(subsection, __LOCATION__, name="HCTH", &
225 : description="Uses the HCTH class of functionals", &
226 68320 : 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 409920 : default_i_val=120)
233 68320 : CALL section_add_keyword(subsection, keyword)
234 68320 : CALL keyword_release(keyword)
235 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
236 : description="activates the functional", &
237 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
238 68320 : CALL section_add_keyword(subsection, keyword)
239 68320 : CALL keyword_release(keyword)
240 68320 : CALL section_add_subsection(section, subsection)
241 68320 : CALL section_release(subsection)
242 :
243 : CALL section_create(subsection, __LOCATION__, name="OPTX", &
244 : description="Uses the OPTX functional", &
245 68320 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
246 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
247 : description="activates the functional", &
248 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
249 68320 : CALL section_add_keyword(subsection, keyword)
250 68320 : CALL keyword_release(keyword)
251 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
252 : description="scales the exchange part of the functional", &
253 68320 : default_r_val=1._dp)
254 68320 : CALL section_add_keyword(subsection, keyword)
255 68320 : CALL keyword_release(keyword)
256 : CALL keyword_create(keyword, __LOCATION__, name="a1", &
257 : description="OPTX a1 coefficient", &
258 68320 : default_r_val=1.05151_dp)
259 68320 : CALL section_add_keyword(subsection, keyword)
260 68320 : CALL keyword_release(keyword)
261 : CALL keyword_create(keyword, __LOCATION__, name="a2", &
262 : description="OPTX a2 coefficient", &
263 68320 : default_r_val=1.43169_dp)
264 68320 : CALL section_add_keyword(subsection, keyword)
265 68320 : CALL keyword_release(keyword)
266 : CALL keyword_create(keyword, __LOCATION__, name="gamma", &
267 : description="OPTX gamma coefficient", &
268 68320 : default_r_val=0.006_dp)
269 68320 : CALL section_add_keyword(subsection, keyword)
270 68320 : CALL keyword_release(keyword)
271 68320 : CALL section_add_subsection(section, subsection)
272 68320 : CALL section_release(subsection)
273 :
274 68320 : CALL libxc_add_sections(section)
275 :
276 : CALL section_create(subsection, __LOCATION__, name="CS1", &
277 : description="Uses the CS1 functional", &
278 68320 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
279 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
280 : description="activates the functional", &
281 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
282 68320 : CALL section_add_keyword(subsection, keyword)
283 68320 : CALL keyword_release(keyword)
284 68320 : CALL section_add_subsection(section, subsection)
285 68320 : 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 68320 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
291 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
292 : description="activates the functional", &
293 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
294 68320 : CALL section_add_keyword(subsection, keyword)
295 68320 : 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 546560 : default_i_val=xgga_b88x)
309 68320 : CALL section_add_keyword(subsection, keyword)
310 68320 : CALL keyword_release(keyword)
311 68320 : CALL section_add_subsection(section, subsection)
312 68320 : 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 68320 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
320 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
321 : description="activates the functional", &
322 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
323 68320 : CALL section_add_keyword(subsection, keyword)
324 68320 : 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 614880 : default_i_val=ke_llp)
339 68320 : CALL section_add_keyword(subsection, keyword)
340 68320 : CALL keyword_release(keyword)
341 68320 : CALL section_add_subsection(section, subsection)
342 68320 : CALL section_release(subsection)
343 :
344 : CALL section_create(subsection, __LOCATION__, name="P86C", &
345 : description="Uses the P86C functional", &
346 68320 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
347 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
348 : description="activates the functional", &
349 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
350 68320 : CALL section_add_keyword(subsection, keyword)
351 68320 : CALL keyword_release(keyword)
352 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
353 : description="scales the correlation part of the functional", &
354 68320 : default_r_val=1._dp)
355 68320 : CALL section_add_keyword(subsection, keyword)
356 68320 : CALL keyword_release(keyword)
357 68320 : CALL section_add_subsection(section, subsection)
358 68320 : CALL section_release(subsection)
359 :
360 : CALL section_create(subsection, __LOCATION__, name="PW92", &
361 : description="Uses the PerdewWang correlation functional.", &
362 68320 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
363 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
364 : description="activates the functional", &
365 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
366 68320 : CALL section_add_keyword(subsection, keyword)
367 68320 : CALL keyword_release(keyword)
368 : CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
369 : description="Scaling of the energy functional", &
370 68320 : default_r_val=1.0_dp)
371 68320 : CALL section_add_keyword(subsection, keyword)
372 68320 : 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 273280 : default_i_val=c_pw92)
382 68320 : CALL section_add_keyword(subsection, keyword)
383 68320 : CALL keyword_release(keyword)
384 68320 : CALL section_add_subsection(section, subsection)
385 68320 : 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 204960 : citations=(/Perdew1981, Ortiz1994/))
391 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
392 : description="activates the functional", &
393 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
394 68320 : CALL section_add_keyword(subsection, keyword)
395 68320 : 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 273280 : default_i_val=pz_orig)
405 68320 : CALL section_add_keyword(subsection, keyword)
406 68320 : CALL keyword_release(keyword)
407 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
408 : description="scales the correlation part of the functional", &
409 68320 : default_r_val=1._dp)
410 68320 : CALL section_add_keyword(subsection, keyword)
411 68320 : CALL keyword_release(keyword)
412 68320 : CALL section_add_subsection(section, subsection)
413 68320 : CALL section_release(subsection)
414 :
415 : CALL section_create(subsection, __LOCATION__, name="TFW", &
416 : description="Uses the TFW functional", &
417 68320 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
418 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
419 : description="activates the functional", &
420 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
421 68320 : CALL section_add_keyword(subsection, keyword)
422 68320 : CALL keyword_release(keyword)
423 68320 : CALL section_add_subsection(section, subsection)
424 68320 : CALL section_release(subsection)
425 :
426 : CALL section_create(subsection, __LOCATION__, name="TF", &
427 : description="Uses the TF functional", &
428 68320 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
429 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
430 : description="activates the functional", &
431 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
432 68320 : CALL section_add_keyword(subsection, keyword)
433 68320 : CALL keyword_release(keyword)
434 68320 : CALL section_add_subsection(section, subsection)
435 68320 : 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 136640 : citations=(/Vosko1980/))
441 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
442 : description="activates the functional", &
443 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
444 68320 : CALL section_add_keyword(subsection, keyword)
445 68320 : CALL keyword_release(keyword)
446 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
447 : description="scales the correlation part of the functional", &
448 68320 : default_r_val=1._dp)
449 68320 : CALL section_add_keyword(subsection, keyword)
450 68320 : 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 68320 : default_i_val=do_vwn5)
461 :
462 68320 : CALL section_add_keyword(subsection, keyword)
463 68320 : CALL keyword_release(keyword)
464 68320 : CALL section_add_subsection(section, subsection)
465 68320 : CALL section_release(subsection)
466 :
467 : CALL section_create(subsection, __LOCATION__, name="XALPHA", &
468 : description="Uses the XALPHA (SLATER) functional.", &
469 68320 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
470 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
471 : description="activates the functional", &
472 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
473 68320 : CALL section_add_keyword(subsection, keyword)
474 68320 : 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 68320 : usage="XA 0.7", default_r_val=2._dp/3._dp)
479 68320 : CALL section_add_keyword(subsection, keyword)
480 68320 : CALL keyword_release(keyword)
481 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
482 : description="scales the exchange part of the functional", &
483 68320 : default_r_val=1._dp)
484 68320 : CALL section_add_keyword(subsection, keyword)
485 68320 : CALL keyword_release(keyword)
486 68320 : CALL section_add_subsection(section, subsection)
487 68320 : 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 136640 : citations=(/Tao2003/))
494 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
495 : description="Activates the functional", &
496 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
497 68320 : CALL section_add_keyword(subsection, keyword)
498 68320 : CALL keyword_release(keyword)
499 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
500 : description="scales the exchange part of the functional", &
501 68320 : default_r_val=1._dp)
502 68320 : CALL section_add_keyword(subsection, keyword)
503 68320 : CALL keyword_release(keyword)
504 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
505 : description="scales the correlation part of the functional", &
506 68320 : default_r_val=1._dp)
507 68320 : CALL section_add_keyword(subsection, keyword)
508 68320 : CALL keyword_release(keyword)
509 68320 : CALL section_add_subsection(section, subsection)
510 68320 : 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 273280 : citations=(/Perdew1996, Zhang1998, Perdew2008/))
516 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
517 : description="activates the functional", &
518 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
519 68320 : CALL section_add_keyword(subsection, keyword)
520 68320 : 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 478240 : default_i_val=xc_pbe_orig)
533 68320 : CALL section_add_keyword(subsection, keyword)
534 68320 : CALL keyword_release(keyword)
535 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
536 : description="scales the exchange part of the functional", &
537 68320 : default_r_val=1._dp)
538 68320 : CALL section_add_keyword(subsection, keyword)
539 68320 : CALL keyword_release(keyword)
540 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
541 : description="scales the correlation part of the functional", &
542 68320 : default_r_val=1._dp)
543 68320 : CALL section_add_keyword(subsection, keyword)
544 68320 : CALL keyword_release(keyword)
545 68320 : CALL section_add_subsection(section, subsection)
546 68320 : 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 136640 : citations=(/Heyd2004/))
552 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
553 : description="activates the functional", &
554 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
555 68320 : CALL section_add_keyword(subsection, keyword)
556 68320 : CALL keyword_release(keyword)
557 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
558 : description="scales the exchange part of the functional", &
559 68320 : default_r_val=1._dp)
560 68320 : CALL section_add_keyword(subsection, keyword)
561 68320 : 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 68320 : default_r_val=0.0_dp)
565 68320 : CALL section_add_keyword(subsection, keyword)
566 68320 : CALL keyword_release(keyword)
567 : CALL keyword_create(keyword, __LOCATION__, name="omega", &
568 : description="screening parameter", &
569 68320 : default_r_val=1._dp)
570 68320 : CALL section_add_keyword(subsection, keyword)
571 68320 : CALL keyword_release(keyword)
572 68320 : CALL section_add_subsection(section, subsection)
573 68320 : 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 204960 : citations=(/Becke1997, Grimme2006/))
579 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
580 : description="activates the functional", &
581 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
582 68320 : CALL section_add_keyword(subsection, keyword)
583 68320 : 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 68320 : default_r_val=-1._dp)
587 68320 : CALL section_add_keyword(subsection, keyword)
588 68320 : CALL keyword_release(keyword)
589 : CALL keyword_create(keyword, __LOCATION__, name="scale_c", &
590 : description="scales the correlation part of the functional", &
591 68320 : default_r_val=1._dp)
592 68320 : CALL section_add_keyword(subsection, keyword)
593 68320 : 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 409920 : default_i_val=xc_b97_orig)
599 68320 : CALL section_add_keyword(subsection, keyword)
600 68320 : CALL keyword_release(keyword)
601 :
602 68320 : CALL section_add_subsection(section, subsection)
603 68320 : 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 204960 : citations=(/BeckeRoussel1989, Proynov2007/))
610 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
611 : description="activates the functional", &
612 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
613 68320 : CALL section_add_keyword(subsection, keyword)
614 68320 : CALL keyword_release(keyword)
615 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
616 : description="scales the exchange part of the functional", &
617 68320 : default_r_val=1._dp)
618 68320 : CALL section_add_keyword(subsection, keyword)
619 68320 : 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 68320 : usage="CUTOFF_RADIUS 2.0", default_r_val=0.0_dp)
624 68320 : CALL section_add_keyword(subsection, keyword)
625 68320 : 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 68320 : usage="GAMMA 0.8", default_r_val=1.0_dp)
630 68320 : CALL section_add_keyword(subsection, keyword)
631 68320 : CALL keyword_release(keyword)
632 68320 : CALL section_add_subsection(section, subsection)
633 68320 : 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 68320 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
638 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
639 : description="activates the functional", &
640 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
641 68320 : CALL section_add_keyword(subsection, keyword)
642 68320 : CALL keyword_release(keyword)
643 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
644 : description="scales the exchange part of the functional", &
645 68320 : default_r_val=1._dp)
646 68320 : CALL section_add_keyword(subsection, keyword)
647 68320 : CALL keyword_release(keyword)
648 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
649 : description="Defines cutoff for lower integration boundary", &
650 68320 : default_r_val=0.0_dp, unit_str="angstrom")
651 68320 : CALL section_add_keyword(subsection, keyword)
652 68320 : CALL keyword_release(keyword)
653 68320 : CALL section_add_subsection(section, subsection)
654 68320 : 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 68320 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
659 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
660 : description="activates the functional", &
661 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
662 68320 : CALL section_add_keyword(subsection, keyword)
663 68320 : CALL keyword_release(keyword)
664 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
665 : description="scales the exchange part of the functional", &
666 68320 : default_r_val=1._dp)
667 68320 : CALL section_add_keyword(subsection, keyword)
668 68320 : CALL keyword_release(keyword)
669 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
670 : description="Defines cutoff for lower integration boundary", &
671 68320 : default_r_val=1.0_dp, unit_str="angstrom")
672 68320 : CALL section_add_keyword(subsection, keyword)
673 68320 : CALL keyword_release(keyword)
674 68320 : CALL section_add_subsection(section, subsection)
675 68320 : CALL section_release(subsection)
676 :
677 : CALL section_create(subsection, __LOCATION__, name="GV09", &
678 : description="Combination of three different exchange hole models", &
679 68320 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
680 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
681 : description="activates the functional", &
682 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
683 68320 : CALL section_add_keyword(subsection, keyword)
684 68320 : CALL keyword_release(keyword)
685 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
686 : description="scales the exchange part of the functional", &
687 68320 : default_r_val=1._dp)
688 68320 : CALL section_add_keyword(subsection, keyword)
689 68320 : CALL keyword_release(keyword)
690 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
691 : description="Defines cutoff for lower integration boundary", &
692 68320 : default_r_val=0.0_dp, unit_str="angstrom")
693 68320 : CALL section_add_keyword(subsection, keyword)
694 68320 : CALL keyword_release(keyword)
695 : CALL keyword_create(keyword, __LOCATION__, name="GAMMA", &
696 : description="Parameter for Becke Roussel hole", &
697 68320 : default_r_val=1.0_dp)
698 68320 : CALL section_add_keyword(subsection, keyword)
699 68320 : CALL keyword_release(keyword)
700 68320 : CALL section_add_subsection(section, subsection)
701 68320 : 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 136640 : citations=(/Wellendorff2012/))
707 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
708 : description="activates the functional", &
709 68320 : lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
710 68320 : CALL section_add_keyword(subsection, keyword)
711 68320 : CALL keyword_release(keyword)
712 : CALL keyword_create(keyword, __LOCATION__, name="scale_x", &
713 : description="scales the exchange part of the functional", &
714 68320 : default_r_val=1._dp)
715 68320 : CALL section_add_keyword(subsection, keyword)
716 68320 : CALL keyword_release(keyword)
717 68320 : CALL section_add_subsection(section, subsection)
718 68320 : CALL section_release(subsection)
719 :
720 68320 : 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 59774 : 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 59774 : 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 59774 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
740 :
741 59774 : NULLIFY (subsection, keyword)
742 : CALL section_create(subsection, __LOCATION__, name="SAOP", &
743 : description="Uses the SAOP potential", &
744 59774 : 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 59774 : usage="ALPHA 1.19", default_r_val=1.19_dp)
748 59774 : CALL section_add_keyword(subsection, keyword)
749 59774 : CALL keyword_release(keyword)
750 : CALL keyword_create(keyword, __LOCATION__, name="BETA", &
751 : description="Value of the beta parameter (default = 0.01).", &
752 59774 : usage="BETA 0.01", default_r_val=0.01_dp)
753 59774 : CALL section_add_keyword(subsection, keyword)
754 59774 : 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 59774 : usage="ALPHA 0.42", default_r_val=0.42_dp)
758 59774 : CALL section_add_keyword(subsection, keyword)
759 59774 : CALL keyword_release(keyword)
760 59774 : CALL section_add_subsection(section, subsection)
761 59774 : 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 59774 : default_i_val=xc_pot_energy_none)
773 59774 : CALL section_add_keyword(section, keyword)
774 59774 : CALL keyword_release(keyword)
775 :
776 59774 : 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 59774 : SUBROUTINE create_xc_kernel_section(section)
784 : TYPE(section_type), POINTER :: section
785 :
786 : TYPE(keyword_type), POINTER :: keyword
787 :
788 59774 : 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 59774 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
795 :
796 59774 : 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 59774 : lone_keyword_i_val=fxc_none)
809 59774 : CALL section_add_keyword(section, keyword)
810 59774 : 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 59774 : type_of_var=real_t, n_var=-1)
816 59774 : CALL section_add_keyword(section, keyword)
817 59774 : 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 59774 : type_of_var=real_t, n_var=3)
823 59774 : CALL section_add_keyword(section, keyword)
824 59774 : 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 59774 : type_of_var=real_t, n_var=3)
830 59774 : CALL section_add_keyword(section, keyword)
831 59774 : 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 59774 : type_of_var=real_t, n_var=3)
837 59774 : CALL section_add_keyword(section, keyword)
838 59774 : 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 59774 : type_of_var=real_t, n_var=3)
844 59774 : CALL section_add_keyword(section, keyword)
845 59774 : CALL keyword_release(keyword)
846 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_X", &
847 : description="Scaling parameter for exchange kernel.", &
848 59774 : usage="SCALE_X 0.2", default_r_val=1.0_dp)
849 59774 : CALL section_add_keyword(section, keyword)
850 59774 : CALL keyword_release(keyword)
851 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_C", &
852 : description="Scaling parameter for correlation kernel.", &
853 59774 : usage="SCALE_C 0.2", default_r_val=1.0_dp)
854 59774 : CALL section_add_keyword(section, keyword)
855 59774 : CALL keyword_release(keyword)
856 :
857 59774 : 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 59774 : 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 59774 : 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 59774 : n_keywords=1, n_subsections=2, repeats=.FALSE.)
874 :
875 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
880 59774 : CALL section_add_keyword(section, keyword)
881 59774 : CALL keyword_release(keyword)
882 59774 : 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 59774 : usage="HFXSR_PRIMBAS 3", default_i_val=0)
887 59774 : CALL section_add_keyword(section, keyword)
888 59774 : CALL keyword_release(keyword)
889 :
890 59774 : CALL create_hfx_section(subsection)
891 59774 : CALL section_add_subsection(section, subsection)
892 59774 : CALL section_release(subsection)
893 :
894 : CALL section_create(subsection, __LOCATION__, name="HFXLR", &
895 : description="Uses the HFXLR (long range) kernel", &
896 59774 : 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 59774 : usage="RCUT 5.00", default_r_val=6.00_dp, unit_str="bohr")
900 59774 : CALL section_add_keyword(subsection, keyword)
901 59774 : CALL keyword_release(keyword)
902 : CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
903 : description="Scaling parameter for HFX kernel.", &
904 59774 : usage="SCALE 0.25", default_r_val=1.00_dp)
905 59774 : CALL section_add_keyword(subsection, keyword)
906 59774 : CALL keyword_release(keyword)
907 59774 : CALL section_add_subsection(section, subsection)
908 59774 : CALL section_release(subsection)
909 :
910 59774 : 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 59774 : 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 59774 : 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 179322 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
929 :
930 59774 : 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 59774 : default_i_val=xc_vdw_fun_none)
941 59774 : CALL section_add_keyword(section, keyword)
942 59774 : 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 59774 : 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 59774 : unit_str="angstrom")
953 59774 : CALL section_add_keyword(subsection, keyword)
954 59774 : 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 59774 : unit_str="angstrom")
960 59774 : CALL section_add_keyword(subsection, keyword)
961 59774 : 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 59774 : unit_str="angstrom")
966 59774 : CALL section_add_keyword(subsection, keyword)
967 59774 : 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 (WARNING: Experimental feature under development)"), &
979 298870 : default_i_val=vdw_pairpot_dftd3)
980 59774 : CALL section_add_keyword(subsection, keyword)
981 59774 : 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 59774 : default_lc_val="DISPERSION_PARAMETERS")
986 59774 : CALL section_add_keyword(subsection, keyword)
987 59774 : 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 59774 : type_of_var=char_t)
996 59774 : CALL section_add_keyword(subsection, keyword)
997 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1002 59774 : CALL section_add_keyword(subsection, keyword)
1003 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1008 59774 : CALL section_add_keyword(subsection, keyword)
1009 59774 : 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 119548 : usage="SCALING 0.2", default_r_val=0._dp)
1015 59774 : CALL section_add_keyword(subsection, keyword)
1016 59774 : 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 119548 : usage="D2_EXP_PRE 20.", default_r_val=20._dp)
1021 59774 : CALL section_add_keyword(subsection, keyword)
1022 59774 : 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 59774 : usage="EPS_CN 1.e-6_dp", default_r_val=1.e-6_dp)
1026 59774 : CALL section_add_keyword(subsection, keyword)
1027 59774 : 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 59774 : default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/))
1034 59774 : CALL section_add_keyword(subsection, keyword)
1035 59774 : 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 59774 : default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp/))
1042 59774 : CALL section_add_keyword(subsection, keyword)
1043 59774 : 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 59774 : default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp/))
1050 59774 : CALL section_add_keyword(subsection, keyword)
1051 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1056 59774 : CALL section_add_keyword(subsection, keyword)
1057 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1062 59774 : CALL section_add_keyword(subsection, keyword)
1063 59774 : 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 59774 : usage="FACTOR_S9_TERM 1.e-0", default_r_val=1.00_dp)
1067 59774 : CALL section_add_keyword(subsection, keyword)
1068 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1074 59774 : CALL section_add_keyword(subsection, keyword)
1075 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1080 59774 : CALL section_add_keyword(subsection, keyword)
1081 59774 : 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 59774 : n_var=4, type_of_var=real_t)
1088 59774 : CALL section_add_keyword(subsection, keyword)
1089 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1095 59774 : CALL section_add_keyword(subsection, keyword)
1096 59774 : 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 59774 : usage="MOLECULE_CORRECTION_C8 1.0 ", default_r_val=0.0_dp)
1100 59774 : CALL section_add_keyword(subsection, keyword)
1101 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1107 59774 : CALL section_add_keyword(subsection, keyword)
1108 59774 : 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 59774 : n_var=-1, type_of_var=integer_t)
1115 59774 : CALL section_add_keyword(subsection, keyword)
1116 59774 : 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 59774 : n_var=2, type_of_var=integer_t)
1123 59774 : CALL section_add_keyword(subsection, keyword)
1124 59774 : 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 59774 : n_var=-1, type_of_var=char_t)
1131 59774 : CALL section_add_keyword(subsection, keyword)
1132 59774 : 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 59774 : n_var=-1, type_of_var=char_t)
1138 59774 : CALL section_add_keyword(subsection, keyword)
1139 59774 : 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 59774 : repeats=.TRUE., n_var=-1, type_of_var=char_t)
1147 59774 : CALL section_add_keyword(subsection, keyword)
1148 59774 : CALL keyword_release(keyword)
1149 :
1150 59774 : 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 59774 : print_level=high_print_level, add_last=add_last_numeric, filename="")
1154 59774 : CALL section_add_subsection(subsection, print_key)
1155 59774 : CALL section_release(print_key)
1156 :
1157 59774 : NULLIFY (newsection)
1158 59774 : CALL create_eeq_control_section(newsection)
1159 59774 : CALL section_add_subsection(subsection, newsection)
1160 59774 : CALL section_release(newsection)
1161 :
1162 59774 : CALL section_add_subsection(section, subsection)
1163 59774 : CALL section_release(subsection)
1164 :
1165 : ! nonlocal section
1166 59774 : 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 59774 : 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 119548 : default_i_val=vdw_nl_DRSLL)
1183 59774 : CALL section_add_keyword(subsection, keyword)
1184 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1189 59774 : CALL section_add_keyword(subsection, keyword)
1190 59774 : 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 59774 : default_lc_val="vdW_kernel_table.dat")
1197 59774 : CALL section_add_keyword(subsection, keyword)
1198 59774 : 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 59774 : default_r_val=-1._dp, unit_str="Ry")
1204 59774 : CALL section_add_keyword(subsection, keyword)
1205 59774 : 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 59774 : type_of_var=real_t, default_r_vals=(/6.3_dp, 0.0093_dp/), n_var=2)
1210 59774 : CALL section_add_keyword(subsection, keyword)
1211 59774 : 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 59774 : type_of_var=real_t, default_r_val=1.0_dp)
1216 59774 : CALL section_add_keyword(subsection, keyword)
1217 59774 : CALL keyword_release(keyword)
1218 :
1219 59774 : CALL section_add_subsection(section, subsection)
1220 59774 : CALL section_release(subsection)
1221 :
1222 59774 : 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 59774 : SUBROUTINE create_gcp_potential_section(section)
1230 : TYPE(section_type), POINTER :: section
1231 :
1232 : TYPE(keyword_type), POINTER :: keyword
1233 :
1234 59774 : 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 119548 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
1240 :
1241 59774 : 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 59774 : default_lc_val="---")
1246 59774 : CALL section_add_keyword(section, keyword)
1247 59774 : 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 59774 : default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp, 0.0_dp/))
1254 59774 : CALL section_add_keyword(section, keyword)
1255 59774 : 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 179322 : type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=(/"XX ", "0.0"/))
1261 59774 : CALL section_add_keyword(section, keyword)
1262 59774 : 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 59774 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1268 59774 : CALL section_add_keyword(section, keyword)
1269 59774 : CALL keyword_release(keyword)
1270 :
1271 59774 : 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 59774 : 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 59774 : 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 59774 : n_keywords=5, n_subsections=2, repeats=.FALSE.)
1288 :
1289 59774 : 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 59774 : usage="density_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1294 59774 : CALL section_add_keyword(section, keyword)
1295 59774 : 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 59774 : usage="gradient_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1301 59774 : CALL section_add_keyword(section, keyword)
1302 59774 : 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 59774 : usage="gradient_cutoff {real}", default_r_val=0.0_dp)
1307 59774 : CALL section_add_keyword(section, keyword)
1308 59774 : 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 59774 : usage="tau_cutoff 1.e-11", default_r_val=1.0e-10_dp)
1313 59774 : CALL section_add_keyword(section, keyword)
1314 59774 : 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 59774 : "Use debug new code for exchange-correlation functional calculation"))
1326 59774 : CALL section_add_keyword(section, keyword)
1327 59774 : 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 59774 : 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 59774 : xc_rho_spline3_smooth/))
1339 59774 : CALL section_add_keyword(subsection, keyword)
1340 59774 : 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 59774 : xc_deriv_collocate/))
1351 59774 : CALL section_add_keyword(subsection, keyword)
1352 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1358 59774 : CALL section_add_keyword(subsection, keyword)
1359 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1365 59774 : CALL section_add_keyword(section, keyword)
1366 59774 : 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 59774 : lone_keyword_l_val=.TRUE.)
1372 59774 : CALL section_add_keyword(section, keyword)
1373 59774 : 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 59774 : usage="STEP_SIZE 1.0E-3", default_r_val=1e-3_dp)
1379 59774 : CALL section_add_keyword(section, keyword)
1380 59774 : 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 59774 : usage="NSTEPS 4", default_i_val=3)
1386 59774 : CALL section_add_keyword(section, keyword)
1387 59774 : CALL keyword_release(keyword)
1388 :
1389 59774 : CALL section_add_subsection(section, subsection)
1390 59774 : CALL section_release(subsection)
1391 :
1392 59774 : CALL create_xc_fun_section(subsection)
1393 59774 : CALL section_add_subsection(section, subsection)
1394 59774 : CALL section_release(subsection)
1395 :
1396 59774 : CALL create_hfx_section(subsection)
1397 59774 : CALL section_add_subsection(section, subsection)
1398 59774 : CALL section_release(subsection)
1399 :
1400 59774 : CALL create_mp2_section(subsection)
1401 59774 : CALL section_add_subsection(section, subsection)
1402 59774 : CALL section_release(subsection)
1403 :
1404 59774 : CALL create_adiabatic_section(subsection)
1405 59774 : CALL section_add_subsection(section, subsection)
1406 59774 : CALL section_release(subsection)
1407 :
1408 59774 : CALL create_xc_potential_section(subsection)
1409 59774 : CALL section_add_subsection(section, subsection)
1410 59774 : CALL section_release(subsection)
1411 :
1412 59774 : CALL create_xc_kernel_section(subsection)
1413 59774 : CALL section_add_subsection(section, subsection)
1414 59774 : CALL section_release(subsection)
1415 :
1416 59774 : CALL create_hfx_kernel_section(subsection)
1417 59774 : CALL section_add_subsection(section, subsection)
1418 59774 : CALL section_release(subsection)
1419 :
1420 59774 : CALL create_vdw_potential_section(subsection)
1421 59774 : CALL section_add_subsection(section, subsection)
1422 59774 : CALL section_release(subsection)
1423 :
1424 59774 : CALL create_gcp_potential_section(subsection)
1425 59774 : CALL section_add_subsection(section, subsection)
1426 59774 : CALL section_release(subsection)
1427 :
1428 59774 : 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 59774 : SUBROUTINE create_adiabatic_section(section)
1436 : TYPE(section_type), POINTER :: section
1437 :
1438 : TYPE(keyword_type), POINTER :: keyword
1439 :
1440 59774 : CPASSERT(.NOT. ASSOCIATED(section))
1441 : CALL section_create(section, __LOCATION__, name="ADIABATIC_RESCALING", &
1442 : description="Parameters for self interaction corrected hybrid functionals", &
1443 59774 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
1444 59774 : 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 59774 : default_i_val=do_adiabatic_hybrid_mcy3)
1455 59774 : CALL section_add_keyword(section, keyword)
1456 59774 : CALL keyword_release(keyword)
1457 :
1458 59774 : 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 59774 : default_r_val=0.71_dp)
1465 59774 : CALL section_add_keyword(section, keyword)
1466 59774 : CALL keyword_release(keyword)
1467 :
1468 59774 : NULLIFY (keyword)
1469 : CALL keyword_create( &
1470 : keyword, __LOCATION__, &
1471 : name="OMEGA", &
1472 : description="Long-range parameter", &
1473 : usage="OMEGA 0.2", &
1474 59774 : default_r_val=0.2_dp)
1475 59774 : CALL section_add_keyword(section, keyword)
1476 59774 : CALL keyword_release(keyword)
1477 :
1478 59774 : 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 59774 : default_i_val=do_adiabatic_model_pade)
1488 59774 : CALL section_add_keyword(section, keyword)
1489 59774 : CALL keyword_release(keyword)
1490 59774 : END SUBROUTINE create_adiabatic_section
1491 :
1492 : END MODULE input_cp2k_xc
|