LCOV - code coverage report
Current view: top level - src - input_cp2k_properties_dft.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:2fce0f8) Lines: 866 867 99.9 %
Date: 2024-12-21 06:28:57 Functions: 19 19 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 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             :                            Iannuzzi2005, &
      17             :                            Kondov2007, &
      18             :                            Luber2014, &
      19             :                            Putrino2000, &
      20             :                            Putrino2002, &
      21             :                            Sebastiani2001, &
      22             :                            Weber2009
      23             :    USE cp_output_handling, ONLY: add_last_numeric, &
      24             :                                  cp_print_key_section_create, &
      25             :                                  debug_print_level, &
      26             :                                  high_print_level, &
      27             :                                  low_print_level, &
      28             :                                  medium_print_level, &
      29             :                                  silent_print_level
      30             :    USE cp_units, ONLY: cp_unit_to_cp2k
      31             :    USE input_constants, ONLY: &
      32             :       current_gauge_atom, current_gauge_r, current_gauge_r_and_step_func, &
      33             :       current_orb_center_atom, current_orb_center_box, current_orb_center_common, &
      34             :       current_orb_center_wannier, do_et_ddapc, do_full_density, do_no_et, do_spin_density, &
      35             :       gto_cartesian, gto_spherical, int_ldos_none, int_ldos_x, int_ldos_y, int_ldos_z, oe_gllb, &
      36             :       oe_lb, oe_none, oe_saop, oe_shift, ot_precond_full_all, ot_precond_full_kinetic, &
      37             :       ot_precond_full_single, ot_precond_full_single_inverse, ot_precond_none, &
      38             :       ot_precond_s_inverse, scan_x, scan_xy, scan_xyz, scan_xz, scan_y, scan_yz, scan_z, &
      39             :       tddfpt_dipole_berry, tddfpt_dipole_length, tddfpt_dipole_velocity, tddfpt_kernel_full, &
      40             :       tddfpt_kernel_none, tddfpt_kernel_stda, use_mom_ref_coac, use_mom_ref_com, &
      41             :       use_mom_ref_user, use_mom_ref_zero
      42             :    USE input_cp2k_atprop, ONLY: create_atprop_section
      43             :    USE input_cp2k_dft, ONLY: create_interp_section, &
      44             :                              create_mgrid_section
      45             :    USE input_cp2k_qs, ONLY: create_ddapc_restraint_section, &
      46             :                             create_lrigpw_section
      47             :    USE input_cp2k_kpoints, ONLY: create_kpoint_set_section
      48             :    USE input_cp2k_loc, ONLY: create_localize_section
      49             :    USE input_cp2k_resp, ONLY: create_resp_section
      50             :    USE input_cp2k_xc, ONLY: create_xc_section
      51             :    USE input_keyword_types, ONLY: keyword_create, &
      52             :                                   keyword_release, &
      53             :                                   keyword_type
      54             :    USE input_section_types, ONLY: section_add_keyword, &
      55             :                                   section_add_subsection, &
      56             :                                   section_create, &
      57             :                                   section_release, &
      58             :                                   section_type
      59             :    USE input_val_types, ONLY: char_t, &
      60             :                               integer_t, &
      61             :                               lchar_t, &
      62             :                               logical_t, &
      63             :                               real_t
      64             :    USE kinds, ONLY: dp
      65             :    USE string_utilities, ONLY: s2a
      66             : #include "./base/base_uses.f90"
      67             : 
      68             :    IMPLICIT NONE
      69             :    PRIVATE
      70             : 
      71             :    LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
      72             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_properties_dft'
      73             : 
      74             :    PUBLIC :: create_properties_section
      75             : 
      76             : CONTAINS
      77             : 
      78             : ! **************************************************************************************************
      79             : !> \brief Create the PROPERTIES section
      80             : !> \param section the section to create
      81             : !> \author teo
      82             : ! **************************************************************************************************
      83        9174 :    SUBROUTINE create_properties_section(section)
      84             :       TYPE(section_type), POINTER                        :: section
      85             : 
      86             :       TYPE(keyword_type), POINTER                        :: keyword
      87             :       TYPE(section_type), POINTER                        :: subsection
      88             : 
      89        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
      90             :       CALL section_create(section, __LOCATION__, name="PROPERTIES", &
      91             :                           description="This section is used to set up the PROPERTIES calculation.", &
      92        9174 :                           n_keywords=0, n_subsections=6, repeats=.FALSE.)
      93             : 
      94        9174 :       NULLIFY (subsection, keyword)
      95             : 
      96        9174 :       CALL create_linres_section(subsection, create_subsections=.TRUE.)
      97        9174 :       CALL section_add_subsection(section, subsection)
      98        9174 :       CALL section_release(subsection)
      99             : 
     100        9174 :       CALL create_et_coupling_section(subsection)
     101        9174 :       CALL section_add_subsection(section, subsection)
     102        9174 :       CALL section_release(subsection)
     103             : 
     104        9174 :       CALL create_resp_section(subsection)
     105        9174 :       CALL section_add_subsection(section, subsection)
     106        9174 :       CALL section_release(subsection)
     107             : 
     108        9174 :       CALL create_atprop_section(subsection)
     109        9174 :       CALL section_add_subsection(section, subsection)
     110        9174 :       CALL section_release(subsection)
     111             : 
     112             :       CALL cp_print_key_section_create(subsection, __LOCATION__, name="FIT_CHARGE", &
     113             :                                        description="This section is used to print the density derived atomic point charges. "// &
     114             :                                        "The fit of the charges is controlled through the DENSITY_FITTING section", &
     115        9174 :                                        print_level=high_print_level, filename="__STD_OUT__")
     116             :       CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_DENSITY", &
     117             :                           description="Specifies the type of density used for the fitting", &
     118             :                           usage="TYPE_OF_DENSITY (FULL|SPIN)", &
     119             :                           enum_c_vals=s2a("FULL", "SPIN"), &
     120             :                           enum_i_vals=(/do_full_density, do_spin_density/), &
     121             :                           enum_desc=s2a("Full density", "Spin density"), &
     122        9174 :                           default_i_val=do_full_density)
     123        9174 :       CALL section_add_keyword(subsection, keyword)
     124        9174 :       CALL keyword_release(keyword)
     125        9174 :       CALL section_add_subsection(section, subsection)
     126        9174 :       CALL section_release(subsection)
     127             : 
     128        9174 :       CALL create_tddfpt2_section(subsection)
     129        9174 :       CALL section_add_subsection(section, subsection)
     130        9174 :       CALL section_release(subsection)
     131             : 
     132        9174 :       CALL create_bandstructure_section(subsection)
     133        9174 :       CALL section_add_subsection(section, subsection)
     134        9174 :       CALL section_release(subsection)
     135             : 
     136        9174 :       CALL create_tipscan_section(subsection)
     137        9174 :       CALL section_add_subsection(section, subsection)
     138        9174 :       CALL section_release(subsection)
     139             : 
     140        9174 :    END SUBROUTINE create_properties_section
     141             : 
     142             : ! **************************************************************************************************
     143             : !> \brief creates the input structure used to activate
     144             : !>      a linear response calculation
     145             : !>      Available properties : none
     146             : !> \param section the section to create
     147             : !> \param create_subsections indicates whether or not subsections should be created
     148             : !> \param default_set_tdlr default parameters to be used if called from TDDFPT
     149             : !> \author MI
     150             : ! **************************************************************************************************
     151       18348 :    SUBROUTINE create_linres_section(section, create_subsections, default_set_tdlr)
     152             :       TYPE(section_type), POINTER                        :: section
     153             :       LOGICAL, INTENT(in)                                :: create_subsections
     154             :       LOGICAL, INTENT(IN), OPTIONAL                      :: default_set_tdlr
     155             : 
     156             :       INTEGER                                            :: def_max_iter, def_precond
     157             :       REAL(KIND=DP)                                      :: def_egap, def_eps, def_eps_filter
     158             :       TYPE(keyword_type), POINTER                        :: keyword
     159             :       TYPE(section_type), POINTER                        :: print_key, subsection
     160             : 
     161       18348 :       NULLIFY (keyword, print_key)
     162             : 
     163       18348 :       IF (PRESENT(default_set_tdlr)) THEN
     164        9174 :          def_egap = 0.02_dp
     165        9174 :          def_eps = 1.0e-10_dp
     166        9174 :          def_eps_filter = 1.0e-15_dp
     167        9174 :          def_max_iter = 100
     168        9174 :          def_precond = ot_precond_full_single_inverse
     169             :       ELSE
     170        9174 :          def_egap = 0.2_dp
     171        9174 :          def_eps = 1.e-6_dp
     172        9174 :          def_eps_filter = 0.0_dp
     173        9174 :          def_max_iter = 50
     174        9174 :          def_precond = ot_precond_none
     175             :       END IF
     176             : 
     177       18348 :       CPASSERT(.NOT. ASSOCIATED(section))
     178             :       CALL section_create(section, __LOCATION__, name="linres", &
     179             :                           description="The linear response is used to calculate one of the "// &
     180             :                           "following properties: nmr, epr, raman, ... ", &
     181             :                           n_keywords=5, n_subsections=2, repeats=.FALSE., &
     182       36696 :                           citations=(/Putrino2000/))
     183             : 
     184             :       CALL keyword_create(keyword, __LOCATION__, name="EPS", &
     185             :                           description="target accuracy for the convergence of the conjugate gradient.", &
     186       18348 :                           usage="EPS 1.e-6", default_r_val=def_eps)
     187       18348 :       CALL section_add_keyword(section, keyword)
     188       18348 :       CALL keyword_release(keyword)
     189             : 
     190             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
     191             :                           description="Filter threshold for response density matrix.", &
     192       18348 :                           usage="EPS 1.e-8", default_r_val=def_eps_filter)
     193       18348 :       CALL section_add_keyword(section, keyword)
     194       18348 :       CALL keyword_release(keyword)
     195             : 
     196             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
     197             :                           description="Maximum number of conjugate gradient iteration to be performed for one optimization.", &
     198       18348 :                           usage="MAX_ITER 200", default_i_val=def_max_iter)
     199       18348 :       CALL section_add_keyword(section, keyword)
     200       18348 :       CALL keyword_release(keyword)
     201             : 
     202             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_EVERY", &
     203             :                           description="Restart the conjugate gradient after the specified number of iterations.", &
     204       18348 :                           usage="RESTART_EVERY 200", default_i_val=50)
     205       18348 :       CALL section_add_keyword(section, keyword)
     206       18348 :       CALL keyword_release(keyword)
     207             : 
     208             :       CALL keyword_create( &
     209             :          keyword, __LOCATION__, name="PRECONDITIONER", &
     210             :          description="Type of preconditioner to be used with all minimization schemes. "// &
     211             :          "They differ in effectiveness, cost of construction, cost of application. "// &
     212             :          "Properly preconditioned minimization can be orders of magnitude faster than doing nothing.", &
     213             :          usage="PRECONDITIONER FULL_ALL", &
     214             :          default_i_val=def_precond, &
     215             :          enum_c_vals=s2a("FULL_ALL", "FULL_SINGLE_INVERSE", "FULL_SINGLE", "FULL_KINETIC", "FULL_S_INVERSE", &
     216             :                          "NONE"), &
     217             :          enum_desc=s2a("Most effective state selective preconditioner based on diagonalization, "// &
     218             :                        "requires the ENERGY_GAP parameter to be an underestimate of the HOMO-LUMO gap. "// &
     219             :                        "This preconditioner is recommended for almost all systems, except very large systems where "// &
     220             :                        "make_preconditioner would dominate the total computational cost.", &
     221             :                        "Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
     222             :                        "but cheaper to construct, "// &
     223             :                        "might be somewhat less robust. Recommended for large systems.", &
     224             :                        "Based on H-eS diagonalisation, not as good as FULL_ALL, but somewhat cheaper to apply. ", &
     225             :                        "Cholesky inversion of S and T, fast construction, robust, and relatively good, "// &
     226             :                        "use for very large systems.", &
     227             :                        "Cholesky inversion of S, not as good as FULL_KINETIC, yet equally expensive.", &
     228             :                        "skip preconditioning"), &
     229             :          enum_i_vals=(/ot_precond_full_all, ot_precond_full_single_inverse, ot_precond_full_single, &
     230       18348 :                        ot_precond_full_kinetic, ot_precond_s_inverse, ot_precond_none/))
     231       18348 :       CALL section_add_keyword(section, keyword)
     232       18348 :       CALL keyword_release(keyword)
     233             : 
     234             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_GAP", &
     235             :                           description="Energy gap estimate [a.u.] for preconditioning", &
     236             :                           usage="ENERGY_GAP 0.1", &
     237       18348 :                           default_r_val=def_egap)
     238       18348 :       CALL section_add_keyword(section, keyword)
     239       18348 :       CALL keyword_release(keyword)
     240             : 
     241             :       CALL keyword_create(keyword, __LOCATION__, name="EVERY_N_STEP", &
     242             :                           description="Perform a linear response calculation every N-th step for MD run", &
     243       18348 :                           usage="EVERY_N_STEP 50", default_i_val=1)
     244       18348 :       CALL section_add_keyword(section, keyword)
     245       18348 :       CALL keyword_release(keyword)
     246             : 
     247             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
     248             :                           description="Restart the response calculation if the restart file exists", &
     249             :                           usage="RESTART", &
     250       18348 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     251       18348 :       CALL section_add_keyword(section, keyword)
     252       18348 :       CALL keyword_release(keyword)
     253             : 
     254             :       CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
     255             :                           variants=(/"RESTART_FILE_NAME"/), &
     256             :                           description="Root of the file names where to read the response functions from "// &
     257             :                           "which to restart the calculation of the linear response", &
     258             :                           usage="WFN_RESTART_FILE_NAME <FILENAME>", &
     259       36696 :                           type_of_var=lchar_t)
     260       18348 :       CALL section_add_keyword(section, keyword)
     261       18348 :       CALL keyword_release(keyword)
     262             : 
     263       18348 :       IF (create_subsections) THEN
     264        9174 :          NULLIFY (subsection)
     265             : 
     266        9174 :          CALL create_localize_section(subsection)
     267        9174 :          CALL section_add_subsection(section, subsection)
     268        9174 :          CALL section_release(subsection)
     269             : 
     270        9174 :          CALL create_current_section(subsection)
     271        9174 :          CALL section_add_subsection(section, subsection)
     272        9174 :          CALL section_release(subsection)
     273             : 
     274        9174 :          CALL create_nmr_section(subsection)
     275        9174 :          CALL section_add_subsection(section, subsection)
     276        9174 :          CALL section_release(subsection)
     277             : 
     278        9174 :          CALL create_spin_spin_section(subsection)
     279        9174 :          CALL section_add_subsection(section, subsection)
     280        9174 :          CALL section_release(subsection)
     281             : 
     282        9174 :          CALL create_epr_section(subsection)
     283        9174 :          CALL section_add_subsection(section, subsection)
     284        9174 :          CALL section_release(subsection)
     285             : 
     286        9174 :          CALL create_polarizability_section(subsection)
     287        9174 :          CALL section_add_subsection(section, subsection)
     288        9174 :          CALL section_release(subsection)
     289             : 
     290        9174 :          CALL create_dcdr_section(subsection)
     291        9174 :          CALL section_add_subsection(section, subsection)
     292        9174 :          CALL section_release(subsection)
     293             : 
     294        9174 :          CALL create_vcd_section(subsection)
     295        9174 :          CALL section_add_subsection(section, subsection)
     296        9174 :          CALL section_release(subsection)
     297             : 
     298             :          CALL section_create(subsection, __LOCATION__, name="PRINT", &
     299             :                              description="printing of information during the linear response calculation", &
     300        9174 :                              repeats=.FALSE.)
     301             : 
     302             :          CALL cp_print_key_section_create( &
     303             :             print_key, __LOCATION__, "program_run_info", &
     304             :             description="Controls the printing of basic iteration information during the LINRES calculation", &
     305        9174 :             print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     306        9174 :          CALL section_add_subsection(subsection, print_key)
     307        9174 :          CALL section_release(print_key)
     308             : 
     309             :          CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
     310             :                                           description="Controls the dumping of restart file of the response wavefunction. "// &
     311             :                                           "For each set of response functions, i.e. for each perturbation, "// &
     312             :                                           "one different restart file is dumped. These restart files should be "// &
     313             :                                           "employed only to restart the same type of LINRES calculation, "// &
     314             :                                           "i.e. with the same perturbation.", &
     315             :                                           print_level=low_print_level, common_iter_levels=3, each_iter_names=s2a("ITER"), &
     316        9174 :                                           add_last=add_last_numeric, each_iter_values=(/3/), filename="")
     317        9174 :          CALL section_add_subsection(subsection, print_key)
     318        9174 :          CALL section_release(print_key)
     319             : 
     320        9174 :          CALL section_add_subsection(section, subsection)
     321        9174 :          CALL section_release(subsection)
     322             : 
     323             :       END IF
     324             : 
     325       18348 :    END SUBROUTINE create_linres_section
     326             : 
     327             : ! **************************************************************************************************
     328             : !> \brief creates the input structure used to activate
     329             : !>      calculation of position perturbation  DFPT
     330             : !> \param section ...
     331             : !> \author Sandra Luber, Edward Ditler
     332             : ! **************************************************************************************************
     333        9174 :    SUBROUTINE create_dcdr_section(section)
     334             : 
     335             :       TYPE(section_type), POINTER                        :: section
     336             : 
     337             :       LOGICAL                                            :: failure
     338             :       TYPE(keyword_type), POINTER                        :: keyword
     339             :       TYPE(section_type), POINTER                        :: print_key, subsection
     340             : 
     341        9174 :       failure = .FALSE.
     342        9174 :       NULLIFY (keyword, print_key, subsection)
     343             : 
     344        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
     345             : 
     346             :       IF (.NOT. failure) THEN
     347             :          CALL section_create(section, __LOCATION__, name="DCDR", &
     348             :                              description="Compute analytical gradients the dipole moments.", &
     349        9174 :                              n_keywords=50, n_subsections=1, repeats=.FALSE.)
     350             : 
     351             :          CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     352             :                              description="controls the activation of the APT calculation", &
     353             :                              usage="&DCDR T", &
     354             :                              default_l_val=.FALSE., &
     355        9174 :                              lone_keyword_l_val=.TRUE.)
     356        9174 :          CALL section_add_keyword(section, keyword)
     357        9174 :          CALL keyword_release(keyword)
     358             : 
     359             :          CALL keyword_create(keyword, __LOCATION__, name="LIST_OF_ATOMS", &
     360             :                              description="Specifies a list of atoms.", &
     361             :                              usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
     362        9174 :                              n_var=-1, type_of_var=integer_t)
     363        9174 :          CALL section_add_keyword(section, keyword)
     364        9174 :          CALL keyword_release(keyword)
     365             : 
     366             :          CALL keyword_create(keyword, __LOCATION__, name="DISTRIBUTED_ORIGIN", &
     367             :                              variants=(/"DO_GAUGE"/), &
     368             :                              description="Use the distributed origin (DO) gauge?", &
     369             :                              usage="DISTRIBUTED_ORIGIN T", &
     370       18348 :                              default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     371        9174 :          CALL section_add_keyword(section, keyword)
     372        9174 :          CALL keyword_release(keyword)
     373             : 
     374             :          CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
     375             :                              description="The orbital center.", &
     376             :                              usage="ORBITAL_CENTER WANNIER", &
     377             :                              default_i_val=current_orb_center_wannier, &
     378             :                              enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
     379             :                              enum_desc=s2a("Use the Wannier centers.", &
     380             :                                            "Use a common center (works only for an isolate molecule).", &
     381             :                                            "Use the atoms as center.", &
     382             :                                            "Boxing."), &
     383             :                              enum_i_vals=(/current_orb_center_wannier, current_orb_center_common, &
     384        9174 :                                            current_orb_center_atom, current_orb_center_box/))
     385        9174 :          CALL section_add_keyword(section, keyword)
     386        9174 :          CALL keyword_release(keyword)
     387             : 
     388             :          CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
     389             :                              description="Gauge origin of the velocity gauge factor.", &
     390             :                              enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
     391             :                              enum_desc=s2a("Use Center of Mass", &
     392             :                                            "Use Center of Atomic Charges", &
     393             :                                            "Use User-defined Point", &
     394             :                                            "Use Origin of Coordinate System"), &
     395             :                              enum_i_vals=(/use_mom_ref_com, &
     396             :                                            use_mom_ref_coac, &
     397             :                                            use_mom_ref_user, &
     398             :                                            use_mom_ref_zero/), &
     399        9174 :                              default_i_val=use_mom_ref_zero)
     400        9174 :          CALL section_add_keyword(section, keyword)
     401        9174 :          CALL keyword_release(keyword)
     402             : 
     403             :          CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
     404             :                              description="User-defined reference point of the velocity gauge factor.", &
     405             :                              usage="REFERENCE_POINT x y z", &
     406        9174 :                              repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
     407        9174 :          CALL section_add_keyword(section, keyword)
     408        9174 :          CALL keyword_release(keyword)
     409             : 
     410             :          CALL keyword_create(keyword, __LOCATION__, name="Z_MATRIX_METHOD", &
     411             :                              description="Use Z_matrix method to solve the response equation", &
     412             :                              usage="Z_MATRIX_METHOD T", &
     413        9174 :                              default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     414        9174 :          CALL section_add_keyword(section, keyword)
     415        9174 :          CALL keyword_release(keyword)
     416             : 
     417        9174 :          NULLIFY (subsection)
     418             :          CALL section_create(subsection, __LOCATION__, name="PRINT", &
     419             :                              description="print results of the magnetic dipole moment calculation", &
     420        9174 :                              repeats=.FALSE.)
     421             : 
     422             :          CALL cp_print_key_section_create(print_key, __LOCATION__, "APT", &
     423             :                                           description="Controls the printing of the electric dipole gradient", &
     424        9174 :                                           print_level=low_print_level, add_last=add_last_numeric, filename="")
     425        9174 :          CALL section_add_subsection(subsection, print_key)
     426        9174 :          CALL section_release(print_key)
     427             : 
     428        9174 :          CALL section_add_subsection(section, subsection)
     429        9174 :          CALL section_release(subsection)
     430             : 
     431        9174 :          NULLIFY (subsection)
     432        9174 :          CALL create_interp_section(subsection)
     433        9174 :          CALL section_add_subsection(section, subsection)
     434        9174 :          CALL section_release(subsection)
     435             : 
     436             :       END IF
     437             : 
     438        9174 :    END SUBROUTINE create_dcdr_section
     439             : 
     440             : ! **************************************************************************************************
     441             : !> \brief creates the input structure used to activate
     442             : !>      calculation of VCD spectra using DFPT
     443             : !> \param section ...
     444             : !> \author Sandra Luber, Tomas Zimmermann, Edward Ditler
     445             : ! **************************************************************************************************
     446        9174 :    SUBROUTINE create_vcd_section(section)
     447             : 
     448             :       TYPE(section_type), POINTER                        :: section
     449             : 
     450             :       TYPE(keyword_type), POINTER                        :: keyword
     451             :       TYPE(section_type), POINTER                        :: print_key, subsection
     452             : 
     453        9174 :       NULLIFY (keyword, print_key, subsection)
     454             : 
     455        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
     456             : 
     457             :       CALL section_create(section, __LOCATION__, name="VCD", &
     458             :                           description="Carry out a VCD calculation.", &
     459        9174 :                           n_keywords=50, n_subsections=1, repeats=.FALSE.)
     460             : 
     461             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     462             :                           description="controls the activation of the APT/AAT calculation", &
     463             :                           usage="&VCD T", &
     464             :                           default_l_val=.FALSE., &
     465        9174 :                           lone_keyword_l_val=.TRUE.)
     466        9174 :       CALL section_add_keyword(section, keyword)
     467        9174 :       CALL keyword_release(keyword)
     468             : 
     469             :       CALL keyword_create(keyword, __LOCATION__, name="LIST_OF_ATOMS", &
     470             :                           description="Specifies a list of atoms.", &
     471             :                           usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
     472        9174 :                           n_var=-1, type_of_var=integer_t)
     473        9174 :       CALL section_add_keyword(section, keyword)
     474        9174 :       CALL keyword_release(keyword)
     475             : 
     476             :       CALL keyword_create(keyword, __LOCATION__, name="DISTRIBUTED_ORIGIN", &
     477             :                           variants=(/"DO_GAUGE"/), &
     478             :                           description="Use the distributed origin (DO) gauge?", &
     479             :                           usage="DISTRIBUTED_ORIGIN T", &
     480       18348 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     481        9174 :       CALL section_add_keyword(section, keyword)
     482        9174 :       CALL keyword_release(keyword)
     483             : 
     484             :       CALL keyword_create(keyword, __LOCATION__, name="ORIGIN_DEPENDENT_MFP", &
     485             :                           description="Use the origin dependent MFP operator.", &
     486             :                           usage="ORIGIN_DEPENDENT_MFP T", &
     487        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     488        9174 :       CALL section_add_keyword(section, keyword)
     489        9174 :       CALL keyword_release(keyword)
     490             : 
     491             :       CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
     492             :                           description="The orbital center.", &
     493             :                           usage="ORBITAL_CENTER WANNIER", &
     494             :                           default_i_val=current_orb_center_wannier, &
     495             :                           enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
     496             :                           enum_desc=s2a("Use the Wannier centers.", &
     497             :                                         "Use a common center (works only for an isolate molecule).", &
     498             :                                         "Use the atoms as center.", &
     499             :                                         "Boxing."), &
     500             :                           enum_i_vals=(/current_orb_center_wannier, current_orb_center_common, &
     501        9174 :                                         current_orb_center_atom, current_orb_center_box/))
     502        9174 :       CALL section_add_keyword(section, keyword)
     503        9174 :       CALL keyword_release(keyword)
     504             : 
     505             :       ! The origin of the magnetic dipole operator (r - MAGNETIC_ORIGIN) x momentum
     506             :       CALL keyword_create(keyword, __LOCATION__, name="MAGNETIC_ORIGIN", &
     507             :                           description="Gauge origin of the magnetic dipole operator.", &
     508             :                           enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
     509             :                           enum_desc=s2a("Use Center of Mass", &
     510             :                                         "Use Center of Atomic Charges", &
     511             :                                         "Use User-defined Point", &
     512             :                                         "Use Origin of Coordinate System"), &
     513             :                           enum_i_vals=(/use_mom_ref_com, &
     514             :                                         use_mom_ref_coac, &
     515             :                                         use_mom_ref_user, &
     516             :                                         use_mom_ref_zero/), &
     517        9174 :                           default_i_val=use_mom_ref_zero)
     518        9174 :       CALL section_add_keyword(section, keyword)
     519        9174 :       CALL keyword_release(keyword)
     520             : 
     521             :       CALL keyword_create(keyword, __LOCATION__, name="MAGNETIC_ORIGIN_REFERENCE", &
     522             :                           description="User-defined reference point of the magnetic dipole operator.", &
     523             :                           usage="REFERENCE_POINT x y z", &
     524        9174 :                           repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
     525        9174 :       CALL section_add_keyword(section, keyword)
     526        9174 :       CALL keyword_release(keyword)
     527             : 
     528             :       ! The origin of the coordinate system
     529             :       CALL keyword_create(keyword, __LOCATION__, name="SPATIAL_ORIGIN", &
     530             :                           description="Gauge origin of the velocity gauge factor/spatial origin.", &
     531             :                           enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
     532             :                           enum_desc=s2a("Use Center of Mass", &
     533             :                                         "Use Center of Atomic Charges", &
     534             :                                         "Use User-defined Point", &
     535             :                                         "Use Origin of Coordinate System"), &
     536             :                           enum_i_vals=(/use_mom_ref_com, &
     537             :                                         use_mom_ref_coac, &
     538             :                                         use_mom_ref_user, &
     539             :                                         use_mom_ref_zero/), &
     540        9174 :                           default_i_val=use_mom_ref_zero)
     541        9174 :       CALL section_add_keyword(section, keyword)
     542        9174 :       CALL keyword_release(keyword)
     543             : 
     544             :       CALL keyword_create(keyword, __LOCATION__, name="SPATIAL_ORIGIN_REFERENCE", &
     545             :                           description="User-defined reference point of the velocity gauge factor/spatial origin.", &
     546             :                           usage="REFERENCE_POINT x y z", &
     547        9174 :                           repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
     548        9174 :       CALL section_add_keyword(section, keyword)
     549        9174 :       CALL keyword_release(keyword)
     550             : 
     551        9174 :       NULLIFY (subsection)
     552             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
     553             :                           description="print results of the magnetic dipole moment calculation", &
     554        9174 :                           repeats=.FALSE.)
     555             : 
     556             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "VCD", &
     557             :                                        description="Controls the printing of the APTs and AATs", &
     558        9174 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="")
     559        9174 :       CALL section_add_subsection(subsection, print_key)
     560        9174 :       CALL section_release(print_key)
     561             : 
     562        9174 :       CALL section_add_subsection(section, subsection)
     563        9174 :       CALL section_release(subsection)
     564             : 
     565        9174 :       NULLIFY (subsection)
     566        9174 :       CALL create_interp_section(subsection)
     567        9174 :       CALL section_add_subsection(section, subsection)
     568        9174 :       CALL section_release(subsection)
     569             : 
     570        9174 :    END SUBROUTINE create_vcd_section
     571             : 
     572             : ! **************************************************************************************************
     573             : !> \brief creates the input structure used to activate
     574             : !>      calculation of induced current  DFPT
     575             : !>      Available properties : none
     576             : !> \param section the section to create
     577             : !> \author  MI/VW
     578             : ! **************************************************************************************************
     579        9174 :    SUBROUTINE create_current_section(section)
     580             :       TYPE(section_type), POINTER                        :: section
     581             : 
     582             :       TYPE(keyword_type), POINTER                        :: keyword
     583             :       TYPE(section_type), POINTER                        :: print_key, subsection
     584             : 
     585        9174 :       NULLIFY (keyword, print_key, subsection)
     586             : 
     587        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
     588             :       CALL section_create(section, __LOCATION__, name="current", &
     589             :                           description="The induced current density is calculated by DFPT.", &
     590             :                           n_keywords=4, n_subsections=1, repeats=.FALSE., &
     591       27522 :                           citations=(/Sebastiani2001, Weber2009/))
     592             : 
     593             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     594             :                           description="controls the activation of the induced current calculation", &
     595             :                           usage="&CURRENT T", &
     596             :                           default_l_val=.FALSE., &
     597        9174 :                           lone_keyword_l_val=.TRUE.)
     598        9174 :       CALL section_add_keyword(section, keyword)
     599        9174 :       CALL keyword_release(keyword)
     600             : 
     601             :       CALL keyword_create(keyword, __LOCATION__, name="GAUGE", &
     602             :                           description="The gauge used to compute the induced current within GAPW.", &
     603             :                           usage="GAUGE R", &
     604             :                           default_i_val=current_gauge_r_and_step_func, &
     605             :                           enum_c_vals=s2a("R", "R_AND_STEP_FUNCTION", "ATOM"), &
     606             :                           enum_desc=s2a("Position gauge (doesnt work well).", &
     607             :                                         "Position and step function for the soft and the local parts, respectively.", &
     608             :                                         "Atoms."), &
     609        9174 :                           enum_i_vals=(/current_gauge_r, current_gauge_r_and_step_func, current_gauge_atom/))
     610        9174 :       CALL section_add_keyword(section, keyword)
     611        9174 :       CALL keyword_release(keyword)
     612             : 
     613             :       CALL keyword_create(keyword, __LOCATION__, name="GAUGE_ATOM_RADIUS", &
     614             :                           description="Build the gauge=atom using only the atoms within this radius.", &
     615             :                           usage="GAUGE_ATOM_RADIUS 10.0", &
     616             :                           type_of_var=real_t, &
     617             :                           default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
     618        9174 :                           unit_str="angstrom")
     619        9174 :       CALL section_add_keyword(section, keyword)
     620        9174 :       CALL keyword_release(keyword)
     621             : 
     622             :       CALL keyword_create(keyword, __LOCATION__, name="USE_OLD_GAUGE_ATOM", &
     623             :                           description="Use the old way to compute the gauge.", &
     624             :                           usage="USE_OLD_GAUGE_ATOM T", &
     625        9174 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     626        9174 :       CALL section_add_keyword(section, keyword)
     627        9174 :       CALL keyword_release(keyword)
     628             : 
     629             :       CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
     630             :                           description="The orbital center.", &
     631             :                           usage="ORBITAL_CENTER WANNIER", &
     632             :                           default_i_val=current_orb_center_wannier, &
     633             :                           enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
     634             :                           enum_desc=s2a("Use the Wannier centers.", &
     635             :                                         "Use a common center (works only for an isolate molecule).", &
     636             :                                         "Use the atoms as center.", &
     637             :                                         "Boxing."), &
     638             :                           enum_i_vals=(/current_orb_center_wannier, current_orb_center_common, &
     639        9174 :                                         current_orb_center_atom, current_orb_center_box/))
     640        9174 :       CALL section_add_keyword(section, keyword)
     641        9174 :       CALL keyword_release(keyword)
     642             : 
     643             :       CALL keyword_create(keyword, __LOCATION__, name="COMMON_CENTER", &
     644             :                           description="The common center ", usage="COMMON_CENTER 0.0 1.0 0.0", &
     645             :                           n_var=3, default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/), type_of_var=real_t, &
     646        9174 :                           unit_str="angstrom")
     647        9174 :       CALL section_add_keyword(section, keyword)
     648        9174 :       CALL keyword_release(keyword)
     649             : 
     650             :       CALL keyword_create(keyword, __LOCATION__, name="NBOX", &
     651             :                           description="How many boxes along each directions ", usage="NBOX 6 6 5", &
     652        9174 :                           n_var=3, default_i_vals=(/4, 4, 4/), type_of_var=integer_t)
     653        9174 :       CALL section_add_keyword(section, keyword)
     654        9174 :       CALL keyword_release(keyword)
     655             : 
     656             :       CALL keyword_create(keyword, __LOCATION__, name="CHI_PBC", &
     657             :                           description="Calculate the succeptibility correction to the shift with PBC", &
     658             :                           usage="CHI_PBC T", &
     659        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     660        9174 :       CALL section_add_keyword(section, keyword)
     661        9174 :       CALL keyword_release(keyword)
     662             : 
     663             :       CALL keyword_create(keyword, __LOCATION__, name="FORCE_NO_FULL", &
     664             :                           description="Avoid the calculation of the state dependent perturbation term, "// &
     665             :                           "even if the orbital centers are set at Wannier centers or at Atom centers", &
     666             :                           usage="FORCE_NO_FULL T", &
     667        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     668        9174 :       CALL section_add_keyword(section, keyword)
     669        9174 :       CALL keyword_release(keyword)
     670             : 
     671             :       CALL keyword_create(keyword, __LOCATION__, name="SELECTED_STATES_ON_ATOM_LIST", &
     672             :                           description="Indexes of the atoms for selecting"// &
     673             :                           " the states to be used for the response calculations.", &
     674             :                           usage="SELECTED_STATES_ON_ATOM_LIST 1 2 10", &
     675        9174 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
     676        9174 :       CALL section_add_keyword(section, keyword)
     677        9174 :       CALL keyword_release(keyword)
     678             : 
     679             :       CALL keyword_create(keyword, __LOCATION__, name="SELECTED_STATES_ATOM_RADIUS", &
     680             :                           description="Select all the states included in the given radius around each atoms "// &
     681             :                           "in SELECTED_STATES_ON_ATOM_LIST.", &
     682             :                           usage="SELECTED_STATES_ATOM_RADIUS 2.0", &
     683             :                           type_of_var=real_t, &
     684             :                           default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
     685        9174 :                           unit_str="angstrom")
     686        9174 :       CALL section_add_keyword(section, keyword)
     687        9174 :       CALL keyword_release(keyword)
     688             : 
     689             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_CURRENT", &
     690             :                           description="Restart the induced current density calculation"// &
     691             :                           " from a previous run (not working yet).", &
     692             :                           usage="RESTART_CURRENT", default_l_val=.FALSE., &
     693        9174 :                           lone_keyword_l_val=.TRUE.)
     694        9174 :       CALL section_add_keyword(section, keyword)
     695        9174 :       CALL keyword_release(keyword)
     696             : 
     697        9174 :       NULLIFY (subsection)
     698             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
     699             :                           description="print results of induced current density calculation", &
     700        9174 :                           repeats=.FALSE.)
     701             : 
     702             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT_CUBES", &
     703             :                                        description="Controls the printing of the induced current density (not working yet).", &
     704        9174 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
     705             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     706             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     707             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     708             :                           " 1 number valid for all components (not working yet).", &
     709        9174 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     710        9174 :       CALL section_add_keyword(print_key, keyword)
     711        9174 :       CALL keyword_release(keyword)
     712             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     713             :                           description="append the cube files when they already exist", &
     714        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     715        9174 :       CALL section_add_keyword(print_key, keyword)
     716        9174 :       CALL keyword_release(keyword)
     717             : 
     718        9174 :       CALL section_add_subsection(subsection, print_key)
     719        9174 :       CALL section_release(print_key)
     720             : 
     721             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
     722             :                                        description="Controls the printing of the response functions (not working yet).", &
     723        9174 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
     724             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     725             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     726             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     727             :                           " 1 number valid for all components (not working yet).", &
     728        9174 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     729        9174 :       CALL section_add_keyword(print_key, keyword)
     730        9174 :       CALL keyword_release(keyword)
     731             : 
     732             :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
     733             :                           variants=(/"CUBES_LU"/), &
     734             :                           description="The lower and upper index of the states to be printed as cube (not working yet).", &
     735             :                           usage="CUBES_LU_BOUNDS integer integer", &
     736       18348 :                           n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
     737        9174 :       CALL section_add_keyword(print_key, keyword)
     738        9174 :       CALL keyword_release(keyword)
     739             : 
     740             :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
     741             :                           description="Indexes of the states to be printed as cube files "// &
     742             :                           "This keyword can be repeated several times "// &
     743             :                           "(useful if you have to specify many indexes) (not working yet).", &
     744             :                           usage="CUBES_LIST 1 2", &
     745        9174 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
     746        9174 :       CALL section_add_keyword(print_key, keyword)
     747        9174 :       CALL keyword_release(keyword)
     748             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     749             :                           description="append the cube files when they already exist", &
     750        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     751        9174 :       CALL section_add_keyword(print_key, keyword)
     752        9174 :       CALL keyword_release(keyword)
     753             : 
     754        9174 :       CALL section_add_subsection(subsection, print_key)
     755        9174 :       CALL section_release(print_key)
     756             : 
     757        9174 :       CALL section_add_subsection(section, subsection)
     758        9174 :       CALL section_release(subsection)
     759             : 
     760        9174 :       NULLIFY (subsection)
     761        9174 :       CALL create_interp_section(subsection)
     762        9174 :       CALL section_add_subsection(section, subsection)
     763        9174 :       CALL section_release(subsection)
     764             : 
     765        9174 :    END SUBROUTINE create_current_section
     766             : 
     767             : ! **************************************************************************************************
     768             : !> \brief creates the input structure used to activate
     769             : !>         calculation of NMR chemical shift using
     770             : !>         the induced current obtained from DFPT
     771             : !>      Available properties : none
     772             : !> \param section the section to create
     773             : !> \author  MI/VW
     774             : ! **************************************************************************************************
     775        9174 :    SUBROUTINE create_nmr_section(section)
     776             :       TYPE(section_type), POINTER                        :: section
     777             : 
     778             :       TYPE(keyword_type), POINTER                        :: keyword
     779             :       TYPE(section_type), POINTER                        :: print_key, subsection
     780             : 
     781        9174 :       NULLIFY (keyword, print_key, subsection)
     782             : 
     783        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
     784             :       CALL section_create(section, __LOCATION__, name="nmr", &
     785             :                           description="The chemical shift is calculated by DFPT.", &
     786             :                           n_keywords=5, n_subsections=1, repeats=.FALSE., &
     787       18348 :                           citations=(/Weber2009/))
     788             : 
     789             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     790             :                           description="controls the activation of the nmr calculation", &
     791             :                           usage="&NMR T", &
     792             :                           default_l_val=.FALSE., &
     793        9174 :                           lone_keyword_l_val=.TRUE.)
     794        9174 :       CALL section_add_keyword(section, keyword)
     795        9174 :       CALL keyword_release(keyword)
     796             : 
     797             :       CALL keyword_create(keyword, __LOCATION__, name="INTERPOLATE_SHIFT", &
     798             :                           description="Calculate the soft part of the chemical shift by interpolation ", &
     799             :                           usage="INTERPOLATE_SHIFT T", &
     800        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     801        9174 :       CALL section_add_keyword(section, keyword)
     802        9174 :       CALL keyword_release(keyword)
     803             : 
     804             :       CALL keyword_create(keyword, __LOCATION__, name="NICS", &
     805             :                           description="Calculate the chemical shift in a set of points"// &
     806             :                           " given from an external file", usage="NICS", &
     807        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     808        9174 :       CALL section_add_keyword(section, keyword)
     809        9174 :       CALL keyword_release(keyword)
     810             : 
     811             :       CALL keyword_create(keyword, __LOCATION__, name="NICS_FILE_NAME", &
     812             :                           description="Name of the file with the NICS points coordinates", &
     813             :                           usage="NICS_FILE_NAME nics_file", &
     814        9174 :                           default_lc_val="nics_file")
     815        9174 :       CALL section_add_keyword(section, keyword)
     816        9174 :       CALL keyword_release(keyword)
     817             : 
     818             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_NMR", &
     819             :                           description="Restart the NMR calculation from a previous run (NOT WORKING YET)", &
     820             :                           usage="RESTART_NMR", default_l_val=.FALSE., &
     821        9174 :                           lone_keyword_l_val=.TRUE.)
     822        9174 :       CALL section_add_keyword(section, keyword)
     823        9174 :       CALL keyword_release(keyword)
     824             : 
     825             :       CALL keyword_create(keyword, __LOCATION__, name="SHIFT_GAPW_RADIUS", &
     826             :                           description="While computing the local part of the shift (GAPW), "// &
     827             :                           "the integration is restricted to nuclei that are within this radius.", &
     828             :                           usage="SHIFT_GAPW_RADIUS 20.0", &
     829             :                           type_of_var=real_t, &
     830             :                           default_r_val=cp_unit_to_cp2k(value=60.0_dp, unit_str="angstrom"), &
     831        9174 :                           unit_str="angstrom")
     832        9174 :       CALL section_add_keyword(section, keyword)
     833        9174 :       CALL keyword_release(keyword)
     834             : 
     835        9174 :       NULLIFY (subsection)
     836             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
     837             :                           description="print results of nmr calculation", &
     838        9174 :                           repeats=.FALSE.)
     839             : 
     840             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
     841             :                                        description="Controls the printing of the response functions ", &
     842        9174 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
     843             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     844             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     845             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     846             :                           " 1 number valid for all components.", &
     847        9174 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     848        9174 :       CALL section_add_keyword(print_key, keyword)
     849        9174 :       CALL keyword_release(keyword)
     850             : 
     851             :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
     852             :                           variants=(/"CUBES_LU"/), &
     853             :                           description="The lower and upper index of the states to be printed as cube", &
     854             :                           usage="CUBES_LU_BOUNDS integer integer", &
     855       18348 :                           n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
     856        9174 :       CALL section_add_keyword(print_key, keyword)
     857        9174 :       CALL keyword_release(keyword)
     858             : 
     859             :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
     860             :                           description="Indexes of the states to be printed as cube files "// &
     861             :                           "This keyword can be repeated several times "// &
     862             :                           "(useful if you have to specify many indexes).", &
     863             :                           usage="CUBES_LIST 1 2", &
     864        9174 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
     865        9174 :       CALL section_add_keyword(print_key, keyword)
     866        9174 :       CALL keyword_release(keyword)
     867             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     868             :                           description="append the cube files when they already exist", &
     869        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     870        9174 :       CALL section_add_keyword(print_key, keyword)
     871        9174 :       CALL keyword_release(keyword)
     872             : 
     873        9174 :       CALL section_add_subsection(subsection, print_key)
     874        9174 :       CALL section_release(print_key)
     875             : 
     876             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CHI_TENSOR", &
     877             :                                        description="Controls the printing of susceptibility", &
     878        9174 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
     879        9174 :       CALL section_add_subsection(subsection, print_key)
     880        9174 :       CALL section_release(print_key)
     881             : 
     882             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "SHIELDING_TENSOR", &
     883             :                                        description="Controls the printing of the chemical shift", &
     884        9174 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="")
     885             : 
     886             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LU_BOUNDS", &
     887             :                           variants=(/"ATOMS_LU"/), &
     888             :                           description="The lower and upper atomic index for which the tensor is printed", &
     889             :                           usage="ATOMS_LU_BOUNDS integer integer", &
     890       18348 :                           n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
     891        9174 :       CALL section_add_keyword(print_key, keyword)
     892        9174 :       CALL keyword_release(keyword)
     893             : 
     894             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
     895             :                           description="list of atoms for which the shift is printed into a file ", &
     896             :                           usage="LIST_ATOMS 1 2", n_var=-1, &
     897        9174 :                           type_of_var=integer_t, repeats=.TRUE.)
     898        9174 :       CALL section_add_keyword(print_key, keyword)
     899        9174 :       CALL keyword_release(keyword)
     900             : 
     901        9174 :       CALL section_add_subsection(subsection, print_key)
     902        9174 :       CALL section_release(print_key)
     903             : 
     904        9174 :       CALL section_add_subsection(section, subsection)
     905        9174 :       CALL section_release(subsection)
     906             : 
     907        9174 :       NULLIFY (subsection)
     908        9174 :       CALL create_interp_section(subsection)
     909        9174 :       CALL section_add_subsection(section, subsection)
     910        9174 :       CALL section_release(subsection)
     911             : 
     912        9174 :    END SUBROUTINE create_nmr_section
     913             : 
     914             : ! **************************************************************************************************
     915             : !> \brief creates the input structure used to activate
     916             : !>      calculation of NMR spin-spin coupling (implementation not operating)
     917             : !>      Available properties : none
     918             : !> \param section the section to create
     919             : !> \author  VW
     920             : ! **************************************************************************************************
     921        9174 :    SUBROUTINE create_spin_spin_section(section)
     922             :       TYPE(section_type), POINTER                        :: section
     923             : 
     924             :       TYPE(keyword_type), POINTER                        :: keyword
     925             :       TYPE(section_type), POINTER                        :: print_key, subsection
     926             : 
     927        9174 :       NULLIFY (keyword, print_key, subsection)
     928             : 
     929        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
     930             :       CALL section_create(section, __LOCATION__, name="spinspin", &
     931             :                           description="Compute indirect spin-spin coupling constants.", &
     932        9174 :                           n_keywords=5, n_subsections=1, repeats=.FALSE.)
     933             : 
     934             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     935             :                           description="controls the activation of the nmr calculation", &
     936             :                           usage="&SPINSPIN T", &
     937             :                           default_l_val=.FALSE., &
     938        9174 :                           lone_keyword_l_val=.TRUE.)
     939        9174 :       CALL section_add_keyword(section, keyword)
     940        9174 :       CALL keyword_release(keyword)
     941             : 
     942             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_SPINSPIN", &
     943             :                           description="Restart the spin-spin calculation from a previous run (NOT WORKING YET)", &
     944             :                           usage="RESTART_SPINSPIN", default_l_val=.FALSE., &
     945        9174 :                           lone_keyword_l_val=.TRUE.)
     946        9174 :       CALL section_add_keyword(section, keyword)
     947        9174 :       CALL keyword_release(keyword)
     948             : 
     949             :       CALL keyword_create(keyword, __LOCATION__, name="ISSC_ON_ATOM_LIST", &
     950             :                           description="Atoms for which the issc is computed.", &
     951             :                           usage="ISSC_ON_ATOM_LIST 1 2 10", &
     952        9174 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
     953        9174 :       CALL section_add_keyword(section, keyword)
     954        9174 :       CALL keyword_release(keyword)
     955             : 
     956             :       CALL keyword_create(keyword, __LOCATION__, name="DO_FC", &
     957             :                           description="Compute the Fermi contact contribution", &
     958             :                           usage="DO_FC F", &
     959        9174 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     960        9174 :       CALL section_add_keyword(section, keyword)
     961        9174 :       CALL keyword_release(keyword)
     962             : 
     963             :       CALL keyword_create(keyword, __LOCATION__, name="DO_SD", &
     964             :                           description="Compute the spin-dipolar contribution", &
     965             :                           usage="DO_SD F", &
     966        9174 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     967        9174 :       CALL section_add_keyword(section, keyword)
     968        9174 :       CALL keyword_release(keyword)
     969             : 
     970             :       CALL keyword_create(keyword, __LOCATION__, name="DO_PSO", &
     971             :                           description="Compute the paramagnetic spin-orbit contribution", &
     972             :                           usage="DO_PSO F", &
     973        9174 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     974        9174 :       CALL section_add_keyword(section, keyword)
     975        9174 :       CALL keyword_release(keyword)
     976             : 
     977             :       CALL keyword_create(keyword, __LOCATION__, name="DO_DSO", &
     978             :                           description="Compute the diamagnetic spin-orbit contribution (NOT YET IMPLEMENTED)", &
     979             :                           usage="DO_DSO F", &
     980        9174 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     981        9174 :       CALL section_add_keyword(section, keyword)
     982        9174 :       CALL keyword_release(keyword)
     983             : 
     984        9174 :       NULLIFY (subsection)
     985             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
     986             :                           description="print results of the indirect spin-spin calculation", &
     987        9174 :                           repeats=.FALSE.)
     988             : 
     989             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "K_MATRIX", &
     990             :                                        description="Controls the printing of the indirect spin-spin matrix", &
     991        9174 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="")
     992             : 
     993             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
     994             :                           description="list of atoms for which the indirect spin-spin is printed into a file ", &
     995             :                           usage="LIST_ATOMS 1 2", n_var=-1, &
     996        9174 :                           type_of_var=integer_t, repeats=.TRUE.)
     997        9174 :       CALL section_add_keyword(print_key, keyword)
     998        9174 :       CALL keyword_release(keyword)
     999             : 
    1000        9174 :       CALL section_add_subsection(subsection, print_key)
    1001        9174 :       CALL section_release(print_key)
    1002             : 
    1003        9174 :       CALL section_add_subsection(section, subsection)
    1004        9174 :       CALL section_release(subsection)
    1005             : 
    1006        9174 :       NULLIFY (subsection)
    1007        9174 :       CALL create_interp_section(subsection)
    1008        9174 :       CALL section_add_subsection(section, subsection)
    1009        9174 :       CALL section_release(subsection)
    1010             : 
    1011        9174 :    END SUBROUTINE create_spin_spin_section
    1012             : 
    1013             : ! **************************************************************************************************
    1014             : !> \brief creates the input structure used to activate
    1015             : !>         calculation of EPR using
    1016             : !>         the induced current obtained from DFPT
    1017             : !>      Available properties : none
    1018             : !> \param section the section to create
    1019             : !> \author  VW
    1020             : ! **************************************************************************************************
    1021        9174 :    SUBROUTINE create_epr_section(section)
    1022             :       TYPE(section_type), POINTER                        :: section
    1023             : 
    1024             :       TYPE(keyword_type), POINTER                        :: keyword
    1025             :       TYPE(section_type), POINTER                        :: print_key, subsection, subsubsection
    1026             : 
    1027        9174 :       NULLIFY (keyword, print_key, subsection, subsubsection)
    1028             : 
    1029        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    1030             :       CALL section_create(section, __LOCATION__, name="EPR", &
    1031             :                           description="The g tensor is calculated by DFPT ", &
    1032             :                           n_keywords=5, n_subsections=1, repeats=.FALSE., &
    1033       18348 :                           citations=(/Weber2009/))
    1034             : 
    1035             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    1036             :                           description="controls the activation of the epr calculation", &
    1037             :                           usage="&EPR T", &
    1038             :                           default_l_val=.FALSE., &
    1039        9174 :                           lone_keyword_l_val=.TRUE.)
    1040        9174 :       CALL section_add_keyword(section, keyword)
    1041        9174 :       CALL keyword_release(keyword)
    1042             : 
    1043             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_EPR", &
    1044             :                           description="Restart the EPR calculation from a previous run (NOT WORKING)", &
    1045             :                           usage="RESTART_EPR", default_l_val=.FALSE., &
    1046        9174 :                           lone_keyword_l_val=.TRUE.)
    1047        9174 :       CALL section_add_keyword(section, keyword)
    1048        9174 :       CALL keyword_release(keyword)
    1049             : 
    1050        9174 :       NULLIFY (subsection)
    1051             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1052             :                           description="print results of epr calculation", &
    1053        9174 :                           repeats=.FALSE.)
    1054             : 
    1055             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "NABLAVKS_CUBES", &
    1056             :                                        description="Controls the printing of the components of nabla v_ks ", &
    1057        9174 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
    1058             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    1059             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1060             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    1061             :                           " 1 number valid for all components.", &
    1062        9174 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    1063        9174 :       CALL section_add_keyword(print_key, keyword)
    1064        9174 :       CALL keyword_release(keyword)
    1065             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1066             :                           description="append the cube files when they already exist", &
    1067        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1068        9174 :       CALL section_add_keyword(print_key, keyword)
    1069        9174 :       CALL keyword_release(keyword)
    1070             : 
    1071        9174 :       CALL section_add_subsection(subsection, print_key)
    1072        9174 :       CALL section_release(print_key)
    1073             : 
    1074             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "G_TENSOR", &
    1075             :                                        description="Controls the printing of the g tensor", &
    1076        9174 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
    1077        9174 :       CALL create_xc_section(subsubsection)
    1078        9174 :       CALL section_add_subsection(print_key, subsubsection)
    1079        9174 :       CALL section_release(subsubsection)
    1080             : 
    1081             :       CALL keyword_create(keyword, __LOCATION__, name="GAPW_MAX_ALPHA", &
    1082             :                           description="Maximum alpha of GTH potentials allowed on the soft grids ", &
    1083        9174 :                           usage="GAPW_MAX_ALPHA real", default_r_val=5.0_dp)
    1084        9174 :       CALL section_add_keyword(print_key, keyword)
    1085        9174 :       CALL keyword_release(keyword)
    1086             : 
    1087             :       CALL keyword_create(keyword, __LOCATION__, name="SOO_RHO_HARD", &
    1088             :                           description="Whether or not to include the atomic parts of the density "// &
    1089             :                           "in the SOO part of the g tensor", usage="SOO_RHO_HARD", &
    1090        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1091        9174 :       CALL section_add_keyword(print_key, keyword)
    1092        9174 :       CALL keyword_release(keyword)
    1093             : 
    1094        9174 :       CALL section_add_subsection(subsection, print_key)
    1095        9174 :       CALL section_release(print_key)
    1096             : 
    1097             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
    1098             :                                        description="Controls the printing of the response functions ", &
    1099        9174 :                                        print_level=high_print_level, add_last=add_last_numeric, filename="")
    1100             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    1101             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1102             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    1103             :                           " 1 number valid for all components.", &
    1104        9174 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    1105        9174 :       CALL section_add_keyword(print_key, keyword)
    1106        9174 :       CALL keyword_release(keyword)
    1107             : 
    1108             :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
    1109             :                           variants=(/"CUBES_LU"/), &
    1110             :                           description="The lower and upper index of the states to be printed as cube", &
    1111             :                           usage="CUBES_LU_BOUNDS integer integer", &
    1112       18348 :                           n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
    1113        9174 :       CALL section_add_keyword(print_key, keyword)
    1114        9174 :       CALL keyword_release(keyword)
    1115             : 
    1116             :       CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
    1117             :                           description="Indexes of the states to be printed as cube files "// &
    1118             :                           "This keyword can be repeated several times "// &
    1119             :                           "(useful if you have to specify many indexes).", &
    1120             :                           usage="CUBES_LIST 1 2", &
    1121        9174 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
    1122        9174 :       CALL section_add_keyword(print_key, keyword)
    1123        9174 :       CALL keyword_release(keyword)
    1124             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1125             :                           description="append the cube files when they already exist", &
    1126        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1127        9174 :       CALL section_add_keyword(print_key, keyword)
    1128        9174 :       CALL keyword_release(keyword)
    1129             : 
    1130        9174 :       CALL section_add_subsection(subsection, print_key)
    1131        9174 :       CALL section_release(print_key)
    1132             : 
    1133        9174 :       CALL section_add_subsection(section, subsection)
    1134        9174 :       CALL section_release(subsection)
    1135             : 
    1136        9174 :       NULLIFY (subsection)
    1137        9174 :       CALL create_interp_section(subsection)
    1138        9174 :       CALL section_add_subsection(section, subsection)
    1139        9174 :       CALL section_release(subsection)
    1140             : 
    1141        9174 :    END SUBROUTINE create_epr_section
    1142             : 
    1143             : ! **************************************************************************************************
    1144             : !> \brief creates the input structure used to activate
    1145             : !>      calculation of polarizability tensor DFPT
    1146             : !>      Available properties : none
    1147             : !> \param section the section to create
    1148             : !> \author SL
    1149             : ! **************************************************************************************************
    1150        9174 :    SUBROUTINE create_polarizability_section(section)
    1151             : 
    1152             :       TYPE(section_type), POINTER                        :: section
    1153             : 
    1154             :       TYPE(keyword_type), POINTER                        :: keyword
    1155             :       TYPE(section_type), POINTER                        :: print_key, subsection
    1156             : 
    1157        9174 :       NULLIFY (keyword, print_key, subsection)
    1158             : 
    1159        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    1160             :       CALL section_create(section, __LOCATION__, name="POLAR", &
    1161             :                           description="Compute polarizabilities.", &
    1162             :                           n_keywords=5, n_subsections=1, repeats=.FALSE., &
    1163       18348 :                           citations=(/Putrino2002/))
    1164             : 
    1165             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    1166             :                           description="controls the activation of the polarizability calculation", &
    1167             :                           usage="&POLAR T", &
    1168             :                           default_l_val=.FALSE., &
    1169        9174 :                           lone_keyword_l_val=.TRUE.)
    1170        9174 :       CALL section_add_keyword(section, keyword)
    1171        9174 :       CALL keyword_release(keyword)
    1172             : 
    1173             :       CALL keyword_create(keyword, __LOCATION__, name="DO_RAMAN", &
    1174             :                           description="Compute the electric-dipole--electric-dipole polarizability", &
    1175             :                           usage="DO_RAMAN F", &
    1176             :                           citations=(/Luber2014/), &
    1177       18348 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1178        9174 :       CALL section_add_keyword(section, keyword)
    1179        9174 :       CALL keyword_release(keyword)
    1180             : 
    1181             :       CALL keyword_create(keyword, __LOCATION__, name="PERIODIC_DIPOLE_OPERATOR", &
    1182             :                           description="Type of dipole operator: Berry phase(T) or Local(F)", &
    1183             :                           usage="PERIODIC_DIPOLE_OPERATOR T", &
    1184        9174 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1185        9174 :       CALL section_add_keyword(section, keyword)
    1186        9174 :       CALL keyword_release(keyword)
    1187             : 
    1188        9174 :       NULLIFY (subsection)
    1189             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1190             :                           description="print results of the polarizability calculation", &
    1191        9174 :                           repeats=.FALSE.)
    1192             : 
    1193             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "POLAR_MATRIX", &
    1194             :                                        description="Controls the printing of the polarizabilities", &
    1195        9174 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="")
    1196             : 
    1197        9174 :       CALL section_add_subsection(subsection, print_key)
    1198        9174 :       CALL section_release(print_key)
    1199        9174 :       CALL section_add_subsection(section, subsection)
    1200        9174 :       CALL section_release(subsection)
    1201             : 
    1202        9174 :       NULLIFY (subsection)
    1203        9174 :       CALL create_interp_section(subsection)
    1204        9174 :       CALL section_add_subsection(section, subsection)
    1205        9174 :       CALL section_release(subsection)
    1206             : 
    1207        9174 :    END SUBROUTINE create_polarizability_section
    1208             : 
    1209             : ! **************************************************************************************************
    1210             : !> \brief creates the section for electron transfer coupling
    1211             : !> \param section ...
    1212             : !> \author fschiff
    1213             : ! **************************************************************************************************
    1214        9174 :    SUBROUTINE create_et_coupling_section(section)
    1215             :       TYPE(section_type), POINTER                        :: section
    1216             : 
    1217             :       TYPE(keyword_type), POINTER                        :: keyword
    1218             :       TYPE(section_type), POINTER                        :: print_key, subsection
    1219             : 
    1220        9174 :       NULLIFY (keyword)
    1221        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    1222             :       CALL section_create(section, __LOCATION__, name="ET_COUPLING", &
    1223             :                           description="specifies the two constraints/restraints for extracting ET coupling elements", &
    1224       27522 :                           n_keywords=1, n_subsections=4, repeats=.FALSE., citations=(/Kondov2007, Futera2017/))
    1225             : 
    1226        9174 :       NULLIFY (subsection)
    1227        9174 :       CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_A")
    1228        9174 :       CALL section_add_subsection(section, subsection)
    1229        9174 :       CALL section_release(subsection)
    1230             : 
    1231        9174 :       NULLIFY (subsection)
    1232        9174 :       CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_B")
    1233        9174 :       CALL section_add_subsection(section, subsection)
    1234        9174 :       CALL section_release(subsection)
    1235             : 
    1236        9174 :       NULLIFY (subsection)
    1237        9174 :       CALL create_projection(subsection, "PROJECTION")
    1238        9174 :       CALL section_add_subsection(section, subsection)
    1239        9174 :       CALL section_release(subsection)
    1240             : 
    1241             :       CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_CONSTRAINT", &
    1242             :                           description="Specifies the type of constraint", &
    1243             :                           usage="TYPE_OF_CONSTRAINT DDAPC", &
    1244             :                           enum_c_vals=s2a("NONE", "DDAPC"), &
    1245             :                           enum_i_vals=(/do_no_et, do_et_ddapc/), &
    1246             :                           enum_desc=s2a("NONE", "DDAPC Constraint"), &
    1247        9174 :                           default_i_val=do_no_et)
    1248        9174 :       CALL section_add_keyword(section, keyword)
    1249        9174 :       CALL keyword_release(keyword)
    1250             : 
    1251        9174 :       NULLIFY (print_key)
    1252             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
    1253             :                                        description="Controls the printing basic info about the method", &
    1254        9174 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
    1255        9174 :       CALL section_add_subsection(section, print_key)
    1256        9174 :       CALL section_release(print_key)
    1257             : 
    1258        9174 :    END SUBROUTINE create_et_coupling_section
    1259             : 
    1260             : ! **************************************************************************************************
    1261             : !> \brief defines input sections for specification of Hilbert space partitioning
    1262             : !>        in projection-operator approach of electronic coupling calulation
    1263             : !> \param section pointer to the section data structure
    1264             : !> \param section_name name of the projection section
    1265             : !> \author Z. Futera (02.2017)
    1266             : ! **************************************************************************************************
    1267        9174 :    SUBROUTINE create_projection(section, section_name)
    1268             : 
    1269             :       ! Routine arguments
    1270             :       TYPE(section_type), POINTER                        :: section
    1271             :       CHARACTER(len=*), INTENT(in)                       :: section_name
    1272             : 
    1273             :       TYPE(keyword_type), POINTER                        :: keyword
    1274             :       TYPE(section_type), POINTER                        :: print_key, section_block, section_print
    1275             : 
    1276             : ! Routine name for dubug purposes
    1277             : 
    1278             :       ! Sanity check
    1279           0 :       CPASSERT(.NOT. ASSOCIATED(section))
    1280             : 
    1281             :       ! Initialization
    1282        9174 :       NULLIFY (keyword)
    1283        9174 :       NULLIFY (print_key)
    1284        9174 :       NULLIFY (section_block)
    1285        9174 :       NULLIFY (section_print)
    1286             : 
    1287             :       ! Input-file section definition
    1288             :       CALL section_create(section, __LOCATION__, name=TRIM(ADJUSTL(section_name)), &
    1289             :                           description="Projection-operator approach fo ET coupling calculation", &
    1290        9174 :                           n_keywords=0, n_subsections=2, repeats=.FALSE.)
    1291             : 
    1292             :       ! Subsection #0: Log printing
    1293             :       CALL cp_print_key_section_create(print_key, __LOCATION__, 'PROGRAM_RUN_INFO', &
    1294             :                                        description="Controls printing of data and informations to log file", &
    1295        9174 :                                        print_level=low_print_level, filename="__STD_OUT__")
    1296        9174 :       CALL section_add_subsection(section, print_key)
    1297        9174 :       CALL section_release(print_key)
    1298             : 
    1299             :       ! Subsection #1: Atomic blocks
    1300             :       CALL section_create(section_block, __LOCATION__, name='BLOCK', &
    1301             :                           description="Part of the system (donor, acceptor, bridge,...)", &
    1302        9174 :                           n_keywords=2, n_subsections=1, repeats=.TRUE.)
    1303        9174 :       CALL section_add_subsection(section, section_block)
    1304             : 
    1305             :       ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
    1306             :       CALL keyword_create(keyword, __LOCATION__, name='ATOMS', &
    1307             :                           description="Array of atom IDs in the system part", &
    1308             :                           usage="ATOMS {integer} {integer} .. {integer}", &
    1309        9174 :                           n_var=-1, type_of_var=integer_t, repeats=.FALSE.)
    1310        9174 :       CALL section_add_keyword(section_block, keyword)
    1311        9174 :       CALL keyword_release(keyword)
    1312             : 
    1313             :       ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
    1314             :       CALL keyword_create(keyword, __LOCATION__, name='NELECTRON', &
    1315             :                           description="Number of electrons expected in the system part", &
    1316        9174 :                           usage="NELECTRON {integer}", default_i_val=0)
    1317        9174 :       CALL section_add_keyword(section_block, keyword)
    1318        9174 :       CALL keyword_release(keyword)
    1319             : 
    1320             :       ! S#1 - Subsection #1: Printing setting
    1321             :       CALL section_create(section_print, __LOCATION__, name='PRINT', &
    1322             :                           description="Possible printing options in ET system part", &
    1323        9174 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
    1324        9174 :       CALL section_add_subsection(section_block, section_print)
    1325             : 
    1326             :       ! S#1 - S#1 - Keyword #1: MO coefficient on specific atom
    1327             :       CALL keyword_create(keyword, __LOCATION__, name='MO_COEFF_ATOM', &
    1328             :                           description="Print out MO coeffiecients on given atom", &
    1329             :                           usage="MO_COEFF_ATOM {integer} {integer} .. {integer}", &
    1330        9174 :                           type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
    1331        9174 :       CALL section_add_keyword(section_print, keyword)
    1332        9174 :       CALL keyword_release(keyword)
    1333             : 
    1334             :       ! S#1 - S#1 - Keyword #1: MO coefficient of specific state
    1335             :       CALL keyword_create(keyword, __LOCATION__, name='MO_COEFF_ATOM_STATE', &
    1336             :                           description="Print out MO coeffiecients of specific state", &
    1337             :                           usage="MO_COEFF_ATOM_STATE {integer} {integer} .. {integer}", &
    1338        9174 :                           type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
    1339        9174 :       CALL section_add_keyword(section_print, keyword)
    1340        9174 :       CALL keyword_release(keyword)
    1341             : 
    1342             :       ! S#1 - S#1 - Subsection #1: Saving MOs to CUBE files
    1343             :       CALL cp_print_key_section_create(print_key, __LOCATION__, 'MO_CUBES', &
    1344             :                                        description="Controls saving of MO cube files", &
    1345        9174 :                                        print_level=high_print_level, filename="")
    1346             : 
    1347             :       ! S#1 - S#1 - S#1 - Keyword #1: Stride
    1348             :       CALL keyword_create(keyword, __LOCATION__, name='STRIDE', &
    1349             :                           description="The stride (X,Y,Z) used to write the cube file", &
    1350             :                           usage="STRIDE {integer} {integer} {integer}", n_var=-1, &
    1351        9174 :                           default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    1352        9174 :       CALL section_add_keyword(print_key, keyword)
    1353        9174 :       CALL keyword_release(keyword)
    1354             : 
    1355             :       ! S#1 - S#1 - S#1 - Keyword #2: List of MO IDs
    1356             :       CALL keyword_create(keyword, __LOCATION__, name='MO_LIST', &
    1357             :                           description="Indices of molecular orbitals to save", &
    1358             :                           usage="MO_LIST {integer} {integer} .. {integer}", &
    1359        9174 :                           type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
    1360        9174 :       CALL section_add_keyword(print_key, keyword)
    1361        9174 :       CALL keyword_release(keyword)
    1362             : 
    1363             :       ! S#1 - S#1 - S#1 - Keyword #2: Number of unoccupied states
    1364             :       CALL keyword_create(keyword, __LOCATION__, name='NLUMO', &
    1365             :                           description="Number of unoccupied molecular orbitals to save", &
    1366        9174 :                           usage="NLUMO {integer}", default_i_val=1)
    1367        9174 :       CALL section_add_keyword(print_key, keyword)
    1368        9174 :       CALL keyword_release(keyword)
    1369             : 
    1370             :       ! S#1 - S#1 - S#1 - Keyword #3: Number of occupied states
    1371             :       CALL keyword_create(keyword, __LOCATION__, name='NHOMO', &
    1372             :                           description="Number of occupied molecular orbitals to save", &
    1373        9174 :                           usage="NHOMO {integer}", default_i_val=1)
    1374        9174 :       CALL section_add_keyword(print_key, keyword)
    1375        9174 :       CALL keyword_release(keyword)
    1376             : 
    1377        9174 :       CALL section_add_subsection(section_print, print_key)
    1378        9174 :       CALL section_release(print_key)
    1379             : 
    1380             :       ! S#1 - S#1 - Clean
    1381        9174 :       CALL section_release(section_print)
    1382             : 
    1383             :       ! S#1 - Clean
    1384        9174 :       CALL section_release(section_block)
    1385             : 
    1386             :       ! S#1 - Subsection #1: Printing setting
    1387             :       CALL section_create(section_print, __LOCATION__, name='PRINT', &
    1388             :                           description="Possible printing options in ET", &
    1389        9174 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
    1390        9174 :       CALL section_add_subsection(section, section_print)
    1391             : 
    1392             :       ! Print couplings
    1393             :       CALL cp_print_key_section_create(print_key, __LOCATION__, 'COUPLINGS', &
    1394             :                                        description="Controls printing couplings onto file", &
    1395        9174 :                                        print_level=low_print_level, filename="")
    1396             : 
    1397             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1398             :                           description="append the files when they already exist", &
    1399        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1400        9174 :       CALL section_add_keyword(print_key, keyword)
    1401        9174 :       CALL keyword_release(keyword)
    1402             : 
    1403        9174 :       CALL section_add_subsection(section_print, print_key)
    1404        9174 :       CALL section_release(print_key)
    1405             : 
    1406        9174 :       CALL section_release(section_print)
    1407             : 
    1408        9174 :    END SUBROUTINE create_projection
    1409             : 
    1410             : ! **************************************************************************************************
    1411             : !> \brief creates an input section for tddfpt calculation
    1412             : !> \param section section to create
    1413             : !> \par History
    1414             : !>    * 05.2016 forked from create_tddfpt_section [Sergey Chulkov]
    1415             : !>    * 08.2016 moved from module input_cp2k_dft [Sergey Chulkov]
    1416             : ! **************************************************************************************************
    1417        9174 :    SUBROUTINE create_tddfpt2_section(section)
    1418             :       TYPE(section_type), POINTER                        :: section
    1419             : 
    1420             :       TYPE(keyword_type), POINTER                        :: keyword
    1421             :       TYPE(section_type), POINTER                        :: print_key, subsection
    1422             : 
    1423        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    1424             :       CALL section_create(section, __LOCATION__, name="TDDFPT", &
    1425             :                           description="Parameters needed to set up the Time-Dependent "// &
    1426             :                           "Density Functional Perturbation Theory. "// &
    1427             :                           "Current implementation works for hybrid functionals. "// &
    1428             :                           "Can be used with Gaussian and Plane Waves (GPW) method only.", &
    1429             :                           n_keywords=12, n_subsections=4, repeats=.FALSE., &
    1430       18348 :                           citations=(/Iannuzzi2005/))
    1431             : 
    1432        9174 :       NULLIFY (keyword, print_key, subsection)
    1433             : 
    1434             :       CALL keyword_create(keyword, __LOCATION__, &
    1435             :                           name="_SECTION_PARAMETERS_", &
    1436             :                           description="Controls the activation of the TDDFPT procedure", &
    1437             :                           default_l_val=.FALSE., &
    1438        9174 :                           lone_keyword_l_val=.TRUE.)
    1439        9174 :       CALL section_add_keyword(section, keyword)
    1440        9174 :       CALL keyword_release(keyword)
    1441             : 
    1442             :       ! Integer
    1443             :       CALL keyword_create(keyword, __LOCATION__, name="NSTATES", &
    1444             :                           description="Number of excited states to converge.", &
    1445             :                           n_var=1, type_of_var=integer_t, &
    1446        9174 :                           default_i_val=1)
    1447        9174 :       CALL section_add_keyword(section, keyword)
    1448        9174 :       CALL keyword_release(keyword)
    1449             : 
    1450             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
    1451             :                           description="Maximal number of iterations to be performed.", &
    1452             :                           n_var=1, type_of_var=integer_t, &
    1453        9174 :                           default_i_val=50)
    1454        9174 :       CALL section_add_keyword(section, keyword)
    1455        9174 :       CALL keyword_release(keyword)
    1456             : 
    1457             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_KV", &
    1458             :                           description="Maximal number of Krylov space vectors. "// &
    1459             :                           "Davidson iterations will be restarted upon reaching this limit.", &
    1460             :                           n_var=1, type_of_var=integer_t, &
    1461        9174 :                           default_i_val=5000)
    1462        9174 :       CALL section_add_keyword(section, keyword)
    1463        9174 :       CALL keyword_release(keyword)
    1464             : 
    1465             :       CALL keyword_create(keyword, __LOCATION__, name="NLUMO", &
    1466             :                           description="Number of unoccupied orbitals to consider. "// &
    1467             :                           "Default is to use all unoccupied orbitals (-1).", &
    1468             :                           n_var=1, type_of_var=integer_t, &
    1469        9174 :                           default_i_val=-1)
    1470        9174 :       CALL section_add_keyword(section, keyword)
    1471        9174 :       CALL keyword_release(keyword)
    1472             : 
    1473             :       CALL keyword_create(keyword, __LOCATION__, name="NPROC_STATE", &
    1474             :                           description="Number of MPI processes to be used per excited state. "// &
    1475             :                           "Default is to use all processors (0).", &
    1476             :                           n_var=1, type_of_var=integer_t, &
    1477        9174 :                           default_i_val=0)
    1478        9174 :       CALL section_add_keyword(section, keyword)
    1479        9174 :       CALL keyword_release(keyword)
    1480             : 
    1481             :       ! kernel type
    1482             :       CALL keyword_create(keyword, __LOCATION__, name="KERNEL", &
    1483             :                           description="Options to compute the kernel", &
    1484             :                           usage="KERNEL FULL", &
    1485             :                           enum_c_vals=s2a("FULL", "sTDA", "NONE"), &
    1486             :                           enum_i_vals=(/tddfpt_kernel_full, tddfpt_kernel_stda, tddfpt_kernel_none/), &
    1487        9174 :                           default_i_val=tddfpt_kernel_full)
    1488        9174 :       CALL section_add_keyword(section, keyword)
    1489        9174 :       CALL keyword_release(keyword)
    1490             : 
    1491             :       CALL keyword_create(keyword, __LOCATION__, name="OE_CORR", &
    1492             :                           description="Orbital energy correction potential.", &
    1493             :                           enum_c_vals=s2a("NONE", "LB94", "GLLB", "SAOP", "SHIFT"), &
    1494             :                           enum_i_vals=(/oe_none, oe_lb, oe_gllb, oe_saop, oe_shift/), &
    1495             :                           enum_desc=s2a("No orbital correction scheme is used", &
    1496             :                                         "van Leeuwen and Baerends. PRA, 49:2421, 1994", &
    1497             :                                         "Gritsenko, van Leeuwen, van Lenthe, Baerends. PRA, 51:1944, 1995", &
    1498             :                                         "Gritsenko, Schipper, Baerends. Chem. Phys. Lett., 302:199, 1999", &
    1499             :                                         "Constant shift of virtual and/or open-shell orbitals"), &
    1500        9174 :                           default_i_val=oe_none)
    1501        9174 :       CALL section_add_keyword(section, keyword)
    1502        9174 :       CALL keyword_release(keyword)
    1503             : 
    1504             :       ! SHIFTS
    1505             :       CALL keyword_create(keyword, __LOCATION__, name="EV_SHIFT", &
    1506             :                           variants=s2a("VIRTUAL_SHIFT"), &
    1507             :                           description="Constant shift of virtual state eigenvalues.", &
    1508             :                           usage="EV_SHIFT 0.500", &
    1509             :                           n_var=1, type_of_var=real_t, &
    1510             :                           unit_str="eV", &
    1511        9174 :                           default_r_val=0.0_dp)
    1512        9174 :       CALL section_add_keyword(section, keyword)
    1513        9174 :       CALL keyword_release(keyword)
    1514             :       !
    1515             :       CALL keyword_create(keyword, __LOCATION__, name="EOS_SHIFT", &
    1516             :                           variants=s2a("OPEN_SHELL_SHIFT"), &
    1517             :                           description="Constant shift of open shell eigenvalues.", &
    1518             :                           usage="EOS_SHIFT 0.200", &
    1519             :                           n_var=1, type_of_var=real_t, &
    1520             :                           unit_str="eV", &
    1521        9174 :                           default_r_val=0.0_dp)
    1522        9174 :       CALL section_add_keyword(section, keyword)
    1523        9174 :       CALL keyword_release(keyword)
    1524             : 
    1525             :       ! Real
    1526             :       CALL keyword_create(keyword, __LOCATION__, name="CONVERGENCE", &
    1527             :                           description="Target accuracy for excited state energies.", &
    1528             :                           n_var=1, type_of_var=real_t, unit_str="hartree", &
    1529        9174 :                           default_r_val=1.0e-5_dp)
    1530        9174 :       CALL section_add_keyword(section, keyword)
    1531        9174 :       CALL keyword_release(keyword)
    1532             : 
    1533             :       CALL keyword_create(keyword, __LOCATION__, name="MIN_AMPLITUDE", &
    1534             :                           description="The smallest excitation amplitude to print.", &
    1535             :                           n_var=1, type_of_var=real_t, &
    1536        9174 :                           default_r_val=5.0e-2_dp)
    1537        9174 :       CALL section_add_keyword(section, keyword)
    1538        9174 :       CALL keyword_release(keyword)
    1539             : 
    1540             :       CALL keyword_create(keyword, __LOCATION__, name="ORTHOGONAL_EPS", &
    1541             :                           description="The largest possible overlap between the ground state and "// &
    1542             :                           "orthogonalised excited state wave-functions. Davidson iterations "// &
    1543             :                           "will be restarted when the overlap goes beyond this threshold in "// &
    1544             :                           "order to prevent numerical instability.", &
    1545             :                           n_var=1, type_of_var=real_t, &
    1546        9174 :                           default_r_val=1.0e-4_dp)
    1547        9174 :       CALL section_add_keyword(section, keyword)
    1548        9174 :       CALL keyword_release(keyword)
    1549             : 
    1550             :       ! Logical
    1551             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
    1552             :                           description="Restart the TDDFPT calculation if a restart file exists", &
    1553             :                           n_var=1, type_of_var=logical_t, &
    1554        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1555        9174 :       CALL section_add_keyword(section, keyword)
    1556        9174 :       CALL keyword_release(keyword)
    1557             : 
    1558             :       CALL keyword_create(keyword, __LOCATION__, name="RKS_TRIPLETS", &
    1559             :                           description="Compute triplet excited states using spin-unpolarised molecular orbitals.", &
    1560             :                           n_var=1, type_of_var=logical_t, &
    1561        9174 :                           default_l_val=.FALSE.)
    1562        9174 :       CALL section_add_keyword(section, keyword)
    1563        9174 :       CALL keyword_release(keyword)
    1564             : 
    1565             :       CALL keyword_create(keyword, __LOCATION__, name="ADMM_KERNEL_XC_CORRECTION", &
    1566             :                           description="Use/Ignore ADMM correction xc functional for TD kernel. "// &
    1567             :                           "XC correction functional is defined in ground state XC section.", &
    1568             :                           n_var=1, type_of_var=logical_t, &
    1569        9174 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1570        9174 :       CALL section_add_keyword(section, keyword)
    1571        9174 :       CALL keyword_release(keyword)
    1572             : 
    1573             :       CALL keyword_create(keyword, __LOCATION__, name="ADMM_KERNEL_CORRECTION_SYMMETRIC", &
    1574             :                           description="ADMM correction functional in kernel is applied symmetrically. "// &
    1575             :                           "Original implementation is using a non-symmetric formula.", &
    1576             :                           n_var=1, type_of_var=logical_t, &
    1577        9174 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1578        9174 :       CALL section_add_keyword(section, keyword)
    1579        9174 :       CALL keyword_release(keyword)
    1580             : 
    1581             :       CALL keyword_create(keyword, __LOCATION__, name="DO_LRIGPW", &
    1582             :                           description="Local resolution of identity for Coulomb contribution.", &
    1583             :                           n_var=1, type_of_var=logical_t, &
    1584        9174 :                           default_l_val=.FALSE.)
    1585        9174 :       CALL section_add_keyword(section, keyword)
    1586        9174 :       CALL keyword_release(keyword)
    1587             : 
    1588             :       CALL keyword_create(keyword, __LOCATION__, name="AUTO_BASIS", &
    1589             :                           description="Specify size of automatically generated auxiliary basis sets: "// &
    1590             :                           "Options={small,medium,large,huge}", &
    1591             :                           usage="AUTO_BASIS {basis_type} {basis_size}", &
    1592       27522 :                           type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=(/"X", "X"/))
    1593        9174 :       CALL section_add_keyword(section, keyword)
    1594        9174 :       CALL keyword_release(keyword)
    1595             : 
    1596             :       ! Strings
    1597             :       CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
    1598             :                           variants=(/"RESTART_FILE_NAME"/), &
    1599             :                           description="Name of the wave function restart file, may include a path."// &
    1600             :                           " If no file is specified, the default is to open the file as generated by"// &
    1601             :                           " the wave function restart print key.", &
    1602             :                           usage="WFN_RESTART_FILE_NAME <FILENAME>", &
    1603       18348 :                           type_of_var=lchar_t)
    1604        9174 :       CALL section_add_keyword(section, keyword)
    1605        9174 :       CALL keyword_release(keyword)
    1606             : 
    1607             :       ! DIPOLE subsection
    1608             :       CALL section_create(subsection, __LOCATION__, name="DIPOLE_MOMENTS", &
    1609             :                           description="Parameters to compute oscillator strengths in the dipole approximation.", &
    1610        9174 :                           n_keywords=3, n_subsections=0, repeats=.FALSE.)
    1611             : 
    1612             :       CALL keyword_create(keyword, __LOCATION__, name="DIPOLE_FORM", &
    1613             :                           description="Form of dipole transition integrals.", &
    1614             :                           enum_c_vals=s2a("BERRY", "LENGTH", "VELOCITY"), &
    1615             :                           enum_desc=s2a("Based on Berry phase formula (valid for fully periodic molecular systems only)", &
    1616             :                                         "Length form &lang; i | r | j &rang; (valid for non-periodic molecular systems only)", &
    1617             :                                         "Velocity form &lang; i | d/dr | j &rang;"), &
    1618             :                           enum_i_vals=(/tddfpt_dipole_berry, tddfpt_dipole_length, tddfpt_dipole_velocity/), &
    1619        9174 :                           default_i_val=tddfpt_dipole_velocity)
    1620        9174 :       CALL section_add_keyword(subsection, keyword)
    1621        9174 :       CALL keyword_release(keyword)
    1622             : 
    1623             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
    1624             :                           description="Reference point to calculate electric "// &
    1625             :                           "dipole moments using the dipole integrals in the length form.", &
    1626             :                           enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
    1627             :                           enum_desc=s2a("Use Center of Mass", &
    1628             :                                         "Use Center of Atomic Charges", &
    1629             :                                         "Use User-defined Point", &
    1630             :                                         "Use Origin of Coordinate System"), &
    1631             :                           enum_i_vals=(/use_mom_ref_com, &
    1632             :                                         use_mom_ref_coac, &
    1633             :                                         use_mom_ref_user, &
    1634             :                                         use_mom_ref_zero/), &
    1635        9174 :                           default_i_val=use_mom_ref_com)
    1636        9174 :       CALL section_add_keyword(subsection, keyword)
    1637        9174 :       CALL keyword_release(keyword)
    1638             : 
    1639             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
    1640             :                           description="User-defined reference point.", &
    1641             :                           usage="REFERENCE_POINT x y z", &
    1642        9174 :                           repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
    1643        9174 :       CALL section_add_keyword(subsection, keyword)
    1644        9174 :       CALL keyword_release(keyword)
    1645             : 
    1646        9174 :       CALL section_add_subsection(section, subsection)
    1647        9174 :       CALL section_release(subsection)
    1648             : 
    1649             :       ! SOC functional
    1650             : 
    1651             :       CALL section_create(subsection, __LOCATION__, name="SOC", &
    1652             :                           description="Is jet to be implemented", &
    1653        9174 :                           n_keywords=2, n_subsections=0, repeats=.FALSE.)
    1654             : 
    1655             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
    1656             :                           variants=s2a("EPS_FILTER_MATRIX"), &
    1657             :                           description="The threshold used for sparse matrix operations", &
    1658             :                           usage="EPS_FILTER {real}", &
    1659             :                           type_of_var=real_t, &
    1660        9174 :                           default_r_val=1.0E-10_dp)
    1661        9174 :       CALL section_add_keyword(subsection, keyword)
    1662        9174 :       CALL keyword_release(keyword)
    1663             : 
    1664             :       CALL keyword_create(keyword, __LOCATION__, name="GRID", &
    1665             :                           variants=(/"ATOMIC_GRID"/), &
    1666             :                           description="Specification of the atomic angular and radial grids for "// &
    1667             :                           "a atomic kind. This keyword must be repeated for all kinds!  "// &
    1668             :                           "Usage: GRID < LEBEDEV_GRID > < RADIAL_GRID >", &
    1669             :                           usage="GRID {string} {integer} {integer}", &
    1670       18348 :                           n_var=3, type_of_var=char_t, repeats=.TRUE.)
    1671        9174 :       CALL section_add_keyword(subsection, keyword)
    1672        9174 :       CALL keyword_release(keyword)
    1673             : 
    1674        9174 :       CALL section_add_subsection(section, subsection)
    1675        9174 :       CALL section_release(subsection)
    1676             : 
    1677             :       ! kernel XC functional
    1678        9174 :       CALL create_xc_section(subsection)
    1679        9174 :       CALL section_add_subsection(section, subsection)
    1680        9174 :       CALL section_release(subsection)
    1681             : 
    1682             :       ! MGRID subsection
    1683        9174 :       CALL create_mgrid_section(subsection, create_subsections=.FALSE.)
    1684        9174 :       CALL section_add_subsection(section, subsection)
    1685        9174 :       CALL section_release(subsection)
    1686             : 
    1687             :       ! sTDA subsection
    1688        9174 :       CALL create_stda_section(subsection)
    1689        9174 :       CALL section_add_subsection(section, subsection)
    1690        9174 :       CALL section_release(subsection)
    1691             : 
    1692             :       ! LRI subsection
    1693        9174 :       CALL create_lrigpw_section(subsection)
    1694        9174 :       CALL section_add_subsection(section, subsection)
    1695        9174 :       CALL section_release(subsection)
    1696             : 
    1697             :       ! LINRES section
    1698        9174 :       CALL create_linres_section(subsection, create_subsections=.FALSE., default_set_tdlr=.TRUE.)
    1699        9174 :       CALL section_add_subsection(section, subsection)
    1700        9174 :       CALL section_release(subsection)
    1701             : 
    1702             :       ! PRINT subsection
    1703             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1704        9174 :                           description="Printing of information during the TDDFT run.", repeats=.FALSE.)
    1705             : 
    1706             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="PROGRAM_BANNER", &
    1707             :                                        description="Controls the printing of the banner for TDDFPT program", &
    1708        9174 :                                        print_level=silent_print_level, filename="__STD_OUT__")
    1709        9174 :       CALL section_add_subsection(subsection, print_key)
    1710        9174 :       CALL section_release(print_key)
    1711             : 
    1712             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="GUESS_VECTORS", &
    1713             :                                        description="Controls the printing of initial guess vectors.", &
    1714        9174 :                                        print_level=low_print_level, filename="__STD_OUT__")
    1715        9174 :       CALL section_add_subsection(subsection, print_key)
    1716        9174 :       CALL section_release(print_key)
    1717             : 
    1718             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="ITERATION_INFO", &
    1719             :                                        description="Controls the printing of basic iteration information "// &
    1720             :                                        "during the TDDFT run.", &
    1721        9174 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
    1722        9174 :       CALL section_add_subsection(subsection, print_key)
    1723        9174 :       CALL section_release(print_key)
    1724             : 
    1725             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="DETAILED_ENERGY", &
    1726             :                                        description="Controls the printing of detailed energy information "// &
    1727             :                                        "during the TDDFT run.", &
    1728        9174 :                                        print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
    1729        9174 :       CALL section_add_subsection(subsection, print_key)
    1730        9174 :       CALL section_release(print_key)
    1731             : 
    1732             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="BASIS_SET_FILE", &
    1733             :                                        description="Controls the printing of a file with all basis sets used.", &
    1734        9174 :                                        print_level=debug_print_level, filename="BASIS_SETS")
    1735        9174 :       CALL section_add_subsection(subsection, print_key)
    1736        9174 :       CALL section_release(print_key)
    1737             : 
    1738             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="RESTART", &
    1739             :                                        description="Controls the dumping of the MO restart file during TDDFPT. "// &
    1740             :                                        "By default keeps a short history of three restarts.", &
    1741             :                                        print_level=low_print_level, common_iter_levels=3, &
    1742             :                                        each_iter_names=s2a("TDDFT_SCF"), each_iter_values=(/10/), &
    1743        9174 :                                        add_last=add_last_numeric, filename="RESTART")
    1744             :       CALL keyword_create(keyword, __LOCATION__, name="BACKUP_COPIES", &
    1745             :                           description="Specifies the maximum number of backup copies.", &
    1746             :                           usage="BACKUP_COPIES {int}", &
    1747        9174 :                           default_i_val=1)
    1748        9174 :       CALL section_add_keyword(print_key, keyword)
    1749        9174 :       CALL keyword_release(keyword)
    1750        9174 :       CALL section_add_subsection(subsection, print_key)
    1751        9174 :       CALL section_release(print_key)
    1752             : 
    1753             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="NTO_ANALYSIS", &
    1754             :                                        description="Perform a natural transition orbital analysis.", &
    1755        9174 :                                        print_level=medium_print_level)
    1756             :       CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
    1757             :                           description="Threshold for sum of NTO eigenvalues considered", &
    1758             :                           usage="Threshold 0.95", &
    1759             :                           n_var=1, &
    1760             :                           type_of_var=real_t, &
    1761        9174 :                           default_r_val=0.975_dp)
    1762        9174 :       CALL section_add_keyword(print_key, keyword)
    1763        9174 :       CALL keyword_release(keyword)
    1764             :       CALL keyword_create(keyword, __LOCATION__, name="INTENSITY_THRESHOLD", &
    1765             :                           description="Threshold for oscillator strength to screen states.", &
    1766             :                           usage="Intensity_threshold 0.01", &
    1767             :                           n_var=1, &
    1768             :                           type_of_var=real_t, &
    1769        9174 :                           default_r_val=0.0_dp)
    1770        9174 :       CALL section_add_keyword(print_key, keyword)
    1771        9174 :       CALL keyword_release(keyword)
    1772             :       CALL keyword_create(keyword, __LOCATION__, name="STATE_LIST", &
    1773             :                           description="Specifies a list of states for the NTO calculations.", &
    1774             :                           usage="STATE_LIST {integer} {integer} .. {integer}", &
    1775        9174 :                           n_var=-1, type_of_var=integer_t)
    1776        9174 :       CALL section_add_keyword(print_key, keyword)
    1777        9174 :       CALL keyword_release(keyword)
    1778             :       CALL keyword_create(keyword, __LOCATION__, name="CUBE_FILES", &
    1779             :                           description="Print NTOs on Cube Files", &
    1780             :                           usage="CUBE_FILES {logical}", repeats=.FALSE., n_var=1, &
    1781        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1782        9174 :       CALL section_add_keyword(print_key, keyword)
    1783        9174 :       CALL keyword_release(keyword)
    1784             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    1785             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1786             :                           "(larger values result in smaller cube files). Provide 3 numbers (for X,Y,Z) or"// &
    1787             :                           " 1 number valid for all components.", &
    1788        9174 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    1789        9174 :       CALL section_add_keyword(print_key, keyword)
    1790        9174 :       CALL keyword_release(keyword)
    1791             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1792             :                           description="append the cube files when they already exist", &
    1793        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1794        9174 :       CALL section_add_keyword(print_key, keyword)
    1795        9174 :       CALL keyword_release(keyword)
    1796        9174 :       CALL section_add_subsection(subsection, print_key)
    1797        9174 :       CALL section_release(print_key)
    1798             : 
    1799             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "MOS_MOLDEN", &
    1800             :                                        description="Write the NTO in Molden file format, for visualisation.", &
    1801        9174 :                                        print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MOS")
    1802             :       CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
    1803             :                           description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
    1804             :                           usage="NDIGITS {int}", &
    1805        9174 :                           default_i_val=3)
    1806        9174 :       CALL section_add_keyword(print_key, keyword)
    1807        9174 :       CALL keyword_release(keyword)
    1808             :       CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
    1809             :                           description="Representation of Gaussian-type orbitals", &
    1810             :                           default_i_val=gto_spherical, &
    1811             :                           enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
    1812             :                           enum_desc=s2a( &
    1813             :                           "Cartesian Gaussian orbitals. Use with caution", &
    1814             :                           "Spherical Gaussian orbitals. Incompatible with VMD"), &
    1815        9174 :                           enum_i_vals=(/gto_cartesian, gto_spherical/))
    1816        9174 :       CALL section_add_keyword(print_key, keyword)
    1817        9174 :       CALL keyword_release(keyword)
    1818        9174 :       CALL section_add_subsection(subsection, print_key)
    1819        9174 :       CALL section_release(print_key)
    1820             : 
    1821             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="NAMD_PRINT", &
    1822             :                                        description="Controls the printout required for NAMD with NEWTONX.", &
    1823        9174 :                                        print_level=debug_print_level + 1, filename="CP2K_NEWTONX")
    1824             :       CALL keyword_create(keyword, __LOCATION__, name="PRINT_VIRTUALS", &
    1825             :                           description="Print occupied AND virtual molecular orbital coefficients", &
    1826        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1827        9174 :       CALL section_add_keyword(print_key, keyword)
    1828        9174 :       CALL keyword_release(keyword)
    1829             :       CALL keyword_create(keyword, __LOCATION__, name="PRINT_PHASES", &
    1830             :                           description="Print phases of occupied and virtuals MOs.", &
    1831        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1832        9174 :       CALL section_add_keyword(print_key, keyword)
    1833        9174 :       CALL keyword_release(keyword)
    1834             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE_WITH_PHASES", &
    1835             :                           description="Scale ES eigenvectors with phases of occupied and virtuals MOs.", &
    1836        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1837        9174 :       CALL section_add_keyword(print_key, keyword)
    1838        9174 :       CALL keyword_release(keyword)
    1839        9174 :       CALL section_add_subsection(subsection, print_key)
    1840        9174 :       CALL section_release(print_key)
    1841             : 
    1842             :       !! SOC PRINT SECTION
    1843             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="SOC_PRINT", &
    1844             :                                        description="Controls the printout of the tddfpt2_soc modul", &
    1845        9174 :                                        print_level=debug_print_level + 1, filename="SOC")
    1846             :       CALL keyword_create(keyword, __LOCATION__, name="UNIT_eV", &
    1847             :                           description="Will detrement if output in eVolt will be printef.", &
    1848        9174 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1849        9174 :       CALL section_add_keyword(print_key, keyword)
    1850        9174 :       CALL keyword_release(keyword)
    1851             :       CALL keyword_create(keyword, __LOCATION__, name="UNIT_wn", &
    1852             :                           description="Will detrement if output in wavenumbers will be printed.", &
    1853        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1854        9174 :       CALL section_add_keyword(print_key, keyword)
    1855        9174 :       CALL keyword_release(keyword)
    1856             :       CALL keyword_create(keyword, __LOCATION__, name="SPLITTING", &
    1857             :                           description="Will add the SOC-Splitting as additional output", &
    1858        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1859        9174 :       CALL section_add_keyword(print_key, keyword)
    1860        9174 :       CALL keyword_release(keyword)
    1861             :       CALL keyword_create(keyword, __LOCATION__, name="SOME", &
    1862             :                           description="Will add the SOC-Matrix as additional output in a different file", &
    1863        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1864        9174 :       CALL section_add_keyword(print_key, keyword)
    1865        9174 :       CALL keyword_release(keyword)
    1866        9174 :       CALL section_add_subsection(subsection, print_key)
    1867        9174 :       CALL section_release(print_key)
    1868             : 
    1869             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="FORCES", &
    1870             :                                        description="Controls the calculation and printing of excited state forces. "// &
    1871             :                                        "This needs a RUN_TYPE that includes force evaluation, e.g. ENERGY_FORCE", &
    1872        9174 :                                        print_level=debug_print_level, filename="TDFORCE")
    1873             :       CALL keyword_create(keyword, __LOCATION__, name="LIST", &
    1874             :                           description="Specifies a list of states for the force calculations.", &
    1875             :                           usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
    1876        9174 :                           n_var=-1, type_of_var=integer_t)
    1877        9174 :       CALL section_add_keyword(print_key, keyword)
    1878        9174 :       CALL keyword_release(keyword)
    1879             :       CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
    1880             :                           description="Threshold for oszillator strength to screen states.", &
    1881             :                           usage="Threshold 0.01", &
    1882             :                           n_var=1, &
    1883             :                           type_of_var=real_t, &
    1884        9174 :                           default_r_val=0.0_dp)
    1885        9174 :       CALL section_add_keyword(print_key, keyword)
    1886        9174 :       CALL keyword_release(keyword)
    1887        9174 :       CALL section_add_subsection(subsection, print_key)
    1888        9174 :       CALL section_release(print_key)
    1889             : 
    1890        9174 :       CALL section_add_subsection(section, subsection)
    1891        9174 :       CALL section_release(subsection)
    1892             : 
    1893        9174 :    END SUBROUTINE create_tddfpt2_section
    1894             : 
    1895             : ! **************************************************************************************************
    1896             : !> \brief creates the stda input section (simplified Tamm Dancoff Approximation)
    1897             : !> \param section the section to create
    1898             : ! **************************************************************************************************
    1899        9174 :    SUBROUTINE create_stda_section(section)
    1900             :       TYPE(section_type), POINTER                        :: section
    1901             : 
    1902             :       TYPE(keyword_type), POINTER                        :: keyword
    1903             : 
    1904        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    1905             :       CALL section_create(section, __LOCATION__, name="sTDA", &
    1906             :                           description="parameters needed and setup for sTDA calculations", &
    1907        9174 :                           n_keywords=3, n_subsections=0, repeats=.FALSE.)
    1908        9174 :       NULLIFY (keyword)
    1909             : 
    1910             :       CALL keyword_create(keyword, __LOCATION__, name="FRACTION", &
    1911             :                           variants=(/"HFX_FRACTION"/), &
    1912             :                           description="The fraction of TB Hartree-Fock exchange to use in the Kernel. "// &
    1913             :                           "0.0 implies no HFX part is used in the kernel. ", &
    1914       18348 :                           usage="FRACTION 0.0", default_r_val=0.0_dp)
    1915        9174 :       CALL section_add_keyword(section, keyword)
    1916        9174 :       CALL keyword_release(keyword)
    1917             : 
    1918             :       ! even if scaling parameter for exchange FRACTION (see above) is zero, the semi-empirical electron repulsion
    1919             :       ! operator for exchange is not, so that a keyword is required to switch off sTDA exchange (if wanted)
    1920             :       CALL keyword_create(keyword, __LOCATION__, name="DO_EXCHANGE", &
    1921             :                           description="Explicitly including or switching off sTDA exchange", &
    1922        9174 :                           usage="DO_EXCHANGE", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1923        9174 :       CALL section_add_keyword(section, keyword)
    1924        9174 :       CALL keyword_release(keyword)
    1925             : 
    1926             :       CALL keyword_create(keyword, __LOCATION__, name="DO_EWALD", &
    1927             :                           description="Use Ewald type method for Coulomb interaction", &
    1928        9174 :                           usage="DO_EWALD", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1929        9174 :       CALL section_add_keyword(section, keyword)
    1930        9174 :       CALL keyword_release(keyword)
    1931             : 
    1932             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_TD_FILTER", &
    1933             :                           description="Threshold for filtering the transition density matrix", &
    1934        9174 :                           usage="EPS_TD_FILTER epsf", default_r_val=1.e-10_dp)
    1935        9174 :       CALL section_add_keyword(section, keyword)
    1936        9174 :       CALL keyword_release(keyword)
    1937             : 
    1938             :       CALL keyword_create(keyword, __LOCATION__, name="MATAGA_NISHIMOTO_CEXP", &
    1939             :                           description="Exponent used in Mataga-Nishimoto formula for Coulomb (alpha). "// &
    1940             :                           "Default value is method dependent!", &
    1941        9174 :                           usage="MATAGA_NISHIMOTO_CEXP cexp", default_r_val=-99.0_dp)
    1942        9174 :       CALL section_add_keyword(section, keyword)
    1943        9174 :       CALL keyword_release(keyword)
    1944             : 
    1945             :       CALL keyword_create(keyword, __LOCATION__, name="MATAGA_NISHIMOTO_XEXP", &
    1946             :                           description="Exponent used in Mataga-Nishimoto formula for Exchange (beta). "// &
    1947             :                           "Default value is method dependent!", &
    1948        9174 :                           usage="MATAGA_NISHIMOTO_XEXP xexp", default_r_val=-99.0_dp)
    1949        9174 :       CALL section_add_keyword(section, keyword)
    1950        9174 :       CALL keyword_release(keyword)
    1951             : 
    1952             :       CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_CUT", &
    1953             :                           description="Maximum range of short range part of Coulomb interaction.", &
    1954        9174 :                           usage="COULOMB_SR_CUT rcut", default_r_val=20.0_dp)
    1955        9174 :       CALL section_add_keyword(section, keyword)
    1956        9174 :       CALL keyword_release(keyword)
    1957             : 
    1958             :       CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_EPS", &
    1959             :                           description="Threshold for short range part of Coulomb interaction.", &
    1960        9174 :                           usage="COULOMB_SR_EPS sreps", default_r_val=1.e-03_dp)
    1961        9174 :       CALL section_add_keyword(section, keyword)
    1962        9174 :       CALL keyword_release(keyword)
    1963             : 
    1964        9174 :    END SUBROUTINE create_stda_section
    1965             : 
    1966             : ! **************************************************************************************************
    1967             : !> \brief creates an input section for electronic band structure calculations
    1968             : !> \param section section to create
    1969             : !> \par History
    1970             : !>    * 07.2023 created [Jan Wilhelm]
    1971             : ! **************************************************************************************************
    1972        9174 :    SUBROUTINE create_bandstructure_section(section)
    1973             :       TYPE(section_type), POINTER                        :: section
    1974             : 
    1975             :       TYPE(keyword_type), POINTER                        :: keyword
    1976             :       TYPE(section_type), POINTER                        :: subsection
    1977             : 
    1978        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    1979             :       CALL section_create(section, __LOCATION__, name="BANDSTRUCTURE", &
    1980             :                           description="Parameters needed to set up a calculation for "// &
    1981             :                           "electronic level energies of molecules and the electronic band "// &
    1982             :                           "structure of materials from post-SCF schemes (GW, perturbative "// &
    1983             :                           "spin-orbit coupling). Also, the density of states (DOS), "// &
    1984             :                           "projected density of states (PDOS), local density of states (LDOS), "// &
    1985             :                           "local valence band maximum (LVBM), local conduction band minimum "// &
    1986             :                           "(LCBM) and local band gap can be calculated. Please note that "// &
    1987             :                           "all methods in this section start from a Gamma-only DFT SCF. "// &
    1988             :                           "You need to make sure that the cell chosen in the DFT SCF is "// &
    1989             :                           "converged in the cell size. Band structures are computed "// &
    1990             :                           "for the primitive cell (i.e. the smallest possible unit cell of "// &
    1991             :                           "the input structure which is detected automatically). Moreover, "// &
    1992             :                           "spin-orbit coupling (SOC) on eigenvalues and band structures is "// &
    1993             :                           "available using Hartwigsen-Goedecker-Hutter "// &
    1994             :                           "pseudopotentials.", &
    1995        9174 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    1996             : 
    1997        9174 :       NULLIFY (keyword, subsection)
    1998             :       CALL keyword_create(keyword, __LOCATION__, &
    1999             :                           name="_SECTION_PARAMETERS_", &
    2000             :                           description="Controls the activation of the band structure calculation.", &
    2001             :                           default_l_val=.FALSE., &
    2002        9174 :                           lone_keyword_l_val=.TRUE.)
    2003        9174 :       CALL section_add_keyword(section, keyword)
    2004        9174 :       CALL keyword_release(keyword)
    2005             : 
    2006             :       ! here we generate a subsection for getting a k-point path for the bandstructure
    2007        9174 :       CALL create_kpoint_set_section(subsection, "BANDSTRUCTURE_PATH")
    2008        9174 :       CALL section_add_subsection(section, subsection)
    2009        9174 :       CALL section_release(subsection)
    2010             : 
    2011        9174 :       CALL create_gw_section(subsection)
    2012        9174 :       CALL section_add_subsection(section, subsection)
    2013        9174 :       CALL section_release(subsection)
    2014             : 
    2015        9174 :       CALL create_soc_section(subsection)
    2016        9174 :       CALL section_add_subsection(section, subsection)
    2017        9174 :       CALL section_release(subsection)
    2018             : 
    2019        9174 :       CALL create_dos_section(subsection)
    2020        9174 :       CALL section_add_subsection(section, subsection)
    2021        9174 :       CALL section_release(subsection)
    2022             : 
    2023        9174 :    END SUBROUTINE create_bandstructure_section
    2024             : 
    2025             : ! **************************************************************************************************
    2026             : !> \brief creates an input section for a GW calculation for the electronic band structure
    2027             : !> \param section section to create
    2028             : !> \par History
    2029             : !>    * 07.2023 created [Jan Wilhelm]
    2030             : ! **************************************************************************************************
    2031        9174 :    SUBROUTINE create_gw_section(section)
    2032             :       TYPE(section_type), POINTER                        :: section
    2033             : 
    2034             :       TYPE(keyword_type), POINTER                        :: keyword
    2035             :       TYPE(section_type), POINTER                        :: print_key, subsection
    2036             : 
    2037        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    2038             :       CALL section_create(section, __LOCATION__, name="GW", &
    2039             :                           description="Parameters needed to set up a GW calculation for "// &
    2040             :                           "electronic level energies of molecules and the band structure of "// &
    2041             :                           "materials (currently only 2D materials tested). For the GW "// &
    2042             :                           "algorithm for molecules, see "// &
    2043             :                           "<https://doi.org/10.1021/acs.jctc.0c01282>. "// &
    2044             :                           "For 2D materials, see <http://arxiv.org/abs/2306.16066>.", &
    2045        9174 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    2046             : 
    2047        9174 :       NULLIFY (keyword)
    2048             :       CALL keyword_create(keyword, __LOCATION__, &
    2049             :                           name="_SECTION_PARAMETERS_", &
    2050             :                           description="Controls the activation of the GW calculation.", &
    2051             :                           default_l_val=.FALSE., &
    2052        9174 :                           lone_keyword_l_val=.TRUE.)
    2053        9174 :       CALL section_add_keyword(section, keyword)
    2054        9174 :       CALL keyword_release(keyword)
    2055             : 
    2056             :       CALL keyword_create(keyword, __LOCATION__, name="NUM_TIME_FREQ_POINTS", &
    2057             :                           description="Number of discrete points for the imaginary-time "// &
    2058             :                           "grid and the imaginary-frequency grid. The more points, the more "// &
    2059             :                           "precise is the calculation. Typically, 10 points are good "// &
    2060             :                           "for 0.1 eV precision of band structures and molecular energy "// &
    2061             :                           "levels, 20 points for 0.03 eV precision, "// &
    2062             :                           "and 30 points for 0.01 eV precision, see Table I in "// &
    2063             :                           "<https://doi.org/10.1021/acs.jctc.0c01282>. GW computation time "// &
    2064             :                           "increases linearly with `NUM_TIME_FREQ_POINTS`.", &
    2065             :                           usage="NUM_TIME_FREQ_POINTS 30", &
    2066        9174 :                           default_i_val=30)
    2067        9174 :       CALL section_add_keyword(section, keyword)
    2068        9174 :       CALL keyword_release(keyword)
    2069             : 
    2070             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
    2071             :                           description="Determines a threshold for the DBCSR based sparse "// &
    2072             :                           "multiplications. Normally, `EPS_FILTER` determines accuracy "// &
    2073             :                           "and timing of low-scaling GW calculations. (Lower filter means "// &
    2074             :                           "higher numerical precision, but higher computational cost.)", &
    2075             :                           usage="EPS_FILTER 1.0E-6", &
    2076        9174 :                           default_r_val=1.0E-8_dp)
    2077        9174 :       CALL section_add_keyword(section, keyword)
    2078        9174 :       CALL keyword_release(keyword)
    2079             : 
    2080             :       CALL keyword_create(keyword, __LOCATION__, name="REGULARIZATION_RI", &
    2081             :                           description="Parameter for RI regularization, setting a negative "// &
    2082             :                           "value triggers the default value. Affects RI basis set convergence "// &
    2083             :                           "but in any case large RI basis will give RI basis set convergence.", &
    2084             :                           usage="REGULARIZATION_RI 1.0E-4", &
    2085        9174 :                           default_r_val=-1.0_dp)
    2086        9174 :       CALL section_add_keyword(section, keyword)
    2087        9174 :       CALL keyword_release(keyword)
    2088             : 
    2089             :       CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RI", &
    2090             :                           description="The cutoff radius (in Angstrom) for the truncated  "// &
    2091             :                           "Coulomb operator. The larger the cutoff radius, the faster "// &
    2092             :                           "converges the resolution of the identity (RI) with respect to the "// &
    2093             :                           "RI basis set size. Larger cutoff radius means higher computational "// &
    2094             :                           "cost.", &
    2095             :                           usage="CUTOFF_RADIUS_RI 3.0", &
    2096             :                           default_r_val=cp_unit_to_cp2k(value=3.0_dp, unit_str="angstrom"), &
    2097        9174 :                           type_of_var=real_t, unit_str="angstrom")
    2098        9174 :       CALL section_add_keyword(section, keyword)
    2099        9174 :       CALL keyword_release(keyword)
    2100             : 
    2101             :       CALL keyword_create(keyword, __LOCATION__, name="MEMORY_PER_PROC", &
    2102             :                           description="Specify the available memory per MPI process. Set "// &
    2103             :                           "`MEMORY_PER_PROC` as accurately as possible for good performance. If "// &
    2104             :                           "`MEMORY_PER_PROC` is set lower as the actually available "// &
    2105             :                           "memory per MPI process, the performance will be "// &
    2106             :                           "bad; if `MEMORY_PER_PROC` is set higher as the actually "// &
    2107             :                           "available memory per MPI process, the program might run out of "// &
    2108             :                           "memory. You can calculate `MEMORY_PER_PROC` as follows: "// &
    2109             :                           "Get the memory per node on your machine, mem_per_node "// &
    2110             :                           "(for example, from a supercomputer website, typically between "// &
    2111             :                           "100 GB and 2 TB), get the number of "// &
    2112             :                           "MPI processes per node, n_MPI_proc_per_node"// &
    2113             :                           " (for example from your run-script; if you "// &
    2114             :                           "use slurm, the number behind '--ntasks-per-node' is the number "// &
    2115             :                           "of MPI processes per node). Then calculate "// &
    2116             :                           "`MEMORY_PER_PROC` = mem_per_node / n_MPI_proc_per_node "// &
    2117             :                           "(typically between 2 GB and 50 GB). Unit of keyword: Gigabyte (GB).", &
    2118             :                           usage="MEMORY_PER_PROC 16", &
    2119        9174 :                           default_r_val=2.0_dp)
    2120        9174 :       CALL section_add_keyword(section, keyword)
    2121        9174 :       CALL keyword_release(keyword)
    2122             : 
    2123             :       CALL keyword_create(keyword, __LOCATION__, name="APPROX_KP_EXTRAPOL", &
    2124             :                           description="If true, use only a 4x4 kpoint mesh for frequency "// &
    2125             :                           "points $\omega_j, j \ge 2$ (instead of a 4x4 and 6x6 k-point mesh). "// &
    2126             :                           "The k-point extrapolation of $W_{PQ}(i\omega_j,\mathbf{q})$ "// &
    2127             :                           "is done approximately from $W_{PQ}(i\omega_1,\mathbf{q})$.", &
    2128             :                           usage="APPROX_KP_EXTRAPOL", &
    2129        9174 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2130        9174 :       CALL section_add_keyword(section, keyword)
    2131        9174 :       CALL keyword_release(keyword)
    2132             : 
    2133             :       CALL keyword_create(keyword, __LOCATION__, name="HEDIN_SHIFT", &
    2134             :                           description="If true, use Hedin's shift in G0W0, evGW and evGW0. "// &
    2135             :                           "Details see in Li et al. JCTC 18, 7570 "// &
    2136             :                           "(2022), Figure 1. G0W0 with Hedin's shift should give "// &
    2137             :                           "similar GW eigenvalues as evGW0; at a lower "// &
    2138             :                           "computational cost.", &
    2139             :                           usage="HEDIN_SHIFT", &
    2140             :                           default_l_val=.FALSE., &
    2141        9174 :                           lone_keyword_l_val=.TRUE.)
    2142        9174 :       CALL section_add_keyword(section, keyword)
    2143        9174 :       CALL keyword_release(keyword)
    2144             : 
    2145        9174 :       NULLIFY (subsection, print_key)
    2146             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    2147             :                           description="Printing of GW restarts.", &
    2148        9174 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    2149             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
    2150             :                                        description="Controls the printing of restart files "// &
    2151             :                                        "for χ, W, Σ.", &
    2152             :                                        filename="", print_level=low_print_level, &
    2153        9174 :                                        common_iter_levels=3)
    2154        9174 :       CALL section_add_subsection(subsection, print_key)
    2155        9174 :       CALL section_release(print_key)
    2156             : 
    2157        9174 :       CALL section_add_subsection(section, subsection)
    2158        9174 :       CALL section_release(subsection)
    2159             : 
    2160        9174 :    END SUBROUTINE create_gw_section
    2161             : 
    2162             : ! **************************************************************************************************
    2163             : !> \brief creates an input section for calculation SOC for the electronic band structure
    2164             : !> \param section section to create
    2165             : !> \par History
    2166             : !>    * 09.2023 created [Jan Wilhelm]
    2167             : ! **************************************************************************************************
    2168        9174 :    SUBROUTINE create_soc_section(section)
    2169             :       TYPE(section_type), POINTER                        :: section
    2170             : 
    2171             :       TYPE(keyword_type), POINTER                        :: keyword
    2172             : 
    2173        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    2174             :       CALL section_create(section, __LOCATION__, name="SOC", &
    2175             :                           description="Switch on or off spin-orbit coupling. Use SOC "// &
    2176             :                           "parameters from non-local pseudopotentials as given in "// &
    2177             :                           "Hartwigsen, Goedecker, Hutter, Eq.(18), (19), "// &
    2178             :                           "<https://doi.org/10.1103/PhysRevB.58.3641>, "// &
    2179             :                           "$V_{\mu\nu}^{\mathrm{SOC}, (\alpha)} = "// &
    2180             :                           "(\hbar/2) \langle \phi_\mu | \sum_l \Delta "// &
    2181             :                           "V_l^\mathrm{SO}(\mathbf{r},\mathbf{r}') "// &
    2182             :                           "L^{(\alpha)} | \phi_\nu \rangle, "// &
    2183             :                           "\alpha = x, y, z$.", &
    2184        9174 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    2185             : 
    2186        9174 :       NULLIFY (keyword)
    2187             :       CALL keyword_create(keyword, __LOCATION__, &
    2188             :                           name="_SECTION_PARAMETERS_", &
    2189             :                           description="Controls the activation of the SOC calculation.", &
    2190             :                           default_l_val=.FALSE., &
    2191        9174 :                           lone_keyword_l_val=.TRUE.)
    2192        9174 :       CALL section_add_keyword(section, keyword)
    2193        9174 :       CALL keyword_release(keyword)
    2194             : 
    2195             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
    2196             :                           description="Apply SOC only for states with eigenvalues in the "// &
    2197             :                           "interval $[\varepsilon_\mathrm{VBM}-E_\mathrm{window}/2, "// &
    2198             :                           "\varepsilon_\mathrm{CBM}+E_\mathrm{window}/2]$. Might be necessary "// &
    2199             :                           "to use for large systems to prevent numerical instabilities.", &
    2200             :                           usage="ENERGY_WINDOW 5.0", &
    2201             :                           default_r_val=cp_unit_to_cp2k(value=40.0_dp, unit_str="eV"), &
    2202        9174 :                           unit_str="eV")
    2203        9174 :       CALL section_add_keyword(section, keyword)
    2204        9174 :       CALL keyword_release(keyword)
    2205             : 
    2206        9174 :    END SUBROUTINE create_soc_section
    2207             : 
    2208             : ! **************************************************************************************************
    2209             : !> \brief input section for computing the density of states and the projected density of states
    2210             : !> \param section section to create
    2211             : !> \par History
    2212             : !>    * 09.2023 created [Jan Wilhelm]
    2213             : ! **************************************************************************************************
    2214        9174 :    SUBROUTINE create_dos_section(section)
    2215             :       TYPE(section_type), POINTER                        :: section
    2216             : 
    2217             :       TYPE(keyword_type), POINTER                        :: keyword
    2218             :       TYPE(section_type), POINTER                        :: subsection
    2219             : 
    2220        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    2221             :       CALL section_create(section, __LOCATION__, name="DOS", &
    2222             :                           description="Parameters needed to calculate the density of states "// &
    2223             :                           "(DOS) and the projected density of states (PDOS).", &
    2224        9174 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    2225             : 
    2226        9174 :       NULLIFY (keyword)
    2227             :       CALL keyword_create(keyword, __LOCATION__, &
    2228             :                           name="_SECTION_PARAMETERS_", &
    2229             :                           description="Controls the activation of the DOS calculation.", &
    2230             :                           default_l_val=.FALSE., &
    2231        9174 :                           lone_keyword_l_val=.TRUE.)
    2232        9174 :       CALL section_add_keyword(section, keyword)
    2233        9174 :       CALL keyword_release(keyword)
    2234             : 
    2235             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
    2236             :                           description="Print DOS and PDOS in the energy window "// &
    2237             :                           "$[\varepsilon_\mathrm{VBM}-E_\mathrm{window}/2,  "// &
    2238             :                           "\varepsilon_\mathrm{CBM}+E_\mathrm{window}/2]$,"// &
    2239             :                           " where VBM is the valence "// &
    2240             :                           "band maximum (or highest occupied molecular orbital, HOMO, for "// &
    2241             :                           "molecules) and CBM the conduction band minimum (or lowest "// &
    2242             :                           "unoccupied molecular orbital, LUMO, for molecules).", &
    2243             :                           usage="ENERGY_WINDOW 5.0", &
    2244             :                           default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"), &
    2245        9174 :                           unit_str="eV")
    2246        9174 :       CALL section_add_keyword(section, keyword)
    2247        9174 :       CALL keyword_release(keyword)
    2248             : 
    2249             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_STEP", &
    2250             :                           description="Resolution of the energy E when computing the $\rho(E)$.", &
    2251             :                           usage="ENERGY_STEP 0.01", &
    2252             :                           default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
    2253        9174 :                           unit_str="eV")
    2254        9174 :       CALL section_add_keyword(section, keyword)
    2255        9174 :       CALL keyword_release(keyword)
    2256             : 
    2257             :       CALL keyword_create(keyword, __LOCATION__, name="BROADENING", &
    2258             :                           description="Broadening α in Gaussians used in the DOS; "// &
    2259             :                           "$\rho(E) = \sum_n \exp(((E-\varepsilon_n)/\alpha)^2)/("// &
    2260             :                           " \sqrt{2\pi} \alpha)$.", &
    2261             :                           usage="BROADENING 0.01", &
    2262             :                           default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
    2263        9174 :                           unit_str="eV")
    2264        9174 :       CALL section_add_keyword(section, keyword)
    2265        9174 :       CALL keyword_release(keyword)
    2266             : 
    2267             :       CALL keyword_create( &
    2268             :          keyword, __LOCATION__, name="KPOINTS", &
    2269             :          description="Monkhorst-Pack k-point mesh of size N_x, N_y, N_z for calculating "// &
    2270             :          "the density of states (DOS). In GW, the KPOINT_DOS mesh is thus used as k-point "// &
    2271             :          "mesh for the self-energy. For non-periodic directions α, choose N_α = 1. "// &
    2272             :          "Automatic choice of the k-point mesh for negative "// &
    2273             :          "values, e.g. KPOINTS_DOS -1 -1 -1 (automatic choice: N_α = 1 in non-periodic "// &
    2274             :          "direction, 8 k-points in periodic direction). If you like to compute a "// &
    2275             :          "band structure along a k-path, you can specify the k-path in "// &
    2276             :          "&KPOINT_SET.", &
    2277             :          usage="KPOINTS N_x  N_y  N_z", &
    2278        9174 :          n_var=3, type_of_var=integer_t, default_i_vals=(/-1, -1, -1/))
    2279        9174 :       CALL section_add_keyword(section, keyword)
    2280        9174 :       CALL keyword_release(keyword)
    2281             : 
    2282        9174 :       NULLIFY (subsection)
    2283        9174 :       CALL create_ldos_section(subsection)
    2284        9174 :       CALL section_add_subsection(section, subsection)
    2285        9174 :       CALL section_release(subsection)
    2286             : 
    2287        9174 :    END SUBROUTINE create_dos_section
    2288             : 
    2289             : ! **************************************************************************************************
    2290             : !> \brief ...
    2291             : !> \param section ...
    2292             : ! **************************************************************************************************
    2293        9174 :    SUBROUTINE create_ldos_section(section)
    2294             :       TYPE(section_type), POINTER                        :: section
    2295             : 
    2296             :       TYPE(keyword_type), POINTER                        :: keyword
    2297             : 
    2298        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    2299             :       CALL section_create(section, __LOCATION__, name="LDOS", &
    2300             :                           description="Parameters needed to calculate the local density "// &
    2301             :                           "of states (LDOS).  "// &
    2302             :                           "The LDOS is computed as $\rho(\mathbf{r},E) = "// &
    2303             :                           "\sum\limits_{n,\mathbf{k}}"// &
    2304             :                           " |\psi_{n\mathbf{k}}(r)|^2\, w_\mathbf{k}\, g(E-\varepsilon_{n\mathbf{k}})$ "// &
    2305             :                           "using the Gaussian weight function "// &
    2306             :                           "$g(x) = \exp(x^2/\alpha^2)/(\sqrt{2\pi}\alpha)$, $\alpha$ is the broadening "// &
    2307             :                           "from the &DOS section, and the k-point weight "// &
    2308             :                           "$w_\mathbf{k}$. The k-mesh is taken from the &DOS section.", &
    2309        9174 :                           n_keywords=2, repeats=.FALSE.)
    2310             : 
    2311        9174 :       NULLIFY (keyword)
    2312             :       CALL keyword_create(keyword, __LOCATION__, &
    2313             :                           name="_SECTION_PARAMETERS_", &
    2314             :                           description="Activates the local VBM CBM gap calculation.", &
    2315             :                           default_l_val=.FALSE., &
    2316        9174 :                           lone_keyword_l_val=.TRUE.)
    2317        9174 :       CALL section_add_keyword(section, keyword)
    2318        9174 :       CALL keyword_release(keyword)
    2319             : 
    2320             :       CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION", &
    2321             :                           description="Defines whether the LDOS is integrated along a "// &
    2322             :                           "coordinate. As an example, for INTEGRATION Z, the LDOS "// &
    2323             :                           "$\rho(x,y,E) = \int dz\, \rho(x,y,z,E)$ is computed.", &
    2324             :                           usage="INTEGRATION Z", &
    2325             :                           enum_c_vals=s2a("X", "Y", "Z", "NONE"), &
    2326             :                           enum_i_vals=(/int_ldos_x, int_ldos_y, int_ldos_z, int_ldos_none/), &
    2327             :                           enum_desc=s2a("Integrate over x coordinate (not yet implemented).", &
    2328             :                                         "Integrate over y coordinate (not yet implemented).", &
    2329             :                                         "Integrate over z coordinate.", &
    2330             :                                         "No integration, print cube file as function "// &
    2331             :                                         "of x,y,z (not yet implemented)."), &
    2332        9174 :                           default_i_val=int_ldos_z)
    2333        9174 :       CALL section_add_keyword(section, keyword)
    2334        9174 :       CALL keyword_release(keyword)
    2335             : 
    2336             :       CALL keyword_create( &
    2337             :          keyword, __LOCATION__, name="BIN_MESH", &
    2338             :          description="Mesh of size n x m for binning the space coordinates x and y of "// &
    2339             :          "the LDOS $\rho(x,y,E)$. If -1, no binning is performed and the "// &
    2340             :          "fine x, y resolution of the electron density from SCF is used.", &
    2341             :          usage="BIN_MESH  n m", &
    2342        9174 :          n_var=2, type_of_var=integer_t, default_i_vals=(/10, 10/))
    2343        9174 :       CALL section_add_keyword(section, keyword)
    2344        9174 :       CALL keyword_release(keyword)
    2345             : 
    2346        9174 :    END SUBROUTINE create_ldos_section
    2347             : 
    2348             : ! **************************************************************************************************
    2349             : !> \brief creates an input section for a tip scan calculation
    2350             : !> \param section section to create
    2351             : !> \par History
    2352             : !>    * 04.2021 created [JGH]
    2353             : ! **************************************************************************************************
    2354        9174 :    SUBROUTINE create_tipscan_section(section)
    2355             :       TYPE(section_type), POINTER                        :: section
    2356             : 
    2357             :       TYPE(keyword_type), POINTER                        :: keyword
    2358             : 
    2359        9174 :       CPASSERT(.NOT. ASSOCIATED(section))
    2360             :       CALL section_create(section, __LOCATION__, name="TIP_SCAN", &
    2361             :                           description="Parameters needed to set up a Tip Scan. "// &
    2362             :                           "Needs external definition of tip induced field.", &
    2363        9174 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    2364             : 
    2365        9174 :       NULLIFY (keyword)
    2366             : 
    2367             :       CALL keyword_create(keyword, __LOCATION__, &
    2368             :                           name="_SECTION_PARAMETERS_", &
    2369             :                           description="Controls the activation of the Tip Scan procedure", &
    2370             :                           default_l_val=.FALSE., &
    2371        9174 :                           lone_keyword_l_val=.TRUE.)
    2372        9174 :       CALL section_add_keyword(section, keyword)
    2373        9174 :       CALL keyword_release(keyword)
    2374             : 
    2375             :       CALL keyword_create(keyword, __LOCATION__, name="SCAN_DIRECTION", &
    2376             :                           description="Defines scan direction and scan type(line, plane).", &
    2377             :                           usage="SCAN_DIRECTION XY", &
    2378             :                           enum_c_vals=s2a("X", "Y", "Z", "XY", "XZ", "YZ", "XYZ"), &
    2379             :                           enum_i_vals=(/scan_x, scan_y, scan_z, scan_xy, scan_xz, scan_yz, scan_xyz/), &
    2380        9174 :                           default_i_val=scan_xy)
    2381        9174 :       CALL section_add_keyword(section, keyword)
    2382        9174 :       CALL keyword_release(keyword)
    2383             : 
    2384             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
    2385             :                           description="The reference point to define the absolute position of the scan. ", &
    2386             :                           usage="REFERENCE_POINT 0.0 0.0 1.0", &
    2387             :                           n_var=3, default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/), type_of_var=real_t, &
    2388        9174 :                           unit_str="angstrom")
    2389        9174 :       CALL section_add_keyword(section, keyword)
    2390        9174 :       CALL keyword_release(keyword)
    2391             : 
    2392             :       CALL keyword_create(keyword, __LOCATION__, name="SCAN_POINTS", &
    2393             :                           description="Number of points calculated for each scan direction.", &
    2394             :                           usage="SCAN_POINTS 20 20", &
    2395        9174 :                           n_var=-1, type_of_var=integer_t)
    2396        9174 :       CALL section_add_keyword(section, keyword)
    2397        9174 :       CALL keyword_release(keyword)
    2398             : 
    2399             :       CALL keyword_create(keyword, __LOCATION__, name="SCAN_STEP", &
    2400             :                           description="Step size for each scan direction.", &
    2401             :                           usage="SCAN_STEP 0.01 0.01", &
    2402        9174 :                           n_var=-1, type_of_var=real_t, unit_str="angstrom")
    2403        9174 :       CALL section_add_keyword(section, keyword)
    2404        9174 :       CALL keyword_release(keyword)
    2405             : 
    2406             :       CALL keyword_create(keyword, __LOCATION__, name="TIP_FILENAME", &
    2407             :                           description="Filename of tip potential defined in cube file format.", &
    2408             :                           usage="TIP_FILENAME <filename>", &
    2409        9174 :                           type_of_var=lchar_t)
    2410        9174 :       CALL section_add_keyword(section, keyword)
    2411        9174 :       CALL keyword_release(keyword)
    2412             : 
    2413        9174 :    END SUBROUTINE create_tipscan_section
    2414             : 
    2415             : END MODULE input_cp2k_properties_dft

Generated by: LCOV version 1.15