--- trunk/OOPSE/libmdtools/do_Forces.F90 2003/03/24 21:55:34 394 +++ trunk/OOPSE/libmdtools/do_Forces.F90 2003/03/31 21:50:59 438 @@ -4,7 +4,7 @@ !! @author Charles F. Vardeman II !! @author Matthew Meineke -!! @version $Id: do_Forces.F90,v 1.4 2003-03-24 21:55:34 gezelter Exp $, $Date: 2003-03-24 21:55:34 $, $Name: not supported by cvs2svn $, $Revision: 1.4 $ +!! @version $Id: do_Forces.F90,v 1.5 2003-03-31 21:50:59 chuckv Exp $, $Date: 2003-03-31 21:50:59 $, $Name: not supported by cvs2svn $, $Revision: 1.5 $ module do_Forces use force_globals @@ -381,15 +381,26 @@ contains #ifdef IS_MPI !!distribute forces - - call scatter(f_Row,f,plan_row3d) + + f_temp = 0.0_dp + call scatter(f_Row,f_temp,plan_row3d) + do i = 1,nlocal + f(1:3,i) = f(1:3,i) + f_temp(1:3,i) + end do + + f_temp = 0.0_dp call scatter(f_Col,f_temp,plan_col3d) do i = 1,nlocal f(1:3,i) = f(1:3,i) + f_temp(1:3,i) end do if (FF_UsesDirectionalAtoms() .and. SimUsesDirectionalAtoms()) then - call scatter(t_Row,t,plan_row3d) + t_temp = 0.0_dp + call scatter(t_Row,t_temp,plan_row3d) + do i = 1,nlocal + t(1:3,i) = t(1:3,i) + t_temp(1:3,i) + end do + t_temp = 0.0_dp call scatter(t_Col,t_temp,plan_col3d) do i = 1,nlocal @@ -461,6 +472,7 @@ contains #ifdef IS_MPI if (do_pot) then + write(*,*) "Fortran is on pot:, pot, pot_local ", pot,pot_local pot = pot_local !! we assume the c code will do the allreduce to get the total potential !! we could do it right here if we needed to...