(git:6d276e9)
Loading...
Searching...
No Matches
input_cp2k_vib.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!> \brief builds the input structure for the VIBRATIONAL_ANALYSIS module
10!> \par History
11!> 01.2008 [tlaino] Teodoro Laino - University of Zurich
12!> Creating an own module for vibrational analysis
13!> \author [tlaino]
14! **************************************************************************************************
22 USE cp_units, ONLY: cp_unit_to_cp2k
38 USE input_val_types, ONLY: 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_vib'
49
50 PUBLIC :: create_vib_section
51CONTAINS
52
53! **************************************************************************************************
54!> \brief Creates the exteranal restart section
55!> \param section the section to create
56!> \author tlaino
57! **************************************************************************************************
58 SUBROUTINE create_vib_section(section)
59 TYPE(section_type), POINTER :: section
60
61 TYPE(keyword_type), POINTER :: keyword
62 TYPE(section_type), POINTER :: subsection
63
64 cpassert(.NOT. ASSOCIATED(section))
65 CALL section_create( &
66 section, __location__, name="VIBRATIONAL_ANALYSIS", &
67 description="Section to setup parameters to perform a Normal Modes, vibrational, or phonon analysis. "// &
68 "Vibrations are computed using finite differences, "// &
69 "which implies a very tight (e.g. 1E-8) threshold is needed for EPS_SCF to get accurate low frequencies. "// &
70 "The analysis assumes a stationary state (minimum or TS),"// &
71 " i.e. tight geometry optimization (MAX_FORCE) is needed as well.", &
72 n_keywords=1, n_subsections=0, repeats=.false.)
73 NULLIFY (keyword, subsection)
74
75 CALL keyword_create(keyword, __location__, name="DX", &
76 description="Specify the increment to be used to construct the HESSIAN with "// &
77 "finite difference method", &
78 default_r_val=1.0e-2_dp, unit_str="bohr")
79 CALL section_add_keyword(section, keyword)
80 CALL keyword_release(keyword)
81
82 CALL keyword_create(keyword, __location__, name="NPROC_REP", &
83 description="Specify the number of processors to be used per replica "// &
84 "environment (for parallel runs). "// &
85 "In case of mode selective calculations more than one replica will start"// &
86 " a block Davidson algorithm to track more than only one frequency", &
87 default_i_val=1)
88 CALL section_add_keyword(section, keyword)
89 CALL keyword_release(keyword)
90
91 CALL keyword_create(keyword, __location__, name="PROC_DIST_TYPE", &
92 description="Specify the topology of the mapping of processors into replicas.", &
93 usage="PROC_DIST_TYPE (INTERLEAVED|BLOCKED)", &
94 enum_c_vals=s2a("INTERLEAVED", &
95 "BLOCKED"), &
96 enum_desc=s2a("Interleaved distribution", &
97 "Blocked distribution"), &
98 enum_i_vals=[do_rep_interleaved, do_rep_blocked], &
99 default_i_val=do_rep_blocked)
100 CALL section_add_keyword(section, keyword)
101 CALL keyword_release(keyword)
102
103 CALL keyword_create(keyword, __location__, name="FULLY_PERIODIC", &
104 description="Avoids to clean rotations from the Hessian matrix.", &
105 default_l_val=.false., lone_keyword_l_val=.true.)
106 CALL section_add_keyword(section, keyword)
107 CALL keyword_release(keyword)
108
109 CALL keyword_create(keyword, __location__, name="INTENSITIES", &
110 description="Calculation of the IR/Raman-Intensities. "// &
111 "Calculation of dipoles and/or polarizabilities have to be "// &
112 "specified explicitly in DFT/PRINT/MOMENTS and/or "// &
113 "PROPERTIES/LINRES/POLAR", &
114 default_l_val=.false., lone_keyword_l_val=.true.)
115 CALL section_add_keyword(section, keyword)
116 CALL keyword_release(keyword)
117
118 CALL keyword_create(keyword, __location__, name="THERMOCHEMISTRY", &
119 description="Calculation of the thermochemical data. Valid for molecules in "// &
120 "the gas phase, not supporting phonon frequencies at general **q**-points "// &
121 "beyond wave vector **q** at gamma point. Based on the rigid-rotor harmonic "// &
122 "oscillator (RRHO) model, which is known to break down if very low vibrational "// &
123 "frequencies are present in a flexible system.", &
124 default_l_val=.false., lone_keyword_l_val=.true.)
125 CALL section_add_keyword(section, keyword)
126 CALL keyword_release(keyword)
127
128 CALL keyword_create(keyword, __location__, name="TC_TEMPERATURE", &
129 description="Temperature for the calculation of the thermochemical data ", &
130 usage="tc_temperature 325.0", default_r_val=cp_unit_to_cp2k(value=273.150_dp, unit_str="K"), &
131 unit_str="K")
132 CALL section_add_keyword(section, keyword)
133 CALL keyword_release(keyword)
134
135 CALL keyword_create(keyword, __location__, name="TC_PRESSURE", &
136 description="Pressure for the calculation of the thermochemical data ", &
137 default_r_val=cp_unit_to_cp2k(value=101325.0_dp, unit_str="Pa"), unit_str="Pa")
138 CALL section_add_keyword(section, keyword)
139 CALL keyword_release(keyword)
140
141 CALL create_mode_selective_section(subsection)
142 CALL section_add_subsection(section, subsection)
143 CALL section_release(subsection)
144
145 CALL create_print_vib_section(subsection)
146 CALL section_add_subsection(section, subsection)
147 CALL section_release(subsection)
148 END SUBROUTINE create_vib_section
149
150! **************************************************************************************************
151!> \brief Create the print section for VIB
152!> \param section the section to create
153!> \author Teodoro Laino [tlaino] - 10.2008
154! **************************************************************************************************
155 SUBROUTINE create_print_vib_section(section)
156 TYPE(section_type), POINTER :: section
157
158 TYPE(keyword_type), POINTER :: keyword
159 TYPE(section_type), POINTER :: print_key
160
161 cpassert(.NOT. ASSOCIATED(section))
162 CALL section_create(section, __location__, name="PRINT", &
163 description="Section controlling the print information during a vibrational "// &
164 "analysis.", n_keywords=1, n_subsections=0, repeats=.false.)
165 NULLIFY (keyword, print_key)
166
167 CALL cp_print_key_section_create(print_key, __location__, "BANNER", &
168 description="Controls the printing of the vibrational analysis banner", &
169 print_level=low_print_level, common_iter_levels=1, &
170 filename="__STD_OUT__")
171 CALL section_add_subsection(section, print_key)
172 CALL section_release(print_key)
173
174 CALL cp_print_key_section_create(print_key, __location__, "PROGRAM_RUN_INFO", &
175 description="Controls the printing basic info about the vibrational method", &
176 print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
177 CALL section_add_subsection(section, print_key)
178 CALL section_release(print_key)
179
180 CALL cp_print_key_section_create(print_key, __location__, "MOLDEN_VIB", &
181 description="Controls the printing for visualization in molden format", &
182 print_level=low_print_level, add_last=add_last_numeric, filename="VIBRATIONS")
183 CALL keyword_create(keyword, __location__, name="WRITE_CELL", &
184 description="Controls whether the CP2K [Cell] extension is written to the MOLDEN file. "// &
185 "The cell vectors are written in atomic units to match the vibrational coordinates.", &
186 usage="WRITE_CELL T", &
187 default_l_val=.false., lone_keyword_l_val=.true.)
188 CALL section_add_keyword(print_key, keyword)
189 CALL keyword_release(keyword)
190 CALL section_add_subsection(section, print_key)
191 CALL section_release(print_key)
192
193 CALL cp_print_key_section_create(print_key, __location__, "ROTATIONAL_INFO", &
194 description="Controls the printing basic info during the cleaning of the "// &
195 "rotational degrees of freedom.", &
196 print_level=debug_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
197 ! Print_key keywords
198 CALL keyword_create(keyword, __location__, name="COORDINATES", &
199 description="Prints atomic coordinates after rotation", &
200 default_l_val=.false., lone_keyword_l_val=.true.)
201 CALL section_add_keyword(print_key, keyword)
202 CALL keyword_release(keyword)
203 CALL section_add_subsection(section, print_key)
204 CALL section_release(print_key)
205
206 CALL cp_print_key_section_create(print_key, __location__, "CARTESIAN_EIGS", &
207 description="Controls the printing of Cartesian "// &
208 "frequencies and eigenvectors of the Hessian used "// &
209 "for initializing ensemble for MD calculations. "// &
210 "This should always print to a file, and will not "// &
211 "effect the same frequencies and eigenvectors printed "// &
212 "in the main vibrational analysis output", &
213 print_level=low_print_level, &
214 add_last=add_last_numeric, &
215 filename="VIBRATIONS")
216 CALL keyword_create(keyword, __location__, name="BACKUP_COPIES", &
217 description="Specifies the maximum number of backup copies.", &
218 usage="BACKUP_COPIES {int}", &
219 default_i_val=1)
220 CALL section_add_keyword(print_key, keyword)
221 CALL keyword_release(keyword)
222 CALL section_add_subsection(section, print_key)
223 CALL section_release(print_key)
224
225 CALL cp_print_key_section_create(print_key, __location__, name="NAMD_PRINT", &
226 description="Adjust cartesian eigenvalues / vectors to NewtonX format.", &
227 print_level=debug_print_level + 1, add_last=add_last_numeric, &
228 filename="FullNormalizedCartesian")
229 CALL keyword_create(keyword, __location__, name="BACKUP_COPIES", &
230 description="Specifies the maximum number of backup copies.", &
231 usage="BACKUP_COPIES {int}", &
232 default_i_val=1)
233 CALL section_add_keyword(print_key, keyword)
234 CALL keyword_release(keyword)
235 CALL section_add_subsection(section, print_key)
236 CALL section_release(print_key)
237
238 CALL cp_print_key_section_create(print_key, __location__, "HESSIAN", &
239 description="Write the Hessian matrix from a vibrational analysis calculation "// &
240 "into a binary file.", &
241 print_level=low_print_level, add_last=add_last_numeric, filename="Hessian")
242 CALL section_add_subsection(section, print_key)
243 CALL section_release(print_key)
244
245 END SUBROUTINE create_print_vib_section
246
247! **************************************************************************************************
248!> \brief Create the input section for MODE selective
249!> \param section the section to create
250!> \author fschiff
251! **************************************************************************************************
252 SUBROUTINE create_mode_selective_section(section)
253 TYPE(section_type), POINTER :: section
254
255 TYPE(keyword_type), POINTER :: keyword
256 TYPE(section_type), POINTER :: print_key, subsection
257
258 NULLIFY (keyword, subsection, print_key)
259 cpassert(.NOT. ASSOCIATED(section))
260 CALL section_create(section, __location__, name="MODE_SELECTIVE", &
261 description="All parameters needed for to run a mode selective vibrational analysis. "// &
262 "The keywords FREQUENCY, RANGE, and the subsection INVOLVED_ATOMS are mutually exclusive.", &
263 n_keywords=8, n_subsections=1, repeats=.false.)
264
265 CALL keyword_create(keyword, __location__, name="FREQUENCY", &
266 description="value close to the expected value of the frequency to look for. "// &
267 "If the block Davidson algorithm is applied, the nrep closest frequencies are tracked. ", &
268 usage="FREQUENCY {REAL}", default_r_val=-1._dp)
269 CALL section_add_keyword(section, keyword)
270 CALL keyword_release(keyword)
271
272 CALL keyword_create(keyword, __location__, name="RANGE", &
273 description="Track modes in a given range of frequencies. "// &
274 "No warranty that the set of frequencies is complete.", &
275 usage="RANGE {REAL} {REAL}", &
276 n_var=-1, type_of_var=real_t)
277 CALL section_add_keyword(section, keyword)
278 CALL keyword_release(keyword)
279
280 CALL keyword_create(keyword, __location__, name="LOWEST_FREQUENCY", &
281 description="Lowest frequency mode to include when writing output. "// &
282 "Use a negative value to print imaginary frequencies. "// &
283 "Useful for visualizing the imaginary frequency along a reaction path coordinate "// &
284 "Depending on accuracy settings, the output might include spurious low frequency "// &
285 "imaginary modes which should be visually checked (see MOLDEN_VIB).", &
286 usage="LOWEST_FREQUENCY <REAL>", default_r_val=0.0_dp)
287 CALL section_add_keyword(section, keyword)
288 CALL keyword_release(keyword)
289
290 CALL keyword_create(keyword, __location__, name="ATOMS", &
291 description="Specifies the list of atoms which should be displaced for the Initial guess", &
292 usage="ATOMS {integer} {integer} .. {integer}", &
293 n_var=-1, type_of_var=integer_t)
294 CALL section_add_keyword(section, keyword)
295 CALL keyword_release(keyword)
296
297 CALL keyword_create(keyword, __location__, name="EPS_MAX_VAL", &
298 description="Convergence criterion for the davidson algorithm. Specifies the maximal value in the "// &
299 "residuum vectors ", &
300 usage="EPS_MAX_VAL {REAL}", default_r_val=5.0e-7_dp)
301 CALL section_add_keyword(section, keyword)
302 CALL keyword_release(keyword)
303
304 CALL keyword_create( &
305 keyword, __location__, name="EPS_NORM", &
306 description="Convergence criterion for the davidson algorithm. Specifies the maximal value of the norm "// &
307 "of the residuum vectors ", &
308 usage="EPS_NORM {REAL}", default_r_val=2.0e-6_dp)
309 CALL section_add_keyword(section, keyword)
310 CALL keyword_release(keyword)
311
312 CALL keyword_create( &
313 keyword, __location__, name="INITIAL_GUESS", &
314 description="The type of initial guess for the normal modes", &
315 usage="INITIAL_GUESS BFGS_HESS", &
316 default_i_val=ms_guess_atomic, &
317 enum_c_vals=s2a("BFGS_HESS", "ATOMIC", "RESTART", "RESTART_VEC", "MOLDEN_RESTART"), &
318 enum_desc=s2a("get the first displacement vector out of the BFGS approximate Hessian", &
319 "use random displacements for a set of atoms specified", &
320 "use data from MS_RESTART as initial guess", &
321 "use a vector from MS_RESTART, useful if you want to increase accurcy by changing functionals or basis", &
322 "use the .mol file of a former run, to restart a vector"// &
323 " (similar to Restart_vec, but a different file FORMAT is used)"), &
325 CALL section_add_keyword(section, keyword)
326 CALL keyword_release(keyword)
327
328 CALL keyword_create(keyword, __location__, name="RESTART_FILE_NAME", &
329 description="Specifies the name of the file used to create the restarted vectors", &
330 usage="RESTART_FILE_NAME {filename}", &
331 default_lc_val="")
332 CALL section_add_keyword(section, keyword)
333 CALL keyword_release(keyword)
334
335 CALL create_involved_atoms_section(subsection)
336 CALL section_add_subsection(section, subsection)
337 CALL section_release(subsection)
338
339 CALL section_create(subsection, __location__, name="PRINT", &
340 description="Controls the printing mode selective vibrational analysis", &
341 n_keywords=0, n_subsections=1, repeats=.true.)
342
343 CALL cp_print_key_section_create(print_key, __location__, "MS_RESTART", &
344 description="Controls the printing of the Mode Selective Restart file.", &
345 print_level=silent_print_level, common_iter_levels=1, &
346 add_last=add_last_numeric, filename="")
347 CALL section_add_subsection(subsection, print_key)
348 CALL section_release(print_key)
349
350 CALL section_add_subsection(section, subsection)
351 CALL section_release(subsection)
352
353 END SUBROUTINE create_mode_selective_section
354
355! **************************************************************************************************
356!> \brief Create the input section for Ivolved_atoms keyword in mode selective
357!> \param section the section to create
358!> \author fschiff
359! **************************************************************************************************
360 SUBROUTINE create_involved_atoms_section(section)
361 TYPE(section_type), POINTER :: section
362
363 TYPE(keyword_type), POINTER :: keyword
364
365 NULLIFY (keyword)
366 cpassert(.NOT. ASSOCIATED(section))
367 CALL section_create( &
368 section, __location__, name="INVOLVED_ATOMS", &
369 description="All parameters needed for the tracking of modes dominated by the motion of selected atoms. "// &
370 "Warning, if many atoms are involved, only low frequency modes are detected, "// &
371 "since they are more delocalized and match the tracked eigenvector.", &
372 n_keywords=2, n_subsections=0, repeats=.false.)
373
374 CALL keyword_create( &
375 keyword, __location__, name="RANGE", &
376 description=" Specifies the range of wavenumbers in which the modes related to the ATOMS have to be tracked."// &
377 " If not specified frequencies >400cm-1 will be used to avoid tracking of translational or rotational modes", &
378 usage="RANGE {REAL} {REAL}", &
379 n_var=-1, type_of_var=real_t)
380 CALL section_add_keyword(section, keyword)
381 CALL keyword_release(keyword)
382
383 CALL keyword_create( &
384 keyword, __location__, name="INVOLVED_ATOMS", &
385 description="Specifies the list of atoms on which the tracked eigenvector should have the highest value "// &
386 "similar to looking for the vibration of a set of atoms", &
387 usage="INVOLVED_ATOMS {integer} {integer} .. {integer}", &
388 n_var=-1, type_of_var=integer_t)
389 CALL section_add_keyword(section, keyword)
390 CALL keyword_release(keyword)
391
392 END SUBROUTINE create_involved_atoms_section
393
394END MODULE input_cp2k_vib
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 add_last_numeric
integer, parameter, public silent_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:1222
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_rep_interleaved
integer, parameter, public do_rep_blocked
integer, parameter, public ms_guess_restart
integer, parameter, public ms_guess_restart_vec
integer, parameter, public ms_guess_molden
integer, parameter, public ms_guess_atomic
integer, parameter, public ms_guess_bfgs
builds the input structure for the VIBRATIONAL_ANALYSIS module
subroutine, public create_vib_section(section)
Creates the exteranal restart section.
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 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