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