4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.3 2003-03-24 18:33:51 mmeineke Exp $, $Date: 2003-03-24 18:33:51 $, $Name: not supported by cvs2svn $, $Revision: 1.3 $ |
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 |
196 |
|
nlocal = getNlocal() |
197 |
|
natoms = nlocal |
198 |
|
#endif |
199 |
– |
|
200 |
– |
write(*,*) 'u_l', u_l(1,1), u_l(2,1), u_l(3,1) |
201 |
– |
|
199 |
|
|
200 |
|
call getRcut(rcut,rc2=rcutsq) |
201 |
|
call getRlist(rlist,rlistsq) |
381 |
|
|
382 |
|
#ifdef IS_MPI |
383 |
|
!!distribute forces |
384 |
< |
|
385 |
< |
call scatter(f_Row,f,plan_row3d) |
384 |
> |
|
385 |
> |
f_temp = 0.0_dp |
386 |
> |
call scatter(f_Row,f_temp,plan_row3d) |
387 |
> |
do i = 1,nlocal |
388 |
> |
f(1:3,i) = f(1:3,i) + f_temp(1:3,i) |
389 |
> |
end do |
390 |
> |
|
391 |
> |
f_temp = 0.0_dp |
392 |
|
call scatter(f_Col,f_temp,plan_col3d) |
393 |
|
do i = 1,nlocal |
394 |
|
f(1:3,i) = f(1:3,i) + f_temp(1:3,i) |
395 |
|
end do |
396 |
|
|
397 |
|
if (FF_UsesDirectionalAtoms() .and. SimUsesDirectionalAtoms()) then |
398 |
< |
call scatter(t_Row,t,plan_row3d) |
398 |
> |
t_temp = 0.0_dp |
399 |
> |
call scatter(t_Row,t_temp,plan_row3d) |
400 |
> |
do i = 1,nlocal |
401 |
> |
t(1:3,i) = t(1:3,i) + t_temp(1:3,i) |
402 |
> |
end do |
403 |
> |
t_temp = 0.0_dp |
404 |
|
call scatter(t_Col,t_temp,plan_col3d) |
405 |
|
|
406 |
|
do i = 1,nlocal |
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 |
420 |
> |
|
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 |
|
|
592 |
|
|
593 |
|
d(1:3) = d(1:3) - box(1:3) * sign(1.0_dp,d(1:3)) * & |
594 |
|
int(abs(d(1:3)/box(1:3)) + 0.5_dp) |
587 |
– |
|
588 |
– |
! write(*,'(a11,3es12.3)') 'wrapped to ', d(1), d(2), d(3) |
595 |
|
|
596 |
|
endif |
597 |
|
r_sq = dot_product(d,d) |