LCOV - code coverage report
Current view: top level - src - input_cp2k_print_dft.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:dc8eeee) Lines: 981 981 100.0 %
Date: 2025-05-15 08:34:30 Functions: 10 10 100.0 %

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

Generated by: LCOV version 1.15