Skip to content

Commit 1da3d05

Browse files
committed
cleanup of temperature and pressure control for MD integrators
1 parent cbe6b45 commit 1da3d05

File tree

8 files changed

+247
-265
lines changed

8 files changed

+247
-265
lines changed

source/baoab.f

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,9 @@ subroutine baoab (istep,dt)
156156
c
157157
call gradient (epot,derivs)
158158
c
159-
c make half-step correction to control the pressure
159+
c compute the kinetic energy from half-step velocities
160160
c
161161
call kinetic (eksum,ekin,temp)
162-
call pressure2 (epot,temp)
163162
c
164163
c second B step for accelerations and full-step velocities
165164
c
@@ -188,11 +187,12 @@ subroutine baoab (istep,dt)
188187
end do
189188
end if
190189
c
191-
c compute the kinetic energy and control the pressure;
192-
c half-step kinetic energy gives better temperature control
190+
c compute full-step kinetic energy and pressure correction;
191+
c half-step kinetic energy gives better pressure control
193192
c
194193
c call kinetic (eksum,ekin,temp)
195194
call pressure (dt,epot,ekin,temp,pres,stress)
195+
call pressure2 (epot,temp)
196196
c
197197
c final constraint step to enforce position convergence
198198
c

source/ghmcstep.f

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ subroutine ghmcstep (istep,dt)
146146
c
147147
if (use_rattle) call rattle2 (dt)
148148
c
149-
c determine the kinetic energy, temperature and total energy
149+
c compute the kinetic energy, temperature and total energy
150150
c
151151
call kinetic (eksum,ekin,temp)
152152
etot = eksum + epot
@@ -175,7 +175,7 @@ subroutine ghmcstep (istep,dt)
175175
end do
176176
end if
177177
c
178-
c evolve velocities according to midpoint Euler for half-step
178+
c update velocities using midpoint Euler for half-step
179179
c
180180
call ghmcterm (istep,dt,alpha,beta)
181181
do i = 1, nuse
@@ -225,6 +225,7 @@ subroutine ghmcstep (istep,dt)
225225
c
226226
call mdstat (istep,dt,etot,epot,eksum,temp,pres)
227227
call mdsave (istep,dt,epot,eksum)
228+
call mdrest (istep)
228229
return
229230
end
230231
c

source/mdinit.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ subroutine mdinit (dt)
7070
nfree = 0
7171
ndummy = 0
7272
irest = 100
73+
iprint = 100
7374
use_wrap = .true.
7475
velsave = .false.
7576
frcsave = .false.
7677
uindsave = .false.
7778
friction = 1.0d0
7879
if (use_solv) friction = 91.0d0
7980
use_sdarea = .false.
80-
iprint = 100
8181
c
8282
c set default values for temperature and pressure control
8383
c

0 commit comments

Comments
 (0)