4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.7 2003-04-01 16:50:14 chuckv Exp $, $Date: 2003-04-01 16:50:14 $, $Name: not supported by cvs2svn $, $Revision: 1.7 $ |
7 |
> |
!! @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 $ |
8 |
|
|
9 |
|
module do_Forces |
10 |
|
use force_globals |
140 |
|
|
141 |
|
if (FF_uses_GB .and. FF_uses_LJ) then |
142 |
|
endif |
143 |
< |
|
143 |
> |
if (.not. do_forces_initialized) then |
144 |
> |
!! Create neighbor lists |
145 |
> |
call expandNeighborList(getNlocal(), my_status) |
146 |
> |
if (my_Status /= 0) then |
147 |
> |
write(default_error,*) "SimSetup: ExpandNeighborList returned error." |
148 |
> |
thisStat = -1 |
149 |
> |
return |
150 |
> |
endif |
151 |
> |
endif |
152 |
|
|
153 |
|
do_forces_initialized = .true. |
154 |
|
|
254 |
|
|
255 |
|
!! save current configuration, construct neighbor list, |
256 |
|
!! and calculate forces |
257 |
< |
call saveNeighborList(q) |
257 |
> |
call saveNeighborList(nlocal, q) |
258 |
|
|
259 |
|
neighborListSize = size(list) |
260 |
|
nlist = 0 |
321 |
|
|
322 |
|
! save current configuration, contruct neighbor list, |
323 |
|
! and calculate forces |
324 |
< |
call saveNeighborList(q) |
324 |
> |
call saveNeighborList(natoms, q) |
325 |
|
|
326 |
|
neighborListSize = size(list) |
327 |
|
|
487 |
|
endif |
488 |
|
|
489 |
|
if (do_stress) then |
490 |
< |
call mpi_allreduce(tau, tau_Temp,9,mpi_double_precision,mpi_sum, & |
490 |
> |
call mpi_allreduce(tau_Temp, tau, 9,mpi_double_precision,mpi_sum, & |
491 |
|
mpi_comm_world,mpi_err) |
492 |
< |
call mpi_allreduce(virial, virial_Temp,1,mpi_double_precision,mpi_sum, & |
492 |
> |
call mpi_allreduce(virial_Temp, virial,1,mpi_double_precision,mpi_sum, & |
493 |
|
mpi_comm_world,mpi_err) |
494 |
|
endif |
495 |
|
|
507 |
|
subroutine do_pair(i, j, rijsq, d, do_pot, do_stress, u_l, A, f, t, pot) |
508 |
|
|
509 |
|
real( kind = dp ) :: pot |
510 |
< |
real( kind = dp ), dimension(:,:) :: u_l |
511 |
< |
real (kind=dp), dimension(:,:) :: A |
512 |
< |
real (kind=dp), dimension(:,:) :: f |
513 |
< |
real (kind=dp), dimension(:,:) :: t |
510 |
> |
real( kind = dp ), dimension(3,getNlocal()) :: u_l |
511 |
> |
real (kind=dp), dimension(9,getNlocal()) :: A |
512 |
> |
real (kind=dp), dimension(3,getNlocal()) :: f |
513 |
> |
real (kind=dp), dimension(3,getNlocal()) :: t |
514 |
|
|
515 |
|
logical, intent(inout) :: do_pot, do_stress |
516 |
|
integer, intent(in) :: i, j |
525 |
|
|
526 |
|
r = sqrt(rijsq) |
527 |
|
|
528 |
+ |
|
529 |
+ |
|
530 |
|
#ifdef IS_MPI |
531 |
+ |
if (tagRow(i) .eq. tagColumn(j)) then |
532 |
+ |
write(0,*) 'do_pair is doing', i , j, tagRow(i), tagColumn(j) |
533 |
+ |
endif |
534 |
|
|
535 |
|
me_i = atid_row(i) |
536 |
|
me_j = atid_col(j) |
599 |
|
real ( kind = dp ), intent(out) :: r_sq |
600 |
|
real( kind = dp ) :: d(3) |
601 |
|
real( kind = dp ) :: d_old(3) |
602 |
< |
d(1:3) = q_i(1:3) - q_j(1:3) |
602 |
> |
d(1:3) = q_j(1:3) - q_i(1:3) |
603 |
|
d_old = d |
604 |
|
! Wrap back into periodic box if necessary |
605 |
|
if ( SimUsesPBC() ) then |
668 |
|
rf = 0.0_dp |
669 |
|
tau_Temp = 0.0_dp |
670 |
|
virial_Temp = 0.0_dp |
658 |
– |
|
671 |
|
end subroutine zero_work_arrays |
672 |
|
|
673 |
|
function skipThisPair(atom1, atom2) result(skip_it) |