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

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

Generated by: LCOV version 2.0-1