42#include "./base/base_uses.f90"
47 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
48 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_neb'
63 TYPE(
section_type),
POINTER :: print_key, subsection, subsubsection
65 cpassert(.NOT.
ASSOCIATED(section))
67 description=
"The section that controls a BAND run", &
68 n_keywords=1, n_subsections=0, repeats=.false., &
70 NULLIFY (keyword, print_key, subsection, subsubsection)
73 description=
"Specify the number of processors to be used per replica "// &
74 "environment (for parallel runs)", &
79 CALL keyword_create(keyword, __location__, name=
"PROC_DIST_TYPE", &
80 description=
"Specify the topology of the mapping of processors into replicas.", &
81 usage=
"PROC_DIST_TYPE (INTERLEAVED|BLOCKED)", &
82 enum_c_vals=
s2a(
"INTERLEAVED", &
84 enum_desc=
s2a(
"Interleaved distribution", &
85 "Blocked distribution"), &
92 description=
"Specifies the type of BAND calculation", &
93 usage=
"BAND_TYPE (B-NEB|IT-NEB|CI-NEB|D-NEB|SM|EB)", &
95 enum_c_vals=
s2a(
"B-NEB", &
101 enum_desc=
s2a(
"Bisection nudged elastic band", &
102 "Improved tangent nudged elastic band", &
103 "Climbing image nudged elastic band", &
104 "Doubly nudged elastic band", &
106 "Elastic band (Hamiltonian formulation)"), &
111 CALL keyword_create(keyword, __location__, name=
"NUMBER_OF_REPLICA", &
112 description=
"Specify the number of Replica to use in the BAND. This may "// &
113 "be equal to or larger than the number of defined &REPLICA sections. If "// &
114 "larger, the rest of missing replica will automatically be interpolated "// &
115 "in an iterative bisection procedure: on each step, the largest distance "// &
116 "between adjacent replica is found and a new replica is inserted there by "// &
117 "taking the average of adjacent replica; this is repeated until getting "// &
118 "requested number of replica. Please note that the number of replica is "// &
119 "always including both end points regardless of the setting of keyword "// &
120 "OPTIMIZE_END_POINTS, which should be taken into account when adjusting "// &
121 "the NPROC_REP value based on processors available on the machine.", &
127 description=
"Uses a version of the band scheme projected in a subspace of colvars.", &
128 default_l_val=.false., lone_keyword_l_val=.true.)
133 description=
"Specifies the type of potential used in the BAND calculation", &
134 usage=
"POT_TYPE (FULL|FE|ME)", &
136 enum_c_vals=
s2a(
"FULL", &
139 enum_desc=
s2a(
"Full potential (no projections in a subspace of colvars)", &
140 "Free energy (requires a projections in a subspace of colvars)", &
141 "Minimum energy (requires a projections in a subspace of colvars)"), &
146 CALL keyword_create(keyword, __location__, name=
"ROTATE_FRAMES", &
147 description=
"Compute at each BAND step the RMSD and rotate the frames in order"// &
148 " to minimize it.", &
149 default_l_val=.true., lone_keyword_l_val=.true.)
154 description=
"Enables the alignment of the frames at the beginning of a BAND calculation. "// &
155 "This keyword does not affect the rotation of the replicas during a BAND calculation.", &
156 default_l_val=.true., lone_keyword_l_val=.true.)
162 description=
"Specify the value of the spring constant", &
163 default_r_val=0.02_dp)
168 CALL section_create(subsection, __location__, name=
"CONVERGENCE_CONTROL", &
169 description=
"Setup parameters to control the convergence criteria for BAND", &
172 description=
"Tolerance on the maximum value of the displacement on the BAND.", &
173 usage=
"MAX_DR {real}", &
174 default_r_val=0.0002_dp)
179 description=
"Tolerance on the maximum value of Forces on the BAND.", &
180 usage=
"MAX_FORCE {real}", &
181 default_r_val=0.00045_dp)
186 description=
"Tolerance on RMS displacements on the BAND.", &
187 usage=
"RMS_DR {real}", &
188 default_r_val=0.0001_dp)
193 description=
"Tolerance on RMS Forces on the BAND.", &
194 usage=
"RMS_FORCE {real}", &
195 default_r_val=0.00030_dp)
201 NULLIFY (subsection, subsubsection)
204 description=
"Controls parameters for CI-NEB type calculation only.", &
207 description=
"Specify the number of steps of IT-NEB to perform before "// &
208 "switching on the CI algorithm", &
216 CALL section_create(subsection, __location__, name=
"STRING_METHOD", &
217 description=
"Controls parameters for String Method type calculation only.", &
221 description=
"Specify the oder of the spline used in the String Method.", &
226 description=
"Smoothing parameter for the reparametrization of the frames.", &
227 default_r_val=0.2_dp)
235 CALL section_create(subsection, __location__, name=
"optimize_band", &
236 description=
"Specify the optimization method for the band", &
238 CALL create_opt_band_section(subsection)
245 description=
"Specify coordinates and velocities (possibly) of the replica", &
249 description=
"Specifies the value of the collective variables used in the projected"// &
250 " BAND method. The order of the values is the order of the COLLECTIVE section in the"// &
251 " constraints/restraints section", &
252 usage=
"COLLECTIVE {real} .. {real}", &
253 type_of_var=
real_t, n_var=-1)
257 CALL keyword_create(keyword, __location__, name=
"COORD_FILE_NAME", &
258 description=
"Name of the xyz file with coordinates (alternative to &COORD section)", &
259 usage=
"COORD_FILE_NAME <CHAR>", &
276 description=
"Controls the printing basic info about the BAND run", &
279 CALL keyword_create(keyword, __location__, name=
"INITIAL_CONFIGURATION_INFO", &
280 description=
"Print information for the setup of the initial configuration.", &
281 usage=
"INITIAL_CONFIGURATION_INFO <LOGICAL>", &
282 default_l_val=.false., lone_keyword_l_val=.true.)
286 CALL keyword_create(keyword, __location__, name=
"PLOT_REL_ENERGY", &
287 description=
"If a simple plot of relative energy of each replica is shown "// &
288 "alongside data vertically on each step. This makes the output format less "// &
289 "compact than default but creates a visual aid for ease of monitoring, with "// &
290 "some special marks for the local maxima `(X)` or minima `(x)` in the plot "// &
291 "and adjacent to the energy values in the form of `(++)` or `(--)`. Please "// &
292 "note that this plot does not represent optimization history where absolute "// &
293 "energy values vary between steps, because it shows *relative* energy that "// &
294 "is calculated by (E_rep-E_min)/(E_max-E_min) for each replica on one step.", &
295 usage=
"PLOT_REL_ENERGY <LOGICAL>", &
296 default_l_val=.false., lone_keyword_l_val=.true.)
304 description=
"Controls the printing of the convergence criteria during a BAND run", &
310 description=
"Controls the printing of each replica info during a BAND run", &
316 description=
"Controls the printing of the ENER file in a BAND run", &
323 description=
"Controls the printing of the final structures as an "// &
324 "XYZ trajectory file after a BAND run, regardless of convergence "// &
325 "status. The unit is angstrom for coordinates and cell vectors.", &
329 CALL keyword_create(keyword, __location__, name=
"PRINT_ATOM_KIND", &
330 description=
"Write the atom kind given in the subsys section instead "// &
331 "of the element symbol in the XYZ trajectory file.", &
332 usage=
"PRINT_ATOM_KIND {LOGICAL}", &
333 default_l_val=.false., lone_keyword_l_val=.true.)
341 description=
"Controls the printing of the BAND banner", &
343 filename=
"__STD_OUT__")
353 SUBROUTINE create_opt_band_section(section)
357 TYPE(
section_type),
POINTER :: print_key, subsection, subsubsection
359 cpassert(
ASSOCIATED(section))
360 NULLIFY (keyword, print_key, subsection, subsubsection)
363 description=
"Specifies the type optimizer used for the band", &
364 usage=
"OPT_TYPE (MD|DIIS)", &
366 enum_c_vals=
s2a(
"MD", &
368 enum_desc=
s2a(
"Molecular dynamics-based optimizer", &
369 "Coupled steepest descent / direct inversion in the iterative subspace"), &
374 CALL keyword_create(keyword, __location__, name=
"OPTIMIZE_END_POINTS", &
375 description=
"If both end points of the band are also optimized alongside "// &
376 "the rest of replica. This may be set to .TRUE. if both end points have "// &
377 "already been optimized with the same FORCE_EVAL, in which case the force "// &
378 "on both end points will be reset to 0 on each step. Please note that both "// &
379 "end points will always be included in NUMBER_OF_REPLICA and get NPROC_REP "// &
380 "processors allocated each for calculation in the same way as the rest of "// &
381 "replica, regardless of this setting.", &
382 default_l_val=.false., lone_keyword_l_val=.true.)
388 description=
"Activate the MD based optimization procedure for BAND", &
392 description=
"Specify the maximum number of MD steps", &
398 keyword, __location__, &
400 description=
"The length of an integration step", &
401 usage=
"timestep 1.0", &
409 description=
"Specify the initial temperature", &
417 CALL section_create(subsubsection, __location__, name=
"TEMP_CONTROL", &
418 description=
"Setup parameters to control the temperature during a BAND MD run.", &
421 description=
"Specify the target temperature", &
422 type_of_var=
real_t, unit_str=
"K")
427 description=
"Specify the tolerance on the temperature for rescaling", &
434 CALL keyword_create(keyword, __location__, name=
"TEMP_TOL_STEPS", &
435 description=
"Specify the number of steps to apply a temperature control", &
443 CALL section_create(subsubsection, __location__, name=
"VEL_CONTROL", &
444 description=
"Setup parameters to control the velocity during a BAND MD run.", &
447 description=
"Specify the annealing coefficient", &
448 default_r_val=1.0_dp)
451 CALL keyword_create(keyword, __location__, name=
"PROJ_VELOCITY_VERLET", &
452 description=
"Uses a Projected Velocity Verlet instead of a normal Velocity Verlet."// &
453 " Every time the cosine between velocities and forces is < 0 velocities are"// &
455 usage=
"PROJ_VELOCITY_VERLET <LOGICAL>", &
456 default_l_val=.true., lone_keyword_l_val=.true.)
460 description=
"Zeros velocity at each MD step emulating a steepest descent like "// &
461 "(SD_LIKE) approach", &
462 usage=
"SD_LIKE <LOGICAL>", &
463 default_l_val=.false., lone_keyword_l_val=.true.)
474 description=
"Activate the DIIS based optimization procedure for BAND", &
478 description=
"Specify the maximum number of SD steps to perform"// &
479 " before switching on DIIS (the minimum number will always be equal to N_DIIS).", &
485 description=
"Specify the maximum number of optimization steps", &
491 variants=[
"NDIIS"], &
492 description=
"Number of history vectors to be used with DIIS", &
499 description=
"Initial stepsize used for the line search, sometimes this parameter "// &
500 "can be reduced to stabilize DIIS", &
501 usage=
"STEPSIZE <REAL>", &
502 default_r_val=1.0_dp)
507 description=
"Maximum stepsize used for the line search, sometimes this parameter "// &
508 "can be reduced to stabilize the LS for particularly difficult initial geometries", &
509 usage=
"MAX_STEPSIZE <REAL>", &
510 default_r_val=2.0_dp)
515 description=
"Number of points used in the line search SD.", &
516 usage=
"NP_LS <INTEGER>", &
522 description=
"Does not perform LS during SD. Useful in combination with a proper STEPSIZE"// &
523 " for particularly out of equilibrium starting geometries.", &
524 default_l_val=.false., lone_keyword_l_val=.true.)
529 description=
"Performs a series of checks on the DIIS solution in order to accept the DIIS step."// &
530 " If set to .FALSE. the only check performed is that the angle between the DIIS solution and the"// &
531 " reference vector is less than Pi/2. Can be useful if many DIIS steps are rejected.", &
532 default_l_val=.true., lone_keyword_l_val=.true.)
537 description=
"Controls the printing of DIIS info during a BAND run", &
544 END SUBROUTINE create_opt_band_section
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public elber1987
integer, save, public jonsson2000_1
integer, save, public jonsson1998
integer, save, public jonsson2000_2
integer, save, public wales2004
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 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
Utilities for string manipulations.