LCOV - code coverage report
Current view: top level - src/start - input_cp2k_motion.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:06f838d) Lines: 100.0 % 1156 1156
Test Date: 2026-06-05 07:04:50 Functions: 100.0 % 21 21

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

Generated by: LCOV version 2.0-1