(git:f7b9015)
Loading...
Searching...
No Matches
input_cp2k_dft.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 dft section of the input
10!> \par History
11!> 10.2005 moved out of input_cp2k [fawzi]
12!> \author fawzi
13! **************************************************************************************************
17 USE bibliography, ONLY: &
27 USE cp_spline_utils, ONLY: pw_interp,&
29 USE cp_units, ONLY: cp_unit_to_cp2k
30 USE input_constants, ONLY: &
88 USE input_val_types, ONLY: char_t,&
89 integer_t,&
90 lchar_t,&
91 logical_t,&
92 real_t
93 USE kinds, ONLY: dp
94 USE physcon, ONLY: evolt,&
96 USE pw_spline_utils, ONLY: no_precond,&
102 USE string_utilities, ONLY: s2a
103#include "./base/base_uses.f90"
104
105 IMPLICIT NONE
106 PRIVATE
107
108 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_dft'
109
110 PUBLIC :: create_dft_section
111 PUBLIC :: create_bsse_section
112 PUBLIC :: create_interp_section
113 PUBLIC :: create_mgrid_section
114
115CONTAINS
116
117! **************************************************************************************************
118!> \brief creates the dft section
119!> \param section the section to be created
120!> \author fawzi
121! **************************************************************************************************
122 SUBROUTINE create_dft_section(section)
123 TYPE(section_type), POINTER :: section
124
125 TYPE(keyword_type), POINTER :: keyword
126 TYPE(section_type), POINTER :: subsection
127
128 cpassert(.NOT. ASSOCIATED(section))
129 CALL section_create(section, __location__, name="DFT", &
130 description="Controls electronic-structure settings for Quickstep and related "// &
131 "Gaussian-basis DFT methods.", &
132 n_keywords=3, n_subsections=4, repeats=.false.)
133
134 NULLIFY (keyword)
135 CALL keyword_create(keyword, __location__, name="BASIS_SET_FILE_NAME", &
136 description="Name of a basis-set library file, optionally including a path. "// &
137 "This keyword can be repeated to search several basis-set files.", &
138 usage="BASIS_SET_FILE_NAME <FILENAME>", &
139 type_of_var=lchar_t, repeats=.true., &
140 default_lc_val="BASIS_SET", n_var=1)
141 CALL section_add_keyword(section, keyword)
142 CALL keyword_release(keyword)
143
144 CALL keyword_create(keyword, __location__, name="POTENTIAL_FILE_NAME", &
145 description="Name of the pseudopotential library file, optionally including a path. "// &
146 "This keyword can be repeated to search several pseudopotential files. "// &
147 "Files are searched in input order and the first matching potential is used. "// &
148 "The potential selected for each kind is set with KIND%POTENTIAL.", &
149 usage="POTENTIAL_FILE_NAME <FILENAME>", &
150 type_of_var=lchar_t, repeats=.true., &
151 default_lc_val="POTENTIAL", n_var=1)
152 CALL section_add_keyword(section, keyword)
153 CALL keyword_release(keyword)
154
155 CALL keyword_create(keyword, __location__, name="WFN_RESTART_FILE_NAME", &
156 variants=["RESTART_FILE_NAME"], &
157 description="Name of the wavefunction restart file, may include a path."// &
158 " If no file is specified, the default is to open the file as generated by the wfn restart print key.", &
159 usage="WFN_RESTART_FILE_NAME <FILENAME>", &
160 type_of_var=lchar_t)
161 CALL section_add_keyword(section, keyword)
162 CALL keyword_release(keyword)
163
164 CALL keyword_create(keyword, __location__, &
165 name="UKS", &
166 variants=s2a("UNRESTRICTED_KOHN_SHAM", &
167 "LSD", &
168 "SPIN_POLARIZED"), &
169 description="Requests a spin-polarized calculation using alpha "// &
170 "and beta orbitals, i.e. no spin restriction is applied", &
171 usage="LSD", &
172 default_l_val=.false., &
173 lone_keyword_l_val=.true.)
174 CALL section_add_keyword(section, keyword)
175 CALL keyword_release(keyword)
176 CALL keyword_create(keyword, __location__, &
177 name="ROKS", &
178 variants=["RESTRICTED_OPEN_KOHN_SHAM"], &
179 description="Requests a restricted open Kohn-Sham calculation", &
180 usage="ROKS", &
181 default_l_val=.false., &
182 lone_keyword_l_val=.true.)
183 CALL section_add_keyword(section, keyword)
184 CALL keyword_release(keyword)
185 CALL keyword_create(keyword, __location__, &
186 name="MULTIPLICITY", &
187 variants=["MULTIP"], &
188 description="Two times the total spin plus one. "// &
189 "Specify 3 for a triplet, 4 for a quartet, "// &
190 "and so on. Default is 1 (singlet) for an "// &
191 "even number and 2 (doublet) for an odd number "// &
192 "of electrons.", &
193 usage="MULTIPLICITY 3", &
194 default_i_val=0) ! this default value is just a flag to get the above
195 CALL section_add_keyword(section, keyword)
196 CALL keyword_release(keyword)
197 CALL keyword_create(keyword, __location__, name="CHARGE", &
198 description="The total charge of the system", &
199 usage="CHARGE -1", &
200 default_i_val=0)
201 CALL section_add_keyword(section, keyword)
202 CALL keyword_release(keyword)
203
204 CALL keyword_create(keyword, __location__, &
205 name="PLUS_U_METHOD", &
206 description="Method employed for the calculation of the DFT+U contribution", &
207 repeats=.false., &
208 enum_c_vals=s2a("LOWDIN", "MULLIKEN", "MULLIKEN_CHARGES", "TENSORIAL"), &
211 enum_desc=s2a("Method based on Lowdin population analysis "// &
212 "(computationally expensive, since the diagonalization of the "// &
213 "overlap matrix is required, but possibly more robust than Mulliken)", &
214 "Method based on Mulliken population analysis using the net AO and "// &
215 "overlap populations (computationally cheap method)", &
216 "Method based on Mulliken gross orbital populations (GOP)", &
217 "Method based on Tensorial population analysis approach"), &
218 n_var=1, &
219 default_i_val=plus_u_mulliken, &
220 usage="PLUS_U_METHOD Lowdin")
221 CALL section_add_keyword(section, keyword)
222 CALL keyword_release(keyword)
223
224 CALL keyword_create(keyword, __location__, &
225 name="EPS_U_J_LOOP", &
226 description="Convergence threshold for the self-consistent update of U and J parameters "// &
227 "in the minimum tracking linear response calculation.", &
228 repeats=.false., &
229 n_var=1, &
230 unit_str="hartree", &
231 default_r_val=1.0e-2_dp, &
232 usage="EPS_U_J_LOOP [eV] 0.01")
233 CALL section_add_keyword(section, keyword)
234 CALL keyword_release(keyword)
235
236 CALL keyword_create(keyword, __location__, &
237 name="MTLR_REFERENCE_SCF", &
238 description="Controls the unperturbed reference SCF for minimum tracking linear "// &
239 "response. With SCF_GUESS ATOMIC, the default is OFF. If enabled, an unperturbed "// &
240 "reference SCF is first converged and its orbitals initialize every perturbation. "// &
241 "With SCF_GUESS RESTART, a reference SCF is required and uses the standard "// &
242 "restart initial guess.", &
243 repeats=.false., &
244 type_of_var=logical_t, &
245 lone_keyword_l_val=.true., &
246 usage="MTLR_REFERENCE_SCF ON")
247 CALL section_add_keyword(section, keyword)
248 CALL keyword_release(keyword)
249
250 CALL keyword_create(keyword, __location__, &
251 name="MAX_MTLR_LOOP", &
252 description="Max number of iterations for calculated self-consistent linear response U and J.", &
253 repeats=.false., &
254 default_i_val=10, &
255 usage="MAX_MTLR_LOOP 10")
256 CALL section_add_keyword(section, keyword)
257 CALL keyword_release(keyword)
258
259 CALL keyword_create(keyword, __location__, &
260 name="RELAX_MULTIPLICITY", &
261 variants=["RELAX_MULTIP"], &
262 description="Tolerance in Hartrees. Do not enforce the occupation "// &
263 "of alpha and beta MOs due to the initially "// &
264 "defined multiplicity, but rather follow the Aufbau principle. "// &
265 "A value greater than zero activates this option. "// &
266 "If alpha/beta MOs differ in energy less than this tolerance, "// &
267 "then alpha-MO occupation is preferred even if it is higher "// &
268 "in energy (within the tolerance). "// &
269 "Such spin-symmetry broken (spin-polarized) occupation is used "// &
270 "as SCF input, which (is assumed to) bias the SCF "// &
271 "towards a spin-polarized solution. "// &
272 "Thus, larger tolerance increases chances of ending up "// &
273 "with spin-polarization. "// &
274 "This option is only valid for unrestricted (i.e. spin polarised) "// &
275 "Kohn-Sham (UKS) calculations. It also needs non-zero "// &
276 "[ADDED_MOS](#CP2K_INPUT.FORCE_EVAL.DFT.SCF.ADDED_MOS) to actually affect the calculations, "// &
277 "which is why it is not expected to work with [OT](#CP2K_INPUT.FORCE_EVAL.DFT.SCF.OT) "// &
278 "and may raise errors when used with OT. "// &
279 "For more details see [this discussion](https://github.com/cp2k/cp2k/issues/4389).", &
280 usage="RELAX_MULTIPLICITY 0.00001", &
281 repeats=.false., &
282 default_r_val=0.0_dp)
283 CALL section_add_keyword(section, keyword)
284 CALL keyword_release(keyword)
285
286 CALL keyword_create(keyword, __location__, name="SUBCELLS", &
287 description="Read the grid size for subcell generation in the construction of "// &
288 "neighbor lists.", usage="SUBCELLS 1.5", &
289 n_var=1, default_r_val=2.0_dp)
290 CALL section_add_keyword(section, keyword)
291 CALL keyword_release(keyword)
292
293 CALL keyword_create(keyword, __location__, name="AUTO_BASIS", &
294 description="Specify type and size of automatically generated auxiliary "// &
295 "(RI) basis sets. Exactly two arguments are required for this option. "// &
296 "The first argument of basis type should be one of the following: "// &
297 "`RI_AUX`, `AUX_FIT`, `LRI_AUX`, `P_LRI_AUX`, `RI_HXC`, `RI_XAS`, or "// &
298 "`RI_HFX`. The second argument of basis size should be one of the "// &
299 "following: `SMALL`, `MEDIUM`, `LARGE`, or `HUGE`. The default is not "// &
300 "using any of these basis sets, requested by `AUTO_BASIS X X` (exactly "// &
301 "as written here).", &
302 usage="AUTO_BASIS {basis_type} {basis_size}", &
303 type_of_var=char_t, repeats=.true., n_var=-1, default_c_vals=["X", "X"])
304 CALL section_add_keyword(section, keyword)
305 CALL keyword_release(keyword)
306
307 CALL keyword_create(keyword, __location__, &
308 name="SURFACE_DIPOLE_CORRECTION", &
309 variants=s2a("SURFACE_DIPOLE", &
310 "SURF_DIP"), &
311 description="For slab calculations with asymmetric geometries, activate the correction of "// &
312 "the electrostatic potential with "// &
313 "by compensating for the surface dipole. Implemented only for slabs with normal "// &
314 "parallel to one Cartesian axis. The normal direction is given by the keyword SURF_DIP_DIR", &
315 usage="SURF_DIP", &
316 default_l_val=.false., &
317 lone_keyword_l_val=.true., &
318 citations=[bengtsson1999])
319 CALL section_add_keyword(section, keyword)
320 CALL keyword_release(keyword)
321
322 CALL keyword_create(keyword, __location__, &
323 name="SURF_DIP_DIR", &
324 description="Cartesian axis parallel to surface normal.", &
325 enum_c_vals=s2a("X", "Y", "Z"), &
326 enum_i_vals=[1, 2, 3], &
327 enum_desc=s2a("Along x", "Along y", "Along z"), &
328 n_var=1, &
329 default_i_val=3, &
330 usage="SURF_DIP_DIR Z")
331 CALL section_add_keyword(section, keyword)
332 CALL keyword_release(keyword)
333
334 CALL keyword_create(keyword, __location__, &
335 name="SURF_DIP_POS", &
336 description="This keyword assigns an user defined position in Angstroms "// &
337 "in the direction normal to the surface (given by SURF_DIP_DIR). "// &
338 "The default value is -1.0_dp which appplies the correction at a position "// &
339 "that has minimum electron density on the grid.", &
340 usage="SURF_DIP_POS -1.0_dp", &
341 default_r_val=-1.0_dp)
342 CALL section_add_keyword(section, keyword)
343 CALL keyword_release(keyword)
344
345 CALL keyword_create(keyword, __location__, &
346 name="SURF_DIP_SWITCH", &
347 description="WARNING: Experimental feature under development that will help the "// &
348 "user to switch parameters to facilitate SCF convergence. In its current form the "// &
349 "surface dipole correction is switched off if the calculation does not converge in "// &
350 "(0.5*MAX_SCF + 1) outer_scf steps. "// &
351 "The default value is .FALSE.", &
352 usage="SURF_DIP_SWITCH .TRUE.", &
353 default_l_val=.false., &
354 lone_keyword_l_val=.true.)
355 CALL section_add_keyword(section, keyword)
356 CALL keyword_release(keyword)
357
358 CALL keyword_create(keyword, __location__, &
359 name="CORE_CORR_DIP", &
360 description="If the total CORE_CORRECTION is non-zero and surface dipole "// &
361 "correction is switched on, presence of this keyword will adjust electron "// &
362 "density via MO occupation to reflect the total CORE_CORRECTION. "// &
363 "The default value is .FALSE.", &
364 usage="CORE_CORR_DIP .TRUE.", &
365 default_l_val=.false., &
366 lone_keyword_l_val=.true.)
367 CALL section_add_keyword(section, keyword)
368 CALL keyword_release(keyword)
369
370 CALL keyword_create(keyword, __location__, &
371 name="SORT_BASIS", &
372 description="Sorts basis functions according to a selected criterion. "// &
373 "Sorting by exponent can improve data locality for selected exact-exchange and RI workflows.", &
374 enum_c_vals=s2a("DEFAULT", "EXP"), &
375 enum_i_vals=[basis_sort_default, basis_sort_zet], &
376 enum_desc=s2a("don't sort", "sort w.r.t. exponent"), &
377 default_i_val=basis_sort_default, &
378 usage="SORT_BASIS EXP")
379 CALL section_add_keyword(section, keyword)
380 CALL keyword_release(keyword)
381
382 NULLIFY (subsection)
383 CALL create_scf_section(subsection)
384 CALL section_add_subsection(section, subsection)
385 CALL section_release(subsection)
386
387 CALL create_ls_scf_section(subsection)
388 CALL section_add_subsection(section, subsection)
389 CALL section_release(subsection)
390
391 CALL create_almo_scf_section(subsection)
392 CALL section_add_subsection(section, subsection)
393 CALL section_release(subsection)
394
395 CALL create_kg_section(subsection)
396 CALL section_add_subsection(section, subsection)
397 CALL section_release(subsection)
398
399 CALL create_fde_section(subsection)
400 CALL section_add_subsection(section, subsection)
401 CALL section_release(subsection)
402
403 CALL create_harris_section(subsection)
404 CALL section_add_subsection(section, subsection)
405 CALL section_release(subsection)
406
407 CALL create_ec_section(subsection)
408 CALL section_add_subsection(section, subsection)
409 CALL section_release(subsection)
410
411 CALL create_exstate_section(subsection)
412 CALL section_add_subsection(section, subsection)
413 CALL section_release(subsection)
414
415 CALL create_admm_section(subsection)
416 CALL section_add_subsection(section, subsection)
417 CALL section_release(subsection)
418
419 CALL create_qs_section(subsection)
420 CALL section_add_subsection(section, subsection)
421 CALL section_release(subsection)
422
423 CALL create_mgrid_section(subsection, create_subsections=.true.)
424 CALL section_add_subsection(section, subsection)
425 CALL section_release(subsection)
426
427 CALL create_xc_section(subsection)
428 CALL section_add_subsection(section, subsection)
429 CALL section_release(subsection)
430
431 CALL create_relativistic_section(subsection)
432 CALL section_add_subsection(section, subsection)
433 CALL section_release(subsection)
434
435 CALL create_sic_section(subsection)
436 CALL section_add_subsection(section, subsection)
437 CALL section_release(subsection)
438
439 CALL create_low_spin_roks_section(subsection)
440 CALL section_add_subsection(section, subsection)
441 CALL section_release(subsection)
442
443 CALL create_efield_section(subsection)
444 CALL section_add_subsection(section, subsection)
445 CALL section_release(subsection)
446
447 CALL create_per_efield_section(subsection)
448 CALL section_add_subsection(section, subsection)
449 CALL section_release(subsection)
450
451 CALL create_ext_pot_section(subsection)
452 CALL section_add_subsection(section, subsection)
453 CALL section_release(subsection)
454
455 CALL create_transport_section(subsection)
456 CALL section_add_subsection(section, subsection)
457 CALL section_release(subsection)
458
459 ! ZMP sections to include the external density or v_xc potential
460 CALL create_ext_den_section(subsection)
461 CALL section_add_subsection(section, subsection)
462 CALL section_release(subsection)
463
464 CALL create_ext_vxc_section(subsection)
465 CALL section_add_subsection(section, subsection)
466 CALL section_release(subsection)
467
468 CALL create_poisson_section(subsection)
469 CALL section_add_subsection(section, subsection)
470 CALL section_release(subsection)
471
472 CALL create_kpoints_section(subsection)
473 CALL section_add_subsection(section, subsection)
474 CALL section_release(subsection)
475
476 CALL create_kpoint_set_section(subsection)
477 CALL section_add_subsection(section, subsection)
478 CALL section_release(subsection)
479
480 CALL create_implicit_solv_section(subsection)
481 CALL section_add_subsection(section, subsection)
482 CALL section_release(subsection)
483
484 CALL create_density_fitting_section(subsection)
485 CALL section_add_subsection(section, subsection)
486 CALL section_release(subsection)
487
488 CALL create_xas_section(subsection)
489 CALL section_add_subsection(section, subsection)
490 CALL section_release(subsection)
491
492 CALL create_xas_tdp_section(subsection)
493 CALL section_add_subsection(section, subsection)
494 CALL section_release(subsection)
495
496 CALL create_localize_section(subsection)
497 CALL section_add_subsection(section, subsection)
498 CALL section_release(subsection)
499
500 CALL create_rtp_section(subsection)
501 CALL section_add_subsection(section, subsection)
502 CALL section_release(subsection)
503
504 CALL create_print_dft_section(subsection)
505 CALL section_add_subsection(section, subsection)
506 CALL section_release(subsection)
507
508 CALL create_sccs_section(subsection)
509 CALL section_add_subsection(section, subsection)
510 CALL section_release(subsection)
511
512 CALL create_active_space_section(subsection)
513 CALL section_add_subsection(section, subsection)
514 CALL section_release(subsection)
515
516 CALL create_dft_smeagol_section(subsection)
517 CALL section_add_subsection(section, subsection)
518 CALL section_release(subsection)
519
520 CALL create_hairy_probes_section(subsection)
521 CALL section_add_subsection(section, subsection)
522 CALL section_release(subsection)
523
524 CALL create_pcc_section(subsection)
525 CALL section_add_subsection(section, subsection)
526 CALL section_release(subsection)
527
528 CALL create_paep_section(subsection)
529 CALL section_add_subsection(section, subsection)
530 CALL section_release(subsection)
531
532 END SUBROUTINE create_dft_section
533
534! **************************************************************************************************
535!> \brief Hairy Probe DFT Model
536!> \param section ...
537!> \author Margherita Buraschi
538! **************************************************************************************************
539
540 SUBROUTINE create_hairy_probes_section(section)
541 TYPE(section_type), POINTER :: section
542
543 TYPE(keyword_type), POINTER :: keyword
544
545 NULLIFY (keyword)
546 cpassert(.NOT. ASSOCIATED(section))
547 CALL section_create(section, __location__, &
548 name="HAIRY_PROBES", &
549 description="Sets up a Hairy Probe calculation. ", &
550 n_keywords=0, n_subsections=0, repeats=.true.)
551
552 CALL keyword_create(keyword, __location__, &
553 name="_SECTION_PARAMETERS_", &
554 description="Controls the activation of hairy probe", &
555 usage="&HAIRY_PROBES ON", &
556 default_l_val=.false., &
557 lone_keyword_l_val=.true.)
558 CALL section_add_keyword(section, keyword)
559 CALL keyword_release(keyword)
560
561 CALL keyword_create(keyword, __location__, name="ATOM_IDS", &
562 description="Indexes of the atoms to which the probes are attached.", &
563 usage="ATOM_IDS <INTEGER> .. <INTEGER>", &
564 type_of_var=integer_t, n_var=-1)
565 CALL section_add_keyword(section, keyword)
566 CALL keyword_release(keyword)
567
568 CALL keyword_create(keyword, __location__, name="T", &
569 description="Electronic temperature [K]", &
570 usage="T <REAL>", &
571 default_r_val=cp_unit_to_cp2k(value=300.0_dp, unit_str="K"), &
572 unit_str="K")
573 CALL section_add_keyword(section, keyword)
574 CALL keyword_release(keyword)
575
576 CALL keyword_create(keyword, __location__, name="MU", &
577 description="Chemical potential of the electrons in the probes [eV] ", &
578 usage="MU <REAL>", &
579 default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="eV"), &
580 unit_str="eV")
581 CALL section_add_keyword(section, keyword)
582 CALL keyword_release(keyword)
583
584 CALL keyword_create(keyword, __location__, name="ALPHA", &
585 description="Parameter for solution probes ", &
586 usage="ALPHA <REAL>", &
587 default_r_val=1.0_dp)
588 CALL section_add_keyword(section, keyword)
589 CALL keyword_release(keyword)
590
591 CALL keyword_create(keyword, __location__, name="EPS_HP", &
592 description=" Tolerance for accuracy checks on occupation numbers "// &
593 "calculated using hair-probes. ", &
594 usage="EPS_HP <REAL>", &
595 default_r_val=1.0e-5_dp)
596 CALL section_add_keyword(section, keyword)
597 CALL keyword_release(keyword)
598 END SUBROUTINE create_hairy_probes_section
599!####################################################################################
600
601! **************************************************************************************************
602!> \brief Implicit Solvation Model
603!> \param section ...
604!> \author tlaino
605! **************************************************************************************************
606 SUBROUTINE create_implicit_solv_section(section)
607 TYPE(section_type), POINTER :: section
608
609 TYPE(keyword_type), POINTER :: keyword
610 TYPE(section_type), POINTER :: print_key, subsection
611
612 NULLIFY (keyword, subsection, print_key)
613 cpassert(.NOT. ASSOCIATED(section))
614 CALL section_create(section, __location__, name="SCRF", &
615 description="Adds an implicit solvation model to the DFT calculation."// &
616 " Know also as Self Consistent Reaction Field.", &
617 n_keywords=0, n_subsections=0, repeats=.false.)
618
619 CALL keyword_create(keyword, __location__, name="EPS_OUT", &
620 description="Value of the dielectric constant outside the sphere", &
621 usage="EPS_OUT <REAL>", &
622 default_r_val=1.0_dp)
623 CALL section_add_keyword(section, keyword)
624 CALL keyword_release(keyword)
625
626 CALL keyword_create(keyword, __location__, name="LMAX", &
627 description="Maximum value of L used in the multipole expansion", &
628 usage="LMAX <INTEGER>", &
629 default_i_val=3)
630 CALL section_add_keyword(section, keyword)
631 CALL keyword_release(keyword)
632
633 CALL create_sphere_section(subsection)
634 CALL section_add_subsection(section, subsection)
635 CALL section_release(subsection)
636
637 CALL cp_print_key_section_create(print_key, __location__, "program_run_info", &
638 description="Controls the printing basic info about the method", &
639 print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
640 CALL section_add_subsection(section, print_key)
641 CALL section_release(print_key)
642
643 END SUBROUTINE create_implicit_solv_section
644
645! **************************************************************************************************
646!> \brief Create Sphere cavity
647!> \param section ...
648!> \author tlaino
649! **************************************************************************************************
650 SUBROUTINE create_sphere_section(section)
651 TYPE(section_type), POINTER :: section
652
653 TYPE(keyword_type), POINTER :: keyword
654 TYPE(section_type), POINTER :: subsection
655
656 NULLIFY (keyword, subsection)
657 cpassert(.NOT. ASSOCIATED(section))
658 CALL section_create(section, __location__, name="SPHERE", &
659 description="Treats the implicit solvent environment like a sphere", &
660 n_keywords=0, n_subsections=0, repeats=.false.)
661
662 CALL keyword_create(keyword, __location__, name="RADIUS", &
663 description="Value of the spherical cavity in the dielectric medium", &
664 usage="RADIUS <REAL>", &
665 unit_str="angstrom", &
666 type_of_var=real_t)
667 CALL section_add_keyword(section, keyword)
668 CALL keyword_release(keyword)
669
670 CALL create_center_section(subsection)
671 CALL section_add_subsection(section, subsection)
672 CALL section_release(subsection)
673
674 END SUBROUTINE create_sphere_section
675
676! **************************************************************************************************
677!> \brief ...
678!> \param section ...
679!> \author tlaino
680! **************************************************************************************************
681 SUBROUTINE create_center_section(section)
682 TYPE(section_type), POINTER :: section
683
684 TYPE(keyword_type), POINTER :: keyword
685
686 NULLIFY (keyword)
687 cpassert(.NOT. ASSOCIATED(section))
688 CALL section_create(section, __location__, name="CENTER", &
689 description="Defines the center of the sphere.", &
690 n_keywords=0, n_subsections=0, repeats=.false.)
691 CALL keyword_create(keyword, __location__, name="XYZ", &
692 description="Coordinates of the center of the sphere", &
693 usage="XYZ <REAL> <REAL> <REAL>", &
694 unit_str="angstrom", &
695 type_of_var=real_t, n_var=3)
696 CALL section_add_keyword(section, keyword)
697 CALL keyword_release(keyword)
698
699 CALL keyword_create(keyword, __location__, name="ATOM_LIST", &
700 description="Defines a list of atoms to define the center of the sphere", &
701 usage="ATOM_LIST <INTEGER> .. <INTEGER>", &
702 type_of_var=integer_t, n_var=-1)
703 CALL section_add_keyword(section, keyword)
704 CALL keyword_release(keyword)
705
706 CALL keyword_create(keyword, __location__, name="WEIGHT_TYPE", &
707 description="Defines the weight used to define the center of the sphere"// &
708 " (if ATOM_LIST is provided)", &
709 usage="WEIGHT_TYPE (UNIT|MASS)", &
710 enum_c_vals=["UNIT", "MASS"], &
711 enum_i_vals=[weight_type_unit, weight_type_mass], &
712 default_i_val=weight_type_unit)
713 CALL section_add_keyword(section, keyword)
714 CALL keyword_release(keyword)
715
716 CALL keyword_create(keyword, __location__, name="FIXED", &
717 description="Specify if the center of the sphere should be fixed or"// &
718 " allowed to move", &
719 usage="FIXED <LOGICAL>", &
720 default_l_val=.true.)
721 CALL section_add_keyword(section, keyword)
722 CALL keyword_release(keyword)
723
724 END SUBROUTINE create_center_section
725
726! **************************************************************************************************
727!> \brief ...
728!> \param section ...
729! **************************************************************************************************
730 SUBROUTINE create_admm_section(section)
731 TYPE(section_type), POINTER :: section
732
733 TYPE(keyword_type), POINTER :: keyword
734
735 NULLIFY (keyword)
736 cpassert(.NOT. ASSOCIATED(section))
737 CALL section_create(section, __location__, name="AUXILIARY_DENSITY_MATRIX_METHOD", &
738 description="Controls the auxiliary density matrix method (ADMM), which evaluates "// &
739 "Hartree-Fock exchange on a smaller auxiliary basis and adds an exchange correction.", &
740 n_keywords=1, n_subsections=1, repeats=.false., &
741 citations=[guidon2010])
742
743 CALL keyword_create( &
744 keyword, __location__, &
745 name="ADMM_TYPE", &
746 description="Named ADMM variant from the literature. This shortcut sets METHOD, "// &
747 "ADMM_PURIFICATION_METHOD, and EXCH_SCALING_MODEL consistently for the selected variant.", &
748 enum_c_vals=s2a("NONE", "ADMM1", "ADMM2", "ADMMS", "ADMMP", "ADMMQ"), &
749 enum_desc=s2a("No short name is used, use specific definitions (default)", &
750 "ADMM1 method from Guidon2010", &
751 "ADMM2 method from Guidon2010", &
752 "ADMMS method from Merlot2014", &
753 "ADMMP method from Merlot2014", &
754 "ADMMQ method from Merlot2014"), &
756 default_i_val=no_admm_type, &
757 citations=[guidon2010, merlot2014])
758 CALL section_add_keyword(section, keyword)
759 CALL keyword_release(keyword)
760
761 CALL keyword_create( &
762 keyword, __location__, &
763 name="ADMM_PURIFICATION_METHOD", &
764 description="Method that shall be used for wavefunction fitting. Use MO_DIAG for MD.", &
765 enum_c_vals=s2a("NONE", "CAUCHY", "CAUCHY_SUBSPACE", "MO_DIAG", "MO_NO_DIAG", "MCWEENY", "NONE_DM"), &
769 enum_desc=s2a("Do not apply any purification", &
770 "Perform purification via general Cauchy representation", &
771 "Perform purification via Cauchy representation in occupied subspace", &
772 "Calculate MO derivatives via Cauchy representation by diagonalization", &
773 "Calculate MO derivatives via Cauchy representation by inversion", &
774 "Perform original McWeeny purification via matrix multiplications", &
775 "Do not apply any purification, works directly with density matrix"), &
776 default_i_val=do_admm_purify_mo_diag)
777 CALL section_add_keyword(section, keyword)
778 CALL keyword_release(keyword)
779
780 CALL keyword_create( &
781 keyword, __location__, &
782 name="METHOD", &
783 description="Method that shall be used for wavefunction fitting. Use BASIS_PROJECTION for MD.", &
784 enum_c_vals=s2a("BASIS_PROJECTION", "BLOCKED_PROJECTION_PURIFY_FULL", "BLOCKED_PROJECTION", &
785 "CHARGE_CONSTRAINED_PROJECTION"), &
788 enum_desc=s2a("Construct auxiliary density matrix from auxiliary basis.", &
789 "Construct auxiliary density from a blocked Fock matrix,"// &
790 " but use the original matrix for purification.", &
791 "Construct auxiliary density from a blocked Fock matrix.", &
792 "Construct auxiliary density from auxiliary basis enforcing charge constrain."), &
793 default_i_val=do_admm_basis_projection)
794 CALL section_add_keyword(section, keyword)
795 CALL keyword_release(keyword)
796
797 CALL keyword_create( &
798 keyword, __location__, &
799 name="EXCH_SCALING_MODEL", &
800 description="Scaling of the exchange correction calculated by the auxiliary density matrix.", &
801 enum_c_vals=s2a("NONE", "MERLOT"), &
803 enum_desc=s2a("No scaling is enabled, refers to methods ADMM1, ADMM2 or ADMMQ.", &
804 "Exchange scaling according to Merlot (2014)"), &
805 default_i_val=do_admm_exch_scaling_none)
806 CALL section_add_keyword(section, keyword)
807 CALL keyword_release(keyword)
808
809 CALL keyword_create( &
810 keyword, __location__, &
811 name="EXCH_CORRECTION_FUNC", &
812 description="Exchange functional used for the ADMM correction. It should be chosen consistently "// &
813 "with the exchange functional in the main XC setup. LibXC implementations require linking with LibXC.", &
814 enum_c_vals=s2a("DEFAULT", "PBEX", "NONE", "OPTX", "BECKE88X", &
815 "PBEX_LIBXC", "BECKE88X_LIBXC", "OPTX_LIBXC", "DEFAULT_LIBXC", "LDA_X_LIBXC"), &
821 enum_desc=s2a("Use PBE-based corrections according to the chosen interaction operator.", &
822 "Use PBEX functional for exchange correction.", &
823 "No correction: X(D)-x(d)-> 0.", &
824 "Use OPTX functional for exchange correction.", &
825 "Use Becke88X functional for exchange correction.", &
826 "Use PBEX functional (LibXC implementation) for exchange correction.", &
827 "Use Becke88X functional (LibXC implementation) for exchange correction.", &
828 "Use OPTX functional (LibXC implementation) for exchange correction.", &
829 "Use PBE-based corrections (LibXC where possible) to the chosen interaction operator.", &
830 "Use Slater X functional (LibXC where possible) for exchange correction."), &
831 default_i_val=do_admm_aux_exch_func_default)
832 CALL section_add_keyword(section, keyword)
833 CALL keyword_release(keyword)
834
835 CALL keyword_create(keyword, __location__, name="optx_a1", &
836 description="OPTX a1 coefficient", &
837 default_r_val=1.05151_dp)
838 CALL section_add_keyword(section, keyword)
839 CALL keyword_release(keyword)
840 CALL keyword_create(keyword, __location__, name="optx_a2", &
841 description="OPTX a2 coefficient", &
842 default_r_val=1.43169_dp)
843 CALL section_add_keyword(section, keyword)
844 CALL keyword_release(keyword)
845 CALL keyword_create(keyword, __location__, name="optx_gamma", &
846 description="OPTX gamma coefficient", &
847 default_r_val=0.006_dp)
848 CALL section_add_keyword(section, keyword)
849 CALL keyword_release(keyword)
850
851 CALL keyword_create(keyword, __location__, name="BLOCK_LIST", &
852 description="Specifies a list of atoms.", &
853 usage="BLOCK_LIST {integer} {integer} .. {integer}", &
854 n_var=-1, type_of_var=integer_t, repeats=.true.)
855 CALL section_add_keyword(section, keyword)
856 CALL keyword_release(keyword)
857
858 CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
859 description="Define accuracy of DBCSR operations", &
860 usage="EPS_FILTER", default_r_val=0.0_dp)
861 CALL section_add_keyword(section, keyword)
862 CALL keyword_release(keyword)
863
864 END SUBROUTINE create_admm_section
865
866! **************************************************************************************************
867!> \brief ...
868!> \param section ...
869! **************************************************************************************************
870 SUBROUTINE create_density_fitting_section(section)
871 TYPE(section_type), POINTER :: section
872
873 TYPE(keyword_type), POINTER :: keyword
874 TYPE(section_type), POINTER :: print_key
875
876 NULLIFY (keyword, print_key)
877 cpassert(.NOT. ASSOCIATED(section))
878 CALL section_create(section, __location__, name="DENSITY_FITTING", &
879 description="Setup parameters for density fitting (Bloechl charges or density derived "// &
880 "atomic point charges (DDAPC) charges)", &
881 n_keywords=7, n_subsections=0, repeats=.false., &
882 citations=[blochl1995])
883
884 CALL keyword_create(keyword, __location__, name="NUM_GAUSS", &
885 description="Specifies the numbers of gaussian used to fit the QM density for each atomic site.", &
886 usage="NUM_GAUSS {integer}", &
887 n_var=1, type_of_var=integer_t, default_i_val=3)
888 CALL section_add_keyword(section, keyword)
889 CALL keyword_release(keyword)
890
891 CALL keyword_create(keyword, __location__, name="PFACTOR", &
892 description="Specifies the progression factor for the gaussian exponent for each atomic site.", &
893 usage="PFACTOR {real}", &
894 n_var=1, type_of_var=real_t, default_r_val=1.5_dp)
895 CALL section_add_keyword(section, keyword)
896 CALL keyword_release(keyword)
897
898 CALL keyword_create(keyword, __location__, name="MIN_RADIUS", &
899 description="Specifies the smallest radius of the gaussian used in the fit. All other radius are"// &
900 " obtained with the progression factor.", &
901 usage="MIN_RADIUS {real}", &
902 unit_str="angstrom", n_var=1, type_of_var=real_t, default_r_val=0.5_dp)
903 CALL section_add_keyword(section, keyword)
904 CALL keyword_release(keyword)
905
906 CALL keyword_create(keyword, __location__, name="RADII", &
907 description="Specifies all the radius of the gaussian used in the fit for each atomic site. The use"// &
908 " of this keyword disables all other keywords of this section.", &
909 usage="RADII {real} {real} .. {real}", &
910 unit_str="angstrom", n_var=-1, type_of_var=real_t)
911 CALL section_add_keyword(section, keyword)
912 CALL keyword_release(keyword)
913
914 CALL keyword_create(keyword, __location__, name="GCUT", &
915 description="Cutoff for charge fit in G-space.", &
916 usage="GCUT {real}", &
917 n_var=1, type_of_var=real_t, default_r_val=sqrt(6.0_dp))
918 CALL section_add_keyword(section, keyword)
919 CALL keyword_release(keyword)
920
921 CALL cp_print_key_section_create(print_key, __location__, "program_run_info", &
922 description="Controls the printing of basic information during the run", &
923 print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
924
925 CALL keyword_create(keyword, __location__, name="CONDITION_NUMBER", &
926 description="Prints information regarding the condition numbers of the A matrix (to be inverted)", &
927 usage="CONDITION_NUMBER <LOGICAL>", &
928 default_l_val=.false., lone_keyword_l_val=.true.)
929 CALL section_add_keyword(print_key, keyword)
930 CALL keyword_release(keyword)
931
932 CALL section_add_subsection(section, print_key)
933 CALL section_release(print_key)
934
935 END SUBROUTINE create_density_fitting_section
936
937! **************************************************************************************************
938!> \brief creates the input section for the relativistic part
939!> \param section the section to create
940!> \author jens
941! **************************************************************************************************
942 SUBROUTINE create_relativistic_section(section)
943 TYPE(section_type), POINTER :: section
944
945 TYPE(keyword_type), POINTER :: keyword
946
947 cpassert(.NOT. ASSOCIATED(section))
948 CALL section_create(section, __location__, name="relativistic", &
949 description="parameters needed and setup for relativistic calculations", &
950 n_keywords=5, n_subsections=0, repeats=.false.)
951
952 NULLIFY (keyword)
953
954 CALL keyword_create(keyword, __location__, name="method", &
955 description="type of relativistic correction used", &
956 usage="method (NONE|DKH|ZORA)", default_i_val=rel_none, &
957 enum_c_vals=s2a("NONE", "DKH", "ZORA"), &
958 enum_i_vals=[rel_none, rel_dkh, rel_zora], &
959 enum_desc=s2a("Use no relativistic correction", &
960 "Use Douglas-Kroll-Hess method", &
961 "Use ZORA method"))
962 CALL section_add_keyword(section, keyword)
963 CALL keyword_release(keyword)
964
965 CALL keyword_create(keyword, __location__, name="DKH_order", &
966 description="The order of the DKH transformation ", &
967 usage="DKH_order 2", default_i_val=2)
968 CALL section_add_keyword(section, keyword)
969 CALL keyword_release(keyword)
970
971 CALL keyword_create(keyword, __location__, name="ZORA_type", &
972 description="Type of ZORA method to be used", &
973 usage="ZORA_type scMP", default_i_val=rel_zora_full, &
974 enum_c_vals=s2a("FULL", "MP", "scMP"), &
975 enum_desc=s2a("Full ZORA method (not implemented)", &
976 "ZORA with atomic model potential", &
977 "Scaled ZORA with atomic model potential"), &
979 CALL section_add_keyword(section, keyword)
980 CALL keyword_release(keyword)
981
982 CALL keyword_create(keyword, __location__, name="transformation", &
983 description="Type of DKH transformation", &
984 usage="transformation (FULL|MOLECULE|ATOM)", default_i_val=rel_trans_atom, &
985 enum_c_vals=s2a("FULL", "MOLECULE", "ATOM"), &
987 enum_desc=s2a("Use full matrix transformation", &
988 "Use transformation blocked by molecule", &
989 "Use atomic blocks"))
990 CALL section_add_keyword(section, keyword)
991 CALL keyword_release(keyword)
992
993 CALL keyword_create(keyword, __location__, name="z_cutoff", &
994 description="The minimal atomic number considered for atom transformation", &
995 usage="z_cutoff 50", default_i_val=1)
996 CALL section_add_keyword(section, keyword)
997 CALL keyword_release(keyword)
998
999 CALL keyword_create(keyword, __location__, name="potential", &
1000 description="External potential used in DKH transformation, full 1/r or erfc(r)/r", &
1001 usage="POTENTIAL {FULL,ERFC}", default_i_val=rel_pot_erfc, &
1002 enum_c_vals=s2a("FULL", "ERFC"), &
1003 enum_i_vals=[rel_pot_full, rel_pot_erfc])
1004 CALL section_add_keyword(section, keyword)
1005 CALL keyword_release(keyword)
1006
1007 END SUBROUTINE create_relativistic_section
1008
1009! **************************************************************************************************
1010!> \brief creates the KG section
1011!> \param section ...
1012!> \author Martin Haeufel [2012.07]
1013! **************************************************************************************************
1014 SUBROUTINE create_kg_section(section)
1015 TYPE(section_type), POINTER :: section
1016
1017 TYPE(keyword_type), POINTER :: keyword
1018 TYPE(section_type), POINTER :: print_key, subsection
1019
1020 cpassert(.NOT. ASSOCIATED(section))
1021 CALL section_create(section, __location__, name="KG_METHOD", &
1022 description="Specifies the parameters for a Kim-Gordon-like partitioning"// &
1023 " into molecular subunits", &
1024 n_keywords=0, n_subsections=1, repeats=.false., &
1026
1027 NULLIFY (keyword, subsection, print_key)
1028
1029 ! add a XC section
1030 CALL create_xc_section(subsection)
1031 CALL section_add_subsection(section, subsection)
1032 CALL section_release(subsection)
1033
1034 ! add LRI section
1035 CALL create_lrigpw_section(subsection)
1036 CALL section_add_subsection(section, subsection)
1037 CALL section_release(subsection)
1038
1039 CALL keyword_create(keyword, __location__, name="COLORING_METHOD", &
1040 description="Which algorithm to use for coloring.", &
1041 usage="COLORING_METHOD GREEDY", &
1042 default_i_val=kg_color_dsatur, &
1043 enum_c_vals=s2a("DSATUR", "GREEDY"), &
1044 enum_desc=s2a("Maximum degree of saturation, relatively accurate", &
1045 "Greedy, fast coloring, less accurate"), &
1046 enum_i_vals=[kg_color_dsatur, kg_color_greedy])
1047 CALL section_add_keyword(section, keyword)
1048 CALL keyword_release(keyword)
1049
1050 CALL keyword_create(keyword, __location__, name="TNADD_METHOD", &
1051 description="Algorithm to use for the calculation of the nonadditive kinetic energy.", &
1052 usage="TNADD_METHOD ATOMIC", &
1053 default_i_val=kg_tnadd_embed, &
1054 enum_c_vals=s2a("EMBEDDING", "RI_EMBEDDING", "ATOMIC", "NONE"), &
1055 enum_desc=s2a("Use full embedding potential (see Iannuzzi et al)", &
1056 "Use full embedding potential with RI density fitting", &
1057 "Use sum of atomic model potentials", &
1058 "Do not use kinetic energy embedding"), &
1060 CALL section_add_keyword(section, keyword)
1061 CALL keyword_release(keyword)
1062
1063 CALL keyword_create(keyword, __location__, name="INTEGRATION_GRID", &
1064 description="Grid [small,medium,large,huge]to be used for the TNADD integration.", &
1065 usage="INTEGRATION_GRID MEDIUM", &
1066 default_c_val="MEDIUM")
1067 CALL section_add_keyword(section, keyword)
1068 CALL keyword_release(keyword)
1069
1070 CALL section_create(subsection, __location__, name="PRINT", &
1071 description="Print section", &
1072 n_keywords=0, n_subsections=1, repeats=.false.)
1073
1074 CALL cp_print_key_section_create(print_key, __location__, "NEIGHBOR_LISTS", &
1075 description="Controls the printing of the neighbor lists.", &
1076 print_level=low_print_level, filename="__STD_OUT__", unit_str="angstrom")
1077
1078 CALL keyword_create(keyword, __location__, &
1079 name="SAB_ORB_FULL", &
1080 description="Activates the printing of the full orbital "// &
1081 "orbital neighbor lists.", &
1082 default_l_val=.false., &
1083 lone_keyword_l_val=.true.)
1084 CALL section_add_keyword(print_key, keyword)
1085 CALL keyword_release(keyword)
1086
1087 CALL keyword_create(keyword, __location__, &
1088 name="SAB_ORB_MOLECULAR", &
1089 description="Activates the printing of the orbital "// &
1090 "orbital neighbor lists for molecular subsets.", &
1091 default_l_val=.false., &
1092 lone_keyword_l_val=.true.)
1093 CALL section_add_keyword(print_key, keyword)
1094 CALL keyword_release(keyword)
1095
1096 CALL keyword_create(keyword, __location__, &
1097 name="SAC_KIN", &
1098 description="Activates the printing of the orbital "// &
1099 "atomic potential neighbor list.", &
1100 default_l_val=.false., &
1101 lone_keyword_l_val=.true.)
1102 CALL section_add_keyword(print_key, keyword)
1103 CALL keyword_release(keyword)
1104
1105 CALL section_add_subsection(subsection, print_key)
1106 CALL section_release(print_key)
1107
1108 CALL section_add_subsection(section, subsection)
1109 CALL section_release(subsection)
1110
1111 END SUBROUTINE create_kg_section
1112
1113! **************************************************************************************************
1114!> \brief Create the BSSE section for counterpoise correction
1115!> \param section the section to create
1116!> \author teo
1117! **************************************************************************************************
1118 SUBROUTINE create_bsse_section(section)
1119 TYPE(section_type), POINTER :: section
1120
1121 TYPE(keyword_type), POINTER :: keyword
1122 TYPE(section_type), POINTER :: subsection
1123
1124 cpassert(.NOT. ASSOCIATED(section))
1125 CALL section_create(section, __location__, name="BSSE", &
1126 description="This section is used to set up the BSSE calculation. "// &
1127 "It also requires that for each atomic kind X a kind X_ghost is present, "// &
1128 "with the GHOST keyword specified, in addition to the other required fields.", &
1129 n_keywords=3, n_subsections=1, repeats=.false.)
1130
1131 NULLIFY (keyword, subsection)
1132 ! FRAGMENT SECTION
1133 CALL section_create(subsection, __location__, name="FRAGMENT", &
1134 description="Specify the atom number belonging to this fragment.", &
1135 n_keywords=2, n_subsections=0, repeats=.true.)
1136
1137 CALL keyword_create(keyword, __location__, name="LIST", &
1138 description="Specifies a list of atoms.", &
1139 usage="LIST {integer} {integer} .. {integer}", &
1140 repeats=.true., n_var=-1, type_of_var=integer_t)
1141 CALL section_add_keyword(subsection, keyword)
1142 CALL keyword_release(keyword)
1143
1144 CALL section_add_subsection(section, subsection)
1145 CALL section_release(subsection)
1146
1147 ! CONFIGURATION SECTION
1148 CALL section_create(subsection, __location__, name="CONFIGURATION", &
1149 description="Specify additional parameters for the combinatorial configurations. "// &
1150 "Use this section to manually specify charge and multiplicity of the fragments "// &
1151 "and their combinations.", &
1152 n_keywords=2, n_subsections=0, repeats=.true.)
1153
1154 CALL keyword_create(keyword, __location__, name="GLB_CONF", &
1155 description="Specifies the global configuration using 1 or 0 for each fragment. "// &
1156 "1 specifies the respective fragment as used, 0 as unused.", &
1157 usage="GLB_CONF {integer} {integer} .. {integer}", &
1158 n_var=-1, type_of_var=integer_t)
1159 CALL section_add_keyword(subsection, keyword)
1160 CALL keyword_release(keyword)
1161
1162 CALL keyword_create(keyword, __location__, name="SUB_CONF", &
1163 description="Specifies the subconfiguration using 1 or 0 belonging to the global configuration. "// &
1164 "1 specifies the respective fragment as real, 0 as ghost.", &
1165 usage="SUB_CONF {integer} {integer} .. {integer}", &
1166 n_var=-1, type_of_var=integer_t)
1167 CALL section_add_keyword(subsection, keyword)
1168 CALL keyword_release(keyword)
1169
1170 CALL keyword_create(keyword, __location__, &
1171 name="MULTIPLICITY", &
1172 variants=["MULTIP"], &
1173 description="Specify for each fragment the multiplicity. Two times the total spin plus one. "// &
1174 "Specify 3 for a triplet, 4 for a quartet,and so on. Default is 1 (singlet) for an "// &
1175 "even number and 2 (doublet) for an odd number of electrons.", &
1176 usage="MULTIPLICITY 3", &
1177 default_i_val=0) ! this default value is just a flag to get the above
1178 CALL section_add_keyword(subsection, keyword)
1179 CALL keyword_release(keyword)
1180
1181 CALL keyword_create(keyword, __location__, name="CHARGE", &
1182 description="The total charge for each fragment.", &
1183 usage="CHARGE -1", &
1184 default_i_val=0)
1185 CALL section_add_keyword(subsection, keyword)
1186 CALL keyword_release(keyword)
1187 CALL section_add_subsection(section, subsection)
1188 CALL section_release(subsection)
1189
1190 CALL section_create(subsection, __location__, name="FRAGMENT_ENERGIES", &
1191 description="This section contains the energies of the fragments already"// &
1192 " computed. It is useful as a summary and specifically for restarting BSSE runs.", &
1193 n_keywords=2, n_subsections=0, repeats=.true.)
1194 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
1195 description="The energy computed for each fragment", repeats=.true., &
1196 usage="{REAL}", type_of_var=real_t)
1197 CALL section_add_keyword(subsection, keyword)
1198 CALL keyword_release(keyword)
1199 CALL section_add_subsection(section, subsection)
1200 CALL section_release(subsection)
1201
1202 CALL create_print_bsse_section(subsection)
1203 CALL section_add_subsection(section, subsection)
1204 CALL section_release(subsection)
1205
1206 END SUBROUTINE create_bsse_section
1207
1208! **************************************************************************************************
1209!> \brief Create the print bsse section
1210!> \param section the section to create
1211!> \author teo
1212! **************************************************************************************************
1213 SUBROUTINE create_print_bsse_section(section)
1214 TYPE(section_type), POINTER :: section
1215
1216 TYPE(section_type), POINTER :: print_key
1217
1218 cpassert(.NOT. ASSOCIATED(section))
1219 CALL section_create(section, __location__, name="print", &
1220 description="Section of possible print options in BSSE code.", &
1221 n_keywords=0, n_subsections=1, repeats=.false.)
1222
1223 NULLIFY (print_key)
1224 CALL cp_print_key_section_create(print_key, __location__, "PROGRAM_RUN_INFO", &
1225 description="Controls the printing of information regarding the run.", &
1226 print_level=low_print_level, filename="__STD_OUT__")
1227 CALL section_add_subsection(section, print_key)
1228 CALL section_release(print_key)
1229
1230 CALL cp_print_key_section_create(print_key, __location__, "RESTART", &
1231 description="Controls the dumping of the restart file during BSSE runs. "// &
1232 "By default the restart is updated after each configuration calculation is "// &
1233 "completed.", &
1234 print_level=silent_print_level, common_iter_levels=0, &
1235 add_last=add_last_numeric, filename="")
1236 CALL section_add_subsection(section, print_key)
1237 CALL section_release(print_key)
1238
1239 END SUBROUTINE create_print_bsse_section
1240
1241! **************************************************************************************************
1242!> \brief input section for optional parameters for RIGPW
1243!> \param section the section to create
1244!> \author JGH [06.2017]
1245! **************************************************************************************************
1246 SUBROUTINE create_rigpw_section(section)
1247 TYPE(section_type), POINTER :: section
1248
1249 cpassert(.NOT. ASSOCIATED(section))
1250 CALL section_create(section, __location__, name="RIGPW", &
1251 description="This section specifies optional parameters for RIGPW.", &
1252 n_keywords=1, n_subsections=0, repeats=.false.)
1253
1254! CALL keyword_create(keyword, __LOCATION__, name="RI_OVERLAP_MATRIX", &
1255! description="Specifies whether to calculate the inverse or the "// &
1256! "pseudoinverse of the overlap matrix of the auxiliary "// &
1257! "basis set. Calculating the pseudoinverse is necessary "// &
1258! "for very large auxiliary basis sets, but more expensive. "// &
1259! "Using the pseudoinverse, consistent forces are not "// &
1260! "guaranteed yet.", &
1261! usage="RI_OVERLAP_MATRIX INVERSE", &
1262! enum_c_vals=s2a("INVERSE", "PSEUDO_INVERSE_SVD", "PSEUDO_INVERSE_DIAG", &
1263! "AUTOSELECT"), &
1264! enum_desc=s2a("Calculate inverse of the overlap matrix.", &
1265! "Calculate the pseuodinverse of the overlap matrix "// &
1266! "using singular value decomposition.", &
1267! "Calculate the pseudoinverse of the overlap matrix "// &
1268! "by prior diagonalization.", &
1269! "Choose automatically for each pair whether to "// &
1270! "calculate the inverse or pseudoinverse based on the "// &
1271! "condition number of the overlap matrix for each pair. "// &
1272! "Calculating the pseudoinverse is much more expensive."), &
1273! enum_i_vals=(/do_lri_inv, do_lri_pseudoinv_svd, &
1274! do_lri_pseudoinv_diag, do_lri_inv_auto/), &
1275! default_i_val=do_lri_inv)
1276! CALL section_add_keyword(section, keyword)
1277! CALL keyword_release(keyword)
1278
1279 END SUBROUTINE create_rigpw_section
1280
1281! **************************************************************************************************
1282!> \brief creates the multigrid
1283!> \param section input section to create
1284!> \param create_subsections indicates whether or not subsections INTERPOLATOR and RS_GRID
1285!> should be created
1286!> \author fawzi
1287! **************************************************************************************************
1288 SUBROUTINE create_mgrid_section(section, create_subsections)
1289 TYPE(section_type), POINTER :: section
1290 LOGICAL, INTENT(in) :: create_subsections
1291
1292 TYPE(keyword_type), POINTER :: keyword
1293 TYPE(section_type), POINTER :: subsection
1294
1295 cpassert(.NOT. ASSOCIATED(section))
1296 CALL section_create(section, __location__, name="mgrid", &
1297 description="Controls the multigrid used by GPW/GAPW to represent densities, "// &
1298 "potentials, and Gaussian products on real-space grids.", &
1299 n_keywords=5, n_subsections=1, repeats=.false.)
1300 NULLIFY (keyword)
1301 CALL keyword_create(keyword, __location__, name="NGRIDS", &
1302 description="Number of multigrid levels. Smooth Gaussian products can be mapped to "// &
1303 "coarser levels, while sharper products require finer levels.", &
1304 usage="ngrids 1", default_i_val=4)
1305 CALL section_add_keyword(section, keyword)
1306 CALL keyword_release(keyword)
1307
1308 CALL keyword_create(keyword, __location__, name="cutoff", &
1309 description= &
1310 "Plane-wave cutoff of the finest real-space grid level. "// &
1311 "Increasing this value improves the grid representation, but it is "// &
1312 "not a substitute for converging the Gaussian basis set. "// &
1313 "Default value for SE or DFTB calculation is 1.0 [Ry].", &
1314 usage="cutoff 300", &
1315 default_r_val=cp_unit_to_cp2k(value=280.0_dp, unit_str="Ry"), &
1316 n_var=1, unit_str="Ry")
1317 CALL section_add_keyword(section, keyword)
1318 CALL keyword_release(keyword)
1319
1320 CALL keyword_create(keyword, __location__, name="progression_factor", &
1321 description="Factor used to derive the cutoff of coarser multigrid levels when "// &
1322 "they are not given explicitly.", &
1323 usage="progression_factor <integer>", default_r_val=3._dp)
1324 CALL section_add_keyword(section, keyword)
1325 CALL keyword_release(keyword)
1326
1327 CALL keyword_create(keyword, __location__, name="commensurate", &
1328 description="If the grids should be commensurate. If true overrides "// &
1329 "the progression factor and the cutoffs of the sub grids", &
1330 usage="commensurate", default_l_val=.false., &
1331 lone_keyword_l_val=.true.)
1332 CALL section_add_keyword(section, keyword)
1333 CALL keyword_release(keyword)
1334
1335 CALL keyword_create(keyword, __location__, name="realspace", &
1336 description="If both rho and rho_gspace are needed ", &
1337 usage="realspace", default_l_val=.false., &
1338 lone_keyword_l_val=.true.)
1339 CALL section_add_keyword(section, keyword)
1340 CALL keyword_release(keyword)
1341
1342 CALL keyword_create(keyword, __location__, name="REL_CUTOFF", &
1343 variants=["RELATIVE_CUTOFF"], &
1344 description="Controls to which multigrid level a Gaussian product is mapped. "// &
1345 "It is the reference cutoff for a Gaussian with exponent alpha=1. Larger values "// &
1346 "keep more Gaussian products on finer grids and can be important for accurate "// &
1347 "energies, forces, stress tensors, and variable-cell simulations.", &
1348 usage="RELATIVE_CUTOFF real", default_r_val=20.0_dp, &
1349 unit_str="Ry")
1350 CALL section_add_keyword(section, keyword)
1351 CALL keyword_release(keyword)
1352
1353 CALL keyword_create(keyword, __location__, name="MULTIGRID_SET", &
1354 description="Activate a manual setting of the multigrids", &
1355 usage="MULTIGRID_SET", default_l_val=.false.)
1356 CALL section_add_keyword(section, keyword)
1357 CALL keyword_release(keyword)
1358
1359 CALL keyword_create(keyword, __location__, &
1360 name="SKIP_LOAD_BALANCE_DISTRIBUTED", &
1361 description="Skips load balancing on distributed multigrids. "// &
1362 "Memory usage is O(p) so may be used "// &
1363 "for all but the very largest runs.", &
1364 usage="SKIP_LOAD_BALANCE_DISTRIBUTED", &
1365 default_l_val=.false., &
1366 lone_keyword_l_val=.true.)
1367! CALL keyword_create(keyword, __LOCATION__, name="SKIP_LOAD_BALANCE_DISTRIBUTED",&
1368! description="Skip load balancing on distributed multigrids, which might be memory intensive."//&
1369! "If not explicitly specified, runs using more than 1024 MPI tasks will default to .TRUE.",&
1370! usage="SKIP_LOAD_BALANCE_DISTRIBUTED", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1371
1372 CALL section_add_keyword(section, keyword)
1373 CALL keyword_release(keyword)
1374
1375 CALL keyword_create(keyword, __location__, name="MULTIGRID_CUTOFF", &
1376 variants=["CUTOFF_LIST"], &
1377 description="List of cutoff values to set up multigrids manually", &
1378 usage="MULTIGRID_CUTOFF 200.0 100.0 ", &
1379 n_var=-1, &
1380 type_of_var=real_t, &
1381 unit_str="Ry")
1382 CALL section_add_keyword(section, keyword)
1383 CALL keyword_release(keyword)
1384
1385 IF (create_subsections) THEN
1386 NULLIFY (subsection)
1387 CALL create_rsgrid_section(subsection)
1388 CALL section_add_subsection(section, subsection)
1389 CALL section_release(subsection)
1390
1391 NULLIFY (subsection)
1392 CALL create_interp_section(subsection)
1393 CALL section_add_subsection(section, subsection)
1394 CALL section_release(subsection)
1395 END IF
1396 END SUBROUTINE create_mgrid_section
1397
1398! **************************************************************************************************
1399!> \brief creates the interpolation section
1400!> \param section ...
1401!> \author tlaino
1402! **************************************************************************************************
1403 SUBROUTINE create_interp_section(section)
1404 TYPE(section_type), POINTER :: section
1405
1406 TYPE(keyword_type), POINTER :: keyword
1407 TYPE(section_type), POINTER :: print_key
1408
1409 cpassert(.NOT. ASSOCIATED(section))
1410 CALL section_create(section, __location__, name="interpolator", &
1411 description="kind of interpolation used between the multigrids", &
1412 n_keywords=5, n_subsections=0, repeats=.false.)
1413
1414 NULLIFY (keyword, print_key)
1415
1416 CALL keyword_create(keyword, __location__, name="kind", &
1417 description="The interpolator to use. SPLINE3 automatically enables commensurate grids.", &
1418 usage="kind spline3", &
1419 default_i_val=pw_interp, &
1420 enum_c_vals=s2a("pw", "spline3"), &
1421 enum_i_vals=[pw_interp, spline3_pbc_interp])
1422 CALL section_add_keyword(section, keyword)
1423 CALL keyword_release(keyword)
1424
1425 CALL keyword_create(keyword, __location__, name="safe_computation", &
1426 description="if a non unrolled calculation is to be performed in parallel", &
1427 usage="safe_computation OFF", &
1428 default_l_val=.false., &
1429 lone_keyword_l_val=.true.)
1430 CALL section_add_keyword(section, keyword)
1431 CALL keyword_release(keyword)
1432
1433 CALL keyword_create(keyword, __location__, name="aint_precond", &
1434 description="the approximate inverse to use to get the starting point"// &
1435 " for the linear solver of the spline3 methods", &
1436 usage="aint_precond copy", &
1437 default_i_val=precond_spl3_aint, &
1438 enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_aint2", &
1439 "spl3_nopbc_precond1", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
1442 CALL section_add_keyword(section, keyword)
1443 CALL keyword_release(keyword)
1444
1445 CALL keyword_create(keyword, __location__, name="precond", &
1446 description="The preconditioner used"// &
1447 " for the linear solver of the spline3 methods", &
1448 usage="PRECOND copy", &
1449 default_i_val=precond_spl3_3, &
1450 enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_aint2", &
1451 "spl3_nopbc_precond1", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
1454 CALL section_add_keyword(section, keyword)
1455 CALL keyword_release(keyword)
1456
1457 CALL keyword_create(keyword, __location__, name="eps_x", &
1458 description="accuracy on the solution for spline3 the interpolators", &
1459 usage="eps_x 1.e-15", default_r_val=1.e-10_dp)
1460 CALL section_add_keyword(section, keyword)
1461 CALL keyword_release(keyword)
1462
1463 CALL keyword_create(keyword, __location__, name="eps_r", &
1464 description="accuracy on the residual for spline3 the interpolators", &
1465 usage="eps_r 1.e-15", default_r_val=1.e-10_dp)
1466 CALL section_add_keyword(section, keyword)
1467 CALL keyword_release(keyword)
1468
1469 CALL keyword_create(keyword, __location__, name="max_iter", &
1470 variants=['maxiter'], &
1471 description="the maximum number of iterations", &
1472 usage="max_iter 200", default_i_val=100)
1473 CALL section_add_keyword(section, keyword)
1474 CALL keyword_release(keyword)
1475
1476 NULLIFY (print_key)
1477 CALL cp_print_key_section_create(print_key, __location__, "conv_info", &
1478 description="if convergence information about the linear solver"// &
1479 " of the spline methods should be printed", &
1480 print_level=medium_print_level, each_iter_names=s2a("SPLINE_FIND_COEFFS"), &
1481 each_iter_values=[10], filename="__STD_OUT__", &
1482 add_last=add_last_numeric)
1483 CALL section_add_subsection(section, print_key)
1484 CALL section_release(print_key)
1485
1486 END SUBROUTINE create_interp_section
1487
1488! **************************************************************************************************
1489!> \brief creates the sic (self interaction correction) section
1490!> \param section ...
1491!> \author fawzi
1492! **************************************************************************************************
1493 SUBROUTINE create_sic_section(section)
1494 TYPE(section_type), POINTER :: section
1495
1496 TYPE(keyword_type), POINTER :: keyword
1497
1498 cpassert(.NOT. ASSOCIATED(section))
1499 CALL section_create(section, __location__, name="sic", &
1500 description="parameters for the self interaction correction", &
1501 n_keywords=6, n_subsections=0, repeats=.false., &
1503
1504 NULLIFY (keyword)
1505
1506 CALL keyword_create(keyword, __location__, name="SIC_SCALING_A", &
1507 description="Scaling of the coulomb term in sic [experimental]", &
1508 usage="SIC_SCALING_A 0.5", &
1509 citations=[vandevondele2005b], &
1510 default_r_val=1.0_dp)
1511 CALL section_add_keyword(section, keyword)
1512 CALL keyword_release(keyword)
1513
1514 CALL keyword_create(keyword, __location__, name="SIC_SCALING_B", &
1515 description="Scaling of the xc term in sic [experimental]", &
1516 usage="SIC_SCALING_B 0.5", &
1517 citations=[vandevondele2005b], &
1518 default_r_val=1.0_dp)
1519 CALL section_add_keyword(section, keyword)
1520 CALL keyword_release(keyword)
1521
1522 CALL keyword_create(keyword, __location__, name="SIC_METHOD", &
1523 description="Method used to remove the self interaction", &
1524 usage="SIC_METHOD MAURI_US", &
1525 default_i_val=sic_none, &
1526 enum_c_vals=s2a("NONE", "MAURI_US", "MAURI_SPZ", "AD", "EXPLICIT_ORBITALS"), &
1527 enum_i_vals=[sic_none, sic_mauri_us, sic_mauri_spz, sic_ad, sic_eo], &
1528 enum_desc=s2a("Do not apply a sic correction", &
1529 "Employ a (scaled) correction proposed by Mauri and co-workers"// &
1530 " on the spin density / doublet unpaired orbital", &
1531 "Employ a (scaled) Perdew-Zunger expression"// &
1532 " on the spin density / doublet unpaired orbital", &
1533 "The average density correction", &
1534 "(scaled) Perdew-Zunger correction explicitly on a set of orbitals."), &
1536 CALL section_add_keyword(section, keyword)
1537 CALL keyword_release(keyword)
1538
1539 CALL keyword_create(keyword, __location__, name="ORBITAL_SET", &
1540 description="Type of orbitals treated with the SIC", &
1541 usage="ORBITAL_SET ALL", &
1542 default_i_val=sic_list_unpaired, &
1543 enum_c_vals=s2a("UNPAIRED", "ALL"), &
1544 enum_desc=s2a("correction for the unpaired orbitals only, requires a restricted open shell calculation", &
1545 "correction for all orbitals, requires a LSD or ROKS calculation"), &
1546 enum_i_vals=[sic_list_unpaired, sic_list_all])
1547 CALL section_add_keyword(section, keyword)
1548 CALL keyword_release(keyword)
1549
1550 END SUBROUTINE create_sic_section
1551
1552! **************************************************************************************************
1553!> \brief creates the low spin roks section
1554!> \param section ...
1555!> \author Joost VandeVondele
1556! **************************************************************************************************
1557 SUBROUTINE create_low_spin_roks_section(section)
1558 TYPE(section_type), POINTER :: section
1559
1560 TYPE(keyword_type), POINTER :: keyword
1561
1562 cpassert(.NOT. ASSOCIATED(section))
1563 CALL section_create(section, __location__, name="LOW_SPIN_ROKS", &
1564 description="Specify the details of the low spin ROKS method. "// &
1565 "In particular, one can specify various terms added to the energy of the high spin roks configuration"// &
1566 " with an energy scaling factor, and a prescription of the spin state. "// &
1567 "With METHOD GAPW, energies and orbital derivatives are supported for LDA/GGA, "// &
1568 "hybrids (without ADMM), tau-dependent meta-GGAs, and molecular GauXC/Skala. "// &
1569 "Nuclear forces, analytical stress, and native-grid Skala are not supported with GAPW. "// &
1570 "The GauXC path requires isolated all-electron calculations with HOST execution.", &
1571 n_keywords=6, n_subsections=0, repeats=.false.)
1572
1573 NULLIFY (keyword)
1574 CALL keyword_create(keyword, __location__, name="ENERGY_SCALING", &
1575 description="The scaling factors for each term added to the total energy. "// &
1576 "This list should contain one number for each term added to the total energy.", &
1577 usage="ENERGY_SCALING 1.0 -1.0 ", &
1578 n_var=-1, type_of_var=real_t, repeats=.false.)
1579 CALL section_add_keyword(section, keyword)
1580 CALL keyword_release(keyword)
1581 CALL keyword_create( &
1582 keyword, __location__, name="SPIN_CONFIGURATION", &
1583 description="For each singly occupied orbital, specify if this should be an alpha (=1) or a beta (=2) orbital. "// &
1584 "This keyword should be repeated, each repetition corresponding to an additional term.", &
1585 usage="SPIN_CONFIGURATION 1 2", &
1586 n_var=-1, type_of_var=integer_t, repeats=.true.)
1587 CALL section_add_keyword(section, keyword)
1588 CALL keyword_release(keyword)
1589
1590 END SUBROUTINE create_low_spin_roks_section
1591
1592! **************************************************************************************************
1593!> \brief ...
1594!> \param section ...
1595! **************************************************************************************************
1596 SUBROUTINE create_rtp_section(section)
1597 TYPE(section_type), POINTER :: section
1598
1599 TYPE(keyword_type), POINTER :: keyword
1600 TYPE(section_type), POINTER :: print_key, print_section, subsection
1601
1602 NULLIFY (keyword)
1603 cpassert(.NOT. ASSOCIATED(section))
1604 CALL section_create(section, __location__, name="REAL_TIME_PROPAGATION", &
1605 description="Parameters needed to set up the real time propagation"// &
1606 " for the electron dynamics. This currently works only in the NVE ensemble.", &
1607 n_keywords=4, n_subsections=4, repeats=.false., &
1608 citations=[kunert2003, andermatt2016, mattiat2022])
1609
1610 CALL keyword_create(keyword, __location__, name="MAX_ITER", &
1611 description="Maximal number of iterations for the self consistent propagator loop.", &
1612 usage="MAX_ITER 10", &
1613 default_i_val=10)
1614 CALL section_add_keyword(section, keyword)
1615 CALL keyword_release(keyword)
1616
1617 CALL keyword_create(keyword, __location__, name="EPS_ITER", &
1618 description="Convergence criterion for the self consistent propagator loop.", &
1619 usage="EPS_ITER 1.0E-5", &
1620 default_r_val=1.0e-7_dp)
1621 CALL section_add_keyword(section, keyword)
1622 CALL keyword_release(keyword)
1623
1624 CALL keyword_create(keyword, __location__, name="ASPC_ORDER", &
1625 description="Speciefies how many steps will be used for extrapolation. "// &
1626 "One will be always used which is means X(t+dt)=X(t)", &
1627 usage="ASPC_ORDER 3", &
1628 default_i_val=3)
1629 CALL section_add_keyword(section, keyword)
1630 CALL keyword_release(keyword)
1631
1632 CALL keyword_create(keyword, __location__, name="MAT_EXP", &
1633 description="Which method should be used to calculate the exponential"// &
1634 " in the propagator. It is recommended to use BCH when employing density_propagation "// &
1635 "and ARNOLDI otherwise.", &
1636 usage="MAT_EXP TAYLOR", default_i_val=do_arnoldi, &
1637 enum_c_vals=s2a("TAYLOR", "PADE", "ARNOLDI", "BCH", "EXACT"), &
1638 enum_i_vals=[do_taylor, do_pade, do_arnoldi, do_bch, do_exact], &
1639 enum_desc=s2a("exponential is evaluated using scaling and squaring in combination"// &
1640 " with a taylor expansion of the exponential.", &
1641 "uses scaling and squaring together with the pade approximation", &
1642 "uses arnoldi subspace algorithm to compute exp(H)*MO directly, can't be used in "// &
1643 "combination with Crank Nicholson or density propagation", &
1644 "Uses a Baker-Campbell-Hausdorff expansion to propagate the density matrix,"// &
1645 " only works for density propagation", &
1646 "Uses diagonalisation of the exponent matrices to determine the "// &
1647 "matrix exponential exactly. Only implemented for GWBSE."))
1648 CALL section_add_keyword(section, keyword)
1649 CALL keyword_release(keyword)
1650
1651 CALL keyword_create(keyword, __location__, name="DENSITY_PROPAGATION", &
1652 description="The density matrix is propagated instead of the molecular orbitals. "// &
1653 "This can allow a linear scaling simulation. The density matrix is filtered with "// &
1654 "the threshold based on the EPS_FILTER keyword from the LS_SCF section", &
1655 usage="DENSITY_PROPAGATION .TRUE.", &
1656 default_l_val=.false., lone_keyword_l_val=.true.)
1657 CALL section_add_keyword(section, keyword)
1658 CALL keyword_release(keyword)
1659
1660 CALL keyword_create(keyword, __location__, name="SC_CHECK_START", &
1661 description="Speciefies how many iteration steps will be done without "// &
1662 "a check for self consistency. Can save some time in big calculations.", &
1663 usage="SC_CHECK_START 3", &
1664 default_i_val=0)
1665 CALL section_add_keyword(section, keyword)
1666 CALL keyword_release(keyword)
1667
1668 CALL keyword_create(keyword, __location__, name="EXP_ACCURACY", &
1669 description="Accuracy for the taylor and pade approximation. "// &
1670 "This is only an upper bound bound since the norm used for the guess "// &
1671 "is an upper bound for the needed one.", &
1672 usage="EXP_ACCURACY 1.0E-6", &
1673 default_r_val=1.0e-9_dp)
1674 CALL section_add_keyword(section, keyword)
1675 CALL keyword_release(keyword)
1676
1677 CALL keyword_create(keyword, __location__, name="PROPAGATOR", &
1678 description="Which propagator should be used for the orbitals", &
1679 usage="PROPAGATOR ETRS", default_i_val=do_etrs, &
1680 enum_c_vals=s2a("ETRS", "CN", "EM"), &
1681 enum_i_vals=[do_etrs, do_cn, do_em], &
1682 enum_desc=s2a("enforced time reversible symmetry", &
1683 "Crank Nicholson propagator", &
1684 "Exponential midpoint propagator"))
1685 CALL section_add_keyword(section, keyword)
1686 CALL keyword_release(keyword)
1687
1688 CALL keyword_create(keyword, __location__, name="INITIAL_WFN", &
1689 description="Controls the initial WFN used for propagation. "// &
1690 "Note that some energy contributions may not be "// &
1691 "initialized in the restart cases, for instance "// &
1692 "electronic entropy energy in the case of smearing.", &
1693 usage="INITIAL_WFN SCF_WFN", default_i_val=use_scf_wfn, &
1694 enum_c_vals=s2a("SCF_WFN", "RESTART_WFN", "RT_RESTART"), &
1695 enum_i_vals=[use_scf_wfn, use_restart_wfn, use_rt_restart], &
1696 enum_desc=s2a("An SCF run is performed to get the initial state.", &
1697 "A wavefunction from a previous SCF is propagated. Especially useful,"// &
1698 " if electronic constraints or restraints are used in the previous calculation, "// &
1699 "since these do not work in the rtp scheme.", &
1700 "use the wavefunction of a real time propagation/ehrenfest run"))
1701 CALL section_add_keyword(section, keyword)
1702 CALL keyword_release(keyword)
1703
1704 CALL keyword_create(keyword, __location__, name="APPLY_WFN_MIX_INIT_RESTART", &
1705 description="If set to True and in the case of INITIAL_WFN=RESTART_WFN, call the "// &
1706 "DFT%PRINT%WFN_MIX section to mix the read initial wfn. The starting wave-function of the "// &
1707 "RTP will be the mixed one. Setting this to True without a defined WFN_MIX section will "// &
1708 "not do anything as defining a WFN_MIX section without this keyword for RTP run with "// &
1709 "INITIAL_WFN=RESTART_WFN. Note that if INITIAL_WFN=SCF_WFN, this keyword is not needed to "// &
1710 "apply the mixing defined in the WFN_MIX section. Default is False.", &
1711 usage="APPLY_WFN_MIX_INIT_RESTART", &
1712 default_l_val=.false., lone_keyword_l_val=.true.)
1713 CALL section_add_keyword(section, keyword)
1714 CALL keyword_release(keyword)
1715
1716 CALL keyword_create(keyword, __location__, name="APPLY_DELTA_PULSE", &
1717 description="Applies a delta kick to the initial wfn (only RTP for now - the EMD"// &
1718 " case is not yet implemented). Only work for INITIAL_WFN=SCF_WFN", &
1719 usage="APPLY_DELTA_PULSE", &
1720 default_l_val=.false., lone_keyword_l_val=.true.)
1721 CALL section_add_keyword(section, keyword)
1722 CALL keyword_release(keyword)
1723
1724 CALL keyword_create(keyword, __location__, name="APPLY_DELTA_PULSE_MAG", &
1725 description="Applies a magnetic delta kick to the initial wfn (only RTP for now - the EMD"// &
1726 " case is not yet implemented). Only work for INITIAL_WFN=SCF_WFN", &
1727 usage="APPLY_DELTA_PULSE_MAG", &
1728 default_l_val=.false., lone_keyword_l_val=.true.)
1729 CALL section_add_keyword(section, keyword)
1730 CALL keyword_release(keyword)
1731
1732 CALL keyword_create(keyword, __location__, name="VELOCITY_GAUGE", &
1733 description="Perform propagation in the velocity gauge using the explicit vector potential"// &
1734 " only a constant vector potential as of now (corresonding to a delta-pulse)."// &
1735 " uses DELTA_PULSE_SCALE and DELTA_PULSE_DIRECTION to define the vector potential", &
1736 usage="VELOCITY_GAUGE T", &
1737 default_l_val=.false., lone_keyword_l_val=.true.)
1738 CALL section_add_keyword(section, keyword)
1739 CALL keyword_release(keyword)
1740
1741 CALL keyword_create(keyword, __location__, name="GAUGE_ORIG", &
1742 description="Define gauge origin for magnetic perturbation", &
1743 usage="GAUGE_ORIG COM", &
1744 enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1745 enum_desc=s2a("Use Center of Mass", &
1746 "Use Center of Atomic Charges", &
1747 "Use User Defined Point (Keyword:REF_POINT)", &
1748 "Use Origin of Coordinate System"), &
1749 enum_i_vals=[use_mom_ref_com, &
1753 default_i_val=use_mom_ref_com)
1754 CALL section_add_keyword(section, keyword)
1755 CALL keyword_release(keyword)
1756
1757 CALL keyword_create(keyword, __location__, name="GAUGE_ORIG_MANUAL", &
1758 description="Manually defined gauge origin for magnetic perturbation [in Bohr!]", &
1759 usage="GAUGE_ORIG_MANUAL x y z", &
1760 repeats=.false., &
1761 n_var=3, default_r_vals=[0._dp, 0._dp, 0._dp], &
1762 type_of_var=real_t, &
1763 unit_str='bohr')
1764 CALL section_add_keyword(section, keyword)
1765 CALL keyword_release(keyword)
1766
1767 CALL keyword_create(keyword, __location__, name="VG_COM_NL", &
1768 description="apply gauge transformed non-local potential term"// &
1769 " only affects VELOCITY_GAUGE=.TRUE.", &
1770 usage="VG_COM_NL T", &
1771 default_l_val=.true., lone_keyword_l_val=.true.)
1772 CALL section_add_keyword(section, keyword)
1773 CALL keyword_release(keyword)
1774
1775 CALL keyword_create(keyword, __location__, name="COM_NL", &
1776 description="Include non-local commutator for periodic delta pulse."// &
1777 " only affects PERIODIC=.TRUE.", &
1778 usage="COM_NL", &
1779 default_l_val=.true., lone_keyword_l_val=.true.)
1780 CALL section_add_keyword(section, keyword)
1781 CALL keyword_release(keyword)
1782
1783 CALL keyword_create(keyword, __location__, name="LEN_REP", &
1784 description="Use length representation delta pulse (in conjunction with PERIODIC T)."// &
1785 " This corresponds to a 1st order perturbation in the length gauge."// &
1786 " Note that this is NOT compatible with a periodic calculation!"// &
1787 " Uses the reference point defined in DFT%PRINT%MOMENTS ", &
1788 usage="LEN_REP T", &
1789 default_l_val=.false., lone_keyword_l_val=.true.)
1790 CALL section_add_keyword(section, keyword)
1791 CALL keyword_release(keyword)
1792
1793 CALL keyword_create(keyword, __location__, name="PERIODIC", &
1794 description="Apply a delta-kick that is compatible with periodic boundary conditions"// &
1795 " for any value of DELTA_PULSE_SCALE. Uses perturbation theory for the preparation of"// &
1796 " the initial wfn with the velocity operator as perturbation."// &
1797 " If LEN_REP is .FALSE. this corresponds to a first order velocity gauge."// &
1798 " Note that the pulse is only applied when INITIAL_WFN is set to SCF_WFN,"// &
1799 " and not for restarts (RT_RESTART).", &
1800 usage="PERIODIC", &
1801 default_l_val=.true., lone_keyword_l_val=.true.)
1802 CALL section_add_keyword(section, keyword)
1803 CALL keyword_release(keyword)
1804
1805 CALL keyword_create(keyword, __location__, name="LOCALIZE", &
1806 description="Localise the Molecular orbitals each n steps "// &
1807 "real-time propagated TDDFT, 0 means never localise", &
1808 usage="LOCALIZE", default_i_val=0)
1809 CALL section_add_keyword(section, keyword)
1810 CALL keyword_release(keyword)
1811
1812 CALL keyword_create(keyword, __location__, name="DELTA_PULSE_DIRECTION", &
1813 description="Direction of the applied electric field. The k vector is given as"// &
1814 " 2*Pi*[i,j,k]*inv(h_mat), which for PERIODIC .FALSE. yields exp(ikr) periodic with"// &
1815 " the unit cell, only if DELTA_PULSE_SCALE is set to unity. For an orthorhombic cell"// &
1816 " [1,0,0] yields [2*Pi/L_x,0,0]. For small cells, this results in a very large kick.", &
1817 usage="DELTA_PULSE_DIRECTION 1 1 1", n_var=3, default_i_vals=[1, 0, 0], &
1818 type_of_var=integer_t)
1819 CALL section_add_keyword(section, keyword)
1820 CALL keyword_release(keyword)
1821
1822 CALL keyword_create(keyword, __location__, name="DELTA_PULSE_SCALE", &
1823 description="Scale the k vector, which for PERIODIC .FALSE. results in exp(ikr) no"// &
1824 " longer being periodic with the unit cell. The norm of k is the strength of the"// &
1825 " applied electric field in atomic units.", &
1826 usage="DELTA_PULSE_SCALE 0.01 ", n_var=1, default_r_val=0.001_dp)
1827 CALL section_add_keyword(section, keyword)
1828 CALL keyword_release(keyword)
1829
1830 CALL keyword_create(keyword, __location__, name="HFX_BALANCE_IN_CORE", &
1831 description="If HFX is used, this keyword forces a redistribution/recalculation"// &
1832 " of the integrals, balanced with respect to the in core steps.", &
1833 usage="HFX_BALANCE_IN_CORE", &
1834 default_l_val=.false., lone_keyword_l_val=.true.)
1835 CALL section_add_keyword(section, keyword)
1836 CALL keyword_release(keyword)
1837
1838 CALL keyword_create(keyword, __location__, name="MCWEENY_MAX_ITER", &
1839 description="Determines the maximum amount of McWeeny steps used after each converged"// &
1840 " step in density propagation", &
1841 usage="MCWEENY_MAX_ITER 2", default_i_val=1)
1842 CALL section_add_keyword(section, keyword)
1843 CALL keyword_release(keyword)
1844
1845 CALL keyword_create( &
1846 keyword, __location__, name="ACCURACY_REFINEMENT", &
1847 description="If using density propagation some parts should be calculated with a higher accuracy than the rest"// &
1848 " to reduce numerical noise. This factor determines by how much the filtering threshold is"// &
1849 " reduced for these calculations.", &
1850 usage="ACCURACY_REFINEMENT", default_i_val=100)
1851 CALL section_add_keyword(section, keyword)
1852 CALL keyword_release(keyword)
1853
1854 CALL keyword_create(keyword, __location__, name="MCWEENY_EPS", &
1855 description="Threshold after which McWeeny is terminated", &
1856 usage="MCWEENY_EPS 0.00001", &
1857 default_r_val=0.0_dp)
1858 CALL section_add_keyword(section, keyword)
1859 CALL keyword_release(keyword)
1860
1861 NULLIFY (print_section)
1862 CALL section_create(print_section, __location__, name="PRINT", &
1863 description="Section of possible print options for an RTP runs", &
1864 repeats=.false.)
1865
1866 NULLIFY (print_key)
1867 CALL cp_print_key_section_create(print_key, __location__, "PROGRAM_RUN_INFO", &
1868 description="Controls the printing within real time propagation and Eherenfest dynamics", &
1869 print_level=low_print_level, filename="__STD_OUT__")
1870 CALL section_add_subsection(print_section, print_key)
1871 CALL section_release(print_key)
1872
1873 CALL cp_print_key_section_create(print_key, __location__, "RESTART", &
1874 description="Controls the dumping of the latest wavefunction restart "// &
1875 "file during rtp. In density propagation this controls the printing "// &
1876 "of density matrix. See also RESTART_HISTORY.", &
1877 print_level=low_print_level, common_iter_levels=3, &
1878 each_iter_names=s2a("MD"), each_iter_values=[20], &
1879 add_last=add_last_numeric, filename="RESTART", do_backup=.true.)
1880 CALL section_add_subsection(print_section, print_key)
1881 CALL section_release(print_key)
1882
1883 CALL cp_print_key_section_create(print_key, __location__, "RESTART_HISTORY", &
1884 description="Dumps unique wavefunction restart files during the run, "// &
1885 "keeping all of them. In density propagation it dumps the density "// &
1886 "matrix instead. For the latest wavefunction restart file, see RESTART.", &
1887 print_level=low_print_level, common_iter_levels=0, &
1888 each_iter_names=s2a("MD"), &
1889 each_iter_values=[500], &
1890 filename="RESTART", do_backup=.true.)
1891 CALL section_add_subsection(print_section, print_key)
1892 CALL section_release(print_key)
1893
1894 CALL cp_print_key_section_create(print_key, __location__, "FIELD", &
1895 description="Print the time-dependent field applied during an EMD simulation in "// &
1896 "atomic unit.", &
1897 print_level=high_print_level, common_iter_levels=1, &
1898 each_iter_names=s2a("MD"), &
1899 each_iter_values=[1], &
1900 filename="FIELD")
1901 CALL section_add_subsection(print_section, print_key)
1902 CALL section_release(print_key)
1903
1904 CALL create_projection_rtp_section(print_key)
1905 CALL section_add_subsection(print_section, print_key)
1906 CALL section_release(print_key)
1907
1908 CALL cp_print_key_section_create(print_key, __location__, "CURRENT_INT", &
1909 description="Print the integral of the current density (only if the"// &
1910 " imaginary part of the density is NOT zero).", &
1911 print_level=high_print_level, common_iter_levels=1, &
1912 each_iter_names=s2a("MD"), &
1913 each_iter_values=[1], &
1914 filename="rtp_j_int")
1915 CALL section_add_subsection(print_section, print_key)
1916 CALL section_release(print_key)
1917
1918 CALL cp_print_key_section_create(print_key, __location__, "CURRENT", &
1919 description="Print the current during an EMD simulation to cube files.", &
1920 print_level=high_print_level, common_iter_levels=0, &
1921 each_iter_names=s2a("MD"), &
1922 each_iter_values=[20], &
1923 filename="current", do_backup=.true.)
1924 CALL keyword_create(keyword, __location__, name="STRIDE", &
1925 description="The stride (X,Y,Z) used to write the cube file "// &
1926 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1927 " 1 number valid for all components.", &
1928 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1929 CALL section_add_keyword(print_key, keyword)
1930 CALL keyword_release(keyword)
1931
1932 CALL section_add_subsection(print_section, print_key)
1933 CALL section_release(print_key)
1934
1935 ! Marek : Add print option for ASCII density files - DEVELPMENT ONLY?
1936 CALL cp_print_key_section_create(print_key, __location__, "DENSITY_MATRIX", &
1937 description="Prints the density matrix at iterations in clear text to a file", &
1938 print_level=high_print_level, common_iter_levels=0, &
1939 each_iter_names=s2a("MD"), &
1940 each_iter_values=[1], &
1941 filename="rho")
1942 CALL section_add_subsection(print_section, print_key)
1943 CALL section_release(print_key)
1944 ! Marek : Moments ASCII print
1945 CALL cp_print_key_section_create(print_key, __location__, "MOMENTS", &
1946 description="Prints the time-dependent electronic moments at "// &
1947 "iterations in clear text to a file.", &
1948 print_level=high_print_level, common_iter_levels=1, &
1949 each_iter_names=s2a("MD"), &
1950 each_iter_values=[1], &
1951 filename="__STD_OUT__")
1952 CALL keyword_create(keyword, __location__, name="REFERENCE", &
1953 variants=s2a("REF"), &
1954 description="Define the reference point for the calculation of the electrostatic moment.", &
1955 usage="REFERENCE COM", &
1956 enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1957 enum_desc=s2a("Use Center of Mass", &
1958 "Use Center of Atomic Charges", &
1959 "Use User Defined Point (Keyword:REFERENCE_POINT)", &
1960 "Use Origin of Coordinate System"), &
1961 enum_i_vals=[use_mom_ref_com, &
1965 default_i_val=use_mom_ref_coac)
1966 CALL section_add_keyword(print_key, keyword)
1967 CALL keyword_release(keyword)
1968
1969 CALL keyword_create(keyword, __location__, name="REFERENCE_POINT", &
1970 variants=s2a("REF_POINT"), &
1971 description="Fixed reference point for the calculations of the electrostatic moment.", &
1972 usage="REFERENCE_POINT x y z", &
1973 repeats=.false., &
1974 n_var=3, default_r_vals=[0._dp, 0._dp, 0._dp], &
1975 type_of_var=real_t, &
1976 unit_str='angstrom')
1977 CALL section_add_keyword(print_key, keyword)
1978 CALL keyword_release(keyword)
1979 CALL section_add_subsection(print_section, print_key)
1980 CALL section_release(print_key)
1981 ! Marek : Fourier transform of MOMENTS ASCII print
1982 CALL cp_print_key_section_create(print_key, __location__, "MOMENTS_FT", &
1983 description="Prints the calculated Fourier transform of "// &
1984 "time-dependent moments. For calculations with real time pulse (not delta kick) "// &
1985 "can be supplied with starting time.", &
1986 print_level=medium_print_level, common_iter_levels=0, &
1987 each_iter_names=s2a("MD"), &
1988 each_iter_values=[1], &
1989 filename="MOMENTS_FT")
1990 CALL section_add_subsection(print_section, print_key)
1991 CALL section_release(print_key)
1992 ! Marek : Chosen element of (Fourier transformed) polarizability tensor (energy dependent) - text format
1993 CALL cp_print_key_section_create(print_key, __location__, "POLARIZABILITY", &
1994 description="Prints the chosen element of the energy dependent polarizability tensor "// &
1995 "to a specified file. The tensor is calculated as ratio of "// &
1996 "Fourier transform of the dipole "// &
1997 "moment trace and Fourier transform of the applied field "// &
1998 "(for delta kick, constant real field is applied.", &
1999 print_level=medium_print_level, common_iter_levels=0, &
2000 each_iter_names=s2a("MD"), &
2001 each_iter_values=[1], &
2002 filename="POLARIZABILITY")
2003 CALL keyword_create(keyword, __location__, "ELEMENT", &
2004 description="Specifies the element of polarizability which is to be printed out "// &
2005 "(indexing starts at 1). If not explicitly provided, RTBSE code tries to guess "// &
2006 "the optimal values - for applied electric field (both delta pulse and RT field) "// &
2007 "with only a single non-zero cartesian component, prints the 3 trivially available elements.", &
2008 type_of_var=integer_t, default_i_vals=[1, 1], n_var=2, usage="ELEMENT 1 1", repeats=.true.)
2009 CALL section_add_keyword(print_key, keyword)
2010 CALL keyword_release(keyword)
2011 CALL section_add_subsection(print_section, print_key)
2012 CALL section_release(print_key)
2013 ! Liouvillian eigenvalue diagnostic (linearized RT-BSE, TDA only)
2014 CALL cp_print_key_section_create(print_key, __location__, "LIOUVILLIAN_EIG", &
2015 description="Prints the eigenvalues of the linearized RT-BSE "// &
2016 "Liouvillian on the OV subspace, computed once at job init from a "// &
2017 "matrix-free probe of the kernel (no time propagation). In TDA this "// &
2018 "equals the Casida-A eigenvalue problem and gives a broadening-free, "// &
2019 "finite-time-free correctness check against bse_full.F. "// &
2020 "Activated by RTBSE%DIAGNOSE_LIOUVILLIAN_EIG. Output lists "// &
2021 "eigenvalues in atomic units and eV.", &
2022 print_level=medium_print_level, common_iter_levels=0, &
2023 each_iter_names=s2a("MD"), &
2024 each_iter_values=[1], &
2025 filename="LIOUVILLIAN_EIG")
2026 CALL section_add_subsection(print_section, print_key)
2027 CALL section_release(print_key)
2028
2029 CALL cp_print_key_section_create(print_key, __location__, "E_CONSTITUENTS", &
2030 description="Print the energy constituents (relevant to RTP) which make up "// &
2031 "the Total Energy", &
2032 print_level=high_print_level, common_iter_levels=1, &
2033 each_iter_names=s2a("MD"), &
2034 each_iter_values=[1], &
2035 filename="rtp")
2036 CALL section_add_subsection(print_section, print_key)
2037 CALL section_release(print_key)
2038
2039 CALL section_add_subsection(section, print_section)
2040 CALL section_release(print_section)
2041
2042 ! RTBSE subsection
2043 NULLIFY (subsection)
2044 CALL create_rtbse_section(subsection)
2045 CALL section_add_subsection(section, subsection)
2046 CALL section_release(subsection)
2047 ! FT subsection
2048 CALL create_ft_section(subsection)
2049 CALL section_add_subsection(section, subsection)
2050 CALL section_release(subsection)
2051
2052 END SUBROUTINE create_rtp_section
2053! **************************************************************************************************
2054!> \brief Creates the subsection for specialized options of RTBSE code
2055!> \param section The created RTBSE section
2056!> \author Stepan Marek
2057! **************************************************************************************************
2058 SUBROUTINE create_rtbse_section(section)
2059 TYPE(section_type), POINTER :: section
2060
2061 TYPE(keyword_type), POINTER :: keyword
2062
2063 NULLIFY (keyword)
2064 cpassert(.NOT. ASSOCIATED(section))
2065
2066 CALL section_create(section, __location__, name="RTBSE", &
2067 description="Controls options for the real-time Bethe-Salpeter (RTBSE) propagation. "// &
2068 "Note that running RTBSE requires previous low-scaling "// &
2069 "[GW](#CP2K_INPUT.FORCE_EVAL.PROPERTIES.BANDSTRUCTURE.GW) calculation. Also note that "// &
2070 "designating this section as RTBSE run but choosing run type ENERGY leads to potential "// &
2071 "deallocation errors. More details (including description of output files) is available in "// &
2072 "the [methods](../../../../methods/properties/optical/rtbse) section of the documentation.", &
2073 repeats=.false., citations=[marek2025])
2074
2075 ! Marek : Controlling flow to RTBSE
2076 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
2077 description="Which method is used for the time propagation of electronic structure. "// &
2078 "By default, use the TDDFT method. Can also choose RT-BSE method, which propagates the lesser "// &
2079 "Green's function instead of density matrix/molecular orbitals.", &
2080 usage="&RTBSE TDDFT", &
2081 default_i_val=rtp_method_tddft, &
2082 lone_keyword_i_val=rtp_method_bse, &
2083 enum_c_vals=s2a("TDDFT", "RTBSE"), &
2084 enum_i_vals=[rtp_method_tddft, rtp_method_bse], &
2085 enum_desc=s2a("Use TDDFT for density matrix/MO propagation.", &
2086 "Use RT-BSE for Green's function propagation"))
2087 CALL section_add_keyword(section, keyword)
2088 CALL keyword_release(keyword)
2089
2090 ! Marek : Development option - run GWBSE starting from the KS Hamiltonian
2091 CALL keyword_create(keyword, __location__, name="RTBSE_HAMILTONIAN", &
2092 description="Which Hamiltonian to use as the single-particle Hamiltonian"// &
2093 " in the Green's propagator.", &
2094 usage="RTBSE_HAMILTONIAN GW", &
2095 default_i_val=rtp_bse_ham_gw, &
2096 enum_c_vals=s2a("KS", "GW"), &
2097 enum_i_vals=[rtp_bse_ham_ks, rtp_bse_ham_gw], &
2098 enum_desc=s2a("Use Kohn-Sham Hamiltonian for Green's function propagation.", &
2099 "Use GW Hamiltonian for Green's function propagation. The GW "// &
2100 "eigenvalues from the highest-level GW flavor will be picked."))
2101 CALL section_add_keyword(section, keyword)
2102 CALL keyword_release(keyword)
2103
2104 ! Switch for linearized rtbse propagation
2105 CALL keyword_create(keyword, __location__, name="LINEARIZED_BSE_PROPAGATION", &
2106 variants=s2a("LRRTBSE"), &
2107 description="Linearizes the BSE propagation", &
2108 usage="LINEARIZED_BSE_PROPAGATION .T.", &
2109 default_l_val=.false., &
2110 lone_keyword_l_val=.true.)
2111 CALL section_add_keyword(section, keyword)
2112 CALL keyword_release(keyword)
2113
2114 ! Energy cutoff (occupied) for active MO window in linearized RT-BSE
2115 CALL keyword_create(keyword, __location__, name="ENERGY_CUTOFF_OCC", &
2116 description="Energy cutoff (relative to HOMO) defining the lowest "// &
2117 "occupied molecular orbital included in the active MO window of the "// &
2118 "linearized RT-BSE propagation. Only used when "// &
2119 "LINEARIZED_BSE_PROPAGATION=.TRUE.. A non-positive value disables the "// &
2120 "occupied truncation.", &
2121 usage="ENERGY_CUTOFF_OCC 5.0", &
2122 unit_str="eV", &
2123 default_r_val=-1.0_dp/evolt)
2124 CALL section_add_keyword(section, keyword)
2125 CALL keyword_release(keyword)
2126
2127 ! Energy cutoff (empty) for active MO window in linearized RT-BSE
2128 CALL keyword_create(keyword, __location__, name="ENERGY_CUTOFF_EMPTY", &
2129 description="Energy cutoff (relative to LUMO) defining the highest "// &
2130 "virtual molecular orbital included in the active MO window of the "// &
2131 "linearized RT-BSE propagation. Only used when "// &
2132 "LINEARIZED_BSE_PROPAGATION=.TRUE.. A non-positive value disables the "// &
2133 "virtual truncation.", &
2134 usage="ENERGY_CUTOFF_EMPTY 5.0", &
2135 unit_str="eV", &
2136 default_r_val=-1.0_dp/evolt)
2137 CALL section_add_keyword(section, keyword)
2138 CALL keyword_release(keyword)
2139
2140 CALL keyword_create(keyword, __location__, name="ENFORCE_MAX_DT", &
2141 description="For linearized RT-BSE, recompute TIMESTEP and STEPS so the same total "// &
2142 "propagation time is covered with the largest timestep that does not exceed the "// &
2143 "estimated RK4 stability limit.", &
2144 usage="ENFORCE_MAX_DT", &
2145 default_l_val=.false., &
2146 lone_keyword_l_val=.true.)
2147 CALL section_add_keyword(section, keyword)
2148 CALL keyword_release(keyword)
2149
2150 ! Tamm-Dancoff approximation for the linearized RT-BSE kernel
2151 CALL keyword_create(keyword, __location__, name="TDA", &
2152 description="Apply the Tamm-Dancoff approximation to the linearized RT-BSE kernel: "// &
2153 "the Hartree and screened-exchange contributions are restricted so that the OV and VO "// &
2154 "blocks of the density response remain decoupled (i.e. only A-block coupling is kept, "// &
2155 "B-block coupling is dropped). Only effective when "// &
2156 "LINEARIZED_BSE_PROPAGATION=.TRUE..", &
2157 usage="TDA", &
2158 default_l_val=.false., &
2159 lone_keyword_l_val=.true.)
2160 CALL section_add_keyword(section, keyword)
2161 CALL keyword_release(keyword)
2162
2163 ! First-peak shift for the TDA path
2164 CALL keyword_create(keyword, __location__, name="TDA_SHIFT_TO_FIRST_PEAK", &
2165 description="For the linearized RT-BSE TDA path, shift the active-MO single-particle "// &
2166 "diagonals by +Omega_0/2 (occupied) and -Omega_0/2 (virtual) with "// &
2167 "Omega_0 = eps_min_ai, so the lowest active OV mode oscillates at zero frequency "// &
2168 "in the rotating frame (RK4-exact for peak 1). omega_max becomes the full active "// &
2169 "OV width Delta = eps_max_ai - eps_min_ai. The rotation is undone at I/O so "// &
2170 "observables remain in the lab frame. Only effective when TDA=.TRUE.. "// &
2171 "Use with caution, additional convergence checks w.r.t. dt needed.", &
2172 usage="TDA_SHIFT_TO_FIRST_PEAK", &
2173 default_l_val=.false., &
2174 lone_keyword_l_val=.true.)
2175 CALL section_add_keyword(section, keyword)
2176 CALL keyword_release(keyword)
2177
2178 CALL keyword_create(keyword, __location__, name="DEBUG_DISABLE_HARTREE", &
2179 description="Debug option for linearized RT-BSE: disables the Hartree kernel in both "// &
2180 "the static reference initialization and the propagation. The Coulomb RI setup is "// &
2181 "still built so the run stays internally consistent.", &
2182 usage="DEBUG_DISABLE_HARTREE", &
2183 default_l_val=.false., &
2184 lone_keyword_l_val=.true.)
2185 CALL section_add_keyword(section, keyword)
2186 CALL keyword_release(keyword)
2187
2188 CALL keyword_create(keyword, __location__, name="KERNEL_RI", &
2189 description="Select the RI framework used to evaluate the linearized RT-BSE "// &
2190 "Hartree and screened-exchange kernels (propagation and reference). "// &
2191 "DEFAULT infers from the GW flavor: RI-RS if the GW_RI_RS section was active, "// &
2192 "AO-RI otherwise. RS/AO force that framework regardless of how GW was run. The "// &
2193 "RI-RS grid (mat_phi_mu_l, mat_Z_lP) and the V_grid/W0_grid kernels are built on "// &
2194 "demand. RI-RS is implemented for linearized RT-BSE only; for full RT-BSE an "// &
2195 "explicit RS is overridden to AO with a warning.", &
2196 usage="KERNEL_RI RS", &
2197 enum_c_vals=s2a("DEFAULT", "RS", "AO"), &
2199 enum_desc=s2a("Infer from the GW flavor (GW_RI_RS active -> RS, else AO).", &
2200 "Real-space RI grid kernels (linearized RT-BSE only).", &
2201 "AO-RI kernels."), &
2202 default_i_val=rtp_bse_kernel_ri_default, n_var=1)
2203 CALL section_add_keyword(section, keyword)
2204 CALL keyword_release(keyword)
2205
2206 CALL keyword_create(keyword, __location__, name="DEBUG_DISABLE_SEX", &
2207 description="Debug option for linearized RT-BSE: disables the screened-exchange kernel "// &
2208 "in both the static reference initialization and the propagation.", &
2209 usage="DEBUG_DISABLE_SEX", &
2210 default_l_val=.false., &
2211 lone_keyword_l_val=.true.)
2212 CALL section_add_keyword(section, keyword)
2213 CALL keyword_release(keyword)
2214
2215 ! Liouvillian eigenvalue diagnostic (matrix-free probe at init; TDA + ABBA)
2216 CALL keyword_create(keyword, __location__, name="DIAGNOSE_LIOUVILLIAN_EIG", &
2217 description="Diagnostic for linearized RT-BSE: at job initialization, build the "// &
2218 "Liouvillian on the OV subspace by probing the kernel routine with canonical OV basis "// &
2219 "vectors, then diagonalize. In TDA this equals the Casida-A eigenvalue problem, giving a "// &
2220 "broadening-free, finite-time-free correctness check against bse_full.F. "// &
2221 "In ABBA it builds and diagonalizes the full coupled (A, B) Liouvillian via the "// &
2222 "Furche reduction. "// &
2223 "Output is controlled by the LIOUVILLIAN_EIG print key in the parent "// &
2224 "&REAL_TIME_PROPAGATION%&PRINT section.", &
2225 usage="DIAGNOSE_LIOUVILLIAN_EIG", &
2226 default_l_val=.false., &
2227 lone_keyword_l_val=.true.)
2228 CALL section_add_keyword(section, keyword)
2229 CALL keyword_release(keyword)
2230
2231 CALL keyword_create(keyword, __location__, name="EPS_FILTER_RHO", &
2232 description="RI-RS linearized RT-BSE: block-filter threshold on the propagated "// &
2233 "response density Delta-rho (AO). Applied upstream of the projection the "// &
2234 "Hartree shares, so it cuts the SEX kernel and the Hartree response alike. "// &
2235 "Absolute, so its strength is the ratio to the Delta-rho scale.", &
2236 usage="EPS_FILTER_RHO 1.0E-6", &
2237 default_r_val=-1.0_dp)
2238 CALL section_add_keyword(section, keyword)
2239 CALL keyword_release(keyword)
2240
2241 CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS_W0", &
2242 description="RI-RS linearized RT-BSE: real-space truncation radius for the "// &
2243 "grid-basis screened interaction W0. Grid block pairs whose centroids lie "// &
2244 "further apart are dropped at build, and the per-step SEX grid transient is "// &
2245 "built into the same pattern. Affects the BSE kernel only, not the GW "// &
2246 "quasiparticle energies and not the Hartree response. Requires a "// &
2247 "non-periodic cell. Zero or negative disables the truncation.", &
2248 usage="CUTOFF_RADIUS_W0 30.0", &
2249 default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2250 type_of_var=real_t, unit_str="angstrom")
2251 CALL section_add_keyword(section, keyword)
2252 CALL keyword_release(keyword)
2253
2254 END SUBROUTINE create_rtbse_section
2255! **************************************************************************************************
2256!> \brief Creates the subsection for Fourier transform options applicable to RTP output
2257!> \param ft_section The created FT section
2258!> \date 11.2025
2259!> \author Stepan Marek
2260! **************************************************************************************************
2261 SUBROUTINE create_ft_section(ft_section)
2262 TYPE(section_type), POINTER :: ft_section
2263
2264 TYPE(keyword_type), POINTER :: keyword
2265 TYPE(section_type), POINTER :: subsection
2266
2267 cpassert(.NOT. ASSOCIATED(ft_section))
2268
2269 ! Create the section itself
2270 CALL section_create(ft_section, __location__, &
2271 name="FT", &
2272 description="Define parameters for Fourier transforms used in RTP outputs.", &
2273 repeats=.false.)
2274
2275 ! Start time keyword
2276 NULLIFY (keyword)
2277 CALL keyword_create(keyword, __location__, "START_TIME", &
2278 description="The starting time from which damping is applied and from which on the trace is "// &
2279 "considered for the Fourier transform (Fourier transform is used for the calculation of "// &
2280 "MOMENTS_FT and POLARIZABILITY). Useful for real-time pulse - "// &
2281 "one can specify the center of the pulse as the starting point.", &
2282 type_of_var=real_t, &
2283 unit_str="fs", &
2284 default_r_val=0.0_dp)
2285 CALL section_add_keyword(ft_section, keyword)
2286 CALL keyword_release(keyword)
2287
2288 ! Damping keyword
2289 CALL keyword_create(keyword, __location__, "DAMPING", &
2290 description="Numerical Fourier transform (required for calculation of "// &
2291 "MOMENTS_FT and POLARIZABILITY) can oscillate "// &
2292 "when the final time trace values are far away from zero. "// &
2293 "This keyword controls the exponential damping added to the Fourier transform "// &
2294 "(Fourier transform is used for calculation of MOMENTS_FT and POLARIZABILITY). "// &
2295 "For negative values (the default), calculates the damping at the run time so that the last point "// &
2296 "in the time trace is reduced by factor e^(-4). When set manually, determines the time in which "// &
2297 "the moments trace is reduced by factor of e^(-1), except when set to zero, in which case "// &
2298 "the damping is not applied.", &
2299 type_of_var=real_t, &
2300 unit_str="fs", &
2301 default_r_val=-1.0_dp/femtoseconds)
2302 CALL section_add_keyword(ft_section, keyword)
2303 CALL keyword_release(keyword)
2304
2305 ! Create the Padé subsection
2306 NULLIFY (subsection)
2307 CALL section_create(subsection, __location__, name="PADE", &
2308 description="Defines the parameters for the Padé interpolation of the "// &
2309 "Fourier transforms used in the output of RTP. Only available with the GreenX library linked to CP2K.", &
2310 repeats=.false.)
2311
2312 ! Explicit presence of the section turns on the Padé interpolation
2313 CALL keyword_create(keyword, __location__, "_SECTION_PARAMETERS_", &
2314 description="Turns on the Padé interpolation", &
2315 type_of_var=logical_t, &
2316 default_l_val=.false., &
2317 lone_keyword_l_val=.true.)
2318 CALL section_add_keyword(subsection, keyword)
2319 CALL keyword_release(keyword)
2320
2321 ! Minimum interpolated energy
2322 CALL keyword_create(keyword, __location__, "E_MIN", &
2323 description="The minimum energy of the Padé interpolation output.", &
2324 type_of_var=real_t, &
2325 unit_str="eV", &
2326 default_r_val=0.0_dp)
2327 CALL section_add_keyword(subsection, keyword)
2328 CALL keyword_release(keyword)
2329
2330 ! Maximum interpolated energy
2331 CALL keyword_create(keyword, __location__, "E_MAX", &
2332 description="The maximum energy of the Padé interpolation output.", &
2333 type_of_var=real_t, &
2334 unit_str="eV", &
2335 default_r_val=100.0_dp)
2336 CALL section_add_keyword(subsection, keyword)
2337 CALL keyword_release(keyword)
2338
2339 ! Energy resolution
2340 CALL keyword_create(keyword, __location__, "E_STEP", &
2341 description="The energy resolution of the Padé interpolation output.", &
2342 type_of_var=real_t, &
2343 unit_str="eV", &
2344 default_r_val=0.02_dp/evolt)
2345 CALL section_add_keyword(subsection, keyword)
2346 CALL keyword_release(keyword)
2347
2348 ! Minimum fitting energy
2349 CALL keyword_create(keyword, __location__, "FIT_E_MIN", &
2350 description="The lower boundary in energy for the points "// &
2351 "used in the fitting of Padé parameters. If negative, uses "// &
2352 "value of E_MIN (default).", &
2353 type_of_var=real_t, &
2354 unit_str="eV", &
2355 default_r_val=-1.0_dp)
2356 CALL section_add_keyword(subsection, keyword)
2357 CALL keyword_release(keyword)
2358
2359 ! Maximum fitting energy
2360 CALL keyword_create(keyword, __location__, "FIT_E_MAX", &
2361 description="The upper boundary in energy for the points "// &
2362 "used in the fitting of Padé parameters. If negative, uses "// &
2363 "the value of E_MAX (default).", &
2364 type_of_var=real_t, &
2365 unit_str="eV", &
2366 default_r_val=-1.0_dp)
2367 CALL section_add_keyword(subsection, keyword)
2368 CALL keyword_release(keyword)
2369
2370 ! Add the Padé subsection
2371 CALL section_add_subsection(ft_section, subsection)
2372 CALL section_release(subsection)
2373 END SUBROUTINE create_ft_section
2374
2375! **************************************************************************************************
2376!> \brief Create CP2K input section for the SCCS model
2377!> \param section ...
2378!> \par History:
2379!> - Creation (10.10.2013,MK)
2380!> \author Matthias Krack (MK)
2381!> \version 1.0
2382! **************************************************************************************************
2383 SUBROUTINE create_sccs_section(section)
2384
2385 TYPE(section_type), POINTER :: section
2386
2387 TYPE(keyword_type), POINTER :: keyword
2388 TYPE(section_type), POINTER :: subsection
2389
2390 cpassert(.NOT. ASSOCIATED(section))
2391
2392 CALL section_create(section, __location__, &
2393 name="SCCS", &
2394 description="Define the parameters for self-consistent continuum solvation (SCCS) model", &
2395 citations=[fattebert2002, andreussi2012, yin2017], &
2396 n_keywords=10, &
2397 n_subsections=4, &
2398 repeats=.false.)
2399
2400 NULLIFY (keyword)
2401
2402 CALL keyword_create(keyword, __location__, &
2403 name="_SECTION_PARAMETERS_", &
2404 description="Controls the activation of the SCCS section", &
2405 usage="&SCCS ON", &
2406 default_l_val=.false., &
2407 lone_keyword_l_val=.true.)
2408 CALL section_add_keyword(section, keyword)
2409 CALL keyword_release(keyword)
2410
2411 CALL keyword_create(keyword, __location__, &
2412 name="ALPHA", &
2413 description="Solvent specific tunable parameter for the calculation of "// &
2414 "the repulsion term $G^\text{rep} = \alpha S$ "// &
2415 "where $S$ is the (quantum) surface of the cavity", &
2416 repeats=.false., &
2417 n_var=1, &
2418 type_of_var=real_t, &
2419 default_r_val=0.0_dp, &
2420 unit_str="mN/m")
2421 CALL section_add_keyword(section, keyword)
2422 CALL keyword_release(keyword)
2423
2424 CALL keyword_create(keyword, __location__, &
2425 name="BETA", &
2426 description="Solvent specific tunable parameter for the calculation of "// &
2427 "the dispersion term $G^\text{dis} = \beta V$ "// &
2428 "where $V$ is the (quantum) volume of the cavity", &
2429 repeats=.false., &
2430 n_var=1, &
2431 type_of_var=real_t, &
2432 default_r_val=0.0_dp, &
2433 unit_str="GPa")
2434 CALL section_add_keyword(section, keyword)
2435 CALL keyword_release(keyword)
2436
2437 CALL keyword_create(keyword, __location__, &
2438 name="DELTA_RHO", &
2439 description="Numerical increment for the calculation of the (quantum) "// &
2440 "surface of the solute cavity", &
2441 repeats=.false., &
2442 n_var=1, &
2443 type_of_var=real_t, &
2444 default_r_val=2.0e-5_dp)
2445 CALL section_add_keyword(section, keyword)
2446 CALL keyword_release(keyword)
2447
2448 CALL keyword_create(keyword, __location__, &
2449 name="DERIVATIVE_METHOD", &
2450 description="Method for the calculation of the numerical derivatives on the real-space grids", &
2451 usage="DERIVATIVE_METHOD cd5", &
2452 repeats=.false., &
2453 n_var=1, &
2454 default_i_val=sccs_derivative_fft, &
2455 enum_c_vals=s2a("FFT", "CD3", "CD5", "CD7"), &
2456 enum_i_vals=[sccs_derivative_fft, &
2460 enum_desc=s2a("Fast Fourier transformation", &
2461 "3-point stencil central differences", &
2462 "5-point stencil central differences", &
2463 "7-point stencil central differences"))
2464 CALL section_add_keyword(section, keyword)
2465 CALL keyword_release(keyword)
2466
2467 CALL keyword_create(keyword, __location__, &
2468 name="RELATIVE_PERMITTIVITY", &
2469 variants=s2a("DIELECTRIC_CONSTANT", "EPSILON_RELATIVE", "EPSILON_SOLVENT"), &
2470 description="Relative permittivity (dielectric constant) of the solvent (medium)", &
2471 repeats=.false., &
2472 n_var=1, &
2473 type_of_var=real_t, &
2474 default_r_val=80.0_dp, &
2475 usage="RELATIVE_PERMITTIVITY 78.36")
2476 CALL section_add_keyword(section, keyword)
2477 CALL keyword_release(keyword)
2478
2479 CALL keyword_create(keyword, __location__, &
2480 name="EPS_SCCS", &
2481 variants=s2a("EPS_ITER", "TAU_POL"), &
2482 description="Tolerance for the convergence of the polarisation density, "// &
2483 "i.e. requested accuracy for the SCCS iteration cycle", &
2484 repeats=.false., &
2485 n_var=1, &
2486 type_of_var=real_t, &
2487 default_r_val=1.0e-6_dp, &
2488 usage="EPS_ITER 1.0E-7")
2489 CALL section_add_keyword(section, keyword)
2490 CALL keyword_release(keyword)
2491
2492 CALL keyword_create(keyword, __location__, &
2493 name="EPS_SCF", &
2494 description="The SCCS iteration cycle is activated only if the SCF iteration cycle "// &
2495 "is converged to this threshold value", &
2496 repeats=.false., &
2497 n_var=1, &
2498 type_of_var=real_t, &
2499 default_r_val=0.5_dp, &
2500 usage="EPS_SCF 1.0E-2")
2501 CALL section_add_keyword(section, keyword)
2502 CALL keyword_release(keyword)
2503
2504 CALL keyword_create(keyword, __location__, &
2505 name="GAMMA", &
2506 variants=s2a("SURFACE_TENSION"), &
2507 description="Surface tension of the solvent used for the calculation of "// &
2508 "the cavitation term $G^\text{cav} = \gamma S$ "// &
2509 "where $S$ is the (quantum) surface of the cavity", &
2510 repeats=.false., &
2511 n_var=1, &
2512 type_of_var=real_t, &
2513 default_r_val=0.0_dp, &
2514 unit_str="mN/m")
2515 CALL section_add_keyword(section, keyword)
2516 CALL keyword_release(keyword)
2517
2518 CALL keyword_create(keyword, __location__, &
2519 name="MAX_ITER", &
2520 description="Maximum number of SCCS iteration steps performed to converge "// &
2521 "within the given tolerance", &
2522 repeats=.false., &
2523 n_var=1, &
2524 type_of_var=integer_t, &
2525 default_i_val=100, &
2526 usage="MAX_ITER 50")
2527 CALL section_add_keyword(section, keyword)
2528 CALL keyword_release(keyword)
2529
2530 CALL keyword_create(keyword, __location__, &
2531 name="METHOD", &
2532 description="Method used for the smoothing of the dielectric function", &
2533 usage="METHOD Fattebert-Gygi", &
2534 default_i_val=sccs_andreussi, &
2535 enum_c_vals=s2a("ANDREUSSI", "FATTEBERT-GYGI", "SAA_ANDREUSSI"), &
2537 enum_desc=s2a("Smoothing function proposed by Andreussi et al.", &
2538 "Smoothing function proposed by Fattebert and Gygi", &
2539 "Smoothing function of the solvent aware algorithm"))
2540 CALL section_add_keyword(section, keyword)
2541 CALL keyword_release(keyword)
2542
2543 CALL keyword_create(keyword, __location__, &
2544 name="MIXING", &
2545 variants=["ETA"], &
2546 description="Mixing parameter (Hartree damping) employed during the iteration procedure", &
2547 repeats=.false., &
2548 n_var=1, &
2549 type_of_var=real_t, &
2550 default_r_val=0.6_dp, &
2551 usage="MIXING 0.2")
2552 CALL section_add_keyword(section, keyword)
2553 CALL keyword_release(keyword)
2554
2555 CALL keyword_create(keyword, __location__, &
2556 name="CORE_FILL", &
2557 description="Add a normalised Gaussian fill density $Z_{val}/(\sqrt{\pi}\sigma)^3 "// &
2558 "\exp(-r^2/\sigma^2)$ on each atom to the electronic density used for the "// &
2559 "definition of the dielectric function. This fills the low valence density "// &
2560 "region at the nuclei of pseudopotential atoms, which otherwise may be treated "// &
2561 "as solvent if a grid point is close to a nucleus (similar to the solvent_mode "// &
2562 "'full' of the Environ library). Kinds without removed core electrons (Z_val = Z, "// &
2563 "e.g. H, He-q2, Li-q3, Be-q4) are not filled by default. "// &
2564 "The resulting ionic forces are included.", &
2565 usage="CORE_FILL", &
2566 default_l_val=.false., &
2567 lone_keyword_l_val=.true.)
2568 CALL section_add_keyword(section, keyword)
2569 CALL keyword_release(keyword)
2570
2571 CALL keyword_create(keyword, __location__, &
2572 name="CORE_FILL_SPREAD", &
2573 description="Default spread $\sigma$ of the Gaussian fill density used with CORE_FILL "// &
2574 "(Environ default 0.5 bohr). Can be overwritten per kind in the CORE_FILL_KIND section.", &
2575 repeats=.false., &
2576 n_var=1, &
2577 type_of_var=real_t, &
2578 unit_str="bohr", &
2579 default_r_val=0.5_dp, &
2580 usage="CORE_FILL_SPREAD [bohr] 0.5")
2581 CALL section_add_keyword(section, keyword)
2582 CALL keyword_release(keyword)
2583
2584 NULLIFY (subsection)
2585
2586 CALL section_create(subsection, __location__, &
2587 name="CORE_FILL_KIND", &
2588 description="Per-kind spread of the CORE_FILL Gaussian fill density. "// &
2589 "Each line contains a kind label (as defined in &KIND) and the spread in bohr. "// &
2590 "A spread <= 0 disables the fill for that kind. Kinds not listed use "// &
2591 "CORE_FILL_SPREAD, except kinds without removed core electrons (Z_val = Z) which are "// &
2592 "not filled.", &
2593 n_keywords=1, &
2594 n_subsections=0, &
2595 repeats=.false.)
2596 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
2597 description="Kind label and spread in bohr", &
2598 repeats=.true., &
2599 usage="{kind label} {spread in bohr}", &
2600 type_of_var=lchar_t)
2601 CALL section_add_keyword(subsection, keyword)
2602 CALL keyword_release(keyword)
2603 CALL section_add_subsection(section, subsection)
2604 CALL section_release(subsection)
2605
2606 CALL section_create(subsection, __location__, &
2607 name="ANDREUSSI", &
2608 description="Define the parameters of the dielectric smoothing function proposed by "// &
2609 "Andreussi et al.", &
2610 citations=[andreussi2012], &
2611 n_keywords=2, &
2612 n_subsections=0, &
2613 repeats=.false.)
2614
2615 CALL keyword_create(keyword, __location__, &
2616 name="RHO_MAX", &
2617 description="Maximum density value used for the smoothing of the dielectric function", &
2618 repeats=.false., &
2619 n_var=1, &
2620 type_of_var=real_t, &
2621 default_r_val=0.0035_dp, &
2622 usage="RHO_MAX 0.01")
2623 CALL section_add_keyword(subsection, keyword)
2624 CALL keyword_release(keyword)
2625
2626 CALL keyword_create(keyword, __location__, &
2627 name="RHO_MIN", &
2628 description="Minimum density value used for the smoothing of the dielectric function", &
2629 repeats=.false., &
2630 n_var=1, &
2631 type_of_var=real_t, &
2632 default_r_val=0.0001_dp, &
2633 usage="RHO_MIN 0.0003")
2634 CALL section_add_keyword(subsection, keyword)
2635 CALL keyword_release(keyword)
2636
2637 CALL section_add_subsection(section, subsection)
2638 CALL section_release(subsection)
2639
2640 CALL section_create(subsection, __location__, &
2641 name="FATTEBERT-GYGI", &
2642 description="Define the parameters of the dielectric smoothing function proposed by "// &
2643 "Fattebert and Gygi", &
2644 citations=[fattebert2002], &
2645 n_keywords=2, &
2646 n_subsections=0, &
2647 repeats=.false.)
2648
2649 CALL keyword_create(keyword, __location__, &
2650 name="BETA", &
2651 description="Parameter &beta; changes the width of the interface solute-solvent", &
2652 repeats=.false., &
2653 n_var=1, &
2654 type_of_var=real_t, &
2655 default_r_val=1.7_dp, &
2656 usage="BETA 1.3")
2657 CALL section_add_keyword(subsection, keyword)
2658 CALL keyword_release(keyword)
2659
2660 CALL keyword_create(keyword, __location__, &
2661 name="RHO_ZERO", &
2662 variants=["RHO0"], &
2663 description="Parameter $\rho_0$ defines the critical density in the middle "// &
2664 "of the interface solute-solvent", &
2665 repeats=.false., &
2666 n_var=1, &
2667 type_of_var=real_t, &
2668 default_r_val=0.0006_dp, &
2669 usage="RHO_ZERO 0.0004")
2670 CALL section_add_keyword(subsection, keyword)
2671 CALL keyword_release(keyword)
2672
2673 CALL section_add_subsection(section, subsection)
2674 CALL section_release(subsection)
2675
2676 CALL section_create(subsection, __location__, &
2677 name="SAA_ANDREUSSI", &
2678 description="Define the parameters of the dielectric smoothing function of "// &
2679 "the solvent aware algorithm proposed by Andreussi et al.", &
2680 citations=[andreussi2019, chai2025a], &
2681 n_keywords=7, &
2682 n_subsections=0, &
2683 repeats=.false.)
2684
2685 CALL keyword_create(keyword, __location__, &
2686 name="RHO_MAX", &
2687 description="Maximum density value used for the smoothing of the dielectric function", &
2688 repeats=.false., &
2689 n_var=1, &
2690 type_of_var=real_t, &
2691 default_r_val=0.0035_dp, &
2692 usage="RHO_MAX 0.01")
2693 CALL section_add_keyword(subsection, keyword)
2694 CALL keyword_release(keyword)
2695
2696 CALL keyword_create(keyword, __location__, &
2697 name="RHO_MIN", &
2698 description="Minimum density value used for the smoothing of the dielectric function", &
2699 repeats=.false., &
2700 n_var=1, &
2701 type_of_var=real_t, &
2702 default_r_val=0.0001_dp, &
2703 usage="RHO_MIN 0.0003")
2704 CALL section_add_keyword(subsection, keyword)
2705 CALL keyword_release(keyword)
2706
2707 CALL keyword_create(keyword, __location__, &
2708 name="F0", &
2709 description="The threshold of the filled fraction that controls whether a point in space "// &
2710 "needs to be removed from the continuum", &
2711 repeats=.false., &
2712 n_var=1, &
2713 type_of_var=real_t, &
2714 default_r_val=0.65_dp, &
2715 usage="F0 0.65")
2716 CALL section_add_keyword(subsection, keyword)
2717 CALL keyword_release(keyword)
2718
2719 CALL keyword_create(keyword, __location__, &
2720 name="DELTA_ETA", &
2721 description="Controls the softness of function t(r)", &
2722 repeats=.false., &
2723 n_var=1, &
2724 type_of_var=real_t, &
2725 default_r_val=0.02_dp, &
2726 usage="DELTA_ETA 0.02")
2727 CALL section_add_keyword(subsection, keyword)
2728 CALL keyword_release(keyword)
2729
2730 CALL keyword_create(keyword, __location__, &
2731 name="DELTA_ZETA", &
2732 description="Controls the softness of function u(r)", &
2733 repeats=.false., &
2734 n_var=1, &
2735 type_of_var=real_t, &
2736 unit_str='bohr', &
2737 default_r_val=0.5_dp, &
2738 usage="DELTA_ZETA 0.5")
2739 CALL section_add_keyword(subsection, keyword)
2740 CALL keyword_release(keyword)
2741
2742 CALL keyword_create(keyword, __location__, &
2743 name="ALPHA_ZETA", &
2744 description="The scaling factor for R_SOLV", &
2745 repeats=.false., &
2746 n_var=1, &
2747 type_of_var=real_t, &
2748 default_r_val=2.0_dp, &
2749 usage="ALPHA_ZETA 2.0")
2750 CALL section_add_keyword(subsection, keyword)
2751 CALL keyword_release(keyword)
2752
2753 CALL keyword_create(keyword, __location__, &
2754 name="R_SOLV", &
2755 description="The solvent radius", &
2756 repeats=.false., &
2757 n_var=1, &
2758 type_of_var=real_t, &
2759 unit_str='bohr', &
2760 default_r_val=2.6_dp, &
2761 usage="R_SOLV 2.6")
2762 CALL section_add_keyword(subsection, keyword)
2763 CALL keyword_release(keyword)
2764
2765 CALL section_add_subsection(section, subsection)
2766 CALL section_release(subsection)
2767
2768 END SUBROUTINE create_sccs_section
2769
2770! **************************************************************************************************
2771!> \brief Create CP2K input section for the planar counter charge density
2772!> \param section ...
2773!> \author Ziwei Chai
2774!> \version 1.0
2775! **************************************************************************************************
2776 SUBROUTINE create_pcc_section(section)
2777
2778 TYPE(section_type), POINTER :: section
2779
2780 TYPE(keyword_type), POINTER :: keyword
2781
2782 cpassert(.NOT. ASSOCIATED(section))
2783
2784 CALL section_create(section, __location__, &
2785 name="PLANAR_COUNTER_CHARGE", &
2786 description="Define the parameters for the planar counter charge density", &
2787 citations=[chai2024a], &
2788 n_keywords=4, &
2789 n_subsections=0, &
2790 repeats=.false.)
2791
2792 NULLIFY (keyword)
2793
2794 CALL keyword_create(keyword, __location__, &
2795 name="_SECTION_PARAMETERS_", &
2796 description="Controls the activation of the planar counter charge section", &
2797 usage="&PLANAR_COUNTER_CHARGE ON", &
2798 default_l_val=.false., &
2799 lone_keyword_l_val=.true.)
2800 CALL section_add_keyword(section, keyword)
2801 CALL keyword_release(keyword)
2802
2803 CALL keyword_create(keyword, __location__, name="PARALLEL_PLANE", &
2804 enum_c_vals=s2a('XY', 'YZ', 'XZ'), &
2805 enum_i_vals=[3, 1, 2], &
2806 description="The coordinate plane that the surface is parallel to.", &
2807 enum_desc=s2a("Parallel to XY", "Parallel to YZ", "Parallel to XZ"), &
2808 n_var=1, &
2809 default_i_val=3, &
2810 usage="PARALLEL_PLANE XY")
2811 CALL section_add_keyword(section, keyword)
2812 CALL keyword_release(keyword)
2813
2814 CALL keyword_create(keyword, __location__, &
2815 name="DIST_EDGE", &
2816 description="Controls the distance between the center of the Gaussian "// &
2817 "and the cell boundary", &
2818 usage="DIST_EDGE 1.0", &
2819 unit_str="angstrom", &
2820 type_of_var=real_t)
2821 CALL section_add_keyword(section, keyword)
2822 CALL keyword_release(keyword)
2823
2824 CALL keyword_create(keyword, __location__, &
2825 name="GAU_C", &
2826 description="Controls the spread of the Gaussian distribution", &
2827 usage="GAU_C 0.1", &
2828 unit_str="angstrom", &
2829 type_of_var=real_t)
2830 CALL section_add_keyword(section, keyword)
2831 CALL keyword_release(keyword)
2832
2833 END SUBROUTINE create_pcc_section
2834
2835! **************************************************************************************************
2836!> \brief Create CP2K input section for calculating and printing the planar averaged
2837!> electrostatic potential (Hartree potential) for symmetric slab systems
2838!> \param section ...
2839!> \author Ziwei Chai
2840!> \version 1.0
2841! **************************************************************************************************
2842 SUBROUTINE create_paep_section(section)
2843
2844 TYPE(section_type), POINTER :: section
2845
2846 TYPE(keyword_type), POINTER :: keyword
2847
2848 cpassert(.NOT. ASSOCIATED(section))
2849
2850 CALL section_create(section, __location__, &
2851 name="PLANAR_AVERAGED_V_HARTREE", &
2852 description="Define the parameters for calculating and printing the planar "// &
2853 "averaged electrostatic potential (Hartree potential) "// &
2854 "for symmetric slab systems", &
2855 n_keywords=2, &
2856 n_subsections=0, &
2857 repeats=.false.)
2858
2859 NULLIFY (keyword)
2860
2861 CALL keyword_create(keyword, __location__, &
2862 name="_SECTION_PARAMETERS_", &
2863 description="Controls the activation of the planar averaged electrostatic "// &
2864 "potential (Hartree potential) section", &
2865 usage="&PLANAR_AVERAGED_V_HARTREE ON", &
2866 default_l_val=.false., &
2867 lone_keyword_l_val=.true.)
2868 CALL section_add_keyword(section, keyword)
2869 CALL keyword_release(keyword)
2870
2871 CALL keyword_create(keyword, __location__, name="PARALLEL_PLANE", &
2872 enum_c_vals=s2a('XY', 'YZ', 'XZ'), &
2873 enum_i_vals=[3, 1, 2], &
2874 description="The coordinate plane that the surface is parallel to.", &
2875 enum_desc=s2a("Parallel to XY", "Parallel to YZ", "Parallel to XZ"), &
2876 n_var=1, &
2877 default_i_val=3, &
2878 usage="PARALLEL_PLANE XY")
2879 CALL section_add_keyword(section, keyword)
2880 CALL keyword_release(keyword)
2881
2882 END SUBROUTINE create_paep_section
2883
2884END MODULE input_cp2k_dft
integer, parameter, public basis_sort_zet
integer, parameter, public basis_sort_default
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public vandevondele2005b
integer, save, public blochl1995
integer, save, public guidon2010
integer, save, public bengtsson1999
integer, save, public kunert2003
integer, save, public yin2017
integer, save, public andreussi2019
integer, save, public mattiat2022
integer, save, public avezac2005
integer, save, public andreussi2012
integer, save, public iannuzzi2006
integer, save, public chai2025a
integer, save, public fattebert2002
integer, save, public andermatt2016
integer, save, public merlot2014
integer, save, public perdew1981
integer, save, public marek2025
integer, save, public brelaz1979
integer, save, public chai2024a
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
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, do_backup)
creates a print_key section
integer, parameter, public low_print_level
integer, parameter, public medium_print_level
integer, parameter, public high_print_level
integer, parameter, public add_last_numeric
integer, parameter, public silent_print_level
utils to manipulate splines on the regular grid of a pw
integer, parameter, public pw_interp
integer, parameter, public spline3_pbc_interp
unit conversion facility
Definition cp_units.F:30
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Definition cp_units.F:1282
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public use_mom_ref_coac
integer, parameter, public sic_list_unpaired
integer, parameter, public sic_mauri_spz
integer, parameter, public do_bch
integer, parameter, public do_admm_purify_mo_no_diag
integer, parameter, public do_etrs
integer, parameter, public do_admm_aux_exch_func_opt_libxc
integer, parameter, public rel_zora_full
integer, parameter, public do_pade
integer, parameter, public do_admm_purify_none
integer, parameter, public use_mom_ref_user
integer, parameter, public rel_pot_full
integer, parameter, public do_admm_purify_none_dm
integer, parameter, public use_mom_ref_com
integer, parameter, public ehrenfest
integer, parameter, public use_restart_wfn
integer, parameter, public do_admm_purify_mcweeny
integer, parameter, public do_admm_blocking_purify_full
integer, parameter, public plus_u_lowdin
integer, parameter, public kg_tnadd_none
integer, parameter, public do_admm_aux_exch_func_sx_libxc
integer, parameter, public admm2_type
integer, parameter, public rtp_bse_kernel_ri_rs
integer, parameter, public sic_list_all
integer, parameter, public do_cn
integer, parameter, public kg_tnadd_embed_ri
integer, parameter, public rtp_bse_kernel_ri_default
integer, parameter, public kg_tnadd_embed
integer, parameter, public sic_eo
integer, parameter, public sccs_derivative_cd5
integer, parameter, public do_admm_aux_exch_func_bee
integer, parameter, public rel_zora_mp
integer, parameter, public sccs_saa_andreussi
integer, parameter, public plus_u_mulliken_charges
integer, parameter, public use_scf_wfn
integer, parameter, public no_admm_type
integer, parameter, public rel_zora
integer, parameter, public do_admm_blocked_projection
integer, parameter, public kg_tnadd_atomic
integer, parameter, public do_admm_basis_projection
integer, parameter, public do_admm_aux_exch_func_default_libxc
integer, parameter, public do_admm_aux_exch_func_opt
integer, parameter, public do_admm_aux_exch_func_none
integer, parameter, public do_admm_purify_cauchy_subspace
integer, parameter, public plus_u_mulliken
integer, parameter, public kg_color_greedy
integer, parameter, public do_admm_aux_exch_func_bee_libxc
integer, parameter, public rtp_bse_kernel_ri_ao
integer, parameter, public admm1_type
integer, parameter, public do_admm_aux_exch_func_pbex_libxc
integer, parameter, public kg_color_dsatur
integer, parameter, public do_admm_aux_exch_func_default
integer, parameter, public weight_type_unit
integer, parameter, public rtp_method_bse
integer, parameter, public admms_type
integer, parameter, public do_admm_charge_constrained_projection
integer, parameter, public rel_dkh
integer, parameter, public do_admm_purify_cauchy
integer, parameter, public plus_u_tensorial
integer, parameter, public sccs_fattebert_gygi
integer, parameter, public rel_trans_full
integer, parameter, public rtp_bse_ham_gw
integer, parameter, public sccs_derivative_cd7
integer, parameter, public rel_trans_molecule
integer, parameter, public rel_trans_atom
integer, parameter, public weight_type_mass
integer, parameter, public use_rt_restart
integer, parameter, public do_exact
integer, parameter, public sccs_derivative_fft
integer, parameter, public use_mom_ref_zero
integer, parameter, public gaussian
integer, parameter, public rel_pot_erfc
integer, parameter, public rtp_method_tddft
integer, parameter, public rel_none
integer, parameter, public do_taylor
integer, parameter, public do_admm_purify_mo_diag
integer, parameter, public do_em
integer, parameter, public sic_mauri_us
integer, parameter, public sic_none
integer, parameter, public rtp_bse_ham_ks
integer, parameter, public sccs_derivative_cd3
integer, parameter, public rel_sczora_mp
integer, parameter, public admmq_type
integer, parameter, public sccs_andreussi
integer, parameter, public sic_ad
integer, parameter, public do_admm_exch_scaling_none
integer, parameter, public do_arnoldi
integer, parameter, public admmp_type
integer, parameter, public do_admm_exch_scaling_merlot
integer, parameter, public real_time_propagation
integer, parameter, public numerical
integer, parameter, public do_admm_aux_exch_func_pbex
integer, parameter, public slater
input for the ALMO SCF section
subroutine, public create_almo_scf_section(section)
create the almo scf section
function that build the active space section of the input
subroutine, public create_active_space_section(section)
Create CP2K input section for the calculation of an active space Hamiltonian.
function that build the dft section of the input
subroutine, public create_bsse_section(section)
Create the BSSE section for counterpoise correction.
subroutine, public create_mgrid_section(section, create_subsections)
creates the multigrid
subroutine, public create_dft_section(section)
creates the dft section
subroutine, public create_interp_section(section)
creates the interpolation section
function that build the dft section of the input
subroutine, public create_ec_section(section)
creates the ENERGY CORRECTION section
Excited state input section.
subroutine, public create_exstate_section(section)
creates the EXCITED ENERGY section
function that build the input sections for external [potential, density VXC]
subroutine, public create_ext_pot_section(section)
Creates the section for applying an electrostatic external potential.
subroutine, public create_ext_vxc_section(section)
ZMP Creates the section for creating the external v_xc.
subroutine, public create_ext_den_section(section)
ZMP Creates the section for reading user supplied external density.
subroutine, public create_fde_section(section)
Create the FDE (frozen-density embedding) input section.
function that build the field section of the input
subroutine, public create_efield_section(section)
creates the section for time dependent nonperiodic fields
subroutine, public create_per_efield_section(section)
creates the section for static periodic fields
Harris input section.
subroutine, public create_harris_section(section)
creates the HARRIS_METHOD section
function that build the kpoints section of the input
subroutine, public create_kpoints_section(section)
Creates the Kpoints section SECTION: &kpoint... &end SCHEME [None, Gamma, Monkhorst-Pack,...
subroutine, public create_kpoint_set_section(section, section_name)
...
subroutine, public create_localize_section(section)
parameters fo the localization of wavefunctions
input for the linear scaling (LS) section
subroutine, public create_ls_scf_section(section)
creates the linear scaling scf section
function that build the poisson section of the input
subroutine, public create_poisson_section(section)
Creates the Poisson section.
function that build the print section of the dft input
subroutine, public create_print_dft_section(section)
Create the print dft section.
function that builds the projection of MO in RTP section of the input
subroutine, public create_projection_rtp_section(section)
creates the section for time dependent projection of the MOs
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_rsgrid_section(section)
...
function that build the scf section of the input
subroutine, public create_scf_section(section)
creates the structure of the section with the DFT SCF parameters
Functions that build SMEAGOL input section.
subroutine, public create_dft_smeagol_section(section)
Create SMEAGOL input section.
input section for NEGF based quantum transport calculations (integration with the quantum transport c...
subroutine, public create_transport_section(section)
creates the TRANSPORT section
function that build the XAS section of the input
subroutine, public create_xas_section(section)
makes the input section for core-level spectroscopy simulations
subroutine, public create_xas_tdp_section(section)
makes the input section for core-level spectroscopy simulations using linear response TDDFT
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 real_t
integer, parameter, public lchar_t
integer, parameter, public logical_t
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
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public femtoseconds
Definition physcon.F:153
real(kind=dp), parameter, public evolt
Definition physcon.F:183
different utils that are useful to manipulate splines on the regular grid of a pw
integer, parameter, public precond_spl3_3
integer, parameter, public precond_spl3_aint
integer, parameter, public no_precond
integer, parameter, public precond_spl3_2
integer, parameter, public precond_spl3_aint2
integer, parameter, public precond_spl3_1
Utilities for string manipulations.
represent a keyword in the input
represent a section of the input file