--- trunk/OOPSE/libmdtools/calc_LJ_FF.F90 2003/04/08 22:38:43 482 +++ trunk/OOPSE/libmdtools/calc_LJ_FF.F90 2003/04/11 15:16:59 490 @@ -2,7 +2,7 @@ !! Corresponds to the force field defined in lj_FF.cpp !! @author Charles F. Vardeman II !! @author Matthew Meineke -!! @version $Id: calc_LJ_FF.F90,v 1.3 2003-04-08 22:38:43 chuckv Exp $, $Date: 2003-04-08 22:38:43 $, $Name: not supported by cvs2svn $, $Revision: 1.3 $ +!! @version $Id: calc_LJ_FF.F90,v 1.5 2003-04-11 15:16:59 gezelter Exp $, $Date: 2003-04-11 15:16:59 $, $Name: not supported by cvs2svn $, $Revision: 1.5 $ module lj use definitions @@ -195,6 +195,7 @@ contains real( kind = dp ) :: t6 real( kind = dp ) :: t12 real( kind = dp ) :: delta + integer :: id1, id2 if (rij.lt.LJ_rcut) then @@ -254,16 +255,31 @@ contains #endif if (do_stress) then - tau_Temp(1) = tau_Temp(1) + fx * d(1) - tau_Temp(2) = tau_Temp(2) + fx * d(2) - tau_Temp(3) = tau_Temp(3) + fx * d(3) - tau_Temp(4) = tau_Temp(4) + fy * d(1) - tau_Temp(5) = tau_Temp(5) + fy * d(2) - tau_Temp(6) = tau_Temp(6) + fy * d(3) - tau_Temp(7) = tau_Temp(7) + fz * d(1) - tau_Temp(8) = tau_Temp(8) + fz * d(2) - tau_Temp(9) = tau_Temp(9) + fz * d(3) - virial_Temp = virial_Temp + (tau_Temp(1) + tau_Temp(5) + tau_Temp(9)) + +#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) + fx * d(1) + tau_Temp(2) = tau_Temp(2) + fx * d(2) + tau_Temp(3) = tau_Temp(3) + fx * d(3) + tau_Temp(4) = tau_Temp(4) + fy * d(1) + tau_Temp(5) = tau_Temp(5) + fy * d(2) + tau_Temp(6) = tau_Temp(6) + fy * d(3) + tau_Temp(7) = tau_Temp(7) + fz * d(1) + tau_Temp(8) = tau_Temp(8) + fz * d(2) + tau_Temp(9) = tau_Temp(9) + fz * d(3) + virial_Temp = virial_Temp + & + (tau_Temp(1) + tau_Temp(5) + tau_Temp(9)) + else + write(0,*) 'skipping ', id1, id2, molMembershipList(id1), molMembershipList(id2) + endif + endif endif