LCOV - code coverage report
Current view: top level - src/start - input_cp2k_motion.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:262480d) Lines: 1132 1132 100.0 %
Date: 2024-11-22 07:00:40 Functions: 21 21 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             : !>      10.2005 split input_cp2k into smaller modules [fawzi]
      11             : !>      01.2020 add keywords related to Space Groups [pcazade]
      12             : !> \author teo & fawzi
      13             : ! **************************************************************************************************
      14             : MODULE input_cp2k_motion
      15             :    USE bibliography, ONLY: Brieuc2016, &
      16             :                            Byrd1995, &
      17             :                            Ceriotti2010, &
      18             :                            Ceriotti2012, &
      19             :                            Ceriotti2014, &
      20             :                            Henkelman1999, &
      21             :                            Henkelman2014, &
      22             :                            Kapil2016
      23             :    USE cp_output_handling, ONLY: add_last_numeric, &
      24             :                                  cp_print_key_section_create, &
      25             :                                  debug_print_level, &
      26             :                                  high_print_level, &
      27             :                                  low_print_level, &
      28             :                                  medium_print_level
      29             :    USE cp_units, ONLY: cp_unit_to_cp2k
      30             :    USE input_constants, ONLY: &
      31             :       default_bfgs_method_id, default_cell_direct_id, default_cell_geo_opt_id, &
      32             :       default_cell_md_id, default_cg_method_id, default_dimer_method_id, &
      33             :       default_lbfgs_method_id, default_minimization_method_id, default_ts_method_id, &
      34             :       do_mc_gemc_npt, do_mc_gemc_nvt, do_mc_traditional, do_mc_virial, fix_none, fix_x, fix_xy, &
      35             :       fix_xz, fix_y, fix_yz, fix_z, fmt_id_pdb, fmt_id_xyz, gaussian, helium_cell_shape_cube, &
      36             :       helium_cell_shape_octahedron, helium_forces_average, helium_forces_last, &
      37             :       helium_mdist_exponential, helium_mdist_gaussian, helium_mdist_linear, &
      38             :       helium_mdist_quadratic, helium_mdist_singlev, helium_mdist_uniform, &
      39             :       helium_sampling_ceperley, helium_sampling_worm, helium_solute_intpot_mwater, helium_solute_intpot_nnp, &
      40             :       helium_solute_intpot_none, integrate_exact, integrate_numeric, ls_2pnt, ls_3pnt, ls_fit, &
      41             :       ls_gold, ls_none, matrix_init_cholesky, matrix_init_diagonal, numerical, perm_cycle, &
      42             :       perm_plain, propagator_pimd, propagator_rpmd, propagator_cmd, transformation_normal, transformation_stage
      43             :    USE input_cp2k_constraints, ONLY: create_constraint_section
      44             :    USE input_cp2k_free_energy, ONLY: create_fe_section
      45             :    USE input_cp2k_md, ONLY: create_md_section
      46             :    USE input_cp2k_motion_print, ONLY: add_format_keyword, &
      47             :                                       create_motion_print_section
      48             :    USE input_cp2k_neb, ONLY: create_band_section
      49             :    USE input_cp2k_subsys, ONLY: create_rng_section
      50             :    USE input_cp2k_thermostats, ONLY: create_coord_section, &
      51             :                                      create_gle_section, &
      52             :                                      create_velocity_section
      53             :    USE input_cp2k_tmc, ONLY: create_TMC_section
      54             :    USE input_keyword_types, ONLY: keyword_create, &
      55             :                                   keyword_release, &
      56             :                                   keyword_type
      57             :    USE input_section_types, ONLY: section_add_keyword, &
      58             :                                   section_add_subsection, &
      59             :                                   section_create, &
      60             :                                   section_release, &
      61             :                                   section_type
      62             :    USE input_val_types, ONLY: integer_t, &
      63             :                               logical_t, &
      64             :                               real_t, &
      65             :                               char_t
      66             :    USE kinds, ONLY: dp
      67             :    USE string_utilities, ONLY: s2a
      68             : #include "../base/base_uses.f90"
      69             : 
      70             :    IMPLICIT NONE
      71             :    PRIVATE
      72             : 
      73             :    LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
      74             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_motion'
      75             : 
      76             :    PUBLIC :: create_motion_section
      77             : 
      78             : CONTAINS
      79             : 
      80             : ! **************************************************************************************************
      81             : !> \brief creates the motion section
      82             : !> \param section the section to be created
      83             : !> \author teo
      84             : ! **************************************************************************************************
      85        8530 :    SUBROUTINE create_motion_section(section)
      86             :       TYPE(section_type), POINTER                        :: section
      87             : 
      88             :       TYPE(section_type), POINTER                        :: subsection
      89             : 
      90        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
      91             :       CALL section_create(section, __LOCATION__, name="motion", &
      92             :                           description="This section defines a set of tool connected with the motion of the nuclei.", &
      93        8530 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
      94             : 
      95        8530 :       NULLIFY (subsection)
      96             : 
      97             :       CALL create_geoopt_section(subsection, __LOCATION__, label="GEO_OPT", &
      98             :                                  description="This section sets the environment of the geometry optimizer.", &
      99             :                                  just_optimizers=.FALSE., &
     100        8530 :                                  use_model_hessian=.TRUE.)
     101        8530 :       CALL section_add_subsection(section, subsection)
     102        8530 :       CALL section_release(subsection)
     103             : 
     104        8530 :       CALL create_cell_opt_section(subsection)
     105        8530 :       CALL section_add_subsection(section, subsection)
     106        8530 :       CALL section_release(subsection)
     107             : 
     108        8530 :       CALL create_shellcore_opt_section(subsection)
     109        8530 :       CALL section_add_subsection(section, subsection)
     110        8530 :       CALL section_release(subsection)
     111             : 
     112        8530 :       CALL create_md_section(subsection)
     113        8530 :       CALL section_add_subsection(section, subsection)
     114        8530 :       CALL section_release(subsection)
     115             : 
     116        8530 :       CALL create_driver_section(subsection)
     117        8530 :       CALL section_add_subsection(section, subsection)
     118        8530 :       CALL section_release(subsection)
     119             : 
     120        8530 :       CALL create_fe_section(subsection)
     121        8530 :       CALL section_add_subsection(section, subsection)
     122        8530 :       CALL section_release(subsection)
     123             : 
     124        8530 :       CALL create_constraint_section(subsection)
     125        8530 :       CALL section_add_subsection(section, subsection)
     126        8530 :       CALL section_release(subsection)
     127             : 
     128        8530 :       CALL create_fp_section(subsection)
     129        8530 :       CALL section_add_subsection(section, subsection)
     130        8530 :       CALL section_release(subsection)
     131             : 
     132        8530 :       CALL create_mc_section(subsection)
     133        8530 :       CALL section_add_subsection(section, subsection)
     134        8530 :       CALL section_release(subsection)
     135             : 
     136        8530 :       CALL create_TMC_section(subsection)
     137        8530 :       CALL section_add_subsection(section, subsection)
     138        8530 :       CALL section_release(subsection)
     139             : 
     140        8530 :       CALL create_pint_section(subsection)
     141        8530 :       CALL section_add_subsection(section, subsection)
     142        8530 :       CALL section_release(subsection)
     143             : 
     144        8530 :       CALL create_band_section(subsection)
     145        8530 :       CALL section_add_subsection(section, subsection)
     146        8530 :       CALL section_release(subsection)
     147             : 
     148        8530 :       CALL create_motion_print_section(subsection)
     149        8530 :       CALL section_add_subsection(section, subsection)
     150        8530 :       CALL section_release(subsection)
     151             : 
     152        8530 :    END SUBROUTINE create_motion_section
     153             : 
     154             : ! **************************************************************************************************
     155             : !> \brief creates the Monte Carlo section
     156             : !> \param section the section to be created
     157             : !> \author matt
     158             : ! **************************************************************************************************
     159        8530 :    SUBROUTINE create_mc_section(section)
     160             :       TYPE(section_type), POINTER                        :: section
     161             : 
     162             :       TYPE(keyword_type), POINTER                        :: keyword
     163             :       TYPE(section_type), POINTER                        :: subsection
     164             : 
     165        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
     166             :       CALL section_create(section, __LOCATION__, name="mc", &
     167             :                           description="This section sets parameters to set up a MonteCarlo calculation.", &
     168        8530 :                           n_keywords=10, n_subsections=2, repeats=.FALSE.)
     169             : 
     170        8530 :       NULLIFY (keyword, subsection)
     171             : 
     172             :       CALL keyword_create(keyword, __LOCATION__, name="NSTEP", &
     173             :                           description="Specifies the number of MC cycles.", &
     174             :                           usage="NSTEP {integer}", &
     175        8530 :                           default_i_val=100)
     176        8530 :       CALL section_add_keyword(section, keyword)
     177        8530 :       CALL keyword_release(keyword)
     178             : 
     179             :       CALL keyword_create(keyword, __LOCATION__, name="IPRINT", &
     180             :                           description="Prints coordinate/cell/etc information every IPRINT steps.", &
     181             :                           usage="IPRINT {integer}", &
     182        8530 :                           default_i_val=1)
     183        8530 :       CALL section_add_keyword(section, keyword)
     184        8530 :       CALL keyword_release(keyword)
     185             : 
     186             :       CALL keyword_create(keyword, __LOCATION__, name="NMOVES", &
     187             :                           description="Specifies the number of classical moves between energy evaluations. ", &
     188             :                           usage="NMOVES {integer}", &
     189        8530 :                           default_i_val=4)
     190        8530 :       CALL section_add_keyword(section, keyword)
     191        8530 :       CALL keyword_release(keyword)
     192             : 
     193             :       CALL keyword_create(keyword, __LOCATION__, name="NSWAPMOVES", &
     194             :                           description="How many insertions to try per swap move.", &
     195             :                           usage="NSWAPMOVES {integer}", &
     196        8530 :                           default_i_val=16)
     197        8530 :       CALL section_add_keyword(section, keyword)
     198        8530 :       CALL keyword_release(keyword)
     199             : 
     200             :       CALL keyword_create(keyword, __LOCATION__, name="LBIAS", &
     201             :                           description="Dictates if we presample moves with a different potential.", &
     202             :                           usage="LBIAS {logical}", &
     203        8530 :                           default_l_val=.FALSE.)
     204        8530 :       CALL section_add_keyword(section, keyword)
     205        8530 :       CALL keyword_release(keyword)
     206             : 
     207             :       CALL keyword_create(keyword, __LOCATION__, name="LSTOP", &
     208             :                           description="Makes nstep in terms of steps, instead of cycles.", &
     209             :                           usage="LSTOP {logical}", &
     210        8530 :                           default_l_val=.FALSE.)
     211        8530 :       CALL section_add_keyword(section, keyword)
     212        8530 :       CALL keyword_release(keyword)
     213             : 
     214             :       CALL keyword_create(keyword, __LOCATION__, name="LDISCRETE", &
     215             :                           description="Changes the volume of the box in discrete steps, one side at a time.", &
     216             :                           usage="LDISCRETE {logical}", &
     217        8530 :                           default_l_val=.FALSE.)
     218        8530 :       CALL section_add_keyword(section, keyword)
     219        8530 :       CALL keyword_release(keyword)
     220             : 
     221             :       CALL keyword_create(keyword, __LOCATION__, name="RCLUS", &
     222             :                           description="The cluster cut off radius in angstroms.", &
     223             :                           usage="RCLUS {real}", &
     224        8530 :                           default_r_val=1.0E0_dp)
     225        8530 :       CALL section_add_keyword(section, keyword)
     226        8530 :       CALL keyword_release(keyword)
     227             : 
     228             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
     229             :                           description="Read initial configuration from restart file.", &
     230             :                           usage="RESTART {logical}", &
     231        8530 :                           default_l_val=.FALSE.)
     232        8530 :       CALL section_add_keyword(section, keyword)
     233        8530 :       CALL keyword_release(keyword)
     234             : 
     235             :       CALL keyword_create( &
     236             :          keyword, __LOCATION__, name="NVIRIAL", &
     237             :          description="Use this many random orientations to compute the second virial coefficient (ENSEMBLE=VIRIAL)", &
     238             :          usage="NVIRIAL {integer}", &
     239        8530 :          default_i_val=1000)
     240        8530 :       CALL section_add_keyword(section, keyword)
     241        8530 :       CALL keyword_release(keyword)
     242             : 
     243             :       CALL keyword_create(keyword, __LOCATION__, name="ENSEMBLE", &
     244             :                           description="Specify the type of simulation", &
     245             :                           usage="PROGRAM (TRADITIONAL|GEMC_NVT|GEMC_NPT|VIRIAL)", &
     246             :                           enum_c_vals=s2a("TRADITIONAL", "GEMC_NVT", "GEMC_NPT", "VIRIAL"), &
     247             :                           enum_i_vals=(/do_mc_traditional, do_mc_gemc_nvt, do_mc_gemc_npt, do_mc_virial/), &
     248        8530 :                           default_i_val=do_mc_traditional)
     249        8530 :       CALL section_add_keyword(section, keyword)
     250        8530 :       CALL keyword_release(keyword)
     251             : 
     252             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_FILE_NAME", &
     253             :                           description="Name of the restart file for MC information.", &
     254             :                           usage="RESTART_FILE_NAME {filename}", &
     255        8530 :                           default_lc_val="")
     256        8530 :       CALL section_add_keyword(section, keyword)
     257        8530 :       CALL keyword_release(keyword)
     258             : 
     259             :       CALL keyword_create(keyword, __LOCATION__, name="MOVES_FILE_NAME", &
     260             :                           description="The file to print the move statistics to.", &
     261             :                           usage="MOVES_FILE_NAME {filename}", &
     262        8530 :                           default_lc_val="")
     263        8530 :       CALL section_add_keyword(section, keyword)
     264        8530 :       CALL keyword_release(keyword)
     265             : 
     266             :       CALL keyword_create(keyword, __LOCATION__, name="MOLECULES_FILE_NAME", &
     267             :                           description="The file to print the number of molecules to.", &
     268             :                           usage="MOLECULES_FILE_NAME {filename}", &
     269        8530 :                           default_lc_val="")
     270        8530 :       CALL section_add_keyword(section, keyword)
     271        8530 :       CALL keyword_release(keyword)
     272             : 
     273             :       CALL keyword_create(keyword, __LOCATION__, name="COORDINATE_FILE_NAME", &
     274             :                           description="The file to print the current coordinates to.", &
     275             :                           usage="COORDINATE_FILE_NAME {filename}", &
     276        8530 :                           default_lc_val="")
     277        8530 :       CALL section_add_keyword(section, keyword)
     278        8530 :       CALL keyword_release(keyword)
     279             : 
     280             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY_FILE_NAME", &
     281             :                           description="The file to print current energies to.", &
     282             :                           usage="ENERGY_FILE_NAME {filename}", &
     283        8530 :                           default_lc_val="")
     284        8530 :       CALL section_add_keyword(section, keyword)
     285        8530 :       CALL keyword_release(keyword)
     286             : 
     287             :       CALL keyword_create(keyword, __LOCATION__, name="DATA_FILE_NAME", &
     288             :                           description="The file to print current configurational info to.", &
     289             :                           usage="DATA_FILE_NAME {filename}", &
     290        8530 :                           default_lc_val="")
     291        8530 :       CALL section_add_keyword(section, keyword)
     292        8530 :       CALL keyword_release(keyword)
     293             : 
     294             :       CALL keyword_create(keyword, __LOCATION__, name="CELL_FILE_NAME", &
     295             :                           description="The file to print current cell length info to.", &
     296             :                           usage="CELL_FILE_NAME {filename}", &
     297        8530 :                           default_lc_val="")
     298        8530 :       CALL section_add_keyword(section, keyword)
     299        8530 :       CALL keyword_release(keyword)
     300             : 
     301             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_DISP_FILE_NAME", &
     302             :                           description="The file to print current maximum displacement info to.", &
     303             :                           usage="MAX_DISP_FILE_NAME {filename}", &
     304        8530 :                           default_lc_val="")
     305        8530 :       CALL section_add_keyword(section, keyword)
     306        8530 :       CALL keyword_release(keyword)
     307             : 
     308             :       CALL keyword_create(keyword, __LOCATION__, name="BOX2_FILE_NAME", &
     309             :                           description="For GEMC, the name of the input file for the other box.", &
     310             :                           usage="BOX2_FILE_NAME {filename}", &
     311        8530 :                           default_lc_val="")
     312        8530 :       CALL section_add_keyword(section, keyword)
     313        8530 :       CALL keyword_release(keyword)
     314             : 
     315             :       CALL keyword_create(keyword, __LOCATION__, name="PRESSURE", &
     316             :                           description="The pressure for NpT simulations, in bar.", &
     317             :                           usage="PRESSURE {real}", &
     318        8530 :                           type_of_var=real_t)
     319        8530 :       CALL section_add_keyword(section, keyword)
     320        8530 :       CALL keyword_release(keyword)
     321             : 
     322             :       CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
     323             :                           description="The temperature of the simulation, in Kelvin.", &
     324             :                           usage="TEMPERATURE {real}", &
     325        8530 :                           type_of_var=real_t)
     326        8530 :       CALL section_add_keyword(section, keyword)
     327        8530 :       CALL keyword_release(keyword)
     328             : 
     329             :       CALL keyword_create( &
     330             :          keyword, __LOCATION__, name="VIRIAL_TEMPS", &
     331             :          description="The temperatures you wish to compute the virial coefficient for.  Only used if ensemble=VIRIAL.", &
     332             :          usage="VIRIAL_TEMPS {real} {real} ... ", &
     333        8530 :          n_var=-1, type_of_var=real_t)
     334        8530 :       CALL section_add_keyword(section, keyword)
     335        8530 :       CALL keyword_release(keyword)
     336             : 
     337             :       CALL keyword_create(keyword, __LOCATION__, name="DISCRETE_STEP", &
     338             :                           description="The size of the discrete volume move step, in angstroms.", &
     339             :                           usage="DISCRETE_STEP {real}", &
     340        8530 :                           default_r_val=1.0E0_dp)
     341        8530 :       CALL section_add_keyword(section, keyword)
     342        8530 :       CALL keyword_release(keyword)
     343             : 
     344             :       CALL keyword_create(keyword, __LOCATION__, name="ETA", &
     345             :                           description="The free energy bias (in Kelvin) for swapping a molecule of each type into this box.", &
     346             :                           usage="ETA {real} {real} ... ", &
     347        8530 :                           n_var=-1, type_of_var=real_t)
     348        8530 :       CALL section_add_keyword(section, keyword)
     349        8530 :       CALL keyword_release(keyword)
     350             : 
     351             :       CALL keyword_create(keyword, __LOCATION__, name="RANDOMTOSKIP", &
     352             :                           description="Number of random numbers from the acceptance/rejection stream to skip", &
     353             :                           usage="RANDOMTOSKIP {integer}", &
     354        8530 :                           default_i_val=0)
     355        8530 :       CALL section_add_keyword(section, keyword)
     356        8530 :       CALL keyword_release(keyword)
     357             : 
     358        8530 :       CALL create_avbmc_section(subsection)
     359        8530 :       CALL section_add_subsection(section, subsection)
     360        8530 :       CALL section_release(subsection)
     361             : 
     362        8530 :       CALL create_move_prob_section(subsection)
     363        8530 :       CALL section_add_subsection(section, subsection)
     364        8530 :       CALL section_release(subsection)
     365             : 
     366        8530 :       CALL create_update_section(subsection)
     367        8530 :       CALL section_add_subsection(section, subsection)
     368        8530 :       CALL section_release(subsection)
     369             : 
     370        8530 :       CALL create_max_disp_section(subsection)
     371        8530 :       CALL section_add_subsection(section, subsection)
     372        8530 :       CALL section_release(subsection)
     373             : 
     374        8530 :    END SUBROUTINE create_mc_section
     375             : 
     376             : ! **************************************************************************************************
     377             : !> \brief ...
     378             : !> \param section will contain the AVBMC parameters for MC
     379             : !> \author matt
     380             : ! **************************************************************************************************
     381        8530 :    SUBROUTINE create_avbmc_section(section)
     382             :       TYPE(section_type), POINTER                        :: section
     383             : 
     384             :       TYPE(keyword_type), POINTER                        :: keyword
     385             : 
     386        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
     387             : 
     388             :       CALL section_create(section, __LOCATION__, name="avbmc", &
     389             :                           description="Parameters for Aggregation Volume Bias Monte Carlo (AVBMC) "// &
     390             :                           "which explores cluster formation and destruction. "// &
     391             :                           "Chen and Siepmann, J. Phys. Chem. B 105, 11275-11282 (2001).", &
     392        8530 :                           n_keywords=5, n_subsections=0, repeats=.FALSE.)
     393             : 
     394        8530 :       NULLIFY (keyword)
     395             : 
     396             :       CALL keyword_create( &
     397             :          keyword, __LOCATION__, name="PBIAS", &
     398             :          description="The probability of swapping to an inner region in an AVBMC swap move for each molecule type.", &
     399             :          usage="PBIAS {real} {real} ... ", &
     400        8530 :          n_var=-1, type_of_var=real_t)
     401        8530 :       CALL section_add_keyword(section, keyword)
     402        8530 :       CALL keyword_release(keyword)
     403             : 
     404             :       CALL keyword_create(keyword, __LOCATION__, name="AVBMC_ATOM", &
     405             :                           description="The target atom for an AVBMC swap move for each molecule type.", &
     406             :                           usage="AVBMC_ATOM {integer} {integer} ... ", &
     407        8530 :                           n_var=-1, type_of_var=integer_t)
     408        8530 :       CALL section_add_keyword(section, keyword)
     409        8530 :       CALL keyword_release(keyword)
     410             : 
     411             :       CALL keyword_create(keyword, __LOCATION__, name="AVBMC_RMIN", &
     412             :                           description="The inner radius for an AVBMC swap move, in angstroms for every molecule type.", &
     413             :                           usage="AVBMC_RMIN {real} {real} ... ", &
     414        8530 :                           n_var=-1, type_of_var=real_t)
     415        8530 :       CALL section_add_keyword(section, keyword)
     416        8530 :       CALL keyword_release(keyword)
     417             : 
     418             :       CALL keyword_create(keyword, __LOCATION__, name="AVBMC_RMAX", &
     419             :                           description="The outer radius for an AVBMC swap move, in angstroms, for every molecule type.", &
     420             :                           usage="AVBMC_RMAX {real} {real} ... ", &
     421        8530 :                           n_var=-1, type_of_var=real_t)
     422        8530 :       CALL section_add_keyword(section, keyword)
     423        8530 :       CALL keyword_release(keyword)
     424             : 
     425        8530 :    END SUBROUTINE create_avbmc_section
     426             : 
     427             : ! **************************************************************************************************
     428             : !> \brief ...
     429             : !> \param section will contain the probabilities for attempting each move
     430             : !>        type in Monte Carlo
     431             : !> \author matt
     432             : ! **************************************************************************************************
     433        8530 :    SUBROUTINE create_move_prob_section(section)
     434             :       TYPE(section_type), POINTER                        :: section
     435             : 
     436             :       TYPE(keyword_type), POINTER                        :: keyword
     437             :       TYPE(section_type), POINTER                        :: subsection
     438             : 
     439        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
     440             : 
     441             :       CALL section_create(section, __LOCATION__, name="move_probabilities", &
     442             :                           description="Parameters for fraction of moves performed for each move type.", &
     443        8530 :                           n_keywords=5, n_subsections=2, repeats=.FALSE.)
     444             : 
     445        8530 :       NULLIFY (keyword, subsection)
     446             : 
     447             :       CALL keyword_create(keyword, __LOCATION__, name="PMHMC", &
     448             :                           description="The probability of attempting a hybrid MC move.", &
     449             :                           usage="PMHMC {real}", &
     450        8530 :                           type_of_var=real_t, default_r_val=0.0E0_dp)
     451        8530 :       CALL section_add_keyword(section, keyword)
     452        8530 :       CALL keyword_release(keyword)
     453             : 
     454             :       CALL keyword_create(keyword, __LOCATION__, name="PMTRANS", &
     455             :                           description="The probability of attempting a molecule translation.", &
     456             :                           usage="PMTRANS {real}", &
     457        8530 :                           type_of_var=real_t)
     458        8530 :       CALL section_add_keyword(section, keyword)
     459        8530 :       CALL keyword_release(keyword)
     460             : 
     461             :       CALL keyword_create(keyword, __LOCATION__, name="PMCLTRANS", &
     462             :                           description="The probability of attempting a cluster translation.", &
     463             :                           usage="PMCLTRANS {real}", &
     464        8530 :                           type_of_var=real_t, default_r_val=0.0E0_dp)
     465        8530 :       CALL section_add_keyword(section, keyword)
     466        8530 :       CALL keyword_release(keyword)
     467             : 
     468             :       CALL keyword_create(keyword, __LOCATION__, name="PMAVBMC", &
     469             :                           description="The probability of attempting an AVBMC swap move.", &
     470             :                           usage="PMAVBMC {real}", &
     471        8530 :                           default_r_val=0.0E0_dp)
     472        8530 :       CALL section_add_keyword(section, keyword)
     473        8530 :       CALL keyword_release(keyword)
     474             : 
     475             :       CALL keyword_create(keyword, __LOCATION__, name="PMTRAION", &
     476             :                           description="The probability of attempting a conformational change.", &
     477             :                           usage="PMTRAION {real}", &
     478        8530 :                           type_of_var=real_t)
     479        8530 :       CALL section_add_keyword(section, keyword)
     480        8530 :       CALL keyword_release(keyword)
     481             : 
     482             :       CALL keyword_create(keyword, __LOCATION__, name="PMSWAP", &
     483             :                           description="The probability of attempting a swap move.", &
     484             :                           usage="PMSWAP {real}", &
     485        8530 :                           type_of_var=real_t, default_r_val=0.0E0_dp)
     486        8530 :       CALL section_add_keyword(section, keyword)
     487        8530 :       CALL keyword_release(keyword)
     488             : 
     489             :       CALL keyword_create(keyword, __LOCATION__, name="PMVOLUME", &
     490             :                           description="The probability of attempting a volume move.", &
     491             :                           usage="PMVOLUME {real}", &
     492        8530 :                           type_of_var=real_t, default_r_val=0.0E0_dp)
     493        8530 :       CALL section_add_keyword(section, keyword)
     494        8530 :       CALL keyword_release(keyword)
     495             : 
     496        8530 :       CALL create_mol_prob_section(subsection)
     497        8530 :       CALL section_add_subsection(section, subsection)
     498        8530 :       CALL section_release(subsection)
     499             : 
     500        8530 :       CALL create_box_prob_section(subsection)
     501        8530 :       CALL section_add_subsection(section, subsection)
     502        8530 :       CALL section_release(subsection)
     503             : 
     504        8530 :    END SUBROUTINE create_move_prob_section
     505             : 
     506             : ! **************************************************************************************************
     507             : !> \brief ...
     508             : !> \param section will contain the probabilities for attempting various moves
     509             : !>        on the various molecule types present in the system
     510             : !> \author matt
     511             : ! **************************************************************************************************
     512        8530 :    SUBROUTINE create_mol_prob_section(section)
     513             :       TYPE(section_type), POINTER                        :: section
     514             : 
     515             :       TYPE(keyword_type), POINTER                        :: keyword
     516             : 
     517        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
     518             : 
     519             :       CALL section_create(section, __LOCATION__, name="mol_probabilities", &
     520             :                           description="Probabilities of attempting various moves types on "// &
     521             :                           "the various molecular types present in the simulation.", &
     522        8530 :                           n_keywords=5, n_subsections=0, repeats=.FALSE.)
     523             : 
     524        8530 :       NULLIFY (keyword)
     525             : 
     526             :       CALL keyword_create(keyword, __LOCATION__, name="PMAVBMC_MOL", &
     527             :                           description="The probability of attempting an AVBMC swap move on each molecule type.", &
     528             :                           usage="PMAVBMC_MOL {real} {real} ... ", &
     529        8530 :                           n_var=-1, type_of_var=real_t)
     530        8530 :       CALL section_add_keyword(section, keyword)
     531        8530 :       CALL keyword_release(keyword)
     532             : 
     533             :       CALL keyword_create(keyword, __LOCATION__, name="PMSWAP_MOL", &
     534             :                           description="The probability of attempting a molecule swap of a given molecule type.", &
     535             :                           usage="PMSWAP_MOL {real} {real} ... ", &
     536        8530 :                           n_var=-1, type_of_var=real_t)
     537        8530 :       CALL section_add_keyword(section, keyword)
     538        8530 :       CALL keyword_release(keyword)
     539             : 
     540             :       CALL keyword_create(keyword, __LOCATION__, name="PMROT_MOL", &
     541             :                           description="The probability of attempting a molecule rotation of a given molecule type.", &
     542             :                           usage="PMROT_MOL {real} {real} ... ", &
     543        8530 :                           n_var=-1, type_of_var=real_t)
     544        8530 :       CALL section_add_keyword(section, keyword)
     545        8530 :       CALL keyword_release(keyword)
     546             : 
     547             :       CALL keyword_create(keyword, __LOCATION__, name="PMTRAION_MOL", &
     548             :                           description="The probability of attempting a conformational change of a given molecule type.", &
     549             :                           usage="PMTRAION_MOL {real} {real} ... ", &
     550        8530 :                           n_var=-1, type_of_var=real_t)
     551        8530 :       CALL section_add_keyword(section, keyword)
     552        8530 :       CALL keyword_release(keyword)
     553             : 
     554             :       CALL keyword_create(keyword, __LOCATION__, name="PMTRANS_MOL", &
     555             :                           description="The probability of attempting a molecule translation of a given molecule type.", &
     556             :                           usage="PMTRANS_MOL {real} {real} ... ", &
     557        8530 :                           n_var=-1, type_of_var=real_t)
     558        8530 :       CALL section_add_keyword(section, keyword)
     559        8530 :       CALL keyword_release(keyword)
     560             : 
     561        8530 :    END SUBROUTINE create_mol_prob_section
     562             : 
     563             : ! **************************************************************************************************
     564             : !> \brief ...
     565             : !> \param section will contain the probabilities for attempting various moves
     566             : !>        on the box where the variable is present
     567             : !> \author matt
     568             : ! **************************************************************************************************
     569        8530 :    SUBROUTINE create_box_prob_section(section)
     570             :       TYPE(section_type), POINTER                        :: section
     571             : 
     572             :       TYPE(keyword_type), POINTER                        :: keyword
     573             : 
     574        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
     575             : 
     576             :       CALL section_create(section, __LOCATION__, name="BOX_PROBABILITIES", &
     577             :                           description="Probabilities of attempting various moves types on "// &
     578             :                           "the box.", &
     579        8530 :                           n_keywords=2, n_subsections=0, repeats=.FALSE.)
     580             : 
     581        8530 :       NULLIFY (keyword)
     582             : 
     583             :       CALL keyword_create(keyword, __LOCATION__, name="PMHMC_BOX", &
     584             :                           description="The probability of attempting a HMC move on this box.", &
     585             :                           usage="PMHMC_BOX {real}", &
     586        8530 :                           type_of_var=real_t, default_r_val=1.0E0_dp)
     587        8530 :       CALL section_add_keyword(section, keyword)
     588        8530 :       CALL keyword_release(keyword)
     589             : 
     590             :       CALL keyword_create(keyword, __LOCATION__, name="PMVOL_BOX", &
     591             :                           description="The probability of attempting a volume move on this box (GEMC_NpT).", &
     592             :                           usage="PMVOL_BOX {real}", &
     593        8530 :                           type_of_var=real_t, default_r_val=1.0E0_dp)
     594        8530 :       CALL section_add_keyword(section, keyword)
     595        8530 :       CALL keyword_release(keyword)
     596             : 
     597             :       CALL keyword_create(keyword, __LOCATION__, name="PMCLUS_BOX", &
     598             :                           description="The probability of attempting a cluster move in this box", &
     599             :                           usage="PMCLUS_BOX {real}", &
     600        8530 :                           type_of_var=real_t, default_r_val=1.0E0_dp)
     601        8530 :       CALL section_add_keyword(section, keyword)
     602        8530 :       CALL keyword_release(keyword)
     603             : 
     604        8530 :    END SUBROUTINE create_box_prob_section
     605             : 
     606             : ! **************************************************************************************************
     607             : !> \brief ...
     608             : !> \param section will contain the frequency for updating maximum
     609             : !>        displacements for various moves
     610             : !> \author matt
     611             : ! **************************************************************************************************
     612        8530 :    SUBROUTINE create_update_section(section)
     613             :       TYPE(section_type), POINTER                        :: section
     614             : 
     615             :       TYPE(keyword_type), POINTER                        :: keyword
     616             : 
     617        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
     618             : 
     619             :       CALL section_create(section, __LOCATION__, name="MOVE_UPDATES", &
     620             :                           description="Frequency for updating move maximum displacements.", &
     621        8530 :                           n_keywords=2, n_subsections=0, repeats=.FALSE.)
     622             : 
     623        8530 :       NULLIFY (keyword)
     624             : 
     625             :       CALL keyword_create(keyword, __LOCATION__, name="IUPVOLUME", &
     626             :                           description="Every iupvolume steps update maximum volume displacement.", &
     627             :                           usage="IUPVOLUME {integer}", &
     628        8530 :                           default_i_val=10000)
     629        8530 :       CALL section_add_keyword(section, keyword)
     630        8530 :       CALL keyword_release(keyword)
     631             : 
     632             :       CALL keyword_create(keyword, __LOCATION__, name="IUPTRANS", &
     633             :                           description="Every iuptrans steps update maximum "// &
     634             :                           "translation/rotation/configurational changes.", &
     635             :                           usage="IUPTRANS {integer}", &
     636        8530 :                           default_i_val=10000)
     637        8530 :       CALL section_add_keyword(section, keyword)
     638        8530 :       CALL keyword_release(keyword)
     639             : 
     640             :       CALL keyword_create(keyword, __LOCATION__, name="IUPCLTRANS", &
     641             :                           description="Every iupcltrans steps update maximum cluster translation.", &
     642             :                           usage="IUPCLTRANS {integer}", &
     643        8530 :                           default_i_val=10000)
     644        8530 :       CALL section_add_keyword(section, keyword)
     645        8530 :       CALL keyword_release(keyword)
     646             : 
     647        8530 :    END SUBROUTINE create_update_section
     648             : 
     649             : ! **************************************************************************************************
     650             : !> \brief ...
     651             : !> \param section will contain the maximum displacements for various moves
     652             : !> \author matt
     653             : ! **************************************************************************************************
     654        8530 :    SUBROUTINE create_max_disp_section(section)
     655             :       TYPE(section_type), POINTER                        :: section
     656             : 
     657             :       TYPE(section_type), POINTER                        :: subsection
     658             : 
     659        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
     660             : 
     661             :       CALL section_create(section, __LOCATION__, name="max_displacements", &
     662             :                           description="The maximum displacements for all attempted moves.", &
     663        8530 :                           n_keywords=1, n_subsections=2, repeats=.FALSE.)
     664             : 
     665        8530 :       NULLIFY (subsection)
     666             : 
     667        8530 :       CALL create_mol_disp_section(subsection)
     668        8530 :       CALL section_add_subsection(section, subsection)
     669        8530 :       CALL section_release(subsection)
     670             : 
     671        8530 :       CALL create_box_disp_section(subsection)
     672        8530 :       CALL section_add_subsection(section, subsection)
     673        8530 :       CALL section_release(subsection)
     674             : 
     675        8530 :    END SUBROUTINE create_max_disp_section
     676             : 
     677             : ! **************************************************************************************************
     678             : !> \brief ...
     679             : !> \param section will contain the maximum displacements for all moves which
     680             : !>        require a value for each molecule type
     681             : !> \author matt
     682             : ! **************************************************************************************************
     683        8530 :    SUBROUTINE create_mol_disp_section(section)
     684             :       TYPE(section_type), POINTER                        :: section
     685             : 
     686             :       TYPE(keyword_type), POINTER                        :: keyword
     687             : 
     688        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
     689             : 
     690             :       CALL section_create(section, __LOCATION__, name="mol_displacements", &
     691             :                           description="Maximum displacements for every move type that requires "// &
     692             :                           "a value for each molecular type in the simulation.", &
     693        8530 :                           n_keywords=5, n_subsections=0, repeats=.FALSE.)
     694             : 
     695        8530 :       NULLIFY (keyword)
     696             : 
     697             :       CALL keyword_create(keyword, __LOCATION__, name="RMBOND", &
     698             :                           description="Maximum bond length displacement, in angstroms, for each molecule type.", &
     699             :                           usage="RMBOND {real} {real} ... ", &
     700        8530 :                           n_var=-1, type_of_var=real_t)
     701        8530 :       CALL section_add_keyword(section, keyword)
     702        8530 :       CALL keyword_release(keyword)
     703             : 
     704             :       CALL keyword_create(keyword, __LOCATION__, name="RMANGLE", &
     705             :                           description="Maximum bond angle displacement, in degrees, for each molecule type.", &
     706             :                           usage="RMANGLE {real} {real} ...", &
     707        8530 :                           n_var=-1, type_of_var=real_t)
     708        8530 :       CALL section_add_keyword(section, keyword)
     709        8530 :       CALL keyword_release(keyword)
     710             : 
     711             :       CALL keyword_create(keyword, __LOCATION__, name="RMDIHEDRAL", &
     712             :                           description="Maximum dihedral angle distplacement, in degrees, for each molecule type.", &
     713             :                           usage="RMDIHEDRAL {real} {real} ... ", &
     714        8530 :                           n_var=-1, type_of_var=real_t)
     715        8530 :       CALL section_add_keyword(section, keyword)
     716        8530 :       CALL keyword_release(keyword)
     717             : 
     718             :       CALL keyword_create(keyword, __LOCATION__, name="RMROT", &
     719             :                           description="Maximum rotational displacement, in degrees, for each molecule type.", &
     720             :                           usage="RMROT {real} {real} ... ", &
     721        8530 :                           n_var=-1, type_of_var=real_t)
     722        8530 :       CALL section_add_keyword(section, keyword)
     723        8530 :       CALL keyword_release(keyword)
     724             : 
     725             :       CALL keyword_create(keyword, __LOCATION__, name="RMTRANS", &
     726             :                           description="Maximum translational displacement, in angstroms, for each molecule type.", &
     727             :                           usage="RMTRANS {real} {real} ...", &
     728        8530 :                           n_var=-1, type_of_var=real_t)
     729        8530 :       CALL section_add_keyword(section, keyword)
     730        8530 :       CALL keyword_release(keyword)
     731             : 
     732        8530 :    END SUBROUTINE create_mol_disp_section
     733             : 
     734             : ! **************************************************************************************************
     735             : !> \brief ...
     736             : !> \param section will contain the maximum displacements for any move that
     737             : !>        is done on each simulation box
     738             : !> \author matt
     739             : ! **************************************************************************************************
     740        8530 :    SUBROUTINE create_box_disp_section(section)
     741             :       TYPE(section_type), POINTER                        :: section
     742             : 
     743             :       TYPE(keyword_type), POINTER                        :: keyword
     744             : 
     745        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
     746             : 
     747             :       CALL section_create(section, __LOCATION__, name="BOX_DISPLACEMENTS", &
     748             :                           description="Maximum displacements for any move that is performed on each"// &
     749             :                           " simulation box.", &
     750        8530 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     751             : 
     752        8530 :       NULLIFY (keyword)
     753             : 
     754             :       CALL keyword_create(keyword, __LOCATION__, name="RMVOLUME", &
     755             :                           description="Maximum volume displacement, in angstrom**3.", &
     756             :                           usage="RMVOLUME {real}", &
     757        8530 :                           type_of_var=real_t)
     758        8530 :       CALL section_add_keyword(section, keyword)
     759        8530 :       CALL keyword_release(keyword)
     760             : 
     761             :       CALL keyword_create(keyword, __LOCATION__, name="RMCLTRANS", &
     762             :                           description="Maximum translational displacement, in angstroms, for each cluster.", &
     763             :                           usage="RMCLTRANS {real}", &
     764        8530 :                           default_r_val=1.0E0_dp)
     765        8530 :       CALL section_add_keyword(section, keyword)
     766        8530 :       CALL keyword_release(keyword)
     767             : 
     768        8530 :    END SUBROUTINE create_box_disp_section
     769             : 
     770             : ! **************************************************************************************************
     771             : !> \brief creates the geometry optimization section
     772             : !> \param section the section to be created
     773             : !> \param location ...
     774             : !> \param label ...
     775             : !> \param description ...
     776             : !> \param just_optimizers ...
     777             : !> \param use_model_hessian ...
     778             : !> \par History
     779             : !>      01.2020 keywords related to Space Group Symmetry added [pcazade]
     780             : !> \author teo
     781             : ! **************************************************************************************************
     782       34120 :    RECURSIVE SUBROUTINE create_geoopt_section(section, location, label, description, just_optimizers, use_model_hessian)
     783             :       TYPE(section_type), POINTER                        :: section
     784             :       CHARACTER(LEN=*), INTENT(IN)                       :: location, label, description
     785             :       LOGICAL, INTENT(IN)                                :: just_optimizers, use_model_hessian
     786             : 
     787             :       TYPE(keyword_type), POINTER                        :: keyword
     788             :       TYPE(section_type), POINTER                        :: print_key, subsection
     789             : 
     790       34120 :       CPASSERT(.NOT. ASSOCIATED(section))
     791             :       CALL section_create(section, location=location, name=label, description=description, &
     792       34120 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
     793             : 
     794       34120 :       NULLIFY (keyword)
     795       34120 :       IF (.NOT. just_optimizers) THEN
     796             :          CALL keyword_create(keyword, __LOCATION__, name="TYPE", &
     797             :                              description="Specify which kind of geometry optimization to perform", &
     798             :                              usage="TYPE (MINIMIZATION|TRANSITION_STATE)", &
     799             :                              enum_c_vals=s2a("MINIMIZATION", "TRANSITION_STATE"), &
     800             :                              enum_desc=s2a("Performs a geometry minimization.", &
     801             :                                            "Performs a transition state optimization."), &
     802             :                              enum_i_vals=(/default_minimization_method_id, default_ts_method_id/), &
     803        8530 :                              default_i_val=default_minimization_method_id)
     804        8530 :          CALL section_add_keyword(section, keyword)
     805        8530 :          CALL keyword_release(keyword)
     806             :       END IF
     807             : 
     808             :       CALL keyword_create( &
     809             :          keyword, __LOCATION__, name="OPTIMIZER", &
     810             :          variants=(/"MINIMIZER"/), &
     811             :          citations=(/Byrd1995/), &
     812             :          description="Specify which method to use to perform a geometry optimization.", &
     813             :          usage="OPTIMIZER {BFGS|LBFGS|CG}", &
     814             :          enum_c_vals=s2a("BFGS", "LBFGS", "CG"), &
     815             :          enum_desc=s2a("Most efficient minimizer, but only for 'small' systems, "// &
     816             :                        "as it relies on diagonalization of a full Hessian matrix", &
     817             :                        "Limited-memory variant of BFGS suitable for large systems. "// &
     818             :                        "Not as well fine-tuned but can be more robust.", &
     819             :                        "conjugate gradients, robust minimizer (depending on the line search) also OK for large systems"), &
     820             :          enum_i_vals=(/default_bfgs_method_id, default_lbfgs_method_id, default_cg_method_id/), &
     821      102360 :          default_i_val=default_bfgs_method_id)
     822       34120 :       CALL section_add_keyword(section, keyword)
     823       34120 :       CALL keyword_release(keyword)
     824             : 
     825             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
     826             :                           description="Specifies the maximum number of geometry optimization steps. "// &
     827             :                           "One step might imply several force evaluations for the CG and LBFGS optimizers.", &
     828             :                           usage="MAX_ITER {integer}", &
     829       34120 :                           default_i_val=200)
     830       34120 :       CALL section_add_keyword(section, keyword)
     831       34120 :       CALL keyword_release(keyword)
     832             : 
     833             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_DR", &
     834             :                           description="Convergence criterion for the maximum geometry change "// &
     835             :                           "between the current and the last optimizer iteration.", &
     836             :                           usage="MAX_DR {real}", &
     837       34120 :                           default_r_val=0.0030_dp, unit_str="bohr")
     838       34120 :       CALL section_add_keyword(section, keyword)
     839       34120 :       CALL keyword_release(keyword)
     840             : 
     841             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_FORCE", &
     842             :                           description="Convergence criterion for the maximum force component of the current configuration.", &
     843             :                           usage="MAX_FORCE {real}", &
     844       34120 :                           default_r_val=0.00045_dp, unit_str="hartree/bohr")
     845       34120 :       CALL section_add_keyword(section, keyword)
     846       34120 :       CALL keyword_release(keyword)
     847             : 
     848             :       CALL keyword_create(keyword, __LOCATION__, name="RMS_DR", &
     849             :                           description="Convergence criterion for the root mean square (RMS) geometry"// &
     850             :                           " change between the current and the last optimizer iteration.", &
     851             :                           usage="RMS_DR {real}", unit_str="bohr", &
     852       34120 :                           default_r_val=0.0015_dp)
     853       34120 :       CALL section_add_keyword(section, keyword)
     854       34120 :       CALL keyword_release(keyword)
     855             : 
     856             :       CALL keyword_create(keyword, __LOCATION__, name="RMS_FORCE", &
     857             :                           description="Convergence criterion for the root mean square (RMS) force of the current configuration.", &
     858             :                           usage="RMS_FORCE {real}", unit_str="hartree/bohr", &
     859       34120 :                           default_r_val=0.00030_dp)
     860       34120 :       CALL section_add_keyword(section, keyword)
     861       34120 :       CALL keyword_release(keyword)
     862             : 
     863             :       CALL keyword_create(keyword, __LOCATION__, name="step_start_val", &
     864             :                           description="The starting step value for the "//TRIM(label)//" module.", &
     865       34120 :                           usage="step_start_val <integer>", default_i_val=0)
     866       34120 :       CALL section_add_keyword(section, keyword)
     867       34120 :       CALL keyword_release(keyword)
     868             : 
     869             :       ! collects keywords related to Space Group Symmetry
     870             :       CALL keyword_create( &
     871             :          keyword, __LOCATION__, name="KEEP_SPACE_GROUP", &
     872             :          description="Detect space group of the system and preserve it during optimization. "// &
     873             :          "The space group symmetry is applied to coordinates, forces, and the stress tensor. "// &
     874             :          "It works for supercell. It does not affect/reduce computational cost. "// &
     875             :          "Use EPS_SYMMETRY to adjust the detection threshold.", &
     876             :          usage="KEEP_SPACE_GROUP .TRUE.", &
     877       34120 :          default_l_val=.FALSE., lone_keyword_l_val=.TRUE., repeats=.FALSE.)
     878       34120 :       CALL section_add_keyword(section, keyword)
     879       34120 :       CALL keyword_release(keyword)
     880             : 
     881             :       ! collects keywords related to precision for finding the space group
     882             :       CALL keyword_create( &
     883             :          keyword, __LOCATION__, name="EPS_SYMMETRY", &
     884             :          description="Accuracy for space group determination. EPS_SYMMETRY is dimensionless. "// &
     885             :        "Roughly speaking, two scaled (fractional) atomic positions v1, v2 are considered identical if |v1 - v2| < EPS_SYMMETRY. ", &
     886             :          usage="EPS_SYMMETRY {REAL}", &
     887       34120 :          default_r_val=1.e-4_dp, repeats=.FALSE.)
     888       34120 :       CALL section_add_keyword(section, keyword)
     889       34120 :       CALL keyword_release(keyword)
     890             : 
     891             :       ! collects keywords related to reduction of symmetry due to an external field
     892             :       CALL keyword_create( &
     893             :          keyword, __LOCATION__, name="SYMM_REDUCTION", &
     894             :          description="Direction of the external static electric field. "// &
     895             :          "Some symmetry operations are not compatible with the direction of an electric field. "// &
     896             :          "These operations are used when enforcing the space group.", &
     897             :          usage="SYMM_REDUCTION  0.0 0.0 0.0", &
     898             :          repeats=.FALSE., n_var=3, &
     899       34120 :          type_of_var=real_t, default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/))
     900       34120 :       CALL section_add_keyword(section, keyword)
     901       34120 :       CALL keyword_release(keyword)
     902             : 
     903             :       ! collects keywords related to ranges of atoms to symmetrize
     904             :       CALL keyword_create( &
     905             :          keyword, __LOCATION__, name="SYMM_EXCLUDE_RANGE", &
     906             :          description="Range of atoms to exclude from space group symmetry. "// &
     907             :          "These atoms are excluded from both identification and enforcement. "// &
     908             :          "This keyword can be repeated.", &
     909       34120 :          repeats=.TRUE., usage="SYMM_EXCLUDE_RANGE {Int} {Int}", type_of_var=integer_t, n_var=2)
     910       34120 :       CALL section_add_keyword(section, keyword)
     911       34120 :       CALL keyword_release(keyword)
     912             : 
     913             :       CALL keyword_create( &
     914             :          keyword, __LOCATION__, name="SPGR_PRINT_ATOMS", &
     915             :          description="Print equivalent atoms list for each space group symmetry operation.", &
     916       34120 :          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     917       34120 :       CALL section_add_keyword(section, keyword)
     918       34120 :       CALL keyword_release(keyword)
     919             : 
     920       34120 :       CALL create_lbfgs_section(subsection)
     921       34120 :       CALL section_add_subsection(section, subsection)
     922       34120 :       CALL section_release(subsection)
     923             : 
     924       34120 :       CALL create_cg_section(subsection)
     925       34120 :       CALL section_add_subsection(section, subsection)
     926       34120 :       CALL section_release(subsection)
     927             : 
     928       34120 :       CALL create_bfgs_section(subsection, use_model_hessian)
     929       34120 :       CALL section_add_subsection(section, subsection)
     930       34120 :       CALL section_release(subsection)
     931             : 
     932       34120 :       IF (.NOT. just_optimizers) THEN
     933             :          ! Transition states section
     934        8530 :          CALL create_ts_section(subsection)
     935        8530 :          CALL section_add_subsection(section, subsection)
     936        8530 :          CALL section_release(subsection)
     937             : 
     938             :          ! Create the PRINT subsection
     939        8530 :          NULLIFY (subsection)
     940             :          CALL section_create(subsection, __LOCATION__, name="PRINT", &
     941             :                              description="Controls the printing properties during a geometry optimization run", &
     942        8530 :                              n_keywords=0, n_subsections=1, repeats=.TRUE.)
     943        8530 :          NULLIFY (print_key)
     944             :          CALL cp_print_key_section_create( &
     945             :             print_key, __LOCATION__, "program_run_info", &
     946             :             description="Controls the printing of basic information during the Geometry Optimization", &
     947        8530 :             print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     948        8530 :          CALL section_add_subsection(subsection, print_key)
     949        8530 :          CALL section_release(print_key)
     950        8530 :          CALL section_add_subsection(section, subsection)
     951        8530 :          CALL section_release(subsection)
     952             :       END IF
     953             : 
     954       34120 :    END SUBROUTINE create_geoopt_section
     955             : 
     956             : ! **************************************************************************************************
     957             : !> \brief creates the section for the shell-core optimization
     958             : !> \param section the section to be created
     959             : !> \author Caino
     960             : ! **************************************************************************************************
     961        8530 :    SUBROUTINE create_shellcore_opt_section(section)
     962             :       TYPE(section_type), POINTER                        :: section
     963             : 
     964             :       TYPE(section_type), POINTER                        :: print_key, subsection
     965             : 
     966             :       CALL create_geoopt_section( &
     967             :          section, __LOCATION__, label="SHELL_OPT", &
     968             :          description="This section sets the environment for the optimization of the shell-core distances"// &
     969             :          " that might turn to be necessary along a MD run using a shell-model potential."// &
     970             :          " The optimization procedure is activated when at least one of the shell-core"// &
     971             :          " pairs becomes too elongated, i.e. when the assumption of point dipole is not longer valid.", &
     972             :          just_optimizers=.TRUE., &
     973        8530 :          use_model_hessian=.FALSE.)
     974             : 
     975        8530 :       NULLIFY (print_key, subsection)
     976             : 
     977             :       ! Create the PRINT subsection
     978             :       NULLIFY (subsection)
     979             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
     980             :                           description="Controls the printing properties during a shell-core optimization procedure", &
     981        8530 :                           n_keywords=0, n_subsections=1, repeats=.TRUE.)
     982        8530 :       NULLIFY (print_key)
     983             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
     984             :                                        description="Controls the printing of basic information during the Optimization", &
     985        8530 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     986        8530 :       CALL section_add_subsection(subsection, print_key)
     987        8530 :       CALL section_release(print_key)
     988        8530 :       CALL section_add_subsection(section, subsection)
     989        8530 :       CALL section_release(subsection)
     990             : 
     991        8530 :    END SUBROUTINE create_shellcore_opt_section
     992             : 
     993             : ! **************************************************************************************************
     994             : !> \brief creates the section for the cell optimization
     995             : !> \param section the section to be created
     996             : !> \author Teodoro Laino [tlaino] - University of Zurich - 03.2008
     997             : ! **************************************************************************************************
     998        8530 :    SUBROUTINE create_cell_opt_section(section)
     999             :       TYPE(section_type), POINTER                        :: section
    1000             : 
    1001             :       TYPE(keyword_type), POINTER                        :: keyword
    1002             :       TYPE(section_type), POINTER                        :: print_key, subsection
    1003             : 
    1004             :       CALL create_geoopt_section(section, __LOCATION__, label="CELL_OPT", &
    1005             :                                  description="This section sets the environment for the optimization of the simulation cell."// &
    1006             :                                  " Two possible schemes are available: (1) Zero temperature optimization;"// &
    1007             :                                  " (2) Finite temperature optimization.", &
    1008             :                                  just_optimizers=.TRUE., &
    1009        8530 :                                  use_model_hessian=.FALSE.)
    1010             : 
    1011        8530 :       NULLIFY (keyword, print_key, subsection)
    1012             :       CALL keyword_create( &
    1013             :          keyword, __LOCATION__, name="TYPE", &
    1014             :          description="Specify which kind of method to use for the optimization of the simulation cell", &
    1015             :          usage="TYPE (GEO_OPT|MD|DIRECT_CELL_OPT)", &
    1016             :          enum_c_vals=s2a("GEO_OPT", "MD", "DIRECT_CELL_OPT"), &
    1017             :          enum_desc=s2a( &
    1018             :          "Performs a geometry optimization (the GEO_OPT section must be defined) between cell optimization steps."// &
    1019             :          " The stress tensor is computed at the optimized geometry.", &
    1020             :          "Performs a molecular dynamics run (the MD section needs must defined) for computing the stress tensor"// &
    1021             :          " used for the cell optimization.", &
    1022             :          "Performs a geometry and cell optimization at the same time."// &
    1023             :          " The stress tensor is computed at every step"), &
    1024             :          enum_i_vals=(/default_cell_geo_opt_id, default_cell_md_id, default_cell_direct_id/), &
    1025        8530 :          default_i_val=default_cell_direct_id)
    1026        8530 :       CALL section_add_keyword(section, keyword)
    1027        8530 :       CALL keyword_release(keyword)
    1028             : 
    1029             :       CALL keyword_create( &
    1030             :          keyword, __LOCATION__, name="EXTERNAL_PRESSURE", &
    1031             :          description="Specifies the external pressure (1 value or the full 9 components of the pressure tensor) "// &
    1032             :          "applied during the cell optimization.", &
    1033             :          usage="EXTERNAL_PRESSURE {REAL} .. {REAL}", unit_str="bar", &
    1034             :          default_r_vals=(/cp_unit_to_cp2k(100.0_dp, "bar"), 0.0_dp, 0.0_dp, &
    1035             :                           0.0_dp, cp_unit_to_cp2k(100.0_dp, "bar"), 0.0_dp, &
    1036       85300 :                           0.0_dp, 0.0_dp, cp_unit_to_cp2k(100.0_dp, "bar")/), n_var=-1)
    1037        8530 :       CALL section_add_keyword(section, keyword)
    1038        8530 :       CALL keyword_release(keyword)
    1039             : 
    1040             :       CALL keyword_create( &
    1041             :          keyword, __LOCATION__, name="KEEP_ANGLES", &
    1042             :          description="Keep angles between the cell vectors constant, but allow the lengths of the"// &
    1043             :          " cell vectors to change independently."// &
    1044             :          " Albeit general, this is most useful for triclinic cells, to enforce higher symmetry, see KEEP_SYMMETRY.", &
    1045        8530 :          usage="KEEP_ANGLES TRUE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1046        8530 :       CALL section_add_keyword(section, keyword)
    1047        8530 :       CALL keyword_release(keyword)
    1048             : 
    1049             :       CALL keyword_create(keyword, __LOCATION__, name="KEEP_SYMMETRY", &
    1050             :                           description="Keep the requested initial cell symmetry (e.g. during a cell optimisation). "// &
    1051             :                           "The initial symmetry must be specified in the &CELL section.", &
    1052        8530 :                           usage="KEEP_SYMMETRY yes", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1053        8530 :       CALL section_add_keyword(section, keyword)
    1054        8530 :       CALL keyword_release(keyword)
    1055             : 
    1056             :       CALL keyword_create( &
    1057             :          keyword, __LOCATION__, name="CONSTRAINT", &
    1058             :          description="Imposes a constraint on the pressure tensor by fixing the specified cell components.", &
    1059             :          usage="CONSTRAINT (none|x|y|z|xy|xz|yz)", &
    1060             :          enum_desc=s2a("Fix nothing", &
    1061             :                        "Fix only x component", &
    1062             :                        "Fix only y component", &
    1063             :                        "Fix only z component", &
    1064             :                        "Fix x and y component", &
    1065             :                        "Fix x and z component", &
    1066             :                        "Fix y and z component"), &
    1067             :          enum_c_vals=s2a("NONE", "X", "Y", "Z", "XY", "XZ", "YZ"), &
    1068             :          enum_i_vals=(/fix_none, fix_x, fix_y, fix_z, fix_xy, fix_xz, fix_yz/), &
    1069        8530 :          default_i_val=fix_none)
    1070        8530 :       CALL section_add_keyword(section, keyword)
    1071        8530 :       CALL keyword_release(keyword)
    1072             : 
    1073             :       CALL keyword_create(keyword, __LOCATION__, name="PRESSURE_TOLERANCE", &
    1074             :                           description="Specifies the Pressure tolerance (compared to the external pressure) to achieve "// &
    1075             :                           "during the cell optimization.", &
    1076             :                           usage="PRESSURE_TOLERANCE {REAL}", unit_str="bar", &
    1077        8530 :                           default_r_val=cp_unit_to_cp2k(100.0_dp, "bar"))
    1078        8530 :       CALL section_add_keyword(section, keyword)
    1079        8530 :       CALL keyword_release(keyword)
    1080             : 
    1081             :       ! Create the PRINT subsection
    1082        8530 :       NULLIFY (subsection)
    1083             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1084             :                           description="Controls the printing properties during a geometry optimization run", &
    1085        8530 :                           n_keywords=0, n_subsections=1, repeats=.TRUE.)
    1086        8530 :       NULLIFY (print_key)
    1087             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
    1088             :                                        description="Controls the printing of basic information during the Geometry Optimization", &
    1089        8530 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
    1090        8530 :       CALL section_add_subsection(subsection, print_key)
    1091        8530 :       CALL section_release(print_key)
    1092             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "cell", &
    1093             :                               description="Controls the printing of the cell eveytime a calculation using a new cell is started.", &
    1094             :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__", &
    1095        8530 :                                        unit_str="angstrom")
    1096        8530 :       CALL section_add_subsection(subsection, print_key)
    1097        8530 :       CALL section_release(print_key)
    1098        8530 :       CALL section_add_subsection(section, subsection)
    1099        8530 :       CALL section_release(subsection)
    1100             : 
    1101        8530 :    END SUBROUTINE create_cell_opt_section
    1102             : 
    1103             : ! **************************************************************************************************
    1104             : !> \brief creates the section for tuning transition states search
    1105             : !> \param section the section to be created
    1106             : !> \author Teodoro Laino [tlaino] - University of Zurich - 01.2008
    1107             : ! **************************************************************************************************
    1108        8530 :    SUBROUTINE create_ts_section(section)
    1109             :       TYPE(section_type), POINTER                        :: section
    1110             : 
    1111             :       TYPE(keyword_type), POINTER                        :: keyword
    1112             :       TYPE(section_type), POINTER                        :: print_key, subsection, subsection2, &
    1113             :                                                             subsection3
    1114             : 
    1115             : ! Create the Transition State subsection
    1116             : 
    1117        8530 :       NULLIFY (section, keyword, subsection, subsection2)
    1118             :       CALL section_create(section, __LOCATION__, name="TRANSITION_STATE", &
    1119             :                           description="Specifies parameters to perform a transition state search", &
    1120        8530 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    1121             : 
    1122             :       CALL keyword_create(keyword, __LOCATION__, name="METHOD", &
    1123             :                           description="Specify which kind of method to use for locating transition states", &
    1124             :                           citations=(/Henkelman1999/), &
    1125             :                           usage="TYPE (DIMER)", &
    1126             :                           enum_c_vals=s2a("DIMER"), &
    1127             :                           enum_desc=s2a("Uses the dimer method to optimize transition states."), &
    1128             :                           enum_i_vals=(/default_dimer_method_id/), &
    1129       17060 :                           default_i_val=default_dimer_method_id)
    1130        8530 :       CALL section_add_keyword(section, keyword)
    1131        8530 :       CALL keyword_release(keyword)
    1132             : 
    1133             :       CALL section_create(subsection, __LOCATION__, name="DIMER", &
    1134             :                           description="Specifies parameters for Dimer Method", &
    1135        8530 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    1136             : 
    1137             :       CALL keyword_create(keyword, __LOCATION__, name="DR", &
    1138             :                           description="This keyword sets the value for the DR parameter.", &
    1139             :                           usage="DR {real}", unit_str='angstrom', &
    1140        8530 :                           default_r_val=cp_unit_to_cp2k(0.01_dp, "angstrom"))
    1141        8530 :       CALL section_add_keyword(subsection, keyword)
    1142        8530 :       CALL keyword_release(keyword)
    1143             : 
    1144             :       CALL keyword_create(keyword, __LOCATION__, name="INTERPOLATE_GRADIENT", &
    1145             :                           description="This keyword controls the interpolation of the gradient whenever possible"// &
    1146             :                           " during the optimization of the Dimer. The use of this keywords saves 1 evaluation"// &
    1147             :                           " of energy/forces.", usage="INTERPOLATE_GRADIENT {logical}", default_l_val=.TRUE., &
    1148        8530 :                           lone_keyword_l_val=.TRUE.)
    1149        8530 :       CALL section_add_keyword(subsection, keyword)
    1150        8530 :       CALL keyword_release(keyword)
    1151             : 
    1152             :       CALL keyword_create(keyword, __LOCATION__, name="ANGLE_TOLERANCE", &
    1153             :                           description="This keyword sets the value of the tolerance angle for the line search"// &
    1154             :                           " performed to optimize the orientation of the dimer.", &
    1155             :                           usage="ANGLE_TOL {real}", unit_str='rad', &
    1156        8530 :                           default_r_val=cp_unit_to_cp2k(5.0_dp, "deg"))
    1157        8530 :       CALL section_add_keyword(subsection, keyword)
    1158        8530 :       CALL keyword_release(keyword)
    1159             : 
    1160             :       CALL keyword_create(keyword, __LOCATION__, name="K-DIMER", &
    1161             :                           description="This keyword activates the constrained k-dimer translation"// &
    1162             :                           " J. Chem. Phys. 141, 164111 (2014).", &
    1163             :                           citations=(/Henkelman2014/), &
    1164             :                           usage="K-DIMER {logica}", &
    1165             :                           default_l_val=.FALSE., &
    1166       17060 :                           lone_keyword_l_val=.FALSE.)
    1167        8530 :       CALL section_add_keyword(subsection, keyword)
    1168        8530 :       CALL keyword_release(keyword)
    1169             : 
    1170             :       CALL keyword_create(keyword, __LOCATION__, name="BETA", &
    1171             :                           description="Exponential factor for the switching function used in K-DIMER", &
    1172             :                           usage="BETA {real}", &
    1173             :                           default_r_val=5.0_dp, &
    1174        8530 :                           lone_keyword_r_val=5.0_dp)
    1175        8530 :       CALL section_add_keyword(subsection, keyword)
    1176        8530 :       CALL keyword_release(keyword)
    1177             : 
    1178             :       CALL create_geoopt_section( &
    1179             :          subsection2, __LOCATION__, label="ROT_OPT", &
    1180             :          description="This section sets the environment for the optimization of the rotation of the Dimer.", &
    1181             :          just_optimizers=.TRUE., &
    1182        8530 :          use_model_hessian=.FALSE.)
    1183        8530 :       NULLIFY (subsection3)
    1184             :       CALL section_create(subsection3, __LOCATION__, name="PRINT", &
    1185             :                           description="Controls the printing properties during the dimer rotation optimization run", &
    1186        8530 :                           n_keywords=0, n_subsections=1, repeats=.TRUE.)
    1187        8530 :       NULLIFY (print_key)
    1188             : 
    1189             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
    1190             :                                        description="Controls the printing of basic information during the Geometry Optimization", &
    1191        8530 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
    1192        8530 :       CALL section_add_subsection(subsection3, print_key)
    1193        8530 :       CALL section_release(print_key)
    1194             : 
    1195             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ROTATIONAL_INFO", &
    1196             :                                        description="Controls the printing basic info during the cleaning of the "// &
    1197             :                                        "rotational degrees of freedom.", print_level=low_print_level, &
    1198        8530 :                                        add_last=add_last_numeric, filename="__STD_OUT__")
    1199             :       CALL keyword_create(keyword, __LOCATION__, name="COORDINATES", &
    1200             :                           description="Prints atomic coordinates after rotation", &
    1201        8530 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1202        8530 :       CALL section_add_keyword(print_key, keyword)
    1203        8530 :       CALL keyword_release(keyword)
    1204        8530 :       CALL section_add_subsection(subsection3, print_key)
    1205        8530 :       CALL section_release(print_key)
    1206             : 
    1207        8530 :       CALL section_add_subsection(subsection2, subsection3)
    1208        8530 :       CALL section_release(subsection3)
    1209        8530 :       CALL section_add_subsection(subsection, subsection2)
    1210        8530 :       CALL section_release(subsection2)
    1211             : 
    1212             :       CALL section_create(subsection2, __LOCATION__, name="DIMER_VECTOR", &
    1213             :                           description="Specifies the initial dimer vector (used frequently to restart DIMER calculations)."// &
    1214             :                           " If not provided the starting orientation of the dimer is chosen randomly.", &
    1215        8530 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    1216             :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    1217             :                           description="Specify on each line the components of the dimer vector.", repeats=.TRUE., &
    1218        8530 :                           usage="{Real} {Real} {Real}", type_of_var=real_t, n_var=-1)
    1219        8530 :       CALL section_add_keyword(subsection2, keyword)
    1220        8530 :       CALL keyword_release(keyword)
    1221        8530 :       CALL section_add_subsection(subsection, subsection2)
    1222        8530 :       CALL section_release(subsection2)
    1223             : 
    1224        8530 :       CALL section_add_subsection(section, subsection)
    1225        8530 :       CALL section_release(subsection)
    1226             : 
    1227        8530 :    END SUBROUTINE create_ts_section
    1228             : 
    1229             : ! **************************************************************************************************
    1230             : !> \brief creates the BFGS section
    1231             : !> \param section the section to be created
    1232             : !> \param use_model_hessian ...
    1233             : !> \author Teodoro Laino [tlaino] - University of Zurich - 01.2008
    1234             : ! **************************************************************************************************
    1235       34120 :    SUBROUTINE create_bfgs_section(section, use_model_hessian)
    1236             :       TYPE(section_type), POINTER                        :: section
    1237             :       LOGICAL, INTENT(IN)                                :: use_model_hessian
    1238             : 
    1239             :       TYPE(keyword_type), POINTER                        :: keyword
    1240             :       TYPE(section_type), POINTER                        :: print_key
    1241             : 
    1242             : ! create the BFGS subsection
    1243             : 
    1244       34120 :       NULLIFY (section, keyword, print_key)
    1245             :       CALL section_create(section, __LOCATION__, name="BFGS", &
    1246             :                           description="Provides parameters to tune the BFGS optimization", &
    1247       34120 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    1248             : 
    1249             :       CALL keyword_create(keyword, __LOCATION__, name="TRUST_RADIUS", &
    1250             :                           description="Trust radius used in BFGS. Previously set to 0.1. "// &
    1251             :                           "Large values can lead to instabilities", &
    1252             :                           usage="TRUST_RADIUS {real}", unit_str='angstrom', &
    1253       34120 :                           default_r_val=cp_unit_to_cp2k(0.25_dp, "angstrom"))
    1254       34120 :       CALL section_add_keyword(section, keyword)
    1255       34120 :       CALL keyword_release(keyword)
    1256             : 
    1257             :       CALL keyword_create(keyword, __LOCATION__, name="USE_MODEL_HESSIAN", &
    1258             :                           description="Uses a model Hessian as initial guess instead of a unit matrix."// &
    1259             :                           " Should lead in general to improved convergence might be switched off for exotic cases", &
    1260             :                           usage="USE_MODEL_HESSIAN", &
    1261       34120 :                           default_l_val=use_model_hessian, lone_keyword_l_val=.TRUE.)
    1262       34120 :       CALL section_add_keyword(section, keyword)
    1263       34120 :       CALL keyword_release(keyword)
    1264             : 
    1265             :       CALL keyword_create(keyword, __LOCATION__, name="USE_RAT_FUN_OPT", &
    1266             :                           description="Includes a rational function optimization to determine the step."// &
    1267             :                           " Previously default but did not improve convergence in many cases", &
    1268             :                           usage="USE_RAT_FUN_OPT", &
    1269       34120 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1270       34120 :       CALL section_add_keyword(section, keyword)
    1271       34120 :       CALL keyword_release(keyword)
    1272             : 
    1273             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_HESSIAN", &
    1274             :                           description="Controls the reading of the initial Hessian from file.", &
    1275             :                           usage="RESTART_HESSIAN", &
    1276       34120 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1277       34120 :       CALL section_add_keyword(section, keyword)
    1278       34120 :       CALL keyword_release(keyword)
    1279             : 
    1280             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_FILE_NAME", &
    1281             :                           description="Specifies the name of the file used to read the initial Hessian.", &
    1282             :                           usage="RESTART_FILE_NAME {filename}", &
    1283       34120 :                           default_lc_val="")
    1284       34120 :       CALL section_add_keyword(section, keyword)
    1285       34120 :       CALL keyword_release(keyword)
    1286             : 
    1287             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
    1288             :                                        description="Controls the printing of Hessian Restart file", &
    1289             :                                        print_level=low_print_level, add_last=add_last_numeric, filename="BFGS", &
    1290       34120 :                                        common_iter_levels=2)
    1291       34120 :       CALL section_add_subsection(section, print_key)
    1292       34120 :       CALL section_release(print_key)
    1293             : 
    1294       34120 :    END SUBROUTINE create_bfgs_section
    1295             : 
    1296             : ! **************************************************************************************************
    1297             : !> \brief creates the CG section
    1298             : !> \param section the section to be created
    1299             : !> \author Teodoro Laino [tlaino] - University of Zurich - 01.2008
    1300             : ! **************************************************************************************************
    1301       34120 :    SUBROUTINE create_cg_section(section)
    1302             :       TYPE(section_type), POINTER                        :: section
    1303             : 
    1304             :       TYPE(keyword_type), POINTER                        :: keyword
    1305             :       TYPE(section_type), POINTER                        :: subsection, subsubsection
    1306             : 
    1307             : ! create the CG subsection
    1308             : 
    1309       34120 :       NULLIFY (section, subsection, subsubsection, keyword)
    1310             :       CALL section_create(section, __LOCATION__, name="CG", &
    1311             :                           description="Provides parameters to tune the conjugate gradient optimization", &
    1312       34120 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    1313             : 
    1314             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_STEEP_STEPS", &
    1315             :                           description="Maximum number of steepest descent steps before starting the"// &
    1316             :                           " conjugate gradients optimization.", &
    1317             :                           usage="MAX_STEEP_STEPS {integer}", &
    1318       34120 :                           default_i_val=0)
    1319       34120 :       CALL section_add_keyword(section, keyword)
    1320       34120 :       CALL keyword_release(keyword)
    1321             : 
    1322             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_LIMIT", &
    1323             :                           description="Cosine of the angle between two consecutive searching directions."// &
    1324             :                           " If the angle during a CG optimization is less than the one corresponding to"// &
    1325             :                           " to the RESTART_LIMIT the CG is reset and one step of steepest descent is"// &
    1326             :                           " performed.", &
    1327             :                           usage="RESTART_LIMIT {real}", &
    1328       34120 :                           default_r_val=0.9_dp)
    1329       34120 :       CALL section_add_keyword(section, keyword)
    1330       34120 :       CALL keyword_release(keyword)
    1331             : 
    1332             :       CALL keyword_create(keyword, __LOCATION__, name="FLETCHER_REEVES", &
    1333             :                           description="Uses FLETCHER-REEVES instead of POLAK-RIBIERE when using Conjugate Gradients", &
    1334             :                           usage="FLETCHER-REEVES", &
    1335       34120 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1336       34120 :       CALL section_add_keyword(section, keyword)
    1337       34120 :       CALL keyword_release(keyword)
    1338             : 
    1339             :       ! Line Search section
    1340             :       CALL section_create(subsection, __LOCATION__, name="LINE_SEARCH", &
    1341             :                           description="Provides parameters to tune the line search during the conjugate gradient optimization", &
    1342       34120 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    1343             : 
    1344             :       CALL keyword_create(keyword, __LOCATION__, name="TYPE", &
    1345             :                           description="1D line search algorithm to be used with the CG optimizer,"// &
    1346             :                           " in increasing order of robustness and cost. ", &
    1347             :                           usage="TYPE GOLD", &
    1348             :                           default_i_val=ls_gold, &
    1349             :                           enum_c_vals=s2a("NONE", "2PNT", "3PNT", "GOLD", "FIT"), &
    1350             :                           enum_desc=s2a("take fixed length steps", &
    1351             :                                         "extrapolate based on 2 points", &
    1352             :                                         "extrapolate based on on 3 points", &
    1353             :                                         "perform 1D golden section search of the minimum (very expensive)", &
    1354             :                                         "perform 1D fit of a parabola on several evaluation of energy "// &
    1355             :                                         "(very expensive and more robust vs numerical noise)"), &
    1356       34120 :                           enum_i_vals=(/ls_none, ls_2pnt, ls_3pnt, ls_gold, ls_fit/))
    1357       34120 :       CALL section_add_keyword(subsection, keyword)
    1358       34120 :       CALL keyword_release(keyword)
    1359             : 
    1360             :       ! 2PNT
    1361       34120 :       NULLIFY (subsubsection)
    1362             :       CALL section_create(subsubsection, __LOCATION__, name="2PNT", &
    1363             :                           description="Provides parameters to tune the line search for the two point based line search.", &
    1364       34120 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    1365             : 
    1366             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_ALLOWED_STEP", &
    1367             :                           description="Max allowed value for the line search step.", &
    1368             :                           usage="MAX_ALLOWED_STEP {real}", unit_str="internal_cp2k", &
    1369       34120 :                           default_r_val=0.25_dp)
    1370       34120 :       CALL section_add_keyword(subsubsection, keyword)
    1371       34120 :       CALL keyword_release(keyword)
    1372             : 
    1373             :       CALL keyword_create( &
    1374             :          keyword, __LOCATION__, name="LINMIN_GRAD_ONLY", &
    1375             :          description="Use only the gradient, not the energy for line minimizations (e.g. in conjugate gradients).", &
    1376             :          usage="LINMIN_GRAD_ONLY T", &
    1377       34120 :          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1378       34120 :       CALL section_add_keyword(subsubsection, keyword)
    1379       34120 :       CALL keyword_release(keyword)
    1380             : 
    1381       34120 :       CALL section_add_subsection(subsection, subsubsection)
    1382       34120 :       CALL section_release(subsubsection)
    1383             : 
    1384             :       ! GOLD
    1385       34120 :       NULLIFY (subsubsection)
    1386             :       CALL section_create(subsubsection, __LOCATION__, name="GOLD", &
    1387             :                           description="Provides parameters to tune the line search for the gold search.", &
    1388       34120 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    1389             : 
    1390             :       CALL keyword_create(keyword, __LOCATION__, name="INITIAL_STEP", &
    1391             :                           description="Initial step size used, e.g. for bracketing or minimizers. "// &
    1392             :                           "Might need to be reduced for systems with close contacts", &
    1393             :                           usage="INITIAL_STEP {real}", unit_str="internal_cp2k", &
    1394       34120 :                           default_r_val=0.2_dp)
    1395       34120 :       CALL section_add_keyword(subsubsection, keyword)
    1396       34120 :       CALL keyword_release(keyword)
    1397             : 
    1398             :       CALL keyword_create(keyword, __LOCATION__, name="BRACK_LIMIT", &
    1399             :                           description="Limit in 1D bracketing during line search in Conjugate Gradients Optimization.", &
    1400             :                           usage="BRACK_LIMIT {real}", unit_str="internal_cp2k", &
    1401       34120 :                           default_r_val=100.0_dp)
    1402       34120 :       CALL section_add_keyword(subsubsection, keyword)
    1403       34120 :       CALL keyword_release(keyword)
    1404             : 
    1405             :       CALL keyword_create(keyword, __LOCATION__, name="BRENT_TOL", &
    1406             :                           description="Tolerance requested during Brent line search in Conjugate Gradients Optimization.", &
    1407             :                           usage="BRENT_TOL {real}", unit_str="internal_cp2k", &
    1408       34120 :                           default_r_val=0.01_dp)
    1409       34120 :       CALL section_add_keyword(subsubsection, keyword)
    1410       34120 :       CALL keyword_release(keyword)
    1411             : 
    1412             :       CALL keyword_create(keyword, __LOCATION__, name="BRENT_MAX_ITER", &
    1413             :                           description="Maximum number of iterations in brent algorithm "// &
    1414             :                           "(used for the line search in Conjugated Gradients Optimization)", &
    1415             :                           usage="BRENT_MAX_ITER {integer}", &
    1416       34120 :                           default_i_val=100)
    1417       34120 :       CALL section_add_keyword(subsubsection, keyword)
    1418       34120 :       CALL keyword_release(keyword)
    1419       34120 :       CALL section_add_subsection(subsection, subsubsection)
    1420       34120 :       CALL section_release(subsubsection)
    1421             : 
    1422       34120 :       CALL section_add_subsection(section, subsection)
    1423       34120 :       CALL section_release(subsection)
    1424       34120 :    END SUBROUTINE create_cg_section
    1425             : 
    1426             : ! **************************************************************************************************
    1427             : !> \brief creates the LBFGS section
    1428             : !> \param section the section to be created
    1429             : !> \author Teodoro Laino [tlaino] - University of Zurich - 01.2008
    1430             : ! **************************************************************************************************
    1431       34120 :    SUBROUTINE create_lbfgs_section(section)
    1432             :       TYPE(section_type), POINTER                        :: section
    1433             : 
    1434             :       TYPE(keyword_type), POINTER                        :: keyword
    1435             : 
    1436             : ! create the LBFGS section
    1437             : 
    1438       34120 :       NULLIFY (section, keyword)
    1439             :       CALL section_create(section, __LOCATION__, name="LBFGS", &
    1440             :                           description="Provides parameters to tune the limited memory BFGS (LBFGS) optimization", &
    1441             :                           n_keywords=0, n_subsections=1, repeats=.FALSE., &
    1442       68240 :                           citations=(/Byrd1995/))
    1443             : 
    1444             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_H_RANK", &
    1445             :                           description="Maximum rank (and consequently size) of the "// &
    1446             :                           "approximate Hessian matrix used by the LBFGS optimizer. "// &
    1447             :                           "Larger values (e.g. 30) will accelerate the convergence behaviour "// &
    1448             :                           "at the cost of a larger memory consumption.", &
    1449             :                           usage="MAX_H_RANK {integer}", &
    1450       34120 :                           default_i_val=5)
    1451       34120 :       CALL section_add_keyword(section, keyword)
    1452       34120 :       CALL keyword_release(keyword)
    1453             : 
    1454             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_F_PER_ITER", &
    1455             :                           description="Maximum number of force evaluations per iteration"// &
    1456             :                           " (used for the line search)", &
    1457             :                           usage="MAX_F_PER_ITER {integer}", &
    1458       34120 :                           default_i_val=20)
    1459       34120 :       CALL section_add_keyword(section, keyword)
    1460       34120 :       CALL keyword_release(keyword)
    1461             : 
    1462             :       CALL keyword_create(keyword, __LOCATION__, name="WANTED_PROJ_GRADIENT", &
    1463             :                           description="Convergence criterion (overrides the general ones):"// &
    1464             :                           " Requested norm threshold of the gradient multiplied"// &
    1465             :                           " by the approximate Hessian.", &
    1466             :                           usage="WANTED_PROJ_GRADIENT {real}", unit_str="internal_cp2k", &
    1467       34120 :                           default_r_val=1.0E-16_dp)
    1468       34120 :       CALL section_add_keyword(section, keyword)
    1469       34120 :       CALL keyword_release(keyword)
    1470             : 
    1471             :       CALL keyword_create(keyword, __LOCATION__, name="WANTED_REL_F_ERROR", &
    1472             :                           description="Convergence criterion (overrides the general ones):"// &
    1473             :                           " Requested relative error on the objective function"// &
    1474             :                           " of the optimizer (the energy)", &
    1475             :                           usage="WANTED_REL_F_ERROR {real}", unit_str="internal_cp2k", &
    1476       34120 :                           default_r_val=1.0E-16_dp)
    1477       34120 :       CALL section_add_keyword(section, keyword)
    1478       34120 :       CALL keyword_release(keyword)
    1479             : 
    1480             :       CALL keyword_create( &
    1481             :          keyword, __LOCATION__, name="TRUST_RADIUS", &
    1482             :          description="Trust radius used in LBFGS. Not completely in depth tested. Negativ values means no trust radius is used.", &
    1483             :          usage="TRUST_RADIUS {real}", unit_str='angstrom', &
    1484       34120 :          default_r_val=-1.0_dp)
    1485       34120 :       CALL section_add_keyword(section, keyword)
    1486       34120 :       CALL keyword_release(keyword)
    1487             : 
    1488       34120 :    END SUBROUTINE create_lbfgs_section
    1489             : 
    1490             : ! **************************************************************************************************
    1491             : !> \brief creates the flexible_partitioning section
    1492             : !> \param section the section to be created
    1493             : !> \author Joost VandeVondele [04.2006]
    1494             : ! **************************************************************************************************
    1495        8530 :    SUBROUTINE create_fp_section(section)
    1496             :       TYPE(section_type), POINTER                        :: section
    1497             : 
    1498             :       TYPE(keyword_type), POINTER                        :: keyword
    1499             :       TYPE(section_type), POINTER                        :: print_key
    1500             : 
    1501        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
    1502             :       CALL section_create(section, __LOCATION__, name="FLEXIBLE_PARTITIONING", &
    1503             :                           description="This section sets up flexible_partitioning", &
    1504        8530 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    1505             : 
    1506        8530 :       NULLIFY (keyword, print_key)
    1507             : 
    1508             :       CALL keyword_create(keyword, __LOCATION__, name="CENTRAL_ATOM", &
    1509             :                           description="Specifies the central atom.", &
    1510             :                           usage="CENTRAL_ATOM {integer}", &
    1511        8530 :                           n_var=1, type_of_var=integer_t)
    1512        8530 :       CALL section_add_keyword(section, keyword)
    1513        8530 :       CALL keyword_release(keyword)
    1514             : 
    1515             :       CALL keyword_create(keyword, __LOCATION__, name="INNER_ATOMS", &
    1516             :                           description="Specifies the list of atoms that should remain close to the central atom.", &
    1517             :                           usage="INNER_ATOMS {integer} {integer} .. {integer}", &
    1518        8530 :                           n_var=-1, type_of_var=integer_t)
    1519        8530 :       CALL section_add_keyword(section, keyword)
    1520        8530 :       CALL keyword_release(keyword)
    1521             : 
    1522             :       CALL keyword_create(keyword, __LOCATION__, name="OUTER_ATOMS", &
    1523             :                           description="Specifies the list of atoms that should remain far from the central atom.", &
    1524             :                           usage="OUTER_ATOMS {integer} {integer} .. {integer}", &
    1525        8530 :                           n_var=-1, type_of_var=integer_t)
    1526        8530 :       CALL section_add_keyword(section, keyword)
    1527        8530 :       CALL keyword_release(keyword)
    1528             : 
    1529             :       CALL keyword_create(keyword, __LOCATION__, name="INNER_RADIUS", &
    1530             :                           description="radius of the inner wall", &
    1531             :                           usage="INNER_RADIUS {real} ", type_of_var=real_t, &
    1532        8530 :                           n_var=1, unit_str="angstrom")
    1533        8530 :       CALL section_add_keyword(section, keyword)
    1534        8530 :       CALL keyword_release(keyword)
    1535             : 
    1536             :       CALL keyword_create(keyword, __LOCATION__, name="OUTER_RADIUS", &
    1537             :                           description="radius of the outer wall", &
    1538             :                           usage="OUTER_RADIUS {real} ", type_of_var=real_t, &
    1539        8530 :                           n_var=1, unit_str="angstrom")
    1540        8530 :       CALL section_add_keyword(section, keyword)
    1541        8530 :       CALL keyword_release(keyword)
    1542             : 
    1543             :       CALL keyword_create(keyword, __LOCATION__, name="STRENGTH", &
    1544             :                           description="Sets the force constant of the repulsive harmonic potential", &
    1545        8530 :                           usage="STRENGTH 1.0", default_r_val=1.0_dp)
    1546        8530 :       CALL section_add_keyword(section, keyword)
    1547        8530 :       CALL keyword_release(keyword)
    1548             : 
    1549             :       CALL keyword_create(keyword, __LOCATION__, name="BIAS", &
    1550             :                           description="If a bias potential counter-acting the weight term should be applied (recommended).", &
    1551        8530 :                           usage="BIAS F", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1552        8530 :       CALL section_add_keyword(section, keyword)
    1553        8530 :       CALL keyword_release(keyword)
    1554             : 
    1555             :       CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE", &
    1556             :                           description="Sets the temperature parameter that is used in the baising potential."// &
    1557             :                           " It is recommended to use the actual simulation temperature", &
    1558        8530 :                           usage="TEMPERATURE 300", default_r_val=300.0_dp, unit_str='K')
    1559        8530 :       CALL section_add_keyword(section, keyword)
    1560        8530 :       CALL keyword_release(keyword)
    1561             : 
    1562             :       CALL keyword_create(keyword, __LOCATION__, name="SMOOTH_WIDTH", &
    1563             :                           description="Sets the width of the smooth counting function.", &
    1564        8530 :                           usage="SMOOTH_WIDTH 0.2", default_r_val=0.02_dp, unit_str='angstrom')
    1565        8530 :       CALL section_add_keyword(section, keyword)
    1566        8530 :       CALL keyword_release(keyword)
    1567             : 
    1568             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "WEIGHTS", &
    1569             :                                        description="Controls the printing of FP info during flexible partitioning simulations.", &
    1570             :                                        print_level=low_print_level, common_iter_levels=1, &
    1571        8530 :                                        filename="FLEXIBLE_PARTIONING")
    1572        8530 :       CALL section_add_subsection(section, print_key)
    1573        8530 :       CALL section_release(print_key)
    1574             : 
    1575             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CONTROL", &
    1576             :                                        description="Controls the printing of FP info at startup", &
    1577             :                                        print_level=low_print_level, common_iter_levels=1, &
    1578        8530 :                                        filename="__STD_OUT__")
    1579        8530 :       CALL section_add_subsection(section, print_key)
    1580        8530 :       CALL section_release(print_key)
    1581             : 
    1582        8530 :    END SUBROUTINE create_fp_section
    1583             : 
    1584             : ! **************************************************************************************************
    1585             : !> \brief ...
    1586             : !> \param section will contain the driver section
    1587             : !> \author mceriotti
    1588             : ! **************************************************************************************************
    1589        8530 :    SUBROUTINE create_driver_section(section)
    1590             :       TYPE(section_type), POINTER                        :: section
    1591             : 
    1592             :       TYPE(keyword_type), POINTER                        :: keyword
    1593             : 
    1594        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
    1595             :       CALL section_create(section, __LOCATION__, name="DRIVER", &
    1596             :                           description="This section defines the parameters needed to run in i-PI driver mode.", &
    1597             :                           citations=(/Ceriotti2014, Kapil2016/), &
    1598       25590 :                           n_keywords=3, n_subsections=0, repeats=.FALSE.)
    1599             : 
    1600        8530 :       NULLIFY (keyword)
    1601             :       CALL keyword_create(keyword, __LOCATION__, name="unix", &
    1602             :                           description="Use a UNIX socket rather than an INET socket.", &
    1603             :                           usage="unix LOGICAL", &
    1604        8530 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1605        8530 :       CALL section_add_keyword(section, keyword)
    1606        8530 :       CALL keyword_release(keyword)
    1607             : 
    1608             :       CALL keyword_create(keyword, __LOCATION__, name="port", &
    1609             :                           description="Port number for the i-PI server.", &
    1610             :                           usage="port <INTEGER>", &
    1611        8530 :                           default_i_val=12345)
    1612        8530 :       CALL section_add_keyword(section, keyword)
    1613        8530 :       CALL keyword_release(keyword)
    1614             : 
    1615             :       CALL keyword_create(keyword, __LOCATION__, name="host", &
    1616             :                           description="Host name for the i-PI server.", &
    1617             :                           usage="host <HOSTNAME>", &
    1618        8530 :                           default_c_val="localhost")
    1619        8530 :       CALL section_add_keyword(section, keyword)
    1620        8530 :       CALL keyword_release(keyword)
    1621             : 
    1622             :       CALL keyword_create(keyword, __LOCATION__, name="SLEEP_TIME", &
    1623             :                           description="Sleeping time while waiting for for driver commands [s].", &
    1624             :                           usage="SLEEP_TIME 0.1", &
    1625        8530 :                           default_r_val=0.01_dp)
    1626        8530 :       CALL section_add_keyword(section, keyword)
    1627        8530 :       CALL keyword_release(keyword)
    1628             : 
    1629        8530 :    END SUBROUTINE create_driver_section
    1630             : 
    1631             : ! **************************************************************************************************
    1632             : !> \brief creates the section for a path integral run
    1633             : !> \param section will contain the pint section
    1634             : !> \author fawzi
    1635             : ! **************************************************************************************************
    1636        8530 :    SUBROUTINE create_pint_section(section)
    1637             :       TYPE(section_type), POINTER                        :: section
    1638             : 
    1639             :       TYPE(keyword_type), POINTER                        :: keyword
    1640             :       TYPE(section_type), POINTER                        :: print_key, subsection, subsubsection
    1641             : 
    1642        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
    1643             :       CALL section_create(section, __LOCATION__, name="PINT", &
    1644             :                           description="The section that controls a path integral run", &
    1645        8530 :                           n_keywords=13, n_subsections=9, repeats=.FALSE.)
    1646        8530 :       NULLIFY (keyword)
    1647             : 
    1648             :       CALL keyword_create(keyword, __LOCATION__, name="p", &
    1649             :                           description="Specify number beads to use", repeats=.FALSE., &
    1650        8530 :                           default_i_val=3)
    1651        8530 :       CALL section_add_keyword(section, keyword)
    1652        8530 :       CALL keyword_release(keyword)
    1653             :       CALL keyword_create(keyword, __LOCATION__, name="proc_per_replica", &
    1654             :                           description="Specify number of processors to use for each replica", &
    1655        8530 :                           repeats=.FALSE., default_i_val=0)
    1656        8530 :       CALL section_add_keyword(section, keyword)
    1657        8530 :       CALL keyword_release(keyword)
    1658             :       CALL keyword_create(keyword, __LOCATION__, name="num_steps", &
    1659             :                           description="Number of steps (if MAX_STEP is not explicitly given"// &
    1660             :                           " the program will perform this number of steps)", repeats=.FALSE., &
    1661        8530 :                           default_i_val=3)
    1662        8530 :       CALL section_add_keyword(section, keyword)
    1663        8530 :       CALL keyword_release(keyword)
    1664             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_STEP", &
    1665             :                           description="Maximum step number (the program will stop if"// &
    1666             :                           " ITERATION >= MAX_STEP even if NUM_STEPS has not been reached)", &
    1667        8530 :                           repeats=.FALSE., default_i_val=10)
    1668        8530 :       CALL section_add_keyword(section, keyword)
    1669        8530 :       CALL keyword_release(keyword)
    1670             :       CALL keyword_create(keyword, __LOCATION__, name="iteration", &
    1671             :                           description="Specify the iteration number from which it should be "// &
    1672        8530 :                           "counted", default_i_val=0)
    1673        8530 :       CALL section_add_keyword(section, keyword)
    1674        8530 :       CALL keyword_release(keyword)
    1675             :       CALL keyword_create(keyword, __LOCATION__, name="Temp", &
    1676             :                           description="The temperature you want to simulate", &
    1677             :                           default_r_val=cp_unit_to_cp2k(300._dp, "K"), &
    1678        8530 :                           unit_str="K")
    1679        8530 :       CALL section_add_keyword(section, keyword)
    1680        8530 :       CALL keyword_release(keyword)
    1681             :       CALL keyword_create(keyword, __LOCATION__, name="kT_CORRECTION", &
    1682             :                           description="Corrects for the loss of temperature due to constrained "// &
    1683             :                           "degrees of freedom for Nose-Hover chains and numeric integration", &
    1684        8530 :                           repeats=.FALSE., default_l_val=.FALSE.)
    1685        8530 :       CALL section_add_keyword(section, keyword)
    1686        8530 :       CALL keyword_release(keyword)
    1687             :       CALL keyword_create(keyword, __LOCATION__, name="T_tol", variants=(/"temp_to"/), &
    1688             :                           description="threshold for the oscillations of the temperature "// &
    1689             :                           "excedeed which the temperature is rescaled. 0 means no rescaling.", &
    1690       17060 :                           default_r_val=0._dp, unit_str="K")
    1691        8530 :       CALL section_add_keyword(section, keyword)
    1692        8530 :       CALL keyword_release(keyword)
    1693             :       CALL keyword_create(keyword, __LOCATION__, name="dt", &
    1694             :                           description="timestep (might be subdivised in nrespa subtimesteps", &
    1695             :                           repeats=.FALSE., &
    1696             :                           default_r_val=cp_unit_to_cp2k(1.0_dp, "fs"), &
    1697        8530 :                           usage="dt 1.0", unit_str="fs")
    1698        8530 :       CALL section_add_keyword(section, keyword)
    1699        8530 :       CALL keyword_release(keyword)
    1700             :       CALL keyword_create(keyword, __LOCATION__, name="HARM_INT", &
    1701             :                           description="integrator scheme for integrating the harmonic bead springs.", &
    1702             :                           usage="HARM_INT (NUMERIC|EXACT)", &
    1703             :                           default_i_val=integrate_numeric, &
    1704             :                           enum_c_vals=s2a("NUMERIC", "EXACT"), &
    1705        8530 :                           enum_i_vals=(/integrate_numeric, integrate_exact/))
    1706        8530 :       CALL section_add_keyword(section, keyword)
    1707        8530 :       CALL keyword_release(keyword)
    1708             :       CALL keyword_create(keyword, __LOCATION__, name="nrespa", &
    1709             :                           description="number of respa steps for the bead for each md step", &
    1710        8530 :                           repeats=.FALSE., default_i_val=5)
    1711        8530 :       CALL section_add_keyword(section, keyword)
    1712        8530 :       CALL keyword_release(keyword)
    1713             : 
    1714             :       CALL keyword_create(keyword, __LOCATION__, name="transformation", &
    1715             :                           description="Specifies the coordinate transformation to use", &
    1716             :                           usage="TRANSFORMATION (NORMAL|STAGE)", &
    1717             :                           default_i_val=transformation_normal, &
    1718             :                           enum_c_vals=s2a("NORMAL", "STAGE"), &
    1719        8530 :                           enum_i_vals=(/transformation_normal, transformation_stage/))
    1720             : 
    1721        8530 :       CALL section_add_keyword(section, keyword)
    1722        8530 :       CALL keyword_release(keyword)
    1723             :       CALL keyword_create(keyword, __LOCATION__, name="propagator", &
    1724             :                           description="Specifies the real time propagator to use", &
    1725             :                           usage="PROPAGATOR (PIMD|RPMD|CMD)", &
    1726             :                           default_i_val=propagator_pimd, &
    1727             :                           enum_c_vals=s2a("PIMD", "RPMD", "CMD"), &
    1728        8530 :                           enum_i_vals=(/propagator_pimd, propagator_rpmd, propagator_cmd/))
    1729        8530 :       CALL section_add_keyword(section, keyword)
    1730        8530 :       CALL keyword_release(keyword)
    1731             :       CALL keyword_create(keyword, __LOCATION__, name="FIX_CENTROID_POS", &
    1732             :                           description="Propagate all DOF but the centroid - "// &
    1733             :                           "useful for equilibration of the non-centroid modes "// &
    1734             :                           "(activated only if TRANSFORMATION==NORMAL)", &
    1735             :                           repeats=.FALSE., default_l_val=.FALSE., &
    1736        8530 :                           lone_keyword_l_val=.TRUE.)
    1737        8530 :       CALL section_add_keyword(section, keyword)
    1738        8530 :       CALL keyword_release(keyword)
    1739             : 
    1740        8530 :       NULLIFY (subsection, subsubsection)
    1741             :       CALL section_create(subsection, __LOCATION__, name="NORMALMODE", &
    1742             :                           description="Controls the normal mode transformation", &
    1743        8530 :                           n_keywords=3, n_subsections=0, repeats=.FALSE.)
    1744             :       CALL keyword_create(keyword, __LOCATION__, name="Q_CENTROID", &
    1745             :                           description="Value of the thermostat mass of centroid degree of freedom", &
    1746        8530 :                           repeats=.FALSE., default_r_val=-1.0_dp)
    1747        8530 :       CALL section_add_keyword(subsection, keyword)
    1748        8530 :       CALL keyword_release(keyword)
    1749             :       CALL keyword_create(keyword, __LOCATION__, name="Q_BEAD", &
    1750             :                           description="Value of the thermostat mass of non-centroid degrees of freedom", &
    1751        8530 :                           repeats=.FALSE., default_r_val=-1.0_dp)
    1752        8530 :       CALL section_add_keyword(subsection, keyword)
    1753        8530 :       CALL keyword_release(keyword)
    1754             :       CALL keyword_create(keyword, __LOCATION__, name="MODEFACTOR", &
    1755             :                           description="mass scale factor for non-centroid degrees of freedom", &
    1756        8530 :                           repeats=.FALSE., default_r_val=1.0_dp)
    1757        8530 :       CALL section_add_keyword(subsection, keyword)
    1758        8530 :       CALL keyword_release(keyword)
    1759             :       CALL keyword_create(keyword, __LOCATION__, name="GAMMA", &
    1760             :                           description="mass scale factor for non-centroid degrees of freedom, &
    1761             : &                                       naming convention according to Witt, 2008, <https://doi.org/10.1063/1.3125009>.", &
    1762        8530 :                           repeats=.FALSE., default_r_val=8.0_dp)
    1763        8530 :       CALL section_add_keyword(subsection, keyword)
    1764        8530 :       CALL keyword_release(keyword)
    1765             : 
    1766        8530 :       CALL section_add_subsection(section, subsection)
    1767        8530 :       CALL section_release(subsection)
    1768             : 
    1769             :       CALL section_create(subsection, __LOCATION__, name="staging", &
    1770             :                           description="The section that controls the staging transformation", &
    1771        8530 :                           n_keywords=2, n_subsections=0, repeats=.FALSE.)
    1772             :       CALL keyword_create(keyword, __LOCATION__, name="j", &
    1773             :                           description="Value of the j parameter for the staging transformation", &
    1774        8530 :                           repeats=.FALSE., default_i_val=2)
    1775        8530 :       CALL section_add_keyword(subsection, keyword)
    1776        8530 :       CALL keyword_release(keyword)
    1777             :       CALL keyword_create(keyword, __LOCATION__, name="Q_END", &
    1778             :                           description="Value of the nose-hoover mass for the endbead (Q_end)", &
    1779        8530 :                           repeats=.FALSE., default_i_val=2)
    1780        8530 :       CALL section_add_keyword(subsection, keyword)
    1781        8530 :       CALL keyword_release(keyword)
    1782        8530 :       CALL section_add_subsection(section, subsection)
    1783        8530 :       CALL section_release(subsection)
    1784             : 
    1785             :       CALL section_create(subsection, __LOCATION__, name="BEADS", &
    1786             :                           description="Sets positions and velocities of the beads", &
    1787             :                           n_keywords=0, n_subsections=2, &
    1788        8530 :                           repeats=.FALSE.)
    1789        8530 :       CALL create_coord_section(subsubsection, "BEADS")
    1790        8530 :       CALL section_add_subsection(subsection, subsubsection)
    1791        8530 :       CALL section_release(subsubsection)
    1792        8530 :       CALL create_velocity_section(subsubsection, "BEADS")
    1793        8530 :       CALL section_add_subsection(subsection, subsubsection)
    1794        8530 :       CALL section_release(subsubsection)
    1795        8530 :       CALL section_add_subsection(section, subsection)
    1796        8530 :       CALL section_release(subsection)
    1797             : 
    1798             :       CALL section_create(subsection, __LOCATION__, name="NOSE", &
    1799             :                           description="Controls the Nose-Hoover thermostats", &
    1800             :                           n_keywords=1, n_subsections=2, &
    1801        8530 :                           repeats=.FALSE.)
    1802             :       CALL keyword_create(keyword, __LOCATION__, name="nnos", &
    1803             :                           description="length of nose-hoover chain. 0 means no thermostat", &
    1804        8530 :                           repeats=.FALSE., default_i_val=2)
    1805        8530 :       CALL section_add_keyword(subsection, keyword)
    1806        8530 :       CALL keyword_release(keyword)
    1807        8530 :       CALL create_coord_section(subsubsection, "NOSE")
    1808        8530 :       CALL section_add_subsection(subsection, subsubsection)
    1809        8530 :       CALL section_release(subsubsection)
    1810        8530 :       CALL create_velocity_section(subsubsection, "NOSE")
    1811        8530 :       CALL section_add_subsection(subsection, subsubsection)
    1812        8530 :       CALL section_release(subsubsection)
    1813        8530 :       CALL section_add_subsection(section, subsection)
    1814        8530 :       CALL section_release(subsection)
    1815             : 
    1816        8530 :       CALL create_gle_section(subsection)
    1817        8530 :       CALL section_add_subsection(section, subsection)
    1818        8530 :       CALL section_release(subsection)
    1819             : 
    1820             :       CALL section_create(subsection, __LOCATION__, name="PILE", &
    1821             :                           description="Controls the PI Langevin Equation thermostat."// &
    1822             :                           " Needs the exact harmonic integrator."// &
    1823             :                           " May lead to unphysical motions if constraint e.g. FIXED_ATOMS, is applied."// &
    1824             :                           " RESTART_HELIUM section has to be .FALSE. when restarting the PIGLET job.", &
    1825             :                           citations=(/Ceriotti2010/), &
    1826             :                           n_keywords=3, n_subsections=1, &
    1827       17060 :                           repeats=.FALSE.)
    1828        8530 :       CALL create_rng_section(subsubsection)
    1829        8530 :       CALL section_add_subsection(subsection, subsubsection)
    1830        8530 :       CALL section_release(subsubsection)
    1831             :       CALL keyword_create(keyword, __LOCATION__, name="TAU", &
    1832             :                           description="Time constant for centroid motion. "// &
    1833             :                           "If zero or negative the centroid is not thermostated.", &
    1834             :                           usage="TAU {real}", type_of_var=real_t, &
    1835        8530 :                           unit_str="fs", n_var=1, default_r_val=1000.0_dp)
    1836        8530 :       CALL section_add_keyword(subsection, keyword)
    1837        8530 :       CALL keyword_release(keyword)
    1838             :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
    1839             :                           description="Scaling of friction to mode coupling", &
    1840             :                           usage="LAMBDA {real}", type_of_var=real_t, &
    1841        8530 :                           n_var=1, default_r_val=0.5_dp)
    1842        8530 :       CALL section_add_keyword(subsection, keyword)
    1843        8530 :       CALL keyword_release(keyword)
    1844             :       CALL keyword_create(keyword, __LOCATION__, name="THERMOSTAT_ENERGY", &
    1845             :                           description="Thermostat energy for conserved quantity. "// &
    1846             :                           "Only useful in restart files.", &
    1847             :                           usage="THERMOSTAT_ENERGY {real}", type_of_var=real_t, &
    1848        8530 :                           n_var=1, default_r_val=0.0_dp)
    1849        8530 :       CALL section_add_keyword(subsection, keyword)
    1850        8530 :       CALL keyword_release(keyword)
    1851        8530 :       CALL section_add_subsection(section, subsection)
    1852        8530 :       CALL section_release(subsection)
    1853             : 
    1854             :       CALL section_create(subsection, __LOCATION__, name="PIGLET", &
    1855             :                           description="Controls the PI Generalized Langevin Equation thermostat."// &
    1856             :                           " Needs the exact harmonic integrator", &
    1857             :                           citations=(/Ceriotti2012/), &
    1858             :                           n_keywords=4, n_subsections=2, &
    1859       17060 :                           repeats=.FALSE.)
    1860        8530 :       CALL create_rng_section(subsubsection)
    1861        8530 :       CALL section_add_subsection(subsection, subsubsection)
    1862        8530 :       CALL section_release(subsubsection)
    1863             :       CALL section_create(subsubsection, __LOCATION__, name="EXTRA_DOF", &
    1864             :                           description="Additional degrees of freedom to ensure Markovian Dynamics.", &
    1865        8530 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1866             :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    1867             :                           description="Restart values for additional degrees of freedom" &
    1868             :                           //" (only for restarts, do not set explicitly)", &
    1869             :                           repeats=.FALSE., &
    1870        8530 :                           type_of_var=real_t, n_var=-1)
    1871        8530 :       CALL section_add_keyword(subsubsection, keyword)
    1872        8530 :       CALL keyword_release(keyword)
    1873        8530 :       CALL section_add_subsection(subsection, subsubsection)
    1874        8530 :       CALL section_release(subsubsection)
    1875             :       CALL keyword_create(keyword, __LOCATION__, name="NEXTRA_DOF", &
    1876             :                           description="Number of extra degrees of freedom to ensure markovian dynamics", &
    1877        8530 :                           repeats=.FALSE., default_i_val=8)
    1878        8530 :       CALL section_add_keyword(subsection, keyword)
    1879        8530 :       CALL keyword_release(keyword)
    1880             :       CALL keyword_create(keyword, __LOCATION__, name="MATRICES_FILE_NAME", &
    1881             :                           description="Filename containig the raw matrices from "// &
    1882             :                           "<https://gle4md.org/index.html?page=matrix>.", &
    1883        8530 :                           repeats=.FALSE., default_lc_val="PIGLET.MAT")
    1884        8530 :       CALL section_add_keyword(subsection, keyword)
    1885        8530 :       CALL keyword_release(keyword)
    1886             :       CALL keyword_create(keyword, __LOCATION__, name="SMATRIX_INIT", &
    1887             :                           description="Select algorithm to initialize piglet S-matrices", &
    1888             :                           usage="SMATRIX_INIT (CHOLESKY|DIAGONAL)", &
    1889             :                           default_i_val=matrix_init_cholesky, &
    1890             :                           enum_c_vals=s2a("CHOLESKY", "DIAGONAL"), &
    1891        8530 :                           enum_i_vals=(/matrix_init_cholesky, matrix_init_diagonal/))
    1892        8530 :       CALL section_add_keyword(subsection, keyword)
    1893        8530 :       CALL keyword_release(keyword)
    1894             :       CALL keyword_create(keyword, __LOCATION__, name="THERMOSTAT_ENERGY", &
    1895             :                           description="Thermostat energy for conserved quantity. "// &
    1896             :                           "Only useful in restart files.", &
    1897             :                           usage="THERMOSTAT_ENERGY {real}", type_of_var=real_t, &
    1898        8530 :                           n_var=1, default_r_val=0.0_dp)
    1899        8530 :       CALL section_add_keyword(subsection, keyword)
    1900        8530 :       CALL keyword_release(keyword)
    1901        8530 :       CALL section_add_subsection(section, subsection)
    1902        8530 :       CALL section_release(subsection)
    1903             : 
    1904             :       CALL section_create(subsection, __LOCATION__, name="QTB", &
    1905             :                           description="Controls the QTB-PILE thermostat."// &
    1906             :                           " Needs the exact harmonic integrator", &
    1907             :                           citations=(/Brieuc2016/), &
    1908             :                           n_keywords=7, n_subsections=1, &
    1909       17060 :                           repeats=.FALSE.)
    1910        8530 :       CALL create_rng_section(subsubsection)
    1911        8530 :       CALL section_add_subsection(subsection, subsubsection)
    1912        8530 :       CALL section_release(subsubsection)
    1913             :       CALL keyword_create(keyword, __LOCATION__, name="TAU", &
    1914             :                           description="Time constant for centroid motion. ", &
    1915             :                           usage="TAU {real}", type_of_var=real_t, &
    1916        8530 :                           unit_str="fs", n_var=1, default_r_val=1000.0_dp)
    1917        8530 :       CALL section_add_keyword(subsection, keyword)
    1918        8530 :       CALL keyword_release(keyword)
    1919             :       CALL keyword_create(keyword, __LOCATION__, name="LAMBDA", &
    1920             :                           description="Scaling of friction to ring polymer NM freq.", &
    1921             :                           usage="LAMBDA {real}", type_of_var=real_t, &
    1922        8530 :                           n_var=1, default_r_val=0.5_dp)
    1923        8530 :       CALL section_add_keyword(subsection, keyword)
    1924        8530 :       CALL keyword_release(keyword)
    1925             :       CALL keyword_create(keyword, __LOCATION__, name="FP", &
    1926             :                           description="Defines which version to use "// &
    1927             :                           "0: f_P^(0), 1: f_P^(1)", &
    1928             :                           usage="FP {integer}", type_of_var=integer_t, &
    1929        8530 :                           n_var=1, default_i_val=1)
    1930        8530 :       CALL section_add_keyword(subsection, keyword)
    1931        8530 :       CALL keyword_release(keyword)
    1932             :       CALL keyword_create(keyword, __LOCATION__, name="TAUCUT", &
    1933             :                           description="Inverse of cutoff freq. for the centroid mode", &
    1934             :                           usage="TAUCUT {real}", type_of_var=real_t, &
    1935        8530 :                           unit_str="fs", n_var=1, default_r_val=0.5_dp)
    1936        8530 :       CALL section_add_keyword(subsection, keyword)
    1937        8530 :       CALL keyword_release(keyword)
    1938             :       CALL keyword_create(keyword, __LOCATION__, name="LAMBCUT", &
    1939             :                           description="Scaling of cutoff freq. to ring polymer NM freq.", &
    1940             :                           usage="LAMBCUT {real}", type_of_var=real_t, &
    1941        8530 :                           n_var=1, default_r_val=2.0_dp)
    1942        8530 :       CALL section_add_keyword(subsection, keyword)
    1943        8530 :       CALL keyword_release(keyword)
    1944             :       CALL keyword_create(keyword, __LOCATION__, name="NF", &
    1945             :                           description="Number of points used for the convolution product.", &
    1946             :                           usage="NF {integer}", type_of_var=integer_t, &
    1947        8530 :                           n_var=1, default_i_val=128)
    1948        8530 :       CALL section_add_keyword(subsection, keyword)
    1949        8530 :       CALL keyword_release(keyword)
    1950             :       CALL keyword_create(keyword, __LOCATION__, name="THERMOSTAT_ENERGY", &
    1951             :                           description="Thermostat energy for conserved quantity. "// &
    1952             :                           "Only useful in restart files.", &
    1953             :                           usage="THERMOSTAT_ENERGY {real}", type_of_var=real_t, &
    1954        8530 :                           n_var=1, default_r_val=0.0_dp)
    1955        8530 :       CALL section_add_keyword(subsection, keyword)
    1956        8530 :       CALL keyword_release(keyword)
    1957        8530 :       CALL section_add_subsection(section, subsection)
    1958        8530 :       CALL section_release(subsection)
    1959             : 
    1960             :       CALL section_create(subsection, __LOCATION__, name="INIT", &
    1961             :                           description="Controls the initialization if the beads are not present", &
    1962        8530 :                           repeats=.FALSE.)
    1963             : 
    1964             :       CALL keyword_create(keyword, __LOCATION__, name="LEVY_POS_SAMPLE", &
    1965             :                           description="Sample bead positions assuming free particle "// &
    1966             :                           "behavior (performs a Levy random walk of length P around "// &
    1967             :                           "the classical position of each atom at the physical "// &
    1968             :                           "temperature defined in PINT%TEMP)", &
    1969             :                           repeats=.FALSE., default_l_val=.FALSE., &
    1970        8530 :                           lone_keyword_l_val=.TRUE.)
    1971        8530 :       CALL section_add_keyword(subsection, keyword)
    1972        8530 :       CALL keyword_release(keyword)
    1973             :       CALL keyword_create(keyword, __LOCATION__, name="LEVY_CORRELATED", &
    1974             :                           description="Use the same Levy path for all atoms, though "// &
    1975             :                           "with mass-dependent variances (might help at very low T)", &
    1976             :                           repeats=.FALSE., default_l_val=.FALSE., &
    1977        8530 :                           lone_keyword_l_val=.TRUE.)
    1978        8530 :       CALL section_add_keyword(subsection, keyword)
    1979        8530 :       CALL keyword_release(keyword)
    1980             :       CALL keyword_create(keyword, __LOCATION__, name="LEVY_TEMP_FACTOR", &
    1981             :                           description="Multiplicative correction factor for the "// &
    1982             :                           "temperature at which the Levy walk is performed "// &
    1983             :                           "(correction is due to the interactions that modify "// &
    1984             :                           "the spread of a free particle)", &
    1985        8530 :                           repeats=.FALSE., default_r_val=1.0_dp)
    1986        8530 :       CALL section_add_keyword(subsection, keyword)
    1987        8530 :       CALL keyword_release(keyword)
    1988             :       CALL keyword_create(keyword, __LOCATION__, name="LEVY_SEED", &
    1989             :                           description="Initial seed for the (pseudo)random number "// &
    1990             :                           "generator that controls Levy walk for bead positions.", &
    1991             :                           usage="LEVY_SEED <INTEGER>", default_i_val=1234, &
    1992        8530 :                           repeats=.FALSE.)
    1993        8530 :       CALL section_add_keyword(subsection, keyword)
    1994        8530 :       CALL keyword_release(keyword)
    1995             :       CALL keyword_create(keyword, __LOCATION__, name="THERMOSTAT_SEED", &
    1996             :                           description="Initial seed for the (pseudo)random number "// &
    1997             :                           "generator that controls the PILE and PIGLET thermostats.", &
    1998             :                           usage="THERMOSTAT_SEED <INTEGER>", default_i_val=12345, &
    1999        8530 :                           repeats=.FALSE.)
    2000        8530 :       CALL section_add_keyword(subsection, keyword)
    2001        8530 :       CALL keyword_release(keyword)
    2002             :       CALL keyword_create(keyword, __LOCATION__, name="RANDOMIZE_POS", &
    2003             :                           description="add gaussian noise to the positions of the beads", &
    2004        8530 :                           repeats=.FALSE., default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2005        8530 :       CALL section_add_keyword(subsection, keyword)
    2006        8530 :       CALL keyword_release(keyword)
    2007             : 
    2008             :       CALL keyword_create(keyword, __LOCATION__, name="CENTROID_SPEED", &
    2009             :                           description="adds random velocity component to the centroid modes "// &
    2010             :                           "(useful to correct for the averaging out of the speed of various beads)", &
    2011        8530 :                           repeats=.FALSE., default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2012        8530 :       CALL section_add_keyword(subsection, keyword)
    2013        8530 :       CALL keyword_release(keyword)
    2014             : 
    2015             :       CALL keyword_create(keyword, __LOCATION__, name="VELOCITY_QUENCH", &
    2016             :                           description="set the initial velocities to zero", &
    2017        8530 :                           repeats=.FALSE., default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2018        8530 :       CALL section_add_keyword(subsection, keyword)
    2019        8530 :       CALL keyword_release(keyword)
    2020             :       CALL keyword_create(keyword, __LOCATION__, name="VELOCITY_SCALE", &
    2021             :                           description="scale initial velocities to the temperature given in MOTION%PINT%TEMP", &
    2022        8530 :                           repeats=.FALSE., default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2023        8530 :       CALL section_add_keyword(subsection, keyword)
    2024        8530 :       CALL keyword_release(keyword)
    2025             : 
    2026        8530 :       CALL section_add_subsection(section, subsection)
    2027        8530 :       CALL section_release(subsection)
    2028             : 
    2029        8530 :       CALL create_helium_section(subsection)
    2030        8530 :       CALL section_add_subsection(section, subsection)
    2031        8530 :       CALL section_release(subsection)
    2032             : 
    2033             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    2034             :                           description="Controls the path integral-specific output", &
    2035        8530 :                           n_keywords=2, n_subsections=0, repeats=.FALSE.)
    2036             : 
    2037        8530 :       NULLIFY (print_key)
    2038             : 
    2039             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ENERGY", &
    2040             :                                        description="Controls the output of the path integral energies", &
    2041        8530 :                                        print_level=low_print_level, common_iter_levels=1)
    2042        8530 :       CALL section_add_subsection(subsection, print_key)
    2043        8530 :       CALL section_release(print_key)
    2044             : 
    2045             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ACTION", &
    2046             :                                        description="Controls the output of the path integral action", &
    2047        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2048        8530 :       CALL section_add_subsection(subsection, print_key)
    2049        8530 :       CALL section_release(print_key)
    2050             : 
    2051             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CENTROID_POS", &
    2052             :                                        description="Controls the output of the centroid's position", &
    2053             :                                        unit_str="angstrom", &
    2054        8530 :                                        print_level=low_print_level, common_iter_levels=1)
    2055             :       CALL add_format_keyword(keyword, print_key, pos=.TRUE., &
    2056        8530 :                               description="Output file format for the positions of centroid")
    2057        8530 :       CALL section_add_subsection(subsection, print_key)
    2058        8530 :       CALL section_release(print_key)
    2059             : 
    2060             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CENTROID_VEL", &
    2061             :                                        description="Controls the output of the centroid's velocity", &
    2062             :                                        unit_str="bohr*au_t^-1", &
    2063        8530 :                                        print_level=low_print_level, common_iter_levels=1)
    2064             :       CALL add_format_keyword(keyword, print_key, pos=.FALSE., &
    2065        8530 :                               description="Output file format for the velocity of centroid")
    2066        8530 :       CALL section_add_subsection(subsection, print_key)
    2067        8530 :       CALL section_release(print_key)
    2068             : 
    2069             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CENTROID_GYR", &
    2070             :                                        description="Controls the output of the centroid's radii of gyration", &
    2071             :                                        unit_str="angstrom", &
    2072        8530 :                                        print_level=low_print_level, common_iter_levels=1)
    2073        8530 :       CALL section_add_subsection(subsection, print_key)
    2074        8530 :       CALL section_release(print_key)
    2075             : 
    2076             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "COM", &
    2077             :                                        description="Controls the output of the center of mass", &
    2078        8530 :                                        print_level=high_print_level, common_iter_levels=1)
    2079        8530 :       CALL section_add_subsection(subsection, print_key)
    2080        8530 :       CALL section_release(print_key)
    2081             : 
    2082             :       CALL keyword_create(keyword, __LOCATION__, name="IMAGINARY_TIME_STRIDE", &
    2083             :                           description="Prints only every nth bead trajectory", &
    2084        8530 :                           repeats=.FALSE., default_i_val=1)
    2085        8530 :       CALL section_add_keyword(subsection, keyword)
    2086        8530 :       CALL keyword_release(keyword)
    2087             : 
    2088        8530 :       CALL section_add_subsection(section, subsection)
    2089        8530 :       CALL section_release(subsection)
    2090             : 
    2091        8530 :    END SUBROUTINE create_pint_section
    2092             : 
    2093             :    ! ***************************************************************************
    2094             :    !> \brief  Create the input section for superfluid helium solvent.
    2095             :    !> \author Lukasz Walewski
    2096             :    ! ***************************************************************************
    2097             : ! **************************************************************************************************
    2098             : !> \brief ...
    2099             : !> \param section ...
    2100             : ! **************************************************************************************************
    2101        8530 :    SUBROUTINE create_helium_section(section)
    2102             :       TYPE(section_type), POINTER                        :: section
    2103             : 
    2104             :       TYPE(keyword_type), POINTER                        :: keyword
    2105             :       TYPE(section_type), POINTER                        :: print_key, subsection, subsubsection
    2106             : 
    2107        8530 :       CPASSERT(.NOT. ASSOCIATED(section))
    2108             : 
    2109             :       CALL section_create(section, __LOCATION__, name="HELIUM", &
    2110             :                           description="The section that controls optional helium solvent"// &
    2111             :                           " environment (highly experimental, not for general use yet)", &
    2112        8530 :                           n_keywords=31, n_subsections=11, repeats=.FALSE.)
    2113             : 
    2114        8530 :       NULLIFY (keyword)
    2115             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    2116             :                           description="Whether or not to actually use this section", &
    2117        8530 :                           usage="silent", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2118        8530 :       CALL section_add_keyword(section, keyword)
    2119        8530 :       CALL keyword_release(keyword)
    2120             : 
    2121             :       CALL keyword_create(keyword, __LOCATION__, name="HELIUM_ONLY", &
    2122             :                           description="Simulate helium solvent only, "// &
    2123             :                           "disregard solute entirely", &
    2124             :                           repeats=.FALSE., default_l_val=.FALSE., &
    2125        8530 :                           lone_keyword_l_val=.TRUE.)
    2126        8530 :       CALL section_add_keyword(section, keyword)
    2127        8530 :       CALL keyword_release(keyword)
    2128             : 
    2129             :       CALL keyword_create(keyword, __LOCATION__, name="INTERACTION_POT_SCAN", &
    2130             :                           description="Scan solute-helium interaction potential, "// &
    2131             :                           "cubefile parameters set in subsection RHO", &
    2132             :                           repeats=.FALSE., default_l_val=.FALSE., &
    2133        8530 :                           lone_keyword_l_val=.TRUE.)
    2134        8530 :       CALL section_add_keyword(section, keyword)
    2135        8530 :       CALL keyword_release(keyword)
    2136             : 
    2137             :       CALL keyword_create(keyword, __LOCATION__, name="NUM_ENV", &
    2138             :                           description="Number of independent helium environments", &
    2139        8530 :                           repeats=.FALSE., default_i_val=1)
    2140        8530 :       CALL section_add_keyword(section, keyword)
    2141        8530 :       CALL keyword_release(keyword)
    2142             : 
    2143             :       CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_FILE_NAME", &
    2144             :                           description="Name of the Helium interaction potential file", &
    2145        8530 :                           repeats=.FALSE., default_lc_val="HELIUM.POT")
    2146        8530 :       CALL section_add_keyword(section, keyword)
    2147        8530 :       CALL keyword_release(keyword)
    2148             : 
    2149             :       CALL keyword_create(keyword, __LOCATION__, name="GET_FORCES", &
    2150             :                           description="Get average MC forces or last MC forces to propagate MD", &
    2151             :                           usage="GET_FORCES (AVERAGE|LAST)", &
    2152             :                           default_i_val=helium_forces_average, &
    2153             :                           enum_c_vals=s2a("AVERAGE", "LAST"), &
    2154        8530 :                           enum_i_vals=(/helium_forces_average, helium_forces_last/))
    2155        8530 :       CALL section_add_keyword(section, keyword)
    2156        8530 :       CALL keyword_release(keyword)
    2157             : 
    2158             :       CALL keyword_create(keyword, __LOCATION__, name="SOLUTE_INTERACTION", &
    2159             :                           description="Interaction potential between helium and the solute", &
    2160             :                           usage="SOLUTE_INTERACTION (NONE | MWATER | NNP)", &
    2161             :                           default_i_val=helium_solute_intpot_none, &
    2162             :                           enum_c_vals=s2a("NONE", "MWATER", "NNP"), &
    2163             :                           enum_i_vals=(/ &
    2164             :                           helium_solute_intpot_none, &
    2165             :                           helium_solute_intpot_mwater, &
    2166             :                           helium_solute_intpot_nnp/), &
    2167             :                           enum_desc=s2a( &
    2168             :                           "No interaction with solute", &
    2169             :                           "Test interaction with wrong Water", &
    2170        8530 :                           "Interaction with NNP"))
    2171        8530 :       CALL section_add_keyword(section, keyword)
    2172        8530 :       CALL keyword_release(keyword)
    2173             : 
    2174             :       CALL keyword_create(keyword, __LOCATION__, name="NATOMS", &
    2175             :                           description="Number of helium atoms", &
    2176        8530 :                           repeats=.FALSE., default_i_val=64)
    2177        8530 :       CALL section_add_keyword(section, keyword)
    2178        8530 :       CALL keyword_release(keyword)
    2179             : 
    2180             :       CALL keyword_create(keyword, __LOCATION__, name="NBEADS", &
    2181             :                           description="Number of helium path integral beads", &
    2182        8530 :                           repeats=.FALSE., default_i_val=25)
    2183        8530 :       CALL section_add_keyword(section, keyword)
    2184        8530 :       CALL keyword_release(keyword)
    2185             : 
    2186             :       CALL keyword_create(keyword, __LOCATION__, name="RNG_SEED", &
    2187             :                           description="Initial seed for the (pseudo)random number "// &
    2188             :                           "generator that controls helium coordinate generation and propagation.", &
    2189             :                           usage="RNG_SEED <INTEGER>", default_i_val=12345, &
    2190        8530 :                           repeats=.FALSE.)
    2191        8530 :       CALL section_add_keyword(section, keyword)
    2192        8530 :       CALL keyword_release(keyword)
    2193             : 
    2194             :       CALL keyword_create(keyword, __LOCATION__, name="N_INNER", &
    2195             :                           variants=s2a("INOROT"), &
    2196             :                           description="Number of MC iterations at the same time slice(s) "// &
    2197             :                           "(number of inner MC loop iterations)", &
    2198        8530 :                           repeats=.FALSE., default_i_val=6600)
    2199        8530 :       CALL section_add_keyword(section, keyword)
    2200        8530 :       CALL keyword_release(keyword)
    2201             : 
    2202             :       CALL keyword_create(keyword, __LOCATION__, name="N_OUTER", &
    2203             :                           variants=s2a("IROT"), &
    2204             :                           description="how often to reselect the time slice(s) to work on "// &
    2205             :                           "(number of outer MC loop iterations)", &
    2206        8530 :                           repeats=.FALSE., default_i_val=300)
    2207        8530 :       CALL section_add_keyword(section, keyword)
    2208        8530 :       CALL keyword_release(keyword)
    2209             : 
    2210             :       CALL keyword_create(keyword, __LOCATION__, name="SAMPLING_METHOD", &
    2211             :                           description="Choose between Ceperley or the worm algorithm", &
    2212             :                           usage="SAMPLING_METHOD (CEPERLEY|WORM)", &
    2213             :                           default_i_val=helium_sampling_ceperley, &
    2214             :                           enum_c_vals=s2a("CEPERLEY", "WORM"), &
    2215        8530 :                           enum_i_vals=(/helium_sampling_ceperley, helium_sampling_worm/))
    2216        8530 :       CALL section_add_keyword(section, keyword)
    2217        8530 :       CALL keyword_release(keyword)
    2218             : 
    2219             :       CALL keyword_create(keyword, __LOCATION__, name="COORD_INIT_TEMP", &
    2220             :                           description="Temperature for thermal gaussian initialization of the helium."// &
    2221             :                           " Negative values correspond to a hot start.", &
    2222             :                           default_r_val=cp_unit_to_cp2k(300._dp, "K"), &
    2223        8530 :                           unit_str="K")
    2224        8530 :       CALL section_add_keyword(section, keyword)
    2225        8530 :       CALL keyword_release(keyword)
    2226             : 
    2227             :       CALL keyword_create(keyword, __LOCATION__, name="SOLUTE_RADIUS", &
    2228             :                           description="Radius of the solute molecule for prevention of"// &
    2229             :                           " coordinate collision during initialization", &
    2230             :                           default_r_val=cp_unit_to_cp2k(0.0_dp, "angstrom"), &
    2231        8530 :                           repeats=.FALSE., type_of_var=real_t, unit_str="angstrom")
    2232        8530 :       CALL section_add_keyword(section, keyword)
    2233        8530 :       CALL keyword_release(keyword)
    2234             : 
    2235             :       ! Helium-solute interaction NNP
    2236        8530 :       NULLIFY (subsection)
    2237             :       CALL section_create(subsection, __LOCATION__, name="NNP", &
    2238             :                           description="This section contains all information to run an helium-solute "// &
    2239             :                           "interaction Neural Network Potential (NNP) calculation.", &
    2240        8530 :                           n_keywords=2, n_subsections=3, repeats=.FALSE.)
    2241             : 
    2242             :       CALL keyword_create(keyword, __LOCATION__, name="NNP_INPUT_FILE_NAME", &
    2243             :                           description="File containing the input information for the setup "// &
    2244             :                           "of the NNP (n2p2/RuNNer format). ", &
    2245        8530 :                           repeats=.FALSE., default_lc_val="input.nn")
    2246        8530 :       CALL section_add_keyword(subsection, keyword)
    2247        8530 :       CALL keyword_release(keyword)
    2248             : 
    2249             :       CALL keyword_create(keyword, __LOCATION__, name="SCALE_FILE_NAME", &
    2250             :                           description="File containing the scaling information for the symmetry "// &
    2251             :                           "functions of the NNP. ", &
    2252        8530 :                           repeats=.FALSE., default_lc_val="scaling.data")
    2253        8530 :       CALL section_add_keyword(subsection, keyword)
    2254        8530 :       CALL keyword_release(keyword)
    2255             : 
    2256        8530 :       NULLIFY (subsubsection)
    2257             :       CALL section_create(subsubsection, __LOCATION__, name="SR_CUTOFF", &
    2258             :                           description="Section for failsafe short range cutoffs for the NNPs, "// &
    2259             :                           "if the distance between solvent and specified solute element becomes "// &
    2260             :                           "smaller than the given cutoff, an artifical repulsive potential is "// &
    2261             :                           "introduced. Note this is only meant to prevent such configurations, "// &
    2262             :                           "not to physically sample them.", &
    2263        8530 :                           n_keywords=2, n_subsections=0, repeats=.TRUE.)
    2264             : 
    2265             :       CALL keyword_create(keyword, __LOCATION__, name="ELEMENT", &
    2266             :                           description="Solute element for which the short range cutoff is in effect", &
    2267        8530 :                           repeats=.FALSE., default_c_val="none")
    2268        8530 :       CALL section_add_keyword(subsubsection, keyword)
    2269        8530 :       CALL keyword_release(keyword)
    2270             : 
    2271             :       CALL keyword_create(keyword, __LOCATION__, name="RADIUS", &
    2272             :                           description="Short range cutoff in Angstrom, below this cutoff, the energy "// &
    2273             :                           "is replaced by a sizable positive value plus a 1/r**2 term to guide particles "// &
    2274             :                           "away from each other.", &
    2275             :                           default_r_val=cp_unit_to_cp2k(0.0_dp, "angstrom"), &
    2276        8530 :                           repeats=.FALSE., type_of_var=real_t, unit_str="angstrom")
    2277        8530 :       CALL section_add_keyword(subsubsection, keyword)
    2278        8530 :       CALL keyword_release(keyword)
    2279        8530 :       CALL section_add_subsection(subsection, subsubsection)
    2280        8530 :       CALL section_release(subsubsection)
    2281             : 
    2282        8530 :       NULLIFY (subsubsection)
    2283             :       CALL section_create(subsubsection, __LOCATION__, name="MODEL", &
    2284             :                           description="Section for a single NNP model. If this section is repeated, "// &
    2285             :                           "a committee model (C-NNP)is used where the NNP members share the same "// &
    2286             :                           "symmetry functions. ", &
    2287        8530 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    2288             : 
    2289             :       CALL keyword_create(keyword, __LOCATION__, name="WEIGHTS", &
    2290             :                           description="File containing the weights for the artificial neural "// &
    2291             :                           "networks of the NNP. The specified name is extended by .XXX.data ", &
    2292        8530 :                           repeats=.FALSE., default_lc_val="weights")
    2293        8530 :       CALL section_add_keyword(subsubsection, keyword)
    2294        8530 :       CALL keyword_release(keyword)
    2295        8530 :       CALL section_add_subsection(subsection, subsubsection)
    2296        8530 :       CALL section_release(subsubsection)
    2297             : 
    2298             :       ! Create the PRINT subsection
    2299        8530 :       NULLIFY (subsubsection)
    2300             :       CALL section_create(subsubsection, __LOCATION__, name="PRINT", &
    2301             :                           description="Section of possible print options in NNP code.", &
    2302        8530 :                           n_keywords=0, n_subsections=3, repeats=.FALSE.)
    2303        8530 :       NULLIFY (print_key, keyword)
    2304             : 
    2305             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ENERGIES", &
    2306             :                                        description="Controls the printing of the NNP energies.", &
    2307        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2308        8530 :       CALL section_add_subsection(subsubsection, print_key)
    2309        8530 :       CALL section_release(print_key)
    2310             : 
    2311             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "FORCES_SIGMA", &
    2312             :                                        description="Controls the printing of the STD per atom of the NNP forces.", &
    2313        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2314        8530 :       CALL section_add_subsection(subsubsection, print_key)
    2315        8530 :       CALL section_release(print_key)
    2316             : 
    2317             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "EXTRAPOLATION", &
    2318             :                                        description="If activated, output structures with extrapolation "// &
    2319             :                                        "warning in xyz-format", &
    2320        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2321        8530 :       CALL section_add_subsection(subsubsection, print_key)
    2322        8530 :       CALL section_release(print_key)
    2323        8530 :       CALL section_add_subsection(subsection, subsubsection)
    2324        8530 :       CALL section_release(subsubsection)
    2325             : 
    2326        8530 :       CALL section_add_subsection(section, subsection)
    2327        8530 :       CALL section_release(subsection) ! release NNP subsection
    2328             : 
    2329             :       ! Ceperley's sampling algorithm
    2330        8530 :       NULLIFY (subsection)
    2331             :       CALL section_create(subsection, __LOCATION__, name="CEPERLEY", &
    2332             :                           description="Enables sampling with Ceperley's algorithm", &
    2333        8530 :                           n_keywords=2, n_subsections=1, repeats=.FALSE.)
    2334             : 
    2335             :       CALL keyword_create(keyword, __LOCATION__, name="BISECTION", &
    2336             :                           description="how many time slices to change at once (+1). "// &
    2337             :                           "Must be a power of 2 currently", &
    2338        8530 :                           repeats=.FALSE., default_i_val=8)
    2339        8530 :       CALL section_add_keyword(subsection, keyword)
    2340        8530 :       CALL keyword_release(keyword)
    2341             : 
    2342             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_PERM_CYCLE", &
    2343             :                           description="how large cyclic permutations to try", &
    2344        8530 :                           repeats=.FALSE., default_i_val=6)
    2345        8530 :       CALL section_add_keyword(subsection, keyword)
    2346        8530 :       CALL keyword_release(keyword)
    2347             : 
    2348        8530 :       NULLIFY (subsubsection)
    2349             :       CALL section_create(subsubsection, __LOCATION__, name="M-SAMPLING", &
    2350             :                           description="Permutation cycle length sampling settings", &
    2351        8530 :                           n_keywords=3, n_subsections=0, repeats=.FALSE.)
    2352             :       CALL keyword_create(keyword, __LOCATION__, name="DISTRIBUTION-TYPE", &
    2353             :                           description="Distribution from which the cycle length m is sampled", &
    2354             :                           usage="DISTRIBUTION-TYPE (SINGLEV|UNIFORM|LINEAR|QUADRATIC|EXPONENTIAL|GAUSSIAN)", &
    2355             :                           default_i_val=helium_mdist_uniform, &
    2356             :                           enum_c_vals=s2a( &
    2357             :                           "SINGLEV", &
    2358             :                           "UNIFORM", &
    2359             :                           "LINEAR", &
    2360             :                           "QUADRATIC", &
    2361             :                           "EXPONENTIAL", &
    2362             :                           "GAUSSIAN"), &
    2363             :                           enum_i_vals=(/ &
    2364             :                           helium_mdist_singlev, &
    2365             :                           helium_mdist_uniform, &
    2366             :                           helium_mdist_linear, &
    2367             :                           helium_mdist_quadratic, &
    2368             :                           helium_mdist_exponential, &
    2369        8530 :                           helium_mdist_gaussian/))
    2370        8530 :       CALL section_add_keyword(subsubsection, keyword)
    2371        8530 :       CALL keyword_release(keyword)
    2372             :       CALL keyword_create(keyword, __LOCATION__, name="M-VALUE", &
    2373             :                           description="Value of m treated in a special way "// &
    2374             :                           "(specific behavior depends on the distribution type chosen)", &
    2375             :                           repeats=.FALSE., &
    2376        8530 :                           default_i_val=1)
    2377        8530 :       CALL section_add_keyword(subsubsection, keyword)
    2378        8530 :       CALL keyword_release(keyword)
    2379             :       CALL keyword_create(keyword, __LOCATION__, name="M-RATIO", &
    2380             :                           description="Probability ratio betw M-VALUE and other cycle lengths", &
    2381             :                           repeats=.FALSE., &
    2382        8530 :                           default_r_val=1.0_dp)
    2383        8530 :       CALL section_add_keyword(subsubsection, keyword)
    2384        8530 :       CALL keyword_release(keyword)
    2385        8530 :       CALL section_add_subsection(subsection, subsubsection)
    2386        8530 :       CALL section_release(subsubsection)
    2387        8530 :       CALL section_add_subsection(section, subsection)
    2388        8530 :       CALL section_release(subsection) ! release CEPERLEY subsection
    2389             : 
    2390             : ! worm algorithm parameters:
    2391        8530 :       NULLIFY (subsection)
    2392             :       CALL section_create(subsection, __LOCATION__, name="WORM", &
    2393             :                           description="Enables sampling via the canonical worm algorithm adapted from Bonisegni", &
    2394        8530 :                           n_keywords=12, n_subsections=0, repeats=.FALSE.)
    2395             : 
    2396             :       CALL keyword_create(keyword, __LOCATION__, name="CENTROID_DRMAX", &
    2397             :                           description="Maximum displacement allowed for the centroid moves", &
    2398        8530 :                           repeats=.FALSE., default_r_val=0.5_dp)
    2399        8530 :       CALL section_add_keyword(subsection, keyword)
    2400        8530 :       CALL keyword_release(keyword)
    2401             : 
    2402             :       CALL keyword_create(keyword, __LOCATION__, name="STAGING_L", &
    2403             :                           description="From 2 up to max. L-1 beads will be moved", &
    2404        8530 :                           repeats=.FALSE., default_i_val=5)
    2405        8530 :       CALL section_add_keyword(subsection, keyword)
    2406        8530 :       CALL keyword_release(keyword)
    2407             : 
    2408             :       CALL keyword_create(keyword, __LOCATION__, name="OPEN_CLOSE_SCALE", &
    2409             :                           description="Open/Close acceptance adjustment parameter", &
    2410        8530 :                           repeats=.FALSE., default_r_val=0.01_dp)
    2411        8530 :       CALL section_add_keyword(subsection, keyword)
    2412        8530 :       CALL keyword_release(keyword)
    2413             : 
    2414             :       CALL keyword_create(keyword, __LOCATION__, name="ALLOW_OPEN", &
    2415             :                           description="Enable bosonic exchange sampling", &
    2416        8530 :                           repeats=.FALSE., default_l_val=.TRUE.)
    2417        8530 :       CALL section_add_keyword(subsection, keyword)
    2418        8530 :       CALL keyword_release(keyword)
    2419             : 
    2420             :       CALL keyword_create(keyword, __LOCATION__, name="MAX_OPEN_CYCLES", &
    2421             :                          description="If > 0 then reset positions and permutations to the previous closed &
    2422             :                          & state if staying more than this amount of MC cycles in open state to avoid staying &
    2423             :                          & trapped in open state for too long. Use with caution as it can potentially introduce &
    2424             :                          & a bias in the sampling.", &
    2425        8530 :                           repeats=.FALSE., default_i_val=0)
    2426        8530 :       CALL section_add_keyword(subsection, keyword)
    2427        8530 :       CALL keyword_release(keyword)
    2428             : 
    2429             :       CALL keyword_create(keyword, __LOCATION__, name="SHOW_STATISTICS", &
    2430             :                           description="Show sampling statistics in output", &
    2431        8530 :                           repeats=.FALSE., default_l_val=.TRUE.)
    2432        8530 :       CALL section_add_keyword(subsection, keyword)
    2433        8530 :       CALL keyword_release(keyword)
    2434             : 
    2435             :       CALL keyword_create(keyword, __LOCATION__, name="CENTROID_WEIGHT", &
    2436             :                           description="Absolute weight of the centroid move", &
    2437        8530 :                           repeats=.FALSE., default_i_val=10)
    2438        8530 :       CALL section_add_keyword(subsection, keyword)
    2439        8530 :       CALL keyword_release(keyword)
    2440             : 
    2441             :       CALL keyword_create(keyword, __LOCATION__, name="STAGING_WEIGHT", &
    2442             :                           description="Absolute weight of the staging move", &
    2443        8530 :                           repeats=.FALSE., default_i_val=30)
    2444        8530 :       CALL section_add_keyword(subsection, keyword)
    2445        8530 :       CALL keyword_release(keyword)
    2446             : 
    2447             :       CALL keyword_create(keyword, __LOCATION__, name="OPEN_CLOSE_WEIGHT", &
    2448             :                           description="Absolute weight of the open/close move", &
    2449        8530 :                           repeats=.FALSE., default_i_val=10)
    2450        8530 :       CALL section_add_keyword(subsection, keyword)
    2451        8530 :       CALL keyword_release(keyword)
    2452             : 
    2453             :       CALL keyword_create(keyword, __LOCATION__, name="HEAD_TAIL_WEIGHT", &
    2454             :                           description="Absolute weight of the head/tail moves (both)", &
    2455        8530 :                           repeats=.FALSE., default_i_val=10)
    2456        8530 :       CALL section_add_keyword(subsection, keyword)
    2457        8530 :       CALL keyword_release(keyword)
    2458             : 
    2459             :       CALL keyword_create(keyword, __LOCATION__, name="CRAWL_WEIGHT", &
    2460             :                           description="Absolute weight of the crawl bwd/fwd moves (both)", &
    2461        8530 :                           repeats=.FALSE., default_i_val=10)
    2462        8530 :       CALL section_add_keyword(subsection, keyword)
    2463        8530 :       CALL keyword_release(keyword)
    2464             : 
    2465             :       CALL keyword_create(keyword, __LOCATION__, name="CRAWL_REPETITION", &
    2466             :                           description="Number of repeated crawl moves", &
    2467        8530 :                           repeats=.FALSE., default_i_val=4)
    2468        8530 :       CALL section_add_keyword(subsection, keyword)
    2469        8530 :       CALL keyword_release(keyword)
    2470             : 
    2471             :       CALL keyword_create(keyword, __LOCATION__, name="SWAP_WEIGHT", &
    2472             :                           description="Absolute weight of the crawl move", &
    2473        8530 :                           repeats=.FALSE., default_i_val=10)
    2474        8530 :       CALL section_add_keyword(subsection, keyword)
    2475        8530 :       CALL keyword_release(keyword)
    2476             : 
    2477        8530 :       CALL section_add_subsection(section, subsection)
    2478        8530 :       CALL section_release(subsection) ! release WORM subsection
    2479             : 
    2480             : ! end of worm parameters
    2481             : 
    2482             :       CALL keyword_create(keyword, __LOCATION__, name="PERIODIC", &
    2483             :                           description="Use periodic boundary conditions for helium", &
    2484        8530 :                           repeats=.FALSE., default_l_val=.FALSE.)
    2485        8530 :       CALL section_add_keyword(section, keyword)
    2486        8530 :       CALL keyword_release(keyword)
    2487             : 
    2488             :       CALL keyword_create(keyword, __LOCATION__, name="CELL_SIZE", &
    2489             :                           description="PBC unit cell size (NOTE 1: density, number of atoms"// &
    2490             :                           " and volume are interdependent - give only two of them; "// &
    2491             :                           "NOTE 2: for small cell sizes specify NATOMS instead)", &
    2492        8530 :                           repeats=.FALSE., type_of_var=real_t, unit_str="angstrom")
    2493        8530 :       CALL section_add_keyword(section, keyword)
    2494        8530 :       CALL keyword_release(keyword)
    2495             : 
    2496             :       CALL keyword_create(keyword, __LOCATION__, name="CELL_SHAPE", &
    2497             :                           description="PBC unit cell shape for helium", &
    2498             :                           usage="CELL_SHAPE (CUBE|OCTAHEDRON)", &
    2499             :                           default_i_val=helium_cell_shape_cube, &
    2500             :                           enum_c_vals=s2a("CUBE", "OCTAHEDRON"), &
    2501        8530 :                           enum_i_vals=(/helium_cell_shape_cube, helium_cell_shape_octahedron/))
    2502        8530 :       CALL section_add_keyword(section, keyword)
    2503        8530 :       CALL keyword_release(keyword)
    2504             : 
    2505             :       CALL keyword_create(keyword, __LOCATION__, name="DROPLET_RADIUS", &
    2506             :                           description="Reject a move if any of the new positions does not lie within"// &
    2507             :                           "  this range from the center of gravity", &
    2508             :                           repeats=.FALSE., type_of_var=real_t, default_r_val=HUGE(1.0_dp), &
    2509        8530 :                           unit_str="angstrom")
    2510        8530 :       CALL section_add_keyword(section, keyword)
    2511        8530 :       CALL keyword_release(keyword)
    2512             : 
    2513             :       CALL keyword_create(keyword, __LOCATION__, name="DENSITY", &
    2514             :                           description="trial density of helium for determining the helium "// &
    2515             :                           "box size", &
    2516             :                           repeats=.FALSE., &
    2517             :                           default_r_val=cp_unit_to_cp2k(0.02186_dp, "angstrom^-3"), &
    2518        8530 :                           unit_str="angstrom^-3")
    2519        8530 :       CALL section_add_keyword(section, keyword)
    2520        8530 :       CALL keyword_release(keyword)
    2521             : 
    2522             :       CALL keyword_create(keyword, __LOCATION__, name="PRESAMPLE", &
    2523             :                           description="Presample He coordinates before first PIMD step", &
    2524        8530 :                           repeats=.FALSE., default_l_val=.FALSE.)
    2525        8530 :       CALL section_add_keyword(section, keyword)
    2526        8530 :       CALL keyword_release(keyword)
    2527             : 
    2528             :       CALL section_create(subsection, __LOCATION__, name="RDF", &
    2529             :                           description="Radial distribution settings", &
    2530        8530 :                           n_keywords=5, n_subsections=0, repeats=.FALSE.)
    2531             : 
    2532             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    2533             :                           description="Whether or not to actually calculate this property", &
    2534        8530 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2535        8530 :       CALL section_add_keyword(subsection, keyword)
    2536        8530 :       CALL keyword_release(keyword)
    2537             : 
    2538             :       CALL keyword_create(keyword, __LOCATION__, name="MAXR", &
    2539             :                           description="Maximum RDF range, defaults to unit cell size", &
    2540             :                           repeats=.FALSE., type_of_var=real_t, &
    2541        8530 :                           unit_str="angstrom")
    2542        8530 :       CALL section_add_keyword(subsection, keyword)
    2543        8530 :       CALL keyword_release(keyword)
    2544             : 
    2545             :       CALL keyword_create(keyword, __LOCATION__, name="NBIN", &
    2546             :                           description="Number of bins", &
    2547             :                           repeats=.FALSE., &
    2548        8530 :                           default_i_val=250)
    2549        8530 :       CALL section_add_keyword(subsection, keyword)
    2550        8530 :       CALL keyword_release(keyword)
    2551             : 
    2552             :       CALL keyword_create(keyword, __LOCATION__, name="SOLUTE_HE", &
    2553             :                           description="Whether or not to calculate solute-He RDFs (if solute is present)", &
    2554        8530 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    2555        8530 :       CALL section_add_keyword(subsection, keyword)
    2556        8530 :       CALL keyword_release(keyword)
    2557             : 
    2558             :       CALL keyword_create(keyword, __LOCATION__, name="HE_HE", &
    2559             :                           description="Whether or not to calculate He-He RDFs", &
    2560        8530 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2561        8530 :       CALL section_add_keyword(subsection, keyword)
    2562        8530 :       CALL keyword_release(keyword)
    2563             : 
    2564        8530 :       CALL section_add_subsection(section, subsection)
    2565        8530 :       CALL section_release(subsection)
    2566             : 
    2567        8530 :       NULLIFY (subsection)
    2568             :       CALL section_create(subsection, __LOCATION__, name="RHO", &
    2569             :                           description="Spatial distribution settings", &
    2570        8530 :                           n_keywords=10, n_subsections=0, repeats=.FALSE.)
    2571             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    2572             :                           description="Whether or not to actually calculate densities "// &
    2573             :                           "(requires significant amount of memory, depending on the value of NBIN)", &
    2574        8530 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    2575        8530 :       CALL section_add_keyword(subsection, keyword)
    2576        8530 :       CALL keyword_release(keyword)
    2577             :       CALL keyword_create(keyword, __LOCATION__, name="NBIN", &
    2578             :                           description="Number of grid points in each direction for density binning", &
    2579             :                           repeats=.FALSE., &
    2580        8530 :                           default_i_val=100)
    2581        8530 :       CALL section_add_keyword(subsection, keyword)
    2582        8530 :       CALL keyword_release(keyword)
    2583             :       !
    2584             :       CALL keyword_create(keyword, __LOCATION__, name="MIN_CYCLE_LENGTHS_WDG", &
    2585             :                           description="Density of winding paths "// &
    2586             :                           "not shorter than the given length", &
    2587             :                           repeats=.FALSE., usage="<INT> <INT> .. <INT>", &
    2588        8530 :                           type_of_var=integer_t, n_var=-1)
    2589        8530 :       CALL section_add_keyword(subsection, keyword)
    2590        8530 :       CALL keyword_release(keyword)
    2591             :       !
    2592             :       CALL keyword_create(keyword, __LOCATION__, name="MIN_CYCLE_LENGTHS_NON", &
    2593             :                           description="Density of non-winding paths "// &
    2594             :                           "not shorter than the given length", &
    2595             :                           repeats=.FALSE., usage="<INT> <INT> .. <INT>", &
    2596        8530 :                           type_of_var=integer_t, n_var=-1)
    2597        8530 :       CALL section_add_keyword(subsection, keyword)
    2598        8530 :       CALL keyword_release(keyword)
    2599             :       !
    2600             :       CALL keyword_create(keyword, __LOCATION__, name="MIN_CYCLE_LENGTHS_ALL", &
    2601             :                           description="Density of all paths "// &
    2602             :                           "not shorter than the given length", &
    2603             :                           repeats=.FALSE., usage="<INT> <INT> .. <INT>", &
    2604        8530 :                           type_of_var=integer_t, n_var=-1)
    2605        8530 :       CALL section_add_keyword(subsection, keyword)
    2606        8530 :       CALL keyword_release(keyword)
    2607             :       !
    2608             :       CALL keyword_create(keyword, __LOCATION__, name="ATOM_NUMBER", &
    2609             :                           description="Atom number density", &
    2610             :                           repeats=.FALSE., &
    2611             :                           type_of_var=logical_t, &
    2612             :                           default_l_val=.TRUE., &
    2613        8530 :                           lone_keyword_l_val=.TRUE.)
    2614        8530 :       CALL section_add_keyword(subsection, keyword)
    2615        8530 :       CALL keyword_release(keyword)
    2616             :       !
    2617             :       CALL keyword_create(keyword, __LOCATION__, name="PROJECTED_AREA_2", &
    2618             :                           description="Projected area squared density, A*A(r)", &
    2619             :                           repeats=.FALSE., &
    2620             :                           type_of_var=logical_t, &
    2621             :                           default_l_val=.FALSE., &
    2622        8530 :                           lone_keyword_l_val=.TRUE.)
    2623        8530 :       CALL section_add_keyword(subsection, keyword)
    2624        8530 :       CALL keyword_release(keyword)
    2625             :       !
    2626             :       CALL keyword_create(keyword, __LOCATION__, name="WINDING_NUMBER_2", &
    2627             :                           description="Winding number squared density, W*W(r)", &
    2628             :                           repeats=.FALSE., &
    2629             :                           type_of_var=logical_t, &
    2630             :                           default_l_val=.FALSE., &
    2631        8530 :                           lone_keyword_l_val=.TRUE.)
    2632        8530 :       CALL section_add_keyword(subsection, keyword)
    2633        8530 :       CALL keyword_release(keyword)
    2634             :       !
    2635             :       CALL keyword_create(keyword, __LOCATION__, name="WINDING_CYCLE_2", &
    2636             :                           description="Winding number squared density, W^2(r)", &
    2637             :                           repeats=.FALSE., &
    2638             :                           type_of_var=logical_t, &
    2639             :                           default_l_val=.FALSE., &
    2640        8530 :                           lone_keyword_l_val=.TRUE.)
    2641        8530 :       CALL section_add_keyword(subsection, keyword)
    2642        8530 :       CALL keyword_release(keyword)
    2643             :       !
    2644             :       CALL keyword_create(keyword, __LOCATION__, name="MOMENT_OF_INERTIA", &
    2645             :                           description="Moment of inertia density", &
    2646             :                           repeats=.FALSE., &
    2647             :                           type_of_var=logical_t, &
    2648             :                           default_l_val=.FALSE., &
    2649        8530 :                           lone_keyword_l_val=.TRUE.)
    2650        8530 :       CALL section_add_keyword(subsection, keyword)
    2651        8530 :       CALL keyword_release(keyword)
    2652             : 
    2653        8530 :       CALL section_add_subsection(section, subsection)
    2654        8530 :       CALL section_release(subsection)
    2655             :       ! end of subsection RHO
    2656             : 
    2657        8530 :       CALL create_coord_section(subsection, "HELIUM")
    2658        8530 :       CALL section_add_subsection(section, subsection)
    2659        8530 :       CALL section_release(subsection)
    2660             : 
    2661             :       CALL section_create(subsection, __LOCATION__, name="PERM", &
    2662             :                           description="Permutation state used for restart", &
    2663        8530 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2664             :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    2665             :                           description="Specify particle index permutation for every "// &
    2666             :                           "helium atom", repeats=.TRUE., usage="<INT> <INT> .. <INT>", &
    2667        8530 :                           type_of_var=integer_t, n_var=-1)
    2668        8530 :       CALL section_add_keyword(subsection, keyword)
    2669        8530 :       CALL keyword_release(keyword)
    2670        8530 :       CALL section_add_subsection(section, subsection)
    2671        8530 :       CALL section_release(subsection)
    2672             : 
    2673             :       CALL section_create(subsection, __LOCATION__, name="AVERAGES", &
    2674             :                           description="Average properties (used for restarts)", &
    2675        8530 :                           n_keywords=7, n_subsections=0, repeats=.FALSE.)
    2676             :       CALL keyword_create(keyword, __LOCATION__, name="PROJECTED_AREA", &
    2677             :                           description="Projected area vector for all environments", &
    2678             :                           repeats=.TRUE., usage="<REAL> <REAL> .. <REAL>", &
    2679        8530 :                           type_of_var=real_t, n_var=-1)
    2680        8530 :       CALL section_add_keyword(subsection, keyword)
    2681        8530 :       CALL keyword_release(keyword)
    2682             :       CALL keyword_create(keyword, __LOCATION__, name="PROJECTED_AREA_2", &
    2683             :                           description="Projected area vector squared for all environments", &
    2684             :                           repeats=.TRUE., usage="<REAL> <REAL> .. <REAL>", &
    2685        8530 :                           type_of_var=real_t, n_var=-1)
    2686        8530 :       CALL section_add_keyword(subsection, keyword)
    2687        8530 :       CALL keyword_release(keyword)
    2688             :       CALL keyword_create(keyword, __LOCATION__, name="WINDING_NUMBER_2", &
    2689             :                           description="Winding number vector squared for all environments", &
    2690             :                           repeats=.TRUE., usage="<REAL> <REAL> .. <REAL>", &
    2691        8530 :                           type_of_var=real_t, n_var=-1)
    2692        8530 :       CALL section_add_keyword(subsection, keyword)
    2693        8530 :       CALL keyword_release(keyword)
    2694             :       CALL keyword_create(keyword, __LOCATION__, name="MOMENT_OF_INERTIA", &
    2695             :                           description="Moment of inertia vector for all environments", &
    2696             :                           repeats=.TRUE., usage="<REAL> <REAL> .. <REAL>", &
    2697        8530 :                           type_of_var=real_t, n_var=-1)
    2698        8530 :       CALL section_add_keyword(subsection, keyword)
    2699        8530 :       CALL keyword_release(keyword)
    2700             :       CALL keyword_create(keyword, __LOCATION__, name="RDF", &
    2701             :                           description="Radial distributions averaged over all environments", &
    2702             :                           repeats=.TRUE., usage="<REAL> <REAL> .. <REAL>", &
    2703        8530 :                           type_of_var=real_t, n_var=-1)
    2704        8530 :       CALL section_add_keyword(subsection, keyword)
    2705        8530 :       CALL keyword_release(keyword)
    2706             :       CALL keyword_create(keyword, __LOCATION__, name="RHO", &
    2707             :                           description="Spatial distributions averaged over all environments", &
    2708             :                           repeats=.TRUE., usage="<REAL> <REAL> .. <REAL>", &
    2709        8530 :                           type_of_var=real_t, n_var=-1)
    2710        8530 :       CALL section_add_keyword(subsection, keyword)
    2711        8530 :       CALL keyword_release(keyword)
    2712             :       CALL keyword_create(keyword, __LOCATION__, name="IWEIGHT", &
    2713             :                           description="Weight for the restarted quantities "// &
    2714             :                           "(number of MC steps used to calculate the accumulated averages)", &
    2715             :                           repeats=.FALSE., &
    2716        8530 :                           default_i_val=0)
    2717        8530 :       CALL section_add_keyword(subsection, keyword)
    2718        8530 :       CALL keyword_release(keyword)
    2719        8530 :       CALL section_add_subsection(section, subsection)
    2720        8530 :       CALL section_release(subsection)
    2721             : 
    2722             :       CALL section_create(subsection, __LOCATION__, name="FORCE", &
    2723             :                           description="Forces exerted by the helium on the solute system"// &
    2724             :                           " (used for restarts)", &
    2725        8530 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2726             :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    2727             :                           description="Number of real values should be 3 * "// &
    2728             :                           "<num_solute_atoms> * <num_solute_beads>", repeats=.TRUE., &
    2729             :                           usage="<REAL> <REAL> .. <REAL>", type_of_var=real_t, &
    2730        8530 :                           n_var=-1)
    2731        8530 :       CALL section_add_keyword(subsection, keyword)
    2732        8530 :       CALL keyword_release(keyword)
    2733        8530 :       CALL section_add_subsection(section, subsection)
    2734        8530 :       CALL section_release(subsection)
    2735             : 
    2736             :       CALL section_create(subsection, __LOCATION__, name="RNG_STATE", &
    2737             :                           description="Random number generator state for all processors", &
    2738        8530 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    2739             :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    2740             :                           description="Three real arrays of DIMENSION(3,2) times two RNG "// &
    2741             :                           "streams - 36 real values per processor", &
    2742             :                           repeats=.TRUE., usage="automatically filled, do not edit by hand", &
    2743        8530 :                           type_of_var=real_t, n_var=-1)
    2744        8530 :       CALL section_add_keyword(subsection, keyword)
    2745        8530 :       CALL keyword_release(keyword)
    2746        8530 :       CALL section_add_subsection(section, subsection)
    2747        8530 :       CALL section_release(subsection)
    2748             : 
    2749             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    2750             :                           description="The section that controls the output of the helium code", &
    2751        8530 :                           n_keywords=16, n_subsections=0, repeats=.FALSE.)
    2752             : 
    2753             :       ! *************************************************************************
    2754             :       !> Printkeys for properties output
    2755             :       ! *************************************************************************
    2756        8530 :       NULLIFY (print_key)
    2757             : 
    2758             :       ! Properties printed at SILENT print level
    2759             :       !
    2760             : 
    2761             :       ! Properties printed at LOW print level
    2762             :       !
    2763             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ENERGY", &
    2764             :                                        description="Controls the output of helium energies"// &
    2765             :                                        " (averaged over MC step)", &
    2766        8530 :                                        print_level=low_print_level, common_iter_levels=1)
    2767        8530 :       CALL section_add_subsection(subsection, print_key)
    2768        8530 :       CALL section_release(print_key)
    2769             :       !
    2770             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROJECTED_AREA_2_AVG", &
    2771             :                                        description="Controls the output of the average projected area squared vector", &
    2772        8530 :                                        print_level=low_print_level, common_iter_levels=1)
    2773        8530 :       CALL section_add_subsection(subsection, print_key)
    2774        8530 :       CALL section_release(print_key)
    2775             :       !
    2776             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "WINDING_NUMBER_2_AVG", &
    2777             :                                        description="Controls the output of the average winding number vector squared", &
    2778        8530 :                                        print_level=low_print_level, common_iter_levels=1)
    2779        8530 :       CALL section_add_subsection(subsection, print_key)
    2780        8530 :       CALL section_release(print_key)
    2781             :       !
    2782             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "MOMENT_OF_INERTIA_AVG", &
    2783             :                                        description="Controls the output of the average moment of inertia vector", &
    2784        8530 :                                        print_level=low_print_level, common_iter_levels=1)
    2785        8530 :       CALL section_add_subsection(subsection, print_key)
    2786        8530 :       CALL section_release(print_key)
    2787             : 
    2788             :       ! Properties printed at MEDIUM print level
    2789             :       !
    2790             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RDF", &
    2791             :                                        description="Controls the output of helium radial distribution functions", &
    2792        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2793        8530 :       CALL section_add_subsection(subsection, print_key)
    2794        8530 :       CALL section_release(print_key)
    2795             : 
    2796             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RHO", &
    2797             :                                        description="Controls the output of the helium density "// &
    2798             :                                        "(Gaussian cube file format)", &
    2799             :                                        each_iter_names=s2a("PINT"), each_iter_values=(/100/), &
    2800             :                                        print_level=medium_print_level, common_iter_levels=1, &
    2801        8530 :                                        add_last=add_last_numeric)
    2802             :       CALL keyword_create(keyword, __LOCATION__, name="BACKUP_COPIES", &
    2803             :                           description="Specifies the maximum number of backup copies.", &
    2804             :                           usage="BACKUP_COPIES {int}", &
    2805        8530 :                           default_i_val=1)
    2806        8530 :       CALL section_add_keyword(print_key, keyword)
    2807        8530 :       CALL keyword_release(keyword)
    2808        8530 :       CALL section_add_subsection(subsection, print_key)
    2809        8530 :       CALL section_release(print_key)
    2810             :       !
    2811             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROJECTED_AREA", &
    2812             :                                        description="Controls the output of the projected area vector", &
    2813        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2814        8530 :       CALL section_add_subsection(subsection, print_key)
    2815        8530 :       CALL section_release(print_key)
    2816             :       !
    2817             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "WINDING_NUMBER", &
    2818             :                                        description="Controls the output of the winding number vector", &
    2819        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2820        8530 :       CALL section_add_subsection(subsection, print_key)
    2821        8530 :       CALL section_release(print_key)
    2822             :       !
    2823             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "MOMENT_OF_INERTIA", &
    2824             :                                        description="Controls the output of the moment of inertia vector", &
    2825        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2826        8530 :       CALL section_add_subsection(subsection, print_key)
    2827        8530 :       CALL section_release(print_key)
    2828             :       !
    2829             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PLENGTH", &
    2830             :                                        description="Controls the output of the helium permutation length", &
    2831        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2832        8530 :       CALL section_add_subsection(subsection, print_key)
    2833        8530 :       CALL section_release(print_key)
    2834             : 
    2835             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ACTION", &
    2836             :                                        description="Controls the output of the total helium action", &
    2837        8530 :                                        print_level=medium_print_level, common_iter_levels=1)
    2838        8530 :       CALL section_add_subsection(subsection, print_key)
    2839        8530 :       CALL section_release(print_key)
    2840             : 
    2841             :       ! Properties printed at HIGH print level
    2842             :       !
    2843             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "COORDINATES", &
    2844             :                                        description="Controls the output of helium coordinates", &
    2845        8530 :                                        print_level=high_print_level, common_iter_levels=1)
    2846             :       CALL keyword_create(keyword, __LOCATION__, name="FORMAT", &
    2847             :                           description="Output file format for the coordinates", &
    2848             :                           usage="FORMAT (PDB|XYZ)", &
    2849             :                           default_i_val=fmt_id_pdb, &
    2850             :                           enum_c_vals=s2a("PDB", "XYZ"), &
    2851             :                           enum_i_vals=(/fmt_id_pdb, fmt_id_xyz/), &
    2852             :                           enum_desc=s2a("Bead coordinates and connectivity is written in PDB format", &
    2853        8530 :                                         "Only bead coordinates are written in XYZ format"))
    2854        8530 :       CALL section_add_keyword(print_key, keyword)
    2855        8530 :       CALL keyword_release(keyword)
    2856        8530 :       CALL section_add_subsection(subsection, print_key)
    2857        8530 :       CALL section_release(print_key)
    2858             :       !
    2859             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PERM", &
    2860             :                                        description="Controls the output of the helium permutation state", &
    2861        8530 :                                        print_level=high_print_level, common_iter_levels=1)
    2862             :       CALL keyword_create(keyword, __LOCATION__, name="FORMAT", &
    2863             :                           description="Output format for the permutation", &
    2864             :                           usage="FORMAT (CYCLE|PLAIN)", &
    2865             :                           default_i_val=perm_cycle, &
    2866             :                           enum_c_vals=s2a("CYCLE", "PLAIN"), &
    2867             :                           enum_i_vals=(/perm_cycle, perm_plain/), &
    2868             :                           enum_desc=s2a( &
    2869             :                           "Cycle notation with winding cycles enclosed"// &
    2870             :                           " in '[...]' and non-winding ones enclosed in '(...)'", &
    2871        8530 :                           "Plain permutation output, i.e. P(1) ... P(N)"))
    2872        8530 :       CALL section_add_keyword(print_key, keyword)
    2873        8530 :       CALL keyword_release(keyword)
    2874        8530 :       CALL section_add_subsection(subsection, print_key)
    2875        8530 :       CALL section_release(print_key)
    2876             : 
    2877             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "FORCES", &
    2878             :                                        description="Controls the output of the helium forces on the solute", &
    2879        8530 :                                        print_level=high_print_level, common_iter_levels=1)
    2880        8530 :       CALL section_add_subsection(subsection, print_key)
    2881        8530 :       CALL section_release(print_key)
    2882             : 
    2883             :       ! Properties printed at DEBUG print level
    2884             :       !
    2885             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ACCEPTS", &
    2886             :                                        description="Controls the output of the helium acceptance data", &
    2887        8530 :                                        print_level=debug_print_level, common_iter_levels=1)
    2888        8530 :       CALL section_add_subsection(subsection, print_key)
    2889        8530 :       CALL section_release(print_key)
    2890             :       !
    2891             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "FORCES_INST", &
    2892             :                                        description="Controls the output of the instantaneous helium forces on the solute", &
    2893        8530 :                                        print_level=debug_print_level, common_iter_levels=1)
    2894        8530 :       CALL section_add_subsection(subsection, print_key)
    2895        8530 :       CALL section_release(print_key)
    2896             : 
    2897        8530 :       CALL section_add_subsection(section, subsection)
    2898        8530 :       CALL section_release(subsection)
    2899             : 
    2900        8530 :       RETURN
    2901             :    END SUBROUTINE create_helium_section
    2902             : 
    2903             : END MODULE input_cp2k_motion

Generated by: LCOV version 1.15