LCOV - code coverage report
Current view: top level - src - input_cp2k_print_dft.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:21ef868) Lines: 100.0 % 1220 1220
Test Date: 2026-08-14 07:04:57 Functions: 100.0 % 12 12

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

Generated by: LCOV version 2.0-1