4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.9 2003-04-04 22:22:30 chuckv Exp $, $Date: 2003-04-04 22:22:30 $, $Name: not supported by cvs2svn $, $Revision: 1.9 $ |
7 |
> |
!! @version $Id: do_Forces.F90,v 1.13 2003-04-08 22:38:43 chuckv Exp $, $Date: 2003-04-08 22:38:43 $, $Name: not supported by cvs2svn $, $Revision: 1.13 $ |
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 |
|
|
218 |
|
|
219 |
|
do_pot = do_pot_c |
220 |
|
do_stress = do_stress_c |
221 |
+ |
|
222 |
|
|
223 |
|
! Gather all information needed by all force loops: |
224 |
|
|
488 |
|
endif |
489 |
|
|
490 |
|
if (do_stress) then |
491 |
< |
call mpi_allreduce(tau, tau_Temp,9,mpi_double_precision,mpi_sum, & |
491 |
> |
call mpi_allreduce(tau_Temp, tau,9,mpi_double_precision,mpi_sum, & |
492 |
|
mpi_comm_world,mpi_err) |
493 |
< |
call mpi_allreduce(virial, virial_Temp,1,mpi_double_precision,mpi_sum, & |
493 |
> |
call mpi_allreduce(virial_Temp, virial,1,mpi_double_precision,mpi_sum, & |
494 |
|
mpi_comm_world,mpi_err) |
495 |
|
endif |
496 |
|
|
552 |
|
|
553 |
|
if ( is_DP_i .and. is_DP_j ) then |
554 |
|
|
555 |
< |
call do_dipole_pair(natoms,i, j, d, r, rijsq, pot, u_l, f, t, & |
555 |
> |
call do_dipole_pair(i, j, d, r, rijsq, pot, u_l, f, t, & |
556 |
|
do_pot, do_stress) |
557 |
|
if (FF_uses_RF .and. SimUsesRF()) then |
558 |
|
call accumulate_rf(i, j, r, u_l) |
595 |
|
real ( kind = dp ), intent(out) :: r_sq |
596 |
|
real( kind = dp ) :: d(3) |
597 |
|
real( kind = dp ) :: d_old(3) |
598 |
< |
d(1:3) = q_i(1:3) - q_j(1:3) |
598 |
> |
d(1:3) = q_j(1:3) - q_i(1:3) |
599 |
|
d_old = d |
600 |
|
! Wrap back into periodic box if necessary |
601 |
|
if ( SimUsesPBC() ) then |
664 |
|
rf = 0.0_dp |
665 |
|
tau_Temp = 0.0_dp |
666 |
|
virial_Temp = 0.0_dp |
658 |
– |
|
667 |
|
end subroutine zero_work_arrays |
668 |
|
|
669 |
|
function skipThisPair(atom1, atom2) result(skip_it) |