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