--- trunk/OOPSE/libmdtools/calc_sticky_pair.F90 2004/05/11 21:31:15 1160 +++ trunk/OOPSE/libmdtools/calc_sticky_pair.F90 2004/05/24 21:03:30 1192 @@ -9,7 +9,7 @@ !! @author Matthew Meineke !! @author Christopher Fennel !! @author J. Daniel Gezelter -!! @version $Id: calc_sticky_pair.F90,v 1.18 2004-05-11 21:31:14 gezelter Exp $, $Date: 2004-05-11 21:31:14 $, $Name: not supported by cvs2svn $, $Revision: 1.18 $ +!! @version $Id: calc_sticky_pair.F90,v 1.19 2004-05-24 21:03:25 gezelter Exp $, $Date: 2004-05-24 21:03:25 $, $Name: not supported by cvs2svn $, $Revision: 1.19 $ module sticky_pair @@ -74,8 +74,8 @@ contains return end subroutine set_sticky_params - subroutine do_sticky_pair(atom1, atom2, d, rij, r2, sw, vpair, pot, A,f, t, & - do_pot, do_stress) + subroutine do_sticky_pair(atom1, atom2, d, rij, r2, sw, vpair, fpair, & + pot, A, f, t, do_pot) !! This routine does only the sticky portion of the SSD potential !! [Chandra and Ichiye, J. Chem. Phys. 111, 2701 (1999)]. @@ -89,11 +89,12 @@ contains integer, intent(in) :: atom1, atom2 real (kind=dp), intent(inout) :: rij, r2 real (kind=dp), dimension(3), intent(in) :: d + real (kind=dp), dimension(3), intent(inout) :: fpair real (kind=dp) :: pot, vpair, sw real (kind=dp), dimension(9,nLocal) :: A real (kind=dp), dimension(3,nLocal) :: f real (kind=dp), dimension(3,nLocal) :: t - logical, intent(in) :: do_pot, do_stress + logical, intent(in) :: do_pot real (kind=dp) :: xi, yi, zi, xj, yj, zj, xi2, yi2, zi2, xj2, yj2, zj2 real (kind=dp) :: r3, r5, r6, s, sp, dsdr, dspdr @@ -347,38 +348,22 @@ contains f(3,atom2) = f(3,atom2) - fzradial #endif - if (do_stress) then - #ifdef IS_MPI - id1 = tagRow(atom1) - id2 = tagColumn(atom2) + id1 = tagRow(atom1) + id2 = tagColumn(atom2) #else - id1 = atom1 - id2 = atom2 + id1 = atom1 + id2 = atom2 #endif - - if (molMembershipList(id1) .ne. molMembershipList(id2)) then - - ! because the d vector is the rj - ri vector, and - ! because fxradial, fyradial, and fzradial are the - ! (positive) force on atom i (negative on atom j) we need - ! a negative sign here: - - tau_Temp(1) = tau_Temp(1) - d(1) * fxradial - tau_Temp(2) = tau_Temp(2) - d(1) * fyradial - tau_Temp(3) = tau_Temp(3) - d(1) * fzradial - tau_Temp(4) = tau_Temp(4) - d(2) * fxradial - tau_Temp(5) = tau_Temp(5) - d(2) * fyradial - tau_Temp(6) = tau_Temp(6) - d(2) * fzradial - tau_Temp(7) = tau_Temp(7) - d(3) * fxradial - tau_Temp(8) = tau_Temp(8) - d(3) * fyradial - tau_Temp(9) = tau_Temp(9) - d(3) * fzradial - - virial_Temp = virial_Temp + (tau_Temp(1) + tau_Temp(5) + tau_Temp(9)) - endif + + if (molMembershipList(id1) .ne. molMembershipList(id2)) then + + fpair(1) = fpair(1) + fxradial + fpair(2) = fpair(2) + fyradial + fpair(3) = fpair(3) + fzradial + endif endif - end subroutine do_sticky_pair !! calculates the switching functions and their derivatives for a given