37 #include "../base/base_uses.f90"
42 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
43 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'dimer_types'
45 PUBLIC :: dimer_env_type, &
57 TYPE dimer_rotational_type
59 INTEGER :: rotation_step = 0
60 LOGICAL :: interpolate_gradient = .false.
61 REAL(KIND=
dp) :: angle_tol = 0.0_dp, angle1 = 0.0_dp, angle2 = 0.0_dp, &
62 dcdp = 0.0_dp, curvature = 0.0_dp
63 REAL(KIND=
dp),
POINTER,
DIMENSION(:) :: g0 => null(), g1 => null(), g1p => null()
64 END TYPE dimer_rotational_type
72 TYPE dimer_translational_type
74 REAL(KIND=
dp),
POINTER,
DIMENSION(:) :: tls_vec => null()
75 END TYPE dimer_translational_type
83 TYPE dimer_cg_rot_type
84 REAL(KIND=
dp) :: norm_theta = 0.0_dp, norm_theta_old = 0.0_dp, norm_h = 0.0_dp
85 REAL(KIND=
dp),
POINTER,
DIMENSION(:) :: nvec_old => null()
86 END TYPE dimer_cg_rot_type
95 INTEGER :: ref_count = 0
96 REAL(KIND=
dp) :: dr = 0.0_dp
97 REAL(KIND=
dp),
POINTER,
DIMENSION(:) :: nvec => null()
98 REAL(KIND=
dp) :: beta = 0.0_dp
99 TYPE(dimer_rotational_type) :: rot = dimer_rotational_type()
100 TYPE(dimer_translational_type) :: tsl = dimer_translational_type()
101 TYPE(dimer_cg_rot_type) :: cg_rot = dimer_cg_rot_type()
102 LOGICAL :: kdimer = .false.
103 END TYPE dimer_env_type
119 TYPE(dimer_env_type),
POINTER :: dimer_env
120 TYPE(cp_subsys_type),
POINTER :: subsys
121 TYPE(global_environment_type),
POINTER :: globenv
122 TYPE(section_vals_type),
POINTER :: dimer_section
124 INTEGER :: i, isize, j, k, n_rep_val, natom, unit_nr
126 REAL(kind=
dp) :: norm, xval(3)
127 REAL(kind=
dp),
DIMENSION(:),
POINTER :: array
128 TYPE(section_vals_type),
POINTER :: nvec_section
131 cpassert(.NOT.
ASSOCIATED(dimer_env))
133 dimer_env%ref_count = 1
138 ALLOCATE (dimer_env%nvec(natom*3))
139 ALLOCATE (dimer_env%rot%g0(natom*3))
140 ALLOCATE (dimer_env%rot%g1(natom*3))
141 ALLOCATE (dimer_env%rot%g1p(natom*3))
146 IF (unit_nr > 0)
WRITE (unit_nr, *)
"Reading Dimer Vector from file!"
152 DO j = 1,
SIZE(array)
154 dimer_env%nvec(isize) = array(j)
157 cpassert(isize ==
SIZE(dimer_env%nvec))
159 CALL globenv%gaussian_rng_stream%fill(dimer_env%nvec)
167 xval(k) = xval(k) + dimer_env%nvec(i)
171 xval = xval/real(natom*3, kind=
dp)
175 dimer_env%nvec(i) = dimer_env%nvec(i) - xval(k)
181 norm = sqrt(sum(dimer_env%nvec**2))
182 IF (norm <= epsilon(0.0_dp)) &
183 cpabort(
"The norm of the dimer vector is 0! Calculation cannot proceed further.")
184 dimer_env%nvec = dimer_env%nvec/norm
188 l_val=dimer_env%rot%interpolate_gradient)
190 r_val=dimer_env%rot%angle_tol)
192 l_val=dimer_env%kdimer)
194 r_val=dimer_env%beta)
196 dimer_env%cg_rot%norm_h = 1.0_dp
197 dimer_env%rot%g0 = 0.0_dp
198 dimer_env%rot%g1 = 0.0_dp
199 dimer_env%rot%g1p = 0.0_dp
200 ALLOCATE (dimer_env%cg_rot%nvec_old(natom*3))
211 TYPE(dimer_env_type),
POINTER :: dimer_env
213 cpassert(
ASSOCIATED(dimer_env))
214 cpassert(dimer_env%ref_count > 0)
215 dimer_env%ref_count = dimer_env%ref_count + 1
226 TYPE(dimer_env_type),
POINTER :: dimer_env
228 IF (
ASSOCIATED(dimer_env))
THEN
229 cpassert(dimer_env%ref_count > 0)
230 dimer_env%ref_count = dimer_env%ref_count - 1
231 IF (dimer_env%ref_count == 0)
THEN
232 IF (
ASSOCIATED(dimer_env%nvec))
THEN
233 DEALLOCATE (dimer_env%nvec)
235 IF (
ASSOCIATED(dimer_env%rot%g0))
THEN
236 DEALLOCATE (dimer_env%rot%g0)
238 IF (
ASSOCIATED(dimer_env%rot%g1))
THEN
239 DEALLOCATE (dimer_env%rot%g1)
241 IF (
ASSOCIATED(dimer_env%rot%g1p))
THEN
242 DEALLOCATE (dimer_env%rot%g1p)
244 IF (
ASSOCIATED(dimer_env%cg_rot%nvec_old))
THEN
245 DEALLOCATE (dimer_env%cg_rot%nvec_old)
248 NULLIFY (dimer_env%tsl%tls_vec)
249 DEALLOCATE (dimer_env)
266 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT) :: vec
267 TYPE(cp_subsys_type),
POINTER :: subsys
269 INTEGER :: ii, ikind, ind, iparticle, nfixed_atoms, &
271 TYPE(fixd_constraint_type),
DIMENSION(:),
POINTER :: fixd_list
272 TYPE(molecule_kind_list_type),
POINTER :: molecule_kinds
273 TYPE(molecule_kind_type),
DIMENSION(:),
POINTER :: molecule_kind_set
274 TYPE(molecule_kind_type),
POINTER :: molecule_kind
276 NULLIFY (molecule_kinds, molecule_kind, fixd_list)
280 molecule_kinds=molecule_kinds)
281 molecule_kind_set => molecule_kinds%els
285 nkinds = molecule_kinds%n_els
287 molecule_kind => molecule_kind_set(ikind)
289 nfixd=nfixed_atoms, &
291 IF (
ASSOCIATED(fixd_list))
THEN
292 DO ii = 1, nfixed_atoms
293 IF (.NOT. fixd_list(ii)%restraint%active)
THEN
294 iparticle = fixd_list(ii)%fixd
295 ind = (iparticle - 1)*3
297 SELECT CASE (fixd_list(ii)%itype)
299 vec(ind + 1) = 0.0_dp
301 vec(ind + 2) = 0.0_dp
303 vec(ind + 3) = 0.0_dp
305 vec(ind + 1) = 0.0_dp
306 vec(ind + 2) = 0.0_dp
308 vec(ind + 1) = 0.0_dp
309 vec(ind + 3) = 0.0_dp
311 vec(ind + 2) = 0.0_dp
312 vec(ind + 3) = 0.0_dp
314 vec(ind + 1) = 0.0_dp
315 vec(ind + 2) = 0.0_dp
316 vec(ind + 3) = 0.0_dp
Handles all functions related to the CELL.
integer, parameter, public use_perd_xyz
integer, parameter, public use_perd_y
integer, parameter, public use_perd_xz
integer, parameter, public use_perd_x
integer, parameter, public use_perd_z
integer, parameter, public use_perd_yz
integer, parameter, public use_perd_xy
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...
types that represent a subsys, i.e. a part of the system
subroutine, public cp_subsys_get(subsys, ref_count, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell)
returns information about various attributes of the given subsys
Contains types used for a Dimer Method calculations.
subroutine, public dimer_env_retain(dimer_env)
...
subroutine, public dimer_env_release(dimer_env)
...
subroutine, public dimer_fixed_atom_control(vec, subsys)
Set parts of a given array vec to zero according to fixed atom constraints. When atoms are (partially...
subroutine, public dimer_env_create(dimer_env, subsys, globenv, dimer_section)
...
Define type storing the global information of a run. Keep the amount of stored data small....
Defines the basic variable types.
integer, parameter, public dp
represent a simple array based list of the given type
Define the molecule kind structure types and the corresponding functionality.
subroutine, public get_molecule_kind(molecule_kind, atom_list, bond_list, bend_list, ub_list, impr_list, opbend_list, colv_list, fixd_list, g3x3_list, g4x6_list, vsite_list, torsion_list, shell_list, name, mass, charge, kind_number, natom, nbend, nbond, nub, nimpr, nopbend, nconstraint, nconstraint_fixd, nfixd, ncolv, ng3x3, ng4x6, nvsite, nfixd_restraint, ng3x3_restraint, ng4x6_restraint, nvsite_restraint, nrestraints, nmolecule, nsgf, nshell, ntorsion, molecule_list, nelectron, nelectron_alpha, nelectron_beta, bond_kind_set, bend_kind_set, ub_kind_set, impr_kind_set, opbend_kind_set, torsion_kind_set, molname_generated)
Get informations about a molecule kind.