(git:b77b4be)
Loading...
Searching...
No Matches
input_cp2k_ec.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 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 dft section of the input
10!> \par History
11!> 10.2005 moved out of input_cp2k [fawzi]
12!> \author fawzi
13! **************************************************************************************************
15 USE bibliography, ONLY: niklasson2003,&
21 USE input_constants, ONLY: &
42 USE input_val_types, ONLY: char_t,&
44 USE kinds, ONLY: dp
45 USE string_utilities, ONLY: s2a
46#include "./base/base_uses.f90"
47
48 IMPLICIT NONE
49 PRIVATE
50
51 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_ec'
52
53 PUBLIC :: create_ec_section
54
55CONTAINS
56
57! **************************************************************************************************
58!> \brief creates the ENERGY CORRECTION section
59!> \param section ...
60!> \author JGH
61! **************************************************************************************************
62 SUBROUTINE create_ec_section(section)
63 TYPE(section_type), POINTER :: section
64
65 TYPE(keyword_type), POINTER :: keyword
66 TYPE(section_type), POINTER :: subsection
67
68 cpassert(.NOT. ASSOCIATED(section))
69
70 NULLIFY (keyword)
71 CALL section_create(section, __location__, name="ENERGY_CORRECTION", &
72 description="Sets the various options for the Energy Correction", &
73 n_keywords=0, n_subsections=2, repeats=.false.)
74
75 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
76 description="Controls the activation of the energy_correction", &
77 usage="&ENERGY_CORRECTION T", &
78 default_l_val=.false., &
79 lone_keyword_l_val=.true.)
80 CALL section_add_keyword(section, keyword)
81 CALL keyword_release(keyword)
82
83 ! add a special XC section
84 NULLIFY (subsection)
85 CALL create_xc_section(subsection)
86 CALL section_add_subsection(section, subsection)
87 CALL section_release(subsection)
88
89 ! add a section for solver keywords
90 NULLIFY (subsection)
91 CALL create_ec_solver_section(subsection)
92 CALL section_add_subsection(section, subsection)
93 CALL section_release(subsection)
94
95 ! add a print section for properties
96 NULLIFY (subsection)
97 CALL create_ec_print_section(subsection)
98 CALL section_add_subsection(section, subsection)
99 CALL section_release(subsection)
100
101 CALL keyword_create(keyword, __location__, name="ENERGY_FUNCTIONAL", &
102 description="Functional used in energy correction", &
103 usage="ENERGY_FUNCTIONAL HARRIS", &
104 default_i_val=ec_functional_harris, &
105 enum_c_vals=s2a("HARRIS", "DCDFT", "EXTERNAL"), &
106 enum_desc=s2a("Harris functional", &
107 "Density-corrected DFT", &
108 "External calculated energy"), &
110 CALL section_add_keyword(section, keyword)
111 CALL keyword_release(keyword)
112
113 CALL keyword_create(keyword, __location__, name="HARRIS_BASIS", &
114 description="Specifies the type of basis to be used for the KG energy correction. "// &
115 "Options are: (1) the default orbital basis (ORBITAL); "// &
116 "(2) the primitive functions of the default orbital basis (PRIMITIVE); "// &
117 "(3) the basis set labeled in Kind section (HARRIS)", &
118 usage="HARRIS_BASIS ORBITAL", &
119 type_of_var=char_t, default_c_val="ORBITAL", n_var=-1)
120 CALL section_add_keyword(section, keyword)
121 CALL keyword_release(keyword)
122
123 CALL keyword_create(keyword, __location__, name="DEBUG_FORCES", &
124 description="Additional output to debug energy correction forces.", &
125 usage="DEBUG_FORCES T", default_l_val=.false., lone_keyword_l_val=.true.)
126 CALL section_add_keyword(section, keyword)
127 CALL keyword_release(keyword)
128 CALL keyword_create(keyword, __location__, name="DEBUG_STRESS", &
129 description="Additional output to debug energy correction forces.", &
130 usage="DEBUG_STRESS T", default_l_val=.false., lone_keyword_l_val=.true.)
131 CALL section_add_keyword(section, keyword)
132 CALL keyword_release(keyword)
133 CALL keyword_create(keyword, __location__, name="DEBUG_EXTERNAL_METHOD", &
134 description="Uses an internal pseudo-energy to test EXTERNAL energy method.", &
135 usage="DEBUG_EXTERNAL_METHOD T", default_l_val=.false., lone_keyword_l_val=.true.)
136 CALL section_add_keyword(section, keyword)
137 CALL keyword_release(keyword)
138
139 CALL keyword_create(keyword, __location__, name="SKIP_EC", &
140 description="Skip EC calculation if ground-state calculation has not converged.", &
141 usage="SKIP_EC T", default_l_val=.false., lone_keyword_l_val=.true.)
142 CALL section_add_keyword(section, keyword)
143 CALL keyword_release(keyword)
144
145 CALL keyword_create(keyword, __location__, name="MAO", &
146 description="Use modified atomic orbitals (MAO) to solve Harris equation", &
147 usage="MAO T", default_l_val=.false., lone_keyword_l_val=.true.)
148 CALL section_add_keyword(section, keyword)
149 CALL keyword_release(keyword)
150
151 CALL keyword_create(keyword, __location__, name="MAO_MAX_ITER", &
152 description="Maximum iterations in MAO optimization. ", &
153 usage="MAO_MAX_ITER 100 ", default_i_val=0)
154 CALL section_add_keyword(section, keyword)
155 CALL keyword_release(keyword)
156
157 CALL keyword_create(keyword, __location__, name="MAO_EPS_GRAD", &
158 description="Threshold used for MAO iterations. ", &
159 usage="MAO_EPS_GRAD 1.0E-4 ", default_r_val=1.0e-5_dp)
160 CALL section_add_keyword(section, keyword)
161 CALL keyword_release(keyword)
162
163 CALL keyword_create(keyword, __location__, name="MAO_EPS1", &
164 description="Occupation threshold used to determine number of MAOs."// &
165 " KIND section MAO keyword sets the minimum.", &
166 usage="MAO_EPS1 0.001 ", default_r_val=1000.0_dp)
167 CALL section_add_keyword(section, keyword)
168 CALL keyword_release(keyword)
169
170 CALL keyword_create(keyword, __location__, name="MAO_IOLEVEL", &
171 description="Verbosity of MAO output: (0) no output ... (3) fully verbose", &
172 usage="MAO_IOLEVEL 0 ", default_i_val=1)
173 CALL section_add_keyword(section, keyword)
174 CALL keyword_release(keyword)
175
176 CALL keyword_create(keyword, __location__, name="ALGORITHM", &
177 description="Algorithm used to solve KS equation", &
178 usage="ALGORITHM DIAGONALIZATION", &
179 default_i_val=ec_diagonalization, &
180 enum_c_vals=s2a("DIAGONALIZATION", "MATRIX_SIGN", &
181 "TRS4", "TC2", "OT_DIAG"), &
182 enum_desc=s2a("Diagonalization of KS matrix.", &
183 "Matrix Sign algorithm", &
184 "Trace resetting trs4 algorithm", &
185 "Trace resetting tc2 algorithm", &
186 "OT diagonalization"), &
187 enum_i_vals=(/ec_diagonalization, ec_matrix_sign, &
189 CALL section_add_keyword(section, keyword)
190 CALL keyword_release(keyword)
191
192 CALL keyword_create(keyword, __location__, name="FACTORIZATION", &
193 description="Algorithm used to calculate factorization of overlap matrix", &
194 usage="FACTORIZATION CHOLESKY", &
195 default_i_val=kg_cholesky, &
196 enum_c_vals=s2a("CHOLESKY"), &
197 enum_desc=s2a("Cholesky factorization of overlap matrix"), &
198 enum_i_vals=(/kg_cholesky/))
199 CALL section_add_keyword(section, keyword)
200 CALL keyword_release(keyword)
201
202 CALL keyword_create(keyword, __location__, name="EPS_DEFAULT", &
203 description="Threshold used for accuracy estimates within energy correction. ", &
204 usage="EPS_DEFAULT 1.0E-7 ", default_r_val=1.0e-7_dp)
205 CALL section_add_keyword(section, keyword)
206 CALL keyword_release(keyword)
207
208 ! Keywords for LS solver of Harris functional
209 CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
210 description="Threshold used for filtering matrix operations.", &
211 usage="EPS_FILTER 1.0E-12", default_r_val=1.0e-12_dp)
212 CALL section_add_keyword(section, keyword)
213 CALL keyword_release(keyword)
214
215 CALL keyword_create(keyword, __location__, name="EPS_LANCZOS", &
216 description="Threshold used for lanczos estimates.", &
217 usage="EPS_LANCZOS 1.0E-4", default_r_val=1.0e-3_dp)
218 CALL section_add_keyword(section, keyword)
219 CALL keyword_release(keyword)
220
221 CALL keyword_create(keyword, __location__, name="MAX_ITER_LANCZOS", &
222 description="Maximum number of lanczos iterations.", &
223 usage="MAX_ITER_LANCZOS ", default_i_val=128)
224 CALL section_add_keyword(section, keyword)
225 CALL keyword_release(keyword)
226
227 CALL keyword_create(keyword, __location__, name="MU", &
228 description="Value (or initial guess) for the chemical potential,"// &
229 " i.e. some suitable energy between HOMO and LUMO energy.", &
230 usage="MU 0.0", default_r_val=-0.1_dp)
231 CALL section_add_keyword(section, keyword)
232 CALL keyword_release(keyword)
233
234 CALL keyword_create(keyword, __location__, name="FIXED_MU", &
235 description="Should the calculation be performed at fixed chemical potential,"// &
236 " or should it be found fixing the number of electrons", &
237 usage="FIXED_MU .TRUE.", default_l_val=.false., lone_keyword_l_val=.true.)
238 CALL section_add_keyword(section, keyword)
239 CALL keyword_release(keyword)
240
241 CALL keyword_create(keyword, __location__, name="S_PRECONDITIONER", &
242 description="Preconditions S with some appropriate form.", &
243 usage="S_PRECONDITIONER MOLECULAR", &
244 default_i_val=ls_s_preconditioner_atomic, &
245 enum_c_vals=s2a("NONE", "ATOMIC", "MOLECULAR"), &
246 enum_desc=s2a("No preconditioner", &
247 "Using atomic blocks", &
248 "Using molecular sub-blocks. Recommended if molecules are defined and not too large."), &
250 CALL section_add_keyword(section, keyword)
251 CALL keyword_release(keyword)
252
253 CALL keyword_create(keyword, __location__, name="S_SQRT_METHOD", &
254 description="Method for the caclulation of the sqrt of S.", &
255 usage="S_SQRT_METHOD NEWTONSCHULZ", &
256 default_i_val=ls_s_sqrt_ns, &
257 enum_c_vals=s2a("NEWTONSCHULZ", "PROOT"), &
258 enum_desc=s2a("Using a Newton-Schulz-like iteration", &
259 "Using the p-th root method."), &
260 enum_i_vals=(/ls_s_sqrt_ns, ls_s_sqrt_proot/))
261 CALL section_add_keyword(section, keyword)
262 CALL keyword_release(keyword)
263
264 CALL keyword_create(keyword, __location__, name="S_SQRT_ORDER", &
265 variants=s2a("SIGN_SQRT_ORDER"), &
266 description="Order of the iteration method for the calculation of the sqrt of S.", &
267 usage="S_SQRT_ORDER 3", default_i_val=3)
268 CALL section_add_keyword(section, keyword)
269 CALL keyword_release(keyword)
270
271 CALL keyword_create(keyword, __location__, name="SIGN_METHOD", &
272 description="Method used for the computation of the sign matrix.", &
273 usage="SIGN_METHOD NEWTONSCHULZ", &
274 default_i_val=ls_scf_sign_ns, &
275 citations=(/vandevondele2012, niklasson2003/), &
276 enum_c_vals=s2a("NEWTONSCHULZ", "PROOT"), &
277 enum_desc=s2a("Newton-Schulz iteration.", &
278 "p-th order root iteration"), &
279 enum_i_vals=(/ls_scf_sign_ns, ls_scf_sign_proot/))
280 CALL section_add_keyword(section, keyword)
281 CALL keyword_release(keyword)
282
283 CALL keyword_create(keyword, __location__, name="SIGN_ORDER", &
284 description="Order of the method used for the computation of the sign matrix.", &
285 usage="SIGN_ORDER 2", &
286 default_i_val=2)
287 CALL section_add_keyword(section, keyword)
288 CALL keyword_release(keyword)
289
290 CALL keyword_create(keyword, __location__, name="DYNAMIC_THRESHOLD", &
291 description="Should the threshold for the purification be chosen dynamically", &
292 usage="DYNAMIC_THRESHOLD .TRUE.", default_l_val=.false., lone_keyword_l_val=.true.)
293 CALL section_add_keyword(section, keyword)
294 CALL keyword_release(keyword)
295
296 CALL keyword_create(keyword, __location__, name="NON_MONOTONIC", &
297 description="Should the purification be performed non-monotonically. Relevant for TC2 only.", &
298 usage="NON_MONOTONIC .TRUE.", default_l_val=.true., lone_keyword_l_val=.true.)
299 CALL section_add_keyword(section, keyword)
300 CALL keyword_release(keyword)
301
302 CALL keyword_create( &
303 keyword, __location__, name="MATRIX_CLUSTER_TYPE", &
304 description="Specify how atomic blocks should be clustered in the used matrices, in order to improve flop rate, "// &
305 "and possibly speedup the matrix multiply. Note that the atomic s_preconditioner can not be used. "// &
306 "Furthermore, since screening is on matrix blocks, "// &
307 "slightly more accurate results can be expected with molecular.", &
308 usage="MATRIX_CLUSTER_TYPE MOLECULAR", &
309 default_i_val=ls_cluster_atomic, &
310 enum_c_vals=s2a("ATOMIC", "MOLECULAR"), &
311 enum_desc=s2a("Using atomic blocks", &
312 "Using molecular blocks."), &
314 CALL section_add_keyword(section, keyword)
315 CALL keyword_release(keyword)
316
317 CALL keyword_create(keyword, __location__, name="S_INVERSION", &
318 description="Method used to compute the inverse of S.", &
319 usage="S_INVERSION MOLECULAR", &
320 default_i_val=ls_s_inversion_sign_sqrt, &
321 enum_c_vals=s2a("SIGN_SQRT", "HOTELLING"), &
322 enum_desc=s2a("Using the inverse sqrt as obtained from sign function iterations.", &
323 "Using the Hotellign iteration."), &
325 CALL section_add_keyword(section, keyword)
326 CALL keyword_release(keyword)
327
328 CALL keyword_create(keyword, __location__, name="REPORT_ALL_SPARSITIES", &
329 description="Run the sparsity report at the end of the SCF", &
330 usage="REPORT_ALL_SPARSITIES", default_l_val=.false., lone_keyword_l_val=.true.)
331 CALL section_add_keyword(section, keyword)
332 CALL keyword_release(keyword)
333
334 CALL keyword_create(keyword, __location__, name="CHECK_S_INV", &
335 description="Perform an accuracy check on the inverse/sqrt of the s matrix.", &
336 usage="CHECK_S_INV", default_l_val=.false., lone_keyword_l_val=.true.)
337 CALL section_add_keyword(section, keyword)
338 CALL keyword_release(keyword)
339
340 CALL keyword_create(keyword, __location__, name="OT_INITIAL_GUESS", &
341 description="Initial guess of density matrix used for OT Diagonalization", &
342 usage="OT_INITIAL_GUESS ATOMIC", &
343 default_i_val=ec_ot_atomic, &
344 enum_c_vals=s2a("ATOMIC", "GROUND_STATE"), &
345 enum_desc=s2a("Generate an atomic density using the atomic code", &
346 "Using the ground-state density."), &
347 enum_i_vals=(/ec_ot_atomic, ec_ot_gs/))
348 CALL section_add_keyword(section, keyword)
349 CALL keyword_release(keyword)
350
351 CALL keyword_create( &
352 keyword, __location__, &
353 name="ADMM", &
354 description="Decide whether to perform ADMM in the exact exchange calc. for DC-DFT. "// &
355 "The ADMM XC correction is governed by the AUXILIARY_DENSITY_MATRIX_METHOD section in &DFT. "// &
356 "In most cases, the Hartree-Fock exchange is not too expensive and there is no need for ADMM, "// &
357 "ADMM can however provide significant speedup and memory savings in case of diffuse basis sets. ", &
358 usage="ADMM", &
359 default_l_val=.false., &
360 lone_keyword_l_val=.true.)
361 CALL section_add_keyword(section, keyword)
362 CALL keyword_release(keyword)
363
364 CALL keyword_create(keyword, __location__, name="EXTERNAL_RESPONSE_FILENAME", &
365 description="Name of the file that contains response information.", &
366 usage="EXTERNAL_RESPONSE_FILENAME <FILENAME>", &
367 default_c_val="TREXIO")
368 CALL section_add_keyword(section, keyword)
369 CALL keyword_release(keyword)
370
371 CALL keyword_create(keyword, __location__, name="EXTERNAL_RESULT_FILENAME", &
372 description="Name of the file that contains results from external response calculation.", &
373 usage="EXTERNAL_RESULT_FILENAME <FILENAME>", &
374 default_c_val="CP2K_EXRESP.result")
375 CALL section_add_keyword(section, keyword)
376 CALL keyword_release(keyword)
377
378 CALL keyword_create( &
379 keyword, __location__, &
380 name="ERROR_ESTIMATION", &
381 description="Perform an error estimation for the response forces/stress. "// &
382 "Requires error estimates for the RHS of the response equation from input. ", &
383 usage="ERROR_ESTIMATION", &
384 default_l_val=.false., &
385 lone_keyword_l_val=.true.)
386 CALL section_add_keyword(section, keyword)
387 CALL keyword_release(keyword)
388
389 END SUBROUTINE create_ec_section
390
391! **************************************************************************************************
392!> \brief creates the linear scaling solver section
393!> \param section ...
394!> \author Joost VandeVondele [2010-10], JGH [2019-12]
395! **************************************************************************************************
396 SUBROUTINE create_ec_solver_section(section)
397 TYPE(section_type), POINTER :: section
398
399 TYPE(keyword_type), POINTER :: keyword
400
401 cpassert(.NOT. ASSOCIATED(section))
402 CALL section_create(section, __location__, name="RESPONSE_SOLVER", &
403 description="Specifies the parameters of the linear scaling solver routines", &
404 n_keywords=24, n_subsections=3, repeats=.false., &
405 citations=(/vandevondele2012/))
406
407 NULLIFY (keyword)
408
409 CALL keyword_create(keyword, __location__, name="EPS", &
410 description="Target accuracy for the convergence of the conjugate gradient.", &
411 usage="EPS 1.e-10", default_r_val=1.e-12_dp)
412 CALL section_add_keyword(section, keyword)
413 CALL keyword_release(keyword)
414
415 CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
416 description="Threshold used for filtering matrix operations.", &
417 usage="EPS_FILTER 1.0E-10", default_r_val=1.0e-10_dp)
418 CALL section_add_keyword(section, keyword)
419 CALL keyword_release(keyword)
420
421 CALL keyword_create(keyword, __location__, name="EPS_LANCZOS", &
422 description="Threshold used for lanczos estimates.", &
423 usage="EPS_LANCZOS 1.0E-4", default_r_val=1.0e-3_dp)
424 CALL section_add_keyword(section, keyword)
425 CALL keyword_release(keyword)
426
427 CALL keyword_create(keyword, __location__, name="MAX_ITER", &
428 description="Maximum number of conjugate gradient iteration "// &
429 "to be performed for one optimization.", &
430 usage="MAX_ITER 200", default_i_val=50)
431 CALL section_add_keyword(section, keyword)
432 CALL keyword_release(keyword)
433
434 CALL keyword_create(keyword, __location__, name="MAX_ITER_LANCZOS", &
435 description="Maximum number of lanczos iterations.", &
436 usage="MAX_ITER_LANCZOS 128", default_i_val=128)
437 CALL section_add_keyword(section, keyword)
438 CALL keyword_release(keyword)
439
440 CALL keyword_create(keyword, __location__, name="METHOD", &
441 description="Algorithm used to solve response equation. "// &
442 "Both solver are conjugate gradient based, but use either a vector (MO-coefficient) "// &
443 "or density matrix formalism in the orthonormal AO-basis to obtain response density", &
444 usage="METHOD SOLVER", &
445 default_i_val=ec_ls_solver, &
446 enum_c_vals=s2a("MO_SOLVER", "AO_ORTHO"), &
447 enum_desc=s2a("Solver based on MO (vector) formalism", &
448 "Solver based on density matrix formalism"), &
449 enum_i_vals=(/ec_mo_solver, ec_ls_solver/))
450 CALL section_add_keyword(section, keyword)
451 CALL keyword_release(keyword)
452
453 CALL keyword_create( &
454 keyword, __location__, name="PRECONDITIONER", &
455 description="Type of preconditioner to be used with MO conjugate gradient solver. "// &
456 "They differ in effectiveness, cost of construction, cost of application. "// &
457 "Properly preconditioned minimization can be orders of magnitude faster than doing nothing. "// &
458 "Only multi-level conjugate gradient preconditioner (MULTI_LEVEL) available for AO response solver (AO_ORTHO). ", &
459 usage="PRECONDITIONER FULL_ALL", &
460 default_i_val=precond_mlp, &
461 enum_c_vals=s2a("FULL_ALL", "FULL_SINGLE_INVERSE", "FULL_SINGLE", "FULL_KINETIC", "FULL_S_INVERSE", &
462 "MULTI_LEVEL", "NONE"), &
463 enum_desc=s2a("Most effective state selective preconditioner based on diagonalization, "// &
464 "requires the ENERGY_GAP parameter to be an underestimate of the HOMO-LUMO gap. "// &
465 "This preconditioner is recommended for almost all systems, except very large systems where "// &
466 "make_preconditioner would dominate the total computational cost.", &
467 "Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
468 "but cheaper to construct, "// &
469 "might be somewhat less robust. Recommended for large systems.", &
470 "Based on H-eS diagonalisation, not as good as FULL_ALL, but somewhat cheaper to apply. ", &
471 "Cholesky inversion of S and T, fast construction, robust, and relatively good, "// &
472 "use for very large systems.", &
473 "Cholesky inversion of S, not as good as FULL_KINETIC, yet equally expensive.", &
474 "Based on same CG as AO-solver itself, but uses cheaper linear transformation", &
475 "skip preconditioning"), &
478 CALL section_add_keyword(section, keyword)
479 CALL keyword_release(keyword)
480
481 CALL keyword_create(keyword, __location__, name="S_PRECONDITIONER", &
482 description="Preconditions S with some appropriate form.", &
483 usage="S_PRECONDITIONER MOLECULAR", &
484 default_i_val=ls_s_preconditioner_atomic, &
485 enum_c_vals=s2a("NONE", "ATOMIC", "MOLECULAR"), &
486 enum_desc=s2a("No preconditioner", &
487 "Using atomic blocks", &
488 "Using molecular sub-blocks. Recommended if molecules are defined and not too large."), &
490 CALL section_add_keyword(section, keyword)
491 CALL keyword_release(keyword)
492
493 CALL keyword_create(keyword, __location__, name="S_SQRT_METHOD", &
494 description="Method for the caclulation of the sqrt of S.", &
495 usage="S_SQRT_METHOD NEWTONSCHULZ", &
496 default_i_val=ls_s_sqrt_ns, &
497 enum_c_vals=s2a("NEWTONSCHULZ", "PROOT"), &
498 enum_desc=s2a("Using a Newton-Schulz-like iteration", &
499 "Using the p-th root method."), &
500 enum_i_vals=(/ls_s_sqrt_ns, ls_s_sqrt_proot/))
501 CALL section_add_keyword(section, keyword)
502 CALL keyword_release(keyword)
503
504 CALL keyword_create(keyword, __location__, name="S_SQRT_ORDER", &
505 variants=s2a("SIGN_SQRT_ORDER"), &
506 description="Order of the iteration method for the calculation of the sqrt of S.", &
507 usage="S_SQRT_ORDER 3", default_i_val=3)
508 CALL section_add_keyword(section, keyword)
509 CALL keyword_release(keyword)
510
511 CALL keyword_create( &
512 keyword, __location__, name="MATRIX_CLUSTER_TYPE", &
513 description="Specify how atomic blocks should be clustered in the used matrices, in order to improve flop rate, "// &
514 "and possibly speedup the matrix multiply. Note that the atomic s_preconditioner can not be used. "// &
515 "Furthermore, since screening is on matrix blocks, "// &
516 "slightly more accurate results can be expected with molecular.", &
517 usage="MATRIX_CLUSTER_TYPE MOLECULAR", &
518 default_i_val=ls_cluster_atomic, &
519 enum_c_vals=s2a("ATOMIC", "MOLECULAR"), &
520 enum_desc=s2a("Using atomic blocks", &
521 "Using molecular blocks."), &
523 CALL section_add_keyword(section, keyword)
524 CALL keyword_release(keyword)
525
526 CALL keyword_create(keyword, __location__, name="S_INVERSION", &
527 description="Method used to compute the inverse of S.", &
528 usage="S_INVERSION MOLECULAR", &
529 default_i_val=ls_s_inversion_sign_sqrt, &
530 enum_c_vals=s2a("SIGN_SQRT", "HOTELLING"), &
531 enum_desc=s2a("Using the inverse sqrt as obtained from sign function iterations.", &
532 "Using the Hotellign iteration."), &
534 CALL section_add_keyword(section, keyword)
535 CALL keyword_release(keyword)
536
537 CALL keyword_create(keyword, __location__, name="RESTART", &
538 description="Restart the response calculation if the restart file exists", &
539 usage="RESTART", &
540 default_l_val=.false., lone_keyword_l_val=.true.)
541 CALL section_add_keyword(section, keyword)
542 CALL keyword_release(keyword)
543
544 CALL keyword_create(keyword, __location__, name="RESTART_EVERY", &
545 description="Restart the conjugate gradient after the specified number of iterations.", &
546 usage="RESTART_EVERY 50", default_i_val=50)
547 CALL section_add_keyword(section, keyword)
548 CALL keyword_release(keyword)
549
550 END SUBROUTINE create_ec_solver_section
551
552! **************************************************************************************************
553!> \brief Create the print dft section
554!> \param section the section to create
555!> \author fbelle - from create_print_dft_section
556! **************************************************************************************************
557 SUBROUTINE create_ec_print_section(section)
558 TYPE(section_type), POINTER :: section
559
560 TYPE(keyword_type), POINTER :: keyword
561 TYPE(section_type), POINTER :: print_key
562
563 cpassert(.NOT. ASSOCIATED(section))
564 CALL section_create(section, __location__, name="PRINT", &
565 description="Section of possible print options in EC code.", &
566 n_keywords=0, n_subsections=1, repeats=.false.)
567
568 NULLIFY (print_key, keyword)
569
570 ! Output of BQB volumetric files
571 CALL cp_print_key_section_create(print_key, __location__, name="E_DENSITY_BQB", &
572 description="Controls the output of the electron density to the losslessly"// &
573 " compressed BQB file format, see [Brehm2018]"// &
574 " (via LibBQB see <https://brehm-research.de/bqb>)."// &
575 " Currently does not work with changing cell vector (NpT ensemble).", &
576 print_level=debug_print_level + 1, filename="", &
577 citations=(/brehm2018/))
578
579 CALL keyword_create(keyword, __location__, name="SKIP_FIRST", &
580 description="Skips the first step of a MD run (avoids duplicate step if restarted).", &
581 usage="SKIP_FIRST T", default_l_val=.false., lone_keyword_l_val=.true.)
582 CALL section_add_keyword(print_key, keyword)
583 CALL keyword_release(keyword)
584
585 CALL keyword_create(keyword, __location__, name="STORE_STEP_NUMBER", &
586 description="Stores the step number and simulation time in the comment line of each BQB"// &
587 " frame. Switch it off for binary compatibility with original CP2k CUBE files.", &
588 usage="STORE_STEP_NUMBER F", default_l_val=.true., lone_keyword_l_val=.true.)
589 CALL section_add_keyword(print_key, keyword)
590 CALL keyword_release(keyword)
591
592 CALL keyword_create(keyword, __location__, name="CHECK", &
593 description="Performs an on-the-fly decompression of each compressed BQB frame to check"// &
594 " whether the volumetric data exactly matches, and aborts the run if not so.", &
595 usage="CHECK T", default_l_val=.false., lone_keyword_l_val=.true.)
596 CALL section_add_keyword(print_key, keyword)
597 CALL keyword_release(keyword)
598
599 CALL keyword_create(keyword, __location__, name="OVERWRITE", &
600 description="Specify this keyword to overwrite the output BQB file if"// &
601 " it already exists. By default, the data is appended to an existing file.", &
602 usage="OVERWRITE T", default_l_val=.false., lone_keyword_l_val=.true.)
603 CALL section_add_keyword(print_key, keyword)
604 CALL keyword_release(keyword)
605
606 CALL keyword_create(keyword, __location__, name="HISTORY", &
607 description="Controls how many previous steps are taken into account for extrapolation in"// &
608 " compression. Use a value of 1 to compress the frames independently.", &
609 usage="HISTORY 10", n_var=1, default_i_val=10, type_of_var=integer_t)
610 CALL section_add_keyword(print_key, keyword)
611 CALL keyword_release(keyword)
612
613 CALL keyword_create(keyword, __location__, name="PARAMETER_KEY", &
614 description="Allows to supply previously optimized compression parameters via a"// &
615 " parameter key (alphanumeric character sequence starting with 'at')."// &
616 " Just leave away the 'at' sign here, because CP2k will otherwise"// &
617 " assume it is a variable name in the input", &
618 usage="PARAMETER_KEY <KEY>", n_var=1, default_c_val="", type_of_var=char_t)
619 CALL section_add_keyword(print_key, keyword)
620 CALL keyword_release(keyword)
621
622 CALL keyword_create(keyword, __location__, name="OPTIMIZE", &
623 description="Controls the time spent to optimize the parameters for compression efficiency.", &
624 usage="OPTIMIZE {OFF,QUICK,NORMAL,PATIENT,EXHAUSTIVE}", repeats=.false., n_var=1, &
625 default_i_val=bqb_opt_quick, &
626 enum_c_vals=s2a("OFF", "QUICK", "NORMAL", "PATIENT", "EXHAUSTIVE"), &
627 enum_desc=s2a("No optimization (use defaults)", "Quick optimization", &
628 "Standard optimization", "Precise optimization", "Exhaustive optimization"), &
630 CALL section_add_keyword(print_key, keyword)
631 CALL keyword_release(keyword)
632
633 CALL section_add_subsection(section, print_key)
634 CALL section_release(print_key)
635
636 ! Voronoi Integration via LibVori
637 NULLIFY (print_key)
638 CALL create_print_voronoi_section(print_key)
639 CALL section_add_subsection(section, print_key)
640 CALL section_release(print_key)
641
642 !Printing of Moments
643 CALL create_dipoles_section(print_key, "MOMENTS", high_print_level)
644 CALL keyword_create( &
645 keyword, __location__, &
646 name="MAX_MOMENT", &
647 description="Maximum moment to be calculated. Values higher than 1 not implemented under periodic boundaries.", &
648 usage="MAX_MOMENT {integer}", &
649 repeats=.false., &
650 n_var=1, &
651 type_of_var=integer_t, &
652 default_i_val=1)
653 CALL section_add_keyword(print_key, keyword)
654 CALL keyword_release(keyword)
655 CALL keyword_create(keyword, __location__, &
656 name="MAGNETIC", &
657 description="Calculate also magnetic moments, only implemented without periodic boundaries", &
658 usage="MAGNETIC yes", &
659 repeats=.false., &
660 n_var=1, &
661 default_l_val=.false., &
662 lone_keyword_l_val=.true.)
663 CALL section_add_keyword(print_key, keyword)
664 CALL keyword_release(keyword)
665 CALL section_add_subsection(section, print_key)
666 CALL section_release(print_key)
667
668 END SUBROUTINE create_ec_print_section
669
670END MODULE input_cp2k_ec
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public vandevondele2012
integer, save, public niklasson2003
integer, save, public brehm2018
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public debug_print_level
integer, parameter, public high_print_level
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 ec_functional_harris
integer, parameter, public bqb_opt_quick
integer, parameter, public ec_functional_dc
integer, parameter, public ls_s_preconditioner_molecular
integer, parameter, public precond_mlp
integer, parameter, public ls_s_inversion_hotelling
integer, parameter, public ls_cluster_molecular
integer, parameter, public ec_ot_atomic
integer, parameter, public ls_s_preconditioner_atomic
integer, parameter, public ec_mo_solver
integer, parameter, public bqb_opt_normal
integer, parameter, public ot_precond_full_kinetic
integer, parameter, public bqb_opt_off
integer, parameter, public ec_ot_diag
integer, parameter, public ec_ot_gs
integer, parameter, public bqb_opt_exhaustive
integer, parameter, public ls_s_sqrt_proot
integer, parameter, public ot_precond_full_single
integer, parameter, public ls_s_sqrt_ns
integer, parameter, public ls_s_preconditioner_none
integer, parameter, public ls_scf_sign_proot
integer, parameter, public ot_precond_none
integer, parameter, public ot_precond_full_single_inverse
integer, parameter, public ec_matrix_tc2
integer, parameter, public ec_diagonalization
integer, parameter, public ec_matrix_trs4
integer, parameter, public ec_functional_ext
integer, parameter, public ls_scf_sign_ns
integer, parameter, public ec_matrix_sign
integer, parameter, public ls_s_inversion_sign_sqrt
integer, parameter, public bqb_opt_patient
integer, parameter, public ot_precond_s_inverse
integer, parameter, public kg_cholesky
integer, parameter, public ot_precond_full_all
integer, parameter, public ls_cluster_atomic
integer, parameter, public ec_ls_solver
function that build the dft section of the input
subroutine, public create_ec_section(section)
creates the ENERGY CORRECTION section
creates the mm section of the input
subroutine, public create_dipoles_section(print_key, label, print_level)
creates the input section for the qs part
function that build the dft section of the input
subroutine, public create_print_voronoi_section(print_key)
Create the print voronoi section.
function that build the xc section of the input
subroutine, public create_xc_section(section)
creates the input section for the xc part
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 char_t
integer, parameter, public integer_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Utilities for string manipulations.
represent a keyword in the input
represent a section of the input file