4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @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 $ |
7 |
> |
!! @version $Id: do_Forces.F90,v 1.6 2003-03-31 22:09:39 chuckv Exp $, $Date: 2003-03-31 22:09:39 $, $Name: not supported by cvs2svn $, $Revision: 1.6 $ |
8 |
|
|
9 |
|
module do_Forces |
10 |
|
use force_globals |
167 |
|
logical ( kind = 2) :: do_pot_c, do_stress_c |
168 |
|
logical :: do_pot |
169 |
|
logical :: do_stress |
170 |
< |
#ifdef IS_MPI |
171 |
< |
real( kind = DP ) :: pot_local |
170 |
> |
#ifdef IS_MPI |
171 |
> |
real( kind = DP ) :: pot_local = 0.0_dp |
172 |
|
integer :: nrow |
173 |
|
integer :: ncol |
174 |
|
#endif |
411 |
|
if (do_pot) then |
412 |
|
! scatter/gather pot_row into the members of my column |
413 |
|
call scatter(pot_Row, pot_Temp, plan_row) |
414 |
< |
|
414 |
> |
|
415 |
|
! scatter/gather pot_local into all other procs |
416 |
|
! add resultant to get total pot |
417 |
|
do i = 1, nlocal |
418 |
|
pot_local = pot_local + pot_Temp(i) |
419 |
|
enddo |
420 |
+ |
|
421 |
+ |
pot_Temp = 0.0_DP |
422 |
|
|
421 |
– |
pot_Temp = 0.0_DP |
422 |
– |
|
423 |
|
call scatter(pot_Col, pot_Temp, plan_col) |
424 |
|
do i = 1, nlocal |
425 |
|
pot_local = pot_local + pot_Temp(i) |
426 |
|
enddo |
427 |
< |
|
427 |
> |
|
428 |
|
endif |
429 |
|
#endif |
430 |
|
|
472 |
|
#ifdef IS_MPI |
473 |
|
|
474 |
|
if (do_pot) then |
475 |
– |
write(*,*) "Fortran is on pot:, pot, pot_local ", pot,pot_local |
475 |
|
pot = pot_local |
476 |
|
!! we assume the c code will do the allreduce to get the total potential |
477 |
|
!! we could do it right here if we needed to... |