LCOV - code coverage report
Current view: top level - src - input_cp2k_print_dft.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:ca6acae) Lines: 100.0 % 1023 1023
Test Date: 2026-01-02 06:29:53 Functions: 100.0 % 10 10

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

Generated by: LCOV version 2.0-1