51#include "../base/base_uses.f90"
56 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
57 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_md'
74 cpassert(.NOT.
ASSOCIATED(section))
76 description=
"This section defines the whole set of parameters needed perform an MD run.", &
77 n_keywords=13, n_subsections=6, repeats=.false.)
79 NULLIFY (keyword, subsection)
81 description=
"The ensemble/integrator that you want to use for MD propagation", &
82 usage=
"ensemble nve", &
84 enum_c_vals=
s2a(
"NVE",
"NVT",
"NPT_I",
"NPT_F",
"MSST",
"MSST_DAMPED", &
85 "HYDROSTATICSHOCK",
"ISOKIN",
"REFTRAJ",
"LANGEVIN",
"NPE_F", &
86 "NPE_I",
"NVT_ADIABATIC",
"NPT_IA"), &
87 enum_desc=
s2a(
"constant energy (microcanonical)", &
88 "constant temperature and volume (canonical)", &
89 "constant temperature and pressure using an isotropic cell", &
90 "constant temperature and pressure using a flexible cell", &
91 "simulate steady shock (uniaxial)", &
92 "simulate steady shock (uniaxial) with extra viscosity", &
93 "simulate steady shock with hydrostatic pressure", &
94 "constant kinetic energy", &
95 "reading frames from a file called reftraj.xyz (e.g. for property calculation)", &
96 "langevin dynamics (constant temperature)", &
97 "constant pressure ensemble (no thermostat)", &
98 "constant pressure ensemble using an isotropic cell (no thermostat)", &
99 "adiabatic dynamics in constant temperature and volume ensemble (CAFES)", &
100 "NPT_I ensemble with frozen atoms in absolute coordinate"), &
110 description=
"The number of MD steps to perform, counting from step_start_val. ", &
111 usage=
"steps 100", default_i_val=3)
116 description=
"The number of MD steps to perform, counting from step 1", &
117 usage=
"max_steps 100", default_i_val=1000000000)
122 description=
"The length of an integration step (in case RESPA the large TIMESTEP)", &
123 usage=
"timestep 1.0", default_r_val=
cp_unit_to_cp2k(
value=0.5_dp, unit_str=
"fs"), &
128 CALL keyword_create(keyword, __location__, name=
"step_start_val", &
129 description=
"The starting step value for the MD", usage=
"step_start_val <integer>", &
134 CALL keyword_create(keyword, __location__, name=
"time_start_val", &
135 description=
"The starting timer value for the MD", &
136 usage=
"time_start_val <real>", default_r_val=
cp_unit_to_cp2k(
value=0.0_dp, unit_str=
"fs"), &
141 CALL keyword_create(keyword, __location__, name=
"econs_start_val", &
142 description=
"The starting value of the conserved quantity", &
143 usage=
"econs_start_val <real>", default_r_val=0.0_dp, &
149 description=
"The temperature in K used to initialize "// &
150 "the velocities with init and pos restart, and in the NPT/NVT simulations", &
151 usage=
"temperature 325.0", default_r_val=
cp_unit_to_cp2k(
value=300.0_dp, unit_str=
"K"), &
157 variants=
s2a(
"temp_to",
"temperature_tolerance"), &
158 description=
"The maximum accepted deviation of the (global) temperature "// &
159 "from the desired target temperature before a rescaling of the velocites "// &
160 "is performed. If it is 0 no rescaling is performed. NOTE: This keyword is "// &
161 "obsolescent; Using a CSVR thermostat with a short timeconstant is "// &
162 "recommended as a better alternative.", &
163 usage=
"temp_tol 0.0", default_r_val=0.0_dp, unit_str=
'K')
168 description=
"Compute the temperature per each kind separately", &
169 usage=
"temp_kind LOGICAL", &
170 default_l_val=.false., lone_keyword_l_val=.true.)
174 CALL keyword_create(keyword, __location__, name=
"scale_temp_kind", &
175 description=
"When necessary rescale the temperature per each kind separately", &
176 usage=
"scale_temp_kind LOGICAL", &
177 default_l_val=.false., lone_keyword_l_val=.true.)
182 description=
"The maximum accepted velocity of the center of mass. "// &
183 "With Shell-Model, comvel may drift if MD%THERMOSTAT%REGION /= GLOBAL ", &
184 usage=
"comvel_tol 0.1", type_of_var=
real_t, n_var=1, unit_str=
"bohr*au_t^-1")
189 description=
"The maximum accepted angular velocity. This option is ignored "// &
190 "when the system is periodic. Removes the components of the velocities that "// &
191 "project on the external rotational degrees of freedom.", &
192 usage=
"angvel_tol 0.1", type_of_var=
real_t, n_var=1, unit_str=
"bohr*au_t^-1")
197 description=
"Set the initial angular velocity to zero. This option is ignored "// &
198 "when the system is periodic or when initial velocities are defined. Technically, "// &
199 "the part of the random initial velocities that projects on the external "// &
200 "rotational degrees of freedom is subtracted.", &
201 usage=
"angvel_zero LOGICAL", &
202 default_l_val=.false., lone_keyword_l_val=.true.)
207 description=
"Specifies the rescaling factor for annealing velocities. "// &
208 "Automatically enables the annealing procedure. This scheme works only for ensembles "// &
209 "that do not have thermostats on particles.", &
210 usage=
"annealing <REAL>", default_r_val=1.0_dp)
214 CALL keyword_create(keyword, __location__, name=
"ANNEALING_CELL", &
215 description=
"Specifies the rescaling factor for annealing velocities of the CELL "// &
216 "Automatically enables the annealing procedure for the CELL. This scheme works only "// &
217 "for ensambles that do not have thermostat on CELLS velocities.", &
218 usage=
"ANNEALING_CELL <REAL>", default_r_val=1.0_dp)
222 CALL keyword_create(keyword, __location__, name=
"TEMPERATURE_ANNEALING", &
223 description=
"Specifies the rescaling factor for the external temperature. "// &
224 "This scheme works only for the Langevin ensemble.", &
225 usage=
"TEMPERATURE_ANNEALING <REAL>", default_r_val=1.0_dp)
229 CALL keyword_create(keyword, __location__, name=
"DISPLACEMENT_TOL", &
230 description=
"This keyword sets a maximum atomic displacement "// &
231 "in each Cartesian direction. "// &
232 "The maximum velocity is evaluated and if it is too large to remain "// &
233 "within the assigned limit, the time step is rescaled accordingly, "// &
234 "and the first half step of the velocity verlet is repeated.", &
235 usage=
"DISPLACEMENT_TOL <REAL>", default_r_val=100.0_dp, &
240 CALL keyword_create(keyword, __location__, name=
"INITIALIZATION_METHOD", &
241 description=
"This keyword selects which method to use to initialize MD. "// &
242 "If velecities are not set explicitly, DEFAULT optioin will assign "// &
243 "random velocities and then scale according to TEMPERATURE; VIBRATIONAL "// &
244 "option will then use previously calculated vibrational modes to "// &
245 "initialise both the atomic positions and velocities so that the "// &
246 "starting point for MD is as close to canonical ensemble as possible, "// &
247 "without the need for lengthy equilibration steps. See PRL 96, 115504 "// &
248 "(2006). The user input atomic positions in this case are expected to "// &
249 "be already geometry optimised. Further options for VIBRATIONAL mode "// &
250 "is can be set in INITIAL_VIBRATION subsection. If unspecified, then "// &
251 "the DEFAULT mode will be used.", &
252 usage=
"INITIALIZATION_METHOD DEFAULT", &
254 enum_c_vals=
s2a(
"DEFAULT",
"VIBRATIONAL"), &
255 enum_desc=
s2a(
"Assign random velocities and then scale according to "// &
257 "Initialise positions and velocities to give canonical ensemble "// &
258 "with TEMPERATURE, using the method described in PRL 96, 115504 (2006)"), &
263 CALL create_langevin_section(subsection)
267 CALL create_msst_section(subsection)
279 CALL create_respa_section(subsection)
283 CALL create_shell_section(subsection)
287 CALL create_adiabatic_section(subsection)
291 CALL create_softening_section(subsection)
295 CALL create_reftraj_section(subsection)
299 CALL create_avgs_section(subsection)
303 CALL create_thermal_region_section(subsection)
307 CALL create_md_print_section(subsection)
311 CALL create_cascade_section(subsection)
315 CALL create_vib_init_section(subsection)
326 SUBROUTINE create_langevin_section(section)
331 cpassert(.NOT.
ASSOCIATED(section))
333 description=
"Controls the set of parameters to run a Langevin MD. "// &
334 "The integrator used follows that given in the article by Ricci et al. "// &
335 "The user can define regions in the system where the atoms inside "// &
336 "undergoes Langevin MD, while those outside the regions undergoes "// &
337 "NVE Born Oppenheimer MD. To define the regions, the user should "// &
338 "use THERMAL_REGION subsection of MOTION%MD. ", &
340 n_keywords=0, n_subsections=1, repeats=.false.)
344 description=
"Gamma parameter for the Langevin dynamics (LD)", &
345 usage=
"gamma 0.001", &
346 default_r_val=0.0_dp, unit_str=
'fs^-1')
351 variants=(/
"NoisyGamma"/), &
352 description=
"Imaginary Langevin Friction term for LD with noisy forces.", &
354 usage=
"Noisy_Gamma 4.0E-5", default_r_val=0.0_dp, unit_str=
'fs^-1')
359 variants=(/
"ShadowGamma"/), &
360 description=
"Shadow Langevin Friction term for LD with noisy forces in order to adjust Noisy_Gamma.", &
362 usage=
"Shadow_Gamma 0.001", default_r_val=0.0_dp, unit_str=
'fs^-1')
365 END SUBROUTINE create_langevin_section
372 SUBROUTINE create_md_print_section(section)
378 cpassert(.NOT.
ASSOCIATED(section))
380 description=
"Controls the printing properties during an MD run", &
381 n_keywords=0, n_subsections=1, repeats=.false.)
382 NULLIFY (print_key, keyword)
385 description=
"Print the output and restart file if walltime is reached or "// &
386 "if an external EXIT command is given. It still requires the keyword LAST "// &
387 "to be present for the specific print key (in case the last step should not "// &
388 "match with the print_key iteration number).", &
389 usage=
"FORCE_LAST LOGICAL", &
390 default_l_val=.false., lone_keyword_l_val=.true.)
395 description=
"Controls the output the ener file", &
402 description=
"Controls the output of the shell-energy file (only if shell-model)", &
409 description=
"Controls the output of the temperature"// &
410 " computed separately for each kind", &
417 description=
"Controls the output of the temperature of the"// &
418 " shell-core motion computed separately for each kind", &
425 description=
"Controls the printing of COM velocity during an MD", &
427 filename=
"__STD_OUT__")
432 description=
"Controls the printing of coefficients during an MD run.", &
439 description=
"Controls the printing basic info during the calculation of the "// &
440 "translational/rotational degrees of freedom.", print_level=
low_print_level, &
443 description=
"Prints atomic coordinates in the standard orientation. "// &
444 "Coordinates are not affected during the calculation.", &
445 default_l_val=.false., lone_keyword_l_val=.true.)
452 description=
"Controls the printing of basic and summary information during the"// &
453 " Molecular Dynamics", &
457 END SUBROUTINE create_md_print_section
464 SUBROUTINE create_respa_section(section)
469 cpassert(.NOT.
ASSOCIATED(section))
472 description=
"Multiple timestep integration based on RESPA (implemented for NVE only)."// &
473 " RESPA exploits multiple force_eval."// &
474 " In this case the order of the force_eval maps"// &
475 " the order of the respa shells from the slowest to the fastest force evaluation."// &
476 " If force_evals share the same subsys, it's enough then to specify the"// &
477 " subsys in the force_eval corresponding at the first index in the multiple_force_eval list."// &
478 " Can be used to speedup classical and ab initio MD simulations.", &
479 n_keywords=1, n_subsections=0, repeats=.false., &
484 description=
"The number of reference MD steps between two RESPA corrections.", &
485 usage=
"FREQUENCY <INTEGER>", default_i_val=5)
489 END SUBROUTINE create_respa_section
496 SUBROUTINE create_reftraj_section(section)
502 cpassert(.NOT.
ASSOCIATED(section))
505 description=
"Loads an external trajectory file and performs analysis on the"// &
506 " loaded snapshots.", &
507 n_keywords=1, n_subsections=1, repeats=.false.)
509 NULLIFY (keyword, print_key, subsection)
511 CALL keyword_create(keyword, __location__, name=
"TRAJ_FILE_NAME", &
512 description=
"Specify the filename where the trajectory is stored. "// &
513 "If you built your own trajectory file make sure it has the trajectory format. "// &
514 'In particular, each structure has to be enumerated using " i = ..."', &
516 usage=
"TRAJ_FILE_NAME <CHARACTER>", default_lc_val=
"reftraj.xyz")
520 CALL keyword_create(keyword, __location__, name=
"CELL_FILE_NAME", &
521 description=
"Specify the filename where the cell is stored "// &
522 "(for trajectories generated within variable cell ensembles).", repeats=.false., &
523 usage=
"CELL_FILE_NAME <CHARACTER>", default_lc_val=
"reftraj.cell")
528 keyword, __location__, name=
"VARIABLE_VOLUME", &
529 description=
"Enables the possibility to read a CELL file with information on the CELL size during the MD.", &
530 repeats=.false., default_l_val=.false., lone_keyword_l_val=.true.)
534 CALL keyword_create(keyword, __location__, name=
"FIRST_SNAPSHOT", &
535 description=
"Index of the snapshot stored in the trajectory file "// &
536 "from which to start a REFTRAJ run", &
537 repeats=.false., usage=
"FIRST_SNAPSHOT <INTEGER>", default_i_val=1)
541 CALL keyword_create(keyword, __location__, name=
"LAST_SNAPSHOT", &
542 description=
"Index of the last snapshot stored in the trajectory file "// &
543 "that is read along a REFTRAJ run. Must be specified as default is 0. "// &
544 "Must be specified exactly as LAST_SNAPSHOT = FIRST_SNAPSHOT + STRIDE*(number of strides) "// &
545 "to avoid an error 'Unexpected EOF'. Note that STRIDE*(number of strides) "// &
546 "is simply the number of steps between the first to last snapshot.", &
547 repeats=.false., usage=
"LAST_SNAPSHOT", default_i_val=0)
552 description=
" Stride in number of snapshot for the reftraj analysis", &
553 repeats=.false., usage=
"STRIDE", default_i_val=1)
558 description=
"Selects the properties to evaluate for each retrieved snapshot during a REFTRAJ run", &
561 enum_c_vals=
s2a(
"NONE",
"ENERGY",
"ENERGY_FORCES"), &
562 enum_desc=
s2a(
"Evaluate nothing",
"Evaluate only the energy",
"Evaluate energy and forces"))
566 CALL keyword_create(keyword, __location__, name=
"eval_energy_forces", &
567 description=
"Evaluate energy and forces for each retrieved snapshot during a REFTRAJ run", &
568 repeats=.false., default_l_val=.false., lone_keyword_l_val=.true., &
569 deprecation_notice=
"Please use MOTION / MD / REFTRAJ / EVAL instead.")
574 description=
"Evaluate the forces for each retrieved snapshot during a REFTRAJ run", &
575 repeats=.false., default_l_val=.false., lone_keyword_l_val=.true., &
576 deprecation_notice=
"Please use MOTION / MD / REFTRAJ / EVAL instead.")
580 CALL create_msd_section(subsection)
585 description=
"The section that controls the output of a reftraj run", &
586 n_keywords=1, n_subsections=0, repeats=.false.)
590 description=
"Controls the output of msd per kind", &
597 description=
"Controls the output of msd per molecule kind", &
604 description=
"Controls the output of index and dislacement of "// &
605 "atoms that moved away from the initial position of more than a "// &
606 "given distance (see msd%disp_tol)", &
615 END SUBROUTINE create_reftraj_section
622 SUBROUTINE create_msd_section(section)
628 cpassert(.NOT.
ASSOCIATED(section))
631 description=
"Loads an external trajectory file and performs analysis on the"// &
632 " loaded snapshots.", &
633 n_keywords=3, n_subsections=0, repeats=.false.)
635 NULLIFY (keyword, subsection)
637 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
638 description=
"controls the activation of core-level spectroscopy simulations", &
640 default_l_val=.false., &
641 lone_keyword_l_val=.true.)
645 CALL keyword_create(keyword, __location__, name=
"REF0_FILENAME", &
646 description=
"Specify the filename where the initial reference configuration is stored.", &
647 repeats=.false., usage=
"REF0_FILENAME <CHARACTER>", default_lc_val=
"")
652 description=
"Set up the calculation of the MSD for each atomic kind", &
653 usage=
"MSD_PER_KIND <LOGICAL>", repeats=.false., &
654 default_l_val=.false., lone_keyword_l_val=.true.)
658 CALL keyword_create(keyword, __location__, name=
"MSD_PER_MOLKIND", &
659 description=
"Set up the calculation of the MSD for each molecule kind. "// &
660 "The position of the center of mass of the molecule is considered.", &
661 usage=
"MSD_PER_MOLKIND <LOGICAL>", repeats=.false., &
662 default_l_val=.false., lone_keyword_l_val=.true.)
666 CALL keyword_create(keyword, __location__, name=
"MSD_PER_REGION", &
667 description=
"Set up the calculation of the MSD for each defined region.", &
668 usage=
"MSD_PER_REGION <LOGICAL>", repeats=.false., &
669 default_l_val=.false., lone_keyword_l_val=.true.)
677 CALL keyword_create(keyword, __location__, name=
"DISPLACED_ATOM", &
678 description=
"Identify the atoms that moved from their initial "// &
679 "position of a distance larger than a given tolerance (see msd%displacement_tol).", &
680 usage=
"DISPLACED_ATOM <LOGICAL>", repeats=.false., &
681 default_l_val=.false., lone_keyword_l_val=.true.)
685 CALL keyword_create(keyword, __location__, name=
"displacement_tol", &
686 description=
"Lower limit to define displaced atoms", &
687 usage=
"DISPLACEMENT_TOL real", &
688 default_r_val=0._dp, n_var=1, unit_str=
'bohr')
692 END SUBROUTINE create_msd_section
699 SUBROUTINE create_msst_section(section)
704 cpassert(.NOT.
ASSOCIATED(section))
707 description=
"Parameters for Multi-Scale Shock Technique (MSST) "// &
708 "which simulate the effect of a steady planar shock on a unit cell. "// &
709 "Reed et. al. Physical Review Letters 90, 235503 (2003).", &
710 n_keywords=1, n_subsections=0, repeats=.false.)
714 description=
"Initial pressure", &
715 usage=
"PRESSURE real", &
716 default_r_val=0._dp, n_var=1, unit_str=
'bar')
721 description=
"Initial energy", &
722 usage=
"ENERGY real", &
723 default_r_val=0._dp, n_var=1, unit_str=
'hartree')
728 description=
"Initial volume", &
729 usage=
"VOLUME real", &
730 default_r_val=0._dp, n_var=1, unit_str=
'angstrom^3')
735 description=
"Effective cell mass", &
736 usage=
"CMASS real", &
737 default_r_val=0._dp, n_var=1, unit_str=
'au_m')
741 CALL keyword_create(keyword, __location__, name=
"VSHOCK", variants=(/
"V_SHOCK"/), &
742 description=
"Velocity shock", &
743 usage=
"VSHOCK real", &
744 default_r_val=0._dp, n_var=1, unit_str=
'm/s')
749 description=
"Damping coefficient for cell volume", &
750 usage=
"GAMMA real", &
752 default_r_val=0.0_dp)
756 END SUBROUTINE create_msst_section
762 SUBROUTINE create_shell_section(section)
768 cpassert(.NOT.
ASSOCIATED(section))
771 description=
"Parameters of shell model in adiabatic dynamics.", &
772 n_keywords=4, n_subsections=1, repeats=.false.)
774 NULLIFY (keyword, thermo_section)
777 description=
"Temperature in K used to control "// &
778 "the internal velocities of the core-shell motion ", &
779 usage=
"temperature 5.0", &
786 description=
"Maximum accepted temperature deviation"// &
787 " from the expected value, for the internal core-shell motion."// &
788 " If 0, no rescaling is performed", &
789 usage=
"temp_tol 0.0", default_r_val=0.0_dp, unit_str=
'K')
793 CALL keyword_create(keyword, __location__, name=
"nose_particle", &
794 description=
"If nvt or npt, the core and shell velocities are controlled "// &
795 "by the same thermostat used for the particle. This might favour heat exchange "// &
796 "and additional rescaling of the internal core-shell velocity is needed (TEMP_TOL)", &
797 default_l_val=.false., lone_keyword_l_val=.true.)
801 CALL keyword_create(keyword, __location__, name=
"DISPLACEMENT_SHELL_TOL", &
802 description=
"This keyword sets a maximum variation of the shell"// &
803 " core distance in each Cartesian direction."// &
804 " The maximum internal core-shell velocity is evaluated and"// &
805 " if it is too large to remain"// &
806 " within the assigned limit, the time step is rescaled accordingly,"// &
807 " and the first half step of the velocity verlet is repeated.", &
808 usage=
"DISPLACEMENT_SHELL_TOL <REAL>", default_r_val=100.0_dp, &
817 END SUBROUTINE create_shell_section
823 SUBROUTINE create_adiabatic_section(section)
827 TYPE(
section_type),
POINTER :: thermo_fast_section, thermo_slow_section
829 cpassert(.NOT.
ASSOCIATED(section))
831 CALL section_create(section, __location__, name=
"ADIABATIC_DYNAMICS", &
832 description=
"Parameters used in canonical adiabatic free energy sampling (CAFES).", &
833 n_keywords=5, n_subsections=2, repeats=.false., &
836 NULLIFY (keyword, thermo_fast_section, thermo_slow_section)
839 description=
"Temperature in K used to control "// &
840 "the fast degrees of freedom ", &
841 usage=
"temp_fast 5.0", &
848 description=
"Temperature in K used to control "// &
849 "the slow degrees of freedom ", &
850 usage=
"temp_slow 5.0", &
856 CALL keyword_create(keyword, __location__, name=
"temp_tol_fast", &
857 description=
"Maximum accepted temperature deviation"// &
858 " from the expected value, for the fast motion."// &
859 " If 0, no rescaling is performed", &
860 usage=
"temp_tol_fast 0.0", default_r_val=0.0_dp, unit_str=
'K')
864 CALL keyword_create(keyword, __location__, name=
"temp_tol_slow", &
865 description=
"Maximum accepted temperature deviation"// &
866 " from the expected value, for the slow motion."// &
867 " If 0, no rescaling is performed", &
868 usage=
"temp_tol_slow 0.0", default_r_val=0.0_dp, unit_str=
'K')
873 description=
"number of respa steps for fast degrees of freedom", &
874 repeats=.false., default_i_val=1)
886 END SUBROUTINE create_adiabatic_section
893 SUBROUTINE create_softening_section(section)
898 CALL section_create(section, __location__, name=
"VELOCITY_SOFTENING", &
899 description=
"A method to initialize the velocities along low-curvature " &
900 //
"directions in order to favors MD trajectories to cross rapidly over " &
901 //
"small energy barriers into neighboring basins. " &
902 //
"In each iteration the forces are calculated at a point y, which " &
903 //
"is slightly displaced from the current positions x in the direction " &
904 //
"of the original velocities v. The velocities are then updated with " &
905 //
"the force component F_t, which is perpendicular to N. " &
906 //
"N = v / |v|; y = x + delta * N; F_t = F(y) - ⟨ F(y) | N ⟩ * N; " &
907 //
"v' = v + alpha * F_t")
911 description=
"Number of softening iterations performed. " &
912 //
"Typical values are around 40 steps.", &
918 description=
"Displacement used to obtain y.", &
919 default_r_val=0.1_dp)
924 description=
"Mixing factor used for updating velocities.", &
925 default_r_val=0.15_dp)
929 END SUBROUTINE create_softening_section
939 SUBROUTINE create_thermal_region_section(section)
943 TYPE(
section_type),
POINTER :: print_key, region_section, subsection
945 cpassert(.NOT.
ASSOCIATED(section))
947 CALL section_create(section, __location__, name=
"thermal_region", &
948 description=
"Define regions where different initialization and control "// &
949 "of the temperature is used. When MOTION%MD%ENSEMBLE is set to LANGEVIN, "// &
950 "this section controls if the atoms defined inside and outside the "// &
951 "thermal regions should undergo Langevin MD or NVE Born-Oppenheimer MD. "// &
952 "The theory behind Langevin MD using different regions can be found in "// &
953 "articles by Kantorovitch et al. listed below.", &
955 n_keywords=0, n_subsections=1, repeats=.false.)
957 NULLIFY (region_section)
958 NULLIFY (keyword, subsection)
960 CALL keyword_create(keyword, __location__, name=
"force_rescaling", &
961 description=
"Control the rescaling ot the velocities in all the regions, "// &
962 "according to the temperature assigned to each reagion, when "// &
963 "RESTART_VELOCITY in EXT_RESTART is active.", &
964 default_l_val=.false., lone_keyword_l_val=.true.)
968 CALL keyword_create(keyword, __location__, name=
"do_langevin_default", &
969 description=
"If ENSEMBLE is set to LANGEVIN, controls whether the "// &
970 "atoms NOT defined in the thermal regions to undergo langevin MD "// &
971 "or not. If not, then the atoms will undergo NVE Born-Oppenheimer MD.", &
972 usage=
"do_langevin_default .FALSE.", &
973 default_l_val=.false., lone_keyword_l_val=.true.)
977 CALL section_create(region_section, __location__, name=
"DEFINE_REGION", &
978 description=
"This section provides the possibility to define arbitrary region ", &
979 n_keywords=3, n_subsections=0, repeats=.true.)
983 description=
"Specifies a list of atoms belonging to the region.", &
984 usage=
"LIST {integer} {integer} .. {integer}", &
985 repeats=.true., n_var=-1, type_of_var=
integer_t)
990 description=
"The temperature in K used to initialize the velocities "// &
991 "of the atoms in this region ", &
992 usage=
"temperature 5.0", &
999 description=
"Maximum accepted temperature deviation from the expected "// &
1000 "value for this region. If temp_tol=0 no rescaling is performed", &
1001 usage=
"temp_tol 0.0", &
1002 default_r_val=0.0_dp, unit_str=
'K')
1007 description=
"When ENSEMBLE is set to LANGEVIN, Controls whether "// &
1008 "the atoms in the thermal region should undergo Langevin MD. If "// &
1009 "not, then they will undergo NVE Born-Oppenheimer MD.", &
1010 usage=
"do_langevin .TRUE.", &
1011 default_l_val=.true., lone_keyword_l_val=.true.)
1015 CALL keyword_create(keyword, __location__, name=
"noisy_gamma_region", &
1016 description=
"Special imaginary Langevin Friction term"// &
1017 " for Langevin Dynamics with noisy forces for the atoms in this region."// &
1018 " When set, overrides the general value set by NOISY_GAMMA in the MOTION%MD%LANGEVIN section."// &
1019 " When unset for a defined region, the general NOISY_GAMMA value applies.", &
1020 citations=(/
kuhne2007/), usage=
"noisy_gamma_region 4.0E-5", &
1031 description=
"Collects all print_keys for thermal_regions", &
1032 n_keywords=1, n_subsections=0, repeats=.false.)
1035 description=
"Controls output of temperature per region.", &
1042 description=
"Controls output of information on which atoms "// &
1043 "underwent Langevin MD and which atoms did not.", &
1052 END SUBROUTINE create_thermal_region_section
1061 SUBROUTINE create_cascade_section(section)
1069 NULLIFY (subsection)
1070 cpassert(.NOT.
ASSOCIATED(section))
1073 description=
"Defines the parameters for the setup of a cascade simulation.", &
1079 name=
"_SECTION_PARAMETERS_", &
1080 description=
"Controls the activation of the CASCADE section.", &
1081 usage=
"&CASCADE on", &
1082 default_l_val=.false., &
1083 lone_keyword_l_val=.true.)
1088 description=
"Total energy transferred to the system during the cascade event.", &
1089 usage=
"ENERGY 20.0", &
1090 default_r_val=0.0_dp, &
1095 CALL section_create(subsection, __location__, name=
"ATOM_LIST", &
1096 description=
"Defines a list of atoms for which the initial velocities are modified", &
1101 CALL keyword_create(keyword, __location__, name=
"_DEFAULT_KEYWORD_", &
1102 description=
"Defines the list of atoms for which the velocities are modified. "// &
1103 "Each record consists of the atomic index, the velocity vector, and "// &
1104 "a weight to define which fraction of the total energy is assigned "// &
1105 "to the current atom: `Atomic_index v_x v_y v_z Weight`", &
1106 usage=
"{{Integer} {Real} {Real} {Real} {Real}}", &
1115 END SUBROUTINE create_cascade_section
1122 SUBROUTINE create_avgs_section(section)
1128 cpassert(.NOT.
ASSOCIATED(section))
1130 description=
"Controls the calculation of the averages during an MD run.", &
1131 n_keywords=1, n_subsections=1, repeats=.false.)
1132 NULLIFY (keyword, print_key, subsection)
1134 CALL keyword_create(keyword, __location__, name=
"_SECTION_PARAMETERS_", &
1135 description=
"Controls the calculations of the averages.", &
1136 usage=
"&AVERAGES T", default_l_val=.true., lone_keyword_l_val=.true.)
1140 CALL keyword_create(keyword, __location__, name=
"ACQUISITION_START_TIME", &
1141 description=
"Setup up the simulation time when the acquisition process to compute"// &
1142 " averages is started.", &
1143 usage=
"ACQUISITION_START_TIME <REAL>", &
1144 default_r_val=0.0_dp, unit_str=
'fs')
1148 CALL keyword_create(keyword, __location__, name=
"AVERAGE_COLVAR", &
1149 description=
"Switch for computing the averages of COLVARs.", &
1150 usage=
"AVERAGE_COLVAR <LOGICAL>", default_l_val=.false., &
1151 lone_keyword_l_val=.true.)
1156 description=
"Controls the output the averaged quantities", &
1162 CALL create_avgs_restart_section(subsection)
1165 END SUBROUTINE create_avgs_section
1172 SUBROUTINE create_avgs_restart_section(section)
1177 cpassert(.NOT.
ASSOCIATED(section))
1178 CALL section_create(section, __location__, name=
"RESTART_AVERAGES", &
1179 description=
"Stores information for restarting averages.", &
1180 n_keywords=1, n_subsections=1, repeats=.false.)
1183 CALL keyword_create(keyword, __location__, name=
"ITIMES_START", &
1184 description=
"TIME STEP starting the evaluation of averages", &
1185 usage=
"ITIMES_START <INTEGER>", type_of_var=
integer_t, n_var=1)
1190 description=
"CPU average", usage=
"AVECPU <REAL>", &
1191 type_of_var=
real_t, n_var=1)
1196 description=
"HUGONIOT average", usage=
"AVEHUGONIOT <REAL>", &
1197 type_of_var=
real_t, n_var=1)
1201 CALL keyword_create(keyword, __location__, name=
"AVETEMP_BARO", &
1202 description=
"BAROSTAT TEMPERATURE average", usage=
"AVETEMP_BARO <REAL>", &
1203 type_of_var=
real_t, n_var=1)
1208 description=
"POTENTIAL ENERGY average", usage=
"AVEPOT <REAL>", &
1209 type_of_var=
real_t, n_var=1)
1214 description=
"KINETIC ENERGY average", usage=
"AVEKIN <REAL>", &
1215 type_of_var=
real_t, n_var=1)
1220 description=
"TEMPERATURE average", usage=
"AVETEMP <REAL>", &
1221 type_of_var=
real_t, n_var=1)
1226 description=
"QM KINETIC ENERGY average in QMMM runs", usage=
"AVEKIN_QM <REAL>", &
1227 type_of_var=
real_t, n_var=1)
1232 description=
"QM TEMPERATURE average in QMMM runs", usage=
"AVETEMP_QM <REAL>", &
1233 type_of_var=
real_t, n_var=1)
1238 description=
"VOLUME average", usage=
"AVEVOL <REAL>", &
1239 type_of_var=
real_t, n_var=1)
1244 description=
"CELL VECTOR A average", usage=
"AVECELL_A <REAL>", &
1245 type_of_var=
real_t, n_var=1)
1250 description=
"CELL VECTOR B average", usage=
"AVECELL_B <REAL>", &
1251 type_of_var=
real_t, n_var=1)
1256 description=
"CELL VECTOR C average", usage=
"AVECELL_C <REAL>", &
1257 type_of_var=
real_t, n_var=1)
1262 description=
"ALPHA cell angle average", usage=
"AVEALPHA <REAL>", &
1263 type_of_var=
real_t, n_var=1)
1268 description=
"BETA cell angle average", usage=
"AVEBETA <REAL>", &
1269 type_of_var=
real_t, n_var=1)
1274 description=
"GAMMA cell angle average", usage=
"AVEGAMMA <REAL>", &
1275 type_of_var=
real_t, n_var=1)
1280 description=
"CONSTANT ENERGY average", usage=
"AVE_ECONS <REAL>", &
1281 type_of_var=
real_t, n_var=1)
1286 description=
"PRESSURE average", usage=
"AVE_PRESS <REAL>", &
1287 type_of_var=
real_t, n_var=1)
1292 description=
"P_{XX} average", usage=
"AVE_PXX <REAL>", &
1293 type_of_var=
real_t, n_var=1)
1298 description=
"PV VIRIAL average", usage=
"AVE_PV_VIR <REAL> .. <REAL>", &
1299 type_of_var=
real_t, n_var=9)
1304 description=
"PV TOTAL average", usage=
"AVE_PV_TOT <REAL> .. <REAL>", &
1305 type_of_var=
real_t, n_var=9)
1310 description=
"PV KINETIC average", usage=
"AVE_PV_KIN <REAL> .. <REAL>", &
1311 type_of_var=
real_t, n_var=9)
1315 CALL keyword_create(keyword, __location__, name=
"AVE_PV_CNSTR", &
1316 description=
"PV CONSTRAINTS average", usage=
"AVE_PV_CNSTR <REAL> .. <REAL>", &
1317 type_of_var=
real_t, n_var=9)
1322 description=
"PV XC average", usage=
"AVE_PV_XC <REAL> .. <REAL>", &
1323 type_of_var=
real_t, n_var=9)
1327 CALL keyword_create(keyword, __location__, name=
"AVE_PV_FOCK_4C", &
1328 description=
"PV XC average", usage=
"AVE_PV_FOCK_4C <REAL> .. <REAL>", &
1329 type_of_var=
real_t, n_var=9)
1334 description=
"COLVARS averages", usage=
"AVE_COLVARS <REAL> .. <REAL>", &
1335 type_of_var=
real_t, n_var=-1)
1340 description=
"METRIC TENSOR averages", usage=
"AVE_MMATRIX <REAL> .. <REAL>", &
1341 type_of_var=
real_t, n_var=-1)
1344 END SUBROUTINE create_avgs_restart_section
1351 SUBROUTINE create_vib_init_section(section)
1356 cpassert(.NOT.
ASSOCIATED(section))
1357 CALL section_create(section, __location__, name=
"INITIAL_VIBRATION", &
1358 description=
"Controls the set of parameters for MD initialisation "// &
1359 "based on vibration analysis data. The starting atomic coordinates "// &
1360 "should be based on the relaxed positions obtained from a previous "// &
1361 "geometry/cell optimisation calculation, and the vibrational "// &
1362 "frequencies and displacements data should be obtained from a "// &
1363 "vibrational analysis calculation done based on the relaxed "// &
1364 "coordinates. The MD initialisation process expects the user has "// &
1365 "performed both geometry optimisation and vibrational analysis "// &
1366 "before hand, and won't perform those calculations automatically ", &
1368 n_keywords=0, n_subsections=1, repeats=.false.)
1370 CALL keyword_create(keyword, __location__, name=
"VIB_EIGS_FILE_NAME", &
1371 description=
"The file name of vibrational frequency (eigenvalue) "// &
1372 "and displacement (eigenvector) data calculated from the a "// &
1373 "vibrational analysis calculation done previously. This file must "// &
1374 "be the same unformatted binary file as referred to by "// &
1375 "VIBRATIONAL_ANALYSIS%PRINT%CARTESIAN_EIGS keyword. If this keyword "// &
1376 "is not explicitly defined by the user, then the default file "// &
1377 "name of: <project_name>-<CARTESIAN_EIGS_FILENAME>.eig will be used", &
1378 usage=
"VIB_EIGS_FILE_NAME <FILENAME>", &
1384 description=
"Controls the initial ratio of potential and kinetic "// &
1385 "contribution to the total energy. The contribution is determined by "// &
1386 "COS**2(2*pi*PHASE) for potential energy, and SIN**2(2*pi*PHASE) "// &
1387 "for kinetic energy. If PHASE is negative, then for each vibration "// &
1388 "mode the phase is determined randomly. Otherwise, PHASE must be "// &
1389 "between 0.0 and 1.0 and will be the same for all vibration modes. "// &
1390 "If value > 1.0 it will just be treated as 1.0. "// &
1391 "For example, setting PHASE = 0.25 would set all modes to "// &
1392 "begin with entirely kinetic energy --- in other words, the initial "// &
1393 "atomic positions will remain at their optimised location", &
1394 default_r_val=-1.0_dp, &
1395 usage=
"PHASE <REAL>")
1398 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
Defines the basic variable types.
integer, parameter, public dp
initialization of the reftraj structure used to analyse previously generated trajectories
integer, parameter, public reftraj_eval_energy
integer, parameter, public reftraj_eval_energy_forces
integer, parameter, public reftraj_eval_none
Utilities for string manipulations.