(git:e7e05ae)
input_cp2k_md.F
Go to the documentation of this file.
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 
15  USE bibliography, ONLY: &
24  USE cp_units, ONLY: cp_unit_to_cp2k
25  USE input_constants, ONLY: &
37  keyword_type
42  section_type
43  USE input_val_types, ONLY: integer_t,&
44  lchar_t,&
45  real_t
46  USE kinds, ONLY: dp
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  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  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  n_keywords=13, n_subsections=6, repeats=.false.)
78 
79  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/), &
106  CALL section_add_keyword(section, keyword)
107  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  usage="steps 100", default_i_val=3)
112  CALL section_add_keyword(section, keyword)
113  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  usage="max_steps 100", default_i_val=1000000000)
118  CALL section_add_keyword(section, keyword)
119  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  unit_str="fs")
125  CALL section_add_keyword(section, keyword)
126  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  default_i_val=0)
131  CALL section_add_keyword(section, keyword)
132  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  unit_str="fs")
138  CALL section_add_keyword(section, keyword)
139  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  unit_str="hartree")
145  CALL section_add_keyword(section, keyword)
146  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  unit_str="K")
153  CALL section_add_keyword(section, keyword)
154  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  usage="temp_tol 0.0", default_r_val=0.0_dp, unit_str='K')
164  CALL section_add_keyword(section, keyword)
165  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  default_l_val=.false., lone_keyword_l_val=.true.)
171  CALL section_add_keyword(section, keyword)
172  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  default_l_val=.false., lone_keyword_l_val=.true.)
178  CALL section_add_keyword(section, keyword)
179  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  usage="comvel_tol 0.1", type_of_var=real_t, n_var=1, unit_str="bohr*au_t^-1")
185  CALL section_add_keyword(section, keyword)
186  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  usage="angvel_tol 0.1", type_of_var=real_t, n_var=1, unit_str="bohr*au_t^-1")
193  CALL section_add_keyword(section, keyword)
194  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  default_l_val=.false., lone_keyword_l_val=.true.)
203  CALL section_add_keyword(section, keyword)
204  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  usage="annealing <REAL>", default_r_val=1.0_dp)
211  CALL section_add_keyword(section, keyword)
212  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  usage="ANNEALING_CELL <REAL>", default_r_val=1.0_dp)
219  CALL section_add_keyword(section, keyword)
220  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  usage="TEMPERATURE_ANNEALING <REAL>", default_r_val=1.0_dp)
226  CALL section_add_keyword(section, keyword)
227  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  unit_str='angstrom')
237  CALL section_add_keyword(section, keyword)
238  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  enum_i_vals=(/md_init_default, md_init_vib/))
260  CALL section_add_keyword(section, keyword)
261  CALL keyword_release(keyword)
262 
263  CALL create_langevin_section(subsection)
264  CALL section_add_subsection(section, subsection)
265  CALL section_release(subsection)
266 
267  CALL create_msst_section(subsection)
268  CALL section_add_subsection(section, subsection)
269  CALL section_release(subsection)
270 
271  CALL create_barostat_section(subsection)
272  CALL section_add_subsection(section, subsection)
273  CALL section_release(subsection)
274 
275  CALL create_thermostat_section(subsection)
276  CALL section_add_subsection(section, subsection)
277  CALL section_release(subsection)
278 
279  CALL create_respa_section(subsection)
280  CALL section_add_subsection(section, subsection)
281  CALL section_release(subsection)
282 
283  CALL create_shell_section(subsection)
284  CALL section_add_subsection(section, subsection)
285  CALL section_release(subsection)
286 
287  CALL create_adiabatic_section(subsection)
288  CALL section_add_subsection(section, subsection)
289  CALL section_release(subsection)
290 
291  CALL create_softening_section(subsection)
292  CALL section_add_subsection(section, subsection)
293  CALL section_release(subsection)
294 
295  CALL create_reftraj_section(subsection)
296  CALL section_add_subsection(section, subsection)
297  CALL section_release(subsection)
298 
299  CALL create_avgs_section(subsection)
300  CALL section_add_subsection(section, subsection)
301  CALL section_release(subsection)
302 
303  CALL create_thermal_region_section(subsection)
304  CALL section_add_subsection(section, subsection)
305  CALL section_release(subsection)
306 
307  CALL create_md_print_section(subsection)
308  CALL section_add_subsection(section, subsection)
309  CALL section_release(subsection)
310 
311  CALL create_cascade_section(subsection)
312  CALL section_add_subsection(section, subsection)
313  CALL section_release(subsection)
314 
315  CALL create_vib_init_section(subsection)
316  CALL section_add_subsection(section, subsection)
317  CALL section_release(subsection)
318 
319  END SUBROUTINE create_md_section
320 
321 ! **************************************************************************************************
322 !> \brief Defines LANGEVIN section
323 !> \param section ...
324 !> \author teo
325 ! **************************************************************************************************
326  SUBROUTINE create_langevin_section(section)
327  TYPE(section_type), POINTER :: section
328 
329  TYPE(keyword_type), POINTER :: keyword
330 
331  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  n_keywords=0, n_subsections=1, repeats=.false.)
341  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  default_r_val=0.0_dp, unit_str='fs^-1')
347  CALL section_add_keyword(section, keyword)
348  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  usage="Noisy_Gamma 4.0E-5", default_r_val=0.0_dp, unit_str='fs^-1')
355  CALL section_add_keyword(section, keyword)
356  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  usage="Shadow_Gamma 0.001", default_r_val=0.0_dp, unit_str='fs^-1')
363  CALL section_add_keyword(section, keyword)
364  CALL keyword_release(keyword)
365  END SUBROUTINE create_langevin_section
366 
367 ! **************************************************************************************************
368 !> \brief Defines print section for MD
369 !> \param section ...
370 !> \author teo
371 ! **************************************************************************************************
372  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  cpassert(.NOT. ASSOCIATED(section))
379  CALL section_create(section, __location__, name="print", &
380  description="Controls the printing properties during an MD run", &
381  n_keywords=0, n_subsections=1, repeats=.false.)
382  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  default_l_val=.false., lone_keyword_l_val=.true.)
391  CALL section_add_keyword(section, keyword)
392  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  filename="")
398  CALL section_add_subsection(section, print_key)
399  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  filename="")
405  CALL section_add_subsection(section, print_key)
406  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  filename="")
413  CALL section_add_subsection(section, print_key)
414  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  filename="")
421  CALL section_add_subsection(section, print_key)
422  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  filename="__STD_OUT__")
428  CALL section_add_subsection(section, print_key)
429  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  filename="")
435  CALL section_add_subsection(section, print_key)
436  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  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  default_l_val=.false., lone_keyword_l_val=.true.)
446  CALL section_add_keyword(print_key, keyword)
447  CALL keyword_release(keyword)
448  CALL section_add_subsection(section, print_key)
449  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  print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
455  CALL section_add_subsection(section, print_key)
456  CALL section_release(print_key)
457  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  SUBROUTINE create_respa_section(section)
465  TYPE(section_type), POINTER :: section
466 
467  TYPE(keyword_type), POINTER :: keyword
468 
469  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  citations=(/tuckerman1992, guidon2008/))
481 
482  NULLIFY (keyword)
483  CALL keyword_create(keyword, __location__, name="FREQUENCY", &
484  description="The number of reference MD steps between two RESPA corrections.", &
485  usage="FREQUENCY <INTEGER>", default_i_val=5)
486  CALL section_add_keyword(section, keyword)
487  CALL keyword_release(keyword)
488 
489  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  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  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  n_keywords=1, n_subsections=1, repeats=.false.)
508 
509  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  usage="TRAJ_FILE_NAME <CHARACTER>", default_lc_val="reftraj.xyz")
517  CALL section_add_keyword(section, keyword)
518  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  usage="CELL_FILE_NAME <CHARACTER>", default_lc_val="reftraj.cell")
524  CALL section_add_keyword(section, keyword)
525  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  repeats=.false., default_l_val=.false., lone_keyword_l_val=.true.)
531  CALL section_add_keyword(section, keyword)
532  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  repeats=.false., usage="FIRST_SNAPSHOT <INTEGER>", default_i_val=1)
538  CALL section_add_keyword(section, keyword)
539  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  repeats=.false., usage="LAST_SNAPSHOT", default_i_val=0)
548  CALL section_add_keyword(section, keyword)
549  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  repeats=.false., usage="STRIDE", default_i_val=1)
554  CALL section_add_keyword(section, keyword)
555  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, &
561  enum_c_vals=s2a("NONE", "ENERGY", "ENERGY_FORCES"), &
562  enum_desc=s2a("Evaluate nothing", "Evaluate only the energy", "Evaluate energy and forces"))
563  CALL section_add_keyword(section, keyword)
564  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  deprecation_notice="Please use MOTION / MD / REFTRAJ / EVAL instead.")
570  CALL section_add_keyword(section, keyword)
571  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  deprecation_notice="Please use MOTION / MD / REFTRAJ / EVAL instead.")
577  CALL section_add_keyword(section, keyword)
578  CALL keyword_release(keyword)
579 
580  CALL create_msd_section(subsection)
581  CALL section_add_subsection(section, subsection)
582  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  n_keywords=1, n_subsections=0, repeats=.false.)
587 
588  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  filename="")
593  CALL section_add_subsection(subsection, print_key)
594  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  filename="")
600  CALL section_add_subsection(subsection, print_key)
601  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  filename="")
609  CALL section_add_subsection(subsection, print_key)
610  CALL section_release(print_key)
611 
612  CALL section_add_subsection(section, subsection)
613  CALL section_release(subsection)
614 
615  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  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  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  n_keywords=3, n_subsections=0, repeats=.false.)
634 
635  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  lone_keyword_l_val=.true.)
642  CALL section_add_keyword(section, keyword)
643  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  repeats=.false., usage="REF0_FILENAME <CHARACTER>", default_lc_val="")
648  CALL section_add_keyword(section, keyword)
649  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  default_l_val=.false., lone_keyword_l_val=.true.)
655  CALL section_add_keyword(section, keyword)
656  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  default_l_val=.false., lone_keyword_l_val=.true.)
663  CALL section_add_keyword(section, keyword)
664  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  default_l_val=.false., lone_keyword_l_val=.true.)
670  CALL section_add_keyword(section, keyword)
671  CALL keyword_release(keyword)
672 
673  CALL create_region_section(subsection, "MSD calculation")
674  CALL section_add_subsection(section, subsection)
675  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  default_l_val=.false., lone_keyword_l_val=.true.)
682  CALL section_add_keyword(section, keyword)
683  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  default_r_val=0._dp, n_var=1, unit_str='bohr')
689  CALL section_add_keyword(section, keyword)
690  CALL keyword_release(keyword)
691 
692  END SUBROUTINE create_msd_section
693 
694 ! **************************************************************************************************
695 !> \brief ...
696 !> \param section will contain the coeff section
697 !> \author teo
698 ! **************************************************************************************************
699  SUBROUTINE create_msst_section(section)
700  TYPE(section_type), POINTER :: section
701 
702  TYPE(keyword_type), POINTER :: keyword
703 
704  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  n_keywords=1, n_subsections=0, repeats=.false.)
711 
712  NULLIFY (keyword)
713  CALL keyword_create(keyword, __location__, name="PRESSURE", &
714  description="Initial pressure", &
715  usage="PRESSURE real", &
716  default_r_val=0._dp, n_var=1, unit_str='bar')
717  CALL section_add_keyword(section, keyword)
718  CALL keyword_release(keyword)
719 
720  CALL keyword_create(keyword, __location__, name="ENERGY", &
721  description="Initial energy", &
722  usage="ENERGY real", &
723  default_r_val=0._dp, n_var=1, unit_str='hartree')
724  CALL section_add_keyword(section, keyword)
725  CALL keyword_release(keyword)
726 
727  CALL keyword_create(keyword, __location__, name="VOLUME", &
728  description="Initial volume", &
729  usage="VOLUME real", &
730  default_r_val=0._dp, n_var=1, unit_str='angstrom^3')
731  CALL section_add_keyword(section, keyword)
732  CALL keyword_release(keyword)
733 
734  CALL keyword_create(keyword, __location__, name="CMASS", &
735  description="Effective cell mass", &
736  usage="CMASS real", &
737  default_r_val=0._dp, n_var=1, unit_str='au_m')
738  CALL section_add_keyword(section, keyword)
739  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  default_r_val=0._dp, n_var=1, unit_str='m/s')
745  CALL section_add_keyword(section, keyword)
746  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  default_r_val=0.0_dp)
753  CALL section_add_keyword(section, keyword)
754  CALL keyword_release(keyword)
755 
756  END SUBROUTINE create_msst_section
757 
758 ! **************************************************************************************************
759 !> \brief section will contain some parameters for the shells dynamics
760 !> \param section ...
761 ! **************************************************************************************************
762  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  cpassert(.NOT. ASSOCIATED(section))
769 
770  CALL section_create(section, __location__, name="shell", &
771  description="Parameters of shell model in adiabatic dynamics.", &
772  n_keywords=4, n_subsections=1, repeats=.false.)
773 
774  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  unit_str="K")
782  CALL section_add_keyword(section, keyword)
783  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  usage="temp_tol 0.0", default_r_val=0.0_dp, unit_str='K')
790  CALL section_add_keyword(section, keyword)
791  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  default_l_val=.false., lone_keyword_l_val=.true.)
798  CALL section_add_keyword(section, keyword)
799  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  unit_str='angstrom')
810  CALL section_add_keyword(section, keyword)
811  CALL keyword_release(keyword)
812 
813  CALL create_thermostat_section(thermo_section)
814  CALL section_add_subsection(section, thermo_section)
815  CALL section_release(thermo_section)
816 
817  END SUBROUTINE create_shell_section
818 
819 ! **************************************************************************************************
820 !> \brief section will contain some parameters for the adiabatic dynamics
821 !> \param section ...
822 ! **************************************************************************************************
823  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  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  citations=(/vandevondele2002/))
835 
836  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  unit_str="K")
844  CALL section_add_keyword(section, keyword)
845  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  unit_str="K")
853  CALL section_add_keyword(section, keyword)
854  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  usage="temp_tol 0.0", default_r_val=0.0_dp, unit_str='K')
861  CALL section_add_keyword(section, keyword)
862  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  usage="temp_tol 0.0", default_r_val=0.0_dp, unit_str='K')
869  CALL section_add_keyword(section, keyword)
870  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  repeats=.false., default_i_val=1)
875  CALL section_add_keyword(section, keyword)
876  CALL keyword_release(keyword)
877 
878  CALL create_thermo_fast_section(thermo_fast_section)
879  CALL section_add_subsection(section, thermo_fast_section)
880  CALL section_release(thermo_fast_section)
881 
882  CALL create_thermo_slow_section(thermo_slow_section)
883  CALL section_add_subsection(section, thermo_slow_section)
884  CALL section_release(thermo_slow_section)
885 
886  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  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  //"v' = v + alpha * F_t")
908 
909  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  default_i_val=0)
914  CALL section_add_keyword(section, keyword)
915  CALL keyword_release(keyword)
916 
917  CALL keyword_create(keyword, __location__, name="DELTA", &
918  description="Displacement used to obtain y.", &
919  default_r_val=0.1_dp)
920  CALL section_add_keyword(section, keyword)
921  CALL keyword_release(keyword)
922 
923  CALL keyword_create(keyword, __location__, name="ALPHA", &
924  description="Mixing factor used for updating velocities.", &
925  default_r_val=0.15_dp)
926  CALL section_add_keyword(section, keyword)
927  CALL keyword_release(keyword)
928 
929  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  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  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  n_keywords=0, n_subsections=1, repeats=.false.)
956 
957  NULLIFY (region_section)
958  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  default_l_val=.false., lone_keyword_l_val=.true.)
965  CALL section_add_keyword(section, keyword)
966  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  default_l_val=.false., lone_keyword_l_val=.true.)
974  CALL section_add_keyword(section, keyword)
975  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  n_keywords=3, n_subsections=0, repeats=.true.)
980 
981  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  repeats=.true., n_var=-1, type_of_var=integer_t)
986  CALL section_add_keyword(region_section, keyword)
987  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  unit_str="K")
995  CALL section_add_keyword(region_section, keyword)
996  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  default_r_val=0.0_dp, unit_str='K')
1003  CALL section_add_keyword(region_section, keyword)
1004  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  default_l_val=.true., lone_keyword_l_val=.true.)
1012  CALL section_add_keyword(region_section, keyword)
1013  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  unit_str="fs^-1")
1023  CALL section_add_keyword(region_section, keyword)
1024  CALL keyword_release(keyword)
1025 
1026  CALL section_add_subsection(section, region_section)
1027  CALL section_release(region_section)
1028 
1029  NULLIFY (print_key)
1030  CALL section_create(subsection, __location__, name="PRINT", &
1031  description="Collects all print_keys for thermal_regions", &
1032  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  filename="")
1038  CALL section_add_subsection(subsection, print_key)
1039  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  filename="")
1046  CALL section_add_subsection(subsection, print_key)
1047  CALL section_release(print_key)
1048 
1049  CALL section_add_subsection(section, subsection)
1050  CALL section_release(subsection)
1051 
1052  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  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  NULLIFY (keyword)
1069  NULLIFY (subsection)
1070  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  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  lone_keyword_l_val=.true.)
1084  CALL section_add_keyword(section, keyword)
1085  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  unit_str="keV")
1092  CALL section_add_keyword(section, keyword)
1093  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  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  type_of_var=lchar_t)
1109  CALL section_add_keyword(subsection, keyword)
1110  CALL keyword_release(keyword)
1111 
1112  CALL section_add_subsection(section, subsection)
1113  CALL section_release(subsection)
1114 
1115  END SUBROUTINE create_cascade_section
1116 
1117 ! **************************************************************************************************
1118 !> \brief Defines AVERAGES section
1119 !> \param section ...
1120 !> \author teo
1121 ! **************************************************************************************************
1122  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  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  n_keywords=1, n_subsections=1, repeats=.false.)
1132  NULLIFY (keyword, print_key, subsection)
1133 
1134  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
1135  description="Controls the calculations of the averages.", &
1136  usage="&AVERAGES T", default_l_val=.true., lone_keyword_l_val=.true.)
1137  CALL section_add_keyword(section, keyword)
1138  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  default_r_val=0.0_dp, unit_str='fs')
1145  CALL section_add_keyword(section, keyword)
1146  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  lone_keyword_l_val=.true.)
1152  CALL section_add_keyword(section, keyword)
1153  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  filename="")
1159  CALL section_add_subsection(section, print_key)
1160  CALL section_release(print_key)
1161 
1162  CALL create_avgs_restart_section(subsection)
1163  CALL section_add_subsection(section, subsection)
1164  CALL section_release(subsection)
1165  END SUBROUTINE create_avgs_section
1166 
1167 ! **************************************************************************************************
1168 !> \brief Defines the AVERAGES RESTART section
1169 !> \param section ...
1170 !> \author teo
1171 ! **************************************************************************************************
1172  SUBROUTINE create_avgs_restart_section(section)
1173  TYPE(section_type), POINTER :: section
1174 
1175  TYPE(keyword_type), POINTER :: keyword
1176 
1177  cpassert(.NOT. ASSOCIATED(section))
1178  CALL section_create(section, __location__, name="RESTART_AVERAGES", &
1179  description="Stores information for restarting averages.", &
1180  n_keywords=1, n_subsections=1, repeats=.false.)
1181  NULLIFY (keyword)
1182 
1183  CALL keyword_create(keyword, __location__, name="ITIMES_START", &
1184  description="TIME STEP starting the evaluation of averages", &
1185  usage="ITIMES_START <INTEGER>", type_of_var=integer_t, n_var=1)
1186  CALL section_add_keyword(section, keyword)
1187  CALL keyword_release(keyword)
1188 
1189  CALL keyword_create(keyword, __location__, name="AVECPU", &
1190  description="CPU average", usage="AVECPU <REAL>", &
1191  type_of_var=real_t, n_var=1)
1192  CALL section_add_keyword(section, keyword)
1193  CALL keyword_release(keyword)
1194 
1195  CALL keyword_create(keyword, __location__, name="AVEHUGONIOT", &
1196  description="HUGONIOT average", usage="AVEHUGONIOT <REAL>", &
1197  type_of_var=real_t, n_var=1)
1198  CALL section_add_keyword(section, keyword)
1199  CALL keyword_release(keyword)
1200 
1201  CALL keyword_create(keyword, __location__, name="AVETEMP_BARO", &
1202  description="BAROSTAT TEMPERATURE average", usage="AVETEMP_BARO <REAL>", &
1203  type_of_var=real_t, n_var=1)
1204  CALL section_add_keyword(section, keyword)
1205  CALL keyword_release(keyword)
1206 
1207  CALL keyword_create(keyword, __location__, name="AVEPOT", &
1208  description="POTENTIAL ENERGY average", usage="AVEPOT <REAL>", &
1209  type_of_var=real_t, n_var=1)
1210  CALL section_add_keyword(section, keyword)
1211  CALL keyword_release(keyword)
1212 
1213  CALL keyword_create(keyword, __location__, name="AVEKIN", &
1214  description="KINETIC ENERGY average", usage="AVEKIN <REAL>", &
1215  type_of_var=real_t, n_var=1)
1216  CALL section_add_keyword(section, keyword)
1217  CALL keyword_release(keyword)
1218 
1219  CALL keyword_create(keyword, __location__, name="AVETEMP", &
1220  description="TEMPERATURE average", usage="AVETEMP <REAL>", &
1221  type_of_var=real_t, n_var=1)
1222  CALL section_add_keyword(section, keyword)
1223  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  type_of_var=real_t, n_var=1)
1228  CALL section_add_keyword(section, keyword)
1229  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  type_of_var=real_t, n_var=1)
1234  CALL section_add_keyword(section, keyword)
1235  CALL keyword_release(keyword)
1236 
1237  CALL keyword_create(keyword, __location__, name="AVEVOL", &
1238  description="VOLUME average", usage="AVEVOL <REAL>", &
1239  type_of_var=real_t, n_var=1)
1240  CALL section_add_keyword(section, keyword)
1241  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  type_of_var=real_t, n_var=1)
1246  CALL section_add_keyword(section, keyword)
1247  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  type_of_var=real_t, n_var=1)
1252  CALL section_add_keyword(section, keyword)
1253  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  type_of_var=real_t, n_var=1)
1258  CALL section_add_keyword(section, keyword)
1259  CALL keyword_release(keyword)
1260 
1261  CALL keyword_create(keyword, __location__, name="AVEALPHA", &
1262  description="ALPHA cell angle average", usage="AVEALPHA <REAL>", &
1263  type_of_var=real_t, n_var=1)
1264  CALL section_add_keyword(section, keyword)
1265  CALL keyword_release(keyword)
1266 
1267  CALL keyword_create(keyword, __location__, name="AVEBETA", &
1268  description="BETA cell angle average", usage="AVEBETA <REAL>", &
1269  type_of_var=real_t, n_var=1)
1270  CALL section_add_keyword(section, keyword)
1271  CALL keyword_release(keyword)
1272 
1273  CALL keyword_create(keyword, __location__, name="AVEGAMMA", &
1274  description="GAMMA cell angle average", usage="AVEGAMMA <REAL>", &
1275  type_of_var=real_t, n_var=1)
1276  CALL section_add_keyword(section, keyword)
1277  CALL keyword_release(keyword)
1278 
1279  CALL keyword_create(keyword, __location__, name="AVE_ECONS", &
1280  description="CONSTANT ENERGY average", usage="AVE_ECONS <REAL>", &
1281  type_of_var=real_t, n_var=1)
1282  CALL section_add_keyword(section, keyword)
1283  CALL keyword_release(keyword)
1284 
1285  CALL keyword_create(keyword, __location__, name="AVE_PRESS", &
1286  description="PRESSURE average", usage="AVE_PRESS <REAL>", &
1287  type_of_var=real_t, n_var=1)
1288  CALL section_add_keyword(section, keyword)
1289  CALL keyword_release(keyword)
1290 
1291  CALL keyword_create(keyword, __location__, name="AVE_PXX", &
1292  description="P_{XX} average", usage="AVE_PXX <REAL>", &
1293  type_of_var=real_t, n_var=1)
1294  CALL section_add_keyword(section, keyword)
1295  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  type_of_var=real_t, n_var=9)
1300  CALL section_add_keyword(section, keyword)
1301  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  type_of_var=real_t, n_var=9)
1306  CALL section_add_keyword(section, keyword)
1307  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  type_of_var=real_t, n_var=9)
1312  CALL section_add_keyword(section, keyword)
1313  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  type_of_var=real_t, n_var=9)
1318  CALL section_add_keyword(section, keyword)
1319  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  type_of_var=real_t, n_var=9)
1324  CALL section_add_keyword(section, keyword)
1325  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  type_of_var=real_t, n_var=9)
1330  CALL section_add_keyword(section, keyword)
1331  CALL keyword_release(keyword)
1332 
1333  CALL keyword_create(keyword, __location__, name="AVE_COLVARS", &
1334  description="COLVARS averages", usage="AVE_COLVARS <REAL> .. <REAL>", &
1335  type_of_var=real_t, n_var=-1)
1336  CALL section_add_keyword(section, keyword)
1337  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  type_of_var=real_t, n_var=-1)
1342  CALL section_add_keyword(section, keyword)
1343  CALL keyword_release(keyword)
1344  END SUBROUTINE create_avgs_restart_section
1345 
1346 ! **************************************************************************************************
1347 !> \brief Defines the INITIAL_VIBRATION section
1348 !> \param section ...
1349 !> \author Lianheng Tong
1350 ! **************************************************************************************************
1351  SUBROUTINE create_vib_init_section(section)
1352  TYPE(section_type), POINTER :: section
1353 
1354  TYPE(keyword_type), POINTER :: keyword
1355 
1356  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  n_keywords=0, n_subsections=1, repeats=.false.)
1369  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  type_of_var=lchar_t)
1380  CALL section_add_keyword(section, keyword)
1381  CALL keyword_release(keyword)
1382  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  usage="PHASE <REAL>")
1396  CALL section_add_keyword(section, keyword)
1397  CALL keyword_release(keyword)
1398  END SUBROUTINE create_vib_init_section
1399 
1400 END MODULE input_cp2k_md
collects all references to literature in CP2K as new algorithms / method are included from literature...
Definition: bibliography.F:28
integer, save, public rengaraj2020
Definition: bibliography.F:43
integer, save, public vandevondele2002
Definition: bibliography.F:43
integer, save, public west2006
Definition: bibliography.F:43
integer, save, public tuckerman1992
Definition: bibliography.F:43
integer, save, public kuhne2007
Definition: bibliography.F:43
integer, save, public ricci2003
Definition: bibliography.F:43
integer, save, public guidon2008
Definition: bibliography.F:43
integer, save, public kantorovich2008
Definition: bibliography.F:43
integer, save, public minary2003
Definition: bibliography.F:43
integer, save, public kantorovich2008a
Definition: bibliography.F:43
integer, save, public evans1983
Definition: bibliography.F:43
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public debug_print_level
integer, parameter, public low_print_level
integer, parameter, public medium_print_level
integer, parameter, public high_print_level
integer, parameter, public add_last_numeric
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str)
creates a print_key section
unit conversion facility
Definition: cp_units.F:30
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Definition: cp_units.F:1150
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public nvt_adiabatic_ensemble
integer, parameter, public nph_uniaxial_ensemble
integer, parameter, public npt_i_ensemble
integer, parameter, public isokin_ensemble
integer, parameter, public nph_uniaxial_damped_ensemble
integer, parameter, public npe_f_ensemble
integer, parameter, public langevin_ensemble
integer, parameter, public npe_i_ensemble
integer, parameter, public md_init_default
integer, parameter, public npt_ia_ensemble
integer, parameter, public nve_ensemble
integer, parameter, public npt_f_ensemble
integer, parameter, public md_init_vib
integer, parameter, public reftraj_ensemble
integer, parameter, public nvt_ensemble
integer, parameter, public nph_ensemble
subroutine, public create_barostat_section(section)
...
subroutine, public create_md_section(section)
...
Definition: input_cp2k_md.F:69
subroutine, public create_thermo_fast_section(section, coupled_thermostat)
Specifies parameter for thermostat for constant temperature ensembles.
subroutine, public create_thermo_slow_section(section, coupled_thermostat)
Specifies parameter for thermostat for constant temperature ensembles.
subroutine, public create_thermostat_section(section, coupled_thermostat)
Specifies parameter for thermostat for constant temperature ensembles.
subroutine, public create_region_section(section, label)
Creates a section to arbitrary define a region to thermostat.
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
subroutine, public section_add_subsection(section, subsection)
adds a subsection to the given section
recursive subroutine, public section_release(section)
releases the given keyword list (see doc/ReferenceCounting.html)
a wrapper for basic fortran types.
integer, parameter, public real_t
integer, parameter, public lchar_t
integer, parameter, public integer_t
Defines the basic variable types.
Definition: kinds.F:23
integer, parameter, public dp
Definition: kinds.F:34
initialization of the reftraj structure used to analyse previously generated trajectories
Definition: reftraj_types.F:15
integer, parameter, public reftraj_eval_energy
Definition: reftraj_types.F:34
integer, parameter, public reftraj_eval_energy_forces
Definition: reftraj_types.F:35
integer, parameter, public reftraj_eval_none
Definition: reftraj_types.F:33
Utilities for string manipulations.