23 #include "../base/base_uses.f90"
28 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
29 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'dimer_utils'
32 REAL(kind=
dp),
PARAMETER,
PUBLIC ::
dimer_thrs = epsilon(0.0_dp)*1.0e4_dp
46 REAL(kind=
dp),
DIMENSION(:),
POINTER :: nvec, theta
49 INTEGER :: output_unit
55 check = abs(dot_product(nvec, theta)) < max(1.0e-9_dp,
dimer_thrs)
56 IF (.NOT. check .AND. (output_unit > 0))
THEN
57 WRITE (output_unit, *)
"NVEC and THETA should be orthogonal! Residue: ", &
58 abs(dot_product(nvec, theta))
61 nvec = nvec*cos(dt) + theta*sin(dt)
74 TYPE(dimer_env_type),
POINTER :: dimer_env
75 TYPE(section_vals_type),
POINTER :: motion_section
77 INTEGER :: i, i_rep_val, isize, j, size_array
78 REAL(kind=
dp),
DIMENSION(:),
POINTER :: array
79 TYPE(section_vals_type),
POINTER :: nvec_section
82 "GEO_OPT%TRANSITION_STATE%DIMER%DIMER_VECTOR")
89 main_loop:
DO i = 1,
SIZE(dimer_env%nvec), size_array
90 ALLOCATE (array(size_array))
91 i_rep_val = i_rep_val + 1
94 array(j) = dimer_env%nvec(isize)
95 IF (isize ==
SIZE(dimer_env%nvec))
THEN
96 CALL reallocate(array, 1, j)
105 cpassert(isize ==
SIZE(dimer_env%nvec))
118 REAL(kind=
dp),
DIMENSION(:) :: gradient
119 TYPE(dimer_env_type),
POINTER :: dimer_env
120 REAL(kind=
dp),
INTENT(OUT) :: norm
122 gradient = gradient - dot_product(gradient, dimer_env%nvec)*dimer_env%nvec
123 norm = sqrt(dot_product(gradient, gradient))
124 IF (norm < epsilon(0.0_dp))
THEN
128 gradient = gradient/norm
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
Contains types used for a Dimer Method calculations.
Contains utilities for a Dimer Method calculations.
subroutine, public update_dimer_vec(dimer_env, motion_section)
Updates the orientation of the dimer vector in the input file.
subroutine, public rotate_dimer(nvec, theta, dt)
Performs a rotation of the unit dimer vector.
subroutine, public get_theta(gradient, dimer_env, norm)
This function orthonormalize the vector for the rotational search.
real(kind=dp), parameter, public dimer_thrs
Defines the basic variable types.
integer, parameter, public dp
Utility routines for the memory handling.