LCOV - code coverage report
Current view: top level - src - input_cp2k_print_dft.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:8ebf9ad) Lines: 100.0 % 1055 1055
Test Date: 2026-01-22 06:43:13 Functions: 100.0 % 13 13

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

Generated by: LCOV version 2.0-1