3 |
|
use simulation |
4 |
|
use definitions |
5 |
|
use forceGlobals |
6 |
< |
use atype_typedefs |
6 |
> |
use atype_module |
7 |
|
use vector_class |
8 |
|
#ifdef IS_MPI |
9 |
|
use mpiSimulation |
12 |
|
|
13 |
|
contains |
14 |
|
|
15 |
< |
subroutine do_dipole_pair(atom1, atom2, d, rij, pot, u_l, f, t) |
15 |
> |
subroutine do_dipole_pair(atom1, atom2, d, rij, pot, u_l, f, t, & |
16 |
> |
do_pot, do_stress) |
17 |
|
|
18 |
+ |
logical :: do_pot, do_stress |
19 |
+ |
|
20 |
|
integer atom1, atom2, me1, me2 |
21 |
|
double precision rij, mu1, mu2 |
22 |
|
double precision dfact1, dfact2, dip2, r2, r3, r5, pre |
90 |
|
|
91 |
|
vterm = dip2*((u1dotu2/r3) - 3.0d0*(rdotu1*rdotu2/r5)) |
92 |
|
|
93 |
+ |
if (do_pot) then |
94 |
|
#ifdef IS_MPI |
95 |
< |
pot_row(atom1) = pot_row(atom1) + 0.5d0*vterm*taper |
96 |
< |
pot_col(atom2) = pot_col(atom2) + 0.5d0*vterm*taper |
95 |
> |
pot_row(atom1) = pot_row(atom1) + 0.5d0*vterm*taper |
96 |
> |
pot_col(atom2) = pot_col(atom2) + 0.5d0*vterm*taper |
97 |
|
#else |
98 |
< |
pot = pot + vterm*taper |
98 |
> |
pot = pot + vterm*taper |
99 |
|
#endif |
100 |
+ |
endif |
101 |
|
|
102 |
|
dudx = (-dfact1 * d(1) * ((u1dotu2/r3) - & |
103 |
|
(5.0d0*(rdotu1*rdotu2)/r5)) - & |
157 |
|
t(3,atom2) = t(3,atom2) - ul2(1)*dudu2y + ul2(2)*dudu2x |
158 |
|
#endif |
159 |
|
|
160 |
< |
if (doStress()) then |
160 |
> |
if (do_stress) then |
161 |
|
tau_Temp(1) = tau_Temp(1) + dudx * d(1) |
162 |
|
tau_Temp(2) = tau_Temp(2) + dudx * d(2) |
163 |
|
tau_Temp(3) = tau_Temp(3) + dudx * d(3) |