(git:871dbd5)
Loading...
Searching...
No Matches
neb_methods.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 Module performing a Nudged Elastic Band Calculation
10!> \note
11!> Numerical accuracy for parallel runs:
12!> Each replica starts the SCF run from the one optimized
13!> in a previous run. It may happen then energies and derivatives
14!> of a serial run and a parallel run could be slightly different
15!> 'cause of a different starting density matrix.
16!> Exact results are obtained using:
17!> EXTRAPOLATION USE_GUESS in QS section (Teo 09.2006)
18!> \author Teodoro Laino 09.2006
19!> \par History
20!> - Teodoro Laino 10.2008 [tlaino] - University of Zurich
21!> Extension to a subspace of collective variables
22! **************************************************************************************************
40 USE header, ONLY: band_header
44 do_sm
49 USE kinds, ONLY: dp
51 USE neb_io, ONLY: dump_neb_final,&
55 USE neb_md_utils, ONLY: control_vels_a,&
58 neb_ls
59 USE neb_types, ONLY: neb_type,&
69 USE physcon, ONLY: massunit
73#include "../base/base_uses.f90"
74
75 IMPLICIT NONE
76 PRIVATE
77 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'neb_methods'
78 LOGICAL, PARAMETER, PRIVATE :: debug_this_module = .false.
79 PUBLIC :: neb
80
81CONTAINS
82
83! **************************************************************************************************
84!> \brief Real subroutine for NEB calculations
85!> \param input ...
86!> \param input_declaration ...
87!> \param para_env ...
88!> \param globenv ...
89!> \author Teodoro Laino 09.2006
90!> \note
91!> Based on the use of replica_env
92! **************************************************************************************************
93 SUBROUTINE neb(input, input_declaration, para_env, globenv)
94 TYPE(section_vals_type), POINTER :: input
95 TYPE(section_type), POINTER :: input_declaration
96 TYPE(mp_para_env_type), POINTER :: para_env
97 TYPE(global_environment_type), POINTER :: globenv
98
99 CHARACTER(len=*), PARAMETER :: routinen = 'neb'
100
101 INTEGER :: handle, ierr, iw, iw2, nrep, &
102 output_unit, prep, proc_dist_type
103 LOGICAL :: check, row_force
104 TYPE(cp_logger_type), POINTER :: logger
105 TYPE(cp_subsys_type), POINTER :: subsys
106 TYPE(f_env_type), POINTER :: f_env
107 TYPE(neb_type), POINTER :: neb_env
108 TYPE(neb_var_type), POINTER :: coords, forces, vels
109 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
110 TYPE(replica_env_type), POINTER :: rep_env
111 TYPE(section_vals_type), POINTER :: diis_section, force_env_section, &
112 md_section, motion_section, &
113 neb_section, print_section
114
115 CALL timeset(routinen, handle)
116 NULLIFY (logger, subsys, f_env, rep_env)
117 NULLIFY (forces, coords, vels, neb_env)
118 logger => cp_get_default_logger()
119 CALL cp_add_iter_level(logger%iter_info, "BAND")
120 motion_section => section_vals_get_subs_vals(input, "MOTION")
121 print_section => section_vals_get_subs_vals(motion_section, "PRINT")
122 neb_section => section_vals_get_subs_vals(motion_section, "BAND")
123 output_unit = cp_print_key_unit_nr(logger, neb_section, "PROGRAM_RUN_INFO", &
124 extension=".nebLog")
125 CALL section_vals_val_get(neb_section, "NPROC_REP", i_val=prep)
126 CALL section_vals_val_get(neb_section, "PROC_DIST_TYPE", i_val=proc_dist_type)
127 row_force = (proc_dist_type == do_rep_blocked)
128 nrep = max(1, para_env%num_pe/prep)
129 IF (nrep*prep /= para_env%num_pe .AND. output_unit > 0) THEN
130 CALL cp_warn(__location__, &
131 "Number of totally requested processors ("//trim(adjustl(cp_to_string(para_env%num_pe)))//") "// &
132 "is not compatible with the number of processors requested per replica ("// &
133 trim(adjustl(cp_to_string(prep)))//") and the number of replicas ("// &
134 trim(adjustl(cp_to_string(nrep)))//") . ["// &
135 trim(adjustl(cp_to_string(para_env%num_pe - nrep*prep)))//"] processors will be wasted!")
136 END IF
137 force_env_section => section_vals_get_subs_vals(input, "FORCE_EVAL")
138 ! Create Replica Environments
139 IF (output_unit > 0) WRITE (output_unit, '(T2,"NEB|",A)') " Replica_env Setup. START"
140 CALL rep_env_create(rep_env, para_env=para_env, input=input, &
141 input_declaration=input_declaration, nrep=nrep, prep=prep, row_force=row_force)
142 IF (output_unit > 0) WRITE (output_unit, '(T2,"NEB|",A)') " Replica_env Setup. END"
143 IF (ASSOCIATED(rep_env)) THEN
144 cpassert(SIZE(rep_env%local_rep_indices) == 1)
145 CALL f_env_add_defaults(f_env_id=rep_env%f_env_id, f_env=f_env)
146 CALL force_env_get(f_env%force_env, subsys=subsys)
147 particle_set => subsys%particles%els
148 ! Read NEB controlling parameters
149 ALLOCATE (neb_env)
150 neb_env%force_env => f_env%force_env
151 neb_env%root_section => input
152 neb_env%force_env_section => force_env_section
153 neb_env%motion_print_section => print_section
154 neb_env%neb_section => neb_section
155 neb_env%nsize_xyz = rep_env%ndim
156 neb_env%nsize_int = number_of_colvar(f_env%force_env)
157 check = (neb_env%nsize_xyz >= neb_env%nsize_int)
158 cpassert(check)
159 ! Check that the used colvar are uniquely determined
160 check = (number_of_colvar(f_env%force_env) == &
161 number_of_colvar(f_env%force_env, unique=.true.))
162 cpassert(check)
163 CALL read_neb_section(neb_env, neb_section)
164 ! Print BAND header
165 iw2 = cp_print_key_unit_nr(logger, neb_section, "BANNER", extension=".nebLog")
166 CALL band_header(iw2, neb_env%number_of_replica, nrep, prep)
167 CALL cp_print_key_finished_output(iw2, logger, neb_section, "BANNER")
168 ! Allocate the principal vectors used in the BAND calculation
169 CALL neb_var_create(coords, neb_env, full_allocation=.true.)
170 CALL neb_var_create(forces, neb_env)
171 CALL neb_var_create(vels, neb_env)
172 ! Collecting the coordinates of the starting replicas of the BAND calculation
173 IF (output_unit > 0) WRITE (output_unit, '(T2,"NEB|",A)') " Building initial set of coordinates. START"
174 iw = cp_print_key_unit_nr(logger, neb_section, "PROGRAM_RUN_INFO/INITIAL_CONFIGURATION_INFO", &
175 extension=".nebLog")
176 CALL build_replica_coords(neb_section, particle_set, coords, vels, neb_env, iw, globenv, &
177 rep_env%para_env)
178 CALL cp_print_key_finished_output(iw, logger, neb_section, &
179 "PROGRAM_RUN_INFO/INITIAL_CONFIGURATION_INFO")
180 IF (output_unit > 0) WRITE (output_unit, '(T2,"NEB|",A)') " Building initial set of coordinates. END"
181 ! Print some additional info in the replica_env initialization file
182 CALL neb_rep_env_map_info(rep_env, neb_env)
183 ! Perform NEB optimization
184 SELECT CASE (neb_env%opt_type)
185 CASE (band_md_opt)
186 neb_env%opt_type_label = "MOLECULAR DYNAMICS"
187 md_section => section_vals_get_subs_vals(neb_section, "OPTIMIZE_BAND%MD")
188 CALL neb_md(rep_env, neb_env, coords, vels, forces, particle_set, output_unit, &
189 md_section, logger, globenv)
190 CASE (band_diis_opt)
191 neb_env%opt_type_label = "DIIS"
192 diis_section => section_vals_get_subs_vals(neb_section, "OPTIMIZE_BAND%DIIS")
193 CALL neb_diis(rep_env, neb_env, coords, vels, forces, particle_set, output_unit, &
194 diis_section, logger, globenv)
195 END SELECT
196 ! Release force_eval
197 CALL f_env_rm_defaults(f_env, ierr)
198 ! Release coords, vels and forces
199 CALL neb_var_release(coords)
200 CALL neb_var_release(forces)
201 CALL neb_var_release(vels)
202 ! At the end let's destroy the environment of the BAND calculation
203 DEALLOCATE (neb_env)
204 END IF
205 CALL rep_env_release(rep_env)
206 CALL cp_print_key_finished_output(output_unit, logger, neb_section, &
207 "PROGRAM_RUN_INFO")
208 CALL cp_rm_iter_level(logger%iter_info, "BAND")
209 CALL timestop(handle)
210 END SUBROUTINE neb
211
212! **************************************************************************************************
213!> \brief MD type optimization NEB
214!> \param rep_env ...
215!> \param neb_env ...
216!> \param coords ...
217!> \param vels ...
218!> \param forces ...
219!> \param particle_set ...
220!> \param output_unit ...
221!> \param md_section ...
222!> \param logger ...
223!> \param globenv ...
224!> \author Teodoro Laino 09.2006
225! **************************************************************************************************
226 SUBROUTINE neb_md(rep_env, neb_env, coords, vels, forces, particle_set, output_unit, &
227 md_section, logger, globenv)
228 TYPE(replica_env_type), POINTER :: rep_env
229 TYPE(neb_type), OPTIONAL, POINTER :: neb_env
230 TYPE(neb_var_type), POINTER :: coords, vels, forces
231 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
232 INTEGER, INTENT(IN) :: output_unit
233 TYPE(section_vals_type), POINTER :: md_section
234 TYPE(cp_logger_type), POINTER :: logger
235 TYPE(global_environment_type), POINTER :: globenv
236
237 CHARACTER(len=*), PARAMETER :: routinen = 'neb_md'
238
239 INTEGER :: handle, iatom, ic, is, istep, iw, &
240 max_steps, natom, shell_index
241 LOGICAL :: converged, should_stop
242 REAL(kind=dp) :: dt
243 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: distances, energies
244 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: mass
245 TYPE(neb_var_type), POINTER :: dcoords
246 TYPE(section_vals_type), POINTER :: tc_section, vc_section
247
248 CALL timeset(routinen, handle)
249 NULLIFY (dcoords, tc_section, vc_section)
250 cpassert(ASSOCIATED(coords))
251 cpassert(ASSOCIATED(vels))
252 ! MD band for string methods type does not make anywa sense. Stop calculation.
253 IF (neb_env%id_type == do_sm) THEN
254 cpwarn("MD band optimization and String Method incompatible.")
255 END IF
256 ! Output unit
257 iw = cp_print_key_unit_nr(logger, neb_env%neb_section, "REPLICA_INFO", &
258 extension=".replicaLog")
259 tc_section => section_vals_get_subs_vals(md_section, "TEMP_CONTROL")
260 vc_section => section_vals_get_subs_vals(md_section, "VEL_CONTROL")
261 CALL section_vals_val_get(md_section, "TIMESTEP", r_val=dt)
262 CALL section_vals_val_get(md_section, "MAX_STEPS", i_val=max_steps)
263 ! Initial setup for MD
264 CALL neb_var_create(dcoords, neb_env)
265 ALLOCATE (mass(SIZE(coords%wrk, 1), neb_env%number_of_replica))
266 ALLOCATE (energies(neb_env%number_of_replica))
267 ALLOCATE (distances(neb_env%number_of_replica - 1))
268 ! Setting up the mass array
269 IF (neb_env%use_colvar) THEN
270 mass(:, :) = 0.5_dp*dt/massunit
271 ELSE
272 natom = SIZE(particle_set)
273 DO iatom = 1, natom
274 ic = 3*(iatom - 1)
275 shell_index = particle_set(iatom)%shell_index
276 IF (shell_index == 0) THEN
277 mass(ic + 1:ic + 3, :) = 0.5_dp*dt/particle_set(iatom)%atomic_kind%mass
278 ELSE
279 is = 3*(natom + shell_index - 1)
280 mass(ic + 1:ic + 3, :) = 0.5_dp*dt/particle_set(iatom)%atomic_kind%shell%mass_core
281 mass(is + 1:is + 3, :) = 0.5_dp*dt/particle_set(iatom)%atomic_kind%shell%mass_shell
282 END IF
283 END DO
284 END IF
285 ! Initializing forces array
286 CALL reorient_images(neb_env%rotate_frames, particle_set, coords, vels, &
287 output_unit, distances, neb_env%number_of_replica)
288 neb_env%avg_distance = sqrt(sum(distances*distances)/real(SIZE(distances), kind=dp))
289 CALL neb_calc_energy_forces(rep_env, neb_env, coords, energies, forces, &
290 particle_set, iw)
291
292 CALL dump_neb_info(neb_env=neb_env, &
293 coords=coords, &
294 vels=vels, &
295 forces=forces, &
296 particle_set=particle_set, &
297 logger=logger, &
298 istep=0, &
299 energies=energies, &
300 distances=distances, &
301 output_unit=output_unit)
302 md_opt_loop: DO istep = 1, max_steps
303 CALL cp_iterate(logger%iter_info, iter_nr=istep)
304 ! Save the optimization step counter
305 neb_env%istep = istep
306 ! Velocity Verlet (first part)
307 vels%wrk(:, :) = vels%wrk(:, :) + mass(:, :)*forces%wrk(:, :)
308 ! Control on velocity - I part [rescale, annealing]
309 CALL control_vels_a(vels, particle_set, tc_section, vc_section, output_unit, &
310 istep)
311 ! Coordinate step
312 dcoords%wrk(:, :) = dt*vels%wrk(:, :)
313 coords%wrk(:, :) = coords%wrk(:, :) + dcoords%wrk(:, :)
314
315 CALL reorient_images(neb_env%rotate_frames, particle_set, coords, vels, &
316 output_unit, distances, neb_env%number_of_replica)
317 neb_env%avg_distance = sqrt(sum(distances*distances)/real(SIZE(distances), kind=dp))
318 CALL neb_calc_energy_forces(rep_env, neb_env, coords, energies, forces, &
319 particle_set, iw)
320 ! Check for an external exit command
321 CALL external_control(should_stop, "NEB", globenv=globenv)
322 IF (should_stop) EXIT md_opt_loop
323 ! Control on velocity - II part [check vels VS forces, Steepest Descent like]
324 CALL control_vels_b(vels, forces, vc_section)
325 ! Velocity Verlet (second part)
326 vels%wrk(:, :) = vels%wrk(:, :) + mass(:, :)*forces%wrk(:, :)
327 ! Dump Infos
328 CALL dump_neb_info(neb_env=neb_env, &
329 coords=coords, &
330 vels=vels, &
331 forces=forces, &
332 particle_set=particle_set, &
333 logger=logger, &
334 istep=istep, &
335 energies=energies, &
336 distances=distances, &
337 output_unit=output_unit)
338 converged = check_convergence(neb_env, dcoords, forces, logger)
339 IF (converged) THEN
340 IF (output_unit > 0) THEN
341 WRITE (unit=output_unit, fmt="(/,T2,A)") repeat("*", 79)
342 WRITE (unit=output_unit, fmt="(T2,A,T32,A,T78,A)") &
343 "***", "BAND TASK COMPLETED", "***"
344 WRITE (unit=output_unit, fmt="(T2,A)") repeat("*", 79)
345 END IF
346 EXIT md_opt_loop
347 END IF
348 END DO md_opt_loop
349 CALL dump_neb_final(neb_env, energies, coords, particle_set, logger, output_unit, converged)
350 DEALLOCATE (mass)
351 DEALLOCATE (energies)
352 DEALLOCATE (distances)
353 CALL neb_var_release(dcoords)
354 CALL cp_print_key_finished_output(iw, logger, neb_env%neb_section, &
355 "REPLICA_INFO")
356 CALL timestop(handle)
357
358 END SUBROUTINE neb_md
359
360! **************************************************************************************************
361!> \brief DIIS type optimization NEB
362!> \param rep_env ...
363!> \param neb_env ...
364!> \param coords ...
365!> \param vels ...
366!> \param forces ...
367!> \param particle_set ...
368!> \param output_unit ...
369!> \param diis_section ...
370!> \param logger ...
371!> \param globenv ...
372!> \author Teodoro Laino 09.2006
373! **************************************************************************************************
374 SUBROUTINE neb_diis(rep_env, neb_env, coords, vels, forces, particle_set, output_unit, &
375 diis_section, logger, globenv)
376 TYPE(replica_env_type), POINTER :: rep_env
377 TYPE(neb_type), OPTIONAL, POINTER :: neb_env
378 TYPE(neb_var_type), POINTER :: coords, vels, forces
379 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
380 INTEGER, INTENT(IN) :: output_unit
381 TYPE(section_vals_type), POINTER :: diis_section
382 TYPE(cp_logger_type), POINTER :: logger
383 TYPE(global_environment_type), POINTER :: globenv
384
385 CHARACTER(len=*), PARAMETER :: routinen = 'neb_diis'
386
387 INTEGER :: handle, istep, iw, iw2, max_sd_steps, &
388 max_steps, n_diis
389 INTEGER, DIMENSION(:), POINTER :: set_err
390 LOGICAL :: check_diis, converged, diis_on, do_ls, &
391 should_stop, skip_ls
392 REAL(kind=dp) :: max_stepsize, norm, stepsize, stepsize0
393 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: distances, energies
394 REAL(kind=dp), DIMENSION(:, :), POINTER :: crr, err
395 TYPE(neb_var_type), POINTER :: sline
396
397 CALL timeset(routinen, handle)
398 NULLIFY (sline, crr, err)
399 neb_env%opt_type_label = "SD"
400 do_ls = .true.
401 cpassert(ASSOCIATED(coords))
402 cpassert(ASSOCIATED(vels))
403 cpassert(ASSOCIATED(forces))
404 iw = cp_print_key_unit_nr(logger, neb_env%neb_section, "REPLICA_INFO", &
405 extension=".replicaLog")
406 CALL section_vals_val_get(diis_section, "MAX_STEPS", i_val=max_steps)
407 CALL section_vals_val_get(diis_section, "N_DIIS", i_val=n_diis)
408 CALL section_vals_val_get(diis_section, "STEPSIZE", r_val=stepsize0)
409 CALL section_vals_val_get(diis_section, "MAX_STEPSIZE", r_val=max_stepsize)
410 CALL section_vals_val_get(diis_section, "NO_LS", l_val=skip_ls)
411 CALL section_vals_val_get(diis_section, "MAX_SD_STEPS", i_val=max_sd_steps)
412 CALL section_vals_val_get(diis_section, "CHECK_DIIS", l_val=check_diis)
413 iw2 = cp_print_key_unit_nr(logger, diis_section, "DIIS_INFO", &
414 extension=".diisLog")
415 ! Initial setup for DIIS
416 stepsize = stepsize0
417 ! Allocate type for Line Search direction
418 CALL neb_var_create(sline, neb_env, full_allocation=.true.)
419 ! Array of error vectors
420 ALLOCATE (err(product(coords%size_wrk), n_diis))
421 ALLOCATE (crr(product(coords%size_wrk), n_diis))
422 ALLOCATE (set_err(n_diis))
423 ALLOCATE (energies(neb_env%number_of_replica))
424 ALLOCATE (distances(neb_env%number_of_replica - 1))
425 ! Initializing forces array
426 CALL reorient_images(neb_env%rotate_frames, particle_set, coords, vels, &
427 output_unit, distances, neb_env%number_of_replica)
428 CALL reparametrize_images(neb_env%reparametrize_frames, neb_env%spline_order, &
429 neb_env%smoothing, coords%wrk, sline%wrk, distances)
430 neb_env%avg_distance = sqrt(sum(distances*distances)/real(SIZE(distances), kind=dp))
431 CALL neb_calc_energy_forces(rep_env, neb_env, coords, energies, forces, &
432 particle_set, iw)
433 ! Dump Infos
434 CALL dump_neb_info(neb_env=neb_env, &
435 coords=coords, &
436 forces=forces, &
437 particle_set=particle_set, &
438 logger=logger, &
439 istep=0, &
440 energies=energies, &
441 distances=distances, &
442 vels=vels, &
443 output_unit=output_unit)
444 ! If rotation is requested let's apply it at the beginning of the
445 ! Geometry optimization and then let's disable it
446 neb_env%rotate_frames = .false.
447 ! Main SD/DIIS loop
448 set_err = -1
449 DO istep = 1, max_steps
450 CALL cp_iterate(logger%iter_info, iter_nr=istep)
451 neb_env%opt_type_label = "SD"
452 ! Save the optimization step counter
453 neb_env%istep = istep
454 ! Perform one step of SD with line search
455 norm = sqrt(sum(forces%wrk*forces%wrk))
456 IF (norm < epsilon(0.0_dp)) THEN
457 ! Let's handle the case in which the band is already fully optimized
458 converged = .true.
459 EXIT
460 END IF
461 sline%wrk = forces%wrk/norm
462 IF (do_ls .AND. (.NOT. skip_ls)) THEN
463 CALL neb_ls(stepsize, sline, rep_env, neb_env, coords, energies, forces, &
464 vels, particle_set, iw, output_unit, distances, diis_section, iw2)
465 IF (iw2 > 0) &
466 WRITE (iw2, '(T2,A,T69,F12.6)') "SD| Stepsize in SD after linesearch", &
467 stepsize
468 ELSE
469 stepsize = min(norm*stepsize0, max_stepsize)
470 IF (iw2 > 0) &
471 WRITE (iw2, '(T2,A,T69,F12.6)') "SD| Stepsize in SD no linesearch performed", &
472 stepsize
473 END IF
474 sline%wrk = stepsize*sline%wrk
475 diis_on = accept_diis_step(istep > max_sd_steps, n_diis, err, crr, set_err, sline, coords, &
476 check_diis, iw2)
477 IF (diis_on) THEN
478 neb_env%opt_type_label = "DIIS"
479 END IF
480 do_ls = .true.
481 IF (count(set_err == -1) == 1) do_ls = .false.
482 coords%wrk = coords%wrk + sline%wrk
483 ! Compute forces
484 CALL reorient_images(neb_env%rotate_frames, particle_set, coords, vels, &
485 output_unit, distances, neb_env%number_of_replica)
486 CALL reparametrize_images(neb_env%reparametrize_frames, neb_env%spline_order, &
487 neb_env%smoothing, coords%wrk, sline%wrk, distances)
488 neb_env%avg_distance = sqrt(sum(distances*distances)/real(SIZE(distances), kind=dp))
489 CALL neb_calc_energy_forces(rep_env, neb_env, coords, energies, forces, &
490 particle_set, iw)
491 ! Check for an external exit command
492 CALL external_control(should_stop, "NEB", globenv=globenv)
493 IF (should_stop) EXIT
494 ! Dump Infos
495 CALL dump_neb_info(neb_env=neb_env, &
496 coords=coords, &
497 forces=forces, &
498 particle_set=particle_set, &
499 logger=logger, &
500 istep=istep, &
501 energies=energies, &
502 distances=distances, &
503 vels=vels, &
504 output_unit=output_unit)
505
506 converged = check_convergence(neb_env, sline, forces, logger)
507 IF (converged) THEN
508 IF (output_unit > 0) THEN
509 WRITE (unit=output_unit, fmt="(/,T2,A)") repeat("*", 79)
510 WRITE (unit=output_unit, fmt="(T2,A,T32,A,T78,A)") &
511 "***", "BAND TASK COMPLETED", "***"
512 WRITE (unit=output_unit, fmt="(T2,A)") repeat("*", 79)
513 END IF
514 EXIT
515 END IF
516 END DO
517 CALL dump_neb_final(neb_env, energies, coords, particle_set, logger, output_unit, converged)
518 DEALLOCATE (energies)
519 DEALLOCATE (distances)
520 DEALLOCATE (err)
521 DEALLOCATE (crr)
522 DEALLOCATE (set_err)
523 CALL neb_var_release(sline)
524 CALL cp_print_key_finished_output(iw, logger, neb_env%neb_section, &
525 "REPLICA_INFO")
526 CALL timestop(handle)
527 END SUBROUTINE neb_diis
528
529END MODULE neb_methods
evaluations of colvar for internal coordinates schemes
integer function, public number_of_colvar(force_env, only_intra_colvar, unique)
Gives back the number of colvar defined for a force_eval.
Routines to handle the external control of CP2K.
subroutine, public external_control(should_stop, flag, globenv, target_time, start_time, force_check)
External manipulations during a run : when the <PROJECT_NAME>.EXIT_$runtype command is sent the progr...
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)
...
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,...
subroutine, public cp_iterate(iteration_info, last, iter_nr, increment, iter_nr_out)
adds one to the actual iteration
subroutine, public cp_rm_iter_level(iteration_info, level_name, n_rlevel_att)
Removes an iteration level.
subroutine, public cp_add_iter_level(iteration_info, level_name, n_rlevel_new)
Adds an iteration level.
types that represent a subsys, i.e. a part of the system
interface to use cp2k as library
subroutine, public f_env_add_defaults(f_env_id, f_env, handle)
adds the default environments of the f_env to the stack of the defaults, and returns a new error and ...
subroutine, public f_env_rm_defaults(f_env, ierr, handle)
removes the default environments of the f_env to the stack of the defaults, and sets ierr accordingly...
Interface for the force calculations.
recursive subroutine, public force_env_get(force_env, in_use, fist_env, qs_env, meta_env, fp_env, subsys, para_env, potential_energy, additional_potential, kinetic_energy, harmonic_shell, kinetic_shell, cell, sub_force_env, qmmm_env, qmmmx_env, eip_env, pwdft_env, globenv, input, force_env_section, method_name_id, root_section, mixed_env, nnp_env, embed_env, ipi_env)
returns various attributes about the force environment
Define type storing the global information of a run. Keep the amount of stored data small....
subroutine, public band_header(iw, ni, nr, np)
...
Definition header.F:384
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public band_md_opt
integer, parameter, public do_rep_blocked
integer, parameter, public do_sm
integer, parameter, public band_diis_opt
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Interface to the message passing library MPI.
I/O Module for Nudged Elastic Band Calculation.
Definition neb_io.F:20
subroutine, public read_neb_section(neb_env, neb_section)
Read data from the NEB input section.
Definition neb_io.F:95
subroutine, public neb_rep_env_map_info(rep_env, neb_env)
Print some mapping infos in the replica_env setup output files i.e. prints in which files one can fin...
Definition neb_io.F:713
subroutine, public dump_neb_info(neb_env, coords, vels, forces, particle_set, logger, istep, energies, distances, output_unit)
dump print info of a NEB run
Definition neb_io.F:290
subroutine, public dump_neb_final(neb_env, energies, coords, particle_set, logger, output_unit, converged)
dump final structures after a NEB run
Definition neb_io.F:172
Module with utility to perform MD Nudged Elastic Band Calculation.
subroutine, public control_vels_a(vels, particle_set, tc_section, vc_section, output_unit, istep)
Control on velocities - I part.
subroutine, public control_vels_b(vels, forces, vc_section)
Control on velocities - II part.
Module performing a Nudged Elastic Band Calculation.
Definition neb_methods.F:23
subroutine, public neb(input, input_declaration, para_env, globenv)
Real subroutine for NEB calculations.
Definition neb_methods.F:94
Module with utility to perform MD Nudged Elastic Band Calculation.
logical function, public accept_diis_step(apply_diis, n_diis, err, crr, set_err, sline, coords, check_diis, iw2)
Performs few basic operations for the NEB DIIS optimization.
subroutine, public neb_ls(stepsize, sline, rep_env, neb_env, coords, energies, forces, vels, particle_set, iw, output_unit, distances, diis_section, iw2)
Perform a line minimization search in optimizing a NEB with DIIS.
Typo for Nudged Elastic Band Calculation.
Definition neb_types.F:20
subroutine, public neb_var_release(neb_var)
Releases a variable type for BAND calculation.
Definition neb_types.F:127
subroutine, public neb_var_create(neb_var, neb_env, full_allocation)
Creates a variable type for BAND calculation.
Definition neb_types.F:84
Module with utility for Nudged Elastic Band Calculation.
Definition neb_utils.F:20
subroutine, public neb_calc_energy_forces(rep_env, neb_env, coords, energies, forces, particle_set, output_unit)
Driver to compute energy and forces within a NEB, Based on the use of the replica_env.
Definition neb_utils.F:402
subroutine, public build_replica_coords(neb_section, particle_set, coords, vels, neb_env, iw, globenv, para_env)
Constructs or Read the coordinates for all replica.
Definition neb_utils.F:140
subroutine, public reorient_images(rotate_frames, particle_set, coords, vels, iw, distances, number_of_replica)
Reorient iteratively all images of the NEB chain in order to have always the smaller RMSD between two...
Definition neb_utils.F:912
subroutine, public reparametrize_images(reparametrize_frames, spline_order, smoothing, coords, sline, distances)
Reparametrization of the replica for String Method with splines.
Definition neb_utils.F:965
logical function, public check_convergence(neb_env, dcoords, forces, logger)
Checks for convergence criteria during a NEB run.
Definition neb_utils.F:1030
Define the data structure for the particle information.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public massunit
Definition physcon.F:141
methods to setup replicas of the same system differing only by atom positions and velocities (as used...
subroutine, public rep_env_create(rep_env, para_env, input, input_declaration, nrep, prep, sync_v, keep_wf_history, row_force)
creates a replica environment together with its force environment
types used to handle many replica of the same system that differ only in atom positions,...
subroutine, public rep_env_release(rep_env)
releases the given replica environment
type of a logger, at the moment it contains just a print level starting at which level it should be l...
represents a system: atoms, molecules, their pos,vel,...
contains the initially parsed file and the initial parallel environment
represent a section of the input file
stores all the informations relevant to an mpi environment
keeps replicated information about the replicas