46 #include "../base/base_uses.f90"
51 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'simpar_methods'
64 TYPE(simpar_type),
POINTER :: simpar
65 TYPE(section_vals_type),
POINTER :: motion_section, md_section
67 CHARACTER(LEN=default_path_length) :: filename
69 REAL(kind=
dp) :: tmp_r1, tmp_r2, tmp_r3
70 TYPE(cp_logger_type),
POINTER :: logger
71 TYPE(enumeration_type),
POINTER :: enum
72 TYPE(keyword_type),
POINTER :: keyword
73 TYPE(section_type),
POINTER :: section
74 TYPE(section_vals_type),
POINTER :: print_key
76 NULLIFY (logger, print_key, enum, keyword, section)
80 CALL read_md_low(simpar, motion_section, md_section)
81 IF (iw > 0)
WRITE (unit=iw, fmt=
"(A)")
""
86 IF (simpar%noisy_gamma > 0.0_dp)
CALL cite_reference(
kuhne2007)
87 IF (simpar%shadow_gamma > 0.0_dp)
CALL cite_reference(
rengaraj2020)
89 simpar%var_w = 2.0_dp*simpar%temp_ext*simpar%dt*(simpar%gamma + simpar%noisy_gamma)
91 WRITE (unit=iw, fmt=
"(T2,A)") &
92 "LD| Parameters for Langevin dynamics"
96 WRITE (unit=iw, fmt=
"(T2,A,T71,ES10.3)") &
97 "LD| Gamma [1/fs] ", tmp_r1, &
98 "LD| Noisy Gamma [1/fs]", tmp_r2, &
99 "LD| Shadow Gamma [1/fs]", tmp_r3, &
100 "LD| Variance [a.u.]", simpar%var_w, &
112 WRITE (iw,
'(T2,A)') &
113 'MD_PAR| Molecular dynamics protocol (MD input parameters)'
114 WRITE (iw,
'(T2,A,T61,A20)') &
115 'MD_PAR| Ensemble type', adjustr(trim(
enum_i2c(enum, simpar%ensemble)))
116 WRITE (iw,
'(T2,A,T61,I20)') &
117 'MD_PAR| Number of time steps', simpar%nsteps
118 IF (simpar%variable_dt)
THEN
119 WRITE (iw,
'(T2,A)') &
120 'MD_PAR| Variable time step is activated'
122 WRITE (iw,
'(T2,A,T61,F20.6)') &
123 'MD_PAR| Maximum time step [fs]', tmp_r1
125 WRITE (iw,
'(T2,A,T61,F20.6)') &
126 'MD_PAR| Maximum atomic displacement permitted [A]', tmp_r1
129 WRITE (iw,
'(T2,A,T61,F20.6)') &
130 'MD_PAR| Time step [fs]', tmp_r1
133 WRITE (iw,
'(T2,A,T61,F20.6)') &
134 'MD_PAR| Temperature [K]', tmp_r1
136 WRITE (iw,
'(T2,A,T61,F20.6)') &
137 'MD_PAR| Temperature tolerance [K]', tmp_r1
139 IF (simpar%annealing)
THEN
140 WRITE (iw,
'(T2,A,T61,F20.6)') &
141 'MD_PAR| Annealing ion factor', simpar%f_annealing
145 simpar%annealing_cell)
THEN
146 WRITE (iw,
'(T2,A,T61,F20.6)') &
147 'MD_PAR| Annealing cell factor', simpar%f_annealing_cell
155 WRITE (iw,
'(T2,A,T61,F20.6)') &
156 'MD_PAR| Pressure [bar]', tmp_r1
158 WRITE (iw,
'(T2,A,T61,F20.6)') &
159 'MD_PAR| Barostat time constant [fs]', tmp_r1
164 WRITE (iw,
'(T2,A)') &
165 'MD_PAR| Simulation using the isokinetic ensemble'
167 IF (simpar%constraint)
THEN
168 WRITE (iw,
'(T2,A)') &
169 'MD_PAR| Constraints activated'
170 WRITE (iw,
'(T2,A,T61,F20.6)') &
171 'MD_PAR| Tolerance for shake', simpar%shake_tol
176 WRITE (iw,
'(T2,A,T63,I10,A)') &
177 'MD_PAR| Print MD information every', iprint,
' step(s)'
178 WRITE (iw,
'(T2,A,T22,A,T71,A10)') &
179 'MD_PAR| File type',
'Print frequency [steps]',
'File names'
184 extension=
".xyz", middle_name=
"pos", my_local=.false.)
185 WRITE (iw,
'(T2,A,T22,I10,T33,A48)') &
186 'MD_PAR| Coordinates', iprint, adjustr(trim(filename))
199 extension=
".cell", my_local=.false.)
200 WRITE (iw,
'(T2,A,T22,I10,T33,A48)') &
201 'MD_PAR| Cell', iprint, adjustr(trim(filename))
207 extension=
".xyz", middle_name=
"vel", my_local=.false.)
208 WRITE (iw,
'(T2,A,T22,I10,T33,A48)') &
209 'MD_PAR| Velocities', iprint, adjustr(trim(filename))
214 extension=
".ener", my_local=.false.)
215 WRITE (iw,
'(T2,A,T22,I10,T33,A48)') &
216 'MD_PAR| Energies', iprint, adjustr(trim(filename))
221 extension=
".restart", my_local=.false.)
222 WRITE (iw,
'(T2,A,T22,I10,T33,A48)') &
223 'MD_PAR| Dump', iprint, adjustr(trim(filename))
227 WRITE (iw,
'(T2,A)')
'SHOCK| Uniaxial shock parameters: '
229 WRITE (iw,
'(T2,A,T61,F20.6)') &
230 'SHOCK| Shock velocity [m/s]', tmp_r1
232 WRITE (iw,
'(T2,A,T61,F20.6)') &
233 'SHOCK| Damping coefficient [1/fs]', tmp_r1
235 WRITE (iw,
'(T2,A,T61,F20.6)') &
236 'SHOCK| Pressure [bar]', tmp_r1
237 WRITE (iw,
'(T2,A,T61,F20.6)') &
238 'SHOCK| Barostat mass [a.u.]', simpar%cmass
241 IF (simpar%temp_tol > 0.0_dp)
THEN
242 CALL cp_warn(__location__, &
243 "A temperature tolerance (TEMP_TOL) is used during the MD. "// &
244 "Due to the velocity rescaling algorithm jumps may appear in the conserved quantity.")
247 IF (simpar%annealing)
THEN
252 CALL cp_abort(__location__, &
253 "Annealing of the ions has been required "// &
254 "even if the thermostat is active (nvt or npt_i or npt_ia or npt_f) "// &
255 "These two methods to control the temperature act one against the other.")
259 IF (simpar%variable_dt)
THEN
262 simpar%do_respa)
THEN
265 "The variable timestep has been required, however "// &
266 "this option is not available either with the Langevin ensemble or with the multiple timestep schme. "// &
267 "The run will proceed with constant timestep, as read from input.")
273 "PRINT%PROGRAM_RUN_INFO")
284 SUBROUTINE read_md_low(simpar, motion_section, md_section)
285 TYPE(simpar_type),
POINTER :: simpar
286 TYPE(section_vals_type),
POINTER :: motion_section, md_section
289 TYPE(section_vals_type),
POINTER :: tmp_section
291 NULLIFY (tmp_section)
299 CALL section_vals_val_get(md_section,
"SCALE_TEMP_KIND", l_val=simpar%scale_temperature_per_kind)
300 CALL section_vals_val_get(md_section,
"ANNEALING", r_val=simpar%f_annealing, explicit=simpar%annealing)
302 explicit=simpar%annealing_cell)
303 CALL section_vals_val_get(md_section,
"TEMPERATURE_ANNEALING", r_val=simpar%f_temperature_annealing, &
304 explicit=simpar%temperature_annealing)
306 explicit=simpar%variable_dt)
309 i_val=simpar%initialization_method)
311 simpar%dt_fact = 1.0_dp
321 IF (simpar%constraint)
THEN
323 IF (simpar%shake_tol <= epsilon(0.0_dp)*1000.0_dp) &
324 CALL cp_warn(__location__, &
325 "Shake tolerance lower than 1000*EPSILON, where EPSILON is the machine precision. "// &
326 "This may lead to numerical problems. Setting up shake_tol to 1000*EPSILON!")
327 simpar%shake_tol = max(epsilon(0.0_dp)*1000.0_dp, simpar%shake_tol)
330 IF (simpar%roll_tol <= epsilon(0.0_dp)*1000.0_dp) &
331 CALL cp_warn(__location__, &
332 "Roll tolerance lower than 1000*EPSILON, where EPSILON is the machine precision. "// &
333 "This may lead to numerical problems. Setting up roll_tol to 1000*EPSILON!")
334 simpar%roll_tol = max(epsilon(0.0_dp)*1000.0_dp, simpar%roll_tol)
348 SELECT CASE (simpar%ensemble)
360 simpar%multi_time_switch = simpar%do_respa
369 simpar%variable_dt = simpar%variable_dt .OR. explicit
383 END SUBROUTINE read_md_low
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public rengaraj2020
integer, save, public kuhne2007
integer, save, public ricci2003
integer, save, public minary2003
integer, save, public evans1983
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
character(len=default_path_length) function, public cp_print_key_generate_filename(logger, print_key, middle_name, extension, my_local)
Utility function that returns a unit number to write the print key. Might open a file with a unique f...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_path_length
Methods for storing MD parameters type.
subroutine, public read_md_section(simpar, motion_section, md_section)
Reads the MD section and setup the simulation parameters type.
Type for storing MD parameters.