LCOV - code coverage report
Current view: top level - src - input_cp2k_print_dft.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:4dc10b3) Lines: 969 969 100.0 %
Date: 2024-11-21 06:45:46 Functions: 10 10 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 print section of the dft input
      10             : !> \par History
      11             : !>      10.2005 moved out of input_cp2k [fawzi]
      12             : !>      07.2024 moved out of input_cp2k_dft [JGH]
      13             : !> \author fawzi
      14             : ! **************************************************************************************************
      15             : MODULE input_cp2k_print_dft
      16             :    USE basis_set_types, ONLY: basis_sort_default, &
      17             :                               basis_sort_zet
      18             :    USE bibliography, ONLY: &
      19             :       Andermatt2016, Andreussi2012, Avezac2005, BaniHashemian2016, Becke1988b, Bengtsson1999, &
      20             :       Blochl1995, Brehm2018, Brelaz1979, Dewar1977, Dewar1985, Dudarev1997, Dudarev1998, &
      21             :       Ehrhardt1985, Eriksen2020, Fattebert2002, Golze2017a, Golze2017b, Guidon2010, &
      22             :       Heinzmann1976, Holmberg2017, Holmberg2018, Iannuzzi2005, Iannuzzi2006, Iannuzzi2007, &
      23             :       Knizia2013, Kolafa2004, Krack2000, Krack2002, Kuhne2007, Kunert2003, Lippert1997, &
      24             :       Lippert1999, Lu2004, Merlot2014, Perdew1981, Repasky2002, Rocha2006, Schenter2008, Schiffmann2015, &
      25             :       Shigeta2001, Stewart1982, Stewart1989, Stewart2007, Thiel1992, VanVoorhis2015, &
      26             :       VandeVondele2003, VandeVondele2005a, VandeVondele2005b, VandeVondele2006, Weber2008, &
      27             :       Yin2017, Pracht2019, Caldeweyher2019, Caldeweyher2020
      28             :    USE cp_output_handling, ONLY: add_last_numeric, &
      29             :                                  cp_print_key_section_create, &
      30             :                                  debug_print_level, &
      31             :                                  high_print_level, &
      32             :                                  low_print_level, &
      33             :                                  medium_print_level, &
      34             :                                  silent_print_level
      35             :    USE cp_spline_utils, ONLY: pw_interp, &
      36             :                               spline3_nopbc_interp, &
      37             :                               spline3_pbc_interp
      38             :    USE cp_units, ONLY: cp_unit_to_cp2k
      39             :    USE input_constants, ONLY: &
      40             :       atomic_guess, becke_cutoff_element, becke_cutoff_global, bqb_opt_exhaustive, &
      41             :       bqb_opt_normal, bqb_opt_off, bqb_opt_patient, bqb_opt_quick, broyden_type_1, &
      42             :       broyden_type_1_explicit, broyden_type_1_explicit_ls, broyden_type_1_ls, broyden_type_2, &
      43             :       broyden_type_2_explicit, broyden_type_2_explicit_ls, broyden_type_2_ls, casci_canonical, &
      44             :       cdft_alpha_constraint, cdft_beta_constraint, cdft_charge_constraint, &
      45             :       cdft_magnetization_constraint, cholesky_dbcsr, cholesky_inverse, cholesky_off, &
      46             :       cholesky_reduce, cholesky_restore, core_guess, diag_block_davidson, diag_block_krylov, &
      47             :       diag_filter_matrix, diag_ot, diag_standard, dmft_model, do_admm_aux_exch_func_bee, &
      48             :       do_admm_aux_exch_func_bee_libxc, do_admm_aux_exch_func_default, &
      49             :       do_admm_aux_exch_func_default_libxc, do_admm_aux_exch_func_none, &
      50             :       do_admm_aux_exch_func_opt, do_admm_aux_exch_func_opt_libxc, do_admm_aux_exch_func_pbex, &
      51             :       do_admm_aux_exch_func_pbex_libxc, do_admm_aux_exch_func_sx_libxc, &
      52             :       do_admm_basis_projection, do_admm_blocked_projection, do_admm_blocking_purify_full, &
      53             :       do_admm_charge_constrained_projection, do_admm_exch_scaling_merlot, &
      54             :       do_admm_exch_scaling_none, do_admm_purify_cauchy, do_admm_purify_cauchy_subspace, &
      55             :       do_admm_purify_mcweeny, do_admm_purify_mo_diag, do_admm_purify_mo_no_diag, &
      56             :       do_admm_purify_none, do_admm_purify_none_dm, do_arnoldi, do_bch, do_cn, &
      57             :       do_ddapc_constraint, do_ddapc_restraint, do_em, do_etrs, do_full_density, do_gapw_gcs, &
      58             :       do_gapw_gct, do_gapw_log, do_iaoloc_energy, do_iaoloc_enone, do_iaoloc_l1, do_iaoloc_occ, &
      59             :       do_iaoloc_pm2, do_iaoloc_pm4, do_lri_inv, do_lri_inv_auto, do_lri_opt_all, &
      60             :       do_lri_opt_coeff, do_lri_opt_exps, do_lri_pseudoinv_diag, do_lri_pseudoinv_svd, &
      61             :       do_method_am1, do_method_dftb, do_method_gapw, do_method_gapw_xc, do_method_gpw, &
      62             :       do_method_lrigpw, do_method_mndo, do_method_mndod, do_method_ofgpw, do_method_pdg, &
      63             :       do_method_pm3, do_method_pm6, do_method_pm6fm, do_method_pnnl, do_method_rigpw, &
      64             :       do_method_rm1, do_method_xtb, do_pade, do_potential_coulomb, do_potential_id, &
      65             :       do_potential_short, do_potential_truncated, do_ppl_analytic, do_ppl_grid, &
      66             :       do_pwgrid_ns_fullspace, do_pwgrid_ns_halfspace, do_pwgrid_spherical, do_s2_constraint, &
      67             :       do_s2_restraint, do_se_is_kdso, do_se_is_kdso_d, do_se_is_slater, do_se_lr_ewald, &
      68             :       do_se_lr_ewald_gks, do_se_lr_ewald_r3, do_se_lr_none, do_spin_density, do_taylor, &
      69             :       ehrenfest, embed_diff, embed_fa, embed_grid_angstrom, embed_grid_bohr, embed_level_shift, &
      70             :       embed_none, embed_quasi_newton, embed_resp, embed_steep_desc, eri_method_full_gpw, &
      71             :       eri_method_gpw_ht, eri_operator_trunc, eri_operator_coulomb, eri_operator_erf, eri_operator_erfc, &
      72             :       eri_operator_gaussian, eri_operator_yukawa, gapw_1c_large, gapw_1c_medium, gapw_1c_orb, &
      73             :       gapw_1c_small, gapw_1c_very_large, gaussian, general_roks, gto_cartesian, gto_spherical, &
      74             :       hf_model, high_spin_roks, history_guess, jacobian_fd1, jacobian_fd1_backward, &
      75             :       jacobian_fd1_central, jacobian_fd2, jacobian_fd2_backward, kg_color_dsatur, &
      76             :       kg_color_greedy, kg_tnadd_atomic, kg_tnadd_embed, kg_tnadd_embed_ri, kg_tnadd_none, &
      77             :       ls_2pnt, ls_3pnt, ls_gold, ls_none, manual_selection, mao_basis_ext, mao_basis_orb, &
      78             :       mao_basis_prim, mao_projection, mopac_guess, no_excitations, no_guess, no_solver, &
      79             :       numerical, oe_gllb, oe_lb, oe_none, oe_saop, oe_sic, orb_dx2, orb_dxy, orb_dy2, orb_dyz, &
      80             :       orb_dz2, orb_dzx, orb_px, orb_py, orb_pz, orb_s, ot_algo_irac, ot_algo_taylor_or_diag, &
      81             :       ot_chol_irac, ot_lwdn_irac, ot_mini_broyden, ot_mini_cg, ot_mini_diis, ot_mini_sd, &
      82             :       ot_poly_irac, ot_precond_full_all, ot_precond_full_kinetic, ot_precond_full_single, &
      83             :       ot_precond_full_single_inverse, ot_precond_none, ot_precond_s_inverse, &
      84             :       ot_precond_solver_default, ot_precond_solver_direct, ot_precond_solver_inv_chol, &
      85             :       ot_precond_solver_update, outer_scf_basis_center_opt, outer_scf_becke_constraint, &
      86             :       outer_scf_cdft_constraint, outer_scf_ddapc_constraint, outer_scf_hirshfeld_constraint, &
      87             :       outer_scf_none, outer_scf_optimizer_bisect, outer_scf_optimizer_broyden, &
      88             :       outer_scf_optimizer_diis, outer_scf_optimizer_newton, outer_scf_optimizer_newton_ls, &
      89             :       outer_scf_optimizer_none, outer_scf_optimizer_sd, outer_scf_optimizer_secant, &
      90             :       outer_scf_s2_constraint, plus_u_lowdin, plus_u_mulliken, plus_u_mulliken_charges, &
      91             :       qiskit_solver, radius_covalent, radius_default, radius_single, radius_user, radius_vdw, &
      92             :       random_guess, real_time_propagation, ref_charge_atomic, ref_charge_mulliken, rel_dkh, &
      93             :       rel_none, rel_pot_erfc, rel_pot_full, rel_sczora_mp, rel_trans_atom, rel_trans_full, &
      94             :       rel_trans_molecule, rel_zora, rel_zora_full, rel_zora_mp, restart_guess, rsdft_model, &
      95             :       sccs_andreussi, sccs_derivative_cd3, sccs_derivative_cd5, sccs_derivative_cd7, &
      96             :       sccs_derivative_fft, sccs_fattebert_gygi, shape_function_density, shape_function_gaussian, &
      97             :       sic_ad, sic_eo, sic_list_all, sic_list_unpaired, sic_mauri_spz, sic_mauri_us, sic_none, &
      98             :       slater, smear_energy_window, smear_fermi_dirac, smear_list, sparse_guess, tddfpt_davidson, &
      99             :       tddfpt_excitations, tddfpt_lanczos, tddfpt_singlet, tddfpt_spin_cons, tddfpt_spin_flip, &
     100             :       tddfpt_triplet, use_mom_ref_coac, use_mom_ref_com, use_mom_ref_user, use_mom_ref_zero, &
     101             :       use_restart_wfn, use_rt_restart, use_scf_wfn, wannier_projection, weight_type_mass, &
     102             :       weight_type_unit, wfi_aspc_nr, wfi_frozen_method_nr, wfi_linear_p_method_nr, &
     103             :       wfi_linear_ps_method_nr, wfi_linear_wf_method_nr, wfi_ps_method_nr, &
     104             :       wfi_use_guess_method_nr, wfi_use_prev_p_method_nr, wfi_use_prev_rho_r_method_nr, &
     105             :       wfi_use_prev_wf_method_nr, wfn_mix_orig_external, wfn_mix_orig_occ, wfn_mix_orig_virtual, &
     106             :       xas_1s_type, xas_2p_type, xas_2s_type, xas_3d_type, xas_3p_type, xas_3s_type, xas_4d_type, &
     107             :       xas_4f_type, xas_4p_type, xas_4s_type, xas_dip_len, xas_dip_vel, xas_dscf, xas_none, &
     108             :       xas_not_excited, xas_tdp_by_index, xas_tdp_by_kind, xas_tp_fh, xas_tp_flex, xas_tp_hh, &
     109             :       xas_tp_xfh, xas_tp_xhh, xes_tp_val, &
     110             :       no_admm_type, admm1_type, admm2_type, admms_type, admmp_type, admmq_type, &
     111             :       e_dens_total_hard_approx, e_dens_total_density, e_dens_soft_density
     112             :    USE input_cp2k_almo, ONLY: create_almo_scf_section
     113             :    USE input_cp2k_distribution, ONLY: create_distribution_section
     114             :    USE input_cp2k_ec, ONLY: create_ec_section
     115             :    USE input_cp2k_exstate, ONLY: create_exstate_section
     116             :    USE input_cp2k_external, ONLY: create_ext_den_section, &
     117             :                                   create_ext_pot_section, &
     118             :                                   create_ext_vxc_section
     119             :    USE input_cp2k_field, ONLY: create_efield_section, &
     120             :                                create_per_efield_section
     121             :    USE input_cp2k_kpoints, ONLY: create_kpoint_set_section, &
     122             :                                  create_kpoints_section
     123             :    USE input_cp2k_loc, ONLY: create_localize_section, &
     124             :                              print_wanniers
     125             :    USE input_cp2k_ls, ONLY: create_ls_scf_section
     126             :    USE input_cp2k_mm, ONLY: create_dipoles_section, &
     127             :                             create_neighbor_lists_section
     128             :    USE input_cp2k_poisson, ONLY: create_poisson_section
     129             :    USE input_cp2k_projection_rtp, ONLY: create_projection_rtp_section
     130             :    USE input_cp2k_rsgrid, ONLY: create_rsgrid_section
     131             :    USE input_cp2k_tb, ONLY: create_dftb_control_section, &
     132             :                             create_xtb_control_section
     133             :    USE input_cp2k_transport, ONLY: create_transport_section
     134             :    USE input_cp2k_voronoi, ONLY: create_print_voronoi_section
     135             :    USE input_cp2k_scf, ONLY: create_scf_section, &
     136             :                              create_cdft_control_section
     137             :    USE input_cp2k_xc, ONLY: create_xc_fun_section, &
     138             :                             create_xc_section
     139             :    USE input_keyword_types, ONLY: keyword_create, &
     140             :                                   keyword_release, &
     141             :                                   keyword_type
     142             :    USE input_section_types, ONLY: section_add_keyword, &
     143             :                                   section_add_subsection, &
     144             :                                   section_create, &
     145             :                                   section_release, &
     146             :                                   section_type
     147             :    USE input_val_types, ONLY: char_t, &
     148             :                               integer_t, &
     149             :                               lchar_t, &
     150             :                               logical_t, &
     151             :                               real_t
     152             :    USE kinds, ONLY: dp
     153             :    USE pw_grids, ONLY: do_pw_grid_blocked_false, &
     154             :                        do_pw_grid_blocked_free, &
     155             :                        do_pw_grid_blocked_true
     156             :    USE pw_spline_utils, ONLY: no_precond, &
     157             :                               precond_spl3_1, &
     158             :                               precond_spl3_2, &
     159             :                               precond_spl3_3, &
     160             :                               precond_spl3_aint, &
     161             :                               precond_spl3_aint2
     162             :    USE qs_density_mixing_types, ONLY: create_mixing_section
     163             :    USE qs_fb_input, ONLY: create_filtermatrix_section
     164             :    USE qs_mom_types, ONLY: create_mom_section
     165             :    USE string_utilities, ONLY: newline, &
     166             :                                s2a
     167             : #include "./base/base_uses.f90"
     168             : 
     169             :    IMPLICIT NONE
     170             :    PRIVATE
     171             : 
     172             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_print_dft'
     173             : 
     174             :    PUBLIC :: create_print_dft_section, create_pdos_section
     175             : 
     176             : CONTAINS
     177             : 
     178             : ! **************************************************************************************************
     179             : !> \brief Create the print dft section
     180             : !> \param section the section to create
     181             : !> \author teo
     182             : ! **************************************************************************************************
     183        8546 :    SUBROUTINE create_print_dft_section(section)
     184             :       TYPE(section_type), POINTER                        :: section
     185             : 
     186             :       TYPE(keyword_type), POINTER                        :: keyword
     187             :       TYPE(section_type), POINTER                        :: print_key, sub_print_key, subsection
     188             : 
     189        8546 :       CPASSERT(.NOT. ASSOCIATED(section))
     190             :       CALL section_create(section, __LOCATION__, name="PRINT", &
     191             :                           description="Section of possible print options in DFT code.", &
     192        8546 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
     193             : 
     194        8546 :       NULLIFY (print_key, keyword, subsection)
     195             : 
     196             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_BANNER", &
     197             :                                        description="Controls the printing of the banner of the MM program", &
     198        8546 :                                        print_level=silent_print_level, filename="__STD_OUT__")
     199        8546 :       CALL section_add_subsection(section, print_key)
     200        8546 :       CALL section_release(print_key)
     201             : 
     202             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "BASIS_SET_FILE", &
     203             :                                        description="Controls the printing of a file with all basis sets used.", &
     204        8546 :                                        print_level=high_print_level, filename="LOCAL_BASIS_SETS")
     205        8546 :       CALL section_add_subsection(section, print_key)
     206        8546 :       CALL section_release(print_key)
     207             : 
     208             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "KINETIC_ENERGY", &
     209             :                                        description="Controls the printing of the kinetic energy", &
     210        8546 :                                        print_level=high_print_level, filename="__STD_OUT__")
     211        8546 :       CALL section_add_subsection(section, print_key)
     212        8546 :       CALL section_release(print_key)
     213             : 
     214             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "DERIVATIVES", &
     215             :                                        description="Print all derivatives after the DFT calculation", &
     216        8546 :                                        print_level=high_print_level, filename="__STD_OUT__")
     217             :       CALL keyword_create(keyword, __LOCATION__, &
     218             :                           name="ndigits", &
     219             :                           description="Specify the number of digits used to print derivatives", &
     220        8546 :                           default_i_val=6)
     221        8546 :       CALL section_add_keyword(print_key, keyword)
     222        8546 :       CALL keyword_release(keyword)
     223             : 
     224        8546 :       CALL section_add_subsection(section, print_key)
     225        8546 :       CALL section_release(print_key)
     226             : 
     227             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="neighbor_lists", &
     228             :                                        description="Controls the printing of the neighbor lists", &
     229        8546 :                                        print_level=debug_print_level, filename="", unit_str="angstrom")
     230             :       CALL keyword_create(keyword, __LOCATION__, &
     231             :                           name="sab_orb", &
     232             :                           description="Activates the printing of the orbital "// &
     233             :                           "orbital neighbor lists, "// &
     234             :                           "i.e. the overlap neighbor lists", &
     235             :                           default_l_val=.FALSE., &
     236        8546 :                           lone_keyword_l_val=.TRUE.)
     237        8546 :       CALL section_add_keyword(print_key, keyword)
     238        8546 :       CALL keyword_release(keyword)
     239             : 
     240             :       CALL keyword_create(keyword, __LOCATION__, &
     241             :                           name="sab_aux_fit", &
     242             :                           description="Activates the printing of the orbital "// &
     243             :                           "orbital neighbor lists wavefunction fitting basis, "// &
     244             :                           "i.e. the overlap neighbor lists", &
     245             :                           default_l_val=.FALSE., &
     246        8546 :                           lone_keyword_l_val=.TRUE.)
     247        8546 :       CALL section_add_keyword(print_key, keyword)
     248        8546 :       CALL keyword_release(keyword)
     249             : 
     250             :       CALL keyword_create(keyword, __LOCATION__, &
     251             :                           name="sab_aux_fit_vs_orb", &
     252             :                           description="Activates the printing of the orbital "// &
     253             :                           "orbital mixed neighbor lists of wavefunction fitting basis, "// &
     254             :                           "and the orbital basis, i.e. the overlap neighbor lists", &
     255             :                           default_l_val=.FALSE., &
     256        8546 :                           lone_keyword_l_val=.TRUE.)
     257        8546 :       CALL section_add_keyword(print_key, keyword)
     258        8546 :       CALL keyword_release(keyword)
     259             : 
     260             :       CALL keyword_create(keyword, __LOCATION__, &
     261             :                           name="sab_scp", &
     262             :                           description="Activates the printing of the vdW SCP "// &
     263             :                           "neighbor lists ", &
     264             :                           default_l_val=.FALSE., &
     265        8546 :                           lone_keyword_l_val=.TRUE.)
     266        8546 :       CALL section_add_keyword(print_key, keyword)
     267        8546 :       CALL keyword_release(keyword)
     268             : 
     269             :       CALL keyword_create(keyword, __LOCATION__, &
     270             :                           name="sab_vdw", &
     271             :                           description="Activates the printing of the vdW "// &
     272             :                           "neighbor lists (from DFT, DFTB, SE), "// &
     273             :                           "i.e. the dispersion neighbor lists", &
     274             :                           default_l_val=.FALSE., &
     275        8546 :                           lone_keyword_l_val=.TRUE.)
     276        8546 :       CALL section_add_keyword(print_key, keyword)
     277        8546 :       CALL keyword_release(keyword)
     278             : 
     279             :       CALL keyword_create(keyword, __LOCATION__, &
     280             :                           name="sab_cn", &
     281             :                           description="Activates the printing of the "// &
     282             :                           "neighbor lists used for coordination numbers in vdW DFT-D3", &
     283             :                           default_l_val=.FALSE., &
     284        8546 :                           lone_keyword_l_val=.TRUE.)
     285        8546 :       CALL section_add_keyword(print_key, keyword)
     286        8546 :       CALL keyword_release(keyword)
     287             : 
     288             :       CALL keyword_create(keyword, __LOCATION__, &
     289             :                           name="sac_ae", &
     290             :                           description="Activates the printing of the orbital "// &
     291             :                           "nuclear attraction neighbor lists (erfc potential)", &
     292             :                           default_l_val=.FALSE., &
     293        8546 :                           lone_keyword_l_val=.TRUE.)
     294        8546 :       CALL section_add_keyword(print_key, keyword)
     295        8546 :       CALL keyword_release(keyword)
     296             : 
     297             :       CALL keyword_create(keyword, __LOCATION__, &
     298             :                           name="sac_ppl", &
     299             :                           description="Activates the printing of the orbital "// &
     300             :                           "GTH-PPL neighbor lists (local part of the "// &
     301             :                           "Goedecker-Teter-Hutter pseudo potentials)", &
     302             :                           default_l_val=.FALSE., &
     303        8546 :                           lone_keyword_l_val=.TRUE.)
     304        8546 :       CALL section_add_keyword(print_key, keyword)
     305        8546 :       CALL keyword_release(keyword)
     306             : 
     307             :       CALL keyword_create(keyword, __LOCATION__, &
     308             :                           name="sap_ppnl", &
     309             :                           description="Activates the printing of the orbital "// &
     310             :                           "GTH-PPNL neighbor lists (non-local part of the "// &
     311             :                           "Goedecker-Teter-Hutter pseudo potentials)", &
     312             :                           default_l_val=.FALSE., &
     313        8546 :                           lone_keyword_l_val=.TRUE.)
     314        8546 :       CALL section_add_keyword(print_key, keyword)
     315        8546 :       CALL keyword_release(keyword)
     316             : 
     317             :       CALL keyword_create(keyword, __LOCATION__, &
     318             :                           name="sap_oce", &
     319             :                           description="Activates the printing of the orbital "// &
     320             :                           "PAW-projector neighbor lists (only GAPW)", &
     321             :                           default_l_val=.FALSE., &
     322        8546 :                           lone_keyword_l_val=.TRUE.)
     323        8546 :       CALL section_add_keyword(print_key, keyword)
     324        8546 :       CALL keyword_release(keyword)
     325             : 
     326             :       CALL keyword_create(keyword, __LOCATION__, &
     327             :                           name="sab_se", &
     328             :                           description="Activates the printing of the two-center "// &
     329             :                           "neighbor lists for Coulomb type interactions in NDDO ", &
     330             :                           default_l_val=.FALSE., &
     331        8546 :                           lone_keyword_l_val=.TRUE.)
     332        8546 :       CALL section_add_keyword(print_key, keyword)
     333        8546 :       CALL keyword_release(keyword)
     334             : 
     335             :       CALL keyword_create(keyword, __LOCATION__, &
     336             :                           name="sab_lrc", &
     337             :                           description="Activates the printing of the long-range SE correction "// &
     338             :                           "neighbor lists (only when doing long-range SE with integral scheme KDSO and KDSO-d)", &
     339        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     340        8546 :       CALL section_add_keyword(print_key, keyword)
     341        8546 :       CALL keyword_release(keyword)
     342             : 
     343             :       CALL keyword_create(keyword, __LOCATION__, &
     344             :                           name="sab_tbe", &
     345             :                           description="Activates the printing of the DFTB Ewald "// &
     346             :                           "neighbor lists ", &
     347             :                           default_l_val=.FALSE., &
     348        8546 :                           lone_keyword_l_val=.TRUE.)
     349        8546 :       CALL section_add_keyword(print_key, keyword)
     350        8546 :       CALL keyword_release(keyword)
     351             : 
     352             :       CALL keyword_create(keyword, __LOCATION__, &
     353             :                           name="sab_xtbe", &
     354             :                           description="Activates the printing of the xTB sr-Coulomb "// &
     355             :                           "neighbor lists ", &
     356             :                           default_l_val=.FALSE., &
     357        8546 :                           lone_keyword_l_val=.TRUE.)
     358        8546 :       CALL section_add_keyword(print_key, keyword)
     359        8546 :       CALL keyword_release(keyword)
     360             : 
     361             :       CALL keyword_create(keyword, __LOCATION__, &
     362             :                           name="sab_core", &
     363             :                           description="Activates the printing of core interaction "// &
     364             :                           "neighbor lists ", &
     365             :                           default_l_val=.FALSE., &
     366        8546 :                           lone_keyword_l_val=.TRUE.)
     367        8546 :       CALL section_add_keyword(print_key, keyword)
     368        8546 :       CALL keyword_release(keyword)
     369             : 
     370             :       CALL keyword_create(keyword, __LOCATION__, &
     371             :                           name="sab_xb", &
     372             :                           description="Activates the printing of XB interaction from (xTB) "// &
     373             :                           "neighbor lists ", &
     374             :                           default_l_val=.FALSE., &
     375        8546 :                           lone_keyword_l_val=.TRUE.)
     376        8546 :       CALL section_add_keyword(print_key, keyword)
     377        8546 :       CALL keyword_release(keyword)
     378             : 
     379             :       CALL keyword_create(keyword, __LOCATION__, &
     380             :                           name="sab_xtb_nonbond", &
     381             :                           description="Activates the printing of nonbonded interaction from (xTB) "// &
     382             :                           "neighbor lists ", &
     383             :                           default_l_val=.FALSE., &
     384        8546 :                           lone_keyword_l_val=.TRUE.)
     385        8546 :       CALL section_add_keyword(print_key, keyword)
     386        8546 :       CALL keyword_release(keyword)
     387             : 
     388             :       CALL keyword_create(keyword, __LOCATION__, &
     389             :                           name="soo_list", &
     390             :                           description="Activates the printing of RI orbital-orbital "// &
     391             :                           "neighbor lists ", &
     392             :                           default_l_val=.FALSE., &
     393        8546 :                           lone_keyword_l_val=.TRUE.)
     394        8546 :       CALL section_add_keyword(print_key, keyword)
     395        8546 :       CALL keyword_release(keyword)
     396             : 
     397             :       CALL keyword_create(keyword, __LOCATION__, &
     398             :                           name="sip_list", &
     399             :                           description="Activates the printing of RI basis-projector interaction "// &
     400             :                           "neighbor lists ", &
     401             :                           default_l_val=.FALSE., &
     402        8546 :                           lone_keyword_l_val=.TRUE.)
     403        8546 :       CALL section_add_keyword(print_key, keyword)
     404        8546 :       CALL keyword_release(keyword)
     405             : 
     406        8546 :       CALL section_add_subsection(section, print_key)
     407        8546 :       CALL section_release(print_key)
     408             : 
     409             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "SUBCELL", &
     410             :                                        description="Activates the printing of the subcells used for the "// &
     411             :                                        "generation of neighbor lists.", unit_str="angstrom", &
     412        8546 :                                        print_level=high_print_level, filename="__STD_OUT__")
     413        8546 :       CALL section_add_subsection(section, print_key)
     414        8546 :       CALL section_release(print_key)
     415             : 
     416             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "AO_MATRICES", &
     417             :                                        description="Controls the printing of the ao (i.e. contracted gaussian) matrices (debug).", &
     418        8546 :                                        print_level=debug_print_level, filename="__STD_OUT__")
     419             :       CALL keyword_create(keyword, __LOCATION__, name="OMIT_HEADERS", &
     420             :                           description="Print only the matrix data, not the row and column headers", &
     421        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     422        8546 :       CALL section_add_keyword(print_key, keyword)
     423        8546 :       CALL keyword_release(keyword)
     424             :       CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
     425             :                           description="Specify the number of digits used to print the AO matrices", &
     426        8546 :                           default_i_val=6)
     427        8546 :       CALL section_add_keyword(print_key, keyword)
     428        8546 :       CALL keyword_release(keyword)
     429             :       CALL keyword_create(keyword, __LOCATION__, name="CORE_HAMILTONIAN", &
     430             :                           description="If the printkey is activated controls the printing of the hamiltonian matrix", &
     431        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     432        8546 :       CALL section_add_keyword(print_key, keyword)
     433        8546 :       CALL keyword_release(keyword)
     434             :       CALL keyword_create(keyword, __LOCATION__, name="DENSITY", &
     435             :                           description="If the printkey is activated controls the printing of the density (P) matrix", &
     436        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     437        8546 :       CALL section_add_keyword(print_key, keyword)
     438        8546 :       CALL keyword_release(keyword)
     439             : 
     440             :       CALL keyword_create(keyword, __LOCATION__, name="KINETIC_ENERGY", &
     441             :                           description="If the printkey is activated controls the printing of the kinetic energy matrix", &
     442        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     443        8546 :       CALL section_add_keyword(print_key, keyword)
     444        8546 :       CALL keyword_release(keyword)
     445             :       CALL keyword_create(keyword, __LOCATION__, name="KOHN_SHAM_MATRIX", &
     446             :                           description="If the printkey is activated controls the printing of the kohn-sham matrix", &
     447        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     448        8546 :       CALL section_add_keyword(print_key, keyword)
     449        8546 :       CALL keyword_release(keyword)
     450             :       CALL keyword_create( &
     451             :          keyword, __LOCATION__, name="MATRIX_VXC", &
     452             :          description="If the printkey is activated compute and print the matrix of the exchange and correlation potential. "// &
     453             :          "Only the GGA part for GPW is printed", &
     454        8546 :          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     455        8546 :       CALL section_add_keyword(print_key, keyword)
     456        8546 :       CALL keyword_release(keyword)
     457             :       CALL keyword_create(keyword, __LOCATION__, name="ORTHO", &
     458             :                           description="If the printkey is activated controls the printing of the orthogonalization matrix", &
     459        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     460        8546 :       CALL section_add_keyword(print_key, keyword)
     461        8546 :       CALL keyword_release(keyword)
     462             :       CALL keyword_create(keyword, __LOCATION__, name="OVERLAP", &
     463             :                           description="If the printkey is activated controls the printing of the overlap matrix", &
     464        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     465        8546 :       CALL section_add_keyword(print_key, keyword)
     466        8546 :       CALL keyword_release(keyword)
     467             :       CALL keyword_create(keyword, __LOCATION__, name="COMMUTATOR_HR", &
     468             :                           description="Controls the printing of the [H,r] commutator matrix", &
     469        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     470        8546 :       CALL section_add_keyword(print_key, keyword)
     471        8546 :       CALL keyword_release(keyword)
     472             : 
     473             :       CALL keyword_create(keyword, __LOCATION__, name="FERMI_CONTACT", &
     474             :                           description="If the printkey is activated controls the printing of the Fermi contact matrix", &
     475        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     476        8546 :       CALL section_add_keyword(print_key, keyword)
     477        8546 :       CALL keyword_release(keyword)
     478             :       CALL keyword_create( &
     479             :          keyword, __LOCATION__, name="PSO", &
     480             :          description="If the printkey is activated controls the printing of the paramagnetic spin-orbit matrices", &
     481        8546 :          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     482        8546 :       CALL section_add_keyword(print_key, keyword)
     483        8546 :       CALL keyword_release(keyword)
     484             :       CALL keyword_create( &
     485             :          keyword, __LOCATION__, name="EFG", &
     486             :          description="If the printkey is activated controls the printing of the electric field gradient matrices", &
     487        8546 :          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     488        8546 :       CALL section_add_keyword(print_key, keyword)
     489        8546 :       CALL keyword_release(keyword)
     490             :       CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_ENERGY", &
     491             :                           description="If the printkey is activated controls the printing of the potential energy matrix", &
     492        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     493        8546 :       CALL section_add_keyword(print_key, keyword)
     494        8546 :       CALL keyword_release(keyword)
     495             :       CALL keyword_create(keyword, __LOCATION__, name="OCE_HARD", &
     496             :                           description="If the printkey is activated controls the printing of the OCE HARD matrix", &
     497        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     498        8546 :       CALL section_add_keyword(print_key, keyword)
     499        8546 :       CALL keyword_release(keyword)
     500             :       CALL keyword_create(keyword, __LOCATION__, name="OCE_SOFT", &
     501             :                           description="If the printkey is activated controls the printing of the OCE SOFT matrix", &
     502        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     503        8546 :       CALL section_add_keyword(print_key, keyword)
     504        8546 :       CALL keyword_release(keyword)
     505             :       CALL keyword_create(keyword, __LOCATION__, name="W_MATRIX", &
     506             :                           description="If the printkey is activated controls the printing of the w matrix", &
     507        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     508        8546 :       CALL section_add_keyword(print_key, keyword)
     509        8546 :       CALL keyword_release(keyword)
     510             :       CALL keyword_create(keyword, __LOCATION__, name="W_MATRIX_AUX_FIT", &
     511             :                           description="If the printkey is activated controls the printing of the w matrix", &
     512        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     513        8546 :       CALL section_add_keyword(print_key, keyword)
     514        8546 :       CALL keyword_release(keyword)
     515             :       CALL keyword_create(keyword, __LOCATION__, name="DERIVATIVES", &
     516             :                           description="If the printkey is activated controls the printing "// &
     517             :                           "of derivatives (for the matrixes that support this)", &
     518        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     519        8546 :       CALL section_add_keyword(print_key, keyword)
     520        8546 :       CALL keyword_release(keyword)
     521        8546 :       CALL section_add_subsection(section, print_key)
     522        8546 :       CALL section_release(print_key)
     523             : 
     524             :       CALL cp_print_key_section_create( &
     525             :          print_key, __LOCATION__, "MO", &
     526             :          description="Controls the printing of the molecular orbital (MO) information. The requested MO information "// &
     527             :          "is printed for all occupied MOs by default. Use the MO_INDEX_RANGE keyword to restrict the number "// &
     528             :          "of the MOs or to print the MO information for unoccupied MOs. With diagonalization, additional MOs "// &
     529             :          "have to be made available for printout using the ADDED_MOS keyword in the SCF section. With OT, "// &
     530             :          "it is sufficient to specify the desired MO_INDEX_RANGE. The OT eigensolver can be controlled with "// &
     531             :          "the EPS_LUMO and MAX_ITER_LUMO keywords in the SCF section.", &
     532        8546 :          print_level=high_print_level, filename="__STD_OUT__")
     533             :       CALL keyword_create(keyword, __LOCATION__, name="CARTESIAN", &
     534             :                           description="Print the MOs in the Cartesian basis instead of the default spherical basis.", &
     535        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     536        8546 :       CALL section_add_keyword(print_key, keyword)
     537        8546 :       CALL keyword_release(keyword)
     538             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGIES", &
     539             :                           variants=s2a("EIGENVALUES", "EIGVALS"), &
     540             :                           description="Print the MO energies (eigenvalues).", &
     541        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     542        8546 :       CALL section_add_keyword(print_key, keyword)
     543        8546 :       CALL keyword_release(keyword)
     544             :       CALL keyword_create(keyword, __LOCATION__, name="COEFFICIENTS", &
     545             :                           variants=s2a("EIGENVECTORS", "EIGVECS"), &
     546             :                           description="Print the MO coefficients (eigenvectors).", &
     547        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     548        8546 :       CALL section_add_keyword(print_key, keyword)
     549        8546 :       CALL keyword_release(keyword)
     550             :       CALL keyword_create(keyword, __LOCATION__, name="OCCUPATION_NUMBERS", &
     551             :                           variants=s2a("OCCNUMS"), &
     552             :                           description="Print the MO occupation numbers.", &
     553        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     554        8546 :       CALL section_add_keyword(print_key, keyword)
     555        8546 :       CALL keyword_release(keyword)
     556             :       CALL keyword_create(keyword, __LOCATION__, name="OCCUPATION_NUMBERS_STATS", &
     557             :                           variants=s2a("OCCNUMSTATS"), &
     558             :                           description="Print some stats (max number of occupied MOs, etc.) of the MO occupation numbers."// &
     559             :                           " First logical toggles stats printing, first real is the occupied threshold.", &
     560             :                           type_of_var=char_t, n_var=-1, &
     561             :                           default_c_vals=[".FALSE.", "1.0E-6 "], &
     562             :                           lone_keyword_c_vals=[".TRUE."], &
     563       34184 :                           usage="OCCUPATION_NUMBERS_STATS {Logical} [{Real}]")
     564        8546 :       CALL section_add_keyword(print_key, keyword)
     565        8546 :       CALL keyword_release(keyword)
     566             :       CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
     567             :                           description="Specify the number of digits used to print the MO information.", &
     568        8546 :                           default_i_val=6)
     569        8546 :       CALL section_add_keyword(print_key, keyword)
     570        8546 :       CALL keyword_release(keyword)
     571             :       CALL keyword_create(keyword, __LOCATION__, &
     572             :                           name="MO_INDEX_RANGE", &
     573             :                           variants=s2a("MO_RANGE", "RANGE"), &
     574             :                           description="Print only the requested subset of MOs. The indices of the first and "// &
     575             :                           "the last MO have to be specified to define the range.", &
     576             :                           repeats=.FALSE., &
     577             :                           n_var=2, &
     578             :                           type_of_var=integer_t, &
     579             :                           default_i_vals=(/0, 0/), &
     580        8546 :                           usage="MO_INDEX_RANGE 10 15")
     581        8546 :       CALL section_add_keyword(print_key, keyword)
     582        8546 :       CALL keyword_release(keyword)
     583        8546 :       CALL section_add_subsection(section, print_key)
     584        8546 :       CALL section_release(print_key)
     585             : 
     586             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "MO_MOLDEN", &
     587             :                                        description="Write the molecular orbitals in Molden file format, for visualisation.", &
     588        8546 :                                        print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MOS")
     589             :       CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
     590             :                           description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
     591             :                           usage="NDIGITS {int}", &
     592        8546 :                           default_i_val=3)
     593        8546 :       CALL section_add_keyword(print_key, keyword)
     594        8546 :       CALL keyword_release(keyword)
     595             :       CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
     596             :                           description="Representation of Gaussian-type orbitals", &
     597             :                           default_i_val=gto_spherical, &
     598             :                           enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
     599             :                           enum_desc=s2a( &
     600             :                           "Cartesian Gaussian orbitals. Use with caution", &
     601             :                           "Spherical Gaussian orbitals. Incompatible with VMD"), &
     602        8546 :                           enum_i_vals=(/gto_cartesian, gto_spherical/))
     603        8546 :       CALL section_add_keyword(print_key, keyword)
     604        8546 :       CALL keyword_release(keyword)
     605        8546 :       CALL section_add_subsection(section, print_key)
     606        8546 :       CALL section_release(print_key)
     607             : 
     608        8546 :       CALL create_mo_cubes_section(print_key)
     609        8546 :       CALL section_add_subsection(section, print_key)
     610        8546 :       CALL section_release(print_key)
     611             : 
     612        8546 :       CALL create_stm_section(print_key)
     613        8546 :       CALL section_add_subsection(section, print_key)
     614        8546 :       CALL section_release(print_key)
     615             : 
     616        8546 :       CALL create_wfn_mix_section(subsection)
     617        8546 :       CALL section_add_subsection(section, subsection)
     618        8546 :       CALL section_release(subsection)
     619             : 
     620             :       CALL section_create(subsection, __LOCATION__, name="GAPW", &
     621             :                           description="Controls the printing of some gapw related information (debug).", &
     622        8546 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
     623             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "projectors", &
     624             :                                        description="If the printkey is activated controls if information on"// &
     625             :                                        " the projectors is printed.", &
     626        8546 :                                        print_level=debug_print_level, filename="__STD_OUT__")
     627        8546 :       CALL section_add_subsection(subsection, print_key)
     628        8546 :       CALL section_release(print_key)
     629             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "rho0_information", &
     630             :                                        description="If the printkey is activated controls if information on rho0 is printed.", &
     631        8546 :                                        print_level=debug_print_level, filename="__STD_OUT__", unit_str="angstrom")
     632        8546 :       CALL section_add_subsection(subsection, print_key)
     633        8546 :       CALL section_release(print_key)
     634        8546 :       CALL section_add_subsection(section, subsection)
     635        8546 :       CALL section_release(subsection)
     636             : 
     637             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "dft_control_parameters", &
     638             :                                        description="Controls the printing of dft control parameters.", &
     639        8546 :                                        print_level=medium_print_level, filename="__STD_OUT__")
     640        8546 :       CALL section_add_subsection(section, print_key)
     641        8546 :       CALL section_release(print_key)
     642             : 
     643             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "KPOINTS", &
     644             :                                        description="Controls the printing of kpoint information.", &
     645        8546 :                                        print_level=medium_print_level, filename="__STD_OUT__")
     646        8546 :       CALL section_add_subsection(section, print_key)
     647        8546 :       CALL section_release(print_key)
     648             : 
     649        8546 :       NULLIFY (subsection)
     650        8546 :       CALL create_bandstructure_section(subsection)
     651        8546 :       CALL section_add_subsection(section, subsection)
     652        8546 :       CALL section_release(subsection)
     653             : 
     654             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "OVERLAP_CONDITION", &
     655             :                                        description="Controls the checking and printing of an estimate "// &
     656             :                                        "of the overlap matrix condition number", &
     657        8546 :                                        print_level=debug_print_level, filename="__STD_OUT__")
     658             :       CALL keyword_create(keyword, __LOCATION__, name="1-NORM", &
     659             :                           description="Calculate an estimate of the 1-norm condition number", &
     660        8546 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     661        8546 :       CALL section_add_keyword(print_key, keyword)
     662        8546 :       CALL keyword_release(keyword)
     663             :       CALL keyword_create(keyword, __LOCATION__, name="DIAGONALIZATION", &
     664             :                           description="Calculate the 1- and 2-norm condition numbers using diagonalization", &
     665        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     666        8546 :       CALL section_add_keyword(print_key, keyword)
     667        8546 :       CALL keyword_release(keyword)
     668             :       CALL keyword_create(keyword, __LOCATION__, name="ARNOLDI", &
     669             :                           description="Calculate the 2-norm condition number using the Arnoldi code (may not be reliable)", &
     670        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     671        8546 :       CALL section_add_keyword(print_key, keyword)
     672        8546 :       CALL keyword_release(keyword)
     673        8546 :       CALL section_add_subsection(section, print_key)
     674        8546 :       CALL section_release(print_key)
     675             : 
     676             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="E_DENSITY_CUBE", &
     677             :                                        description="Controls the printing of cube files with "// &
     678             :                                        "the electronic density and, for LSD calculations, the spin density.", &
     679        8546 :                                        print_level=high_print_level, filename="")
     680             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     681             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     682             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     683             :                           " 1 number valid for all components.", &
     684        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     685        8546 :       CALL section_add_keyword(print_key, keyword)
     686        8546 :       CALL keyword_release(keyword)
     687             : 
     688             :       CALL keyword_create(keyword, __LOCATION__, name="DENSITY_INCLUDE", &
     689             :                           description="Which parts of the density to include. In GAPW the electronic density "// &
     690             :                           "is divided into a hard and a soft component, and the default (TOTAL_HARD_APPROX) "// &
     691             :                           "is to approximate the hard density as a spherical gaussian and to print the smooth "// &
     692             :                           "density accurately. This avoids potential artefacts originating from the hard density. "// &
     693             :                           "If the TOTAL_DENSITY keyword is used the hard density will be computed more accurately "// &
     694             :                           "but may introduce non-physical features. The SOFT_DENSITY keyword will lead to only the "// &
     695             :                           "soft density being printed. In GPW these options have no effect and the cube file will "// &
     696             :                           "only contain the valence electron density.", &
     697             :                           usage="DENSITY_INCLUDE TOTAL_HARD_APPROX", &
     698             :                           enum_c_vals=s2a("TOTAL_HARD_APPROX", "TOTAL_DENSITY", "SOFT_DENSITY"), &
     699             :                           enum_desc=s2a("Print (hard+soft) density where the hard components shape is approximated", &
     700             :                                         "Print (hard+soft) density. Only has an effect "// &
     701             :                                         "if PAW atoms are present. NOTE: The total "// &
     702             :                                         "in real space might exhibit unphysical features "// &
     703             :                                         "like spikes due to the finite and thus "// &
     704             :                                         "truncated g vector", &
     705             :                                         "Print only the soft density"), &
     706             :                           enum_i_vals=(/e_dens_total_hard_approx, &
     707             :                                         e_dens_total_density, &
     708             :                                         e_dens_soft_density/), &
     709        8546 :                           default_i_val=e_dens_total_hard_approx)
     710        8546 :       CALL section_add_keyword(print_key, keyword)
     711        8546 :       CALL keyword_release(keyword)
     712             : 
     713             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     714             :                           description="append the cube files when they already exist", &
     715        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     716        8546 :       CALL section_add_keyword(print_key, keyword)
     717        8546 :       CALL keyword_release(keyword)
     718             : 
     719             :       CALL keyword_create(keyword, __LOCATION__, name="XRD_INTERFACE", &
     720             :                           description="It activates the print out of exponents and coefficients for the"// &
     721             :                           " Gaussian expansion of the core densities, based on atom calculations for each kind."// &
     722             :                           " The resulting core dansities are needed to compute the form factors."// &
     723             :                           " If GAPW the local densities are also given in terms of a Gaussian expansion,"// &
     724             :                           " by fitting the difference between local-fhard and local-soft density for each atom."// &
     725             :                           " In this case the keyword SOFT_DENSITY is enabled.", &
     726        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     727        8546 :       CALL section_add_keyword(print_key, keyword)
     728        8546 :       CALL keyword_release(keyword)
     729             : 
     730             :       CALL keyword_create(keyword, __LOCATION__, name="NGAUSS", &
     731             :                           description="Number of Gaussian functions used in the expansion of atomic (core) density", &
     732        8546 :                           usage="NGAUSS 10", n_var=1, default_i_val=12, type_of_var=integer_t)
     733        8546 :       CALL section_add_keyword(print_key, keyword)
     734        8546 :       CALL keyword_release(keyword)
     735             : 
     736        8546 :       CALL section_add_subsection(section, print_key)
     737        8546 :       CALL section_release(print_key)
     738             : 
     739             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "tot_density_cube", &
     740             :                                        description="Controls printing of cube files with "// &
     741             :                                        "the total density (electrons+atomic core). Note that "// &
     742             :                                        "the value of the total density is positive where the "// &
     743             :                                        "electron density dominates and negative where the core is. "// &
     744             :                                        "When GPW is enabled this will simply print the combined density "// &
     745             :                                        "of the valence electrons and charge-balanced core. In GAPW the "// &
     746             :                                        "electronic density (hard+soft plus a correction term) is printed "// &
     747             :                                        "together with the charge-balanced core density to produce a complete "// &
     748             :                                        "representation of the total density.", &
     749        8546 :                                        print_level=high_print_level, filename="")
     750             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     751             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     752             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     753             :                           " 1 number valid for all components.", &
     754        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     755        8546 :       CALL section_add_keyword(print_key, keyword)
     756        8546 :       CALL keyword_release(keyword)
     757             : 
     758             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     759             :                           description="append the cube files when they already exist", &
     760        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     761        8546 :       CALL section_add_keyword(print_key, keyword)
     762        8546 :       CALL keyword_release(keyword)
     763             : 
     764        8546 :       CALL section_add_subsection(section, print_key)
     765        8546 :       CALL section_release(print_key)
     766             : 
     767             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "v_hartree_cube", &
     768             :                                        description="Controls the printing of a cube file with eletrostatic"// &
     769             :                                        " potential generated by the total density (electrons+ions). It is"// &
     770             :                                        " valid only for QS with GPW formalism."// &
     771             :                                        " Note that by convention the potential has opposite sign than the expected physical one.", &
     772        8546 :                                        print_level=high_print_level, filename="")
     773             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     774             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     775             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     776             :                           " 1 number valid for all components.", &
     777        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     778        8546 :       CALL section_add_keyword(print_key, keyword)
     779        8546 :       CALL keyword_release(keyword)
     780             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     781             :                           description="append the cube files when they already exist", &
     782        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     783        8546 :       CALL section_add_keyword(print_key, keyword)
     784        8546 :       CALL keyword_release(keyword)
     785             : 
     786        8546 :       CALL section_add_subsection(section, print_key)
     787        8546 :       CALL section_release(print_key)
     788             : 
     789             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "external_potential_cube", &
     790             :                                        description="Controls the printing of a cube file with external"// &
     791             :                                        " potential from the DFT%EXTERNAL_POTENTIAL section only.", &
     792        8546 :                                        print_level=high_print_level, filename="")
     793             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     794             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     795             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     796             :                           " 1 number valid for all components.", &
     797        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     798        8546 :       CALL section_add_keyword(print_key, keyword)
     799        8546 :       CALL keyword_release(keyword)
     800             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     801             :                           description="append the cube files when they already exist", &
     802        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     803        8546 :       CALL section_add_keyword(print_key, keyword)
     804        8546 :       CALL keyword_release(keyword)
     805             : 
     806        8546 :       CALL section_add_subsection(section, print_key)
     807        8546 :       CALL section_release(print_key)
     808             : 
     809             :       ! Output of BQB volumetric files
     810             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="E_DENSITY_BQB", &
     811             :                                        description="Controls the output of the electron density to the losslessly"// &
     812             :                                        " compressed BQB file format, see [Brehm2018]"// &
     813             :                                        " (via LibBQB see <https://brehm-research.de/bqb>)."// &
     814             :                                        " Currently does not work with changing cell vector (NpT ensemble).", &
     815             :                                        print_level=debug_print_level + 1, filename="", &
     816       17092 :                                        citations=(/Brehm2018/))
     817             : 
     818             :       CALL keyword_create(keyword, __LOCATION__, name="SKIP_FIRST", &
     819             :                           description="Skips the first step of a MD run (avoids duplicate step if restarted).", &
     820        8546 :                           usage="SKIP_FIRST T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     821        8546 :       CALL section_add_keyword(print_key, keyword)
     822        8546 :       CALL keyword_release(keyword)
     823             : 
     824             :       CALL keyword_create(keyword, __LOCATION__, name="STORE_STEP_NUMBER", &
     825             :                           description="Stores the step number and simulation time in the comment line of each BQB"// &
     826             :                           " frame. Switch it off for binary compatibility with original CP2k CUBE files.", &
     827        8546 :                           usage="STORE_STEP_NUMBER F", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     828        8546 :       CALL section_add_keyword(print_key, keyword)
     829        8546 :       CALL keyword_release(keyword)
     830             : 
     831             :       CALL keyword_create(keyword, __LOCATION__, name="CHECK", &
     832             :                           description="Performs an on-the-fly decompression of each compressed BQB frame to check"// &
     833             :                           " whether the volumetric data exactly matches, and aborts the run if not so.", &
     834        8546 :                           usage="CHECK T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     835        8546 :       CALL section_add_keyword(print_key, keyword)
     836        8546 :       CALL keyword_release(keyword)
     837             : 
     838             :       CALL keyword_create(keyword, __LOCATION__, name="OVERWRITE", &
     839             :                           description="Specify this keyword to overwrite the output BQB file if"// &
     840             :                           " it already exists. By default, the data is appended to an existing file.", &
     841        8546 :                           usage="OVERWRITE T", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     842        8546 :       CALL section_add_keyword(print_key, keyword)
     843        8546 :       CALL keyword_release(keyword)
     844             : 
     845             :       CALL keyword_create(keyword, __LOCATION__, name="HISTORY", &
     846             :                           description="Controls how many previous steps are taken into account for extrapolation in"// &
     847             :                           " compression. Use a value of 1 to compress the frames independently.", &
     848        8546 :                           usage="HISTORY 10", n_var=1, default_i_val=10, type_of_var=integer_t)
     849        8546 :       CALL section_add_keyword(print_key, keyword)
     850        8546 :       CALL keyword_release(keyword)
     851             : 
     852             :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETER_KEY", &
     853             :                           description="Allows to supply previously optimized compression parameters via a"// &
     854             :                           " parameter key (alphanumeric character sequence starting with 'at')."// &
     855             :                           " Just leave away the 'at' sign here, because CP2k will otherwise"// &
     856             :                           " assume it is a variable name in the input", &
     857        8546 :                           usage="PARAMETER_KEY <KEY>", n_var=1, default_c_val="", type_of_var=char_t)
     858        8546 :       CALL section_add_keyword(print_key, keyword)
     859        8546 :       CALL keyword_release(keyword)
     860             : 
     861             :       CALL keyword_create(keyword, __LOCATION__, name="OPTIMIZE", &
     862             :                           description="Controls the time spent to optimize the parameters for compression efficiency.", &
     863             :                           usage="OPTIMIZE {OFF,QUICK,NORMAL,PATIENT,EXHAUSTIVE}", repeats=.FALSE., n_var=1, &
     864             :                           default_i_val=bqb_opt_quick, &
     865             :                           enum_c_vals=s2a("OFF", "QUICK", "NORMAL", "PATIENT", "EXHAUSTIVE"), &
     866             :                           enum_desc=s2a("No optimization (use defaults)", "Quick optimization", &
     867             :                                         "Standard optimization", "Precise optimization", "Exhaustive optimization"), &
     868        8546 :                           enum_i_vals=(/bqb_opt_off, bqb_opt_quick, bqb_opt_normal, bqb_opt_patient, bqb_opt_exhaustive/))
     869        8546 :       CALL section_add_keyword(print_key, keyword)
     870        8546 :       CALL keyword_release(keyword)
     871             : 
     872        8546 :       CALL section_add_subsection(section, print_key)
     873        8546 :       CALL section_release(print_key)
     874             : 
     875             :       ! Voronoi Integration via LibVori
     876        8546 :       CALL create_print_voronoi_section(print_key)
     877        8546 :       CALL section_add_subsection(section, print_key)
     878        8546 :       CALL section_release(print_key)
     879             : 
     880             :       ! cube files for data generated by the implicit (generalized) Poisson solver
     881        8546 :       CALL create_implicit_psolver_section(subsection)
     882        8546 :       CALL section_add_subsection(section, subsection)
     883        8546 :       CALL section_release(subsection)
     884             : 
     885             :       ! ZMP adding the print section for  the v_xc cube
     886             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "v_xc_cube", &
     887             :                                        description="Controls the printing of a cube file with xc"// &
     888             :                                        " potential generated by the ZMP method (for the moment). It is"// &
     889             :                                        " valid only for QS with GPW formalism .", &
     890        8546 :                                        print_level=high_print_level, filename="")
     891             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     892             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     893             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     894             :                           " 1 number valid for all components.", &
     895        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     896        8546 :       CALL section_add_keyword(print_key, keyword)
     897        8546 :       CALL keyword_release(keyword)
     898             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     899             :                           description="append the cube files when they already exist", &
     900        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     901        8546 :       CALL section_add_keyword(print_key, keyword)
     902        8546 :       CALL keyword_release(keyword)
     903             : 
     904        8546 :       CALL section_add_subsection(section, print_key)
     905        8546 :       CALL section_release(print_key)
     906             : 
     907             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "efield_cube", &
     908             :                                        description="Controls the printing of cube files with electric"// &
     909             :                                        " field generated by the total density (electrons+ions). It is"// &
     910             :                                        " valid only for QS with GPW formalism.", &
     911        8546 :                                        print_level=high_print_level, filename="")
     912             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     913             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     914             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     915             :                           " 1 number valid for all components.", &
     916        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     917        8546 :       CALL section_add_keyword(print_key, keyword)
     918        8546 :       CALL keyword_release(keyword)
     919             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     920             :                           description="append the cube files when they already exist", &
     921        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     922        8546 :       CALL section_add_keyword(print_key, keyword)
     923        8546 :       CALL keyword_release(keyword)
     924             : 
     925        8546 :       CALL section_add_subsection(section, print_key)
     926        8546 :       CALL section_release(print_key)
     927             : 
     928             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ELF_CUBE", &
     929             :                                        description="Controls printing of cube files with"// &
     930             :                                        " the electron localization function (ELF). Note that"// &
     931             :                                        " the value of ELF is defined between 0 and 1: Pauli kinetic energy density normalized"// &
     932             :                                        " by the kinetic energy density of a uniform el. gas of same density.", &
     933        8546 :                                        print_level=high_print_level, filename="")
     934             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     935             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     936             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     937             :                           " 1 number valid for all components.", &
     938        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     939        8546 :       CALL section_add_keyword(print_key, keyword)
     940        8546 :       CALL keyword_release(keyword)
     941             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     942             :                           description="append the cube files when they already exist", &
     943        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     944        8546 :       CALL section_add_keyword(print_key, keyword)
     945        8546 :       CALL keyword_release(keyword)
     946             : 
     947             :       CALL keyword_create(keyword, __LOCATION__, name="density_cutoff", &
     948             :                           description=" ", &
     949             :                           usage="density_cutoff 0.0001", &
     950             :                           repeats=.FALSE., &
     951             :                           n_var=1, &
     952             :                           type_of_var=real_t, &
     953        8546 :                           default_r_val=1.0e-10_dp)
     954        8546 :       CALL section_add_keyword(print_key, keyword)
     955        8546 :       CALL keyword_release(keyword)
     956             : 
     957        8546 :       CALL section_add_subsection(section, print_key)
     958        8546 :       CALL section_release(print_key)
     959             : 
     960             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "LOCAL_ENERGY_CUBE", &
     961             :                                        description="Controls the printing of cube files with the local"// &
     962             :                                        " energy. It is valid only for QS with GPW/GAPW formalism."// &
     963             :                                        " Meta and hybrid functionals are not possible.", &
     964        8546 :                                        print_level=debug_print_level, filename="")
     965             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     966             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     967             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     968             :                           " 1 number valid for all components.", &
     969        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     970        8546 :       CALL section_add_keyword(print_key, keyword)
     971        8546 :       CALL keyword_release(keyword)
     972             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     973             :                           description="append the cube files when they already exist", &
     974        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     975        8546 :       CALL section_add_keyword(print_key, keyword)
     976        8546 :       CALL keyword_release(keyword)
     977             : 
     978        8546 :       CALL section_add_subsection(section, print_key)
     979        8546 :       CALL section_release(print_key)
     980             : 
     981             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "LOCAL_STRESS_CUBE", &
     982             :                                        description="Controls the printing of cube files with the local"// &
     983             :                                        " stress. It is valid only for QS with GPW/GAPW formalism."// &
     984             :                                        " Meta and hybrid functionals are not possible.", &
     985        8546 :                                        print_level=debug_print_level, filename="")
     986             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
     987             :                           description="The stride (X,Y,Z) used to write the cube file "// &
     988             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
     989             :                           " 1 number valid for all components.", &
     990        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
     991        8546 :       CALL section_add_keyword(print_key, keyword)
     992        8546 :       CALL keyword_release(keyword)
     993             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
     994             :                           description="append the cube files when they already exist", &
     995        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     996        8546 :       CALL section_add_keyword(print_key, keyword)
     997        8546 :       CALL keyword_release(keyword)
     998             : 
     999        8546 :       CALL section_add_subsection(section, print_key)
    1000        8546 :       CALL section_release(print_key)
    1001             : 
    1002        8546 :       CALL create_dos_section(print_key)
    1003        8546 :       CALL section_add_subsection(section, print_key)
    1004        8546 :       CALL section_release(print_key)
    1005             : 
    1006        8546 :       CALL create_pdos_section(print_key)
    1007        8546 :       CALL section_add_subsection(section, print_key)
    1008        8546 :       CALL section_release(print_key)
    1009             : 
    1010        8546 :       CALL create_wannier_section(print_key)
    1011        8546 :       CALL section_add_subsection(section, print_key)
    1012        8546 :       CALL section_release(print_key)
    1013             : 
    1014             :       !Printing of Moments
    1015        8546 :       CALL create_dipoles_section(print_key, "MOMENTS", high_print_level)
    1016             :       CALL keyword_create( &
    1017             :          keyword, __LOCATION__, &
    1018             :          name="MAX_MOMENT", &
    1019             :          description="Maximum moment to be calculated. Values higher than 1 not implemented under periodic boundaries.", &
    1020             :          usage="MAX_MOMENT {integer}", &
    1021             :          repeats=.FALSE., &
    1022             :          n_var=1, &
    1023             :          type_of_var=integer_t, &
    1024        8546 :          default_i_val=1)
    1025        8546 :       CALL section_add_keyword(print_key, keyword)
    1026        8546 :       CALL keyword_release(keyword)
    1027             :       CALL keyword_create(keyword, __LOCATION__, &
    1028             :                           name="MAGNETIC", &
    1029             :                           description="Calculate also magnetic moments, only implemented without periodic boundaries", &
    1030             :                           usage="MAGNETIC yes", &
    1031             :                           repeats=.FALSE., &
    1032             :                           n_var=1, &
    1033             :                           default_l_val=.FALSE., &
    1034        8546 :                           lone_keyword_l_val=.TRUE.)
    1035        8546 :       CALL section_add_keyword(print_key, keyword)
    1036        8546 :       CALL keyword_release(keyword)
    1037             :       CALL keyword_create(keyword, __LOCATION__, &
    1038             :                           name="VEL_REPRS", &
    1039             :                           description="Calculate expectation values of the el. multipole moments in their velocity "// &
    1040             :                           "representation during RTP. Implemented up to el. quadrupole moment.", &
    1041             :                           usage="VEL_REPS yes", &
    1042             :                           repeats=.FALSE., &
    1043             :                           n_var=1, &
    1044             :                           default_l_val=.FALSE., &
    1045        8546 :                           lone_keyword_l_val=.TRUE.)
    1046        8546 :       CALL section_add_keyword(print_key, keyword)
    1047        8546 :       CALL keyword_release(keyword)
    1048             :       CALL keyword_create(keyword, __LOCATION__, &
    1049             :                           name="COM_NL", &
    1050             :                           description="Include non local commutator for velocity representations. "// &
    1051             :                           "Necessary for origin independent results.", &
    1052             :                           usage="COM_NL yes", &
    1053             :                           repeats=.FALSE., &
    1054             :                           n_var=1, &
    1055             :                           default_l_val=.FALSE., &
    1056        8546 :                           lone_keyword_l_val=.TRUE.)
    1057        8546 :       CALL section_add_keyword(print_key, keyword)
    1058        8546 :       CALL keyword_release(keyword)
    1059             :       CALL keyword_create(keyword, __LOCATION__, &
    1060             :                           name="SECOND_REFERENCE_POINT", &
    1061             :                           description="Use second reference point", &
    1062             :                           usage="SECOND_REFERENCE_POINT .TRUE.", &
    1063             :                           repeats=.FALSE., &
    1064             :                           n_var=1, &
    1065             :                           default_l_val=.FALSE., &
    1066        8546 :                           lone_keyword_l_val=.TRUE.)
    1067        8546 :       CALL section_add_keyword(print_key, keyword)
    1068        8546 :       CALL keyword_release(keyword)
    1069             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_2", &
    1070             :                           variants=s2a("REF_2"), &
    1071             :                           description="Define a second reference point for the calculation of the electrostatic moment.", &
    1072             :                           usage="REFERENCE_2 COM", &
    1073             :                           enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
    1074             :                           enum_desc=s2a("Use Center of Mass", &
    1075             :                                         "Use Center of Atomic Charges", &
    1076             :                                         "Use User Defined Point (Keyword:REF_POINT)", &
    1077             :                                         "Use Origin of Coordinate System"), &
    1078             :                           enum_i_vals=(/use_mom_ref_com, &
    1079             :                                         use_mom_ref_coac, &
    1080             :                                         use_mom_ref_user, &
    1081             :                                         use_mom_ref_zero/), &
    1082        8546 :                           default_i_val=use_mom_ref_zero)
    1083        8546 :       CALL section_add_keyword(print_key, keyword)
    1084        8546 :       CALL keyword_release(keyword)
    1085             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT_2", &
    1086             :                           variants=s2a("REF_POINT_2"), &
    1087             :                           description="Fixed second reference point for the calculations of the electrostatic moment.", &
    1088             :                           usage="REFERENCE_POINT_2 x y z", &
    1089             :                           repeats=.FALSE., &
    1090             :                           n_var=3, default_r_vals=(/0._dp, 0._dp, 0._dp/), &
    1091             :                           type_of_var=real_t, &
    1092        8546 :                           unit_str='bohr')
    1093        8546 :       CALL section_add_keyword(print_key, keyword)
    1094        8546 :       CALL keyword_release(keyword)
    1095        8546 :       CALL section_add_subsection(section, print_key)
    1096        8546 :       CALL section_release(print_key)
    1097             : 
    1098             :       ! Mulliken population analysis
    1099             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "MULLIKEN", &
    1100             :                                        description="Controls the printing of the Mulliken (spin) population analysis", &
    1101             :                                        print_level=medium_print_level, filename="__STD_OUT__", &
    1102        8546 :                                        common_iter_levels=1)
    1103             :       CALL keyword_create( &
    1104             :          keyword, __LOCATION__, &
    1105             :          name="PRINT_GOP", &
    1106             :          description="Print the gross orbital populations (GOP) in addition to the gross atomic populations (GAP) "// &
    1107             :          "and net charges", &
    1108             :          usage="PRINT_GOP yes", &
    1109             :          repeats=.FALSE., &
    1110             :          n_var=1, &
    1111             :          default_l_val=.FALSE., &
    1112        8546 :          lone_keyword_l_val=.TRUE.)
    1113        8546 :       CALL section_add_keyword(print_key, keyword)
    1114        8546 :       CALL keyword_release(keyword)
    1115             :       CALL keyword_create( &
    1116             :          keyword, __LOCATION__, &
    1117             :          name="PRINT_ALL", &
    1118             :          description="Print all information including the full net AO and overlap population matrix", &
    1119             :          usage="PRINT_ALL yes", &
    1120             :          repeats=.FALSE., &
    1121             :          n_var=1, &
    1122             :          default_l_val=.FALSE., &
    1123        8546 :          lone_keyword_l_val=.TRUE.)
    1124        8546 :       CALL section_add_keyword(print_key, keyword)
    1125        8546 :       CALL keyword_release(keyword)
    1126        8546 :       CALL section_add_subsection(section, print_key)
    1127        8546 :       CALL section_release(print_key)
    1128             : 
    1129             :       ! Lowdin population analysis (fairly expensive to compute, so only at high)
    1130             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "LOWDIN", &
    1131             :                                        description="Controls the printing of the Lowdin (spin) population analysis", &
    1132             :                                        print_level=high_print_level, filename="__STD_OUT__", &
    1133        8546 :                                        common_iter_levels=1)
    1134             :       CALL keyword_create( &
    1135             :          keyword, __LOCATION__, &
    1136             :          name="PRINT_GOP", &
    1137             :          description="Print the orbital populations in addition to the atomic populations and net charges", &
    1138             :          usage="PRINT_GOP yes", &
    1139             :          repeats=.FALSE., &
    1140             :          n_var=1, &
    1141             :          default_l_val=.FALSE., &
    1142        8546 :          lone_keyword_l_val=.TRUE.)
    1143        8546 :       CALL section_add_keyword(print_key, keyword)
    1144        8546 :       CALL keyword_release(keyword)
    1145             :       CALL keyword_create( &
    1146             :          keyword, __LOCATION__, &
    1147             :          name="PRINT_ALL", &
    1148             :          description="Print all information including the full symmetrically orthogonalised density matrix", &
    1149             :          usage="PRINT_ALL yes", &
    1150             :          repeats=.FALSE., &
    1151             :          n_var=1, &
    1152             :          default_l_val=.FALSE., &
    1153        8546 :          lone_keyword_l_val=.TRUE.)
    1154        8546 :       CALL section_add_keyword(print_key, keyword)
    1155        8546 :       CALL keyword_release(keyword)
    1156        8546 :       CALL section_add_subsection(section, print_key)
    1157        8546 :       CALL section_release(print_key)
    1158             : 
    1159             :       ! Hirshfeld population analysis
    1160             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "HIRSHFELD", &
    1161             :                                        description="Controls the printing of the Hirshfeld (spin) population analysis", &
    1162             :                                        print_level=medium_print_level, filename="__STD_OUT__", &
    1163        8546 :                                        common_iter_levels=1)
    1164             :       CALL keyword_create(keyword, __LOCATION__, name="SELF_CONSISTENT", &
    1165             :                           description="Calculate charges from the Hirscheld-I (self_consistent) method."// &
    1166             :                           " This scales only the full shape function, not the added charge as in the original scheme.", &
    1167             :                           usage="SELF_CONSISTENT yes", repeats=.FALSE., n_var=1, &
    1168        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1169        8546 :       CALL section_add_keyword(print_key, keyword)
    1170        8546 :       CALL keyword_release(keyword)
    1171             :       CALL keyword_create(keyword, __LOCATION__, name="SHAPE_FUNCTION", &
    1172             :                           description="Type of shape function used for Hirshfeld partitioning.", &
    1173             :                           usage="SHAPE_FUNCTION {Gaussian,Density}", repeats=.FALSE., n_var=1, &
    1174             :                           default_i_val=shape_function_gaussian, &
    1175             :                           enum_c_vals=s2a("GAUSSIAN", "DENSITY"), &
    1176             :                           enum_desc=s2a("Single Gaussian with Colvalent radius", &
    1177             :                                         "Atomic density expanded in multiple Gaussians"), &
    1178        8546 :                           enum_i_vals=(/shape_function_gaussian, shape_function_density/))
    1179        8546 :       CALL section_add_keyword(print_key, keyword)
    1180        8546 :       CALL keyword_release(keyword)
    1181             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_CHARGE", &
    1182             :                           description="Charge of atomic partitioning function for Hirshfeld method.", &
    1183             :                           usage="REFERENCE_CHARGE {Atomic,Mulliken}", repeats=.FALSE., n_var=1, &
    1184             :                           default_i_val=ref_charge_atomic, &
    1185             :                           enum_c_vals=s2a("ATOMIC", "MULLIKEN"), &
    1186             :                           enum_desc=s2a("Use atomic core charges", "Calculate Mulliken charges"), &
    1187        8546 :                           enum_i_vals=(/ref_charge_atomic, ref_charge_mulliken/))
    1188        8546 :       CALL section_add_keyword(print_key, keyword)
    1189        8546 :       CALL keyword_release(keyword)
    1190             :       CALL keyword_create(keyword, __LOCATION__, name="USER_RADIUS", &
    1191             :                           description="Use user defined radii to generate Gaussians."// &
    1192             :                           " These radii are defined by the keyword ATOMIC_RADII", &
    1193             :                           usage="USER_RADIUS yes", repeats=.FALSE., n_var=1, &
    1194        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1195        8546 :       CALL section_add_keyword(print_key, keyword)
    1196        8546 :       CALL keyword_release(keyword)
    1197             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMIC_RADII", &
    1198             :                           description="Defines custom radii to setup the spherical Gaussians.", &
    1199             :                           usage="ATOMIC_RADII {real} {real} {real}", repeats=.FALSE., &
    1200             :                           unit_str="angstrom", &
    1201        8546 :                           type_of_var=real_t, n_var=-1)
    1202        8546 :       CALL section_add_keyword(print_key, keyword)
    1203        8546 :       CALL keyword_release(keyword)
    1204        8546 :       CALL section_add_subsection(section, print_key)
    1205        8546 :       CALL section_release(print_key)
    1206             : 
    1207             :       ! Print EEQ Charges
    1208             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "EEQ_CHARGES", &
    1209             :                                        description="Controls the printing of the EEQ charges", &
    1210             :                                        print_level=debug_print_level, filename="__STD_OUT__", &
    1211             :                                        common_iter_levels=1, &
    1212       34184 :                                        citations=(/Pracht2019, Caldeweyher2019, Caldeweyher2020/))
    1213        8546 :       CALL section_add_subsection(section, print_key)
    1214        8546 :       CALL section_release(print_key)
    1215             : 
    1216             :       ! MAO (modified atomic orbital) analysis
    1217             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "MAO_ANALYSIS", &
    1218             :                                        description="Controls the printing of the MAO (modified atomic orbital) analysis", &
    1219             :                                        print_level=debug_print_level, filename="__STD_OUT__", &
    1220             :                                        common_iter_levels=1, &
    1221       25638 :                                        citations=(/Heinzmann1976, Ehrhardt1985/))
    1222             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
    1223             :                           description="Threshold for matrix elements in MAO determination.", &
    1224             :                           usage="EPS_FILTER reps", repeats=.FALSE., n_var=1, &
    1225        8546 :                           default_r_val=1.e-8_dp, type_of_var=real_t)
    1226        8546 :       CALL section_add_keyword(print_key, keyword)
    1227        8546 :       CALL keyword_release(keyword)
    1228             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_BASIS", &
    1229             :                           description="Basis set used to construct MAO's.", &
    1230             :                           usage="REFERENCE_BASIS {ORBITAL,PRIMITIVE,EXTERNAL}", repeats=.FALSE., n_var=1, &
    1231             :                           default_i_val=mao_basis_orb, &
    1232             :                           enum_c_vals=s2a("ORBITAL", "PRIMITIVE", "EXTERNAL"), &
    1233             :                           enum_desc=s2a("Use standard orbital basis set", "Construct basis from primitives of the orbital basis", &
    1234             :                                         "Read external basis (MAO)"), &
    1235        8546 :                           enum_i_vals=(/mao_basis_orb, mao_basis_prim, mao_basis_ext/))
    1236        8546 :       CALL section_add_keyword(print_key, keyword)
    1237        8546 :       CALL keyword_release(keyword)
    1238             :       CALL keyword_create(keyword, __LOCATION__, name="PRINT_BASIS", &
    1239             :                           description="Print out MAO reference basis.", &
    1240             :                           usage="PRINT_BASIS {logical}", repeats=.FALSE., n_var=1, &
    1241        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1242        8546 :       CALL section_add_keyword(print_key, keyword)
    1243        8546 :       CALL keyword_release(keyword)
    1244             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_GRAD", &
    1245             :                           description="Threshold for gradient in MAO optimization.", &
    1246             :                           usage="EPS_GRAD reps", repeats=.FALSE., n_var=1, &
    1247        8546 :                           default_r_val=1.e-4_dp, type_of_var=real_t)
    1248        8546 :       CALL section_add_keyword(print_key, keyword)
    1249        8546 :       CALL keyword_release(keyword)
    1250             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FUNCTION", &
    1251             :                           description="Threshold for electron defect in MAO optimization.", &
    1252             :                           usage="EPS_FUNCTION feps", repeats=.FALSE., n_var=1, &
    1253        8546 :                           default_r_val=1.e-3_dp, type_of_var=real_t)
    1254        8546 :       CALL section_add_keyword(print_key, keyword)
    1255        8546 :       CALL keyword_release(keyword)
    1256             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
    1257             :                           description="Maximum allowed iterations for MAO optimization.", &
    1258             :                           usage="MAX_ITER iter", repeats=.FALSE., n_var=1, &
    1259        8546 :                           default_i_val=0, type_of_var=integer_t)
    1260        8546 :       CALL section_add_keyword(print_key, keyword)
    1261        8546 :       CALL keyword_release(keyword)
    1262             :       CALL keyword_create(keyword, __LOCATION__, name="NEGLECT_ABC", &
    1263             :                           description="Neglect 3 atom terms in MAO analysis.", &
    1264             :                           usage="NEGLECT_ABC {logical}", repeats=.FALSE., n_var=1, &
    1265        8546 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1266        8546 :       CALL section_add_keyword(print_key, keyword)
    1267        8546 :       CALL keyword_release(keyword)
    1268             :       CALL keyword_create(keyword, __LOCATION__, name="AB_THRESHOLD", &
    1269             :                           description="Threshold for printing of AB shared electron numbers.", &
    1270             :                           usage="AB_THRESHOLD thr", repeats=.FALSE., n_var=1, &
    1271        8546 :                           default_r_val=1.e-2_dp, type_of_var=real_t)
    1272        8546 :       CALL section_add_keyword(print_key, keyword)
    1273        8546 :       CALL keyword_release(keyword)
    1274             :       CALL keyword_create(keyword, __LOCATION__, name="ABC_THRESHOLD", &
    1275             :                           description="Threshold for printing of ABC shared electron numbers.", &
    1276             :                           usage="ABC_THRESHOLD thr", repeats=.FALSE., n_var=1, &
    1277        8546 :                           default_r_val=1.e-5_dp, type_of_var=real_t)
    1278        8546 :       CALL section_add_keyword(print_key, keyword)
    1279        8546 :       CALL keyword_release(keyword)
    1280             :       CALL keyword_create(keyword, __LOCATION__, name="ANALYZE_UNASSIGNED_CHARGE", &
    1281             :                           description="Calculate atomic contributions to the unassigned charge.", &
    1282             :                           usage="ANALYZE_UNASSIGNED_CHARGE {logical}", repeats=.FALSE., n_var=1, &
    1283        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1284        8546 :       CALL section_add_keyword(print_key, keyword)
    1285        8546 :       CALL keyword_release(keyword)
    1286        8546 :       CALL section_add_subsection(section, print_key)
    1287        8546 :       CALL section_release(print_key)
    1288             : 
    1289             :       !Minimal localized basis analysis
    1290             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "MINBAS_ANALYSIS", &
    1291             :                                        description="Controls the printing of the minimal localized basis analysis", &
    1292             :                                        print_level=debug_print_level, filename="__STD_OUT__", &
    1293             :                                        common_iter_levels=1, &
    1294       17092 :                                        citations=(/Lu2004/))
    1295             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
    1296             :                           description="Threshold for matrix elements in basis determination.", &
    1297             :                           usage="EPS_FILTER reps", repeats=.FALSE., n_var=1, &
    1298        8546 :                           default_r_val=1.e-8_dp, type_of_var=real_t)
    1299        8546 :       CALL section_add_keyword(print_key, keyword)
    1300        8546 :       CALL keyword_release(keyword)
    1301             :       CALL keyword_create(keyword, __LOCATION__, name="FULL_ORTHOGONALIZATION", &
    1302             :                           description="Orthogonalize the localized minimal basis.", &
    1303             :                           usage="FULL_ORTHOGONALIZATION {logical}", repeats=.FALSE., n_var=1, &
    1304        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1305        8546 :       CALL section_add_keyword(print_key, keyword)
    1306        8546 :       CALL keyword_release(keyword)
    1307             :       CALL keyword_create(keyword, __LOCATION__, name="BOND_ORDER", &
    1308             :                           description="Calculate Mayer Bond Orders.", &
    1309             :                           usage="BOND_ORDER {logical}", repeats=.FALSE., n_var=1, &
    1310        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1311        8546 :       CALL section_add_keyword(print_key, keyword)
    1312        8546 :       CALL keyword_release(keyword)
    1313             : 
    1314        8546 :       NULLIFY (sub_print_key)
    1315             :       CALL cp_print_key_section_create(sub_print_key, __LOCATION__, "MINBAS_CUBE", &
    1316             :                                        description="Write the minimal basis on Cube files.", &
    1317        8546 :                                        print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MINBAS")
    1318             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    1319             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1320             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    1321             :                           " 1 number valid for all components.", &
    1322        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    1323        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1324        8546 :       CALL keyword_release(keyword)
    1325             :       CALL keyword_create(keyword, __LOCATION__, name="ATOM_LIST", &
    1326             :                           description="Indexes of the atoms minimal basis to be printed as cube files "// &
    1327             :                           "This keyword can be repeated several times "// &
    1328             :                           "(useful if you have to specify many indexes).", &
    1329             :                           usage="CUBES_LIST 1 2", &
    1330        8546 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
    1331        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1332        8546 :       CALL keyword_release(keyword)
    1333        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    1334        8546 :       CALL section_release(sub_print_key)
    1335             : 
    1336        8546 :       NULLIFY (sub_print_key)
    1337             :       CALL cp_print_key_section_create(sub_print_key, __LOCATION__, "MINBAS_MOLDEN", &
    1338             :                                        description="Write the minimal basis in Molden file format, for visualisation.", &
    1339        8546 :                                        print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MINBAS")
    1340             :       CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
    1341             :                           description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
    1342             :                           usage="NDIGITS {int}", &
    1343        8546 :                           default_i_val=3)
    1344        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1345        8546 :       CALL keyword_release(keyword)
    1346             :       CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
    1347             :                           description="Representation of Gaussian-type orbitals", &
    1348             :                           default_i_val=gto_spherical, &
    1349             :                           enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
    1350             :                           enum_desc=s2a( &
    1351             :                           "Cartesian Gaussian orbitals. Use with caution", &
    1352             :                           "Spherical Gaussian orbitals. Incompatible with VMD"), &
    1353        8546 :                           enum_i_vals=(/gto_cartesian, gto_spherical/))
    1354        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1355        8546 :       CALL keyword_release(keyword)
    1356        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    1357        8546 :       CALL section_release(sub_print_key)
    1358             : 
    1359        8546 :       CALL section_add_subsection(section, print_key)
    1360        8546 :       CALL section_release(print_key)
    1361             : 
    1362             :       !Energy Decomposition Analysis
    1363             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ENERGY_DECOMPOSITION_ANALYSIS", &
    1364             :                                        description="Controls energy decomposition analysis", &
    1365             :                                        print_level=debug_print_level, filename="__STD_OUT__", &
    1366             :                                        common_iter_levels=1, &
    1367       17092 :                                        citations=(/Eriksen2020/))
    1368             :       CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_ORB_CANONICAL", &
    1369             :                           description="Use reference orbitals in canonical form.", &
    1370             :                           usage="REFERENCE_ORB_CANONICAL {logical}", repeats=.FALSE., n_var=1, &
    1371        8546 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1372        8546 :       CALL section_add_keyword(print_key, keyword)
    1373        8546 :       CALL keyword_release(keyword)
    1374             :       CALL keyword_create(keyword, __LOCATION__, name="SKIP_LOCALIZATION", &
    1375             :                           description="Don't localize the MOs.", &
    1376             :                           usage="SKIP_LOCALIZATION {logical}", repeats=.FALSE., n_var=1, &
    1377        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1378        8546 :       CALL section_add_keyword(print_key, keyword)
    1379        8546 :       CALL keyword_release(keyword)
    1380             :       CALL keyword_create(keyword, __LOCATION__, name="DETAILED_ENERGY", &
    1381             :                           description="Calculate detailed atomic decomposition energies.", &
    1382             :                           usage="DETAILED_ENERGY {logical}", repeats=.FALSE., n_var=1, &
    1383        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1384        8546 :       CALL section_add_keyword(print_key, keyword)
    1385        8546 :       CALL keyword_release(keyword)
    1386             :       CALL keyword_create(keyword, __LOCATION__, name="EWALD_ALPHA_PARAMETER", &
    1387             :                           description="Calculate Energy Decomposition for a specific alpha value. "// &
    1388             :                           "alpha = 1/(2*rc**2), see GTH pseudopotentials.", &
    1389             :                           usage="EWALD_ALPHA_PARAMETER alpha", repeats=.FALSE., n_var=1, &
    1390        8546 :                           default_r_val=0.0_dp, type_of_var=real_t)
    1391        8546 :       CALL section_add_keyword(print_key, keyword)
    1392        8546 :       CALL keyword_release(keyword)
    1393             : 
    1394        8546 :       CALL section_add_subsection(section, print_key)
    1395        8546 :       CALL section_release(print_key)
    1396             : 
    1397             :       ! IAO (Intrinsic atomic orbital) analysis
    1398             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "IAO_ANALYSIS", &
    1399             :                                        description="Controls the printing of the IAO (intrinsic atomic orbital) analysis", &
    1400             :                                        print_level=debug_print_level, filename="__STD_OUT__", &
    1401             :                                        common_iter_levels=1, &
    1402       17092 :                                        citations=(/Knizia2013/))
    1403             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_SVD", &
    1404             :                           description="Threshold for matrix inversion eigenvalues.", &
    1405             :                           usage="EPS_SVD reps", repeats=.FALSE., n_var=1, &
    1406        8546 :                           default_r_val=0.0_dp, type_of_var=real_t)
    1407        8546 :       CALL section_add_keyword(print_key, keyword)
    1408        8546 :       CALL keyword_release(keyword)
    1409             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_OCC", &
    1410             :                           description="Threshold in occupation for vectors included.", &
    1411             :                           usage="EPS_OCC reps", repeats=.FALSE., n_var=1, &
    1412        8546 :                           default_r_val=0.0_dp, type_of_var=real_t)
    1413        8546 :       CALL section_add_keyword(print_key, keyword)
    1414        8546 :       CALL keyword_release(keyword)
    1415             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMIC_CHARGES", &
    1416             :                           description="Calculate atomic charges from IAO.", &
    1417             :                           usage="ATOMIC_CHARGES {logical}", repeats=.FALSE., n_var=1, &
    1418        8546 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
    1419        8546 :       CALL section_add_keyword(print_key, keyword)
    1420        8546 :       CALL keyword_release(keyword)
    1421             :       ! IAO_MOLDEN
    1422        8546 :       NULLIFY (sub_print_key)
    1423             :       CALL cp_print_key_section_create(sub_print_key, __LOCATION__, "IAO_MOLDEN", &
    1424             :                                        description="Write the IAO basis in Molden file format, for visualisation.", &
    1425        8546 :                                        print_level=debug_print_level + 1, add_last=add_last_numeric, filename="IAOBAS")
    1426             :       CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
    1427             :                           description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
    1428             :                           usage="NDIGITS {int}", &
    1429        8546 :                           default_i_val=3)
    1430        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1431        8546 :       CALL keyword_release(keyword)
    1432             :       CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
    1433             :                           description="Representation of Gaussian-type orbitals", &
    1434             :                           default_i_val=gto_spherical, &
    1435             :                           enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
    1436             :                           enum_desc=s2a( &
    1437             :                           "Cartesian Gaussian orbitals. Use with caution", &
    1438             :                           "Spherical Gaussian orbitals. Incompatible with VMD"), &
    1439        8546 :                           enum_i_vals=(/gto_cartesian, gto_spherical/))
    1440        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1441        8546 :       CALL keyword_release(keyword)
    1442        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    1443        8546 :       CALL section_release(sub_print_key)
    1444             :       ! IAO_CUBES
    1445        8546 :       NULLIFY (sub_print_key)
    1446             :       CALL cp_print_key_section_create(sub_print_key, __LOCATION__, "IAO_CUBES", &
    1447             :                                        description="Controls the printing of the IAO basis "// &
    1448             :                                        "as *.cube files.", &
    1449             :                                        print_level=high_print_level, common_iter_levels=1, &
    1450        8546 :                                        add_last=add_last_numeric, filename="")
    1451             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    1452             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1453             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    1454             :                           " 1 number valid for all components.", &
    1455        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    1456        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1457        8546 :       CALL keyword_release(keyword)
    1458             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1459             :                           description="append the cube files when they already exist", &
    1460        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1461        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1462        8546 :       CALL keyword_release(keyword)
    1463             :       CALL keyword_create(keyword, __LOCATION__, name="ATOM_LIST", &
    1464             :                           description="Indices of the atoms to be included in basis CUBE file printing. ", &
    1465             :                           usage="ATOM_LIST {integer}  {integer} ..  {integer} ", &
    1466        8546 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
    1467        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1468        8546 :       CALL keyword_release(keyword)
    1469        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    1470        8546 :       CALL section_release(sub_print_key)
    1471             :       ! One Center Expansion of IAO
    1472        8546 :       NULLIFY (sub_print_key)
    1473             :       CALL cp_print_key_section_create(sub_print_key, __LOCATION__, "ONE_CENTER_EXPANSION", &
    1474             :                                        description="Calculates single center expansion of IAOs ", &
    1475             :                                        print_level=high_print_level, common_iter_levels=1, &
    1476        8546 :                                        add_last=add_last_numeric, filename="")
    1477             :       CALL keyword_create(keyword, __LOCATION__, name="LMAX", &
    1478             :                           description="Maximum l quantum number used in the expansion.", &
    1479        8546 :                           usage="LMAX 2", n_var=1, default_i_val=3, type_of_var=integer_t)
    1480        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1481        8546 :       CALL keyword_release(keyword)
    1482             :       CALL keyword_create(keyword, __LOCATION__, name="NBAS", &
    1483             :                           description="Max number of basis functions used in the expansion."// &
    1484             :                           " Default is determined by the orbital basis set.", &
    1485        8546 :                           usage="NBAS 10", n_var=1, default_i_val=-1, type_of_var=integer_t)
    1486        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1487        8546 :       CALL keyword_release(keyword)
    1488             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1489             :                           description="Append the OCE basis files when it already exists", &
    1490        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1491        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1492        8546 :       CALL keyword_release(keyword)
    1493        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    1494        8546 :       CALL section_release(sub_print_key)
    1495             :       ! Intrinsic Bond orbitals
    1496        8546 :       NULLIFY (sub_print_key)
    1497             :       CALL cp_print_key_section_create(sub_print_key, __LOCATION__, "BOND_ORBITALS", &
    1498             :                                        description="Calculate intrinsic bond orbitals using "// &
    1499             :                                        "localized MOs in IAO basis.", &
    1500             :                                        print_level=high_print_level, common_iter_levels=1, &
    1501        8546 :                                        add_last=add_last_numeric, filename="")
    1502             : 
    1503             :       CALL keyword_create(keyword, __LOCATION__, name="LOCALIZATION_OPERATOR", &
    1504             :                           description="Operator to be optimized for orbital localization", &
    1505             :                           enum_c_vals=s2a("PIPEK_MEZEY", "PIPEK_MEZEY_4", "L1NORM"), &
    1506             :                           enum_i_vals=(/do_iaoloc_pm2, do_iaoloc_pm4, do_iaoloc_l1/), &
    1507             :                           enum_desc=s2a("Use Pipek-Mezey operator (order 2)", &
    1508             :                                         "Use Pipek-Mezey operator (order 4)", &
    1509             :                                         "Use L1 norm"), &
    1510        8546 :                           default_i_val=do_iaoloc_pm2)
    1511        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1512        8546 :       CALL keyword_release(keyword)
    1513             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_LOCALIZATION_FUNCTION", &
    1514             :                           description="Function for energy localization: f(e_i), e_i orbital energy", &
    1515             :                           enum_c_vals=s2a("NONE", "ENERGY", "OCCUPATION"), &
    1516             :                           enum_i_vals=(/do_iaoloc_enone, do_iaoloc_energy, do_iaoloc_occ/), &
    1517             :                           enum_desc=s2a("Don't use energy localization.", &
    1518             :                                         "Use orbital energies for localization.", &
    1519             :                                         "Use occupation numbers for localization."), &
    1520        8546 :                           default_i_val=do_iaoloc_enone)
    1521        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1522        8546 :       CALL keyword_release(keyword)
    1523             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_LOCALIZATION_WEIGHT", &
    1524             :                           description="Weight given to energy localization, using f(e_i) function", &
    1525             :                           usage="ENERGY_LOCALIZATION_WEIGHT 0.1", n_var=1, &
    1526        8546 :                           default_r_val=0.0_dp, type_of_var=real_t)
    1527        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1528        8546 :       CALL keyword_release(keyword)
    1529             : 
    1530             :       ! CHARGE CENTER AND SPREAD
    1531        8546 :       NULLIFY (subsection)
    1532             :       CALL cp_print_key_section_create(subsection, __LOCATION__, "CHARGE_CENTER", &
    1533             :                                        description="Calculation and printing of centers and spreads "// &
    1534             :                                        "of localized orbitals.", &
    1535             :                                        print_level=high_print_level, common_iter_levels=1, &
    1536        8546 :                                        add_last=add_last_numeric, filename="")
    1537             :       CALL keyword_create(keyword, __LOCATION__, name="POSITION_OPERATOR_BERRY", &
    1538             :                           description="Use Berry phase position operator.", &
    1539             :                           usage="POSITION_OPERATOR_BERRY T", n_var=1, &
    1540        8546 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1541        8546 :       CALL section_add_keyword(subsection, keyword)
    1542        8546 :       CALL keyword_release(keyword)
    1543        8546 :       CALL section_add_subsection(sub_print_key, subsection)
    1544        8546 :       CALL section_release(subsection)
    1545             :       ! IBO_MOLDEN
    1546        8546 :       NULLIFY (subsection)
    1547             :       CALL cp_print_key_section_create(subsection, __LOCATION__, "IBO_MOLDEN", &
    1548             :                                        description="Write the IBO orbitals in Molden file format, for visualisation.", &
    1549        8546 :                                        print_level=debug_print_level + 1, add_last=add_last_numeric, filename="IBOBAS")
    1550             :       CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
    1551             :                           description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
    1552             :                           usage="NDIGITS {int}", &
    1553        8546 :                           default_i_val=3)
    1554        8546 :       CALL section_add_keyword(subsection, keyword)
    1555        8546 :       CALL keyword_release(keyword)
    1556             :       CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
    1557             :                           description="Representation of Gaussian-type orbitals", &
    1558             :                           default_i_val=gto_spherical, &
    1559             :                           enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
    1560             :                           enum_desc=s2a( &
    1561             :                           "Cartesian Gaussian orbitals. Use with caution", &
    1562             :                           "Spherical Gaussian orbitals. Incompatible with VMD"), &
    1563        8546 :                           enum_i_vals=(/gto_cartesian, gto_spherical/))
    1564        8546 :       CALL section_add_keyword(subsection, keyword)
    1565        8546 :       CALL keyword_release(keyword)
    1566        8546 :       CALL section_add_subsection(sub_print_key, subsection)
    1567        8546 :       CALL section_release(subsection)
    1568             :       ! IAO_CUBES
    1569        8546 :       NULLIFY (subsection)
    1570             :       CALL cp_print_key_section_create(subsection, __LOCATION__, "IBO_CUBES", &
    1571             :                                        description="Controls the printing of the IBO orbitals "// &
    1572             :                                        "as *.cube files.", &
    1573             :                                        print_level=high_print_level, common_iter_levels=1, &
    1574        8546 :                                        add_last=add_last_numeric, filename="")
    1575             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    1576             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1577             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    1578             :                           " 1 number valid for all components.", &
    1579        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    1580        8546 :       CALL section_add_keyword(subsection, keyword)
    1581        8546 :       CALL keyword_release(keyword)
    1582             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1583             :                           description="append the cube files when they already exist", &
    1584        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1585        8546 :       CALL section_add_keyword(subsection, keyword)
    1586        8546 :       CALL keyword_release(keyword)
    1587             :       CALL keyword_create(keyword, __LOCATION__, name="STATE_LIST", &
    1588             :                           description="Indices of the orbitals to be included in IBO CUBE file printing. ", &
    1589             :                           usage="STATE_LIST {integer}  {integer} ..  {integer} ", &
    1590        8546 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
    1591        8546 :       CALL section_add_keyword(subsection, keyword)
    1592        8546 :       CALL keyword_release(keyword)
    1593        8546 :       CALL section_add_subsection(sub_print_key, subsection)
    1594        8546 :       CALL section_release(subsection)
    1595        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    1596        8546 :       CALL section_release(sub_print_key)
    1597             : 
    1598        8546 :       CALL section_add_subsection(section, print_key)
    1599        8546 :       CALL section_release(print_key)
    1600             :       ! END OF IAO_ANALYSIS SECTION
    1601             : 
    1602             :       !DOS from density matrix
    1603             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ENERGY_WINDOWS", &
    1604             :                                        description="Controls the printing of the DOS from the density matrix. "// &
    1605             :                                        "This allows the calculation of the DOS even in density matrix based "// &
    1606             :                                        "REAL_TIME_PROPAGATION and LS_SCF. "// &
    1607             :                                        "However, it requires a cubically scaling diagonalization of the Hamiltonian. "// &
    1608             :                                        "Hartree-Fock NYI, values will be wrong. "// &
    1609             :                                        "Careful, the orbitals in rtp/emd are not actually eigenstates of the Hamiltonian. "// &
    1610             :                                        "Assumes absence of spin polarization (so far).", &
    1611             :                                        print_level=high_print_level, common_iter_levels=3, &
    1612             :                                        each_iter_names=s2a("MD"), each_iter_values=(/100/), &
    1613        8546 :                                        add_last=add_last_numeric, filename="energy-windows")
    1614             :       CALL keyword_create(keyword, __LOCATION__, name="N_WINDOWS", &
    1615             :                           description="The number of energy windows.", &
    1616             :                           usage="N_WINDOWS 200", &
    1617        8546 :                           default_i_val=100)
    1618        8546 :       CALL section_add_keyword(print_key, keyword)
    1619        8546 :       CALL keyword_release(keyword)
    1620             :       CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
    1621             :                           description="Filtering threshold for sparse matrix operations.", &
    1622             :                           usage="EPS_FILTER 1.0E-6", &
    1623        8546 :                           default_r_val=1.0E-14_dp)
    1624        8546 :       CALL section_add_keyword(print_key, keyword)
    1625        8546 :       CALL keyword_release(keyword)
    1626             :       CALL keyword_create(keyword, __LOCATION__, name="RESTRICT_RANGE", &
    1627             :                           description="Restricts the energy windows to states close to the fermi level", &
    1628             :                           usage="RESTRICT_RANGE .TRUE.", &
    1629        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1630        8546 :       CALL section_add_keyword(print_key, keyword)
    1631        8546 :       CALL keyword_release(keyword)
    1632             :       CALL keyword_create(keyword, __LOCATION__, name="RANGE", &
    1633             :                           description="If the RESTRICT_RANGE keyword is set, then all energy widnows will"// &
    1634             :                           " be placed in an interval from from the fermi level minus to the fermi level plus this keyword", &
    1635             :                           usage="RANGE 1", &
    1636        8546 :                           default_r_val=1.0_dp)
    1637        8546 :       CALL section_add_keyword(print_key, keyword)
    1638        8546 :       CALL keyword_release(keyword)
    1639             :       CALL keyword_create(keyword, __LOCATION__, name="PRINT_CUBES", &
    1640             :                           description="Print the energy windows to cube files", &
    1641             :                           usage="DENSITY_PROPAGATION .TRUE.", &
    1642        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1643        8546 :       CALL section_add_keyword(print_key, keyword)
    1644        8546 :       CALL keyword_release(keyword)
    1645             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    1646             :                           description="The stride (X,Y,Z) used to write the energy windows cube files (if enabled) "// &
    1647             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    1648             :                           " 1 number valid for all components.", &
    1649        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    1650        8546 :       CALL section_add_keyword(print_key, keyword)
    1651        8546 :       CALL keyword_release(keyword)
    1652        8546 :       CALL section_add_subsection(section, print_key)
    1653        8546 :       CALL section_release(print_key)
    1654             : 
    1655             :       ! Hamiltonian in CSR format
    1656             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "KS_CSR_WRITE", &
    1657             :                                        description="Write the KS matrix in CSR format into a file.", &
    1658        8546 :                                        print_level=debug_print_level, filename="")
    1659             :       CALL keyword_create(keyword, __LOCATION__, name="Threshold", &
    1660             :                           description="Threshold on the absolute value of the elements to be printed out. "// &
    1661             :                           "In CP2K all the elements in a (atomic) matrix block are considered non-zero, "// &
    1662             :                           "if the block contains at least one non-zero element.", &
    1663             :                           usage="THRESHOLD {real}", &
    1664             :                           repeats=.FALSE., &
    1665        8546 :                           default_r_val=0.0_dp)
    1666        8546 :       CALL section_add_keyword(print_key, keyword)
    1667        8546 :       CALL keyword_release(keyword)
    1668             :       CALL keyword_create(keyword, __LOCATION__, name="Upper_triangular", &
    1669             :                           description="Print only the upper triangular part of the matrix. ", &
    1670             :                           usage="UPPER_TRIANGULAR {logical}", &
    1671             :                           repeats=.FALSE., &
    1672             :                           default_l_val=.FALSE., &
    1673        8546 :                           lone_keyword_l_val=.TRUE.)
    1674        8546 :       CALL section_add_keyword(print_key, keyword)
    1675        8546 :       CALL keyword_release(keyword)
    1676             :       CALL keyword_create(keyword, __LOCATION__, name="Binary", &
    1677             :                           description="Whether or not to generate the file in a binary format. ", &
    1678             :                           usage="BINARY {logical}", &
    1679             :                           repeats=.FALSE., &
    1680             :                           default_l_val=.FALSE., &
    1681        8546 :                           lone_keyword_l_val=.TRUE.)
    1682        8546 :       CALL section_add_keyword(print_key, keyword)
    1683        8546 :       CALL keyword_release(keyword)
    1684             :       CALL keyword_create(keyword, __LOCATION__, name="Real_space", &
    1685             :                           description="Print the KS matrix in real-space instead of k-space.. ", &
    1686             :                           usage="REAL_SPACE {logical}", &
    1687             :                           repeats=.FALSE., &
    1688             :                           default_l_val=.FALSE., &
    1689        8546 :                           lone_keyword_l_val=.TRUE.)
    1690        8546 :       CALL section_add_keyword(print_key, keyword)
    1691        8546 :       CALL keyword_release(keyword)
    1692        8546 :       CALL section_add_subsection(section, print_key)
    1693        8546 :       CALL section_release(print_key)
    1694             : 
    1695             :       ! Overlap in CSR format
    1696             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "S_CSR_WRITE", &
    1697             :                                        description="Write the overlap matrix in CSR format into a file.", &
    1698        8546 :                                        print_level=debug_print_level, filename="")
    1699             :       CALL keyword_create(keyword, __LOCATION__, name="Threshold", &
    1700             :                           description="Threshold on the absolute value of the elements to be printed out. "// &
    1701             :                           "In CP2K all the elements in a (atomic) matrix block are considered non-zero, "// &
    1702             :                           "if the block contains at least one non-zero element.", &
    1703             :                           usage="THRESHOLD {real}", &
    1704             :                           repeats=.FALSE., &
    1705        8546 :                           default_r_val=0.0_dp)
    1706        8546 :       CALL section_add_keyword(print_key, keyword)
    1707        8546 :       CALL keyword_release(keyword)
    1708             :       CALL keyword_create(keyword, __LOCATION__, name="Upper_triangular", &
    1709             :                           description="Print only the upper triangular part of the matrix. ", &
    1710             :                           usage="UPPER_TRIANGULAR {logical}", &
    1711             :                           repeats=.FALSE., &
    1712             :                           default_l_val=.FALSE., &
    1713        8546 :                           lone_keyword_l_val=.TRUE.)
    1714        8546 :       CALL section_add_keyword(print_key, keyword)
    1715        8546 :       CALL keyword_release(keyword)
    1716             :       CALL keyword_create(keyword, __LOCATION__, name="Binary", &
    1717             :                           description="Whether or not to generate the file in a binary format. ", &
    1718             :                           usage="BINARY {logical}", &
    1719             :                           repeats=.FALSE., &
    1720             :                           default_l_val=.FALSE., &
    1721        8546 :                           lone_keyword_l_val=.TRUE.)
    1722        8546 :       CALL section_add_keyword(print_key, keyword)
    1723        8546 :       CALL keyword_release(keyword)
    1724             :       CALL keyword_create(keyword, __LOCATION__, name="Real_space", &
    1725             :                           description="Print the overlap matrix in real-space instead of k-space.. ", &
    1726             :                           usage="REAL_SPACE {logical}", &
    1727             :                           repeats=.FALSE., &
    1728             :                           default_l_val=.FALSE., &
    1729        8546 :                           lone_keyword_l_val=.TRUE.)
    1730        8546 :       CALL section_add_keyword(print_key, keyword)
    1731        8546 :       CALL keyword_release(keyword)
    1732        8546 :       CALL section_add_subsection(section, print_key)
    1733        8546 :       CALL section_release(print_key)
    1734             : 
    1735             :       ! interaction adjacency matrix
    1736             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ADJMAT_WRITE", &
    1737             :                                        description="Writes an (upper-triangular) adjacency matrix indicating the "// &
    1738             :                                        "interaction between atoms (according to overlapping basis functions). The "// &
    1739             :                                        "columns are: iatom, jatom, ikind, jkind; where iatom and jatom are the atom "// &
    1740             :                                        "indices (based on the coordinate file), ikind and jkind are the atomic kinds "// &
    1741             :                                        "(indeces as shown in the ATOMIC KIND INFORMATION section of a CP2K output). ", &
    1742        8546 :                                        print_level=debug_print_level, filename="")
    1743        8546 :       CALL section_add_subsection(section, print_key)
    1744        8546 :       CALL section_release(print_key)
    1745             : 
    1746             :       ! Xray diffraction
    1747             :       CALL cp_print_key_section_create( &
    1748             :          print_key, __LOCATION__, name="XRAY_DIFFRACTION_SPECTRUM", &
    1749             :          description="Calculate and print the coherent X-ray "// &
    1750             :          "diffraction spectrum", &
    1751             :          print_level=debug_print_level, &
    1752             :          filename="", &
    1753       25638 :          citations=(/Krack2000, Krack2002/))
    1754             :       CALL keyword_create( &
    1755             :          keyword, __LOCATION__, &
    1756             :          name="Q_MAX", &
    1757             :          variants=(/"Q_MAXIMUM"/), &
    1758             :          description="Maximum Q value calculated for the spectrum", &
    1759             :          usage="Q_MAX {real}", &
    1760             :          repeats=.FALSE., &
    1761             :          n_var=1, &
    1762             :          type_of_var=real_t, &
    1763             :          default_r_val=cp_unit_to_cp2k(value=20.0_dp, &
    1764             :                                        unit_str="angstrom^-1"), &
    1765       17092 :          unit_str="angstrom^-1")
    1766        8546 :       CALL section_add_keyword(print_key, keyword)
    1767        8546 :       CALL keyword_release(keyword)
    1768        8546 :       CALL section_add_subsection(section, print_key)
    1769        8546 :       CALL section_release(print_key)
    1770             : 
    1771             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="ELECTRIC_FIELD_GRADIENT", &
    1772             :                                        description="Calculate and print the electric field gradients "// &
    1773             :                                        "at atomic positions", &
    1774             :                                        print_level=debug_print_level, &
    1775        8546 :                                        filename="__STD_OUT__")
    1776             : 
    1777             :       CALL keyword_create(keyword, __LOCATION__, &
    1778             :                           name="INTERPOLATION", &
    1779             :                           description="Use interpolation method from real space grid", &
    1780             :                           usage="INTERPOLATION {logical}", &
    1781             :                           repeats=.FALSE., &
    1782             :                           n_var=1, &
    1783        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1784        8546 :       CALL section_add_keyword(print_key, keyword)
    1785        8546 :       CALL keyword_release(keyword)
    1786             : 
    1787             :       CALL keyword_create(keyword, __LOCATION__, &
    1788             :                           name="GSPACE_SMOOTHING", &
    1789             :                           description="Use a G-space smoothing function", &
    1790             :                           usage="GSPACE_SMOOTHING cutoff {real}, width {real}", &
    1791             :                           repeats=.FALSE., &
    1792             :                           n_var=2, default_r_vals=(/-1._dp, -1._dp/), &
    1793        8546 :                           type_of_var=real_t)
    1794        8546 :       CALL section_add_keyword(print_key, keyword)
    1795        8546 :       CALL keyword_release(keyword)
    1796             : 
    1797             :       CALL keyword_create(keyword, __LOCATION__, &
    1798             :                           name="DEBUG", &
    1799             :                           description="Print additional debug output", &
    1800             :                           usage="DEBUG {logical}", &
    1801             :                           repeats=.FALSE., &
    1802             :                           n_var=1, &
    1803        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1804        8546 :       CALL section_add_keyword(print_key, keyword)
    1805        8546 :       CALL keyword_release(keyword)
    1806             : 
    1807        8546 :       CALL create_gspace_interp_section(subsection)
    1808        8546 :       CALL section_add_subsection(print_key, subsection)
    1809        8546 :       CALL section_release(subsection)
    1810             : 
    1811        8546 :       CALL section_add_subsection(section, print_key)
    1812        8546 :       CALL section_release(print_key)
    1813             : 
    1814             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="BASIS_MOLOPT_QUANTITIES", &
    1815             :                                        description="Print the two quantities needed in the basis molopt generation:"// &
    1816             :                                        " total energy and condition number of the overlap matrix (S matrix)", &
    1817             :                                        print_level=debug_print_level, &
    1818        8546 :                                        filename="__STD_OUT__")
    1819        8546 :       CALL section_add_subsection(section, print_key)
    1820        8546 :       CALL section_release(print_key)
    1821             : 
    1822             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="HYPERFINE_COUPLING_TENSOR", &
    1823             :                                        description="Calculate and print the EPR hyperfine coupling tensor"// &
    1824             :                                        " at atomic positions", &
    1825             :                                        print_level=debug_print_level, &
    1826        8546 :                                        filename="__STD_OUT__")
    1827             : 
    1828             :       CALL keyword_create(keyword, __LOCATION__, &
    1829             :                           name="INTERACTION_RADIUS", &
    1830             :                           description="Radius of interaction for EPR hyperfine tensor calculation", &
    1831             :                           usage="INTERACTION_RADIUS radius {real}", &
    1832             :                           repeats=.FALSE., &
    1833             :                           n_var=1, default_r_val=10._dp, &
    1834        8546 :                           type_of_var=real_t)
    1835        8546 :       CALL section_add_keyword(print_key, keyword)
    1836        8546 :       CALL keyword_release(keyword)
    1837             : 
    1838        8546 :       CALL section_add_subsection(section, print_key)
    1839        8546 :       CALL section_release(print_key)
    1840             : 
    1841             :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="OPTIMIZE_LRI_BASIS", &
    1842             :                                        description="Optimize the exponents of the LRI basis set", &
    1843             :                                        print_level=low_print_level, &
    1844        8546 :                                        filename="OPTIMIZED_LRI_BASIS")
    1845        8546 :       CALL section_add_subsection(section, print_key)
    1846        8546 :       CALL section_release(print_key)
    1847             : 
    1848             :       CALL cp_print_key_section_create( &
    1849             :          print_key, __LOCATION__, name="PLUS_U", &
    1850             :          description="Controls the printing for the DFT+U methods", &
    1851             :          print_level=high_print_level, &
    1852             :          filename="__STD_OUT__", &
    1853             :          each_iter_names=s2a("QS_SCF"), &
    1854             :          each_iter_values=(/0/), &
    1855       25638 :          citations=(/Dudarev1997, Dudarev1998/))
    1856        8546 :       CALL section_add_subsection(section, print_key)
    1857        8546 :       CALL section_release(print_key)
    1858             : 
    1859             :       CALL cp_print_key_section_create( &
    1860             :          print_key, __LOCATION__, name="CHARGEMOL", &
    1861             :          description="Write .wfx input file for Chargemol", &
    1862             :          print_level=debug_print_level + 1, &
    1863             :          filename="CHARGEMOL", &
    1864        8546 :          add_last=add_last_numeric)
    1865             :       CALL keyword_create(keyword, __LOCATION__, name="BACKUP_COPIES", &
    1866             :                           description="Specifies the maximum number of backup copies.", &
    1867             :                           usage="BACKUP_COPIES {int}", &
    1868        8546 :                           default_i_val=1)
    1869        8546 :       CALL section_add_keyword(print_key, keyword)
    1870        8546 :       CALL keyword_release(keyword)
    1871             :       CALL keyword_create(keyword, __LOCATION__, name="PERIODIC", &
    1872             :                           description="Write information about cell periodicity.", &
    1873             :                           usage="PERIODIC {LOGICAL}", &
    1874        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1875        8546 :       CALL section_add_keyword(print_key, keyword)
    1876        8546 :       CALL keyword_release(keyword)
    1877        8546 :       CALL section_add_subsection(section, print_key)
    1878        8546 :       CALL section_release(print_key)
    1879             : 
    1880             :       CALL cp_print_key_section_create( &
    1881             :          print_key, __LOCATION__, name="SCCS", &
    1882             :          description="Controls the printing for the SCCS models", &
    1883             :          print_level=high_print_level, &
    1884             :          filename="__STD_OUT__", &
    1885             :          each_iter_names=s2a("QS_SCF"), &
    1886             :          each_iter_values=(/0/), &
    1887       34184 :          citations=(/Fattebert2002, Andreussi2012, Yin2017/))
    1888             : 
    1889        8546 :       NULLIFY (sub_print_key)
    1890             : 
    1891             :       CALL cp_print_key_section_create( &
    1892             :          sub_print_key, __LOCATION__, name="DENSITY_GRADIENT", &
    1893             :          description="Controls the printing of the cube files with "// &
    1894             :          "the norm of the density gradient |&nabla;&rho;| "// &
    1895             :          "used by the SCCS model.", &
    1896             :          print_level=debug_print_level, &
    1897             :          filename="", &
    1898             :          each_iter_names=s2a("QS_SCF"), &
    1899        8546 :          each_iter_values=(/0/))
    1900             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    1901             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1902             :                           "(larger values result in smaller cube files). You can provide 3 "// &
    1903             :                           "numbers (for X,Y,Z) or 1 number valid for all components.", &
    1904             :                           n_var=-1, &
    1905             :                           default_i_vals=(/2, 2, 2/), &
    1906             :                           type_of_var=integer_t, &
    1907        8546 :                           repeats=.FALSE.)
    1908        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1909        8546 :       CALL keyword_release(keyword)
    1910             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1911             :                           description="Append the cube files when they already exist", &
    1912             :                           default_l_val=.FALSE., &
    1913             :                           lone_keyword_l_val=.TRUE., &
    1914        8546 :                           repeats=.FALSE.)
    1915        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1916        8546 :       CALL keyword_release(keyword)
    1917        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    1918        8546 :       CALL section_release(sub_print_key)
    1919             : 
    1920             :       CALL cp_print_key_section_create( &
    1921             :          sub_print_key, __LOCATION__, name="DIELECTRIC_FUNCTION", &
    1922             :          description="Controls the printing of the cube files with "// &
    1923             :          "the dielectric function used by the SCCS model. "// &
    1924             :          "This function determines the cavity formed by a solute in "// &
    1925             :          "a solvent and thus it can be used for the visualisaton of the cavity.", &
    1926             :          print_level=debug_print_level, &
    1927             :          filename="", &
    1928             :          each_iter_names=s2a("QS_SCF"), &
    1929             :          each_iter_values=(/0/), &
    1930       34184 :          citations=(/Fattebert2002, Andreussi2012, Yin2017/))
    1931             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    1932             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1933             :                           "(larger values result in smaller cube files). You can provide 3 "// &
    1934             :                           "numbers (for X,Y,Z) or 1 number valid for all components.", &
    1935             :                           n_var=-1, &
    1936             :                           default_i_vals=(/2, 2, 2/), &
    1937             :                           type_of_var=integer_t, &
    1938        8546 :                           repeats=.FALSE.)
    1939        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1940        8546 :       CALL keyword_release(keyword)
    1941             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1942             :                           description="Append the cube files when they already exist", &
    1943             :                           default_l_val=.FALSE., &
    1944             :                           lone_keyword_l_val=.TRUE., &
    1945        8546 :                           repeats=.FALSE.)
    1946        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1947        8546 :       CALL keyword_release(keyword)
    1948        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    1949        8546 :       CALL section_release(sub_print_key)
    1950             : 
    1951             :       CALL cp_print_key_section_create( &
    1952             :          sub_print_key, __LOCATION__, name="TOTAL_CHARGE_DENSITY", &
    1953             :          description="Controls the printing of the cube files with the "// &
    1954             :          "total charge density $\rho^\text{tot}$ used by the SCCS model.", &
    1955             :          print_level=debug_print_level, &
    1956             :          filename="", &
    1957             :          each_iter_names=s2a("QS_SCF"), &
    1958             :          each_iter_values=(/0/), &
    1959       34184 :          citations=(/Fattebert2002, Andreussi2012, Yin2017/))
    1960             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    1961             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1962             :                           "(larger values result in smaller cube files). You can provide 3 "// &
    1963             :                           "numbers (for X,Y,Z) or 1 number valid for all components.", &
    1964             :                           n_var=-1, &
    1965             :                           default_i_vals=(/2, 2, 2/), &
    1966             :                           type_of_var=integer_t, &
    1967        8546 :                           repeats=.FALSE.)
    1968        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1969        8546 :       CALL keyword_release(keyword)
    1970             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    1971             :                           description="Append the cube files when they already exist", &
    1972             :                           default_l_val=.FALSE., &
    1973             :                           lone_keyword_l_val=.TRUE., &
    1974        8546 :                           repeats=.FALSE.)
    1975        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1976        8546 :       CALL keyword_release(keyword)
    1977        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    1978        8546 :       CALL section_release(sub_print_key)
    1979             : 
    1980             :       CALL cp_print_key_section_create( &
    1981             :          sub_print_key, __LOCATION__, name="POLARISATION_CHARGE_DENSITY", &
    1982             :          description="Controls the printing of the cube files with the "// &
    1983             :          "polarisation charge density $\rho^\text{pol}$ used by the SCCS model with the "// &
    1984             :          "total charge density $\rho^\text{tot} = \rho^\text{sol} + \rho^\text{pol}", &
    1985             :          print_level=debug_print_level, &
    1986             :          filename="", &
    1987             :          each_iter_names=s2a("QS_SCF"), &
    1988             :          each_iter_values=(/0/), &
    1989       34184 :          citations=(/Fattebert2002, Andreussi2012, Yin2017/))
    1990             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    1991             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    1992             :                           "(larger values result in smaller cube files). You can provide 3 "// &
    1993             :                           "numbers (for X,Y,Z) or 1 number valid for all components.", &
    1994             :                           n_var=-1, &
    1995             :                           default_i_vals=(/2, 2, 2/), &
    1996             :                           type_of_var=integer_t, &
    1997        8546 :                           repeats=.FALSE.)
    1998        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    1999        8546 :       CALL keyword_release(keyword)
    2000             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2001             :                           description="Append the cube files when they already exist", &
    2002             :                           default_l_val=.FALSE., &
    2003             :                           lone_keyword_l_val=.TRUE., &
    2004        8546 :                           repeats=.FALSE.)
    2005        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    2006        8546 :       CALL keyword_release(keyword)
    2007        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    2008        8546 :       CALL section_release(sub_print_key)
    2009             : 
    2010             :       CALL cp_print_key_section_create( &
    2011             :          sub_print_key, __LOCATION__, name="POLARISATION_POTENTIAL", &
    2012             :          description="Controls the printing of the cube files with the "// &
    2013             :          "polarisation potential $\phi^\text{pol}$ used by the SCCS model with the "// &
    2014             :          "total potential $\phi^\text{tot} = \phi^\text{sol} + \phi^\text{pol}$", &
    2015             :          print_level=debug_print_level, &
    2016             :          filename="", &
    2017             :          each_iter_names=s2a("QS_SCF"), &
    2018             :          each_iter_values=(/0/), &
    2019       34184 :          citations=(/Fattebert2002, Andreussi2012, Yin2017/))
    2020             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
    2021             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    2022             :                           "(larger values result in smaller cube files). You can provide 3 "// &
    2023             :                           "numbers (for X,Y,Z) or 1 number valid for all components.", &
    2024             :                           n_var=-1, &
    2025             :                           default_i_vals=(/2, 2, 2/), &
    2026             :                           type_of_var=integer_t, &
    2027        8546 :                           repeats=.FALSE.)
    2028        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    2029        8546 :       CALL keyword_release(keyword)
    2030             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2031             :                           description="Append the cube files when they already exist", &
    2032             :                           default_l_val=.FALSE., &
    2033             :                           lone_keyword_l_val=.TRUE., &
    2034        8546 :                           repeats=.FALSE.)
    2035        8546 :       CALL section_add_keyword(sub_print_key, keyword)
    2036        8546 :       CALL keyword_release(keyword)
    2037        8546 :       CALL section_add_subsection(print_key, sub_print_key)
    2038        8546 :       CALL section_release(sub_print_key)
    2039             : 
    2040        8546 :       CALL section_add_subsection(section, print_key)
    2041        8546 :       CALL section_release(print_key)
    2042             : 
    2043        8546 :    END SUBROUTINE create_print_dft_section
    2044             : 
    2045             : ! **************************************************************************************************
    2046             : !> \brief ...
    2047             : !> \param section ...
    2048             : !> \author JGH
    2049             : ! **************************************************************************************************
    2050        8546 :    SUBROUTINE create_bandstructure_section(section)
    2051             :       TYPE(section_type), POINTER                        :: section
    2052             : 
    2053             :       TYPE(keyword_type), POINTER                        :: keyword
    2054             :       TYPE(section_type), POINTER                        :: subsection
    2055             : 
    2056        8546 :       CPASSERT(.NOT. ASSOCIATED(section))
    2057             :       CALL section_create(section, __LOCATION__, name="BAND_STRUCTURE", &
    2058             :                           description="Specifies the k-points used in band structure calculation.", &
    2059        8546 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
    2060             : 
    2061        8546 :       NULLIFY (keyword)
    2062             :       CALL keyword_create(keyword, __LOCATION__, name="FILE_NAME", &
    2063             :                           description="File name used for band structure", &
    2064             :                           usage="FILE_NAME <filename>", default_c_val="", &
    2065        8546 :                           type_of_var=char_t, n_var=1)
    2066        8546 :       CALL section_add_keyword(section, keyword)
    2067        8546 :       CALL keyword_release(keyword)
    2068             : 
    2069             :       CALL keyword_create(keyword, __LOCATION__, name="ADDED_MOS", &
    2070             :                           variants=(/"ADDED_BANDS"/), &
    2071             :                           description="Number of MOs/Bands added to the Band Structure calculation.", &
    2072       17092 :                           default_i_val=0)
    2073        8546 :       CALL section_add_keyword(section, keyword)
    2074        8546 :       CALL keyword_release(keyword)
    2075             : 
    2076        8546 :       NULLIFY (subsection)
    2077        8546 :       CALL create_kpoint_set_section(subsection)
    2078        8546 :       CALL section_add_subsection(section, subsection)
    2079        8546 :       CALL section_release(subsection)
    2080             : 
    2081        8546 :    END SUBROUTINE create_bandstructure_section
    2082             : 
    2083             : ! **************************************************************************************************
    2084             : !> \brief creates the input section for dealing with homo lumos, including dumping cubes
    2085             : !> \param print_key ...
    2086             : ! **************************************************************************************************
    2087        8546 :    SUBROUTINE create_mo_cubes_section(print_key)
    2088             :       TYPE(section_type), POINTER                        :: print_key
    2089             : 
    2090             :       TYPE(keyword_type), POINTER                        :: keyword
    2091             : 
    2092        8546 :       NULLIFY (keyword)
    2093             : 
    2094             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "MO_CUBES", &
    2095             :                                        description="Controls the printing of the molecular orbitals (MOs) as cube files."// &
    2096             :                                        " It can be used during a Real Time calculation to print the MOs."// &
    2097             :                                        " In this case, the density corresponding to the time dependent MO is printed"// &
    2098             :                                        " instead of the wave-function.", &
    2099        8546 :                                        print_level=high_print_level, filename="")
    2100             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    2101             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    2102             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    2103             :                           " 1 number valid for all components.", &
    2104        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    2105        8546 :       CALL section_add_keyword(print_key, keyword)
    2106        8546 :       CALL keyword_release(keyword)
    2107             : 
    2108             :       CALL keyword_create(keyword, __LOCATION__, name="write_cube", &
    2109             :                           description="If the MO cube file should be written. If false, the eigenvalues are still computed."// &
    2110             :                           " Can also be useful in combination with STM calculations", &
    2111        8546 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    2112        8546 :       CALL section_add_keyword(print_key, keyword)
    2113        8546 :       CALL keyword_release(keyword)
    2114             : 
    2115             :       CALL keyword_create(keyword, __LOCATION__, name="nlumo", &
    2116             :                           description="If the printkey is activated controls the number of lumos"// &
    2117             :                           " that are printed and dumped as a cube (-1=all)", &
    2118        8546 :                           default_i_val=0)
    2119        8546 :       CALL section_add_keyword(print_key, keyword)
    2120        8546 :       CALL keyword_release(keyword)
    2121             :       CALL keyword_create( &
    2122             :          keyword, __LOCATION__, name="nhomo", &
    2123             :          description="If the printkey is activated controls the number of homos that dumped as a cube (-1=all),"// &
    2124             :          " eigenvalues are always all dumped", &
    2125        8546 :          default_i_val=1)
    2126        8546 :       CALL section_add_keyword(print_key, keyword)
    2127        8546 :       CALL keyword_release(keyword)
    2128             : 
    2129             :       CALL keyword_create( &
    2130             :          keyword, __LOCATION__, name="homo_list", &
    2131             :          description="If the printkey is activated controls the index of homos dumped as a cube,"// &
    2132             :          " eigenvalues are always all dumped. It overrides nhomo.", &
    2133             :          usage="HOMO_LIST {integer}  {integer} ..  {integer} ", type_of_var=integer_t, &
    2134        8546 :          n_var=-1, repeats=.TRUE.)
    2135        8546 :       CALL section_add_keyword(print_key, keyword)
    2136        8546 :       CALL keyword_release(keyword)
    2137             : 
    2138             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2139             :                           description="append the cube files when they already exist", &
    2140        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2141        8546 :       CALL section_add_keyword(print_key, keyword)
    2142        8546 :       CALL keyword_release(keyword)
    2143             : 
    2144        8546 :    END SUBROUTINE create_mo_cubes_section
    2145             : 
    2146             : ! **************************************************************************************************
    2147             : !> \brief ...
    2148             : !> \param print_key ...
    2149             : ! **************************************************************************************************
    2150        8546 :    SUBROUTINE create_dos_section(print_key)
    2151             : 
    2152             :       TYPE(section_type), POINTER                        :: print_key
    2153             : 
    2154             :       TYPE(keyword_type), POINTER                        :: keyword
    2155             : 
    2156        8546 :       NULLIFY (keyword)
    2157             : 
    2158             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "DOS", &
    2159             :                                        description="Print Density of States (DOS) (only available states from SCF)", &
    2160        8546 :                                        print_level=debug_print_level, common_iter_levels=1, filename="")
    2161             : 
    2162             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2163             :                           description="Append the DOS obtained at different iterations to the output file. "// &
    2164             :                           "By default the file is overwritten", &
    2165             :                           usage="APPEND", default_l_val=.FALSE., &
    2166        8546 :                           lone_keyword_l_val=.TRUE.)
    2167        8546 :       CALL section_add_keyword(print_key, keyword)
    2168        8546 :       CALL keyword_release(keyword)
    2169             : 
    2170             :       CALL keyword_create(keyword, __LOCATION__, name="DELTA_E", &
    2171             :                           description="Histogramm energy spacing.", &
    2172        8546 :                           usage="DELTA_E 0.0005", type_of_var=real_t, default_r_val=0.001_dp)
    2173        8546 :       CALL section_add_keyword(print_key, keyword)
    2174        8546 :       CALL keyword_release(keyword)
    2175             : 
    2176             :       CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
    2177             :                           description="Specify the number of digits used to print density and occupation", &
    2178        8546 :                           default_i_val=4)
    2179        8546 :       CALL section_add_keyword(print_key, keyword)
    2180        8546 :       CALL keyword_release(keyword)
    2181             : 
    2182        8546 :    END SUBROUTINE create_dos_section
    2183             : 
    2184             : ! **************************************************************************************************
    2185             : !> \brief ...
    2186             : !> \param print_key ...
    2187             : ! **************************************************************************************************
    2188       25638 :    SUBROUTINE create_pdos_section(print_key)
    2189             : 
    2190             :       TYPE(section_type), POINTER                        :: print_key
    2191             : 
    2192             :       TYPE(keyword_type), POINTER                        :: keyword
    2193             :       TYPE(section_type), POINTER                        :: subsection
    2194             : 
    2195       25638 :       NULLIFY (subsection)
    2196       25638 :       NULLIFY (keyword)
    2197             : 
    2198             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PDOS", &
    2199             :                                        description="Print out the DOS projected per kind and per angular momentum  ", &
    2200       25638 :                                        print_level=debug_print_level, common_iter_levels=1, filename="")
    2201             :       CALL keyword_create(keyword, __LOCATION__, name="COMPONENTS", &
    2202             :                           description="Print out pdos distinguishing all angular momentum components.", &
    2203             :                           usage="COMPONENTS", default_l_val=.FALSE., &
    2204       25638 :                           lone_keyword_l_val=.TRUE.)
    2205       25638 :       CALL section_add_keyword(print_key, keyword)
    2206       25638 :       CALL keyword_release(keyword)
    2207             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2208             :                           description="Append the pdos obtained at different iterations to the pdos  output file. "// &
    2209             :                           "By default the file is overwritten", &
    2210             :                           usage="APPEND", default_l_val=.FALSE., &
    2211       25638 :                           lone_keyword_l_val=.TRUE.)
    2212       25638 :       CALL section_add_keyword(print_key, keyword)
    2213       25638 :       CALL keyword_release(keyword)
    2214             :       CALL keyword_create( &
    2215             :          keyword, __LOCATION__, name="NLUMO", &
    2216             :          description="Number of virtual orbitals to be added to the MO set (-1=all)."//newline// &
    2217             :          "CAUTION: Setting this value to be higher than the number of states present may cause a Cholesky error.", &
    2218       25638 :          usage="NLUMO integer", default_i_val=0)
    2219       25638 :       CALL section_add_keyword(print_key, keyword)
    2220       25638 :       CALL keyword_release(keyword)
    2221             :       CALL keyword_create(keyword, __LOCATION__, name="OUT_EACH_MO", &
    2222             :                           description="Output on the status of the calculation every OUT_EACH_MO states. If -1 no output", &
    2223       25638 :                           usage="OUT_EACH_MO integer", default_i_val=-1)
    2224       25638 :       CALL section_add_keyword(print_key, keyword)
    2225       25638 :       CALL keyword_release(keyword)
    2226             : 
    2227             :       CALL section_create(subsection, __LOCATION__, name="LDOS", &
    2228             :                           description="Controls the printing of local PDOS, projected on subsets"// &
    2229             :                           " of atoms given through lists", &
    2230       25638 :                           n_keywords=4, n_subsections=0, repeats=.TRUE.)
    2231             :       CALL keyword_create(keyword, __LOCATION__, name="COMPONENTS", &
    2232             :                           description="Print out pdos distinguishing all angular momentum components.", &
    2233             :                           usage="COMPONENTS", default_l_val=.FALSE., &
    2234       25638 :                           lone_keyword_l_val=.TRUE.)
    2235       25638 :       CALL section_add_keyword(subsection, keyword)
    2236       25638 :       CALL keyword_release(keyword)
    2237             : 
    2238             :       CALL keyword_create(keyword, __LOCATION__, name="LIST", &
    2239             :                           description="Specifies a list of indexes of atoms where to project the DOS  ", &
    2240             :                           usage="LIST {integer}  {integer} ..  {integer} ", type_of_var=integer_t, &
    2241       25638 :                           n_var=-1, repeats=.TRUE.)
    2242       25638 :       CALL section_add_keyword(subsection, keyword)
    2243       25638 :       CALL keyword_release(keyword)
    2244             : 
    2245       25638 :       CALL section_add_subsection(print_key, subsection)
    2246       25638 :       CALL section_release(subsection)
    2247             : 
    2248             :       CALL section_create(subsection, __LOCATION__, name="R_LDOS", &
    2249             :                           description="Controls the printing of local PDOS, projected on 3D volume in real space,"// &
    2250             :                           " the volume is defined in terms of position with respect to atoms in the lists", &
    2251       25638 :                           n_keywords=4, n_subsections=0, repeats=.TRUE.)
    2252             : 
    2253             :       CALL keyword_create(keyword, __LOCATION__, name="LIST", &
    2254             :                           description="Specifies a list of indexes of atoms used to define the real space volume  ", &
    2255             :                           usage="LIST {integer}  {integer} ..  {integer} ", type_of_var=integer_t, &
    2256       25638 :                           n_var=-1, repeats=.TRUE.)
    2257       25638 :       CALL section_add_keyword(subsection, keyword)
    2258       25638 :       CALL keyword_release(keyword)
    2259             : 
    2260             :       CALL keyword_create(keyword, __LOCATION__, name="XRANGE", &
    2261             :                           description="range of positions in Cartesian direction x: all grid points within "// &
    2262             :                           "this range from at least one atom of the list are considered", &
    2263       25638 :                           usage="XRANGE -10.0 10.0", unit_str="angstrom", n_var=2, type_of_var=real_t)
    2264       25638 :       CALL section_add_keyword(subsection, keyword)
    2265       25638 :       CALL keyword_release(keyword)
    2266             :       CALL keyword_create(keyword, __LOCATION__, name="YRANGE", &
    2267             :                           description="range of positions in Cartesian direction y: all grid points within "// &
    2268             :                           "this range from at least one atom of the list are considered", &
    2269       25638 :                           usage="YRANGE -10.0 10.0", unit_str="angstrom", n_var=2, type_of_var=real_t)
    2270       25638 :       CALL section_add_keyword(subsection, keyword)
    2271       25638 :       CALL keyword_release(keyword)
    2272             :       CALL keyword_create(keyword, __LOCATION__, name="ZRANGE", &
    2273             :                           description="range of positions in Cartesian direction z: all grid points within "// &
    2274             :                           "this range from at least one atom of the list are considered", &
    2275       25638 :                           usage="ZRANGE -10.0 10.0", unit_str="angstrom", n_var=2, type_of_var=real_t)
    2276       25638 :       CALL section_add_keyword(subsection, keyword)
    2277       25638 :       CALL keyword_release(keyword)
    2278             : 
    2279             :       CALL keyword_create(keyword, __LOCATION__, name="ERANGE", &
    2280             :                           description="only project states with the eigenvalues in the given interval. "// &
    2281             :                           "Default is all states.", &
    2282       25638 :                           usage="ERANGE -1.0 1.0", unit_str="hartree", n_var=2, type_of_var=real_t)
    2283       25638 :       CALL section_add_keyword(subsection, keyword)
    2284       25638 :       CALL keyword_release(keyword)
    2285             : 
    2286       25638 :       CALL section_add_subsection(print_key, subsection)
    2287       25638 :       CALL section_release(subsection)
    2288             : 
    2289       25638 :    END SUBROUTINE create_pdos_section
    2290             : 
    2291             : ! **************************************************************************************************
    2292             : !> \brief ...
    2293             : !> \param print_key ...
    2294             : ! **************************************************************************************************
    2295        8546 :    SUBROUTINE create_wannier_section(print_key)
    2296             : 
    2297             :       TYPE(section_type), POINTER                        :: print_key
    2298             : 
    2299             :       TYPE(keyword_type), POINTER                        :: keyword
    2300             : 
    2301        8546 :       NULLIFY (keyword)
    2302             : 
    2303             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "WANNIER90", &
    2304             :                                        description="Interface to Wannier90 code. (EXPERIMENTAL)", &
    2305        8546 :                                        print_level=debug_print_level, common_iter_levels=1, filename="")
    2306             : 
    2307             :       CALL keyword_create(keyword, __LOCATION__, name="SEED_NAME", &
    2308             :                           description="The seedname for the Wannier90 calculation (body of filenames).", &
    2309             :                           usage="SEED_NAME  filename", default_c_val="wannier90", &
    2310        8546 :                           n_var=1, type_of_var=char_t)
    2311        8546 :       CALL section_add_keyword(print_key, keyword)
    2312        8546 :       CALL keyword_release(keyword)
    2313             : 
    2314             :       CALL keyword_create(keyword, __LOCATION__, name="MP_GRID", &
    2315             :                           description="The dimensions of the Monkhorst-Pack k-point grid. ", &
    2316        8546 :                           usage="MP_GRID 6 6 6", n_var=-1, default_i_vals=(/10, 10, 10/), type_of_var=integer_t)
    2317        8546 :       CALL section_add_keyword(print_key, keyword)
    2318        8546 :       CALL keyword_release(keyword)
    2319             : 
    2320             :       CALL keyword_create(keyword, __LOCATION__, name="ADDED_MOS", &
    2321             :                           variants=(/"ADDED_BANDS"/), &
    2322             :                           description="Number of MOs/Bands added to the Band Structure calculation.", &
    2323       17092 :                           default_i_val=0)
    2324        8546 :       CALL section_add_keyword(print_key, keyword)
    2325        8546 :       CALL keyword_release(keyword)
    2326             : 
    2327             :       CALL keyword_create(keyword, __LOCATION__, name="EXCLUDE_BANDS", &
    2328             :                           description="List of Bands excluded in the Wannier calculation.", &
    2329             :                           usage="EXCLUDE_BANDS b1 b2 ...", n_var=-1, repeats=.TRUE., &
    2330        8546 :                           type_of_var=integer_t)
    2331        8546 :       CALL section_add_keyword(print_key, keyword)
    2332        8546 :       CALL keyword_release(keyword)
    2333             : 
    2334             :       CALL keyword_create(keyword, __LOCATION__, name="WANNIER_FUNCTIONS", &
    2335             :                           description="Number of Wannier functions to be calculated. ", &
    2336             :                           usage="WANNIER_FUNCTIONS 6", n_var=1, default_i_val=0, &
    2337        8546 :                           repeats=.TRUE., type_of_var=integer_t)
    2338        8546 :       CALL section_add_keyword(print_key, keyword)
    2339        8546 :       CALL keyword_release(keyword)
    2340             : 
    2341        8546 :    END SUBROUTINE create_wannier_section
    2342             : 
    2343             : ! **************************************************************************************************
    2344             : !> \brief ...
    2345             : !> \param print_key ...
    2346             : ! **************************************************************************************************
    2347        8546 :    SUBROUTINE create_stm_section(print_key)
    2348             :       TYPE(section_type), POINTER                        :: print_key
    2349             : 
    2350             :       TYPE(keyword_type), POINTER                        :: keyword
    2351             : 
    2352        8546 :       NULLIFY (keyword)
    2353             : 
    2354             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "STM", &
    2355             :                                        description="Controls the printing of cubes for the generation of STM images.", &
    2356        8546 :                                        print_level=debug_print_level, filename="")
    2357             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    2358             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    2359             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    2360             :                           " 1 number valid for all components.", &
    2361        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    2362        8546 :       CALL section_add_keyword(print_key, keyword)
    2363        8546 :       CALL keyword_release(keyword)
    2364             : 
    2365             :       CALL keyword_create(keyword, __LOCATION__, name="nlumo", &
    2366             :                           description="If the printkey is activated controls the number of additional lumos"// &
    2367             :                           " that are computed to be able to reproduce STM images obtained"// &
    2368             :                           "  from positive bias (imaging unoccupied states)", &
    2369        8546 :                           default_i_val=0)
    2370        8546 :       CALL section_add_keyword(print_key, keyword)
    2371        8546 :       CALL keyword_release(keyword)
    2372             : 
    2373             :       CALL keyword_create(keyword, __LOCATION__, name="BIAS", &
    2374             :                           description="Bias energy for scanning tunneling microscopy (STM) image generation. "// &
    2375             :                           "Orbital densities are summed according to the bias energy. "// &
    2376             :                           "For negative values, states in the range ]EF+bias,EF] are summed, "// &
    2377             :                           "While positive values sum states in the range [EF,EF+bias[. "// &
    2378             :                           "If positive biases are used, sufficiently many unoccupied stated "// &
    2379             :                           "(see ADDED_MOS and NLUMO ) should be computed.", &
    2380        8546 :                           n_var=-1, type_of_var=real_t, default_r_vals=(/0.0_dp/), unit_str='eV')
    2381        8546 :       CALL section_add_keyword(print_key, keyword)
    2382        8546 :       CALL keyword_release(keyword)
    2383             : 
    2384             :       CALL keyword_create(keyword, __LOCATION__, name="TH_TORB", &
    2385             :                           description="Tip orbital symmetry in Tersoff-Hamann approximation to compute STM images", &
    2386             :                           repeats=.TRUE., &
    2387             :                           default_i_val=orb_s, &
    2388             :                           usage="TH_TORB s dz2", &
    2389             :                           enum_c_vals=s2a("S", "PX", "PY", "PZ", "DXY", "DYZ", "DZX", "DX2", "DY2", "DZ2"), &
    2390             :                           enum_i_vals=(/orb_s, orb_px, orb_py, orb_pz, orb_dxy, orb_dyz, orb_dzx, orb_dx2, orb_dy2, orb_dz2/), &
    2391             :                           enum_desc=s2a("s orbital", "px orbital", "py orbital", "pz orbital", &
    2392        8546 :                                         "dxy orbital", "dyz orbital", "dzx orbital", "x^2 orbital", "y^2 orbital", "z^2 orbital"))
    2393        8546 :       CALL section_add_keyword(print_key, keyword)
    2394        8546 :       CALL keyword_release(keyword)
    2395             : 
    2396             :       CALL keyword_create(keyword, __LOCATION__, name="REF_ENERGY", &
    2397             :                           description="By default the reference energy is the Fermi energy. In order to compare"// &
    2398             :                           " with STS experiments, where specific energy ranges are addressed, here"// &
    2399             :                           "  one can set a different reference energy."// &
    2400             :                           " The energy range is anyway controlled by the BIAS", &
    2401        8546 :                           type_of_var=real_t, default_r_val=0.0_dp, unit_str='eV')
    2402        8546 :       CALL section_add_keyword(print_key, keyword)
    2403        8546 :       CALL keyword_release(keyword)
    2404             : 
    2405             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2406             :                           description="append the cube files when they already exist", &
    2407        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2408        8546 :       CALL section_add_keyword(print_key, keyword)
    2409        8546 :       CALL keyword_release(keyword)
    2410             : 
    2411        8546 :    END SUBROUTINE create_stm_section
    2412             : 
    2413             : ! **************************************************************************************************
    2414             : !> \brief ...
    2415             : !> \param section ...
    2416             : ! **************************************************************************************************
    2417        8546 :    SUBROUTINE create_wfn_mix_section(section)
    2418             : 
    2419             :       TYPE(section_type), POINTER                        :: section
    2420             : 
    2421             :       TYPE(keyword_type), POINTER                        :: keyword
    2422             :       TYPE(section_type), POINTER                        :: subsection
    2423             : 
    2424        8546 :       NULLIFY (subsection)
    2425        8546 :       NULLIFY (keyword)
    2426             : 
    2427        8546 :       CPASSERT(.NOT. ASSOCIATED(section))
    2428             : 
    2429             :       CALL section_create(section, __LOCATION__, name="WFN_MIX", &
    2430             :                           description="A section that allows manipulation of the MO coeffs, "// &
    2431             :                           "e.g. for changing a ground state into an excited state. "// &
    2432             :                           "Starting from a copy of the original MOs, changes can be made "// &
    2433             :                           "by adding linear combinations of HOMO/LUMO of the original MOs to the result MOs. "// &
    2434             :                           "This method is called after an SCF optimization or before an RTP run if "// &
    2435             :                           "INITIAL_WFN=RESTART_WFN. Note that if called after an SCF optimization, a restart file "// &
    2436             :                           "with the mixed MOs is saved. This is not the case for an RTP with "// &
    2437             :                           "INITIAL_WFN=RESTART_WFN.", &
    2438        8546 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2439             : 
    2440             :       CALL keyword_create(keyword, __LOCATION__, name="OVERWRITE_MOS", &
    2441             :                         description="If set to True, the active molecular orbitals in memory will be replaced by the mixed wfn "// &
    2442             :                         "at the end of the wfn mixing procedure. For instance, you can then use this new set of MOs to perform "// &
    2443             :                      "RTP or EMD directly. Note that in the case of an RTP run with INITIAL_WFN=RESTART_WFN, the OVERWRITE_MOS "// &
    2444             :                           "keyword is not used.", &
    2445        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2446        8546 :       CALL section_add_keyword(section, keyword)
    2447        8546 :       CALL keyword_release(keyword)
    2448             : 
    2449             :       CALL section_create(subsection, __LOCATION__, name="UPDATE", &
    2450             :                           description="Update a result MO with with a linear combination of original MOs."// &
    2451             :                           " This section can be repeated to build arbitrary linear combinations using repeatedly y=a*y+b*x. "// &
    2452             :                           "RESULT is (y), RESULT_SCALE is (a), ORIG is (x), ORIG_SCALE is (b)", &
    2453        8546 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    2454             : 
    2455             :       CALL keyword_create(keyword, __LOCATION__, name="RESULT_MO_INDEX", &
    2456             :                           description="Index of the MO (y) to be modified. Counting down in energy: "// &
    2457             :                           "set to 1 for the highest MO, to 3 for the highest MO-2.", &
    2458        8546 :                           usage="RESULT_MO_INDEX 1", type_of_var=integer_t, default_i_val=0)
    2459        8546 :       CALL section_add_keyword(subsection, keyword)
    2460        8546 :       CALL keyword_release(keyword)
    2461             : 
    2462             :       CALL keyword_create(keyword, __LOCATION__, name="RESULT_MARKED_STATE", &
    2463             :                           description="Specifies the MO according to "// &
    2464             :                           "the marks set in MOLECULAR_STATES. The value corresponds to the repetition "// &
    2465             :                           "of MARK_STATES in MOLECULAR_STATES", &
    2466        8546 :                           usage="ORIG_MARKED_STATE 1", type_of_var=integer_t, default_i_val=0)
    2467        8546 :       CALL section_add_keyword(subsection, keyword)
    2468        8546 :       CALL keyword_release(keyword)
    2469             : 
    2470             :       CALL keyword_create(keyword, __LOCATION__, name="REVERSE_MO_INDEX", &
    2471             :                           description="Reverses the index order of the OCCUPIED and EXTERNAL MOs. With this keyword "// &
    2472             :                           "ORIG_MO_INDEX/RESULT_MO_INDEX 1 point to the lowest energy MO (instead of the highest) "// &
    2473             :                           "and counts up in energy. The VIRTUAL MOs indexing is unchanged.", &
    2474        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2475        8546 :       CALL section_add_keyword(subsection, keyword)
    2476        8546 :       CALL keyword_release(keyword)
    2477             : 
    2478             :       CALL keyword_create(keyword, __LOCATION__, name="RESULT_SPIN_INDEX", &
    2479             :                           description="Spin of the MO (y) to be modified.", &
    2480             :                           enum_c_vals=s2a("Alpha", "Beta"), &
    2481             :                           enum_i_vals=(/1, 2/), & ! direct index in array
    2482             :                           default_i_val=1, &
    2483        8546 :                           enum_desc=s2a("Majority spin", "Minority spin"))
    2484        8546 :       CALL section_add_keyword(subsection, keyword)
    2485        8546 :       CALL keyword_release(keyword)
    2486             : 
    2487             :       CALL keyword_create(keyword, __LOCATION__, name="RESULT_SCALE", &
    2488             :                           description="Scaling factor of the result variable (a).", &
    2489        8546 :                           usage="RESULT_SCALE 0.0", type_of_var=real_t)
    2490        8546 :       CALL section_add_keyword(subsection, keyword)
    2491        8546 :       CALL keyword_release(keyword)
    2492             : 
    2493             :       CALL keyword_create(keyword, __LOCATION__, name="ORIG_MO_INDEX", &
    2494             :                           description="Index of the original MO (x). "// &
    2495             :                           "If ORIG_TYPE is OCCUPIED, it counts down in energy: set to 1 to point to "// &
    2496             :                           "the highest MO and to 3 for the highest MO-2. "// &
    2497             :                           "If ORIG_TYPE is VIRTUAL, it counts up in energy: set to 1 to point to "// &
    2498             :                           "the lowest virtual MO and to 3 for the lowest MO+2. "// &
    2499             :                           "If ORIG_TYPE is EXTERNAL, it counts down in energy for the external "// &
    2500             :                           "set of MOs: set to 1 to point to the highest MO and to 3 for the highest MO-2. "// &
    2501             :                           "Do not set to zero or negative values.", &
    2502        8546 :                           usage="ORIG_MO_INDEX 1", type_of_var=integer_t, default_i_val=0)
    2503        8546 :       CALL section_add_keyword(subsection, keyword)
    2504        8546 :       CALL keyword_release(keyword)
    2505             : 
    2506             :       CALL keyword_create(keyword, __LOCATION__, name="ORIG_MARKED_STATE", &
    2507             :                           description="Specifies the MO according to "// &
    2508             :                           "the marks set in MOLECULAR_STATES. The value corresponds to the repetition "// &
    2509             :                           "of MARK_STATES in MOLECULAR_STATES", &
    2510        8546 :                           usage="ORIG_MARKED_STATE 1", type_of_var=integer_t, default_i_val=0)
    2511        8546 :       CALL section_add_keyword(subsection, keyword)
    2512        8546 :       CALL keyword_release(keyword)
    2513             : 
    2514             :       CALL keyword_create(keyword, __LOCATION__, name="ORIG_SPIN_INDEX", &
    2515             :                           description="Spin of the MO (x) to be modified.", &
    2516             :                           enum_c_vals=s2a("Alpha", "Beta"), &
    2517             :                           enum_i_vals=(/1, 2/), & ! direct index in array
    2518             :                           default_i_val=1, &
    2519        8546 :                           enum_desc=s2a("Majority spin", "Minority spin"))
    2520        8546 :       CALL section_add_keyword(subsection, keyword)
    2521        8546 :       CALL keyword_release(keyword)
    2522             : 
    2523             :       CALL keyword_create(keyword, __LOCATION__, name="ORIG_SCALE", &
    2524             :                           description="Scaling factor of the original variable (b).", &
    2525        8546 :                           usage="ORIG_SCALE 0.0", type_of_var=real_t)
    2526        8546 :       CALL section_add_keyword(subsection, keyword)
    2527        8546 :       CALL keyword_release(keyword)
    2528             : 
    2529             :       CALL keyword_create(keyword, __LOCATION__, name="ORIG_TYPE", &
    2530             :                           description="Type of the original MO. Note that if ADDED_MOS was used in the "// &
    2531             :                           "SCF construction of the MO matrix, these extra MOs are also treated as OCCUPIED. ", &
    2532             :                           enum_c_vals=s2a("OCCUPIED", "VIRTUAL", 'EXTERNAL'), &
    2533             :                           usage="ORIG_TYPE OCCUPIED", &
    2534             :                           default_i_val=wfn_mix_orig_occ, &
    2535             :                           enum_desc=s2a("The original MO is the result of the SCF procedure. This can also contain "// &
    2536             :                                         "unoccupied MOs if the SCF%ADDED_MOS keyword was used.", &
    2537             :                                         "The original MO is taken from the result of additional MOs calculated a "// &
    2538             :                                         "posteriori of the SCF by request of the user. E.g. by specifying print%mo_cubes%nlumo. ", &
    2539             :                                         "The orginal MO is from an external .wfn file. Use the keyword "// &
    2540             :                                         "ORIG_EXT_FILE_NAME to define its name."), &
    2541        8546 :                           enum_i_vals=(/wfn_mix_orig_occ, wfn_mix_orig_virtual, wfn_mix_orig_external/))
    2542        8546 :       CALL section_add_keyword(subsection, keyword)
    2543        8546 :       CALL keyword_release(keyword)
    2544             : 
    2545             :       CALL keyword_create(keyword, __LOCATION__, name="ORIG_EXT_FILE_NAME", &
    2546             :                           description="Name of the wavefunction file to read the original MO from. "// &
    2547             :                           "For instance, a restart wfn file from SCF calculation or an excited state from XAS_TDP calculation. "// &
    2548             :                           "If no file is specified, the run will crash. "// &
    2549             :                           "Currently, a RTP restart file (.rtpwfn) cannot be used as reference. "// &
    2550             :                           "Currently, this file SHALL have the basis set, number of MO and the same number of spin as the one "// &
    2551             :                           "from the SCF cycle.", &
    2552             :                           usage="ORIG_EXT_FILE_NAME <FILENAME>", &
    2553        8546 :                           default_lc_val="EMPTY")
    2554        8546 :       CALL section_add_keyword(subsection, keyword)
    2555        8546 :       CALL keyword_release(keyword)
    2556             : 
    2557        8546 :       CALL section_add_subsection(section, subsection)
    2558        8546 :       CALL section_release(subsection)
    2559             : 
    2560        8546 :    END SUBROUTINE create_wfn_mix_section
    2561             : 
    2562             : ! **************************************************************************************************
    2563             : !> \brief Creates the section for cube files related to the implicit Poisson solver.
    2564             : !> \param section the section to be created
    2565             : !> \par History
    2566             : !>      03.2016 refactored from create_print_dft_section [Hossein Bani-Hashemian]
    2567             : !> \author Mohammad Hossein Bani-Hashemian
    2568             : ! **************************************************************************************************
    2569        8546 :    SUBROUTINE create_implicit_psolver_section(section)
    2570             :       TYPE(section_type), POINTER                        :: section
    2571             : 
    2572             :       TYPE(keyword_type), POINTER                        :: keyword
    2573             :       TYPE(section_type), POINTER                        :: print_key
    2574             : 
    2575        8546 :       CPASSERT(.NOT. ASSOCIATED(section))
    2576             :       CALL section_create(section, __LOCATION__, name="IMPLICIT_PSOLVER", &
    2577             :                           description="Controls printing of cube files for data from the implicit "// &
    2578             :                           "(generalized) Poisson solver.", &
    2579             :                           citations=(/BaniHashemian2016/), &
    2580       17092 :                           n_keywords=0, n_subsections=3, repeats=.FALSE.)
    2581             : 
    2582        8546 :       NULLIFY (keyword, print_key)
    2583             : 
    2584             :       ! dielectric constant function
    2585             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "DIELECTRIC_CUBE", &
    2586             :                                        description="Controls the printing of a cube file with dielectric constant from "// &
    2587             :                                        "the implicit (generalized) Poisson solver.", &
    2588        8546 :                                        print_level=high_print_level, filename="")
    2589             : 
    2590             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    2591             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    2592             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    2593             :                           " 1 number valid for all components.", &
    2594        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    2595        8546 :       CALL section_add_keyword(print_key, keyword)
    2596        8546 :       CALL keyword_release(keyword)
    2597             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2598             :                           description="append the cube files when they already exist", &
    2599        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2600        8546 :       CALL section_add_keyword(print_key, keyword)
    2601        8546 :       CALL keyword_release(keyword)
    2602             : 
    2603        8546 :       CALL section_add_subsection(section, print_key)
    2604        8546 :       CALL section_release(print_key)
    2605             : 
    2606             :       ! dirichlet type constraints
    2607             :       CALL cp_print_key_section_create( &
    2608             :          print_key, __LOCATION__, "DIRICHLET_BC_CUBE", &
    2609             :          description="Controls the printing of cube files with unit step functions (constraints)"// &
    2610             :          " representing Dirichlet-type (boundary) regions defined in the implicit (generalized) Poisson"// &
    2611             :          " solver section. The regions remain unchanged throughout the calculations. If the Dirichlet"// &
    2612             :          " regions are relatively large and/or the number of partitions is quite high, in order to save memory,"// &
    2613             :          " generate the cube files in early steps and perform the rest of the calculations with this keyword"// &
    2614             :          " switched off.", &
    2615        8546 :          print_level=high_print_level, filename="")
    2616             : 
    2617             :       CALL keyword_create(keyword, __LOCATION__, name="TILE_CUBES", &
    2618             :                           description="Print tiles that tessellate the Dirichlet regions into cube files. If TRUE, "// &
    2619             :                           "generates cube files as many as the total number of tiles.", &
    2620             :                           usage="TILE_CUBES <logical>", &
    2621        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2622        8546 :       CALL section_add_keyword(print_key, keyword)
    2623        8546 :       CALL keyword_release(keyword)
    2624             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    2625             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    2626             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    2627             :                           " 1 number valid for all components.", &
    2628        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    2629        8546 :       CALL section_add_keyword(print_key, keyword)
    2630        8546 :       CALL keyword_release(keyword)
    2631             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2632             :                           description="append the cube files when they already exist", &
    2633        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2634        8546 :       CALL section_add_keyword(print_key, keyword)
    2635        8546 :       CALL keyword_release(keyword)
    2636             : 
    2637        8546 :       CALL section_add_subsection(section, print_key)
    2638        8546 :       CALL section_release(print_key)
    2639             : 
    2640             :       ! charge introduced by Lagrange multipliers
    2641             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "DIRICHLET_CSTR_CHARGE_CUBE", &
    2642             :                                        description="Controls the printing of cube files with penalty charges induced to "// &
    2643             :                                        "Dirichlet regions by Lagrange multipliers (implicit Poisson solver).", &
    2644        8546 :                                        print_level=high_print_level, filename="")
    2645             : 
    2646             :       CALL keyword_create(keyword, __LOCATION__, name="stride", &
    2647             :                           description="The stride (X,Y,Z) used to write the cube file "// &
    2648             :                           "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
    2649             :                           " 1 number valid for all components.", &
    2650        8546 :                           usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
    2651        8546 :       CALL section_add_keyword(print_key, keyword)
    2652        8546 :       CALL keyword_release(keyword)
    2653             :       CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
    2654             :                           description="append the cube files when they already exist", &
    2655        8546 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2656        8546 :       CALL section_add_keyword(print_key, keyword)
    2657        8546 :       CALL keyword_release(keyword)
    2658             : 
    2659        8546 :       CALL section_add_subsection(section, print_key)
    2660        8546 :       CALL section_release(print_key)
    2661             : 
    2662        8546 :    END SUBROUTINE create_implicit_psolver_section
    2663             : 
    2664             : ! **************************************************************************************************
    2665             : !> \brief creates the interpolation section for the periodic QM/MM
    2666             : !> \param section ...
    2667             : !> \author tlaino
    2668             : ! **************************************************************************************************
    2669        8546 :    SUBROUTINE create_gspace_interp_section(section)
    2670             :       TYPE(section_type), POINTER                        :: section
    2671             : 
    2672             :       TYPE(keyword_type), POINTER                        :: keyword
    2673             :       TYPE(section_type), POINTER                        :: print_key
    2674             : 
    2675        8546 :       CPASSERT(.NOT. ASSOCIATED(section))
    2676             :       CALL section_create(section, __LOCATION__, name="interpolator", &
    2677             :                           description="controls the interpolation for the G-space term", &
    2678        8546 :                           n_keywords=5, n_subsections=0, repeats=.FALSE.)
    2679             : 
    2680        8546 :       NULLIFY (keyword, print_key)
    2681             : 
    2682             :       CALL keyword_create(keyword, __LOCATION__, name="aint_precond", &
    2683             :                           description="the approximate inverse to use to get the starting point"// &
    2684             :                           " for the linear solver of the spline3 methods", &
    2685             :                           usage="kind spline3", &
    2686             :                           default_i_val=precond_spl3_aint, &
    2687             :                           enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_precond1", &
    2688             :                                           "spl3_nopbc_aint2", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
    2689             :                           enum_i_vals=(/no_precond, precond_spl3_aint, precond_spl3_1, &
    2690        8546 :                                         precond_spl3_aint2, precond_spl3_2, precond_spl3_3/))
    2691        8546 :       CALL section_add_keyword(section, keyword)
    2692        8546 :       CALL keyword_release(keyword)
    2693             : 
    2694             :       CALL keyword_create(keyword, __LOCATION__, name="precond", &
    2695             :                           description="The preconditioner used"// &
    2696             :                           " for the linear solver of the spline3 methods", &
    2697             :                           usage="kind spline3", &
    2698             :                           default_i_val=precond_spl3_3, &
    2699             :                           enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_precond1", &
    2700             :                                           "spl3_nopbc_aint2", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
    2701             :                           enum_i_vals=(/no_precond, precond_spl3_aint, precond_spl3_1, &
    2702        8546 :                                         precond_spl3_aint2, precond_spl3_2, precond_spl3_3/))
    2703        8546 :       CALL section_add_keyword(section, keyword)
    2704        8546 :       CALL keyword_release(keyword)
    2705             : 
    2706             :       CALL keyword_create(keyword, __LOCATION__, name="eps_x", &
    2707             :                           description="accuracy on the solution for spline3 the interpolators", &
    2708        8546 :                           usage="eps_x 1.e-15", default_r_val=1.e-10_dp)
    2709        8546 :       CALL section_add_keyword(section, keyword)
    2710        8546 :       CALL keyword_release(keyword)
    2711             : 
    2712             :       CALL keyword_create(keyword, __LOCATION__, name="eps_r", &
    2713             :                           description="accuracy on the residual for spline3 the interpolators", &
    2714        8546 :                           usage="eps_r 1.e-15", default_r_val=1.e-10_dp)
    2715        8546 :       CALL section_add_keyword(section, keyword)
    2716        8546 :       CALL keyword_release(keyword)
    2717             : 
    2718             :       CALL keyword_create(keyword, __LOCATION__, name="max_iter", &
    2719             :                           variants=(/'maxiter'/), &
    2720             :                           description="the maximum number of iterations", &
    2721       17092 :                           usage="max_iter 200", default_i_val=100)
    2722        8546 :       CALL section_add_keyword(section, keyword)
    2723        8546 :       CALL keyword_release(keyword)
    2724             : 
    2725        8546 :       NULLIFY (print_key)
    2726             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "conv_info", &
    2727             :                                        description="if convergence information about the linear solver"// &
    2728             :                                        " of the spline methods should be printed", &
    2729             :                                        print_level=medium_print_level, each_iter_names=s2a("SPLINE_FIND_COEFFS"), &
    2730             :                                        each_iter_values=(/10/), filename="__STD_OUT__", &
    2731        8546 :                                        add_last=add_last_numeric)
    2732        8546 :       CALL section_add_subsection(section, print_key)
    2733        8546 :       CALL section_release(print_key)
    2734             : 
    2735        8546 :    END SUBROUTINE create_gspace_interp_section
    2736             : 
    2737             : END MODULE input_cp2k_print_dft

Generated by: LCOV version 1.15