30#include "../base/base_uses.f90"
41 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'pint_pile'
59 CHARACTER(LEN=rng_record_length) :: rng_record
60 INTEGER :: i, i_propagator, j, p
62 REAL(kind=
dp) :: dti2, ex
63 REAL(kind=
dp),
DIMENSION(3, 2) :: initial_seed
66 pint_env%e_pile = 0.0_dp
67 pile_therm%thermostat_energy = 0.0_dp
76 pile_therm%tau = 0.0_dp
80 dti2 = 0.5_dp*pint_env%dt
81 ALLOCATE (pile_therm%c1(p))
82 ALLOCATE (pile_therm%c2(p))
83 ALLOCATE (pile_therm%g_fric(p))
84 ALLOCATE (pile_therm%massfact(p, pint_env%ndim))
88 IF (pile_therm%tau <= 0.0_dp)
THEN
89 pile_therm%g_fric(1) = 0.0_dp
91 pile_therm%g_fric(1) = 1.0_dp/pile_therm%tau
94 pile_therm%c1(1) = exp(-dti2*pile_therm%g_fric(1))
95 ex = pile_therm%c1(1)*pile_therm%c1(1)
96 pile_therm%c2(1) = sqrt(1.0_dp - ex)
98 pile_therm%c1(i) = 0.0_dp
99 pile_therm%c2(i) = 1.0_dp
103 pile_therm%g_fric(i) = 2.0_dp*pile_therm%lamb*sqrt(normalmode_env%lambda(i))
106 ex = -dti2*pile_therm%g_fric(i)
107 pile_therm%c1(i) = exp(ex)
108 ex = pile_therm%c1(i)*pile_therm%c1(i)
109 pile_therm%c2(i) = sqrt(1.0_dp - ex)
112 DO j = 1, pint_env%ndim
114 pile_therm%massfact(i, j) = sqrt(pint_env%kT/pint_env%mass_fict(i, j))
119 NULLIFY (rng_section)
121 subsection_name=
"RNG_INIT")
125 i_rep_val=1, c_val=rng_record)
129 initial_seed(:, :) = real(pint_env%thermostat_rng_seed,
dp)
131 name=
"pile_rng_gaussian", distribution_type=
gaussian, &
132 extended_precision=.true., &
149 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: vold, vnew
150 INTEGER,
INTENT(IN) :: p, ndim, first_mode
151 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: masses
154 CHARACTER(len=*),
PARAMETER :: routinen =
'pint_pile_step'
156 INTEGER :: handle, ibead, idim
157 REAL(kind=
dp) :: delta_ekin
159 CALL timeset(routinen, handle)
162 DO ibead = first_mode, p
163 vnew(ibead, idim) = pile_therm%c1(ibead)*vold(ibead, idim) + &
164 pile_therm%massfact(ibead, idim)*pile_therm%c2(ibead)* &
165 pile_therm%gaussian_rng_stream%next()
166 delta_ekin = delta_ekin + masses(ibead, idim)*( &
167 vnew(ibead, idim)*vnew(ibead, idim) - &
168 vold(ibead, idim)*vold(ibead, idim))
171 pile_therm%thermostat_energy = pile_therm%thermostat_energy - 0.5_dp*delta_ekin
173 CALL timestop(handle)
185 DEALLOCATE (pile_therm%c1)
186 DEALLOCATE (pile_therm%c2)
187 DEALLOCATE (pile_therm%g_fric)
188 DEALLOCATE (pile_therm%massfact)
200 IF (
ASSOCIATED(pint_env%pile_therm))
THEN
201 pint_env%e_pile = pint_env%pile_therm%thermostat_energy
Defines the basic variable types.
integer, parameter, public dp
Parallel (pseudo)random number generator (RNG) for multiple streams and substreams of random numbers.
type(rng_stream_type) function, public rng_stream_type_from_record(rng_record)
Create a RNG stream from a record given as an internal file (string).
integer, parameter, public rng_record_length
integer, parameter, public gaussian
Methods to apply a simple Lagevin thermostat to PI runs. v_new = c1*vold + SQRT(kT/m)*c2*random.
subroutine, public pint_pile_step(vold, vnew, p, ndim, first_mode, masses, pile_therm)
...
subroutine, public pint_pile_init(pile_therm, pint_env, normalmode_env, section)
initializes the data for a pile run
subroutine, public pint_pile_release(pile_therm)
releases the pile environment
subroutine, public pint_calc_pile_energy(pint_env)
returns the pile kinetic energy contribution
data to perform the normalmode transformation
data to use the pile thermostat
environment for a path integral run