LCOV - code coverage report
Current view: top level - src - input_cp2k_subsys.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:cccd2f3) Lines: 100.0 % 855 855
Test Date: 2026-05-06 07:07:47 Functions: 100.0 % 28 28

            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 builds the subsystem section of the input
      10              : !> \par History
      11              : !>      10.2005 split input_cp2k [fawzi]
      12              : !> \author teo & fawzi
      13              : ! **************************************************************************************************
      14              : MODULE input_cp2k_subsys
      15              : 
      16              :    USE bibliography, ONLY: Goedecker1996, &
      17              :                            Guidon2010, &
      18              :                            Hartwigsen1998, &
      19              :                            Krack2005, &
      20              :                            VandeVondele2005a, &
      21              :                            VandeVondele2007
      22              :    USE cell_types, ONLY: &
      23              :       cell_sym_cubic, cell_sym_hexagonal_gamma_120, cell_sym_hexagonal_gamma_60, &
      24              :       cell_sym_monoclinic, cell_sym_monoclinic_gamma_ab, cell_sym_none, cell_sym_orthorhombic, &
      25              :       cell_sym_rhombohedral, cell_sym_tetragonal_ab, cell_sym_tetragonal_ac, &
      26              :       cell_sym_tetragonal_bc, cell_sym_triclinic, use_perd_none, use_perd_x, use_perd_xy, &
      27              :       use_perd_xyz, use_perd_xz, use_perd_y, use_perd_yz, use_perd_z
      28              :    USE cp_output_handling, ONLY: cp_print_key_section_create, debug_print_level, &
      29              :                                  high_print_level, medium_print_level
      30              :    USE cp_units, ONLY: cp_unit_to_cp2k
      31              :    USE input_constants, ONLY: do_add, do_bondparm_covalent, do_bondparm_vdw, &
      32              :                               do_cell_cif, do_cell_cp2k, do_cell_xsc, &
      33              :                               do_cell_extxyz, do_cell_pdb, &
      34              :                               do_conn_amb7, do_conn_g87, do_conn_g96, &
      35              :                               do_conn_generate, do_conn_mol_set, do_conn_off, &
      36              :                               do_conn_psf, do_conn_psf_u, do_conn_user, &
      37              :                               do_coord_cif, do_coord_cp2k, do_coord_crd, &
      38              :                               do_coord_g96, do_coord_off, do_coord_pdb, &
      39              :                               do_coord_xtl, do_coord_xyz, do_remove, &
      40              :                               do_skip_11, do_skip_12, do_skip_13, do_skip_14, &
      41              :                               dump_pdb, gaussian
      42              :    USE input_cp2k_colvar, ONLY: create_colvar_section
      43              :    USE input_cp2k_mm, ONLY: create_neighbor_lists_section
      44              :    USE input_keyword_types, ONLY: keyword_create, keyword_release, keyword_type
      45              :    USE input_section_types, ONLY: section_add_keyword, section_add_subsection, &
      46              :                                   section_create, section_release, section_type
      47              :    USE input_val_types, ONLY: char_t, integer_t, lchar_t, real_t
      48              :    USE kinds, ONLY: dp
      49              :    USE physcon, ONLY: bohr
      50              :    USE string_utilities, ONLY: newline, s2a
      51              : #include "./base/base_uses.f90"
      52              : 
      53              :    IMPLICIT NONE
      54              :    PRIVATE
      55              : 
      56              :    LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
      57              :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_subsys'
      58              : 
      59              :    PUBLIC :: create_subsys_section, &
      60              :              create_cell_section, &
      61              :              create_structure_data_section, &
      62              :              create_rng_section, &
      63              :              create_basis_section
      64              : 
      65              : CONTAINS
      66              : 
      67              : ! **************************************************************************************************
      68              : !> \brief creates the cell section
      69              : !> \param section ...
      70              : !> \param periodic ...
      71              : !> \author Ole Schuett
      72              : ! **************************************************************************************************
      73        22926 :    SUBROUTINE create_cell_section(section, periodic)
      74              :       TYPE(section_type), POINTER                        :: section
      75              :       INTEGER, INTENT(IN), OPTIONAL                      :: periodic
      76              : 
      77              :       TYPE(section_type), POINTER                        :: subsection
      78              : 
      79        22926 :       CPASSERT(.NOT. ASSOCIATED(section))
      80              :       CALL section_create(section, __LOCATION__, "CELL", &
      81              :                           description="Input parameters needed to set up the simulation cell. "// &
      82              :                           "Simple products and fractions combined with functions of a single "// &
      83              :                           "number can be used like 2/3, 0.3*COS(60) or -SQRT(3)/2. The functions "// &
      84              :                           "COS, EXP, LOG, LOG10, SIN, SQRT, and TAN are available."//newline//newline// &
      85              :                           "Cell settings are parsed in the following precedence order:"//newline// &
      86              :                           "1. The external file set by CELL_FILE_NAME with a CELL_FILE_FORMAT;"//newline// &
      87              :                           "2. The lengths and angles of cell vectors set by ABC and ALPHA_BETA_GAMMA;"//newline// &
      88              :                           "3. The vectors set by A, B, C together;"//newline// &
      89              :                           "4. If none above exist, the external file set by TOPOLOGY/COORD_FILE_NAME with "// &
      90              :                           "suitable TOPOLOGY/COORD_FILE_FORMAT may also be parsed for FORCE_EVAL/SUBSYS/CELL "// &
      91        22926 :                           "but not for FORCE_EVAL/QMMM/CELL.")
      92        22926 :       CALL create_cell_section_low(section, periodic)
      93              : 
      94        22926 :       NULLIFY (subsection)
      95              :       CALL section_create(subsection, __LOCATION__, "CELL_REF", &
      96              :                           description="Input parameters needed to set up the reference cell for "// &
      97              :                           "FORCE_EVAL/SUBSYS/CELL. This option can be used to keep the FFT grid "// &
      98              :                           "fixed while running a cell optimization or NpT molecular dynamics. "// &
      99        22926 :                           "Check the &CELL section for further details.")
     100        22926 :       CALL create_cell_section_low(subsection, periodic)
     101        22926 :       CALL section_add_subsection(section, subsection)
     102        22926 :       CALL section_release(subsection)
     103              : 
     104        22926 :    END SUBROUTINE create_cell_section
     105              : 
     106              : ! **************************************************************************************************
     107              : !> \brief populates cell section with keywords
     108              : !> \param section ...
     109              : !> \param periodic ...
     110              : !> \author teo
     111              : ! **************************************************************************************************
     112        45852 :    SUBROUTINE create_cell_section_low(section, periodic)
     113              :       TYPE(section_type), POINTER                        :: section
     114              :       INTEGER, INTENT(IN), OPTIONAL                      :: periodic
     115              : 
     116              :       INTEGER                                            :: my_periodic
     117              :       TYPE(keyword_type), POINTER                        :: keyword
     118              : 
     119        45852 :       my_periodic = use_perd_xyz
     120        45852 :       IF (PRESENT(periodic)) my_periodic = periodic
     121              : 
     122        45852 :       NULLIFY (keyword)
     123              :       CALL keyword_create(keyword, __LOCATION__, name="A", &
     124              :                           description="Specify the Cartesian components for the cell vector A. "// &
     125              :                           "This defines the first column of the h matrix. "// &
     126              :                           "Ignored if the keywords ABC or CELL_FILE_NAME are used.", &
     127              :                           usage="A  10.000  0.000  0.000", unit_str="angstrom", &
     128        45852 :                           n_var=3, type_of_var=real_t, repeats=.FALSE.)
     129        45852 :       CALL section_add_keyword(section, keyword)
     130        45852 :       CALL keyword_release(keyword)
     131              : 
     132              :       CALL keyword_create(keyword, __LOCATION__, name="B", &
     133              :                           description="Specify the Cartesian components for the cell vector B. "// &
     134              :                           "This defines the second column of the h matrix. "// &
     135              :                           "Ignored if the keywords ABC or CELL_FILE_NAME are used.", &
     136              :                           usage="B   0.000 10.000  0.000", unit_str="angstrom", &
     137        45852 :                           n_var=3, type_of_var=real_t, repeats=.FALSE.)
     138        45852 :       CALL section_add_keyword(section, keyword)
     139        45852 :       CALL keyword_release(keyword)
     140              : 
     141              :       CALL keyword_create(keyword, __LOCATION__, name="C", &
     142              :                           description="Specify the Cartesian components for the cell vector C. "// &
     143              :                           "This defines the third column of the h matrix. "// &
     144              :                           "Ignored if the keywords ABC or CELL_FILE_NAME are used.", &
     145              :                           usage="C   0.000  0.000 10.000", unit_str="angstrom", &
     146        45852 :                           n_var=3, type_of_var=real_t, repeats=.FALSE.)
     147        45852 :       CALL section_add_keyword(section, keyword)
     148        45852 :       CALL keyword_release(keyword)
     149              : 
     150              :       CALL keyword_create(keyword, __LOCATION__, name="ABC", &
     151              :                           description="Specify the lengths of the cell vectors A, B, and C, which"// &
     152              :                           " defines the diagonal elements of h matrix for an orthorhombic cell."// &
     153              :                           " For non-orthorhombic cells it is possible either to specify the angles "// &
     154              :                           "ALPHA, BETA, GAMMA via ALPHA_BETA_GAMMA keyword or alternatively use the keywords "// &
     155              :                           "A, B, and C. The convention is that A lies along the X-axis, B is in the XY plane. "// &
     156              :                           "Ignored if CELL_FILE_NAME is used.", &
     157              :                           usage="ABC 10.000 10.000 10.000", unit_str="angstrom", &
     158        45852 :                           n_var=3, type_of_var=real_t, repeats=.FALSE.)
     159        45852 :       CALL section_add_keyword(section, keyword)
     160        45852 :       CALL keyword_release(keyword)
     161              : 
     162              :       CALL keyword_create(keyword, __LOCATION__, name="ALPHA_BETA_GAMMA", &
     163              :                           variants=["ANGLES"], &
     164              :                           description="Specify the angles between the vectors A, B and C when using the ABC keyword. "// &
     165              :                           "The convention is that A lies along the X-axis, B is in the XY plane. "// &
     166              :                           "ALPHA is the angle between B and C, BETA is the angle between A and C and "// &
     167              :                           "GAMMA is the angle between A and B.", &
     168              :                           usage="ALPHA_BETA_GAMMA [deg] 90.0 90.0 120.0", unit_str="deg", &
     169              :                           n_var=3, default_r_vals=[cp_unit_to_cp2k(value=90.0_dp, unit_str="deg"), &
     170              :                                                    cp_unit_to_cp2k(value=90.0_dp, unit_str="deg"), &
     171              :                                                    cp_unit_to_cp2k(value=90.0_dp, unit_str="deg")], &
     172       229260 :                           repeats=.FALSE.)
     173        45852 :       CALL section_add_keyword(section, keyword)
     174        45852 :       CALL keyword_release(keyword)
     175              : 
     176              :       CALL keyword_create(keyword, __LOCATION__, name="CELL_FILE_NAME", &
     177              :                           description="The external file from which cell is parsed ", &
     178              :                           repeats=.FALSE., usage="CELL_FILE_NAME <CHARACTER>", &
     179        45852 :                           type_of_var=lchar_t)
     180        45852 :       CALL section_add_keyword(section, keyword)
     181        45852 :       CALL keyword_release(keyword)
     182              : 
     183              :       CALL keyword_create(keyword, __LOCATION__, name="CELL_FILE_FORMAT", &
     184              :                           description="Format of the external file from which "// &
     185              :                           "cell is parsed. If the format specifies a cell by "// &
     186              :                           "lengths and angles of three vectors, then a cell "// &
     187              :                           "matrix is constructed with the convention that A "// &
     188              :                           "lies along the X-axis, B is in the XY plane. ALPHA "// &
     189              :                           "is the angle between B and C, BETA is the angle "// &
     190              :                           "between A and C, and GAMMA is the angle between A and B.", &
     191              :                           usage="CELL_FILE_FORMAT (CP2K|CIF|XSC|EXTXYZ|XYZ|PDB)", &
     192              :                           enum_c_vals=s2a("CP2K", "CIF", "XSC", "EXTXYZ", "XYZ", "PDB"), &
     193              :                           enum_i_vals=[do_cell_cp2k, do_cell_cif, do_cell_xsc, do_cell_extxyz, do_cell_extxyz, do_cell_pdb], &
     194              :                           enum_desc=s2a("Cell info in the CP2K native format", &
     195              :                                         "Cell info from CIF file (from fields `_cell_length_a` or `_cell.length_a`, etc)", &
     196              :                                         "Cell info in the XSC format (NAMD)", &
     197              :                                         "Cell info as `lattice=...` field in the comment line of Extended XYZ format", &
     198              :                                         "Alias for Extended XYZ", &
     199              :                                         "Cell info in the `CRYST1` record of PDB format"), &
     200        45852 :                           default_i_val=do_cell_cp2k)
     201        45852 :       CALL section_add_keyword(section, keyword)
     202        45852 :       CALL keyword_release(keyword)
     203              : 
     204              :       CALL keyword_create(keyword, __LOCATION__, name="PERIODIC", &
     205              :                           description="Specify the directions for which periodic boundary conditions (PBC) will be applied. "// &
     206              :                           "Important notice: This applies to the generation of the pair lists as well as to the "// &
     207              :                           "application of the PBCs to positions. "// &
     208              :                           "See the POISSON section to specify the periodicity used for the electrostatics. "// &
     209              :                           "Typically the settings should be the same.", &
     210              :                           usage="PERIODIC (x|y|z|xy|xz|yz|xyz|none)", &
     211              :                           enum_c_vals=s2a("x", "y", "z", "xy", "xz", "yz", "xyz", "none"), &
     212              :                           enum_i_vals=[use_perd_x, use_perd_y, use_perd_z, &
     213              :                                        use_perd_xy, use_perd_xz, use_perd_yz, &
     214              :                                        use_perd_xyz, use_perd_none], &
     215        45852 :                           default_i_val=my_periodic)
     216        45852 :       CALL section_add_keyword(section, keyword)
     217        45852 :       CALL keyword_release(keyword)
     218              : 
     219              :       CALL keyword_create(keyword, __LOCATION__, name="MULTIPLE_UNIT_CELL", &
     220              :                           description="Specifies the numbers of repetition in space (X, Y, Z) of the defined cell, "// &
     221              :                           "assuming it as a unit cell. This keyword affects only the CELL specification. The same keyword "// &
     222              :                           "in SUBSYS%TOPOLOGY%MULTIPLE_UNIT_CELL should be modified in order to affect the coordinates "// &
     223              :                           "specification.", usage="MULTIPLE_UNIT_CELL 1 1 1", &
     224        45852 :                           n_var=3, default_i_vals=[1, 1, 1], repeats=.FALSE.)
     225        45852 :       CALL section_add_keyword(section, keyword)
     226        45852 :       CALL keyword_release(keyword)
     227              : 
     228              :       CALL keyword_create( &
     229              :          keyword, __LOCATION__, name="SYMMETRY", &
     230              :          description="Imposes an initial cell symmetry, according to the convention "// &
     231              :          "that A lies along the X-axis, B is in the XY plane. After the "// &
     232              :          "input cell information is parsed, the symmetry is enforced by "// &
     233              :          "reconstructing the cell matrix from lengths and angles of the "// &
     234              :          "cell vectors, taking averages if necessary. This process does "// &
     235              :          "not affect input atomic coordinates; in case a space group is "// &
     236              :          "to be detected and preserved for an optimization task, atomic "// &
     237              :          "coordinates should correspond to cell vectors already obeying "// &
     238              :          "the convention mentioned above.", &
     239              :          usage="SYMMETRY monoclinic", &
     240              :          enum_desc=s2a("No cell symmetry", &
     241              :                        "Triclinic (a &ne; b &ne; c &ne; a, &alpha; &ne; &beta; &ne; &gamma; &ne; &alpha; &ne; 90&deg;)", &
     242              :                        "Monoclinic (a &ne; b &ne; c, &alpha; = &gamma; = 90&deg;, &beta; &ne; 90&deg;)", &
     243              :                        "Monoclinic (a = b &ne; c, &alpha; = &beta; = 90&deg;, &gamma; &ne; 90&deg;)", &
     244              :                        "Orthorhombic (a &ne; b &ne; c, &alpha; = &beta; = &gamma; = 90&deg;)", &
     245              :                        "Tetragonal (a = b &ne; c, &alpha; = &beta; = &gamma; = 90&deg;)", &
     246              :                        "Tetragonal (a = c &ne; b, &alpha; = &beta; = &gamma; = 90&deg;)", &
     247              :                        "Tetragonal (a &ne; b = c, &alpha; = &beta; = &gamma; = 90&deg;)", &
     248              :                        "Tetragonal (alias for TETRAGONAL_AB)", &
     249              :                        "Rhombohedral (a = b = c, &alpha; = &beta; = &gamma; &ne; 90&deg;)", &
     250              :                        "Hexagonal (alias for HEXAGONAL_GAMMA_60)", &
     251              :                        "Hexagonal (a = b &ne; c, &alpha; = &beta; = 90&deg;, &gamma; = 60&deg;)", &
     252              :                        "Hexagonal (a = b &ne; c, &alpha; = &beta; = 90&deg;, &gamma; = 120&deg;)", &
     253              :                        "Cubic (a = b = c, &alpha; = &beta; = &gamma; = 90&deg;)"), &
     254              :          enum_c_vals=s2a("NONE", "TRICLINIC", "MONOCLINIC", "MONOCLINIC_GAMMA_AB", "ORTHORHOMBIC", &
     255              :                          "TETRAGONAL_AB", "TETRAGONAL_AC", "TETRAGONAL_BC", "TETRAGONAL", "RHOMBOHEDRAL", &
     256              :                          "HEXAGONAL", "HEXAGONAL_GAMMA_60", "HEXAGONAL_GAMMA_120", "CUBIC"), &
     257              :          enum_i_vals=[cell_sym_none, cell_sym_triclinic, cell_sym_monoclinic, cell_sym_monoclinic_gamma_ab, &
     258              :                       cell_sym_orthorhombic, cell_sym_tetragonal_ab, cell_sym_tetragonal_ac, cell_sym_tetragonal_bc, &
     259              :                       cell_sym_tetragonal_ab, cell_sym_rhombohedral, cell_sym_hexagonal_gamma_60, &
     260              :                       cell_sym_hexagonal_gamma_60, cell_sym_hexagonal_gamma_120, cell_sym_cubic], &
     261        45852 :          default_i_val=cell_sym_none)
     262        45852 :       CALL section_add_keyword(section, keyword)
     263        45852 :       CALL keyword_release(keyword)
     264              : 
     265        45852 :    END SUBROUTINE create_cell_section_low
     266              : 
     267              : ! **************************************************************************************************
     268              : !> \brief Creates the random number restart section
     269              : !> \param section the section to create
     270              : !> \author teo
     271              : ! **************************************************************************************************
     272       230609 :    SUBROUTINE create_rng_section(section)
     273              :       TYPE(section_type), POINTER                        :: section
     274              : 
     275              :       TYPE(keyword_type), POINTER                        :: keyword
     276              : 
     277       230609 :       CPASSERT(.NOT. ASSOCIATED(section))
     278              :       CALL section_create(section, __LOCATION__, name="RNG_INIT", &
     279              :                           description="Information to initialize the parallel random number generator streams", &
     280       230609 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     281       230609 :       NULLIFY (keyword)
     282              : 
     283              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     284              :                           description="Specify an initial RNG stream record", repeats=.TRUE., &
     285       230609 :                           usage="{RNG record string}", type_of_var=lchar_t)
     286       230609 :       CALL section_add_keyword(section, keyword)
     287       230609 :       CALL keyword_release(keyword)
     288              : 
     289       230609 :    END SUBROUTINE create_rng_section
     290              : 
     291              : ! **************************************************************************************************
     292              : !> \brief creates the structure of a subsys, i.e. a full set of
     293              : !>      atoms+mol+bounds+cell
     294              : !> \param section the section to create
     295              : !> \author fawzi
     296              : ! **************************************************************************************************
     297         9823 :    SUBROUTINE create_subsys_section(section)
     298              :       TYPE(section_type), POINTER                        :: section
     299              : 
     300              :       TYPE(keyword_type), POINTER                        :: keyword
     301              :       TYPE(section_type), POINTER                        :: subsection
     302              : 
     303         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
     304              :       CALL section_create(section, __LOCATION__, name="subsys", &
     305              :                           description="a subsystem: coordinates, topology, molecules and cell", &
     306         9823 :                           n_keywords=1, n_subsections=9, repeats=.FALSE.)
     307              : 
     308         9823 :       NULLIFY (keyword)
     309              :       CALL keyword_create(keyword, __LOCATION__, name="SEED", &
     310              :                           description="Initial seed for the (pseudo)random number generator for the "// &
     311              :                           "Wiener process employed by the Langevin dynamics. Exactly 1 or 6 positive "// &
     312              :                           "integer values are expected. A single value is replicated to fill up the "// &
     313              :                           "full seed array with 6 numbers.", &
     314              :                           n_var=-1, &
     315              :                           type_of_var=integer_t, &
     316              :                           usage="SEED {INTEGER} .. {INTEGER}", &
     317         9823 :                           default_i_vals=[12345])
     318         9823 :       CALL section_add_keyword(section, keyword)
     319         9823 :       CALL keyword_release(keyword)
     320              : 
     321         9823 :       NULLIFY (subsection)
     322              : 
     323         9823 :       CALL create_rng_section(subsection)
     324         9823 :       CALL section_add_subsection(section, subsection)
     325         9823 :       CALL section_release(subsection)
     326              : 
     327         9823 :       CALL create_cell_section(subsection)
     328         9823 :       CALL section_add_subsection(section, subsection)
     329         9823 :       CALL section_release(subsection)
     330              : 
     331         9823 :       CALL create_coord_section(subsection)
     332         9823 :       CALL section_add_subsection(section, subsection)
     333         9823 :       CALL section_release(subsection)
     334              : 
     335         9823 :       CALL create_velocity_section(subsection)
     336         9823 :       CALL section_add_subsection(section, subsection)
     337         9823 :       CALL section_release(subsection)
     338              : 
     339         9823 :       CALL create_kind_section(subsection)
     340         9823 :       CALL section_add_subsection(section, subsection)
     341         9823 :       CALL section_release(subsection)
     342              : 
     343         9823 :       CALL create_topology_section(subsection)
     344         9823 :       CALL section_add_subsection(section, subsection)
     345         9823 :       CALL section_release(subsection)
     346              : 
     347         9823 :       CALL create_colvar_section(section=subsection)
     348         9823 :       CALL section_add_subsection(section, subsection)
     349         9823 :       CALL section_release(subsection)
     350              : 
     351         9823 :       CALL create_multipole_section(subsection)
     352         9823 :       CALL section_add_subsection(section, subsection)
     353         9823 :       CALL section_release(subsection)
     354              : 
     355         9823 :       CALL create_shell_coord_section(subsection)
     356         9823 :       CALL section_add_subsection(section, subsection)
     357         9823 :       CALL section_release(subsection)
     358              : 
     359         9823 :       CALL create_shell_vel_section(subsection)
     360         9823 :       CALL section_add_subsection(section, subsection)
     361         9823 :       CALL section_release(subsection)
     362         9823 :       CALL create_core_coord_section(subsection)
     363         9823 :       CALL section_add_subsection(section, subsection)
     364         9823 :       CALL section_release(subsection)
     365              : 
     366         9823 :       CALL create_core_vel_section(subsection)
     367         9823 :       CALL section_add_subsection(section, subsection)
     368         9823 :       CALL section_release(subsection)
     369              : 
     370         9823 :       CALL create_subsys_print_section(subsection)
     371         9823 :       CALL section_add_subsection(section, subsection)
     372         9823 :       CALL section_release(subsection)
     373              : 
     374         9823 :    END SUBROUTINE create_subsys_section
     375              : 
     376              : ! **************************************************************************************************
     377              : !> \brief Creates the subsys print section
     378              : !> \param section the section to create
     379              : !> \author teo
     380              : ! **************************************************************************************************
     381         9823 :    SUBROUTINE create_subsys_print_section(section)
     382              :       TYPE(section_type), POINTER                        :: section
     383              : 
     384              :       TYPE(keyword_type), POINTER                        :: keyword
     385              :       TYPE(section_type), POINTER                        :: print_key
     386              : 
     387         9823 :       NULLIFY (print_key, keyword)
     388         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
     389              :       CALL section_create(section, __LOCATION__, name="print", &
     390              :                           description="Controls printings related to the subsys", &
     391         9823 :                           n_keywords=0, n_subsections=9, repeats=.FALSE.)
     392              : 
     393              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "atomic_coordinates", &
     394              :                                        description="controls the output of the atomic coordinates when setting up the"// &
     395              :                                        " force environment. For printing coordinates during MD or GEO refer to the keyword"// &
     396              :                                        " trajectory.", unit_str="angstrom", &
     397         9823 :                                        print_level=medium_print_level, filename="__STD_OUT__")
     398         9823 :       CALL section_add_subsection(section, print_key)
     399         9823 :       CALL section_release(print_key)
     400              : 
     401         9823 :       CALL create_structure_data_section(print_key)
     402         9823 :       CALL section_add_subsection(section, print_key)
     403         9823 :       CALL section_release(print_key)
     404              : 
     405              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "INTERATOMIC_DISTANCES", &
     406              :                                        description="Controls the printout of the interatomic distances when setting up the "// &
     407              :                                        "force environment", unit_str="angstrom", &
     408         9823 :                                        print_level=debug_print_level, filename="__STD_OUT__")
     409              :       CALL keyword_create(keyword, __LOCATION__, name="CHECK_INTERATOMIC_DISTANCES", &
     410              :                           description="Minimum allowed distance between two atoms. "// &
     411              :                           "A warning is printed, if a smaller interatomic distance is encountered. "// &
     412              :                           "The check is disabled for the threshold value 0 which is the default "// &
     413              :                           "for systems with more than 2000 atoms (otherwise 0.5 A). "// &
     414              :                           "The run is aborted, if an interatomic distance is smaller than the absolute "// &
     415              :                           "value of a negative threshold value.", &
     416         9823 :                           default_r_val=0.5_dp*bohr, unit_str="angstrom")
     417         9823 :       CALL section_add_keyword(print_key, keyword)
     418         9823 :       CALL keyword_release(keyword)
     419         9823 :       CALL section_add_subsection(section, print_key)
     420         9823 :       CALL section_release(print_key)
     421              : 
     422              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "topology_info", description= &
     423              :                                        "controls the printing of information in the topology settings", &
     424         9823 :                                        print_level=high_print_level, filename="__STD_OUT__")
     425              :       CALL keyword_create(keyword, __LOCATION__, name="xtl_info", &
     426              :                           description="Prints information when parsing XTL files.", &
     427         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     428         9823 :       CALL section_add_keyword(print_key, keyword)
     429         9823 :       CALL keyword_release(keyword)
     430              :       CALL keyword_create(keyword, __LOCATION__, name="cif_info", &
     431              :                           description="Prints information when parsing CIF files.", &
     432         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     433         9823 :       CALL section_add_keyword(print_key, keyword)
     434         9823 :       CALL keyword_release(keyword)
     435              :       CALL keyword_create(keyword, __LOCATION__, name="pdb_info", &
     436              :                           description="Prints information when parsing PDB files.", &
     437         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     438         9823 :       CALL section_add_keyword(print_key, keyword)
     439         9823 :       CALL keyword_release(keyword)
     440              :       CALL keyword_create(keyword, __LOCATION__, name="xyz_info", &
     441              :                           description="Prints information when parsing XYZ files.", &
     442         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     443         9823 :       CALL section_add_keyword(print_key, keyword)
     444         9823 :       CALL keyword_release(keyword)
     445              :       CALL keyword_create(keyword, __LOCATION__, name="psf_info", &
     446              :                           description="Prints information when parsing PSF files.", &
     447         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     448         9823 :       CALL section_add_keyword(print_key, keyword)
     449         9823 :       CALL keyword_release(keyword)
     450              :       CALL keyword_create(keyword, __LOCATION__, name="amber_info", &
     451              :                           description="Prints information when parsing ABER topology files.", &
     452         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     453         9823 :       CALL section_add_keyword(print_key, keyword)
     454         9823 :       CALL keyword_release(keyword)
     455              :       CALL keyword_create(keyword, __LOCATION__, name="g96_info", &
     456              :                           description="Prints information when parsing G96 files.", &
     457         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     458         9823 :       CALL section_add_keyword(print_key, keyword)
     459         9823 :       CALL keyword_release(keyword)
     460              :       CALL keyword_create(keyword, __LOCATION__, name="crd_info", &
     461              :                           description="Prints information when parsing CRD files.", &
     462         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     463         9823 :       CALL section_add_keyword(print_key, keyword)
     464         9823 :       CALL keyword_release(keyword)
     465              :       CALL keyword_create(keyword, __LOCATION__, name="gtop_info", &
     466              :                           description="Prints information when parsing GROMOS topology files.", &
     467         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     468         9823 :       CALL section_add_keyword(print_key, keyword)
     469         9823 :       CALL keyword_release(keyword)
     470              :       CALL keyword_create(keyword, __LOCATION__, name="util_info", &
     471              :                           description="Prints information regarding topology utilities", &
     472         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     473         9823 :       CALL section_add_keyword(print_key, keyword)
     474         9823 :       CALL keyword_release(keyword)
     475              :       CALL keyword_create(keyword, __LOCATION__, name="generate_info", &
     476              :                           description="Prints information regarding topology generation", &
     477         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     478         9823 :       CALL section_add_keyword(print_key, keyword)
     479         9823 :       CALL keyword_release(keyword)
     480         9823 :       CALL section_add_subsection(section, print_key)
     481         9823 :       CALL section_release(print_key)
     482              : 
     483              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "cell", &
     484              :                                        description="controls the output of the cell parameters", &
     485              :                                        print_level=medium_print_level, filename="__STD_OUT__", &
     486         9823 :                                        unit_str="angstrom")
     487         9823 :       CALL section_add_subsection(section, print_key)
     488         9823 :       CALL section_release(print_key)
     489              : 
     490              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "kinds", &
     491              :                                        description="controls the output of information on the kinds", &
     492         9823 :                                        print_level=medium_print_level, filename="__STD_OUT__")
     493              :       CALL keyword_create(keyword, __LOCATION__, name="potential", &
     494              :                           description="If the printkey is activated controls the printing of the"// &
     495              :                           " fist_potential, gth_potential, sgp_potential or all electron"// &
     496              :                           " potential information", &
     497         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     498         9823 :       CALL section_add_keyword(print_key, keyword)
     499         9823 :       CALL keyword_release(keyword)
     500              :       CALL keyword_create(keyword, __LOCATION__, name="basis_set", &
     501              :                           description="If the printkey is activated controls the printing of basis set information", &
     502         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     503         9823 :       CALL section_add_keyword(print_key, keyword)
     504         9823 :       CALL keyword_release(keyword)
     505              :       CALL keyword_create(keyword, __LOCATION__, name="se_parameters", &
     506              :                           description="If the printkey is activated controls the printing of the semi-empirical parameters.", &
     507         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     508         9823 :       CALL section_add_keyword(print_key, keyword)
     509         9823 :       CALL keyword_release(keyword)
     510         9823 :       CALL section_add_subsection(section, print_key)
     511         9823 :       CALL section_release(print_key)
     512              : 
     513              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "SYMMETRY", &
     514              :                                        description="controls the output of symmetry information", &
     515         9823 :                                        print_level=debug_print_level + 1, filename="__STD_OUT__")
     516              :       CALL keyword_create(keyword, __LOCATION__, name="MOLECULE", &
     517              :                           description="Assume the system is an isolated molecule", &
     518         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     519         9823 :       CALL section_add_keyword(print_key, keyword)
     520         9823 :       CALL keyword_release(keyword)
     521              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_GEO", &
     522              :                           description="Accuracy required for symmetry detection", &
     523         9823 :                           default_r_val=1.0E-4_dp)
     524         9823 :       CALL section_add_keyword(print_key, keyword)
     525         9823 :       CALL keyword_release(keyword)
     526              :       CALL keyword_create(keyword, __LOCATION__, name="STANDARD_ORIENTATION", &
     527              :                           description="Print molecular coordinates in standard orientation", &
     528         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     529         9823 :       CALL section_add_keyword(print_key, keyword)
     530         9823 :       CALL keyword_release(keyword)
     531              :       CALL keyword_create(keyword, __LOCATION__, name="INERTIA", &
     532              :                           description="Print molecular inertia tensor", &
     533         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     534         9823 :       CALL section_add_keyword(print_key, keyword)
     535         9823 :       CALL keyword_release(keyword)
     536              :       CALL keyword_create(keyword, __LOCATION__, name="SYMMETRY_ELEMENTS", &
     537              :                           description="Print symmetry elements", &
     538         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     539         9823 :       CALL section_add_keyword(print_key, keyword)
     540         9823 :       CALL keyword_release(keyword)
     541              :       CALL keyword_create(keyword, __LOCATION__, name="ALL", &
     542              :                           description="Print all symmetry information", &
     543         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     544         9823 :       CALL section_add_keyword(print_key, keyword)
     545         9823 :       CALL keyword_release(keyword)
     546              :       CALL keyword_create(keyword, __LOCATION__, name="ROTATION_MATRICES", &
     547              :                           description="All the rotation matrices of the point group", &
     548         9823 :                           default_l_val=.FALSE.)
     549         9823 :       CALL section_add_keyword(print_key, keyword)
     550         9823 :       CALL keyword_release(keyword)
     551              :       CALL keyword_create(keyword, __LOCATION__, name="CHECK_SYMMETRY", &
     552              :                           description="Check if calculated symmetry has expected value."// &
     553              :                           " Use either Schoenfliess or Hermann-Maugin symbols", &
     554         9823 :                           default_c_val="NONE")
     555         9823 :       CALL section_add_keyword(print_key, keyword)
     556         9823 :       CALL keyword_release(keyword)
     557         9823 :       CALL section_add_subsection(section, print_key)
     558         9823 :       CALL section_release(print_key)
     559              : 
     560              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "molecules", &
     561              :                                        description="controls the output of information on the molecules", &
     562         9823 :                                        print_level=medium_print_level, filename="__STD_OUT__")
     563         9823 :       CALL section_add_subsection(section, print_key)
     564         9823 :       CALL section_release(print_key)
     565              : 
     566              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "radii", &
     567              :                                        description="controls the output of radii information", unit_str="angstrom", &
     568         9823 :                                        print_level=high_print_level, filename="__STD_OUT__")
     569              : 
     570              :       CALL keyword_create(keyword, __LOCATION__, name="core_charges_radii", &
     571              :                           description="If the printkey is activated controls the printing of the radii of the core charges", &
     572         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     573         9823 :       CALL section_add_keyword(print_key, keyword)
     574         9823 :       CALL keyword_release(keyword)
     575              : 
     576              :       CALL keyword_create(keyword, __LOCATION__, name="pgf_radii", &
     577              :                           description="If the printkey is activated controls the printing of the core gaussian radii", &
     578         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     579         9823 :       CALL section_add_keyword(print_key, keyword)
     580         9823 :       CALL keyword_release(keyword)
     581              : 
     582              :       CALL keyword_create(keyword, __LOCATION__, name="set_radii", &
     583              :                           description="If the printkey is activated controls the printing of the set_radii", &
     584         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     585         9823 :       CALL section_add_keyword(print_key, keyword)
     586         9823 :       CALL keyword_release(keyword)
     587              : 
     588              :       CALL keyword_create(keyword, __LOCATION__, name="kind_radii", &
     589              :                           description="If the printkey is activated controls the printing of the kind_radii", &
     590         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     591         9823 :       CALL section_add_keyword(print_key, keyword)
     592         9823 :       CALL keyword_release(keyword)
     593              : 
     594              :       CALL keyword_create(keyword, __LOCATION__, name="core_charge_radii", &
     595              :                           description="If the printkey is activated controls the printing of the core_charge_radii", &
     596         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     597         9823 :       CALL section_add_keyword(print_key, keyword)
     598         9823 :       CALL keyword_release(keyword)
     599              : 
     600              :       CALL keyword_create(keyword, __LOCATION__, name="ppl_radii", &
     601              :                           description="If the printkey is activated controls the printing of the "// &
     602              :                           "pseudo potential local radii", &
     603         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     604         9823 :       CALL section_add_keyword(print_key, keyword)
     605         9823 :       CALL keyword_release(keyword)
     606              : 
     607              :       CALL keyword_create(keyword, __LOCATION__, name="ppnl_radii", &
     608              :                           description="If the printkey is activated controls the printing of the "// &
     609              :                           "pseudo potential non local radii", &
     610         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     611         9823 :       CALL section_add_keyword(print_key, keyword)
     612         9823 :       CALL keyword_release(keyword)
     613              : 
     614              :       CALL keyword_create(keyword, __LOCATION__, name="gapw_prj_radii", &
     615              :                           description="If the printkey is activated controls the printing of the gapw projector radii", &
     616         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     617         9823 :       CALL section_add_keyword(print_key, keyword)
     618         9823 :       CALL keyword_release(keyword)
     619              : 
     620         9823 :       CALL section_add_subsection(section, print_key)
     621         9823 :       CALL section_release(print_key)
     622              : 
     623         9823 :    END SUBROUTINE create_subsys_print_section
     624              : 
     625              : ! **************************************************************************************************
     626              : !> \brief Creates the multipole section
     627              : !> \param section the section to create
     628              : !> \author teo
     629              : ! **************************************************************************************************
     630         9823 :    SUBROUTINE create_multipole_section(section)
     631              :       TYPE(section_type), POINTER                        :: section
     632              : 
     633              :       TYPE(keyword_type), POINTER                        :: keyword
     634              :       TYPE(section_type), POINTER                        :: subsection
     635              : 
     636         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
     637              :       CALL section_create(section, __LOCATION__, name="multipoles", &
     638              :                           description="Specifies the dipoles and quadrupoles for particles.", &
     639         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     640              : 
     641         9823 :       NULLIFY (keyword, subsection)
     642              :       CALL section_create(subsection, __LOCATION__, name="dipoles", &
     643              :                           description="Specifies the dipoles of the particles.", &
     644         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     645              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     646              :                           description="The dipole components for each atom in the format: "// &
     647              :                           "$D_x \ D_y \ D_z$", &
     648              :                           repeats=.TRUE., usage="{Real} {Real} {Real}", &
     649         9823 :                           type_of_var=real_t, n_var=3)
     650         9823 :       CALL section_add_keyword(subsection, keyword)
     651         9823 :       CALL keyword_release(keyword)
     652         9823 :       CALL section_add_subsection(section, subsection)
     653         9823 :       CALL section_release(subsection)
     654              : 
     655              :       CALL section_create(subsection, __LOCATION__, name="quadrupoles", &
     656              :                           description="Specifies the quadrupoles of the particles.", &
     657         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     658              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     659              :                           description="The quadrupole components for each atom in the format: "// &
     660              :                           "$Q_{xx} \ Q_{xy} \ Q_{xz} \ Q_{yy} \ Q_{yz} \ Q_{zz}$", &
     661              :                           repeats=.TRUE., usage="{Real} {Real} {Real} {Real} {Real} {Real}", &
     662         9823 :                           type_of_var=real_t, n_var=6)
     663         9823 :       CALL section_add_keyword(subsection, keyword)
     664         9823 :       CALL keyword_release(keyword)
     665         9823 :       CALL section_add_subsection(section, subsection)
     666         9823 :       CALL section_release(subsection)
     667              : 
     668         9823 :    END SUBROUTINE create_multipole_section
     669              : 
     670              : ! **************************************************************************************************
     671              : !> \brief creates structure data section for output.. both subsys  (for initialization)
     672              : !>      and motion section..
     673              : !> \param print_key ...
     674              : ! **************************************************************************************************
     675        19646 :    SUBROUTINE create_structure_data_section(print_key)
     676              :       TYPE(section_type), POINTER                        :: print_key
     677              : 
     678              :       TYPE(keyword_type), POINTER                        :: keyword
     679              : 
     680        19646 :       CPASSERT(.NOT. ASSOCIATED(print_key))
     681              : 
     682        19646 :       NULLIFY (keyword)
     683              : 
     684              :       CALL cp_print_key_section_create(print_key, __LOCATION__, name="STRUCTURE_DATA", &
     685              :                                        description="Request the printing of special structure data during a structure "// &
     686              :                                        "optimization (in MOTION%PRINT) or when setting up a subsys (in SUBSYS%PRINT).", &
     687        19646 :                                        print_level=high_print_level, filename="__STD_OUT__", unit_str="angstrom")
     688              : 
     689              :       CALL keyword_create(keyword, __LOCATION__, name="POSITION", variants=["POS"], &
     690              :                           description="Print the position vectors in Cartesian coordinates of the atoms specified "// &
     691              :                           "by a list of their indices", &
     692              :                           usage="POSITION {integer} {integer} {integer}..{integer}", n_var=-1, repeats=.TRUE., &
     693        39292 :                           type_of_var=integer_t)
     694        19646 :       CALL section_add_keyword(print_key, keyword)
     695        19646 :       CALL keyword_release(keyword)
     696              : 
     697              :       CALL keyword_create(keyword, __LOCATION__, name="POSITION_SCALED", variants=["POS_SCALED"], &
     698              :                           description="Print the position vectors in scaled coordinates of the atoms specified "// &
     699              :                           "by a list of their indices", &
     700              :                           usage="POSITION_SCALED {integer} {integer} {integer}..{integer}", n_var=-1, repeats=.TRUE., &
     701        39292 :                           type_of_var=integer_t)
     702        19646 :       CALL section_add_keyword(print_key, keyword)
     703        19646 :       CALL keyword_release(keyword)
     704              : 
     705              :       CALL keyword_create(keyword, __LOCATION__, name="DISTANCE", variants=["DIS"], &
     706              :                           description="Print the distance between the atoms a and b specified by their indices", &
     707              :                           usage="DISTANCE {integer} {integer}", n_var=2, repeats=.TRUE., &
     708        39292 :                           type_of_var=integer_t)
     709        19646 :       CALL section_add_keyword(print_key, keyword)
     710        19646 :       CALL keyword_release(keyword)
     711              : 
     712              :       CALL keyword_create(keyword, __LOCATION__, name="ANGLE", variants=["ANG"], &
     713              :                           description="Print the angle formed by the atoms specified by their indices", &
     714              :                           usage="ANGLE {integer} {integer} {integer}", n_var=3, repeats=.TRUE., &
     715        39292 :                           type_of_var=integer_t)
     716        19646 :       CALL section_add_keyword(print_key, keyword)
     717        19646 :       CALL keyword_release(keyword)
     718              : 
     719              :       CALL keyword_create(keyword, __LOCATION__, name="DIHEDRAL_ANGLE", variants=s2a("DIHEDRAL", "DIH"), &
     720              :                           description="Print the dihedral angle between the planes defined by the atoms (a,b,c) and "// &
     721              :                           "the atoms (b,c,d) specified by their indices", &
     722              :                           usage="DIHEDRAL_ANGLE {integer}  {integer} {integer} {integer}", n_var=4, &
     723        19646 :                           repeats=.TRUE., type_of_var=integer_t)
     724        19646 :       CALL section_add_keyword(print_key, keyword)
     725        19646 :       CALL keyword_release(keyword)
     726              : 
     727        19646 :    END SUBROUTINE create_structure_data_section
     728              : 
     729              : ! **************************************************************************************************
     730              : !> \brief Creates the velocity section
     731              : !> \param section the section to create
     732              : !> \author teo
     733              : ! **************************************************************************************************
     734         9823 :    SUBROUTINE create_velocity_section(section)
     735              :       TYPE(section_type), POINTER                        :: section
     736              : 
     737              :       TYPE(keyword_type), POINTER                        :: keyword
     738              : 
     739         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
     740              :       CALL section_create(section, __LOCATION__, name="velocity", &
     741              :                           description="The velocities for simple systems or "// &
     742              :                           "the centroid mode in PI runs, xyz format by default", &
     743         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     744         9823 :       NULLIFY (keyword)
     745              :       CALL keyword_create(keyword, __LOCATION__, name="PINT_UNIT", &
     746              :                           description="Specify the units of measurement for the velocities "// &
     747              :                           "(currently works only for the path integral code). "// &
     748              :                           "All available CP2K units can be used.", &
     749              :                           usage="PINT_UNIT angstrom*au_t^-1", &
     750         9823 :                           default_c_val="bohr*au_t^-1")
     751         9823 :       CALL section_add_keyword(section, keyword)
     752         9823 :       CALL keyword_release(keyword)
     753              : 
     754              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     755              :                           description="The atomic velocities in the format: "// &
     756              :                           "$ v_x \ v_y \ v_z$ "// &
     757              :                           "The same order as for the atomic coordinates is assumed.", &
     758              :                           repeats=.TRUE., usage="{Real} {Real} {Real}", &
     759         9823 :                           type_of_var=real_t, n_var=3)
     760         9823 :       CALL section_add_keyword(section, keyword)
     761         9823 :       CALL keyword_release(keyword)
     762              : 
     763         9823 :    END SUBROUTINE create_velocity_section
     764              : 
     765              : ! **************************************************************************************************
     766              : !> \brief Creates the shell velocity section
     767              : !> \param section the section to create
     768              : !> \author teo
     769              : ! **************************************************************************************************
     770         9823 :    SUBROUTINE create_shell_vel_section(section)
     771              :       TYPE(section_type), POINTER                        :: section
     772              : 
     773              :       TYPE(keyword_type), POINTER                        :: keyword
     774              : 
     775         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
     776              :       CALL section_create(section, __LOCATION__, name="shell_velocity", &
     777              :                           description="The velocities of shells for shell-model potentials, "// &
     778              :                           "in xyz format  ", &
     779         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     780         9823 :       NULLIFY (keyword)
     781              : 
     782              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     783              :                           description="The shell particle velocities in the format: "// &
     784              :                           "$v_x \ v_y \ v_z$ "// &
     785              :                           "The same order as for the shell particle coordinates is assumed.", &
     786              :                           repeats=.TRUE., usage="{Real} {Real} {Real}", &
     787         9823 :                           type_of_var=real_t, n_var=3)
     788         9823 :       CALL section_add_keyword(section, keyword)
     789         9823 :       CALL keyword_release(keyword)
     790              : 
     791         9823 :    END SUBROUTINE create_shell_vel_section
     792              : 
     793              : ! **************************************************************************************************
     794              : !> \brief Creates the shell velocity section
     795              : !> \param section the section to create
     796              : !> \author teo
     797              : ! **************************************************************************************************
     798         9823 :    SUBROUTINE create_core_vel_section(section)
     799              :       TYPE(section_type), POINTER                        :: section
     800              : 
     801              :       TYPE(keyword_type), POINTER                        :: keyword
     802              : 
     803         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
     804              :       CALL section_create(section, __LOCATION__, name="core_velocity", &
     805              :                           description="The velocities of cores for shell-model potentials, "// &
     806              :                           "in xyz format  ", &
     807         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     808         9823 :       NULLIFY (keyword)
     809              : 
     810              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     811              :                           description="The core particle velocities in the format: "// &
     812              :                           "$v_x \ v_y \ v_z$ "// &
     813              :                           "The same order as for the core particle coordinates is assumed.", &
     814              :                           repeats=.TRUE., usage="{Real} {Real} {Real}", &
     815         9823 :                           type_of_var=real_t, n_var=3)
     816         9823 :       CALL section_add_keyword(section, keyword)
     817         9823 :       CALL keyword_release(keyword)
     818              : 
     819         9823 :    END SUBROUTINE create_core_vel_section
     820              : 
     821              : ! **************************************************************************************************
     822              : !> \brief Creates the &POTENTIAL section
     823              : !> \param section the section to create
     824              : !> \author teo
     825              : ! **************************************************************************************************
     826         9823 :    SUBROUTINE create_potential_section(section)
     827              :       TYPE(section_type), POINTER                        :: section
     828              : 
     829              :       TYPE(keyword_type), POINTER                        :: keyword
     830              : 
     831              :       CALL section_create(section, __LOCATION__, name="potential", &
     832              :                           description="Section used to specify Potentials.", &
     833         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     834         9823 :       NULLIFY (keyword)
     835              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     836              :                           description="CP2K Pseudo Potential Standard Format (GTH, ALL)", &
     837         9823 :                           repeats=.TRUE., type_of_var=lchar_t)
     838         9823 :       CALL section_add_keyword(section, keyword)
     839         9823 :       CALL keyword_release(keyword)
     840              : 
     841         9823 :    END SUBROUTINE create_potential_section
     842              : 
     843              : ! **************************************************************************************************
     844              : !> \brief Creates the &KG_POTENTIAL section
     845              : !> \param section the section to create
     846              : !> \author JGH
     847              : ! **************************************************************************************************
     848         9823 :    SUBROUTINE create_kgpot_section(section)
     849              :       TYPE(section_type), POINTER                        :: section
     850              : 
     851              :       TYPE(keyword_type), POINTER                        :: keyword
     852              : 
     853              :       CALL section_create(section, __LOCATION__, name="kg_potential", &
     854              :                           description="Section used to specify KG Potentials.", &
     855         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     856         9823 :       NULLIFY (keyword)
     857              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     858              :                           description="CP2K KG TNADD Potential Standard Format (TNADD)", &
     859         9823 :                           repeats=.TRUE., type_of_var=lchar_t)
     860         9823 :       CALL section_add_keyword(section, keyword)
     861         9823 :       CALL keyword_release(keyword)
     862              : 
     863         9823 :    END SUBROUTINE create_kgpot_section
     864              : 
     865              : ! **************************************************************************************************
     866              : !> \brief Creates the &BASIS section
     867              : !> \param section the section to create
     868              : !> \author teo
     869              : ! **************************************************************************************************
     870        19646 :    SUBROUTINE create_basis_section(section)
     871              :       TYPE(section_type), POINTER                        :: section
     872              : 
     873              :       TYPE(keyword_type), POINTER                        :: keyword
     874              : 
     875              :       CALL section_create(section, __LOCATION__, name="BASIS", &
     876              :                           description="Section used to specify a general basis set for QM calculations.", &
     877        19646 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
     878              : 
     879        19646 :       NULLIFY (keyword)
     880              : 
     881              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     882              :                           description="The type of basis set defined in this section.", &
     883              :                           lone_keyword_c_val="Orbital", &
     884        19646 :                           usage="Orbital", default_c_val="Orbital")
     885        19646 :       CALL section_add_keyword(section, keyword)
     886        19646 :       CALL keyword_release(keyword)
     887              : 
     888              :       CALL keyword_create( &
     889              :          keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     890              :          repeats=.TRUE., type_of_var=lchar_t, &
     891              :          description="CP2K Basis Set Standard Format:"//newline//newline// &
     892              :          "```"//newline// &
     893              :          "Element symbol  Name of the basis set  Alias names"//newline// &
     894              :          "nset (repeat the following block of lines nset times)"//newline// &
     895              :          "n lmin lmax nexp nshell(lmin) nshell(lmin+1) ... nshell(lmax-1) nshell(lmax)"//newline// &
     896              :          "a(1)      c(1,l,1)      c(1,l,2) ...      c(1,l,nshell(l)-1)      c(1,l,nshell(l)), l=lmin,lmax"//newline// &
     897              :          "a(2)      c(2,l,1)      c(2,l,2) ...      c(2,l,nshell(l)-1)      c(2,l,nshell(l)), l=lmin,lmax"//newline// &
     898              :          " .         .             .                 .                       ."//newline// &
     899              :          " .         .             .                 .                       ."//newline// &
     900              :          " .         .             .                 .                       ."//newline// &
     901              :          "a(nexp-1) c(nexp-1,l,1) c(nexp-1,l,2) ... c(nexp-1,l,nshell(l)-1) c(nexp-1,l,nshell(l)), l=lmin,lmax"//newline// &
     902              :          "a(nexp)   c(nexp,l,1)   c(nexp,l,2)   ... c(nexp,l,nshell(l)-1)   c(nexp,l,nshell(l)), l=lmin,lmax"//newline// &
     903              :          newline// &
     904              :          newline// &
     905              :          "nset     : Number of exponent sets"//newline// &
     906              :          "n        : Principle quantum number (only for orbital label printing)"//newline// &
     907              :          "lmax     : Maximum angular momentum quantum number l"//newline// &
     908              :          "lmin     : Minimum angular momentum quantum number l"//newline// &
     909              :          "nshell(l): Number of shells for angular momentum quantum number l"//newline// &
     910              :          "a        : Exponent"//newline// &
     911              :          "c        : Contraction coefficient"//newline// &
     912        19646 :          "```")
     913        19646 :       CALL section_add_keyword(section, keyword)
     914        19646 :       CALL keyword_release(keyword)
     915              : 
     916        19646 :    END SUBROUTINE create_basis_section
     917              : 
     918              : ! **************************************************************************************************
     919              : !> \brief Creates the &COORD section
     920              : !> \param section the section to create
     921              : !> \author teo
     922              : ! **************************************************************************************************
     923         9823 :    SUBROUTINE create_coord_section(section)
     924              :       TYPE(section_type), POINTER                        :: section
     925              : 
     926              :       TYPE(keyword_type), POINTER                        :: keyword
     927              : 
     928         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
     929              :       CALL section_create(section, __LOCATION__, name="coord", &
     930              :                           description="The coordinates for simple systems (like small QM cells) "// &
     931              :                           "are specified here by default using explicit XYZ coordinates. "// &
     932              :                           "Simple products and fractions combined with functions of a single "// &
     933              :                           "number can be used like 2/3, 0.3*COS(60) or -SQRT(3)/2. "// &
     934              :                           "More complex systems should be given via an external coordinate "// &
     935              :                           "file in the SUBSYS%TOPOLOGY section.", &
     936         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     937         9823 :       NULLIFY (keyword)
     938              :       CALL keyword_create(keyword, __LOCATION__, name="UNIT", &
     939              :                           description='Specify the unit of measurement for the coordinates in input'// &
     940              :                           "All available CP2K units can be used.", &
     941         9823 :                           usage="UNIT angstrom", default_c_val="angstrom")
     942         9823 :       CALL section_add_keyword(section, keyword)
     943         9823 :       CALL keyword_release(keyword)
     944              : 
     945              :       CALL keyword_create(keyword, __LOCATION__, name="SCALED", &
     946              :                           description='Specify if the coordinates in input are scaled. '// &
     947              :                           'When true, the coordinates are given in multiples of the lattice vectors.', &
     948              :                           usage="SCALED F", default_l_val=.FALSE., &
     949         9823 :                           lone_keyword_l_val=.TRUE.)
     950         9823 :       CALL section_add_keyword(section, keyword)
     951         9823 :       CALL keyword_release(keyword)
     952              : 
     953              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     954              :                           description="The atomic coordinates in the format:"//newline//newline// &
     955              :                           "`ATOMIC_KIND  X Y Z  MOLNAME`"//newline//newline// &
     956              :                           "The `MOLNAME` is optional. If not provided the molecule name "// &
     957              :                           "is internally created. All other fields after `MOLNAME` are simply ignored.", &
     958              :                           repeats=.TRUE., usage="{{String} {Real} {Real} {Real} {String}}", &
     959         9823 :                           type_of_var=lchar_t)
     960         9823 :       CALL section_add_keyword(section, keyword)
     961         9823 :       CALL keyword_release(keyword)
     962         9823 :    END SUBROUTINE create_coord_section
     963              : 
     964              : ! **************************************************************************************************
     965              : !> \brief Creates the &SHELL_COORD section
     966              : !> \param section the section to create
     967              : !> \author teo
     968              : ! **************************************************************************************************
     969         9823 :    SUBROUTINE create_shell_coord_section(section)
     970              :       TYPE(section_type), POINTER                        :: section
     971              : 
     972              :       TYPE(keyword_type), POINTER                        :: keyword
     973              : 
     974         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
     975              :       CALL section_create(section, __LOCATION__, name="shell_coord", &
     976              :                           description="The shell coordinates for the shell-model potentials"// &
     977              :                           " xyz format with an additional column for the index of the corresponding particle", &
     978         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     979         9823 :       NULLIFY (keyword)
     980              :       CALL keyword_create(keyword, __LOCATION__, name="UNIT", &
     981              :                           description='Specify the unit of measurement for the coordinates in input'// &
     982              :                           "All available CP2K units can be used.", &
     983         9823 :                           usage="UNIT angstrom", default_c_val="angstrom")
     984         9823 :       CALL section_add_keyword(section, keyword)
     985         9823 :       CALL keyword_release(keyword)
     986              : 
     987              :       CALL keyword_create(keyword, __LOCATION__, name="SCALED", &
     988              :                           description='Specify if the coordinates in input are scaled. '// &
     989              :                           'When true, the coordinates are given in multiples of the lattice vectors.', &
     990              :                           usage="SCALED F", default_l_val=.FALSE., &
     991         9823 :                           lone_keyword_l_val=.TRUE.)
     992         9823 :       CALL section_add_keyword(section, keyword)
     993         9823 :       CALL keyword_release(keyword)
     994              : 
     995              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     996              :                           description="The shell particle coordinates in the format:"//newline//newline// &
     997              :                           "`ATOMIC_KIND  X Y Z  ATOMIC_INDEX`"//newline//newline// &
     998              :                           "The `ATOMIC_INDEX` refers to the atom the shell particle belongs to.", &
     999              :                           repeats=.TRUE., usage="{{String} {Real} {Real} {Real} {Integer}}", &
    1000         9823 :                           type_of_var=lchar_t)
    1001         9823 :       CALL section_add_keyword(section, keyword)
    1002         9823 :       CALL keyword_release(keyword)
    1003              : 
    1004         9823 :    END SUBROUTINE create_shell_coord_section
    1005              : 
    1006              : ! **************************************************************************************************
    1007              : !> \brief Creates the &core_COORD section
    1008              : !> \param section the section to create
    1009              : !> \author teo
    1010              : ! **************************************************************************************************
    1011         9823 :    SUBROUTINE create_core_coord_section(section)
    1012              :       TYPE(section_type), POINTER                        :: section
    1013              : 
    1014              :       TYPE(keyword_type), POINTER                        :: keyword
    1015              : 
    1016         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    1017              :       CALL section_create(section, __LOCATION__, name="core_coord", &
    1018              :                           description="The core coordinates for the shell-model potentials"// &
    1019              :                           " xyz format with an additional column for the index of the corresponding particle", &
    1020         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1021         9823 :       NULLIFY (keyword)
    1022              :       CALL keyword_create(keyword, __LOCATION__, name="UNIT", &
    1023              :                           description='Specify the unit of measurement for the coordinates in input'// &
    1024              :                           "All available CP2K units can be used.", &
    1025         9823 :                           usage="UNIT angstrom", default_c_val="angstrom")
    1026         9823 :       CALL section_add_keyword(section, keyword)
    1027         9823 :       CALL keyword_release(keyword)
    1028              : 
    1029              :       CALL keyword_create(keyword, __LOCATION__, name="SCALED", &
    1030              :                           description='Specify if the coordinates in input are scaled. '// &
    1031              :                           'When true, the coordinates are given in multiples of the lattice vectors.', &
    1032              :                           usage="SCALED F", default_l_val=.FALSE., &
    1033         9823 :                           lone_keyword_l_val=.TRUE.)
    1034         9823 :       CALL section_add_keyword(section, keyword)
    1035         9823 :       CALL keyword_release(keyword)
    1036              : 
    1037              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    1038              :                           description="The core particle coordinates in the format:"//newline//newline// &
    1039              :                           "`ATOMIC_KIND  X Y Z  ATOMIC_INDEX`"//newline//newline// &
    1040              :                           "The `ATOMIC_INDEX` refers to the atom the core particle belongs to.", &
    1041              :                           repeats=.TRUE., usage="{{String} {Real} {Real} {Real} {Integer}}", &
    1042         9823 :                           type_of_var=lchar_t)
    1043         9823 :       CALL section_add_keyword(section, keyword)
    1044         9823 :       CALL keyword_release(keyword)
    1045              : 
    1046         9823 :    END SUBROUTINE create_core_coord_section
    1047              : 
    1048              : ! **************************************************************************************************
    1049              : !> \brief Creates the QM/MM section
    1050              : !> \param section the section to create
    1051              : !> \author teo
    1052              : ! **************************************************************************************************
    1053         9823 :    SUBROUTINE create_kind_section(section)
    1054              :       TYPE(section_type), POINTER                        :: section
    1055              : 
    1056              :       TYPE(keyword_type), POINTER                        :: keyword
    1057              :       TYPE(section_type), POINTER                        :: subsection
    1058              : 
    1059         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    1060              : 
    1061              :       CALL section_create(section, __LOCATION__, name="KIND", &
    1062              :                           description="Defines settings shared by atoms of the same kind, such as basis sets, "// &
    1063              :                           "pseudopotentials, all-electron treatment, and atom-centered grids.", &
    1064         9823 :                           n_keywords=20, n_subsections=1, repeats=.TRUE.)
    1065              : 
    1066         9823 :       NULLIFY (keyword)
    1067              : 
    1068              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    1069              :                           description="The name of the kind described in this section.", &
    1070         9823 :                           usage="H", default_c_val="DEFAULT")
    1071         9823 :       CALL section_add_keyword(section, keyword)
    1072         9823 :       CALL keyword_release(keyword)
    1073              : 
    1074              :       CALL keyword_create(keyword, __LOCATION__, name="BASIS_SET", &
    1075              :                           description="Selects a Gaussian basis set for this kind. The default type is ORB and the default "// &
    1076              :                           "form is GTO; NONE implies no basis and is meaningful for ghost atoms. Possible values for TYPE are "// &
    1077              :                           "{ORB, AUX, MIN, RI_AUX, LRI, ...}. Possible values for "// &
    1078              :                           "FORM are {GTO, STO}. Where STO results in a GTO expansion of a Slater type basis. "// &
    1079              :                           "If a value for FORM is given, also TYPE has to be set explicitly.", &
    1080              :                           usage="BASIS_SET [type] [form] DZVP", type_of_var=char_t, default_c_vals=[" ", " ", " "], &
    1081              :                           citations=[VandeVondele2005a, VandeVondele2007], &
    1082        58938 :                           repeats=.TRUE., n_var=-1)
    1083         9823 :       CALL section_add_keyword(section, keyword)
    1084         9823 :       CALL keyword_release(keyword)
    1085              : 
    1086              :       ! old type basis set input keywords
    1087              :       ! kept for backward compatibility
    1088              :       CALL keyword_create( &
    1089              :          keyword, __LOCATION__, name="AUX_BASIS_SET", &
    1090              :          variants=s2a("AUXILIARY_BASIS_SET", "AUX_BASIS"), &
    1091              :          description="The auxiliary basis set (GTO type)", &
    1092              :          usage="AUX_BASIS_SET DZVP", default_c_val=" ", &
    1093              :          n_var=1, &
    1094              :          deprecation_notice="use 'BASIS_SET AUX ...' instead", &
    1095         9823 :          removed=.TRUE.)
    1096         9823 :       CALL section_add_keyword(section, keyword)
    1097         9823 :       CALL keyword_release(keyword)
    1098              : 
    1099              :       CALL keyword_create( &
    1100              :          keyword, __LOCATION__, name="RI_AUX_BASIS_SET", &
    1101              :          variants=s2a("RI_MP2_BASIS_SET", "RI_RPA_BASIS_SET", "RI_AUX_BASIS"), &
    1102              :          description="The RI auxiliary basis set used in WF_CORRELATION (GTO type)", &
    1103              :          usage="RI_AUX_BASIS_SET DZVP", default_c_val=" ", &
    1104              :          n_var=1, &
    1105              :          deprecation_notice="Use 'BASIS_SET RI_AUX ...' instead.", &
    1106         9823 :          removed=.TRUE.)
    1107         9823 :       CALL section_add_keyword(section, keyword)
    1108         9823 :       CALL keyword_release(keyword)
    1109              : 
    1110              :       CALL keyword_create( &
    1111              :          keyword, __LOCATION__, name="LRI_BASIS_SET", &
    1112              :          variants=s2a("LRI_BASIS"), &
    1113              :          description="The local resolution of identity basis set (GTO type)", &
    1114              :          usage="LRI_BASIS_SET", default_c_val=" ", &
    1115              :          n_var=1, &
    1116              :          deprecation_notice="Use 'BASIS_SET LRI ...' instead.", &
    1117         9823 :          removed=.TRUE.)
    1118         9823 :       CALL section_add_keyword(section, keyword)
    1119         9823 :       CALL keyword_release(keyword)
    1120              : 
    1121              :       CALL keyword_create( &
    1122              :          keyword, __LOCATION__, name="AUX_FIT_BASIS_SET", &
    1123              :          variants=s2a("AUXILIARY_FIT_BASIS_SET", "AUX_FIT_BASIS"), &
    1124              :          description="The auxiliary basis set (GTO type) for auxiliary density matrix method", &
    1125              :          usage="AUX_FIT_BASIS_SET DZVP", default_c_val=" ", &
    1126              :          citations=[Guidon2010], &
    1127              :          n_var=1, &
    1128              :          deprecation_notice="Use 'BASIS_SET AUX_FIT ...' instead.", &
    1129        19646 :          removed=.TRUE.)
    1130         9823 :       CALL section_add_keyword(section, keyword)
    1131         9823 :       CALL keyword_release(keyword)
    1132              :       ! end of old basis set keywords
    1133              : 
    1134              :       CALL keyword_create(keyword, __LOCATION__, name="ELEC_CONF", &
    1135              :                           description="Specifies the electronic configuration used in construction the "// &
    1136              :                           "atomic initial guess (see the pseudo potential file for the default values).", &
    1137              :                           usage="ELEC_CONF n_elec(s)  n_elec(p)  n_elec(d)  ... ", &
    1138         9823 :                           n_var=-1, type_of_var=integer_t)
    1139         9823 :       CALL section_add_keyword(section, keyword)
    1140         9823 :       CALL keyword_release(keyword)
    1141              : 
    1142              :       CALL keyword_create(keyword, __LOCATION__, name="CORE_CORRECTION", &
    1143              :                           description="Corrects the effective nuclear charge", &
    1144              :                           usage="CORE_CORRECTION 1.0", n_var=1, &
    1145         9823 :                           default_r_val=0.0_dp)
    1146         9823 :       CALL section_add_keyword(section, keyword)
    1147         9823 :       CALL keyword_release(keyword)
    1148              : 
    1149              :       CALL keyword_create(keyword, __LOCATION__, name="MAGNETIZATION", &
    1150              :                           description="The magnetization used in the atomic initial guess. "// &
    1151              :                           "Adds magnetization/2 spin-alpha electrons and removes magnetization/2 spin-beta electrons.", &
    1152              :                           usage="MAGNETIZATION 0.5", n_var=1, &
    1153         9823 :                           default_r_val=0.0_dp)
    1154         9823 :       CALL section_add_keyword(section, keyword)
    1155         9823 :       CALL keyword_release(keyword)
    1156              : 
    1157              :       CALL keyword_create(keyword, __LOCATION__, name="ELEMENT", &
    1158              :                           variants=["ELEMENT_SYMBOL"], &
    1159              :                           description="The element of the actual kind "// &
    1160              :                           "(if not given it is inferred from the kind name)", &
    1161        19646 :                           usage="ELEMENT O", type_of_var=char_t, n_var=1)
    1162         9823 :       CALL section_add_keyword(section, keyword)
    1163         9823 :       CALL keyword_release(keyword)
    1164              : 
    1165              :       CALL keyword_create(keyword, __LOCATION__, name="MASS", &
    1166              :                           variants=s2a("ATOMIC_MASS", "ATOMIC_WEIGHT", "WEIGHT"), &
    1167              :                           description="The mass of the atom "// &
    1168              :                           "(if negative or non present it is inferred from the element symbol)", &
    1169         9823 :                           usage="MASS 2.0", type_of_var=real_t, n_var=1)
    1170         9823 :       CALL section_add_keyword(section, keyword)
    1171         9823 :       CALL keyword_release(keyword)
    1172              : 
    1173              :       CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_FILE_NAME", &
    1174              :                           description="The name of the file where to find this kinds pseudopotential."// &
    1175              :                           " Default file is specified in DFT section.", &
    1176         9823 :                           usage="POTENTIAL_FILE_NAME <PSEUDO-POTENTIAL-FILE-NAME>", default_c_val="-", n_var=1)
    1177         9823 :       CALL section_add_keyword(section, keyword)
    1178         9823 :       CALL keyword_release(keyword)
    1179              : 
    1180              :       CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_TYPE", &
    1181              :                           description="The type of this kinds pseudopotential (ECP, ALL, GTH, UPS).", &
    1182              :                           deprecation_notice="Use 'POTENTIAL <TYPE> ...' instead.", &
    1183         9823 :                           usage="POTENTIAL_TYPE <TYPE>", default_c_val="", n_var=1)
    1184         9823 :       CALL section_add_keyword(section, keyword)
    1185         9823 :       CALL keyword_release(keyword)
    1186              : 
    1187              :       CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL", &
    1188              :                           variants=["POT"], &
    1189              :                           description= &
    1190              :                           "The type (ECP, ALL, GTH, UPS) and name of the "// &
    1191              :                           "pseudopotential for the defined kind. Use GTH potentials "// &
    1192              :                           "for most GPW calculations, ECP for Gaussian-integral effective core "// &
    1193              :                           "potentials, and ALL for all-electron calculations.", &
    1194              :                           usage="POTENTIAL [type] <POTENTIAL-NAME>", type_of_var=char_t, &
    1195              :                           default_c_vals=[" ", " "], &
    1196        68761 :                           citations=[Goedecker1996, Hartwigsen1998, Krack2005], n_var=-1)
    1197         9823 :       CALL section_add_keyword(section, keyword)
    1198         9823 :       CALL keyword_release(keyword)
    1199              : 
    1200              :       CALL keyword_create(keyword, __LOCATION__, name="KG_POTENTIAL_FILE_NAME", &
    1201              :                           description="The name of the file where to find this kinds KG potential."// &
    1202              :                           " Default file is specified in DFT section.", &
    1203         9823 :                           usage="KG_POTENTIAL_FILE_NAME <POTENTIAL-FILE-NAME>", default_c_val="-", n_var=1)
    1204         9823 :       CALL section_add_keyword(section, keyword)
    1205         9823 :       CALL keyword_release(keyword)
    1206              : 
    1207              :       CALL keyword_create(keyword, __LOCATION__, name="KG_POTENTIAL", &
    1208              :                           variants=["KG_POT"], &
    1209              :                           description="The name of the non-additive atomic kinetic energy potential.", &
    1210        19646 :                           usage="KG_POTENTIAL <TNADD-POTENTIAL-NAME>", default_c_val="NONE", n_var=1)
    1211         9823 :       CALL section_add_keyword(section, keyword)
    1212         9823 :       CALL keyword_release(keyword)
    1213              : 
    1214              :       CALL keyword_create(keyword, __LOCATION__, name="ECP_SEMI_LOCAL", &
    1215              :                           description="Use ECPs in the original semi-local form."// &
    1216              :                           " This requires the availability of the corresponding integral library."// &
    1217              :                           " If set to False, a fully nonlocal one-center expansion of the ECP is constructed.", &
    1218         9823 :                           usage="ECP_SEMI_LOCAL {T,F}", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1219         9823 :       CALL section_add_keyword(section, keyword)
    1220         9823 :       CALL keyword_release(keyword)
    1221              : 
    1222              :       CALL keyword_create(keyword, __LOCATION__, name="COVALENT_RADIUS", &
    1223              :                           description="Use this covalent radius (in Angstrom) for all atoms of "// &
    1224              :                           "the atomic kind instead of the internally tabulated default value", &
    1225              :                           usage="COVALENT_RADIUS 1.24", n_var=1, default_r_val=0.0_dp, &
    1226         9823 :                           unit_str="angstrom")
    1227         9823 :       CALL section_add_keyword(section, keyword)
    1228         9823 :       CALL keyword_release(keyword)
    1229              : 
    1230              :       CALL keyword_create(keyword, __LOCATION__, name="VDW_RADIUS", &
    1231              :                           description="Use this van der Waals radius (in Angstrom) for all atoms of "// &
    1232              :                           "the atomic kind instead of the internally tabulated default value", &
    1233         9823 :                           usage="VDW_RADIUS 1.85", n_var=1, default_r_val=0.0_dp, unit_str="angstrom")
    1234         9823 :       CALL section_add_keyword(section, keyword)
    1235         9823 :       CALL keyword_release(keyword)
    1236              : 
    1237              :       CALL keyword_create(keyword, __LOCATION__, name="HARD_EXP_RADIUS", &
    1238              :                           description="The region where the hard density is supposed to be confined"// &
    1239              :                           " (GAPW) (in Bohr, default is 1.2 for H and 1.512 otherwise)", &
    1240         9823 :                           usage="HARD_EXP_RADIUS 0.9", type_of_var=real_t, n_var=1)
    1241         9823 :       CALL section_add_keyword(section, keyword)
    1242         9823 :       CALL keyword_release(keyword)
    1243              : 
    1244              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_RAD_LOCAL", &
    1245              :                           description="Max radius for the basis functions used to"// &
    1246              :                           " generate the local projectors in GAPW [Bohr]", &
    1247         9823 :                           usage="MAX_RAD_LOCAL 15.0", default_r_val=13.0_dp*bohr)
    1248         9823 :       CALL section_add_keyword(section, keyword)
    1249         9823 :       CALL keyword_release(keyword)
    1250              : 
    1251              :       CALL keyword_create(keyword, __LOCATION__, name="RHO0_EXP_RADIUS", &
    1252              :                           description="the radius which defines the atomic region where "// &
    1253              :                           "the hard compensation density is confined. "// &
    1254              :                           "should be less than HARD_EXP_RADIUS (GAPW) (Bohr, default equals HARD_EXP_RADIUS)", &
    1255         9823 :                           usage="RHO0_EXP_RADIUS 0.9", type_of_var=real_t, n_var=1)
    1256         9823 :       CALL section_add_keyword(section, keyword)
    1257         9823 :       CALL keyword_release(keyword)
    1258              : 
    1259              :       CALL keyword_create(keyword, __LOCATION__, name="LEBEDEV_GRID", &
    1260              :                           description="GAPW: size of the angular Lebedev grid used for "// &
    1261              :                           "atom-centered integrations for this kind.", &
    1262         9823 :                           usage="LEBEDEV_GRID 40", default_i_val=50)
    1263         9823 :       CALL section_add_keyword(section, keyword)
    1264         9823 :       CALL keyword_release(keyword)
    1265              : 
    1266              :       CALL keyword_create(keyword, __LOCATION__, name="RADIAL_GRID", &
    1267              :                           description="GAPW: number of radial grid points used for atom-centered "// &
    1268              :                           "integrations for this kind.", &
    1269         9823 :                           usage="RADIAL_GRID 70", default_i_val=50)
    1270         9823 :       CALL section_add_keyword(section, keyword)
    1271         9823 :       CALL keyword_release(keyword)
    1272              : 
    1273              :       CALL keyword_create(keyword, __LOCATION__, name="MM_RADIUS", &
    1274              :                           description="Defines the radius of the electrostatic multipole "// &
    1275              :                           "of the atom in Fist. This radius applies to the charge, the "// &
    1276              :                           "dipole and the quadrupole. When zero, the atom is treated as "// &
    1277              :                           "a point multipole, otherwise it is treated as a Gaussian "// &
    1278              :                           "charge distribution with the given radius: "// &
    1279              :                           "p(x,y,z)*N*exp(-(x**2+y**2+z**2)/(2*MM_RADIUS**2)), where N is "// &
    1280              :                           "a normalization constant. In the core-shell model, only the "// &
    1281              :                           "shell is treated as a Gaussian and the core is always a point "// &
    1282              :                           "charge.", &
    1283              :                           usage="MM_RADIUS {real}", default_r_val=0.0_dp, type_of_var=real_t, &
    1284         9823 :                           unit_str="angstrom", n_var=1)
    1285         9823 :       CALL section_add_keyword(section, keyword)
    1286         9823 :       CALL keyword_release(keyword)
    1287              : 
    1288              :       CALL keyword_create(keyword, __LOCATION__, name="DFTB3_PARAM", &
    1289              :                           description="The third order parameter (derivative of hardness) used in "// &
    1290              :                           "diagonal DFTB3 correction.", &
    1291         9823 :                           usage="DFTB3_PARAM 0.2", default_r_val=0.0_dp)
    1292         9823 :       CALL section_add_keyword(section, keyword)
    1293         9823 :       CALL keyword_release(keyword)
    1294              : 
    1295              :       CALL keyword_create(keyword, __LOCATION__, name="LMAX_DFTB", &
    1296              :                           description="The maximum l-quantum number of the DFTB basis for this kind.", &
    1297         9823 :                           usage="LMAX_DFTB 1", default_i_val=-1)
    1298         9823 :       CALL section_add_keyword(section, keyword)
    1299         9823 :       CALL keyword_release(keyword)
    1300              : 
    1301              :       CALL keyword_create(keyword, __LOCATION__, name="MAO", &
    1302              :                           description="The number of MAOs (Modified Atomic Orbitals) for this kind.", &
    1303         9823 :                           usage="MAO 4", default_i_val=-1)
    1304         9823 :       CALL section_add_keyword(section, keyword)
    1305         9823 :       CALL keyword_release(keyword)
    1306              : 
    1307              :       ! Logicals
    1308              :       CALL keyword_create(keyword, __LOCATION__, name="SE_P_ORBITALS_ON_H", &
    1309              :                           description="Forces the usage of p-orbitals on H for SEMI-EMPIRICAL calculations."// &
    1310              :                           " This keyword applies only when the KIND is specifying an Hydrogen element."// &
    1311              :                           " It is ignored in all other cases. ", &
    1312         9823 :                           usage="SE_P_ORBITALS_ON_H", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1313         9823 :       CALL section_add_keyword(section, keyword)
    1314         9823 :       CALL keyword_release(keyword)
    1315              : 
    1316              :       CALL keyword_create(keyword, __LOCATION__, name="GPW_TYPE", &
    1317              :                           description="Force one type to be treated by the GPW scheme,"// &
    1318              :                           " whatever are its primitives, even if the GAPW method is used", &
    1319         9823 :                           usage="GPW_TYPE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1320         9823 :       CALL section_add_keyword(section, keyword)
    1321         9823 :       CALL keyword_release(keyword)
    1322              : 
    1323              :       CALL keyword_create(keyword, __LOCATION__, &
    1324              :                           name="GHOST", &
    1325              :                           description="This keyword makes all atoms of this kind "// &
    1326              :                           "ghost atoms, i.e. without pseudo or nuclear charge. "// &
    1327              :                           "Useful to just have the basis set at that position (e.g. BSSE calculations), "// &
    1328              :                           "or to have a non-interacting particle with BASIS_SET NONE", &
    1329              :                           usage="GHOST", &
    1330              :                           default_l_val=.FALSE., &
    1331         9823 :                           lone_keyword_l_val=.TRUE.)
    1332         9823 :       CALL section_add_keyword(section, keyword)
    1333         9823 :       CALL keyword_release(keyword)
    1334              : 
    1335              :       CALL keyword_create(keyword, __LOCATION__, &
    1336              :                           name="MONOVALENT", &
    1337              :                           description="This keyword makes all atoms of this kind monovalent, i.e. with "// &
    1338              :                           "a single electron and nuclear charge set to 1.0. Used to saturate dangling bonds, "// &
    1339              :                           "ideally in conjunction with a monovalent pseudopotential. Currently GTH only.", &
    1340              :                           usage="MONOVALENT", &
    1341              :                           default_l_val=.FALSE., &
    1342         9823 :                           lone_keyword_l_val=.TRUE.)
    1343         9823 :       CALL section_add_keyword(section, keyword)
    1344         9823 :       CALL keyword_release(keyword)
    1345              : 
    1346              :       CALL keyword_create(keyword, __LOCATION__, &
    1347              :                           name="FLOATING_BASIS_CENTER", &
    1348              :                           description="This keyword makes all atoms of this kind "// &
    1349              :                           "floating functions, i.e. without pseudo or nuclear charge"// &
    1350              :                           " which are subject to a geometry optimization in the outer SCF.", &
    1351              :                           usage="FLOATING_BASIS_CENTER", &
    1352              :                           default_l_val=.FALSE., &
    1353         9823 :                           lone_keyword_l_val=.TRUE.)
    1354         9823 :       CALL section_add_keyword(section, keyword)
    1355         9823 :       CALL keyword_release(keyword)
    1356              : 
    1357              :       CALL keyword_create(keyword, __LOCATION__, &
    1358              :                           name="NO_OPTIMIZE", &
    1359              :                           description="Skip optimization of this type (used in specific basis set or"// &
    1360              :                           " potential optimization schemes)", &
    1361              :                           usage="NO_OPTIMIZE", &
    1362              :                           default_l_val=.FALSE., &
    1363         9823 :                           lone_keyword_l_val=.TRUE.)
    1364         9823 :       CALL section_add_keyword(section, keyword)
    1365         9823 :       CALL keyword_release(keyword)
    1366              : 
    1367              :       CALL keyword_create(keyword, __LOCATION__, name="PAO_BASIS_SIZE", &
    1368              :                           description="The block size used for the polarized atomic orbital basis. "// &
    1369              :                           "Setting PAO_BASIS_SIZE to the size of the primary basis or to a value "// &
    1370              :                           "below one will disables the PAO method for the given atomic kind. "// &
    1371         9823 :                           "By default PAO is disbabled.", default_i_val=0)
    1372         9823 :       CALL section_add_keyword(section, keyword)
    1373         9823 :       CALL keyword_release(keyword)
    1374              : 
    1375              :       CALL keyword_create(keyword, __LOCATION__, name="PAO_MODEL_FILE", type_of_var=lchar_t, &
    1376         9823 :                           description="The filename of the PyTorch model for predicting PAO basis sets.")
    1377         9823 :       CALL section_add_keyword(section, keyword)
    1378         9823 :       CALL keyword_release(keyword)
    1379              : 
    1380         9823 :       NULLIFY (subsection)
    1381         9823 :       CALL create_pao_potential_section(subsection)
    1382         9823 :       CALL section_add_subsection(section, subsection)
    1383         9823 :       CALL section_release(subsection)
    1384              : 
    1385         9823 :       CALL create_pao_descriptor_section(subsection)
    1386         9823 :       CALL section_add_subsection(section, subsection)
    1387         9823 :       CALL section_release(subsection)
    1388              : 
    1389         9823 :       CALL create_basis_section(subsection)
    1390         9823 :       CALL section_add_subsection(section, subsection)
    1391         9823 :       CALL section_release(subsection)
    1392              : 
    1393         9823 :       CALL create_potential_section(subsection)
    1394         9823 :       CALL section_add_subsection(section, subsection)
    1395         9823 :       CALL section_release(subsection)
    1396              : 
    1397         9823 :       CALL create_kgpot_section(subsection)
    1398         9823 :       CALL section_add_subsection(section, subsection)
    1399         9823 :       CALL section_release(subsection)
    1400              : 
    1401         9823 :       CALL create_dft_plus_u_section(subsection)
    1402         9823 :       CALL section_add_subsection(section, subsection)
    1403         9823 :       CALL section_release(subsection)
    1404              : 
    1405         9823 :       CALL create_bs_section(subsection)
    1406         9823 :       CALL section_add_subsection(section, subsection)
    1407         9823 :       CALL section_release(subsection)
    1408              : 
    1409         9823 :    END SUBROUTINE create_kind_section
    1410              : 
    1411              : ! **************************************************************************************************
    1412              : !> \brief Creates the PAO_POTENTIAL section
    1413              : !> \param section the section to create
    1414              : !> \author Ole Schuett
    1415              : ! **************************************************************************************************
    1416         9823 :    SUBROUTINE create_pao_potential_section(section)
    1417              :       TYPE(section_type), POINTER                        :: section
    1418              : 
    1419              :       TYPE(keyword_type), POINTER                        :: keyword
    1420              : 
    1421         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    1422         9823 :       NULLIFY (keyword)
    1423              : 
    1424              :       CALL section_create(section, __LOCATION__, name="PAO_POTENTIAL", repeats=.TRUE., &
    1425         9823 :                           description="Settings of the PAO potentials, which are atomic kind specific.")
    1426              : 
    1427              :       CALL keyword_create(keyword, __LOCATION__, name="MAXL", &
    1428              :                           description="Maximum angular moment of the potential "// &
    1429         9823 :                           "(must be an even number).", default_i_val=0)
    1430         9823 :       CALL section_add_keyword(section, keyword)
    1431         9823 :       CALL keyword_release(keyword)
    1432              : 
    1433              :       CALL keyword_create(keyword, __LOCATION__, name="BETA", &
    1434              :                           description="Exponent of the Gaussian potential term.", &
    1435         9823 :                           default_r_val=1.0_dp)
    1436         9823 :       CALL section_add_keyword(section, keyword)
    1437         9823 :       CALL keyword_release(keyword)
    1438              : 
    1439              :       CALL keyword_create(keyword, __LOCATION__, name="WEIGHT", &
    1440              :                           description="Weight of Gaussian potential term.", &
    1441         9823 :                           default_r_val=1.0_dp)
    1442         9823 :       CALL section_add_keyword(section, keyword)
    1443         9823 :       CALL keyword_release(keyword)
    1444              : 
    1445              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_PROJECTOR", &
    1446              :                           description="Maximum angular moment of the potential's projectors. "// &
    1447         9823 :                           "Used only by the GTH parametrization", default_i_val=2)
    1448         9823 :       CALL section_add_keyword(section, keyword)
    1449         9823 :       CALL keyword_release(keyword)
    1450              : 
    1451         9823 :    END SUBROUTINE create_pao_potential_section
    1452              : 
    1453              : ! **************************************************************************************************
    1454              : !> \brief Creates the PAO_DESCRIPTOR section
    1455              : !> \param section the section to create
    1456              : !> \author Ole Schuett
    1457              : ! **************************************************************************************************
    1458         9823 :    SUBROUTINE create_pao_descriptor_section(section)
    1459              :       TYPE(section_type), POINTER                        :: section
    1460              : 
    1461              :       TYPE(keyword_type), POINTER                        :: keyword
    1462              : 
    1463         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    1464         9823 :       NULLIFY (keyword)
    1465              : 
    1466              :       CALL section_create(section, __LOCATION__, name="PAO_DESCRIPTOR", repeats=.TRUE., &
    1467         9823 :                           description="Settings of the PAO descriptor, which are atomic kind specific.")
    1468              : 
    1469              :       CALL keyword_create(keyword, __LOCATION__, name="BETA", &
    1470              :                           description="Exponent of the Gaussian potential term.", &
    1471         9823 :                           default_r_val=1.0_dp)
    1472         9823 :       CALL section_add_keyword(section, keyword)
    1473         9823 :       CALL keyword_release(keyword)
    1474              : 
    1475              :       CALL keyword_create(keyword, __LOCATION__, name="SCREENING", &
    1476              :                           description="Exponent of the Gaussian screening.", &
    1477         9823 :                           default_r_val=0.2_dp)
    1478         9823 :       CALL section_add_keyword(section, keyword)
    1479         9823 :       CALL keyword_release(keyword)
    1480              : 
    1481              :       CALL keyword_create(keyword, __LOCATION__, name="WEIGHT", &
    1482              :                           description="Weight of Gaussian potential term.", &
    1483         9823 :                           default_r_val=1.0_dp)
    1484         9823 :       CALL section_add_keyword(section, keyword)
    1485         9823 :       CALL keyword_release(keyword)
    1486              : 
    1487         9823 :    END SUBROUTINE create_pao_descriptor_section
    1488              : 
    1489              : ! **************************************************************************************************
    1490              : !> \brief      Create CP2K input section for BS method: imposing atomic orbital occupation
    1491              : !>             different from default in initialization of the density  matrix
    1492              : !>             it works only with GUESS ATOMIC
    1493              : !> \param section ...
    1494              : !> \date       05.08.2009
    1495              : !> \author     MI
    1496              : !> \version    1.0
    1497              : ! **************************************************************************************************
    1498         9823 :    SUBROUTINE create_bs_section(section)
    1499              : 
    1500              :       TYPE(section_type), POINTER                        :: section
    1501              : 
    1502              :       TYPE(keyword_type), POINTER                        :: keyword
    1503              :       TYPE(section_type), POINTER                        :: subsection
    1504              : 
    1505         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    1506              : 
    1507              :       CALL section_create(section, __LOCATION__, &
    1508              :                           name="BS", &
    1509              :                           description="Define the required atomic orbital occupation "// &
    1510              :                           "assigned in initialization of the density matrix, by adding or "// &
    1511              :                           "subtracting electrons from specific angular momentum channels. "// &
    1512              :                           "It works only with GUESS ATOMIC.", &
    1513              :                           n_keywords=0, &
    1514              :                           n_subsections=2, &
    1515         9823 :                           repeats=.FALSE.)
    1516              : 
    1517         9823 :       NULLIFY (keyword, subsection)
    1518              : 
    1519              :       CALL keyword_create(keyword, __LOCATION__, &
    1520              :                           name="_SECTION_PARAMETERS_", &
    1521              :                           description="controls the activation of the BS section", &
    1522              :                           usage="&BS ON", &
    1523              :                           default_l_val=.FALSE., &
    1524         9823 :                           lone_keyword_l_val=.TRUE.)
    1525         9823 :       CALL section_add_keyword(section, keyword)
    1526         9823 :       CALL keyword_release(keyword)
    1527              : 
    1528              :       CALL section_create(subsection, __LOCATION__, name="ALPHA", description="alpha spin", &
    1529              :                           n_keywords=3, &
    1530              :                           n_subsections=0, &
    1531         9823 :                           repeats=.FALSE.)
    1532              : 
    1533              :       CALL keyword_create(keyword, __LOCATION__, &
    1534              :                           name="NEL", &
    1535              :                           description="Orbital ccupation change per angular momentum quantum number. "// &
    1536              :                           "In unrestricted calculations applied to spin alpha.", &
    1537              :                           repeats=.FALSE., &
    1538              :                           n_var=-1, &
    1539              :                           default_i_val=-1, &
    1540         9823 :                           usage="NEL 2")
    1541         9823 :       CALL section_add_keyword(subsection, keyword)
    1542         9823 :       CALL keyword_release(keyword)
    1543              : 
    1544              :       CALL keyword_create(keyword, __LOCATION__, &
    1545              :                           name="L", &
    1546              :                           variants=["L"], &
    1547              :                           description="Angular momentum quantum number of the "// &
    1548              :                           "orbitals whose occupation is changed", &
    1549              :                           repeats=.FALSE., &
    1550              :                           n_var=-1, &
    1551              :                           default_i_val=-1, &
    1552        19646 :                           usage="L 2")
    1553         9823 :       CALL section_add_keyword(subsection, keyword)
    1554         9823 :       CALL keyword_release(keyword)
    1555              : 
    1556              :       CALL keyword_create(keyword, __LOCATION__, &
    1557              :                           name="N", &
    1558              :                           variants=["N"], &
    1559              :                           description="Principal quantum number of the "// &
    1560              :                           "orbitals whose occupation is changed. "// &
    1561              :                           "Default is the first not occupied", &
    1562              :                           repeats=.FALSE., &
    1563              :                           n_var=-1, &
    1564              :                           default_i_val=0, &
    1565        19646 :                           usage="N 2")
    1566         9823 :       CALL section_add_keyword(subsection, keyword)
    1567         9823 :       CALL keyword_release(keyword)
    1568         9823 :       CALL section_add_subsection(section, subsection)
    1569         9823 :       CALL section_release(subsection)
    1570              : 
    1571              :       CALL section_create(subsection, __LOCATION__, name="BETA", description="beta spin", &
    1572              :                           n_keywords=3, &
    1573              :                           n_subsections=0, &
    1574         9823 :                           repeats=.FALSE.)
    1575              : 
    1576              :       CALL keyword_create(keyword, __LOCATION__, &
    1577              :                           name="NEL", &
    1578              :                           description="Orbital ccupation change per angular momentum quantum number. "// &
    1579              :                           "Applied to spin beta and active only in unrestricted calculations.", &
    1580              :                           repeats=.FALSE., &
    1581              :                           n_var=-1, &
    1582              :                           default_i_val=-1, &
    1583         9823 :                           usage="NEL 2")
    1584         9823 :       CALL section_add_keyword(subsection, keyword)
    1585         9823 :       CALL keyword_release(keyword)
    1586              : 
    1587              :       CALL keyword_create(keyword, __LOCATION__, &
    1588              :                           name="L", &
    1589              :                           description="Angular momentum quantum number of the "// &
    1590              :                           "orbitals of beta spin whose occupation is changed. "// &
    1591              :                           "Active only for unrestricted calculations", &
    1592              :                           repeats=.FALSE., &
    1593              :                           n_var=-1, &
    1594              :                           default_i_val=-1, &
    1595         9823 :                           usage="L 2")
    1596         9823 :       CALL section_add_keyword(subsection, keyword)
    1597         9823 :       CALL keyword_release(keyword)
    1598              : 
    1599              :       CALL keyword_create(keyword, __LOCATION__, &
    1600              :                           name="N", &
    1601              :                           description="Principal quantum number of the "// &
    1602              :                           "orbitals of beta spin whose occupation is changed. "// &
    1603              :                           "Default is the first not occupied. "// &
    1604              :                           "Active only for unrestricted calculations", &
    1605              :                           repeats=.FALSE., &
    1606              :                           n_var=-1, &
    1607              :                           default_i_val=0, &
    1608         9823 :                           usage="N 2")
    1609         9823 :       CALL section_add_keyword(subsection, keyword)
    1610         9823 :       CALL keyword_release(keyword)
    1611              : 
    1612         9823 :       CALL section_add_subsection(section, subsection)
    1613         9823 :       CALL section_release(subsection)
    1614              : 
    1615         9823 :    END SUBROUTINE create_bs_section
    1616              : 
    1617              : ! **************************************************************************************************
    1618              : !> \brief Create the topology section for FIST.. and the base is running running...
    1619              : !>      Contains all information regarding topology to be read in input file..
    1620              : !> \param section the section to create
    1621              : !> \author teo
    1622              : ! **************************************************************************************************
    1623         9823 :    SUBROUTINE create_topology_section(section)
    1624              :       TYPE(section_type), POINTER                        :: section
    1625              : 
    1626              :       TYPE(keyword_type), POINTER                        :: keyword
    1627              :       TYPE(section_type), POINTER                        :: print_key, subsection
    1628              : 
    1629         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    1630              :       CALL section_create(section, __LOCATION__, name="TOPOLOGY", &
    1631              :                           description="Section specifying information regarding how to handle the topology"// &
    1632              :                           " for classical runs.", &
    1633         9823 :                           n_keywords=5, n_subsections=0, repeats=.FALSE.)
    1634              : 
    1635         9823 :       NULLIFY (keyword, print_key)
    1636              :       ! Logical
    1637              :       CALL keyword_create(keyword, __LOCATION__, name="USE_ELEMENT_AS_KIND", &
    1638              :                           description="Kinds are generated according to the element name."// &
    1639              :                           " Default=True for SE and TB methods.", &
    1640              :                           usage="USE_ELEMENT_AS_KIND logical", &
    1641         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1642         9823 :       CALL section_add_keyword(section, keyword)
    1643         9823 :       CALL keyword_release(keyword)
    1644              : 
    1645              :       CALL keyword_create(keyword, __LOCATION__, name="CHARGE_OCCUP", &
    1646              :                           variants=["CHARGE_O"], &
    1647              :                           description="Read MM charges from the OCCUP field of PDB file.", &
    1648              :                           usage="CHARGE_OCCUP logical", &
    1649        19646 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1650         9823 :       CALL section_add_keyword(section, keyword)
    1651         9823 :       CALL keyword_release(keyword)
    1652              : 
    1653              :       CALL keyword_create(keyword, __LOCATION__, name="CHARGE_BETA", &
    1654              :                           variants=["CHARGE_B"], &
    1655              :                           description="Read MM charges from the BETA field of PDB file.", &
    1656              :                           usage="CHARGE_BETA logical", &
    1657        19646 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1658         9823 :       CALL section_add_keyword(section, keyword)
    1659         9823 :       CALL keyword_release(keyword)
    1660              : 
    1661              :       CALL keyword_create(keyword, __LOCATION__, name="CHARGE_EXTENDED", &
    1662              :                           description="Read MM charges from the very last field of PDB file (starting from column 81)."// &
    1663              :                           " No limitations of number of digits.", &
    1664              :                           usage="CHARGE_EXTENDED logical", &
    1665         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1666         9823 :       CALL section_add_keyword(section, keyword)
    1667         9823 :       CALL keyword_release(keyword)
    1668              : 
    1669              :       CALL keyword_create(keyword, __LOCATION__, name="PARA_RES", &
    1670              :                           description="For a protein, each residue is now considered a molecule", &
    1671              :                           usage="PARA_RES logical", &
    1672         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1673         9823 :       CALL section_add_keyword(section, keyword)
    1674         9823 :       CALL keyword_release(keyword)
    1675              : 
    1676              :       CALL keyword_create(keyword, __LOCATION__, name="MOL_CHECK", &
    1677              :                           description="Check molecules have the same number of atom and names.", &
    1678              :                           usage="MOL_CHECK logical", &
    1679         9823 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1680         9823 :       CALL section_add_keyword(section, keyword)
    1681         9823 :       CALL keyword_release(keyword)
    1682              : 
    1683              :       CALL keyword_create(keyword, __LOCATION__, name="USE_G96_VELOCITY", &
    1684              :                           description="Use the velocities in the G96 coordinate files as the starting velocity", &
    1685              :                           usage="USE_G96_VELOCITY logical", &
    1686         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1687         9823 :       CALL section_add_keyword(section, keyword)
    1688         9823 :       CALL keyword_release(keyword)
    1689              : 
    1690              :       ! Character
    1691              :       CALL keyword_create(keyword, __LOCATION__, name="COORD_FILE_NAME", &
    1692              :                           variants=s2a("COORD_FILE"), &
    1693              :                           description="Specifies the filename that contains coordinates. "// &
    1694              :                           "In case the CELL section is not set explicitly but this file "// &
    1695              :                           "contains cell information, including CIF, PDB and (Extended) XYZ "// &
    1696              :                           "formats, this file is also parsed for setting up the simulation cell.", &
    1697         9823 :                           usage="COORD_FILE_NAME <FILENAME>", type_of_var=lchar_t)
    1698         9823 :       CALL section_add_keyword(section, keyword)
    1699         9823 :       CALL keyword_release(keyword)
    1700              : 
    1701              :       CALL keyword_create(keyword, __LOCATION__, name="COORD_FILE_FORMAT", &
    1702              :                           variants=s2a("COORDINATE"), &
    1703              :                           description="Set up the way in which coordinates will be read.", &
    1704              :                           usage="COORD_FILE_FORMAT (OFF|PDB|XYZ|G96|CRD|CIF|XTL|CP2K)", &
    1705              :                           enum_c_vals=s2a("OFF", "PDB", "XYZ", "G96", "CRD", "CIF", "XTL", "CP2K"), &
    1706              :                           enum_i_vals=[do_coord_off, do_coord_pdb, do_coord_xyz, do_coord_g96, do_coord_crd, &
    1707              :                                        do_coord_cif, do_coord_xtl, do_coord_cp2k], &
    1708              :                           enum_desc=s2a( &
    1709              :                           "Coordinates read in the &COORD section of the input file", &
    1710              :                           "Coordinates provided through a PDB file format", &
    1711              :                           "Coordinates provided through an XYZ file format", &
    1712              :                           "Coordinates provided through a GROMOS96 file format", &
    1713              :                           "Coordinates provided through an AMBER file format", &
    1714              :                           "Coordinates provided through a CIF (Crystallographic Information File) file format", &
    1715              :                           "Coordinates provided through a XTL (MSI native) file format", &
    1716              :                           "Read the coordinates in CP2K &COORD section format from an external file. "// &
    1717              :                           "NOTE: This file will be overwritten with the latest coordinates."), &
    1718         9823 :                           default_i_val=do_coord_off)
    1719         9823 :       CALL section_add_keyword(section, keyword)
    1720         9823 :       CALL keyword_release(keyword)
    1721              : 
    1722              :       CALL keyword_create(keyword, __LOCATION__, name="NUMBER_OF_ATOMS", &
    1723              :                           variants=s2a("NATOMS", "NATOM"), &
    1724              :                           description="Optionally define the number of atoms read from an external file "// &
    1725              :                           "(see COORD_FILE_NAME) if the COORD_FILE_FORMAT CP2K is used", &
    1726              :                           repeats=.FALSE., &
    1727              :                           n_var=1, &
    1728              :                           type_of_var=integer_t, &
    1729              :                           default_i_val=-1, &
    1730         9823 :                           usage="NATOMS 768000")
    1731         9823 :       CALL section_add_keyword(section, keyword)
    1732         9823 :       CALL keyword_release(keyword)
    1733              : 
    1734         9823 :       CALL connectivity_framework(section, do_conn_generate)
    1735              : 
    1736              :       CALL keyword_create(keyword, __LOCATION__, name="DISABLE_EXCLUSION_LISTS", &
    1737              :                           description="Do not build any exclusion lists.", &
    1738              :                           usage="DISABLE_EXCLUSION_LISTS", &
    1739         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1740         9823 :       CALL section_add_keyword(section, keyword)
    1741         9823 :       CALL keyword_release(keyword)
    1742              : 
    1743              :       CALL keyword_create(keyword, __LOCATION__, name="EXCLUDE_VDW", &
    1744              :                           description="Specifies which kind of Van der Waals interaction to skip.", &
    1745              :                           usage="EXCLUDE_VDW (1-1||1-2||1-3||1-4)", &
    1746              :                           enum_c_vals=s2a("1-1", "1-2", "1-3", "1-4"), &
    1747              :                           enum_i_vals=[do_skip_11, do_skip_12, do_skip_13, do_skip_14], &
    1748         9823 :                           default_i_val=do_skip_13)
    1749         9823 :       CALL section_add_keyword(section, keyword)
    1750         9823 :       CALL keyword_release(keyword)
    1751              : 
    1752              :       CALL keyword_create(keyword, __LOCATION__, name="EXCLUDE_EI", &
    1753              :                           description="Specifies which kind of Electrostatic interaction to skip.", &
    1754              :                           usage="EXCLUDE_EI (1-1||1-2||1-3||1-4)", &
    1755              :                           enum_c_vals=s2a("1-1", "1-2", "1-3", "1-4"), &
    1756              :                           enum_i_vals=[do_skip_11, do_skip_12, do_skip_13, do_skip_14], &
    1757         9823 :                           default_i_val=do_skip_13)
    1758         9823 :       CALL section_add_keyword(section, keyword)
    1759         9823 :       CALL keyword_release(keyword)
    1760              : 
    1761              :       CALL keyword_create(keyword, __LOCATION__, name="AUTOGEN_EXCLUDE_LISTS", &
    1762              :                           description="When True, the exclude lists are solely based on"// &
    1763              :                           " the bond data in the topology. The (minimal)"// &
    1764              :                           " number of bonds between two atoms is used to"// &
    1765              :                           " determine if the atom pair is added to an"// &
    1766              :                           " exclusion list. When False, 1-2 exclusion is based"// &
    1767              :                           " on bonds in the topology, 1-3 exclusion is based"// &
    1768              :                           " on bonds and bends in the topology, 1-4 exclusion"// &
    1769              :                           " is based on bonds, bends and dihedrals in the"// &
    1770              :                           " topology. This implies that a missing dihedral in"// &
    1771              :                           " the topology will cause the corresponding 1-4 pair"// &
    1772              :                           " not to be in the exclusion list, in case 1-4"// &
    1773              :                           " exclusion is requested for VDW or EI interactions.", &
    1774              :                           usage="AUTOGEN_EXCLUDE_LISTS logical", &
    1775         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1776         9823 :       CALL section_add_keyword(section, keyword)
    1777         9823 :       CALL keyword_release(keyword)
    1778              : 
    1779              :       CALL keyword_create( &
    1780              :          keyword, __LOCATION__, name="MULTIPLE_UNIT_CELL", &
    1781              :          description="Specifies the numbers of repetition in space (X, Y, Z) of the defined cell, "// &
    1782              :          "assuming it as a unit cell. This keyword affects only the coordinates specification. The same keyword "// &
    1783              :          "in SUBSYS%CELL%MULTIPLE_UNIT_CELL should be modified in order to affect the cell "// &
    1784              :          "specification.", usage="MULTIPLE_UNIT_CELL 1 1 1", &
    1785         9823 :          n_var=3, default_i_vals=[1, 1, 1], repeats=.FALSE.)
    1786         9823 :       CALL section_add_keyword(section, keyword)
    1787         9823 :       CALL keyword_release(keyword)
    1788              : 
    1789              :       CALL keyword_create(keyword, __LOCATION__, name="MEMORY_PROGRESSION_FACTOR", &
    1790              :                           description="This keyword is quite technical and should normally not be changed by the user. It "// &
    1791              :                           "affects the memory allocation during the construction of the topology. It does NOT affect the "// &
    1792              :                           "memory used once the topology is built.", &
    1793         9823 :                           n_var=1, default_r_val=1.2_dp, repeats=.FALSE.)
    1794         9823 :       CALL section_add_keyword(section, keyword)
    1795         9823 :       CALL keyword_release(keyword)
    1796              : 
    1797              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "DUMP_PDB", &
    1798              :                                        description="controls the dumping of the PDB at the starting geometry", &
    1799         9823 :                                        print_level=debug_print_level, filename="dump")
    1800         9823 :       CALL section_add_subsection(section, print_key)
    1801              : 
    1802              :       CALL keyword_create(keyword, __LOCATION__, name="CHARGE_OCCUP", &
    1803              :                           variants=["CHARGE_O"], &
    1804              :                           description="Write the MM charges to the OCCUP field of the PDB file", &
    1805              :                           usage="CHARGE_OCCUP logical", &
    1806        19646 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1807         9823 :       CALL section_add_keyword(print_key, keyword)
    1808         9823 :       CALL keyword_release(keyword)
    1809              : 
    1810              :       CALL keyword_create(keyword, __LOCATION__, name="CHARGE_BETA", &
    1811              :                           variants=["CHARGE_B"], &
    1812              :                           description="Write the MM charges to the BETA field of the PDB file", &
    1813              :                           usage="CHARGE_BETA logical", &
    1814        19646 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1815         9823 :       CALL section_add_keyword(print_key, keyword)
    1816         9823 :       CALL keyword_release(keyword)
    1817              : 
    1818              :       CALL keyword_create(keyword, __LOCATION__, name="CHARGE_EXTENDED", &
    1819              :                           description="Write the MM charges to the very last field of the PDB file (starting from column 81)", &
    1820              :                           usage="CHARGE_EXTENDED logical", &
    1821         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1822         9823 :       CALL section_add_keyword(print_key, keyword)
    1823         9823 :       CALL keyword_release(keyword)
    1824              : 
    1825         9823 :       CALL section_release(print_key)
    1826              : 
    1827              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "DUMP_PSF", &
    1828              :                                        description="controls the dumping of the PSF connectivity", &
    1829         9823 :                                        print_level=debug_print_level, filename="dump")
    1830         9823 :       CALL section_add_subsection(section, print_key)
    1831         9823 :       CALL section_release(print_key)
    1832              : 
    1833         9823 :       NULLIFY (subsection)
    1834         9823 :       CALL create_exclude_list_section(subsection, "EXCLUDE_VDW_LIST")
    1835         9823 :       CALL section_add_subsection(section, subsection)
    1836         9823 :       CALL section_release(subsection)
    1837              : 
    1838         9823 :       CALL create_exclude_list_section(subsection, "EXCLUDE_EI_LIST")
    1839         9823 :       CALL section_add_subsection(section, subsection)
    1840         9823 :       CALL section_release(subsection)
    1841              : 
    1842         9823 :       CALL create_center_section(subsection)
    1843         9823 :       CALL section_add_subsection(section, subsection)
    1844         9823 :       CALL section_release(subsection)
    1845              : 
    1846         9823 :       CALL create_generate_section(subsection)
    1847         9823 :       CALL section_add_subsection(section, subsection)
    1848         9823 :       CALL section_release(subsection)
    1849              : 
    1850         9823 :       CALL create_molset_section(subsection)
    1851         9823 :       CALL section_add_subsection(section, subsection)
    1852         9823 :       CALL section_release(subsection)
    1853              : 
    1854         9823 :    END SUBROUTINE create_topology_section
    1855              : 
    1856              : ! **************************************************************************************************
    1857              : !> \brief Setup a list of fine exclusion elements
    1858              : !> \param section the section to create
    1859              : !> \param header ...
    1860              : !> \author Teodoro Laino [tlaino] - 12.2009
    1861              : ! **************************************************************************************************
    1862        19646 :    SUBROUTINE create_exclude_list_section(section, header)
    1863              :       TYPE(section_type), POINTER                        :: section
    1864              :       CHARACTER(LEN=*), INTENT(IN)                       :: header
    1865              : 
    1866              :       TYPE(keyword_type), POINTER                        :: keyword
    1867              : 
    1868        19646 :       CPASSERT(.NOT. ASSOCIATED(section))
    1869        19646 :       NULLIFY (keyword)
    1870              :       CALL section_create(section, __LOCATION__, TRIM(header), &
    1871              :                           description="Speficy bonds (via atom kinds) for fine tuning of 1-2 "// &
    1872              :                           "exclusion lists. If this section is not present the 1-2 exclusion is "// &
    1873              :                           "applied to all bond kinds. When this section is present the 1-2 exclusion "// &
    1874              :                           "is applied ONLY to the bonds defined herein. This section allows ONLY fine tuning of 1-2 "// &
    1875              :                           "interactions. ", &
    1876        19646 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1877              : 
    1878              :       CALL keyword_create(keyword, __LOCATION__, name="BOND", &
    1879              :                           description="Specify the atom kinds involved in the bond for which 1-2 exclusion holds.", &
    1880              :                           usage="BOND {KIND1} {KIND2}", type_of_var=char_t, &
    1881        19646 :                           n_var=2)
    1882        19646 :       CALL section_add_keyword(section, keyword)
    1883        19646 :       CALL keyword_release(keyword)
    1884        19646 :    END SUBROUTINE create_exclude_list_section
    1885              : 
    1886              : ! **************************************************************************************************
    1887              : !> \brief Specify keywords used to center molecule in the box
    1888              : !> \param section the section to create
    1889              : !> \author Teodoro Laino [tlaino] - University of Zurich - 06.2009
    1890              : ! **************************************************************************************************
    1891         9823 :    SUBROUTINE create_center_section(section)
    1892              :       TYPE(section_type), POINTER                        :: section
    1893              : 
    1894              :       TYPE(keyword_type), POINTER                        :: keyword
    1895              : 
    1896         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    1897         9823 :       NULLIFY (keyword)
    1898              :       CALL section_create(section, __LOCATION__, "CENTER_COORDINATES", &
    1899              :                           description="Allows centering the coordinates of the system in the box. "// &
    1900              :                           "The centering point can be defined by the user.", &
    1901         9823 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1902              : 
    1903              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    1904              :                           description="Controls the activation of the centering method", &
    1905              :                           usage="&CENTER_COORDINATES T", &
    1906              :                           default_l_val=.FALSE., &
    1907         9823 :                           lone_keyword_l_val=.TRUE.)
    1908         9823 :       CALL section_add_keyword(section, keyword)
    1909         9823 :       CALL keyword_release(keyword)
    1910              : 
    1911              :       CALL keyword_create(keyword, __LOCATION__, name="CENTER_POINT", &
    1912              :                           description="Specify the point used for centering the coordinates. Default is to "// &
    1913              :                           "center the system in cell/2. ", type_of_var=real_t, n_var=3, &
    1914         9823 :                           repeats=.FALSE.)
    1915         9823 :       CALL section_add_keyword(section, keyword)
    1916         9823 :       CALL keyword_release(keyword)
    1917         9823 :    END SUBROUTINE create_center_section
    1918              : 
    1919              : ! **************************************************************************************************
    1920              : !> \brief Specify keywords used to setup several molecules with few connectivity files
    1921              : !> \param section the section to create
    1922              : !> \author Teodoro Laino [tlaino] - University of Zurich - 08.2008
    1923              : ! **************************************************************************************************
    1924         9823 :    SUBROUTINE create_molset_section(section)
    1925              :       TYPE(section_type), POINTER                        :: section
    1926              : 
    1927              :       TYPE(keyword_type), POINTER                        :: keyword
    1928              :       TYPE(section_type), POINTER                        :: subsection, subsubsection
    1929              : 
    1930         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    1931         9823 :       NULLIFY (keyword, subsection, subsubsection)
    1932              :       CALL section_create(section, __LOCATION__, name="MOL_SET", &
    1933              :                           description="Specify the connectivity of a full system specifying the connectivity"// &
    1934              :                           " of the fragments of the system.", &
    1935         9823 :                           n_keywords=2, n_subsections=0, repeats=.FALSE.)
    1936              : 
    1937              :       ! MOLECULES
    1938              :       CALL section_create(subsection, __LOCATION__, name="MOLECULE", &
    1939              :                           description="Specify information about the connectivity of single molecules", &
    1940         9823 :                           n_keywords=2, n_subsections=0, repeats=.TRUE.)
    1941              : 
    1942              :       CALL keyword_create(keyword, __LOCATION__, name="NMOL", &
    1943              :                           description="number of molecules ", &
    1944         9823 :                           usage="NMOL {integer}", default_i_val=1)
    1945         9823 :       CALL section_add_keyword(subsection, keyword)
    1946         9823 :       CALL keyword_release(keyword)
    1947              : 
    1948         9823 :       CALL connectivity_framework(subsection, do_conn_psf)
    1949         9823 :       CALL section_add_subsection(section, subsection)
    1950         9823 :       CALL section_release(subsection)
    1951              : 
    1952              :       ! MERGE MOLECULES
    1953              :       CALL section_create(subsection, __LOCATION__, name="MERGE_MOLECULES", &
    1954              :                           description="Enables the creation of connecting bridges (bonds, angles, torsions, impropers)"// &
    1955              :                           " between the two or more molecules defined with independent connectivity.", &
    1956         9823 :                           n_keywords=2, n_subsections=0, repeats=.FALSE.)
    1957              : 
    1958              :       CALL section_create(subsubsection, __LOCATION__, name="bonds", &
    1959         9823 :                           description="Defines new bonds", n_keywords=2, n_subsections=0, repeats=.FALSE.)
    1960              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    1961              :                           description="Two integer indexes per line defining the new bond."// &
    1962              :                           " Indexes must be relative to the full system and not to the single molecules", &
    1963              :                           repeats=.TRUE., &
    1964         9823 :                           usage="{Integer} {Integer}", type_of_var=integer_t, n_var=2)
    1965         9823 :       CALL section_add_keyword(subsubsection, keyword)
    1966         9823 :       CALL keyword_release(keyword)
    1967         9823 :       CALL section_add_subsection(subsection, subsubsection)
    1968         9823 :       CALL section_release(subsubsection)
    1969              : 
    1970              :       CALL section_create(subsubsection, __LOCATION__, name="angles", &
    1971              :                           description="Defines new angles", n_keywords=2, n_subsections=0, &
    1972         9823 :                           repeats=.FALSE.)
    1973              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    1974              :                           description="Three integer indexes per line defining the new angle"// &
    1975              :                           " Indexes must be relative to the full system and not to the single molecules", repeats=.TRUE., &
    1976         9823 :                           usage="{Integer} {Integer} {Integer}", type_of_var=integer_t, n_var=3)
    1977         9823 :       CALL section_add_keyword(subsubsection, keyword)
    1978         9823 :       CALL keyword_release(keyword)
    1979         9823 :       CALL section_add_subsection(subsection, subsubsection)
    1980         9823 :       CALL section_release(subsubsection)
    1981              : 
    1982              :       CALL section_create(subsubsection, __LOCATION__, name="torsions", &
    1983              :                           description="Defines new torsions", n_keywords=2, n_subsections=0, &
    1984         9823 :                           repeats=.FALSE.)
    1985              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    1986              :                           description="Four integer indexes per line defining the new torsion"// &
    1987              :                           " Indexes must be relative to the full system and not to the single molecules", repeats=.TRUE., &
    1988         9823 :                           usage="{Integer} {Integer} {Integer} {Integer}", type_of_var=integer_t, n_var=4)
    1989         9823 :       CALL section_add_keyword(subsubsection, keyword)
    1990         9823 :       CALL keyword_release(keyword)
    1991         9823 :       CALL section_add_subsection(subsection, subsubsection)
    1992         9823 :       CALL section_release(subsubsection)
    1993              : 
    1994              :       CALL section_create(subsubsection, __LOCATION__, name="impropers", &
    1995              :                           description="Defines new impropers", n_keywords=2, n_subsections=0, &
    1996         9823 :                           repeats=.FALSE.)
    1997              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    1998              :                           description="Four integer indexes per line defining the new improper"// &
    1999              :                           " Indexes must be relative to the full system and not to the single molecules", repeats=.TRUE., &
    2000         9823 :                           usage="{Integer} {Integer} {Integer} {Integer}", type_of_var=integer_t, n_var=4)
    2001         9823 :       CALL section_add_keyword(subsubsection, keyword)
    2002         9823 :       CALL keyword_release(keyword)
    2003         9823 :       CALL section_add_subsection(subsection, subsubsection)
    2004         9823 :       CALL section_release(subsubsection)
    2005              : 
    2006         9823 :       CALL section_add_subsection(section, subsection)
    2007         9823 :       CALL section_release(subsection)
    2008              : 
    2009         9823 :    END SUBROUTINE create_molset_section
    2010              : 
    2011              : ! **************************************************************************************************
    2012              : !> \brief Specify keywords used to generate connectivity
    2013              : !> \param section the section to create
    2014              : !> \author Teodoro Laino [tlaino] - University of Zurich - 08.2008
    2015              : ! **************************************************************************************************
    2016         9823 :    SUBROUTINE create_generate_section(section)
    2017              :       TYPE(section_type), POINTER                        :: section
    2018              : 
    2019              :       TYPE(keyword_type), POINTER                        :: keyword
    2020              :       TYPE(section_type), POINTER                        :: subsection
    2021              : 
    2022         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    2023         9823 :       NULLIFY (keyword, subsection)
    2024              :       CALL section_create(section, __LOCATION__, name="GENERATE", &
    2025              :                           description="Setup of keywords controlling the generation of the connectivity", &
    2026         9823 :                           n_keywords=2, n_subsections=0, repeats=.TRUE.)
    2027              : 
    2028              :       CALL keyword_create(keyword, __LOCATION__, name="REORDER", &
    2029              :                           description="Reorder a list of atomic coordinates into order so it can be packed correctly.", &
    2030              :                           usage="REORDER <LOGICAL>", &
    2031         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2032         9823 :       CALL section_add_keyword(section, keyword)
    2033         9823 :       CALL keyword_release(keyword)
    2034              : 
    2035              :       CALL keyword_create(keyword, __LOCATION__, name="CREATE_MOLECULES", &
    2036              :                           description="Create molecules names and definition. Can be used to override the"// &
    2037              :                           " molecules specifications of a possible input connectivity or to create molecules"// &
    2038              :                           " specifications for file types as XYZ, missing of molecules definitions.", &
    2039              :                           usage="CREATE_MOLECULES <LOGICAL>", &
    2040         9823 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2041         9823 :       CALL section_add_keyword(section, keyword)
    2042         9823 :       CALL keyword_release(keyword)
    2043              : 
    2044              :       CALL keyword_create(keyword, __LOCATION__, name="BONDPARM", &
    2045              :                           description="Used in conjunction with BONDPARM_FACTOR to "// &
    2046              :                           "help determine wheather there is bonding "// &
    2047              :                           "between two atoms based on a distance criteria. "// &
    2048              :                           "Can use covalent radii information or VDW radii information", &
    2049              :                           usage="BONDPARM (COVALENT||VDW)", &
    2050              :                           enum_c_vals=s2a("COVALENT", "VDW"), &
    2051              :                           enum_i_vals=[do_bondparm_covalent, do_bondparm_vdw], &
    2052         9823 :                           default_i_val=do_bondparm_covalent)
    2053         9823 :       CALL section_add_keyword(section, keyword)
    2054         9823 :       CALL keyword_release(keyword)
    2055              : 
    2056              :       CALL keyword_create(keyword, __LOCATION__, name="BONDPARM_FACTOR", &
    2057              :                           description="Used in conjunction with BONDPARM to help "// &
    2058              :                           "determine wheather there is bonding between "// &
    2059              :                           "two atoms based on a distance criteria.", &
    2060         9823 :                           usage="bondparm_factor {real}", default_r_val=1.1_dp)
    2061         9823 :       CALL section_add_keyword(section, keyword)
    2062         9823 :       CALL keyword_release(keyword)
    2063              : 
    2064              :       CALL keyword_create(keyword, __LOCATION__, name="BONDLENGTH_MAX", &
    2065              :                           description="Maximum distance to generate neighbor lists to build connectivity", &
    2066              :                           usage="BONDLENGTH_MAX <real>", &
    2067              :                           default_r_val=cp_unit_to_cp2k(value=3.0_dp, unit_str="angstrom"), &
    2068         9823 :                           unit_str="angstrom")
    2069         9823 :       CALL section_add_keyword(section, keyword)
    2070         9823 :       CALL keyword_release(keyword)
    2071              : 
    2072              :       CALL keyword_create(keyword, __LOCATION__, name="BONDLENGTH_MIN", &
    2073              :                           description="Minimum distance to generate neighbor lists to build connectivity", &
    2074              :                           usage="BONDLENGTH_MIN <real>", &
    2075              :                           default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="angstrom"), &
    2076         9823 :                           unit_str="angstrom")
    2077         9823 :       CALL section_add_keyword(section, keyword)
    2078         9823 :       CALL keyword_release(keyword)
    2079              : 
    2080              :       ! BONDS
    2081              :       CALL section_create(subsection, __LOCATION__, name="BOND", &
    2082              :                           description="Section used to add/remove  bonds in the connectivity."// &
    2083              :                           " Useful for systems with a complex connectivity, difficult to find out automatically.", &
    2084         9823 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    2085              : 
    2086              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    2087              :                           description="controls the activation of the bond", &
    2088              :                           usage="&BOND (ADD|REMOVE)", &
    2089              :                           enum_c_vals=s2a("ADD", "REMOVE"), &
    2090              :                           enum_i_vals=[do_add, do_remove], &
    2091         9823 :                           default_i_val=do_add)
    2092         9823 :       CALL section_add_keyword(subsection, keyword)
    2093         9823 :       CALL keyword_release(keyword)
    2094              : 
    2095              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2096              :                           description="Specifies two atomic index united by a covalent bond", &
    2097              :                           usage="ATOMS {integer} {integer}", type_of_var=integer_t, n_var=2, &
    2098         9823 :                           repeats=.TRUE.)
    2099         9823 :       CALL section_add_keyword(subsection, keyword)
    2100         9823 :       CALL keyword_release(keyword)
    2101              : 
    2102         9823 :       CALL section_add_subsection(section, subsection)
    2103         9823 :       CALL section_release(subsection)
    2104              : 
    2105              :       ! ANGLES
    2106              :       CALL section_create(subsection, __LOCATION__, name="ANGLE", &
    2107              :                           description="Section used to add/remove angles in the connectivity."// &
    2108              :                           " Useful for systems with a complex connectivity, difficult to find out automatically.", &
    2109         9823 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    2110              : 
    2111              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    2112              :                           description="controls the activation of the bond", &
    2113              :                           usage="&ANGLE (ADD|REMOVE)", &
    2114              :                           enum_c_vals=s2a("ADD", "REMOVE"), &
    2115              :                           enum_i_vals=[do_add, do_remove], &
    2116         9823 :                           default_i_val=do_add)
    2117         9823 :       CALL section_add_keyword(subsection, keyword)
    2118         9823 :       CALL keyword_release(keyword)
    2119              : 
    2120              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2121              :                           description="Specifies two atomic index united by a covalent bond", &
    2122              :                           usage="ATOMS {integer} {integer} {integer} ", type_of_var=integer_t, n_var=3, &
    2123         9823 :                           repeats=.TRUE.)
    2124         9823 :       CALL section_add_keyword(subsection, keyword)
    2125         9823 :       CALL keyword_release(keyword)
    2126              : 
    2127         9823 :       CALL section_add_subsection(section, subsection)
    2128         9823 :       CALL section_release(subsection)
    2129              : 
    2130              :       ! TORSIONS
    2131              :       CALL section_create(subsection, __LOCATION__, name="TORSION", &
    2132              :                           description="Section used to add/remove torsion in the connectivity."// &
    2133              :                           " Useful for systems with a complex connectivity, difficult to find out automatically.", &
    2134         9823 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    2135              : 
    2136              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    2137              :                           description="controls the activation of the bond", &
    2138              :                           usage="&TORSION (ADD|REMOVE)", &
    2139              :                           enum_c_vals=s2a("ADD", "REMOVE"), &
    2140              :                           enum_i_vals=[do_add, do_remove], &
    2141         9823 :                           default_i_val=do_add)
    2142         9823 :       CALL section_add_keyword(subsection, keyword)
    2143         9823 :       CALL keyword_release(keyword)
    2144              : 
    2145              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2146              :                           description="Specifies two atomic index united by a covalent bond", &
    2147              :                           usage="ATOMS {integer} {integer} {integer} {integer} ", type_of_var=integer_t, n_var=4, &
    2148         9823 :                           repeats=.TRUE.)
    2149         9823 :       CALL section_add_keyword(subsection, keyword)
    2150         9823 :       CALL keyword_release(keyword)
    2151              : 
    2152         9823 :       CALL section_add_subsection(section, subsection)
    2153         9823 :       CALL section_release(subsection)
    2154              : 
    2155              :       ! IMPROPERS
    2156              :       CALL section_create(subsection, __LOCATION__, name="IMPROPER", &
    2157              :                           description="Section used to add/remove improper in the connectivity."// &
    2158              :                           " Useful for systems with a complex connectivity, difficult to find out automatically.", &
    2159         9823 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    2160              : 
    2161              :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    2162              :                           description="controls the activation of the bond", &
    2163              :                           usage="&IMPROPER (ADD|REMOVE)", &
    2164              :                           enum_c_vals=s2a("ADD", "REMOVE"), &
    2165              :                           enum_i_vals=[do_add, do_remove], &
    2166         9823 :                           default_i_val=do_add)
    2167         9823 :       CALL section_add_keyword(subsection, keyword)
    2168         9823 :       CALL keyword_release(keyword)
    2169              : 
    2170              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2171              :                           description="Specifies two atomic index united by a covalent bond", &
    2172              :                           usage="ATOMS {integer} {integer} {integer} {integer} ", type_of_var=integer_t, n_var=4, &
    2173         9823 :                           repeats=.TRUE.)
    2174         9823 :       CALL section_add_keyword(subsection, keyword)
    2175         9823 :       CALL keyword_release(keyword)
    2176              : 
    2177         9823 :       CALL section_add_subsection(section, subsection)
    2178         9823 :       CALL section_release(subsection)
    2179              : 
    2180              :       ! ISOLATED ATOMS
    2181              :       CALL section_create(subsection, __LOCATION__, name="ISOLATED_ATOMS", &
    2182              :                           description=" This section specifies the  atoms that one considers isolated. Useful when present "// &
    2183         9823 :                           "ions in solution.", n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2184              :       CALL keyword_create(keyword, __LOCATION__, name="LIST", &
    2185              :                           description="Specifies a list of atomic indexes of the isolated ion", &
    2186              :                           usage="LIST {integer}", type_of_var=integer_t, n_var=-1, &
    2187         9823 :                           repeats=.TRUE.)
    2188         9823 :       CALL section_add_keyword(subsection, keyword)
    2189         9823 :       CALL keyword_release(keyword)
    2190              : 
    2191         9823 :       CALL section_add_subsection(section, subsection)
    2192         9823 :       CALL section_release(subsection)
    2193              : 
    2194              :       ! Neighbor lists keys and printing handling the construction of NL for the connectivity
    2195         9823 :       CALL create_neighbor_lists_section(subsection)
    2196         9823 :       CALL section_add_subsection(section, subsection)
    2197         9823 :       CALL section_release(subsection)
    2198              : 
    2199         9823 :       CALL create_gen_print_section(subsection)
    2200         9823 :       CALL section_add_subsection(section, subsection)
    2201         9823 :       CALL section_release(subsection)
    2202              : 
    2203         9823 :    END SUBROUTINE create_generate_section
    2204              : 
    2205              : ! **************************************************************************************************
    2206              : !> \brief Create the print gen section
    2207              : !> \param section the section to create
    2208              : !> \author teo
    2209              : ! **************************************************************************************************
    2210         9823 :    SUBROUTINE create_gen_print_section(section)
    2211              :       TYPE(section_type), POINTER                        :: section
    2212              : 
    2213              :       TYPE(section_type), POINTER                        :: print_key
    2214              : 
    2215         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    2216              :       CALL section_create(section, __LOCATION__, name="print", &
    2217              :                           description="Section of possible print options in GENERATE code.", &
    2218         9823 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    2219              : 
    2220         9823 :       NULLIFY (print_key)
    2221              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "NEIGHBOR_LISTS", &
    2222              :                                        description="Activates the printing of the neighbor lists used"// &
    2223              :                                        " for generating the connectivity.", print_level=high_print_level, &
    2224         9823 :                                        filename="", unit_str="angstrom")
    2225         9823 :       CALL section_add_subsection(section, print_key)
    2226         9823 :       CALL section_release(print_key)
    2227              : 
    2228              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "SUBCELL", &
    2229              :                                        description="Activates the printing of the subcells used for the "// &
    2230              :                                        "generation of neighbor lists for connectivity.", &
    2231         9823 :                                        print_level=high_print_level, filename="__STD_OUT__")
    2232         9823 :       CALL section_add_subsection(section, print_key)
    2233         9823 :       CALL section_release(print_key)
    2234              : 
    2235         9823 :    END SUBROUTINE create_gen_print_section
    2236              : 
    2237              : ! **************************************************************************************************
    2238              : !> \brief Specify keywords used to define connectivity
    2239              : !> \param section the section to create
    2240              : !> \param default ...
    2241              : !> \author teo
    2242              : ! **************************************************************************************************
    2243        19646 :    SUBROUTINE connectivity_framework(section, default)
    2244              :       TYPE(section_type), POINTER                        :: section
    2245              :       INTEGER, INTENT(IN)                                :: default
    2246              : 
    2247              :       TYPE(keyword_type), POINTER                        :: keyword
    2248              : 
    2249        19646 :       CPASSERT(ASSOCIATED(section))
    2250        19646 :       NULLIFY (keyword)
    2251              :       CALL keyword_create(keyword, __LOCATION__, name="CONN_FILE_NAME", &
    2252              :                           variants=["CONN_FILE"], &
    2253              :                           description="Specifies the filename that contains the molecular connectivity.", &
    2254        39292 :                           usage="CONN_FILE_NAME <FILENAME>", type_of_var=lchar_t)
    2255        19646 :       CALL section_add_keyword(section, keyword)
    2256        19646 :       CALL keyword_release(keyword)
    2257              : 
    2258              :       CALL keyword_create(keyword, __LOCATION__, name="CONN_FILE_FORMAT", &
    2259              :                           variants=["CONNECTIVITY"], &
    2260              :                           description="Ways to determine and generate a molecules. "// &
    2261              :                           "Default is to use GENERATE", &
    2262              :                           usage="CONN_FILE_FORMAT (PSF|UPSF|MOL_SET|GENERATE|OFF|G87|G96|AMBER|USER)", &
    2263              :                           enum_c_vals=s2a("PSF", "UPSF", "MOL_SET", "GENERATE", "OFF", "G87", "G96", "AMBER", "USER"), &
    2264              :                           enum_i_vals=[do_conn_psf, &
    2265              :                                        do_conn_psf_u, &
    2266              :                                        do_conn_mol_set, &
    2267              :                                        do_conn_generate, &
    2268              :                                        do_conn_off, &
    2269              :                                        do_conn_g87, &
    2270              :                                        do_conn_g96, &
    2271              :                                        do_conn_amb7, &
    2272              :                                        do_conn_user], &
    2273              :                           enum_desc=s2a("Use  a PSF file to determine the connectivity."// &
    2274              :                                         " (support standard CHARMM/XPLOR and EXT CHARMM)", &
    2275              :                                         "Read a PSF file in an unformatted way (useful for not so standard PSF).", &
    2276              :                                         "Use multiple PSF (for now...) files to generate the whole system.", &
    2277              :                                         "Use a simple distance criteria. (Look at keyword BONDPARM)", &
    2278              :                                         "Do not generate molecules. (e.g. for QS or ill defined systems)", &
    2279              :                                         "Use GROMOS G87 topology file.", &
    2280              :                                         "Use GROMOS G96 topology file.", &
    2281              :                                         "Use AMBER topology file for reading connectivity (compatible starting from AMBER V.7)", &
    2282              :                                         "Allows the definition of molecules and residues based on the 5th and 6th column of "// &
    2283              :                                         "the COORD section. This option can be handy for the definition of molecules with QS "// &
    2284              :                                         "or to save memory in the case of very large systems (use PARA_RES off)."), &
    2285        39292 :                           default_i_val=default)
    2286        19646 :       CALL section_add_keyword(section, keyword)
    2287        19646 :       CALL keyword_release(keyword)
    2288        19646 :    END SUBROUTINE connectivity_framework
    2289              : 
    2290              : ! **************************************************************************************************
    2291              : !> \brief      Create CP2K input section for the DFT+U method parameters
    2292              : !> \param section ...
    2293              : !> \date       01.11.2007
    2294              : !> \author     Matthias Krack (MK)
    2295              : !> \version    1.0
    2296              : ! **************************************************************************************************
    2297         9823 :    SUBROUTINE create_dft_plus_u_section(section)
    2298              : 
    2299              :       TYPE(section_type), POINTER                        :: section
    2300              : 
    2301              :       TYPE(keyword_type), POINTER                        :: keyword
    2302              :       TYPE(section_type), POINTER                        :: subsection
    2303              : 
    2304         9823 :       CPASSERT(.NOT. ASSOCIATED(section))
    2305              : 
    2306              :       CALL section_create(section, __LOCATION__, &
    2307              :                           name="DFT_PLUS_U", &
    2308              :                           description="Define the parameters for a DFT+U run", &
    2309              :                           n_keywords=3, &
    2310              :                           n_subsections=1, &
    2311         9823 :                           repeats=.FALSE.)
    2312         9823 :       NULLIFY (keyword)
    2313              : 
    2314              :       CALL keyword_create(keyword, __LOCATION__, &
    2315              :                           name="_SECTION_PARAMETERS_", &
    2316              :                           description="Controls the activation of the DFT+U section", &
    2317              :                           usage="&DFT_PLUS_U ON", &
    2318              :                           default_l_val=.FALSE., &
    2319         9823 :                           lone_keyword_l_val=.TRUE.)
    2320         9823 :       CALL section_add_keyword(section, keyword)
    2321         9823 :       CALL keyword_release(keyword)
    2322              : 
    2323              :       CALL keyword_create(keyword, __LOCATION__, &
    2324              :                           name="L", &
    2325              :                           description="Angular momentum quantum number of the "// &
    2326              :                           "orbitals to which the correction is applied", &
    2327              :                           repeats=.FALSE., &
    2328              :                           n_var=1, &
    2329              :                           type_of_var=integer_t, &
    2330              :                           default_i_val=-1, &
    2331         9823 :                           usage="L 2")
    2332         9823 :       CALL section_add_keyword(section, keyword)
    2333         9823 :       CALL keyword_release(keyword)
    2334              : 
    2335              :       CALL keyword_create(keyword, __LOCATION__, &
    2336              :                           name="U_MINUS_J", &
    2337              :                           variants=["U_EFF"], &
    2338              :                           description="Effective parameter U(eff) = U - J", &
    2339              :                           repeats=.FALSE., &
    2340              :                           n_var=1, &
    2341              :                           type_of_var=real_t, &
    2342              :                           default_r_val=0.0_dp, &
    2343              :                           unit_str="au_e", &
    2344        19646 :                           usage="U_MINUS_J [eV] 1.4")
    2345         9823 :       CALL section_add_keyword(section, keyword)
    2346         9823 :       CALL keyword_release(keyword)
    2347              : 
    2348              :       CALL keyword_create(keyword, __LOCATION__, &
    2349              :                           name="N", &
    2350              :                           description="principal quantum number of the "// &
    2351              :                           "orbitals to which the correction is applied. Ignored unless pwdft is used for the calculations", &
    2352              :                           repeats=.FALSE., &
    2353              :                           n_var=1, &
    2354              :                           type_of_var=integer_t, &
    2355              :                           default_i_val=-1, &
    2356         9823 :                           usage="N 2")
    2357         9823 :       CALL section_add_keyword(section, keyword)
    2358         9823 :       CALL keyword_release(keyword)
    2359              : 
    2360              :       CALL keyword_create(keyword, __LOCATION__, &
    2361              :                           name="U", &
    2362              :                           description="U parameter in the theory of Dudarev et al. Ignored unless pwdft is used", &
    2363              :                           repeats=.FALSE., &
    2364              :                           n_var=1, &
    2365              :                           type_of_var=real_t, &
    2366              :                           default_r_val=0.0_dp, &
    2367              :                           unit_str="au_e", &
    2368         9823 :                           usage="U [eV] 1.4")
    2369         9823 :       CALL section_add_keyword(section, keyword)
    2370         9823 :       CALL keyword_release(keyword)
    2371              : 
    2372              :       CALL keyword_create(keyword, __LOCATION__, &
    2373              :                           name="J", &
    2374              :                           description="J parameter in the theory of Dudarev et al. Ignored unless pwdft is used", &
    2375              :                           repeats=.FALSE., &
    2376              :                           n_var=1, &
    2377              :                           type_of_var=real_t, &
    2378              :                           default_r_val=0.0_dp, &
    2379              :                           unit_str="au_e", &
    2380         9823 :                           usage="J [eV] 1.4")
    2381         9823 :       CALL section_add_keyword(section, keyword)
    2382         9823 :       CALL keyword_release(keyword)
    2383              : 
    2384              :       CALL keyword_create(keyword, __LOCATION__, &
    2385              :                           name="alpha", &
    2386              :                           description="alpha parameter in the theory of Dudarev et al. Ignored unless pwdft is used", &
    2387              :                           repeats=.FALSE., &
    2388              :                           n_var=1, &
    2389              :                           type_of_var=real_t, &
    2390              :                           default_r_val=0.0_dp, &
    2391              :                           unit_str="au_e", &
    2392         9823 :                           usage="alpha [eV] 1.4")
    2393         9823 :       CALL section_add_keyword(section, keyword)
    2394         9823 :       CALL keyword_release(keyword)
    2395              : 
    2396              :       CALL keyword_create(keyword, __LOCATION__, &
    2397              :                           name="beta", &
    2398              :                           description="beta parameter in the theory of Dudarev et al. Ignored unless pwdft is used", &
    2399              :                           repeats=.FALSE., &
    2400              :                           n_var=1, &
    2401              :                           type_of_var=real_t, &
    2402              :                           default_r_val=0.0_dp, &
    2403              :                           unit_str="au_e", &
    2404         9823 :                           usage="beta [eV] 1.4")
    2405         9823 :       CALL section_add_keyword(section, keyword)
    2406         9823 :       CALL keyword_release(keyword)
    2407              : 
    2408              :       CALL keyword_create(keyword, __LOCATION__, &
    2409              :                           name="J0", &
    2410              :                           description="J0 parameter in the theory of Dudarev et al. Ignored unless pwdft is used", &
    2411              :                           repeats=.FALSE., &
    2412              :                           n_var=1, &
    2413              :                           type_of_var=real_t, &
    2414              :                           default_r_val=0.0_dp, &
    2415              :                           unit_str="au_e", &
    2416         9823 :                           usage="J0 [eV] 1.4")
    2417         9823 :       CALL section_add_keyword(section, keyword)
    2418         9823 :       CALL keyword_release(keyword)
    2419              : 
    2420              :       CALL keyword_create(keyword, __LOCATION__, &
    2421              :                           name="occupation", &
    2422              :                           description="number of electrons in the hubbard shell. Ignored unless pwdft is used", &
    2423              :                           repeats=.FALSE., &
    2424              :                           n_var=1, &
    2425              :                           type_of_var=real_t, &
    2426              :                           default_r_val=0.0_dp, &
    2427         9823 :                           usage="occupation 6")
    2428         9823 :       CALL section_add_keyword(section, keyword)
    2429         9823 :       CALL keyword_release(keyword)
    2430              : 
    2431              :       CALL keyword_create(keyword, __LOCATION__, &
    2432              :                           name="U_RAMPING", &
    2433              :                           description="Increase the effective U parameter stepwise using the specified "// &
    2434              :                           "increment until the target value given by U_MINUS_J is reached.", &
    2435              :                           repeats=.FALSE., &
    2436              :                           n_var=1, &
    2437              :                           type_of_var=real_t, &
    2438              :                           default_r_val=0.0_dp, &
    2439              :                           unit_str="au_e", &
    2440         9823 :                           usage="U_RAMPING [eV] 0.1")
    2441         9823 :       CALL section_add_keyword(section, keyword)
    2442         9823 :       CALL keyword_release(keyword)
    2443              : 
    2444              :       CALL keyword_create(keyword, __LOCATION__, &
    2445              :                           name="EPS_U_RAMPING", &
    2446              :                           description="Threshold value (SCF convergence) for incrementing the effective "// &
    2447              :                           "U value when U ramping is active.", &
    2448              :                           repeats=.FALSE., &
    2449              :                           n_var=1, &
    2450              :                           type_of_var=real_t, &
    2451              :                           default_r_val=1.0E-5_dp, &
    2452         9823 :                           usage="EPS_U_RAMPING 1.0E-6")
    2453         9823 :       CALL section_add_keyword(section, keyword)
    2454         9823 :       CALL keyword_release(keyword)
    2455              : 
    2456              :       CALL keyword_create(keyword, __LOCATION__, &
    2457              :                           name="INIT_U_RAMPING_EACH_SCF", &
    2458              :                           description="Set the initial U ramping value to zero before each wavefunction optimisation. "// &
    2459              :                           "The default is to apply U ramping only for the initial wavefunction optimisation.", &
    2460              :                           repeats=.FALSE., &
    2461              :                           default_l_val=.FALSE., &
    2462              :                           lone_keyword_l_val=.TRUE., &
    2463         9823 :                           usage="INIT_U_RAMPING_EACH_SCF on")
    2464         9823 :       CALL section_add_keyword(section, keyword)
    2465         9823 :       CALL keyword_release(keyword)
    2466              : 
    2467         9823 :       NULLIFY (subsection)
    2468              : 
    2469              :       CALL section_create(subsection, __LOCATION__, &
    2470              :                           name="ENFORCE_OCCUPATION", &
    2471              :                           description="Enforce and control a special (initial) orbital occupation. "// &
    2472              :                           "Note, this feature works only for the methods MULLIKEN and LOWDIN. "// &
    2473              :                           "It should only be used to prepare an initial configuration. An "// &
    2474              :                           "inadequate parameter choice can easily inhibit SCF convergence.", &
    2475              :                           n_keywords=5, &
    2476              :                           n_subsections=0, &
    2477         9823 :                           repeats=.FALSE.)
    2478              : 
    2479              :       CALL keyword_create(keyword, __LOCATION__, &
    2480              :                           name="_SECTION_PARAMETERS_", &
    2481              :                           description="Controls the activation of the ENFORCE_OCCUPATION section", &
    2482              :                           usage="&ENFORCE_OCCUPATION ON", &
    2483              :                           default_l_val=.FALSE., &
    2484         9823 :                           lone_keyword_l_val=.TRUE.)
    2485         9823 :       CALL section_add_keyword(subsection, keyword)
    2486         9823 :       CALL keyword_release(keyword)
    2487              : 
    2488              :       CALL keyword_create(keyword, __LOCATION__, name="NELEC", &
    2489              :                           variants=["N_ELECTRONS"], &
    2490              :                           description="Number of alpha and beta electrons. An occupation (per spin) smaller than 0.5 is ignored.", &
    2491              :                           repeats=.FALSE., &
    2492              :                           n_var=-1, &
    2493              :                           type_of_var=real_t, &
    2494              :                           default_r_val=0.0_dp, &
    2495        19646 :                           usage="NELEC 5.0 4.0")
    2496         9823 :       CALL section_add_keyword(subsection, keyword)
    2497         9823 :       CALL keyword_release(keyword)
    2498              : 
    2499              :       CALL keyword_create(keyword, __LOCATION__, &
    2500              :                           name="ORBITALS", &
    2501              :                           variants=["M"], &
    2502              :                           description="Select orbitals and occupation order. An input of 1 to 2*L+1 integer values in "// &
    2503              :                           "the range -L to L defining the M values of the spherical orbitals is expected.", &
    2504              :                           repeats=.FALSE., &
    2505              :                           n_var=-1, &
    2506              :                           type_of_var=integer_t, &
    2507              :                           default_i_val=0, &
    2508        19646 :                           usage="ORBITALS 0 +1 -1")
    2509         9823 :       CALL section_add_keyword(subsection, keyword)
    2510         9823 :       CALL keyword_release(keyword)
    2511              : 
    2512              :       CALL keyword_create(keyword, __LOCATION__, &
    2513              :                           name="EPS_SCF", &
    2514              :                           description="The occupation constraint is enforced until this threshold value "// &
    2515              :                           "for the SCF convergence criterion is reached", &
    2516              :                           repeats=.FALSE., &
    2517              :                           n_var=1, &
    2518              :                           type_of_var=real_t, &
    2519              :                           default_r_val=1.0E30_dp, &
    2520         9823 :                           usage="EPS_SCF 0.001")
    2521         9823 :       CALL section_add_keyword(subsection, keyword)
    2522         9823 :       CALL keyword_release(keyword)
    2523              : 
    2524              :       CALL keyword_create(keyword, __LOCATION__, &
    2525              :                           name="MAX_SCF", &
    2526              :                           description="The occupation constraint is applied for this number of initial SCF iterations", &
    2527              :                           repeats=.FALSE., &
    2528              :                           n_var=1, &
    2529              :                           type_of_var=integer_t, &
    2530              :                           default_i_val=-1, &
    2531         9823 :                           usage="MAX_SCF 5")
    2532         9823 :       CALL section_add_keyword(subsection, keyword)
    2533         9823 :       CALL keyword_release(keyword)
    2534              : 
    2535              :       CALL keyword_create(keyword, __LOCATION__, &
    2536              :                           name="SMEAR", &
    2537              :                           description="The occupation constraint is applied with smearing", &
    2538              :                           repeats=.FALSE., &
    2539              :                           default_l_val=.FALSE., &
    2540              :                           lone_keyword_l_val=.TRUE., &
    2541         9823 :                           usage="SMEAR ON")
    2542         9823 :       CALL section_add_keyword(subsection, keyword)
    2543         9823 :       CALL keyword_release(keyword)
    2544              : 
    2545         9823 :       CALL section_add_subsection(section, subsection)
    2546         9823 :       CALL section_release(subsection)
    2547              : 
    2548         9823 :    END SUBROUTINE create_dft_plus_u_section
    2549              : 
    2550              : END MODULE input_cp2k_subsys
        

Generated by: LCOV version 2.0-1