LCOV - code coverage report
Current view: top level - src - input_cp2k_subsys.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:3db43b4) Lines: 100.0 % 855 855
Test Date: 2026-04-03 06:55:30 Functions: 100.0 % 28 28

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

Generated by: LCOV version 2.0-1