(git:c641773)
Loading...
Searching...
No Matches
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-2026 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
26 USE input_constants, ONLY: &
44 USE input_val_types, ONLY: char_t,&
45 integer_t,&
46 lchar_t,&
47 real_t
48 USE kinds, ONLY: dp
55 USE string_utilities, ONLY: newline,&
56 s2a
57#include "../base/base_uses.f90"
58
59 IMPLICIT NONE
60 PRIVATE
61
62 LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
63 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_md'
64
65 PUBLIC :: create_md_section
66
67CONTAINS
68
69! **************************************************************************************************
70!> \brief ...
71!> \param section will contain the md section
72!> \author fawzi
73! **************************************************************************************************
74 SUBROUTINE create_md_section(section)
75 TYPE(section_type), POINTER :: section
76
77 TYPE(keyword_type), POINTER :: keyword
78 TYPE(section_type), POINTER :: subsection
79
80 cpassert(.NOT. ASSOCIATED(section))
81 CALL section_create(section, __location__, name="MD", &
82 description="This section defines the whole set of parameters needed perform an MD run.", &
83 n_keywords=13, n_subsections=6, repeats=.false.)
84
85 NULLIFY (keyword, subsection)
86 CALL keyword_create(keyword, __location__, name="ensemble", &
87 description="The ensemble/integrator that you want to use for MD propagation", &
88 usage="ensemble nve", &
89 default_i_val=nve_ensemble, &
90 enum_c_vals=s2a("NVE", "NVT", "NPT_I", "NPT_F", "MSST", "MSST_DAMPED", &
91 "HYDROSTATICSHOCK", "ISOKIN", "REFTRAJ", "LANGEVIN", "NPE_F", &
92 "NPE_I", "NVT_ADIABATIC", "NPT_IA"), &
93 enum_desc=s2a("constant energy (microcanonical)", &
94 "constant temperature and volume (canonical)", &
95 "constant temperature and pressure using an isotropic cell", &
96 "constant temperature and pressure using a flexible cell", &
97 "simulate steady shock (uniaxial)", &
98 "simulate steady shock (uniaxial) with extra viscosity", &
99 "simulate steady shock with hydrostatic pressure", &
100 "constant kinetic energy", &
101 "reading frames from a file called reftraj.xyz (e.g. for property calculation)", &
102 "langevin dynamics (constant temperature)", &
103 "constant pressure ensemble (no thermostat)", &
104 "constant pressure ensemble using an isotropic cell (no thermostat)", &
105 "adiabatic dynamics in constant temperature and volume ensemble (CAFES)", &
106 "NPT_I ensemble with frozen atoms in absolute coordinate"), &
107 citations=[evans1983, vandevondele2002, minary2003], &
112 CALL section_add_keyword(section, keyword)
113 CALL keyword_release(keyword)
114
115 CALL keyword_create(keyword, __location__, name="STEPS", &
116 description="The number of MD steps to perform, counting from step_start_val. ", &
117 usage="STEPS 100", default_i_val=3)
118 CALL section_add_keyword(section, keyword)
119 CALL keyword_release(keyword)
120
121 CALL keyword_create(keyword, __location__, name="MAX_STEPS", &
122 description="The number of MD steps to perform, counting from step 1", &
123 usage="MAX_STEPS 100", default_i_val=1000000000)
124 CALL section_add_keyword(section, keyword)
125 CALL keyword_release(keyword)
126
127 CALL keyword_create(keyword, __location__, name="TIMESTEP", &
128 description="The length of an integration step (in case RESPA the large TIMESTEP)", &
129 usage="TIMESTEP 1.0", default_r_val=cp_unit_to_cp2k(value=0.5_dp, unit_str="fs"), &
130 unit_str="fs")
131 CALL section_add_keyword(section, keyword)
132 CALL keyword_release(keyword)
133
134 CALL keyword_create(keyword, __location__, name="STEP_START_VAL", &
135 description="The starting step value for the MD", usage="STEP_START_VAL <integer>", &
136 default_i_val=0)
137 CALL section_add_keyword(section, keyword)
138 CALL keyword_release(keyword)
139
140 CALL keyword_create(keyword, __location__, name="TIME_START_VAL", &
141 description="The starting timer value for the MD", &
142 usage="TIME_START_VAL <real>", default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="fs"), &
143 unit_str="fs")
144 CALL section_add_keyword(section, keyword)
145 CALL keyword_release(keyword)
146
147 CALL keyword_create(keyword, __location__, name="ECONS_START_VAL", &
148 description="The starting value of the conserved quantity", &
149 usage="ECONS_START_VAL <real>", default_r_val=0.0_dp, &
150 unit_str="hartree")
151 CALL section_add_keyword(section, keyword)
152 CALL keyword_release(keyword)
153
154 CALL keyword_create(keyword, __location__, name="TEMPERATURE", &
155 description="The temperature in K used to initialize "// &
156 "the velocities with init and pos restart, and in the NPT/NVT simulations", &
157 usage="TEMPERATURE 325.0", default_r_val=cp_unit_to_cp2k(value=300.0_dp, unit_str="K"), &
158 unit_str="K")
159 CALL section_add_keyword(section, keyword)
160 CALL keyword_release(keyword)
161
162 CALL keyword_create(keyword, __location__, name="TEMP_TOL", &
163 variants=s2a("temp_to", "temperature_tolerance"), &
164 description="The maximum accepted deviation of the (global) temperature "// &
165 "from the desired target temperature before a rescaling of the velocities "// &
166 "is performed. If it is 0 no rescaling is performed. NOTE: This keyword is "// &
167 "obsolescent; Using a CSVR thermostat with a short timeconstant is "// &
168 "recommended as a better alternative.", &
169 usage="TEMP_TOL 0.0", default_r_val=0.0_dp, unit_str='K')
170 CALL section_add_keyword(section, keyword)
171 CALL keyword_release(keyword)
172
173 CALL keyword_create(keyword, __location__, name="TEMP_KIND", &
174 description="Compute the temperature per each kind separately", &
175 usage="TEMP_KIND LOGICAL", &
176 default_l_val=.false., lone_keyword_l_val=.true.)
177 CALL section_add_keyword(section, keyword)
178 CALL keyword_release(keyword)
179
180 CALL keyword_create(keyword, __location__, name="SCALE_TEMP_KIND", &
181 description="When necessary rescale the temperature per each kind separately", &
182 usage="SCALE_TEMP_KIND LOGICAL", &
183 default_l_val=.false., lone_keyword_l_val=.true.)
184 CALL section_add_keyword(section, keyword)
185 CALL keyword_release(keyword)
186
187 CALL keyword_create(keyword, __location__, name="COMVEL_TOL", &
188 description="The maximum accepted velocity of the center of mass. "// &
189 "With Shell-Model, comvel may drift if MD%THERMOSTAT%REGION /= GLOBAL ", &
190 usage="COMVEL_TOL 0.1", type_of_var=real_t, n_var=1, unit_str="bohr*au_t^-1")
191 CALL section_add_keyword(section, keyword)
192 CALL keyword_release(keyword)
193
194 CALL keyword_create(keyword, __location__, name="ANGVEL_TOL", &
195 description="The maximum accepted angular velocity. This option is ignored "// &
196 "when the system is periodic. Removes the components of the velocities that "// &
197 "project on the external rotational degrees of freedom.", &
198 usage="ANGVEL_TOL 0.1", type_of_var=real_t, n_var=1, unit_str="bohr*au_t^-1")
199 CALL section_add_keyword(section, keyword)
200 CALL keyword_release(keyword)
201
202 CALL keyword_create(keyword, __location__, name="ANGVEL_ZERO", &
203 description="Set the initial angular velocity to zero. This option is ignored "// &
204 "when the system is periodic or when initial velocities are defined. Technically, "// &
205 "the part of the random initial velocities that projects on the external "// &
206 "rotational degrees of freedom is subtracted.", &
207 usage="ANGVEL_ZERO LOGICAL", &
208 default_l_val=.false., lone_keyword_l_val=.true.)
209 CALL section_add_keyword(section, keyword)
210 CALL keyword_release(keyword)
211
212 CALL keyword_create(keyword, __location__, name="ANNEALING", &
213 description="Specifies the rescaling factor for annealing velocities. "// &
214 "Automatically enables the annealing procedure. This scheme works only for ensembles "// &
215 "that do not have thermostats on particles.", &
216 usage="annealing <REAL>", default_r_val=1.0_dp)
217 CALL section_add_keyword(section, keyword)
218 CALL keyword_release(keyword)
219
220 CALL keyword_create(keyword, __location__, name="ANNEALING_CELL", &
221 description="Specifies the rescaling factor for annealing velocities of the CELL "// &
222 "Automatically enables the annealing procedure for the CELL. This scheme works only "// &
223 "for ensambles that do not have thermostat on CELLS velocities.", &
224 usage="ANNEALING_CELL <REAL>", default_r_val=1.0_dp)
225 CALL section_add_keyword(section, keyword)
226 CALL keyword_release(keyword)
227
228 CALL keyword_create(keyword, __location__, name="TEMPERATURE_ANNEALING", &
229 description="Specifies the rescaling factor for the external temperature. "// &
230 "This scheme works only for the Langevin ensemble.", &
231 usage="TEMPERATURE_ANNEALING <REAL>", default_r_val=1.0_dp)
232 CALL section_add_keyword(section, keyword)
233 CALL keyword_release(keyword)
234
235 CALL keyword_create(keyword, __location__, name="DISPLACEMENT_TOL", &
236 description="This keyword sets a maximum atomic displacement "// &
237 "in each Cartesian direction. "// &
238 "The maximum velocity is evaluated and if it is too large to remain "// &
239 "within the assigned limit, the time step is rescaled accordingly, "// &
240 "and the first half step of the velocity verlet is repeated.", &
241 usage="DISPLACEMENT_TOL <REAL>", default_r_val=100.0_dp, &
242 unit_str='angstrom')
243 CALL section_add_keyword(section, keyword)
244 CALL keyword_release(keyword)
245
246 CALL keyword_create(keyword, __location__, name="INITIALIZATION_METHOD", &
247 description="This keyword selects which method to use to initialize MD. "// &
248 "If velecities are not set explicitly, DEFAULT optioin will assign "// &
249 "random velocities and then scale according to TEMPERATURE; VIBRATIONAL "// &
250 "option will then use previously calculated vibrational modes to "// &
251 "initialise both the atomic positions and velocities so that the "// &
252 "starting point for MD is as close to canonical ensemble as possible, "// &
253 "without the need for lengthy equilibration steps. See PRL 96, 115504 "// &
254 "(2006). The user input atomic positions in this case are expected to "// &
255 "be already geometry optimised. Further options for VIBRATIONAL mode "// &
256 "is can be set in INITIAL_VIBRATION subsection. If unspecified, then "// &
257 "the DEFAULT mode will be used.", &
258 usage="INITIALIZATION_METHOD DEFAULT", &
259 default_i_val=md_init_default, &
260 enum_c_vals=s2a("DEFAULT", "VIBRATIONAL"), &
261 enum_desc=s2a("Assign random velocities and then scale according to "// &
262 "TEMPERATURE", &
263 "Initialise positions and velocities to give canonical ensemble "// &
264 "with TEMPERATURE, using the method described in PRL 96, 115504 (2006)"), &
265 enum_i_vals=[md_init_default, md_init_vib])
266 CALL section_add_keyword(section, keyword)
267 CALL keyword_release(keyword)
268
269 CALL create_langevin_section(subsection)
270 CALL section_add_subsection(section, subsection)
271 CALL section_release(subsection)
272
273 CALL create_msst_section(subsection)
274 CALL section_add_subsection(section, subsection)
275 CALL section_release(subsection)
276
277 CALL create_barostat_section(subsection)
278 CALL section_add_subsection(section, subsection)
279 CALL section_release(subsection)
280
281 CALL create_thermostat_section(subsection)
282 CALL section_add_subsection(section, subsection)
283 CALL section_release(subsection)
284
285 CALL create_respa_section(subsection)
286 CALL section_add_subsection(section, subsection)
287 CALL section_release(subsection)
288
289 CALL create_shell_section(subsection)
290 CALL section_add_subsection(section, subsection)
291 CALL section_release(subsection)
292
293 CALL create_adiabatic_section(subsection)
294 CALL section_add_subsection(section, subsection)
295 CALL section_release(subsection)
296
297 CALL create_softening_section(subsection)
298 CALL section_add_subsection(section, subsection)
299 CALL section_release(subsection)
300
301 CALL create_reftraj_section(subsection)
302 CALL section_add_subsection(section, subsection)
303 CALL section_release(subsection)
304
305 CALL create_avgs_section(subsection)
306 CALL section_add_subsection(section, subsection)
307 CALL section_release(subsection)
308
309 CALL create_thermal_region_section(subsection)
310 CALL section_add_subsection(section, subsection)
311 CALL section_release(subsection)
312
313 CALL create_md_print_section(subsection)
314 CALL section_add_subsection(section, subsection)
315 CALL section_release(subsection)
316
317 CALL create_cascade_section(subsection)
318 CALL section_add_subsection(section, subsection)
319 CALL section_release(subsection)
320
321 CALL create_vib_init_section(subsection)
322 CALL section_add_subsection(section, subsection)
323 CALL section_release(subsection)
324
325 CALL create_electrons_section(subsection)
326 CALL section_add_subsection(section, subsection)
327 CALL section_release(subsection)
328
329 END SUBROUTINE create_md_section
330
331! **************************************************************************************************
332!> \brief Defines LANGEVIN section
333!> \param section ...
334!> \author teo
335! **************************************************************************************************
336 SUBROUTINE create_langevin_section(section)
337 TYPE(section_type), POINTER :: section
338
339 TYPE(keyword_type), POINTER :: keyword
340
341 cpassert(.NOT. ASSOCIATED(section))
342 CALL section_create(section, __location__, name="Langevin", &
343 description="Controls the set of parameters to run a Langevin MD. "// &
344 "The integrator used follows that given in the article by Ricci et al. "// &
345 "The user can define regions in the system where the atoms inside "// &
346 "undergoes Langevin MD, while those outside the regions undergoes "// &
347 "NVE Born Oppenheimer MD. To define the regions, the user should "// &
348 "use THERMAL_REGION subsection of MOTION%MD. ", &
349 citations=[ricci2003, kuhne2007, rengaraj2020], &
350 n_keywords=0, n_subsections=1, repeats=.false.)
351 NULLIFY (keyword)
352
353 CALL keyword_create(keyword, __location__, name="gamma", &
354 description="Gamma parameter for the Langevin dynamics (LD)", &
355 usage="gamma 0.001", &
356 default_r_val=0.0_dp, unit_str='fs^-1')
357 CALL section_add_keyword(section, keyword)
358 CALL keyword_release(keyword)
359
360 CALL keyword_create(keyword, __location__, name="Noisy_Gamma", &
361 variants=["NoisyGamma"], &
362 description="Imaginary Langevin Friction term for LD with noisy forces.", &
363 citations=[kuhne2007], &
364 usage="Noisy_Gamma 4.0E-5", default_r_val=0.0_dp, unit_str='fs^-1')
365 CALL section_add_keyword(section, keyword)
366 CALL keyword_release(keyword)
367
368 CALL keyword_create(keyword, __location__, name="Shadow_Gamma", &
369 variants=["ShadowGamma"], &
370 description="Shadow Langevin Friction term for LD with noisy forces in order to adjust Noisy_Gamma.", &
371 citations=[rengaraj2020], &
372 usage="Shadow_Gamma 0.001", default_r_val=0.0_dp, unit_str='fs^-1')
373 CALL section_add_keyword(section, keyword)
374 CALL keyword_release(keyword)
375 END SUBROUTINE create_langevin_section
376
377! **************************************************************************************************
378!> \brief Defines print section for MD
379!> \param section ...
380!> \author teo
381! **************************************************************************************************
382 SUBROUTINE create_md_print_section(section)
383 TYPE(section_type), POINTER :: section
384
385 TYPE(keyword_type), POINTER :: keyword
386 TYPE(section_type), POINTER :: print_key
387
388 cpassert(.NOT. ASSOCIATED(section))
389 CALL section_create(section, __location__, name="print", &
390 description="Controls the printing properties during an MD run", &
391 n_keywords=0, n_subsections=1, repeats=.false.)
392 NULLIFY (print_key, keyword)
393
394 CALL keyword_create(keyword, __location__, name="FORCE_LAST", &
395 description="Print the output and restart file if walltime is reached or "// &
396 "if an external EXIT command is given. It still requires the keyword LAST "// &
397 "to be present for the specific print key (in case the last step should not "// &
398 "match with the print_key iteration number).", &
399 usage="FORCE_LAST LOGICAL", &
400 default_l_val=.false., lone_keyword_l_val=.true.)
401 CALL section_add_keyword(section, keyword)
402 CALL keyword_release(keyword)
403
404 CALL cp_print_key_section_create(print_key, __location__, "ENERGY", &
405 description="Controls the output the ener file", &
406 print_level=low_print_level, common_iter_levels=1, &
407 filename="")
408 CALL section_add_subsection(section, print_key)
409 CALL section_release(print_key)
410
411 CALL cp_print_key_section_create(print_key, __location__, "SHELL_ENERGY", &
412 description="Controls the output of the shell-energy file (only if shell-model)", &
413 print_level=medium_print_level, common_iter_levels=1, &
414 filename="")
415 CALL section_add_subsection(section, print_key)
416 CALL section_release(print_key)
417
418 CALL cp_print_key_section_create(print_key, __location__, "TEMP_KIND", &
419 description="Controls the output of the temperature"// &
420 " computed separately for each kind", &
421 print_level=high_print_level, common_iter_levels=1, &
422 filename="")
423 CALL section_add_subsection(section, print_key)
424 CALL section_release(print_key)
425
426 CALL cp_print_key_section_create(print_key, __location__, "TEMP_SHELL_KIND", &
427 description="Controls the output of the temperature of the"// &
428 " shell-core motion computed separately for each kind", &
429 print_level=high_print_level, common_iter_levels=1, &
430 filename="")
431 CALL section_add_subsection(section, print_key)
432 CALL section_release(print_key)
433
434 CALL cp_print_key_section_create(print_key, __location__, "CENTER_OF_MASS", &
435 description="Controls the printing of COM velocity during an MD", &
436 print_level=medium_print_level, common_iter_levels=1, &
437 filename="__STD_OUT__")
438 CALL section_add_subsection(section, print_key)
439 CALL section_release(print_key)
440
441 CALL cp_print_key_section_create(print_key, __location__, "COEFFICIENTS", &
442 description="Controls the printing of coefficients during an MD run.", &
443 print_level=medium_print_level, common_iter_levels=1, &
444 filename="")
445 CALL section_add_subsection(section, print_key)
446 CALL section_release(print_key)
447
448 CALL cp_print_key_section_create(print_key, __location__, "ROTATIONAL_INFO", &
449 description="Controls the printing basic info during the calculation of the "// &
450 "translational/rotational degrees of freedom.", print_level=low_print_level, &
451 add_last=add_last_numeric, filename="__STD_OUT__")
452 CALL keyword_create(keyword, __location__, name="COORDINATES", &
453 description="Prints atomic coordinates in the standard orientation. "// &
454 "Coordinates are not affected during the calculation.", &
455 default_l_val=.false., lone_keyword_l_val=.true.)
456 CALL section_add_keyword(print_key, keyword)
457 CALL keyword_release(keyword)
458 CALL section_add_subsection(section, print_key)
459 CALL section_release(print_key)
460
461 CALL cp_print_key_section_create(print_key, __location__, "PROGRAM_RUN_INFO", &
462 description="Controls the printing of basic and summary information during the"// &
463 " Molecular Dynamics", &
464 print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
465 CALL section_add_subsection(section, print_key)
466 CALL section_release(print_key)
467 END SUBROUTINE create_md_print_section
468
469! **************************************************************************************************
470!> \brief Defines parameters for RESPA integration scheme
471!> \param section will contain the coeff section
472!> \author teo
473! **************************************************************************************************
474 SUBROUTINE create_respa_section(section)
475 TYPE(section_type), POINTER :: section
476
477 TYPE(keyword_type), POINTER :: keyword
478
479 cpassert(.NOT. ASSOCIATED(section))
480
481 CALL section_create(section, __location__, name="RESPA", &
482 description="Multiple timestep integration based on RESPA (implemented for NVE only)."// &
483 " RESPA exploits multiple force_eval."// &
484 " In this case the order of the force_eval maps"// &
485 " the order of the respa shells from the slowest to the fastest force evaluation."// &
486 " If force_evals share the same subsys, it's enough then to specify the"// &
487 " subsys in the force_eval corresponding at the first index in the multiple_force_eval list."// &
488 " Can be used to speedup classical and ab initio MD simulations.", &
489 n_keywords=1, n_subsections=0, repeats=.false., &
490 citations=[tuckerman1992, guidon2008])
491
492 NULLIFY (keyword)
493 CALL keyword_create(keyword, __location__, name="FREQUENCY", &
494 description="The number of reference MD steps between two RESPA corrections.", &
495 usage="FREQUENCY <INTEGER>", default_i_val=5)
496 CALL section_add_keyword(section, keyword)
497 CALL keyword_release(keyword)
498
499 END SUBROUTINE create_respa_section
500
501! **************************************************************************************************
502!> \brief Defines parameters for REFTRAJ analysis
503!> \param section will contain the coeff section
504!> \author teo
505! **************************************************************************************************
506 SUBROUTINE create_reftraj_section(section)
507 TYPE(section_type), POINTER :: section
508
509 TYPE(keyword_type), POINTER :: keyword
510 TYPE(section_type), POINTER :: print_key, subsection
511
512 cpassert(.NOT. ASSOCIATED(section))
513
514 CALL section_create(section, __location__, name="REFTRAJ", &
515 description="Loads an external trajectory file and performs analysis on "// &
516 "the loaded snapshots; optionally, calculates per-frame potential energy, "// &
517 "forces and other properties as requested by the keyword `EVAL` below with "// &
518 "the force method specified in the `&FORCE_EVAL` section. Time integration "// &
519 "is not performed here, and quantities of velocity, temperature and kinetic "// &
520 "energy from nuclear motion are therefore irrelevant. Such a REFTRAJ run is "// &
521 "essentially a series of single-point calculations; the snapshots are not "// &
522 "necessarily from MD and may be from custom concatenation."//newline//newline// &
523 "The trajectory should be a multi-frame XYZ file where each frame has the "// &
524 "same number of atoms and kind specification as the `&FORCE_EVAL/&SUBSYS` "// &
525 "down to the exact ordering, but cell (box) size and shape can be different. "// &
526 "The comment line of each frame is parsed for additional information such "// &
527 "as cell, step, time and energy; currently the parser supports the same "// &
528 "formats as the XYZ option of `&FORCE_EVAL/&SUBSYS/&CELL/CELL_FILE_FORMAT`, "// &
529 "corresponding to trajectory files printed from `&MOTION/&PRINT/&TRAJECTORY` "// &
530 "as XYZ and EXTXYZ and from the external `dumpdcd` tool."//newline//newline// &
531 "A minimal working example trajectory in the extended XYZ format should have "// &
532 '`Lattice="<Ax> <Ay> <Az> <Bx> <By> <Bz> <Cx> <Cy> <Cz>"` for the components '// &
533 "of cell vectors A, B, C, and `Step=<integer>` for the integer timestep. "// &
534 "`Time=<real>` and `Energy=<real>` for simulation time and potential energy "// &
535 "respectively are also parsed; if omitted, the default value will be 0.0 . "// &
536 "Note that the parser is case insensitive, but whitespaces are only used "// &
537 "between key-value pairs as delimiters and not around the = signs in an "// &
538 "extended XYZ file. `Properties=species:S:1:pos:R:3` is always assumed for "// &
539 "backwards compatibility with the primitive XYZ specification: the first "// &
540 "column is a string for element symbol (or kind alias), followed by three "// &
541 "columns of real values for Cartesian coordinates in angstrom."//newline//newline// &
542 "Alternatively, the legacy brief format from `&TRAJECTORY` output where the "// &
543 "comment line starts with `i = <integer>` for the integer timestep can also "// &
544 "be used, this time with the = sign surrounded by whitespaces. The cell "// &
545 "information may come from a separate file requested by `CELL_FILE_NAME` if "// &
546 "variable, or may be taken as the `&FORCE_EVAL/&SUBSYS/&CELL` if constant.", &
547 n_keywords=1, n_subsections=1, repeats=.false.)
548
549 NULLIFY (keyword, print_key, subsection)
550
551 CALL keyword_create(keyword, __location__, name="TRAJ_FILE_NAME", &
552 description="Specify the filename where the trajectory is stored.", &
553 repeats=.false., &
554 usage="TRAJ_FILE_NAME <CHARACTER>", default_lc_val="reftraj.xyz")
555 CALL section_add_keyword(section, keyword)
556 CALL keyword_release(keyword)
557
558 CALL keyword_create(keyword, __location__, name="CELL_FILE_NAME", &
559 description="Specify the filename where the cell is stored "// &
560 "(for trajectories generated within variable cell ensembles). "// &
561 "This file will be parsed only when no cell information is found "// &
562 "in the trajectory file and VARIABLE_VOLUME is set to .TRUE.", &
563 repeats=.false., &
564 usage="CELL_FILE_NAME <CHARACTER>", default_lc_val="reftraj.cell")
565 CALL section_add_keyword(section, keyword)
566 CALL keyword_release(keyword)
567
568 CALL keyword_create(keyword, __location__, name="VARIABLE_VOLUME", &
569 description="Enables the possibility to read a CELL file with "// &
570 "information on the CELL size during the MD. This keyword will be "// &
571 "ignored if cell information is already available in the trajectory file.", &
572 repeats=.false., default_l_val=.false., lone_keyword_l_val=.true.)
573 CALL section_add_keyword(section, keyword)
574 CALL keyword_release(keyword)
575
576 CALL keyword_create(keyword, __location__, name="FIRST_SNAPSHOT", &
577 description="Index of the snapshot stored in the trajectory file "// &
578 "from which to start a REFTRAJ run", &
579 repeats=.false., usage="FIRST_SNAPSHOT <INTEGER>", default_i_val=1)
580 CALL section_add_keyword(section, keyword)
581 CALL keyword_release(keyword)
582
583 CALL keyword_create(keyword, __location__, name="LAST_SNAPSHOT", &
584 description="Index of the last snapshot stored in the trajectory file "// &
585 "that is read along a REFTRAJ run. Must be specified as default is 0. "// &
586 "Must be specified exactly as LAST_SNAPSHOT = FIRST_SNAPSHOT + STRIDE*(number of strides) "// &
587 "to avoid an error 'Unexpected EOF'. Note that STRIDE*(number of strides) "// &
588 "is simply the number of steps between the first to last snapshot.", &
589 repeats=.false., usage="LAST_SNAPSHOT", default_i_val=0)
590 CALL section_add_keyword(section, keyword)
591 CALL keyword_release(keyword)
592
593 CALL keyword_create(keyword, __location__, name="STRIDE", &
594 description=" Stride in number of snapshot for the reftraj analysis", &
595 repeats=.false., usage="STRIDE", default_i_val=1)
596 CALL section_add_keyword(section, keyword)
597 CALL keyword_release(keyword)
598
599 CALL keyword_create(keyword, __location__, name="EVAL", &
600 description="Selects the mode of energy and force evaluation for each "// &
601 "retrieved snapshot during a REFTRAJ run, which determines availability "// &
602 "of other properties and the time consumption in the computation. The "// &
603 "default is NONE, a conservative option useful for analyses concerning "// &
604 "structure only that are independent of force method, such as MSD and "// &
605 "`&MOTION/&PRINT/&STRUCTURE_DATA`. This keyword supersedes the logical "// &
606 "keywords `EVAL_<mode>` in older versions of the program.", &
607 default_i_val=reftraj_eval_none, &
609 enum_c_vals=s2a("NONE", "ENERGY", "ENERGY_FORCES"), &
610 enum_desc=s2a("Do not evaluate energy or force", &
611 "Evaluate only the energy", &
612 "Evaluate energy and forces"))
613 CALL section_add_keyword(section, keyword)
614 CALL keyword_release(keyword)
615
616 CALL keyword_create(keyword, __location__, name="WRAP", &
617 description="Whether and how atoms would be wrapped to inside the "// &
618 "simulation box according to periodic boundary condition before any "// &
619 "subsequent analysis. Useful when there is need to convert the raw, "// &
620 "unwrapped coordinates produced from `MOTION%PRINT%TRAJECTORY` for "// &
621 "post-processing. This keyword will be ignored when requesting MSD "// &
622 "calculation because wrapping coordinates makes displacement discontinuous.", &
623 default_i_val=reftraj_wrap_none, &
625 enum_c_vals=s2a("NONE", "POSITIVE", "CENTRAL"), &
626 enum_desc=s2a("Do not wrap atoms at all and use coordinates exactly as input", &
627 "Wrap atoms so that fractional coordinates are within [0, 1]", &
628 "Wrap atoms so that fractional coordinates are within [-1/2, +1/2]"))
629 CALL section_add_keyword(section, keyword)
630 CALL keyword_release(keyword)
631
632 CALL create_msd_section(subsection)
633 CALL section_add_subsection(section, subsection)
634 CALL section_release(subsection)
635
636 CALL section_create(subsection, __location__, name="print", &
637 description="The section that controls the output of a reftraj run", &
638 n_keywords=1, n_subsections=0, repeats=.false.)
639
640 NULLIFY (print_key)
641 CALL cp_print_key_section_create(print_key, __location__, "msd_kind", &
642 description="Controls the output of msd per kind", &
643 print_level=low_print_level, common_iter_levels=1, &
644 filename="")
645 CALL section_add_subsection(subsection, print_key)
646 CALL section_release(print_key)
647
648 CALL cp_print_key_section_create(print_key, __location__, "msd_molecule", &
649 description="Controls the output of msd per molecule kind", &
650 print_level=low_print_level, common_iter_levels=1, &
651 filename="")
652 CALL section_add_subsection(subsection, print_key)
653 CALL section_release(print_key)
654
655 CALL cp_print_key_section_create(print_key, __location__, "displaced_atom", &
656 description="Controls the output of index and dislacement of "// &
657 "atoms that moved away from the initial position of more than a "// &
658 "given distance (see msd%disp_tol)", &
659 print_level=low_print_level, common_iter_levels=1, &
660 filename="")
661 CALL section_add_subsection(subsection, print_key)
662 CALL section_release(print_key)
663
664 CALL section_add_subsection(section, subsection)
665 CALL section_release(subsection)
666
667 END SUBROUTINE create_reftraj_section
668
669! **************************************************************************************************
670!> \brief Defines parameters for MSD calculation along a REFTRAJ analysis
671!> \param section will contain the coeff section
672!> \author MI
673! **************************************************************************************************
674 SUBROUTINE create_msd_section(section)
675 TYPE(section_type), POINTER :: section
676
677 TYPE(keyword_type), POINTER :: keyword
678 TYPE(section_type), POINTER :: subsection
679
680 cpassert(.NOT. ASSOCIATED(section))
681
682 CALL section_create(section, __location__, name="MSD", &
683 description="Loads an external trajectory file and performs analysis on the"// &
684 " loaded snapshots.", &
685 n_keywords=3, n_subsections=0, repeats=.false.)
686
687 NULLIFY (keyword, subsection)
688
689 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
690 description="controls the activation of core-level spectroscopy simulations", &
691 usage="&MSD T", &
692 default_l_val=.false., &
693 lone_keyword_l_val=.true.)
694 CALL section_add_keyword(section, keyword)
695 CALL keyword_release(keyword)
696
697 CALL keyword_create(keyword, __location__, name="REF0_FILENAME", &
698 description="Specify the filename where the initial reference configuration is stored.", &
699 repeats=.false., usage="REF0_FILENAME <CHARACTER>", default_lc_val="")
700 CALL section_add_keyword(section, keyword)
701 CALL keyword_release(keyword)
702
703 CALL keyword_create(keyword, __location__, name="MSD_PER_KIND", &
704 description="Set up the calculation of the MSD for each atomic kind", &
705 usage="MSD_PER_KIND <LOGICAL>", repeats=.false., &
706 default_l_val=.false., lone_keyword_l_val=.true.)
707 CALL section_add_keyword(section, keyword)
708 CALL keyword_release(keyword)
709
710 CALL keyword_create(keyword, __location__, name="MSD_PER_MOLKIND", &
711 description="Set up the calculation of the MSD for each molecule kind. "// &
712 "The position of the center of mass of the molecule is considered.", &
713 usage="MSD_PER_MOLKIND <LOGICAL>", repeats=.false., &
714 default_l_val=.false., lone_keyword_l_val=.true.)
715 CALL section_add_keyword(section, keyword)
716 CALL keyword_release(keyword)
717
718 CALL keyword_create(keyword, __location__, name="MSD_PER_REGION", &
719 description="Set up the calculation of the MSD for each defined region.", &
720 usage="MSD_PER_REGION <LOGICAL>", repeats=.false., &
721 default_l_val=.false., lone_keyword_l_val=.true.)
722 CALL section_add_keyword(section, keyword)
723 CALL keyword_release(keyword)
724
725 CALL create_region_section(subsection, "MSD calculation")
726 CALL section_add_subsection(section, subsection)
727 CALL section_release(subsection)
728
729 CALL keyword_create(keyword, __location__, name="DISPLACED_ATOM", &
730 description="Identify the atoms that moved from their initial "// &
731 "position of a distance larger than a given tolerance (see msd%displacement_tol).", &
732 usage="DISPLACED_ATOM <LOGICAL>", repeats=.false., &
733 default_l_val=.false., lone_keyword_l_val=.true.)
734 CALL section_add_keyword(section, keyword)
735 CALL keyword_release(keyword)
736
737 CALL keyword_create(keyword, __location__, name="displacement_tol", &
738 description="Lower limit to define displaced atoms", &
739 usage="DISPLACEMENT_TOL real", &
740 default_r_val=0._dp, n_var=1, unit_str='bohr')
741 CALL section_add_keyword(section, keyword)
742 CALL keyword_release(keyword)
743
744 END SUBROUTINE create_msd_section
745
746! **************************************************************************************************
747!> \brief ...
748!> \param section will contain the coeff section
749!> \author teo
750! **************************************************************************************************
751 SUBROUTINE create_msst_section(section)
752 TYPE(section_type), POINTER :: section
753
754 TYPE(keyword_type), POINTER :: keyword
755
756 cpassert(.NOT. ASSOCIATED(section))
757
758 CALL section_create(section, __location__, name="msst", &
759 description="Parameters for Multi-Scale Shock Technique (MSST) "// &
760 "which simulate the effect of a steady planar shock on a unit cell. "// &
761 "Reed et. al. Physical Review Letters 90, 235503 (2003).", &
762 n_keywords=1, n_subsections=0, repeats=.false.)
763
764 NULLIFY (keyword)
765 CALL keyword_create(keyword, __location__, name="PRESSURE", &
766 description="Initial pressure", &
767 usage="PRESSURE real", &
768 default_r_val=0._dp, n_var=1, unit_str='bar')
769 CALL section_add_keyword(section, keyword)
770 CALL keyword_release(keyword)
771
772 CALL keyword_create(keyword, __location__, name="ENERGY", &
773 description="Initial energy", &
774 usage="ENERGY real", &
775 default_r_val=0._dp, n_var=1, unit_str='hartree')
776 CALL section_add_keyword(section, keyword)
777 CALL keyword_release(keyword)
778
779 CALL keyword_create(keyword, __location__, name="VOLUME", &
780 description="Initial volume", &
781 usage="VOLUME real", &
782 default_r_val=0._dp, n_var=1, unit_str='angstrom^3')
783 CALL section_add_keyword(section, keyword)
784 CALL keyword_release(keyword)
785
786 CALL keyword_create(keyword, __location__, name="CMASS", &
787 description="Effective cell mass", &
788 usage="CMASS real", &
789 default_r_val=0._dp, n_var=1, unit_str='au_m')
790 CALL section_add_keyword(section, keyword)
791 CALL keyword_release(keyword)
792
793 CALL keyword_create(keyword, __location__, name="VSHOCK", variants=["V_SHOCK"], &
794 description="Velocity shock", &
795 usage="VSHOCK real", &
796 default_r_val=0._dp, n_var=1, unit_str='m/s')
797 CALL section_add_keyword(section, keyword)
798 CALL keyword_release(keyword)
799
800 CALL keyword_create(keyword, __location__, name="GAMMA", &
801 description="Damping coefficient for cell volume", &
802 usage="GAMMA real", &
803 unit_str='fs^-1', &
804 default_r_val=0.0_dp)
805 CALL section_add_keyword(section, keyword)
806 CALL keyword_release(keyword)
807
808 END SUBROUTINE create_msst_section
809
810! **************************************************************************************************
811!> \brief section will contain some parameters for the shells dynamics
812!> \param section ...
813! **************************************************************************************************
814 SUBROUTINE create_shell_section(section)
815 TYPE(section_type), POINTER :: section
816
817 TYPE(keyword_type), POINTER :: keyword
818 TYPE(section_type), POINTER :: thermo_section
819
820 cpassert(.NOT. ASSOCIATED(section))
821
822 CALL section_create(section, __location__, name="shell", &
823 description="Parameters of shell model in adiabatic dynamics.", &
824 n_keywords=4, n_subsections=1, repeats=.false.)
825
826 NULLIFY (keyword, thermo_section)
827
828 CALL keyword_create(keyword, __location__, name="temperature", &
829 description="Temperature in K used to control "// &
830 "the internal velocities of the core-shell motion ", &
831 usage="temperature 5.0", &
832 default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="K"), &
833 unit_str="K")
834 CALL section_add_keyword(section, keyword)
835 CALL keyword_release(keyword)
836
837 CALL keyword_create(keyword, __location__, name="temp_tol", &
838 description="Maximum accepted temperature deviation"// &
839 " from the expected value, for the internal core-shell motion."// &
840 " If 0, no rescaling is performed", &
841 usage="temp_tol 0.0", default_r_val=0.0_dp, unit_str='K')
842 CALL section_add_keyword(section, keyword)
843 CALL keyword_release(keyword)
844
845 CALL keyword_create(keyword, __location__, name="nose_particle", &
846 description="If nvt or npt, the core and shell velocities are controlled "// &
847 "by the same thermostat used for the particle. This might favour heat exchange "// &
848 "and additional rescaling of the internal core-shell velocity is needed (TEMP_TOL)", &
849 default_l_val=.false., lone_keyword_l_val=.true.)
850 CALL section_add_keyword(section, keyword)
851 CALL keyword_release(keyword)
852
853 CALL keyword_create(keyword, __location__, name="DISPLACEMENT_SHELL_TOL", &
854 description="This keyword sets a maximum variation of the shell"// &
855 " core distance in each Cartesian direction."// &
856 " The maximum internal core-shell velocity is evaluated and"// &
857 " if it is too large to remain"// &
858 " within the assigned limit, the time step is rescaled accordingly,"// &
859 " and the first half step of the velocity verlet is repeated.", &
860 usage="DISPLACEMENT_SHELL_TOL <REAL>", default_r_val=100.0_dp, &
861 unit_str='angstrom')
862 CALL section_add_keyword(section, keyword)
863 CALL keyword_release(keyword)
864
865 CALL create_thermostat_section(thermo_section)
866 CALL section_add_subsection(section, thermo_section)
867 CALL section_release(thermo_section)
868
869 END SUBROUTINE create_shell_section
870
871! **************************************************************************************************
872!> \brief section will contain some parameters for the adiabatic dynamics
873!> \param section ...
874! **************************************************************************************************
875 SUBROUTINE create_adiabatic_section(section)
876 TYPE(section_type), POINTER :: section
877
878 TYPE(keyword_type), POINTER :: keyword
879 TYPE(section_type), POINTER :: thermo_fast_section, thermo_slow_section
880
881 cpassert(.NOT. ASSOCIATED(section))
882
883 CALL section_create(section, __location__, name="ADIABATIC_DYNAMICS", &
884 description="Parameters used in canonical adiabatic free energy sampling (CAFES).", &
885 n_keywords=5, n_subsections=2, repeats=.false., &
886 citations=[vandevondele2002])
887
888 NULLIFY (keyword, thermo_fast_section, thermo_slow_section)
889
890 CALL keyword_create(keyword, __location__, name="temp_fast", &
891 description="Temperature in K used to control "// &
892 "the fast degrees of freedom ", &
893 usage="temp_fast 5.0", &
894 default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="K"), &
895 unit_str="K")
896 CALL section_add_keyword(section, keyword)
897 CALL keyword_release(keyword)
898
899 CALL keyword_create(keyword, __location__, name="temp_slow", &
900 description="Temperature in K used to control "// &
901 "the slow degrees of freedom ", &
902 usage="temp_slow 5.0", &
903 default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="K"), &
904 unit_str="K")
905 CALL section_add_keyword(section, keyword)
906 CALL keyword_release(keyword)
907
908 CALL keyword_create(keyword, __location__, name="temp_tol_fast", &
909 description="Maximum accepted temperature deviation"// &
910 " from the expected value, for the fast motion."// &
911 " If 0, no rescaling is performed", &
912 usage="temp_tol_fast 0.0", default_r_val=0.0_dp, unit_str='K')
913 CALL section_add_keyword(section, keyword)
914 CALL keyword_release(keyword)
915
916 CALL keyword_create(keyword, __location__, name="temp_tol_slow", &
917 description="Maximum accepted temperature deviation"// &
918 " from the expected value, for the slow motion."// &
919 " If 0, no rescaling is performed", &
920 usage="temp_tol_slow 0.0", default_r_val=0.0_dp, unit_str='K')
921 CALL section_add_keyword(section, keyword)
922 CALL keyword_release(keyword)
923
924 CALL keyword_create(keyword, __location__, name="n_resp_fast", &
925 description="number of respa steps for fast degrees of freedom", &
926 repeats=.false., default_i_val=1)
927 CALL section_add_keyword(section, keyword)
928 CALL keyword_release(keyword)
929
930 CALL create_thermo_fast_section(thermo_fast_section)
931 CALL section_add_subsection(section, thermo_fast_section)
932 CALL section_release(thermo_fast_section)
933
934 CALL create_thermo_slow_section(thermo_slow_section)
935 CALL section_add_subsection(section, thermo_slow_section)
936 CALL section_release(thermo_slow_section)
937
938 END SUBROUTINE create_adiabatic_section
939
940! **************************************************************************************************
941!> \brief section will contain parameters for the velocity softening
942!> \param section ...
943!> \author Ole Schuett
944! **************************************************************************************************
945 SUBROUTINE create_softening_section(section)
946 TYPE(section_type), POINTER :: section
947
948 TYPE(keyword_type), POINTER :: keyword
949
950 CALL section_create(section, __location__, name="VELOCITY_SOFTENING", &
951 description="A method to initialize the velocities along low-curvature " &
952 //"directions in order to favors MD trajectories to cross rapidly over " &
953 //"small energy barriers into neighboring basins. " &
954 //"In each iteration the forces are calculated at a point y, which " &
955 //"is slightly displaced from the current positions x in the direction " &
956 //"of the original velocities v. The velocities are then updated with " &
957 //"the force component F_t, which is perpendicular to N. " &
958 //"N = v / |v|; y = x + delta * N; F_t = F(y) - &lang; F(y) | N &rang; * N; " &
959 //"v' = v + alpha * F_t")
960
961 NULLIFY (keyword)
962 CALL keyword_create(keyword, __location__, name="STEPS", &
963 description="Number of softening iterations performed. " &
964 //"Typical values are around 40 steps.", &
965 default_i_val=0)
966 CALL section_add_keyword(section, keyword)
967 CALL keyword_release(keyword)
968
969 CALL keyword_create(keyword, __location__, name="DELTA", &
970 description="Displacement used to obtain y.", &
971 default_r_val=0.1_dp)
972 CALL section_add_keyword(section, keyword)
973 CALL keyword_release(keyword)
974
975 CALL keyword_create(keyword, __location__, name="ALPHA", &
976 description="Mixing factor used for updating velocities.", &
977 default_r_val=0.15_dp)
978 CALL section_add_keyword(section, keyword)
979 CALL keyword_release(keyword)
980
981 END SUBROUTINE create_softening_section
982
983! **************************************************************************************************
984!> \brief input section used to define regions with different temperature
985!> initialization and control
986!> \param section ...
987!> \par History
988!> - Added input for langevin regions in thermal regions section
989!> (2014/02/04, LT)
990! **************************************************************************************************
991 SUBROUTINE create_thermal_region_section(section)
992 TYPE(section_type), POINTER :: section
993
994 TYPE(keyword_type), POINTER :: keyword
995 TYPE(section_type), POINTER :: print_key, region_section, subsection, &
996 tfunc_section
997
998 cpassert(.NOT. ASSOCIATED(section))
999
1000 CALL section_create(section, __location__, name="THERMAL_REGION", &
1001 description="Define regions where different initialization and control "// &
1002 "of the temperature is used. When MOTION%MD%ENSEMBLE is set to LANGEVIN, "// &
1003 "this section controls if the atoms defined inside and outside the "// &
1004 "thermal regions should undergo Langevin MD or NVE Born-Oppenheimer MD. "// &
1005 "The theory behind Langevin MD using different regions can be found in "// &
1006 "articles by Kantorovitch et al. listed below.", &
1007 citations=[kantorovich2008, kantorovich2008a], &
1008 n_keywords=0, n_subsections=1, repeats=.false.)
1009
1010 NULLIFY (region_section)
1011 NULLIFY (keyword, subsection, tfunc_section)
1012
1013 CALL keyword_create(keyword, __location__, name="FORCE_RESCALING", &
1014 description="Control the rescaling ot the velocities in all the regions, "// &
1015 "according to the temperature assigned to each reagion, when "// &
1016 "RESTART_VELOCITY in EXT_RESTART is active.", &
1017 default_l_val=.false., lone_keyword_l_val=.true.)
1018 CALL section_add_keyword(section, keyword)
1019 CALL keyword_release(keyword)
1020
1021 CALL keyword_create(keyword, __location__, name="DO_LANGEVIN_DEFAULT", &
1022 description="If ENSEMBLE is set to LANGEVIN, controls whether the "// &
1023 "atoms NOT defined in the thermal regions to undergo langevin MD "// &
1024 "or not. If not, then the atoms will undergo NVE Born-Oppenheimer MD.", &
1025 usage="DO_LANGEVIN_DEFAULT .FALSE.", &
1026 default_l_val=.false., lone_keyword_l_val=.true.)
1027 CALL section_add_keyword(section, keyword)
1028 CALL keyword_release(keyword)
1029
1030 CALL section_create(region_section, __location__, name="DEFINE_REGION", &
1031 description="Define arbitrary thermal region with distinct "// &
1032 "temperature controls. For thermostat regions, see section "// &
1033 "MOTION%MD%THERMOSTAT%DEFINE_REGION; when the keyword "// &
1034 "MOTION%MD%THERMOSTAT%REGION is set to THERMAL, the "// &
1035 "definition of thermostat regions will be the same as "// &
1036 "that of thermal regions.", &
1037 n_keywords=3, n_subsections=1, repeats=.true.)
1038
1039 NULLIFY (keyword)
1040 CALL keyword_create(keyword, __location__, name="LIST", &
1041 description="Specifies a list of atoms belonging to the region.", &
1042 usage="LIST {integer} {integer} .. {integer}", &
1043 repeats=.true., n_var=-1, type_of_var=integer_t)
1044 CALL section_add_keyword(region_section, keyword)
1045 CALL keyword_release(keyword)
1046
1047 CALL keyword_create(keyword, __location__, name="MOLNAME", &
1048 variants=["SEGNAME"], &
1049 description="Specifies the name of the molecules belonging to the region.", &
1050 usage="MOLNAME WAT MEOH", repeats=.true., &
1051 n_var=-1, type_of_var=char_t)
1052 CALL section_add_keyword(region_section, keyword)
1053 CALL keyword_release(keyword)
1054
1055 CALL keyword_create(keyword, __location__, name="MM_SUBSYS", &
1056 variants=["PROTEIN"], &
1057 description="Not yet implemented: In a QM/MM run all "// &
1058 "MM atoms are specified as a whole region", &
1059 usage="MM_SUBSYS (NONE|ATOMIC|MOLECULAR)", &
1060 enum_c_vals=s2a("NONE", "ATOMIC", "MOLECULAR"), &
1062 enum_desc=s2a("Nothing in the region", &
1063 "Only the MM atoms itself", &
1064 "The full molecule/residue that contains a MM atom"), &
1065 default_i_val=do_constr_none, repeats=.false.)
1066 CALL section_add_keyword(region_section, keyword)
1067 CALL keyword_release(keyword)
1068
1069 CALL keyword_create(keyword, __location__, name="QM_SUBSYS", &
1070 description="Not yet implemented: In a QM/MM run all "// &
1071 "QM atoms are specified as a whole region", &
1072 usage="QM_SUBSYS (NONE|ATOMIC|MOLECULAR)", &
1073 enum_c_vals=s2a("NONE", "ATOMIC", "MOLECULAR"), &
1074 enum_desc=s2a("Nothing in the region", &
1075 "Only the QM atoms itself", &
1076 "The full molecule/residue that contains a QM atom"), &
1078 default_i_val=do_constr_none, repeats=.false.)
1079 CALL section_add_keyword(region_section, keyword)
1080 CALL keyword_release(keyword)
1081
1082 CALL keyword_create(keyword, __location__, name="TEMPERATURE", &
1083 description="The temperature in K used to initialize the velocities "// &
1084 "of the atoms in this region. It overrides the value evaluated by the "// &
1085 "function defined in TFUNC section.", &
1086 usage="TEMPERATURE 5.0", &
1087 default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="K"), &
1088 unit_str="K")
1089 CALL section_add_keyword(region_section, keyword)
1090 CALL keyword_release(keyword)
1091
1092 CALL keyword_create(keyword, __location__, name="TEMP_TOL", &
1093 description="Maximum accepted temperature deviation from the target "// &
1094 "value for this region, which is defined by TEMPERATURE or evaluated "// &
1095 "with the function defined in TFUNC section. Default value is 0 that "// &
1096 "turns off rescaling.", &
1097 usage="TEMP_TOL 0.0", &
1098 default_r_val=0.0_dp, unit_str='K')
1099 CALL section_add_keyword(region_section, keyword)
1100 CALL keyword_release(keyword)
1101
1102 CALL keyword_create(keyword, __location__, name="DO_LANGEVIN", &
1103 description="When ENSEMBLE is set to LANGEVIN, Controls whether "// &
1104 "the atoms in the thermal region should undergo Langevin MD. If "// &
1105 "not, then they will undergo NVE Born-Oppenheimer MD.", &
1106 usage="DO_LANGEVIN .TRUE.", &
1107 default_l_val=.true., lone_keyword_l_val=.true.)
1108 CALL section_add_keyword(region_section, keyword)
1109 CALL keyword_release(keyword)
1110
1111 CALL keyword_create(keyword, __location__, name="NOISY_GAMMA_REGION", &
1112 description="Special imaginary Langevin Friction term"// &
1113 " for Langevin Dynamics with noisy forces for the atoms in this region."// &
1114 " When set, overrides the general value set by NOISY_GAMMA in the MOTION%MD%LANGEVIN section."// &
1115 " When unset for a defined region, the general NOISY_GAMMA value applies.", &
1116 citations=[kuhne2007], usage="NOISY_GAMMA_REGION 4.0E-5", &
1117 type_of_var=real_t, &
1118 unit_str="fs^-1")
1119 CALL section_add_keyword(region_section, keyword)
1120 CALL keyword_release(keyword)
1121
1122 ! Define temperature function start
1123 CALL create_function_section(tfunc_section, section_name="TFUNC", func_name="FUNCTION", &
1124 description="This section specifies the target temperature by "// &
1125 "using the time step `S` and the temperature of the last step "// &
1126 "in Kelvin `T` in a functional form, thus allowing for a simple "// &
1127 "region-wise annealing (heating/cooling) controls in the absence "// &
1128 "of a thermostat. Specifically, if the absolute difference between "// &
1129 "target and actual temperature is larger than the TEMP_TOL value "// &
1130 "on each step, the atomic velocities will be rescaled to match "// &
1131 "the target temperature. However, note that a small restrictive "// &
1132 "TEMP_TOL together with a rapidly varying target temperature "// &
1133 "function and a large timestep leaves little time for the system to "// &
1134 "adjust itself, possibly leading to unphysical relaxation behaviors "// &
1135 "and structural artifacts."//newline//newline// &
1136 "When DEFINE_REGION%TEMPERATURE is not set for this region explicitly, "// &
1137 "the function will be evaluated at `S` set in MD%STEP_START_VAL and "// &
1138 "`T = 0.00` to obtain the initial temperature (assumed positive) for "// &
1139 "initialization of the atomic velocities in the region; if the result "// &
1140 "of function evaluation is not positive, the MD%TEMPERATURE will be "// &
1141 "used as a fallback."//newline//newline// &
1142 "The function is interpreted directly as in Kelvin, with no need to "// &
1143 "specify the UNITS keyword for the parameters. For instance, defining "// &
1144 "`FUNCTION (ABS(S/N+M)-ABS(S/N-M))/2`, `PARAMETERS N M` and "// &
1145 "`VALUES 50/3 300.0`, the target temperature will rise linearly and "// &
1146 "reach 300.0 K at step `S = 5000`.", &
1147 repeats=.false., input_variables=["S", "T"])
1148
1149 CALL section_add_subsection(region_section, tfunc_section)
1150 CALL section_release(tfunc_section)
1151 ! Define temperature function end
1152
1153 CALL section_add_subsection(section, region_section)
1154 CALL section_release(region_section)
1155
1156 NULLIFY (print_key)
1157 CALL section_create(subsection, __location__, name="PRINT", &
1158 description="Collects all print_keys for thermal_regions", &
1159 n_keywords=1, n_subsections=0, repeats=.false.)
1160
1161 CALL cp_print_key_section_create(print_key, __location__, "TEMPERATURE", &
1162 description="Controls the output of the temperature per "// &
1163 "region. The first three columns are: step number, time "// &
1164 "(in fs), and the temperature of atoms not in any temperature "// &
1165 "region (or zero if all atoms are in some temperature region). "// &
1166 "Subsequent columns are, in pairs, the target value "// &
1167 "(calculated by TFUNC or specified by TEMPERATURE) "// &
1168 "and the actual value of the temperature for each region.", &
1169 print_level=high_print_level, common_iter_levels=1, &
1170 filename="")
1171 CALL section_add_subsection(subsection, print_key)
1172 CALL section_release(print_key)
1173
1174 CALL cp_print_key_section_create(print_key, __location__, "LANGEVIN_REGIONS", &
1175 description="Controls output of information on which atoms "// &
1176 "underwent Langevin MD and which atoms did not.", &
1177 print_level=high_print_level, &
1178 filename="")
1179 CALL section_add_subsection(subsection, print_key)
1180 CALL section_release(print_key)
1181
1182 CALL section_add_subsection(section, subsection)
1183 CALL section_release(subsection)
1184
1185 END SUBROUTINE create_thermal_region_section
1186
1187! **************************************************************************************************
1188!> \brief Defines the parameters for the setup of a cascade simulation
1189!> \param section ...
1190!> \date 03.02.2012
1191!> \author Matthias Krack (MK)
1192!> \version 1.0
1193! **************************************************************************************************
1194 SUBROUTINE create_cascade_section(section)
1195
1196 TYPE(section_type), POINTER :: section
1197
1198 TYPE(keyword_type), POINTER :: keyword
1199 TYPE(section_type), POINTER :: subsection
1200
1201 NULLIFY (keyword)
1202 NULLIFY (subsection)
1203 cpassert(.NOT. ASSOCIATED(section))
1204
1205 CALL section_create(section, __location__, name="CASCADE", &
1206 description="Defines the parameters for the setup of a cascade simulation.", &
1207 n_keywords=1, &
1208 n_subsections=1, &
1209 repeats=.false.)
1210
1211 CALL keyword_create(keyword, __location__, &
1212 name="_SECTION_PARAMETERS_", &
1213 description="Controls the activation of the CASCADE section.", &
1214 usage="&CASCADE on", &
1215 default_l_val=.false., &
1216 lone_keyword_l_val=.true.)
1217 CALL section_add_keyword(section, keyword)
1218 CALL keyword_release(keyword)
1219
1220 CALL keyword_create(keyword, __location__, name="ENERGY", &
1221 description="Total energy transferred to the system during the cascade event.", &
1222 usage="ENERGY 20.0", &
1223 default_r_val=0.0_dp, &
1224 unit_str="keV")
1225 CALL section_add_keyword(section, keyword)
1226 CALL keyword_release(keyword)
1227
1228 CALL section_create(subsection, __location__, name="ATOM_LIST", &
1229 description="Defines a list of atoms for which the initial velocities are modified", &
1230 n_keywords=1, &
1231 n_subsections=0, &
1232 repeats=.false.)
1233
1234 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
1235 description="Defines the list of atoms for which the velocities are modified. "// &
1236 "Each record consists of the atomic index, the velocity vector, and "// &
1237 "a weight to define which fraction of the total energy is assigned "// &
1238 "to the current atom: `Atomic_index v_x v_y v_z Weight`", &
1239 usage="{{Integer} {Real} {Real} {Real} {Real}}", &
1240 repeats=.true., &
1241 type_of_var=lchar_t)
1242 CALL section_add_keyword(subsection, keyword)
1243 CALL keyword_release(keyword)
1244
1245 CALL section_add_subsection(section, subsection)
1246 CALL section_release(subsection)
1247
1248 END SUBROUTINE create_cascade_section
1249
1250! **************************************************************************************************
1251!> \brief Defines AVERAGES section
1252!> \param section ...
1253!> \author teo
1254! **************************************************************************************************
1255 SUBROUTINE create_avgs_section(section)
1256 TYPE(section_type), POINTER :: section
1257
1258 TYPE(keyword_type), POINTER :: keyword
1259 TYPE(section_type), POINTER :: print_key, subsection
1260
1261 cpassert(.NOT. ASSOCIATED(section))
1262 CALL section_create(section, __location__, name="Averages", &
1263 description="Controls the calculation of the averages during an MD run.", &
1264 n_keywords=1, n_subsections=1, repeats=.false.)
1265 NULLIFY (keyword, print_key, subsection)
1266
1267 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
1268 description="Controls the calculations of the averages.", &
1269 usage="&AVERAGES T", default_l_val=.true., lone_keyword_l_val=.true.)
1270 CALL section_add_keyword(section, keyword)
1271 CALL keyword_release(keyword)
1272
1273 CALL keyword_create(keyword, __location__, name="ACQUISITION_START_TIME", &
1274 description="Setup up the simulation time when the acquisition process to compute"// &
1275 " averages is started.", &
1276 usage="ACQUISITION_START_TIME <REAL>", &
1277 default_r_val=0.0_dp, unit_str='fs')
1278 CALL section_add_keyword(section, keyword)
1279 CALL keyword_release(keyword)
1280
1281 CALL keyword_create(keyword, __location__, name="AVERAGE_COLVAR", &
1282 description="Switch for computing the averages of COLVARs.", &
1283 usage="AVERAGE_COLVAR <LOGICAL>", default_l_val=.false., &
1284 lone_keyword_l_val=.true.)
1285 CALL section_add_keyword(section, keyword)
1286 CALL keyword_release(keyword)
1287
1288 CALL cp_print_key_section_create(print_key, __location__, "PRINT_AVERAGES", &
1289 description="Controls the output the averaged quantities", &
1290 print_level=debug_print_level + 1, common_iter_levels=1, &
1291 filename="")
1292 CALL section_add_subsection(section, print_key)
1293 CALL section_release(print_key)
1294
1295 CALL create_avgs_restart_section(subsection)
1296 CALL section_add_subsection(section, subsection)
1297 CALL section_release(subsection)
1298 END SUBROUTINE create_avgs_section
1299
1300! **************************************************************************************************
1301!> \brief Defines the ELECTRONS section: settings for the standalone electronic
1302!> potentiostat (constant-potential / Ne-electrode) driver.
1303!> \param section ...
1304! **************************************************************************************************
1305 SUBROUTINE create_electrons_section(section)
1306 TYPE(section_type), POINTER :: section
1307
1308 TYPE(keyword_type), POINTER :: keyword
1309
1310 cpassert(.NOT. ASSOCIATED(section))
1311 CALL section_create(section, __location__, name="ELECTRONS", &
1312 description="Settings for the electronic potentiostat driving a "// &
1313 "constant-potential / Ne-electrode MD run.", &
1314 citations=[zhang2026], &
1315 n_keywords=3, n_subsections=0, repeats=.false.)
1316
1317 NULLIFY (keyword)
1318
1319 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
1320 description="Controls the activation of the electronic potentiostat. "// &
1321 "There are three states, not two. Section ABSENT: nothing happens, no "// &
1322 ".cpcont file. Section present with T (or 1): full constant-potential "// &
1323 "dynamics -- q is propagated by the potentiostat, requires ENSEMBLE NVT "// &
1324 "or LANGEVIN. Section present with 0 (or F): REPORT-ONLY -- an ordinary "// &
1325 "MD run that additionally computes the Fermi level and work function "// &
1326 "every step and writes the .cpcont file, with q held at the system's "// &
1327 "electron count and TARGET_WORKFUNCTION reported as 0. Report-only needs "// &
1328 "only POTENTIAL_AVERAGE_AXIS and POTENTIAL_AVERAGE_REGION, works under "// &
1329 "any ensemble, and requires a plain FORCE_EVAL (not METHOD MIXED). Use "// &
1330 "it to measure the work function of a fixed-charge system -- for example "// &
1331 "to find the neutral work function before choosing TARGET_WORKFUNCTION "// &
1332 "and Q_INIT for a constant-potential run.", &
1333 usage="&ELECTRONS T", default_l_val=.false., lone_keyword_l_val=.true.)
1334 CALL section_add_keyword(section, keyword)
1335 CALL keyword_release(keyword)
1336
1337 CALL keyword_create(keyword, __location__, name="POTENTIAL_AVERAGE_AXIS", &
1338 description="Lattice axis along which the planar Hartree-potential "// &
1339 "average is computed for the work-function readback.", &
1340 usage="POTENTIAL_AVERAGE_AXIS Z", &
1341 default_i_val=3, &
1342 enum_c_vals=s2a("X", "Y", "Z"), &
1343 enum_desc=s2a("average along the x axis", &
1344 "average along the y axis", &
1345 "average along the z axis"), &
1346 enum_i_vals=[1, 2, 3])
1347 CALL section_add_keyword(section, keyword)
1348 CALL keyword_release(keyword)
1349
1350 CALL keyword_create(keyword, __location__, name="POTENTIAL_AVERAGE_REGION", &
1351 description="Minimum and maximum coordinate, along POTENTIAL_AVERAGE_AXIS, "// &
1352 "of the vacuum region over which the Hartree potential is averaged to "// &
1353 "obtain the work function.", &
1354 usage="POTENTIAL_AVERAGE_REGION 27.0 30.0", &
1355 type_of_var=real_t, n_var=2, unit_str="angstrom")
1356 CALL section_add_keyword(section, keyword)
1357 CALL keyword_release(keyword)
1358
1359 CALL keyword_create(keyword, __location__, name="NEUTRAL_ELECTRONS", &
1360 description="Reference (neutral-system) total electron count. Must match "// &
1361 "the actual DFT electron count of the simulated system -- there is no "// &
1362 "physically meaningful universal default. Plain number, not unit-converted.", &
1363 usage="NEUTRAL_ELECTRONS 1329.0", &
1364 default_r_val=1329.0_dp)
1365 CALL section_add_keyword(section, keyword)
1366 CALL keyword_release(keyword)
1367
1368 CALL keyword_create(keyword, __location__, name="Q_INIT", &
1369 description="Initial value of the potentiostat's electron-count variable q. "// &
1370 "Normally equal to NEUTRAL_ELECTRONS for a neutral start. Plain number, not "// &
1371 "unit-converted.", &
1372 usage="Q_INIT 1329.0", &
1373 default_r_val=1329.0_dp)
1374 CALL section_add_keyword(section, keyword)
1375 CALL keyword_release(keyword)
1376
1377 CALL keyword_create(keyword, __location__, name="TARGET_WORKFUNCTION", &
1378 description="Target work function the potentiostat drives toward. "// &
1379 "Accepts CP2K's usual [unit] qualifier, e.g. "// &
1380 "TARGET_WORKFUNCTION [eV] 4.81 or [hartree] 0.1768; a bare number is "// &
1381 "read as eV, so existing input decks are unaffected. The value is "// &
1382 "stored in atomic units and converted back to eV in md_run.F, because "// &
1383 "the potentiostat works in eV throughout.", &
1384 usage="TARGET_WORKFUNCTION [eV] 4.81", &
1385 default_r_val=cp_unit_to_cp2k(value=5.0_dp, unit_str="eV"), &
1386 unit_str="eV")
1387 CALL section_add_keyword(section, keyword)
1388 CALL keyword_release(keyword)
1389
1390 CALL keyword_create(keyword, __location__, name="MASS", &
1391 description="Fictitious mass of the electron-count degree of freedom, in "// &
1392 "atomic units. Plain number, not unit-converted.", &
1393 usage="MASS 400.0", &
1394 default_r_val=400.0_dp)
1395 CALL section_add_keyword(section, keyword)
1396 CALL keyword_release(keyword)
1397
1398 CALL keyword_create(keyword, __location__, name="TAU_POTENTIOSTAT", &
1399 description="Langevin relaxation time of the electronic potentiostat, in "// &
1400 "femtoseconds. Plain number, not unit-converted.", &
1401 usage="TAU_POTENTIOSTAT 200.0", &
1402 default_r_val=200.0_dp)
1403 CALL section_add_keyword(section, keyword)
1404 CALL keyword_release(keyword)
1405
1406 CALL keyword_create(keyword, __location__, name="TEMP_POTENTIOSTAT", &
1407 description="Target temperature of the electronic potentiostat Langevin "// &
1408 "thermostat, in kelvin. Plain number, not unit-converted. Set to 0.0 to "// &
1409 "disable stochastic noise (deterministic/damped dynamics only).", &
1410 usage="TEMP_POTENTIOSTAT 300.0", &
1411 default_r_val=300.0_dp)
1412 CALL section_add_keyword(section, keyword)
1413 CALL keyword_release(keyword)
1414
1415 CALL keyword_create(keyword, __location__, name="CHARGE_MIXING_INPLACE", &
1416 description="At a boundary crossing, mutate the stale endpoint's "// &
1417 "electron count IN PLACE instead of tearing it down and re-running "// &
1418 "qs_init. Only the electron count of the existing endpoint is changed. "// &
1419 "The converged wavefunction, "// &
1420 "the dispersion neighbour lists, pw_env and the atomic distributions "// &
1421 "all survive, so a crossing no longer cold-starts an SCF. Strongly "// &
1422 "recommended; FALSE only to fall back to the original rebuild path for "// &
1423 "comparison.", &
1424 usage="CHARGE_MIXING_INPLACE T", &
1425 default_l_val=.false., lone_keyword_l_val=.true.)
1426 CALL section_add_keyword(section, keyword)
1427 CALL keyword_release(keyword)
1428
1429 CALL keyword_create(keyword, __location__, name="LAMBDA", &
1430 description="Freeze the mixing weight at this value instead of deriving "// &
1431 "it from q. When given: q(t) is NOT propagated, the potentiostat is "// &
1432 "inactive, and the endpoints are never rebuilt -- the run becomes "// &
1433 "ordinary MD on the fixed combination (1-LAMBDA)*E(N_lo) + LAMBDA*E(N_hi) "// &
1434 "of the two integer-charge FORCE_EVALs, with N_lo/N_hi exactly as the "// &
1435 "input CHARGE keywords built them. Intended as a control experiment: it "// &
1436 "separates the charge mixing from the constant-potential dynamics. "// &
1437 "A run with LAMBDA set contains no constant-potential physics at all.", &
1438 usage="LAMBDA 0.5", &
1439 type_of_var=real_t, default_r_val=huge(0.0_dp))
1440 CALL section_add_keyword(section, keyword)
1441 CALL keyword_release(keyword)
1442
1443 CALL keyword_create(keyword, __location__, name="TARGET_FERMI_LEVEL", &
1444 description="Target Fermi level in eV. Setting this switches the "// &
1445 "potentiostat from work-function control to FERMI-LEVEL control: the "// &
1446 "generalized force becomes (TARGET_FERMI_LEVEL - current Fermi level) "// &
1447 "instead of (current work function - TARGET_WORKFUNCTION), and the "// &
1448 "grand-canonical potential becomes E - e_F_target*(q - N_neutral). "// &
1449 "TAKES PRECEDENCE over TARGET_WORKFUNCTION when both are present, so "// &
1450 "a restart file written in work-function mode can be switched to Fermi "// &
1451 "control by adding this one keyword. The two modes are NOT "// &
1452 "interchangeable: they differ by the vacuum level, whose derivative "// &
1453 "with respect to q is not zero for a charged slab, so holding one "// &
1454 "constant does not hold the other constant. "// &
1455 "Unset by default (sentinel HUGE). "// &
1456 "REFERENCE: this is an ABSOLUTE Kohn-Sham eigenvalue on CP2K's "// &
1457 "internal energy scale, NOT a shift relative to the neutral cell. "// &
1458 "In a periodic cell the G=0 Hartree term is set to zero, so that "// &
1459 "scale is referenced to the CELL-AVERAGE electrostatic potential: "// &
1460 "not to vacuum, and not to the Fermi level of the neutral system. "// &
1461 "To target a potential a known amount away from the neutral cell, "// &
1462 "first run the neutral cell once, read its Fermi level e_F(N0) from "// &
1463 "the output, and set TARGET_FERMI_LEVEL = e_F(N0) + your shift.", &
1464 usage="TARGET_FERMI_LEVEL -0.5", &
1465 type_of_var=real_t, default_r_val=huge(0.0_dp))
1466 CALL section_add_keyword(section, keyword)
1467 CALL keyword_release(keyword)
1468
1469 CALL keyword_create(keyword, __location__, name="CHARGE_MIXING", &
1470 description="Use dual integer-endpoint charge mixing (CP2K METHOD MIXED "// &
1471 "LINEAR_COMBINATION over two integer-charge FORCE_EVAL sections) instead "// &
1472 "of the Ne-electrode core correction. Q_INIT is the initial mixing "// &
1473 "coordinate q. NEUTRAL_ELECTRONS is REQUIRED here, contrary to what an "// &
1474 "earlier version of this text said: it sets the CHARGE of every rebuilt "// &
1475 "endpoint via NINT(neutral_electrons) - N, and defines the reference "// &
1476 "point of the grand-canonical potential.", &
1477 usage="CHARGE_MIXING T", default_l_val=.false., lone_keyword_l_val=.true.)
1478 CALL section_add_keyword(section, keyword)
1479 CALL keyword_release(keyword)
1480
1481 CALL keyword_create(keyword, __location__, name="CHARGE_MIXING_SPAN", &
1482 description="Integer span S between the two mixed FORCE_EVAL endpoints: "// &
1483 "N_lo=S*floor(q/S), N_hi=N_lo+S. Only used when CHARGE_MIXING is TRUE. "// &
1484 "S=2 keeps the endpoint parity fixed, which UKS with an explicit "// &
1485 "MULTIPLICITY requires. With CHARGE_MIXING_INPLACE, ADDED_MOS must "// &
1486 "cover every endpoint the run reaches (each crossing moves one by S).", &
1487 usage="CHARGE_MIXING_SPAN 1", type_of_var=integer_t, default_i_val=1)
1488 CALL section_add_keyword(section, keyword)
1489 CALL keyword_release(keyword)
1490
1491 ! ------------------------------------------------------------------
1492 ! Restartable runtime state of the electronic extended variable.
1493 ! These are rewritten into the input tree every step by md_run.F, so
1494 ! CP2K's ordinary restart dump carries them and a continued run picks
1495 ! up the electronic dynamics exactly where it left off. Without them
1496 ! a restart silently resets q to its original Q_INIT with p = 0 in the
1497 ! middle of a trajectory. Q_INIT above doubles as the restart slot for
1498 ! q, exactly as CP2K reuses the input coordinates for the positions.
1499 ! ------------------------------------------------------------------
1500
1501 CALL keyword_create(keyword, __location__, name="P_INIT", &
1502 description="Initial (or restarted) momentum conjugate to the electronic "// &
1503 "coordinate q, in atomic units. Normally left at zero for a fresh run and "// &
1504 "written automatically into restart files.", &
1505 usage="P_INIT 0.0", default_r_val=0.0_dp)
1506 CALL section_add_keyword(section, keyword)
1507 CALL keyword_release(keyword)
1508
1509 CALL keyword_create(keyword, __location__, name="POTENTIOSTAT_ENERGY", &
1510 description="Accumulated heat exchanged with the electronic potentiostat, "// &
1511 "in atomic units, for conserved-quantity bookkeeping across restarts. "// &
1512 "Written automatically into restart files.", &
1513 usage="POTENTIOSTAT_ENERGY 0.0", default_r_val=0.0_dp)
1514 CALL section_add_keyword(section, keyword)
1515 CALL keyword_release(keyword)
1516
1517 CALL keyword_create(keyword, __location__, name="CURRENT_FERMI_LEVEL", &
1518 description="Last Fermi level in eV. Restart bookkeeping only: it is "// &
1519 "recomputed from the density at the first force evaluation, and exists so "// &
1520 "that the .cpcont column is meaningful on the restart step itself.", &
1521 usage="CURRENT_FERMI_LEVEL 0.0", default_r_val=0.0_dp)
1522 CALL section_add_keyword(section, keyword)
1523 CALL keyword_release(keyword)
1524
1525 CALL keyword_create(keyword, __location__, name="CURRENT_WORKFUNCTION", &
1526 description="Last work function in eV. Restart bookkeeping only, as for "// &
1527 "CURRENT_FERMI_LEVEL: md_run.F recomputes it at the initial force "// &
1528 "evaluation before the first electronic kick.", &
1529 usage="CURRENT_WORKFUNCTION 0.0", default_r_val=0.0_dp)
1530 CALL section_add_keyword(section, keyword)
1531 CALL keyword_release(keyword)
1532
1533 END SUBROUTINE create_electrons_section
1534
1535! **************************************************************************************************
1536!> \brief Defines the AVERAGES RESTART section
1537!> \param section ...
1538!> \author teo
1539! **************************************************************************************************
1540 SUBROUTINE create_avgs_restart_section(section)
1541 TYPE(section_type), POINTER :: section
1542
1543 TYPE(keyword_type), POINTER :: keyword
1544
1545 cpassert(.NOT. ASSOCIATED(section))
1546 CALL section_create(section, __location__, name="RESTART_AVERAGES", &
1547 description="Stores information for restarting averages.", &
1548 n_keywords=1, n_subsections=1, repeats=.false.)
1549 NULLIFY (keyword)
1550
1551 CALL keyword_create(keyword, __location__, name="ITIMES_START", &
1552 description="TIME STEP starting the evaluation of averages", &
1553 usage="ITIMES_START <INTEGER>", type_of_var=integer_t, n_var=1)
1554 CALL section_add_keyword(section, keyword)
1555 CALL keyword_release(keyword)
1556
1557 CALL keyword_create(keyword, __location__, name="AVECPU", &
1558 description="CPU average", usage="AVECPU <REAL>", &
1559 type_of_var=real_t, n_var=1)
1560 CALL section_add_keyword(section, keyword)
1561 CALL keyword_release(keyword)
1562
1563 CALL keyword_create(keyword, __location__, name="AVEHUGONIOT", &
1564 description="HUGONIOT average", usage="AVEHUGONIOT <REAL>", &
1565 type_of_var=real_t, n_var=1)
1566 CALL section_add_keyword(section, keyword)
1567 CALL keyword_release(keyword)
1568
1569 CALL keyword_create(keyword, __location__, name="AVETEMP_BARO", &
1570 description="BAROSTAT TEMPERATURE average", usage="AVETEMP_BARO <REAL>", &
1571 type_of_var=real_t, n_var=1)
1572 CALL section_add_keyword(section, keyword)
1573 CALL keyword_release(keyword)
1574
1575 CALL keyword_create(keyword, __location__, name="AVEPOT", &
1576 description="POTENTIAL ENERGY average", usage="AVEPOT <REAL>", &
1577 type_of_var=real_t, n_var=1)
1578 CALL section_add_keyword(section, keyword)
1579 CALL keyword_release(keyword)
1580
1581 CALL keyword_create(keyword, __location__, name="AVEKIN", &
1582 description="KINETIC ENERGY average", usage="AVEKIN <REAL>", &
1583 type_of_var=real_t, n_var=1)
1584 CALL section_add_keyword(section, keyword)
1585 CALL keyword_release(keyword)
1586
1587 CALL keyword_create(keyword, __location__, name="AVETEMP", &
1588 description="TEMPERATURE average", usage="AVETEMP <REAL>", &
1589 type_of_var=real_t, n_var=1)
1590 CALL section_add_keyword(section, keyword)
1591 CALL keyword_release(keyword)
1592
1593 CALL keyword_create(keyword, __location__, name="AVEKIN_QM", &
1594 description="QM KINETIC ENERGY average in QMMM runs", usage="AVEKIN_QM <REAL>", &
1595 type_of_var=real_t, n_var=1)
1596 CALL section_add_keyword(section, keyword)
1597 CALL keyword_release(keyword)
1598
1599 CALL keyword_create(keyword, __location__, name="AVETEMP_QM", &
1600 description="QM TEMPERATURE average in QMMM runs", usage="AVETEMP_QM <REAL>", &
1601 type_of_var=real_t, n_var=1)
1602 CALL section_add_keyword(section, keyword)
1603 CALL keyword_release(keyword)
1604
1605 CALL keyword_create(keyword, __location__, name="AVEVOL", &
1606 description="VOLUME average", usage="AVEVOL <REAL>", &
1607 type_of_var=real_t, n_var=1)
1608 CALL section_add_keyword(section, keyword)
1609 CALL keyword_release(keyword)
1610
1611 CALL keyword_create(keyword, __location__, name="AVECELL_A", &
1612 description="CELL VECTOR A average", usage="AVECELL_A <REAL>", &
1613 type_of_var=real_t, n_var=1)
1614 CALL section_add_keyword(section, keyword)
1615 CALL keyword_release(keyword)
1616
1617 CALL keyword_create(keyword, __location__, name="AVECELL_B", &
1618 description="CELL VECTOR B average", usage="AVECELL_B <REAL>", &
1619 type_of_var=real_t, n_var=1)
1620 CALL section_add_keyword(section, keyword)
1621 CALL keyword_release(keyword)
1622
1623 CALL keyword_create(keyword, __location__, name="AVECELL_C", &
1624 description="CELL VECTOR C average", usage="AVECELL_C <REAL>", &
1625 type_of_var=real_t, n_var=1)
1626 CALL section_add_keyword(section, keyword)
1627 CALL keyword_release(keyword)
1628
1629 CALL keyword_create(keyword, __location__, name="AVEALPHA", &
1630 description="ALPHA cell angle average", usage="AVEALPHA <REAL>", &
1631 type_of_var=real_t, n_var=1)
1632 CALL section_add_keyword(section, keyword)
1633 CALL keyword_release(keyword)
1634
1635 CALL keyword_create(keyword, __location__, name="AVEBETA", &
1636 description="BETA cell angle average", usage="AVEBETA <REAL>", &
1637 type_of_var=real_t, n_var=1)
1638 CALL section_add_keyword(section, keyword)
1639 CALL keyword_release(keyword)
1640
1641 CALL keyword_create(keyword, __location__, name="AVEGAMMA", &
1642 description="GAMMA cell angle average", usage="AVEGAMMA <REAL>", &
1643 type_of_var=real_t, n_var=1)
1644 CALL section_add_keyword(section, keyword)
1645 CALL keyword_release(keyword)
1646
1647 CALL keyword_create(keyword, __location__, name="AVE_ECONS", &
1648 description="CONSTANT ENERGY average", usage="AVE_ECONS <REAL>", &
1649 type_of_var=real_t, n_var=1)
1650 CALL section_add_keyword(section, keyword)
1651 CALL keyword_release(keyword)
1652
1653 CALL keyword_create(keyword, __location__, name="AVE_PRESS", &
1654 description="PRESSURE average", usage="AVE_PRESS <REAL>", &
1655 type_of_var=real_t, n_var=1)
1656 CALL section_add_keyword(section, keyword)
1657 CALL keyword_release(keyword)
1658
1659 CALL keyword_create(keyword, __location__, name="AVE_PXX", &
1660 description="P_{XX} average", usage="AVE_PXX <REAL>", &
1661 type_of_var=real_t, n_var=1)
1662 CALL section_add_keyword(section, keyword)
1663 CALL keyword_release(keyword)
1664
1665 CALL keyword_create(keyword, __location__, name="AVE_PV_VIR", &
1666 description="PV VIRIAL average", usage="AVE_PV_VIR <REAL> .. <REAL>", &
1667 type_of_var=real_t, n_var=9)
1668 CALL section_add_keyword(section, keyword)
1669 CALL keyword_release(keyword)
1670
1671 CALL keyword_create(keyword, __location__, name="AVE_PV_TOT", &
1672 description="PV TOTAL average", usage="AVE_PV_TOT <REAL> .. <REAL>", &
1673 type_of_var=real_t, n_var=9)
1674 CALL section_add_keyword(section, keyword)
1675 CALL keyword_release(keyword)
1676
1677 CALL keyword_create(keyword, __location__, name="AVE_PV_KIN", &
1678 description="PV KINETIC average", usage="AVE_PV_KIN <REAL> .. <REAL>", &
1679 type_of_var=real_t, n_var=9)
1680 CALL section_add_keyword(section, keyword)
1681 CALL keyword_release(keyword)
1682
1683 CALL keyword_create(keyword, __location__, name="AVE_PV_CNSTR", &
1684 description="PV CONSTRAINTS average", usage="AVE_PV_CNSTR <REAL> .. <REAL>", &
1685 type_of_var=real_t, n_var=9)
1686 CALL section_add_keyword(section, keyword)
1687 CALL keyword_release(keyword)
1688
1689 CALL keyword_create(keyword, __location__, name="AVE_PV_XC", &
1690 description="PV XC average", usage="AVE_PV_XC <REAL> .. <REAL>", &
1691 type_of_var=real_t, n_var=9)
1692 CALL section_add_keyword(section, keyword)
1693 CALL keyword_release(keyword)
1694
1695 CALL keyword_create(keyword, __location__, name="AVE_PV_FOCK_4C", &
1696 description="PV XC average", usage="AVE_PV_FOCK_4C <REAL> .. <REAL>", &
1697 type_of_var=real_t, n_var=9)
1698 CALL section_add_keyword(section, keyword)
1699 CALL keyword_release(keyword)
1700
1701 CALL keyword_create(keyword, __location__, name="AVE_COLVARS", &
1702 description="COLVARS averages", usage="AVE_COLVARS <REAL> .. <REAL>", &
1703 type_of_var=real_t, n_var=-1)
1704 CALL section_add_keyword(section, keyword)
1705 CALL keyword_release(keyword)
1706
1707 CALL keyword_create(keyword, __location__, name="AVE_MMATRIX", &
1708 description="METRIC TENSOR averages", usage="AVE_MMATRIX <REAL> .. <REAL>", &
1709 type_of_var=real_t, n_var=-1)
1710 CALL section_add_keyword(section, keyword)
1711 CALL keyword_release(keyword)
1712 END SUBROUTINE create_avgs_restart_section
1713
1714! **************************************************************************************************
1715!> \brief Defines the INITIAL_VIBRATION section
1716!> \param section ...
1717!> \author Lianheng Tong
1718! **************************************************************************************************
1719 SUBROUTINE create_vib_init_section(section)
1720 TYPE(section_type), POINTER :: section
1721
1722 TYPE(keyword_type), POINTER :: keyword
1723
1724 cpassert(.NOT. ASSOCIATED(section))
1725 CALL section_create(section, __location__, name="INITIAL_VIBRATION", &
1726 description="Controls the set of parameters for MD initialisation "// &
1727 "based on vibration analysis data. The starting atomic coordinates "// &
1728 "should be based on the relaxed positions obtained from a previous "// &
1729 "geometry/cell optimisation calculation, and the vibrational "// &
1730 "frequencies and displacements data should be obtained from a "// &
1731 "vibrational analysis calculation done based on the relaxed "// &
1732 "coordinates. The MD initialisation process expects the user has "// &
1733 "performed both geometry optimisation and vibrational analysis "// &
1734 "before hand, and won't perform those calculations automatically ", &
1735 citations=[west2006], &
1736 n_keywords=0, n_subsections=1, repeats=.false.)
1737 NULLIFY (keyword)
1738 CALL keyword_create(keyword, __location__, name="VIB_EIGS_FILE_NAME", &
1739 description="The file name of vibrational frequency (eigenvalue) "// &
1740 "and displacement (eigenvector) data calculated from the a "// &
1741 "vibrational analysis calculation done previously. This file must "// &
1742 "be the same unformatted binary file as referred to by "// &
1743 "VIBRATIONAL_ANALYSIS%PRINT%CARTESIAN_EIGS keyword. If this keyword "// &
1744 "is not explicitly defined by the user, then the default file "// &
1745 "name of: <project_name>-<CARTESIAN_EIGS_FILENAME>.eig will be used", &
1746 usage="VIB_EIGS_FILE_NAME <FILENAME>", &
1747 type_of_var=lchar_t)
1748 CALL section_add_keyword(section, keyword)
1749 CALL keyword_release(keyword)
1750 NULLIFY (keyword)
1751 CALL keyword_create(keyword, __location__, name="PHASE", &
1752 description="Controls the initial ratio of potential and kinetic "// &
1753 "contribution to the total energy. Denote the input value as $p$; "// &
1754 "the contribution is determined by $\cos^2(2\pi p)$ for potential "// &
1755 "energy and $\sin^2(2\pi p)$ for kinetic energy. A negative $p$ "// &
1756 "means that for each vibration mode the phase is determined randomly. "// &
1757 "A value of $0.0 \lt p \lt 1.0$ will be the same for all vibration "// &
1758 "modes; a value of $p \gt 1.0$ will just be treated as 1.0. "// &
1759 "For example, setting $p = 0.25$ would set all modes to "// &
1760 "begin with entirely kinetic energy --- in other words, the initial "// &
1761 "atomic positions will remain at their optimised location", &
1762 default_r_val=-1.0_dp, &
1763 usage="PHASE <REAL>")
1764 CALL section_add_keyword(section, keyword)
1765 CALL keyword_release(keyword)
1766 END SUBROUTINE create_vib_init_section
1767
1768END MODULE input_cp2k_md
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public rengaraj2020
integer, save, public vandevondele2002
integer, save, public west2006
integer, save, public tuckerman1992
integer, save, public kuhne2007
integer, save, public ricci2003
integer, save, public guidon2008
integer, save, public kantorovich2008
integer, save, public zhang2026
integer, save, public minary2003
integer, save, public kantorovich2008a
integer, save, public evans1983
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
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, do_backup)
creates a print_key section
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
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:1282
Creates and parses an input section to define a generic function.
subroutine, public create_function_section(gen_section, section_name, func_name, description, repeats, do_deriv, input_variables)
Create the input section for a generic function.
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_constr_atomic
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 do_constr_molec
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 do_constr_none
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)
...
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, deprecation_notice)
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 char_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
integer, parameter, public reftraj_wrap_central
integer, parameter, public reftraj_wrap_positive
integer, parameter, public reftraj_eval_energy
integer, parameter, public reftraj_wrap_none
integer, parameter, public reftraj_eval_energy_forces
integer, parameter, public reftraj_eval_none
Utilities for string manipulations.
character(len=1), parameter, public newline
represent a keyword in the input
represent a section of the input file