LCOV - code coverage report
Current view: top level - src - input_cp2k_colvar.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:70636b1) Lines: 100.0 % 822 822
Test Date: 2026-02-11 07:00:35 Functions: 100.0 % 32 32

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

Generated by: LCOV version 2.0-1