--- trunk/OOPSE/libmdtools/calc_dipole_dipole.F90 2003/07/16 21:30:56 626 +++ trunk/OOPSE/libmdtools/calc_dipole_dipole.F90 2003/08/27 16:16:01 727 @@ -39,7 +39,7 @@ contains logical :: do_pot, do_stress - integer atom1, atom2, me1, me2 + integer atom1, atom2, me1, me2, id1, id2 real(kind=dp) :: rij, mu1, mu2 real(kind=dp) :: dfact1, dfact2, dip2, r2, r3, r5 real(kind=dp) :: dudx, dudy, dudz, dudu1x, dudu1y, dudu1z @@ -175,10 +175,17 @@ contains t(2,atom2) = t(2,atom2) - ul2(3)*dudu2x + ul2(1)*dudu2z t(3,atom2) = t(3,atom2) - ul2(1)*dudu2y + ul2(2)*dudu2x #endif - + +#ifdef IS_MPI + id1 = tagRow(atom1) + id2 = tagColumn(atom2) +#else + id1 = atom1 + id2 = atom2 +#endif if (do_stress) then - if (molMembershipList(atom1) .ne. molMembershipList(atom2)) then + if (molMembershipList(id1) .ne. molMembershipList(id2)) then ! because the d vector is the rj - ri vector, and ! because dudx, dudy, dudz are the (positive) force on