(git:1155b05)
Loading...
Searching...
No Matches
input_cp2k_qs.F
Go to the documentation of this file.
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! **************************************************************************************************
16 USE bibliography, ONLY: &
24 USE input_constants, ONLY: &
53 USE input_val_types, ONLY: integer_t,&
54 lchar_t,&
55 real_t
56 USE kinds, ONLY: dp
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
69
70CONTAINS
71
72! **************************************************************************************************
73!> \brief creates the input section for the qs part
74!> \param section the section to create
75!> \author teo
76! **************************************************************************************************
77 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 cpassert(.NOT. ASSOCIATED(section))
84 CALL section_create(section, __location__, name="qs", &
85 description="parameters needed to set up the Quickstep framework", &
86 n_keywords=1, n_subsections=0, repeats=.false.)
87
88 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 usage="EPS_DEFAULT real", default_r_val=1.0e-10_dp)
94 CALL section_add_keyword(section, keyword)
95 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 usage="EPS_CORE_CHARGE real", type_of_var=real_t)
100 CALL section_add_keyword(section, keyword)
101 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 usage="EPS_GVG_RSPACE real", type_of_var=real_t)
108 CALL section_add_keyword(section, keyword)
109 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 usage="EPS_PGF_ORB real", type_of_var=real_t)
114 CALL section_add_keyword(section, keyword)
115 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 type_of_var=real_t)
122 CALL section_add_keyword(section, keyword)
123 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 usage="EPS_PPL real", type_of_var=real_t, default_r_val=1.0e-2_dp)
128 CALL section_add_keyword(section, keyword)
129 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 usage="EPS_PPNL real", type_of_var=real_t)
135 CALL section_add_keyword(section, keyword)
136 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 usage="EPS_CPC real", type_of_var=real_t)
141 CALL section_add_keyword(section, keyword)
142 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 usage="EPS_RHO real", type_of_var=real_t)
147 CALL section_add_keyword(section, keyword)
148 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 usage="EPS_RHO_RSPACE real", type_of_var=real_t)
154 CALL section_add_keyword(section, keyword)
155 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 usage="EPS_RHO_GSPACE real", type_of_var=real_t)
161 CALL section_add_keyword(section, keyword)
162 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 usage="EPS_FILTER_MATRIX 1.0E-6", type_of_var=real_t, default_r_val=0.0e0_dp)
167 CALL section_add_keyword(section, keyword)
168 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 usage="EPSFIT real", default_r_val=1.0e-4_dp)
174 CALL section_add_keyword(section, keyword)
175 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 usage="EPSISO real", default_r_val=1.0e-12_dp)
181 CALL section_add_keyword(section, keyword)
182 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 usage="EPS_SVD real", default_r_val=1.0e-8_dp)
188 CALL section_add_keyword(section, keyword)
189 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 usage="EPSRHO0 real", default_r_val=1.0e-6_dp)
195 CALL section_add_keyword(section, keyword)
196 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 usage="ALPHA0_HARD real", default_r_val=0.0_dp)
202 CALL section_add_keyword(section, keyword)
203 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 default_l_val=.false., lone_keyword_l_val=.true.)
214 CALL section_add_keyword(section, keyword)
215 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 usage="MAX_RAD_LOCAL real", default_r_val=25.0_dp)
221 CALL section_add_keyword(section, keyword)
222 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."), &
236 default_i_val=gapw_1c_orb)
237 CALL section_add_keyword(section, keyword)
238 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 default_l_val=.false., lone_keyword_l_val=.true.)
245 CALL section_add_keyword(section, keyword)
246 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 usage="ALPHA_WEIGHTS 10.0", default_r_val=6.0_dp)
252 CALL section_add_keyword(section, keyword)
253 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 usage="MIN_PAIR_LIST_RADIUS real", default_r_val=0.0_dp)
260 CALL section_add_keyword(section, keyword)
261 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 default_l_val=.false.)
268 CALL section_add_keyword(section, keyword)
269 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 default_l_val=.false.)
275 CALL section_add_keyword(section, keyword)
276 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 default_l_val=.false.)
282 CALL section_add_keyword(section, keyword)
283 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 default_l_val=.false., citations=[iannuzzi2006, brelaz1979, andermatt2016])
289 CALL section_add_keyword(section, keyword)
290 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 default_l_val=.false., lone_keyword_l_val=.true.)
296 CALL section_add_keyword(section, keyword)
297 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 default_l_val=.false., lone_keyword_l_val=.true.)
303 CALL section_add_keyword(section, keyword)
304 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 default_l_val=.false., lone_keyword_l_val=.true.)
310 CALL section_add_keyword(section, keyword)
311 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 default_l_val=.false., lone_keyword_l_val=.true.)
317 CALL section_add_keyword(section, keyword)
318 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 default_l_val=.false., lone_keyword_l_val=.true.)
324 CALL section_add_keyword(section, keyword)
325 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 usage="STO_NG", default_i_val=6)
331 CALL section_add_keyword(section, keyword)
332 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 default_i_val=-1)
339 CALL section_add_keyword(section, keyword)
340 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 default_i_val=2)
347 CALL section_add_keyword(section, keyword)
348 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 default_i_val=99)
355 CALL section_add_keyword(section, keyword)
356 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 default_i_val=do_gapw_log)
368 CALL section_add_keyword(section, keyword)
369 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"), &
377 default_i_val=do_pwgrid_ns_fullspace)
378 CALL section_add_keyword(section, keyword)
379 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 &le; 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 default_i_vals=[-1, -1])
389 CALL section_add_keyword(section, keyword)
390 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"), &
398 default_i_val=do_pw_grid_blocked_free)
399 CALL section_add_keyword(section, keyword)
400 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", &
420 "Higher order extrapolation of the density matrix times the overlap matrix", &
421 "Frozen ... (not available for k-points)", &
422 "Always stable predictor corrector, similar to PS, but going for MD stability instead of initial guess accuracy."), &
423 enum_i_vals=[ &
433 wfi_aspc_nr], &
434 default_i_val=wfi_aspc_nr)
435 CALL section_add_keyword(section, keyword)
436 CALL keyword_release(keyword)
437
438 CALL keyword_create(keyword, __location__, name="EXTRAPOLATION_ORDER", &
439 description="Order for the PS or ASPC extrapolation (typically 2-4). "// &
440 "Higher order might bring more accuracy, but comes, "// &
441 "for large systems, also at some cost. "// &
442 "In some cases, a high order extrapolation is not stable,"// &
443 " and the order needs to be reduced.", &
444 usage="EXTRAPOLATION_ORDER {integer}", default_i_val=3)
445 CALL section_add_keyword(section, keyword)
446 CALL keyword_release(keyword)
447
448 CALL keyword_create(keyword, __location__, name="METHOD", &
449 description="Specifies the electronic structure method that should be employed", &
450 usage="METHOD GAPW", &
451 enum_c_vals=s2a("GAPW", "GAPW_XC", "GPW", "LRIGPW", "RIGPW", &
452 "MNDO", "MNDOD", "AM1", "PM3", "PM6", "PM6-FM", "PDG", "RM1", "PNNL", "DFTB", "xTB", "OFGPW"), &
453 enum_desc=s2a("Gaussian and augmented plane waves method", &
454 "Gaussian and augmented plane waves method only for XC", &
455 "Gaussian and plane waves method", &
456 "Local resolution of identity method", &
457 "Resolution of identity method for HXC terms", &
458 "MNDO semiempirical", "MNDO-d semiempirical", "AM1 semiempirical", &
459 "PM3 semiempirical", "PM6 semiempirical", "PM6-FM semiempirical", "PDG semiempirical", &
460 "RM1 semiempirical", &
461 "PNNL semiempirical", &
462 "DFTB Density Functional based Tight-Binding", &
463 "GFN-xTB Extended Tight-Binding", &
464 "OFGPW Orbital-free GPW method"), &
472 default_i_val=do_method_gpw)
473 CALL section_add_keyword(section, keyword)
474 CALL keyword_release(keyword)
475
476 CALL keyword_create(keyword, __location__, name="CORE_PPL", &
477 description="Specifies the method used to calculate the local pseudopotential contribution.", &
478 usage="CORE_PPL ANALYTIC", &
479 enum_c_vals=s2a("ANALYTIC", "GRID"), &
480 enum_desc=s2a("Analytic integration of integrals", &
481 "Numerical integration on real space grid. Lumped together with core charge"), &
482 enum_i_vals=[do_ppl_analytic, do_ppl_grid], &
483 default_i_val=do_ppl_analytic)
484 CALL section_add_keyword(section, keyword)
485 CALL keyword_release(keyword)
486
487 CALL keyword_create(keyword, __location__, name="EMBED_RESTART_FILE_NAME", &
488 description="Root of the file name where to read the embedding "// &
489 "potential guess.", &
490 usage="EMBED_RESTART_FILE_NAME <FILENAME>", &
491 type_of_var=lchar_t)
492 CALL section_add_keyword(section, keyword)
493 CALL keyword_release(keyword)
494
495 CALL keyword_create(keyword, __location__, name="EMBED_CUBE_FILE_NAME", &
496 description="Root of the file name where to read the embedding "// &
497 "potential (guess) as a cube.", &
498 usage="EMBED_CUBE_FILE_NAME <FILENAME>", &
499 type_of_var=lchar_t)
500 CALL section_add_keyword(section, keyword)
501 CALL keyword_release(keyword)
502
503 CALL keyword_create(keyword, __location__, name="EMBED_SPIN_CUBE_FILE_NAME", &
504 description="Root of the file name where to read the spin part "// &
505 "of the embedding potential (guess) as a cube.", &
506 usage="EMBED_SPIN_CUBE_FILE_NAME <FILENAME>", &
507 type_of_var=lchar_t)
508 CALL section_add_keyword(section, keyword)
509 CALL keyword_release(keyword)
510
511 CALL create_distribution_section(subsection)
512 CALL section_add_subsection(section, subsection)
513 CALL section_release(subsection)
514
515 CALL create_dftb_control_section(subsection)
516 CALL section_add_subsection(section, subsection)
517 CALL section_release(subsection)
518
519 CALL create_xtb_control_section(subsection)
520 CALL section_add_subsection(section, subsection)
521 CALL section_release(subsection)
522
523 CALL create_se_control_section(subsection)
524 CALL section_add_subsection(section, subsection)
525 CALL section_release(subsection)
526
527 CALL create_mulliken_section(subsection)
528 CALL section_add_subsection(section, subsection)
529 CALL section_release(subsection)
530
531 CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT")
532 CALL section_add_subsection(section, subsection)
533 CALL section_release(subsection)
534
535 CALL create_cdft_control_section(subsection)
536 CALL section_add_subsection(section, subsection)
537 CALL section_release(subsection)
538
539 CALL create_s2_restraint_section(subsection)
540 CALL section_add_subsection(section, subsection)
541 CALL section_release(subsection)
542
543 CALL create_lrigpw_section(subsection)
544 CALL section_add_subsection(section, subsection)
545 CALL section_release(subsection)
546
547 CALL create_optimize_lri_basis_section(subsection)
548 CALL section_add_subsection(section, subsection)
549 CALL section_release(subsection)
550
551 ! Embedding subsections: DFET and DMFET
552 CALL create_optimize_embed(subsection)
553 CALL section_add_subsection(section, subsection)
554 CALL section_release(subsection)
555
556 CALL create_optimize_dmfet(subsection)
557 CALL section_add_subsection(section, subsection)
558 CALL section_release(subsection)
559
560 END SUBROUTINE create_qs_section
561
562! **************************************************************************************************
563!> \brief ...
564!> \param section ...
565! **************************************************************************************************
566 SUBROUTINE create_mulliken_section(section)
567 TYPE(section_type), POINTER :: section
568
569 TYPE(keyword_type), POINTER :: keyword
570
571 NULLIFY (keyword)
572 cpassert(.NOT. ASSOCIATED(section))
573 CALL section_create(section, __location__, name="MULLIKEN_RESTRAINT", &
574 description="Use mulliken charges in a restraint (check code for details)", &
575 n_keywords=7, n_subsections=0, repeats=.false.)
576
577 CALL keyword_create(keyword, __location__, name="STRENGTH", &
578 description="force constant of the restraint", &
579 usage="STRENGTH {real} ", default_r_val=0.1_dp)
580 CALL section_add_keyword(section, keyword)
581 CALL keyword_release(keyword)
582
583 CALL keyword_create(keyword, __location__, name="TARGET", &
584 description="target value of the restraint", &
585 usage="TARGET {real} ", default_r_val=1._dp)
586 CALL section_add_keyword(section, keyword)
587 CALL keyword_release(keyword)
588
589 CALL keyword_create(keyword, __location__, name="ATOMS", &
590 description="Specifies the list of atoms that is summed in the restraint", &
591 usage="ATOMS {integer} {integer} .. {integer}", &
592 n_var=-1, type_of_var=integer_t)
593 CALL section_add_keyword(section, keyword)
594 CALL keyword_release(keyword)
595
596 END SUBROUTINE create_mulliken_section
597
598! **************************************************************************************************
599!> \brief ...
600!> \param section ...
601!> \param section_name ...
602! **************************************************************************************************
603 SUBROUTINE create_ddapc_restraint_section(section, section_name)
604 TYPE(section_type), POINTER :: section
605 CHARACTER(len=*), INTENT(in) :: section_name
606
607 TYPE(keyword_type), POINTER :: keyword
608 TYPE(section_type), POINTER :: print_key
609
610 NULLIFY (keyword, print_key)
611 cpassert(.NOT. ASSOCIATED(section))
612 CALL section_create(section, __location__, name=trim(adjustl(section_name)), &
613 description="Use DDAPC charges in a restraint (check code for details)", &
614 n_keywords=7, n_subsections=0, repeats=.true.)
615
616 CALL keyword_create(keyword, __location__, name="TYPE_OF_DENSITY", &
617 description="Specifies the type of density used for the fitting", &
618 usage="TYPE_OF_DENSITY (FULL|SPIN)", &
619 enum_c_vals=s2a("FULL", "SPIN"), &
620 enum_i_vals=[do_full_density, do_spin_density], &
621 enum_desc=s2a("Full density", "Spin density"), &
622 default_i_val=do_full_density)
623 CALL section_add_keyword(section, keyword)
624 CALL keyword_release(keyword)
625
626 CALL keyword_create(keyword, __location__, name="STRENGTH", &
627 description="force constant of the restraint", &
628 usage="STRENGTH {real} ", default_r_val=0.1_dp)
629 CALL section_add_keyword(section, keyword)
630 CALL keyword_release(keyword)
631
632 CALL keyword_create(keyword, __location__, name="TARGET", &
633 description="target value of the restraint", &
634 usage="TARGET {real} ", default_r_val=1._dp)
635 CALL section_add_keyword(section, keyword)
636 CALL keyword_release(keyword)
637
638 CALL keyword_create(keyword, __location__, name="ATOMS", &
639 description="Specifies the list of atoms that is summed in the restraint", &
640 usage="ATOMS {integer} {integer} .. {integer}", &
641 n_var=-1, type_of_var=integer_t)
642 CALL section_add_keyword(section, keyword)
643 CALL keyword_release(keyword)
644
645 CALL keyword_create(keyword, __location__, name="COEFF", &
646 description="Defines the the coefficient of the atom in the atom list (default is one) ", &
647 usage="COEFF 1.0 -1.0", &
648 type_of_var=real_t, n_var=-1)
649 CALL section_add_keyword(section, keyword)
650 CALL keyword_release(keyword)
651
652 CALL keyword_create(keyword, __location__, name="FUNCTIONAL_FORM", &
653 description="Specifies the functional form of the term added", &
654 usage="FUNCTIONAL_FORM RESTRAINT", &
655 enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
657 enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
658 default_i_val=do_ddapc_restraint)
659 CALL section_add_keyword(section, keyword)
660 CALL keyword_release(keyword)
661
662 CALL cp_print_key_section_create(print_key, __location__, "program_run_info", &
663 description="Controls the printing basic info about the method", &
664 print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
665 CALL section_add_subsection(section, print_key)
666 CALL section_release(print_key)
667
668 END SUBROUTINE create_ddapc_restraint_section
669
670! **************************************************************************************************
671!> \brief ...
672!> \param section ...
673! **************************************************************************************************
674 SUBROUTINE create_s2_restraint_section(section)
675 TYPE(section_type), POINTER :: section
676
677 TYPE(keyword_type), POINTER :: keyword
678
679 NULLIFY (keyword)
680 cpassert(.NOT. ASSOCIATED(section))
681
682 CALL section_create(section, __location__, name="S2_RESTRAINT", &
683 description="Use S2 in a re/constraint (OT only)", &
684 n_keywords=7, n_subsections=0, repeats=.false.)
685
686 CALL keyword_create(keyword, __location__, name="STRENGTH", &
687 description="force constant of the restraint", &
688 usage="STRENGTH {real} ", default_r_val=0.1_dp)
689 CALL section_add_keyword(section, keyword)
690 CALL keyword_release(keyword)
691
692 CALL keyword_create(keyword, __location__, name="TARGET", &
693 description="target value of the restraint", &
694 usage="TARGET {real} ", default_r_val=1._dp)
695 CALL section_add_keyword(section, keyword)
696 CALL keyword_release(keyword)
697
698 CALL keyword_create(keyword, __location__, name="FUNCTIONAL_FORM", &
699 description="Specifies the functional form of the term added", &
700 usage="FUNCTIONAL_FORM RESTRAINT", &
701 enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
702 enum_i_vals=[do_s2_restraint, do_s2_constraint], &
703 enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
704 default_i_val=do_s2_restraint)
705 CALL section_add_keyword(section, keyword)
706 CALL keyword_release(keyword)
707
708 END SUBROUTINE create_s2_restraint_section
709
710! **************************************************************************************************
711!> \brief input section for optional parameters for LRIGPW
712!> LRI: local resolution of identity
713!> \param section the section to create
714!> \author Dorothea Golze [02.2015]
715! **************************************************************************************************
716 SUBROUTINE create_lrigpw_section(section)
717 TYPE(section_type), POINTER :: section
718
719 TYPE(keyword_type), POINTER :: keyword
720
721 cpassert(.NOT. ASSOCIATED(section))
722 CALL section_create(section, __location__, name="LRIGPW", &
723 description="This section specifies optional parameters for LRIGPW.", &
724 n_keywords=3, n_subsections=0, repeats=.false., citations=[golze2017b])
725
726 NULLIFY (keyword)
727
728 CALL keyword_create(keyword, __location__, name="LRI_OVERLAP_MATRIX", &
729 description="Specifies whether to calculate the inverse or the "// &
730 "pseudoinverse of the overlap matrix of the auxiliary "// &
731 "basis set. Calculating the pseudoinverse is necessary "// &
732 "for very large auxiliary basis sets, but more expensive. "// &
733 "Using the pseudoinverse, consistent forces are not "// &
734 "guaranteed yet.", &
735 usage="LRI_OVERLAP_MATRIX INVERSE", &
736 enum_c_vals=s2a("INVERSE", "PSEUDO_INVERSE_SVD", "PSEUDO_INVERSE_DIAG", &
737 "AUTOSELECT"), &
738 enum_desc=s2a("Calculate inverse of the overlap matrix.", &
739 "Calculate the pseuodinverse of the overlap matrix "// &
740 "using singular value decomposition.", &
741 "Calculate the pseudoinverse of the overlap matrix "// &
742 "by prior diagonalization.", &
743 "Choose automatically for each pair whether to "// &
744 "calculate the inverse or pseudoinverse based on the "// &
745 "condition number of the overlap matrix for each pair. "// &
746 "Calculating the pseudoinverse is much more expensive."), &
747 enum_i_vals=[do_lri_inv, do_lri_pseudoinv_svd, &
749 default_i_val=do_lri_inv)
750 CALL section_add_keyword(section, keyword)
751 CALL keyword_release(keyword)
752
753 CALL keyword_create(keyword, __location__, name="MAX_CONDITION_NUM", &
754 description="If AUTOSELECT is chosen for LRI_OVERLAP_MATRIX, this "// &
755 "keyword specifies that the pseudoinverse is calculated "// &
756 "only if the LOG of the condition number of the lri "// &
757 "overlap matrix is larger than the given value.", &
758 usage="MAX_CONDITION_NUM 20.0", default_r_val=20.0_dp)
759 CALL section_add_keyword(section, keyword)
760 CALL keyword_release(keyword)
761
762 CALL keyword_create(keyword, __location__, name="EPS_O3_INT", &
763 description="Threshold for ABA and ABB integrals in LRI. "// &
764 "This is used for screening in the KS and "// &
765 "force calculations (tensor contractions).", &
766 usage="EPS_O3_INT 1.e-10", default_r_val=1.0e-14_dp)
767 CALL section_add_keyword(section, keyword)
768 CALL keyword_release(keyword)
769
770 CALL keyword_create(keyword, __location__, name="DEBUG_LRI_INTEGRALS", &
771 description="Debug the integrals needed for LRIGPW.", &
772 usage="DEBUG_LRI_INTEGRALS TRUE", &
773 default_l_val=.false., lone_keyword_l_val=.true.)
774 CALL section_add_keyword(section, keyword)
775 CALL keyword_release(keyword)
776
777 CALL keyword_create(keyword, __location__, name="EXACT_1C_TERMS", &
778 description="Don't use LRI for one center densities.", &
779 usage="EXACT_1C_TERMS TRUE", &
780 default_l_val=.false., lone_keyword_l_val=.true.)
781 CALL section_add_keyword(section, keyword)
782 CALL keyword_release(keyword)
783
784 CALL keyword_create(keyword, __location__, name="PPL_RI", &
785 description="Use LRI/RI for local pseudopotential.", &
786 usage="PPL_RI TRUE", &
787 default_l_val=.false., lone_keyword_l_val=.true.)
788 CALL section_add_keyword(section, keyword)
789 CALL keyword_release(keyword)
790
791 CALL keyword_create(keyword, __location__, name="RI_STATISTIC", &
792 description="Print statistical information on the RI calculation.", &
793 usage="RI_STATISTIC TRUE", &
794 default_l_val=.false., lone_keyword_l_val=.true.)
795 CALL section_add_keyword(section, keyword)
796 CALL keyword_release(keyword)
797
798 CALL keyword_create(keyword, __location__, name="DISTANT_PAIR_APPROXIMATION", &
799 description="Calculate distant pairs using an independent atom approximation.", &
800 usage="DISTANT_PAIR_APPROXIMATION TRUE", &
801 default_l_val=.false., lone_keyword_l_val=.true.)
802 CALL section_add_keyword(section, keyword)
803 CALL keyword_release(keyword)
804
805 CALL keyword_create(keyword, __location__, name="DISTANT_PAIR_METHOD", &
806 description="Method used to separate pair density for distant pairs. "// &
807 "Options: EW (equal weights); AW (atomic weights); SW (set weights); "// &
808 "LW (shell function weights)", &
809 usage="DISTANT_PAIR_METHOD {method}", &
810 default_c_val="LW")
811 CALL section_add_keyword(section, keyword)
812 CALL keyword_release(keyword)
813
814 CALL keyword_create(keyword, __location__, name="DISTANT_PAIR_RADII", &
815 description="Inner and outer radii used in distant "// &
816 "pair separation. Smooth interpolation between inner and outer "// &
817 "radius is used.", &
818 usage="DISTANT_PAIR_RADII r_inner {real} r_outer {real} ", &
819 n_var=2, default_r_vals=[8._dp, 12._dp], unit_str='bohr', &
820 type_of_var=real_t)
821 CALL section_add_keyword(section, keyword)
822 CALL keyword_release(keyword)
823
824 CALL keyword_create(keyword, __location__, name="SHG_LRI_INTEGRALS", &
825 description="Uses the SHG (solid harmonic Gaussian) integral "// &
826 "scheme instead of Obara-Saika", &
827 usage="SHG_LRI_INTEGRALS TRUE", &
828 default_l_val=.true., lone_keyword_l_val=.true., &
829 citations=[golze2017a])
830 CALL section_add_keyword(section, keyword)
831 CALL keyword_release(keyword)
832
833 CALL keyword_create(keyword, __location__, name="RI_SINV", &
834 description="Approximation to be used for the inverse of the "// &
835 "RI overlap matrix. INVF, INVS: exact inverse, apply directly "// &
836 "for solver (F:full matrix, S:sparsematrix). AINV approximate inverse, use with PCG. "// &
837 "NONE: no approximation used with CG solver.", &
838 usage="RI_SINV NONE", default_c_val="INVF")
839 CALL section_add_keyword(section, keyword)
840 CALL keyword_release(keyword)
841
842 END SUBROUTINE create_lrigpw_section
843
844END MODULE input_cp2k_qs
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public stewart2007
integer, save, public vandevondele2006
integer, save, public golze2017b
integer, save, public vandevondele2005a
integer, save, public kuhne2007
integer, save, public golze2017a
integer, save, public lippert1999
integer, save, public dewar1977
integer, save, public vanvoorhis2015
integer, save, public repasky2002
integer, save, public iannuzzi2006
integer, save, public rocha2006
integer, save, public lippert1997
integer, save, public andermatt2016
integer, save, public thiel1992
integer, save, public schenter2008
integer, save, public brelaz1979
integer, save, public krack2000
integer, save, public dewar1985
integer, save, public stewart1989
integer, save, public kolafa2004
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public low_print_level
integer, parameter, public add_last_numeric
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str)
creates a print_key section
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_method_ofgpw
integer, parameter, public do_gapw_gct
integer, parameter, public do_gapw_gcs
integer, parameter, public do_s2_restraint
integer, parameter, public do_method_rigpw
integer, parameter, public do_s2_constraint
integer, parameter, public wfi_frozen_method_nr
integer, parameter, public do_method_gpw
integer, parameter, public gapw_1c_large
integer, parameter, public do_method_pdg
integer, parameter, public wfi_linear_wf_method_nr
integer, parameter, public wfi_linear_p_method_nr
integer, parameter, public wfi_linear_ps_method_nr
integer, parameter, public do_method_pnnl
integer, parameter, public do_ddapc_constraint
integer, parameter, public wfi_use_prev_rho_r_method_nr
integer, parameter, public do_lri_inv_auto
integer, parameter, public gapw_1c_medium
integer, parameter, public wfi_use_guess_method_nr
integer, parameter, public do_ppl_grid
integer, parameter, public do_method_rm1
integer, parameter, public gapw_1c_small
integer, parameter, public do_method_pm3
integer, parameter, public do_method_mndo
integer, parameter, public gapw_1c_orb
integer, parameter, public do_pwgrid_ns_fullspace
integer, parameter, public gapw_1c_very_large
integer, parameter, public do_method_gapw
integer, parameter, public do_lri_pseudoinv_svd
integer, parameter, public do_method_mndod
integer, parameter, public do_gapw_log
integer, parameter, public do_method_am1
integer, parameter, public do_method_dftb
integer, parameter, public wfi_use_prev_wf_method_nr
integer, parameter, public do_spin_density
integer, parameter, public gaussian
integer, parameter, public wfi_ps_method_nr
integer, parameter, public do_pwgrid_spherical
integer, parameter, public do_method_lrigpw
integer, parameter, public do_ppl_analytic
integer, parameter, public wfi_aspc_nr
integer, parameter, public do_lri_inv
integer, parameter, public do_method_xtb
integer, parameter, public do_ddapc_restraint
integer, parameter, public do_pwgrid_ns_halfspace
integer, parameter, public do_method_pm6fm
integer, parameter, public do_full_density
integer, parameter, public do_method_gapw_xc
integer, parameter, public numerical
integer, parameter, public do_method_pm6
integer, parameter, public wfi_use_prev_p_method_nr
integer, parameter, public do_lri_pseudoinv_diag
integer, parameter, public slater
function that builds the distribution section of the input
subroutine, public create_distribution_section(section)
Creates the distribution section.
function that build the dft section of the input
subroutine, public create_optimize_lri_basis_section(section)
input section for optimization of the auxililary basis for LRIGPW
subroutine, public create_optimize_dmfet(section)
Input for density matrix functional embedding, DMFET.
subroutine, public create_optimize_embed(section)
Input for DFT embedding.
function that build the QS section of the input
subroutine, public create_qs_section(section)
creates the input section for the qs part
subroutine, public create_lrigpw_section(section)
input section for optional parameters for LRIGPW LRI: local resolution of identity
subroutine, public create_ddapc_restraint_section(section, section_name)
...
function that build the scf section of the input
subroutine, public create_cdft_control_section(section)
Creates the input section for defining CDFT constraints.
function that build the semi empirical section of the input
subroutine, public create_se_control_section(section)
...
function that build the dft section of the input
subroutine, public create_dftb_control_section(section)
...
subroutine, public create_xtb_control_section(section)
...
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations, deprecation_notice)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
subroutine, public section_add_subsection(section, subsection)
adds a subsection to the given section
recursive subroutine, public section_release(section)
releases the given keyword list (see doc/ReferenceCounting.html)
a wrapper for basic fortran types.
integer, parameter, public real_t
integer, parameter, public lchar_t
integer, parameter, public integer_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
This module defines the grid data type and some basic operations on it.
Definition pw_grids.F:36
integer, parameter, public do_pw_grid_blocked_false
Definition pw_grids.F:77
integer, parameter, public do_pw_grid_blocked_true
Definition pw_grids.F:77
integer, parameter, public do_pw_grid_blocked_free
Definition pw_grids.F:77
Utilities for string manipulations.
represent a keyword in the input
represent a section of the input file