Line data Source code
1 : !--------------------------------------------------------------------------------------------------!
2 : ! CP2K: A general program to perform molecular dynamics simulations !
3 : ! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4 : ! !
5 : ! SPDX-License-Identifier: GPL-2.0-or-later !
6 : !--------------------------------------------------------------------------------------------------!
7 :
8 : ! **************************************************************************************************
9 : !> \brief function that build the QS section of the input
10 : !> \par History
11 : !> 10.2005 moved out of input_cp2k [fawzi]
12 : !> 07.2024 moved out of input_cp2k_dft [JGH]
13 : !> \author fawzi
14 : ! **************************************************************************************************
15 : MODULE input_cp2k_qs
16 : USE bibliography, ONLY: &
17 : Andermatt2016, Brelaz1979, Dewar1977, Dewar1985, Golze2017a, Golze2017b, Iannuzzi2006, &
18 : Kolafa2004, Krack2000, Kuhne2007, Lippert1997, Lippert1999, Repasky2002, Rocha2006, &
19 : Schenter2008, Stewart1989, Stewart2007, Thiel1992, VanVoorhis2015, VandeVondele2005a, &
20 : VandeVondele2006
21 : USE cp_output_handling, ONLY: add_last_numeric,&
22 : cp_print_key_section_create,&
23 : low_print_level
24 : USE input_constants, ONLY: &
25 : do_ddapc_constraint, do_ddapc_restraint, do_full_density, do_gapw_gcs, do_gapw_gct, &
26 : do_gapw_log, do_lri_inv, do_lri_inv_auto, do_lri_pseudoinv_diag, do_lri_pseudoinv_svd, &
27 : do_method_am1, do_method_dftb, do_method_gapw, do_method_gapw_xc, do_method_gpw, &
28 : do_method_lrigpw, do_method_mndo, do_method_mndod, do_method_ofgpw, do_method_pdg, &
29 : do_method_pm3, do_method_pm6, do_method_pm6fm, do_method_pnnl, do_method_rigpw, &
30 : do_method_rm1, do_method_xtb, do_ppl_analytic, do_ppl_grid, do_pwgrid_ns_fullspace, &
31 : do_pwgrid_ns_halfspace, do_pwgrid_spherical, do_s2_constraint, do_s2_restraint, &
32 : do_spin_density, gapw_1c_large, gapw_1c_medium, gapw_1c_orb, gapw_1c_small, &
33 : gapw_1c_very_large, gaussian, numerical, slater, wfi_aspc_nr, wfi_frozen_method_nr, &
34 : wfi_linear_p_method_nr, wfi_linear_ps_method_nr, wfi_linear_wf_method_nr, &
35 : wfi_ps_method_nr, wfi_use_guess_method_nr, wfi_use_prev_p_method_nr, &
36 : wfi_use_prev_rho_r_method_nr, wfi_use_prev_wf_method_nr
37 : USE input_cp2k_distribution, ONLY: create_distribution_section
38 : USE input_cp2k_opt, ONLY: create_optimize_dmfet,&
39 : create_optimize_embed,&
40 : create_optimize_lri_basis_section
41 : USE input_cp2k_scf, ONLY: create_cdft_control_section
42 : USE input_cp2k_se, ONLY: create_se_control_section
43 : USE input_cp2k_tb, ONLY: create_dftb_control_section,&
44 : create_xtb_control_section
45 : USE input_keyword_types, ONLY: keyword_create,&
46 : keyword_release,&
47 : keyword_type
48 : USE input_section_types, ONLY: section_add_keyword,&
49 : section_add_subsection,&
50 : section_create,&
51 : section_release,&
52 : section_type
53 : USE input_val_types, ONLY: integer_t,&
54 : lchar_t,&
55 : real_t
56 : USE kinds, ONLY: dp
57 : USE pw_grids, ONLY: do_pw_grid_blocked_false,&
58 : do_pw_grid_blocked_free,&
59 : do_pw_grid_blocked_true
60 : USE string_utilities, ONLY: s2a
61 : #include "./base/base_uses.f90"
62 :
63 : IMPLICIT NONE
64 : PRIVATE
65 :
66 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_qs'
67 :
68 : PUBLIC :: create_qs_section, create_lrigpw_section, create_ddapc_restraint_section
69 :
70 : CONTAINS
71 :
72 : ! **************************************************************************************************
73 : !> \brief creates the input section for the qs part
74 : !> \param section the section to create
75 : !> \author teo
76 : ! **************************************************************************************************
77 9530 : SUBROUTINE create_qs_section(section)
78 : TYPE(section_type), POINTER :: section
79 :
80 : TYPE(keyword_type), POINTER :: keyword
81 : TYPE(section_type), POINTER :: subsection
82 :
83 9530 : CPASSERT(.NOT. ASSOCIATED(section))
84 : CALL section_create(section, __LOCATION__, name="qs", &
85 : description="parameters needed to set up the Quickstep framework", &
86 9530 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
87 :
88 9530 : NULLIFY (keyword, subsection)
89 :
90 : ! Reals
91 : CALL keyword_create(keyword, __LOCATION__, name="EPS_DEFAULT", &
92 : description="Try setting all EPS_xxx to values leading to an energy correct up to EPS_DEFAULT", &
93 9530 : usage="EPS_DEFAULT real", default_r_val=1.0E-10_dp)
94 9530 : CALL section_add_keyword(section, keyword)
95 9530 : CALL keyword_release(keyword)
96 :
97 : CALL keyword_create(keyword, __LOCATION__, name="EPS_CORE_CHARGE", &
98 : description="Precision for mapping the core charges.Overrides EPS_DEFAULT/100.0 value", &
99 9530 : usage="EPS_CORE_CHARGE real", type_of_var=real_t)
100 9530 : CALL section_add_keyword(section, keyword)
101 9530 : CALL keyword_release(keyword)
102 :
103 : CALL keyword_create( &
104 : keyword, __LOCATION__, name="EPS_GVG_RSPACE", &
105 : variants=["EPS_GVG"], &
106 : description="Sets precision of the realspace KS matrix element integration. Overrides SQRT(EPS_DEFAULT) value", &
107 19060 : usage="EPS_GVG_RSPACE real", type_of_var=real_t)
108 9530 : CALL section_add_keyword(section, keyword)
109 9530 : CALL keyword_release(keyword)
110 :
111 : CALL keyword_create(keyword, __LOCATION__, name="EPS_PGF_ORB", &
112 : description="Sets precision of the overlap matrix elements. Overrides SQRT(EPS_DEFAULT) value", &
113 9530 : usage="EPS_PGF_ORB real", type_of_var=real_t)
114 9530 : CALL section_add_keyword(section, keyword)
115 9530 : CALL keyword_release(keyword)
116 :
117 : CALL keyword_create( &
118 : keyword, __LOCATION__, name="EPS_KG_ORB", &
119 : description="Sets precision used in coloring the subsets for the Kim-Gordon method. Overrides SQRT(EPS_DEFAULT) value", &
120 : usage="EPS_KG_ORB 1.0E-8", &
121 9530 : type_of_var=real_t)
122 9530 : CALL section_add_keyword(section, keyword)
123 9530 : CALL keyword_release(keyword)
124 :
125 : CALL keyword_create(keyword, __LOCATION__, name="EPS_PPL", &
126 : description="Adjusts the precision for the local part of the pseudo potential. ", &
127 9530 : usage="EPS_PPL real", type_of_var=real_t, default_r_val=1.0E-2_dp)
128 9530 : CALL section_add_keyword(section, keyword)
129 9530 : CALL keyword_release(keyword)
130 :
131 : CALL keyword_create( &
132 : keyword, __LOCATION__, name="EPS_PPNL", &
133 : description="Sets precision of the non-local part of the pseudo potential. Overrides sqrt(EPS_DEFAULT) value", &
134 9530 : usage="EPS_PPNL real", type_of_var=real_t)
135 9530 : CALL section_add_keyword(section, keyword)
136 9530 : CALL keyword_release(keyword)
137 :
138 : CALL keyword_create(keyword, __LOCATION__, name="EPS_CPC", &
139 : description="Sets precision of the GAPW projection. Overrides EPS_DEFAULT value", &
140 9530 : usage="EPS_CPC real", type_of_var=real_t)
141 9530 : CALL section_add_keyword(section, keyword)
142 9530 : CALL keyword_release(keyword)
143 :
144 : CALL keyword_create(keyword, __LOCATION__, name="EPS_RHO", &
145 : description="Sets precision of the density mapping on the grids.Overrides EPS_DEFAULT value", &
146 9530 : usage="EPS_RHO real", type_of_var=real_t)
147 9530 : CALL section_add_keyword(section, keyword)
148 9530 : CALL keyword_release(keyword)
149 :
150 : CALL keyword_create(keyword, __LOCATION__, name="EPS_RHO_RSPACE", &
151 : description="Sets precision of the density mapping in rspace.Overrides EPS_DEFAULT value."// &
152 : " Overrides EPS_RHO value", &
153 9530 : usage="EPS_RHO_RSPACE real", type_of_var=real_t)
154 9530 : CALL section_add_keyword(section, keyword)
155 9530 : CALL keyword_release(keyword)
156 :
157 : CALL keyword_create(keyword, __LOCATION__, name="EPS_RHO_GSPACE", &
158 : description="Sets precision of the density mapping in gspace.Overrides EPS_DEFAULT value."// &
159 : " Overrides EPS_RHO value", &
160 9530 : usage="EPS_RHO_GSPACE real", type_of_var=real_t)
161 9530 : CALL section_add_keyword(section, keyword)
162 9530 : CALL keyword_release(keyword)
163 :
164 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER_MATRIX", &
165 : description="Sets the threshold for filtering matrix elements.", &
166 9530 : usage="EPS_FILTER_MATRIX 1.0E-6", type_of_var=real_t, default_r_val=0.0E0_dp)
167 9530 : CALL section_add_keyword(section, keyword)
168 9530 : CALL keyword_release(keyword)
169 :
170 : CALL keyword_create(keyword, __LOCATION__, name="EPSFIT", &
171 : variants=["EPS_FIT"], &
172 : description="GAPW: precision to give the extension of a hard gaussian ", &
173 19060 : usage="EPSFIT real", default_r_val=1.0E-4_dp)
174 9530 : CALL section_add_keyword(section, keyword)
175 9530 : CALL keyword_release(keyword)
176 :
177 : CALL keyword_create(keyword, __LOCATION__, name="EPSISO", &
178 : variants=["EPS_ISO"], &
179 : description="GAPW: precision to determine an isolated projector", &
180 19060 : usage="EPSISO real", default_r_val=1.0E-12_dp)
181 9530 : CALL section_add_keyword(section, keyword)
182 9530 : CALL keyword_release(keyword)
183 :
184 : CALL keyword_create(keyword, __LOCATION__, name="EPSSVD", &
185 : variants=["EPS_SVD"], &
186 : description="GAPW: tolerance used in the singular value decomposition of the projector matrix", &
187 19060 : usage="EPS_SVD real", default_r_val=1.0E-8_dp)
188 9530 : CALL section_add_keyword(section, keyword)
189 9530 : CALL keyword_release(keyword)
190 :
191 : CALL keyword_create(keyword, __LOCATION__, name="EPSRHO0", &
192 : variants=s2a("EPSVRHO0", "EPS_VRHO0"), &
193 : description="GAPW : precision to determine the range of V(rho0-rho0soft)", &
194 9530 : usage="EPSRHO0 real", default_r_val=1.0E-6_dp)
195 9530 : CALL section_add_keyword(section, keyword)
196 9530 : CALL keyword_release(keyword)
197 :
198 : CALL keyword_create(keyword, __LOCATION__, name="ALPHA0_HARD", &
199 : variants=s2a("ALPHA0_H", "ALPHA0"), &
200 : description="GAPW: Exponent for hard compensation charge", &
201 9530 : usage="ALPHA0_HARD real", default_r_val=0.0_dp)
202 9530 : CALL section_add_keyword(section, keyword)
203 9530 : CALL keyword_release(keyword)
204 :
205 : CALL keyword_create( &
206 : keyword, __LOCATION__, name="FORCE_PAW", &
207 : description="Use the GAPW scheme also for atoms with soft basis sets, i.e. "// &
208 : "the local densities are computed even if hard and soft should be equal. "// &
209 : "If this keyword is not set to true, those atoms with soft basis sets are treated by a GPW scheme, i.e. "// &
210 : "the corresponding density contribution goes on the global grid and is expanded in PW. "// &
211 : "This option nullifies the effect of the GPW_TYPE in the atomic KIND", &
212 : usage="FORCE_PAW", &
213 9530 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
214 9530 : CALL section_add_keyword(section, keyword)
215 9530 : CALL keyword_release(keyword)
216 :
217 : CALL keyword_create(keyword, __LOCATION__, name="MAX_RAD_LOCAL", &
218 : description="GAPW : maximum radius of gaussian functions"// &
219 : " included in the generation of projectors", &
220 9530 : usage="MAX_RAD_LOCAL real", default_r_val=25.0_dp)
221 9530 : CALL section_add_keyword(section, keyword)
222 9530 : CALL keyword_release(keyword)
223 :
224 : CALL keyword_create(keyword, __LOCATION__, name="GAPW_1C_BASIS", &
225 : description="Specifies how to construct the GAPW one center basis set. "// &
226 : "Default is to use the primitives from the orbital basis.", &
227 : usage="GAPW_1C_BASIS MEDIUM", &
228 : enum_c_vals=s2a("ORB", "EXT_SMALL", "EXT_MEDIUM", "EXT_LARGE", "EXT_VERY_LARGE"), &
229 : enum_desc=s2a("Use orbital basis set.", &
230 : "Extension using Small number of primitive Gaussians.", &
231 : "Extension using Medium number of primitive Gaussians.", &
232 : "Extension using Large number of primitive Gaussians.", &
233 : "Extension using Very Large number of primitive Gaussians."), &
234 : enum_i_vals=[gapw_1c_orb, gapw_1c_small, gapw_1c_medium, &
235 : gapw_1c_large, gapw_1c_very_large], &
236 9530 : default_i_val=gapw_1c_orb)
237 9530 : CALL section_add_keyword(section, keyword)
238 9530 : CALL keyword_release(keyword)
239 :
240 : CALL keyword_create( &
241 : keyword, __LOCATION__, name="GAPW_ACCURATE_XCINT", &
242 : description="Use a more accurate integration scheme for the soft XC energy in GAPW.", &
243 : usage="GAPW_ACCURATE_XCINT", &
244 9530 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
245 9530 : CALL section_add_keyword(section, keyword)
246 9530 : CALL keyword_release(keyword)
247 :
248 : CALL keyword_create( &
249 : keyword, __LOCATION__, name="ALPHA_WEIGHTS", &
250 : description="Gaussian exponent reference (rc=1.2 Bohr) for accurate integration in GAPW.", &
251 9530 : usage="ALPHA_WEIGHTS 10.0", default_r_val=6.0_dp)
252 9530 : CALL section_add_keyword(section, keyword)
253 9530 : CALL keyword_release(keyword)
254 :
255 : CALL keyword_create(keyword, __LOCATION__, name="MIN_PAIR_LIST_RADIUS", &
256 : description="Set the minimum value [Bohr] for the overlap pair list radius."// &
257 : " Default is 0.0 Bohr, negative values are changed to the cell size."// &
258 : " This allows to control the sparsity of the KS matrix for HFX calculations.", &
259 9530 : usage="MIN_PAIR_LIST_RADIUS real", default_r_val=0.0_dp)
260 9530 : CALL section_add_keyword(section, keyword)
261 9530 : CALL keyword_release(keyword)
262 :
263 : ! Logicals
264 : CALL keyword_create(keyword, __LOCATION__, name="LS_SCF", &
265 : description="Perform a linear scaling SCF", &
266 : usage="LS_SCF", lone_keyword_l_val=.TRUE., &
267 9530 : default_l_val=.FALSE.)
268 9530 : CALL section_add_keyword(section, keyword)
269 9530 : CALL keyword_release(keyword)
270 :
271 : CALL keyword_create(keyword, __LOCATION__, name="ALMO_SCF", &
272 : description="Perform ALMO SCF", &
273 : usage="ALMO_SCF", lone_keyword_l_val=.TRUE., &
274 9530 : default_l_val=.FALSE.)
275 9530 : CALL section_add_keyword(section, keyword)
276 9530 : CALL keyword_release(keyword)
277 :
278 : CALL keyword_create(keyword, __LOCATION__, name="TRANSPORT", &
279 : description="Perform transport calculations (coupling CP2K and OMEN)", &
280 : usage="TRANSPORT", lone_keyword_l_val=.TRUE., &
281 9530 : default_l_val=.FALSE.)
282 9530 : CALL section_add_keyword(section, keyword)
283 9530 : CALL keyword_release(keyword)
284 :
285 : CALL keyword_create(keyword, __LOCATION__, name="KG_METHOD", &
286 : description="Use a Kim-Gordon-like scheme.", &
287 : usage="KG_METHOD", lone_keyword_l_val=.TRUE., &
288 38120 : default_l_val=.FALSE., citations=[Iannuzzi2006, Brelaz1979, Andermatt2016])
289 9530 : CALL section_add_keyword(section, keyword)
290 9530 : CALL keyword_release(keyword)
291 :
292 : CALL keyword_create(keyword, __LOCATION__, name="REF_EMBED_SUBSYS", &
293 : description="A total, reference, system in DFT embedding. ", &
294 : usage="REF_EMBED_SUBSYS FALSE", &
295 9530 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
296 9530 : CALL section_add_keyword(section, keyword)
297 9530 : CALL keyword_release(keyword)
298 :
299 : CALL keyword_create(keyword, __LOCATION__, name="CLUSTER_EMBED_SUBSYS", &
300 : description="A cluster treated with DFT in DFT embedding. ", &
301 : usage="CLUSTER_EMBED_SUBSYS FALSE", &
302 9530 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
303 9530 : CALL section_add_keyword(section, keyword)
304 9530 : CALL keyword_release(keyword)
305 :
306 : CALL keyword_create(keyword, __LOCATION__, name="HIGH_LEVEL_EMBED_SUBSYS", &
307 : description="A cluster treated with a high-level method in DFT embedding. ", &
308 : usage="HIGH_LEVEL_EMBED_SUBSYS FALSE", &
309 9530 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
310 9530 : CALL section_add_keyword(section, keyword)
311 9530 : CALL keyword_release(keyword)
312 :
313 : CALL keyword_create(keyword, __LOCATION__, name="DFET_EMBEDDED", &
314 : description="Calculation with DFT-embedding potential. ", &
315 : usage="DFET_EMBEDDED FALSE", &
316 9530 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
317 9530 : CALL section_add_keyword(section, keyword)
318 9530 : CALL keyword_release(keyword)
319 :
320 : CALL keyword_create(keyword, __LOCATION__, name="DMFET_EMBEDDED", &
321 : description="Calculation with DM embedding potential. ", &
322 : usage="DMFET_EMBEDDED FALSE", &
323 9530 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
324 9530 : CALL section_add_keyword(section, keyword)
325 9530 : CALL keyword_release(keyword)
326 :
327 : ! Integers
328 : CALL keyword_create(keyword, __LOCATION__, name="STO_NG", &
329 : description="Order of Gaussian type expansion of Slater orbital basis sets.", &
330 9530 : usage="STO_NG", default_i_val=6)
331 9530 : CALL section_add_keyword(section, keyword)
332 9530 : CALL keyword_release(keyword)
333 :
334 : CALL keyword_create(keyword, __LOCATION__, name="LMAXN1", &
335 : variants=["LMAXRHO1"], &
336 : description="GAPW : max L number for expansion of the atomic densities in spherical gaussians", &
337 : usage="LMAXN1 integer", &
338 19060 : default_i_val=-1)
339 9530 : CALL section_add_keyword(section, keyword)
340 9530 : CALL keyword_release(keyword)
341 :
342 : CALL keyword_create(keyword, __LOCATION__, name="LMAXN0", &
343 : variants=["LMAXRHO0"], &
344 : description="GAPW : max L number for the expansion compensation densities in spherical gaussians", &
345 : usage="LMAXN0 integer", &
346 19060 : default_i_val=2)
347 9530 : CALL section_add_keyword(section, keyword)
348 9530 : CALL keyword_release(keyword)
349 :
350 : CALL keyword_create(keyword, __LOCATION__, name="LADDN0", &
351 : description="GAPW : integer added to the max L of the basis set, used to determine the "// &
352 : "maximum value of L for the compensation charge density.", &
353 : usage="LADDN0 integer", &
354 9530 : default_i_val=99)
355 9530 : CALL section_add_keyword(section, keyword)
356 9530 : CALL keyword_release(keyword)
357 :
358 : ! Characters
359 : CALL keyword_create(keyword, __LOCATION__, name="QUADRATURE", &
360 : description="GAPW: algorithm to construct the atomic radial grids", &
361 : usage="QUADRATURE GC_SIMPLE", &
362 : enum_c_vals=s2a("GC_SIMPLE", "GC_TRANSFORMED", "GC_LOG"), &
363 : enum_i_vals=[do_gapw_gcs, do_gapw_gct, do_gapw_log], &
364 : enum_desc=s2a("Gauss-Chebyshev quadrature", &
365 : "Transformed Gauss-Chebyshev quadrature", &
366 : "Logarithmic transformed Gauss-Chebyshev quadrature"), &
367 9530 : default_i_val=do_gapw_log)
368 9530 : CALL section_add_keyword(section, keyword)
369 9530 : CALL keyword_release(keyword)
370 :
371 : CALL keyword_create(keyword, __LOCATION__, name="PW_GRID", &
372 : description="What kind of PW_GRID should be employed", &
373 : usage="PW_GRID NS-FULLSPACE", &
374 : enum_c_vals=s2a("SPHERICAL", "NS-FULLSPACE", "NS-HALFSPACE"), &
375 : enum_desc=s2a("- not tested", " tested", " - not tested"), &
376 : enum_i_vals=[do_pwgrid_spherical, do_pwgrid_ns_fullspace, do_pwgrid_ns_halfspace], &
377 9530 : default_i_val=do_pwgrid_ns_fullspace)
378 9530 : CALL section_add_keyword(section, keyword)
379 9530 : CALL keyword_release(keyword)
380 :
381 : CALL keyword_create(keyword, __LOCATION__, name="PW_GRID_LAYOUT", &
382 : description="Force a particular real-space layout for the plane waves grids. "// &
383 : "Numbers ≤ 0 mean that this dimension is free, incorrect layouts will be ignored. "// &
384 : "The default (/-1,-1/) causes CP2K to select a good value, "// &
385 : "i.e. plane distributed for large grids, more general distribution for small grids.", &
386 : usage="PW_GRID_LAYOUT 4 16", &
387 : repeats=.FALSE., n_var=2, &
388 9530 : default_i_vals=[-1, -1])
389 9530 : CALL section_add_keyword(section, keyword)
390 9530 : CALL keyword_release(keyword)
391 :
392 : CALL keyword_create(keyword, __LOCATION__, name="PW_GRID_BLOCKED", &
393 : description="Can be used to set the distribution in g-space for the pw grids and their FFT.", &
394 : usage="PW_GRID_BLOCKED FREE", &
395 : enum_c_vals=s2a("FREE", "TRUE", "FALSE"), &
396 : enum_desc=s2a("CP2K will select an appropriate value", "blocked", "not blocked"), &
397 : enum_i_vals=[do_pw_grid_blocked_free, do_pw_grid_blocked_true, do_pw_grid_blocked_false], &
398 9530 : default_i_val=do_pw_grid_blocked_free)
399 9530 : CALL section_add_keyword(section, keyword)
400 9530 : CALL keyword_release(keyword)
401 :
402 : CALL keyword_create( &
403 : keyword, __LOCATION__, name="EXTRAPOLATION", &
404 : variants=s2a("INTERPOLATION", "WF_INTERPOLATION"), &
405 : description="Extrapolation strategy for the wavefunction during e.g. MD. "// &
406 : "Not all options are available for all simulation methods. "// &
407 : "PS and ASPC are recommended, see also EXTRAPOLATION_ORDER.", &
408 : citations=[Kolafa2004, VandeVondele2005a, Kuhne2007], &
409 : usage="EXTRAPOLATION PS", &
410 : enum_c_vals=s2a("USE_GUESS", "USE_PREV_P", "USE_PREV_RHO_R", "LINEAR_WF", &
411 : "LINEAR_P", "LINEAR_PS", "USE_PREV_WF", "PS", "FROZEN", "ASPC"), &
412 : enum_desc=s2a( &
413 : "Use the method specified with SCF_GUESS, i.e. no extrapolation", &
414 : "Use the previous density matrix", &
415 : "Use the previous density in real space", &
416 : "Linear extrapolation of the wavefunction (not available for K-points)", &
417 : "Linear extrapolation of the density matrix", &
418 : "Linear extrapolation of the density matrix times the overlap matrix (not available for K-points)", &
419 : "Use the previous wavefunction (not available for K-points)", &
420 : "Higher order extrapolation of the density matrix times the overlap matrix (not available for K-points)", &
421 : "Frozen ...", &
422 : "Always stable predictor corrector, similar to PS, but going for MD stability instead of initial guess accuracy. "// &
423 : "(not available for K-points)"), &
424 : enum_i_vals=[ &
425 : wfi_use_guess_method_nr, &
426 : wfi_use_prev_p_method_nr, &
427 : wfi_use_prev_rho_r_method_nr, &
428 : wfi_linear_wf_method_nr, &
429 : wfi_linear_p_method_nr, &
430 : wfi_linear_ps_method_nr, &
431 : wfi_use_prev_wf_method_nr, &
432 : wfi_ps_method_nr, &
433 : wfi_frozen_method_nr, &
434 : wfi_aspc_nr], &
435 38120 : default_i_val=wfi_aspc_nr)
436 9530 : CALL section_add_keyword(section, keyword)
437 9530 : CALL keyword_release(keyword)
438 :
439 : CALL keyword_create(keyword, __LOCATION__, name="EXTRAPOLATION_ORDER", &
440 : description="Order for the PS or ASPC extrapolation (typically 2-4). "// &
441 : "Higher order might bring more accuracy, but comes, "// &
442 : "for large systems, also at some cost. "// &
443 : "In some cases, a high order extrapolation is not stable,"// &
444 : " and the order needs to be reduced.", &
445 9530 : usage="EXTRAPOLATION_ORDER {integer}", default_i_val=3)
446 9530 : CALL section_add_keyword(section, keyword)
447 9530 : CALL keyword_release(keyword)
448 :
449 : CALL keyword_create(keyword, __LOCATION__, name="METHOD", &
450 : description="Specifies the electronic structure method that should be employed", &
451 : usage="METHOD GAPW", &
452 : enum_c_vals=s2a("GAPW", "GAPW_XC", "GPW", "LRIGPW", "RIGPW", &
453 : "MNDO", "MNDOD", "AM1", "PM3", "PM6", "PM6-FM", "PDG", "RM1", "PNNL", "DFTB", "xTB", "OFGPW"), &
454 : enum_desc=s2a("Gaussian and augmented plane waves method", &
455 : "Gaussian and augmented plane waves method only for XC", &
456 : "Gaussian and plane waves method", &
457 : "Local resolution of identity method", &
458 : "Resolution of identity method for HXC terms", &
459 : "MNDO semiempirical", "MNDO-d semiempirical", "AM1 semiempirical", &
460 : "PM3 semiempirical", "PM6 semiempirical", "PM6-FM semiempirical", "PDG semiempirical", &
461 : "RM1 semiempirical", &
462 : "PNNL semiempirical", &
463 : "DFTB Density Functional based Tight-Binding", &
464 : "GFN-xTB Extended Tight-Binding", &
465 : "OFGPW Orbital-free GPW method"), &
466 : enum_i_vals=[do_method_gapw, do_method_gapw_xc, do_method_gpw, do_method_lrigpw, do_method_rigpw, &
467 : do_method_mndo, do_method_mndod, do_method_am1, do_method_pm3, &
468 : do_method_pm6, do_method_pm6fm, do_method_pdg, do_method_rm1, &
469 : do_method_pnnl, do_method_dftb, do_method_xtb, do_method_ofgpw], &
470 : citations=[Lippert1997, Lippert1999, Krack2000, VandeVondele2005a, &
471 : VandeVondele2006, Dewar1977, Dewar1985, Rocha2006, Stewart1989, Thiel1992, &
472 : Repasky2002, Stewart2007, VanVoorhis2015, Schenter2008], &
473 142950 : default_i_val=do_method_gpw)
474 9530 : CALL section_add_keyword(section, keyword)
475 9530 : CALL keyword_release(keyword)
476 :
477 : CALL keyword_create(keyword, __LOCATION__, name="CORE_PPL", &
478 : description="Specifies the method used to calculate the local pseudopotential contribution.", &
479 : usage="CORE_PPL ANALYTIC", &
480 : enum_c_vals=s2a("ANALYTIC", "GRID"), &
481 : enum_desc=s2a("Analytic integration of integrals", &
482 : "Numerical integration on real space grid. Lumped together with core charge"), &
483 : enum_i_vals=[do_ppl_analytic, do_ppl_grid], &
484 9530 : default_i_val=do_ppl_analytic)
485 9530 : CALL section_add_keyword(section, keyword)
486 9530 : CALL keyword_release(keyword)
487 :
488 : CALL keyword_create(keyword, __LOCATION__, name="EMBED_RESTART_FILE_NAME", &
489 : description="Root of the file name where to read the embedding "// &
490 : "potential guess.", &
491 : usage="EMBED_RESTART_FILE_NAME <FILENAME>", &
492 9530 : type_of_var=lchar_t)
493 9530 : CALL section_add_keyword(section, keyword)
494 9530 : CALL keyword_release(keyword)
495 :
496 : CALL keyword_create(keyword, __LOCATION__, name="EMBED_CUBE_FILE_NAME", &
497 : description="Root of the file name where to read the embedding "// &
498 : "potential (guess) as a cube.", &
499 : usage="EMBED_CUBE_FILE_NAME <FILENAME>", &
500 9530 : type_of_var=lchar_t)
501 9530 : CALL section_add_keyword(section, keyword)
502 9530 : CALL keyword_release(keyword)
503 :
504 : CALL keyword_create(keyword, __LOCATION__, name="EMBED_SPIN_CUBE_FILE_NAME", &
505 : description="Root of the file name where to read the spin part "// &
506 : "of the embedding potential (guess) as a cube.", &
507 : usage="EMBED_SPIN_CUBE_FILE_NAME <FILENAME>", &
508 9530 : type_of_var=lchar_t)
509 9530 : CALL section_add_keyword(section, keyword)
510 9530 : CALL keyword_release(keyword)
511 :
512 9530 : CALL create_distribution_section(subsection)
513 9530 : CALL section_add_subsection(section, subsection)
514 9530 : CALL section_release(subsection)
515 :
516 9530 : CALL create_dftb_control_section(subsection)
517 9530 : CALL section_add_subsection(section, subsection)
518 9530 : CALL section_release(subsection)
519 :
520 9530 : CALL create_xtb_control_section(subsection)
521 9530 : CALL section_add_subsection(section, subsection)
522 9530 : CALL section_release(subsection)
523 :
524 9530 : CALL create_se_control_section(subsection)
525 9530 : CALL section_add_subsection(section, subsection)
526 9530 : CALL section_release(subsection)
527 :
528 9530 : CALL create_mulliken_section(subsection)
529 9530 : CALL section_add_subsection(section, subsection)
530 9530 : CALL section_release(subsection)
531 :
532 9530 : CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT")
533 9530 : CALL section_add_subsection(section, subsection)
534 9530 : CALL section_release(subsection)
535 :
536 9530 : CALL create_cdft_control_section(subsection)
537 9530 : CALL section_add_subsection(section, subsection)
538 9530 : CALL section_release(subsection)
539 :
540 9530 : CALL create_s2_restraint_section(subsection)
541 9530 : CALL section_add_subsection(section, subsection)
542 9530 : CALL section_release(subsection)
543 :
544 9530 : CALL create_lrigpw_section(subsection)
545 9530 : CALL section_add_subsection(section, subsection)
546 9530 : CALL section_release(subsection)
547 :
548 9530 : CALL create_optimize_lri_basis_section(subsection)
549 9530 : CALL section_add_subsection(section, subsection)
550 9530 : CALL section_release(subsection)
551 :
552 : ! Embedding subsections: DFET and DMFET
553 9530 : CALL create_optimize_embed(subsection)
554 9530 : CALL section_add_subsection(section, subsection)
555 9530 : CALL section_release(subsection)
556 :
557 9530 : CALL create_optimize_dmfet(subsection)
558 9530 : CALL section_add_subsection(section, subsection)
559 9530 : CALL section_release(subsection)
560 :
561 9530 : END SUBROUTINE create_qs_section
562 :
563 : ! **************************************************************************************************
564 : !> \brief ...
565 : !> \param section ...
566 : ! **************************************************************************************************
567 9530 : SUBROUTINE create_mulliken_section(section)
568 : TYPE(section_type), POINTER :: section
569 :
570 : TYPE(keyword_type), POINTER :: keyword
571 :
572 9530 : NULLIFY (keyword)
573 9530 : CPASSERT(.NOT. ASSOCIATED(section))
574 : CALL section_create(section, __LOCATION__, name="MULLIKEN_RESTRAINT", &
575 : description="Use mulliken charges in a restraint (check code for details)", &
576 9530 : n_keywords=7, n_subsections=0, repeats=.FALSE.)
577 :
578 : CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
579 : description="force constant of the restraint", &
580 9530 : usage="STRENGTH {real} ", default_r_val=0.1_dp)
581 9530 : CALL section_add_keyword(section, keyword)
582 9530 : CALL keyword_release(keyword)
583 :
584 : CALL keyword_create(keyword, __LOCATION__, name="TARGET", &
585 : description="target value of the restraint", &
586 9530 : usage="TARGET {real} ", default_r_val=1._dp)
587 9530 : CALL section_add_keyword(section, keyword)
588 9530 : CALL keyword_release(keyword)
589 :
590 : CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
591 : description="Specifies the list of atoms that is summed in the restraint", &
592 : usage="ATOMS {integer} {integer} .. {integer}", &
593 9530 : n_var=-1, type_of_var=integer_t)
594 9530 : CALL section_add_keyword(section, keyword)
595 9530 : CALL keyword_release(keyword)
596 :
597 9530 : END SUBROUTINE create_mulliken_section
598 :
599 : ! **************************************************************************************************
600 : !> \brief ...
601 : !> \param section ...
602 : !> \param section_name ...
603 : ! **************************************************************************************************
604 28558 : SUBROUTINE create_ddapc_restraint_section(section, section_name)
605 : TYPE(section_type), POINTER :: section
606 : CHARACTER(len=*), INTENT(in) :: section_name
607 :
608 : TYPE(keyword_type), POINTER :: keyword
609 : TYPE(section_type), POINTER :: print_key
610 :
611 28558 : NULLIFY (keyword, print_key)
612 0 : CPASSERT(.NOT. ASSOCIATED(section))
613 : CALL section_create(section, __LOCATION__, name=TRIM(ADJUSTL(section_name)), &
614 : description="Use DDAPC charges in a restraint (check code for details)", &
615 28558 : n_keywords=7, n_subsections=0, repeats=.TRUE.)
616 :
617 : CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_DENSITY", &
618 : description="Specifies the type of density used for the fitting", &
619 : usage="TYPE_OF_DENSITY (FULL|SPIN)", &
620 : enum_c_vals=s2a("FULL", "SPIN"), &
621 : enum_i_vals=[do_full_density, do_spin_density], &
622 : enum_desc=s2a("Full density", "Spin density"), &
623 28558 : default_i_val=do_full_density)
624 28558 : CALL section_add_keyword(section, keyword)
625 28558 : CALL keyword_release(keyword)
626 :
627 : CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
628 : description="force constant of the restraint", &
629 28558 : usage="STRENGTH {real} ", default_r_val=0.1_dp)
630 28558 : CALL section_add_keyword(section, keyword)
631 28558 : CALL keyword_release(keyword)
632 :
633 : CALL keyword_create(keyword, __LOCATION__, name="TARGET", &
634 : description="target value of the restraint", &
635 28558 : usage="TARGET {real} ", default_r_val=1._dp)
636 28558 : CALL section_add_keyword(section, keyword)
637 28558 : CALL keyword_release(keyword)
638 :
639 : CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
640 : description="Specifies the list of atoms that is summed in the restraint", &
641 : usage="ATOMS {integer} {integer} .. {integer}", &
642 28558 : n_var=-1, type_of_var=integer_t)
643 28558 : CALL section_add_keyword(section, keyword)
644 28558 : CALL keyword_release(keyword)
645 :
646 : CALL keyword_create(keyword, __LOCATION__, name="COEFF", &
647 : description="Defines the the coefficient of the atom in the atom list (default is one) ", &
648 : usage="COEFF 1.0 -1.0", &
649 28558 : type_of_var=real_t, n_var=-1)
650 28558 : CALL section_add_keyword(section, keyword)
651 28558 : CALL keyword_release(keyword)
652 :
653 : CALL keyword_create(keyword, __LOCATION__, name="FUNCTIONAL_FORM", &
654 : description="Specifies the functional form of the term added", &
655 : usage="FUNCTIONAL_FORM RESTRAINT", &
656 : enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
657 : enum_i_vals=[do_ddapc_restraint, do_ddapc_constraint], &
658 : enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
659 28558 : default_i_val=do_ddapc_restraint)
660 28558 : CALL section_add_keyword(section, keyword)
661 28558 : CALL keyword_release(keyword)
662 :
663 : CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
664 : description="Controls the printing basic info about the method", &
665 28558 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
666 28558 : CALL section_add_subsection(section, print_key)
667 28558 : CALL section_release(print_key)
668 :
669 28558 : END SUBROUTINE create_ddapc_restraint_section
670 :
671 : ! **************************************************************************************************
672 : !> \brief ...
673 : !> \param section ...
674 : ! **************************************************************************************************
675 9530 : SUBROUTINE create_s2_restraint_section(section)
676 : TYPE(section_type), POINTER :: section
677 :
678 : TYPE(keyword_type), POINTER :: keyword
679 :
680 9530 : NULLIFY (keyword)
681 9530 : CPASSERT(.NOT. ASSOCIATED(section))
682 :
683 : CALL section_create(section, __LOCATION__, name="S2_RESTRAINT", &
684 : description="Use S2 in a re/constraint (OT only)", &
685 9530 : n_keywords=7, n_subsections=0, repeats=.FALSE.)
686 :
687 : CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
688 : description="force constant of the restraint", &
689 9530 : usage="STRENGTH {real} ", default_r_val=0.1_dp)
690 9530 : CALL section_add_keyword(section, keyword)
691 9530 : CALL keyword_release(keyword)
692 :
693 : CALL keyword_create(keyword, __LOCATION__, name="TARGET", &
694 : description="target value of the restraint", &
695 9530 : usage="TARGET {real} ", default_r_val=1._dp)
696 9530 : CALL section_add_keyword(section, keyword)
697 9530 : CALL keyword_release(keyword)
698 :
699 : CALL keyword_create(keyword, __LOCATION__, name="FUNCTIONAL_FORM", &
700 : description="Specifies the functional form of the term added", &
701 : usage="FUNCTIONAL_FORM RESTRAINT", &
702 : enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
703 : enum_i_vals=[do_s2_restraint, do_s2_constraint], &
704 : enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
705 9530 : default_i_val=do_s2_restraint)
706 9530 : CALL section_add_keyword(section, keyword)
707 9530 : CALL keyword_release(keyword)
708 :
709 9530 : END SUBROUTINE create_s2_restraint_section
710 :
711 : ! **************************************************************************************************
712 : !> \brief input section for optional parameters for LRIGPW
713 : !> LRI: local resolution of identity
714 : !> \param section the section to create
715 : !> \author Dorothea Golze [02.2015]
716 : ! **************************************************************************************************
717 38088 : SUBROUTINE create_lrigpw_section(section)
718 : TYPE(section_type), POINTER :: section
719 :
720 : TYPE(keyword_type), POINTER :: keyword
721 :
722 38088 : CPASSERT(.NOT. ASSOCIATED(section))
723 : CALL section_create(section, __LOCATION__, name="LRIGPW", &
724 : description="This section specifies optional parameters for LRIGPW.", &
725 76176 : n_keywords=3, n_subsections=0, repeats=.FALSE., citations=[Golze2017b])
726 :
727 38088 : NULLIFY (keyword)
728 :
729 : CALL keyword_create(keyword, __LOCATION__, name="LRI_OVERLAP_MATRIX", &
730 : description="Specifies whether to calculate the inverse or the "// &
731 : "pseudoinverse of the overlap matrix of the auxiliary "// &
732 : "basis set. Calculating the pseudoinverse is necessary "// &
733 : "for very large auxiliary basis sets, but more expensive. "// &
734 : "Using the pseudoinverse, consistent forces are not "// &
735 : "guaranteed yet.", &
736 : usage="LRI_OVERLAP_MATRIX INVERSE", &
737 : enum_c_vals=s2a("INVERSE", "PSEUDO_INVERSE_SVD", "PSEUDO_INVERSE_DIAG", &
738 : "AUTOSELECT"), &
739 : enum_desc=s2a("Calculate inverse of the overlap matrix.", &
740 : "Calculate the pseuodinverse of the overlap matrix "// &
741 : "using singular value decomposition.", &
742 : "Calculate the pseudoinverse of the overlap matrix "// &
743 : "by prior diagonalization.", &
744 : "Choose automatically for each pair whether to "// &
745 : "calculate the inverse or pseudoinverse based on the "// &
746 : "condition number of the overlap matrix for each pair. "// &
747 : "Calculating the pseudoinverse is much more expensive."), &
748 : enum_i_vals=[do_lri_inv, do_lri_pseudoinv_svd, &
749 : do_lri_pseudoinv_diag, do_lri_inv_auto], &
750 38088 : default_i_val=do_lri_inv)
751 38088 : CALL section_add_keyword(section, keyword)
752 38088 : CALL keyword_release(keyword)
753 :
754 : CALL keyword_create(keyword, __LOCATION__, name="MAX_CONDITION_NUM", &
755 : description="If AUTOSELECT is chosen for LRI_OVERLAP_MATRIX, this "// &
756 : "keyword specifies that the pseudoinverse is calculated "// &
757 : "only if the LOG of the condition number of the lri "// &
758 : "overlap matrix is larger than the given value.", &
759 38088 : usage="MAX_CONDITION_NUM 20.0", default_r_val=20.0_dp)
760 38088 : CALL section_add_keyword(section, keyword)
761 38088 : CALL keyword_release(keyword)
762 :
763 : CALL keyword_create(keyword, __LOCATION__, name="EPS_O3_INT", &
764 : description="Threshold for ABA and ABB integrals in LRI. "// &
765 : "This is used for screening in the KS and "// &
766 : "force calculations (tensor contractions).", &
767 38088 : usage="EPS_O3_INT 1.e-10", default_r_val=1.0e-14_dp)
768 38088 : CALL section_add_keyword(section, keyword)
769 38088 : CALL keyword_release(keyword)
770 :
771 : CALL keyword_create(keyword, __LOCATION__, name="DEBUG_LRI_INTEGRALS", &
772 : description="Debug the integrals needed for LRIGPW.", &
773 : usage="DEBUG_LRI_INTEGRALS TRUE", &
774 38088 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
775 38088 : CALL section_add_keyword(section, keyword)
776 38088 : CALL keyword_release(keyword)
777 :
778 : CALL keyword_create(keyword, __LOCATION__, name="EXACT_1C_TERMS", &
779 : description="Don't use LRI for one center densities.", &
780 : usage="EXACT_1C_TERMS TRUE", &
781 38088 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
782 38088 : CALL section_add_keyword(section, keyword)
783 38088 : CALL keyword_release(keyword)
784 :
785 : CALL keyword_create(keyword, __LOCATION__, name="PPL_RI", &
786 : description="Use LRI/RI for local pseudopotential.", &
787 : usage="PPL_RI TRUE", &
788 38088 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
789 38088 : CALL section_add_keyword(section, keyword)
790 38088 : CALL keyword_release(keyword)
791 :
792 : CALL keyword_create(keyword, __LOCATION__, name="RI_STATISTIC", &
793 : description="Print statistical information on the RI calculation.", &
794 : usage="RI_STATISTIC TRUE", &
795 38088 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
796 38088 : CALL section_add_keyword(section, keyword)
797 38088 : CALL keyword_release(keyword)
798 :
799 : CALL keyword_create(keyword, __LOCATION__, name="DISTANT_PAIR_APPROXIMATION", &
800 : description="Calculate distant pairs using an independent atom approximation.", &
801 : usage="DISTANT_PAIR_APPROXIMATION TRUE", &
802 38088 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
803 38088 : CALL section_add_keyword(section, keyword)
804 38088 : CALL keyword_release(keyword)
805 :
806 : CALL keyword_create(keyword, __LOCATION__, name="DISTANT_PAIR_METHOD", &
807 : description="Method used to separate pair density for distant pairs. "// &
808 : "Options: EW (equal weights); AW (atomic weights); SW (set weights); "// &
809 : "LW (shell function weights)", &
810 : usage="DISTANT_PAIR_METHOD {method}", &
811 38088 : default_c_val="LW")
812 38088 : CALL section_add_keyword(section, keyword)
813 38088 : CALL keyword_release(keyword)
814 :
815 : CALL keyword_create(keyword, __LOCATION__, name="DISTANT_PAIR_RADII", &
816 : description="Inner and outer radii used in distant "// &
817 : "pair separation. Smooth interpolation between inner and outer "// &
818 : "radius is used.", &
819 : usage="DISTANT_PAIR_RADII r_inner {real} r_outer {real} ", &
820 : n_var=2, default_r_vals=[8._dp, 12._dp], unit_str='bohr', &
821 38088 : type_of_var=real_t)
822 38088 : CALL section_add_keyword(section, keyword)
823 38088 : CALL keyword_release(keyword)
824 :
825 : CALL keyword_create(keyword, __LOCATION__, name="SHG_LRI_INTEGRALS", &
826 : description="Uses the SHG (solid harmonic Gaussian) integral "// &
827 : "scheme instead of Obara-Saika", &
828 : usage="SHG_LRI_INTEGRALS TRUE", &
829 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE., &
830 76176 : citations=[Golze2017a])
831 38088 : CALL section_add_keyword(section, keyword)
832 38088 : CALL keyword_release(keyword)
833 :
834 : CALL keyword_create(keyword, __LOCATION__, name="RI_SINV", &
835 : description="Approximation to be used for the inverse of the "// &
836 : "RI overlap matrix. INVF, INVS: exact inverse, apply directly "// &
837 : "for solver (F:full matrix, S:sparsematrix). AINV approximate inverse, use with PCG. "// &
838 : "NONE: no approximation used with CG solver.", &
839 38088 : usage="RI_SINV NONE", default_c_val="INVF")
840 38088 : CALL section_add_keyword(section, keyword)
841 38088 : CALL keyword_release(keyword)
842 :
843 38088 : END SUBROUTINE create_lrigpw_section
844 :
845 : END MODULE input_cp2k_qs
|