LCOV - code coverage report
Current view: top level - src - input_cp2k_colvar.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:591cf04) Lines: 100.0 % 863 863
Test Date: 2026-09-21 02:17:57 Functions: 100.0 % 33 33

            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              : !> \par History
      10              : !>      - taken out of input_cp2k_motion
      11              : !> \author teo & fawzi
      12              : ! **************************************************************************************************
      13              : MODULE input_cp2k_colvar
      14              :    USE bibliography,                    ONLY: Branduardi2007,&
      15              :                                               Zhang2025
      16              :    USE colvar_types,                    ONLY: &
      17              :         do_clv_fix_point, do_clv_geo_center, do_clv_x, do_clv_xy, do_clv_xyz, do_clv_xz, do_clv_y, &
      18              :         do_clv_yz, do_clv_z, plane_def_atoms, plane_def_vec
      19              :    USE cp_output_handling,              ONLY: add_last_numeric,&
      20              :                                               cp_print_key_section_create,&
      21              :                                               high_print_level,&
      22              :                                               low_print_level
      23              :    USE cp_units,                        ONLY: cp_unit_to_cp2k
      24              :    USE fparser,                         ONLY: docf
      25              :    USE input_constants,                 ONLY: gaussian,&
      26              :                                               numerical,&
      27              :                                               rmsd_all,&
      28              :                                               rmsd_list,&
      29              :                                               rmsd_weightlist
      30              :    USE input_keyword_types,             ONLY: keyword_create,&
      31              :                                               keyword_release,&
      32              :                                               keyword_type
      33              :    USE input_section_types,             ONLY: section_add_keyword,&
      34              :                                               section_add_subsection,&
      35              :                                               section_create,&
      36              :                                               section_release,&
      37              :                                               section_type
      38              :    USE input_val_types,                 ONLY: char_t,&
      39              :                                               integer_t,&
      40              :                                               lchar_t,&
      41              :                                               real_t
      42              :    USE kinds,                           ONLY: dp
      43              :    USE string_utilities,                ONLY: s2a
      44              : #include "./base/base_uses.f90"
      45              : 
      46              :    IMPLICIT NONE
      47              :    PRIVATE
      48              : 
      49              :    LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .FALSE.
      50              :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_colvar'
      51              : 
      52              :    PUBLIC :: create_colvar_section, &
      53              :              create_colvar_xyz_d_section, &
      54              :              create_colvar_xyz_od_section
      55              : 
      56              : CONTAINS
      57              : 
      58              : ! **************************************************************************************************
      59              : !> \brief creates the colvar section
      60              : !> \param section the section to be created
      61              : !> \param skip_recursive_colvar ...
      62              : !> \author teo
      63              : ! **************************************************************************************************
      64         5520 :    RECURSIVE SUBROUTINE create_colvar_section(section, skip_recursive_colvar)
      65              :       TYPE(section_type), POINTER                        :: section
      66              :       LOGICAL, OPTIONAL                                  :: skip_recursive_colvar
      67              : 
      68              :       LOGICAL                                            :: skip
      69              :       TYPE(section_type), POINTER                        :: print_key, subsection
      70              : 
      71         5520 :       skip = .FALSE.
      72         5520 :       IF (PRESENT(skip_recursive_colvar)) skip = skip_recursive_colvar
      73         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
      74              :       CALL section_create(section, __LOCATION__, name="COLVAR", &
      75              :                           description="This section specifies the nature of the collective variables.", &
      76         5520 :                           n_keywords=1, n_subsections=1, repeats=.TRUE.)
      77         5520 :       NULLIFY (subsection, print_key)
      78              : 
      79              :       CALL create_colvar_var_section(subsection=subsection, &
      80         5520 :                                      section=section, skip_recursive_colvar=skip)
      81              : 
      82              :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
      83              :                           description="Controls the printing of the colvar specifications", &
      84         5520 :                           n_keywords=0, n_subsections=1, repeats=.TRUE.)
      85         5520 :       NULLIFY (print_key)
      86              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
      87              :                                        description="Controls the printing of basic information during colvar setup.", &
      88         5520 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
      89         5520 :       CALL section_add_subsection(subsection, print_key)
      90         5520 :       CALL section_release(print_key)
      91         5520 :       CALL section_add_subsection(section, subsection)
      92         5520 :       CALL section_release(subsection)
      93              : 
      94         5520 :       CALL create_clv_info_section(subsection)
      95         5520 :       CALL section_add_subsection(section, subsection)
      96         5520 :       CALL section_release(subsection)
      97              : 
      98         5520 :    END SUBROUTINE create_colvar_section
      99              : 
     100              : ! **************************************************************************************************
     101              : !> \brief Create the restart section for colvar restraints
     102              : !>      This section will be only used for restraint restarts.
     103              : !>      Constraints are handled automatically
     104              : !> \param section the section to create
     105              : !> \author Teodoro Laino 08.2006
     106              : ! **************************************************************************************************
     107         5520 :    SUBROUTINE create_clv_info_section(section)
     108              :       TYPE(section_type), POINTER                        :: section
     109              : 
     110              :       TYPE(keyword_type), POINTER                        :: keyword
     111              : 
     112         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     113         5520 :       NULLIFY (keyword)
     114              :       CALL section_create(section, __LOCATION__, name="COLVAR_FUNC_INFO", &
     115              :                           description="Specify further data possibly used by colvars, depending "// &
     116              :                           "on the starting geometry, for computing the functions value.", &
     117         5520 :                           n_subsections=0, repeats=.FALSE.)
     118              : 
     119              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
     120              :                           description="Colvar function data."// &
     121              :                           " The order is an internal order. So if you decide to edit/modify/add these values by hand"// &
     122              :                           " you should know very well what you are doing.!", repeats=.TRUE., &
     123         5520 :                           usage="{Real} ...", type_of_var=real_t, n_var=-1)
     124         5520 :       CALL section_add_keyword(section, keyword)
     125         5520 :       CALL keyword_release(keyword)
     126              : 
     127         5520 :    END SUBROUTINE create_clv_info_section
     128              : 
     129              : ! **************************************************************************************************
     130              : !> \brief creates the collective variables for the colvar section
     131              : !> \param subsection ...
     132              : !> \param section the section to be created
     133              : !> \param skip_recursive_colvar ...
     134              : !> \author teo
     135              : ! **************************************************************************************************
     136         5520 :    RECURSIVE SUBROUTINE create_colvar_var_section(subsection, section, skip_recursive_colvar)
     137              :       TYPE(section_type), POINTER                        :: subsection, section
     138              :       LOGICAL, INTENT(IN)                                :: skip_recursive_colvar
     139              : 
     140         5520 :       CPASSERT(.NOT. ASSOCIATED(subsection))
     141         5520 :       CPASSERT(ASSOCIATED(section))
     142              : 
     143         5520 :       CALL create_colvar_dist_section(subsection)
     144         5520 :       CALL section_add_subsection(section, subsection)
     145         5520 :       CALL section_release(subsection)
     146              : 
     147         5520 :       CALL create_colvar_angle_section(subsection)
     148         5520 :       CALL section_add_subsection(section, subsection)
     149         5520 :       CALL section_release(subsection)
     150              : 
     151         5520 :       CALL create_colvar_torsion_section(subsection)
     152         5520 :       CALL section_add_subsection(section, subsection)
     153         5520 :       CALL section_release(subsection)
     154              : 
     155         5520 :       CALL create_colvar_coord_section(subsection)
     156         5520 :       CALL section_add_subsection(section, subsection)
     157         5520 :       CALL section_release(subsection)
     158              : 
     159         5520 :       CALL create_colvar_pop_section(subsection)
     160         5520 :       CALL section_add_subsection(section, subsection)
     161         5520 :       CALL section_release(subsection)
     162              : 
     163         5520 :       CALL create_colvar_gyr_section(subsection)
     164         5520 :       CALL section_add_subsection(section, subsection)
     165         5520 :       CALL section_release(subsection)
     166              : 
     167         5520 :       CALL create_colvar_d_pl_section(subsection)
     168         5520 :       CALL section_add_subsection(section, subsection)
     169         5520 :       CALL section_release(subsection)
     170              : 
     171         5520 :       CALL create_colvar_a_pl_section(subsection)
     172         5520 :       CALL section_add_subsection(section, subsection)
     173         5520 :       CALL section_release(subsection)
     174              : 
     175         5520 :       CALL create_colvar_rot_section(subsection)
     176         5520 :       CALL section_add_subsection(section, subsection)
     177         5520 :       CALL section_release(subsection)
     178              : 
     179         5520 :       CALL create_colvar_dfunct_section(subsection)
     180         5520 :       CALL section_add_subsection(section, subsection)
     181         5520 :       CALL section_release(subsection)
     182              : 
     183         5520 :       CALL create_colvar_qparm_section(subsection)
     184         5520 :       CALL section_add_subsection(section, subsection)
     185         5520 :       CALL section_release(subsection)
     186              : 
     187         5520 :       CALL create_colvar_hydronium_shell_section(subsection)
     188         5520 :       CALL section_add_subsection(section, subsection)
     189         5520 :       CALL section_release(subsection)
     190              : 
     191         5520 :       CALL create_colvar_hydronium_dist_section(subsection)
     192         5520 :       CALL section_add_subsection(section, subsection)
     193         5520 :       CALL section_release(subsection)
     194              : 
     195         5520 :       CALL create_colvar_acid_hyd_dist_section(subsection)
     196         5520 :       CALL section_add_subsection(section, subsection)
     197         5520 :       CALL section_release(subsection)
     198              : 
     199         5520 :       CALL create_colvar_acid_hyd_shell_section(subsection)
     200         5520 :       CALL section_add_subsection(section, subsection)
     201         5520 :       CALL section_release(subsection)
     202              : 
     203         5520 :       CALL create_colvar_rmsd_section(subsection)
     204         5520 :       CALL section_add_subsection(section, subsection)
     205         5520 :       CALL section_release(subsection)
     206              : 
     207         5520 :       CALL create_colvar_xyz_d_section(subsection)
     208         5520 :       CALL section_add_subsection(section, subsection)
     209         5520 :       CALL section_release(subsection)
     210              : 
     211         5520 :       CALL create_colvar_xyz_od_section(subsection)
     212         5520 :       CALL section_add_subsection(section, subsection)
     213         5520 :       CALL section_release(subsection)
     214              : 
     215         5520 :       CALL create_colvar_u_section(subsection)
     216         5520 :       CALL section_add_subsection(section, subsection)
     217         5520 :       CALL section_release(subsection)
     218              : 
     219         5520 :       CALL create_colvar_wc_section(subsection)
     220         5520 :       CALL section_add_subsection(section, subsection)
     221         5520 :       CALL section_release(subsection)
     222              : 
     223         5520 :       CALL create_colvar_hbp_section(subsection)
     224         5520 :       CALL section_add_subsection(section, subsection)
     225         5520 :       CALL section_release(subsection)
     226              : 
     227         5520 :       CALL create_colvar_ring_puckering_section(subsection)
     228         5520 :       CALL section_add_subsection(section, subsection)
     229         5520 :       CALL section_release(subsection)
     230              : 
     231         5520 :       CALL create_colvar_cond_dist_section(subsection)
     232         5520 :       CALL section_add_subsection(section, subsection)
     233         5520 :       CALL section_release(subsection)
     234              : 
     235         5520 :       CALL create_voronoiipz_section(subsection)
     236         5520 :       CALL section_add_subsection(section, subsection)
     237         5520 :       CALL section_release(subsection)
     238              : 
     239         5520 :       IF (.NOT. skip_recursive_colvar) THEN
     240         1380 :          CALL create_colvar_rpath_section(subsection)
     241         1380 :          CALL section_add_subsection(section, subsection)
     242         1380 :          CALL section_release(subsection)
     243              : 
     244         1380 :          CALL create_colvar_dpath_section(subsection)
     245         1380 :          CALL section_add_subsection(section, subsection)
     246         1380 :          CALL section_release(subsection)
     247              : 
     248         1380 :          CALL create_colvar_comb_section(subsection)
     249         1380 :          CALL section_add_subsection(section, subsection)
     250         1380 :          CALL section_release(subsection)
     251              :       END IF
     252              : 
     253         5520 :    END SUBROUTINE create_colvar_var_section
     254              : 
     255              : ! **************************************************************************************************
     256              : !> \brief collective variables specifying coordination
     257              : !> \param section the section to be created
     258              : !> \author teo
     259              : ! **************************************************************************************************
     260         5520 :    SUBROUTINE create_colvar_coord_section(section)
     261              :       TYPE(section_type), POINTER                        :: section
     262              : 
     263              :       TYPE(keyword_type), POINTER                        :: keyword
     264              :       TYPE(section_type), POINTER                        :: subsection
     265              : 
     266         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     267              :       CALL section_create(section, __LOCATION__, name="coordination", &
     268              :                           description="Section to define the coordination number as a collective variable.", &
     269         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     270              : 
     271         5520 :       NULLIFY (subsection, keyword)
     272              : 
     273              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_FROM", &
     274              :                           variants=["POINTS_FROM"], &
     275              :                           description="Specify indexes of atoms/points building the coordination variable. ", &
     276              :                           usage="ATOMS_FROM {integer} {integer} ..", repeats=.TRUE., &
     277        11040 :                           n_var=-1, type_of_var=integer_t)
     278         5520 :       CALL section_add_keyword(section, keyword)
     279         5520 :       CALL keyword_release(keyword)
     280              : 
     281              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_TO", &
     282              :                           variants=["POINTS_TO"], &
     283              :                           description="Specify indexes of atoms/points building the coordination variable. ", &
     284              :                           usage="ATOMS_TO {integer} {integer} ..", repeats=.TRUE., &
     285        11040 :                           n_var=-1, type_of_var=integer_t)
     286         5520 :       CALL section_add_keyword(section, keyword)
     287         5520 :       CALL keyword_release(keyword)
     288              : 
     289              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_TO_B", &
     290              :                           variants=["POINTS_TO_B"], &
     291              :                           description="For the CV given by the multiplication of two coorination numbers,"// &
     292              :                           " here specify indexes of the third set of atoms/points. ", &
     293              :                           usage="ATOMS_TO_B {integer} {integer} ..", repeats=.TRUE., &
     294        11040 :                           n_var=-1, type_of_var=integer_t)
     295         5520 :       CALL section_add_keyword(section, keyword)
     296         5520 :       CALL keyword_release(keyword)
     297              : 
     298              :       CALL keyword_create(keyword, __LOCATION__, name="KINDS_FROM", &
     299              :                           description="Specify alternatively kinds of atoms building the coordination variable.", &
     300              :                           usage="KINDS_FROM {CHAR} {CHAR} ..", repeats=.TRUE., &
     301         5520 :                           n_var=-1, type_of_var=char_t)
     302         5520 :       CALL section_add_keyword(section, keyword)
     303         5520 :       CALL keyword_release(keyword)
     304              : 
     305              :       CALL keyword_create(keyword, __LOCATION__, name="KINDS_TO", &
     306              :                           description="Specify alternatively kinds of atoms building the coordination variable.", &
     307              :                           usage="KINDS_TO {CHAR} {CHAR} ..", repeats=.TRUE., &
     308         5520 :                           n_var=-1, type_of_var=char_t)
     309         5520 :       CALL section_add_keyword(section, keyword)
     310         5520 :       CALL keyword_release(keyword)
     311              : 
     312              :       CALL keyword_create(keyword, __LOCATION__, name="KINDS_TO_B", &
     313              :                           description="For the CV given by the multiplication of two coorination numbers,"// &
     314              :                           " here specify alternatively kinds of atoms building the coordination variable.", &
     315              :                           usage="KINDS_TO_B {CHAR} {CHAR} ..", repeats=.TRUE., &
     316         5520 :                           n_var=-1, type_of_var=char_t)
     317         5520 :       CALL section_add_keyword(section, keyword)
     318         5520 :       CALL keyword_release(keyword)
     319              : 
     320              :       ! Must be present in each colvar and handled properly
     321         5520 :       CALL create_point_section(subsection)
     322         5520 :       CALL section_add_subsection(section, subsection)
     323         5520 :       CALL section_release(subsection)
     324              : 
     325              :       CALL keyword_create(keyword, __LOCATION__, name="R0", &
     326              :                           variants=["R_0"], &
     327              :                           description="Specify the R0 parameter in the coordination function.", &
     328              :                           usage="R0 {real}", default_r_val=3.0_dp, &
     329        11040 :                           unit_str="bohr", n_var=1)
     330         5520 :       CALL section_add_keyword(section, keyword)
     331         5520 :       CALL keyword_release(keyword)
     332              : 
     333              :       CALL keyword_create(keyword, __LOCATION__, name="NN", &
     334              :                           variants=["EXPON_NUMERATOR"], &
     335              :                           description="Sets the value of the numerator of the exponential factor"// &
     336              :                           " in the coordination FUNCTION.", &
     337              :                           usage="NN {integer}", default_i_val=6, &
     338        11040 :                           n_var=1)
     339         5520 :       CALL section_add_keyword(section, keyword)
     340         5520 :       CALL keyword_release(keyword)
     341              : 
     342              :       CALL keyword_create(keyword, __LOCATION__, name="ND", &
     343              :                           variants=["EXPON_DENOMINATOR"], &
     344              :                           description="Sets the value of the denominator of the exponential factor"// &
     345              :                           " in the coordination FUNCTION.", &
     346              :                           usage="ND {integer}", default_i_val=12, &
     347        11040 :                           n_var=1)
     348         5520 :       CALL section_add_keyword(section, keyword)
     349         5520 :       CALL keyword_release(keyword)
     350              : 
     351              :       CALL keyword_create(keyword, __LOCATION__, name="R0_B", &
     352              :                           variants=["R_0_B"], &
     353              :                           description="For the CV given by the multiplication of two coorination numbers,"// &
     354              :                           " specify the R0 parameter in the second coordination function.", &
     355              :                           usage="R0_B {real}", default_r_val=3.0_dp, &
     356        11040 :                           unit_str="bohr", n_var=1)
     357         5520 :       CALL section_add_keyword(section, keyword)
     358         5520 :       CALL keyword_release(keyword)
     359              : 
     360              :       CALL keyword_create(keyword, __LOCATION__, name="NN_B", &
     361              :                           variants=["EXPON_NUMERATOR_B"], &
     362              :                           description="For the CV given by the multiplication of two coorination numbers,"// &
     363              :                           " Sets the value of the numerator of the exponential factor"// &
     364              :                           " in the coordination FUNCTION.", &
     365              :                           usage="NN_B {integer}", default_i_val=6, &
     366        11040 :                           n_var=1)
     367         5520 :       CALL section_add_keyword(section, keyword)
     368         5520 :       CALL keyword_release(keyword)
     369              : 
     370              :       CALL keyword_create(keyword, __LOCATION__, name="ND_B", &
     371              :                           variants=["EXPON_DENOMINATOR_B"], &
     372              :                           description="For the CV given by the multiplication of two coorination numbers,"// &
     373              :                           " Sets the value of the denominator of the exponential factor"// &
     374              :                           " in the coordination FUNCTION.", &
     375              :                           usage="ND_B {integer}", default_i_val=12, &
     376        11040 :                           n_var=1)
     377         5520 :       CALL section_add_keyword(section, keyword)
     378         5520 :       CALL keyword_release(keyword)
     379              : 
     380         5520 :    END SUBROUTINE create_colvar_coord_section
     381              : 
     382              : ! **************************************************************************************************
     383              : !> \brief ...
     384              : !> \param section ...
     385              : ! **************************************************************************************************
     386         5520 :    SUBROUTINE create_colvar_cond_dist_section(section)
     387              :       TYPE(section_type), POINTER                        :: section
     388              : 
     389              :       TYPE(keyword_type), POINTER                        :: keyword
     390              :       TYPE(section_type), POINTER                        :: subsection
     391              : 
     392         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     393              :       CALL section_create(section, __LOCATION__, name="CONDITIONED_DISTANCE", &
     394              :                           description="Section to define the conditioned distance as a collective variable.", &
     395         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     396              : 
     397         5520 :       NULLIFY (subsection, keyword)
     398              : 
     399              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_DISTANCE", &
     400              :                           description="Specify indexes of atoms/points from which the distance is computed. ", &
     401              :                           usage="ATOMS_DISTANCE {integer} {integer} ..", repeats=.TRUE., &
     402         5520 :                           n_var=-1, type_of_var=integer_t)
     403         5520 :       CALL section_add_keyword(section, keyword)
     404         5520 :       CALL keyword_release(keyword)
     405              : 
     406              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_FROM", &
     407              :                           variants=["POINTS_FROM"], &
     408              :                           description="Specify indexes of atoms/points building the coordination variable. ", &
     409              :                           usage="ATOMS_FROM {integer} {integer} ..", repeats=.TRUE., &
     410        11040 :                           n_var=-1, type_of_var=integer_t)
     411         5520 :       CALL section_add_keyword(section, keyword)
     412         5520 :       CALL keyword_release(keyword)
     413              : 
     414              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_TO", &
     415              :                           variants=["POINTS_TO"], &
     416              :                           description="Specify indexes of atoms/points building the coordination variable. ", &
     417              :                           usage="ATOMS_TO {integer} {integer} ..", repeats=.TRUE., &
     418        11040 :                           n_var=-1, type_of_var=integer_t)
     419         5520 :       CALL section_add_keyword(section, keyword)
     420         5520 :       CALL keyword_release(keyword)
     421              : 
     422              :       CALL keyword_create(keyword, __LOCATION__, name="KINDS_FROM", &
     423              :                           description="Specify alternatively kinds of atoms building the coordination variable.", &
     424              :                           usage="KINDS_FROM {CHAR} {CHAR} ..", repeats=.TRUE., &
     425         5520 :                           n_var=-1, type_of_var=char_t)
     426         5520 :       CALL section_add_keyword(section, keyword)
     427         5520 :       CALL keyword_release(keyword)
     428              : 
     429              :       CALL keyword_create(keyword, __LOCATION__, name="KINDS_TO", &
     430              :                           description="Specify alternatively kinds of atoms building the coordination variable.", &
     431              :                           usage="KINDS_TO {CHAR} {CHAR} ..", repeats=.TRUE., &
     432         5520 :                           n_var=-1, type_of_var=char_t)
     433         5520 :       CALL section_add_keyword(section, keyword)
     434         5520 :       CALL keyword_release(keyword)
     435              : 
     436              :       ! Must be present in each colvar and handled properly
     437         5520 :       CALL create_point_section(subsection)
     438         5520 :       CALL section_add_subsection(section, subsection)
     439         5520 :       CALL section_release(subsection)
     440              : 
     441              :       CALL keyword_create(keyword, __LOCATION__, name="R0", &
     442              :                           variants=["R_0"], &
     443              :                           description="Specify the R0 parameter in the coordination function.", &
     444              :                           usage="R0 {real}", default_r_val=3.0_dp, &
     445        11040 :                           unit_str="bohr", n_var=1)
     446         5520 :       CALL section_add_keyword(section, keyword)
     447         5520 :       CALL keyword_release(keyword)
     448              : 
     449              :       CALL keyword_create(keyword, __LOCATION__, name="NN", &
     450              :                           variants=["EXPON_NUMERATOR"], &
     451              :                           description="Sets the value of the numerator of the exponential factor"// &
     452              :                           " in the coordination FUNCTION.", &
     453              :                           usage="NN {integer}", default_i_val=6, &
     454        11040 :                           n_var=1)
     455         5520 :       CALL section_add_keyword(section, keyword)
     456         5520 :       CALL keyword_release(keyword)
     457              : 
     458              :       CALL keyword_create(keyword, __LOCATION__, name="ND", &
     459              :                           variants=["EXPON_DENOMINATOR"], &
     460              :                           description="Sets the value of the denominator of the exponential factor"// &
     461              :                           " in the coordination FUNCTION.", &
     462              :                           usage="ND {integer}", default_i_val=12, &
     463        11040 :                           n_var=1)
     464         5520 :       CALL section_add_keyword(section, keyword)
     465         5520 :       CALL keyword_release(keyword)
     466              : 
     467              :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
     468              :                           description="Specify the lambda parameter at the exponent of the conditioned distance function.", &
     469              :                           usage="LAMBDA {real}", default_r_val=3.0_dp, &
     470         5520 :                           unit_str="bohr", n_var=1)
     471         5520 :       CALL section_add_keyword(section, keyword)
     472         5520 :       CALL keyword_release(keyword)
     473              : 
     474         5520 :    END SUBROUTINE create_colvar_cond_dist_section
     475              : 
     476              : ! **************************************************************************************************
     477              : !> \brief collective variables specifying population of a specie based on coordination
     478              : !> \param section the section to be created
     479              : !> \date  01.2009
     480              : !> \author Fabio Sterpone
     481              : ! **************************************************************************************************
     482         5520 :    SUBROUTINE create_colvar_pop_section(section)
     483              :       TYPE(section_type), POINTER                        :: section
     484              : 
     485              :       TYPE(keyword_type), POINTER                        :: keyword
     486              :       TYPE(section_type), POINTER                        :: subsection
     487              : 
     488         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     489              :       CALL section_create(section, __LOCATION__, name="population", &
     490              :                           description="Section to define the population of specie as a collective variable. "// &
     491              :                           "See also <https://doi.org/10.1021/jp3019588>.", &
     492         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     493              : 
     494         5520 :       NULLIFY (subsection, keyword)
     495              : 
     496              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_FROM", &
     497              :                           variants=["POINTS_FROM"], &
     498              :                           description="Specify indexes of atoms/points building the coordination variable. ", &
     499              :                           usage="ATOMS_FROM {integer} {integer} ..", repeats=.TRUE., &
     500        11040 :                           n_var=-1, type_of_var=integer_t)
     501         5520 :       CALL section_add_keyword(section, keyword)
     502         5520 :       CALL keyword_release(keyword)
     503              : 
     504              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_TO", &
     505              :                           variants=["POINTS_TO"], &
     506              :                           description="Specify indexes of atoms/points building the coordination variable. ", &
     507              :                           usage="ATOMS_TO {integer} {integer} ..", repeats=.TRUE., &
     508        11040 :                           n_var=-1, type_of_var=integer_t)
     509         5520 :       CALL section_add_keyword(section, keyword)
     510         5520 :       CALL keyword_release(keyword)
     511              : 
     512              :       CALL keyword_create(keyword, __LOCATION__, name="KINDS_FROM", &
     513              :                           description="Specify alternatively kinds of atoms building the coordination variable.", &
     514              :                           usage="KINDS_FROM {CHAR} {CHAR} ..", repeats=.TRUE., &
     515         5520 :                           n_var=-1, type_of_var=char_t)
     516         5520 :       CALL section_add_keyword(section, keyword)
     517         5520 :       CALL keyword_release(keyword)
     518              : 
     519              :       CALL keyword_create(keyword, __LOCATION__, name="KINDS_TO", &
     520              :                           description="Specify alternatively kinds of atoms building the coordination variable.", &
     521              :                           usage="KINDS_TO {CHAR} {CHAR} ..", repeats=.TRUE., &
     522         5520 :                           n_var=-1, type_of_var=char_t)
     523         5520 :       CALL section_add_keyword(section, keyword)
     524         5520 :       CALL keyword_release(keyword)
     525              : 
     526              :       ! Must be present in each colvar and handled properly
     527         5520 :       CALL create_point_section(subsection)
     528         5520 :       CALL section_add_subsection(section, subsection)
     529         5520 :       CALL section_release(subsection)
     530              : 
     531              :       CALL keyword_create(keyword, __LOCATION__, name="R0", &
     532              :                           variants=["R_0"], &
     533              :                           description="Specify the R0 parameter in the coordination function.", &
     534              :                           usage="R0 {real}", default_r_val=3.0_dp, &
     535        11040 :                           n_var=1)
     536         5520 :       CALL section_add_keyword(section, keyword)
     537         5520 :       CALL keyword_release(keyword)
     538              : 
     539              :       CALL keyword_create(keyword, __LOCATION__, name="NN", &
     540              :                           variants=["EXPON_NUMERATOR"], &
     541              :                           description="Sets the value of the numerator of the exponential factor"// &
     542              :                           " in the coordination FUNCTION.", &
     543              :                           usage="NN {integer}", default_i_val=6, &
     544        11040 :                           n_var=1)
     545         5520 :       CALL section_add_keyword(section, keyword)
     546         5520 :       CALL keyword_release(keyword)
     547              : 
     548              :       CALL keyword_create(keyword, __LOCATION__, name="ND", &
     549              :                           variants=["EXPON_DENOMINATOR"], &
     550              :                           description="Sets the value of the denominator of the exponential factor"// &
     551              :                           " in the coordination FUNCTION.", &
     552              :                           usage="ND {integer}", default_i_val=12, &
     553        11040 :                           n_var=1)
     554         5520 :       CALL section_add_keyword(section, keyword)
     555         5520 :       CALL keyword_release(keyword)
     556              : 
     557              :       CALL keyword_create(keyword, __LOCATION__, name="n0", &
     558              :                           variants=["n_0"], &
     559              :                           description="Specify the n0 parameter that sets the coordination of the species.", &
     560              :                           usage="n0 {integer}", default_i_val=4, &
     561        11040 :                           n_var=1)
     562         5520 :       CALL section_add_keyword(section, keyword)
     563         5520 :       CALL keyword_release(keyword)
     564              : 
     565              :       CALL keyword_create(keyword, __LOCATION__, name="SIGMA", &
     566              :                           description="Specify the gaussian width of used to build the population istogram.", &
     567              :                           usage="SIGMA {real}", default_r_val=0.5_dp, &
     568         5520 :                           n_var=1)
     569         5520 :       CALL section_add_keyword(section, keyword)
     570         5520 :       CALL keyword_release(keyword)
     571              : 
     572         5520 :    END SUBROUTINE create_colvar_pop_section
     573              : 
     574              : ! **************************************************************************************************
     575              : !> \brief ...
     576              : !> \param section ...
     577              : ! **************************************************************************************************
     578         5520 :    SUBROUTINE create_colvar_gyr_section(section)
     579              :       TYPE(section_type), POINTER                        :: section
     580              : 
     581              :       TYPE(keyword_type), POINTER                        :: keyword
     582              :       TYPE(section_type), POINTER                        :: subsection
     583              : 
     584         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     585              :       CALL section_create(section, __LOCATION__, name="GYRATION_RADIUS", &
     586              :                           description="Section to define the gyration radius as a collective variable.", &
     587         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     588              : 
     589         5520 :       NULLIFY (subsection, keyword)
     590              : 
     591              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
     592              :                           variants=["POINTS"], &
     593              :                           description="Specify indexes of atoms/points defyining the gyration radius variable. ", &
     594              :                           usage="ATOMS {integer} {integer} ..", repeats=.TRUE., &
     595        11040 :                           n_var=-1, type_of_var=integer_t)
     596         5520 :       CALL section_add_keyword(section, keyword)
     597         5520 :       CALL keyword_release(keyword)
     598              : 
     599              :       CALL keyword_create(keyword, __LOCATION__, name="KINDS", &
     600              :                           description="Specify alternatively kinds of atoms defining the gyration radius.", &
     601              :                           usage="KINDS {CHAR} {CHAR} ..", repeats=.TRUE., &
     602         5520 :                           n_var=-1, type_of_var=char_t)
     603         5520 :       CALL section_add_keyword(section, keyword)
     604         5520 :       CALL keyword_release(keyword)
     605              : 
     606              :       ! Must be present in each colvar and handled properly
     607         5520 :       CALL create_point_section(subsection)
     608         5520 :       CALL section_add_subsection(section, subsection)
     609         5520 :       CALL section_release(subsection)
     610              : 
     611         5520 :    END SUBROUTINE create_colvar_gyr_section
     612              : 
     613              : ! **************************************************************************************************
     614              : !> \brief collective variables specifying torsion
     615              : !> \param section the section to be created
     616              : !> \author teo
     617              : ! **************************************************************************************************
     618         5520 :    SUBROUTINE create_colvar_dfunct_section(section)
     619              :       TYPE(section_type), POINTER                        :: section
     620              : 
     621              :       TYPE(keyword_type), POINTER                        :: keyword
     622              :       TYPE(section_type), POINTER                        :: subsection
     623              : 
     624         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     625              :       CALL section_create(section, __LOCATION__, name="DISTANCE_FUNCTION", &
     626              :                           description="Section to define functions between two distances as collective variables."// &
     627              :                           " The function is defined as d1+coeff*d2", &
     628         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     629              : 
     630         5520 :       NULLIFY (keyword, subsection)
     631              : 
     632              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
     633              :                           variants=["POINTS"], &
     634              :                           description="Specifies the indexes of atoms/points for the two bonds d1=(1-2) d2=(3-4).", &
     635              :                           usage="ATOMS {integer} {integer} {integer} {integer}", &
     636        11040 :                           n_var=4, type_of_var=integer_t)
     637         5520 :       CALL section_add_keyword(section, keyword)
     638         5520 :       CALL keyword_release(keyword)
     639              : 
     640              :       CALL keyword_create(keyword, __LOCATION__, name="COEFFICIENT", &
     641              :                           description="Specifies the coefficient in the function for the constraint."// &
     642              :                           " -1.0 has to be used for distance difference, 1.0 for distance addition", &
     643              :                           usage="COEFFICIENT {real}", &
     644         5520 :                           type_of_var=real_t)
     645         5520 :       CALL section_add_keyword(section, keyword)
     646         5520 :       CALL keyword_release(keyword)
     647              : 
     648              :       CALL keyword_create(keyword, __LOCATION__, name="PBC", &
     649              :                           description="Whether periodic boundary conditions should be applied on the "// &
     650              :                           "atomic position before computing the colvar or not.", &
     651              :                           usage="PBC", &
     652         5520 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     653         5520 :       CALL section_add_keyword(section, keyword)
     654         5520 :       CALL keyword_release(keyword)
     655              : 
     656              :       ! Must be present in each colvar and handled properly
     657         5520 :       CALL create_point_section(subsection)
     658         5520 :       CALL section_add_subsection(section, subsection)
     659         5520 :       CALL section_release(subsection)
     660              : 
     661         5520 :    END SUBROUTINE create_colvar_dfunct_section
     662              : 
     663              : ! **************************************************************************************************
     664              : !> \brief collective variables specifying torsion
     665              : !> \param section the section to be created
     666              : !> \author teo
     667              : ! **************************************************************************************************
     668         5520 :    SUBROUTINE create_colvar_torsion_section(section)
     669              :       TYPE(section_type), POINTER                        :: section
     670              : 
     671              :       TYPE(keyword_type), POINTER                        :: keyword
     672              :       TYPE(section_type), POINTER                        :: subsection
     673              : 
     674         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     675              :       CALL section_create(section, __LOCATION__, name="torsion", &
     676              :                           description="Section to define the torsion as a collective variables.", &
     677         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     678              : 
     679         5520 :       NULLIFY (keyword, subsection)
     680              : 
     681              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
     682              :                           variants=["POINTS"], &
     683              :                           description="Specifies the indexes of atoms/points defining the torsion.", &
     684              :                           usage="ATOMS {integer} {integer} {integer} {integer}", &
     685        11040 :                           n_var=4, type_of_var=integer_t)
     686         5520 :       CALL section_add_keyword(section, keyword)
     687         5520 :       CALL keyword_release(keyword)
     688              : 
     689              :       ! Must be present in each colvar and handled properly
     690         5520 :       CALL create_point_section(subsection)
     691         5520 :       CALL section_add_subsection(section, subsection)
     692         5520 :       CALL section_release(subsection)
     693              : 
     694         5520 :    END SUBROUTINE create_colvar_torsion_section
     695              : 
     696              : ! **************************************************************************************************
     697              : !> \brief collective variables specifying torsion
     698              : !> \param section the section to be created
     699              : !> \author teo
     700              : ! **************************************************************************************************
     701         5520 :    SUBROUTINE create_colvar_rot_section(section)
     702              :       TYPE(section_type), POINTER                        :: section
     703              : 
     704              :       TYPE(keyword_type), POINTER                        :: keyword
     705              :       TYPE(section_type), POINTER                        :: subsection
     706              : 
     707         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     708              :       CALL section_create(section, __LOCATION__, name="bond_rotation", &
     709              :                           description="Section to define the rotation of a bond/line with respect to"// &
     710              :                           " another bond/line", &
     711         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     712              : 
     713         5520 :       NULLIFY (keyword, subsection)
     714              : 
     715              :       CALL keyword_create(keyword, __LOCATION__, name="P1_BOND1", &
     716              :                           description="Specifies the index of atom/point defining the first point"// &
     717              :                           " of the first bond/line.", &
     718              :                           usage="P1_BOND1 {integer}", &
     719         5520 :                           n_var=1, type_of_var=integer_t)
     720         5520 :       CALL section_add_keyword(section, keyword)
     721         5520 :       CALL keyword_release(keyword)
     722              : 
     723              :       CALL keyword_create(keyword, __LOCATION__, name="P2_BOND1", &
     724              :                           description="Specifies the index of atom/point defining the second point"// &
     725              :                           " of the first bond/line.", &
     726              :                           usage="P2_BOND1 {integer}", &
     727         5520 :                           n_var=1, type_of_var=integer_t)
     728         5520 :       CALL section_add_keyword(section, keyword)
     729         5520 :       CALL keyword_release(keyword)
     730              : 
     731              :       CALL keyword_create(keyword, __LOCATION__, name="P1_BOND2", &
     732              :                           description="Specifies the index of atom/point defining the first point"// &
     733              :                           " of the second bond/line.", &
     734              :                           usage="P1_BOND2 {integer}", &
     735         5520 :                           n_var=1, type_of_var=integer_t)
     736         5520 :       CALL section_add_keyword(section, keyword)
     737         5520 :       CALL keyword_release(keyword)
     738              : 
     739              :       CALL keyword_create(keyword, __LOCATION__, name="P2_BOND2", &
     740              :                           description="Specifies the index of atom/point defining the second point"// &
     741              :                           " of the second bond/line.", &
     742              :                           usage="P2_BOND2 {integer}", &
     743         5520 :                           n_var=1, type_of_var=integer_t)
     744         5520 :       CALL section_add_keyword(section, keyword)
     745         5520 :       CALL keyword_release(keyword)
     746              : 
     747              :       ! Must be present in each colvar and handled properly
     748         5520 :       CALL create_point_section(subsection)
     749         5520 :       CALL section_add_subsection(section, subsection)
     750         5520 :       CALL section_release(subsection)
     751              : 
     752         5520 :    END SUBROUTINE create_colvar_rot_section
     753              : 
     754              : ! **************************************************************************************************
     755              : !> \brief collective variables specifying angles
     756              : !> \param section the section to be created
     757              : !> \author teo
     758              : ! **************************************************************************************************
     759         5520 :    SUBROUTINE create_colvar_angle_section(section)
     760              :       TYPE(section_type), POINTER                        :: section
     761              : 
     762              :       TYPE(keyword_type), POINTER                        :: keyword
     763              :       TYPE(section_type), POINTER                        :: subsection
     764              : 
     765         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     766              :       CALL section_create(section, __LOCATION__, name="angle", &
     767              :                           description="Section to define the angle as a collective variables.", &
     768         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     769         5520 :       NULLIFY (keyword, subsection)
     770              : 
     771              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
     772              :                           variants=["POINTS"], &
     773              :                           description="Specifies the indexes of atoms/points defining the angle.", &
     774              :                           usage="ATOMS {integer} {integer} {integer}", &
     775        11040 :                           n_var=3, type_of_var=integer_t)
     776         5520 :       CALL section_add_keyword(section, keyword)
     777         5520 :       CALL keyword_release(keyword)
     778              : 
     779              :       ! Must be present in each colvar and handled properly
     780         5520 :       CALL create_point_section(subsection)
     781         5520 :       CALL section_add_subsection(section, subsection)
     782         5520 :       CALL section_release(subsection)
     783              : 
     784         5520 :    END SUBROUTINE create_colvar_angle_section
     785              : 
     786              : ! **************************************************************************************************
     787              : !> \brief creates the colvar section regarded to the collective variables dist
     788              : !> \param section the section to be created
     789              : !> \author teo
     790              : ! **************************************************************************************************
     791         5520 :    SUBROUTINE create_colvar_dist_section(section)
     792              :       TYPE(section_type), POINTER                        :: section
     793              : 
     794              :       TYPE(keyword_type), POINTER                        :: keyword
     795              :       TYPE(section_type), POINTER                        :: subsection
     796              : 
     797         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     798              :       CALL section_create(section, __LOCATION__, name="distance", &
     799              :                           description="Section to define the distance as a collective variables.", &
     800         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     801         5520 :       NULLIFY (keyword, subsection)
     802              : 
     803              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
     804              :                           variants=["POINTS"], &
     805              :                           description="Specifies the indexes of atoms/points defining the distance.", &
     806              :                           usage="ATOMS {integer} {integer}", &
     807        11040 :                           n_var=2, type_of_var=integer_t)
     808         5520 :       CALL section_add_keyword(section, keyword)
     809         5520 :       CALL keyword_release(keyword)
     810              :       CALL keyword_create(keyword, __LOCATION__, name="AXIS", &
     811              :                           description="Define the axes along which the colvar should be evaluated", &
     812              :                           usage="AXIS (XYZ | X | Y | Z | XY| XZ | YZ)", &
     813              :                           enum_c_vals=s2a("XYZ", "X", "Y", "Z", "XY", "XZ", "YZ"), &
     814              :                           enum_i_vals=[do_clv_xyz, do_clv_x, do_clv_y, do_clv_z, do_clv_xy, do_clv_xz, do_clv_yz], &
     815         5520 :                           default_i_val=do_clv_xyz)
     816         5520 :       CALL section_add_keyword(section, keyword)
     817         5520 :       CALL keyword_release(keyword)
     818              : 
     819              :       CALL keyword_create(keyword, __LOCATION__, name="SIGN", &
     820              :                           description="Whether the distance along one Cartesian axis has to be considered with sign."// &
     821              :                           " This option is valid if only one dimension is selected.", &
     822              :                           usage="SIGN", &
     823         5520 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     824         5520 :       CALL section_add_keyword(section, keyword)
     825         5520 :       CALL keyword_release(keyword)
     826              : 
     827              :       ! Must be present in each colvar and handled properly
     828         5520 :       CALL create_point_section(subsection)
     829         5520 :       CALL section_add_subsection(section, subsection)
     830         5520 :       CALL section_release(subsection)
     831              : 
     832         5520 :    END SUBROUTINE create_colvar_dist_section
     833              : 
     834              : ! **************************************************************************************************
     835              : !> \brief creates the colvar section regarded to the collective variables dist
     836              : !> \param section the section to be created
     837              : !> \author teo
     838              : ! **************************************************************************************************
     839         5523 :    SUBROUTINE create_colvar_xyz_d_section(section)
     840              :       TYPE(section_type), POINTER                        :: section
     841              : 
     842              :       TYPE(keyword_type), POINTER                        :: keyword
     843              :       TYPE(section_type), POINTER                        :: subsection
     844              : 
     845         5523 :       CPASSERT(.NOT. ASSOCIATED(section))
     846              :       CALL section_create(section, __LOCATION__, name="XYZ_DIAG", &
     847              :                           description="Section to define the distance of an atom from its starting "// &
     848              :                           "position ((X-X(0))^2+(Y-Y(0))^2+(Z-Z(0))^2) or part of its components as a collective variable. "// &
     849              :                           "If absolute_position is specified, instead the CV is represented by the "// &
     850              :                           "instantaneous position of the atom (only available for X, Y or Z components).", &
     851         5523 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     852         5523 :       NULLIFY (keyword, subsection)
     853              : 
     854              :       CALL keyword_create(keyword, __LOCATION__, name="ATOM", &
     855              :                           variants=["POINT"], &
     856              :                           description="Specifies the index of the atom/point.", &
     857              :                           usage="ATOM {integer}", &
     858        11046 :                           n_var=1, type_of_var=integer_t)
     859         5523 :       CALL section_add_keyword(section, keyword)
     860         5523 :       CALL keyword_release(keyword)
     861              : 
     862              :       CALL keyword_create(keyword, __LOCATION__, name="COMPONENT", &
     863              :                           description="Define the component of the position vector which will be used "// &
     864              :                           "as a colvar.", &
     865              :                           usage="COMPONENT (XYZ | X | Y | Z | XY| XZ | YZ)", &
     866              :                           enum_c_vals=s2a("XYZ", "X", "Y", "Z", "XY", "XZ", "YZ"), &
     867              :                           enum_i_vals=[do_clv_xyz, do_clv_x, do_clv_y, do_clv_z, do_clv_xy, do_clv_xz, do_clv_yz], &
     868         5523 :                           default_i_val=do_clv_xyz)
     869         5523 :       CALL section_add_keyword(section, keyword)
     870         5523 :       CALL keyword_release(keyword)
     871              : 
     872              :       CALL keyword_create(keyword, __LOCATION__, name="PBC", &
     873              :                           description="Whether periodic boundary conditions should be applied on the "// &
     874              :                           "atomic position before computing the colvar or not.", &
     875              :                           usage="PBC", &
     876         5523 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     877         5523 :       CALL section_add_keyword(section, keyword)
     878         5523 :       CALL keyword_release(keyword)
     879              : 
     880              :       CALL keyword_create(keyword, __LOCATION__, name="ABSOLUTE_POSITION", &
     881              :                           description="If enabled, the absolute position of the atoms will be used. ", &
     882              :                           usage="ABSOLUTE_POSITION", &
     883         5523 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     884         5523 :       CALL section_add_keyword(section, keyword)
     885         5523 :       CALL keyword_release(keyword)
     886              : 
     887              :       ! Must be present in each colvar and handled properly
     888         5523 :       CALL create_point_section(subsection)
     889         5523 :       CALL section_add_subsection(section, subsection)
     890         5523 :       CALL section_release(subsection)
     891              : 
     892         5523 :    END SUBROUTINE create_colvar_xyz_d_section
     893              : 
     894              : ! **************************************************************************************************
     895              : !> \brief creates the colvar section regarded to the collective variables dist
     896              : !> \param section the section to be created
     897              : !> \author teo
     898              : ! **************************************************************************************************
     899         5523 :    SUBROUTINE create_colvar_xyz_od_section(section)
     900              :       TYPE(section_type), POINTER                        :: section
     901              : 
     902              :       TYPE(keyword_type), POINTER                        :: keyword
     903              :       TYPE(section_type), POINTER                        :: subsection
     904              : 
     905         5523 :       CPASSERT(.NOT. ASSOCIATED(section))
     906              :       CALL section_create(section, __LOCATION__, name="XYZ_OUTERDIAG", &
     907              :                           description="Section to define the cross term (XA-XA(0))*(XB-XB(0))+(XA-XA(0))*(YB-YB(0))"// &
     908              :                           " or part of its components as a collective variable. The final term is given by the product"// &
     909              :                           " of the components of A with the components of B.", &
     910         5523 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     911         5523 :       NULLIFY (keyword, subsection)
     912              : 
     913              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
     914              :                           variants=["POINTS"], &
     915              :                           description="Specifies the index of the atoms/points A and B.", &
     916              :                           usage="ATOMS {integer} {integer}", &
     917        11046 :                           n_var=2, type_of_var=integer_t)
     918         5523 :       CALL section_add_keyword(section, keyword)
     919         5523 :       CALL keyword_release(keyword)
     920              : 
     921              :       CALL keyword_create(keyword, __LOCATION__, name="COMPONENT_A", &
     922              :                           description="Define the component of the position vector which will be used "// &
     923              :                           "as a colvar for atom A.", &
     924              :                           usage="COMPONENT_A (XYZ | X | Y | Z | XY| XZ | YZ)", &
     925              :                           enum_c_vals=s2a("XYZ", "X", "Y", "Z", "XY", "XZ", "YZ"), &
     926              :                           enum_i_vals=[do_clv_xyz, do_clv_x, do_clv_y, do_clv_z, do_clv_xy, do_clv_xz, do_clv_yz], &
     927         5523 :                           default_i_val=do_clv_xyz)
     928         5523 :       CALL section_add_keyword(section, keyword)
     929         5523 :       CALL keyword_release(keyword)
     930              : 
     931              :       CALL keyword_create(keyword, __LOCATION__, name="COMPONENT_B", &
     932              :                           description="Define the component of the position vector which will be used "// &
     933              :                           "as a colvar for atom B.", &
     934              :                           usage="COMPONENT_B (XYZ | X | Y | Z | XY| XZ | YZ)", &
     935              :                           enum_c_vals=s2a("XYZ", "X", "Y", "Z", "XY", "XZ", "YZ"), &
     936              :                           enum_i_vals=[do_clv_xyz, do_clv_x, do_clv_y, do_clv_z, do_clv_xy, do_clv_xz, do_clv_yz], &
     937         5523 :                           default_i_val=do_clv_xyz)
     938         5523 :       CALL section_add_keyword(section, keyword)
     939         5523 :       CALL keyword_release(keyword)
     940              : 
     941              :       CALL keyword_create(keyword, __LOCATION__, name="PBC", &
     942              :                           description="Whether periodic boundary conditions should be applied on the "// &
     943              :                           "atomic position before computing the colvar or not.", &
     944              :                           usage="PBC", &
     945         5523 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     946         5523 :       CALL section_add_keyword(section, keyword)
     947         5523 :       CALL keyword_release(keyword)
     948              : 
     949              :       ! Must be present in each colvar and handled properly
     950         5523 :       CALL create_point_section(subsection)
     951         5523 :       CALL section_add_subsection(section, subsection)
     952         5523 :       CALL section_release(subsection)
     953              : 
     954         5523 :    END SUBROUTINE create_colvar_xyz_od_section
     955              : 
     956              : ! **************************************************************************************************
     957              : !> \brief energy as collective variable
     958              : !> \param section the section to be created
     959              : !> \author Sebastiano Caravati
     960              : ! **************************************************************************************************
     961         5520 :    SUBROUTINE create_colvar_u_section(section)
     962              :       TYPE(section_type), POINTER                        :: section
     963              : 
     964              :       TYPE(keyword_type), POINTER                        :: keyword
     965              :       TYPE(section_type), POINTER                        :: subsection
     966              : 
     967         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
     968              :       CALL section_create(section, __LOCATION__, name="u", &
     969              :                           description="Section to define the energy as a generalized collective variable.", &
     970         5520 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     971              : 
     972         5520 :       NULLIFY (subsection, keyword)
     973              :       CALL section_create(subsection, __LOCATION__, name="MIXED", &
     974              :                           description="This section allows to use any function of the energy subsystems"// &
     975              :                           " in a mixed_env calculation as a collective variable.", &
     976         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     977              : 
     978              :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_FUNCTION", &
     979              :                           description="Specifies the functional form of the collective variable in mathematical notation.", &
     980              :                           usage="ENERGY_FUNCTION (E1+E2-LOG(E1/E2))", type_of_var=lchar_t, &
     981         5520 :                           n_var=1)
     982         5520 :       CALL section_add_keyword(subsection, keyword)
     983         5520 :       CALL keyword_release(keyword)
     984              : 
     985              :       CALL keyword_create(keyword, __LOCATION__, name="VARIABLES", &
     986              :                           description="Defines the variables of the functional form. To allow an efficient"// &
     987              :                           " mapping the order of the energy variables will be considered identical to the"// &
     988              :                           " order of the force_eval in the force_eval_order list.", &
     989              :                           usage="VARIABLES x", type_of_var=char_t, &
     990         5520 :                           n_var=-1)
     991         5520 :       CALL section_add_keyword(subsection, keyword)
     992         5520 :       CALL keyword_release(keyword)
     993              : 
     994              :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETERS", &
     995              :                           description="Defines the parameters of the functional form", &
     996              :                           usage="PARAMETERS a b D", type_of_var=char_t, &
     997         5520 :                           n_var=-1, repeats=.TRUE.)
     998         5520 :       CALL section_add_keyword(subsection, keyword)
     999         5520 :       CALL keyword_release(keyword)
    1000              : 
    1001              :       CALL keyword_create(keyword, __LOCATION__, name="VALUES", &
    1002              :                           description="Defines the values of parameter of the functional form", &
    1003              :                           usage="VALUES ", type_of_var=real_t, &
    1004         5520 :                           n_var=-1, repeats=.TRUE., unit_str="internal_cp2k")
    1005         5520 :       CALL section_add_keyword(subsection, keyword)
    1006         5520 :       CALL keyword_release(keyword)
    1007              : 
    1008              :       CALL keyword_create(keyword, __LOCATION__, name="UNITS", &
    1009              :                           description="Optionally, allows to define valid CP2K unit strings for each parameter value. "// &
    1010              :                           "It is assumed that the corresponding parameter value is specified in this unit.", &
    1011              :                           usage="UNITS angstrom eV*angstrom^-1 angstrom^1 K", type_of_var=char_t, &
    1012         5520 :                           n_var=-1, repeats=.TRUE.)
    1013         5520 :       CALL section_add_keyword(subsection, keyword)
    1014         5520 :       CALL keyword_release(keyword)
    1015              : 
    1016              :       CALL keyword_create(keyword, __LOCATION__, name="DX", &
    1017              :                           description="Parameter used for computing the derivative with the Ridders' method.", &
    1018         5520 :                           usage="DX <REAL>", default_r_val=0.1_dp, unit_str="bohr")
    1019         5520 :       CALL section_add_keyword(subsection, keyword)
    1020         5520 :       CALL keyword_release(keyword)
    1021              : 
    1022              :       CALL keyword_create(keyword, __LOCATION__, name="ERROR_LIMIT", &
    1023              :                           description="Checks that the error in computing the derivative is not larger than "// &
    1024              :                           "the value set; in case error is larger a warning message is printed.", &
    1025         5520 :                           usage="ERROR_LIMIT <REAL>", default_r_val=1.0E-12_dp)
    1026         5520 :       CALL section_add_keyword(subsection, keyword)
    1027         5520 :       CALL keyword_release(keyword)
    1028              : 
    1029         5520 :       CALL section_add_subsection(section, subsection)
    1030         5520 :       CALL section_release(subsection)
    1031              : 
    1032         5520 :    END SUBROUTINE create_colvar_u_section
    1033              : 
    1034              : ! **************************************************************************************************
    1035              : !> \brief creates the colvar section regarded to the collective variables distance
    1036              : !>      of a point from a plane
    1037              : !> \param section the section to be created
    1038              : !> \author teo
    1039              : ! **************************************************************************************************
    1040         5520 :    SUBROUTINE create_colvar_d_pl_section(section)
    1041              :       TYPE(section_type), POINTER                        :: section
    1042              : 
    1043              :       TYPE(keyword_type), POINTER                        :: keyword
    1044              :       TYPE(section_type), POINTER                        :: subsection
    1045              : 
    1046         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    1047              :       CALL section_create(section, __LOCATION__, name="distance_point_plane", &
    1048              :                           description="Section to define the distance of a point from a plane "// &
    1049              :                           "as a collective variables.", &
    1050         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1051         5520 :       NULLIFY (keyword, subsection)
    1052              : 
    1053              :       CALL keyword_create(keyword, __LOCATION__, name="PBC", &
    1054              :                           description="Whether periodic boundary conditions should be applied on the "// &
    1055              :                           "atomic position before computing the colvar or not.", &
    1056              :                           usage="PBC", &
    1057         5520 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1058         5520 :       CALL section_add_keyword(section, keyword)
    1059         5520 :       CALL keyword_release(keyword)
    1060              : 
    1061              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_PLANE", &
    1062              :                           variants=["POINTS_PLANE"], &
    1063              :                           description="Specifies the indexes of atoms/points defining the plane.", &
    1064              :                           usage="ATOMS_PLANE <INTEGER> <INTEGER> <INTEGER>", &
    1065        11040 :                           n_var=3, type_of_var=integer_t)
    1066         5520 :       CALL section_add_keyword(section, keyword)
    1067         5520 :       CALL keyword_release(keyword)
    1068              : 
    1069              :       CALL keyword_create(keyword, __LOCATION__, name="ATOM_POINT", &
    1070              :                           variants=["POINT_POINT"], &
    1071              :                           description="Specifies the atom/point index defining the point.", &
    1072              :                           usage="ATOM_POINT <INTEGER>", &
    1073        11040 :                           n_var=1, type_of_var=integer_t)
    1074         5520 :       CALL section_add_keyword(section, keyword)
    1075         5520 :       CALL keyword_release(keyword)
    1076              : 
    1077              :       ! Must be present in each colvar and handled properly
    1078         5520 :       CALL create_point_section(subsection)
    1079         5520 :       CALL section_add_subsection(section, subsection)
    1080         5520 :       CALL section_release(subsection)
    1081              : 
    1082         5520 :    END SUBROUTINE create_colvar_d_pl_section
    1083              : 
    1084              : ! **************************************************************************************************
    1085              : !> \brief creates the colvar section regarded to the collective variables
    1086              : !>      angles betweem two planes
    1087              : !> \param section the section to be created
    1088              : !> \author teo
    1089              : ! **************************************************************************************************
    1090         5520 :    SUBROUTINE create_colvar_a_pl_section(section)
    1091              :       TYPE(section_type), POINTER                        :: section
    1092              : 
    1093              :       TYPE(keyword_type), POINTER                        :: keyword
    1094              :       TYPE(section_type), POINTER                        :: subsection
    1095              : 
    1096         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    1097              :       CALL section_create(section, __LOCATION__, name="angle_plane_plane", &
    1098              :                           description="This section defines the angle between two planes "// &
    1099              :                           "as a collective variables.", &
    1100         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1101         5520 :       NULLIFY (keyword, subsection)
    1102              : 
    1103              :       CALL section_create(subsection, __LOCATION__, name="PLANE", &
    1104              :                           description="This section defines the plane. When using this colvar, "// &
    1105              :                           "two plane section must be defined!", &
    1106         5520 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    1107              : 
    1108              :       CALL keyword_create(keyword, __LOCATION__, name="DEF_TYPE", &
    1109              :                           description="Specify how the plane is defined: either by 3 atoms or by a fixed normal "// &
    1110              :                           "vector. At least one plane must be defined through atoms.", &
    1111              :                           usage="DEF_TYPE ATOMS", &
    1112              :                           default_i_val=plane_def_atoms, &
    1113              :                           enum_c_vals=s2a("ATOMS", "VECTOR"), &
    1114              :                           enum_desc=s2a("Plane defined by the position of 3 atoms", &
    1115              :                                         "Plane defined by a fixed normal vector"), &
    1116         5520 :                           enum_i_vals=[plane_def_atoms, plane_def_vec])
    1117         5520 :       CALL section_add_keyword(subsection, keyword)
    1118         5520 :       CALL keyword_release(keyword)
    1119              : 
    1120              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    1121              :                           description="Specifies the indexes of 3 atoms/points defining the plane.", &
    1122              :                           usage="ATOMS <INTEGER> <INTEGER> <INTEGER>", &
    1123         5520 :                           n_var=3, type_of_var=integer_t)
    1124         5520 :       CALL section_add_keyword(subsection, keyword)
    1125         5520 :       CALL keyword_release(keyword)
    1126              : 
    1127              :       CALL keyword_create(keyword, __LOCATION__, name="NORMAL_VECTOR", &
    1128              :                           description="Alternatively to 3 atoms/points one can define one of the two, "// &
    1129              :                           "planes by defining its NORMAL vector.", &
    1130              :                           usage="NORMAL_VECTOR 0.0 1.0 0.0", &
    1131         5520 :                           n_var=3, type_of_var=real_t)
    1132         5520 :       CALL section_add_keyword(subsection, keyword)
    1133         5520 :       CALL keyword_release(keyword)
    1134         5520 :       CALL section_add_subsection(section, subsection)
    1135         5520 :       CALL section_release(subsection)
    1136              : 
    1137              :       ! Must be present in each colvar and handled properly
    1138         5520 :       CALL create_point_section(subsection)
    1139         5520 :       CALL section_add_subsection(section, subsection)
    1140         5520 :       CALL section_release(subsection)
    1141         5520 :    END SUBROUTINE create_colvar_a_pl_section
    1142              : 
    1143              : ! **************************************************************************************************
    1144              : !> \brief create a geometrical point as a function of several atom coordinates
    1145              : !> \param section the section to be created
    1146              : !> \author teo
    1147              : ! **************************************************************************************************
    1148        93846 :    SUBROUTINE create_point_section(section)
    1149              :       TYPE(section_type), POINTER                        :: section
    1150              : 
    1151              :       TYPE(keyword_type), POINTER                        :: keyword
    1152              : 
    1153        93846 :       CPASSERT(.NOT. ASSOCIATED(section))
    1154              :       CALL section_create(section, __LOCATION__, name="POINT", &
    1155              :                           description="Enables the possibility to use geometrical centers instead of single atoms"// &
    1156              :                           " to define colvars", &
    1157        93846 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    1158              : 
    1159        93846 :       NULLIFY (keyword)
    1160              : 
    1161              :       CALL keyword_create(keyword, __LOCATION__, name="TYPE", &
    1162              :                           description="Chooses the type of geometrical point", &
    1163              :                           usage="type (GEO_CENTER|FIX_POINT)", &
    1164              :                           enum_c_vals=s2a("GEO_CENTER", "FIX_POINT"), &
    1165              :                           enum_desc=s2a("Computes the geometrical center of the listed atoms", &
    1166              :                                         "Defines a fixed point in space"), &
    1167              :                           enum_i_vals=[do_clv_geo_center, do_clv_fix_point], &
    1168        93846 :                           default_i_val=do_clv_geo_center)
    1169        93846 :       CALL section_add_keyword(section, keyword)
    1170        93846 :       CALL keyword_release(keyword)
    1171              : 
    1172              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    1173              :                           description="Specifies the indexes of atoms defining the geometrical center", &
    1174              :                           usage="ATOMS {integer} {integer} {integer} {integer}", &
    1175        93846 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
    1176        93846 :       CALL section_add_keyword(section, keyword)
    1177        93846 :       CALL keyword_release(keyword)
    1178              : 
    1179              :       CALL keyword_create( &
    1180              :          keyword, __LOCATION__, name="WEIGHTS", &
    1181              :          description="Specifies the weights for a weighted geometrical center. Default is 1/natoms for every atom", &
    1182              :          usage="WEIGHTS {real} {real} {real} {real}", &
    1183        93846 :          n_var=-1, type_of_var=real_t, repeats=.TRUE.)
    1184        93846 :       CALL section_add_keyword(section, keyword)
    1185        93846 :       CALL keyword_release(keyword)
    1186              : 
    1187              :       CALL keyword_create(keyword, __LOCATION__, name="XYZ", &
    1188              :                           description="Specifies the xyz of the fixed point (if the case)", &
    1189              :                           usage="XYZ {real} {real} {real}", &
    1190              :                           n_var=3, type_of_var=real_t, unit_str="bohr", &
    1191        93846 :                           repeats=.FALSE.)
    1192        93846 :       CALL section_add_keyword(section, keyword)
    1193        93846 :       CALL keyword_release(keyword)
    1194              : 
    1195        93846 :    END SUBROUTINE create_point_section
    1196              : 
    1197              : ! **************************************************************************************************
    1198              : !> \brief collective variables specifying torsion
    1199              : !> \param section the section to be created
    1200              : !> \author teo
    1201              : ! **************************************************************************************************
    1202         5520 :    SUBROUTINE create_colvar_qparm_section(section)
    1203              :       TYPE(section_type), POINTER                        :: section
    1204              : 
    1205              :       TYPE(keyword_type), POINTER                        :: keyword
    1206              :       TYPE(section_type), POINTER                        :: subsection
    1207              : 
    1208         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    1209              :       CALL section_create(section, __LOCATION__, name="qparm", &
    1210              :                           description="Section to define the Q parameter (crystalline order parameter) as a collective variable.", &
    1211         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1212              : 
    1213         5520 :       NULLIFY (keyword, subsection)
    1214              : 
    1215              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_FROM", &
    1216              :                           variants=["POINTS_FROM"], &
    1217              :                           description="Specify indexes of atoms/points building the coordination variable. ", &
    1218              :                           usage="ATOMS_FROM {integer} {integer} ..", repeats=.TRUE., &
    1219        11040 :                           n_var=-1, type_of_var=integer_t)
    1220         5520 :       CALL section_add_keyword(section, keyword)
    1221         5520 :       CALL keyword_release(keyword)
    1222              : 
    1223              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS_TO", &
    1224              :                           variants=["POINTS_TO"], &
    1225              :                           description="Specify indexes of atoms/points building the coordination variable. ", &
    1226              :                           usage="ATOMS_TO {integer} {integer} ..", repeats=.TRUE., &
    1227        11040 :                           n_var=-1, type_of_var=integer_t)
    1228         5520 :       CALL section_add_keyword(section, keyword)
    1229         5520 :       CALL keyword_release(keyword)
    1230              : 
    1231              :       CALL keyword_create(keyword, __LOCATION__, name="RCUT", &
    1232              :                           description="Specifies the distance cutoff for neighbors. "// &
    1233              :                           "Cutoff function is exactly zero for all neighbors beyond RCUT.", &
    1234              :                           usage="RCUT {real}", &
    1235         5520 :                           n_var=1, unit_str="angstrom", type_of_var=real_t)
    1236         5520 :       CALL section_add_keyword(section, keyword)
    1237         5520 :       CALL keyword_release(keyword)
    1238              : 
    1239              :       CALL keyword_create(keyword, __LOCATION__, name="INCLUDE_IMAGES", &
    1240              :                           description="Whether to include periodic images of ATOMS_TO into the neighbor list.", &
    1241              :                           usage="INCLUDE_IMAGES", &
    1242         5520 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1243         5520 :       CALL section_add_keyword(section, keyword)
    1244         5520 :       CALL keyword_release(keyword)
    1245              : 
    1246              :       CALL keyword_create(keyword, __LOCATION__, name="RSTART", &
    1247              :                           description="Specifies the distance cutoff for neighbors. "// &
    1248              :                           "Cutoff function is exactly 1 for all neighbors closer than RSTART.", &
    1249              :                           usage="RSTART {real}", &
    1250         5520 :                           n_var=1, unit_str="angstrom", type_of_var=real_t)
    1251         5520 :       CALL section_add_keyword(section, keyword)
    1252         5520 :       CALL keyword_release(keyword)
    1253              : 
    1254              :       CALL keyword_create(keyword, __LOCATION__, name="L", &
    1255              :                           description="Specifies the L spherical harmonics from Ylm.", &
    1256              :                           usage="L {integer}", &
    1257         5520 :                           n_var=1, type_of_var=integer_t)
    1258         5520 :       CALL section_add_keyword(section, keyword)
    1259         5520 :       CALL keyword_release(keyword)
    1260              : 
    1261              :       !CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
    1262              :       !                    description="Specifies the width of the Fermi-Dirac style smearing around RCUT.", &
    1263              :       !                    usage="ALPHA {real}", unit_str="angstrom^-1", default_r_val=0.0_dp)
    1264              :       !CALL section_add_keyword(section, keyword)
    1265              :       !CALL keyword_release(keyword)
    1266              : 
    1267              :       ! Must be present in each colvar and handled properly
    1268         5520 :       CALL create_point_section(subsection)
    1269         5520 :       CALL section_add_subsection(section, subsection)
    1270         5520 :       CALL section_release(subsection)
    1271              : 
    1272         5520 :    END SUBROUTINE create_colvar_qparm_section
    1273              : 
    1274              : ! **************************************************************************************************
    1275              : !> \brief collective variables specifying hydronium solvation
    1276              : !> \param section the section to be created
    1277              : !> \author Marcel Baer
    1278              : ! **************************************************************************************************
    1279         5520 :    SUBROUTINE create_colvar_hydronium_shell_section(section)
    1280              :       TYPE(section_type), POINTER                        :: section
    1281              : 
    1282              :       TYPE(keyword_type), POINTER                        :: keyword
    1283              : 
    1284         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    1285              :       CALL section_create(section, __LOCATION__, name="HYDRONIUM_SHELL", &
    1286              :                           description="Section to define the formation of a hydronium as a"// &
    1287              :                           " collective variable. Number of oxygens in the 1st shell of the"// &
    1288              :                           " hydronium. Adapted from Equation (3) in Supplementary Info of"// &
    1289              :                           " J. Am. Chem. Soc.,128, 2006, 11318, i.e. omitting the cutoff function"// &
    1290              :                           " and summing only over the oxygens of water.", &
    1291         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1292              : 
    1293         5520 :       NULLIFY (keyword)
    1294              : 
    1295              :       CALL keyword_create(keyword, __LOCATION__, name="OXYGENS", &
    1296              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1297              :                           " Oxygens of the water molecules.", &
    1298              :                           usage="OXYGENS {integer} {integer} ..", repeats=.TRUE., &
    1299         5520 :                           n_var=-1, type_of_var=integer_t)
    1300         5520 :       CALL section_add_keyword(section, keyword)
    1301         5520 :       CALL keyword_release(keyword)
    1302              : 
    1303              :       CALL keyword_create(keyword, __LOCATION__, name="HYDROGENS", &
    1304              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1305              :                           " Hydrogens of the water molecules.", &
    1306              :                           usage="HYDROGENS {integer} {integer} ..", repeats=.TRUE., &
    1307         5520 :                           n_var=-1, type_of_var=integer_t)
    1308         5520 :       CALL section_add_keyword(section, keyword)
    1309         5520 :       CALL keyword_release(keyword)
    1310              : 
    1311              :       CALL keyword_create(keyword, __LOCATION__, name="ROO", &
    1312              :                           description="Specifies the rc parameter in the coordination function:"// &
    1313              :                           " number of oxygens per water oxygen.", &
    1314              :                           usage="ROO {real}", default_r_val=cp_unit_to_cp2k(value=3.0_dp, &
    1315         5520 :                                                                             unit_str="bohr"), unit_str="bohr", n_var=1)
    1316         5520 :       CALL section_add_keyword(section, keyword)
    1317         5520 :       CALL keyword_release(keyword)
    1318              : 
    1319              :       CALL keyword_create(keyword, __LOCATION__, name="pOO", &
    1320              :                           variants=["EXPON_NUMERATORA"], &
    1321              :                           description="Sets the value of the numerator of the exponential factor"// &
    1322              :                           " in the coordination function: number of oxygens per water oxygen.", &
    1323              :                           usage="pOO {integer}", default_i_val=6, &
    1324        11040 :                           n_var=1)
    1325         5520 :       CALL section_add_keyword(section, keyword)
    1326         5520 :       CALL keyword_release(keyword)
    1327              : 
    1328              :       CALL keyword_create(keyword, __LOCATION__, name="qOO", &
    1329              :                           variants=["EXPON_DENOMINATORA"], &
    1330              :                           description="Sets the value of the denominator of the exponential factor"// &
    1331              :                           " in the coordination function: number of oxygens per water oxygen.", &
    1332              :                           usage="qOO {integer}", default_i_val=12, &
    1333        11040 :                           n_var=1)
    1334         5520 :       CALL section_add_keyword(section, keyword)
    1335         5520 :       CALL keyword_release(keyword)
    1336              : 
    1337              :       CALL keyword_create(keyword, __LOCATION__, name="ROH", &
    1338              :                           description="Specifies the rc parameter in the coordination function:"// &
    1339              :                           " number of hydrogens per water molecule.", &
    1340              :                           usage="ROH {real}", default_r_val=cp_unit_to_cp2k(value=3.0_dp, &
    1341         5520 :                                                                             unit_str="bohr"), unit_str="bohr", n_var=1)
    1342         5520 :       CALL section_add_keyword(section, keyword)
    1343         5520 :       CALL keyword_release(keyword)
    1344              : 
    1345              :       CALL keyword_create(keyword, __LOCATION__, name="pOH", &
    1346              :                           variants=["EXPON_NUMERATORB"], &
    1347              :                           description="Sets the value of the numerator of the exponential factor"// &
    1348              :                           " in the coordination function: number of hydrogens per water molecule.", &
    1349              :                           usage="pOH {integer}", default_i_val=6, &
    1350        11040 :                           n_var=1)
    1351         5520 :       CALL section_add_keyword(section, keyword)
    1352         5520 :       CALL keyword_release(keyword)
    1353              : 
    1354              :       CALL keyword_create(keyword, __LOCATION__, name="qOH", &
    1355              :                           variants=["EXPON_DENOMINATORB"], &
    1356              :                           description="Sets the value of the denominator of the exponential factor"// &
    1357              :                           " in the coordination function: number of hydrogens per water molecule.", &
    1358              :                           usage="qOH {integer}", default_i_val=12, &
    1359        11040 :                           n_var=1)
    1360         5520 :       CALL section_add_keyword(section, keyword)
    1361         5520 :       CALL keyword_release(keyword)
    1362              : 
    1363              :       CALL keyword_create(keyword, __LOCATION__, name="NH", &
    1364              :                           description="Specifies the NH parameter in the M function.", &
    1365              :                           usage="NH {real}", default_r_val=3.0_dp, &
    1366         5520 :                           n_var=1)
    1367         5520 :       CALL section_add_keyword(section, keyword)
    1368         5520 :       CALL keyword_release(keyword)
    1369              : 
    1370              :       CALL keyword_create(keyword, __LOCATION__, name="pM", &
    1371              :                           variants=["EXPON_NUMERATOR"], &
    1372              :                           description="Sets the value of the numerator of the exponential factor"// &
    1373              :                           " in the M function.", &
    1374              :                           usage="pM {integer}", default_i_val=8, &
    1375        11040 :                           n_var=1)
    1376         5520 :       CALL section_add_keyword(section, keyword)
    1377         5520 :       CALL keyword_release(keyword)
    1378              : 
    1379              :       CALL keyword_create(keyword, __LOCATION__, name="qM", &
    1380              :                           variants=["EXPON_DENOMINATOR"], &
    1381              :                           description="Sets the value of the denominator of the exponential factor"// &
    1382              :                           " in the M function.", &
    1383              :                           usage="qM {integer}", default_i_val=16, &
    1384        11040 :                           n_var=1)
    1385         5520 :       CALL section_add_keyword(section, keyword)
    1386         5520 :       CALL keyword_release(keyword)
    1387              : 
    1388              :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
    1389              :                           description="Specify the LAMBDA parameter in the hydronium function.", &
    1390              :                           usage="LAMBDA {real}", default_r_val=10.0_dp, &
    1391         5520 :                           n_var=1)
    1392         5520 :       CALL section_add_keyword(section, keyword)
    1393         5520 :       CALL keyword_release(keyword)
    1394              : 
    1395         5520 :    END SUBROUTINE create_colvar_hydronium_shell_section
    1396              : 
    1397              : ! **************************************************************************************************
    1398              : !> \brief collective variables specifying the distance between hydronium and hydroxide ion
    1399              : !> \param section the section to be created
    1400              : !> \author Dorothea Golze
    1401              : ! **************************************************************************************************
    1402         5520 :    SUBROUTINE create_colvar_hydronium_dist_section(section)
    1403              :       TYPE(section_type), POINTER                        :: section
    1404              : 
    1405              :       TYPE(keyword_type), POINTER                        :: keyword
    1406              : 
    1407         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    1408              :       CALL section_create(section, __LOCATION__, name="HYDRONIUM_DISTANCE", &
    1409              :                           description="Section to define the formation of a hydronium as a"// &
    1410              :                           " collective variable. Distance between hydronium and hydroxide ion"// &
    1411              :                           " Experimental at this point, i.e. not proved to be an effective"// &
    1412              :                           " collective variable.", &
    1413         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1414              : 
    1415         5520 :       NULLIFY (keyword)
    1416              : 
    1417              :       CALL keyword_create(keyword, __LOCATION__, name="OXYGENS", &
    1418              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1419              :                           " Oxygens of the water molecules.", &
    1420              :                           usage="OXYGENS {integer} {integer} ..", repeats=.TRUE., &
    1421         5520 :                           n_var=-1, type_of_var=integer_t)
    1422         5520 :       CALL section_add_keyword(section, keyword)
    1423         5520 :       CALL keyword_release(keyword)
    1424              : 
    1425              :       CALL keyword_create(keyword, __LOCATION__, name="HYDROGENS", &
    1426              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1427              :                           " Hydrogens of the water molecules.", &
    1428              :                           usage="HYDROGENS {integer} {integer} ..", repeats=.TRUE., &
    1429         5520 :                           n_var=-1, type_of_var=integer_t)
    1430         5520 :       CALL section_add_keyword(section, keyword)
    1431         5520 :       CALL keyword_release(keyword)
    1432              : 
    1433              :       CALL keyword_create(keyword, __LOCATION__, name="ROH", &
    1434              :                           description="Specifies the rc parameter in the coordination function:"// &
    1435              :                           " number of hydrogens per water molecule.", &
    1436              :                           usage="ROH {real}", default_r_val=cp_unit_to_cp2k(value=2.4_dp, &
    1437         5520 :                                                                             unit_str="bohr"), unit_str="bohr", n_var=1)
    1438         5520 :       CALL section_add_keyword(section, keyword)
    1439         5520 :       CALL keyword_release(keyword)
    1440              : 
    1441              :       CALL keyword_create(keyword, __LOCATION__, name="pOH", &
    1442              :                           description="Sets the value of the numerator of the exponential factor"// &
    1443              :                           " in the coordination function: number of hydrogens per water molecule.", &
    1444              :                           usage="pOH {integer}", default_i_val=6, &
    1445         5520 :                           n_var=1)
    1446         5520 :       CALL section_add_keyword(section, keyword)
    1447         5520 :       CALL keyword_release(keyword)
    1448              : 
    1449              :       CALL keyword_create(keyword, __LOCATION__, name="qOH", &
    1450              :                           description="Sets the value of the denominator of the exponential factor"// &
    1451              :                           " in the coordination function: number of hydrogens per water molecule.", &
    1452              :                           usage="qOH {integer}", default_i_val=12, &
    1453         5520 :                           n_var=1)
    1454         5520 :       CALL section_add_keyword(section, keyword)
    1455         5520 :       CALL keyword_release(keyword)
    1456              : 
    1457              :       CALL keyword_create(keyword, __LOCATION__, name="NH", &
    1458              :                           description="Specifies the NH parameter in the M function.", &
    1459              :                           usage="NH {real}", default_r_val=2.2_dp, &
    1460         5520 :                           n_var=1)
    1461         5520 :       CALL section_add_keyword(section, keyword)
    1462         5520 :       CALL keyword_release(keyword)
    1463              : 
    1464              :       CALL keyword_create(keyword, __LOCATION__, name="pM", &
    1465              :                           description="Sets the value of the numerator of the exponential factor"// &
    1466              :                           " in the M function.", &
    1467              :                           usage="pM {integer}", default_i_val=8, &
    1468         5520 :                           n_var=1)
    1469         5520 :       CALL section_add_keyword(section, keyword)
    1470         5520 :       CALL keyword_release(keyword)
    1471              : 
    1472              :       CALL keyword_create(keyword, __LOCATION__, name="qM", &
    1473              :                           description="Sets the value of the denominator of the exponential factor"// &
    1474              :                           " in the M function.", &
    1475              :                           usage="qM {integer}", default_i_val=16, &
    1476         5520 :                           n_var=1)
    1477         5520 :       CALL section_add_keyword(section, keyword)
    1478         5520 :       CALL keyword_release(keyword)
    1479              : 
    1480              :       CALL keyword_create(keyword, __LOCATION__, name="NN", &
    1481              :                           description="Specifies the NN parameter in the F function.", &
    1482              :                           usage="NN {real}", default_r_val=1.5_dp, &
    1483         5520 :                           n_var=1)
    1484         5520 :       CALL section_add_keyword(section, keyword)
    1485         5520 :       CALL keyword_release(keyword)
    1486              : 
    1487              :       CALL keyword_create(keyword, __LOCATION__, name="pF", &
    1488              :                           description="Sets the value of the numerator of the exponential factor"// &
    1489              :                           " in the F function.", &
    1490              :                           usage="pF {integer}", default_i_val=8, &
    1491         5520 :                           n_var=1)
    1492         5520 :       CALL section_add_keyword(section, keyword)
    1493         5520 :       CALL keyword_release(keyword)
    1494              : 
    1495              :       CALL keyword_create(keyword, __LOCATION__, name="qF", &
    1496              :                           description="Sets the value of the denominator of the exponential factor"// &
    1497              :                           " in the F function.", &
    1498              :                           usage="qF {integer}", default_i_val=16, &
    1499         5520 :                           n_var=1)
    1500         5520 :       CALL section_add_keyword(section, keyword)
    1501         5520 :       CALL keyword_release(keyword)
    1502              : 
    1503              :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
    1504              :                           description="Specify the LAMBDA parameter in the hydronium function.", &
    1505              :                           usage="LAMBDA {real}", default_r_val=20.0_dp, &
    1506         5520 :                           n_var=1)
    1507         5520 :       CALL section_add_keyword(section, keyword)
    1508         5520 :       CALL keyword_release(keyword)
    1509              : 
    1510         5520 :    END SUBROUTINE create_colvar_hydronium_dist_section
    1511              : 
    1512              : ! **************************************************************************************************
    1513              : !> \brief collective variables specifying the solvation of carboxylic acid;
    1514              : !>        distance between hydronium ion and acetate ion; Equation (2) in
    1515              : !>        Supplementary Information of J. Am. Chem. Soc.,128,  2006, 11318
    1516              : !> \param section the section to be created
    1517              : !> \author Dorothea Golze
    1518              : ! **************************************************************************************************
    1519         5520 :    SUBROUTINE create_colvar_acid_hyd_dist_section(section)
    1520              :       TYPE(section_type), POINTER                        :: section
    1521              : 
    1522              :       TYPE(keyword_type), POINTER                        :: keyword
    1523              : 
    1524         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    1525              :       CALL section_create(section, __LOCATION__, name="ACID_HYDRONIUM_DISTANCE", &
    1526              :                           description="Section to define the dissociation of a carboxylic acid in"// &
    1527              :                           " water. Distance between hydronium ion and acetate ion. Equation (2)"// &
    1528              :                           " in Supplementary Info of J. Am. Chem. Soc.,128,  2006, 11318.", &
    1529         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1530              : 
    1531         5520 :       NULLIFY (keyword)
    1532              : 
    1533              :       CALL keyword_create(keyword, __LOCATION__, name="OXYGENS_WATER", &
    1534              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1535              :                           " Oxygens of the water molecules. ", &
    1536              :                           usage="OXYGENS_WATER {integer} {integer} ..", repeats=.TRUE., &
    1537         5520 :                           n_var=-1, type_of_var=integer_t)
    1538         5520 :       CALL section_add_keyword(section, keyword)
    1539         5520 :       CALL keyword_release(keyword)
    1540              : 
    1541              :       CALL keyword_create(keyword, __LOCATION__, name="OXYGENS_ACID", &
    1542              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1543              :                           " Oxygens of the carboxyl groups.", &
    1544              :                           usage="OXYGENS_ACID {integer} {integer} ..", repeats=.TRUE., &
    1545         5520 :                           n_var=-1, type_of_var=integer_t)
    1546         5520 :       CALL section_add_keyword(section, keyword)
    1547         5520 :       CALL keyword_release(keyword)
    1548              : 
    1549              :       CALL keyword_create(keyword, __LOCATION__, name="HYDROGENS", &
    1550              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1551              :                           " Hydrogens of the water molecules and of the carboxyl groups.", &
    1552              :                           usage="HYDROGENS {integer} {integer} ..", repeats=.TRUE., &
    1553         5520 :                           n_var=-1, type_of_var=integer_t)
    1554         5520 :       CALL section_add_keyword(section, keyword)
    1555         5520 :       CALL keyword_release(keyword)
    1556              : 
    1557              :       CALL keyword_create(keyword, __LOCATION__, name="pWOH", &
    1558              :                           description="Sets the value of the numerator of the exponential factor"// &
    1559              :                           " in the coordination function: number of hydrogens per water molecule.", &
    1560              :                           usage="pWOH {integer}", default_i_val=8, &
    1561         5520 :                           n_var=1)
    1562         5520 :       CALL section_add_keyword(section, keyword)
    1563         5520 :       CALL keyword_release(keyword)
    1564              : 
    1565              :       CALL keyword_create(keyword, __LOCATION__, name="qWOH", &
    1566              :                           description="Sets the value of the denominator of the exponential factor"// &
    1567              :                           " in the coordination function: number of hydrogens per water molecule.", &
    1568              :                           usage="qWOH {integer}", default_i_val=16, &
    1569         5520 :                           n_var=1)
    1570         5520 :       CALL section_add_keyword(section, keyword)
    1571         5520 :       CALL keyword_release(keyword)
    1572              : 
    1573              :       CALL keyword_create(keyword, __LOCATION__, name="RWOH", &
    1574              :                           description="Specify the rc parameter in the coordination function:"// &
    1575              :                           " number of hydrogens per water molecule.", &
    1576              :                           usage="RWOH {real}", default_r_val=cp_unit_to_cp2k(value=2.4_dp, &
    1577         5520 :                                                                              unit_str="bohr"), unit_str="bohr", n_var=1)
    1578         5520 :       CALL section_add_keyword(section, keyword)
    1579         5520 :       CALL keyword_release(keyword)
    1580              : 
    1581              :       CALL keyword_create(keyword, __LOCATION__, name="pAOH", &
    1582              :                           description="Sets the value of the numerator of the exponential factor"// &
    1583              :                           " in the coordination function: number of hydrogens per carboxyl group.", &
    1584              :                           usage="pAOH {integer}", default_i_val=6, &
    1585         5520 :                           n_var=1)
    1586         5520 :       CALL section_add_keyword(section, keyword)
    1587         5520 :       CALL keyword_release(keyword)
    1588              : 
    1589              :       CALL keyword_create(keyword, __LOCATION__, name="qAOH", &
    1590              :                           description="Sets the value of the denominator of the exponential factor"// &
    1591              :                           " in the coordination function: number of hydrogens per carboxyl group.", &
    1592              :                           usage="qAOH {integer}", default_i_val=14, &
    1593         5520 :                           n_var=1)
    1594         5520 :       CALL section_add_keyword(section, keyword)
    1595         5520 :       CALL keyword_release(keyword)
    1596              : 
    1597              :       CALL keyword_create(keyword, __LOCATION__, name="RAOH", &
    1598              :                           description="Specify the rc parameter in the coordination function:"// &
    1599              :                           " number of hydrogens per carboxyl group.", &
    1600              :                           usage="RAOH {real}", default_r_val=cp_unit_to_cp2k(value=2.4_dp, &
    1601         5520 :                                                                              unit_str="bohr"), unit_str="bohr", n_var=1)
    1602         5520 :       CALL section_add_keyword(section, keyword)
    1603         5520 :       CALL keyword_release(keyword)
    1604              : 
    1605              :       CALL keyword_create(keyword, __LOCATION__, name="pCUT", &
    1606              :                           description="Sets the value of the numerator of the exponential factor"// &
    1607              :                           " in the cutoff function.", &
    1608              :                           usage="pCUT {integer}", default_i_val=6, &
    1609         5520 :                           n_var=1)
    1610         5520 :       CALL section_add_keyword(section, keyword)
    1611         5520 :       CALL keyword_release(keyword)
    1612              : 
    1613              :       CALL keyword_create(keyword, __LOCATION__, name="qCUT", &
    1614              :                           description="Sets the value of the denominator of the exponential factor"// &
    1615              :                           " in the cutoff function.", &
    1616              :                           usage="qCUT {integer}", default_i_val=12, &
    1617         5520 :                           n_var=1)
    1618         5520 :       CALL section_add_keyword(section, keyword)
    1619         5520 :       CALL keyword_release(keyword)
    1620              : 
    1621              :       CALL keyword_create(keyword, __LOCATION__, name="NC", &
    1622              :                           description="Specifies the NC parameter in the cutoff function.", &
    1623              :                           usage="NC {real}", default_r_val=0.56_dp, &
    1624         5520 :                           n_var=1)
    1625         5520 :       CALL section_add_keyword(section, keyword)
    1626         5520 :       CALL keyword_release(keyword)
    1627              : 
    1628              :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
    1629              :                           variants=["LAMBDA"], &
    1630              :                           description="Specifies the LAMBDA parameter carboxylic acid function.", &
    1631              :                           usage="LAMBDA {real}", default_r_val=20.0_dp, &
    1632        11040 :                           n_var=1)
    1633         5520 :       CALL section_add_keyword(section, keyword)
    1634         5520 :       CALL keyword_release(keyword)
    1635              : 
    1636         5520 :    END SUBROUTINE create_colvar_acid_hyd_dist_section
    1637              : 
    1638              : ! **************************************************************************************************
    1639              : !> \brief collective variables specifying the solvation of carboxylic acid;
    1640              : !>        number of oxygens in the 1st shell of the hydronium; Equation (3) in
    1641              : !>        Supplementary Information of J. Am. Chem. Soc.,128,  2006, 11318
    1642              : !> \param section the section to be created
    1643              : !> \author Dorothea Golze
    1644              : ! **************************************************************************************************
    1645         5520 :    SUBROUTINE create_colvar_acid_hyd_shell_section(section)
    1646              :       TYPE(section_type), POINTER                        :: section
    1647              : 
    1648              :       TYPE(keyword_type), POINTER                        :: keyword
    1649              : 
    1650         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    1651              :       CALL section_create(section, __LOCATION__, name="ACID_HYDRONIUM_SHELL", &
    1652              :                           description="Section to define the dissociation of a carboxylic acid in"// &
    1653              :                           " water. Number of oxygens in the 1st shell of the hydronium. Equation (3)"// &
    1654              :                           " in Supplementary Info of J. Am. Chem. Soc.,128,  2006, 11318. Similar to"// &
    1655              :                           " the HYDRONIUM colvar, but with modification for the acid.", &
    1656         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1657              : 
    1658         5520 :       NULLIFY (keyword)
    1659              : 
    1660              :       CALL keyword_create(keyword, __LOCATION__, name="OXYGENS_WATER", &
    1661              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1662              :                           " Oxygens of the water molecules. ", &
    1663              :                           usage="OXYGENS_WATER {integer} {integer} ..", repeats=.TRUE., &
    1664         5520 :                           n_var=-1, type_of_var=integer_t)
    1665         5520 :       CALL section_add_keyword(section, keyword)
    1666         5520 :       CALL keyword_release(keyword)
    1667              : 
    1668              :       CALL keyword_create(keyword, __LOCATION__, name="OXYGENS_ACID", &
    1669              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1670              :                           " Oxygens of the carboxyl groups.", &
    1671              :                           usage="OXYGENS_ACID {integer} {integer} ..", repeats=.TRUE., &
    1672         5520 :                           n_var=-1, type_of_var=integer_t)
    1673         5520 :       CALL section_add_keyword(section, keyword)
    1674         5520 :       CALL keyword_release(keyword)
    1675              : 
    1676              :       CALL keyword_create(keyword, __LOCATION__, name="HYDROGENS", &
    1677              :                           description="Specifies indexes of atoms building the coordination variable."// &
    1678              :                           " Hydrogens of the water molecules and of the carboxyl groups.", &
    1679              :                           usage="HYDROGENS {integer} {integer} ..", repeats=.TRUE., &
    1680         5520 :                           n_var=-1, type_of_var=integer_t)
    1681         5520 :       CALL section_add_keyword(section, keyword)
    1682         5520 :       CALL keyword_release(keyword)
    1683              : 
    1684              :       CALL keyword_create(keyword, __LOCATION__, name="pWOH", &
    1685              :                           description="Sets the value of the numerator of the exponential factor"// &
    1686              :                           " in the coordination function: number of hydrogens per water molecule.", &
    1687              :                           usage="pWOH {integer}", default_i_val=8, &
    1688         5520 :                           n_var=1)
    1689         5520 :       CALL section_add_keyword(section, keyword)
    1690         5520 :       CALL keyword_release(keyword)
    1691              : 
    1692              :       CALL keyword_create(keyword, __LOCATION__, name="qWOH", &
    1693              :                           description="Sets the value of the denominator of the exponential factor"// &
    1694              :                           " in the coordination function: number of hydrogens per water molecule.", &
    1695              :                           usage="qWOH {integer}", default_i_val=16, &
    1696         5520 :                           n_var=1)
    1697         5520 :       CALL section_add_keyword(section, keyword)
    1698         5520 :       CALL keyword_release(keyword)
    1699              : 
    1700              :       CALL keyword_create(keyword, __LOCATION__, name="RWOH", &
    1701              :                           description="Specifies the rc parameter in the coordination function:"// &
    1702              :                           " number of hydrogens per water molecule.", &
    1703              :                           usage="RWOH {real}", default_r_val=cp_unit_to_cp2k(value=2.4_dp, &
    1704         5520 :                                                                              unit_str="bohr"), unit_str="bohr", n_var=1)
    1705         5520 :       CALL section_add_keyword(section, keyword)
    1706         5520 :       CALL keyword_release(keyword)
    1707              : 
    1708              :       CALL keyword_create(keyword, __LOCATION__, name="pAOH", &
    1709              :                           description="Sets the value of the numerator of the exponential factor"// &
    1710              :                           " in the coordination function: number of hydrogens per carboxyl group.", &
    1711              :                           usage="pAOH {integer}", default_i_val=6, &
    1712         5520 :                           n_var=1)
    1713         5520 :       CALL section_add_keyword(section, keyword)
    1714         5520 :       CALL keyword_release(keyword)
    1715              : 
    1716              :       CALL keyword_create(keyword, __LOCATION__, name="qAOH", &
    1717              :                           description="Sets the value of the denominator of the exponential factor"// &
    1718              :                           " in the coordination function: number of hydrogens per carboxyl group.", &
    1719              :                           usage="qAOH {integer}", default_i_val=14, &
    1720         5520 :                           n_var=1)
    1721         5520 :       CALL section_add_keyword(section, keyword)
    1722         5520 :       CALL keyword_release(keyword)
    1723              : 
    1724              :       CALL keyword_create(keyword, __LOCATION__, name="RAOH", &
    1725              :                           description="Specifies the rc parameter in the coordination function:"// &
    1726              :                           " number of hydrogens per carboxyl group.", &
    1727              :                           usage="RAOH {real}", default_r_val=cp_unit_to_cp2k(value=2.4_dp, &
    1728         5520 :                                                                              unit_str="bohr"), unit_str="bohr", n_var=1)
    1729         5520 :       CALL section_add_keyword(section, keyword)
    1730         5520 :       CALL keyword_release(keyword)
    1731              : 
    1732              :       CALL keyword_create(keyword, __LOCATION__, name="pOO", &
    1733              :                           description="Sets the value of the numerator of the exponential factor"// &
    1734              :                           " in the coordination function: number of oxygens per water oxygen.", &
    1735              :                           usage="pOO {integer}", default_i_val=6, &
    1736         5520 :                           n_var=1)
    1737         5520 :       CALL section_add_keyword(section, keyword)
    1738         5520 :       CALL keyword_release(keyword)
    1739              : 
    1740              :       CALL keyword_create(keyword, __LOCATION__, name="qOO", &
    1741              :                           description="Sets the value of the denominator of the exponential factor"// &
    1742              :                           " in the coordination function: number of oxygens per water oxygen.", &
    1743              :                           usage="qOO {integer}", default_i_val=12, &
    1744         5520 :                           n_var=1)
    1745         5520 :       CALL section_add_keyword(section, keyword)
    1746         5520 :       CALL keyword_release(keyword)
    1747              : 
    1748              :       CALL keyword_create(keyword, __LOCATION__, name="ROO", &
    1749              :                           description="Specifies the rc parameter in the coordination function:"// &
    1750              :                           " number of oxygens per water oxygen.", &
    1751              :                           usage="ROO {real}", default_r_val=cp_unit_to_cp2k(value=5.5_dp, &
    1752         5520 :                                                                             unit_str="bohr"), unit_str="bohr", n_var=1)
    1753         5520 :       CALL section_add_keyword(section, keyword)
    1754         5520 :       CALL keyword_release(keyword)
    1755              : 
    1756              :       CALL keyword_create(keyword, __LOCATION__, name="pM", &
    1757              :                           description="Sets the value of the numerator of the exponential factor"// &
    1758              :                           " in the M function.", &
    1759              :                           usage="pM {integer}", default_i_val=8, &
    1760         5520 :                           n_var=1)
    1761         5520 :       CALL section_add_keyword(section, keyword)
    1762         5520 :       CALL keyword_release(keyword)
    1763              : 
    1764              :       CALL keyword_create(keyword, __LOCATION__, name="qM", &
    1765              :                           description="Sets the value of the denominator of the exponential factor"// &
    1766              :                           " in the M function.", &
    1767              :                           usage="qM {integer}", default_i_val=16, &
    1768         5520 :                           n_var=1)
    1769         5520 :       CALL section_add_keyword(section, keyword)
    1770         5520 :       CALL keyword_release(keyword)
    1771              : 
    1772              :       CALL keyword_create(keyword, __LOCATION__, name="NH", &
    1773              :                           description="Specifies the NH parameter in the M function.", &
    1774              :                           usage="NH {real}", default_r_val=2.2_dp, &
    1775         5520 :                           n_var=1)
    1776         5520 :       CALL section_add_keyword(section, keyword)
    1777         5520 :       CALL keyword_release(keyword)
    1778              : 
    1779              :       CALL keyword_create(keyword, __LOCATION__, name="pCUT", &
    1780              :                           description="Sets the value of the numerator of the exponential factor"// &
    1781              :                           " in the cutoff function.", &
    1782              :                           usage="pCUT {integer}", default_i_val=6, &
    1783         5520 :                           n_var=1)
    1784         5520 :       CALL section_add_keyword(section, keyword)
    1785         5520 :       CALL keyword_release(keyword)
    1786              : 
    1787              :       CALL keyword_create(keyword, __LOCATION__, name="qCUT", &
    1788              :                           description="Sets the value of the denominator of the exponential factor"// &
    1789              :                           " in the cutoff function.", &
    1790              :                           usage="qCUT {integer}", default_i_val=12, &
    1791         5520 :                           n_var=1)
    1792         5520 :       CALL section_add_keyword(section, keyword)
    1793         5520 :       CALL keyword_release(keyword)
    1794              : 
    1795              :       CALL keyword_create(keyword, __LOCATION__, name="NC", &
    1796              :                           description="Specifies the NC parameter in the cutoff function.", &
    1797              :                           usage="NC {real}", default_r_val=0.9_dp, &
    1798         5520 :                           n_var=1)
    1799         5520 :       CALL section_add_keyword(section, keyword)
    1800         5520 :       CALL keyword_release(keyword)
    1801              : 
    1802              :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
    1803              :                           variants=["LAMBDA"], &
    1804              :                           description="Specifies the LAMBDA parameter carboxylic acid function.", &
    1805              :                           usage="LAMBDA {real}", default_r_val=10.0_dp, &
    1806        11040 :                           n_var=1)
    1807         5520 :       CALL section_add_keyword(section, keyword)
    1808         5520 :       CALL keyword_release(keyword)
    1809              : 
    1810         5520 :    END SUBROUTINE create_colvar_acid_hyd_shell_section
    1811              : 
    1812              : ! **************************************************************************************************
    1813              : !> \brief ...
    1814              : !> \param section ...
    1815              : ! **************************************************************************************************
    1816         5520 :    SUBROUTINE create_colvar_rmsd_section(section)
    1817              :       TYPE(section_type), POINTER                        :: section
    1818              : 
    1819              :       TYPE(keyword_type), POINTER                        :: keyword
    1820              :       TYPE(section_type), POINTER                        :: subsection, subsubsection
    1821              : 
    1822         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    1823              :       CALL section_create(section, __LOCATION__, name="rmsd", &
    1824              :                           description="Section to define a CV as function of RMSD computed with respect to"// &
    1825              :                           " given reference configurations. For 2 configurations the colvar is equal to:"// &
    1826              :                           " ss = (RMSDA-RMSDB)/(RMSDA+RMSDB), while if only 1 configuration is given, then the"// &
    1827              :                           " colvar is just the RMSD from that frame.", &
    1828         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1829              : 
    1830         5520 :       NULLIFY (keyword, subsection, subsubsection)
    1831              :       CALL keyword_create(keyword, __LOCATION__, name="SUBSET_TYPE", &
    1832              :                           description="Define the subsytem used to compute the RMSD. With ALL the displacements"// &
    1833              :                           " are mass-weighted, with LIST all weights are set to 1,"// &
    1834              :                           " with WEIGHT_LIST a list of weights is expected from input.", &
    1835              :                           usage="SUBSET_TYPE ALL", &
    1836              :                           enum_c_vals=s2a("ALL", "LIST", "WEIGHT_LIST"), &
    1837              :                           enum_i_vals=[rmsd_all, rmsd_list, rmsd_weightlist], &
    1838         5520 :                           default_i_val=rmsd_all)
    1839         5520 :       CALL section_add_keyword(section, keyword)
    1840         5520 :       CALL keyword_release(keyword)
    1841              : 
    1842              :       CALL keyword_create(keyword, __LOCATION__, name="ALIGN_FRAMES", &
    1843              :                           description="Whether the reference frames should be aligned to minimize the RMSD", &
    1844              :                           usage="ALIGN_FRAMES", &
    1845         5520 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1846         5520 :       CALL section_add_keyword(section, keyword)
    1847         5520 :       CALL keyword_release(keyword)
    1848              : 
    1849              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    1850              :                           description="Specify indexes of atoms building the subset. ", &
    1851              :                           usage="ATOMS {integer} {integer} ..", repeats=.TRUE., &
    1852         5520 :                           n_var=-1, type_of_var=integer_t)
    1853         5520 :       CALL section_add_keyword(section, keyword)
    1854         5520 :       CALL keyword_release(keyword)
    1855              : 
    1856              :       CALL keyword_create(keyword, __LOCATION__, name="WEIGHTS", &
    1857              :                           description="Specify weights of atoms building the subset. It is used only with WEIGHT_LIST ", &
    1858              :                           usage="weightS {real} {real} ..", repeats=.TRUE., &
    1859         5520 :                           n_var=-1, type_of_var=real_t)
    1860         5520 :       CALL section_add_keyword(section, keyword)
    1861         5520 :       CALL keyword_release(keyword)
    1862              : 
    1863              :       CALL section_create(subsection, __LOCATION__, name="FRAME", &
    1864              :                           description="Specify coordinates of the frame (number of frames can be either 1 or 2)", &
    1865         5520 :                           repeats=.TRUE.)
    1866              : 
    1867              :       CALL keyword_create(keyword, __LOCATION__, name="COORD_FILE_NAME", &
    1868              :                           description="Name of the xyz file with coordinates (alternative to &COORD section)", &
    1869              :                           usage="COORD_FILE_NAME <CHAR>", &
    1870         5520 :                           default_lc_val="")
    1871         5520 :       CALL section_add_keyword(subsection, keyword)
    1872         5520 :       CALL keyword_release(keyword)
    1873              : 
    1874         5520 :       CALL create_coord_section_cv(subsubsection, "RMSD")
    1875         5520 :       CALL section_add_subsection(subsection, subsubsection)
    1876         5520 :       CALL section_release(subsubsection)
    1877              : 
    1878         5520 :       CALL section_add_subsection(section, subsection)
    1879         5520 :       CALL section_release(subsection)
    1880              : 
    1881         5520 :    END SUBROUTINE create_colvar_rmsd_section
    1882              : 
    1883              : ! **************************************************************************************************
    1884              : !> \brief collective variables specifying the space orthogonal to the reaction path
    1885              : !>        in the space spanned by the involved collective coordinates
    1886              : !> \param section the section to be created
    1887              : !> \author fschiff
    1888              : ! **************************************************************************************************
    1889         1380 :    SUBROUTINE create_colvar_rpath_section(section)
    1890              :       TYPE(section_type), POINTER                        :: section
    1891              : 
    1892         1380 :       CPASSERT(.NOT. ASSOCIATED(section))
    1893              :       CALL section_create(section, __LOCATION__, name="REACTION_PATH", &
    1894              :                           description="Section defining a one dimensional reaction path in an Q-dimensional space of colvars. "// &
    1895              :                           "Constraining this colvar, allows to sample the space orthogonal to the reaction path, "// &
    1896              :                           "both in the Q-dimensional colvar and 3N-Q remaining coordinates. "// &
    1897              :                           "For the details of the function see cited literature.", &
    1898              :                           n_keywords=1, n_subsections=0, repeats=.FALSE., &
    1899         2760 :                           citations=[Branduardi2007])
    1900              : 
    1901         1380 :       CALL keywords_colvar_path(section)
    1902         1380 :    END SUBROUTINE create_colvar_rpath_section
    1903              : 
    1904              : ! **************************************************************************************************
    1905              : !> \brief Distance from reaction path
    1906              : !> \param section the section to be created
    1907              : !> \author 01.2010
    1908              : ! **************************************************************************************************
    1909         1380 :    SUBROUTINE create_colvar_dpath_section(section)
    1910              :       TYPE(section_type), POINTER                        :: section
    1911              : 
    1912         1380 :       CPASSERT(.NOT. ASSOCIATED(section))
    1913              :       CALL section_create(section, __LOCATION__, name="DISTANCE_FROM_PATH", &
    1914              :                           description="Section defining the distance from a one dimensional reaction "// &
    1915              :                           "path in an Q-dimensional space of colvars. "// &
    1916              :                           "Constraining this colvar, allows to sample the space equidistant to the reaction path, "// &
    1917              :                           "both in the Q-dimensional colvar and 3N-Q remaining coordinates. "// &
    1918              :                           "For the details of the function see cited literature.", &
    1919              :                           n_keywords=1, n_subsections=0, repeats=.FALSE., &
    1920         2760 :                           citations=[Branduardi2007])
    1921              : 
    1922         1380 :       CALL keywords_colvar_path(section)
    1923         1380 :    END SUBROUTINE create_colvar_dpath_section
    1924              : 
    1925              : ! **************************************************************************************************
    1926              : !> \brief Section describinf keywords for both reaction path and distance from reaction path
    1927              : !> \param section the section to be created
    1928              : !> \author 01.2010
    1929              : ! **************************************************************************************************
    1930         2760 :    SUBROUTINE keywords_colvar_path(section)
    1931              : 
    1932              :       TYPE(section_type), POINTER                        :: section
    1933              : 
    1934              :       TYPE(keyword_type), POINTER                        :: keyword
    1935              :       TYPE(section_type), POINTER                        :: print_key, subsection, subsubsection
    1936              : 
    1937         2760 :       NULLIFY (keyword, subsection, subsubsection, print_key)
    1938         2760 :       CALL create_colvar_section(subsection, skip_recursive_colvar=.TRUE.)
    1939         2760 :       CALL section_add_subsection(section, subsection)
    1940         2760 :       CALL section_release(subsection)
    1941              : 
    1942              :       CALL keyword_create(keyword, __LOCATION__, name="DISTANCES_RMSD", &
    1943              :                           description=" ", &
    1944              :                           usage="DISTANCES_RMSD T", &
    1945         2760 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1946         2760 :       CALL section_add_keyword(section, keyword)
    1947         2760 :       CALL keyword_release(keyword)
    1948              : 
    1949              :       CALL keyword_create(keyword, __LOCATION__, name="RMSD", &
    1950              :                           description=" ", &
    1951              :                           usage="RMSD T", &
    1952         2760 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1953         2760 :       CALL section_add_keyword(section, keyword)
    1954         2760 :       CALL keyword_release(keyword)
    1955              : 
    1956              :       CALL keyword_create(keyword, __LOCATION__, name="SUBSET_TYPE", &
    1957              :                           description="Define the subsytem used to compute the RMSD", &
    1958              :                           usage="SUBSET_TYPE ALL", &
    1959              :                           enum_c_vals=s2a("ALL", "LIST"), &
    1960              :                           enum_i_vals=[rmsd_all, rmsd_list], &
    1961         2760 :                           default_i_val=rmsd_all)
    1962         2760 :       CALL section_add_keyword(section, keyword)
    1963         2760 :       CALL keyword_release(keyword)
    1964              : 
    1965              :       CALL keyword_create(keyword, __LOCATION__, name="ALIGN_FRAMES", &
    1966              :                           description="Whether the reference frames should be aligned to minimize the RMSD", &
    1967              :                           usage="ALIGN_FRAMES", &
    1968         2760 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1969         2760 :       CALL section_add_keyword(section, keyword)
    1970         2760 :       CALL keyword_release(keyword)
    1971              : 
    1972              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    1973              :                           description="Specify indexes of atoms building the subset. ", &
    1974              :                           usage="ATOMS {integer} {integer} ..", repeats=.TRUE., &
    1975         2760 :                           n_var=-1, type_of_var=integer_t)
    1976         2760 :       CALL section_add_keyword(section, keyword)
    1977         2760 :       CALL keyword_release(keyword)
    1978              : 
    1979              :       CALL section_create(subsection, __LOCATION__, name="FRAME", &
    1980              :                           description="Specify coordinates of the frame", &
    1981         2760 :                           repeats=.TRUE.)
    1982              : 
    1983              :       CALL keyword_create(keyword, __LOCATION__, name="COORD_FILE_NAME", &
    1984              :                           description="Name of the xyz file with coordinates (alternative to &COORD section)", &
    1985              :                           usage="COORD_FILE_NAME <CHAR>", &
    1986         2760 :                           default_lc_val="")
    1987         2760 :       CALL section_add_keyword(subsection, keyword)
    1988         2760 :       CALL keyword_release(keyword)
    1989              : 
    1990         2760 :       CALL create_coord_section_cv(subsubsection, "RMSD")
    1991         2760 :       CALL section_add_subsection(subsection, subsubsection)
    1992         2760 :       CALL section_release(subsubsection)
    1993              : 
    1994         2760 :       CALL section_add_subsection(section, subsection)
    1995         2760 :       CALL section_release(subsection)
    1996              : 
    1997              :       CALL keyword_create(keyword, __LOCATION__, name="FUNCTION", &
    1998              :                           description="Specifies the ith element of the vector valued function that defines the reaction path. "// &
    1999              :                           "This keyword needs to repeat exactly Q times, and the order must match the order of the colvars. "// &
    2000              :                           "The VARIABLE (e.g. T) which parametrises the curve can be used as the target of a constraint.", &
    2001              :                           usage="FUNCTION (sin(T+2)+2*T)", type_of_var=lchar_t, &
    2002         2760 :                           n_var=1, default_lc_val="0", repeats=.TRUE.)
    2003         2760 :       CALL section_add_keyword(section, keyword)
    2004         2760 :       CALL keyword_release(keyword)
    2005              : 
    2006              :       CALL keyword_create(keyword, __LOCATION__, name="VARIABLE", &
    2007              :                           description="Specifies the name of the variable that parametrises the FUNCTION "// &
    2008              :                           "defining the reaction path.", &
    2009              :                           usage="VARIABLE T", type_of_var=char_t, &
    2010         2760 :                           n_var=1, repeats=.FALSE.)
    2011         2760 :       CALL section_add_keyword(section, keyword)
    2012         2760 :       CALL keyword_release(keyword)
    2013              : 
    2014              :       CALL keyword_create( &
    2015              :          keyword, __LOCATION__, name="LAMBDA", &
    2016              :          description="Specifies the exponent of the Gaussian used in the integral representation of the colvar. "// &
    2017              :          "The shape of the space orthogonal to the reaction path is defined by this choice. "// &
    2018              :          "In the limit of large values, it is given by the plane orthogonal to the path. "// &
    2019              :          "In practice, modest values are required for stable numerical integration.", &
    2020              :          usage="LAMBDA {real}", &
    2021         2760 :          type_of_var=real_t, default_r_val=5.0_dp)
    2022         2760 :       CALL section_add_keyword(section, keyword)
    2023         2760 :       CALL keyword_release(keyword)
    2024              : 
    2025              :       CALL keyword_create(keyword, __LOCATION__, name="STEP_SIZE", &
    2026              :                           description="Step size in the numerical integration, "// &
    2027              :                           "a few thousand points are common, and the proper number also depends on LAMBDA.", &
    2028              :                           usage="STEP_SIZE {real}", &
    2029         2760 :                           type_of_var=real_t, default_r_val=0.01_dp)
    2030         2760 :       CALL section_add_keyword(section, keyword)
    2031         2760 :       CALL keyword_release(keyword)
    2032              : 
    2033              :       CALL keyword_create(keyword, __LOCATION__, name="RANGE", &
    2034              :                           description="The range of VARIABLE used for the parametrisation.", &
    2035              :                           usage="RANGE <REAL> <REAL>", &
    2036         2760 :                           n_var=2, type_of_var=real_t)
    2037         2760 :       CALL section_add_keyword(section, keyword)
    2038         2760 :       CALL keyword_release(keyword)
    2039              : 
    2040              :       CALL cp_print_key_section_create( &
    2041              :          print_key, __LOCATION__, name="MAP", &
    2042              :          description="Activating this print key will print once a file with the values of the FUNCTION on a grid "// &
    2043              :          "of COLVAR values in a specified range. "// &
    2044              :          "GRID_SPACING and RANGE for every COLVAR has to be specified again in the same order as they are in the input.", &
    2045         2760 :          print_level=high_print_level, filename="PATH")
    2046              : 
    2047              :       CALL keyword_create(keyword, __LOCATION__, name="RANGE", &
    2048              :                           description="The range of of the grid of the COLVAR.", &
    2049              :                           usage="RANGE <REAL> <REAL>", &
    2050         2760 :                           n_var=2, type_of_var=real_t, repeats=.TRUE.)
    2051         2760 :       CALL section_add_keyword(print_key, keyword)
    2052         2760 :       CALL keyword_release(keyword)
    2053              : 
    2054              :       CALL keyword_create(keyword, __LOCATION__, name="GRID_SPACING", &
    2055              :                           description="Distance between two gridpoints for the grid on the COLVAR", &
    2056              :                           usage="GRID_SPACING {real}", repeats=.TRUE., &
    2057         2760 :                           type_of_var=real_t, default_r_val=0.01_dp)
    2058         2760 :       CALL section_add_keyword(print_key, keyword)
    2059         2760 :       CALL keyword_release(keyword)
    2060              : 
    2061         2760 :       CALL section_add_subsection(section, print_key)
    2062         2760 :       CALL section_release(print_key)
    2063              : 
    2064         2760 :    END SUBROUTINE keywords_colvar_path
    2065              : 
    2066              : ! **************************************************************************************************
    2067              : !> \brief Colvar allowing a combination of COLVARS
    2068              : !> \param section the section to be created
    2069              : !> \author Teodoro Laino [tlaino] - 12.2008
    2070              : ! **************************************************************************************************
    2071         1380 :    SUBROUTINE create_colvar_comb_section(section)
    2072              :       TYPE(section_type), POINTER                        :: section
    2073              : 
    2074              :       TYPE(keyword_type), POINTER                        :: keyword
    2075              :       TYPE(section_type), POINTER                        :: subsection
    2076              : 
    2077         1380 :       CPASSERT(.NOT. ASSOCIATED(section))
    2078              :       CALL section_create(section, __LOCATION__, name="COMBINE_COLVAR", &
    2079              :                           description="Allows the possibility to combine several COLVARs into one COLVAR "// &
    2080              :                           "with a generic function. "//docf(), &
    2081         1380 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2082              : 
    2083         1380 :       NULLIFY (keyword, subsection)
    2084         1380 :       CALL create_colvar_section(subsection, skip_recursive_colvar=.TRUE.)
    2085         1380 :       CALL section_add_subsection(section, subsection)
    2086         1380 :       CALL section_release(subsection)
    2087              : 
    2088              :       CALL keyword_create(keyword, __LOCATION__, name="FUNCTION", &
    2089              :                           description="Specifies the function used to combine different COLVARs into one.", &
    2090              :                           ! **************************************************************************************************
    2091              :                           !> \brief ...
    2092              :                           !> \param CV1^2 ...
    2093              :                           !> \param CV2^2 ...
    2094              :                           !> \param " ...
    2095              :                           !> \param type_of_var=lchar_t ...
    2096              :                           !> \param n_var=1 ...
    2097              :                           !> \param error=error ...
    2098              :                           ! **************************************************************************************************
    2099              :                           usage="FUNCTION SQRT(CV1^2+CV2^2)", type_of_var=lchar_t, &
    2100         1380 :                           n_var=1)
    2101         1380 :       CALL section_add_keyword(section, keyword)
    2102         1380 :       CALL keyword_release(keyword)
    2103              : 
    2104              :       CALL keyword_create(keyword, __LOCATION__, name="VARIABLES", &
    2105              :                           description="Specifies the name of the variable that parametrises the FUNCTION "// &
    2106              :                           "defining how COLVARS should be combined. The matching follows the same order of the "// &
    2107              :                           "COLVARS definition in the input file.", &
    2108         1380 :                           usage="VARIABLES CV1 CV2 CV3", type_of_var=char_t, n_var=-1, repeats=.FALSE.)
    2109         1380 :       CALL section_add_keyword(section, keyword)
    2110         1380 :       CALL keyword_release(keyword)
    2111              : 
    2112              :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETERS", &
    2113              :                           description="Defines the parameters of the functional form", &
    2114              :                           usage="PARAMETERS a b D", type_of_var=char_t, &
    2115         1380 :                           n_var=-1, repeats=.TRUE.)
    2116         1380 :       CALL section_add_keyword(section, keyword)
    2117         1380 :       CALL keyword_release(keyword)
    2118              : 
    2119              :       CALL keyword_create(keyword, __LOCATION__, name="VALUES", &
    2120              :                           description="Defines the values of  parameter of the functional form", &
    2121              :                           usage="VALUES ", type_of_var=real_t, &
    2122         1380 :                           n_var=-1, repeats=.TRUE., unit_str="internal_cp2k")
    2123         1380 :       CALL section_add_keyword(section, keyword)
    2124         1380 :       CALL keyword_release(keyword)
    2125              : 
    2126              :       CALL keyword_create(keyword, __LOCATION__, name="DX", &
    2127              :                           description="Parameter used for computing the derivative of the combination "// &
    2128              :                           "of COLVARs with the Ridders' method.", &
    2129         1380 :                           usage="DX <REAL>", default_r_val=0.1_dp, unit_str="bohr")
    2130         1380 :       CALL section_add_keyword(section, keyword)
    2131         1380 :       CALL keyword_release(keyword)
    2132              : 
    2133              :       CALL keyword_create(keyword, __LOCATION__, name="ERROR_LIMIT", &
    2134              :                           description="Checks that the error in computing the derivative is not larger than "// &
    2135              :                           "the value set; in case error is larger a warning message is printed.", &
    2136         1380 :                           usage="ERROR_LIMIT <REAL>", default_r_val=1.0E-12_dp)
    2137         1380 :       CALL section_add_keyword(section, keyword)
    2138         1380 :       CALL keyword_release(keyword)
    2139              : 
    2140         1380 :    END SUBROUTINE create_colvar_comb_section
    2141              : 
    2142              : ! **************************************************************************************************
    2143              : !> \brief Creates the coord section
    2144              : !> \param section the section to create
    2145              : !> \param name ...
    2146              : !> \author teo
    2147              : ! **************************************************************************************************
    2148         8280 :    SUBROUTINE create_coord_section_cv(section, name)
    2149              :       TYPE(section_type), POINTER                        :: section
    2150              :       CHARACTER(LEN=*), INTENT(IN)                       :: name
    2151              : 
    2152              :       TYPE(keyword_type), POINTER                        :: keyword
    2153              : 
    2154         8280 :       CPASSERT(.NOT. ASSOCIATED(section))
    2155              :       CALL section_create(section, __LOCATION__, name="coord", &
    2156              :                           description="The positions for "//TRIM(name)//" used for restart", &
    2157         8280 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2158         8280 :       NULLIFY (keyword)
    2159              : 
    2160              :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    2161              :                           description="Specify positions of the system", repeats=.TRUE., &
    2162         8280 :                           usage="{Real} ...", type_of_var=real_t, n_var=-1)
    2163         8280 :       CALL section_add_keyword(section, keyword)
    2164         8280 :       CALL keyword_release(keyword)
    2165              : 
    2166         8280 :    END SUBROUTINE create_coord_section_cv
    2167              : 
    2168              : ! **************************************************************************************************
    2169              : !> \brief collective variables specifying h bonds
    2170              : !> \param section the section to be created
    2171              : !> \author alin m elena
    2172              : ! **************************************************************************************************
    2173         5520 :    SUBROUTINE create_colvar_wc_section(section)
    2174              :       TYPE(section_type), POINTER                        :: section
    2175              : 
    2176              :       TYPE(keyword_type), POINTER                        :: keyword
    2177              :       TYPE(section_type), POINTER                        :: subsection
    2178              : 
    2179         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    2180              :       CALL section_create(section, __LOCATION__, name="wc", &
    2181              :                           description="Section to define the hbond wannier centre as a collective variables.", &
    2182         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2183         5520 :       NULLIFY (keyword, subsection)
    2184              : 
    2185              :       CALL keyword_create(keyword, __LOCATION__, name="RCUT", &
    2186              :                           description="Parameter used for computing the cutoff radius for searching "// &
    2187              :                           "the wannier centres around an atom", &
    2188              :                           usage="RCUT <REAL>", default_r_val=0.529177208590000_dp, unit_str="angstrom", &
    2189         5520 :                           type_of_var=real_t, repeats=.FALSE.)
    2190         5520 :       CALL section_add_keyword(section, keyword)
    2191         5520 :       CALL keyword_release(keyword)
    2192              : 
    2193              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2194              :                           variants=["POINTS"], &
    2195              :                           description="Specifies the indexes of atoms/points defining the bond (Od, H, Oa).", &
    2196              :                           usage="ATOMS {integer} {integer} {integer}", &
    2197        11040 :                           n_var=3, type_of_var=integer_t, repeats=.TRUE.)
    2198         5520 :       CALL section_add_keyword(section, keyword)
    2199         5520 :       CALL keyword_release(keyword)
    2200              : 
    2201              :       ! Must be present in each colvar and handled properly
    2202         5520 :       CALL create_point_section(subsection)
    2203         5520 :       CALL section_add_subsection(section, subsection)
    2204         5520 :       CALL section_release(subsection)
    2205              : 
    2206         5520 :    END SUBROUTINE create_colvar_wc_section
    2207              : 
    2208              :    ! **************************************************************************************************
    2209              : !> \brief collective variables specifying h bonds= wire
    2210              : !> \param section the section to be created
    2211              : !> \author alin m elena
    2212              : ! **************************************************************************************************
    2213         5520 :    SUBROUTINE create_colvar_hbp_section(section)
    2214              :       TYPE(section_type), POINTER                        :: section
    2215              : 
    2216              :       TYPE(keyword_type), POINTER                        :: keyword
    2217              :       TYPE(section_type), POINTER                        :: subsection
    2218              : 
    2219         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    2220              :       CALL section_create(section, __LOCATION__, name="hbp", &
    2221              :                           description="Section to define the hbond wannier centre as a collective variables.", &
    2222         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2223         5520 :       NULLIFY (keyword, subsection)
    2224              : 
    2225              :       CALL keyword_create(keyword, __LOCATION__, name="RCUT", &
    2226              :                           description="Parameter used for computing the cutoff radius for searching "// &
    2227              :                           "the wannier centres around an atom", &
    2228              :                           usage="RCUT <REAL>", default_r_val=0.529177208590000_dp, unit_str="angstrom", &
    2229         5520 :                           type_of_var=real_t, repeats=.FALSE.)
    2230         5520 :       CALL section_add_keyword(section, keyword)
    2231         5520 :       CALL keyword_release(keyword)
    2232              : 
    2233              :       CALL keyword_create(keyword, __LOCATION__, name="SHIFT", &
    2234              :                           description="Parameter used for shifting each term in the sum ", &
    2235              :                           usage="SHIFT <REAL>", default_r_val=0.5_dp, &
    2236         5520 :                           type_of_var=real_t, repeats=.FALSE.)
    2237         5520 :       CALL section_add_keyword(section, keyword)
    2238         5520 :       CALL keyword_release(keyword)
    2239              : 
    2240              :       CALL keyword_create(keyword, __LOCATION__, name="NPOINTS", &
    2241              :                           description="The number of points in the path", &
    2242              :                           usage="NPOINTS {integer}", default_i_val=-1, &
    2243         5520 :                           n_var=1, type_of_var=integer_t, repeats=.FALSE.)
    2244         5520 :       CALL section_add_keyword(section, keyword)
    2245         5520 :       CALL keyword_release(keyword)
    2246              : 
    2247              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2248              :                           variants=["POINTS"], &
    2249              :                           description="Specifies the indexes of atoms/points defining the bond (Od, H, Oa).", &
    2250              :                           usage="ATOMS {integer} {integer} {integer}", &
    2251        11040 :                           n_var=3, type_of_var=integer_t, repeats=.TRUE.)
    2252         5520 :       CALL section_add_keyword(section, keyword)
    2253         5520 :       CALL keyword_release(keyword)
    2254              : 
    2255              :       ! Must be present in each colvar and handled properly
    2256         5520 :       CALL create_point_section(subsection)
    2257         5520 :       CALL section_add_subsection(section, subsection)
    2258         5520 :       CALL section_release(subsection)
    2259              : 
    2260         5520 :    END SUBROUTINE create_colvar_hbp_section
    2261              : 
    2262              : ! **************************************************************************************************
    2263              : !> \brief collective variables specifying ring puckering
    2264              : !> \brief D. Cremer and J.A. Pople, JACS 97 1354 (1975)
    2265              : !> \param section the section to be created
    2266              : !> \author Marcel Baer
    2267              : ! **************************************************************************************************
    2268         5520 :    SUBROUTINE create_colvar_ring_puckering_section(section)
    2269              :       TYPE(section_type), POINTER                        :: section
    2270              : 
    2271              :       TYPE(keyword_type), POINTER                        :: keyword
    2272              :       TYPE(section_type), POINTER                        :: subsection
    2273              : 
    2274         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    2275              :       CALL section_create(section, __LOCATION__, name="RING_PUCKERING", &
    2276              :                           description="Section to define general ring puckering collective variables.", &
    2277         5520 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2278              : 
    2279         5520 :       NULLIFY (keyword, subsection)
    2280              : 
    2281              :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2282              :                           variants=["POINTS"], &
    2283              :                           description="Specifies the indexes of atoms/points defining the ring. "// &
    2284              :                           "At least 4 Atoms are needed.", &
    2285              :                           usage="ATOMS {integer} {integer} {integer} ..", &
    2286        11040 :                           n_var=-1, type_of_var=integer_t)
    2287         5520 :       CALL section_add_keyword(section, keyword)
    2288         5520 :       CALL keyword_release(keyword)
    2289              : 
    2290              :       CALL keyword_create(keyword, __LOCATION__, name="COORDINATE", &
    2291              :                           description="Indicate the coordinate to be used. Follow the Cremer-Pople definition for a N ring. "// &
    2292              :                           "0 is the total puckering variable Q, "// &
    2293              :                           "2..[N/2] are puckering coordinates. "// &
    2294              :                           "-2..-[N/2-1] are puckering angles.", &
    2295              :                           usage="COORDINATE {integer}", default_i_val=0, &
    2296         5520 :                           n_var=1)
    2297         5520 :       CALL section_add_keyword(section, keyword)
    2298         5520 :       CALL keyword_release(keyword)
    2299              : 
    2300              :       ! Must be present in each colvar and handled properly
    2301         5520 :       CALL create_point_section(subsection)
    2302         5520 :       CALL section_add_subsection(section, subsection)
    2303         5520 :       CALL section_release(subsection)
    2304              : 
    2305         5520 :    END SUBROUTINE create_colvar_ring_puckering_section
    2306              : 
    2307              : ! **************************************************************************************************
    2308              : !> \brief Creates the VORONOIIPZ collective variable input section
    2309              : !> \param section the section to create
    2310              : ! **************************************************************************************************
    2311         5520 :    SUBROUTINE create_voronoiipz_section(section)
    2312              :       TYPE(section_type), POINTER                        :: section
    2313              : 
    2314              :       TYPE(keyword_type), POINTER                        :: keyword
    2315              : 
    2316         5520 :       CPASSERT(.NOT. ASSOCIATED(section))
    2317         5520 :       NULLIFY (keyword)
    2318              :       CALL section_create(section, __LOCATION__, name="VORONOIIPZ", &
    2319              :                           description="Absolute location of a hydronium ion along a Cartesian axis, "// &
    2320              :                           "based on continuous Voronoi weights.", &
    2321        11040 :                           citations=[Zhang2025], n_subsections=0, repeats=.FALSE.)
    2322              : 
    2323              :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
    2324              :                           description="Exponent in the Voronoi weight exp(LAMBDA*r). "// &
    2325              :                           "Negative values assign each hydrogen predominantly to nearby oxygen atoms.", &
    2326              :                           usage="LAMBDA [angstrom^-1] -8.0", type_of_var=real_t, &
    2327              :                           default_r_val=cp_unit_to_cp2k(value=-8.0_dp, unit_str="angstrom^-1"), &
    2328         5520 :                           unit_str="angstrom^-1", n_var=1)
    2329         5520 :       CALL section_add_keyword(section, keyword)
    2330         5520 :       CALL keyword_release(keyword)
    2331              : 
    2332              :       CALL keyword_create(keyword, __LOCATION__, name="ZMID", &
    2333              :                           description="Coordinate of the reference plane along the selected axis.", &
    2334              :                           usage="ZMID [angstrom] 0.0", type_of_var=real_t, default_r_val=0.0_dp, &
    2335         5520 :                           unit_str="angstrom", n_var=1)
    2336         5520 :       CALL section_add_keyword(section, keyword)
    2337         5520 :       CALL keyword_release(keyword)
    2338              : 
    2339              :       CALL keyword_create(keyword, __LOCATION__, name="ZIDX", &
    2340              :                           description="Cartesian direction used for the ion location: 1=X, 2=Y, 3=Z.", &
    2341         5520 :                           usage="ZIDX 3", type_of_var=integer_t, default_i_val=3, n_var=1)
    2342         5520 :       CALL section_add_keyword(section, keyword)
    2343         5520 :       CALL keyword_release(keyword)
    2344              : 
    2345              :       CALL keyword_create(keyword, __LOCATION__, name="D_0", &
    2346              :                           description="Reference coordination of the non-reactive GROUPA atoms.", &
    2347         5520 :                           usage="D_0 2.0", type_of_var=real_t, default_r_val=2.0_dp, n_var=1)
    2348         5520 :       CALL section_add_keyword(section, keyword)
    2349         5520 :       CALL keyword_release(keyword)
    2350              : 
    2351              :       CALL keyword_create(keyword, __LOCATION__, name="D_1", &
    2352              :                           description="Reference coordination of the first reactive GROUPA atom.", &
    2353         5520 :                           usage="D_1 2.0", type_of_var=real_t, default_r_val=2.0_dp, n_var=1)
    2354         5520 :       CALL section_add_keyword(section, keyword)
    2355         5520 :       CALL keyword_release(keyword)
    2356              : 
    2357              :       CALL keyword_create(keyword, __LOCATION__, name="D_2", &
    2358              :                           description="Reference coordination of the second reactive GROUPA atom.", &
    2359         5520 :                           usage="D_2 2.0", type_of_var=real_t, default_r_val=2.0_dp, n_var=1)
    2360         5520 :       CALL section_add_keyword(section, keyword)
    2361         5520 :       CALL keyword_release(keyword)
    2362              : 
    2363              :       CALL keyword_create(keyword, __LOCATION__, name="D_3", &
    2364              :                           description="Reference coordination of the third reactive GROUPA atom.", &
    2365         5520 :                           usage="D_3 2.0", type_of_var=real_t, default_r_val=2.0_dp, n_var=1)
    2366         5520 :       CALL section_add_keyword(section, keyword)
    2367         5520 :       CALL keyword_release(keyword)
    2368              : 
    2369              :       CALL keyword_create(keyword, __LOCATION__, name="NL_CUTOFF", &
    2370              :                           description="Maximum GROUPA-GROUPB distance included in the Voronoi weights.", &
    2371              :                           usage="NL_CUTOFF [angstrom] 2.4", &
    2372              :                           default_r_val=cp_unit_to_cp2k(value=2.4_dp, unit_str="angstrom"), &
    2373         5520 :                           unit_str="angstrom", n_var=1)
    2374         5520 :       CALL section_add_keyword(section, keyword)
    2375         5520 :       CALL keyword_release(keyword)
    2376              : 
    2377              :       CALL keyword_create(keyword, __LOCATION__, name="GROUPA", &
    2378              :                           description="Oxygen atoms used as Voronoi sites. Any reactive sites must "// &
    2379              :                           "be the final NRX entries.", &
    2380         5520 :                           usage="GROUPA 1 4 7", n_var=-1, type_of_var=integer_t)
    2381         5520 :       CALL section_add_keyword(section, keyword)
    2382         5520 :       CALL keyword_release(keyword)
    2383              : 
    2384              :       CALL keyword_create(keyword, __LOCATION__, name="GROUPB", &
    2385              :                           description="Hydrogen atoms assigned to the GROUPA sites.", &
    2386         5520 :                           usage="GROUPB 2 3 5 6 8 9", n_var=-1, type_of_var=integer_t)
    2387         5520 :       CALL section_add_keyword(section, keyword)
    2388         5520 :       CALL keyword_release(keyword)
    2389              : 
    2390              :       CALL keyword_create(keyword, __LOCATION__, name="NRX", &
    2391              :                           description="Number of reactive sites at the end of GROUPA (zero to three). "// &
    2392              :                           "Their reference coordinations are D_1 through D_3.", &
    2393         5520 :                           usage="NRX 0", type_of_var=integer_t, default_i_val=0, n_var=1)
    2394         5520 :       CALL section_add_keyword(section, keyword)
    2395         5520 :       CALL keyword_release(keyword)
    2396              : 
    2397         5520 :    END SUBROUTINE create_voronoiipz_section
    2398              : 
    2399              : END MODULE input_cp2k_colvar
        

Generated by: LCOV version 2.0-1