-
Notifications
You must be signed in to change notification settings - Fork 1
/
input_cp2k_motion_print.F
341 lines (296 loc) · 20.8 KB
/
input_cp2k_motion_print.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
!--------------------------------------------------------------------------------------------------!
! CP2K: A general program to perform molecular dynamics simulations !
! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
! !
! SPDX-License-Identifier: GPL-2.0-or-later !
!--------------------------------------------------------------------------------------------------!
! **************************************************************************************************
!> \par History
!> - taken out of input_cp2k_motion
!> \author Ole Schuett
! **************************************************************************************************
MODULE input_cp2k_motion_print
USE cp_output_handling, ONLY: add_last_numeric,&
cp_print_key_section_create,&
high_print_level,&
low_print_level,&
silent_print_level
USE input_constants, ONLY: dump_atomic,&
dump_dcd,&
dump_dcd_aligned_cell,&
dump_pdb,&
dump_xmol
USE input_cp2k_subsys, ONLY: create_structure_data_section
USE input_keyword_types, ONLY: keyword_create,&
keyword_release,&
keyword_type
USE input_section_types, ONLY: section_add_keyword,&
section_add_subsection,&
section_create,&
section_release,&
section_type
USE string_utilities, ONLY: s2a
#include "./base/base_uses.f90"
IMPLICIT NONE
PRIVATE
LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_motion_print'
PUBLIC :: create_motion_print_section, add_format_keyword
CONTAINS
! **************************************************************************************************
!> \brief creates the motion%print section
!> \param section the section to be created
!> \author teo
! **************************************************************************************************
SUBROUTINE create_motion_print_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key
NULLIFY (keyword, section, print_key)
CALL section_create(section, __LOCATION__, name="print", &
description="Controls the printing properties during an MD/Optimization run", &
n_keywords=1, n_subsections=1, repeats=.TRUE.)
CALL keyword_create(keyword, __LOCATION__, name="MEMORY_INFO", &
variants=(/"MEMORY"/), &
description="Whether overall memory usage should be sampled and printed "// &
"at each MD/Optimization step.", &
usage="MEMORY_INFO LOGICAL", &
default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL cp_print_key_section_create(print_key, __LOCATION__, "TRAJECTORY", &
description="Controls the output of the trajectory", &
print_level=low_print_level, common_iter_levels=1, &
filename="", unit_str="angstrom")
CALL add_format_keyword(keyword, print_key, pos=.TRUE., &
description="Specifies the format of the output file for the trajectory.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create( &
print_key, __LOCATION__, "SHELL_TRAJECTORY", &
description="Controls the output of the trajectory of shells when the shell-model is used ", &
print_level=high_print_level, common_iter_levels=1, &
filename="", unit_str="angstrom")
CALL add_format_keyword(keyword, print_key, pos=.TRUE., &
description="Specifies the format of the output file for the trajectory of shells.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "CORE_TRAJECTORY", &
description="Controls the output of the trajectory of cores when the shell-model is used ", &
print_level=high_print_level, common_iter_levels=1, &
filename="", unit_str="angstrom")
CALL add_format_keyword(keyword, print_key, pos=.TRUE., &
description="Specifies the format of the output file for the trajectory of cores.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "CELL", &
description="Controls the output of the simulation cell. "// &
"For later analysis of the trajectory it is recommendable that the "// &
"frequency of printing is the same as the one used for the trajectory file.", &
print_level=high_print_level, common_iter_levels=1, &
filename="")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "VELOCITIES", &
description="Controls the output of the atomic velocities. "// &
"The default unit for the atomic velocities $v$ is bohr/au_time. "// &
"The kinetic energy $K_i$ in [hartree] of an atom $i$ with mass $m_i$ in "// &
"atomic mass units [amu] (or just [u]) and velocity $v_i$ can be obtained by "// &
"$K_i = \frac{1}{2}f_u\,m_i\,v_i^2$ with $f_u = 1822.888$ as conversion factor "// &
"from [u] to [a.u.]. $f_u$ is printed in full precision in the top of the CP2K "// &
"output for print level MEDIUM or higher.", &
print_level=high_print_level, common_iter_levels=1, &
filename="", unit_str="bohr*au_t^-1")
CALL add_format_keyword(keyword, print_key, pos=.FALSE., &
description="Specifies the format of the output file for the velocities.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "SHELL_VELOCITIES", &
description="Controls the output of the velocities of shells when the shell model is used", &
print_level=high_print_level, common_iter_levels=1, &
filename="", unit_str="bohr*au_t^-1")
CALL add_format_keyword(keyword, print_key, pos=.FALSE., &
description="Specifies the format of the output file for the velocities of shells.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "CORE_VELOCITIES", &
description="controls the output of the velocities of cores when the shell model is used", &
print_level=high_print_level, common_iter_levels=1, &
filename="", unit_str="bohr*au_t^-1")
CALL add_format_keyword(keyword, print_key, pos=.FALSE., &
description="Specifies the format of the output file for the velocities of cores.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL create_structure_data_section(print_key)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create( &
print_key, __LOCATION__, "FORCE_MIXING_LABELS", &
description="Controls the output of the force mixing (FORCE_EVAL&QMMM&FORCE_MIXING) labels", &
print_level=high_print_level, common_iter_levels=1, &
filename="")
CALL add_format_keyword(keyword, print_key, pos=.FALSE., &
description="Specifies the format of the output file for the force mixing labels.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "FORCES", &
description="Controls the output of the forces", &
print_level=high_print_level, common_iter_levels=1, &
filename="", unit_str="hartree*bohr^-1")
CALL add_format_keyword(keyword, print_key, pos=.FALSE., &
description="Specifies the format of the output file for the forces.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "SHELL_FORCES", &
description="Controls the output of the forces on shells when shell-model is used", &
print_level=high_print_level, common_iter_levels=1, &
filename="", unit_str="hartree*bohr^-1")
CALL add_format_keyword(keyword, print_key, pos=.FALSE., &
description="Specifies the format of the output file for the forces on shells.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "CORE_FORCES", &
description="Controls the output of the forces on cores when shell-model is used", &
print_level=high_print_level, common_iter_levels=1, &
filename="", unit_str="hartree*bohr^-1")
CALL add_format_keyword(keyword, print_key, pos=.FALSE., &
description="Specifies the format of the output file for the forces on cores.")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "MIXED_ENERGIES", &
description="Controls the output of the energies of the two "// &
"regular FORCE_EVALS in the MIXED method "// &
"printed is step,time,Etot,E_F1,E_F2,CONS_QNT", &
print_level=low_print_level, common_iter_levels=1, &
filename="")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "STRESS", &
description="Controls the output of the stress tensor", &
print_level=high_print_level, common_iter_levels=1, &
filename="")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "POLAR_MATRIX", &
description="Controls the output of the polarisability tensor during an MD run", &
print_level=low_print_level, common_iter_levels=1, &
filename="")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
description="Controls the dumping of the restart file during runs. "// &
"By default keeps a short history of three restarts. See also RESTART_HISTORY", &
each_iter_names=s2a("MD"), each_iter_values=(/20/), &
print_level=silent_print_level, common_iter_levels=1, &
add_last=add_last_numeric, filename="")
CALL keyword_create(keyword, __LOCATION__, name="BACKUP_COPIES", &
description="Specifies the maximum number of backup copies.", &
usage="BACKUP_COPIES {int}", &
default_i_val=1)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="SPLIT_RESTART_FILE", &
description="If specified selected input sections, which are growing with the "// &
"number of atoms in the system, are written to another restart file "// &
"in binary format instead of the default restart file in human "// &
"readable ASCII format. This split of the restart file may "// &
"provide significant memory savings and an accelerated I/O for "// &
"systems with a very large number of atoms", &
usage="SPLIT_RESTART_FILE yes", &
default_l_val=.FALSE., &
lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(print_key, keyword)
CALL keyword_release(keyword)
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART_HISTORY", &
description="Dumps unique restart files during the run keeping all of them. "// &
"Most useful if recovery is needed at a later point.", &
print_level=low_print_level, common_iter_levels=0, &
each_iter_names=s2a("MD", "GEO_OPT", "ROT_OPT"), each_iter_values=(/500, 500, 500/), &
filename="")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "TRANSLATION_VECTOR", &
description="Dumps the translation vector applied along an MD (if any). Useful"// &
" for postprocessing of QMMM trajectories in which the QM fragment is continuously"// &
" centered in the QM box", &
print_level=high_print_level, common_iter_levels=1, &
filename="")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)
END SUBROUTINE create_motion_print_section
! **************************************************************************************************
!> \brief creates the FORMAT keyword
!> \param keyword ...
!> \param section will contain the pint section
!> \param pos ...
!> \param description ...
!> \author Teodoro Laino 10.2008 [tlaino]
! **************************************************************************************************
SUBROUTINE add_format_keyword(keyword, section, pos, description)
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: section
LOGICAL, INTENT(IN) :: pos
CHARACTER(LEN=*), INTENT(IN) :: description
CPASSERT(ASSOCIATED(section))
CPASSERT(.NOT. ASSOCIATED(keyword))
IF (pos) THEN
CALL keyword_create( &
keyword, __LOCATION__, name="FORMAT", &
description=description, usage="FORMAT (ATOMIC|DCD|PDB|XMOL|XYZ)", &
default_i_val=dump_xmol, &
enum_c_vals=s2a("ATOMIC", "DCD", "DCD_ALIGNED_CELL", "PDB", "XMOL", "XYZ"), &
enum_i_vals=(/dump_atomic, dump_dcd, dump_dcd_aligned_cell, dump_pdb, dump_xmol, dump_xmol/), &
enum_desc=s2a("Write only the coordinates X,Y,Z without element symbols to a formatted file", &
"Write the coordinates (no element labels) and the cell information to a binary file", &
"Like DCD, but the dumped coordinates refer to an aligned cell following the common convention: "// &
"the cell vector **a** is aligned with the *x* axis and the cell vector **b** lies in "// &
"the *xy* plane. This allows the reconstruction of scaled coordinates from the DCD data only.", &
"Write the atomic information in PDB format to a formatted file", &
"Mostly known as XYZ format, provides in a formatted file: element_symbol X Y Z", &
"Alias name for XMOL"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CHARGE_OCCUP", &
variants=(/"CHARGE_O"/), &
description="Write the MM charges to the OCCUP field of the PDB file", &
usage="CHARGE_OCCUP logical", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CHARGE_BETA", &
variants=(/"CHARGE_B"/), &
description="Write the MM charges to the BETA field of the PDB file", &
usage="CHARGE_BETA logical", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="CHARGE_EXTENDED", &
description="Write the MM charges to the very last field of the PDB file (starting from column 81)", &
usage="CHARGE_EXTENDED logical", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
ELSE
CALL keyword_create(keyword, __LOCATION__, name="FORMAT", &
description=description, usage="FORMAT (ATOMIC|DCD|XMOL|XYZ)", &
default_i_val=dump_xmol, &
enum_c_vals=s2a("ATOMIC", "DCD", "XMOL", "XYZ"), &
enum_i_vals=(/dump_atomic, dump_dcd, dump_xmol, dump_xmol/), &
enum_desc=s2a("Write only the coordinates X,Y,Z without element symbols to a formatted file", &
"Write the coordinates (no element labels) and the cell information to a binary file", &
"Mostly known as XYZ format, provides in a formatted file: element_symbol X Y Z", &
"Alias name for XMOL"))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END IF
CALL keyword_create(keyword, __LOCATION__, name="PRINT_ATOM_KIND", &
description="Write the atom kind given in the subsys section instead of the element symbol. "// &
"Only valid for the XMOL format.", &
usage="PRINT_ELEMENT_NAME logical", &
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE add_format_keyword
END MODULE input_cp2k_motion_print