LCOV - code coverage report
Current view: top level - src/motion - input_cp2k_md.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:374b731) Lines: 497 497 100.0 %
Date: 2024-05-06 07:15:15 Functions: 15 15 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : 
       8             : ! **************************************************************************************************
       9             : !> \par History
      10             : !>      - taken out of input_cp2k_motion
      11             : !> \author Ole Schuett
      12             : ! **************************************************************************************************
      13             : 
      14             : MODULE input_cp2k_md
      15             :    USE bibliography,                    ONLY: &
      16             :         Evans1983, Guidon2008, Kantorovich2008, Kantorovich2008a, Kuhne2007, Minary2003, &
      17             :         Rengaraj2020, Ricci2003, Tuckerman1992, VandeVondele2002, West2006
      18             :    USE cp_output_handling,              ONLY: add_last_numeric,&
      19             :                                               cp_print_key_section_create,&
      20             :                                               debug_print_level,&
      21             :                                               high_print_level,&
      22             :                                               low_print_level,&
      23             :                                               medium_print_level
      24             :    USE cp_units,                        ONLY: cp_unit_to_cp2k
      25             :    USE input_constants,                 ONLY: &
      26             :         isokin_ensemble, langevin_ensemble, md_init_default, md_init_vib, npe_f_ensemble, &
      27             :         npe_i_ensemble, nph_ensemble, nph_uniaxial_damped_ensemble, nph_uniaxial_ensemble, &
      28             :         npt_f_ensemble, npt_i_ensemble, npt_ia_ensemble, nve_ensemble, nvt_adiabatic_ensemble, &
      29             :         nvt_ensemble, reftraj_ensemble
      30             :    USE input_cp2k_barostats,            ONLY: create_barostat_section
      31             :    USE input_cp2k_thermostats,          ONLY: create_region_section,&
      32             :                                               create_thermo_fast_section,&
      33             :                                               create_thermo_slow_section,&
      34             :                                               create_thermostat_section
      35             :    USE input_keyword_types,             ONLY: keyword_create,&
      36             :                                               keyword_release,&
      37             :                                               keyword_type
      38             :    USE input_section_types,             ONLY: section_add_keyword,&
      39             :                                               section_add_subsection,&
      40             :                                               section_create,&
      41             :                                               section_release,&
      42             :                                               section_type
      43             :    USE input_val_types,                 ONLY: integer_t,&
      44             :                                               lchar_t,&
      45             :                                               real_t
      46             :    USE kinds,                           ONLY: dp
      47             :    USE reftraj_types,                   ONLY: REFTRAJ_EVAL_ENERGY,&
      48             :                                               REFTRAJ_EVAL_ENERGY_FORCES,&
      49             :                                               REFTRAJ_EVAL_NONE
      50             :    USE string_utilities,                ONLY: s2a
      51             : #include "../base/base_uses.f90"
      52             : 
      53             :    IMPLICIT NONE
      54             :    PRIVATE
      55             : 
      56             :    LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
      57             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_md'
      58             : 
      59             :    PUBLIC :: create_md_section
      60             : 
      61             : CONTAINS
      62             : 
      63             : ! **************************************************************************************************
      64             : !> \brief ...
      65             : !> \param section will contain the md section
      66             : !> \author fawzi
      67             : ! **************************************************************************************************
      68       28498 :    SUBROUTINE create_md_section(section)
      69             :       TYPE(section_type), POINTER                        :: section
      70             : 
      71             :       TYPE(keyword_type), POINTER                        :: keyword
      72             :       TYPE(section_type), POINTER                        :: subsection
      73             : 
      74       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
      75             :       CALL section_create(section, __LOCATION__, name="MD", &
      76             :                           description="This section defines the whole set of parameters needed perform an MD run.", &
      77       28498 :                           n_keywords=13, n_subsections=6, repeats=.FALSE.)
      78             : 
      79       28498 :       NULLIFY (keyword, subsection)
      80             :       CALL keyword_create(keyword, __LOCATION__, name="ensemble", &
      81             :                           description="The ensemble/integrator that you want to use for MD propagation", &
      82             :                           usage="ensemble nve", &
      83             :                           default_i_val=nve_ensemble, &
      84             :                           enum_c_vals=s2a("NVE", "NVT", "NPT_I", "NPT_F", "MSST", "MSST_DAMPED", &
      85             :                                           "HYDROSTATICSHOCK", "ISOKIN", "REFTRAJ", "LANGEVIN", "NPE_F", &
      86             :                                           "NPE_I", "NVT_ADIABATIC", "NPT_IA"), &
      87             :                           enum_desc=s2a("constant energy (microcanonical)", &
      88             :                                         "constant temperature and volume (canonical)", &
      89             :                                         "constant temperature and pressure using an isotropic cell", &
      90             :                                         "constant temperature and pressure using a flexible cell", &
      91             :                                         "simulate steady shock (uniaxial)", &
      92             :                                         "simulate steady shock (uniaxial) with extra viscosity", &
      93             :                                         "simulate steady shock with hydrostatic pressure", &
      94             :                                         "constant kinetic energy", &
      95             :                                         "reading frames from a file called reftraj.xyz (e.g. for property calculation)", &
      96             :                                         "langevin dynamics (constant temperature)", &
      97             :                                         "constant pressure ensemble (no thermostat)", &
      98             :                                         "constant pressure ensemble using an isotropic cell (no thermostat)", &
      99             :                                         "adiabatic dynamics in constant temperature and volume ensemble (CAFES)", &
     100             :                                         "NPT_I ensemble with frozen atoms in absolute coordinate"), &
     101             :                           citations=(/Evans1983, VandeVondele2002, Minary2003/), &
     102             :                           enum_i_vals=(/nve_ensemble, nvt_ensemble, npt_i_ensemble, npt_f_ensemble, &
     103             :                                         nph_uniaxial_ensemble, nph_uniaxial_damped_ensemble, nph_ensemble, isokin_ensemble, &
     104             :                                         reftraj_ensemble, langevin_ensemble, npe_f_ensemble, npe_i_ensemble, &
     105      113992 :                                         nvt_adiabatic_ensemble, npt_ia_ensemble/))
     106       28498 :       CALL section_add_keyword(section, keyword)
     107       28498 :       CALL keyword_release(keyword)
     108             : 
     109             :       CALL keyword_create(keyword, __LOCATION__, name="steps", &
     110             :                           description="The number of MD steps to perform, counting from step_start_val. ", &
     111       28498 :                           usage="steps 100", default_i_val=3)
     112       28498 :       CALL section_add_keyword(section, keyword)
     113       28498 :       CALL keyword_release(keyword)
     114             : 
     115             :       CALL keyword_create(keyword, __LOCATION__, name="max_steps", &
     116             :                           description="The number of MD steps to perform, counting from step 1", &
     117       28498 :                           usage="max_steps 100", default_i_val=1000000000)
     118       28498 :       CALL section_add_keyword(section, keyword)
     119       28498 :       CALL keyword_release(keyword)
     120             : 
     121             :       CALL keyword_create(keyword, __LOCATION__, name="timestep", &
     122             :                           description="The length of an integration step (in case RESPA the large TIMESTEP)", &
     123             :                           usage="timestep 1.0", default_r_val=cp_unit_to_cp2k(value=0.5_dp, unit_str="fs"), &
     124       28498 :                           unit_str="fs")
     125       28498 :       CALL section_add_keyword(section, keyword)
     126       28498 :       CALL keyword_release(keyword)
     127             : 
     128             :       CALL keyword_create(keyword, __LOCATION__, name="step_start_val", &
     129             :                           description="The starting step value for the MD", usage="step_start_val <integer>", &
     130       28498 :                           default_i_val=0)
     131       28498 :       CALL section_add_keyword(section, keyword)
     132       28498 :       CALL keyword_release(keyword)
     133             : 
     134             :       CALL keyword_create(keyword, __LOCATION__, name="time_start_val", &
     135             :                           description="The starting timer value for the MD", &
     136             :                           usage="time_start_val <real>", default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="fs"), &
     137       28498 :                           unit_str="fs")
     138       28498 :       CALL section_add_keyword(section, keyword)
     139       28498 :       CALL keyword_release(keyword)
     140             : 
     141             :       CALL keyword_create(keyword, __LOCATION__, name="econs_start_val", &
     142             :                           description="The starting  value of the conserved quantity", &
     143             :                           usage="econs_start_val <real>", default_r_val=0.0_dp, &
     144       28498 :                           unit_str="hartree")
     145       28498 :       CALL section_add_keyword(section, keyword)
     146       28498 :       CALL keyword_release(keyword)
     147             : 
     148             :       CALL keyword_create(keyword, __LOCATION__, name="temperature", &
     149             :                           description="The temperature in K used to initialize "// &
     150             :                           "the velocities with init and pos restart, and in the NPT/NVT simulations", &
     151             :                           usage="temperature 325.0", default_r_val=cp_unit_to_cp2k(value=300.0_dp, unit_str="K"), &
     152       28498 :                           unit_str="K")
     153       28498 :       CALL section_add_keyword(section, keyword)
     154       28498 :       CALL keyword_release(keyword)
     155             : 
     156             :       CALL keyword_create(keyword, __LOCATION__, name="temp_tol", &
     157             :                           variants=s2a("temp_to", "temperature_tolerance"), &
     158             :                           description="The maximum accepted deviation of the (global) temperature "// &
     159             :                           "from the desired target temperature before a rescaling of the velocites "// &
     160             :                           "is performed. If it is 0 no rescaling is performed. NOTE: This keyword is "// &
     161             :                           "obsolescent; Using a CSVR thermostat with a short timeconstant is "// &
     162             :                           "recommended as a better alternative.", &
     163       28498 :                           usage="temp_tol 0.0", default_r_val=0.0_dp, unit_str='K')
     164       28498 :       CALL section_add_keyword(section, keyword)
     165       28498 :       CALL keyword_release(keyword)
     166             : 
     167             :       CALL keyword_create(keyword, __LOCATION__, name="temp_kind", &
     168             :                           description="Compute the temperature per each kind separately", &
     169             :                           usage="temp_kind LOGICAL", &
     170       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     171       28498 :       CALL section_add_keyword(section, keyword)
     172       28498 :       CALL keyword_release(keyword)
     173             : 
     174             :       CALL keyword_create(keyword, __LOCATION__, name="scale_temp_kind", &
     175             :                           description="When necessary rescale the temperature per each kind separately", &
     176             :                           usage="scale_temp_kind LOGICAL", &
     177       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     178       28498 :       CALL section_add_keyword(section, keyword)
     179       28498 :       CALL keyword_release(keyword)
     180             : 
     181             :       CALL keyword_create(keyword, __LOCATION__, name="comvel_tol", &
     182             :                           description="The maximum accepted velocity of the center of mass. "// &
     183             :                           "With Shell-Model, comvel may drift if MD%THERMOSTAT%REGION /= GLOBAL ", &
     184       28498 :                           usage="comvel_tol 0.1", type_of_var=real_t, n_var=1, unit_str="bohr*au_t^-1")
     185       28498 :       CALL section_add_keyword(section, keyword)
     186       28498 :       CALL keyword_release(keyword)
     187             : 
     188             :       CALL keyword_create(keyword, __LOCATION__, name="angvel_tol", &
     189             :                           description="The maximum accepted angular velocity. This option is ignored "// &
     190             :                           "when the system is periodic. Removes the components of the velocities that "// &
     191             :                           "project on the external rotational degrees of freedom.", &
     192       28498 :                           usage="angvel_tol 0.1", type_of_var=real_t, n_var=1, unit_str="bohr*au_t^-1")
     193       28498 :       CALL section_add_keyword(section, keyword)
     194       28498 :       CALL keyword_release(keyword)
     195             : 
     196             :       CALL keyword_create(keyword, __LOCATION__, name="angvel_zero", &
     197             :                           description="Set the initial angular velocity to zero. This option is ignored "// &
     198             :                           "when the system is periodic or when initial velocities are defined. Technically, "// &
     199             :                           "the part of the random initial velocities that projects on the external "// &
     200             :                           "rotational degrees of freedom is subtracted.", &
     201             :                           usage="angvel_zero LOGICAL", &
     202       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     203       28498 :       CALL section_add_keyword(section, keyword)
     204       28498 :       CALL keyword_release(keyword)
     205             : 
     206             :       CALL keyword_create(keyword, __LOCATION__, name="ANNEALING", &
     207             :                           description="Specifies the rescaling factor for annealing velocities. "// &
     208             :                           "Automatically enables the annealing procedure. This scheme works only for ensembles "// &
     209             :                           "that do not have thermostats on particles.", &
     210       28498 :                           usage="annealing <REAL>", default_r_val=1.0_dp)
     211       28498 :       CALL section_add_keyword(section, keyword)
     212       28498 :       CALL keyword_release(keyword)
     213             : 
     214             :       CALL keyword_create(keyword, __LOCATION__, name="ANNEALING_CELL", &
     215             :                           description="Specifies the rescaling factor for annealing velocities of the CELL "// &
     216             :                           "Automatically enables the annealing procedure for the CELL. This scheme works only "// &
     217             :                           "for ensambles that do not have thermostat on CELLS velocities.", &
     218       28498 :                           usage="ANNEALING_CELL <REAL>", default_r_val=1.0_dp)
     219       28498 :       CALL section_add_keyword(section, keyword)
     220       28498 :       CALL keyword_release(keyword)
     221             : 
     222             :       CALL keyword_create(keyword, __LOCATION__, name="TEMPERATURE_ANNEALING", &
     223             :                           description="Specifies the rescaling factor for the external temperature. "// &
     224             :                           "This scheme works only for the Langevin ensemble.", &
     225       28498 :                           usage="TEMPERATURE_ANNEALING <REAL>", default_r_val=1.0_dp)
     226       28498 :       CALL section_add_keyword(section, keyword)
     227       28498 :       CALL keyword_release(keyword)
     228             : 
     229             :       CALL keyword_create(keyword, __LOCATION__, name="DISPLACEMENT_TOL", &
     230             :                           description="This keyword sets a maximum atomic displacement "// &
     231             :                           "in each Cartesian direction. "// &
     232             :                           "The maximum velocity is evaluated and if it is too large to remain "// &
     233             :                           "within the assigned limit, the time step is rescaled accordingly, "// &
     234             :                           "and the first half step of the velocity verlet is repeated.", &
     235             :                           usage="DISPLACEMENT_TOL <REAL>", default_r_val=100.0_dp, &
     236       28498 :                           unit_str='angstrom')
     237       28498 :       CALL section_add_keyword(section, keyword)
     238       28498 :       CALL keyword_release(keyword)
     239             : 
     240             :       CALL keyword_create(keyword, __LOCATION__, name="INITIALIZATION_METHOD", &
     241             :                           description="This keyword selects which method to use to initialize MD. "// &
     242             :                           "If velecities are not set explicitly, DEFAULT optioin will assign "// &
     243             :                           "random velocities and then scale according to TEMPERATURE; VIBRATIONAL "// &
     244             :                           "option will then use previously calculated vibrational modes to "// &
     245             :                           "initialise both the atomic positions and velocities so that the "// &
     246             :                           "starting point for MD is as close to canonical ensemble as possible, "// &
     247             :                           "without the need for lengthy equilibration steps. See PRL 96, 115504 "// &
     248             :                           "(2006). The user input atomic positions in this case are expected to "// &
     249             :                           "be already geometry optimised. Further options for VIBRATIONAL mode "// &
     250             :                           "is can be set in INITIAL_VIBRATION subsection. If unspecified, then "// &
     251             :                           "the DEFAULT mode will be used.", &
     252             :                           usage="INITIALIZATION_METHOD DEFAULT", &
     253             :                           default_i_val=md_init_default, &
     254             :                           enum_c_vals=s2a("DEFAULT", "VIBRATIONAL"), &
     255             :                           enum_desc=s2a("Assign random velocities and then scale according to "// &
     256             :                                         "TEMPERATURE", &
     257             :                                         "Initialise positions and velocities to give canonical ensemble "// &
     258             :                                         "with TEMPERATURE, using the method described in PRL 96, 115504 (2006)"), &
     259       28498 :                           enum_i_vals=(/md_init_default, md_init_vib/))
     260       28498 :       CALL section_add_keyword(section, keyword)
     261       28498 :       CALL keyword_release(keyword)
     262             : 
     263       28498 :       CALL create_langevin_section(subsection)
     264       28498 :       CALL section_add_subsection(section, subsection)
     265       28498 :       CALL section_release(subsection)
     266             : 
     267       28498 :       CALL create_msst_section(subsection)
     268       28498 :       CALL section_add_subsection(section, subsection)
     269       28498 :       CALL section_release(subsection)
     270             : 
     271       28498 :       CALL create_barostat_section(subsection)
     272       28498 :       CALL section_add_subsection(section, subsection)
     273       28498 :       CALL section_release(subsection)
     274             : 
     275       28498 :       CALL create_thermostat_section(subsection)
     276       28498 :       CALL section_add_subsection(section, subsection)
     277       28498 :       CALL section_release(subsection)
     278             : 
     279       28498 :       CALL create_respa_section(subsection)
     280       28498 :       CALL section_add_subsection(section, subsection)
     281       28498 :       CALL section_release(subsection)
     282             : 
     283       28498 :       CALL create_shell_section(subsection)
     284       28498 :       CALL section_add_subsection(section, subsection)
     285       28498 :       CALL section_release(subsection)
     286             : 
     287       28498 :       CALL create_adiabatic_section(subsection)
     288       28498 :       CALL section_add_subsection(section, subsection)
     289       28498 :       CALL section_release(subsection)
     290             : 
     291       28498 :       CALL create_softening_section(subsection)
     292       28498 :       CALL section_add_subsection(section, subsection)
     293       28498 :       CALL section_release(subsection)
     294             : 
     295       28498 :       CALL create_reftraj_section(subsection)
     296       28498 :       CALL section_add_subsection(section, subsection)
     297       28498 :       CALL section_release(subsection)
     298             : 
     299       28498 :       CALL create_avgs_section(subsection)
     300       28498 :       CALL section_add_subsection(section, subsection)
     301       28498 :       CALL section_release(subsection)
     302             : 
     303       28498 :       CALL create_thermal_region_section(subsection)
     304       28498 :       CALL section_add_subsection(section, subsection)
     305       28498 :       CALL section_release(subsection)
     306             : 
     307       28498 :       CALL create_md_print_section(subsection)
     308       28498 :       CALL section_add_subsection(section, subsection)
     309       28498 :       CALL section_release(subsection)
     310             : 
     311       28498 :       CALL create_cascade_section(subsection)
     312       28498 :       CALL section_add_subsection(section, subsection)
     313       28498 :       CALL section_release(subsection)
     314             : 
     315       28498 :       CALL create_vib_init_section(subsection)
     316       28498 :       CALL section_add_subsection(section, subsection)
     317       28498 :       CALL section_release(subsection)
     318             : 
     319       28498 :    END SUBROUTINE create_md_section
     320             : 
     321             : ! **************************************************************************************************
     322             : !> \brief Defines LANGEVIN section
     323             : !> \param section ...
     324             : !> \author teo
     325             : ! **************************************************************************************************
     326       28498 :    SUBROUTINE create_langevin_section(section)
     327             :       TYPE(section_type), POINTER                        :: section
     328             : 
     329             :       TYPE(keyword_type), POINTER                        :: keyword
     330             : 
     331       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
     332             :       CALL section_create(section, __LOCATION__, name="Langevin", &
     333             :                           description="Controls the set of parameters to run a Langevin MD. "// &
     334             :                           "The integrator used follows that given in the article by Ricci et al. "// &
     335             :                           "The user can define regions in the system where the atoms inside "// &
     336             :                           "undergoes Langevin MD, while those outside the regions undergoes "// &
     337             :                           "NVE Born Oppenheimer MD. To define the regions, the user should "// &
     338             :                           "use THERMAL_REGION subsection of MOTION%MD. ", &
     339             :                           citations=(/Ricci2003, Kuhne2007, Rengaraj2020/), &
     340      113992 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
     341       28498 :       NULLIFY (keyword)
     342             : 
     343             :       CALL keyword_create(keyword, __LOCATION__, name="gamma", &
     344             :                           description="Gamma parameter for the Langevin dynamics (LD)", &
     345             :                           usage="gamma 0.001", &
     346       28498 :                           default_r_val=0.0_dp, unit_str='fs^-1')
     347       28498 :       CALL section_add_keyword(section, keyword)
     348       28498 :       CALL keyword_release(keyword)
     349             : 
     350             :       CALL keyword_create(keyword, __LOCATION__, name="Noisy_Gamma", &
     351             :                           variants=(/"NoisyGamma"/), &
     352             :                           description="Imaginary Langevin Friction term for LD with noisy forces.", &
     353             :                           citations=(/Kuhne2007/), &
     354       85494 :                           usage="Noisy_Gamma 4.0E-5", default_r_val=0.0_dp, unit_str='fs^-1')
     355       28498 :       CALL section_add_keyword(section, keyword)
     356       28498 :       CALL keyword_release(keyword)
     357             : 
     358             :       CALL keyword_create(keyword, __LOCATION__, name="Shadow_Gamma", &
     359             :                           variants=(/"ShadowGamma"/), &
     360             :                           description="Shadow Langevin Friction term for LD with noisy forces in order to adjust Noisy_Gamma.", &
     361             :                           citations=(/Rengaraj2020/), &
     362       85494 :                           usage="Shadow_Gamma 0.001", default_r_val=0.0_dp, unit_str='fs^-1')
     363       28498 :       CALL section_add_keyword(section, keyword)
     364       28498 :       CALL keyword_release(keyword)
     365       28498 :    END SUBROUTINE create_langevin_section
     366             : 
     367             : ! **************************************************************************************************
     368             : !> \brief Defines print section for MD
     369             : !> \param section ...
     370             : !> \author teo
     371             : ! **************************************************************************************************
     372       28498 :    SUBROUTINE create_md_print_section(section)
     373             :       TYPE(section_type), POINTER                        :: section
     374             : 
     375             :       TYPE(keyword_type), POINTER                        :: keyword
     376             :       TYPE(section_type), POINTER                        :: print_key
     377             : 
     378       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
     379             :       CALL section_create(section, __LOCATION__, name="print", &
     380             :                           description="Controls the printing properties during an MD run", &
     381       28498 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
     382       28498 :       NULLIFY (print_key, keyword)
     383             : 
     384             :       CALL keyword_create(keyword, __LOCATION__, name="FORCE_LAST", &
     385             :                           description="Print the output and restart file if walltime is reached or "// &
     386             :                           "if an external EXIT command is given. It still requires the keyword LAST "// &
     387             :                           "to be present for the specific print key (in case the last step should not "// &
     388             :                           "match with the print_key iteration number).", &
     389             :                           usage="FORCE_LAST LOGICAL", &
     390       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     391       28498 :       CALL section_add_keyword(section, keyword)
     392       28498 :       CALL keyword_release(keyword)
     393             : 
     394             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ENERGY", &
     395             :                                        description="Controls the output the ener file", &
     396             :                                        print_level=low_print_level, common_iter_levels=1, &
     397       28498 :                                        filename="")
     398       28498 :       CALL section_add_subsection(section, print_key)
     399       28498 :       CALL section_release(print_key)
     400             : 
     401             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "SHELL_ENERGY", &
     402             :                                        description="Controls the output of the shell-energy file (only if shell-model)", &
     403             :                                        print_level=medium_print_level, common_iter_levels=1, &
     404       28498 :                                        filename="")
     405       28498 :       CALL section_add_subsection(section, print_key)
     406       28498 :       CALL section_release(print_key)
     407             : 
     408             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "TEMP_KIND", &
     409             :                                        description="Controls the output of the temperature"// &
     410             :                                        " computed separately for each kind", &
     411             :                                        print_level=high_print_level, common_iter_levels=1, &
     412       28498 :                                        filename="")
     413       28498 :       CALL section_add_subsection(section, print_key)
     414       28498 :       CALL section_release(print_key)
     415             : 
     416             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "TEMP_SHELL_KIND", &
     417             :                                        description="Controls the output of the temperature of the"// &
     418             :                                        " shell-core motion computed separately for each kind", &
     419             :                                        print_level=high_print_level, common_iter_levels=1, &
     420       28498 :                                        filename="")
     421       28498 :       CALL section_add_subsection(section, print_key)
     422       28498 :       CALL section_release(print_key)
     423             : 
     424             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "CENTER_OF_MASS", &
     425             :                                        description="Controls the printing of COM velocity during an MD", &
     426             :                                        print_level=medium_print_level, common_iter_levels=1, &
     427       28498 :                                        filename="__STD_OUT__")
     428       28498 :       CALL section_add_subsection(section, print_key)
     429       28498 :       CALL section_release(print_key)
     430             : 
     431             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "COEFFICIENTS", &
     432             :                                        description="Controls the printing of coefficients during an MD run.", &
     433             :                                        print_level=medium_print_level, common_iter_levels=1, &
     434       28498 :                                        filename="")
     435       28498 :       CALL section_add_subsection(section, print_key)
     436       28498 :       CALL section_release(print_key)
     437             : 
     438             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "ROTATIONAL_INFO", &
     439             :                                        description="Controls the printing basic info during the calculation of the "// &
     440             :                                        "translational/rotational degrees of freedom.", print_level=low_print_level, &
     441       28498 :                                        add_last=add_last_numeric, filename="__STD_OUT__")
     442             :       CALL keyword_create(keyword, __LOCATION__, name="COORDINATES", &
     443             :                           description="Prints atomic coordinates in the standard orientation. "// &
     444             :                           "Coordinates are not affected during the calculation.", &
     445       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     446       28498 :       CALL section_add_keyword(print_key, keyword)
     447       28498 :       CALL keyword_release(keyword)
     448       28498 :       CALL section_add_subsection(section, print_key)
     449       28498 :       CALL section_release(print_key)
     450             : 
     451             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
     452             :                                        description="Controls the printing of basic and summary information during the"// &
     453             :                                        " Molecular Dynamics", &
     454       28498 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     455       28498 :       CALL section_add_subsection(section, print_key)
     456       28498 :       CALL section_release(print_key)
     457       28498 :    END SUBROUTINE create_md_print_section
     458             : 
     459             : ! **************************************************************************************************
     460             : !> \brief Defines parameters for RESPA integration scheme
     461             : !> \param section will contain the coeff section
     462             : !> \author teo
     463             : ! **************************************************************************************************
     464       28498 :    SUBROUTINE create_respa_section(section)
     465             :       TYPE(section_type), POINTER                        :: section
     466             : 
     467             :       TYPE(keyword_type), POINTER                        :: keyword
     468             : 
     469       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
     470             : 
     471             :       CALL section_create(section, __LOCATION__, name="RESPA", &
     472             :                           description="Multiple timestep integration based on RESPA (implemented for NVE only)."// &
     473             :                           " RESPA exploits multiple force_eval."// &
     474             :                           " In this case the order of the force_eval maps"// &
     475             :                           " the order of the respa shells from the slowest to the fastest force evaluation."// &
     476             :                           " If force_evals share the same subsys, it's enough then to specify the"// &
     477             :                           " subsys in the force_eval corresponding at the first index in the multiple_force_eval list."// &
     478             :                           " Can be used to speedup classical and ab initio MD simulations.", &
     479             :                           n_keywords=1, n_subsections=0, repeats=.FALSE., &
     480       85494 :                           citations=(/Tuckerman1992, Guidon2008/))
     481             : 
     482       28498 :       NULLIFY (keyword)
     483             :       CALL keyword_create(keyword, __LOCATION__, name="FREQUENCY", &
     484             :                           description="The number of reference MD steps between two RESPA corrections.", &
     485       28498 :                           usage="FREQUENCY <INTEGER>", default_i_val=5)
     486       28498 :       CALL section_add_keyword(section, keyword)
     487       28498 :       CALL keyword_release(keyword)
     488             : 
     489       28498 :    END SUBROUTINE create_respa_section
     490             : 
     491             : ! **************************************************************************************************
     492             : !> \brief Defines parameters for REFTRAJ analysis
     493             : !> \param section will contain the coeff section
     494             : !> \author teo
     495             : ! **************************************************************************************************
     496       28498 :    SUBROUTINE create_reftraj_section(section)
     497             :       TYPE(section_type), POINTER                        :: section
     498             : 
     499             :       TYPE(keyword_type), POINTER                        :: keyword
     500             :       TYPE(section_type), POINTER                        :: print_key, subsection
     501             : 
     502       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
     503             : 
     504             :       CALL section_create(section, __LOCATION__, name="REFTRAJ", &
     505             :                           description="Loads an external trajectory file and performs analysis on the"// &
     506             :                           " loaded snapshots.", &
     507       28498 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
     508             : 
     509       28498 :       NULLIFY (keyword, print_key, subsection)
     510             : 
     511             :       CALL keyword_create(keyword, __LOCATION__, name="TRAJ_FILE_NAME", &
     512             :                           description="Specify the filename where the trajectory is stored. "// &
     513             :                           "If you built your own trajectory file make sure it has the trajectory format. "// &
     514             :                           'In particular, each structure has to be enumerated using " i = ..."', &
     515             :                           repeats=.FALSE., &
     516       28498 :                           usage="TRAJ_FILE_NAME <CHARACTER>", default_lc_val="reftraj.xyz")
     517       28498 :       CALL section_add_keyword(section, keyword)
     518       28498 :       CALL keyword_release(keyword)
     519             : 
     520             :       CALL keyword_create(keyword, __LOCATION__, name="CELL_FILE_NAME", &
     521             :                           description="Specify the filename where the cell is stored "// &
     522             :                           "(for trajectories generated within variable cell ensembles).", repeats=.FALSE., &
     523       28498 :                           usage="CELL_FILE_NAME <CHARACTER>", default_lc_val="reftraj.cell")
     524       28498 :       CALL section_add_keyword(section, keyword)
     525       28498 :       CALL keyword_release(keyword)
     526             : 
     527             :       CALL keyword_create( &
     528             :          keyword, __LOCATION__, name="VARIABLE_VOLUME", &
     529             :          description="Enables the possibility to read a CELL file with information on the CELL size during the MD.", &
     530       28498 :          repeats=.FALSE., default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     531       28498 :       CALL section_add_keyword(section, keyword)
     532       28498 :       CALL keyword_release(keyword)
     533             : 
     534             :       CALL keyword_create(keyword, __LOCATION__, name="FIRST_SNAPSHOT", &
     535             :                           description="Index of the snapshot stored in the trajectory file "// &
     536             :                           "from which to start a REFTRAJ run", &
     537       28498 :                           repeats=.FALSE., usage="FIRST_SNAPSHOT <INTEGER>", default_i_val=1)
     538       28498 :       CALL section_add_keyword(section, keyword)
     539       28498 :       CALL keyword_release(keyword)
     540             : 
     541             :       CALL keyword_create(keyword, __LOCATION__, name="LAST_SNAPSHOT", &
     542             :                           description="Index of the last snapshot stored in the trajectory file "// &
     543             :                           "that is read along a REFTRAJ run. Must be specified as default is 0. "// &
     544             :                           "Must be specified exactly as LAST_SNAPSHOT = FIRST_SNAPSHOT + STRIDE*(number of strides) "// &
     545             :                           "to avoid an error 'Unexpected EOF'. Note that STRIDE*(number of strides) "// &
     546             :                           "is simply the number of steps between the first to last snapshot.", &
     547       28498 :                           repeats=.FALSE., usage="LAST_SNAPSHOT", default_i_val=0)
     548       28498 :       CALL section_add_keyword(section, keyword)
     549       28498 :       CALL keyword_release(keyword)
     550             : 
     551             :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
     552             :                           description=" Stride in number of snapshot for the  reftraj analysis", &
     553       28498 :                           repeats=.FALSE., usage="STRIDE", default_i_val=1)
     554       28498 :       CALL section_add_keyword(section, keyword)
     555       28498 :       CALL keyword_release(keyword)
     556             : 
     557             :       CALL keyword_create(keyword, __LOCATION__, name="EVAL", &
     558             :                           description="Selects the properties to evaluate for each retrieved snapshot during a REFTRAJ run", &
     559             :                           default_i_val=REFTRAJ_EVAL_NONE, &
     560             :                           enum_i_vals=(/REFTRAJ_EVAL_NONE, REFTRAJ_EVAL_ENERGY, REFTRAJ_EVAL_ENERGY_FORCES/), &
     561             :                           enum_c_vals=s2a("NONE", "ENERGY", "ENERGY_FORCES"), &
     562       28498 :                           enum_desc=s2a("Evaluate nothing", "Evaluate only the energy", "Evaluate energy and forces"))
     563       28498 :       CALL section_add_keyword(section, keyword)
     564       28498 :       CALL keyword_release(keyword)
     565             : 
     566             :       CALL keyword_create(keyword, __LOCATION__, name="eval_energy_forces", &
     567             :                           description="Evaluate energy and forces for each retrieved snapshot during a REFTRAJ run", &
     568             :                           repeats=.FALSE., default_l_val=.FALSE., lone_keyword_l_val=.TRUE., &
     569       28498 :                           deprecation_notice="Please use MOTION / MD / REFTRAJ / EVAL instead.")
     570       28498 :       CALL section_add_keyword(section, keyword)
     571       28498 :       CALL keyword_release(keyword)
     572             : 
     573             :       CALL keyword_create(keyword, __LOCATION__, name="eval_forces", &
     574             :                           description="Evaluate the forces for each retrieved snapshot during a REFTRAJ run", &
     575             :                           repeats=.FALSE., default_l_val=.FALSE., lone_keyword_l_val=.TRUE., &
     576       28498 :                           deprecation_notice="Please use MOTION / MD / REFTRAJ / EVAL instead.")
     577       28498 :       CALL section_add_keyword(section, keyword)
     578       28498 :       CALL keyword_release(keyword)
     579             : 
     580       28498 :       CALL create_msd_section(subsection)
     581       28498 :       CALL section_add_subsection(section, subsection)
     582       28498 :       CALL section_release(subsection)
     583             : 
     584             :       CALL section_create(subsection, __LOCATION__, name="print", &
     585             :                           description="The section that controls the output of a reftraj run", &
     586       28498 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     587             : 
     588       28498 :       NULLIFY (print_key)
     589             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "msd_kind", &
     590             :                                        description="Controls the output of msd per kind", &
     591             :                                        print_level=low_print_level, common_iter_levels=1, &
     592       28498 :                                        filename="")
     593       28498 :       CALL section_add_subsection(subsection, print_key)
     594       28498 :       CALL section_release(print_key)
     595             : 
     596             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "msd_molecule", &
     597             :                                        description="Controls the output of msd per molecule kind", &
     598             :                                        print_level=low_print_level, common_iter_levels=1, &
     599       28498 :                                        filename="")
     600       28498 :       CALL section_add_subsection(subsection, print_key)
     601       28498 :       CALL section_release(print_key)
     602             : 
     603             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "displaced_atom", &
     604             :                                        description="Controls the output of index and dislacement of "// &
     605             :                                        "atoms that moved away from the initial position of more than a "// &
     606             :                                        "given distance (see msd%disp_tol)", &
     607             :                                        print_level=low_print_level, common_iter_levels=1, &
     608       28498 :                                        filename="")
     609       28498 :       CALL section_add_subsection(subsection, print_key)
     610       28498 :       CALL section_release(print_key)
     611             : 
     612       28498 :       CALL section_add_subsection(section, subsection)
     613       28498 :       CALL section_release(subsection)
     614             : 
     615       28498 :    END SUBROUTINE create_reftraj_section
     616             : 
     617             : ! **************************************************************************************************
     618             : !> \brief Defines parameters for MSD calculation along a REFTRAJ analysis
     619             : !> \param section will contain the coeff section
     620             : !> \author MI
     621             : ! **************************************************************************************************
     622       28498 :    SUBROUTINE create_msd_section(section)
     623             :       TYPE(section_type), POINTER                        :: section
     624             : 
     625             :       TYPE(keyword_type), POINTER                        :: keyword
     626             :       TYPE(section_type), POINTER                        :: subsection
     627             : 
     628       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
     629             : 
     630             :       CALL section_create(section, __LOCATION__, name="MSD", &
     631             :                           description="Loads an external trajectory file and performs analysis on the"// &
     632             :                           " loaded snapshots.", &
     633       28498 :                           n_keywords=3, n_subsections=0, repeats=.FALSE.)
     634             : 
     635       28498 :       NULLIFY (keyword, subsection)
     636             : 
     637             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
     638             :                           description="controls the activation of core-level spectroscopy simulations", &
     639             :                           usage="&MSD T", &
     640             :                           default_l_val=.FALSE., &
     641       28498 :                           lone_keyword_l_val=.TRUE.)
     642       28498 :       CALL section_add_keyword(section, keyword)
     643       28498 :       CALL keyword_release(keyword)
     644             : 
     645             :       CALL keyword_create(keyword, __LOCATION__, name="REF0_FILENAME", &
     646             :                           description="Specify the filename where the initial reference configuration is stored.", &
     647       28498 :                           repeats=.FALSE., usage="REF0_FILENAME <CHARACTER>", default_lc_val="")
     648       28498 :       CALL section_add_keyword(section, keyword)
     649       28498 :       CALL keyword_release(keyword)
     650             : 
     651             :       CALL keyword_create(keyword, __LOCATION__, name="MSD_PER_KIND", &
     652             :                           description="Set up the calculation of the MSD for each atomic kind", &
     653             :                           usage="MSD_PER_KIND <LOGICAL>", repeats=.FALSE., &
     654       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     655       28498 :       CALL section_add_keyword(section, keyword)
     656       28498 :       CALL keyword_release(keyword)
     657             : 
     658             :       CALL keyword_create(keyword, __LOCATION__, name="MSD_PER_MOLKIND", &
     659             :                           description="Set up the calculation of the MSD for each molecule kind. "// &
     660             :                           "The position of the center of mass of the molecule is considered.", &
     661             :                           usage="MSD_PER_MOLKIND <LOGICAL>", repeats=.FALSE., &
     662       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     663       28498 :       CALL section_add_keyword(section, keyword)
     664       28498 :       CALL keyword_release(keyword)
     665             : 
     666             :       CALL keyword_create(keyword, __LOCATION__, name="MSD_PER_REGION", &
     667             :                           description="Set up the calculation of the MSD for each defined region.", &
     668             :                           usage="MSD_PER_REGION <LOGICAL>", repeats=.FALSE., &
     669       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     670       28498 :       CALL section_add_keyword(section, keyword)
     671       28498 :       CALL keyword_release(keyword)
     672             : 
     673       28498 :       CALL create_region_section(subsection, "MSD calculation")
     674       28498 :       CALL section_add_subsection(section, subsection)
     675       28498 :       CALL section_release(subsection)
     676             : 
     677             :       CALL keyword_create(keyword, __LOCATION__, name="DISPLACED_ATOM", &
     678             :                           description="Identify the atoms that moved from their initial "// &
     679             :                           "position of a distance larger than a given tolerance (see msd%displacement_tol).", &
     680             :                           usage="DISPLACED_ATOM <LOGICAL>", repeats=.FALSE., &
     681       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     682       28498 :       CALL section_add_keyword(section, keyword)
     683       28498 :       CALL keyword_release(keyword)
     684             : 
     685             :       CALL keyword_create(keyword, __LOCATION__, name="displacement_tol", &
     686             :                           description="Lower limit to define displaced atoms", &
     687             :                           usage="DISPLACEMENT_TOL real", &
     688       28498 :                           default_r_val=0._dp, n_var=1, unit_str='bohr')
     689       28498 :       CALL section_add_keyword(section, keyword)
     690       28498 :       CALL keyword_release(keyword)
     691             : 
     692       28498 :    END SUBROUTINE create_msd_section
     693             : 
     694             : ! **************************************************************************************************
     695             : !> \brief ...
     696             : !> \param section will contain the coeff section
     697             : !> \author teo
     698             : ! **************************************************************************************************
     699       28498 :    SUBROUTINE create_msst_section(section)
     700             :       TYPE(section_type), POINTER                        :: section
     701             : 
     702             :       TYPE(keyword_type), POINTER                        :: keyword
     703             : 
     704       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
     705             : 
     706             :       CALL section_create(section, __LOCATION__, name="msst", &
     707             :                           description="Parameters for Multi-Scale Shock Technique (MSST) "// &
     708             :                           "which simulate the effect of a steady planar shock on a unit cell. "// &
     709             :                           "Reed et. al. Physical Review Letters 90, 235503 (2003).", &
     710       28498 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     711             : 
     712       28498 :       NULLIFY (keyword)
     713             :       CALL keyword_create(keyword, __LOCATION__, name="PRESSURE", &
     714             :                           description="Initial pressure", &
     715             :                           usage="PRESSURE real", &
     716       28498 :                           default_r_val=0._dp, n_var=1, unit_str='bar')
     717       28498 :       CALL section_add_keyword(section, keyword)
     718       28498 :       CALL keyword_release(keyword)
     719             : 
     720             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY", &
     721             :                           description="Initial energy", &
     722             :                           usage="ENERGY real", &
     723       28498 :                           default_r_val=0._dp, n_var=1, unit_str='hartree')
     724       28498 :       CALL section_add_keyword(section, keyword)
     725       28498 :       CALL keyword_release(keyword)
     726             : 
     727             :       CALL keyword_create(keyword, __LOCATION__, name="VOLUME", &
     728             :                           description="Initial volume", &
     729             :                           usage="VOLUME real", &
     730       28498 :                           default_r_val=0._dp, n_var=1, unit_str='angstrom^3')
     731       28498 :       CALL section_add_keyword(section, keyword)
     732       28498 :       CALL keyword_release(keyword)
     733             : 
     734             :       CALL keyword_create(keyword, __LOCATION__, name="CMASS", &
     735             :                           description="Effective cell mass", &
     736             :                           usage="CMASS real", &
     737       28498 :                           default_r_val=0._dp, n_var=1, unit_str='au_m')
     738       28498 :       CALL section_add_keyword(section, keyword)
     739       28498 :       CALL keyword_release(keyword)
     740             : 
     741             :       CALL keyword_create(keyword, __LOCATION__, name="VSHOCK", variants=(/"V_SHOCK"/), &
     742             :                           description="Velocity shock", &
     743             :                           usage="VSHOCK real", &
     744       56996 :                           default_r_val=0._dp, n_var=1, unit_str='m/s')
     745       28498 :       CALL section_add_keyword(section, keyword)
     746       28498 :       CALL keyword_release(keyword)
     747             : 
     748             :       CALL keyword_create(keyword, __LOCATION__, name="GAMMA", &
     749             :                           description="Damping coefficient for cell volume", &
     750             :                           usage="GAMMA real", &
     751             :                           unit_str='fs^-1', &
     752       28498 :                           default_r_val=0.0_dp)
     753       28498 :       CALL section_add_keyword(section, keyword)
     754       28498 :       CALL keyword_release(keyword)
     755             : 
     756       28498 :    END SUBROUTINE create_msst_section
     757             : 
     758             : ! **************************************************************************************************
     759             : !> \brief section will contain some parameters for the shells dynamics
     760             : !> \param section ...
     761             : ! **************************************************************************************************
     762       28498 :    SUBROUTINE create_shell_section(section)
     763             :       TYPE(section_type), POINTER                        :: section
     764             : 
     765             :       TYPE(keyword_type), POINTER                        :: keyword
     766             :       TYPE(section_type), POINTER                        :: thermo_section
     767             : 
     768       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
     769             : 
     770             :       CALL section_create(section, __LOCATION__, name="shell", &
     771             :                           description="Parameters of shell model in adiabatic dynamics.", &
     772       28498 :                           n_keywords=4, n_subsections=1, repeats=.FALSE.)
     773             : 
     774       28498 :       NULLIFY (keyword, thermo_section)
     775             : 
     776             :       CALL keyword_create(keyword, __LOCATION__, name="temperature", &
     777             :                           description="Temperature in K used to control "// &
     778             :                           "the internal velocities of the core-shell motion ", &
     779             :                           usage="temperature 5.0", &
     780             :                           default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="K"), &
     781       28498 :                           unit_str="K")
     782       28498 :       CALL section_add_keyword(section, keyword)
     783       28498 :       CALL keyword_release(keyword)
     784             : 
     785             :       CALL keyword_create(keyword, __LOCATION__, name="temp_tol", &
     786             :                           description="Maximum accepted temperature deviation"// &
     787             :                           " from the expected value, for the internal core-shell motion."// &
     788             :                           " If 0, no rescaling is performed", &
     789       28498 :                           usage="temp_tol 0.0", default_r_val=0.0_dp, unit_str='K')
     790       28498 :       CALL section_add_keyword(section, keyword)
     791       28498 :       CALL keyword_release(keyword)
     792             : 
     793             :       CALL keyword_create(keyword, __LOCATION__, name="nose_particle", &
     794             :                           description="If nvt or npt, the core and shell velocities are controlled "// &
     795             :                           "by the same thermostat used for the particle. This might favour heat exchange "// &
     796             :                           "and additional rescaling of the internal core-shell velocity is needed (TEMP_TOL)", &
     797       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     798       28498 :       CALL section_add_keyword(section, keyword)
     799       28498 :       CALL keyword_release(keyword)
     800             : 
     801             :       CALL keyword_create(keyword, __LOCATION__, name="DISPLACEMENT_SHELL_TOL", &
     802             :                           description="This keyword sets a maximum variation of the shell"// &
     803             :                           " core distance in each Cartesian direction."// &
     804             :                           " The maximum internal core-shell velocity is evaluated and"// &
     805             :                           " if it is too large to remain"// &
     806             :                           " within the assigned limit, the time step is rescaled accordingly,"// &
     807             :                           " and the first half step of the velocity verlet is repeated.", &
     808             :                           usage="DISPLACEMENT_SHELL_TOL <REAL>", default_r_val=100.0_dp, &
     809       28498 :                           unit_str='angstrom')
     810       28498 :       CALL section_add_keyword(section, keyword)
     811       28498 :       CALL keyword_release(keyword)
     812             : 
     813       28498 :       CALL create_thermostat_section(thermo_section)
     814       28498 :       CALL section_add_subsection(section, thermo_section)
     815       28498 :       CALL section_release(thermo_section)
     816             : 
     817       28498 :    END SUBROUTINE create_shell_section
     818             : 
     819             : ! **************************************************************************************************
     820             : !> \brief section will contain some parameters for the adiabatic dynamics
     821             : !> \param section ...
     822             : ! **************************************************************************************************
     823       28498 :    SUBROUTINE create_adiabatic_section(section)
     824             :       TYPE(section_type), POINTER                        :: section
     825             : 
     826             :       TYPE(keyword_type), POINTER                        :: keyword
     827             :       TYPE(section_type), POINTER                        :: thermo_fast_section, thermo_slow_section
     828             : 
     829       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
     830             : 
     831             :       CALL section_create(section, __LOCATION__, name="ADIABATIC_DYNAMICS", &
     832             :                           description="Parameters used in canonical adiabatic free energy sampling (CAFES).", &
     833             :                           n_keywords=5, n_subsections=2, repeats=.FALSE., &
     834       56996 :                           citations=(/VandeVondele2002/))
     835             : 
     836       28498 :       NULLIFY (keyword, thermo_fast_section, thermo_slow_section)
     837             : 
     838             :       CALL keyword_create(keyword, __LOCATION__, name="temp_fast", &
     839             :                           description="Temperature in K used to control "// &
     840             :                           "the fast degrees of freedom ", &
     841             :                           usage="temp_fast 5.0", &
     842             :                           default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="K"), &
     843       28498 :                           unit_str="K")
     844       28498 :       CALL section_add_keyword(section, keyword)
     845       28498 :       CALL keyword_release(keyword)
     846             : 
     847             :       CALL keyword_create(keyword, __LOCATION__, name="temp_slow", &
     848             :                           description="Temperature in K used to control "// &
     849             :                           "the slow degrees of freedom ", &
     850             :                           usage="temp_slow 5.0", &
     851             :                           default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="K"), &
     852       28498 :                           unit_str="K")
     853       28498 :       CALL section_add_keyword(section, keyword)
     854       28498 :       CALL keyword_release(keyword)
     855             : 
     856             :       CALL keyword_create(keyword, __LOCATION__, name="temp_tol_fast", &
     857             :                           description="Maximum accepted temperature deviation"// &
     858             :                           " from the expected value, for the fast motion."// &
     859             :                           " If 0, no rescaling is performed", &
     860       28498 :                           usage="temp_tol 0.0", default_r_val=0.0_dp, unit_str='K')
     861       28498 :       CALL section_add_keyword(section, keyword)
     862       28498 :       CALL keyword_release(keyword)
     863             : 
     864             :       CALL keyword_create(keyword, __LOCATION__, name="temp_tol_slow", &
     865             :                           description="Maximum accepted temperature deviation"// &
     866             :                           " from the expected value, for the slow motion."// &
     867             :                           " If 0, no rescaling is performed", &
     868       28498 :                           usage="temp_tol 0.0", default_r_val=0.0_dp, unit_str='K')
     869       28498 :       CALL section_add_keyword(section, keyword)
     870       28498 :       CALL keyword_release(keyword)
     871             : 
     872             :       CALL keyword_create(keyword, __LOCATION__, name="n_resp_fast", &
     873             :                           description="number of respa steps for fast degrees of freedom", &
     874       28498 :                           repeats=.FALSE., default_i_val=1)
     875       28498 :       CALL section_add_keyword(section, keyword)
     876       28498 :       CALL keyword_release(keyword)
     877             : 
     878       28498 :       CALL create_thermo_fast_section(thermo_fast_section)
     879       28498 :       CALL section_add_subsection(section, thermo_fast_section)
     880       28498 :       CALL section_release(thermo_fast_section)
     881             : 
     882       28498 :       CALL create_thermo_slow_section(thermo_slow_section)
     883       28498 :       CALL section_add_subsection(section, thermo_slow_section)
     884       28498 :       CALL section_release(thermo_slow_section)
     885             : 
     886       28498 :    END SUBROUTINE create_adiabatic_section
     887             : 
     888             : ! **************************************************************************************************
     889             : !> \brief section will contain parameters for the velocity softening
     890             : !> \param section ...
     891             : !> \author Ole Schuett
     892             : ! **************************************************************************************************
     893       28498 :    SUBROUTINE create_softening_section(section)
     894             :       TYPE(section_type), POINTER                        :: section
     895             : 
     896             :       TYPE(keyword_type), POINTER                        :: keyword
     897             : 
     898             :       CALL section_create(section, __LOCATION__, name="VELOCITY_SOFTENING", &
     899             :                           description="A method to initialize the velocities along low-curvature " &
     900             :                           //"directions in order to favors MD trajectories to cross rapidly over " &
     901             :                           //"small energy barriers into neighboring basins. " &
     902             :                           //"In each iteration the forces are calculated at a point y, which " &
     903             :                           //"is slightly displaced from the current positions x in the direction " &
     904             :                           //"of the original velocities v. The velocities are then updated with " &
     905             :                           //"the force component F_t, which is perpendicular to N. " &
     906             :                           //"N = v / |v|;  y = x + delta * N;  F_t = F(y) - &lang; F(y) | N &rang; * N; " &
     907       28498 :                           //"v' = v + alpha * F_t")
     908             : 
     909       28498 :       NULLIFY (keyword)
     910             :       CALL keyword_create(keyword, __LOCATION__, name="STEPS", &
     911             :                           description="Number of softening iterations performed. " &
     912             :                           //"Typical values are around 40 steps.", &
     913       28498 :                           default_i_val=0)
     914       28498 :       CALL section_add_keyword(section, keyword)
     915       28498 :       CALL keyword_release(keyword)
     916             : 
     917             :       CALL keyword_create(keyword, __LOCATION__, name="DELTA", &
     918             :                           description="Displacement used to obtain y.", &
     919       28498 :                           default_r_val=0.1_dp)
     920       28498 :       CALL section_add_keyword(section, keyword)
     921       28498 :       CALL keyword_release(keyword)
     922             : 
     923             :       CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
     924             :                           description="Mixing factor used for updating velocities.", &
     925       28498 :                           default_r_val=0.15_dp)
     926       28498 :       CALL section_add_keyword(section, keyword)
     927       28498 :       CALL keyword_release(keyword)
     928             : 
     929       28498 :    END SUBROUTINE create_softening_section
     930             : 
     931             : ! **************************************************************************************************
     932             : !> \brief input section used to define regions with different temperature
     933             : !>        initialization and control
     934             : !> \param section ...
     935             : !> \par History
     936             : !>   - Added input for langevin regions in thermal regions section
     937             : !>     (2014/02/04, LT)
     938             : ! **************************************************************************************************
     939       28498 :    SUBROUTINE create_thermal_region_section(section)
     940             :       TYPE(section_type), POINTER                        :: section
     941             : 
     942             :       TYPE(keyword_type), POINTER                        :: keyword
     943             :       TYPE(section_type), POINTER                        :: print_key, region_section, subsection
     944             : 
     945       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
     946             : 
     947             :       CALL section_create(section, __LOCATION__, name="thermal_region", &
     948             :                           description="Define regions where different initialization and control "// &
     949             :                           "of the temperature is used. When MOTION%MD%ENSEMBLE is set to LANGEVIN, "// &
     950             :                           "this section controls if the atoms defined inside and outside the "// &
     951             :                           "thermal regions should undergo Langevin MD or NVE Born-Oppenheimer MD. "// &
     952             :                           "The theory behind Langevin MD using different regions can be found in "// &
     953             :                           "articles by Kantorovitch et al. listed below.", &
     954             :                           citations=(/Kantorovich2008, Kantorovich2008a/), &
     955       85494 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
     956             : 
     957       28498 :       NULLIFY (region_section)
     958       28498 :       NULLIFY (keyword, subsection)
     959             : 
     960             :       CALL keyword_create(keyword, __LOCATION__, name="force_rescaling", &
     961             :                           description="Control the rescaling ot the velocities in all the regions, "// &
     962             :                           "according to the temperature assigned to each reagion, when "// &
     963             :                           "RESTART_VELOCITY in EXT_RESTART is active.", &
     964       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     965       28498 :       CALL section_add_keyword(section, keyword)
     966       28498 :       CALL keyword_release(keyword)
     967             : 
     968             :       CALL keyword_create(keyword, __LOCATION__, name="do_langevin_default", &
     969             :                           description="If ENSEMBLE is set to LANGEVIN, controls whether the "// &
     970             :                           "atoms NOT defined in the thermal regions to undergo langevin MD "// &
     971             :                           "or not. If not, then the atoms will undergo NVE Born-Oppenheimer MD.", &
     972             :                           usage="do_langevin_default .FALSE.", &
     973       28498 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     974       28498 :       CALL section_add_keyword(section, keyword)
     975       28498 :       CALL keyword_release(keyword)
     976             : 
     977             :       CALL section_create(region_section, __LOCATION__, name="DEFINE_REGION", &
     978             :                           description="This section provides the possibility to define arbitrary region ", &
     979       28498 :                           n_keywords=3, n_subsections=0, repeats=.TRUE.)
     980             : 
     981       28498 :       NULLIFY (keyword)
     982             :       CALL keyword_create(keyword, __LOCATION__, name="LIST", &
     983             :                           description="Specifies a list of atoms belonging to the region.", &
     984             :                           usage="LIST {integer} {integer} .. {integer}", &
     985       28498 :                           repeats=.TRUE., n_var=-1, type_of_var=integer_t)
     986       28498 :       CALL section_add_keyword(region_section, keyword)
     987       28498 :       CALL keyword_release(keyword)
     988             : 
     989             :       CALL keyword_create(keyword, __LOCATION__, name="temperature", &
     990             :                           description="The temperature in K used to initialize the velocities "// &
     991             :                           "of the atoms in this region ", &
     992             :                           usage="temperature 5.0", &
     993             :                           default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="K"), &
     994       28498 :                           unit_str="K")
     995       28498 :       CALL section_add_keyword(region_section, keyword)
     996       28498 :       CALL keyword_release(keyword)
     997             : 
     998             :       CALL keyword_create(keyword, __LOCATION__, name="temp_tol", &
     999             :                           description="Maximum accepted temperature deviation from the expected "// &
    1000             :                           "value for this region. If temp_tol=0 no rescaling is performed", &
    1001             :                           usage="temp_tol 0.0", &
    1002       28498 :                           default_r_val=0.0_dp, unit_str='K')
    1003       28498 :       CALL section_add_keyword(region_section, keyword)
    1004       28498 :       CALL keyword_release(keyword)
    1005             : 
    1006             :       CALL keyword_create(keyword, __LOCATION__, name="do_langevin", &
    1007             :                           description="When ENSEMBLE is set to LANGEVIN, Controls whether "// &
    1008             :                           "the atoms in the thermal region should undergo Langevin MD. If "// &
    1009             :                           "not, then they will undergo NVE Born-Oppenheimer MD.", &
    1010             :                           usage="do_langevin .TRUE.", &
    1011       28498 :                           default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1012       28498 :       CALL section_add_keyword(region_section, keyword)
    1013       28498 :       CALL keyword_release(keyword)
    1014             : 
    1015             :       CALL keyword_create(keyword, __LOCATION__, name="noisy_gamma_region", &
    1016             :                           description="Special imaginary Langevin Friction term"// &
    1017             :                           " for Langevin Dynamics with noisy forces for the atoms in this region."// &
    1018             :                           " When set, overrides the general value set by NOISY_GAMMA in the MOTION%MD%LANGEVIN section."// &
    1019             :                           " When unset for a defined region, the general NOISY_GAMMA value applies.", &
    1020             :                           citations=(/Kuhne2007/), usage="noisy_gamma_region 4.0E-5", &
    1021             :                           type_of_var=real_t, &
    1022       56996 :                           unit_str="fs^-1")
    1023       28498 :       CALL section_add_keyword(region_section, keyword)
    1024       28498 :       CALL keyword_release(keyword)
    1025             : 
    1026       28498 :       CALL section_add_subsection(section, region_section)
    1027       28498 :       CALL section_release(region_section)
    1028             : 
    1029       28498 :       NULLIFY (print_key)
    1030             :       CALL section_create(subsection, __LOCATION__, name="PRINT", &
    1031             :                           description="Collects all print_keys for thermal_regions", &
    1032       28498 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
    1033             : 
    1034             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "TEMPERATURE", &
    1035             :                                        description="Controls output of temperature per region.", &
    1036             :                                        print_level=high_print_level, common_iter_levels=1, &
    1037       28498 :                                        filename="")
    1038       28498 :       CALL section_add_subsection(subsection, print_key)
    1039       28498 :       CALL section_release(print_key)
    1040             : 
    1041             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "LANGEVIN_REGIONS", &
    1042             :                                        description="Controls output of information on which atoms "// &
    1043             :                                        "underwent Langevin MD and which atoms did not.", &
    1044             :                                        print_level=high_print_level, &
    1045       28498 :                                        filename="")
    1046       28498 :       CALL section_add_subsection(subsection, print_key)
    1047       28498 :       CALL section_release(print_key)
    1048             : 
    1049       28498 :       CALL section_add_subsection(section, subsection)
    1050       28498 :       CALL section_release(subsection)
    1051             : 
    1052       28498 :    END SUBROUTINE create_thermal_region_section
    1053             : 
    1054             : ! **************************************************************************************************
    1055             : !> \brief   Defines the parameters for the setup of a cascade simulation
    1056             : !> \param section ...
    1057             : !> \date    03.02.2012
    1058             : !> \author  Matthias Krack (MK)
    1059             : !> \version 1.0
    1060             : ! **************************************************************************************************
    1061       28498 :    SUBROUTINE create_cascade_section(section)
    1062             : 
    1063             :       TYPE(section_type), POINTER                        :: section
    1064             : 
    1065             :       TYPE(keyword_type), POINTER                        :: keyword
    1066             :       TYPE(section_type), POINTER                        :: subsection
    1067             : 
    1068       28498 :       NULLIFY (keyword)
    1069       28498 :       NULLIFY (subsection)
    1070       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
    1071             : 
    1072             :       CALL section_create(section, __LOCATION__, name="CASCADE", &
    1073             :                           description="Defines the parameters for the setup of a cascade simulation.", &
    1074             :                           n_keywords=1, &
    1075             :                           n_subsections=1, &
    1076       28498 :                           repeats=.FALSE.)
    1077             : 
    1078             :       CALL keyword_create(keyword, __LOCATION__, &
    1079             :                           name="_SECTION_PARAMETERS_", &
    1080             :                           description="Controls the activation of the CASCADE section.", &
    1081             :                           usage="&CASCADE on", &
    1082             :                           default_l_val=.FALSE., &
    1083       28498 :                           lone_keyword_l_val=.TRUE.)
    1084       28498 :       CALL section_add_keyword(section, keyword)
    1085       28498 :       CALL keyword_release(keyword)
    1086             : 
    1087             :       CALL keyword_create(keyword, __LOCATION__, name="ENERGY", &
    1088             :                           description="Total energy transferred to the system during the cascade event.", &
    1089             :                           usage="ENERGY 20.0", &
    1090             :                           default_r_val=0.0_dp, &
    1091       28498 :                           unit_str="keV")
    1092       28498 :       CALL section_add_keyword(section, keyword)
    1093       28498 :       CALL keyword_release(keyword)
    1094             : 
    1095             :       CALL section_create(subsection, __LOCATION__, name="ATOM_LIST", &
    1096             :                           description="Defines a list of atoms for which the initial velocities are modified", &
    1097             :                           n_keywords=1, &
    1098             :                           n_subsections=0, &
    1099       28498 :                           repeats=.FALSE.)
    1100             : 
    1101             :       CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
    1102             :                           description="Defines the list of atoms for which the velocities are modified. "// &
    1103             :                           "Each record consists of the atomic index, the velocity vector, and "// &
    1104             :                           "a weight to define which fraction of the total energy is assigned "// &
    1105             :                           "to the current atom: `Atomic_index  v_x  v_y  v_z  Weight`", &
    1106             :                           usage="{{Integer} {Real} {Real} {Real} {Real}}", &
    1107             :                           repeats=.TRUE., &
    1108       28498 :                           type_of_var=lchar_t)
    1109       28498 :       CALL section_add_keyword(subsection, keyword)
    1110       28498 :       CALL keyword_release(keyword)
    1111             : 
    1112       28498 :       CALL section_add_subsection(section, subsection)
    1113       28498 :       CALL section_release(subsection)
    1114             : 
    1115       28498 :    END SUBROUTINE create_cascade_section
    1116             : 
    1117             : ! **************************************************************************************************
    1118             : !> \brief Defines AVERAGES section
    1119             : !> \param section ...
    1120             : !> \author teo
    1121             : ! **************************************************************************************************
    1122       28498 :    SUBROUTINE create_avgs_section(section)
    1123             :       TYPE(section_type), POINTER                        :: section
    1124             : 
    1125             :       TYPE(keyword_type), POINTER                        :: keyword
    1126             :       TYPE(section_type), POINTER                        :: print_key, subsection
    1127             : 
    1128       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
    1129             :       CALL section_create(section, __LOCATION__, name="Averages", &
    1130             :                           description="Controls the calculation of the averages during an MD run.", &
    1131       28498 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    1132       28498 :       NULLIFY (keyword, print_key, subsection)
    1133             : 
    1134             :       CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
    1135             :                           description="Controls the calculations of the averages.", &
    1136       28498 :                           usage="&AVERAGES T", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
    1137       28498 :       CALL section_add_keyword(section, keyword)
    1138       28498 :       CALL keyword_release(keyword)
    1139             : 
    1140             :       CALL keyword_create(keyword, __LOCATION__, name="ACQUISITION_START_TIME", &
    1141             :                           description="Setup up the simulation time when the acquisition process to compute"// &
    1142             :                           " averages is started.", &
    1143             :                           usage="ACQUISITION_START_TIME <REAL>", &
    1144       28498 :                           default_r_val=0.0_dp, unit_str='fs')
    1145       28498 :       CALL section_add_keyword(section, keyword)
    1146       28498 :       CALL keyword_release(keyword)
    1147             : 
    1148             :       CALL keyword_create(keyword, __LOCATION__, name="AVERAGE_COLVAR", &
    1149             :                           description="Switch for computing the averages of COLVARs.", &
    1150             :                           usage="AVERAGE_COLVAR <LOGICAL>", default_l_val=.FALSE., &
    1151       28498 :                           lone_keyword_l_val=.TRUE.)
    1152       28498 :       CALL section_add_keyword(section, keyword)
    1153       28498 :       CALL keyword_release(keyword)
    1154             : 
    1155             :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PRINT_AVERAGES", &
    1156             :                                        description="Controls the output the averaged quantities", &
    1157             :                                        print_level=debug_print_level + 1, common_iter_levels=1, &
    1158       28498 :                                        filename="")
    1159       28498 :       CALL section_add_subsection(section, print_key)
    1160       28498 :       CALL section_release(print_key)
    1161             : 
    1162       28498 :       CALL create_avgs_restart_section(subsection)
    1163       28498 :       CALL section_add_subsection(section, subsection)
    1164       28498 :       CALL section_release(subsection)
    1165       28498 :    END SUBROUTINE create_avgs_section
    1166             : 
    1167             : ! **************************************************************************************************
    1168             : !> \brief Defines the AVERAGES RESTART section
    1169             : !> \param section ...
    1170             : !> \author teo
    1171             : ! **************************************************************************************************
    1172       28498 :    SUBROUTINE create_avgs_restart_section(section)
    1173             :       TYPE(section_type), POINTER                        :: section
    1174             : 
    1175             :       TYPE(keyword_type), POINTER                        :: keyword
    1176             : 
    1177       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
    1178             :       CALL section_create(section, __LOCATION__, name="RESTART_AVERAGES", &
    1179             :                           description="Stores information for restarting averages.", &
    1180       28498 :                           n_keywords=1, n_subsections=1, repeats=.FALSE.)
    1181       28498 :       NULLIFY (keyword)
    1182             : 
    1183             :       CALL keyword_create(keyword, __LOCATION__, name="ITIMES_START", &
    1184             :                           description="TIME STEP starting the evaluation of averages", &
    1185       28498 :                           usage="ITIMES_START <INTEGER>", type_of_var=integer_t, n_var=1)
    1186       28498 :       CALL section_add_keyword(section, keyword)
    1187       28498 :       CALL keyword_release(keyword)
    1188             : 
    1189             :       CALL keyword_create(keyword, __LOCATION__, name="AVECPU", &
    1190             :                           description="CPU average", usage="AVECPU <REAL>", &
    1191       28498 :                           type_of_var=real_t, n_var=1)
    1192       28498 :       CALL section_add_keyword(section, keyword)
    1193       28498 :       CALL keyword_release(keyword)
    1194             : 
    1195             :       CALL keyword_create(keyword, __LOCATION__, name="AVEHUGONIOT", &
    1196             :                           description="HUGONIOT average", usage="AVEHUGONIOT <REAL>", &
    1197       28498 :                           type_of_var=real_t, n_var=1)
    1198       28498 :       CALL section_add_keyword(section, keyword)
    1199       28498 :       CALL keyword_release(keyword)
    1200             : 
    1201             :       CALL keyword_create(keyword, __LOCATION__, name="AVETEMP_BARO", &
    1202             :                           description="BAROSTAT TEMPERATURE average", usage="AVETEMP_BARO <REAL>", &
    1203       28498 :                           type_of_var=real_t, n_var=1)
    1204       28498 :       CALL section_add_keyword(section, keyword)
    1205       28498 :       CALL keyword_release(keyword)
    1206             : 
    1207             :       CALL keyword_create(keyword, __LOCATION__, name="AVEPOT", &
    1208             :                           description="POTENTIAL ENERGY average", usage="AVEPOT <REAL>", &
    1209       28498 :                           type_of_var=real_t, n_var=1)
    1210       28498 :       CALL section_add_keyword(section, keyword)
    1211       28498 :       CALL keyword_release(keyword)
    1212             : 
    1213             :       CALL keyword_create(keyword, __LOCATION__, name="AVEKIN", &
    1214             :                           description="KINETIC ENERGY average", usage="AVEKIN <REAL>", &
    1215       28498 :                           type_of_var=real_t, n_var=1)
    1216       28498 :       CALL section_add_keyword(section, keyword)
    1217       28498 :       CALL keyword_release(keyword)
    1218             : 
    1219             :       CALL keyword_create(keyword, __LOCATION__, name="AVETEMP", &
    1220             :                           description="TEMPERATURE average", usage="AVETEMP <REAL>", &
    1221       28498 :                           type_of_var=real_t, n_var=1)
    1222       28498 :       CALL section_add_keyword(section, keyword)
    1223       28498 :       CALL keyword_release(keyword)
    1224             : 
    1225             :       CALL keyword_create(keyword, __LOCATION__, name="AVEKIN_QM", &
    1226             :                           description="QM KINETIC ENERGY average in QMMM runs", usage="AVEKIN_QM <REAL>", &
    1227       28498 :                           type_of_var=real_t, n_var=1)
    1228       28498 :       CALL section_add_keyword(section, keyword)
    1229       28498 :       CALL keyword_release(keyword)
    1230             : 
    1231             :       CALL keyword_create(keyword, __LOCATION__, name="AVETEMP_QM", &
    1232             :                           description="QM TEMPERATURE average in QMMM runs", usage="AVETEMP_QM <REAL>", &
    1233       28498 :                           type_of_var=real_t, n_var=1)
    1234       28498 :       CALL section_add_keyword(section, keyword)
    1235       28498 :       CALL keyword_release(keyword)
    1236             : 
    1237             :       CALL keyword_create(keyword, __LOCATION__, name="AVEVOL", &
    1238             :                           description="VOLUME average", usage="AVEVOL <REAL>", &
    1239       28498 :                           type_of_var=real_t, n_var=1)
    1240       28498 :       CALL section_add_keyword(section, keyword)
    1241       28498 :       CALL keyword_release(keyword)
    1242             : 
    1243             :       CALL keyword_create(keyword, __LOCATION__, name="AVECELL_A", &
    1244             :                           description="CELL VECTOR A average", usage="AVECELL_A <REAL>", &
    1245       28498 :                           type_of_var=real_t, n_var=1)
    1246       28498 :       CALL section_add_keyword(section, keyword)
    1247       28498 :       CALL keyword_release(keyword)
    1248             : 
    1249             :       CALL keyword_create(keyword, __LOCATION__, name="AVECELL_B", &
    1250             :                           description="CELL VECTOR B average", usage="AVECELL_B <REAL>", &
    1251       28498 :                           type_of_var=real_t, n_var=1)
    1252       28498 :       CALL section_add_keyword(section, keyword)
    1253       28498 :       CALL keyword_release(keyword)
    1254             : 
    1255             :       CALL keyword_create(keyword, __LOCATION__, name="AVECELL_C", &
    1256             :                           description="CELL VECTOR C average", usage="AVECELL_C <REAL>", &
    1257       28498 :                           type_of_var=real_t, n_var=1)
    1258       28498 :       CALL section_add_keyword(section, keyword)
    1259       28498 :       CALL keyword_release(keyword)
    1260             : 
    1261             :       CALL keyword_create(keyword, __LOCATION__, name="AVEALPHA", &
    1262             :                           description="ALPHA cell angle average", usage="AVEALPHA <REAL>", &
    1263       28498 :                           type_of_var=real_t, n_var=1)
    1264       28498 :       CALL section_add_keyword(section, keyword)
    1265       28498 :       CALL keyword_release(keyword)
    1266             : 
    1267             :       CALL keyword_create(keyword, __LOCATION__, name="AVEBETA", &
    1268             :                           description="BETA cell angle average", usage="AVEBETA <REAL>", &
    1269       28498 :                           type_of_var=real_t, n_var=1)
    1270       28498 :       CALL section_add_keyword(section, keyword)
    1271       28498 :       CALL keyword_release(keyword)
    1272             : 
    1273             :       CALL keyword_create(keyword, __LOCATION__, name="AVEGAMMA", &
    1274             :                           description="GAMMA cell angle average", usage="AVEGAMMA <REAL>", &
    1275       28498 :                           type_of_var=real_t, n_var=1)
    1276       28498 :       CALL section_add_keyword(section, keyword)
    1277       28498 :       CALL keyword_release(keyword)
    1278             : 
    1279             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_ECONS", &
    1280             :                           description="CONSTANT ENERGY average", usage="AVE_ECONS <REAL>", &
    1281       28498 :                           type_of_var=real_t, n_var=1)
    1282       28498 :       CALL section_add_keyword(section, keyword)
    1283       28498 :       CALL keyword_release(keyword)
    1284             : 
    1285             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_PRESS", &
    1286             :                           description="PRESSURE average", usage="AVE_PRESS <REAL>", &
    1287       28498 :                           type_of_var=real_t, n_var=1)
    1288       28498 :       CALL section_add_keyword(section, keyword)
    1289       28498 :       CALL keyword_release(keyword)
    1290             : 
    1291             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_PXX", &
    1292             :                           description="P_{XX} average", usage="AVE_PXX <REAL>", &
    1293       28498 :                           type_of_var=real_t, n_var=1)
    1294       28498 :       CALL section_add_keyword(section, keyword)
    1295       28498 :       CALL keyword_release(keyword)
    1296             : 
    1297             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_PV_VIR", &
    1298             :                           description="PV VIRIAL average", usage="AVE_PV_VIR <REAL> .. <REAL>", &
    1299       28498 :                           type_of_var=real_t, n_var=9)
    1300       28498 :       CALL section_add_keyword(section, keyword)
    1301       28498 :       CALL keyword_release(keyword)
    1302             : 
    1303             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_PV_TOT", &
    1304             :                           description="PV TOTAL average", usage="AVE_PV_TOT <REAL> .. <REAL>", &
    1305       28498 :                           type_of_var=real_t, n_var=9)
    1306       28498 :       CALL section_add_keyword(section, keyword)
    1307       28498 :       CALL keyword_release(keyword)
    1308             : 
    1309             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_PV_KIN", &
    1310             :                           description="PV KINETIC average", usage="AVE_PV_KIN <REAL> .. <REAL>", &
    1311       28498 :                           type_of_var=real_t, n_var=9)
    1312       28498 :       CALL section_add_keyword(section, keyword)
    1313       28498 :       CALL keyword_release(keyword)
    1314             : 
    1315             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_PV_CNSTR", &
    1316             :                           description="PV CONSTRAINTS average", usage="AVE_PV_CNSTR <REAL> .. <REAL>", &
    1317       28498 :                           type_of_var=real_t, n_var=9)
    1318       28498 :       CALL section_add_keyword(section, keyword)
    1319       28498 :       CALL keyword_release(keyword)
    1320             : 
    1321             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_PV_XC", &
    1322             :                           description="PV XC average", usage="AVE_PV_XC <REAL> .. <REAL>", &
    1323       28498 :                           type_of_var=real_t, n_var=9)
    1324       28498 :       CALL section_add_keyword(section, keyword)
    1325       28498 :       CALL keyword_release(keyword)
    1326             : 
    1327             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_PV_FOCK_4C", &
    1328             :                           description="PV XC average", usage="AVE_PV_FOCK_4C <REAL> .. <REAL>", &
    1329       28498 :                           type_of_var=real_t, n_var=9)
    1330       28498 :       CALL section_add_keyword(section, keyword)
    1331       28498 :       CALL keyword_release(keyword)
    1332             : 
    1333             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_COLVARS", &
    1334             :                           description="COLVARS averages", usage="AVE_COLVARS <REAL> .. <REAL>", &
    1335       28498 :                           type_of_var=real_t, n_var=-1)
    1336       28498 :       CALL section_add_keyword(section, keyword)
    1337       28498 :       CALL keyword_release(keyword)
    1338             : 
    1339             :       CALL keyword_create(keyword, __LOCATION__, name="AVE_MMATRIX", &
    1340             :                           description="METRIC TENSOR averages", usage="AVE_MMATRIX <REAL> .. <REAL>", &
    1341       28498 :                           type_of_var=real_t, n_var=-1)
    1342       28498 :       CALL section_add_keyword(section, keyword)
    1343       28498 :       CALL keyword_release(keyword)
    1344       28498 :    END SUBROUTINE create_avgs_restart_section
    1345             : 
    1346             : ! **************************************************************************************************
    1347             : !> \brief Defines the INITIAL_VIBRATION section
    1348             : !> \param section ...
    1349             : !> \author Lianheng Tong
    1350             : ! **************************************************************************************************
    1351       28498 :    SUBROUTINE create_vib_init_section(section)
    1352             :       TYPE(section_type), POINTER                        :: section
    1353             : 
    1354             :       TYPE(keyword_type), POINTER                        :: keyword
    1355             : 
    1356       28498 :       CPASSERT(.NOT. ASSOCIATED(section))
    1357             :       CALL section_create(section, __LOCATION__, name="INITIAL_VIBRATION", &
    1358             :                           description="Controls the set of parameters for MD initialisation "// &
    1359             :                           "based on vibration analysis data. The starting atomic coordinates "// &
    1360             :                           "should be based on the relaxed positions obtained from a previous "// &
    1361             :                           "geometry/cell optimisation calculation, and the vibrational "// &
    1362             :                           "frequencies and displacements data should be obtained from a "// &
    1363             :                           "vibrational analysis calculation done based on the relaxed "// &
    1364             :                           "coordinates. The MD initialisation process expects the user has "// &
    1365             :                           "performed both geometry optimisation and vibrational analysis "// &
    1366             :                           "before hand, and won't perform those calculations automatically ", &
    1367             :                           citations=(/West2006/), &
    1368       56996 :                           n_keywords=0, n_subsections=1, repeats=.FALSE.)
    1369       28498 :       NULLIFY (keyword)
    1370             :       CALL keyword_create(keyword, __LOCATION__, name="VIB_EIGS_FILE_NAME", &
    1371             :                           description="The file name of vibrational frequency (eigenvalue) "// &
    1372             :                           "and displacement (eigenvector) data calculated from the a "// &
    1373             :                           "vibrational analysis calculation done previously. This file must "// &
    1374             :                           "be the same unformatted binary file as referred to by "// &
    1375             :                           "VIBRATIONAL_ANALYSIS%PRINT%CARTESIAN_EIGS keyword. If this keyword "// &
    1376             :                           "is not explicitly defined by the user, then the default file "// &
    1377             :                           "name of: <project_name>-<CARTESIAN_EIGS_FILENAME>.eig will be used", &
    1378             :                           usage="VIB_EIGS_FILE_NAME <FILENAME>", &
    1379       28498 :                           type_of_var=lchar_t)
    1380       28498 :       CALL section_add_keyword(section, keyword)
    1381       28498 :       CALL keyword_release(keyword)
    1382       28498 :       NULLIFY (keyword)
    1383             :       CALL keyword_create(keyword, __LOCATION__, name="PHASE", &
    1384             :                           description="Controls the initial ratio of potential and kinetic "// &
    1385             :                           "contribution to the total energy. The contribution is determined by "// &
    1386             :                           "COS**2(2*pi*PHASE) for potential energy, and SIN**2(2*pi*PHASE) "// &
    1387             :                           "for kinetic energy. If PHASE is negative, then for each vibration "// &
    1388             :                           "mode the phase is determined randomly. Otherwise, PHASE must be "// &
    1389             :                           "between 0.0 and 1.0 and will be the same for all vibration modes. "// &
    1390             :                           "If value > 1.0 it will just be treated as 1.0. "// &
    1391             :                           "For example, setting PHASE = 0.25 would set all modes to "// &
    1392             :                           "begin with entirely kinetic energy --- in other words, the initial "// &
    1393             :                           "atomic positions will remain at their optimised location", &
    1394             :                           default_r_val=-1.0_dp, &
    1395       28498 :                           usage="PHASE <REAL>")
    1396       28498 :       CALL section_add_keyword(section, keyword)
    1397       28498 :       CALL keyword_release(keyword)
    1398       28498 :    END SUBROUTINE create_vib_init_section
    1399             : 
    1400             : END MODULE input_cp2k_md

Generated by: LCOV version 1.15