LCOV - code coverage report
Current view: top level - src - input_cp2k_colvar.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:936074a) Lines: 100.0 % 822 822
Test Date: 2025-12-04 06:27:48 Functions: 100.0 % 32 32

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

Generated by: LCOV version 2.0-1