LCOV - code coverage report
Current view: top level - src - input_cp2k_colvar.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:4dc10b3) Lines: 822 822 100.0 %
Date: 2024-11-21 06:45:46 Functions: 32 32 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 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       34120 :    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       34120 :       skip = .FALSE.
      70       34120 :       IF (PRESENT(skip_recursive_colvar)) skip = skip_recursive_colvar
      71       34120 :       CPASSERT(.NOT. ASSOCIATED(section))
      72             :       CALL section_create(section, __LOCATION__, name="COLVAR", &
      73             :                           description="This section specifies the nature of the collective variables.", &
      74       34120 :                           n_keywords=1, n_subsections=1, repeats=.TRUE.)
      75       34120 :       NULLIFY (subsection, print_key)
      76             : 
      77             :       CALL create_colvar_var_section(subsection=subsection, &
      78       34120 :                                      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       34120 :                           n_keywords=0, n_subsections=1, repeats=.TRUE.)
      83       34120 :       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       34120 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
      87       34120 :       CALL section_add_subsection(subsection, print_key)
      88       34120 :       CALL section_release(print_key)
      89       34120 :       CALL section_add_subsection(section, subsection)
      90       34120 :       CALL section_release(subsection)
      91             : 
      92       34120 :       CALL create_clv_info_section(subsection)
      93       34120 :       CALL section_add_subsection(section, subsection)
      94       34120 :       CALL section_release(subsection)
      95             : 
      96       34120 :    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       34120 :    SUBROUTINE create_clv_info_section(section)
     106             :       TYPE(section_type), POINTER                        :: section
     107             : 
     108             :       TYPE(keyword_type), POINTER                        :: keyword
     109             : 
     110       34120 :       CPASSERT(.NOT. ASSOCIATED(section))
     111       34120 :       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       34120 :                           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       34120 :                           usage="{Real} ...", type_of_var=real_t, n_var=-1)
     122       34120 :       CALL section_add_keyword(section, keyword)
     123       34120 :       CALL keyword_release(keyword)
     124             : 
     125       34120 :    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       34120 :    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       34120 :       CPASSERT(.NOT. ASSOCIATED(subsection))
     139       34120 :       CPASSERT(ASSOCIATED(section))
     140             : 
     141       34120 :       CALL create_colvar_dist_section(subsection)
     142       34120 :       CALL section_add_subsection(section, subsection)
     143       34120 :       CALL section_release(subsection)
     144             : 
     145       34120 :       CALL create_colvar_angle_section(subsection)
     146       34120 :       CALL section_add_subsection(section, subsection)
     147       34120 :       CALL section_release(subsection)
     148             : 
     149       34120 :       CALL create_colvar_torsion_section(subsection)
     150       34120 :       CALL section_add_subsection(section, subsection)
     151       34120 :       CALL section_release(subsection)
     152             : 
     153       34120 :       CALL create_colvar_coord_section(subsection)
     154       34120 :       CALL section_add_subsection(section, subsection)
     155       34120 :       CALL section_release(subsection)
     156             : 
     157       34120 :       CALL create_colvar_pop_section(subsection)
     158       34120 :       CALL section_add_subsection(section, subsection)
     159       34120 :       CALL section_release(subsection)
     160             : 
     161       34120 :       CALL create_colvar_gyr_section(subsection)
     162       34120 :       CALL section_add_subsection(section, subsection)
     163       34120 :       CALL section_release(subsection)
     164             : 
     165       34120 :       CALL create_colvar_d_pl_section(subsection)
     166       34120 :       CALL section_add_subsection(section, subsection)
     167       34120 :       CALL section_release(subsection)
     168             : 
     169       34120 :       CALL create_colvar_a_pl_section(subsection)
     170       34120 :       CALL section_add_subsection(section, subsection)
     171       34120 :       CALL section_release(subsection)
     172             : 
     173       34120 :       CALL create_colvar_rot_section(subsection)
     174       34120 :       CALL section_add_subsection(section, subsection)
     175       34120 :       CALL section_release(subsection)
     176             : 
     177       34120 :       CALL create_colvar_dfunct_section(subsection)
     178       34120 :       CALL section_add_subsection(section, subsection)
     179       34120 :       CALL section_release(subsection)
     180             : 
     181       34120 :       CALL create_colvar_qparm_section(subsection)
     182       34120 :       CALL section_add_subsection(section, subsection)
     183       34120 :       CALL section_release(subsection)
     184             : 
     185       34120 :       CALL create_colvar_hydronium_shell_section(subsection)
     186       34120 :       CALL section_add_subsection(section, subsection)
     187       34120 :       CALL section_release(subsection)
     188             : 
     189       34120 :       CALL create_colvar_hydronium_dist_section(subsection)
     190       34120 :       CALL section_add_subsection(section, subsection)
     191       34120 :       CALL section_release(subsection)
     192             : 
     193       34120 :       CALL create_colvar_acid_hyd_dist_section(subsection)
     194       34120 :       CALL section_add_subsection(section, subsection)
     195       34120 :       CALL section_release(subsection)
     196             : 
     197       34120 :       CALL create_colvar_acid_hyd_shell_section(subsection)
     198       34120 :       CALL section_add_subsection(section, subsection)
     199       34120 :       CALL section_release(subsection)
     200             : 
     201       34120 :       CALL create_colvar_rmsd_section(subsection)
     202       34120 :       CALL section_add_subsection(section, subsection)
     203       34120 :       CALL section_release(subsection)
     204             : 
     205       34120 :       CALL create_colvar_xyz_d_section(subsection)
     206       34120 :       CALL section_add_subsection(section, subsection)
     207       34120 :       CALL section_release(subsection)
     208             : 
     209       34120 :       CALL create_colvar_xyz_od_section(subsection)
     210       34120 :       CALL section_add_subsection(section, subsection)
     211       34120 :       CALL section_release(subsection)
     212             : 
     213       34120 :       CALL create_colvar_u_section(subsection)
     214       34120 :       CALL section_add_subsection(section, subsection)
     215       34120 :       CALL section_release(subsection)
     216             : 
     217       34120 :       CALL create_colvar_wc_section(subsection)
     218       34120 :       CALL section_add_subsection(section, subsection)
     219       34120 :       CALL section_release(subsection)
     220             : 
     221       34120 :       CALL create_colvar_hbp_section(subsection)
     222       34120 :       CALL section_add_subsection(section, subsection)
     223       34120 :       CALL section_release(subsection)
     224             : 
     225       34120 :       CALL create_colvar_ring_puckering_section(subsection)
     226       34120 :       CALL section_add_subsection(section, subsection)
     227       34120 :       CALL section_release(subsection)
     228             : 
     229       34120 :       CALL create_colvar_cond_dist_section(subsection)
     230       34120 :       CALL section_add_subsection(section, subsection)
     231       34120 :       CALL section_release(subsection)
     232             : 
     233       34120 :       IF (.NOT. skip_recursive_colvar) THEN
     234        8530 :          CALL create_colvar_rpath_section(subsection)
     235        8530 :          CALL section_add_subsection(section, subsection)
     236        8530 :          CALL section_release(subsection)
     237             : 
     238        8530 :          CALL create_colvar_dpath_section(subsection)
     239        8530 :          CALL section_add_subsection(section, subsection)
     240        8530 :          CALL section_release(subsection)
     241             : 
     242        8530 :          CALL create_colvar_comb_section(subsection)
     243        8530 :          CALL section_add_subsection(section, subsection)
     244        8530 :          CALL section_release(subsection)
     245             :       END IF
     246             : 
     247       34120 :    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       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     264             : 
     265       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
     272       34120 :       CALL section_add_keyword(section, keyword)
     273       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
     280       34120 :       CALL section_add_keyword(section, keyword)
     281       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
     289       34120 :       CALL section_add_keyword(section, keyword)
     290       34120 :       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       34120 :                           n_var=-1, type_of_var=char_t)
     296       34120 :       CALL section_add_keyword(section, keyword)
     297       34120 :       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       34120 :                           n_var=-1, type_of_var=char_t)
     303       34120 :       CALL section_add_keyword(section, keyword)
     304       34120 :       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       34120 :                           n_var=-1, type_of_var=char_t)
     311       34120 :       CALL section_add_keyword(section, keyword)
     312       34120 :       CALL keyword_release(keyword)
     313             : 
     314             :       ! Must be present in each colvar and handled properly
     315       34120 :       CALL create_point_section(subsection)
     316       34120 :       CALL section_add_subsection(section, subsection)
     317       34120 :       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       68240 :                           unit_str="bohr", n_var=1)
     324       34120 :       CALL section_add_keyword(section, keyword)
     325       34120 :       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       68240 :                           n_var=1)
     333       34120 :       CALL section_add_keyword(section, keyword)
     334       34120 :       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       68240 :                           n_var=1)
     342       34120 :       CALL section_add_keyword(section, keyword)
     343       34120 :       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       68240 :                           unit_str="bohr", n_var=1)
     351       34120 :       CALL section_add_keyword(section, keyword)
     352       34120 :       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       68240 :                           n_var=1)
     361       34120 :       CALL section_add_keyword(section, keyword)
     362       34120 :       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       68240 :                           n_var=1)
     371       34120 :       CALL section_add_keyword(section, keyword)
     372       34120 :       CALL keyword_release(keyword)
     373             : 
     374       34120 :    END SUBROUTINE create_colvar_coord_section
     375             : 
     376             : ! **************************************************************************************************
     377             : !> \brief ...
     378             : !> \param section ...
     379             : ! **************************************************************************************************
     380       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     390             : 
     391       34120 :       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       34120 :                           n_var=-1, type_of_var=integer_t)
     397       34120 :       CALL section_add_keyword(section, keyword)
     398       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
     405       34120 :       CALL section_add_keyword(section, keyword)
     406       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
     413       34120 :       CALL section_add_keyword(section, keyword)
     414       34120 :       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       34120 :                           n_var=-1, type_of_var=char_t)
     420       34120 :       CALL section_add_keyword(section, keyword)
     421       34120 :       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       34120 :                           n_var=-1, type_of_var=char_t)
     427       34120 :       CALL section_add_keyword(section, keyword)
     428       34120 :       CALL keyword_release(keyword)
     429             : 
     430             :       ! Must be present in each colvar and handled properly
     431       34120 :       CALL create_point_section(subsection)
     432       34120 :       CALL section_add_subsection(section, subsection)
     433       34120 :       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       68240 :                           unit_str="bohr", n_var=1)
     440       34120 :       CALL section_add_keyword(section, keyword)
     441       34120 :       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       68240 :                           n_var=1)
     449       34120 :       CALL section_add_keyword(section, keyword)
     450       34120 :       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       68240 :                           n_var=1)
     458       34120 :       CALL section_add_keyword(section, keyword)
     459       34120 :       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="R0 {real}", default_r_val=3.0_dp, &
     464       34120 :                           unit_str="bohr", n_var=1)
     465       34120 :       CALL section_add_keyword(section, keyword)
     466       34120 :       CALL keyword_release(keyword)
     467             : 
     468       34120 :    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       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     487             : 
     488       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
     495       34120 :       CALL section_add_keyword(section, keyword)
     496       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
     503       34120 :       CALL section_add_keyword(section, keyword)
     504       34120 :       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       34120 :                           n_var=-1, type_of_var=char_t)
     510       34120 :       CALL section_add_keyword(section, keyword)
     511       34120 :       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       34120 :                           n_var=-1, type_of_var=char_t)
     517       34120 :       CALL section_add_keyword(section, keyword)
     518       34120 :       CALL keyword_release(keyword)
     519             : 
     520             :       ! Must be present in each colvar and handled properly
     521       34120 :       CALL create_point_section(subsection)
     522       34120 :       CALL section_add_subsection(section, subsection)
     523       34120 :       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       68240 :                           n_var=1)
     530       34120 :       CALL section_add_keyword(section, keyword)
     531       34120 :       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       68240 :                           n_var=1)
     539       34120 :       CALL section_add_keyword(section, keyword)
     540       34120 :       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       68240 :                           n_var=1)
     548       34120 :       CALL section_add_keyword(section, keyword)
     549       34120 :       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       68240 :                           n_var=1)
     556       34120 :       CALL section_add_keyword(section, keyword)
     557       34120 :       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       34120 :                           n_var=1)
     563       34120 :       CALL section_add_keyword(section, keyword)
     564       34120 :       CALL keyword_release(keyword)
     565             : 
     566       34120 :    END SUBROUTINE create_colvar_pop_section
     567             : 
     568             : ! **************************************************************************************************
     569             : !> \brief ...
     570             : !> \param section ...
     571             : ! **************************************************************************************************
     572       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     582             : 
     583       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
     590       34120 :       CALL section_add_keyword(section, keyword)
     591       34120 :       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       34120 :                           n_var=-1, type_of_var=char_t)
     597       34120 :       CALL section_add_keyword(section, keyword)
     598       34120 :       CALL keyword_release(keyword)
     599             : 
     600             :       ! Must be present in each colvar and handled properly
     601       34120 :       CALL create_point_section(subsection)
     602       34120 :       CALL section_add_subsection(section, subsection)
     603       34120 :       CALL section_release(subsection)
     604             : 
     605       34120 :    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       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     623             : 
     624       34120 :       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       68240 :                           n_var=4, type_of_var=integer_t)
     631       34120 :       CALL section_add_keyword(section, keyword)
     632       34120 :       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       34120 :                           type_of_var=real_t)
     639       34120 :       CALL section_add_keyword(section, keyword)
     640       34120 :       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       34120 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     647       34120 :       CALL section_add_keyword(section, keyword)
     648       34120 :       CALL keyword_release(keyword)
     649             : 
     650             :       ! Must be present in each colvar and handled properly
     651       34120 :       CALL create_point_section(subsection)
     652       34120 :       CALL section_add_subsection(section, subsection)
     653       34120 :       CALL section_release(subsection)
     654             : 
     655       34120 :    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       34120 :    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       34120 :       CPASSERT(.NOT. ASSOCIATED(section))
     669             :       CALL section_create(section, __LOCATION__, name="torsion", &
     670             :                           description="Section to define the torsion as a collective variables.", &
     671       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     672             : 
     673       34120 :       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       68240 :                           n_var=4, type_of_var=integer_t)
     680       34120 :       CALL section_add_keyword(section, keyword)
     681       34120 :       CALL keyword_release(keyword)
     682             : 
     683             :       ! Must be present in each colvar and handled properly
     684       34120 :       CALL create_point_section(subsection)
     685       34120 :       CALL section_add_subsection(section, subsection)
     686       34120 :       CALL section_release(subsection)
     687             : 
     688       34120 :    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       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     706             : 
     707       34120 :       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       34120 :                           n_var=1, type_of_var=integer_t)
     714       34120 :       CALL section_add_keyword(section, keyword)
     715       34120 :       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       34120 :                           n_var=1, type_of_var=integer_t)
     722       34120 :       CALL section_add_keyword(section, keyword)
     723       34120 :       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       34120 :                           n_var=1, type_of_var=integer_t)
     730       34120 :       CALL section_add_keyword(section, keyword)
     731       34120 :       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       34120 :                           n_var=1, type_of_var=integer_t)
     738       34120 :       CALL section_add_keyword(section, keyword)
     739       34120 :       CALL keyword_release(keyword)
     740             : 
     741             :       ! Must be present in each colvar and handled properly
     742       34120 :       CALL create_point_section(subsection)
     743       34120 :       CALL section_add_subsection(section, subsection)
     744       34120 :       CALL section_release(subsection)
     745             : 
     746       34120 :    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       34120 :    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       34120 :       CPASSERT(.NOT. ASSOCIATED(section))
     760             :       CALL section_create(section, __LOCATION__, name="angle", &
     761             :                           description="Section to define the angle as a collective variables.", &
     762       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     763       34120 :       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       68240 :                           n_var=3, type_of_var=integer_t)
     770       34120 :       CALL section_add_keyword(section, keyword)
     771       34120 :       CALL keyword_release(keyword)
     772             : 
     773             :       ! Must be present in each colvar and handled properly
     774       34120 :       CALL create_point_section(subsection)
     775       34120 :       CALL section_add_subsection(section, subsection)
     776       34120 :       CALL section_release(subsection)
     777             : 
     778       34120 :    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       34120 :    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       34120 :       CPASSERT(.NOT. ASSOCIATED(section))
     792             :       CALL section_create(section, __LOCATION__, name="distance", &
     793             :                           description="Section to define the distance as a collective variables.", &
     794       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     795       34120 :       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       68240 :                           n_var=2, type_of_var=integer_t)
     802       34120 :       CALL section_add_keyword(section, keyword)
     803       34120 :       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       34120 :                           default_i_val=do_clv_xyz)
     810       34120 :       CALL section_add_keyword(section, keyword)
     811       34120 :       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       34120 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     818       34120 :       CALL section_add_keyword(section, keyword)
     819       34120 :       CALL keyword_release(keyword)
     820             : 
     821             :       ! Must be present in each colvar and handled properly
     822       34120 :       CALL create_point_section(subsection)
     823       34120 :       CALL section_add_subsection(section, subsection)
     824       34120 :       CALL section_release(subsection)
     825             : 
     826       34120 :    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       34123 :    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       34123 :       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       34123 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     846       34123 :       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       68246 :                           n_var=1, type_of_var=integer_t)
     853       34123 :       CALL section_add_keyword(section, keyword)
     854       34123 :       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="AXIS (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       34123 :                           default_i_val=do_clv_xyz)
     863       34123 :       CALL section_add_keyword(section, keyword)
     864       34123 :       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       34123 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     871       34123 :       CALL section_add_keyword(section, keyword)
     872       34123 :       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       34123 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     878       34123 :       CALL section_add_keyword(section, keyword)
     879       34123 :       CALL keyword_release(keyword)
     880             : 
     881             :       ! Must be present in each colvar and handled properly
     882       34123 :       CALL create_point_section(subsection)
     883       34123 :       CALL section_add_subsection(section, subsection)
     884       34123 :       CALL section_release(subsection)
     885             : 
     886       34123 :    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       34123 :    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       34123 :       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       34123 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     905       34123 :       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       68246 :                           n_var=2, type_of_var=integer_t)
     912       34123 :       CALL section_add_keyword(section, keyword)
     913       34123 :       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="AXIS (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       34123 :                           default_i_val=do_clv_xyz)
     922       34123 :       CALL section_add_keyword(section, keyword)
     923       34123 :       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="AXIS (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       34123 :                           default_i_val=do_clv_xyz)
     932       34123 :       CALL section_add_keyword(section, keyword)
     933       34123 :       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       34123 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     940       34123 :       CALL section_add_keyword(section, keyword)
     941       34123 :       CALL keyword_release(keyword)
     942             : 
     943             :       ! Must be present in each colvar and handled properly
     944       34123 :       CALL create_point_section(subsection)
     945       34123 :       CALL section_add_subsection(section, subsection)
     946       34123 :       CALL section_release(subsection)
     947             : 
     948       34123 :    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       34120 :    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       34120 :       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       34120 :                           n_keywords=0, n_subsections=0, repeats=.FALSE.)
     965             : 
     966       34120 :       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       34120 :                           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       34120 :                           n_var=1)
     976       34120 :       CALL section_add_keyword(subsection, keyword)
     977       34120 :       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       34120 :                           n_var=-1)
     985       34120 :       CALL section_add_keyword(subsection, keyword)
     986       34120 :       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       34120 :                           n_var=-1, repeats=.TRUE.)
     992       34120 :       CALL section_add_keyword(subsection, keyword)
     993       34120 :       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       34120 :                           n_var=-1, repeats=.TRUE., unit_str="internal_cp2k")
     999       34120 :       CALL section_add_keyword(subsection, keyword)
    1000       34120 :       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       34120 :                           n_var=-1, repeats=.TRUE.)
    1007       34120 :       CALL section_add_keyword(subsection, keyword)
    1008       34120 :       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       34120 :                           usage="DX <REAL>", default_r_val=0.1_dp, unit_str="bohr")
    1013       34120 :       CALL section_add_keyword(subsection, keyword)
    1014       34120 :       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       34120 :                           usage="ERROR_LIMIT <REAL>", default_r_val=1.0E-12_dp)
    1020       34120 :       CALL section_add_keyword(subsection, keyword)
    1021       34120 :       CALL keyword_release(keyword)
    1022             : 
    1023       34120 :       CALL section_add_subsection(section, subsection)
    1024       34120 :       CALL section_release(subsection)
    1025             : 
    1026       34120 :    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       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1045       34120 :       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       34120 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1052       34120 :       CALL section_add_keyword(section, keyword)
    1053       34120 :       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       68240 :                           n_var=3, type_of_var=integer_t)
    1060       34120 :       CALL section_add_keyword(section, keyword)
    1061       34120 :       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       68240 :                           n_var=1, type_of_var=integer_t)
    1068       34120 :       CALL section_add_keyword(section, keyword)
    1069       34120 :       CALL keyword_release(keyword)
    1070             : 
    1071             :       ! Must be present in each colvar and handled properly
    1072       34120 :       CALL create_point_section(subsection)
    1073       34120 :       CALL section_add_subsection(section, subsection)
    1074       34120 :       CALL section_release(subsection)
    1075             : 
    1076       34120 :    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       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1095       34120 :       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       34120 :                           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       34120 :                           enum_i_vals=(/plane_def_atoms, plane_def_vec/))
    1111       34120 :       CALL section_add_keyword(subsection, keyword)
    1112       34120 :       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       34120 :                           n_var=3, type_of_var=integer_t)
    1118       34120 :       CALL section_add_keyword(subsection, keyword)
    1119       34120 :       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       34120 :                           n_var=3, type_of_var=real_t)
    1126       34120 :       CALL section_add_keyword(subsection, keyword)
    1127       34120 :       CALL keyword_release(keyword)
    1128       34120 :       CALL section_add_subsection(section, subsection)
    1129       34120 :       CALL section_release(subsection)
    1130             : 
    1131             :       ! Must be present in each colvar and handled properly
    1132       34120 :       CALL create_point_section(subsection)
    1133       34120 :       CALL section_add_subsection(section, subsection)
    1134       34120 :       CALL section_release(subsection)
    1135       34120 :    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      580046 :    SUBROUTINE create_point_section(section)
    1143             :       TYPE(section_type), POINTER                        :: section
    1144             : 
    1145             :       TYPE(keyword_type), POINTER                        :: keyword
    1146             : 
    1147      580046 :       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      580046 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    1152             : 
    1153      580046 :       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      580046 :                           default_i_val=do_clv_geo_center)
    1163      580046 :       CALL section_add_keyword(section, keyword)
    1164      580046 :       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      580046 :                           n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
    1170      580046 :       CALL section_add_keyword(section, keyword)
    1171      580046 :       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      580046 :          n_var=-1, type_of_var=real_t, repeats=.TRUE.)
    1178      580046 :       CALL section_add_keyword(section, keyword)
    1179      580046 :       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      580046 :                           repeats=.FALSE.)
    1186      580046 :       CALL section_add_keyword(section, keyword)
    1187      580046 :       CALL keyword_release(keyword)
    1188             : 
    1189      580046 :    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       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1206             : 
    1207       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
    1214       34120 :       CALL section_add_keyword(section, keyword)
    1215       34120 :       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       68240 :                           n_var=-1, type_of_var=integer_t)
    1222       34120 :       CALL section_add_keyword(section, keyword)
    1223       34120 :       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       34120 :                           n_var=1, unit_str="angstrom", type_of_var=real_t)
    1230       34120 :       CALL section_add_keyword(section, keyword)
    1231       34120 :       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       34120 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1237       34120 :       CALL section_add_keyword(section, keyword)
    1238       34120 :       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       34120 :                           n_var=1, unit_str="angstrom", type_of_var=real_t)
    1245       34120 :       CALL section_add_keyword(section, keyword)
    1246       34120 :       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       34120 :                           n_var=1, type_of_var=integer_t)
    1252       34120 :       CALL section_add_keyword(section, keyword)
    1253       34120 :       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       34120 :       CALL create_point_section(subsection)
    1263       34120 :       CALL section_add_subsection(section, subsection)
    1264       34120 :       CALL section_release(subsection)
    1265             : 
    1266       34120 :    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       34120 :    SUBROUTINE create_colvar_hydronium_shell_section(section)
    1274             :       TYPE(section_type), POINTER                        :: section
    1275             : 
    1276             :       TYPE(keyword_type), POINTER                        :: keyword
    1277             : 
    1278       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1286             : 
    1287       34120 :       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       34120 :                           n_var=-1, type_of_var=integer_t)
    1294       34120 :       CALL section_add_keyword(section, keyword)
    1295       34120 :       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       34120 :                           n_var=-1, type_of_var=integer_t)
    1302       34120 :       CALL section_add_keyword(section, keyword)
    1303       34120 :       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       34120 :                                                                             unit_str="bohr"), unit_str="bohr", n_var=1)
    1310       34120 :       CALL section_add_keyword(section, keyword)
    1311       34120 :       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       68240 :                           n_var=1)
    1319       34120 :       CALL section_add_keyword(section, keyword)
    1320       34120 :       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       68240 :                           n_var=1)
    1328       34120 :       CALL section_add_keyword(section, keyword)
    1329       34120 :       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       34120 :                                                                             unit_str="bohr"), unit_str="bohr", n_var=1)
    1336       34120 :       CALL section_add_keyword(section, keyword)
    1337       34120 :       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       68240 :                           n_var=1)
    1345       34120 :       CALL section_add_keyword(section, keyword)
    1346       34120 :       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       68240 :                           n_var=1)
    1354       34120 :       CALL section_add_keyword(section, keyword)
    1355       34120 :       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       34120 :                           n_var=1)
    1361       34120 :       CALL section_add_keyword(section, keyword)
    1362       34120 :       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       68240 :                           n_var=1)
    1370       34120 :       CALL section_add_keyword(section, keyword)
    1371       34120 :       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       68240 :                           n_var=1)
    1379       34120 :       CALL section_add_keyword(section, keyword)
    1380       34120 :       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       34120 :                           n_var=1)
    1386       34120 :       CALL section_add_keyword(section, keyword)
    1387       34120 :       CALL keyword_release(keyword)
    1388             : 
    1389       34120 :    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       34120 :    SUBROUTINE create_colvar_hydronium_dist_section(section)
    1397             :       TYPE(section_type), POINTER                        :: section
    1398             : 
    1399             :       TYPE(keyword_type), POINTER                        :: keyword
    1400             : 
    1401       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1408             : 
    1409       34120 :       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       34120 :                           n_var=-1, type_of_var=integer_t)
    1416       34120 :       CALL section_add_keyword(section, keyword)
    1417       34120 :       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       34120 :                           n_var=-1, type_of_var=integer_t)
    1424       34120 :       CALL section_add_keyword(section, keyword)
    1425       34120 :       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       34120 :                                                                             unit_str="bohr"), unit_str="bohr", n_var=1)
    1432       34120 :       CALL section_add_keyword(section, keyword)
    1433       34120 :       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       34120 :                           n_var=1)
    1440       34120 :       CALL section_add_keyword(section, keyword)
    1441       34120 :       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       34120 :                           n_var=1)
    1448       34120 :       CALL section_add_keyword(section, keyword)
    1449       34120 :       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       34120 :                           n_var=1)
    1455       34120 :       CALL section_add_keyword(section, keyword)
    1456       34120 :       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       34120 :                           n_var=1)
    1463       34120 :       CALL section_add_keyword(section, keyword)
    1464       34120 :       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       34120 :                           n_var=1)
    1471       34120 :       CALL section_add_keyword(section, keyword)
    1472       34120 :       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       34120 :                           n_var=1)
    1478       34120 :       CALL section_add_keyword(section, keyword)
    1479       34120 :       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       34120 :                           n_var=1)
    1486       34120 :       CALL section_add_keyword(section, keyword)
    1487       34120 :       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       34120 :                           n_var=1)
    1494       34120 :       CALL section_add_keyword(section, keyword)
    1495       34120 :       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       34120 :                           n_var=1)
    1501       34120 :       CALL section_add_keyword(section, keyword)
    1502       34120 :       CALL keyword_release(keyword)
    1503             : 
    1504       34120 :    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       34120 :    SUBROUTINE create_colvar_acid_hyd_dist_section(section)
    1514             :       TYPE(section_type), POINTER                        :: section
    1515             : 
    1516             :       TYPE(keyword_type), POINTER                        :: keyword
    1517             : 
    1518       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1524             : 
    1525       34120 :       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 {integer} {integer} ..", repeats=.TRUE., &
    1531       34120 :                           n_var=-1, type_of_var=integer_t)
    1532       34120 :       CALL section_add_keyword(section, keyword)
    1533       34120 :       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 {integer} {integer} ..", repeats=.TRUE., &
    1539       34120 :                           n_var=-1, type_of_var=integer_t)
    1540       34120 :       CALL section_add_keyword(section, keyword)
    1541       34120 :       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       34120 :                           n_var=-1, type_of_var=integer_t)
    1548       34120 :       CALL section_add_keyword(section, keyword)
    1549       34120 :       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       34120 :                           n_var=1)
    1556       34120 :       CALL section_add_keyword(section, keyword)
    1557       34120 :       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       34120 :                           n_var=1)
    1564       34120 :       CALL section_add_keyword(section, keyword)
    1565       34120 :       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       34120 :                                                                              unit_str="bohr"), unit_str="bohr", n_var=1)
    1572       34120 :       CALL section_add_keyword(section, keyword)
    1573       34120 :       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       34120 :                           n_var=1)
    1580       34120 :       CALL section_add_keyword(section, keyword)
    1581       34120 :       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       34120 :                           n_var=1)
    1588       34120 :       CALL section_add_keyword(section, keyword)
    1589       34120 :       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       34120 :                                                                              unit_str="bohr"), unit_str="bohr", n_var=1)
    1596       34120 :       CALL section_add_keyword(section, keyword)
    1597       34120 :       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       34120 :                           n_var=1)
    1604       34120 :       CALL section_add_keyword(section, keyword)
    1605       34120 :       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       34120 :                           n_var=1)
    1612       34120 :       CALL section_add_keyword(section, keyword)
    1613       34120 :       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       34120 :                           n_var=1)
    1619       34120 :       CALL section_add_keyword(section, keyword)
    1620       34120 :       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       68240 :                           n_var=1)
    1627       34120 :       CALL section_add_keyword(section, keyword)
    1628       34120 :       CALL keyword_release(keyword)
    1629             : 
    1630       34120 :    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       34120 :    SUBROUTINE create_colvar_acid_hyd_shell_section(section)
    1640             :       TYPE(section_type), POINTER                        :: section
    1641             : 
    1642             :       TYPE(keyword_type), POINTER                        :: keyword
    1643             : 
    1644       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1651             : 
    1652       34120 :       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 {integer} {integer} ..", repeats=.TRUE., &
    1658       34120 :                           n_var=-1, type_of_var=integer_t)
    1659       34120 :       CALL section_add_keyword(section, keyword)
    1660       34120 :       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 {integer} {integer} ..", repeats=.TRUE., &
    1666       34120 :                           n_var=-1, type_of_var=integer_t)
    1667       34120 :       CALL section_add_keyword(section, keyword)
    1668       34120 :       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       34120 :                           n_var=-1, type_of_var=integer_t)
    1675       34120 :       CALL section_add_keyword(section, keyword)
    1676       34120 :       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       34120 :                           n_var=1)
    1683       34120 :       CALL section_add_keyword(section, keyword)
    1684       34120 :       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       34120 :                           n_var=1)
    1691       34120 :       CALL section_add_keyword(section, keyword)
    1692       34120 :       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       34120 :                                                                              unit_str="bohr"), unit_str="bohr", n_var=1)
    1699       34120 :       CALL section_add_keyword(section, keyword)
    1700       34120 :       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       34120 :                           n_var=1)
    1707       34120 :       CALL section_add_keyword(section, keyword)
    1708       34120 :       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       34120 :                           n_var=1)
    1715       34120 :       CALL section_add_keyword(section, keyword)
    1716       34120 :       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       34120 :                                                                              unit_str="bohr"), unit_str="bohr", n_var=1)
    1723       34120 :       CALL section_add_keyword(section, keyword)
    1724       34120 :       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       34120 :                           n_var=1)
    1731       34120 :       CALL section_add_keyword(section, keyword)
    1732       34120 :       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       34120 :                           n_var=1)
    1739       34120 :       CALL section_add_keyword(section, keyword)
    1740       34120 :       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       34120 :                                                                             unit_str="bohr"), unit_str="bohr", n_var=1)
    1747       34120 :       CALL section_add_keyword(section, keyword)
    1748       34120 :       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       34120 :                           n_var=1)
    1755       34120 :       CALL section_add_keyword(section, keyword)
    1756       34120 :       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       34120 :                           n_var=1)
    1763       34120 :       CALL section_add_keyword(section, keyword)
    1764       34120 :       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       34120 :                           n_var=1)
    1770       34120 :       CALL section_add_keyword(section, keyword)
    1771       34120 :       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       34120 :                           n_var=1)
    1778       34120 :       CALL section_add_keyword(section, keyword)
    1779       34120 :       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       34120 :                           n_var=1)
    1786       34120 :       CALL section_add_keyword(section, keyword)
    1787       34120 :       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       34120 :                           n_var=1)
    1793       34120 :       CALL section_add_keyword(section, keyword)
    1794       34120 :       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       68240 :                           n_var=1)
    1801       34120 :       CALL section_add_keyword(section, keyword)
    1802       34120 :       CALL keyword_release(keyword)
    1803             : 
    1804       34120 :    END SUBROUTINE create_colvar_acid_hyd_shell_section
    1805             : 
    1806             : ! **************************************************************************************************
    1807             : !> \brief ...
    1808             : !> \param section ...
    1809             : ! **************************************************************************************************
    1810       34120 :    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       34120 :       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       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1823             : 
    1824       34120 :       NULLIFY (keyword, subsection, subsubsection)
    1825             :       CALL keyword_create(keyword, __LOCATION__, name="SUBSET_TYPE", &
    1826             :                           description="Define the subsytem used to compute the RMSD", &
    1827             :                           usage="SUBSET_TYPE ALL", &
    1828             :                           enum_c_vals=s2a("ALL", "LIST", "WEIGHT_LIST"), &
    1829             :                           enum_i_vals=(/rmsd_all, rmsd_list, rmsd_weightlist/), &
    1830       34120 :                           default_i_val=rmsd_all)
    1831       34120 :       CALL section_add_keyword(section, keyword)
    1832       34120 :       CALL keyword_release(keyword)
    1833             : 
    1834             :       CALL keyword_create(keyword, __LOCATION__, name="ALIGN_FRAMES", &
    1835             :                           description="Whether the reference frames should be aligned to minimize the RMSD", &
    1836             :                           usage="ALIGN_FRAME", &
    1837       34120 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1838       34120 :       CALL section_add_keyword(section, keyword)
    1839       34120 :       CALL keyword_release(keyword)
    1840             : 
    1841             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    1842             :                           description="Specify indexes of atoms building the subset. ", &
    1843             :                           usage="ATOMS {integer} {integer} ..", repeats=.TRUE., &
    1844       34120 :                           n_var=-1, type_of_var=integer_t)
    1845       34120 :       CALL section_add_keyword(section, keyword)
    1846       34120 :       CALL keyword_release(keyword)
    1847             : 
    1848             :       CALL keyword_create(keyword, __LOCATION__, name="WEIGHTS", &
    1849             :                           description="Specify weights of atoms building the subset. ", &
    1850             :                           usage="weightS {real} {real} ..", repeats=.TRUE., &
    1851       34120 :                           n_var=-1, type_of_var=real_t)
    1852       34120 :       CALL section_add_keyword(section, keyword)
    1853       34120 :       CALL keyword_release(keyword)
    1854             : 
    1855             :       CALL section_create(subsection, __LOCATION__, name="FRAME", &
    1856             :                           description="Specify coordinates of the frame (number of frames can be either 1 or 2)", &
    1857       34120 :                           repeats=.TRUE.)
    1858             : 
    1859             :       CALL keyword_create(keyword, __LOCATION__, name="COORD_FILE_NAME", &
    1860             :                           description="Name of the xyz file with coordinates (alternative to &COORD section)", &
    1861             :                           usage="COORD_FILE_NAME <CHAR>", &
    1862       34120 :                           default_lc_val="")
    1863       34120 :       CALL section_add_keyword(subsection, keyword)
    1864       34120 :       CALL keyword_release(keyword)
    1865             : 
    1866       34120 :       CALL create_coord_section_cv(subsubsection, "RMSD")
    1867       34120 :       CALL section_add_subsection(subsection, subsubsection)
    1868       34120 :       CALL section_release(subsubsection)
    1869             : 
    1870       34120 :       CALL section_add_subsection(section, subsection)
    1871       34120 :       CALL section_release(subsection)
    1872             : 
    1873       34120 :    END SUBROUTINE create_colvar_rmsd_section
    1874             : 
    1875             : ! **************************************************************************************************
    1876             : !> \brief collective variables specifying the space orthogonal to the reaction path
    1877             : !>        in the space spanned by the involved collective coordinates
    1878             : !> \param section the section to be created
    1879             : !> \author fschiff
    1880             : ! **************************************************************************************************
    1881        8530 :    SUBROUTINE create_colvar_rpath_section(section)
    1882             :       TYPE(section_type), POINTER                        :: section
    1883             : 
    1884        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
    1885             :       CALL section_create(section, __LOCATION__, name="REACTION_PATH", &
    1886             :                           description="Section defining a one dimensional reaction path in an Q-dimensional space of colvars. "// &
    1887             :                           "Constraining this colvar, allows to sample the space orthogonal to the reaction path, "// &
    1888             :                           "both in the Q-dimensional colvar and 3N-Q remaining coordinates. "// &
    1889             :                           "For the details of the function see cited literature.", &
    1890             :                           n_keywords=1, n_subsections=0, repeats=.FALSE., &
    1891       17060 :                           citations=(/Branduardi2007/))
    1892             : 
    1893        8530 :       CALL keywords_colvar_path(section)
    1894        8530 :    END SUBROUTINE create_colvar_rpath_section
    1895             : 
    1896             : ! **************************************************************************************************
    1897             : !> \brief Distance from reaction path
    1898             : !> \param section the section to be created
    1899             : !> \author 01.2010
    1900             : ! **************************************************************************************************
    1901        8530 :    SUBROUTINE create_colvar_dpath_section(section)
    1902             :       TYPE(section_type), POINTER                        :: section
    1903             : 
    1904        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
    1905             :       CALL section_create(section, __LOCATION__, name="DISTANCE_FROM_PATH", &
    1906             :                           description="Section defining the distance from a one dimensional reaction "// &
    1907             :                           "path in an Q-dimensional space of colvars. "// &
    1908             :                           "Constraining this colvar, allows to sample the space equidistant to the reaction path, "// &
    1909             :                           "both in the Q-dimensional colvar and 3N-Q remaining coordinates. "// &
    1910             :                           "For the details of the function see cited literature.", &
    1911             :                           n_keywords=1, n_subsections=0, repeats=.FALSE., &
    1912       17060 :                           citations=(/Branduardi2007/))
    1913             : 
    1914        8530 :       CALL keywords_colvar_path(section)
    1915        8530 :    END SUBROUTINE create_colvar_dpath_section
    1916             : 
    1917             : ! **************************************************************************************************
    1918             : !> \brief Section describinf keywords for both reaction path and distance from reaction path
    1919             : !> \param section the section to be created
    1920             : !> \author 01.2010
    1921             : ! **************************************************************************************************
    1922       17060 :    SUBROUTINE keywords_colvar_path(section)
    1923             : 
    1924             :       TYPE(section_type), POINTER                        :: section
    1925             : 
    1926             :       TYPE(keyword_type), POINTER                        :: keyword
    1927             :       TYPE(section_type), POINTER                        :: print_key, subsection, subsubsection
    1928             : 
    1929       17060 :       NULLIFY (keyword, subsection, subsubsection, print_key)
    1930       17060 :       CALL create_colvar_section(subsection, skip_recursive_colvar=.TRUE.)
    1931       17060 :       CALL section_add_subsection(section, subsection)
    1932       17060 :       CALL section_release(subsection)
    1933             : 
    1934             :       CALL keyword_create(keyword, __LOCATION__, name="DISTANCES_RMSD", &
    1935             :                           description=" ", &
    1936             :                           usage="DISTANCES_RMSD T", &
    1937       17060 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1938       17060 :       CALL section_add_keyword(section, keyword)
    1939       17060 :       CALL keyword_release(keyword)
    1940             : 
    1941             :       CALL keyword_create(keyword, __LOCATION__, name="RMSD", &
    1942             :                           description=" ", &
    1943             :                           usage="RMSD T", &
    1944       17060 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1945       17060 :       CALL section_add_keyword(section, keyword)
    1946       17060 :       CALL keyword_release(keyword)
    1947             : 
    1948             :       CALL keyword_create(keyword, __LOCATION__, name="SUBSET_TYPE", &
    1949             :                           description="Define the subsytem used to compute the RMSD", &
    1950             :                           usage="SUBSET_TYPE ALL", &
    1951             :                           enum_c_vals=s2a("ALL", "LIST"), &
    1952             :                           enum_i_vals=(/rmsd_all, rmsd_list/), &
    1953       17060 :                           default_i_val=rmsd_all)
    1954       17060 :       CALL section_add_keyword(section, keyword)
    1955       17060 :       CALL keyword_release(keyword)
    1956             : 
    1957             :       CALL keyword_create(keyword, __LOCATION__, name="ALIGN_FRAMES", &
    1958             :                           description="Whether the reference frames should be aligned to minimize the RMSD", &
    1959             :                           usage="ALIGN_FRAME", &
    1960       17060 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1961       17060 :       CALL section_add_keyword(section, keyword)
    1962       17060 :       CALL keyword_release(keyword)
    1963             : 
    1964             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    1965             :                           description="Specify indexes of atoms building the subset. ", &
    1966             :                           usage="ATOMS {integer} {integer} ..", repeats=.TRUE., &
    1967       17060 :                           n_var=-1, type_of_var=integer_t)
    1968       17060 :       CALL section_add_keyword(section, keyword)
    1969       17060 :       CALL keyword_release(keyword)
    1970             : 
    1971             :       CALL section_create(subsection, __LOCATION__, name="FRAME", &
    1972             :                           description="Specify coordinates of the frame", &
    1973       17060 :                           repeats=.TRUE.)
    1974             : 
    1975             :       CALL keyword_create(keyword, __LOCATION__, name="COORD_FILE_NAME", &
    1976             :                           description="Name of the xyz file with coordinates (alternative to &COORD section)", &
    1977             :                           usage="COORD_FILE_NAME <CHAR>", &
    1978       17060 :                           default_lc_val="")
    1979       17060 :       CALL section_add_keyword(subsection, keyword)
    1980       17060 :       CALL keyword_release(keyword)
    1981             : 
    1982       17060 :       CALL create_coord_section_cv(subsubsection, "RMSD")
    1983       17060 :       CALL section_add_subsection(subsection, subsubsection)
    1984       17060 :       CALL section_release(subsubsection)
    1985             : 
    1986       17060 :       CALL section_add_subsection(section, subsection)
    1987       17060 :       CALL section_release(subsection)
    1988             : 
    1989             :       CALL keyword_create(keyword, __LOCATION__, name="FUNCTION", &
    1990             :                           description="Specifies the ith element of the vector valued function that defines the reaction path. "// &
    1991             :                           "This keyword needs to repeat exactly Q times, and the order must match the order of the colvars. "// &
    1992             :                           "The VARIABLE (e.g. T) which parametrises the curve can be used as the target of a constraint.", &
    1993             :                           usage="FUNCTION (sin(T+2)+2*T)", type_of_var=lchar_t, &
    1994       17060 :                           n_var=1, default_lc_val="0", repeats=.TRUE.)
    1995       17060 :       CALL section_add_keyword(section, keyword)
    1996       17060 :       CALL keyword_release(keyword)
    1997             : 
    1998             :       CALL keyword_create(keyword, __LOCATION__, name="VARIABLE", &
    1999             :                           description="Specifies the name of the variable that parametrises the FUNCTION "// &
    2000             :                           "defining the reaction path.", &
    2001             :                           usage="VARIABLE T", type_of_var=char_t, &
    2002       17060 :                           n_var=1, repeats=.FALSE.)
    2003       17060 :       CALL section_add_keyword(section, keyword)
    2004       17060 :       CALL keyword_release(keyword)
    2005             : 
    2006             :       CALL keyword_create( &
    2007             :          keyword, __LOCATION__, name="LAMBDA", &
    2008             :          description="Specifies the exponent of the Gaussian used in the integral representation of the colvar. "// &
    2009             :          "The shape of the space orthogonal to the reaction path is defined by this choice. "// &
    2010             :          "In the limit of large values, it is given by the plane orthogonal to the path. "// &
    2011             :          "In practice, modest values are required for stable numerical integration.", &
    2012             :          usage="LAMBDA {real}", &
    2013       17060 :          type_of_var=real_t, default_r_val=5.0_dp)
    2014       17060 :       CALL section_add_keyword(section, keyword)
    2015       17060 :       CALL keyword_release(keyword)
    2016             : 
    2017             :       CALL keyword_create(keyword, __LOCATION__, name="STEP_SIZE", &
    2018             :                           description="Step size in the numerical integration, "// &
    2019             :                           "a few thousand points are common, and the proper number also depends on LAMBDA.", &
    2020             :                           usage="STEP_SIZE {real}", &
    2021       17060 :                           type_of_var=real_t, default_r_val=0.01_dp)
    2022       17060 :       CALL section_add_keyword(section, keyword)
    2023       17060 :       CALL keyword_release(keyword)
    2024             : 
    2025             :       CALL keyword_create(keyword, __LOCATION__, name="RANGE", &
    2026             :                           description="The range of VARIABLE used for the parametrisation.", &
    2027             :                           usage="RANGE <REAL> <REAL>", &
    2028       17060 :                           n_var=2, type_of_var=real_t)
    2029       17060 :       CALL section_add_keyword(section, keyword)
    2030       17060 :       CALL keyword_release(keyword)
    2031             : 
    2032             :       CALL cp_print_key_section_create( &
    2033             :          print_key, __LOCATION__, name="MAP", &
    2034             :          description="Activating this print key will print once a file with the values of the FUNCTION on a grid "// &
    2035             :          "of COLVAR values in a specified range. "// &
    2036             :          "GRID_SPACING and RANGE for every COLVAR has to be specified again in the same order as they are in the input.", &
    2037       17060 :          print_level=high_print_level, filename="PATH")
    2038             : 
    2039             :       CALL keyword_create(keyword, __LOCATION__, name="RANGE", &
    2040             :                           description="The range of of the grid of the COLVAR.", &
    2041             :                           usage="RANGE <REAL> <REAL>", &
    2042       17060 :                           n_var=2, type_of_var=real_t, repeats=.TRUE.)
    2043       17060 :       CALL section_add_keyword(print_key, keyword)
    2044       17060 :       CALL keyword_release(keyword)
    2045             : 
    2046             :       CALL keyword_create(keyword, __LOCATION__, name="GRID_SPACING", &
    2047             :                           description="Distance between two gridpoints for the grid on the COLVAR", &
    2048             :                           usage="STEP_SIZE {real}", repeats=.TRUE., &
    2049       17060 :                           type_of_var=real_t, default_r_val=0.01_dp)
    2050       17060 :       CALL section_add_keyword(print_key, keyword)
    2051       17060 :       CALL keyword_release(keyword)
    2052             : 
    2053       17060 :       CALL section_add_subsection(section, print_key)
    2054       17060 :       CALL section_release(print_key)
    2055             : 
    2056       17060 :    END SUBROUTINE keywords_colvar_path
    2057             : 
    2058             : ! **************************************************************************************************
    2059             : !> \brief Colvar allowing a combination of COLVARS
    2060             : !> \param section the section to be created
    2061             : !> \author Teodoro Laino [tlaino] - 12.2008
    2062             : ! **************************************************************************************************
    2063        8530 :    SUBROUTINE create_colvar_comb_section(section)
    2064             :       TYPE(section_type), POINTER                        :: section
    2065             : 
    2066             :       TYPE(keyword_type), POINTER                        :: keyword
    2067             :       TYPE(section_type), POINTER                        :: subsection
    2068             : 
    2069        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
    2070             :       CALL section_create(section, __LOCATION__, name="COMBINE_COLVAR", &
    2071             :                           description="Allows the possibility to combine several COLVARs into one COLVAR "// &
    2072             :                           "with a generic function.", &
    2073        8530 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2074             : 
    2075        8530 :       NULLIFY (keyword, subsection)
    2076        8530 :       CALL create_colvar_section(subsection, skip_recursive_colvar=.TRUE.)
    2077        8530 :       CALL section_add_subsection(section, subsection)
    2078        8530 :       CALL section_release(subsection)
    2079             : 
    2080             :       CALL keyword_create(keyword, __LOCATION__, name="FUNCTION", &
    2081             :                           description="Specifies the function used to combine different COLVARs into one.", &
    2082             :                           ! **************************************************************************************************
    2083             :                           !> \brief ...
    2084             :                           !> \param CV1^2 ...
    2085             :                           !> \param CV2^2 ...
    2086             :                           !> \param " ...
    2087             :                           !> \param type_of_var=lchar_t ...
    2088             :                           !> \param n_var=1 ...
    2089             :                           !> \param error=error ...
    2090             :                           ! **************************************************************************************************
    2091             :                           usage="FUNCTION SQRT(CV1^2+CV2^2)", type_of_var=lchar_t, &
    2092        8530 :                           n_var=1)
    2093        8530 :       CALL section_add_keyword(section, keyword)
    2094        8530 :       CALL keyword_release(keyword)
    2095             : 
    2096             :       CALL keyword_create(keyword, __LOCATION__, name="VARIABLES", &
    2097             :                           description="Specifies the name of the variable that parametrises the FUNCTION "// &
    2098             :                           "defining how COLVARS should be combined. The matching follows the same order of the "// &
    2099             :                           "COLVARS definition in the input file.", &
    2100        8530 :                           usage="VARIABLE CV1 CV2 CV3", type_of_var=char_t, n_var=-1, repeats=.FALSE.)
    2101        8530 :       CALL section_add_keyword(section, keyword)
    2102        8530 :       CALL keyword_release(keyword)
    2103             : 
    2104             :       CALL keyword_create(keyword, __LOCATION__, name="PARAMETERS", &
    2105             :                           description="Defines the parameters of the functional form", &
    2106             :                           usage="PARAMETERS a b D", type_of_var=char_t, &
    2107        8530 :                           n_var=-1, repeats=.TRUE.)
    2108        8530 :       CALL section_add_keyword(section, keyword)
    2109        8530 :       CALL keyword_release(keyword)
    2110             : 
    2111             :       CALL keyword_create(keyword, __LOCATION__, name="VALUES", &
    2112             :                           description="Defines the values of  parameter of the functional form", &
    2113             :                           usage="VALUES ", type_of_var=real_t, &
    2114        8530 :                           n_var=-1, repeats=.TRUE., unit_str="internal_cp2k")
    2115        8530 :       CALL section_add_keyword(section, keyword)
    2116        8530 :       CALL keyword_release(keyword)
    2117             : 
    2118             :       CALL keyword_create(keyword, __LOCATION__, name="DX", &
    2119             :                           description="Parameter used for computing the derivative of the combination "// &
    2120             :                           "of COLVARs with the Ridders' method.", &
    2121        8530 :                           usage="DX <REAL>", default_r_val=0.1_dp, unit_str="bohr")
    2122        8530 :       CALL section_add_keyword(section, keyword)
    2123        8530 :       CALL keyword_release(keyword)
    2124             : 
    2125             :       CALL keyword_create(keyword, __LOCATION__, name="ERROR_LIMIT", &
    2126             :                           description="Checks that the error in computing the derivative is not larger than "// &
    2127             :                           "the value set; in case error is larger a warning message is printed.", &
    2128        8530 :                           usage="ERROR_LIMIT <REAL>", default_r_val=1.0E-12_dp)
    2129        8530 :       CALL section_add_keyword(section, keyword)
    2130        8530 :       CALL keyword_release(keyword)
    2131             : 
    2132        8530 :    END SUBROUTINE create_colvar_comb_section
    2133             : 
    2134             : ! **************************************************************************************************
    2135             : !> \brief Creates the coord section
    2136             : !> \param section the section to create
    2137             : !> \param name ...
    2138             : !> \author teo
    2139             : ! **************************************************************************************************
    2140       51180 :    SUBROUTINE create_coord_section_cv(section, name)
    2141             :       TYPE(section_type), POINTER                        :: section
    2142             :       CHARACTER(LEN=*), INTENT(IN)                       :: name
    2143             : 
    2144             :       TYPE(keyword_type), POINTER                        :: keyword
    2145             : 
    2146       51180 :       CPASSERT(.NOT. ASSOCIATED(section))
    2147             :       CALL section_create(section, __LOCATION__, name="coord", &
    2148             :                           description="The positions for "//TRIM(name)//" used for restart", &
    2149       51180 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2150       51180 :       NULLIFY (keyword)
    2151             : 
    2152             :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    2153             :                           description="Specify positions of the system", repeats=.TRUE., &
    2154       51180 :                           usage="{Real} ...", type_of_var=real_t, n_var=-1)
    2155       51180 :       CALL section_add_keyword(section, keyword)
    2156       51180 :       CALL keyword_release(keyword)
    2157             : 
    2158       51180 :    END SUBROUTINE create_coord_section_cv
    2159             : 
    2160             : ! **************************************************************************************************
    2161             : !> \brief collective variables specifying h bonds
    2162             : !> \param section the section to be created
    2163             : !> \author alin m elena
    2164             : ! **************************************************************************************************
    2165       34120 :    SUBROUTINE create_colvar_wc_section(section)
    2166             :       TYPE(section_type), POINTER                        :: section
    2167             : 
    2168             :       TYPE(keyword_type), POINTER                        :: keyword
    2169             :       TYPE(section_type), POINTER                        :: subsection
    2170             : 
    2171       34120 :       CPASSERT(.NOT. ASSOCIATED(section))
    2172             :       CALL section_create(section, __LOCATION__, name="wc", &
    2173             :                           description="Section to define the hbond wannier centre as a collective variables.", &
    2174       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2175       34120 :       NULLIFY (keyword, subsection)
    2176             : 
    2177             :       CALL keyword_create(keyword, __LOCATION__, name="RCUT", &
    2178             :                           description="Parameter used for computing the cutoff radius for searching "// &
    2179             :                           "the wannier centres around an atom", &
    2180             :                           usage="RCUT <REAL>", default_r_val=0.529177208590000_dp, unit_str="angstrom", &
    2181       34120 :                           type_of_var=real_t, repeats=.FALSE.)
    2182       34120 :       CALL section_add_keyword(section, keyword)
    2183       34120 :       CALL keyword_release(keyword)
    2184             : 
    2185             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2186             :                           variants=(/"POINTS"/), &
    2187             :                           description="Specifies the indexes of atoms/points defining the bond (Od, H, Oa).", &
    2188             :                           usage="ATOMS {integer} {integer} {integer}", &
    2189       68240 :                           n_var=3, type_of_var=integer_t, repeats=.TRUE.)
    2190       34120 :       CALL section_add_keyword(section, keyword)
    2191       34120 :       CALL keyword_release(keyword)
    2192             : 
    2193             :       ! Must be present in each colvar and handled properly
    2194       34120 :       CALL create_point_section(subsection)
    2195       34120 :       CALL section_add_subsection(section, subsection)
    2196       34120 :       CALL section_release(subsection)
    2197             : 
    2198       34120 :    END SUBROUTINE create_colvar_wc_section
    2199             : 
    2200             :    ! **************************************************************************************************
    2201             : !> \brief collective variables specifying h bonds= wire
    2202             : !> \param section the section to be created
    2203             : !> \author alin m elena
    2204             : ! **************************************************************************************************
    2205       34120 :    SUBROUTINE create_colvar_hbp_section(section)
    2206             :       TYPE(section_type), POINTER                        :: section
    2207             : 
    2208             :       TYPE(keyword_type), POINTER                        :: keyword
    2209             :       TYPE(section_type), POINTER                        :: subsection
    2210             : 
    2211       34120 :       CPASSERT(.NOT. ASSOCIATED(section))
    2212             :       CALL section_create(section, __LOCATION__, name="hbp", &
    2213             :                           description="Section to define the hbond wannier centre as a collective variables.", &
    2214       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2215       34120 :       NULLIFY (keyword, subsection)
    2216             : 
    2217             :       CALL keyword_create(keyword, __LOCATION__, name="RCUT", &
    2218             :                           description="Parameter used for computing the cutoff radius for searching "// &
    2219             :                           "the wannier centres around an atom", &
    2220             :                           usage="RCUT <REAL>", default_r_val=0.529177208590000_dp, unit_str="angstrom", &
    2221       34120 :                           type_of_var=real_t, repeats=.FALSE.)
    2222       34120 :       CALL section_add_keyword(section, keyword)
    2223       34120 :       CALL keyword_release(keyword)
    2224             : 
    2225             :       CALL keyword_create(keyword, __LOCATION__, name="SHIFT", &
    2226             :                           description="Parameter used for shifting each term in the sum ", &
    2227             :                           usage="SHIFT <REAL>", default_r_val=0.5_dp, &
    2228       34120 :                           type_of_var=real_t, repeats=.FALSE.)
    2229       34120 :       CALL section_add_keyword(section, keyword)
    2230       34120 :       CALL keyword_release(keyword)
    2231             : 
    2232             :       CALL keyword_create(keyword, __LOCATION__, name="NPOINTS", &
    2233             :                           description="The number of points in the path", &
    2234             :                           usage="NPOINTS {integer}", default_i_val=-1, &
    2235       34120 :                           n_var=1, type_of_var=integer_t, repeats=.FALSE.)
    2236       34120 :       CALL section_add_keyword(section, keyword)
    2237       34120 :       CALL keyword_release(keyword)
    2238             : 
    2239             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2240             :                           variants=(/"POINTS"/), &
    2241             :                           description="Specifies the indexes of atoms/points defining the bond (Od, H, Oa).", &
    2242             :                           usage="ATOMS {integer} {integer} {integer}", &
    2243       68240 :                           n_var=3, type_of_var=integer_t, repeats=.TRUE.)
    2244       34120 :       CALL section_add_keyword(section, keyword)
    2245       34120 :       CALL keyword_release(keyword)
    2246             : 
    2247             :       ! Must be present in each colvar and handled properly
    2248       34120 :       CALL create_point_section(subsection)
    2249       34120 :       CALL section_add_subsection(section, subsection)
    2250       34120 :       CALL section_release(subsection)
    2251             : 
    2252       34120 :    END SUBROUTINE create_colvar_hbp_section
    2253             : 
    2254             : ! **************************************************************************************************
    2255             : !> \brief collective variables specifying ring puckering
    2256             : !> \brief D. Cremer and J.A. Pople, JACS 97 1354 (1975)
    2257             : !> \param section the section to be created
    2258             : !> \author Marcel Baer
    2259             : ! **************************************************************************************************
    2260       34120 :    SUBROUTINE create_colvar_ring_puckering_section(section)
    2261             :       TYPE(section_type), POINTER                        :: section
    2262             : 
    2263             :       TYPE(keyword_type), POINTER                        :: keyword
    2264             :       TYPE(section_type), POINTER                        :: subsection
    2265             : 
    2266       34120 :       CPASSERT(.NOT. ASSOCIATED(section))
    2267             :       CALL section_create(section, __LOCATION__, name="RING_PUCKERING", &
    2268             :                           description="Section to define general ring puckering collective variables.", &
    2269       34120 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2270             : 
    2271       34120 :       NULLIFY (keyword, subsection)
    2272             : 
    2273             :       CALL keyword_create(keyword, __LOCATION__, name="ATOMS", &
    2274             :                           variants=(/"POINTS"/), &
    2275             :                           description="Specifies the indexes of atoms/points defining the ring. "// &
    2276             :                           "At least 4 Atoms are needed.", &
    2277             :                           usage="ATOMS {integer} {integer} {integer} ..", &
    2278       68240 :                           n_var=-1, type_of_var=integer_t)
    2279       34120 :       CALL section_add_keyword(section, keyword)
    2280       34120 :       CALL keyword_release(keyword)
    2281             : 
    2282             :       CALL keyword_create(keyword, __LOCATION__, name="COORDINATE", &
    2283             :                           description="Indicate the coordinate to be used. Follow the Cremer-Pople definition for a N ring. "// &
    2284             :                           "0 is the total puckering variable Q, "// &
    2285             :                           "2..[N/2] are puckering coordinates. "// &
    2286             :                           "-2..-[N/2-1] are puckering angles.", &
    2287             :                           usage="COORDINATE {integer}", default_i_val=0, &
    2288       34120 :                           n_var=1)
    2289       34120 :       CALL section_add_keyword(section, keyword)
    2290       34120 :       CALL keyword_release(keyword)
    2291             : 
    2292             :       ! Must be present in each colvar and handled properly
    2293       34120 :       CALL create_point_section(subsection)
    2294       34120 :       CALL section_add_subsection(section, subsection)
    2295       34120 :       CALL section_release(subsection)
    2296             : 
    2297       34120 :    END SUBROUTINE create_colvar_ring_puckering_section
    2298             : 
    2299             : ! **************************************************************************************************
    2300             : 
    2301             : END MODULE input_cp2k_colvar

Generated by: LCOV version 1.15