--- trunk/OOPSE/libmdtools/calc_eam.F90 2004/01/05 22:49:14 898 +++ trunk/OOPSE/libmdtools/calc_eam.F90 2004/05/24 22:24:30 1195 @@ -651,14 +651,17 @@ contains !! Does EAM pairwise Force calculation. - subroutine do_eam_pair(atom1,atom2,d,rij,r2,pot,f,do_pot,do_stress) + subroutine do_eam_pair(atom1, atom2, d, rij, r2, sw, vpair, fpair, & + pot, f, do_pot) !Arguments integer, intent(in) :: atom1, atom2 real( kind = dp ), intent(in) :: rij, r2 - real( kind = dp ) :: pot + real( kind = dp ) :: pot, sw, vpair real( kind = dp ), dimension(3,nLocal) :: f real( kind = dp ), intent(in), dimension(3) :: d - logical, intent(in) :: do_pot, do_stress + real( kind = dp ), intent(inout), dimension(3) :: fpair + + logical, intent(in) :: do_pot real( kind = dp ) :: drdx,drdy,drdz real( kind = dp ) :: d2 @@ -809,8 +812,25 @@ contains f(1,atom2) = f(1,atom2) - fx f(2,atom2) = f(2,atom2) - fy f(3,atom2) = f(3,atom2) - fz +#endif + + vpair = vpair + phab +#ifdef IS_MPI + id1 = tagRow(atom1) + id2 = tagColumn(atom2) +#else + id1 = atom1 + id2 = atom2 #endif + if (molMembershipList(id1) .ne. molMembershipList(id2)) then + + fpair(1) = fpair(1) + fx + fpair(2) = fpair(2) + fy + fpair(3) = fpair(3) + fz + + endif + if (nmflag) then drhoidr = drha @@ -834,40 +854,8 @@ contains drhojdr*drhojdr*d2frhodrhodrho(atom1) #endif end if - - - - if (do_stress) then - -#ifdef IS_MPI - id1 = tagRow(atom1) - id2 = tagColumn(atom2) -#else - id1 = atom1 - id2 = atom2 -#endif - - if (molMembershipList(id1) .ne. molMembershipList(id2)) then - - tau_Temp(1) = tau_Temp(1) - d(1) * fx - tau_Temp(2) = tau_Temp(2) - d(1) * fy - tau_Temp(3) = tau_Temp(3) - d(1) * fz - tau_Temp(4) = tau_Temp(4) - d(2) * fx - tau_Temp(5) = tau_Temp(5) - d(2) * fy - tau_Temp(6) = tau_Temp(6) - d(2) * fz - tau_Temp(7) = tau_Temp(7) - d(3) * fx - tau_Temp(8) = tau_Temp(8) - d(3) * fy - tau_Temp(9) = tau_Temp(9) - d(3) * fz - - virial_Temp = virial_Temp + & - (tau_Temp(1) + tau_Temp(5) + tau_Temp(9)) - - endif - endif - endif - - + endif end subroutine do_eam_pair