--- trunk/OOPSE/libmdtools/do_Forces.F90 2003/04/07 20:50:46 470 +++ trunk/OOPSE/libmdtools/do_Forces.F90 2003/04/11 15:16:59 490 @@ -4,7 +4,7 @@ !! @author Charles F. Vardeman II !! @author Matthew Meineke -!! @version $Id: do_Forces.F90,v 1.11 2003-04-07 20:50:46 chuckv Exp $, $Date: 2003-04-07 20:50:46 $, $Name: not supported by cvs2svn $, $Revision: 1.11 $ +!! @version $Id: do_Forces.F90,v 1.15 2003-04-11 15:16:59 gezelter Exp $, $Date: 2003-04-11 15:16:59 $, $Name: not supported by cvs2svn $, $Revision: 1.15 $ module do_Forces use force_globals @@ -140,7 +140,15 @@ contains if (FF_uses_GB .and. FF_uses_LJ) then endif - + if (.not. do_forces_initialized) then + !! Create neighbor lists + call expandNeighborList(getNlocal(), my_status) + if (my_Status /= 0) then + write(default_error,*) "SimSetup: ExpandNeighborList returned error." + thisStat = -1 + return + endif + endif do_forces_initialized = .true. @@ -210,7 +218,6 @@ contains do_pot = do_pot_c do_stress = do_stress_c - ! Gather all information needed by all force loops: @@ -480,7 +487,7 @@ contains endif if (do_stress) then - call mpi_allreduce(tau_Temp, tau,9,mpi_double_precision,mpi_sum, & + call mpi_allreduce(tau_Temp, tau, 9,mpi_double_precision,mpi_sum, & mpi_comm_world,mpi_err) call mpi_allreduce(virial_Temp, virial,1,mpi_double_precision,mpi_sum, & mpi_comm_world,mpi_err) @@ -517,8 +524,13 @@ contains integer :: me_i, me_j r = sqrt(rijsq) + + #ifdef IS_MPI + if (tagRow(i) .eq. tagColumn(j)) then + write(0,*) 'do_pair is doing', i , j, tagRow(i), tagColumn(j) + endif me_i = atid_row(i) me_j = atid_col(j) @@ -587,7 +599,7 @@ contains real ( kind = dp ), intent(out) :: r_sq real( kind = dp ) :: d(3) real( kind = dp ) :: d_old(3) - d(1:3) = q_i(1:3) - q_j(1:3) + d(1:3) = q_j(1:3) - q_i(1:3) d_old = d ! Wrap back into periodic box if necessary if ( SimUsesPBC() ) then