LCOV - code coverage report
Current view: top level - src - input_cp2k_properties_dft.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:21ef868) Lines: 99.9 % 1101 1100
Test Date: 2026-08-14 07:04:57 Functions: 100.0 % 23 23

            Line data    Source code
       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              : !>      01.2013 moved out of input_cp2k_dft [MI]
      12              : !> \author MI
      13              : ! **************************************************************************************************
      14              : MODULE input_cp2k_properties_dft
      15              :    USE bibliography, ONLY: Futera2017, &
      16              :                            Hanasaki2025, &
      17              :                            Hernandez2025, &
      18              :                            Iannuzzi2005, &
      19              :                            Kondov2007, &
      20              :                            KuhneHeskeProdan2020, &
      21              :                            Luber2014, &
      22              :                            Putrino2000, &
      23              :                            Putrino2002, &
      24              :                            Sebastiani2001, &
      25              :                            Weber2009, &
      26              :                            VazdaCruz2021
      27              :    USE cp_output_handling, ONLY: add_last_numeric, &
      28              :                                  cp_print_key_section_create, &
      29              :                                  debug_print_level, &
      30              :                                  high_print_level, &
      31              :                                  low_print_level, &
      32              :                                  medium_print_level, &
      33              :                                  silent_print_level
      34              :    USE cp_units, ONLY: cp_unit_to_cp2k
      35              :    USE input_constants, ONLY: &
      36              :       current_gauge_atom, current_gauge_r, current_gauge_r_and_step_func, &
      37              :       current_orb_center_atom, current_orb_center_box, current_orb_center_common, &
      38              :       current_orb_center_wannier, do_et_ddapc, do_full_density, do_no_et, do_spin_density, &
      39              :       gto_cartesian, gto_spherical, int_ldos_none, int_ldos_x, int_ldos_y, int_ldos_z, oe_gllb, &
      40              :       oe_lb, oe_none, oe_saop, oe_shift, ot_precond_full_all, ot_precond_full_kinetic, &
      41              :       ot_precond_full_single, ot_precond_full_single_inverse, ot_precond_none, &
      42              :       ot_precond_s_inverse, scan_x, scan_xy, scan_xyz, scan_xz, scan_y, scan_yz, scan_z, &
      43              :       tddfpt_dipole_berry, tddfpt_dipole_length, tddfpt_dipole_scf_moment, &
      44              :       tddfpt_dipole_velocity, tddfpt_dipole_velocity_old, tddfpt_kernel_full, tddfpt_kernel_none, &
      45              :       tddfpt_kernel_stda, no_sf_tddfpt, tddfpt_sf_col, tddfpt_sf_noncol, use_mom_ref_coac, &
      46              :       use_mom_ref_com, use_mom_ref_user, use_mom_ref_zero
      47              :    USE input_cp2k_atprop, ONLY: create_atprop_section
      48              :    USE input_cp2k_dft, ONLY: create_interp_section, &
      49              :                              create_mgrid_section
      50              :    USE input_cp2k_qs, ONLY: create_ddapc_restraint_section, &
      51              :                             create_lrigpw_section
      52              :    USE input_cp2k_kpoints, ONLY: create_kpoint_set_section
      53              :    USE input_cp2k_loc, ONLY: create_localize_section
      54              :    USE input_cp2k_resp, ONLY: create_resp_section
      55              :    USE input_cp2k_xc, ONLY: create_xc_section
      56              :    USE input_keyword_types, ONLY: keyword_create, &
      57              :                                   keyword_release, &
      58              :                                   keyword_type
      59              :    USE input_section_types, ONLY: section_add_keyword, &
      60              :                                   section_add_subsection, &
      61              :                                   section_create, &
      62              :                                   section_release, &
      63              :                                   section_type
      64              :    USE input_val_types, ONLY: char_t, &
      65              :                               integer_t, &
      66              :                               lchar_t, &
      67              :                               logical_t, &
      68              :                               real_t
      69              :    USE input_cp2k_xas, ONLY: create_xas_tdp_section
      70              :    USE kinds, ONLY: dp
      71              :    USE string_utilities, ONLY: s2a
      72              : #include "./base/base_uses.f90"
      73              : 
      74              :    IMPLICIT NONE
      75              :    PRIVATE
      76              : 
      77              :    LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
      78              :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_properties_dft'
      79              : 
      80              :    PUBLIC :: create_properties_section
      81              : 
      82              : CONTAINS
      83              : 
      84              : ! **************************************************************************************************
      85              : !> \brief Create the PROPERTIES section
      86              : !> \param section the section to create
      87              : !> \author teo
      88              : ! **************************************************************************************************
      89        10624 :    SUBROUTINE create_properties_section(section)
      90              :       TYPE(section_type), POINTER                        :: section
      91              : 
      92              :       TYPE(keyword_type), POINTER                        :: keyword
      93              :       TYPE(section_type), POINTER                        :: subsection
      94              : 
      95        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
      96              :       CALL section_create(section, __LOCATION__, name="PROPERTIES", &
      97              :                           description="This section is used to set up the PROPERTIES calculation.", &
      98        10624 :                           n_keywords=0, n_subsections=6, repeats=.FALSE.)
      99              : 
     100        10624 :       NULLIFY (subsection, keyword)
     101              : 
     102        10624 :       CALL create_linres_section(subsection, create_subsections=.TRUE.)
     103        10624 :       CALL section_add_subsection(section, subsection)
     104        10624 :       CALL section_release(subsection)
     105              : 
     106        10624 :       CALL create_et_coupling_section(subsection)
     107        10624 :       CALL section_add_subsection(section, subsection)
     108        10624 :       CALL section_release(subsection)
     109              : 
     110        10624 :       CALL create_resp_section(subsection)
     111        10624 :       CALL section_add_subsection(section, subsection)
     112        10624 :       CALL section_release(subsection)
     113              : 
     114        10624 :       CALL create_atprop_section(subsection)
     115        10624 :       CALL section_add_subsection(section, subsection)
     116        10624 :       CALL section_release(subsection)
     117              : 
     118              :       CALL cp_print_key_section_create(subsection, __LOCATION__, name="FIT_CHARGE", &
     119              :                                        description="This section is used to print the density derived atomic point charges. "// &
     120              :                                        "The fit of the charges is controlled through the DENSITY_FITTING section", &
     121        10624 :                                        print_level=high_print_level, filename="__STD_OUT__")
     122              :       CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_DENSITY", &
     123              :                           description="Specifies the type of density used for the fitting", &
     124              :                           usage="TYPE_OF_DENSITY (FULL|SPIN)", &
     125              :                           enum_c_vals=s2a("FULL", "SPIN"), &
     126              :                           enum_i_vals=[do_full_density, do_spin_density], &
     127              :                           enum_desc=s2a("Full density", "Spin density"), &
     128        10624 :                           default_i_val=do_full_density)
     129        10624 :       CALL section_add_keyword(subsection, keyword)
     130        10624 :       CALL keyword_release(keyword)
     131        10624 :       CALL section_add_subsection(section, subsection)
     132        10624 :       CALL section_release(subsection)
     133              : 
     134        10624 :       CALL create_tddfpt2_section(subsection)
     135        10624 :       CALL section_add_subsection(section, subsection)
     136        10624 :       CALL section_release(subsection)
     137              : 
     138        10624 :       CALL create_rixs_section(subsection)
     139        10624 :       CALL section_add_subsection(section, subsection)
     140        10624 :       CALL section_release(subsection)
     141              : 
     142        10624 :       CALL create_kubo_transport_section(subsection)
     143        10624 :       CALL section_add_subsection(section, subsection)
     144        10624 :       CALL section_release(subsection)
     145              : 
     146        10624 :       CALL create_bandstructure_section(subsection)
     147        10624 :       CALL section_add_subsection(section, subsection)
     148        10624 :       CALL section_release(subsection)
     149              : 
     150        10624 :       CALL create_tipscan_section(subsection)
     151        10624 :       CALL section_add_subsection(section, subsection)
     152        10624 :       CALL section_release(subsection)
     153              : 
     154        10624 :    END SUBROUTINE create_properties_section
     155              : 
     156              : ! **************************************************************************************************
     157              : !> \brief creates the input structure used to activate finite-volume Kubo transport
     158              : ! **************************************************************************************************
     159              : 
     160        10624 :    SUBROUTINE create_kubo_transport_section(section)
     161              :       TYPE(section_type), POINTER                        :: section
     162              :       TYPE(keyword_type), POINTER                        :: keyword
     163              : 
     164        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
     165              : 
     166        10624 :       NULLIFY (keyword)
     167              : 
     168              :       CALL section_create(section, __LOCATION__, name="KUBO_TRANSPORT", &
     169              :                           description="Finite-volume Kubo-Greenwood transport coefficients from the "// &
     170              :                           "converged Quickstep Hamiltonian, overlap matrix, and atomic geometry. "// &
     171              :                           "For one- and two-dimensional cells, transport is projected onto the "// &
     172              :                           "periodic subspace and normalized by the periodic length or area.", &
     173              :                           n_keywords=8, n_subsections=0, repeats=.FALSE., &
     174        21248 :                           citations=[KuhneHeskeProdan2020])
     175              : 
     176              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     177              :                           description="Controls the activation of the Kubo transport calculation.", &
     178              :                           default_l_val=.FALSE., &
     179        10624 :                           lone_keyword_l_val=.TRUE.)
     180        10624 :       CALL section_add_keyword(section, keyword)
     181        10624 :       CALL keyword_release(keyword)
     182              : 
     183              :       CALL keyword_create(keyword, __LOCATION__, name="METHOD", &
     184              :                           description="Transport algorithm. DIAGONALIZATION evaluates the finite-volume "// &
     185              :                           "Kubo-Greenwood expression from the explicit spectrum. TD and CHEBYSHEV are "// &
     186              :                           "reserved for future diagonalization-free implementations.", &
     187              :                           usage="METHOD DIAGONALIZATION", &
     188        10624 :                           n_var=1, type_of_var=char_t, default_c_val="DIAGONALIZATION")
     189        10624 :       CALL section_add_keyword(section, keyword)
     190        10624 :       CALL keyword_release(keyword)
     191              : 
     192              :       CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
     193              :                           description="Electronic temperature used in the Fermi operator.", &
     194              :                           usage="TEMPERATURE 1.0", &
     195              :                           default_r_val=cp_unit_to_cp2k(value=1.0_dp, unit_str="K"), &
     196        10624 :                           n_var=1, type_of_var=real_t, unit_str="K")
     197        10624 :       CALL section_add_keyword(section, keyword)
     198        10624 :       CALL keyword_release(keyword)
     199              : 
     200              :       CALL keyword_create(keyword, __LOCATION__, name="DISSIPATION", &
     201              :                           description="Dissipation/broadening parameter in the finite-temperature "// &
     202              :                           "Kubo formula.", &
     203              :                           usage="DISSIPATION 300.0", &
     204              :                           default_r_val=cp_unit_to_cp2k(value=300.0_dp, unit_str="K"), &
     205        10624 :                           n_var=1, type_of_var=real_t, unit_str="K")
     206        10624 :       CALL section_add_keyword(section, keyword)
     207        10624 :       CALL keyword_release(keyword)
     208              : 
     209              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_RANGE", &
     210              :                           description="Absolute chemical-potential range. The default 0 0 uses the "// &
     211              :                           "full eigenvalue range of the finite-volume Hamiltonian.", &
     212              :                           usage="ENERGY_RANGE -0.5 0.5", &
     213              :                           default_r_vals=[0.0_dp, 0.0_dp], n_var=2, type_of_var=real_t, &
     214        10624 :                           unit_str="hartree")
     215        10624 :       CALL section_add_keyword(section, keyword)
     216        10624 :       CALL keyword_release(keyword)
     217              : 
     218              :       CALL keyword_create(keyword, __LOCATION__, name="NEUTRAL_MU", &
     219              :                           description="Optional fixed neutral chemical potential. If omitted, the "// &
     220              :                           "neutral point is found from the eigenvalue spectrum and total electron count.", &
     221              :                           usage="NEUTRAL_MU 0.245467619658419", &
     222        10624 :                           n_var=1, type_of_var=real_t, unit_str="hartree")
     223        10624 :       CALL section_add_keyword(section, keyword)
     224        10624 :       CALL keyword_release(keyword)
     225              : 
     226              :       CALL keyword_create(keyword, __LOCATION__, name="N_MU", &
     227              :                           description="Number of chemical-potential grid points.", &
     228              :                           usage="N_MU 200", &
     229        10624 :                           default_i_val=200, n_var=1, type_of_var=integer_t)
     230        10624 :       CALL section_add_keyword(section, keyword)
     231        10624 :       CALL keyword_release(keyword)
     232              : 
     233              :       CALL keyword_create(keyword, __LOCATION__, name="NEUTRAL_GRID", &
     234              :                           description="Number of grid points used to locate the neutral chemical potential.", &
     235              :                           usage="NEUTRAL_GRID 10000", &
     236        10624 :                           default_i_val=10000, n_var=1, type_of_var=integer_t)
     237        10624 :       CALL section_add_keyword(section, keyword)
     238        10624 :       CALL keyword_release(keyword)
     239              : 
     240        10624 :    END SUBROUTINE create_kubo_transport_section
     241              : 
     242              : ! **************************************************************************************************
     243              : !> \brief creates the input structure used to activate
     244              : !>      a resonant inelastic xray scattering (RIXS) calculation
     245              : ! **************************************************************************************************
     246              : 
     247        10624 :    SUBROUTINE create_rixs_section(section)
     248              :       TYPE(section_type), POINTER                        :: section
     249              :       TYPE(section_type), POINTER                        :: subsection, print_key
     250              :       TYPE(keyword_type), POINTER                        :: keyword
     251              : 
     252        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
     253              : 
     254        10624 :       NULLIFY (keyword, subsection, print_key)
     255              : 
     256              :       CALL section_create(section, __LOCATION__, name="RIXS", &
     257              :                           description="Resonant Inelastic Xray Scattering using XAS_TDP and TDDFPT.", &
     258              :                           n_keywords=1, n_subsections=3, repeats=.FALSE., &
     259        21248 :                           citations=[VazdaCruz2021])
     260              : 
     261              :       CALL keyword_create(keyword, __LOCATION__, &
     262              :                           name="_SECTION_PARAMETERS_", &
     263              :                           description="Controls the activation of the RIXS procedure", &
     264              :                           default_l_val=.FALSE., &
     265        10624 :                           lone_keyword_l_val=.TRUE.)
     266        10624 :       CALL section_add_keyword(section, keyword)
     267        10624 :       CALL keyword_release(keyword)
     268              : 
     269              :       CALL keyword_create(keyword, __LOCATION__, name="CORE_STATES", &
     270              :                           description="Number of core excited states to be used in the RIXS "// &
     271              :                           "calculation. Restricting this number reduces computational cost. "// &
     272              :                           "-1 means all available core states will be used.", &
     273        10624 :                           n_var=1, type_of_var=integer_t, default_i_val=-1)
     274        10624 :       CALL section_add_keyword(section, keyword)
     275        10624 :       CALL keyword_release(keyword)
     276              : 
     277              :       CALL keyword_create(keyword, __LOCATION__, name="VALENCE_STATES", &
     278              :                           description="Number of valence excited states to be used in the RIXS "// &
     279              :                           "calculation. Restricting this number reduces computational cost, but "// &
     280              :                           "removes spectral features corresponding to higher excitations. Should be "// &
     281              :                           "used with care. -1 means all available valence states will be used.", &
     282        10624 :                           n_var=1, type_of_var=integer_t, default_i_val=-1)
     283        10624 :       CALL section_add_keyword(section, keyword)
     284        10624 :       CALL keyword_release(keyword)
     285              : 
     286        10624 :       CALL create_tddfpt2_section(subsection)
     287        10624 :       CALL section_add_subsection(section, subsection)
     288        10624 :       CALL section_release(subsection)
     289              : 
     290        10624 :       CALL create_xas_tdp_section(subsection)
     291        10624 :       CALL section_add_subsection(section, subsection)
     292        10624 :       CALL section_release(subsection)
     293              : 
     294              :       CALL section_create(subsection, __LOCATION__, "PRINT", "Controls the printing of information "// &
     295        10624 :                           "during RIXS calculations", repeats=.FALSE.)
     296              : 
     297              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="SPECTRUM", &
     298              :                                        description="Controles the printing of the RIXS spectrum "// &
     299              :                                        "in output files", &
     300              :                                        print_level=low_print_level, filename="", &
     301        10624 :                                        common_iter_levels=3)
     302        10624 :       CALL section_add_subsection(subsection, print_key)
     303        10624 :       CALL section_release(print_key)
     304              : 
     305        10624 :       CALL section_add_subsection(section, subsection)
     306        10624 :       CALL section_release(subsection)
     307              : 
     308        10624 :    END SUBROUTINE create_rixs_section
     309              : 
     310              : ! **************************************************************************************************
     311              : !> \brief creates the input structure used to activate
     312              : !>      a linear response calculation
     313              : !>      Available properties : none
     314              : !> \param section the section to create
     315              : !> \param create_subsections indicates whether or not subsections should be created
     316              : !> \param default_set_tdlr default parameters to be used if called from TDDFPT
     317              : !> \author MI
     318              : ! **************************************************************************************************
     319        31872 :    SUBROUTINE create_linres_section(section, create_subsections, default_set_tdlr)
     320              :       TYPE(section_type), POINTER                        :: section
     321              :       LOGICAL, INTENT(in)                                :: create_subsections
     322              :       LOGICAL, INTENT(IN), OPTIONAL                      :: default_set_tdlr
     323              : 
     324              :       INTEGER                                            :: def_max_iter, def_precond
     325              :       REAL(KIND=DP)                                      :: def_egap, def_eps, def_eps_filter
     326              :       TYPE(keyword_type), POINTER                        :: keyword
     327              :       TYPE(section_type), POINTER                        :: print_key, subsection
     328              : 
     329              :       CHARACTER(len=256)                      :: desc
     330              : 
     331        31872 :       NULLIFY (keyword, print_key)
     332              : 
     333        31872 :       IF (PRESENT(default_set_tdlr)) THEN
     334        21248 :          def_egap = 0.02_dp
     335        21248 :          def_eps = 1.0e-10_dp
     336        21248 :          def_eps_filter = 1.0e-15_dp
     337        21248 :          def_max_iter = 100
     338        21248 :          def_precond = ot_precond_full_single_inverse
     339        21248 :          desc = "Controls the parameters of the LINRES force calculations for excited states."
     340              :       ELSE
     341        10624 :          def_egap = 0.2_dp
     342        10624 :          def_eps = 1.e-6_dp
     343        10624 :          def_eps_filter = 0.0_dp
     344        10624 :          def_max_iter = 50
     345        10624 :          def_precond = ot_precond_none
     346        10624 :          desc = "The linear response is used to calculate one of the following properties: nmr, epr, raman, ..."
     347              :       END IF
     348              : 
     349        31872 :       CPASSERT(.NOT. ASSOCIATED(section))
     350              :       CALL section_create(section, __LOCATION__, name="linres", &
     351              :                           description=desc, n_keywords=5, n_subsections=2, repeats=.FALSE., &
     352        63744 :                           citations=[Putrino2000])
     353              : 
     354              :       CALL keyword_create(keyword, __LOCATION__, name="EPS", &
     355              :                           description="target accuracy for the convergence of the conjugate gradient.", &
     356        31872 :                           usage="EPS 1.e-6", default_r_val=def_eps)
     357        31872 :       CALL section_add_keyword(section, keyword)
     358        31872 :       CALL keyword_release(keyword)
     359              : 
     360              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
     361              :                           description="Filter threshold for response density matrix.", &
     362        31872 :                           usage="EPS_FILTER 1.e-8", default_r_val=def_eps_filter)
     363        31872 :       CALL section_add_keyword(section, keyword)
     364        31872 :       CALL keyword_release(keyword)
     365              : 
     366              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
     367              :                           description="Maximum number of conjugate gradient iteration to be performed for one optimization.", &
     368        31872 :                           usage="MAX_ITER 200", default_i_val=def_max_iter)
     369        31872 :       CALL section_add_keyword(section, keyword)
     370        31872 :       CALL keyword_release(keyword)
     371              : 
     372              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_EVERY", &
     373              :                           description="Restart the conjugate gradient after the specified number of iterations.", &
     374        31872 :                           usage="RESTART_EVERY 200", default_i_val=50)
     375        31872 :       CALL section_add_keyword(section, keyword)
     376        31872 :       CALL keyword_release(keyword)
     377              : 
     378              :       CALL keyword_create( &
     379              :          keyword, __LOCATION__, name="PRECONDITIONER", &
     380              :          description="Type of preconditioner to be used with all minimization schemes. "// &
     381              :          "They differ in effectiveness, cost of construction, cost of application. "// &
     382              :          "Properly preconditioned minimization can be orders of magnitude faster than doing nothing.", &
     383              :          usage="PRECONDITIONER FULL_ALL", &
     384              :          default_i_val=def_precond, &
     385              :          enum_c_vals=s2a("FULL_ALL", "FULL_SINGLE_INVERSE", "FULL_SINGLE", "FULL_KINETIC", "FULL_S_INVERSE", &
     386              :                          "NONE"), &
     387              :          enum_desc=s2a("Most effective state selective preconditioner based on diagonalization, "// &
     388              :                        "requires the ENERGY_GAP parameter to be an underestimate of the HOMO-LUMO gap. "// &
     389              :                        "This preconditioner is recommended for almost all systems, except very large systems where "// &
     390              :                        "make_preconditioner would dominate the total computational cost.", &
     391              :                        "Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
     392              :                        "but cheaper to construct, "// &
     393              :                        "might be somewhat less robust. Recommended for large systems.", &
     394              :                        "Based on H-eS diagonalisation, not as good as FULL_ALL, but somewhat cheaper to apply. ", &
     395              :                        "Cholesky inversion of S and T, fast construction, robust, and relatively good, "// &
     396              :                        "use for very large systems.", &
     397              :                        "Cholesky inversion of S, not as good as FULL_KINETIC, yet equally expensive.", &
     398              :                        "skip preconditioning"), &
     399              :          enum_i_vals=[ot_precond_full_all, ot_precond_full_single_inverse, ot_precond_full_single, &
     400        31872 :                       ot_precond_full_kinetic, ot_precond_s_inverse, ot_precond_none])
     401        31872 :       CALL section_add_keyword(section, keyword)
     402        31872 :       CALL keyword_release(keyword)
     403              : 
     404              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_GAP", &
     405              :                           description="Energy gap estimate [a.u.] for preconditioning", &
     406              :                           usage="ENERGY_GAP 0.1", &
     407        31872 :                           default_r_val=def_egap)
     408        31872 :       CALL section_add_keyword(section, keyword)
     409        31872 :       CALL keyword_release(keyword)
     410              : 
     411              :       CALL keyword_create(keyword, __LOCATION__, name="EVERY_N_STEP", &
     412              :                           description="Perform a linear response calculation every N-th step for MD run", &
     413        31872 :                           usage="EVERY_N_STEP 50", default_i_val=1)
     414        31872 :       CALL section_add_keyword(section, keyword)
     415        31872 :       CALL keyword_release(keyword)
     416              : 
     417              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
     418              :                           description="Restart the response calculation if the restart file exists", &
     419              :                           usage="RESTART", &
     420        31872 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     421        31872 :       CALL section_add_keyword(section, keyword)
     422        31872 :       CALL keyword_release(keyword)
     423              : 
     424              :       CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
     425              :                           variants=["RESTART_FILE_NAME"], &
     426              :                           description="Root of the file names where to read the response functions from "// &
     427              :                           "which to restart the calculation of the linear response", &
     428              :                           usage="WFN_RESTART_FILE_NAME <FILENAME>", &
     429        63744 :                           type_of_var=lchar_t)
     430        31872 :       CALL section_add_keyword(section, keyword)
     431        31872 :       CALL keyword_release(keyword)
     432              : 
     433        31872 :       IF (create_subsections) THEN
     434        10624 :          NULLIFY (subsection)
     435              : 
     436        10624 :          CALL create_localize_section(subsection)
     437        10624 :          CALL section_add_subsection(section, subsection)
     438        10624 :          CALL section_release(subsection)
     439              : 
     440        10624 :          CALL create_current_section(subsection)
     441        10624 :          CALL section_add_subsection(section, subsection)
     442        10624 :          CALL section_release(subsection)
     443              : 
     444        10624 :          CALL create_nmr_section(subsection)
     445        10624 :          CALL section_add_subsection(section, subsection)
     446        10624 :          CALL section_release(subsection)
     447              : 
     448        10624 :          CALL create_spin_spin_section(subsection)
     449        10624 :          CALL section_add_subsection(section, subsection)
     450        10624 :          CALL section_release(subsection)
     451              : 
     452        10624 :          CALL create_epr_section(subsection)
     453        10624 :          CALL section_add_subsection(section, subsection)
     454        10624 :          CALL section_release(subsection)
     455              : 
     456        10624 :          CALL create_polarizability_section(subsection)
     457        10624 :          CALL section_add_subsection(section, subsection)
     458        10624 :          CALL section_release(subsection)
     459              : 
     460        10624 :          CALL create_dcdr_section(subsection)
     461        10624 :          CALL section_add_subsection(section, subsection)
     462        10624 :          CALL section_release(subsection)
     463              : 
     464        10624 :          CALL create_vcd_section(subsection)
     465        10624 :          CALL section_add_subsection(section, subsection)
     466        10624 :          CALL section_release(subsection)
     467              : 
     468              :          CALL section_create(subsection, __LOCATION__, name="PRINT", &
     469              :                              description="printing of information during the linear response calculation", &
     470        10624 :                              repeats=.FALSE.)
     471              : 
     472              :          CALL cp_print_key_section_create( &
     473              :             print_key, __LOCATION__, "program_run_info", &
     474              :             description="Controls the printing of basic iteration information during the LINRES calculation", &
     475        10624 :             print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     476        10624 :          CALL section_add_subsection(subsection, print_key)
     477        10624 :          CALL section_release(print_key)
     478              : 
     479              :          CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
     480              :                                           description="Controls the dumping of restart file of the response wavefunction. "// &
     481              :                                           "For each set of response functions, i.e. for each perturbation, "// &
     482              :                                           "one different restart file is dumped. These restart files should be "// &
     483              :                                           "employed only to restart the same type of LINRES calculation, "// &
     484              :                                           "i.e. with the same perturbation.", &
     485              :                                           print_level=low_print_level, common_iter_levels=3, each_iter_names=s2a("ITER"), &
     486        10624 :                                           add_last=add_last_numeric, each_iter_values=[3], filename="")
     487        10624 :          CALL section_add_subsection(subsection, print_key)
     488        10624 :          CALL section_release(print_key)
     489              : 
     490        10624 :          CALL section_add_subsection(section, subsection)
     491        10624 :          CALL section_release(subsection)
     492              : 
     493              :       END IF
     494              : 
     495        31872 :    END SUBROUTINE create_linres_section
     496              : 
     497              : ! **************************************************************************************************
     498              : !> \brief creates the input structure used to activate
     499              : !>      calculation of position perturbation  DFPT
     500              : !> \param section ...
     501              : !> \author Sandra Luber, Edward Ditler
     502              : ! **************************************************************************************************
     503        10624 :    SUBROUTINE create_dcdr_section(section)
     504              : 
     505              :       TYPE(section_type), POINTER                        :: section
     506              : 
     507              :       LOGICAL                                            :: failure
     508              :       TYPE(keyword_type), POINTER                        :: keyword
     509              :       TYPE(section_type), POINTER                        :: print_key, subsection
     510              : 
     511        10624 :       failure = .FALSE.
     512        10624 :       NULLIFY (keyword, print_key, subsection)
     513              : 
     514        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
     515              : 
     516              :       IF (.NOT. failure) THEN
     517              :          CALL section_create(section, __LOCATION__, name="DCDR", &
     518              :                              description="Compute analytical gradients the dipole moments.", &
     519        10624 :                              n_keywords=50, n_subsections=1, repeats=.FALSE.)
     520              : 
     521              :          CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     522              :                              description="Controls the activation of the APT calculation. "// &
     523              :                              "Analytical derivatives are not available for functionals that depend on "// &
     524              :                              "the kinetic energy density; use APT_FD for these functionals.", &
     525              :                              usage="&DCDR T", &
     526              :                              default_l_val=.FALSE., &
     527        10624 :                              lone_keyword_l_val=.TRUE.)
     528        10624 :          CALL section_add_keyword(section, keyword)
     529        10624 :          CALL keyword_release(keyword)
     530              : 
     531              :          CALL keyword_create(keyword, __LOCATION__, name="LIST_OF_ATOMS", &
     532              :                              description="Specifies a list of atoms.", &
     533              :                              usage="LIST_OF_ATOMS {integer} {integer} .. {integer}", repeats=.TRUE., &
     534        10624 :                              n_var=-1, type_of_var=integer_t)
     535        10624 :          CALL section_add_keyword(section, keyword)
     536        10624 :          CALL keyword_release(keyword)
     537              : 
     538              :          CALL keyword_create(keyword, __LOCATION__, name="DISTRIBUTED_ORIGIN", &
     539              :                              variants=["DO_GAUGE"], &
     540              :                              description="Use the distributed origin (DO) gauge?", &
     541              :                              usage="DISTRIBUTED_ORIGIN T", &
     542        21248 :                              default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     543        10624 :          CALL section_add_keyword(section, keyword)
     544        10624 :          CALL keyword_release(keyword)
     545              : 
     546              :          CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
     547              :                              description="The orbital center.", &
     548              :                              usage="ORBITAL_CENTER WANNIER", &
     549              :                              default_i_val=current_orb_center_wannier, &
     550              :                              enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
     551              :                              enum_desc=s2a("Use the Wannier centers.", &
     552              :                                            "Use a common center (works only for an isolate molecule).", &
     553              :                                            "Use the atoms as center.", &
     554              :                                            "Boxing."), &
     555              :                              enum_i_vals=[current_orb_center_wannier, current_orb_center_common, &
     556        10624 :                                           current_orb_center_atom, current_orb_center_box])
     557        10624 :          CALL section_add_keyword(section, keyword)
     558        10624 :          CALL keyword_release(keyword)
     559              : 
     560              :          CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
     561              :                              description="Gauge origin of the velocity gauge factor.", &
     562              :                              enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
     563              :                              enum_desc=s2a("Use Center of Mass", &
     564              :                                            "Use Center of Atomic Charges", &
     565              :                                            "Use User-defined Point", &
     566              :                                            "Use Origin of Coordinate System"), &
     567              :                              enum_i_vals=[use_mom_ref_com, &
     568              :                                           use_mom_ref_coac, &
     569              :                                           use_mom_ref_user, &
     570              :                                           use_mom_ref_zero], &
     571        10624 :                              default_i_val=use_mom_ref_zero)
     572        10624 :          CALL section_add_keyword(section, keyword)
     573        10624 :          CALL keyword_release(keyword)
     574              : 
     575              :          CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
     576              :                              description="User-defined reference point of the velocity gauge factor.", &
     577              :                              usage="REFERENCE_POINT x y z", &
     578        10624 :                              repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
     579        10624 :          CALL section_add_keyword(section, keyword)
     580        10624 :          CALL keyword_release(keyword)
     581              : 
     582              :          CALL keyword_create(keyword, __LOCATION__, name="Z_MATRIX_METHOD", &
     583              :                              description="Use Z_matrix method to solve the response equation", &
     584              :                              usage="Z_MATRIX_METHOD T", &
     585        10624 :                              default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     586        10624 :          CALL section_add_keyword(section, keyword)
     587        10624 :          CALL keyword_release(keyword)
     588              : 
     589              :          CALL keyword_create(keyword, __LOCATION__, name="APT_FD", &
     590              :                              description="Use numerical differentiation to compute the APT, "// &
     591              :                              "switches off the calculation of dcdr analytical derivatives. "// &
     592              :                              "Requires RUN_TYPE = ENERGY_FORCE or MD.", &
     593              :                              usage="APT_FD T", &
     594        10624 :                              default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     595        10624 :          CALL section_add_keyword(section, keyword)
     596        10624 :          CALL keyword_release(keyword)
     597              : 
     598              :          CALL keyword_create(keyword, __LOCATION__, name="APT_FD_DE", &
     599              :                              description="Electric field strength (atomic units) to use for finite differences", &
     600              :                              repeats=.FALSE., &
     601              :                              n_var=1, &
     602              :                              type_of_var=real_t, &
     603              :                              default_r_val=0.0003_dp, &
     604        10624 :                              usage="APT_FD_DE 1.0E-4")
     605        10624 :          CALL section_add_keyword(section, keyword)
     606        10624 :          CALL keyword_release(keyword)
     607              : 
     608              :          CALL keyword_create(keyword, __LOCATION__, name="APT_FD_METHOD", &
     609              :                              description="Numerical differentiation method", &
     610              :                              usage="APT_FD_METHOD FD", &
     611              :                              default_i_val=1, &
     612              :                              !enum_c_vals=s2a("FD", "2PNT"), &
     613              :                              enum_c_vals=s2a("2PNT"), &
     614              :                              !enum_desc=s2a("Forward differences.", &
     615              :                              !              "Symmetric two-point differences."), &
     616              :                              enum_desc=s2a("Symmetric two-point differences."), &
     617              :                              !enum_i_vals=(/0, 1/))
     618        10624 :                              enum_i_vals=[1])
     619        10624 :          CALL section_add_keyword(section, keyword)
     620        10624 :          CALL keyword_release(keyword)
     621              : 
     622        10624 :          NULLIFY (subsection)
     623              :          CALL section_create(subsection, __LOCATION__, name="PRINT", &
     624              :                              description="print results of the magnetic dipole moment calculation", &
     625        10624 :                              repeats=.FALSE.)
     626              : 
     627              :          CALL cp_print_key_section_create(print_key, __LOCATION__, "APT", &
     628              :                                           description="Controls the printing of the electric dipole gradient", &
     629        10624 :                                           print_level=low_print_level, add_last=add_last_numeric, filename="")
     630        10624 :          CALL section_add_subsection(subsection, print_key)
     631        10624 :          CALL section_release(print_key)
     632              : 
     633        10624 :          CALL section_add_subsection(section, subsection)
     634        10624 :          CALL section_release(subsection)
     635              : 
     636        10624 :          NULLIFY (subsection)
     637        10624 :          CALL create_interp_section(subsection)
     638        10624 :          CALL section_add_subsection(section, subsection)
     639        10624 :          CALL section_release(subsection)
     640              : 
     641              :       END IF
     642              : 
     643        10624 :    END SUBROUTINE create_dcdr_section
     644              : 
     645              : ! **************************************************************************************************
     646              : !> \brief creates the input structure used to activate
     647              : !>      calculation of VCD spectra using DFPT
     648              : !> \param section ...
     649              : !> \author Sandra Luber, Tomas Zimmermann, Edward Ditler
     650              : ! **************************************************************************************************
     651        10624 :    SUBROUTINE create_vcd_section(section)
     652              : 
     653              :       TYPE(section_type), POINTER                        :: section
     654              : 
     655              :       TYPE(keyword_type), POINTER                        :: keyword
     656              :       TYPE(section_type), POINTER                        :: print_key, subsection
     657              : 
     658        10624 :       NULLIFY (keyword, print_key, subsection)
     659              : 
     660        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
     661              : 
     662              :       CALL section_create(section, __LOCATION__, name="VCD", &
     663              :                           description="Carry out a VCD calculation.", &
     664        10624 :                           n_keywords=50, n_subsections=1, repeats=.FALSE.)
     665              : 
     666              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     667              :                           description="controls the activation of the APT/AAT calculation", &
     668              :                           usage="&VCD T", &
     669              :                           default_l_val=.FALSE., &
     670        10624 :                           lone_keyword_l_val=.TRUE.)
     671        10624 :       CALL section_add_keyword(section, keyword)
     672        10624 :       CALL keyword_release(keyword)
     673              : 
     674              :       CALL keyword_create(keyword, __LOCATION__, name="LIST_OF_ATOMS", &
     675              :                           description="Specifies a list of atoms.", &
     676              :                           usage="LIST_OF_ATOMS {integer} {integer} .. {integer}", repeats=.TRUE., &
     677        10624 :                           n_var=-1, type_of_var=integer_t)
     678        10624 :       CALL section_add_keyword(section, keyword)
     679        10624 :       CALL keyword_release(keyword)
     680              : 
     681              :       CALL keyword_create(keyword, __LOCATION__, name="DISTRIBUTED_ORIGIN", &
     682              :                           variants=["DO_GAUGE"], &
     683              :                           description="Use the distributed origin (DO) gauge?", &
     684              :                           usage="DISTRIBUTED_ORIGIN T", &
     685        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     686        10624 :       CALL section_add_keyword(section, keyword)
     687        10624 :       CALL keyword_release(keyword)
     688              : 
     689              :       CALL keyword_create(keyword, __LOCATION__, name="ORIGIN_DEPENDENT_MFP", &
     690              :                           description="Use the origin dependent MFP operator.", &
     691              :                           usage="ORIGIN_DEPENDENT_MFP T", &
     692        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     693        10624 :       CALL section_add_keyword(section, keyword)
     694        10624 :       CALL keyword_release(keyword)
     695              : 
     696              :       CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
     697              :                           description="The orbital center.", &
     698              :                           usage="ORBITAL_CENTER WANNIER", &
     699              :                           default_i_val=current_orb_center_wannier, &
     700              :                           enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
     701              :                           enum_desc=s2a("Use the Wannier centers.", &
     702              :                                         "Use a common center (works only for an isolate molecule).", &
     703              :                                         "Use the atoms as center.", &
     704              :                                         "Boxing."), &
     705              :                           enum_i_vals=[current_orb_center_wannier, current_orb_center_common, &
     706        10624 :                                        current_orb_center_atom, current_orb_center_box])
     707        10624 :       CALL section_add_keyword(section, keyword)
     708        10624 :       CALL keyword_release(keyword)
     709              : 
     710              :       ! The origin of the magnetic dipole operator (r - MAGNETIC_ORIGIN) x momentum
     711              :       CALL keyword_create(keyword, __LOCATION__, name="MAGNETIC_ORIGIN", &
     712              :                           description="Gauge origin of the magnetic dipole operator.", &
     713              :                           enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
     714              :                           enum_desc=s2a("Use Center of Mass", &
     715              :                                         "Use Center of Atomic Charges", &
     716              :                                         "Use User-defined Point", &
     717              :                                         "Use Origin of Coordinate System"), &
     718              :                           enum_i_vals=[use_mom_ref_com, &
     719              :                                        use_mom_ref_coac, &
     720              :                                        use_mom_ref_user, &
     721              :                                        use_mom_ref_zero], &
     722        10624 :                           default_i_val=use_mom_ref_zero)
     723        10624 :       CALL section_add_keyword(section, keyword)
     724        10624 :       CALL keyword_release(keyword)
     725              : 
     726              :       CALL keyword_create(keyword, __LOCATION__, name="MAGNETIC_ORIGIN_REFERENCE", &
     727              :                           description="User-defined reference point of the magnetic dipole operator.", &
     728              :                           usage="MAGNETIC_ORIGIN_REFERENCE x y z", &
     729        10624 :                           repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
     730        10624 :       CALL section_add_keyword(section, keyword)
     731        10624 :       CALL keyword_release(keyword)
     732              : 
     733              :       ! The origin of the coordinate system
     734              :       CALL keyword_create(keyword, __LOCATION__, name="SPATIAL_ORIGIN", &
     735              :                           description="Gauge origin of the velocity gauge factor/spatial origin.", &
     736              :                           enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
     737              :                           enum_desc=s2a("Use Center of Mass", &
     738              :                                         "Use Center of Atomic Charges", &
     739              :                                         "Use User-defined Point", &
     740              :                                         "Use Origin of Coordinate System"), &
     741              :                           enum_i_vals=[use_mom_ref_com, &
     742              :                                        use_mom_ref_coac, &
     743              :                                        use_mom_ref_user, &
     744              :                                        use_mom_ref_zero], &
     745        10624 :                           default_i_val=use_mom_ref_zero)
     746        10624 :       CALL section_add_keyword(section, keyword)
     747        10624 :       CALL keyword_release(keyword)
     748              : 
     749              :       CALL keyword_create(keyword, __LOCATION__, name="SPATIAL_ORIGIN_REFERENCE", &
     750              :                           description="User-defined reference point of the velocity gauge factor/spatial origin.", &
     751              :                           usage="SPATIAL_ORIGIN_REFERENCE x y z", &
     752        10624 :                           repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
     753        10624 :       CALL section_add_keyword(section, keyword)
     754        10624 :       CALL keyword_release(keyword)
     755              : 
     756        10624 :       NULLIFY (subsection)
     757              :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
     758              :                           description="print results of the magnetic dipole moment calculation", &
     759        10624 :                           repeats=.FALSE.)
     760              : 
     761              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "VCD", &
     762              :                                        description="Controls the printing of the APTs and AATs", &
     763        10624 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="")
     764        10624 :       CALL section_add_subsection(subsection, print_key)
     765        10624 :       CALL section_release(print_key)
     766              : 
     767        10624 :       CALL section_add_subsection(section, subsection)
     768        10624 :       CALL section_release(subsection)
     769              : 
     770        10624 :       NULLIFY (subsection)
     771        10624 :       CALL create_interp_section(subsection)
     772        10624 :       CALL section_add_subsection(section, subsection)
     773        10624 :       CALL section_release(subsection)
     774              : 
     775        10624 :    END SUBROUTINE create_vcd_section
     776              : 
     777              : ! **************************************************************************************************
     778              : !> \brief creates the input structure used to activate
     779              : !>      calculation of induced current  DFPT
     780              : !>      Available properties : none
     781              : !> \param section the section to create
     782              : !> \author  MI/VW
     783              : ! **************************************************************************************************
     784        10624 :    SUBROUTINE create_current_section(section)
     785              :       TYPE(section_type), POINTER                        :: section
     786              : 
     787              :       TYPE(keyword_type), POINTER                        :: keyword
     788              :       TYPE(section_type), POINTER                        :: print_key, subsection
     789              : 
     790        10624 :       NULLIFY (keyword, print_key, subsection)
     791              : 
     792        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
     793              :       CALL section_create(section, __LOCATION__, name="current", &
     794              :                           description="The induced current density is calculated by DFPT.", &
     795              :                           n_keywords=4, n_subsections=1, repeats=.FALSE., &
     796        31872 :                           citations=[Sebastiani2001, Weber2009])
     797              : 
     798              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     799              :                           description="controls the activation of the induced current calculation", &
     800              :                           usage="&CURRENT T", &
     801              :                           default_l_val=.FALSE., &
     802        10624 :                           lone_keyword_l_val=.TRUE.)
     803        10624 :       CALL section_add_keyword(section, keyword)
     804        10624 :       CALL keyword_release(keyword)
     805              : 
     806              :       CALL keyword_create(keyword, __LOCATION__, name="GAUGE", &
     807              :                           description="The gauge used to compute the induced current within GAPW.", &
     808              :                           usage="GAUGE R", &
     809              :                           default_i_val=current_gauge_r_and_step_func, &
     810              :                           enum_c_vals=s2a("R", "R_AND_STEP_FUNCTION", "ATOM"), &
     811              :                           enum_desc=s2a("Position gauge (doesnt work well).", &
     812              :                                         "Position and step function for the soft and the local parts, respectively.", &
     813              :                                         "Atoms."), &
     814        10624 :                           enum_i_vals=[current_gauge_r, current_gauge_r_and_step_func, current_gauge_atom])
     815        10624 :       CALL section_add_keyword(section, keyword)
     816        10624 :       CALL keyword_release(keyword)
     817              : 
     818              :       CALL keyword_create(keyword, __LOCATION__, name="GAUGE_ATOM_RADIUS", &
     819              :                           description="Build the gauge=atom using only the atoms within this radius.", &
     820              :                           usage="GAUGE_ATOM_RADIUS 10.0", &
     821              :                           type_of_var=real_t, &
     822              :                           default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
     823        10624 :                           unit_str="angstrom")
     824        10624 :       CALL section_add_keyword(section, keyword)
     825        10624 :       CALL keyword_release(keyword)
     826              : 
     827              :       CALL keyword_create(keyword, __LOCATION__, name="USE_OLD_GAUGE_ATOM", &
     828              :                           description="Use the old way to compute the gauge.", &
     829              :                           usage="USE_OLD_GAUGE_ATOM T", &
     830        10624 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     831        10624 :       CALL section_add_keyword(section, keyword)
     832        10624 :       CALL keyword_release(keyword)
     833              : 
     834              :       CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
     835              :                           description="The orbital center.", &
     836              :                           usage="ORBITAL_CENTER WANNIER", &
     837              :                           default_i_val=current_orb_center_wannier, &
     838              :                           enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
     839              :                           enum_desc=s2a("Use the Wannier centers.", &
     840              :                                         "Use a common center (works only for an isolate molecule).", &
     841              :                                         "Use the atoms as center.", &
     842              :                                         "Boxing."), &
     843              :                           enum_i_vals=[current_orb_center_wannier, current_orb_center_common, &
     844        10624 :                                        current_orb_center_atom, current_orb_center_box])
     845        10624 :       CALL section_add_keyword(section, keyword)
     846        10624 :       CALL keyword_release(keyword)
     847              : 
     848              :       CALL keyword_create(keyword, __LOCATION__, name="COMMON_CENTER", &
     849              :                           description="The common center ", usage="COMMON_CENTER 0.0 1.0 0.0", &
     850              :                           n_var=3, default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp], type_of_var=real_t, &
     851        10624 :                           unit_str="angstrom")
     852        10624 :       CALL section_add_keyword(section, keyword)
     853        10624 :       CALL keyword_release(keyword)
     854              : 
     855              :       CALL keyword_create(keyword, __LOCATION__, name="NBOX", &
     856              :                           description="How many boxes along each directions ", usage="NBOX 6 6 5", &
     857        10624 :                           n_var=3, default_i_vals=[4, 4, 4], type_of_var=integer_t)
     858        10624 :       CALL section_add_keyword(section, keyword)
     859        10624 :       CALL keyword_release(keyword)
     860              : 
     861              :       CALL keyword_create(keyword, __LOCATION__, name="CHI_PBC", &
     862              :                           description="Calculate the succeptibility correction to the shift with PBC", &
     863              :                           usage="CHI_PBC T", &
     864        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     865        10624 :       CALL section_add_keyword(section, keyword)
     866        10624 :       CALL keyword_release(keyword)
     867              : 
     868              :       CALL keyword_create(keyword, __LOCATION__, name="FORCE_NO_FULL", &
     869              :                           description="Avoid the calculation of the state dependent perturbation term, "// &
     870              :                           "even if the orbital centers are set at Wannier centers or at Atom centers", &
     871              :                           usage="FORCE_NO_FULL T", &
     872        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     873        10624 :       CALL section_add_keyword(section, keyword)
     874        10624 :       CALL keyword_release(keyword)
     875              : 
     876              :       CALL keyword_create(keyword, __LOCATION__, name="SELECTED_STATES_ON_ATOM_LIST", &
     877              :                           description="Indexes of the atoms for selecting"// &
     878              :                           " the states to be used for the response calculations.", &
     879              :                           usage="SELECTED_STATES_ON_ATOM_LIST 1 2 10", &
     880        10624 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
     881        10624 :       CALL section_add_keyword(section, keyword)
     882        10624 :       CALL keyword_release(keyword)
     883              : 
     884              :       CALL keyword_create(keyword, __LOCATION__, name="SELECTED_STATES_ATOM_RADIUS", &
     885              :                           description="Select all the states included in the given radius around each atoms "// &
     886              :                           "in SELECTED_STATES_ON_ATOM_LIST.", &
     887              :                           usage="SELECTED_STATES_ATOM_RADIUS 2.0", &
     888              :                           type_of_var=real_t, &
     889              :                           default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
     890        10624 :                           unit_str="angstrom")
     891        10624 :       CALL section_add_keyword(section, keyword)
     892        10624 :       CALL keyword_release(keyword)
     893              : 
     894              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_CURRENT", &
     895              :                           description="Restart the induced current density calculation"// &
     896              :                           " from a previous run (not working yet).", &
     897              :                           usage="RESTART_CURRENT", default_l_val=.FALSE., &
     898        10624 :                           lone_keyword_l_val=.TRUE.)
     899        10624 :       CALL section_add_keyword(section, keyword)
     900        10624 :       CALL keyword_release(keyword)
     901              : 
     902        10624 :       NULLIFY (subsection)
     903              :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
     904              :                           description="print results of induced current density calculation", &
     905        10624 :                           repeats=.FALSE.)
     906              : 
     907              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT_CUBES", &
     908              :                                        description="Controls the printing of the induced current density (not working yet).", &
     909        10624 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
     910              :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     911              :                           description="The stride (X,Y,Z) used to write the cube file "// &
     912              :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     913              :                           " 1 number valid for all components (not working yet).", &
     914        10624 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
     915        10624 :       CALL section_add_keyword(print_key, keyword)
     916        10624 :       CALL keyword_release(keyword)
     917              :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     918              :                           description="append the cube files when they already exist", &
     919        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     920        10624 :       CALL section_add_keyword(print_key, keyword)
     921        10624 :       CALL keyword_release(keyword)
     922              : 
     923        10624 :       CALL section_add_subsection(subsection, print_key)
     924        10624 :       CALL section_release(print_key)
     925              : 
     926              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
     927              :                                        description="Controls the printing of the response functions (not working yet).", &
     928        10624 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
     929              :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     930              :                           description="The stride (X,Y,Z) used to write the cube file "// &
     931              :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     932              :                           " 1 number valid for all components (not working yet).", &
     933        10624 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
     934        10624 :       CALL section_add_keyword(print_key, keyword)
     935        10624 :       CALL keyword_release(keyword)
     936              : 
     937              :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
     938              :                           variants=["CUBES_LU"], &
     939              :                           description="The lower and upper index of the states to be printed as cube (not working yet).", &
     940              :                           usage="CUBES_LU_BOUNDS integer integer", &
     941        21248 :                           n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
     942        10624 :       CALL section_add_keyword(print_key, keyword)
     943        10624 :       CALL keyword_release(keyword)
     944              : 
     945              :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
     946              :                           description="Indexes of the states to be printed as cube files "// &
     947              :                           "This keyword can be repeated several times "// &
     948              :                           "(useful if you have to specify many indexes) (not working yet).", &
     949              :                           usage="CUBES_LIST 1 2", &
     950        10624 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
     951        10624 :       CALL section_add_keyword(print_key, keyword)
     952        10624 :       CALL keyword_release(keyword)
     953              :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     954              :                           description="append the cube files when they already exist", &
     955        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     956        10624 :       CALL section_add_keyword(print_key, keyword)
     957        10624 :       CALL keyword_release(keyword)
     958              : 
     959        10624 :       CALL section_add_subsection(subsection, print_key)
     960        10624 :       CALL section_release(print_key)
     961              : 
     962        10624 :       CALL section_add_subsection(section, subsection)
     963        10624 :       CALL section_release(subsection)
     964              : 
     965        10624 :       NULLIFY (subsection)
     966        10624 :       CALL create_interp_section(subsection)
     967        10624 :       CALL section_add_subsection(section, subsection)
     968        10624 :       CALL section_release(subsection)
     969              : 
     970        10624 :    END SUBROUTINE create_current_section
     971              : 
     972              : ! **************************************************************************************************
     973              : !> \brief creates the input structure used to activate
     974              : !>         calculation of NMR chemical shift using
     975              : !>         the induced current obtained from DFPT
     976              : !>      Available properties : none
     977              : !> \param section the section to create
     978              : !> \author  MI/VW
     979              : ! **************************************************************************************************
     980        10624 :    SUBROUTINE create_nmr_section(section)
     981              :       TYPE(section_type), POINTER                        :: section
     982              : 
     983              :       TYPE(keyword_type), POINTER                        :: keyword
     984              :       TYPE(section_type), POINTER                        :: print_key, subsection
     985              : 
     986        10624 :       NULLIFY (keyword, print_key, subsection)
     987              : 
     988        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
     989              :       CALL section_create(section, __LOCATION__, name="nmr", &
     990              :                           description="The chemical shift is calculated by DFPT.", &
     991              :                           n_keywords=5, n_subsections=1, repeats=.FALSE., &
     992        21248 :                           citations=[Weber2009])
     993              : 
     994              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     995              :                           description="controls the activation of the nmr calculation", &
     996              :                           usage="&NMR T", &
     997              :                           default_l_val=.FALSE., &
     998        10624 :                           lone_keyword_l_val=.TRUE.)
     999        10624 :       CALL section_add_keyword(section, keyword)
    1000        10624 :       CALL keyword_release(keyword)
    1001              : 
    1002              :       CALL keyword_create(keyword, __LOCATION__, name="INTERPOLATE_SHIFT", &
    1003              :                           description="Calculate the soft part of the chemical shift by interpolation ", &
    1004              :                           usage="INTERPOLATE_SHIFT T", &
    1005        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1006        10624 :       CALL section_add_keyword(section, keyword)
    1007        10624 :       CALL keyword_release(keyword)
    1008              : 
    1009              :       CALL keyword_create(keyword, __LOCATION__, name="NICS", &
    1010              :                           description="Calculate the chemical shift in a set of points"// &
    1011              :                           " given from an external file", usage="NICS", &
    1012        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1013        10624 :       CALL section_add_keyword(section, keyword)
    1014        10624 :       CALL keyword_release(keyword)
    1015              : 
    1016              :       CALL keyword_create(keyword, __LOCATION__, name="NICS_FILE_NAME", &
    1017              :                           description="Name of the file with the NICS points coordinates", &
    1018              :                           usage="NICS_FILE_NAME nics_file", &
    1019        10624 :                           default_lc_val="nics_file")
    1020        10624 :       CALL section_add_keyword(section, keyword)
    1021        10624 :       CALL keyword_release(keyword)
    1022              : 
    1023              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_NMR", &
    1024              :                           description="Restart the NMR calculation from a previous run (NOT WORKING YET)", &
    1025              :                           usage="RESTART_NMR", default_l_val=.FALSE., &
    1026        10624 :                           lone_keyword_l_val=.TRUE.)
    1027        10624 :       CALL section_add_keyword(section, keyword)
    1028        10624 :       CALL keyword_release(keyword)
    1029              : 
    1030              :       CALL keyword_create(keyword, __LOCATION__, name="SHIFT_GAPW_RADIUS", &
    1031              :                           description="While computing the local part of the shift (GAPW), "// &
    1032              :                           "the integration is restricted to nuclei that are within this radius.", &
    1033              :                           usage="SHIFT_GAPW_RADIUS 20.0", &
    1034              :                           type_of_var=real_t, &
    1035              :                           default_r_val=cp_unit_to_cp2k(value=60.0_dp, unit_str="angstrom"), &
    1036        10624 :                           unit_str="angstrom")
    1037        10624 :       CALL section_add_keyword(section, keyword)
    1038        10624 :       CALL keyword_release(keyword)
    1039              : 
    1040        10624 :       NULLIFY (subsection)
    1041              :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1042              :                           description="print results of nmr calculation", &
    1043        10624 :                           repeats=.FALSE.)
    1044              : 
    1045              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
    1046              :                                        description="Controls the printing of the response functions ", &
    1047        10624 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
    1048              :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    1049              :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1050              :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    1051              :                           " 1 number valid for all components.", &
    1052        10624 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
    1053        10624 :       CALL section_add_keyword(print_key, keyword)
    1054        10624 :       CALL keyword_release(keyword)
    1055              : 
    1056              :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
    1057              :                           variants=["CUBES_LU"], &
    1058              :                           description="The lower and upper index of the states to be printed as cube", &
    1059              :                           usage="CUBES_LU_BOUNDS integer integer", &
    1060        21248 :                           n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
    1061        10624 :       CALL section_add_keyword(print_key, keyword)
    1062        10624 :       CALL keyword_release(keyword)
    1063              : 
    1064              :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
    1065              :                           description="Indexes of the states to be printed as cube files "// &
    1066              :                           "This keyword can be repeated several times "// &
    1067              :                           "(useful if you have to specify many indexes).", &
    1068              :                           usage="CUBES_LIST 1 2", &
    1069        10624 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
    1070        10624 :       CALL section_add_keyword(print_key, keyword)
    1071        10624 :       CALL keyword_release(keyword)
    1072              :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1073              :                           description="append the cube files when they already exist", &
    1074        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1075        10624 :       CALL section_add_keyword(print_key, keyword)
    1076        10624 :       CALL keyword_release(keyword)
    1077              : 
    1078        10624 :       CALL section_add_subsection(subsection, print_key)
    1079        10624 :       CALL section_release(print_key)
    1080              : 
    1081              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CHI_TENSOR", &
    1082              :                                        description="Controls the printing of susceptibility", &
    1083        10624 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
    1084        10624 :       CALL section_add_subsection(subsection, print_key)
    1085        10624 :       CALL section_release(print_key)
    1086              : 
    1087              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "SHIELDING_TENSOR", &
    1088              :                                        description="Controls the printing of the chemical shift", &
    1089        10624 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="")
    1090              : 
    1091              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LU_BOUNDS", &
    1092              :                           variants=["ATOMS_LU"], &
    1093              :                           description="The lower and upper atomic index for which the tensor is printed", &
    1094              :                           usage="ATOMS_LU_BOUNDS integer integer", &
    1095        21248 :                           n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
    1096        10624 :       CALL section_add_keyword(print_key, keyword)
    1097        10624 :       CALL keyword_release(keyword)
    1098              : 
    1099              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
    1100              :                           description="list of atoms for which the shift is printed into a file ", &
    1101              :                           usage="ATOMS_LIST 1 2", n_var=-1, &
    1102        10624 :                           type_of_var=integer_t, repeats=.TRUE.)
    1103        10624 :       CALL section_add_keyword(print_key, keyword)
    1104        10624 :       CALL keyword_release(keyword)
    1105              : 
    1106        10624 :       CALL section_add_subsection(subsection, print_key)
    1107        10624 :       CALL section_release(print_key)
    1108              : 
    1109        10624 :       CALL section_add_subsection(section, subsection)
    1110        10624 :       CALL section_release(subsection)
    1111              : 
    1112        10624 :       NULLIFY (subsection)
    1113        10624 :       CALL create_interp_section(subsection)
    1114        10624 :       CALL section_add_subsection(section, subsection)
    1115        10624 :       CALL section_release(subsection)
    1116              : 
    1117        10624 :    END SUBROUTINE create_nmr_section
    1118              : 
    1119              : ! **************************************************************************************************
    1120              : !> \brief creates the input structure used to activate
    1121              : !>      calculation of NMR spin-spin coupling (implementation not operating)
    1122              : !>      Available properties : none
    1123              : !> \param section the section to create
    1124              : !> \author  VW
    1125              : ! **************************************************************************************************
    1126        10624 :    SUBROUTINE create_spin_spin_section(section)
    1127              :       TYPE(section_type), POINTER                        :: section
    1128              : 
    1129              :       TYPE(keyword_type), POINTER                        :: keyword
    1130              :       TYPE(section_type), POINTER                        :: print_key, subsection
    1131              : 
    1132        10624 :       NULLIFY (keyword, print_key, subsection)
    1133              : 
    1134        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    1135              :       CALL section_create(section, __LOCATION__, name="spinspin", &
    1136              :                           description="Compute indirect spin-spin coupling constants.", &
    1137        10624 :                           n_keywords=5, n_subsections=1, repeats=.FALSE.)
    1138              : 
    1139              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    1140              :                           description="controls the activation of the nmr calculation", &
    1141              :                           usage="&SPINSPIN T", &
    1142              :                           default_l_val=.FALSE., &
    1143        10624 :                           lone_keyword_l_val=.TRUE.)
    1144        10624 :       CALL section_add_keyword(section, keyword)
    1145        10624 :       CALL keyword_release(keyword)
    1146              : 
    1147              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_SPINSPIN", &
    1148              :                           description="Restart the spin-spin calculation from a previous run (NOT WORKING YET)", &
    1149              :                           usage="RESTART_SPINSPIN", default_l_val=.FALSE., &
    1150        10624 :                           lone_keyword_l_val=.TRUE.)
    1151        10624 :       CALL section_add_keyword(section, keyword)
    1152        10624 :       CALL keyword_release(keyword)
    1153              : 
    1154              :       CALL keyword_create(keyword, __LOCATION__, name="ISSC_ON_ATOM_LIST", &
    1155              :                           description="Atoms for which the issc is computed.", &
    1156              :                           usage="ISSC_ON_ATOM_LIST 1 2 10", &
    1157        10624 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
    1158        10624 :       CALL section_add_keyword(section, keyword)
    1159        10624 :       CALL keyword_release(keyword)
    1160              : 
    1161              :       CALL keyword_create(keyword, __LOCATION__, name="DO_FC", &
    1162              :                           description="Compute the Fermi contact contribution", &
    1163              :                           usage="DO_FC F", &
    1164        10624 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1165        10624 :       CALL section_add_keyword(section, keyword)
    1166        10624 :       CALL keyword_release(keyword)
    1167              : 
    1168              :       CALL keyword_create(keyword, __LOCATION__, name="DO_SD", &
    1169              :                           description="Compute the spin-dipolar contribution", &
    1170              :                           usage="DO_SD F", &
    1171        10624 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1172        10624 :       CALL section_add_keyword(section, keyword)
    1173        10624 :       CALL keyword_release(keyword)
    1174              : 
    1175              :       CALL keyword_create(keyword, __LOCATION__, name="DO_PSO", &
    1176              :                           description="Compute the paramagnetic spin-orbit contribution", &
    1177              :                           usage="DO_PSO F", &
    1178        10624 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1179        10624 :       CALL section_add_keyword(section, keyword)
    1180        10624 :       CALL keyword_release(keyword)
    1181              : 
    1182              :       CALL keyword_create(keyword, __LOCATION__, name="DO_DSO", &
    1183              :                           description="Compute the diamagnetic spin-orbit contribution (NOT YET IMPLEMENTED)", &
    1184              :                           usage="DO_DSO F", &
    1185        10624 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1186        10624 :       CALL section_add_keyword(section, keyword)
    1187        10624 :       CALL keyword_release(keyword)
    1188              : 
    1189        10624 :       NULLIFY (subsection)
    1190              :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1191              :                           description="print results of the indirect spin-spin calculation", &
    1192        10624 :                           repeats=.FALSE.)
    1193              : 
    1194              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "K_MATRIX", &
    1195              :                                        description="Controls the printing of the indirect spin-spin matrix", &
    1196        10624 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="")
    1197              : 
    1198              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
    1199              :                           description="list of atoms for which the indirect spin-spin is printed into a file ", &
    1200              :                           usage="ATOMS_LIST 1 2", n_var=-1, &
    1201        10624 :                           type_of_var=integer_t, repeats=.TRUE.)
    1202        10624 :       CALL section_add_keyword(print_key, keyword)
    1203        10624 :       CALL keyword_release(keyword)
    1204              : 
    1205        10624 :       CALL section_add_subsection(subsection, print_key)
    1206        10624 :       CALL section_release(print_key)
    1207              : 
    1208        10624 :       CALL section_add_subsection(section, subsection)
    1209        10624 :       CALL section_release(subsection)
    1210              : 
    1211        10624 :       NULLIFY (subsection)
    1212        10624 :       CALL create_interp_section(subsection)
    1213        10624 :       CALL section_add_subsection(section, subsection)
    1214        10624 :       CALL section_release(subsection)
    1215              : 
    1216        10624 :    END SUBROUTINE create_spin_spin_section
    1217              : 
    1218              : ! **************************************************************************************************
    1219              : !> \brief creates the input structure used to activate
    1220              : !>         calculation of EPR using
    1221              : !>         the induced current obtained from DFPT
    1222              : !>      Available properties : none
    1223              : !> \param section the section to create
    1224              : !> \author  VW
    1225              : ! **************************************************************************************************
    1226        10624 :    SUBROUTINE create_epr_section(section)
    1227              :       TYPE(section_type), POINTER                        :: section
    1228              : 
    1229              :       TYPE(keyword_type), POINTER                        :: keyword
    1230              :       TYPE(section_type), POINTER                        :: print_key, subsection, subsubsection
    1231              : 
    1232        10624 :       NULLIFY (keyword, print_key, subsection, subsubsection)
    1233              : 
    1234        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    1235              :       CALL section_create(section, __LOCATION__, name="EPR", &
    1236              :                           description="The g tensor is calculated by DFPT ", &
    1237              :                           n_keywords=5, n_subsections=1, repeats=.FALSE., &
    1238        21248 :                           citations=[Weber2009])
    1239              : 
    1240              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    1241              :                           description="controls the activation of the epr calculation", &
    1242              :                           usage="&EPR T", &
    1243              :                           default_l_val=.FALSE., &
    1244        10624 :                           lone_keyword_l_val=.TRUE.)
    1245        10624 :       CALL section_add_keyword(section, keyword)
    1246        10624 :       CALL keyword_release(keyword)
    1247              : 
    1248              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_EPR", &
    1249              :                           description="Restart the EPR calculation from a previous run (NOT WORKING)", &
    1250              :                           usage="RESTART_EPR", default_l_val=.FALSE., &
    1251        10624 :                           lone_keyword_l_val=.TRUE.)
    1252        10624 :       CALL section_add_keyword(section, keyword)
    1253        10624 :       CALL keyword_release(keyword)
    1254              : 
    1255        10624 :       NULLIFY (subsection)
    1256              :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1257              :                           description="print results of epr calculation", &
    1258        10624 :                           repeats=.FALSE.)
    1259              : 
    1260              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "NABLAVKS_CUBES", &
    1261              :                                        description="Controls the printing of the components of nabla v_ks ", &
    1262        10624 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
    1263              :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    1264              :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1265              :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    1266              :                           " 1 number valid for all components.", &
    1267        10624 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
    1268        10624 :       CALL section_add_keyword(print_key, keyword)
    1269        10624 :       CALL keyword_release(keyword)
    1270              :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1271              :                           description="append the cube files when they already exist", &
    1272        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1273        10624 :       CALL section_add_keyword(print_key, keyword)
    1274        10624 :       CALL keyword_release(keyword)
    1275              : 
    1276        10624 :       CALL section_add_subsection(subsection, print_key)
    1277        10624 :       CALL section_release(print_key)
    1278              : 
    1279              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "G_TENSOR", &
    1280              :                                        description="Controls the printing of the g tensor", &
    1281        10624 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
    1282        10624 :       CALL create_xc_section(subsubsection)
    1283        10624 :       CALL section_add_subsection(print_key, subsubsection)
    1284        10624 :       CALL section_release(subsubsection)
    1285              : 
    1286              :       CALL keyword_create(keyword, __LOCATION__, name="GAPW_MAX_ALPHA", &
    1287              :                           description="Maximum alpha of GTH potentials allowed on the soft grids ", &
    1288        10624 :                           usage="GAPW_MAX_ALPHA real", default_r_val=5.0_dp)
    1289        10624 :       CALL section_add_keyword(print_key, keyword)
    1290        10624 :       CALL keyword_release(keyword)
    1291              : 
    1292              :       CALL keyword_create(keyword, __LOCATION__, name="SOO_RHO_HARD", &
    1293              :                           description="Whether or not to include the atomic parts of the density "// &
    1294              :                           "in the SOO part of the g tensor", usage="SOO_RHO_HARD", &
    1295        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1296        10624 :       CALL section_add_keyword(print_key, keyword)
    1297        10624 :       CALL keyword_release(keyword)
    1298              : 
    1299        10624 :       CALL section_add_subsection(subsection, print_key)
    1300        10624 :       CALL section_release(print_key)
    1301              : 
    1302              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
    1303              :                                        description="Controls the printing of the response functions ", &
    1304        10624 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
    1305              :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    1306              :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1307              :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    1308              :                           " 1 number valid for all components.", &
    1309        10624 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
    1310        10624 :       CALL section_add_keyword(print_key, keyword)
    1311        10624 :       CALL keyword_release(keyword)
    1312              : 
    1313              :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
    1314              :                           variants=["CUBES_LU"], &
    1315              :                           description="The lower and upper index of the states to be printed as cube", &
    1316              :                           usage="CUBES_LU_BOUNDS integer integer", &
    1317        21248 :                           n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
    1318        10624 :       CALL section_add_keyword(print_key, keyword)
    1319        10624 :       CALL keyword_release(keyword)
    1320              : 
    1321              :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
    1322              :                           description="Indexes of the states to be printed as cube files "// &
    1323              :                           "This keyword can be repeated several times "// &
    1324              :                           "(useful if you have to specify many indexes).", &
    1325              :                           usage="CUBES_LIST 1 2", &
    1326        10624 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
    1327        10624 :       CALL section_add_keyword(print_key, keyword)
    1328        10624 :       CALL keyword_release(keyword)
    1329              :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1330              :                           description="append the cube files when they already exist", &
    1331        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1332        10624 :       CALL section_add_keyword(print_key, keyword)
    1333        10624 :       CALL keyword_release(keyword)
    1334              : 
    1335        10624 :       CALL section_add_subsection(subsection, print_key)
    1336        10624 :       CALL section_release(print_key)
    1337              : 
    1338        10624 :       CALL section_add_subsection(section, subsection)
    1339        10624 :       CALL section_release(subsection)
    1340              : 
    1341        10624 :       NULLIFY (subsection)
    1342        10624 :       CALL create_interp_section(subsection)
    1343        10624 :       CALL section_add_subsection(section, subsection)
    1344        10624 :       CALL section_release(subsection)
    1345              : 
    1346        10624 :    END SUBROUTINE create_epr_section
    1347              : 
    1348              : ! **************************************************************************************************
    1349              : !> \brief creates the input structure used to activate
    1350              : !>      calculation of polarizability tensor DFPT
    1351              : !>      Available properties : none
    1352              : !> \param section the section to create
    1353              : !> \author SL
    1354              : ! **************************************************************************************************
    1355        10624 :    SUBROUTINE create_polarizability_section(section)
    1356              : 
    1357              :       TYPE(section_type), POINTER                        :: section
    1358              : 
    1359              :       TYPE(keyword_type), POINTER                        :: keyword
    1360              :       TYPE(section_type), POINTER                        :: print_key, subsection
    1361              : 
    1362        10624 :       NULLIFY (keyword, print_key, subsection)
    1363              : 
    1364        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    1365              :       CALL section_create(section, __LOCATION__, name="POLAR", &
    1366              :                           description="Compute polarizabilities.", &
    1367              :                           n_keywords=5, n_subsections=1, repeats=.FALSE., &
    1368        21248 :                           citations=[Putrino2002])
    1369              : 
    1370              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    1371              :                           description="controls the activation of the polarizability calculation", &
    1372              :                           usage="&POLAR T", &
    1373              :                           default_l_val=.FALSE., &
    1374        10624 :                           lone_keyword_l_val=.TRUE.)
    1375        10624 :       CALL section_add_keyword(section, keyword)
    1376        10624 :       CALL keyword_release(keyword)
    1377              : 
    1378              :       CALL keyword_create(keyword, __LOCATION__, name="DO_RAMAN", &
    1379              :                           description="Compute the electric-dipole--electric-dipole polarizability", &
    1380              :                           usage="DO_RAMAN F", &
    1381              :                           citations=[Luber2014], &
    1382        21248 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1383        10624 :       CALL section_add_keyword(section, keyword)
    1384        10624 :       CALL keyword_release(keyword)
    1385              : 
    1386              :       CALL keyword_create(keyword, __LOCATION__, name="PERIODIC_DIPOLE_OPERATOR", &
    1387              :                           description="Type of dipole operator: Berry phase(T) or Local(F)", &
    1388              :                           usage="PERIODIC_DIPOLE_OPERATOR T", &
    1389        10624 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1390        10624 :       CALL section_add_keyword(section, keyword)
    1391        10624 :       CALL keyword_release(keyword)
    1392              : 
    1393        10624 :       NULLIFY (subsection)
    1394              :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1395              :                           description="print results of the polarizability calculation", &
    1396        10624 :                           repeats=.FALSE.)
    1397              : 
    1398              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "POLAR_MATRIX", &
    1399              :                                        description="Controls the printing of the polarizabilities", &
    1400        10624 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="")
    1401              : 
    1402        10624 :       CALL section_add_subsection(subsection, print_key)
    1403        10624 :       CALL section_release(print_key)
    1404        10624 :       CALL section_add_subsection(section, subsection)
    1405        10624 :       CALL section_release(subsection)
    1406              : 
    1407        10624 :       NULLIFY (subsection)
    1408        10624 :       CALL create_interp_section(subsection)
    1409        10624 :       CALL section_add_subsection(section, subsection)
    1410        10624 :       CALL section_release(subsection)
    1411              : 
    1412        10624 :    END SUBROUTINE create_polarizability_section
    1413              : 
    1414              : ! **************************************************************************************************
    1415              : !> \brief creates the section for electron transfer coupling
    1416              : !> \param section ...
    1417              : !> \author fschiff
    1418              : ! **************************************************************************************************
    1419        10624 :    SUBROUTINE create_et_coupling_section(section)
    1420              :       TYPE(section_type), POINTER                        :: section
    1421              : 
    1422              :       TYPE(keyword_type), POINTER                        :: keyword
    1423              :       TYPE(section_type), POINTER                        :: print_key, subsection
    1424              : 
    1425        10624 :       NULLIFY (keyword)
    1426        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    1427              :       CALL section_create(section, __LOCATION__, name="ET_COUPLING", &
    1428              :                           description="specifies the two constraints/restraints for extracting ET coupling elements", &
    1429        31872 :                           n_keywords=1, n_subsections=4, repeats=.FALSE., citations=[Kondov2007, Futera2017])
    1430              : 
    1431        10624 :       NULLIFY (subsection)
    1432        10624 :       CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_A")
    1433        10624 :       CALL section_add_subsection(section, subsection)
    1434        10624 :       CALL section_release(subsection)
    1435              : 
    1436        10624 :       NULLIFY (subsection)
    1437        10624 :       CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_B")
    1438        10624 :       CALL section_add_subsection(section, subsection)
    1439        10624 :       CALL section_release(subsection)
    1440              : 
    1441        10624 :       NULLIFY (subsection)
    1442        10624 :       CALL create_projection(subsection, "PROJECTION")
    1443        10624 :       CALL section_add_subsection(section, subsection)
    1444        10624 :       CALL section_release(subsection)
    1445              : 
    1446              :       CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_CONSTRAINT", &
    1447              :                           description="Specifies the type of constraint", &
    1448              :                           usage="TYPE_OF_CONSTRAINT DDAPC", &
    1449              :                           enum_c_vals=s2a("NONE", "DDAPC"), &
    1450              :                           enum_i_vals=[do_no_et, do_et_ddapc], &
    1451              :                           enum_desc=s2a("NONE", "DDAPC Constraint"), &
    1452        10624 :                           default_i_val=do_no_et)
    1453        10624 :       CALL section_add_keyword(section, keyword)
    1454        10624 :       CALL keyword_release(keyword)
    1455              : 
    1456        10624 :       NULLIFY (print_key)
    1457              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
    1458              :                                        description="Controls the printing basic info about the method", &
    1459        10624 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
    1460        10624 :       CALL section_add_subsection(section, print_key)
    1461        10624 :       CALL section_release(print_key)
    1462              : 
    1463        10624 :    END SUBROUTINE create_et_coupling_section
    1464              : 
    1465              : ! **************************************************************************************************
    1466              : !> \brief defines input sections for specification of Hilbert space partitioning
    1467              : !>        in projection-operator approach of electronic coupling calulation
    1468              : !> \param section pointer to the section data structure
    1469              : !> \param section_name name of the projection section
    1470              : !> \author Z. Futera (02.2017)
    1471              : ! **************************************************************************************************
    1472        10624 :    SUBROUTINE create_projection(section, section_name)
    1473              : 
    1474              :       ! Routine arguments
    1475              :       TYPE(section_type), POINTER                        :: section
    1476              :       CHARACTER(len=*), INTENT(in)                       :: section_name
    1477              : 
    1478              :       TYPE(keyword_type), POINTER                        :: keyword
    1479              :       TYPE(section_type), POINTER                        :: print_key, section_block, section_print
    1480              : 
    1481              : ! Routine name for dubug purposes
    1482              : 
    1483              :       ! Sanity check
    1484            0 :       CPASSERT(.NOT. ASSOCIATED(section))
    1485              : 
    1486              :       ! Initialization
    1487        10624 :       NULLIFY (keyword)
    1488        10624 :       NULLIFY (print_key)
    1489        10624 :       NULLIFY (section_block)
    1490        10624 :       NULLIFY (section_print)
    1491              : 
    1492              :       ! Input-file section definition
    1493              :       CALL section_create(section, __LOCATION__, name=TRIM(ADJUSTL(section_name)), &
    1494              :                           description="Projection-operator approach fo ET coupling calculation", &
    1495        10624 :                           n_keywords=0, n_subsections=2, repeats=.FALSE.)
    1496              : 
    1497              :       ! Subsection #0: Log printing
    1498              :       CALL cp_print_key_section_create(print_key, __LOCATION__, 'PROGRAM_RUN_INFO', &
    1499              :                                        description="Controls printing of data and informations to log file", &
    1500        10624 :                                        print_level=low_print_level, filename="__STD_OUT__")
    1501        10624 :       CALL section_add_subsection(section, print_key)
    1502        10624 :       CALL section_release(print_key)
    1503              : 
    1504              :       ! Subsection #1: Atomic blocks
    1505              :       CALL section_create(section_block, __LOCATION__, name='BLOCK', &
    1506              :                           description="Part of the system (donor, acceptor, bridge,...)", &
    1507        10624 :                           n_keywords=2, n_subsections=1, repeats=.TRUE.)
    1508        10624 :       CALL section_add_subsection(section, section_block)
    1509              : 
    1510              :       ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
    1511              :       CALL keyword_create(keyword, __LOCATION__, name='ATOMS', &
    1512              :                           description="Array of atom IDs in the system part", &
    1513              :                           usage="ATOMS {integer} {integer} .. {integer}", &
    1514        10624 :                           n_var=-1, type_of_var=integer_t, repeats=.FALSE.)
    1515        10624 :       CALL section_add_keyword(section_block, keyword)
    1516        10624 :       CALL keyword_release(keyword)
    1517              : 
    1518              :       ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
    1519              :       CALL keyword_create(keyword, __LOCATION__, name='NELECTRON', &
    1520              :                           description="Number of electrons expected in the system part", &
    1521        10624 :                           usage="NELECTRON {integer}", default_i_val=0)
    1522        10624 :       CALL section_add_keyword(section_block, keyword)
    1523        10624 :       CALL keyword_release(keyword)
    1524              : 
    1525              :       ! S#1 - Subsection #1: Printing setting
    1526              :       CALL section_create(section_print, __LOCATION__, name='PRINT', &
    1527              :                           description="Possible printing options in ET system part", &
    1528        10624 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
    1529        10624 :       CALL section_add_subsection(section_block, section_print)
    1530              : 
    1531              :       ! S#1 - S#1 - Keyword #1: MO coefficient on specific atom
    1532              :       CALL keyword_create(keyword, __LOCATION__, name='MO_COEFF_ATOM', &
    1533              :                           description="Print out MO coeffiecients on given atom", &
    1534              :                           usage="MO_COEFF_ATOM {integer} {integer} .. {integer}", &
    1535        10624 :                           type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
    1536        10624 :       CALL section_add_keyword(section_print, keyword)
    1537        10624 :       CALL keyword_release(keyword)
    1538              : 
    1539              :       ! S#1 - S#1 - Keyword #1: MO coefficient of specific state
    1540              :       CALL keyword_create(keyword, __LOCATION__, name='MO_COEFF_ATOM_STATE', &
    1541              :                           description="Print out MO coeffiecients of specific state", &
    1542              :                           usage="MO_COEFF_ATOM_STATE {integer} {integer} .. {integer}", &
    1543        10624 :                           type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
    1544        10624 :       CALL section_add_keyword(section_print, keyword)
    1545        10624 :       CALL keyword_release(keyword)
    1546              : 
    1547              :       ! S#1 - S#1 - Subsection #1: Saving MOs to CUBE files
    1548              :       CALL cp_print_key_section_create(print_key, __LOCATION__, 'MO_CUBES', &
    1549              :                                        description="Controls saving of MO cube files", &
    1550        10624 :                                        print_level=high_print_level, filename="")
    1551              : 
    1552              :       ! S#1 - S#1 - S#1 - Keyword #1: Stride
    1553              :       CALL keyword_create(keyword, __LOCATION__, name='STRIDE', &
    1554              :                           description="The stride (X,Y,Z) used to write the cube file", &
    1555              :                           usage="STRIDE {integer} {integer} {integer}", n_var=-1, &
    1556        10624 :                           default_i_vals=[2, 2, 2], type_of_var=integer_t)
    1557        10624 :       CALL section_add_keyword(print_key, keyword)
    1558        10624 :       CALL keyword_release(keyword)
    1559              : 
    1560              :       ! S#1 - S#1 - S#1 - Keyword #2: List of MO IDs
    1561              :       CALL keyword_create(keyword, __LOCATION__, name='MO_LIST', &
    1562              :                           description="Indices of molecular orbitals to save", &
    1563              :                           usage="MO_LIST {integer} {integer} .. {integer}", &
    1564        10624 :                           type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
    1565        10624 :       CALL section_add_keyword(print_key, keyword)
    1566        10624 :       CALL keyword_release(keyword)
    1567              : 
    1568              :       ! S#1 - S#1 - S#1 - Keyword #2: Number of unoccupied states
    1569              :       CALL keyword_create(keyword, __LOCATION__, name='NLUMO', &
    1570              :                           description="Number of unoccupied molecular orbitals to save", &
    1571        10624 :                           usage="NLUMO {integer}", default_i_val=1)
    1572        10624 :       CALL section_add_keyword(print_key, keyword)
    1573        10624 :       CALL keyword_release(keyword)
    1574              : 
    1575              :       ! S#1 - S#1 - S#1 - Keyword #3: Number of occupied states
    1576              :       CALL keyword_create(keyword, __LOCATION__, name='NHOMO', &
    1577              :                           description="Number of occupied molecular orbitals to save", &
    1578        10624 :                           usage="NHOMO {integer}", default_i_val=1)
    1579        10624 :       CALL section_add_keyword(print_key, keyword)
    1580        10624 :       CALL keyword_release(keyword)
    1581              : 
    1582        10624 :       CALL section_add_subsection(section_print, print_key)
    1583        10624 :       CALL section_release(print_key)
    1584              : 
    1585              :       ! S#1 - S#1 - Clean
    1586        10624 :       CALL section_release(section_print)
    1587              : 
    1588              :       ! S#1 - Clean
    1589        10624 :       CALL section_release(section_block)
    1590              : 
    1591              :       ! S#1 - Subsection #1: Printing setting
    1592              :       CALL section_create(section_print, __LOCATION__, name='PRINT', &
    1593              :                           description="Possible printing options in ET", &
    1594        10624 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
    1595        10624 :       CALL section_add_subsection(section, section_print)
    1596              : 
    1597              :       ! Print couplings
    1598              :       CALL cp_print_key_section_create(print_key, __LOCATION__, 'COUPLINGS', &
    1599              :                                        description="Controls printing couplings onto file", &
    1600        10624 :                                        print_level=low_print_level, filename="")
    1601              : 
    1602              :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1603              :                           description="append the files when they already exist", &
    1604        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1605        10624 :       CALL section_add_keyword(print_key, keyword)
    1606        10624 :       CALL keyword_release(keyword)
    1607              : 
    1608        10624 :       CALL section_add_subsection(section_print, print_key)
    1609        10624 :       CALL section_release(print_key)
    1610              : 
    1611        10624 :       CALL section_release(section_print)
    1612              : 
    1613        10624 :    END SUBROUTINE create_projection
    1614              : 
    1615              : ! **************************************************************************************************
    1616              : !> \brief creates an input section for tddfpt calculation
    1617              : !> \param section section to create
    1618              : !> \par History
    1619              : !>    * 05.2016 forked from create_tddfpt_section [Sergey Chulkov]
    1620              : !>    * 08.2016 moved from module input_cp2k_dft [Sergey Chulkov]
    1621              : ! **************************************************************************************************
    1622        21248 :    SUBROUTINE create_tddfpt2_section(section)
    1623              :       TYPE(section_type), POINTER                        :: section
    1624              : 
    1625              :       TYPE(keyword_type), POINTER                        :: keyword
    1626              :       TYPE(section_type), POINTER                        :: print_key, subsection
    1627              : 
    1628        21248 :       CPASSERT(.NOT. ASSOCIATED(section))
    1629              :       CALL section_create(section, __LOCATION__, name="TDDFPT", &
    1630              :                           description="Controls time-dependent density functional perturbation theory "// &
    1631              :                           "(TDDFPT) calculations for electronic excitations and related properties.", &
    1632              :                           n_keywords=14, n_subsections=4, repeats=.FALSE., &
    1633        84992 :                           citations=[Iannuzzi2005, Hanasaki2025, Hernandez2025])
    1634              : 
    1635        21248 :       NULLIFY (keyword, print_key, subsection)
    1636              : 
    1637              :       CALL keyword_create(keyword, __LOCATION__, &
    1638              :                           name="_SECTION_PARAMETERS_", &
    1639              :                           description="Activates the TDDFPT procedure.", &
    1640              :                           default_l_val=.FALSE., &
    1641        21248 :                           lone_keyword_l_val=.TRUE.)
    1642        21248 :       CALL section_add_keyword(section, keyword)
    1643        21248 :       CALL keyword_release(keyword)
    1644              : 
    1645              :       ! Integer
    1646              :       CALL keyword_create(keyword, __LOCATION__, name="NSTATES", &
    1647              :                           description="Number of excited states to converge.", &
    1648              :                           n_var=1, type_of_var=integer_t, &
    1649        21248 :                           default_i_val=1)
    1650        21248 :       CALL section_add_keyword(section, keyword)
    1651        21248 :       CALL keyword_release(keyword)
    1652              : 
    1653              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
    1654              :                           description="Maximal number of iterations to be performed.", &
    1655              :                           n_var=1, type_of_var=integer_t, &
    1656        21248 :                           default_i_val=50)
    1657        21248 :       CALL section_add_keyword(section, keyword)
    1658        21248 :       CALL keyword_release(keyword)
    1659              : 
    1660              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_KV", &
    1661              :                           description="Maximal number of Krylov space vectors. "// &
    1662              :                           "Davidson iterations will be restarted upon reaching this limit.", &
    1663              :                           n_var=1, type_of_var=integer_t, &
    1664        21248 :                           default_i_val=5000)
    1665        21248 :       CALL section_add_keyword(section, keyword)
    1666        21248 :       CALL keyword_release(keyword)
    1667              : 
    1668              :       CALL keyword_create(keyword, __LOCATION__, name="NLUMO", &
    1669              :                           description="Number of unoccupied orbitals to consider. "// &
    1670              :                           "Default is to use all unoccupied orbitals (-1).", &
    1671              :                           n_var=1, type_of_var=integer_t, &
    1672        21248 :                           default_i_val=-1)
    1673        21248 :       CALL section_add_keyword(section, keyword)
    1674        21248 :       CALL keyword_release(keyword)
    1675              : 
    1676              :       CALL keyword_create(keyword, __LOCATION__, name="NPROC_STATE", &
    1677              :                           description="Number of MPI processes to be used per excited state. "// &
    1678              :                           "Default is to use all MPI processes (0).", &
    1679              :                           n_var=1, type_of_var=integer_t, &
    1680        21248 :                           default_i_val=0)
    1681        21248 :       CALL section_add_keyword(section, keyword)
    1682        21248 :       CALL keyword_release(keyword)
    1683              : 
    1684              :       ! kernel type
    1685              :       CALL keyword_create(keyword, __LOCATION__, name="KERNEL", &
    1686              :                           description="Options to compute the kernel", &
    1687              :                           usage="KERNEL FULL", &
    1688              :                           enum_c_vals=s2a("FULL", "sTDA", "NONE"), &
    1689              :                           enum_i_vals=[tddfpt_kernel_full, tddfpt_kernel_stda, tddfpt_kernel_none], &
    1690        21248 :                           default_i_val=tddfpt_kernel_full)
    1691        21248 :       CALL section_add_keyword(section, keyword)
    1692        21248 :       CALL keyword_release(keyword)
    1693              : 
    1694              :       ! spin-flip TDDFPT options
    1695              :       CALL keyword_create(keyword, __LOCATION__, name="SPINFLIP", &
    1696              :                           description="Selects the type of spin-flip TDDFPT kernel", &
    1697              :                           usage="SPINFLIP NONCOLLINEAR", &
    1698              :                           enum_c_vals=s2a("NONE", "COLLINEAR", "NONCOLLINEAR"), &
    1699              :                           enum_i_vals=[no_sf_tddfpt, tddfpt_sf_col, tddfpt_sf_noncol], &
    1700              :                           enum_desc=s2a("Only molecular orbital energy differences are considered", &
    1701              :                                         "MO energy diferences and Fock exchange contributions are "// &
    1702              :                                         "considered", &
    1703              :                                         "MO energy differences, Fock exchange and "// &
    1704              :                                         "Noncollinear local exchange-correlation "// &
    1705              :                                         "kernel are considered"), &
    1706        42496 :                           default_i_val=no_sf_tddfpt, citations=[Hernandez2025])
    1707        21248 :       CALL section_add_keyword(section, keyword)
    1708        21248 :       CALL keyword_release(keyword)
    1709              : 
    1710              :       CALL keyword_create(keyword, __LOCATION__, name="OE_CORR", &
    1711              :                           description="Orbital energy correction potential.", &
    1712              :                           enum_c_vals=s2a("NONE", "LB94", "GLLB", "SAOP", "SHIFT"), &
    1713              :                           enum_i_vals=[oe_none, oe_lb, oe_gllb, oe_saop, oe_shift], &
    1714              :                           enum_desc=s2a("No orbital correction scheme is used", &
    1715              :                                         "van Leeuwen and Baerends. PRA, 49:2421, 1994", &
    1716              :                                         "Gritsenko, van Leeuwen, van Lenthe, Baerends. PRA, 51:1944, 1995", &
    1717              :                                         "Gritsenko, Schipper, Baerends. Chem. Phys. Lett., 302:199, 1999", &
    1718              :                                         "Constant shift of virtual and/or open-shell orbitals"), &
    1719        21248 :                           default_i_val=oe_none)
    1720        21248 :       CALL section_add_keyword(section, keyword)
    1721        21248 :       CALL keyword_release(keyword)
    1722              : 
    1723              :       ! SHIFTS
    1724              :       CALL keyword_create(keyword, __LOCATION__, name="EV_SHIFT", &
    1725              :                           variants=s2a("VIRTUAL_SHIFT"), &
    1726              :                           description="Constant shift of virtual state eigenvalues.", &
    1727              :                           usage="EV_SHIFT 0.500", &
    1728              :                           n_var=1, type_of_var=real_t, &
    1729              :                           unit_str="eV", &
    1730        21248 :                           default_r_val=0.0_dp)
    1731        21248 :       CALL section_add_keyword(section, keyword)
    1732        21248 :       CALL keyword_release(keyword)
    1733              :       !
    1734              :       CALL keyword_create(keyword, __LOCATION__, name="EOS_SHIFT", &
    1735              :                           variants=s2a("OPEN_SHELL_SHIFT"), &
    1736              :                           description="Constant shift of open shell eigenvalues.", &
    1737              :                           usage="EOS_SHIFT 0.200", &
    1738              :                           n_var=1, type_of_var=real_t, &
    1739              :                           unit_str="eV", &
    1740        21248 :                           default_r_val=0.0_dp)
    1741        21248 :       CALL section_add_keyword(section, keyword)
    1742        21248 :       CALL keyword_release(keyword)
    1743              : 
    1744              :       ! Real
    1745              :       CALL keyword_create(keyword, __LOCATION__, name="CONVERGENCE", &
    1746              :                           description="Target accuracy for excited state energies.", &
    1747              :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
    1748        21248 :                           default_r_val=1.0e-5_dp)
    1749        21248 :       CALL section_add_keyword(section, keyword)
    1750        21248 :       CALL keyword_release(keyword)
    1751              : 
    1752              :       CALL keyword_create(keyword, __LOCATION__, name="MIN_AMPLITUDE", &
    1753              :                           description="The smallest excitation amplitude to print.", &
    1754              :                           n_var=1, type_of_var=real_t, &
    1755        21248 :                           default_r_val=5.0e-2_dp)
    1756        21248 :       CALL section_add_keyword(section, keyword)
    1757        21248 :       CALL keyword_release(keyword)
    1758              : 
    1759              :       CALL keyword_create(keyword, __LOCATION__, name="ORTHOGONAL_EPS", &
    1760              :                           description="The largest possible overlap between the ground state and "// &
    1761              :                           "orthogonalised excited state wave-functions. Davidson iterations "// &
    1762              :                           "will be restarted when the overlap goes beyond this threshold in "// &
    1763              :                           "order to prevent numerical instability.", &
    1764              :                           n_var=1, type_of_var=real_t, &
    1765        21248 :                           default_r_val=1.0e-4_dp)
    1766        21248 :       CALL section_add_keyword(section, keyword)
    1767        21248 :       CALL keyword_release(keyword)
    1768              : 
    1769              :       ! Logical
    1770              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
    1771              :                           description="Restart the TDDFPT calculation if a restart file exists", &
    1772              :                           n_var=1, type_of_var=logical_t, &
    1773        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1774        21248 :       CALL section_add_keyword(section, keyword)
    1775        21248 :       CALL keyword_release(keyword)
    1776              : 
    1777              :       CALL keyword_create(keyword, __LOCATION__, name="RKS_TRIPLETS", &
    1778              :                           description="Compute triplet excited states using spin-unpolarised molecular orbitals.", &
    1779              :                           n_var=1, type_of_var=logical_t, &
    1780        21248 :                           default_l_val=.FALSE.)
    1781        21248 :       CALL section_add_keyword(section, keyword)
    1782        21248 :       CALL keyword_release(keyword)
    1783              : 
    1784              :       CALL keyword_create(keyword, __LOCATION__, name="ADMM_KERNEL_XC_CORRECTION", &
    1785              :                           description="Use/Ignore ADMM correction xc functional for TD kernel. "// &
    1786              :                           "XC correction functional is defined in ground state XC section.", &
    1787              :                           n_var=1, type_of_var=logical_t, &
    1788        21248 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1789        21248 :       CALL section_add_keyword(section, keyword)
    1790        21248 :       CALL keyword_release(keyword)
    1791              : 
    1792              :       CALL keyword_create(keyword, __LOCATION__, name="ADMM_KERNEL_CORRECTION_SYMMETRIC", &
    1793              :                           description="ADMM correction functional in kernel is applied symmetrically. "// &
    1794              :                           "Original implementation is using a non-symmetric formula.", &
    1795              :                           n_var=1, type_of_var=logical_t, &
    1796        21248 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1797        21248 :       CALL section_add_keyword(section, keyword)
    1798        21248 :       CALL keyword_release(keyword)
    1799              : 
    1800              :       CALL keyword_create(keyword, __LOCATION__, name="DO_LRIGPW", &
    1801              :                           description="Local resolution of identity for Coulomb contribution.", &
    1802              :                           n_var=1, type_of_var=logical_t, &
    1803        21248 :                           default_l_val=.FALSE.)
    1804        21248 :       CALL section_add_keyword(section, keyword)
    1805        21248 :       CALL keyword_release(keyword)
    1806              : 
    1807              :       CALL keyword_create(keyword, __LOCATION__, name="AUTO_BASIS", &
    1808              :                           description="Specify type and size of automatically generated auxiliary "// &
    1809              :                           "(RI) basis sets. Exactly two arguments are required for this option. "// &
    1810              :                           "The first argument of basis type should be one of the following: "// &
    1811              :                           "`P_LRI_AUX`. The second argument of basis size should be one of the "// &
    1812              :                           "following: `SMALL`, `MEDIUM`, `LARGE`, or `HUGE`. The default is not "// &
    1813              :                           "using any of these basis sets, requested by `AUTO_BASIS X X` (exactly "// &
    1814              :                           "as written here).", &
    1815              :                           usage="AUTO_BASIS {basis_type} {basis_size}", &
    1816        63744 :                           type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=["X", "X"])
    1817        21248 :       CALL section_add_keyword(section, keyword)
    1818        21248 :       CALL keyword_release(keyword)
    1819              : 
    1820              :       CALL keyword_create(keyword, __LOCATION__, name="DO_SMEARING", &
    1821              :                           description="Implying smeared occupation. ", &
    1822              :                           n_var=1, type_of_var=logical_t, &
    1823        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1824        21248 :       CALL section_add_keyword(section, keyword)
    1825        21248 :       CALL keyword_release(keyword)
    1826              : 
    1827              :       CALL keyword_create(keyword, __LOCATION__, name="EXCITON_DESCRIPTORS", &
    1828              :                           description="Compute exciton descriptors. "// &
    1829              :                           "Details given in Manual section about Bethe Salpeter equation.", &
    1830              :                           n_var=1, type_of_var=logical_t, &
    1831        21248 :                           default_l_val=.FALSE.)
    1832        21248 :       CALL section_add_keyword(section, keyword)
    1833        21248 :       CALL keyword_release(keyword)
    1834              : 
    1835              :       CALL keyword_create(keyword, __LOCATION__, name="DIRECTIONAL_EXCITON_DESCRIPTORS", &
    1836              :                           description="Print cartesian components of exciton descriptors.", &
    1837              :                           n_var=1, type_of_var=logical_t, &
    1838        21248 :                           default_l_val=.FALSE.)
    1839        21248 :       CALL section_add_keyword(section, keyword)
    1840        21248 :       CALL keyword_release(keyword)
    1841              : 
    1842              :       ! Strings
    1843              :       CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
    1844              :                           variants=["RESTART_FILE_NAME"], &
    1845              :                           description="Name of the wave function restart file, may include a path."// &
    1846              :                           " If no file is specified, the default is to open the file as generated by"// &
    1847              :                           " the wave function restart print key.", &
    1848              :                           usage="WFN_RESTART_FILE_NAME <FILENAME>", &
    1849        42496 :                           type_of_var=lchar_t)
    1850        21248 :       CALL section_add_keyword(section, keyword)
    1851        21248 :       CALL keyword_release(keyword)
    1852              : 
    1853              :       ! DIPOLE subsection
    1854              :       CALL section_create(subsection, __LOCATION__, name="DIPOLE_MOMENTS", &
    1855              :                           description="Parameters to compute oscillator strengths in the dipole approximation.", &
    1856        21248 :                           n_keywords=3, n_subsections=0, repeats=.FALSE.)
    1857              : 
    1858              :       CALL keyword_create(keyword, __LOCATION__, name="DIPOLE_FORM", &
    1859              :                           description="Form of dipole transition integrals.", &
    1860              :                           enum_c_vals=s2a("BERRY", "LENGTH", "VELOCITY", "VELOCITY_OLD", &
    1861              :                                           "SCF_MOMENT"), &
    1862              :                           enum_desc=s2a("Based on Berry phase formula (valid for fully periodic molecular systems only)", &
    1863              :                                         "Length form &lang; i | r | j &rang; (valid for non-periodic molecular systems only)", &
    1864              :                                         "Velocity form &lang; i | d/dr | j &rang;", &
    1865              :                                         "Old velocity form &lang; i | d/dr | j &rang;", &
    1866              :                                         "SCF molecular-orbital moment form for k-point TDDFPT"), &
    1867              :                           enum_i_vals=[tddfpt_dipole_berry, tddfpt_dipole_length, &
    1868              :                                        tddfpt_dipole_velocity, tddfpt_dipole_velocity_old, &
    1869              :                                        tddfpt_dipole_scf_moment], &
    1870        21248 :                           default_i_val=tddfpt_dipole_velocity)
    1871        21248 :       CALL section_add_keyword(subsection, keyword)
    1872        21248 :       CALL keyword_release(keyword)
    1873              : 
    1874              :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
    1875              :                           description="Reference point to calculate electric "// &
    1876              :                           "dipole moments using the dipole integrals in the length form.", &
    1877              :                           enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
    1878              :                           enum_desc=s2a("Use Center of Mass", &
    1879              :                                         "Use Center of Atomic Charges", &
    1880              :                                         "Use User-defined Point", &
    1881              :                                         "Use Origin of Coordinate System"), &
    1882              :                           enum_i_vals=[use_mom_ref_com, &
    1883              :                                        use_mom_ref_coac, &
    1884              :                                        use_mom_ref_user, &
    1885              :                                        use_mom_ref_zero], &
    1886        21248 :                           default_i_val=use_mom_ref_com)
    1887        21248 :       CALL section_add_keyword(subsection, keyword)
    1888        21248 :       CALL keyword_release(keyword)
    1889              : 
    1890              :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
    1891              :                           description="User-defined reference point.", &
    1892              :                           usage="REFERENCE_POINT x y z", &
    1893        21248 :                           repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
    1894        21248 :       CALL section_add_keyword(subsection, keyword)
    1895        21248 :       CALL keyword_release(keyword)
    1896              : 
    1897        21248 :       CALL section_add_subsection(section, subsection)
    1898        21248 :       CALL section_release(subsection)
    1899              : 
    1900              :       ! SOC functional
    1901              : 
    1902              :       CALL section_create(subsection, __LOCATION__, name="SOC", &
    1903              :                           description="Is jet to be implemented", &
    1904        21248 :                           n_keywords=2, n_subsections=0, repeats=.FALSE.)
    1905              : 
    1906              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
    1907              :                           variants=s2a("EPS_FILTER_MATRIX"), &
    1908              :                           description="The threshold used for sparse matrix operations", &
    1909              :                           usage="EPS_FILTER {real}", &
    1910              :                           type_of_var=real_t, &
    1911        21248 :                           default_r_val=1.0E-10_dp)
    1912        21248 :       CALL section_add_keyword(subsection, keyword)
    1913        21248 :       CALL keyword_release(keyword)
    1914              : 
    1915              :       CALL keyword_create(keyword, __LOCATION__, name="GRID", &
    1916              :                           variants=["ATOMIC_GRID"], &
    1917              :                           description="Specification of the atomic angular and radial grids for "// &
    1918              :                           "a atomic kind. This keyword must be repeated for all kinds!  "// &
    1919              :                           "Usage: GRID < LEBEDEV_GRID > < RADIAL_GRID >", &
    1920              :                           usage="GRID {string} {integer} {integer}", &
    1921        42496 :                           n_var=3, type_of_var=char_t, repeats=.TRUE.)
    1922        21248 :       CALL section_add_keyword(subsection, keyword)
    1923        21248 :       CALL keyword_release(keyword)
    1924              : 
    1925        21248 :       CALL section_add_subsection(section, subsection)
    1926        21248 :       CALL section_release(subsection)
    1927              : 
    1928              :       ! kernel XC functional
    1929        21248 :       CALL create_xc_section(subsection)
    1930        21248 :       CALL section_add_subsection(section, subsection)
    1931        21248 :       CALL section_release(subsection)
    1932              : 
    1933              :       ! MGRID subsection
    1934        21248 :       CALL create_mgrid_section(subsection, create_subsections=.FALSE.)
    1935        21248 :       CALL section_add_subsection(section, subsection)
    1936        21248 :       CALL section_release(subsection)
    1937              : 
    1938              :       ! sTDA subsection
    1939        21248 :       CALL create_stda_section(subsection)
    1940        21248 :       CALL section_add_subsection(section, subsection)
    1941        21248 :       CALL section_release(subsection)
    1942              : 
    1943              :       ! RSE subsection
    1944        21248 :       CALL create_res_section(subsection)
    1945        21248 :       CALL section_add_subsection(section, subsection)
    1946        21248 :       CALL section_release(subsection)
    1947              : 
    1948              :       CALL keyword_create(keyword, __LOCATION__, name="DO_BSE", &
    1949              :                           description="Choosing BSE kernel.", &
    1950        21248 :                           usage="DO_BSE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1951        21248 :       CALL section_add_keyword(section, keyword)
    1952        21248 :       CALL keyword_release(keyword)
    1953              : 
    1954              :       CALL keyword_create(keyword, __LOCATION__, name="DO_BSE_W_ONLY", &
    1955              :                           description="Debug option for BSE kernel.", &
    1956        21248 :                           usage="DO_BSE_W_ONLY", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1957        21248 :       CALL section_add_keyword(section, keyword)
    1958        21248 :       CALL keyword_release(keyword)
    1959              : 
    1960              :       CALL keyword_create(keyword, __LOCATION__, name="DO_BSE_GW_ONLY", &
    1961              :                           description="Debug option for BSE kernel.", &
    1962        21248 :                           usage="DO_BSE_GW_ONLY", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1963        21248 :       CALL section_add_keyword(section, keyword)
    1964        21248 :       CALL keyword_release(keyword)
    1965              : 
    1966              :       ! LRI subsection
    1967        21248 :       CALL create_lrigpw_section(subsection)
    1968        21248 :       CALL section_add_subsection(section, subsection)
    1969        21248 :       CALL section_release(subsection)
    1970              : 
    1971              :       ! LINRES section
    1972        21248 :       CALL create_linres_section(subsection, create_subsections=.FALSE., default_set_tdlr=.TRUE.)
    1973        21248 :       CALL section_add_subsection(section, subsection)
    1974        21248 :       CALL section_release(subsection)
    1975              : 
    1976              :       ! PRINT subsection
    1977              :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1978        21248 :                           description="Printing of information during the TDDFT run.", repeats=.FALSE.)
    1979              : 
    1980              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="PROGRAM_BANNER", &
    1981              :                                        description="Controls the printing of the banner for TDDFPT program", &
    1982        21248 :                                        print_level=silent_print_level, filename="__STD_OUT__")
    1983        21248 :       CALL section_add_subsection(subsection, print_key)
    1984        21248 :       CALL section_release(print_key)
    1985              : 
    1986              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="GUESS_VECTORS", &
    1987              :                                        description="Controls the printing of initial guess vectors.", &
    1988        21248 :                                        print_level=low_print_level, filename="__STD_OUT__")
    1989        21248 :       CALL section_add_subsection(subsection, print_key)
    1990        21248 :       CALL section_release(print_key)
    1991              : 
    1992              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="ITERATION_INFO", &
    1993              :                                        description="Controls the printing of basic iteration information "// &
    1994              :                                        "during the TDDFT run.", &
    1995        21248 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
    1996        21248 :       CALL section_add_subsection(subsection, print_key)
    1997        21248 :       CALL section_release(print_key)
    1998              : 
    1999              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="DETAILED_ENERGY", &
    2000              :                                        description="Controls the printing of detailed energy information "// &
    2001              :                                        "during the TDDFT run.", &
    2002        21248 :                                        print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
    2003        21248 :       CALL section_add_subsection(subsection, print_key)
    2004        21248 :       CALL section_release(print_key)
    2005              : 
    2006              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="BASIS_SET_FILE", &
    2007              :                                        description="Controls the printing of a file with all basis sets used.", &
    2008        21248 :                                        print_level=debug_print_level, filename="BASIS_SETS")
    2009        21248 :       CALL section_add_subsection(subsection, print_key)
    2010        21248 :       CALL section_release(print_key)
    2011              : 
    2012              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="RESTART", &
    2013              :                                        description="Controls the dumping of the MO restart file during TDDFPT. "// &
    2014              :                                        "By default keeps a short history of three restarts.", &
    2015              :                                        print_level=low_print_level, common_iter_levels=3, &
    2016              :                                        each_iter_names=s2a("TDDFT_SCF"), each_iter_values=[10], &
    2017        21248 :                                        add_last=add_last_numeric, filename="RESTART")
    2018              :       CALL keyword_create(keyword, __LOCATION__, name="BACKUP_COPIES", &
    2019              :                           description="Specifies the maximum number of backup copies.", &
    2020              :                           usage="BACKUP_COPIES {int}", &
    2021        21248 :                           default_i_val=1)
    2022        21248 :       CALL section_add_keyword(print_key, keyword)
    2023        21248 :       CALL keyword_release(keyword)
    2024        21248 :       CALL section_add_subsection(subsection, print_key)
    2025        21248 :       CALL section_release(print_key)
    2026              : 
    2027              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="NTO_ANALYSIS", &
    2028              :                                        description="Perform a natural transition orbital analysis.", &
    2029        21248 :                                        print_level=medium_print_level)
    2030              :       CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
    2031              :                           description="Threshold for sum of NTO eigenvalues considered", &
    2032              :                           usage="Threshold 0.95", &
    2033              :                           n_var=1, &
    2034              :                           type_of_var=real_t, &
    2035        21248 :                           default_r_val=0.975_dp)
    2036        21248 :       CALL section_add_keyword(print_key, keyword)
    2037        21248 :       CALL keyword_release(keyword)
    2038              :       CALL keyword_create(keyword, __LOCATION__, name="INTENSITY_THRESHOLD", &
    2039              :                           description="Threshold for oscillator strength to screen states.", &
    2040              :                           usage="Intensity_threshold 0.01", &
    2041              :                           n_var=1, &
    2042              :                           type_of_var=real_t, &
    2043        21248 :                           default_r_val=0.0_dp)
    2044        21248 :       CALL section_add_keyword(print_key, keyword)
    2045        21248 :       CALL keyword_release(keyword)
    2046              :       CALL keyword_create(keyword, __LOCATION__, name="STATE_LIST", &
    2047              :                           description="Specifies a list of states for the NTO calculations.", &
    2048              :                           usage="STATE_LIST {integer} {integer} .. {integer}", &
    2049        21248 :                           n_var=-1, type_of_var=integer_t)
    2050        21248 :       CALL section_add_keyword(print_key, keyword)
    2051        21248 :       CALL keyword_release(keyword)
    2052              :       CALL keyword_create(keyword, __LOCATION__, name="CUBE_FILES", &
    2053              :                           description="Print NTOs on Cube Files", &
    2054              :                           usage="CUBE_FILES {logical}", repeats=.FALSE., n_var=1, &
    2055        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    2056        21248 :       CALL section_add_keyword(print_key, keyword)
    2057        21248 :       CALL keyword_release(keyword)
    2058              :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    2059              :                           description="The stride (X,Y,Z) used to write the cube file "// &
    2060              :                           "(larger values result in smaller cube files). Provide 3 numbers (for X,Y,Z) or"// &
    2061              :                           " 1 number valid for all components.", &
    2062        21248 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
    2063        21248 :       CALL section_add_keyword(print_key, keyword)
    2064        21248 :       CALL keyword_release(keyword)
    2065              :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2066              :                           description="append the cube files when they already exist", &
    2067        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2068        21248 :       CALL section_add_keyword(print_key, keyword)
    2069        21248 :       CALL keyword_release(keyword)
    2070        21248 :       CALL section_add_subsection(subsection, print_key)
    2071        21248 :       CALL section_release(print_key)
    2072              : 
    2073              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "MOS_MOLDEN", &
    2074              :                                        description="Write the NTO in Molden file format, for visualisation.", &
    2075        21248 :                                        print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MOS")
    2076              :       CALL keyword_create(keyword, __LOCATION__, name="UNIT", &
    2077              :                           description="Unit for coordinates and cell in the MOLDEN file.", &
    2078              :                           usage="UNIT ANGSTROM", &
    2079              :                           enum_c_vals=s2a("BOHR", "ANGSTROM"), &
    2080              :                           enum_desc=s2a("Write in Bohr (AU)", "Write in Angstrom"), &
    2081              :                           enum_i_vals=[1, 2], &
    2082        21248 :                           default_i_val=1)
    2083        21248 :       CALL section_add_keyword(print_key, keyword)
    2084        21248 :       CALL keyword_release(keyword)
    2085              :       CALL keyword_create(keyword, __LOCATION__, name="WRITE_CELL", &
    2086              :                           description="Controls whether the [Cell] block is written to the MOLDEN file.", &
    2087              :                           usage="WRITE_CELL TRUE", &
    2088        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2089        21248 :       CALL section_add_keyword(print_key, keyword)
    2090        21248 :       CALL keyword_release(keyword)
    2091              :       CALL keyword_create(keyword, __LOCATION__, name="WRITE_PSEUDO", &
    2092              :                           description="Controls whether the [Pseudo] block is written to the MOLDEN file.", &
    2093              :                           usage="WRITE_PSEUDO TRUE", &
    2094        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2095        21248 :       CALL section_add_keyword(print_key, keyword)
    2096        21248 :       CALL keyword_release(keyword)
    2097              :       CALL keyword_create(keyword, __LOCATION__, name="MARK_GHOST", &
    2098              :                           description="Controls whether ghost atoms are marked in the [Atoms] block by "// &
    2099              :                           "setting their atomic number to zero.", &
    2100              :                           usage="MARK_GHOST T", &
    2101        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2102        21248 :       CALL section_add_keyword(print_key, keyword)
    2103        21248 :       CALL keyword_release(keyword)
    2104              :       CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
    2105              :                           description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
    2106              :                           usage="NDIGITS {int}", &
    2107        21248 :                           default_i_val=3)
    2108        21248 :       CALL section_add_keyword(print_key, keyword)
    2109        21248 :       CALL keyword_release(keyword)
    2110              :       CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
    2111              :                           description="Representation of Gaussian-type orbitals", &
    2112              :                           default_i_val=gto_spherical, &
    2113              :                           enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
    2114              :                           enum_desc=s2a( &
    2115              :                           "Cartesian Gaussian orbitals. Use with caution", &
    2116              :                           "Spherical Gaussian orbitals. Incompatible with VMD"), &
    2117        21248 :                           enum_i_vals=[gto_cartesian, gto_spherical])
    2118        21248 :       CALL section_add_keyword(print_key, keyword)
    2119        21248 :       CALL keyword_release(keyword)
    2120        21248 :       CALL section_add_subsection(subsection, print_key)
    2121        21248 :       CALL section_release(print_key)
    2122              : 
    2123              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="NAMD_PRINT", &
    2124              :                                        description="Controls the printout required for NAMD with NEWTONX.", &
    2125        21248 :                                        print_level=debug_print_level + 1, filename="CP2K_NEWTONX")
    2126              :       CALL keyword_create(keyword, __LOCATION__, name="PRINT_VIRTUALS", &
    2127              :                           description="Print occupied AND virtual molecular orbital coefficients", &
    2128        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2129        21248 :       CALL section_add_keyword(print_key, keyword)
    2130        21248 :       CALL keyword_release(keyword)
    2131              :       CALL keyword_create(keyword, __LOCATION__, name="PRINT_PHASES", &
    2132              :                           description="Print phases of occupied and virtuals MOs.", &
    2133        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2134        21248 :       CALL section_add_keyword(print_key, keyword)
    2135        21248 :       CALL keyword_release(keyword)
    2136              :       CALL keyword_create(keyword, __LOCATION__, name="SCALE_WITH_PHASES", &
    2137              :                           description="Scale ES eigenvectors with phases of occupied and virtuals MOs.", &
    2138        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2139        21248 :       CALL section_add_keyword(print_key, keyword)
    2140        21248 :       CALL keyword_release(keyword)
    2141        21248 :       CALL section_add_subsection(subsection, print_key)
    2142        21248 :       CALL section_release(print_key)
    2143              : 
    2144              :       !! SOC PRINT SECTION
    2145              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="SOC_PRINT", &
    2146              :                                        description="Controls the printout of the tddfpt2_soc modul", &
    2147        21248 :                                        print_level=debug_print_level + 1, filename="SOC")
    2148              :       CALL keyword_create(keyword, __LOCATION__, name="UNIT_eV", &
    2149              :                           description="Will detrement if output in eVolt will be printef.", &
    2150        21248 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    2151        21248 :       CALL section_add_keyword(print_key, keyword)
    2152        21248 :       CALL keyword_release(keyword)
    2153              :       CALL keyword_create(keyword, __LOCATION__, name="UNIT_wn", &
    2154              :                           description="Will detrement if output in wavenumbers will be printed.", &
    2155        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2156        21248 :       CALL section_add_keyword(print_key, keyword)
    2157        21248 :       CALL keyword_release(keyword)
    2158              :       CALL keyword_create(keyword, __LOCATION__, name="SPLITTING", &
    2159              :                           description="Will add the SOC-Splitting as additional output", &
    2160        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2161        21248 :       CALL section_add_keyword(print_key, keyword)
    2162        21248 :       CALL keyword_release(keyword)
    2163              :       CALL keyword_create(keyword, __LOCATION__, name="SOME", &
    2164              :                           description="Will add the SOC-Matrix as additional output in a different file", &
    2165        21248 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2166        21248 :       CALL section_add_keyword(print_key, keyword)
    2167        21248 :       CALL keyword_release(keyword)
    2168        21248 :       CALL section_add_subsection(subsection, print_key)
    2169        21248 :       CALL section_release(print_key)
    2170              : 
    2171              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="FORCES", &
    2172              :                                        description="Controls the calculation and printing of excited state forces. "// &
    2173              :                                        "This needs a RUN_TYPE that includes force evaluation, e.g. ENERGY_FORCE", &
    2174        21248 :                                        print_level=debug_print_level, filename="TDFORCE")
    2175              :       CALL keyword_create(keyword, __LOCATION__, name="LIST", &
    2176              :                           description="Specifies a list of states for the force calculations.", &
    2177              :                           usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
    2178        21248 :                           n_var=-1, type_of_var=integer_t)
    2179        21248 :       CALL section_add_keyword(print_key, keyword)
    2180        21248 :       CALL keyword_release(keyword)
    2181              :       CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
    2182              :                           description="Threshold for oszillator strength to screen states.", &
    2183              :                           usage="Threshold 0.01", &
    2184              :                           n_var=1, &
    2185              :                           type_of_var=real_t, &
    2186        21248 :                           default_r_val=0.0_dp)
    2187        21248 :       CALL section_add_keyword(print_key, keyword)
    2188        21248 :       CALL keyword_release(keyword)
    2189        21248 :       CALL section_add_subsection(subsection, print_key)
    2190        21248 :       CALL section_release(print_key)
    2191              : 
    2192        21248 :       CALL section_add_subsection(section, subsection)
    2193        21248 :       CALL section_release(subsection)
    2194              : 
    2195        21248 :    END SUBROUTINE create_tddfpt2_section
    2196              : 
    2197              : ! **************************************************************************************************
    2198              : !> \brief creates the stda input section (simplified Tamm Dancoff Approximation)
    2199              : !> \param section the section to create
    2200              : ! **************************************************************************************************
    2201        21248 :    SUBROUTINE create_stda_section(section)
    2202              :       TYPE(section_type), POINTER                        :: section
    2203              : 
    2204              :       TYPE(keyword_type), POINTER                        :: keyword
    2205              : 
    2206        21248 :       CPASSERT(.NOT. ASSOCIATED(section))
    2207              :       CALL section_create(section, __LOCATION__, name="sTDA", &
    2208              :                           description="parameters needed and setup for sTDA calculations", &
    2209        21248 :                           n_keywords=3, n_subsections=0, repeats=.FALSE.)
    2210        21248 :       NULLIFY (keyword)
    2211              : 
    2212              :       CALL keyword_create(keyword, __LOCATION__, name="FRACTION", &
    2213              :                           variants=["HFX_FRACTION"], &
    2214              :                           description="The fraction of TB Hartree-Fock exchange to use in the Kernel. "// &
    2215              :                           "0.0 implies no HFX part is used in the kernel. ", &
    2216        42496 :                           usage="FRACTION 0.0", default_r_val=0.0_dp)
    2217        21248 :       CALL section_add_keyword(section, keyword)
    2218        21248 :       CALL keyword_release(keyword)
    2219              : 
    2220              :       ! even if scaling parameter for exchange FRACTION (see above) is zero, the semi-empirical electron repulsion
    2221              :       ! operator for exchange is not, so that a keyword is required to switch off sTDA exchange (if wanted)
    2222              :       CALL keyword_create(keyword, __LOCATION__, name="DO_EXCHANGE", &
    2223              :                           description="Explicitly including or switching off sTDA exchange", &
    2224        21248 :                           usage="DO_EXCHANGE", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    2225        21248 :       CALL section_add_keyword(section, keyword)
    2226        21248 :       CALL keyword_release(keyword)
    2227              : 
    2228              :       CALL keyword_create(keyword, __LOCATION__, name="DO_EWALD", &
    2229              :                           description="Use Ewald type method for Coulomb interaction", &
    2230        21248 :                           usage="DO_EWALD", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2231        21248 :       CALL section_add_keyword(section, keyword)
    2232        21248 :       CALL keyword_release(keyword)
    2233              : 
    2234              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_TD_FILTER", &
    2235              :                           description="Threshold for filtering the transition density matrix", &
    2236        21248 :                           usage="EPS_TD_FILTER epsf", default_r_val=1.e-10_dp)
    2237        21248 :       CALL section_add_keyword(section, keyword)
    2238        21248 :       CALL keyword_release(keyword)
    2239              : 
    2240              :       CALL keyword_create(keyword, __LOCATION__, name="MATAGA_NISHIMOTO_CEXP", &
    2241              :                           description="Exponent used in Mataga-Nishimoto formula for Coulomb (alpha). "// &
    2242              :                           "Default value is method dependent!", &
    2243        21248 :                           usage="MATAGA_NISHIMOTO_CEXP cexp", default_r_val=-99.0_dp)
    2244        21248 :       CALL section_add_keyword(section, keyword)
    2245        21248 :       CALL keyword_release(keyword)
    2246              : 
    2247              :       CALL keyword_create(keyword, __LOCATION__, name="MATAGA_NISHIMOTO_XEXP", &
    2248              :                           description="Exponent used in Mataga-Nishimoto formula for Exchange (beta). "// &
    2249              :                           "Default value is method dependent!", &
    2250        21248 :                           usage="MATAGA_NISHIMOTO_XEXP xexp", default_r_val=-99.0_dp)
    2251        21248 :       CALL section_add_keyword(section, keyword)
    2252        21248 :       CALL keyword_release(keyword)
    2253              : 
    2254              :       CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_CUT", &
    2255              :                           description="Maximum range of short range part of Coulomb interaction.", &
    2256        21248 :                           usage="COULOMB_SR_CUT rcut", default_r_val=20.0_dp)
    2257        21248 :       CALL section_add_keyword(section, keyword)
    2258        21248 :       CALL keyword_release(keyword)
    2259              : 
    2260              :       CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_EPS", &
    2261              :                           description="Threshold for short range part of Coulomb interaction.", &
    2262        21248 :                           usage="COULOMB_SR_EPS sreps", default_r_val=1.e-03_dp)
    2263        21248 :       CALL section_add_keyword(section, keyword)
    2264        21248 :       CALL keyword_release(keyword)
    2265              : 
    2266        21248 :    END SUBROUTINE create_stda_section
    2267              : 
    2268              : ! **************************************************************************************************
    2269              : !> \brief creates the RES input section (Reduced Excitation Space)
    2270              : !> \param section the section to create
    2271              : ! **************************************************************************************************
    2272        21248 :    SUBROUTINE create_res_section(section)
    2273              :       TYPE(section_type), POINTER                        :: section
    2274              : 
    2275              :       TYPE(keyword_type), POINTER                        :: keyword
    2276              : 
    2277        21248 :       CPASSERT(.NOT. ASSOCIATED(section))
    2278              :       CALL section_create(section, __LOCATION__, name="REDUCED_EXCITATION_SPACE", &
    2279              :                           description="Sets up a restricted (reduced) excitation space for TDDFT", &
    2280        21248 :                           n_keywords=3, n_subsections=0, repeats=.FALSE.)
    2281              : 
    2282        21248 :       NULLIFY (keyword)
    2283              :       CALL keyword_create(keyword, __LOCATION__, &
    2284              :                           name="_SECTION_PARAMETERS_", &
    2285              :                           description="Controls the activation of RES calculation.", &
    2286              :                           default_l_val=.FALSE., &
    2287        21248 :                           lone_keyword_l_val=.TRUE.)
    2288        21248 :       CALL section_add_keyword(section, keyword)
    2289        21248 :       CALL keyword_release(keyword)
    2290              : 
    2291              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
    2292              :                           description="Upper and lower cutoffs [eV] for orbitals to be included for excitations. ", &
    2293              :                           usage="ENERGY_WINDOW -5.0 0.0", default_r_vals=[-1.0E10_dp, 1.0E10_dp], &
    2294        21248 :                           type_of_var=real_t, unit_str="eV")
    2295        21248 :       CALL section_add_keyword(section, keyword)
    2296        21248 :       CALL keyword_release(keyword)
    2297              : 
    2298              :       CALL keyword_create(keyword, __LOCATION__, name="UPPER_ENERGY_CUTOFF", &
    2299              :                           description="Upper energy cutoff [eV] for orbitals to be included in excitations.", &
    2300              :                           usage="UPPER_ENERGY_CUTOFF -5.0", default_r_val=1.0E10_dp, &
    2301        21248 :                           type_of_var=real_t, unit_str="eV")
    2302        21248 :       CALL section_add_keyword(section, keyword)
    2303        21248 :       CALL keyword_release(keyword)
    2304              : 
    2305              :       CALL keyword_create(keyword, __LOCATION__, name="LOWER_ENERGY_CUTOFF", &
    2306              :                           description="Lower energy cutoff [eV] for orbitals to be included in excitations.", &
    2307              :                           usage="LOWER_ENERGY_CUTOFF -5.0", default_r_val=-1.0E10_dp, &
    2308        21248 :                           type_of_var=real_t, unit_str="eV")
    2309        21248 :       CALL section_add_keyword(section, keyword)
    2310        21248 :       CALL keyword_release(keyword)
    2311              : 
    2312              :       CALL keyword_create(keyword, __LOCATION__, name="MOLECULE_LIST", &
    2313              :                           description="Indices of molecules to be excited. "// &
    2314              :                           "This implies the calculation of molecular states through orbital location "// &
    2315              :                           "and subspace diagonalization.", &
    2316              :                           usage="MOLECULE_LIST {integer}  {integer} ..  {integer} ", &
    2317        21248 :                           n_var=-1, type_of_var=integer_t, repeats=.FALSE.)
    2318        21248 :       CALL section_add_keyword(section, keyword)
    2319        21248 :       CALL keyword_release(keyword)
    2320              : 
    2321        21248 :    END SUBROUTINE create_res_section
    2322              : 
    2323              : ! **************************************************************************************************
    2324              : !> \brief creates an input section for electronic band structure calculations
    2325              : !> \param section section to create
    2326              : !> \par History
    2327              : !>    * 07.2023 created [Jan Wilhelm]
    2328              : ! **************************************************************************************************
    2329        10624 :    SUBROUTINE create_bandstructure_section(section)
    2330              :       TYPE(section_type), POINTER                        :: section
    2331              : 
    2332              :       TYPE(keyword_type), POINTER                        :: keyword
    2333              :       TYPE(section_type), POINTER                        :: subsection
    2334              : 
    2335        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    2336              :       CALL section_create(section, __LOCATION__, name="BANDSTRUCTURE", &
    2337              :                           description="Parameters needed to set up a calculation for "// &
    2338              :                           "electronic level energies of molecules and the electronic band "// &
    2339              :                           "structure of materials from post-SCF schemes (GW, perturbative "// &
    2340              :                           "spin-orbit coupling). Also, the density of states (DOS), "// &
    2341              :                           "projected density of states (PDOS), local density of states (LDOS), "// &
    2342              :                           "local valence band maximum (LVBM), local conduction band minimum "// &
    2343              :                           "(LCBM) and local band gap can be calculated. Please note that "// &
    2344              :                           "all methods in this section start from a Gamma-only DFT SCF. "// &
    2345              :                           "You need to make sure that the cell chosen in the DFT SCF is "// &
    2346              :                           "converged in the cell size. Band structures are computed "// &
    2347              :                           "for the primitive cell (i.e. the smallest possible unit cell of "// &
    2348              :                           "the input structure which is detected automatically). Moreover, "// &
    2349              :                           "spin-orbit coupling (SOC) on eigenvalues and band structures is "// &
    2350              :                           "available using Hartwigsen-Goedecker-Hutter "// &
    2351              :                           "pseudopotentials.", &
    2352        10624 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    2353              : 
    2354        10624 :       NULLIFY (keyword, subsection)
    2355              :       CALL keyword_create(keyword, __LOCATION__, &
    2356              :                           name="_SECTION_PARAMETERS_", &
    2357              :                           description="Controls the activation of the band structure calculation.", &
    2358              :                           default_l_val=.FALSE., &
    2359        10624 :                           lone_keyword_l_val=.TRUE.)
    2360        10624 :       CALL section_add_keyword(section, keyword)
    2361        10624 :       CALL keyword_release(keyword)
    2362              : 
    2363              :       ! here we generate a subsection for getting a k-point path for the bandstructure
    2364        10624 :       CALL create_kpoint_set_section(subsection, "BANDSTRUCTURE_PATH")
    2365        10624 :       CALL section_add_subsection(section, subsection)
    2366        10624 :       CALL section_release(subsection)
    2367              : 
    2368        10624 :       CALL create_gw_section(subsection)
    2369        10624 :       CALL section_add_subsection(section, subsection)
    2370        10624 :       CALL section_release(subsection)
    2371              : 
    2372        10624 :       CALL create_soc_section(subsection)
    2373        10624 :       CALL section_add_subsection(section, subsection)
    2374        10624 :       CALL section_release(subsection)
    2375              : 
    2376        10624 :       CALL create_dos_section(subsection)
    2377        10624 :       CALL section_add_subsection(section, subsection)
    2378        10624 :       CALL section_release(subsection)
    2379              : 
    2380        10624 :       CALL create_floquet_section(subsection)
    2381        10624 :       CALL section_add_subsection(section, subsection)
    2382        10624 :       CALL section_release(subsection)
    2383              : 
    2384        10624 :    END SUBROUTINE create_bandstructure_section
    2385              : 
    2386              : ! **************************************************************************************************
    2387              : !> \brief creates an input section for a GW calculation for the electronic band structure
    2388              : !> \param section section to create
    2389              : !> \par History
    2390              : !>    * 07.2023 created [Jan Wilhelm]
    2391              : ! **************************************************************************************************
    2392        10624 :    SUBROUTINE create_gw_section(section)
    2393              :       TYPE(section_type), POINTER                        :: section
    2394              : 
    2395              :       TYPE(keyword_type), POINTER                        :: keyword
    2396              :       TYPE(section_type), POINTER                        :: print_key, subsection
    2397              : 
    2398        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    2399              :       CALL section_create(section, __LOCATION__, name="GW", &
    2400              :                           description="Parameters needed to set up a GW calculation for "// &
    2401              :                           "electronic level energies $\varepsilon_{n\mathbf{k}}^{G_0W_0}$ "// &
    2402              :                           "of molecules and the band structure of materials: "// &
    2403              :                           "$\varepsilon_{n\mathbf{k}}^{G_0W_0}=  "// &
    2404              :                           "\varepsilon_{n\mathbf{k}}^\text{DFT}+\Sigma_{n\mathbf{k}} "// &
    2405              :                           "-v^\text{xc}_{n\mathbf{k}}$. "// &
    2406              :                           "For the GW algorithm for molecules, see "// &
    2407              :                           "<https://doi.org/10.1021/acs.jctc.0c01282>. "// &
    2408              :                           "For 2D materials, see <https://doi.org/10.1021/acs.jctc.3c01230>.", &
    2409        10624 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    2410              : 
    2411        10624 :       NULLIFY (keyword)
    2412              :       CALL keyword_create(keyword, __LOCATION__, &
    2413              :                           name="_SECTION_PARAMETERS_", &
    2414              :                           description="Controls the activation of the GW calculation.", &
    2415              :                           default_l_val=.FALSE., &
    2416        10624 :                           lone_keyword_l_val=.TRUE.)
    2417        10624 :       CALL section_add_keyword(section, keyword)
    2418        10624 :       CALL keyword_release(keyword)
    2419              : 
    2420              :       CALL keyword_create(keyword, __LOCATION__, name="NUM_TIME_FREQ_POINTS", &
    2421              :                           description="Number of discrete points for the imaginary-time "// &
    2422              :                           "grid and the imaginary-frequency grid. The more points, the more "// &
    2423              :                           "precise is the calculation. Typically, 10 points are good "// &
    2424              :                           "for 0.1 eV precision of band structures and molecular energy "// &
    2425              :                           "levels, 20 points for 0.03 eV precision, "// &
    2426              :                           "and 30 points for 0.01 eV precision, see Table I in "// &
    2427              :                           "<https://doi.org/10.1021/acs.jctc.0c01282>. GW computation time "// &
    2428              :                           "increases linearly with `NUM_TIME_FREQ_POINTS`.", &
    2429              :                           usage="NUM_TIME_FREQ_POINTS 30", &
    2430        10624 :                           default_i_val=30)
    2431        10624 :       CALL section_add_keyword(section, keyword)
    2432        10624 :       CALL keyword_release(keyword)
    2433              : 
    2434              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
    2435              :                           description="Determines a threshold for the DBCSR based sparse "// &
    2436              :                           "multiplications. Normally, `EPS_FILTER` determines accuracy "// &
    2437              :                           "and timing of low-scaling GW calculations. (Lower filter means "// &
    2438              :                           "higher numerical precision, but higher computational cost.)", &
    2439              :                           usage="EPS_FILTER 1.0E-6", &
    2440        10624 :                           default_r_val=1.0E-8_dp)
    2441        10624 :       CALL section_add_keyword(section, keyword)
    2442        10624 :       CALL keyword_release(keyword)
    2443              : 
    2444              :       CALL keyword_create(keyword, __LOCATION__, name="REGULARIZATION_MINIMAX", &
    2445              :                           description="Parameter to regularize the Fourier transformation with minimax grids. "// &
    2446              :                           "In case the parameter 0.0 is chosen, no regularization is performed.", &
    2447              :                           usage="REGULARIZATION_MINIMAX 1.0E-4", &
    2448        10624 :                           default_r_val=-1.0_dp)
    2449        10624 :       CALL section_add_keyword(section, keyword)
    2450        10624 :       CALL keyword_release(keyword)
    2451              : 
    2452              :       CALL keyword_create(keyword, __LOCATION__, name="REGULARIZATION_RI", &
    2453              :                           description="Parameter for RI regularization, setting a negative "// &
    2454              :                           "value triggers the default value. Affects RI basis set convergence "// &
    2455              :                           "but in any case large RI basis will give RI basis set convergence.", &
    2456              :                           usage="REGULARIZATION_RI 1.0E-4", &
    2457        10624 :                           default_r_val=-1.0_dp)
    2458        10624 :       CALL section_add_keyword(section, keyword)
    2459        10624 :       CALL keyword_release(keyword)
    2460              : 
    2461              :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RI", &
    2462              :                           description="The cutoff radius (in Angstrom) for the truncated  "// &
    2463              :                           "Coulomb operator. The larger the cutoff radius, the faster "// &
    2464              :                           "converges the resolution of the identity (RI) with respect to the "// &
    2465              :                           "RI basis set size. Larger cutoff radius means higher computational "// &
    2466              :                           "cost.", &
    2467              :                           usage="CUTOFF_RADIUS_RI 3.0", &
    2468              :                           default_r_val=cp_unit_to_cp2k(value=3.0_dp, unit_str="angstrom"), &
    2469        10624 :                           type_of_var=real_t, unit_str="angstrom")
    2470        10624 :       CALL section_add_keyword(section, keyword)
    2471        10624 :       CALL keyword_release(keyword)
    2472              : 
    2473              :       CALL keyword_create(keyword, __LOCATION__, name="MEMORY_PER_PROC", &
    2474              :                           description="Specify the available memory per MPI process. Set "// &
    2475              :                           "`MEMORY_PER_PROC` as accurately as possible for good performance. If "// &
    2476              :                           "`MEMORY_PER_PROC` is set lower as the actually available "// &
    2477              :                           "memory per MPI process, the performance will be "// &
    2478              :                           "bad; if `MEMORY_PER_PROC` is set higher as the actually "// &
    2479              :                           "available memory per MPI process, the program might run out of "// &
    2480              :                           "memory. You can calculate `MEMORY_PER_PROC` as follows: "// &
    2481              :                           "Get the memory per node on your machine, mem_per_node "// &
    2482              :                           "(for example, from a supercomputer website, typically between "// &
    2483              :                           "100 GB and 2 TB), get the number of "// &
    2484              :                           "MPI processes per node, n_MPI_proc_per_node"// &
    2485              :                           " (for example from your run-script; if you "// &
    2486              :                           "use slurm, the number behind '--ntasks-per-node' is the number "// &
    2487              :                           "of MPI processes per node). Then calculate "// &
    2488              :                           "`MEMORY_PER_PROC` = mem_per_node / n_MPI_proc_per_node "// &
    2489              :                           "(typically between 2 GB and 50 GB). Unit of keyword: Gigabyte (GB). "// &
    2490              :                           "Note: This keyword is not used for GW calculations with RI-RS, "// &
    2491              :                           "where the available memory is detected automatically.", &
    2492              :                           usage="MEMORY_PER_PROC 16", &
    2493        10624 :                           default_r_val=2.0_dp)
    2494        10624 :       CALL section_add_keyword(section, keyword)
    2495        10624 :       CALL keyword_release(keyword)
    2496              : 
    2497              :       CALL keyword_create(keyword, __LOCATION__, name="APPROX_KP_EXTRAPOL", &
    2498              :                           description="If true, use only a 4x4 kpoint mesh for frequency "// &
    2499              :                           "points $\omega_j, j \ge 2$ (instead of a 4x4 and 6x6 k-point mesh). "// &
    2500              :                           "The k-point extrapolation of $W_{PQ}(i\omega_j,\mathbf{q})$ "// &
    2501              :                           "is done approximately from $W_{PQ}(i\omega_1,\mathbf{q})$.", &
    2502              :                           usage="APPROX_KP_EXTRAPOL", &
    2503        10624 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2504        10624 :       CALL section_add_keyword(section, keyword)
    2505        10624 :       CALL keyword_release(keyword)
    2506              : 
    2507              :       CALL keyword_create(keyword, __LOCATION__, name="SIZE_LATTICE_SUM", &
    2508              :                           description="Parameter determines how many neighbor cells $\mathbf{R}$ "// &
    2509              :                           "are used for computing "// &
    2510              :                           "$V_{PQ}(\mathbf{k}) = "// &
    2511              :                           "\sum_{\mathbf{R}} e^{i\mathbf{k}\cdot\mathbf{R}}\,\langle P, "// &
    2512              :                           "\text{cell}{=}\mathbf{0}|1/r|Q,\text{cell}{=}\mathbf{R}\rangle$. "// &
    2513              :                           "Normally, parameter does not need to be touched.", &
    2514              :                           usage="SIZE_LATTICE_SUM 4", &
    2515        10624 :                           default_i_val=3)
    2516        10624 :       CALL section_add_keyword(section, keyword)
    2517        10624 :       CALL keyword_release(keyword)
    2518              : 
    2519              :       CALL keyword_create( &
    2520              :          keyword, __LOCATION__, name="KPOINTS_W", &
    2521              :          description="Monkhorst-Pack k-point mesh of size N_x, N_y, N_z for calculating "// &
    2522              :          "$W_{PQ}^\mathbf{R}=\int_\text{BZ}\frac{d\mathbf{k}}{\Omega_\text{BZ}}\, "// &
    2523              :          "e^{-i\mathbf{k}\cdot\mathbf{R}}\,W_{PQ}(\mathbf{k})$. "// &
    2524              :          "For non-periodic directions α, choose N_α = 1. "// &
    2525              :          "Automatic choice of the k-point mesh for negative "// &
    2526              :          "values, i.e. KPOINTS_W -1 -1 -1. "// &
    2527              :          "K-point extrapolation of W is automatically switched on.", &
    2528              :          usage="KPOINTS_W N_x  N_y  N_z", &
    2529        10624 :          n_var=3, type_of_var=integer_t, default_i_vals=[-1, -1, -1])
    2530        10624 :       CALL section_add_keyword(section, keyword)
    2531        10624 :       CALL keyword_release(keyword)
    2532              : 
    2533              :       CALL keyword_create(keyword, __LOCATION__, name="HEDIN_SHIFT", &
    2534              :                           description="If true, use Hedin's shift in G0W0, evGW and evGW0. "// &
    2535              :                           "Details see in Li et al. JCTC 18, 7570 "// &
    2536              :                           "(2022), Figure 1. G0W0 with Hedin's shift should give "// &
    2537              :                           "similar GW eigenvalues as evGW0; at a lower "// &
    2538              :                           "computational cost.", &
    2539              :                           usage="HEDIN_SHIFT", &
    2540              :                           default_l_val=.FALSE., &
    2541        10624 :                           lone_keyword_l_val=.TRUE.)
    2542        10624 :       CALL section_add_keyword(section, keyword)
    2543        10624 :       CALL keyword_release(keyword)
    2544              : 
    2545              :       CALL keyword_create(keyword, __LOCATION__, name="FREQ_MAX_FIT", &
    2546              :                           description="For analytic continuation, a fit on Σ(iω) is performed. "// &
    2547              :                           "This fit is then evaluated at a real frequency, Σ(ω), which is used "// &
    2548              :                           "in the quasiparticle equation "// &
    2549              :                           "$\varepsilon_{n\mathbf{k}}^{G_0W_0}=  "// &
    2550              :                           "\varepsilon_{n\mathbf{k}}^\text{DFT}+\Sigma_{n\mathbf{k}} "// &
    2551              :                           "-v^\text{xc}_{n\mathbf{k}}$. The keyword FREQ_MAX_FIT "// &
    2552              :                           "determines fitting range for the self-energy Σ(iω) on "// &
    2553              :                           "imaginary axis: i*[0, ω_max] for empty orbitals/bands, i*[-ω_max,0] "// &
    2554              :                           "for occ orbitals. A smaller ω_max might lead to better numerical "// &
    2555              :                           "stability (i.e., if you observe clearly wrong GW eigenvalues/bands "// &
    2556              :                           "around HOMO/LUMO, decreasing ω_max might fix this issue). "// &
    2557              :                           "A small benchmark of ω_max is contained in Fig. 5 of "// &
    2558              :                           "J. Wilhelm et al., JCTC 12, 3623-3635 (2016). "// &
    2559              :                           "Note that we used ω_max = 1 Ha = 27.211 eV in the benchmark "// &
    2560              :                           "M. Azizi et al., PRB 109, 245101 (2024).", &
    2561              :                           unit_str="eV", &
    2562              :                           usage="FREQ_MAX_FIT 20.0", &
    2563        10624 :                           default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"))
    2564        10624 :       CALL section_add_keyword(section, keyword)
    2565        10624 :       CALL keyword_release(keyword)
    2566              : 
    2567        10624 :       NULLIFY (subsection, print_key)
    2568              :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    2569              :                           description="Printing of GW restarts.", &
    2570        10624 :                           n_keywords=2, n_subsections=1, repeats=.FALSE.)
    2571              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
    2572              :                                        description="Controls the printing of restart files "// &
    2573              :                                        "for χ, W, Σ.", &
    2574              :                                        filename="", print_level=low_print_level, &
    2575        10624 :                                        common_iter_levels=3)
    2576        10624 :       CALL section_add_subsection(subsection, print_key)
    2577        10624 :       CALL section_release(print_key)
    2578              : 
    2579              :       CALL keyword_create(keyword, __LOCATION__, name="PRINT_DBT_CONTRACT", &
    2580              :                           description="Prints information of contraction routines.", &
    2581              :                           usage="PRINT_DBT_CONTRACT", &
    2582              :                           default_l_val=.FALSE., &
    2583        10624 :                           lone_keyword_l_val=.TRUE.)
    2584        10624 :       CALL section_add_keyword(subsection, keyword)
    2585        10624 :       CALL keyword_release(keyword)
    2586              : 
    2587              :       CALL keyword_create(keyword, __LOCATION__, name="PRINT_DBT_CONTRACT_VERBOSE", &
    2588              :                           description="Prints verbose information of contraction routines.", &
    2589              :                           usage="PRINT_DBT_CONTRACT_VERBOSE", &
    2590              :                           default_l_val=.FALSE., &
    2591        10624 :                           lone_keyword_l_val=.TRUE.)
    2592        10624 :       CALL section_add_keyword(subsection, keyword)
    2593        10624 :       CALL keyword_release(keyword)
    2594              : 
    2595              :       CALL keyword_create(keyword, __LOCATION__, name="RI_RS", &
    2596              :                           description="Real-Space Resolution of Identity (RI-RS) method. This "// &
    2597              :                           "approximation replaces the conventional 3-center RI integrals "// &
    2598              :                           "$(\mu\nu|P)$ by a factorized representation on an atom-centered "// &
    2599              :                           "real-space grid $\{\mathbf{r}_\ell\}$: "// &
    2600              :                           "$(\mu\nu|P) \approx \sum_\ell \varphi_\mu(\mathbf{r}_\ell) "// &
    2601              :                           "\varphi_\nu(\mathbf{r}_\ell) Z_{\ell P}$. "// &
    2602              :                           "The coefficients $Z_{\ell P}$ combine the numerical integration "// &
    2603              :                           "weights and the Coulomb potential of the auxiliary basis function "// &
    2604              :                           "$P$ evaluated at grid point $\mathbf{r}_\ell$. To reduce the "// &
    2605              :                           "computational cost, only grid points within the sphere $B^P$ are "// &
    2606              :                           "included, where "// &
    2607              :                           "$B^P = \{\mathbf{r} : |\mathbf{r} - \mathbf{R}_P| < R_c + r_P\}$. "// &
    2608              :                           "Here, $r_P$ is the effective radius of the most diffuse RI "// &
    2609              :                           "auxiliary Gaussian on atom $P$, at which the basis function "// &
    2610              :                           "magnitude falls below a threshold $\delta$ "// &
    2611              :                           "(currently controlled through EPS_FILTER). "// &
    2612              :                           "This locality approximation yields a sparse representation of the "// &
    2613              :                           "3-center integrals and enables reduced computational cost. "// &
    2614              :                           "See details in https://doi.org/10.1063/1.5090605.", &
    2615              :                           usage="RI_RS", &
    2616              :                           default_l_val=.FALSE., &
    2617        10624 :                           lone_keyword_l_val=.TRUE.)
    2618        10624 :       CALL section_add_keyword(section, keyword)
    2619        10624 :       CALL keyword_release(keyword)
    2620              : 
    2621              :       CALL keyword_create(keyword, __LOCATION__, name="TIKHONOV", &
    2622              :                           description="Regularization parameter $\alpha$ used to stabilize "// &
    2623              :                           "the inversion of the grid-overlap matrix "// &
    2624              :                           "$D$ in the RI-RS method. "// &
    2625              :                           "See Equation (9) in https://doi.org/10.1063/1.5090605.", &
    2626              :                           usage="TIKHONOV 1.0E-8", &
    2627        10624 :                           default_r_val=1.0E-08_dp)
    2628        10624 :       CALL section_add_keyword(section, keyword)
    2629        10624 :       CALL keyword_release(keyword)
    2630              : 
    2631              :       CALL keyword_create(keyword, __LOCATION__, name="GRID_SELECT", &
    2632              :                           description="Selection of the atom-centered grid type used "// &
    2633              :                           "in RI-RS optimized by Duchemin and Blase. "// &
    2634              :                           "(1) def2-TZVPP: Available for elements up to the fourth row "// &
    2635              :                           "of the periodic table (see https://doi.org/10.1021/acs.jctc.1c00101). "// &
    2636              :                           "(2) cc-pVTZ: Available for H, C, N, and O atoms "// &
    2637              :                           "(see https://doi.org/10.1063/1.5090605). "// &
    2638              :                           "(3) User-provided grids: per-element grid files supplied by the "// &
    2639              :                           "user, read as ri_rs_grid/<Element><suffix> in the same format as "// &
    2640              :                           "the built-in sets; the suffix is _rirs.ion by default and can be "// &
    2641              :                           "changed with GRID_FILE_SUFFIX.", &
    2642              :                           usage="GRID_SELECT 1", &
    2643        10624 :                           default_i_val=1)
    2644        10624 :       CALL section_add_keyword(section, keyword)
    2645        10624 :       CALL keyword_release(keyword)
    2646              : 
    2647              :       CALL keyword_create(keyword, __LOCATION__, name="GRID_FILE_SUFFIX", &
    2648              :                           description="Overrides the per-element grid file suffix used by "// &
    2649              :                           "GRID_SELECT 3; grid files are read as ri_rs_grid/<Element><suffix>.", &
    2650              :                           usage="GRID_FILE_SUFFIX _my-grids.ion", &
    2651        10624 :                           default_lc_val="")
    2652        10624 :       CALL section_add_keyword(section, keyword)
    2653        10624 :       CALL keyword_release(keyword)
    2654              : 
    2655              :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RL_RI", &
    2656              :                           description="Real-space cutoff radius (in Angstrom) for evaluating "// &
    2657              :                           "the RI-RS integration domain $B^P$. Overrides the default "// &
    2658              :                           "$R_c + r_P$, where $R_c$ is the truncated-Coulomb cutoff of the "// &
    2659              :                           "RI metric and $r_P$ the radius of the most diffuse RI auxiliary "// &
    2660              :                           "Gaussian on atom $P$.", &
    2661              :                           usage="CUTOFF_RADIUS_RL_RI 15.0", &
    2662              :                           default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
    2663        10624 :                           type_of_var=real_t, unit_str="angstrom")
    2664        10624 :       CALL section_add_keyword(section, keyword)
    2665        10624 :       CALL keyword_release(keyword)
    2666              : 
    2667              :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RL_AO", &
    2668              :                           description="Real-space cutoff radius (in Angstrom) for evaluating "// &
    2669              :                           "the AO basis functions on the RI-RS grid. Override the default radius "// &
    2670              :                           "derived automatically from the most diffuse AO Gaussian on each atom. ", &
    2671              :                           usage="CUTOFF_RADIUS_RL_AO 8.0", &
    2672              :                           default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
    2673        10624 :                           type_of_var=real_t, unit_str="angstrom")
    2674        10624 :       CALL section_add_keyword(section, keyword)
    2675        10624 :       CALL keyword_release(keyword)
    2676              : 
    2677              :       CALL keyword_create(keyword, __LOCATION__, name="N_PROCS_PER_ATOM_Z_LP", &
    2678              :                           description="Number of MPI ranks that cooperate on one atom's "// &
    2679              :                           "Cholesky factorisation in computation of $Z_{\ell P}$ in RI-RS. "// &
    2680              :                           "Default -1 = AUTO: "// &
    2681              :                           "each atom is solved single-rank (fast BLAS) unless its dense "// &
    2682              :                           "grid-overlap matrix would exceed the available memory per process, "// &
    2683              :                           "in which case it is distributed across a rank subgroup sized "// &
    2684              :                           "automatically (ScaLAPACK). Set to 1 to force single-rank for all "// &
    2685              :                           "atoms, or > 1 to force that fixed subgroup size for all atoms.", &
    2686              :                           usage="N_PROCS_PER_ATOM_Z_LP 2", &
    2687        10624 :                           default_i_val=-1)
    2688        10624 :       CALL section_add_keyword(section, keyword)
    2689        10624 :       CALL keyword_release(keyword)
    2690              : 
    2691              :       CALL keyword_create(keyword, __LOCATION__, name="N_PANELS", &
    2692              :                           description="Number of grid panels (batches) the real-space grid is "// &
    2693              :                           "split into for the streaming chi/W/Sigma contractions in RI-RS. More "// &
    2694              :                           "panels means lower peak memory per step but more overhead. Default 1 = a "// &
    2695              :                           "single whole-grid panel. On large cells the number of panels is "// &
    2696              :                           "automatically increased beyond the request to keep per-rank DBCSR "// &
    2697              :                           "messages under the 32-bit length limit.", &
    2698              :                           usage="N_PANELS 4", &
    2699        10624 :                           default_i_val=1)
    2700        10624 :       CALL section_add_keyword(section, keyword)
    2701        10624 :       CALL keyword_release(keyword)
    2702              : 
    2703              :       CALL keyword_create(keyword, __LOCATION__, name="KEEP_SPARSITY_RL", &
    2704              :                           description="If `.TRUE.` (default), the W/V matrices in the "// &
    2705              :                           "grid-basis contractions of RI-RSwill used the sparsity pattern of the "// &
    2706              :                           "corresponding G/D matrices. "// &
    2707              :                           "Set `.FALSE.` to build W/V fully dense.", &
    2708              :                           usage="KEEP_SPARSITY_RL .FALSE.", &
    2709        10624 :                           default_l_val=.TRUE.)
    2710        10624 :       CALL section_add_keyword(section, keyword)
    2711        10624 :       CALL keyword_release(keyword)
    2712              : 
    2713              :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RL_W", &
    2714              :                           description="Real-space truncation radius (Angstrom) for the grid-basis "// &
    2715              :                           "G operators in the RI-RS GW self-energy. "// &
    2716              :                           "Default -1.0 disables the truncation (exact grid-basis operators).", &
    2717              :                           usage="CUTOFF_RADIUS_RL_W 20.0", &
    2718              :                           default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
    2719        10624 :                           type_of_var=real_t, unit_str="angstrom")
    2720        10624 :       CALL section_add_keyword(section, keyword)
    2721        10624 :       CALL keyword_release(keyword)
    2722              : 
    2723              :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_G_W", &
    2724              :                           description="Atom-pair distance truncation radius (Angstrom) applied to "// &
    2725              :                           "the AO/RI-space operator matrices G, D, V and W themselves in the RI-RS "// &
    2726              :                           "GW contractions: matrix blocks between atoms further apart than this "// &
    2727              :                           "radius are dropped. Physically consistent with CUTOFF_RADIUS_RL_W, "// &
    2728              :                           "which truncates the grid-basis products at the same kind of range. "// &
    2729              :                           "Default -1.0 disables the truncation (exact operators).", &
    2730              :                           usage="CUTOFF_RADIUS_G_W 20.0", &
    2731              :                           default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
    2732        10624 :                           type_of_var=real_t, unit_str="angstrom")
    2733        10624 :       CALL section_add_keyword(section, keyword)
    2734        10624 :       CALL keyword_release(keyword)
    2735              : 
    2736        10624 :       CALL section_add_subsection(section, subsection)
    2737        10624 :       CALL section_release(subsection)
    2738              : 
    2739        10624 :    END SUBROUTINE create_gw_section
    2740              : 
    2741              : ! **************************************************************************************************
    2742              : !> \brief creates an input section for calculation SOC for the electronic band structure
    2743              : !> \param section section to create
    2744              : !> \par History
    2745              : !>    * 09.2023 created [Jan Wilhelm]
    2746              : ! **************************************************************************************************
    2747        10624 :    SUBROUTINE create_soc_section(section)
    2748              :       TYPE(section_type), POINTER                        :: section
    2749              : 
    2750              :       TYPE(keyword_type), POINTER                        :: keyword
    2751              : 
    2752        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    2753              :       CALL section_create(section, __LOCATION__, name="SOC", &
    2754              :                           description="Switch on or off spin-orbit coupling. Use SOC "// &
    2755              :                           "parameters from non-local pseudopotentials as given in "// &
    2756              :                           "Hartwigsen, Goedecker, Hutter, Eq.(18), (19), "// &
    2757              :                           "<https://doi.org/10.1103/PhysRevB.58.3641>, "// &
    2758              :                           "$V_{\mu\nu}^{\mathrm{SOC}, (\alpha)} = "// &
    2759              :                           "(\hbar/2) \langle \phi_\mu | \sum_l \Delta "// &
    2760              :                           "V_l^\mathrm{SO}(\mathbf{r},\mathbf{r}') "// &
    2761              :                           "L^{(\alpha)} | \phi_\nu \rangle, "// &
    2762              :                           "\alpha = x, y, z$.", &
    2763        10624 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    2764              : 
    2765        10624 :       NULLIFY (keyword)
    2766              :       CALL keyword_create(keyword, __LOCATION__, &
    2767              :                           name="_SECTION_PARAMETERS_", &
    2768              :                           description="Controls the activation of the SOC calculation.", &
    2769              :                           default_l_val=.FALSE., &
    2770        10624 :                           lone_keyword_l_val=.TRUE.)
    2771        10624 :       CALL section_add_keyword(section, keyword)
    2772        10624 :       CALL keyword_release(keyword)
    2773              : 
    2774              :       CALL keyword_create(keyword, __LOCATION__, name="SOC_WINDOW_OCC", &
    2775              :                           description="Apply SOC only for states with eigenvalues below VBM "// &
    2776              :                           "in the interval $[\varepsilon_\mathrm{VBM}-E_\mathrm{window\_occ}, \ "// &
    2777              :                           "\varepsilon_\mathrm{VBM}]$. "// &
    2778              :                           "to use for large systems to prevent numerical instabilities.", &
    2779              :                           usage="SOC_WINDOW_OCC 5.0", &
    2780              :                           default_r_val=-1.0_dp, &
    2781        10624 :                           unit_str="eV")
    2782        10624 :       CALL section_add_keyword(section, keyword)
    2783        10624 :       CALL keyword_release(keyword)
    2784              : 
    2785              :       CALL keyword_create(keyword, __LOCATION__, name="SOC_WINDOW_VIRT", &
    2786              :                           description="Apply SOC only for states with eigenvalues above CBM "// &
    2787              :                           "in the interval $[\varepsilon_\mathrm{CBM},\ "// &
    2788              :                           "\varepsilon_\mathrm{CBM}+E_\mathrm{window\_virt}]$, "// &
    2789              :                           "to use for large systems to prevent numerical instabilities.", &
    2790              :                           usage="SOC_WINDOW_VIRT 5.0", &
    2791              :                           default_r_val=-1.0_dp, &
    2792        10624 :                           unit_str="eV")
    2793        10624 :       CALL section_add_keyword(section, keyword)
    2794        10624 :       CALL keyword_release(keyword)
    2795              : 
    2796              :       CALL keyword_create(keyword, __LOCATION__, name="SOC_WINDOW_SMEARING", &
    2797              :                           description="Width of the Fermi-like smoothing at the SOC energy-window edge. "// &
    2798              :                           "Default reproduces the value of 1 eV. "// &
    2799              :                           "only effective when at least one SOC window is active.", &
    2800              :                           usage="SOC_WINDOW_SMEARING 1.0", &
    2801              :                           default_r_val=cp_unit_to_cp2k(value=1.0_dp, unit_str="eV"), &
    2802        10624 :                           unit_str="eV")
    2803        10624 :       CALL section_add_keyword(section, keyword)
    2804        10624 :       CALL keyword_release(keyword)
    2805              : 
    2806        10624 :    END SUBROUTINE create_soc_section
    2807              : 
    2808              : ! **************************************************************************************************
    2809              : !> \brief input section for computing the density of states and the projected density of states
    2810              : !> \param section section to create
    2811              : !> \par History
    2812              : !>    * 09.2023 created [Jan Wilhelm]
    2813              : ! **************************************************************************************************
    2814        10624 :    SUBROUTINE create_dos_section(section)
    2815              :       TYPE(section_type), POINTER                        :: section
    2816              : 
    2817              :       TYPE(keyword_type), POINTER                        :: keyword
    2818              :       TYPE(section_type), POINTER                        :: subsection
    2819              : 
    2820        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    2821              :       CALL section_create(section, __LOCATION__, name="DOS", &
    2822              :                           description="Parameters needed to calculate the density of states "// &
    2823              :                           "(DOS) and the projected density of states (PDOS).", &
    2824        10624 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    2825              : 
    2826        10624 :       NULLIFY (keyword)
    2827              :       CALL keyword_create(keyword, __LOCATION__, &
    2828              :                           name="_SECTION_PARAMETERS_", &
    2829              :                           description="Controls the activation of the DOS calculation.", &
    2830              :                           default_l_val=.FALSE., &
    2831        10624 :                           lone_keyword_l_val=.TRUE.)
    2832        10624 :       CALL section_add_keyword(section, keyword)
    2833        10624 :       CALL keyword_release(keyword)
    2834              : 
    2835              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
    2836              :                           description="Print DOS and PDOS in the energy window "// &
    2837              :                           "$[\varepsilon_\mathrm{VBM}-E_\mathrm{window}/2,  "// &
    2838              :                           "\varepsilon_\mathrm{CBM}+E_\mathrm{window}/2]$,"// &
    2839              :                           " where VBM is the valence "// &
    2840              :                           "band maximum (or highest occupied molecular orbital, HOMO, for "// &
    2841              :                           "molecules) and CBM the conduction band minimum (or lowest "// &
    2842              :                           "unoccupied molecular orbital, LUMO, for molecules).", &
    2843              :                           usage="ENERGY_WINDOW 5.0", &
    2844              :                           default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"), &
    2845        10624 :                           unit_str="eV")
    2846        10624 :       CALL section_add_keyword(section, keyword)
    2847        10624 :       CALL keyword_release(keyword)
    2848              : 
    2849              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_STEP", &
    2850              :                           description="Resolution of the energy E when computing the $\rho(E)$.", &
    2851              :                           usage="ENERGY_STEP 0.01", &
    2852              :                           default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
    2853        10624 :                           unit_str="eV")
    2854        10624 :       CALL section_add_keyword(section, keyword)
    2855        10624 :       CALL keyword_release(keyword)
    2856              : 
    2857              :       CALL keyword_create(keyword, __LOCATION__, name="BROADENING", &
    2858              :                           description="Broadening α in Gaussians used in the DOS; "// &
    2859              :                           "$\rho(E) = \sum_n \exp(((E-\varepsilon_n)/\alpha)^2)/("// &
    2860              :                           " \sqrt{2\pi} \alpha)$.", &
    2861              :                           usage="BROADENING 0.01", &
    2862              :                           default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
    2863        10624 :                           unit_str="eV")
    2864        10624 :       CALL section_add_keyword(section, keyword)
    2865        10624 :       CALL keyword_release(keyword)
    2866              : 
    2867              :       CALL keyword_create( &
    2868              :          keyword, __LOCATION__, name="KPOINTS", &
    2869              :          description="Monkhorst-Pack k-point mesh of size N_x, N_y, N_z for calculating "// &
    2870              :          "the density of states (DOS). In GW, the KPOINT_DOS mesh is thus used as k-point "// &
    2871              :          "mesh for the self-energy. For non-periodic directions α, choose N_α = 1. "// &
    2872              :          "Automatic choice of the k-point mesh for negative "// &
    2873              :          "values, i.e. KPOINTS_DOS -1 -1 -1 (automatic choice: N_α = 1 in non-periodic "// &
    2874              :          "direction, 8 k-points in periodic direction). If you like to compute a "// &
    2875              :          "band structure along a k-path, you can specify the k-path in "// &
    2876              :          "&KPOINT_SET.", &
    2877              :          usage="KPOINTS N_x  N_y  N_z", &
    2878        10624 :          n_var=3, type_of_var=integer_t, default_i_vals=[-1, -1, -1])
    2879        10624 :       CALL section_add_keyword(section, keyword)
    2880        10624 :       CALL keyword_release(keyword)
    2881              : 
    2882        10624 :       NULLIFY (subsection)
    2883        10624 :       CALL create_ldos_section(subsection)
    2884        10624 :       CALL section_add_subsection(section, subsection)
    2885        10624 :       CALL section_release(subsection)
    2886              : 
    2887        10624 :    END SUBROUTINE create_dos_section
    2888              : 
    2889              : ! **************************************************************************************************
    2890              : !> \brief ...
    2891              : !> \param section ...
    2892              : ! **************************************************************************************************
    2893        10624 :    SUBROUTINE create_ldos_section(section)
    2894              :       TYPE(section_type), POINTER                        :: section
    2895              : 
    2896              :       TYPE(keyword_type), POINTER                        :: keyword
    2897              : 
    2898        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    2899              :       CALL section_create(section, __LOCATION__, name="LDOS", &
    2900              :                           description="Parameters needed to calculate the local density "// &
    2901              :                           "of states (LDOS).  "// &
    2902              :                           "The LDOS is computed as $\rho(\mathbf{r},E) = "// &
    2903              :                           "\sum\limits_{n,\mathbf{k}}"// &
    2904              :                           " |\psi_{n\mathbf{k}}(r)|^2\, w_\mathbf{k}\, g(E-\varepsilon_{n\mathbf{k}})$ "// &
    2905              :                           "using the Gaussian weight function "// &
    2906              :                           "$g(x) = \exp(x^2/\alpha^2)/(\sqrt{2\pi}\alpha)$, $\alpha$ is the broadening "// &
    2907              :                           "from the &DOS section, and the k-point weight "// &
    2908              :                           "$w_\mathbf{k}$. The k-mesh is taken from the &DOS section.", &
    2909        10624 :                           n_keywords=2, repeats=.FALSE.)
    2910              : 
    2911        10624 :       NULLIFY (keyword)
    2912              :       CALL keyword_create(keyword, __LOCATION__, &
    2913              :                           name="_SECTION_PARAMETERS_", &
    2914              :                           description="Activates the local VBM CBM gap calculation.", &
    2915              :                           default_l_val=.FALSE., &
    2916        10624 :                           lone_keyword_l_val=.TRUE.)
    2917        10624 :       CALL section_add_keyword(section, keyword)
    2918        10624 :       CALL keyword_release(keyword)
    2919              : 
    2920              :       CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION", &
    2921              :                           description="Defines whether the LDOS is integrated along a "// &
    2922              :                           "coordinate. As an example, for INTEGRATION Z, the LDOS "// &
    2923              :                           "$\rho(x,y,E) = \int dz\, \rho(x,y,z,E)$ is computed.", &
    2924              :                           usage="INTEGRATION Z", &
    2925              :                           enum_c_vals=s2a("X", "Y", "Z", "NONE"), &
    2926              :                           enum_i_vals=[int_ldos_x, int_ldos_y, int_ldos_z, int_ldos_none], &
    2927              :                           enum_desc=s2a("Integrate over x coordinate (not yet implemented).", &
    2928              :                                         "Integrate over y coordinate (not yet implemented).", &
    2929              :                                         "Integrate over z coordinate.", &
    2930              :                                         "No integration, print cube file as function "// &
    2931              :                                         "of x,y,z (not yet implemented)."), &
    2932        10624 :                           default_i_val=int_ldos_z)
    2933        10624 :       CALL section_add_keyword(section, keyword)
    2934        10624 :       CALL keyword_release(keyword)
    2935              : 
    2936              :       CALL keyword_create( &
    2937              :          keyword, __LOCATION__, name="BIN_MESH", &
    2938              :          description="Mesh of size n x m for binning the space coordinates x and y of "// &
    2939              :          "the LDOS $\rho(x,y,E)$. If -1, no binning is performed and the "// &
    2940              :          "fine x, y resolution of the electron density from SCF is used.", &
    2941              :          usage="BIN_MESH  n m", &
    2942        10624 :          n_var=2, type_of_var=integer_t, default_i_vals=[10, 10])
    2943        10624 :       CALL section_add_keyword(section, keyword)
    2944        10624 :       CALL keyword_release(keyword)
    2945              : 
    2946        10624 :    END SUBROUTINE create_ldos_section
    2947              : 
    2948              : ! **************************************************************************************************
    2949              : !> \brief creates an input section for a tip scan calculation
    2950              : !> \param section section to create
    2951              : !> \par History
    2952              : !>    * 04.2021 created [JGH]
    2953              : ! **************************************************************************************************
    2954        10624 :    SUBROUTINE create_tipscan_section(section)
    2955              :       TYPE(section_type), POINTER                        :: section
    2956              : 
    2957              :       TYPE(keyword_type), POINTER                        :: keyword
    2958              : 
    2959        10624 :       CPASSERT(.NOT. ASSOCIATED(section))
    2960              :       CALL section_create(section, __LOCATION__, name="TIP_SCAN", &
    2961              :                           description="Parameters needed to set up a Tip Scan. "// &
    2962              :                           "Needs external definition of tip induced field.", &
    2963        10624 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    2964              : 
    2965        10624 :       NULLIFY (keyword)
    2966              : 
    2967              :       CALL keyword_create(keyword, __LOCATION__, &
    2968              :                           name="_SECTION_PARAMETERS_", &
    2969              :                           description="Controls the activation of the Tip Scan procedure", &
    2970              :                           default_l_val=.FALSE., &
    2971        10624 :                           lone_keyword_l_val=.TRUE.)
    2972        10624 :       CALL section_add_keyword(section, keyword)
    2973        10624 :       CALL keyword_release(keyword)
    2974              : 
    2975              :       CALL keyword_create(keyword, __LOCATION__, name="SCAN_DIRECTION", &
    2976              :                           description="Defines scan direction and scan type(line, plane).", &
    2977              :                           usage="SCAN_DIRECTION XY", &
    2978              :                           enum_c_vals=s2a("X", "Y", "Z", "XY", "XZ", "YZ", "XYZ"), &
    2979              :                           enum_i_vals=[scan_x, scan_y, scan_z, scan_xy, scan_xz, scan_yz, scan_xyz], &
    2980        10624 :                           default_i_val=scan_xy)
    2981        10624 :       CALL section_add_keyword(section, keyword)
    2982        10624 :       CALL keyword_release(keyword)
    2983              : 
    2984              :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
    2985              :                           description="The reference point to define the absolute position of the scan. ", &
    2986              :                           usage="REFERENCE_POINT 0.0 0.0 1.0", &
    2987              :                           n_var=3, default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp], type_of_var=real_t, &
    2988        10624 :                           unit_str="angstrom")
    2989        10624 :       CALL section_add_keyword(section, keyword)
    2990        10624 :       CALL keyword_release(keyword)
    2991              : 
    2992              :       CALL keyword_create(keyword, __LOCATION__, name="SCAN_POINTS", &
    2993              :                           description="Number of points calculated for each scan direction.", &
    2994              :                           usage="SCAN_POINTS 20 20", &
    2995        10624 :                           n_var=-1, type_of_var=integer_t)
    2996        10624 :       CALL section_add_keyword(section, keyword)
    2997        10624 :       CALL keyword_release(keyword)
    2998              : 
    2999              :       CALL keyword_create(keyword, __LOCATION__, name="SCAN_STEP", &
    3000              :                           description="Step size for each scan direction.", &
    3001              :                           usage="SCAN_STEP 0.01 0.01", &
    3002        10624 :                           n_var=-1, type_of_var=real_t, unit_str="angstrom")
    3003        10624 :       CALL section_add_keyword(section, keyword)
    3004        10624 :       CALL keyword_release(keyword)
    3005              : 
    3006              :       CALL keyword_create(keyword, __LOCATION__, name="TIP_FILENAME", &
    3007              :                           description="Filename of tip potential defined in cube file format.", &
    3008              :                           usage="TIP_FILENAME <filename>", &
    3009        10624 :                           type_of_var=lchar_t)
    3010        10624 :       CALL section_add_keyword(section, keyword)
    3011        10624 :       CALL keyword_release(keyword)
    3012              : 
    3013        10624 :    END SUBROUTINE create_tipscan_section
    3014              : 
    3015              : ! **************************************************************************************************
    3016              : !> \brief ...
    3017              : !> \param section ...
    3018              : !> \param section_name ...
    3019              : !> \author Shridhar Shanbhag
    3020              : ! **************************************************************************************************
    3021        10624 :    SUBROUTINE create_floquet_section(section)
    3022              :       TYPE(section_type), POINTER                        :: section
    3023              : 
    3024              :       TYPE(keyword_type), POINTER                        :: keyword
    3025              : 
    3026              :       CALL section_create(section, __LOCATION__, name="FLOQUET", &
    3027              :                           description="Parameters controlling the calculation of the "// &
    3028              :                           "Floquet band structure and Quasi-energies of a system driven "// &
    3029              :                           "by a periodic monochromatic electric field with any arbitrary "// &
    3030              :                           "polarisation state.", &
    3031        10624 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    3032        10624 :       NULLIFY (keyword)
    3033              : 
    3034              :       CALL keyword_create(keyword, __LOCATION__, name="AMPLITUDE", &
    3035              :                           description="Electric field amplitude of the monochromatic light.", &
    3036              :                           usage="AMPLITUDE [Vm-1] 1.0E9", n_var=1, type_of_var=real_t, &
    3037        10624 :                           unit_str="Vm-1", default_r_val=0.0_dp)
    3038        10624 :       CALL section_add_keyword(section, keyword)
    3039        10624 :       CALL keyword_release(keyword)
    3040              : 
    3041              :       CALL keyword_create(keyword, __LOCATION__, name="FREQUENCY", &
    3042              :                           description="Frequency of the electric field for Floquet calculations "// &
    3043              :                           "expressed in terms of the energy of a photon in eV.", &
    3044              :                           usage="FREQUENCY 1.5", unit_str="eV", n_var=1, type_of_var=real_t, &
    3045        10624 :                           default_r_val=cp_unit_to_cp2k(value=1.0_dp, unit_str="eV"))
    3046        10624 :       CALL section_add_keyword(section, keyword)
    3047        10624 :       CALL keyword_release(keyword)
    3048              : 
    3049              :       CALL keyword_create(keyword, __LOCATION__, name="POLARISATION", &
    3050              :                           description="Polarisation vector of the input light. The "// &
    3051              :                           "amplitude in each direction is the product of the AMPLITUDE "// &
    3052              :                           "and the POLARISATION vector component. Eg. for light polarized "// &
    3053              :                           "in the x direction, use 1 0 0. For left-circularly polarized "// &
    3054              :                           "light travelling in the +z direction use 1 1 0 and set "// &
    3055              :                           "PHASE_OFFSET 0 0.5 0 for a +π/2 offset", &
    3056              :                           usage="POLARISATION  0.0 0.0 1.0", &
    3057        10624 :                           default_r_vals=[0.0_dp, 0.0_dp, 1.0_dp])
    3058        10624 :       CALL section_add_keyword(section, keyword)
    3059        10624 :       CALL keyword_release(keyword)
    3060              : 
    3061              :       CALL keyword_create(keyword, __LOCATION__, name="PHASE_OFFSETS", &
    3062              :                           description="Phase offset of the electric field in the "// &
    3063              :                           "x, y, and z directions given in multiples of π. For "// &
    3064              :                           "linearly polarized light, use 0 0 0 and for left-circularly "// &
    3065              :                           "polarized light travelling in the +z direction use "// &
    3066              :                           "PHASE_OFFSET 0.0 0.5 0 ", &
    3067              :                           usage="PHASE_OFFSETS  0.5 0 0", &
    3068        10624 :                           default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp])
    3069        10624 :       CALL section_add_keyword(section, keyword)
    3070        10624 :       CALL keyword_release(keyword)
    3071              : 
    3072              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_FLOQUET_INDEX", &
    3073              :                           description="Largest absolute Floquet index up to which "// &
    3074              :                           "Floquet Hamiltonian is truncated. Use a larger value to "// &
    3075              :                           "ensure convergence at higher computational cost and a "// &
    3076              :                           "smaller value for faster computation. EPS_FLOQUET checks "// &
    3077              :                           "to ensure that the error due to truncation is small.", &
    3078              :                           usage="MAX_FLOQUET_INDEX 50", &
    3079        10624 :                           default_i_val=50)
    3080        10624 :       CALL section_add_keyword(section, keyword)
    3081        10624 :       CALL keyword_release(keyword)
    3082              : 
    3083              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FLOQUET", &
    3084              :                           description="Threshold on the error due to truncation of "// &
    3085              :                           "the Floquet Hamiltonian. Used to verify that MAX_FLOQUET_INDEX "// &
    3086              :                           "is large enough that truncation errors are small. "// &
    3087              :                           "If negative, the check is removed (not recommended).", &
    3088        10624 :                           usage="EPS_FLOQUET 1.e-10", default_r_val=1.0e-10_dp)
    3089        10624 :       CALL section_add_keyword(section, keyword)
    3090        10624 :       CALL keyword_release(keyword)
    3091              : 
    3092              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
    3093              :                           description="Half-width of the energy range, in eV, centred "// &
    3094              :                           "on the Fermi level, over which the Floquet spectral "// &
    3095              :                           "function is evaluated.", &
    3096              :                           usage="ENERGY_WINDOW 5.0", &
    3097              :                           default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"), &
    3098        10624 :                           unit_str="eV")
    3099        10624 :       CALL section_add_keyword(section, keyword)
    3100        10624 :       CALL keyword_release(keyword)
    3101              : 
    3102              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_STEP", &
    3103              :                           description="Resolution of the energy E used to compute the "// &
    3104              :                           "spectral function within the energy window.", &
    3105              :                           usage="ENERGY_STEP 0.01", &
    3106              :                           default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
    3107        10624 :                           unit_str="eV")
    3108        10624 :       CALL section_add_keyword(section, keyword)
    3109        10624 :       CALL keyword_release(keyword)
    3110              : 
    3111              :       CALL keyword_create(keyword, __LOCATION__, name="BROADENING", &
    3112              :                           description="Lorentzian broadening applied to the peaks of the "// &
    3113              :                           "Floquet spectral function.", &
    3114              :                           usage="BROADENING 0.02", &
    3115              :                           default_r_val=cp_unit_to_cp2k(value=0.02_dp, unit_str="eV"), &
    3116        10624 :                           unit_str="eV")
    3117        10624 :       CALL section_add_keyword(section, keyword)
    3118        10624 :       CALL keyword_release(keyword)
    3119              : 
    3120              :       CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
    3121              :                           description="Electronic temperature (in K) of the wide-band fermion "// &
    3122              :                           "bath used to weight the Floquet DOS by Fermi-Dirac occupations, adding "// &
    3123              :                           "an occupied spectral-weight column f(E)*A(E) to the DOS file. If "// &
    3124              :                           "negative (default), that column is not written.", &
    3125        10624 :                           usage="TEMPERATURE 300.0", default_r_val=-1.0_dp)
    3126        10624 :       CALL section_add_keyword(section, keyword)
    3127        10624 :       CALL keyword_release(keyword)
    3128              : 
    3129              :       CALL keyword_create(keyword, __LOCATION__, name="FLOQUET_DOS_FILE_NAME", &
    3130              :                           description="File name used for the Floquet spectral function.", &
    3131              :                           usage="FLOQUET_DOS_FILE_NAME FLOQUET_DOS", &
    3132        10624 :                           default_lc_val="FLOQUET_DOS")
    3133        10624 :       CALL section_add_keyword(section, keyword)
    3134        10624 :       CALL keyword_release(keyword)
    3135              : 
    3136              :       CALL keyword_create(keyword, __LOCATION__, name="QUASI_ENERGIES_FILE_NAME", &
    3137              :                           description="File name used for the Floquet quasi-energies.", &
    3138              :                           usage="QUASI_ENERGIES_FILE_NAME QUASI_ENERGIES", &
    3139        10624 :                           default_lc_val="QUASI_ENERGIES")
    3140        10624 :       CALL section_add_keyword(section, keyword)
    3141        10624 :       CALL keyword_release(keyword)
    3142              : 
    3143              :       CALL keyword_create(keyword, __LOCATION__, name="FLOQUET_BS_FILE_NAME", &
    3144              :                           description="File name used for the Floquet m=0 (central-sector) "// &
    3145              :                           "band structure.", &
    3146              :                           usage="FLOQUET_BS_FILE_NAME FLOQUET_BANDSTRUCTURE", &
    3147        10624 :                           default_lc_val="FLOQUET_BANDSTRUCTURE")
    3148        10624 :       CALL section_add_keyword(section, keyword)
    3149        10624 :       CALL keyword_release(keyword)
    3150              : 
    3151              :       CALL keyword_create(keyword, __LOCATION__, name="MEM_FILL_FRACTION", &
    3152              :                           description="Fraction of the computation memory that may be filled "// &
    3153              :                           "by Floquet Hamiltonian matrices. Reduce if process gets OOMP killed.", &
    3154        10624 :                           usage="MEM_FILL_FRACTION 0.5", default_r_val=0.8_dp)
    3155        10624 :       CALL section_add_keyword(section, keyword)
    3156        10624 :       CALL keyword_release(keyword)
    3157              : 
    3158        10624 :    END SUBROUTINE create_floquet_section
    3159              : 
    3160              : END MODULE input_cp2k_properties_dft
        

Generated by: LCOV version 2.0-1