20 #include "../base/base_uses.f90"
26 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
27 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'pint_public'
46 TYPE(pint_env_type),
INTENT(IN) :: pint_env
47 REAL(kind=
dp),
DIMENSION(3) :: com_r
50 REAL(kind=
dp) :: tmass
54 DO ia = 1, pint_env%ndim/3
57 com_r(ic) = com_r(ic) + &
58 pint_env%x(ib, (ia - 1)*3 + ic)*pint_env%mass((ia - 1)*3 + ic)
59 tmass = tmass + pint_env%mass((ia - 1)*3 + ic)
67 com_r(:) = com_r(:)/tmass
77 PURE FUNCTION pint_cog_pos(pint_env)
RESULT(cntrd_r)
79 TYPE(pint_env_type),
INTENT(IN) :: pint_env
80 REAL(kind=
dp),
DIMENSION(3) :: cntrd_r
82 INTEGER :: ia, ib, ic, natoms
85 natoms = pint_env%ndim/3
89 cntrd_r(ic) = cntrd_r(ic) + pint_env%x(ib, (ia - 1)*3 + ic)
93 cntrd_r(:) = cntrd_r(:)/real(pint_env%p,
dp)/real(natoms,
dp)
94 END FUNCTION pint_cog_pos
110 SUBROUTINE pint_free_part_bead_x(n, t, rng_gaussian, x, nout)
114 INTEGER,
INTENT(IN) :: n
115 REAL(kind=
dp),
INTENT(IN) :: t
116 TYPE(rng_stream_type),
INTENT(INOUT) :: rng_gaussian
117 REAL(kind=
dp),
DIMENSION(:),
POINTER :: x
118 INTEGER,
INTENT(OUT) :: nout
120 INTEGER :: dl, i1, i2, ib, ic, il, ip, j, nlevels, &
122 REAL(kind=
dp) :: rtmp, tcheck, vrnc,
xc
123 REAL(kind=
dp),
DIMENSION(3) :: cntrd_r
132 nlevels = nint(log(real(n, kind=
dp))/log(2.0_dp))
134 tcheck = abs(real(n, kind=
dp) - rtmp)
135 IF (tcheck > 100.0_dp*epsilon(0.0_dp))
THEN
147 DO il = 0, nlevels - 1
167 xc = (x(3*i1 + ic) + x(3*i2 + ic))/2.0
168 xc =
xc + rng_gaussian%next(variance=vrnc)
180 cntrd_r(ic) = cntrd_r(ic) + x((ib - 1)*3 + ic)
183 cntrd_r(:) = cntrd_r(:)/real(n,
dp)
186 x((ib - 1)*3 + ic) = x((ib - 1)*3 + ic) - cntrd_r(ic)
190 END SUBROUTINE pint_free_part_bead_x
205 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: x0
206 INTEGER,
INTENT(IN) :: n
207 REAL(kind=
dp),
INTENT(IN) :: v
208 REAL(kind=
dp),
DIMENSION(:),
POINTER :: x
209 TYPE(rng_stream_type),
INTENT(INOUT) :: rng_gaussian
212 REAL(kind=
dp) :: r, tau_i, tau_i1
213 REAL(kind=
dp),
DIMENSION(3) :: cntrd_r
220 r = rng_gaussian%next(variance=1.0_dp)
221 tau_i = (real(ib,
dp) - 1.0_dp)/real(n,
dp)
222 tau_i1 = (real(ib + 1,
dp) - 1.0_dp)/real(n,
dp)
223 x(ib*3 + ic) = (x((ib - 1)*3 + ic)*(1.0_dp - tau_i1) + &
224 x(ic)*(tau_i1 - tau_i))/ &
238 cntrd_r(ic) = cntrd_r(ic) + x((ib - 1)*3 + ic)
241 cntrd_r(:) = cntrd_r(:)/real(n,
dp)
244 x((ib - 1)*3 + ic) = x((ib - 1)*3 + ic) - cntrd_r(ic)
258 TYPE(pint_env_type),
INTENT(INOUT) :: pint_env
261 REAL(kind=
dp) :: invp
263 invp = 1.0_dp/pint_env%p
264 pint_env%centroid(:) = 0.0_dp
265 DO ia = 1, pint_env%ndim
266 DO ib = 1, pint_env%p
267 pint_env%centroid(ia) = pint_env%centroid(ia) + pint_env%x(ib, ia)
269 pint_env%centroid(ia) = pint_env%centroid(ia)*invp
Defines the basic variable types.
integer, parameter, public dp
Parallel (pseudo)random number generator (RNG) for multiple streams and substreams of random numbers.
Public path integral routines that can be called from other modules.
pure real(kind=dp) function, dimension(3), public pint_com_pos(pint_env)
Return the center of mass of the PI system.
subroutine, public pint_levy_walk(x0, n, v, x, rng_gaussian)
Perform a Brownian walk of length n around x0 with the variance v.
pure subroutine, public pint_calc_centroid(pint_env)
Calculate the centroid.
Exchange and Correlation functional calculations.