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 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 8546 : 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 8546 : CPASSERT(.NOT. ASSOCIATED(section))
84 : CALL section_create(section, __LOCATION__, name="qs", &
85 : description="parameters needed to set up the Quickstep framework", &
86 8546 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
87 :
88 8546 : 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 8546 : usage="EPS_DEFAULT real", default_r_val=1.0E-10_dp)
94 8546 : CALL section_add_keyword(section, keyword)
95 8546 : 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 8546 : usage="EPS_CORE_CHARGE real", type_of_var=real_t)
100 8546 : CALL section_add_keyword(section, keyword)
101 8546 : 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 17092 : usage="EPS_GVG_RSPACE real", type_of_var=real_t)
108 8546 : CALL section_add_keyword(section, keyword)
109 8546 : 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 8546 : usage="EPS_PGF_ORB real", type_of_var=real_t)
114 8546 : CALL section_add_keyword(section, keyword)
115 8546 : 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 8546 : type_of_var=real_t)
122 8546 : CALL section_add_keyword(section, keyword)
123 8546 : 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 8546 : usage="EPS_PPL real", type_of_var=real_t, default_r_val=1.0E-2_dp)
128 8546 : CALL section_add_keyword(section, keyword)
129 8546 : 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 8546 : usage="EPS_PPNL real", type_of_var=real_t)
135 8546 : CALL section_add_keyword(section, keyword)
136 8546 : 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 8546 : usage="EPS_CPC real", type_of_var=real_t)
141 8546 : CALL section_add_keyword(section, keyword)
142 8546 : 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 8546 : usage="EPS_RHO real", type_of_var=real_t)
147 8546 : CALL section_add_keyword(section, keyword)
148 8546 : 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 8546 : usage="EPS_RHO_RSPACE real", type_of_var=real_t)
154 8546 : CALL section_add_keyword(section, keyword)
155 8546 : 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 8546 : usage="EPS_RHO_GSPACE real", type_of_var=real_t)
161 8546 : CALL section_add_keyword(section, keyword)
162 8546 : 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 8546 : usage="EPS_FILTER_MATRIX 1.0E-6", type_of_var=real_t, default_r_val=0.0E0_dp)
167 8546 : CALL section_add_keyword(section, keyword)
168 8546 : 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 17092 : usage="EPSFIT real", default_r_val=1.0E-4_dp)
174 8546 : CALL section_add_keyword(section, keyword)
175 8546 : 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 17092 : usage="EPSISO real", default_r_val=1.0E-12_dp)
181 8546 : CALL section_add_keyword(section, keyword)
182 8546 : 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 17092 : usage="EPS_SVD real", default_r_val=1.0E-8_dp)
188 8546 : CALL section_add_keyword(section, keyword)
189 8546 : 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 8546 : usage="EPSRHO0 real", default_r_val=1.0E-6_dp)
195 8546 : CALL section_add_keyword(section, keyword)
196 8546 : 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 8546 : usage="ALPHA0_HARD real", default_r_val=0.0_dp)
202 8546 : CALL section_add_keyword(section, keyword)
203 8546 : 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 8546 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
214 8546 : CALL section_add_keyword(section, keyword)
215 8546 : 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 8546 : usage="MAX_RAD_LOCAL real", default_r_val=25.0_dp)
221 8546 : CALL section_add_keyword(section, keyword)
222 8546 : 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 8546 : default_i_val=gapw_1c_orb)
237 8546 : CALL section_add_keyword(section, keyword)
238 8546 : CALL keyword_release(keyword)
239 :
240 : CALL keyword_create(keyword, __LOCATION__, name="MIN_PAIR_LIST_RADIUS", &
241 : description="Set the minimum value [Bohr] for the overlap pair list radius."// &
242 : " Default is 0.0 Bohr, negative values are changed to the cell size."// &
243 : " This allows to control the sparsity of the KS matrix for HFX calculations.", &
244 8546 : usage="MIN_PAIR_LIST_RADIUS real", default_r_val=0.0_dp)
245 8546 : CALL section_add_keyword(section, keyword)
246 8546 : CALL keyword_release(keyword)
247 :
248 : ! Logicals
249 : CALL keyword_create(keyword, __LOCATION__, name="LS_SCF", &
250 : description="Perform a linear scaling SCF", &
251 : usage="LS_SCF", lone_keyword_l_val=.TRUE., &
252 8546 : default_l_val=.FALSE.)
253 8546 : CALL section_add_keyword(section, keyword)
254 8546 : CALL keyword_release(keyword)
255 :
256 : CALL keyword_create(keyword, __LOCATION__, name="ALMO_SCF", &
257 : description="Perform ALMO SCF", &
258 : usage="ALMO_SCF", lone_keyword_l_val=.TRUE., &
259 8546 : default_l_val=.FALSE.)
260 8546 : CALL section_add_keyword(section, keyword)
261 8546 : CALL keyword_release(keyword)
262 :
263 : CALL keyword_create(keyword, __LOCATION__, name="TRANSPORT", &
264 : description="Perform transport calculations (coupling CP2K and OMEN)", &
265 : usage="TRANSPORT", lone_keyword_l_val=.TRUE., &
266 8546 : default_l_val=.FALSE.)
267 8546 : CALL section_add_keyword(section, keyword)
268 8546 : CALL keyword_release(keyword)
269 :
270 : CALL keyword_create(keyword, __LOCATION__, name="KG_METHOD", &
271 : description="Use a Kim-Gordon-like scheme.", &
272 : usage="KG_METHOD", lone_keyword_l_val=.TRUE., &
273 34184 : default_l_val=.FALSE., citations=(/Iannuzzi2006, Brelaz1979, Andermatt2016/))
274 8546 : CALL section_add_keyword(section, keyword)
275 8546 : CALL keyword_release(keyword)
276 :
277 : CALL keyword_create(keyword, __LOCATION__, name="REF_EMBED_SUBSYS", &
278 : description="A total, reference, system in DFT embedding. ", &
279 : usage="REF_EMBED_SUBSYS FALSE", &
280 8546 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
281 8546 : CALL section_add_keyword(section, keyword)
282 8546 : CALL keyword_release(keyword)
283 :
284 : CALL keyword_create(keyword, __LOCATION__, name="CLUSTER_EMBED_SUBSYS", &
285 : description="A cluster treated with DFT in DFT embedding. ", &
286 : usage="CLUSTER_EMBED_SUBSYS FALSE", &
287 8546 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
288 8546 : CALL section_add_keyword(section, keyword)
289 8546 : CALL keyword_release(keyword)
290 :
291 : CALL keyword_create(keyword, __LOCATION__, name="HIGH_LEVEL_EMBED_SUBSYS", &
292 : description="A cluster treated with a high-level method in DFT embedding. ", &
293 : usage="HIGH_LEVEL_EMBED_SUBSYS FALSE", &
294 8546 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
295 8546 : CALL section_add_keyword(section, keyword)
296 8546 : CALL keyword_release(keyword)
297 :
298 : CALL keyword_create(keyword, __LOCATION__, name="DFET_EMBEDDED", &
299 : description="Calculation with DFT-embedding potential. ", &
300 : usage="DFET_EMBEDDED FALSE", &
301 8546 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
302 8546 : CALL section_add_keyword(section, keyword)
303 8546 : CALL keyword_release(keyword)
304 :
305 : CALL keyword_create(keyword, __LOCATION__, name="DMFET_EMBEDDED", &
306 : description="Calculation with DM embedding potential. ", &
307 : usage="DMFET_EMBEDDED FALSE", &
308 8546 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
309 8546 : CALL section_add_keyword(section, keyword)
310 8546 : CALL keyword_release(keyword)
311 :
312 : ! Integers
313 : CALL keyword_create(keyword, __LOCATION__, name="STO_NG", &
314 : description="Order of Gaussian type expansion of Slater orbital basis sets.", &
315 8546 : usage="STO_NG", default_i_val=6)
316 8546 : CALL section_add_keyword(section, keyword)
317 8546 : CALL keyword_release(keyword)
318 :
319 : CALL keyword_create(keyword, __LOCATION__, name="LMAXN1", &
320 : variants=(/"LMAXRHO1"/), &
321 : description="GAPW : max L number for expansion of the atomic densities in spherical gaussians", &
322 : usage="LMAXN1 integer", &
323 17092 : default_i_val=-1)
324 8546 : CALL section_add_keyword(section, keyword)
325 8546 : CALL keyword_release(keyword)
326 :
327 : CALL keyword_create(keyword, __LOCATION__, name="LMAXN0", &
328 : variants=(/"LMAXRHO0"/), &
329 : description="GAPW : max L number for the expansion compensation densities in spherical gaussians", &
330 : usage="LMAXN0 integer", &
331 17092 : default_i_val=2)
332 8546 : CALL section_add_keyword(section, keyword)
333 8546 : CALL keyword_release(keyword)
334 :
335 : CALL keyword_create(keyword, __LOCATION__, name="LADDN0", &
336 : description="GAPW : integer added to the max L of the basis set, used to determine the "// &
337 : "maximum value of L for the compensation charge density.", &
338 : usage="LADDN0 integer", &
339 8546 : default_i_val=99)
340 8546 : CALL section_add_keyword(section, keyword)
341 8546 : CALL keyword_release(keyword)
342 :
343 : ! Characters
344 : CALL keyword_create(keyword, __LOCATION__, name="QUADRATURE", &
345 : description="GAPW: algorithm to construct the atomic radial grids", &
346 : usage="QUADRATURE GC_SIMPLE", &
347 : enum_c_vals=s2a("GC_SIMPLE", "GC_TRANSFORMED", "GC_LOG"), &
348 : enum_i_vals=(/do_gapw_gcs, do_gapw_gct, do_gapw_log/), &
349 : enum_desc=s2a("Gauss-Chebyshev quadrature", &
350 : "Transformed Gauss-Chebyshev quadrature", &
351 : "Logarithmic transformed Gauss-Chebyshev quadrature"), &
352 8546 : default_i_val=do_gapw_log)
353 8546 : CALL section_add_keyword(section, keyword)
354 8546 : CALL keyword_release(keyword)
355 :
356 : CALL keyword_create(keyword, __LOCATION__, name="PW_GRID", &
357 : description="What kind of PW_GRID should be employed", &
358 : usage="PW_GRID NS-FULLSPACE", &
359 : enum_c_vals=s2a("SPHERICAL", "NS-FULLSPACE", "NS-HALFSPACE"), &
360 : enum_desc=s2a("- not tested", " tested", " - not tested"), &
361 : enum_i_vals=(/do_pwgrid_spherical, do_pwgrid_ns_fullspace, do_pwgrid_ns_halfspace/), &
362 8546 : default_i_val=do_pwgrid_ns_fullspace)
363 8546 : CALL section_add_keyword(section, keyword)
364 8546 : CALL keyword_release(keyword)
365 :
366 : CALL keyword_create(keyword, __LOCATION__, name="PW_GRID_LAYOUT", &
367 : description="Force a particular real-space layout for the plane waves grids. "// &
368 : "Numbers ≤ 0 mean that this dimension is free, incorrect layouts will be ignored. "// &
369 : "The default (/-1,-1/) causes CP2K to select a good value, "// &
370 : "i.e. plane distributed for large grids, more general distribution for small grids.", &
371 : usage="PW_GRID_LAYOUT 4 16", &
372 : repeats=.FALSE., n_var=2, &
373 8546 : default_i_vals=(/-1, -1/))
374 8546 : CALL section_add_keyword(section, keyword)
375 8546 : CALL keyword_release(keyword)
376 :
377 : CALL keyword_create(keyword, __LOCATION__, name="PW_GRID_BLOCKED", &
378 : description="Can be used to set the distribution in g-space for the pw grids and their FFT.", &
379 : usage="PW_GRID_BLOCKED FREE", &
380 : enum_c_vals=s2a("FREE", "TRUE", "FALSE"), &
381 : enum_desc=s2a("CP2K will select an appropriate value", "blocked", "not blocked"), &
382 : enum_i_vals=(/do_pw_grid_blocked_free, do_pw_grid_blocked_true, do_pw_grid_blocked_false/), &
383 8546 : default_i_val=do_pw_grid_blocked_free)
384 8546 : CALL section_add_keyword(section, keyword)
385 8546 : CALL keyword_release(keyword)
386 :
387 : CALL keyword_create( &
388 : keyword, __LOCATION__, name="EXTRAPOLATION", &
389 : variants=s2a("INTERPOLATION", "WF_INTERPOLATION"), &
390 : description="Extrapolation strategy for the wavefunction during e.g. MD. "// &
391 : "Not all options are available for all simulation methods. "// &
392 : "PS and ASPC are recommended, see also EXTRAPOLATION_ORDER.", &
393 : citations=(/Kolafa2004, VandeVondele2005a, Kuhne2007/), &
394 : usage="EXTRAPOLATION PS", &
395 : enum_c_vals=s2a("USE_GUESS", "USE_PREV_P", "USE_PREV_RHO_R", "LINEAR_WF", &
396 : "LINEAR_P", "LINEAR_PS", "USE_PREV_WF", "PS", "FROZEN", "ASPC"), &
397 : enum_desc=s2a( &
398 : "Use the method specified with SCF_GUESS, i.e. no extrapolation", &
399 : "Use the previous density matrix", &
400 : "Use the previous density in real space", &
401 : "Linear extrapolation of the wavefunction (not available for K-points)", &
402 : "Linear extrapolation of the density matrix", &
403 : "Linear extrapolation of the density matrix times the overlap matrix (not available for K-points)", &
404 : "Use the previous wavefunction (not available for K-points)", &
405 : "Higher order extrapolation of the density matrix times the overlap matrix (not available for K-points)", &
406 : "Frozen ...", &
407 : "Always stable predictor corrector, similar to PS, but going for MD stability instead of initial guess accuracy. "// &
408 : "(not available for K-points)"), &
409 : enum_i_vals=(/ &
410 : wfi_use_guess_method_nr, &
411 : wfi_use_prev_p_method_nr, &
412 : wfi_use_prev_rho_r_method_nr, &
413 : wfi_linear_wf_method_nr, &
414 : wfi_linear_p_method_nr, &
415 : wfi_linear_ps_method_nr, &
416 : wfi_use_prev_wf_method_nr, &
417 : wfi_ps_method_nr, &
418 : wfi_frozen_method_nr, &
419 : wfi_aspc_nr/), &
420 34184 : default_i_val=wfi_aspc_nr)
421 8546 : CALL section_add_keyword(section, keyword)
422 8546 : CALL keyword_release(keyword)
423 :
424 : CALL keyword_create(keyword, __LOCATION__, name="EXTRAPOLATION_ORDER", &
425 : description="Order for the PS or ASPC extrapolation (typically 2-4). "// &
426 : "Higher order might bring more accuracy, but comes, "// &
427 : "for large systems, also at some cost. "// &
428 : "In some cases, a high order extrapolation is not stable,"// &
429 : " and the order needs to be reduced.", &
430 8546 : usage="EXTRAPOLATION_ORDER {integer}", default_i_val=3)
431 8546 : CALL section_add_keyword(section, keyword)
432 8546 : CALL keyword_release(keyword)
433 :
434 : CALL keyword_create(keyword, __LOCATION__, name="METHOD", &
435 : description="Specifies the electronic structure method that should be employed", &
436 : usage="METHOD GAPW", &
437 : enum_c_vals=s2a("GAPW", "GAPW_XC", "GPW", "LRIGPW", "RIGPW", &
438 : "MNDO", "MNDOD", "AM1", "PM3", "PM6", "PM6-FM", "PDG", "RM1", "PNNL", "DFTB", "xTB", "OFGPW"), &
439 : enum_desc=s2a("Gaussian and augmented plane waves method", &
440 : "Gaussian and augmented plane waves method only for XC", &
441 : "Gaussian and plane waves method", &
442 : "Local resolution of identity method", &
443 : "Resolution of identity method for HXC terms", &
444 : "MNDO semiempirical", "MNDO-d semiempirical", "AM1 semiempirical", &
445 : "PM3 semiempirical", "PM6 semiempirical", "PM6-FM semiempirical", "PDG semiempirical", &
446 : "RM1 semiempirical", &
447 : "PNNL semiempirical", &
448 : "DFTB Density Functional based Tight-Binding", &
449 : "GFN-xTB Extended Tight-Binding", &
450 : "OFGPW Orbital-free GPW method"), &
451 : enum_i_vals=(/do_method_gapw, do_method_gapw_xc, do_method_gpw, do_method_lrigpw, do_method_rigpw, &
452 : do_method_mndo, do_method_mndod, do_method_am1, do_method_pm3, &
453 : do_method_pm6, do_method_pm6fm, do_method_pdg, do_method_rm1, &
454 : do_method_pnnl, do_method_dftb, do_method_xtb, do_method_ofgpw/), &
455 : citations=(/Lippert1997, Lippert1999, Krack2000, VandeVondele2005a, &
456 : VandeVondele2006, Dewar1977, Dewar1985, Rocha2006, Stewart1989, Thiel1992, &
457 : Repasky2002, Stewart2007, VanVoorhis2015, Schenter2008/), &
458 128190 : default_i_val=do_method_gpw)
459 8546 : CALL section_add_keyword(section, keyword)
460 8546 : CALL keyword_release(keyword)
461 :
462 : CALL keyword_create(keyword, __LOCATION__, name="CORE_PPL", &
463 : description="Specifies the method used to calculate the local pseudopotential contribution.", &
464 : usage="CORE_PPL ANALYTIC", &
465 : enum_c_vals=s2a("ANALYTIC", "GRID"), &
466 : enum_desc=s2a("Analytic integration of integrals", &
467 : "Numerical integration on real space grid. Lumped together with core charge"), &
468 : enum_i_vals=(/do_ppl_analytic, do_ppl_grid/), &
469 8546 : default_i_val=do_ppl_analytic)
470 8546 : CALL section_add_keyword(section, keyword)
471 8546 : CALL keyword_release(keyword)
472 :
473 : CALL keyword_create(keyword, __LOCATION__, name="EMBED_RESTART_FILE_NAME", &
474 : description="Root of the file name where to read the embedding "// &
475 : "potential guess.", &
476 : usage="EMBED_RESTART_FILE_NAME <FILENAME>", &
477 8546 : type_of_var=lchar_t)
478 8546 : CALL section_add_keyword(section, keyword)
479 8546 : CALL keyword_release(keyword)
480 :
481 : CALL keyword_create(keyword, __LOCATION__, name="EMBED_CUBE_FILE_NAME", &
482 : description="Root of the file name where to read the embedding "// &
483 : "potential (guess) as a cube.", &
484 : usage="EMBED_CUBE_FILE_NAME <FILENAME>", &
485 8546 : type_of_var=lchar_t)
486 8546 : CALL section_add_keyword(section, keyword)
487 8546 : CALL keyword_release(keyword)
488 :
489 : CALL keyword_create(keyword, __LOCATION__, name="EMBED_SPIN_CUBE_FILE_NAME", &
490 : description="Root of the file name where to read the spin part "// &
491 : "of the embedding potential (guess) as a cube.", &
492 : usage="EMBED_SPIN_CUBE_FILE_NAME <FILENAME>", &
493 8546 : type_of_var=lchar_t)
494 8546 : CALL section_add_keyword(section, keyword)
495 8546 : CALL keyword_release(keyword)
496 :
497 8546 : CALL create_distribution_section(subsection)
498 8546 : CALL section_add_subsection(section, subsection)
499 8546 : CALL section_release(subsection)
500 :
501 8546 : CALL create_dftb_control_section(subsection)
502 8546 : CALL section_add_subsection(section, subsection)
503 8546 : CALL section_release(subsection)
504 :
505 8546 : CALL create_xtb_control_section(subsection)
506 8546 : CALL section_add_subsection(section, subsection)
507 8546 : CALL section_release(subsection)
508 :
509 8546 : CALL create_se_control_section(subsection)
510 8546 : CALL section_add_subsection(section, subsection)
511 8546 : CALL section_release(subsection)
512 :
513 8546 : CALL create_mulliken_section(subsection)
514 8546 : CALL section_add_subsection(section, subsection)
515 8546 : CALL section_release(subsection)
516 :
517 8546 : CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT")
518 8546 : CALL section_add_subsection(section, subsection)
519 8546 : CALL section_release(subsection)
520 :
521 8546 : CALL create_cdft_control_section(subsection)
522 8546 : CALL section_add_subsection(section, subsection)
523 8546 : CALL section_release(subsection)
524 :
525 8546 : CALL create_s2_restraint_section(subsection)
526 8546 : CALL section_add_subsection(section, subsection)
527 8546 : CALL section_release(subsection)
528 :
529 8546 : CALL create_lrigpw_section(subsection)
530 8546 : CALL section_add_subsection(section, subsection)
531 8546 : CALL section_release(subsection)
532 :
533 8546 : CALL create_optimize_lri_basis_section(subsection)
534 8546 : CALL section_add_subsection(section, subsection)
535 8546 : CALL section_release(subsection)
536 :
537 : ! Embedding subsections: DFET and DMFET
538 8546 : CALL create_optimize_embed(subsection)
539 8546 : CALL section_add_subsection(section, subsection)
540 8546 : CALL section_release(subsection)
541 :
542 8546 : CALL create_optimize_dmfet(subsection)
543 8546 : CALL section_add_subsection(section, subsection)
544 8546 : CALL section_release(subsection)
545 :
546 8546 : END SUBROUTINE create_qs_section
547 :
548 : ! **************************************************************************************************
549 : !> \brief ...
550 : !> \param section ...
551 : ! **************************************************************************************************
552 8546 : SUBROUTINE create_mulliken_section(section)
553 : TYPE(section_type), POINTER :: section
554 :
555 : TYPE(keyword_type), POINTER :: keyword
556 :
557 8546 : NULLIFY (keyword)
558 8546 : CPASSERT(.NOT. ASSOCIATED(section))
559 : CALL section_create(section, __LOCATION__, name="MULLIKEN_RESTRAINT", &
560 : description="Use mulliken charges in a restraint (check code for details)", &
561 8546 : n_keywords=7, n_subsections=0, repeats=.FALSE.)
562 :
563 : CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
564 : description="force constant of the restraint", &
565 8546 : usage="STRENGTH {real} ", default_r_val=0.1_dp)
566 8546 : CALL section_add_keyword(section, keyword)
567 8546 : CALL keyword_release(keyword)
568 :
569 : CALL keyword_create(keyword, __LOCATION__, name="TARGET", &
570 : description="target value of the restraint", &
571 8546 : usage="TARGET {real} ", default_r_val=1._dp)
572 8546 : CALL section_add_keyword(section, keyword)
573 8546 : CALL keyword_release(keyword)
574 :
575 : CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
576 : description="Specifies the list of atoms that is summed in the restraint", &
577 : usage="ATOMS {integer} {integer} .. {integer}", &
578 8546 : n_var=-1, type_of_var=integer_t)
579 8546 : CALL section_add_keyword(section, keyword)
580 8546 : CALL keyword_release(keyword)
581 :
582 8546 : END SUBROUTINE create_mulliken_section
583 :
584 : ! **************************************************************************************************
585 : !> \brief ...
586 : !> \param section ...
587 : !> \param section_name ...
588 : ! **************************************************************************************************
589 25606 : SUBROUTINE create_ddapc_restraint_section(section, section_name)
590 : TYPE(section_type), POINTER :: section
591 : CHARACTER(len=*), INTENT(in) :: section_name
592 :
593 : TYPE(keyword_type), POINTER :: keyword
594 : TYPE(section_type), POINTER :: print_key
595 :
596 25606 : NULLIFY (keyword, print_key)
597 0 : CPASSERT(.NOT. ASSOCIATED(section))
598 : CALL section_create(section, __LOCATION__, name=TRIM(ADJUSTL(section_name)), &
599 : description="Use DDAPC charges in a restraint (check code for details)", &
600 25606 : n_keywords=7, n_subsections=0, repeats=.TRUE.)
601 :
602 : CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_DENSITY", &
603 : description="Specifies the type of density used for the fitting", &
604 : usage="TYPE_OF_DENSITY (FULL|SPIN)", &
605 : enum_c_vals=s2a("FULL", "SPIN"), &
606 : enum_i_vals=(/do_full_density, do_spin_density/), &
607 : enum_desc=s2a("Full density", "Spin density"), &
608 25606 : default_i_val=do_full_density)
609 25606 : CALL section_add_keyword(section, keyword)
610 25606 : CALL keyword_release(keyword)
611 :
612 : CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
613 : description="force constant of the restraint", &
614 25606 : usage="STRENGTH {real} ", default_r_val=0.1_dp)
615 25606 : CALL section_add_keyword(section, keyword)
616 25606 : CALL keyword_release(keyword)
617 :
618 : CALL keyword_create(keyword, __LOCATION__, name="TARGET", &
619 : description="target value of the restraint", &
620 25606 : usage="TARGET {real} ", default_r_val=1._dp)
621 25606 : CALL section_add_keyword(section, keyword)
622 25606 : CALL keyword_release(keyword)
623 :
624 : CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
625 : description="Specifies the list of atoms that is summed in the restraint", &
626 : usage="ATOMS {integer} {integer} .. {integer}", &
627 25606 : n_var=-1, type_of_var=integer_t)
628 25606 : CALL section_add_keyword(section, keyword)
629 25606 : CALL keyword_release(keyword)
630 :
631 : CALL keyword_create(keyword, __LOCATION__, name="COEFF", &
632 : description="Defines the the coefficient of the atom in the atom list (default is one) ", &
633 : usage="COEFF 1.0 -1.0", &
634 25606 : type_of_var=real_t, n_var=-1)
635 25606 : CALL section_add_keyword(section, keyword)
636 25606 : CALL keyword_release(keyword)
637 :
638 : CALL keyword_create(keyword, __LOCATION__, name="FUNCTIONAL_FORM", &
639 : description="Specifies the functional form of the term added", &
640 : usage="FUNCTIONAL_FORM RESTRAINT", &
641 : enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
642 : enum_i_vals=(/do_ddapc_restraint, do_ddapc_constraint/), &
643 : enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
644 25606 : default_i_val=do_ddapc_restraint)
645 25606 : CALL section_add_keyword(section, keyword)
646 25606 : CALL keyword_release(keyword)
647 :
648 : CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
649 : description="Controls the printing basic info about the method", &
650 25606 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
651 25606 : CALL section_add_subsection(section, print_key)
652 25606 : CALL section_release(print_key)
653 :
654 25606 : END SUBROUTINE create_ddapc_restraint_section
655 :
656 : ! **************************************************************************************************
657 : !> \brief ...
658 : !> \param section ...
659 : ! **************************************************************************************************
660 8546 : SUBROUTINE create_s2_restraint_section(section)
661 : TYPE(section_type), POINTER :: section
662 :
663 : TYPE(keyword_type), POINTER :: keyword
664 :
665 8546 : NULLIFY (keyword)
666 8546 : CPASSERT(.NOT. ASSOCIATED(section))
667 :
668 : CALL section_create(section, __LOCATION__, name="S2_RESTRAINT", &
669 : description="Use S2 in a re/constraint (OT only)", &
670 8546 : n_keywords=7, n_subsections=0, repeats=.FALSE.)
671 :
672 : CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
673 : description="force constant of the restraint", &
674 8546 : usage="STRENGTH {real} ", default_r_val=0.1_dp)
675 8546 : CALL section_add_keyword(section, keyword)
676 8546 : CALL keyword_release(keyword)
677 :
678 : CALL keyword_create(keyword, __LOCATION__, name="TARGET", &
679 : description="target value of the restraint", &
680 8546 : usage="TARGET {real} ", default_r_val=1._dp)
681 8546 : CALL section_add_keyword(section, keyword)
682 8546 : CALL keyword_release(keyword)
683 :
684 : CALL keyword_create(keyword, __LOCATION__, name="FUNCTIONAL_FORM", &
685 : description="Specifies the functional form of the term added", &
686 : usage="FUNCTIONAL_FORM RESTRAINT", &
687 : enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
688 : enum_i_vals=(/do_s2_restraint, do_s2_constraint/), &
689 : enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
690 8546 : default_i_val=do_s2_restraint)
691 8546 : CALL section_add_keyword(section, keyword)
692 8546 : CALL keyword_release(keyword)
693 :
694 8546 : END SUBROUTINE create_s2_restraint_section
695 :
696 : ! **************************************************************************************************
697 : !> \brief input section for optional parameters for LRIGPW
698 : !> LRI: local resolution of identity
699 : !> \param section the section to create
700 : !> \author Dorothea Golze [02.2015]
701 : ! **************************************************************************************************
702 25622 : SUBROUTINE create_lrigpw_section(section)
703 : TYPE(section_type), POINTER :: section
704 :
705 : TYPE(keyword_type), POINTER :: keyword
706 :
707 25622 : CPASSERT(.NOT. ASSOCIATED(section))
708 : CALL section_create(section, __LOCATION__, name="LRIGPW", &
709 : description="This section specifies optional parameters for LRIGPW.", &
710 51244 : n_keywords=3, n_subsections=0, repeats=.FALSE., citations=(/Golze2017b/))
711 :
712 25622 : NULLIFY (keyword)
713 :
714 : CALL keyword_create(keyword, __LOCATION__, name="LRI_OVERLAP_MATRIX", &
715 : description="Specifies whether to calculate the inverse or the "// &
716 : "pseudoinverse of the overlap matrix of the auxiliary "// &
717 : "basis set. Calculating the pseudoinverse is necessary "// &
718 : "for very large auxiliary basis sets, but more expensive. "// &
719 : "Using the pseudoinverse, consistent forces are not "// &
720 : "guaranteed yet.", &
721 : usage="LRI_OVERLAP_MATRIX INVERSE", &
722 : enum_c_vals=s2a("INVERSE", "PSEUDO_INVERSE_SVD", "PSEUDO_INVERSE_DIAG", &
723 : "AUTOSELECT"), &
724 : enum_desc=s2a("Calculate inverse of the overlap matrix.", &
725 : "Calculate the pseuodinverse of the overlap matrix "// &
726 : "using singular value decomposition.", &
727 : "Calculate the pseudoinverse of the overlap matrix "// &
728 : "by prior diagonalization.", &
729 : "Choose automatically for each pair whether to "// &
730 : "calculate the inverse or pseudoinverse based on the "// &
731 : "condition number of the overlap matrix for each pair. "// &
732 : "Calculating the pseudoinverse is much more expensive."), &
733 : enum_i_vals=(/do_lri_inv, do_lri_pseudoinv_svd, &
734 : do_lri_pseudoinv_diag, do_lri_inv_auto/), &
735 25622 : default_i_val=do_lri_inv)
736 25622 : CALL section_add_keyword(section, keyword)
737 25622 : CALL keyword_release(keyword)
738 :
739 : CALL keyword_create(keyword, __LOCATION__, name="MAX_CONDITION_NUM", &
740 : description="If AUTOSELECT is chosen for LRI_OVERLAP_MATRIX, this "// &
741 : "keyword specifies that the pseudoinverse is calculated "// &
742 : "only if the LOG of the condition number of the lri "// &
743 : "overlap matrix is larger than the given value.", &
744 25622 : usage="MAX_CONDITION_NUM 20.0", default_r_val=20.0_dp)
745 25622 : CALL section_add_keyword(section, keyword)
746 25622 : CALL keyword_release(keyword)
747 :
748 : CALL keyword_create(keyword, __LOCATION__, name="EPS_O3_INT", &
749 : description="Threshold for ABA and ABB integrals in LRI. "// &
750 : "This is used for screening in the KS and "// &
751 : "force calculations (tensor contractions).", &
752 25622 : usage="EPS_O3_INT 1.e-10", default_r_val=1.0e-14_dp)
753 25622 : CALL section_add_keyword(section, keyword)
754 25622 : CALL keyword_release(keyword)
755 :
756 : CALL keyword_create(keyword, __LOCATION__, name="DEBUG_LRI_INTEGRALS", &
757 : description="Debug the integrals needed for LRIGPW.", &
758 : usage="DEBUG_LRI_INTEGRALS TRUE", &
759 25622 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
760 25622 : CALL section_add_keyword(section, keyword)
761 25622 : CALL keyword_release(keyword)
762 :
763 : CALL keyword_create(keyword, __LOCATION__, name="EXACT_1C_TERMS", &
764 : description="Don't use LRI for one center densities.", &
765 : usage="EXACT_1C_TERMS TRUE", &
766 25622 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
767 25622 : CALL section_add_keyword(section, keyword)
768 25622 : CALL keyword_release(keyword)
769 :
770 : CALL keyword_create(keyword, __LOCATION__, name="PPL_RI", &
771 : description="Use LRI/RI for local pseudopotential.", &
772 : usage="PPL_RI TRUE", &
773 25622 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
774 25622 : CALL section_add_keyword(section, keyword)
775 25622 : CALL keyword_release(keyword)
776 :
777 : CALL keyword_create(keyword, __LOCATION__, name="RI_STATISTIC", &
778 : description="Print statistical information on the RI calculation.", &
779 : usage="RI_STATISTIC TRUE", &
780 25622 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
781 25622 : CALL section_add_keyword(section, keyword)
782 25622 : CALL keyword_release(keyword)
783 :
784 : CALL keyword_create(keyword, __LOCATION__, name="DISTANT_PAIR_APPROXIMATION", &
785 : description="Calculate distant pairs using an independent atom approximation.", &
786 : usage="DISTANT_PAIR_APPROXIMATION TRUE", &
787 25622 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
788 25622 : CALL section_add_keyword(section, keyword)
789 25622 : CALL keyword_release(keyword)
790 :
791 : CALL keyword_create(keyword, __LOCATION__, name="DISTANT_PAIR_METHOD", &
792 : description="Method used to separate pair density for distant pairs. "// &
793 : "Options: EW (equal weights); AW (atomic weights); SW (set weights); "// &
794 : "LW (shell function weights)", &
795 : usage="DISTANT_PAIR_METHOD {method}", &
796 25622 : default_c_val="LW")
797 25622 : CALL section_add_keyword(section, keyword)
798 25622 : CALL keyword_release(keyword)
799 :
800 : CALL keyword_create(keyword, __LOCATION__, name="DISTANT_PAIR_RADII", &
801 : description="Inner and outer radii used in distant "// &
802 : "pair separation. Smooth interpolation between inner and outer "// &
803 : "radius is used.", &
804 : usage="DISTANT_PAIR_RADII r_inner {real} r_outer {real} ", &
805 : n_var=2, default_r_vals=(/8._dp, 12._dp/), unit_str='bohr', &
806 25622 : type_of_var=real_t)
807 25622 : CALL section_add_keyword(section, keyword)
808 25622 : CALL keyword_release(keyword)
809 :
810 : CALL keyword_create(keyword, __LOCATION__, name="SHG_LRI_INTEGRALS", &
811 : description="Uses the SHG (solid harmonic Gaussian) integral "// &
812 : "scheme instead of Obara-Saika", &
813 : usage="SHG_LRI_INTEGRALS TRUE", &
814 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE., &
815 51244 : citations=(/Golze2017a/))
816 25622 : CALL section_add_keyword(section, keyword)
817 25622 : CALL keyword_release(keyword)
818 :
819 : CALL keyword_create(keyword, __LOCATION__, name="RI_SINV", &
820 : description="Approximation to be used for the inverse of the "// &
821 : "RI overlap matrix. INVF, INVS: exact inverse, apply directly "// &
822 : "for solver (F:full matrix, S:sparsematrix). AINV approximate inverse, use with PCG. "// &
823 : "NONE: no approximation used with CG solver.", &
824 25622 : usage="RI_SINV NONE", default_c_val="INVF")
825 25622 : CALL section_add_keyword(section, keyword)
826 25622 : CALL keyword_release(keyword)
827 :
828 25622 : END SUBROUTINE create_lrigpw_section
829 :
830 : END MODULE input_cp2k_qs
|