Constant temperature MD was corrupted by my recent modifications. Fixed.

C.S.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2568 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
sbraccia 2005-12-08 14:28:25 +00:00
parent d924777f3c
commit 93832ebcfd
1 changed files with 11 additions and 3 deletions

View File

@ -161,6 +161,8 @@ SUBROUTINE dynamics()
istep = istep + 1
!
IF ( lrescale_t ) THEN
!
vel(:,:) = tau(:,:) - tau_old(:,:)
!
IF ( MOD( istep, nraise ) == 0 ) THEN
!
@ -188,8 +190,10 @@ SUBROUTINE dynamics()
END IF
!
! ... the old positions are updated to reflect the new velocities
! ... ( notice that vel is not the real velocity, but just a
! ... displacement vector )
!
tau_old(:,:) = tau(:,:) - dt * vel(:,:)
tau_old(:,:) = tau(:,:) - vel(:,:)
!
END IF
!
@ -299,7 +303,7 @@ SUBROUTINE dynamics()
!
! ... the linear momentum and the kinetic energy are computed here
!
IF ( istep > 1 ) &
IF ( istep > 1 .OR. lrescale_t ) &
vel = ( tau_new - tau_old ) / ( 2.D0 * dt ) * DBLE( if_pos )
!
ml = 0.D0
@ -626,6 +630,10 @@ SUBROUTINE dynamics()
!
END DO
!
! ... vel is used already multiplied by the time step
!
vel(:,:) = vel(:,:) * dt
!
! ... after the velocity of the center of mass has been subtracted the
! ... temperature is usually changed. Set again the temperature to the
! ... right value.
@ -661,7 +669,7 @@ SUBROUTINE dynamics()
!
END IF
!
vel = vel * aux
vel(:,:) = vel(:,:) * aux
!
RETURN
!