(git:495eafe)
Loading...
Searching...
No Matches
input_cp2k_thermostats.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!> 10.2005 split input_cp2k into smaller modules [fawzi]
11!> \author teo & fawzi
12! **************************************************************************************************
14 USE bibliography, ONLY: bussi2007,&
17 jones2011,&
18 nose1984a,&
23 USE cp_units, ONLY: cp_unit_to_cp2k
24 USE input_constants, ONLY: &
37 USE input_val_types, ONLY: char_t,&
38 integer_t,&
39 real_t
40 USE kinds, ONLY: dp
41 USE string_utilities, ONLY: s2a
42#include "./base/base_uses.f90"
43
44 IMPLICIT NONE
45 PRIVATE
46
47 LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
48 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_thermostats'
49
50 PUBLIC :: create_thermostat_section, &
53 create_coord_section, &
55 create_velocity_section, &
58
59!***
60CONTAINS
61! **************************************************************************************************
62!> \brief Specifies parameter for thermostat for constant temperature ensembles
63!> \param section will contain the coeff section
64!> \param coupled_thermostat ...
65!> \author teo [tlaino] - University of Zurich - 09.2007
66! **************************************************************************************************
67 SUBROUTINE create_thermo_slow_section(section, coupled_thermostat)
68 TYPE(section_type), POINTER :: section
69 LOGICAL, INTENT(IN), OPTIONAL :: coupled_thermostat
70
71 LOGICAL :: my_coupled_thermostat
72 TYPE(keyword_type), POINTER :: keyword
73 TYPE(section_type), POINTER :: nose_section, region_section
74
75 cpassert(.NOT. ASSOCIATED(section))
76 my_coupled_thermostat = .false.
77 IF (PRESENT(coupled_thermostat)) my_coupled_thermostat = coupled_thermostat
78 NULLIFY (nose_section, region_section)
79
80 CALL section_create(section, __location__, name="THERMOSTAT_SLOW", &
81 description="Specify thermostat type and parameters controlling the thermostat.", &
82 n_keywords=1, n_subsections=0, repeats=.false.)
83 NULLIFY (keyword)
84
85 IF (.NOT. my_coupled_thermostat) THEN
86 CALL keyword_create(keyword, __location__, name="TYPE", &
87 description="Specify the thermostat used for the constant temperature ensembles.", &
88 usage="TYPE NOSE", &
89 default_i_val=do_thermo_nose, &
90 enum_c_vals=s2a("NOSE"), &
91 enum_i_vals=[do_thermo_nose], &
92 enum_desc=s2a("Uses only the Nose-Hoover thermostat."))
93 CALL section_add_keyword(section, keyword)
94 CALL keyword_release(keyword)
95
96 CALL keyword_create(keyword, __location__, name="REGION", &
97 description="Determines the defined region for slow thermostat", &
98 usage="REGION (GLOBAL||MOLECULE||MASSIVE||DEFINED||NONE)", &
99 enum_c_vals=s2a("GLOBAL", "MOLECULE", "MASSIVE", "DEFINED", "NONE"), &
100 enum_i_vals=[do_region_global, do_region_molecule, &
102 default_i_val=do_region_global)
103 CALL section_add_keyword(section, keyword)
104 CALL keyword_release(keyword)
105
106 CALL create_region_section(region_section, "slow thermostat")
107 CALL section_add_subsection(section, region_section)
108 CALL section_release(region_section)
109 ELSE
110 CALL keyword_create(keyword, __location__, name="TYPE", &
111 description="Specify the thermostat used for the constant temperature ensembles.", &
112 usage="thermostat NOSE", &
113 default_i_val=do_thermo_same_as_part, &
114 enum_c_vals=s2a("SAME_AS_PARTICLE", "NOSE", "CSVR"), &
116 enum_desc=s2a("Use the same kind of thermostat used for particles.", &
117 "Uses the Nose-Hoover thermostat.", &
118 "Uses the canonical sampling through velocity rescaling."))
119 CALL section_add_keyword(section, keyword)
120 CALL keyword_release(keyword)
121 END IF
122
123 CALL create_nose_section(nose_section)
124 CALL section_add_subsection(section, nose_section)
125 CALL section_release(nose_section)
126
127 ! Print Section
128! CALL create_print_section(subsection)
129! CALL section_add_subsection(section, subsection)
130! CALL section_release(subsection)
131
132 END SUBROUTINE create_thermo_slow_section
133
134! **************************************************************************************************
135!> \brief Specifies parameter for thermostat for constant temperature ensembles
136!> \param section will contain the coeff section
137!> \param coupled_thermostat ...
138!> \author teo [tlaino] - University of Zurich - 09.2007
139! **************************************************************************************************
140 SUBROUTINE create_thermo_fast_section(section, coupled_thermostat)
141 TYPE(section_type), POINTER :: section
142 LOGICAL, INTENT(IN), OPTIONAL :: coupled_thermostat
143
144 LOGICAL :: my_coupled_thermostat
145 TYPE(keyword_type), POINTER :: keyword
146 TYPE(section_type), POINTER :: nose_section, region_section
147
148 cpassert(.NOT. ASSOCIATED(section))
149 my_coupled_thermostat = .false.
150 IF (PRESENT(coupled_thermostat)) my_coupled_thermostat = coupled_thermostat
151 NULLIFY (nose_section, region_section)
152
153 CALL section_create(section, __location__, name="THERMOSTAT_FAST", &
154 description="Specify thermostat type and parameters controlling the thermostat.", &
155 n_keywords=1, n_subsections=0, repeats=.false.)
156 NULLIFY (keyword)
157
158 IF (.NOT. my_coupled_thermostat) THEN
159 CALL keyword_create(keyword, __location__, name="TYPE", &
160 description="Specify the thermostat used for the constant temperature ensembles.", &
161 usage="TYPE NOSE", &
162 default_i_val=do_thermo_nose, &
163 enum_c_vals=s2a("NOSE"), &
164 enum_i_vals=[do_thermo_nose], &
165 enum_desc=s2a("Uses only the Nose-Hoover thermostat."))
166 CALL section_add_keyword(section, keyword)
167 CALL keyword_release(keyword)
168
169 CALL keyword_create(keyword, __location__, name="REGION", &
170 description="Determines the defined region for fast thermostat", &
171 usage="REGION (GLOBAL||MOLECULE||MASSIVE||DEFINED||NONE)", &
172 enum_c_vals=s2a("GLOBAL", "MOLECULE", "MASSIVE", "DEFINED", "NONE"), &
173 enum_i_vals=[do_region_global, do_region_molecule, &
175 default_i_val=do_region_global)
176 CALL section_add_keyword(section, keyword)
177 CALL keyword_release(keyword)
178
179 CALL create_region_section(region_section, "fast thermostat")
180 CALL section_add_subsection(section, region_section)
181 CALL section_release(region_section)
182 ELSE
183 CALL keyword_create(keyword, __location__, name="TYPE", &
184 description="Specify the thermostat used for the constant temperature ensembles.", &
185 usage="thermostat NOSE", &
186 default_i_val=do_thermo_same_as_part, &
187 enum_c_vals=s2a("SAME_AS_PARTICLE", "NOSE", "CSVR"), &
189 enum_desc=s2a("Use the same kind of thermostat used for particles.", &
190 "Uses the Nose-Hoover thermostat.", &
191 "Uses the canonical sampling through velocity rescaling."))
192 CALL section_add_keyword(section, keyword)
193 CALL keyword_release(keyword)
194 END IF
195
196 CALL create_nose_section(nose_section)
197 CALL section_add_subsection(section, nose_section)
198 CALL section_release(nose_section)
199
200 ! Print Section
201! CALL create_print_section(subsection)
202! CALL section_add_subsection(section, subsection)
203! CALL section_release(subsection)
204
205 END SUBROUTINE create_thermo_fast_section
206
207! **************************************************************************************************
208!> \brief Specifies parameter for thermostat for constant temperature ensembles
209!> \param section will contain the coeff section
210!> \param coupled_thermostat ...
211!> \author teo [tlaino] - University of Zurich - 09.2007
212! **************************************************************************************************
213 SUBROUTINE create_thermostat_section(section, coupled_thermostat)
214 TYPE(section_type), POINTER :: section
215 LOGICAL, INTENT(IN), OPTIONAL :: coupled_thermostat
216
217 LOGICAL :: my_coupled_thermostat
218 TYPE(keyword_type), POINTER :: keyword
219 TYPE(section_type), POINTER :: al_section, csvr_section, gle_section, &
220 nose_section, region_section, &
221 subsection
222
223 cpassert(.NOT. ASSOCIATED(section))
224 my_coupled_thermostat = .false.
225 IF (PRESENT(coupled_thermostat)) my_coupled_thermostat = coupled_thermostat
226 NULLIFY (csvr_section, gle_section, al_section, nose_section, subsection, region_section)
227
228 CALL section_create(section, __location__, name="THERMOSTAT", &
229 description="Specify thermostat type and parameters controlling the thermostat.", &
230 n_keywords=1, n_subsections=0, repeats=.false.)
231 NULLIFY (keyword)
232
233 IF (.NOT. my_coupled_thermostat) THEN
234 CALL keyword_create(keyword, __location__, name="TYPE", &
235 description="Specify the thermostat used for the constant temperature ensembles.", &
236 usage="TYPE NOSE", &
237 default_i_val=do_thermo_nose, &
238 enum_c_vals=s2a("NOSE", "CSVR", "GLE", "AD_LANGEVIN"), &
239 enum_i_vals=[do_thermo_nose, &
241 enum_desc=s2a("Uses the Nose-Hoover thermostat.", &
242 "Uses the canonical sampling through velocity rescaling.", &
243 "Uses GLE thermostat", &
244 "Uses adaptive-Langevin thermostat"))
245 CALL section_add_keyword(section, keyword)
246 CALL keyword_release(keyword)
247
248 CALL keyword_create(keyword, __location__, name="REGION", &
249 description="Determines the region each thermostat is attached to.", &
250 usage="REGION (GLOBAL|MOLECULE|MASSIVE|DEFINED|THERMAL|NONE)", &
251 enum_c_vals=s2a("GLOBAL", "MOLECULE", "MASSIVE", "DEFINED", "THERMAL", "NONE"), &
254 enum_desc=s2a("Apply one thermostat to the whole system (default)", &
255 "Apply one thermostat to each molecule kind", &
256 "Apply one thermostat to each degree of freedom", &
257 "Apply one thermostat to each defined region from THERMOSTAT/DEFINE_REGION", &
258 "Apply one thermostat to each defined region from THERMAL_REGION/DEFINE_REGION", &
259 "No thermostat is applied"), &
260 default_i_val=do_region_global)
261 CALL section_add_keyword(section, keyword)
262 CALL keyword_release(keyword)
263
264 CALL create_region_section(region_section, "thermostat")
265 CALL section_add_subsection(section, region_section)
266 CALL section_release(region_section)
267 ELSE
268 CALL keyword_create(keyword, __location__, name="TYPE", &
269 description="Specify the thermostat used for the constant temperature ensembles.", &
270 usage="TYPE NOSE", &
271 default_i_val=do_thermo_same_as_part, &
272 enum_c_vals=s2a("SAME_AS_PARTICLE", "NOSE", "CSVR"), &
274 enum_desc=s2a("Use the same kind of thermostat used for particles.", &
275 "Uses the Nose-Hoover thermostat.", &
276 "Uses the canonical sampling through velocity rescaling."))
277 CALL section_add_keyword(section, keyword)
278 CALL keyword_release(keyword)
279 END IF
280
281 CALL create_nose_section(nose_section)
282 CALL section_add_subsection(section, nose_section)
283 CALL section_release(nose_section)
284
285 CALL create_csvr_section(csvr_section)
286 CALL section_add_subsection(section, csvr_section)
287 CALL section_release(csvr_section)
288
289 CALL create_gle_section(gle_section)
290 CALL section_add_subsection(section, gle_section)
291 CALL section_release(gle_section)
292
293 CALL create_al_section(al_section)
294 CALL section_add_subsection(section, al_section)
295 CALL section_release(al_section)
296
297 ! Print Section
298 CALL create_print_section(subsection)
299 CALL section_add_subsection(section, subsection)
300 CALL section_release(subsection)
301
302 END SUBROUTINE create_thermostat_section
303
304! **************************************************************************************************
305!> \brief Creates print section for thermostat section
306!> \param section ...
307!> \author teo [tlaino] - University of Zurich - 02.2008
308! **************************************************************************************************
309 SUBROUTINE create_print_section(section)
310 TYPE(section_type), POINTER :: section
311
312 TYPE(section_type), POINTER :: print_key
313
314 cpassert(.NOT. ASSOCIATED(section))
315 NULLIFY (print_key)
316 CALL section_create(section, __location__, name="PRINT", &
317 description="Collects all print_keys for thermostat", &
318 n_keywords=1, n_subsections=0, repeats=.false.)
319
320 CALL cp_print_key_section_create(print_key, __location__, "THERMOSTAT_INFO", &
321 description="Controls output information of the corresponding thermostat.", &
322 print_level=low_print_level, common_iter_levels=1, &
323 filename="__STD_OUT__")
324 CALL section_add_subsection(section, print_key)
325 CALL section_release(print_key)
326
327 CALL cp_print_key_section_create(print_key, __location__, "TEMPERATURE", &
328 description="Controls the output of the temperatures of the regions corresponding to "// &
329 "the present thermostat", &
330 print_level=high_print_level, common_iter_levels=1, &
331 filename="")
332 CALL section_add_subsection(section, print_key)
333 CALL section_release(print_key)
334
335 CALL cp_print_key_section_create(print_key, __location__, "ENERGY", &
336 description="Controls the output of kinetic energy, and potential energy "// &
337 "of the defined thermostat.", print_level=high_print_level, common_iter_levels=1, &
338 filename="")
339 CALL section_add_subsection(section, print_key)
340 CALL section_release(print_key)
341 END SUBROUTINE create_print_section
342
343! **************************************************************************************************
344!> \brief Creates a section to arbitrary define a region to thermostat
345!> \param section will contain the coeff section
346!> \param label ...
347!> \author teo
348! **************************************************************************************************
349 SUBROUTINE create_region_section(section, label)
350 TYPE(section_type), POINTER :: section
351 CHARACTER(LEN=*), INTENT(IN) :: label
352
353 TYPE(keyword_type), POINTER :: keyword
354
355 cpassert(.NOT. ASSOCIATED(section))
356
357 CALL section_create(section, __location__, name="DEFINE_REGION", &
358 description="This section provides the possibility to define arbitrary region "// &
359 "for the "//trim(label)//".", &
360 n_keywords=1, n_subsections=0, repeats=.true.)
361
362 NULLIFY (keyword)
363 CALL keyword_create(keyword, __location__, name="LIST", &
364 description="Specifies a list of atoms to thermostat.", &
365 usage="LIST {integer} {integer} .. {integer}", repeats=.true., &
366 n_var=-1, type_of_var=integer_t)
367 CALL section_add_keyword(section, keyword)
368 CALL keyword_release(keyword)
369
370 CALL keyword_create(keyword, __location__, name="MOLNAME", &
371 variants=["SEGNAME"], &
372 description="Specifies the name of the molecules to thermostat", &
373 usage="MOLNAME WAT MEOH", repeats=.true., &
374 n_var=-1, type_of_var=char_t)
375 CALL section_add_keyword(section, keyword)
376 CALL keyword_release(keyword)
377
378 CALL keyword_create(keyword, __location__, name="MM_SUBSYS", &
379 variants=["PROTEIN"], &
380 description="In a QM/MM run all MM atoms are specified as a whole ensemble to be thermostated", &
381 usage="MM_SUBSYS (NONE|ATOMIC|MOLECULAR)", &
382 enum_c_vals=s2a("NONE", "ATOMIC", "MOLECULAR"), &
384 enum_desc=s2a("Thermostat nothing", &
385 "Only the MM atoms itself", &
386 "The full molecule/residue that contains a MM atom"), &
387 default_i_val=do_constr_none, repeats=.false.)
388 CALL section_add_keyword(section, keyword)
389 CALL keyword_release(keyword)
390
391 CALL keyword_create(keyword, __location__, name="QM_SUBSYS", &
392 description="In a QM/MM run all QM atoms are specified as a whole ensemble to be thermostated", &
393 usage="QM_SUBSYS (NONE|ATOMIC|MOLECULAR)", &
394 enum_c_vals=s2a("NONE", "ATOMIC", "MOLECULAR"), &
395 enum_desc=s2a("Thermostat nothing", &
396 "Only the QM atoms itself", &
397 "The full molecule/residue that contains a QM atom"), &
399 default_i_val=do_constr_none, repeats=.false.)
400 CALL section_add_keyword(section, keyword)
401 CALL keyword_release(keyword)
402
403 END SUBROUTINE create_region_section
404
405! **************************************************************************************************
406!> \brief ...
407!> \param section will contain the ewald section
408!> \author gloria
409! **************************************************************************************************
410 SUBROUTINE create_nose_section(section)
411 TYPE(section_type), POINTER :: section
412
413 TYPE(keyword_type), POINTER :: keyword
414 TYPE(section_type), POINTER :: subsection
415
416 cpassert(.NOT. ASSOCIATED(section))
417 CALL section_create(section, __location__, name="nose", &
418 description="paramameters of the Nose Hoover thermostat chain", &
419 citations=[nose1984a, nose1984b])
420
421 NULLIFY (keyword, subsection)
422 CALL keyword_create(keyword, __location__, name="length", &
423 description="length of the Nose-Hoover chain", usage="length integer", &
424 default_i_val=3)
425 CALL section_add_keyword(section, keyword)
426 CALL keyword_release(keyword)
427
428 CALL keyword_create(keyword, __location__, name="Yoshida", &
429 description="order of the yoshida integrator used for the thermostat", &
430 usage="Yoshida integer", &
431 default_i_val=3)
432 CALL section_add_keyword(section, keyword)
433 CALL keyword_release(keyword)
434
435 CALL keyword_create(keyword, __location__, name="timecon", &
436 description="timeconstant of the thermostat chain", &
437 usage="timecon <REAL>", &
438 default_r_val=cp_unit_to_cp2k(1000.0_dp, "fs"), &
439 unit_str="fs")
440 CALL section_add_keyword(section, keyword)
441 CALL keyword_release(keyword)
442
443 CALL keyword_create(keyword, __location__, name="mts", &
444 variants=s2a("multiple_time_steps", "mult_t_steps"), &
445 description="number of multiple timesteps to be used for the NoseHoover chain", &
446 usage="mts integer", &
447 default_i_val=2)
448 CALL section_add_keyword(section, keyword)
449 CALL keyword_release(keyword)
450
451 CALL create_coord_section(subsection, "NOSE HOOVER")
452 CALL section_add_subsection(section, subsection)
453 CALL section_release(subsection)
454
455 CALL create_velocity_section(subsection, "NOSE HOOVER")
456 CALL section_add_subsection(section, subsection)
457 CALL section_release(subsection)
458
459 CALL create_mass_section(subsection, "NOSE HOOVER")
460 CALL section_add_subsection(section, subsection)
461 CALL section_release(subsection)
462
463 CALL create_force_section(subsection, "NOSE HOOVER")
464 CALL section_add_subsection(section, subsection)
465 CALL section_release(subsection)
466
467 END SUBROUTINE create_nose_section
468
469! **************************************************************************************************
470!> \brief ...
471!> \param section ...
472!> \param
473!> \author
474! **************************************************************************************************
475 SUBROUTINE create_gle_section(section)
476 TYPE(section_type), POINTER :: section
477
478 TYPE(keyword_type), POINTER :: keyword
479 TYPE(section_type), POINTER :: subsection
480
481 cpassert(.NOT. ASSOCIATED(section))
482 CALL section_create(section, __location__, name="GLE", &
483 description="paramameters of the gle thermostat. This section can be generated "// &
484 "from <https://gle4md.org/index.html?page=matrix>.", &
485 citations=[ceriotti2009, ceriotti2009b])
486
487 NULLIFY (keyword, subsection)
488
489 CALL keyword_create(keyword, __location__, name="NDIM", &
490 description="Size of the gle matrix", usage="NDIM 6", &
491 default_i_val=5)
492 CALL section_add_keyword(section, keyword)
493 CALL keyword_release(keyword)
494
495 CALL keyword_create(keyword, __location__, name="A_SCALE", &
496 description="scaling factor for matrix A (for generic matrix A, depends "// &
497 "on the characteristic frequency of the system).", usage="A_SCALE 0.5", &
498 default_r_val=cp_unit_to_cp2k(1.0_dp, "ps^-1"), unit_str="ps^-1")
499 CALL section_add_keyword(section, keyword)
500 CALL keyword_release(keyword)
501
502 CALL keyword_create(keyword, __location__, name="A_LIST", &
503 description="A matrix The defaults give optimal sampling for most "// &
504 "cristalline and liquid compounds. Generated with the parameters set kv_4-4.a "// &
505 "centered on w_0=40 cm^-1.", usage="A_LIST real real real", &
506 type_of_var=real_t, unit_str="internal_cp2k", &
507 n_var=-1, repeats=.true.)
508! default_r_vals=(/ &
509! 1.859575861256e+2_dp, 2.726385349840e-1_dp, 1.152610045461e+1_dp, -3.641457826260e+1_dp, 2.317337581602e+2_dp, &
510! -2.780952471206e-1_dp, 8.595159180871e-5_dp, 7.218904801765e-1_dp, -1.984453934386e-1_dp, 4.240925758342e-1_dp, &
511! -1.482580813121e+1_dp, -7.218904801765e-1_dp, 1.359090212128e+0_dp, 5.149889628035e+0_dp, -9.994926845099e+0_dp, &
512! -1.037218912688e+1_dp, 1.984453934386e-1_dp, -5.149889628035e+0_dp, 2.666191089117e+1_dp, 1.150771549531e+1_dp, &
513! 2.180134636042e+2_dp, -4.240925758342e-1_dp, 9.994926845099e+0_dp, -1.150771549531e+1_dp, 3.095839456559e+2_dp /), &
514 CALL section_add_keyword(section, keyword)
515 CALL keyword_release(keyword)
516
517 CALL keyword_create(keyword, __location__, name="C_LIST", &
518 description="C matrix", usage="C_LIST real real real", &
519 unit_str="K_e", &
520 type_of_var=real_t, n_var=-1, repeats=.true.)
521 CALL section_add_keyword(section, keyword)
522 CALL keyword_release(keyword)
523
524 CALL create_thermo_energy_section(subsection)
525 CALL section_add_subsection(section, subsection)
526 CALL section_release(subsection)
527
528 CALL create_rng_section(subsection)
529 CALL section_add_subsection(section, subsection)
530 CALL section_release(subsection)
531
532 CALL create_gles_section(subsection)
533 CALL section_add_subsection(section, subsection)
534 CALL section_release(subsection)
535
536 END SUBROUTINE create_gle_section
537
538! **************************************************************************************************
539!> \brief Creates the gles section
540!> \param section the section to create
541!> \author teo
542! **************************************************************************************************
543 SUBROUTINE create_gles_section(section)
544 TYPE(section_type), POINTER :: section
545
546 TYPE(keyword_type), POINTER :: keyword
547
548 cpassert(.NOT. ASSOCIATED(section))
549 CALL section_create(section, __location__, name="s", &
550 description="The s variable for GLE used for restart", &
551 n_keywords=1, n_subsections=0, repeats=.false.)
552 NULLIFY (keyword)
553
554 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
555 description="Specify s variable for GLE thermostat ", repeats=.false., &
556 usage="{Real} ...", type_of_var=real_t, n_var=-1)
557 CALL section_add_keyword(section, keyword)
558 CALL keyword_release(keyword)
559
560 END SUBROUTINE create_gles_section
561
562! **************************************************************************************************
563!> \brief ...
564!> \param section will contain the ewald section
565!> \author teo [tlaino] - University of Zurich - 09.2007
566! **************************************************************************************************
567 SUBROUTINE create_csvr_section(section)
568 TYPE(section_type), POINTER :: section
569
570 TYPE(keyword_type), POINTER :: keyword
571 TYPE(section_type), POINTER :: subsection
572
573 cpassert(.NOT. ASSOCIATED(section))
574 CALL section_create(section, __location__, name="csvr", &
575 description="Parameters of the canonical sampling through velocity rescaling thermostat.", &
576 citations=[bussi2007])
577
578 NULLIFY (keyword, subsection)
579
580 CALL keyword_create(keyword, __location__, name="timecon", &
581 description="Time constant of the CSVR thermostat. A small time "// &
582 "constant will result in strong thermostatting (useful for "// &
583 "initial equilibrations) and a large time constant would be adequate "// &
584 "to get weak thermostatting in production runs.", &
585 usage="timecon <REAL>", &
586 default_r_val=cp_unit_to_cp2k(1000.0_dp, "fs"), &
587 unit_str="fs")
588 CALL section_add_keyword(section, keyword)
589 CALL keyword_release(keyword)
590
591 CALL create_thermo_energy_section(subsection)
592 CALL section_add_subsection(section, subsection)
593 CALL section_release(subsection)
594
595 CALL create_rng_section(subsection)
596 CALL section_add_subsection(section, subsection)
597 CALL section_release(subsection)
598
599 END SUBROUTINE create_csvr_section
600
601! **************************************************************************************************
602!> \brief ...
603!> \param section will contain the adaptive langevin section
604!> \author Noam [bernstei]
605! **************************************************************************************************
606 SUBROUTINE create_al_section(section)
607 TYPE(section_type), POINTER :: section
608
609 TYPE(keyword_type), POINTER :: keyword
610 TYPE(section_type), POINTER :: subsection
611
612 cpassert(.NOT. ASSOCIATED(section))
613 CALL section_create(section, __location__, name="ad_langevin", &
614 description="Parameters of the adaptive-Langevin thermostat."// &
615 " Known to work with NVT ensemble, but not tested with"// &
616 " other ensembles. Also tested with FIXED_ATOMS constraints, but"// &
617 " may not work with other constraints (restraints should be OK, but"// &
618 " haven't been well tested)", &
619 citations=[jones2011])
620
621 NULLIFY (keyword, subsection)
622
623 CALL keyword_create(keyword, __location__, name="timecon_nh", &
624 description="Time constant of the Nose-Hoover part of the AD_LANGEVIN thermostat. A small time "// &
625 "constant will result in strong thermostatting (useful for "// &
626 "initial equilibrations) and a large time constant would be adequate "// &
627 "to get weak thermostatting in production runs.", &
628 usage="timecon_nh <REAL>", &
629 default_r_val=cp_unit_to_cp2k(1000.0_dp, "fs"), &
630 unit_str="fs")
631 CALL section_add_keyword(section, keyword)
632 CALL keyword_release(keyword)
633
634 CALL keyword_create(keyword, __location__, name="timecon_langevin", &
635 description="Time constant of the Langevin part of the AD_LANGEVIN thermostat. A small time "// &
636 "constant will result in strong thermostatting (useful for "// &
637 "initial equilibrations) and a large time constant would be adequate "// &
638 "to get weak thermostatting in production runs.", &
639 usage="timecon_langevin <REAL>", &
640 default_r_val=cp_unit_to_cp2k(1000.0_dp, "fs"), &
641 unit_str="fs")
642 CALL section_add_keyword(section, keyword)
643 CALL keyword_release(keyword)
644
645 CALL create_thermo_chi_mass_section(subsection, "CHI")
646 CALL section_add_subsection(section, subsection)
647 CALL section_release(subsection)
648
649 CALL create_thermo_chi_mass_section(subsection, "MASS")
650 CALL section_add_subsection(section, subsection)
651 CALL section_release(subsection)
652
653 END SUBROUTINE create_al_section
654
655! **************************************************************************************************
656!> \brief Creates the thermostat chi restarting section
657!> \param section the section to create
658!> \param sec_name ...
659!> \author teo
660! **************************************************************************************************
661 SUBROUTINE create_thermo_chi_mass_section(section, sec_name)
662 TYPE(section_type), POINTER :: section
663 CHARACTER(len=*) :: sec_name
664
665 TYPE(keyword_type), POINTER :: keyword
666
667 cpassert(.NOT. ASSOCIATED(section))
668 CALL section_create(section, __location__, name=trim(sec_name), &
669 description="Information to initialize the Ad-Langevin thermostat DOF "//trim(sec_name), &
670 n_keywords=1, n_subsections=0, repeats=.false.)
671 NULLIFY (keyword)
672
673 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
674 description="Specify an initial thermostat DOF "//trim(sec_name)// &
675 " for Ad-Langevin thermostat.", repeats=.true., &
676 unit_str="fs^-1", type_of_var=real_t)
677 CALL section_add_keyword(section, keyword)
678 CALL keyword_release(keyword)
679
680 END SUBROUTINE create_thermo_chi_mass_section
681
682! **************************************************************************************************
683!> \brief Creates the thermostat energy restarting section
684!> \param section the section to create
685!> \author teo
686! **************************************************************************************************
687 SUBROUTINE create_thermo_energy_section(section)
688 TYPE(section_type), POINTER :: section
689
690 TYPE(keyword_type), POINTER :: keyword
691
692 cpassert(.NOT. ASSOCIATED(section))
693 CALL section_create(section, __location__, name="THERMOSTAT_ENERGY", &
694 description="Information to initialize the CSVR thermostat energy.", &
695 n_keywords=1, n_subsections=0, repeats=.false.)
696 NULLIFY (keyword)
697
698 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
699 description="Specify an initial thermostat energy for CSVR thermostat.", &
700 repeats=.true., unit_str="internal_cp2k", type_of_var=real_t)
701 CALL section_add_keyword(section, keyword)
702 CALL keyword_release(keyword)
703
704 END SUBROUTINE create_thermo_energy_section
705
706! **************************************************************************************************
707!> \brief Creates the mass section
708!> \param section the section to create
709!> \param name ...
710!> \author teo
711! **************************************************************************************************
712 SUBROUTINE create_force_section(section, name)
713 TYPE(section_type), POINTER :: section
714 CHARACTER(LEN=*), INTENT(IN) :: name
715
716 TYPE(keyword_type), POINTER :: keyword
717
718 cpassert(.NOT. ASSOCIATED(section))
719 CALL section_create(section, __location__, name="force", &
720 description="The forces for "//trim(name)//" used for restart", &
721 n_keywords=1, n_subsections=0, repeats=.false.)
722 NULLIFY (keyword)
723
724 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
725 description="Specify masses of the system", repeats=.false., &
726 usage="{Real} ...", type_of_var=real_t, n_var=-1)
727 CALL section_add_keyword(section, keyword)
728 CALL keyword_release(keyword)
729
730 END SUBROUTINE create_force_section
731
732! **************************************************************************************************
733!> \brief Creates the mass section
734!> \param section the section to create
735!> \param name ...
736!> \author teo
737! **************************************************************************************************
738 SUBROUTINE create_mass_section(section, name)
739 TYPE(section_type), POINTER :: section
740 CHARACTER(LEN=*), INTENT(IN) :: name
741
742 TYPE(keyword_type), POINTER :: keyword
743
744 cpassert(.NOT. ASSOCIATED(section))
745 CALL section_create(section, __location__, name="mass", &
746 description="The masses for "//trim(name)//" used for restart", &
747 n_keywords=1, n_subsections=0, repeats=.false.)
748 NULLIFY (keyword)
749
750 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
751 description="Specify masses of the system", repeats=.false., &
752 usage="{Real} ...", type_of_var=real_t, n_var=-1)
753 CALL section_add_keyword(section, keyword)
754 CALL keyword_release(keyword)
755
756 END SUBROUTINE create_mass_section
757
758! **************************************************************************************************
759!> \brief Creates the velocity section
760!> \param section the section to create
761!> \param name ...
762!> \author teo
763! **************************************************************************************************
764 SUBROUTINE create_velocity_section(section, name)
765 TYPE(section_type), POINTER :: section
766 CHARACTER(LEN=*), INTENT(IN) :: name
767
768 TYPE(keyword_type), POINTER :: keyword
769
770 cpassert(.NOT. ASSOCIATED(section))
771 CALL section_create(section, __location__, name="velocity", &
772 description="The velocities for "//trim(name)//" used for restart", &
773 n_keywords=1, n_subsections=0, repeats=.false.)
774 NULLIFY (keyword)
775
776 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
777 description="Specify velocities of the system", repeats=.true., &
778 usage="{Real} ...", type_of_var=real_t, n_var=-1)
779 CALL section_add_keyword(section, keyword)
780 CALL keyword_release(keyword)
781
782 END SUBROUTINE create_velocity_section
783
784! **************************************************************************************************
785!> \brief Creates the coord section
786!> \param section the section to create
787!> \param name ...
788!> \author teo
789! **************************************************************************************************
790 SUBROUTINE create_coord_section(section, name)
791 TYPE(section_type), POINTER :: section
792 CHARACTER(LEN=*), INTENT(IN) :: name
793
794 TYPE(keyword_type), POINTER :: keyword
795
796 cpassert(.NOT. ASSOCIATED(section))
797 CALL section_create(section, __location__, name="coord", &
798 description="The positions for "//trim(name)//" used for restart", &
799 n_keywords=1, n_subsections=0, repeats=.false.)
800 NULLIFY (keyword)
801
802 CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
803 description="Specify positions of the system", repeats=.true., &
804 usage="{Real} ...", type_of_var=real_t, n_var=-1)
805 CALL section_add_keyword(section, keyword)
806 CALL keyword_release(keyword)
807
808 END SUBROUTINE create_coord_section
809
810END MODULE input_cp2k_thermostats
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public nose1984a
integer, save, public ceriotti2009
integer, save, public jones2011
integer, save, public nose1984b
integer, save, public bussi2007
integer, save, public ceriotti2009b
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public low_print_level
integer, parameter, public high_print_level
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str)
creates a print_key section
unit conversion facility
Definition cp_units.F:30
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Definition cp_units.F:1149
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_thermo_nose
integer, parameter, public do_constr_atomic
integer, parameter, public do_region_molecule
integer, parameter, public do_thermo_al
integer, parameter, public do_constr_molec
integer, parameter, public do_region_thermal
integer, parameter, public do_thermo_csvr
integer, parameter, public do_thermo_gle
integer, parameter, public do_region_massive
integer, parameter, public do_region_global
integer, parameter, public do_region_defined
integer, parameter, public do_constr_none
integer, parameter, public do_region_none
integer, parameter, public do_thermo_same_as_part
builds the subsystem section of the input
subroutine, public create_rng_section(section)
Creates the random number restart 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_mass_section(section, name)
Creates the mass section.
subroutine, public create_gle_section(section)
...
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 char_t
integer, parameter, public integer_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Utilities for string manipulations.
represent a keyword in the input
represent a section of the input file