--- trunk/OOPSE/libmdtools/calc_gb.F90 2003/07/15 17:10:50 611 +++ trunk/OOPSE/libmdtools/calc_gb.F90 2003/08/27 16:25:11 730 @@ -51,6 +51,7 @@ contains do_pot, do_stress) integer, intent(in) :: atom1, atom2 + integer :: id1, id2 real (kind=dp), intent(inout) :: r, r2 real (kind=dp), dimension(3), intent(in) :: d real (kind=dp) :: pot @@ -352,8 +353,17 @@ contains #endif if (do_stress) then - if (molMembershipList(atom1) .ne. molMembershipList(atom2)) then + +#ifdef IS_MPI + id1 = tagRow(atom1) + id2 = tagColumn(atom2) +#else + id1 = atom1 + id2 = atom2 +#endif + if (molMembershipList(id1) .ne. molMembershipList(id2)) then + ! because the d vector is the rj - ri vector, and ! because dUdx, dUdy, dUdz are the force on atom i, we need a ! negative sign here: