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

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

Generated by: LCOV version 1.15