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

Generated by: LCOV version 2.0-1