57#include "../base/base_uses.f90"
62 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
63 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_md'
80 cpassert(.NOT.
ASSOCIATED(section))
82 description=
"This section defines the whole set of parameters needed perform an MD run.", &
83 n_keywords=13, n_subsections=6, repeats=.false.)
85 NULLIFY (keyword, subsection)
87 description=
"The ensemble/integrator that you want to use for MD propagation", &
88 usage=
"ensemble nve", &
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"), &
116 description=
"The number of MD steps to perform, counting from step_start_val. ", &
117 usage=
"STEPS 100", default_i_val=3)
122 description=
"The number of MD steps to perform, counting from step 1", &
123 usage=
"MAX_STEPS 100", default_i_val=1000000000)
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"), &
134 CALL keyword_create(keyword, __location__, name=
"STEP_START_VAL", &
135 description=
"The starting step value for the MD", usage=
"STEP_START_VAL <integer>", &
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"), &
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, &
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"), &
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')
174 description=
"Compute the temperature per each kind separately", &
175 usage=
"TEMP_KIND LOGICAL", &
176 default_l_val=.false., lone_keyword_l_val=.true.)
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.)
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")
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")
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.)
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)
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)
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)
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, &
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", &
260 enum_c_vals=
s2a(
"DEFAULT",
"VIBRATIONAL"), &
261 enum_desc=
s2a(
"Assign random velocities and then scale according to "// &
263 "Initialise positions and velocities to give canonical ensemble "// &
264 "with TEMPERATURE, using the method described in PRL 96, 115504 (2006)"), &
269 CALL create_langevin_section(subsection)
273 CALL create_msst_section(subsection)
285 CALL create_respa_section(subsection)
289 CALL create_shell_section(subsection)
293 CALL create_adiabatic_section(subsection)
297 CALL create_softening_section(subsection)
301 CALL create_reftraj_section(subsection)
305 CALL create_avgs_section(subsection)
309 CALL create_thermal_region_section(subsection)
313 CALL create_md_print_section(subsection)
317 CALL create_cascade_section(subsection)
321 CALL create_vib_init_section(subsection)
332 SUBROUTINE create_langevin_section(section)
337 cpassert(.NOT.
ASSOCIATED(section))
339 description=
"Controls the set of parameters to run a Langevin MD. "// &
340 "The integrator used follows that given in the article by Ricci et al. "// &
341 "The user can define regions in the system where the atoms inside "// &
342 "undergoes Langevin MD, while those outside the regions undergoes "// &
343 "NVE Born Oppenheimer MD. To define the regions, the user should "// &
344 "use THERMAL_REGION subsection of MOTION%MD. ", &
346 n_keywords=0, n_subsections=1, repeats=.false.)
350 description=
"Gamma parameter for the Langevin dynamics (LD)", &
351 usage=
"gamma 0.001", &
352 default_r_val=0.0_dp, unit_str=
'fs^-1')
357 variants=[
"NoisyGamma"], &
358 description=
"Imaginary Langevin Friction term for LD with noisy forces.", &
360 usage=
"Noisy_Gamma 4.0E-5", default_r_val=0.0_dp, unit_str=
'fs^-1')
365 variants=[
"ShadowGamma"], &
366 description=
"Shadow Langevin Friction term for LD with noisy forces in order to adjust Noisy_Gamma.", &
368 usage=
"Shadow_Gamma 0.001", default_r_val=0.0_dp, unit_str=
'fs^-1')
371 END SUBROUTINE create_langevin_section
378 SUBROUTINE create_md_print_section(section)
384 cpassert(.NOT.
ASSOCIATED(section))
386 description=
"Controls the printing properties during an MD run", &
387 n_keywords=0, n_subsections=1, repeats=.false.)
388 NULLIFY (print_key, keyword)
391 description=
"Print the output and restart file if walltime is reached or "// &
392 "if an external EXIT command is given. It still requires the keyword LAST "// &
393 "to be present for the specific print key (in case the last step should not "// &
394 "match with the print_key iteration number).", &
395 usage=
"FORCE_LAST LOGICAL", &
396 default_l_val=.false., lone_keyword_l_val=.true.)
401 description=
"Controls the output the ener file", &
408 description=
"Controls the output of the shell-energy file (only if shell-model)", &
415 description=
"Controls the output of the temperature"// &
416 " computed separately for each kind", &
423 description=
"Controls the output of the temperature of the"// &
424 " shell-core motion computed separately for each kind", &
431 description=
"Controls the printing of COM velocity during an MD", &
433 filename=
"__STD_OUT__")
438 description=
"Controls the printing of coefficients during an MD run.", &
445 description=
"Controls the printing basic info during the calculation of the "// &
446 "translational/rotational degrees of freedom.", print_level=
low_print_level, &
449 description=
"Prints atomic coordinates in the standard orientation. "// &
450 "Coordinates are not affected during the calculation.", &
451 default_l_val=.false., lone_keyword_l_val=.true.)
458 description=
"Controls the printing of basic and summary information during the"// &
459 " Molecular Dynamics", &
463 END SUBROUTINE create_md_print_section
470 SUBROUTINE create_respa_section(section)
475 cpassert(.NOT.
ASSOCIATED(section))
478 description=
"Multiple timestep integration based on RESPA (implemented for NVE only)."// &
479 " RESPA exploits multiple force_eval."// &
480 " In this case the order of the force_eval maps"// &
481 " the order of the respa shells from the slowest to the fastest force evaluation."// &
482 " If force_evals share the same subsys, it's enough then to specify the"// &
483 " subsys in the force_eval corresponding at the first index in the multiple_force_eval list."// &
484 " Can be used to speedup classical and ab initio MD simulations.", &
485 n_keywords=1, n_subsections=0, repeats=.false., &
490 description=
"The number of reference MD steps between two RESPA corrections.", &
491 usage=
"FREQUENCY <INTEGER>", default_i_val=5)
495 END SUBROUTINE create_respa_section
502 SUBROUTINE create_reftraj_section(section)
508 cpassert(.NOT.
ASSOCIATED(section))
511 description=
"Loads an external trajectory file and performs analysis on "// &
512 "the loaded snapshots; optionally, calculates per-frame potential energy, "// &
513 "forces and other properties as requested by the keyword `EVAL` below with "// &
514 "the force method specified in the `&FORCE_EVAL` section. Time integration "// &
515 "is not performed here, and quantities of velocity, temperature and kinetic "// &
516 "energy from nuclear motion are therefore irrelevant. Such a REFTRAJ run is "// &
517 "essentially a series of single-point calculations; the snapshots are not "// &
518 "necessarily from MD and may be from custom concatenation."//
newline//
newline// &
519 "The trajectory should be a multi-frame XYZ file where each frame has the "// &
520 "same number of atoms and kind specification as the `&FORCE_EVAL/&SUBSYS` "// &
521 "down to the exact ordering, but cell (box) size and shape can be different. "// &
522 "The comment line of each frame is parsed for additional information such "// &
523 "as cell, step, time and energy; currently the parser supports the same "// &
524 "formats as the XYZ option of `&FORCE_EVAL/&SUBSYS/&CELL/CELL_FILE_FORMAT`, "// &
525 "corresponding to trajectory files printed from `&MOTION/&PRINT/&TRAJECTORY` "// &
526 "as XYZ and EXTXYZ and from the external `dumpdcd` tool."//
newline//
newline// &
527 "A minimal working example trajectory in the extended XYZ format should have "// &
528 '`Lattice="<Ax> <Ay> <Az> <Bx> <By> <Bz> <Cx> <Cy> <Cz>"` for the components '// &
529 "of cell vectors A, B, C, and `Step=<integer>` for the integer timestep. "// &
530 "`Time=<real>` and `Energy=<real>` for simulation time and potential energy "// &
531 "respectively are also parsed; if omitted, the default value will be 0.0 . "// &
532 "Note that the parser is case insensitive, but whitespaces are only used "// &
533 "between key-value pairs as delimiters and not around the = signs in an "// &
534 "extended XYZ file. `Properties=species:S:1:pos:R:3` is always assumed for "// &
535 "backwards compatibility with the primitive XYZ specification: the first "// &
536 "column is a string for element symbol (or kind alias), followed by three "// &
537 "columns of real values for Cartesian coordinates in angstrom."//
newline//
newline// &
538 "Alternatively, the legacy brief format from `&TRAJECTORY` output where the "// &
539 "comment line starts with `i = <integer>` for the integer timestep can also "// &
540 "be used, this time with the = sign surrounded by whitespaces. The cell "// &
541 "information may come from a separate file requested by `CELL_FILE_NAME` if "// &
542 "variable, or may be taken as the `&FORCE_EVAL/&SUBSYS/&CELL` if constant.", &
543 n_keywords=1, n_subsections=1, repeats=.false.)
545 NULLIFY (keyword, print_key, subsection)
547 CALL keyword_create(keyword, __location__, name=
"TRAJ_FILE_NAME", &
548 description=
"Specify the filename where the trajectory is stored.", &
550 usage=
"TRAJ_FILE_NAME <CHARACTER>", default_lc_val=
"reftraj.xyz")
554 CALL keyword_create(keyword, __location__, name=
"CELL_FILE_NAME", &
555 description=
"Specify the filename where the cell is stored "// &
556 "(for trajectories generated within variable cell ensembles). "// &
557 "This file will be parsed only when no cell information is found "// &
558 "in the trajectory file and VARIABLE_VOLUME is set to .TRUE.", &
560 usage=
"CELL_FILE_NAME <CHARACTER>", default_lc_val=
"reftraj.cell")
564 CALL keyword_create(keyword, __location__, name=
"VARIABLE_VOLUME", &
565 description=
"Enables the possibility to read a CELL file with "// &
566 "information on the CELL size during the MD. This keyword will be "// &
567 "ignored if cell information is already available in the trajectory file.", &
568 repeats=.false., default_l_val=.false., lone_keyword_l_val=.true.)
572 CALL keyword_create(keyword, __location__, name=
"FIRST_SNAPSHOT", &
573 description=
"Index of the snapshot stored in the trajectory file "// &
574 "from which to start a REFTRAJ run", &
575 repeats=.false., usage=
"FIRST_SNAPSHOT <INTEGER>", default_i_val=1)
579 CALL keyword_create(keyword, __location__, name=
"LAST_SNAPSHOT", &
580 description=
"Index of the last snapshot stored in the trajectory file "// &
581 "that is read along a REFTRAJ run. Must be specified as default is 0. "// &
582 "Must be specified exactly as LAST_SNAPSHOT = FIRST_SNAPSHOT + STRIDE*(number of strides) "// &
583 "to avoid an error 'Unexpected EOF'. Note that STRIDE*(number of strides) "// &
584 "is simply the number of steps between the first to last snapshot.", &
585 repeats=.false., usage=
"LAST_SNAPSHOT", default_i_val=0)
590 description=
" Stride in number of snapshot for the reftraj analysis", &
591 repeats=.false., usage=
"STRIDE", default_i_val=1)
596 description=
"Selects the mode of energy and force evaluation for each "// &
597 "retrieved snapshot during a REFTRAJ run, which determines availability "// &
598 "of other properties and the time consumption in the computation. The "// &
599 "default is NONE, a conservative option useful for analyses concerning "// &
600 "structure only that are independent of force method, such as MSD and "// &
601 "`&MOTION/&PRINT/&STRUCTURE_DATA`. This keyword supersedes the logical "// &
602 "keywords `EVAL_<mode>` in older versions of the program.", &
605 enum_c_vals=
s2a(
"NONE",
"ENERGY",
"ENERGY_FORCES"), &
606 enum_desc=
s2a(
"Do not evaluate energy or force", &
607 "Evaluate only the energy", &
608 "Evaluate energy and forces"))
613 description=
"Whether and how atoms would be wrapped to inside the "// &
614 "simulation box according to periodic boundary condition before any "// &
615 "subsequent analysis. Useful when there is need to convert the raw, "// &
616 "unwrapped coordinates produced from `MOTION%PRINT%TRAJECTORY` for "// &
617 "post-processing. This keyword will be ignored when requesting MSD "// &
618 "calculation because wrapping coordinates makes displacement discontinuous.", &
621 enum_c_vals=
s2a(
"NONE",
"POSITIVE",
"CENTRAL"), &
622 enum_desc=
s2a(
"Do not wrap atoms at all and use coordinates exactly as input", &
623 "Wrap atoms so that fractional coordinates are within [0, 1]", &
624 "Wrap atoms so that fractional coordinates are within [-1/2, +1/2]"))
628 CALL create_msd_section(subsection)
633 description=
"The section that controls the output of a reftraj run", &
634 n_keywords=1, n_subsections=0, repeats=.false.)
638 description=
"Controls the output of msd per kind", &
645 description=
"Controls the output of msd per molecule kind", &
652 description=
"Controls the output of index and dislacement of "// &
653 "atoms that moved away from the initial position of more than a "// &
654 "given distance (see msd%disp_tol)", &
663 END SUBROUTINE create_reftraj_section
670 SUBROUTINE create_msd_section(section)
676 cpassert(.NOT.
ASSOCIATED(section))
679 description=
"Loads an external trajectory file and performs analysis on the"// &
680 " loaded snapshots.", &
681 n_keywords=3, n_subsections=0, repeats=.false.)
683 NULLIFY (keyword, subsection)
685 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
686 description=
"controls the activation of core-level spectroscopy simulations", &
688 default_l_val=.false., &
689 lone_keyword_l_val=.true.)
693 CALL keyword_create(keyword, __location__, name=
"REF0_FILENAME", &
694 description=
"Specify the filename where the initial reference configuration is stored.", &
695 repeats=.false., usage=
"REF0_FILENAME <CHARACTER>", default_lc_val=
"")
700 description=
"Set up the calculation of the MSD for each atomic kind", &
701 usage=
"MSD_PER_KIND <LOGICAL>", repeats=.false., &
702 default_l_val=.false., lone_keyword_l_val=.true.)
706 CALL keyword_create(keyword, __location__, name=
"MSD_PER_MOLKIND", &
707 description=
"Set up the calculation of the MSD for each molecule kind. "// &
708 "The position of the center of mass of the molecule is considered.", &
709 usage=
"MSD_PER_MOLKIND <LOGICAL>", repeats=.false., &
710 default_l_val=.false., lone_keyword_l_val=.true.)
714 CALL keyword_create(keyword, __location__, name=
"MSD_PER_REGION", &
715 description=
"Set up the calculation of the MSD for each defined region.", &
716 usage=
"MSD_PER_REGION <LOGICAL>", repeats=.false., &
717 default_l_val=.false., lone_keyword_l_val=.true.)
725 CALL keyword_create(keyword, __location__, name=
"DISPLACED_ATOM", &
726 description=
"Identify the atoms that moved from their initial "// &
727 "position of a distance larger than a given tolerance (see msd%displacement_tol).", &
728 usage=
"DISPLACED_ATOM <LOGICAL>", repeats=.false., &
729 default_l_val=.false., lone_keyword_l_val=.true.)
733 CALL keyword_create(keyword, __location__, name=
"displacement_tol", &
734 description=
"Lower limit to define displaced atoms", &
735 usage=
"DISPLACEMENT_TOL real", &
736 default_r_val=0._dp, n_var=1, unit_str=
'bohr')
740 END SUBROUTINE create_msd_section
747 SUBROUTINE create_msst_section(section)
752 cpassert(.NOT.
ASSOCIATED(section))
755 description=
"Parameters for Multi-Scale Shock Technique (MSST) "// &
756 "which simulate the effect of a steady planar shock on a unit cell. "// &
757 "Reed et. al. Physical Review Letters 90, 235503 (2003).", &
758 n_keywords=1, n_subsections=0, repeats=.false.)
762 description=
"Initial pressure", &
763 usage=
"PRESSURE real", &
764 default_r_val=0._dp, n_var=1, unit_str=
'bar')
769 description=
"Initial energy", &
770 usage=
"ENERGY real", &
771 default_r_val=0._dp, n_var=1, unit_str=
'hartree')
776 description=
"Initial volume", &
777 usage=
"VOLUME real", &
778 default_r_val=0._dp, n_var=1, unit_str=
'angstrom^3')
783 description=
"Effective cell mass", &
784 usage=
"CMASS real", &
785 default_r_val=0._dp, n_var=1, unit_str=
'au_m')
789 CALL keyword_create(keyword, __location__, name=
"VSHOCK", variants=[
"V_SHOCK"], &
790 description=
"Velocity shock", &
791 usage=
"VSHOCK real", &
792 default_r_val=0._dp, n_var=1, unit_str=
'm/s')
797 description=
"Damping coefficient for cell volume", &
798 usage=
"GAMMA real", &
800 default_r_val=0.0_dp)
804 END SUBROUTINE create_msst_section
810 SUBROUTINE create_shell_section(section)
816 cpassert(.NOT.
ASSOCIATED(section))
819 description=
"Parameters of shell model in adiabatic dynamics.", &
820 n_keywords=4, n_subsections=1, repeats=.false.)
822 NULLIFY (keyword, thermo_section)
825 description=
"Temperature in K used to control "// &
826 "the internal velocities of the core-shell motion ", &
827 usage=
"temperature 5.0", &
834 description=
"Maximum accepted temperature deviation"// &
835 " from the expected value, for the internal core-shell motion."// &
836 " If 0, no rescaling is performed", &
837 usage=
"temp_tol 0.0", default_r_val=0.0_dp, unit_str=
'K')
841 CALL keyword_create(keyword, __location__, name=
"nose_particle", &
842 description=
"If nvt or npt, the core and shell velocities are controlled "// &
843 "by the same thermostat used for the particle. This might favour heat exchange "// &
844 "and additional rescaling of the internal core-shell velocity is needed (TEMP_TOL)", &
845 default_l_val=.false., lone_keyword_l_val=.true.)
849 CALL keyword_create(keyword, __location__, name=
"DISPLACEMENT_SHELL_TOL", &
850 description=
"This keyword sets a maximum variation of the shell"// &
851 " core distance in each Cartesian direction."// &
852 " The maximum internal core-shell velocity is evaluated and"// &
853 " if it is too large to remain"// &
854 " within the assigned limit, the time step is rescaled accordingly,"// &
855 " and the first half step of the velocity verlet is repeated.", &
856 usage=
"DISPLACEMENT_SHELL_TOL <REAL>", default_r_val=100.0_dp, &
865 END SUBROUTINE create_shell_section
871 SUBROUTINE create_adiabatic_section(section)
875 TYPE(
section_type),
POINTER :: thermo_fast_section, thermo_slow_section
877 cpassert(.NOT.
ASSOCIATED(section))
879 CALL section_create(section, __location__, name=
"ADIABATIC_DYNAMICS", &
880 description=
"Parameters used in canonical adiabatic free energy sampling (CAFES).", &
881 n_keywords=5, n_subsections=2, repeats=.false., &
884 NULLIFY (keyword, thermo_fast_section, thermo_slow_section)
887 description=
"Temperature in K used to control "// &
888 "the fast degrees of freedom ", &
889 usage=
"temp_fast 5.0", &
896 description=
"Temperature in K used to control "// &
897 "the slow degrees of freedom ", &
898 usage=
"temp_slow 5.0", &
904 CALL keyword_create(keyword, __location__, name=
"temp_tol_fast", &
905 description=
"Maximum accepted temperature deviation"// &
906 " from the expected value, for the fast motion."// &
907 " If 0, no rescaling is performed", &
908 usage=
"temp_tol_fast 0.0", default_r_val=0.0_dp, unit_str=
'K')
912 CALL keyword_create(keyword, __location__, name=
"temp_tol_slow", &
913 description=
"Maximum accepted temperature deviation"// &
914 " from the expected value, for the slow motion."// &
915 " If 0, no rescaling is performed", &
916 usage=
"temp_tol_slow 0.0", default_r_val=0.0_dp, unit_str=
'K')
921 description=
"number of respa steps for fast degrees of freedom", &
922 repeats=.false., default_i_val=1)
934 END SUBROUTINE create_adiabatic_section
941 SUBROUTINE create_softening_section(section)
946 CALL section_create(section, __location__, name=
"VELOCITY_SOFTENING", &
947 description=
"A method to initialize the velocities along low-curvature " &
948 //
"directions in order to favors MD trajectories to cross rapidly over " &
949 //
"small energy barriers into neighboring basins. " &
950 //
"In each iteration the forces are calculated at a point y, which " &
951 //
"is slightly displaced from the current positions x in the direction " &
952 //
"of the original velocities v. The velocities are then updated with " &
953 //
"the force component F_t, which is perpendicular to N. " &
954 //
"N = v / |v|; y = x + delta * N; F_t = F(y) - ⟨ F(y) | N ⟩ * N; " &
955 //
"v' = v + alpha * F_t")
959 description=
"Number of softening iterations performed. " &
960 //
"Typical values are around 40 steps.", &
966 description=
"Displacement used to obtain y.", &
967 default_r_val=0.1_dp)
972 description=
"Mixing factor used for updating velocities.", &
973 default_r_val=0.15_dp)
977 END SUBROUTINE create_softening_section
987 SUBROUTINE create_thermal_region_section(section)
991 TYPE(
section_type),
POINTER :: print_key, region_section, subsection, &
994 cpassert(.NOT.
ASSOCIATED(section))
996 CALL section_create(section, __location__, name=
"THERMAL_REGION", &
997 description=
"Define regions where different initialization and control "// &
998 "of the temperature is used. When MOTION%MD%ENSEMBLE is set to LANGEVIN, "// &
999 "this section controls if the atoms defined inside and outside the "// &
1000 "thermal regions should undergo Langevin MD or NVE Born-Oppenheimer MD. "// &
1001 "The theory behind Langevin MD using different regions can be found in "// &
1002 "articles by Kantorovitch et al. listed below.", &
1004 n_keywords=0, n_subsections=1, repeats=.false.)
1006 NULLIFY (region_section)
1007 NULLIFY (keyword, subsection, tfunc_section)
1009 CALL keyword_create(keyword, __location__, name=
"FORCE_RESCALING", &
1010 description=
"Control the rescaling ot the velocities in all the regions, "// &
1011 "according to the temperature assigned to each reagion, when "// &
1012 "RESTART_VELOCITY in EXT_RESTART is active.", &
1013 default_l_val=.false., lone_keyword_l_val=.true.)
1017 CALL keyword_create(keyword, __location__, name=
"DO_LANGEVIN_DEFAULT", &
1018 description=
"If ENSEMBLE is set to LANGEVIN, controls whether the "// &
1019 "atoms NOT defined in the thermal regions to undergo langevin MD "// &
1020 "or not. If not, then the atoms will undergo NVE Born-Oppenheimer MD.", &
1021 usage=
"DO_LANGEVIN_DEFAULT .FALSE.", &
1022 default_l_val=.false., lone_keyword_l_val=.true.)
1026 CALL section_create(region_section, __location__, name=
"DEFINE_REGION", &
1027 description=
"Define arbitrary thermal region with distinct "// &
1028 "temperature controls. For thermostat regions, see section "// &
1029 "MOTION%MD%THERMOSTAT%DEFINE_REGION; when the keyword "// &
1030 "MOTION%MD%THERMOSTAT%REGION is set to THERMAL, the "// &
1031 "definition of thermostat regions will be the same as "// &
1032 "that of thermal regions.", &
1033 n_keywords=3, n_subsections=1, repeats=.true.)
1037 description=
"Specifies a list of atoms belonging to the region.", &
1038 usage=
"LIST {integer} {integer} .. {integer}", &
1039 repeats=.true., n_var=-1, type_of_var=
integer_t)
1044 variants=[
"SEGNAME"], &
1045 description=
"Specifies the name of the molecules belonging to the region.", &
1046 usage=
"MOLNAME WAT MEOH", repeats=.true., &
1047 n_var=-1, type_of_var=
char_t)
1052 variants=[
"PROTEIN"], &
1053 description=
"Not yet implemented: In a QM/MM run all "// &
1054 "MM atoms are specified as a whole region", &
1055 usage=
"MM_SUBSYS (NONE|ATOMIC|MOLECULAR)", &
1056 enum_c_vals=
s2a(
"NONE",
"ATOMIC",
"MOLECULAR"), &
1058 enum_desc=
s2a(
"Nothing in the region", &
1059 "Only the MM atoms itself", &
1060 "The full molecule/residue that contains a MM atom"), &
1066 description=
"Not yet implemented: In a QM/MM run all "// &
1067 "QM atoms are specified as a whole region", &
1068 usage=
"QM_SUBSYS (NONE|ATOMIC|MOLECULAR)", &
1069 enum_c_vals=
s2a(
"NONE",
"ATOMIC",
"MOLECULAR"), &
1070 enum_desc=
s2a(
"Nothing in the region", &
1071 "Only the QM atoms itself", &
1072 "The full molecule/residue that contains a QM atom"), &
1079 description=
"The temperature in K used to initialize the velocities "// &
1080 "of the atoms in this region. It overrides the value evaluated by the "// &
1081 "function defined in TFUNC section.", &
1082 usage=
"TEMPERATURE 5.0", &
1089 description=
"Maximum accepted temperature deviation from the target "// &
1090 "value for this region, which is defined by TEMPERATURE or evaluated "// &
1091 "with the function defined in TFUNC section. Default value is 0 that "// &
1092 "turns off rescaling.", &
1093 usage=
"TEMP_TOL 0.0", &
1094 default_r_val=0.0_dp, unit_str=
'K')
1099 description=
"When ENSEMBLE is set to LANGEVIN, Controls whether "// &
1100 "the atoms in the thermal region should undergo Langevin MD. If "// &
1101 "not, then they will undergo NVE Born-Oppenheimer MD.", &
1102 usage=
"DO_LANGEVIN .TRUE.", &
1103 default_l_val=.true., lone_keyword_l_val=.true.)
1107 CALL keyword_create(keyword, __location__, name=
"NOISY_GAMMA_REGION", &
1108 description=
"Special imaginary Langevin Friction term"// &
1109 " for Langevin Dynamics with noisy forces for the atoms in this region."// &
1110 " When set, overrides the general value set by NOISY_GAMMA in the MOTION%MD%LANGEVIN section."// &
1111 " When unset for a defined region, the general NOISY_GAMMA value applies.", &
1112 citations=[
kuhne2007], usage=
"NOISY_GAMMA_REGION 4.0E-5", &
1120 description=
"This section specifies the target temperature by using "// &
1121 "the time step and the temperature of the last step, allowing for "// &
1122 "simple region-wise simulated annealing (heating/cooling) controls. "// &
1123 "When the absolute difference between target and actual temperature "// &
1124 "is larger than TEMP_TOL value, the atomic velocities in this region "// &
1125 "are rescaled to match the target temperature. However, note that "// &
1126 "the actual temperature is subject to thermostat coupling as well "// &
1127 "and a small restrictive TEMP_TOL together with a rapidly varying "// &
1128 "target temperature function leaves little time for the system to "// &
1129 "adjust itself, possibly showing unphysical relaxation behaviors. "// &
1131 n_keywords=4, n_subsections=0, repeats=.false.)
1135 description=
"Specifies the functional form of the temperature "// &
1136 "in Kelvin in mathematical notation. Two variables are available "// &
1137 "with one denoted S for the integer time step and another denoted "// &
1138 "T for the temperature of the last step in Kelvin respectively. When "// &
1139 "DEFINE_REGION%TEMPERATURE is not explicitly set, the function "// &
1140 "will be evaluated at S set in MD%STEP_START_VAL and T = 0.0 "// &
1141 "to initialize the velocities of atoms in the region.", &
1142 usage=
"FUNCTION A*T+(1-A)*B*(2/(1+EXP(-0.001*S))-1)", &
1148 description=
"Defines the parameters of the functional form", &
1149 usage=
"PARAMETERS A B", type_of_var=
char_t, &
1150 n_var=-1, repeats=.true.)
1155 description=
"Optionally, allows to define valid CP2K unit strings for each parameter value. "// &
1156 "It is assumed that the corresponding parameter value is specified in this unit.", &
1157 usage=
"UNITS ", type_of_var=
char_t, &
1158 n_var=-1, repeats=.true.)
1163 description=
"Defines the values of the parameter of the functional form", &
1164 usage=
"VALUES 0.75 3.00E+2", type_of_var=
real_t, &
1165 n_var=-1, repeats=.true., unit_str=
"internal_cp2k")
1178 description=
"Collects all print_keys for thermal_regions", &
1179 n_keywords=1, n_subsections=0, repeats=.false.)
1182 description=
"Controls the output of the temperature per "// &
1183 "region. The first three columns are: step number, time "// &
1184 "(in fs), and the temperature of atoms not in any temperature "// &
1185 "region (or zero if all atoms are in some temperature region). "// &
1186 "Subsequent columns are, in pairs, the target value "// &
1187 "(calculated by TFUNC or specified by TEMPERATURE) "// &
1188 "and the actual value of the temperature for each region.", &
1195 description=
"Controls output of information on which atoms "// &
1196 "underwent Langevin MD and which atoms did not.", &
1205 END SUBROUTINE create_thermal_region_section
1214 SUBROUTINE create_cascade_section(section)
1222 NULLIFY (subsection)
1223 cpassert(.NOT.
ASSOCIATED(section))
1226 description=
"Defines the parameters for the setup of a cascade simulation.", &
1232 name=
"_SECTION_PARAMETERS_", &
1233 description=
"Controls the activation of the CASCADE section.", &
1234 usage=
"&CASCADE on", &
1235 default_l_val=.false., &
1236 lone_keyword_l_val=.true.)
1241 description=
"Total energy transferred to the system during the cascade event.", &
1242 usage=
"ENERGY 20.0", &
1243 default_r_val=0.0_dp, &
1248 CALL section_create(subsection, __location__, name=
"ATOM_LIST", &
1249 description=
"Defines a list of atoms for which the initial velocities are modified", &
1254 CALL keyword_create(keyword, __location__, name=
"_DEFAULT_KEYWORD_", &
1255 description=
"Defines the list of atoms for which the velocities are modified. "// &
1256 "Each record consists of the atomic index, the velocity vector, and "// &
1257 "a weight to define which fraction of the total energy is assigned "// &
1258 "to the current atom: `Atomic_index v_x v_y v_z Weight`", &
1259 usage=
"{{Integer} {Real} {Real} {Real} {Real}}", &
1268 END SUBROUTINE create_cascade_section
1275 SUBROUTINE create_avgs_section(section)
1281 cpassert(.NOT.
ASSOCIATED(section))
1283 description=
"Controls the calculation of the averages during an MD run.", &
1284 n_keywords=1, n_subsections=1, repeats=.false.)
1285 NULLIFY (keyword, print_key, subsection)
1287 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
1288 description=
"Controls the calculations of the averages.", &
1289 usage=
"&AVERAGES T", default_l_val=.true., lone_keyword_l_val=.true.)
1293 CALL keyword_create(keyword, __location__, name=
"ACQUISITION_START_TIME", &
1294 description=
"Setup up the simulation time when the acquisition process to compute"// &
1295 " averages is started.", &
1296 usage=
"ACQUISITION_START_TIME <REAL>", &
1297 default_r_val=0.0_dp, unit_str=
'fs')
1301 CALL keyword_create(keyword, __location__, name=
"AVERAGE_COLVAR", &
1302 description=
"Switch for computing the averages of COLVARs.", &
1303 usage=
"AVERAGE_COLVAR <LOGICAL>", default_l_val=.false., &
1304 lone_keyword_l_val=.true.)
1309 description=
"Controls the output the averaged quantities", &
1315 CALL create_avgs_restart_section(subsection)
1318 END SUBROUTINE create_avgs_section
1325 SUBROUTINE create_avgs_restart_section(section)
1330 cpassert(.NOT.
ASSOCIATED(section))
1331 CALL section_create(section, __location__, name=
"RESTART_AVERAGES", &
1332 description=
"Stores information for restarting averages.", &
1333 n_keywords=1, n_subsections=1, repeats=.false.)
1336 CALL keyword_create(keyword, __location__, name=
"ITIMES_START", &
1337 description=
"TIME STEP starting the evaluation of averages", &
1338 usage=
"ITIMES_START <INTEGER>", type_of_var=
integer_t, n_var=1)
1343 description=
"CPU average", usage=
"AVECPU <REAL>", &
1344 type_of_var=
real_t, n_var=1)
1349 description=
"HUGONIOT average", usage=
"AVEHUGONIOT <REAL>", &
1350 type_of_var=
real_t, n_var=1)
1354 CALL keyword_create(keyword, __location__, name=
"AVETEMP_BARO", &
1355 description=
"BAROSTAT TEMPERATURE average", usage=
"AVETEMP_BARO <REAL>", &
1356 type_of_var=
real_t, n_var=1)
1361 description=
"POTENTIAL ENERGY average", usage=
"AVEPOT <REAL>", &
1362 type_of_var=
real_t, n_var=1)
1367 description=
"KINETIC ENERGY average", usage=
"AVEKIN <REAL>", &
1368 type_of_var=
real_t, n_var=1)
1373 description=
"TEMPERATURE average", usage=
"AVETEMP <REAL>", &
1374 type_of_var=
real_t, n_var=1)
1379 description=
"QM KINETIC ENERGY average in QMMM runs", usage=
"AVEKIN_QM <REAL>", &
1380 type_of_var=
real_t, n_var=1)
1385 description=
"QM TEMPERATURE average in QMMM runs", usage=
"AVETEMP_QM <REAL>", &
1386 type_of_var=
real_t, n_var=1)
1391 description=
"VOLUME average", usage=
"AVEVOL <REAL>", &
1392 type_of_var=
real_t, n_var=1)
1397 description=
"CELL VECTOR A average", usage=
"AVECELL_A <REAL>", &
1398 type_of_var=
real_t, n_var=1)
1403 description=
"CELL VECTOR B average", usage=
"AVECELL_B <REAL>", &
1404 type_of_var=
real_t, n_var=1)
1409 description=
"CELL VECTOR C average", usage=
"AVECELL_C <REAL>", &
1410 type_of_var=
real_t, n_var=1)
1415 description=
"ALPHA cell angle average", usage=
"AVEALPHA <REAL>", &
1416 type_of_var=
real_t, n_var=1)
1421 description=
"BETA cell angle average", usage=
"AVEBETA <REAL>", &
1422 type_of_var=
real_t, n_var=1)
1427 description=
"GAMMA cell angle average", usage=
"AVEGAMMA <REAL>", &
1428 type_of_var=
real_t, n_var=1)
1433 description=
"CONSTANT ENERGY average", usage=
"AVE_ECONS <REAL>", &
1434 type_of_var=
real_t, n_var=1)
1439 description=
"PRESSURE average", usage=
"AVE_PRESS <REAL>", &
1440 type_of_var=
real_t, n_var=1)
1445 description=
"P_{XX} average", usage=
"AVE_PXX <REAL>", &
1446 type_of_var=
real_t, n_var=1)
1451 description=
"PV VIRIAL average", usage=
"AVE_PV_VIR <REAL> .. <REAL>", &
1452 type_of_var=
real_t, n_var=9)
1457 description=
"PV TOTAL average", usage=
"AVE_PV_TOT <REAL> .. <REAL>", &
1458 type_of_var=
real_t, n_var=9)
1463 description=
"PV KINETIC average", usage=
"AVE_PV_KIN <REAL> .. <REAL>", &
1464 type_of_var=
real_t, n_var=9)
1468 CALL keyword_create(keyword, __location__, name=
"AVE_PV_CNSTR", &
1469 description=
"PV CONSTRAINTS average", usage=
"AVE_PV_CNSTR <REAL> .. <REAL>", &
1470 type_of_var=
real_t, n_var=9)
1475 description=
"PV XC average", usage=
"AVE_PV_XC <REAL> .. <REAL>", &
1476 type_of_var=
real_t, n_var=9)
1480 CALL keyword_create(keyword, __location__, name=
"AVE_PV_FOCK_4C", &
1481 description=
"PV XC average", usage=
"AVE_PV_FOCK_4C <REAL> .. <REAL>", &
1482 type_of_var=
real_t, n_var=9)
1487 description=
"COLVARS averages", usage=
"AVE_COLVARS <REAL> .. <REAL>", &
1488 type_of_var=
real_t, n_var=-1)
1493 description=
"METRIC TENSOR averages", usage=
"AVE_MMATRIX <REAL> .. <REAL>", &
1494 type_of_var=
real_t, n_var=-1)
1497 END SUBROUTINE create_avgs_restart_section
1504 SUBROUTINE create_vib_init_section(section)
1509 cpassert(.NOT.
ASSOCIATED(section))
1510 CALL section_create(section, __location__, name=
"INITIAL_VIBRATION", &
1511 description=
"Controls the set of parameters for MD initialisation "// &
1512 "based on vibration analysis data. The starting atomic coordinates "// &
1513 "should be based on the relaxed positions obtained from a previous "// &
1514 "geometry/cell optimisation calculation, and the vibrational "// &
1515 "frequencies and displacements data should be obtained from a "// &
1516 "vibrational analysis calculation done based on the relaxed "// &
1517 "coordinates. The MD initialisation process expects the user has "// &
1518 "performed both geometry optimisation and vibrational analysis "// &
1519 "before hand, and won't perform those calculations automatically ", &
1521 n_keywords=0, n_subsections=1, repeats=.false.)
1523 CALL keyword_create(keyword, __location__, name=
"VIB_EIGS_FILE_NAME", &
1524 description=
"The file name of vibrational frequency (eigenvalue) "// &
1525 "and displacement (eigenvector) data calculated from the a "// &
1526 "vibrational analysis calculation done previously. This file must "// &
1527 "be the same unformatted binary file as referred to by "// &
1528 "VIBRATIONAL_ANALYSIS%PRINT%CARTESIAN_EIGS keyword. If this keyword "// &
1529 "is not explicitly defined by the user, then the default file "// &
1530 "name of: <project_name>-<CARTESIAN_EIGS_FILENAME>.eig will be used", &
1531 usage=
"VIB_EIGS_FILE_NAME <FILENAME>", &
1537 description=
"Controls the initial ratio of potential and kinetic "// &
1538 "contribution to the total energy. The contribution is determined by "// &
1539 "COS**2(2*pi*PHASE) for potential energy, and SIN**2(2*pi*PHASE) "// &
1540 "for kinetic energy. If PHASE is negative, then for each vibration "// &
1541 "mode the phase is determined randomly. Otherwise, PHASE must be "// &
1542 "between 0.0 and 1.0 and will be the same for all vibration modes. "// &
1543 "If value > 1.0 it will just be treated as 1.0. "// &
1544 "For example, setting PHASE = 0.25 would set all modes to "// &
1545 "begin with entirely kinetic energy --- in other words, the initial "// &
1546 "atomic positions will remain at their optimised location", &
1547 default_r_val=-1.0_dp, &
1548 usage=
"PHASE <REAL>")
1551 END SUBROUTINE create_vib_init_section
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 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...
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
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
This public domain function parser module is intended for applications where a set of mathematical ex...
character(len=:) function, allocatable, public docf()
...
Defines the basic variable types.
integer, parameter, public dp
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