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