26 |
|
real(kind=dp), intent(in) :: this_rrf, this_rt |
27 |
|
rrf = this_rrf |
28 |
|
rt = this_rt |
29 |
< |
! pre converts from mu in units of debye to kcal/mol |
29 |
> |
|
30 |
> |
! pre converts from mu in units of debye to kcal/mol |
31 |
|
pre = 14.38362_dp |
32 |
|
|
33 |
|
dipole_initialized = .true. |
40 |
|
|
41 |
|
logical :: do_pot, do_stress |
42 |
|
|
43 |
< |
integer atom1, atom2, me1, me2 |
43 |
> |
integer atom1, atom2, me1, me2, id1, id2 |
44 |
|
real(kind=dp) :: rij, mu1, mu2 |
45 |
|
real(kind=dp) :: dfact1, dfact2, dip2, r2, r3, r5 |
46 |
|
real(kind=dp) :: dudx, dudy, dudz, dudu1x, dudu1y, dudu1z |
49 |
|
|
50 |
|
real( kind = dp ) :: pot |
51 |
|
real( kind = dp ), dimension(3) :: d |
52 |
< |
real( kind = dp ), dimension(3,getNlocal()) :: u_l |
53 |
< |
real( kind = dp ), dimension(3,getNlocal()) :: f |
54 |
< |
real( kind = dp ), dimension(3,getNlocal()) :: t |
52 |
> |
real( kind = dp ), dimension(3,nLocal) :: u_l |
53 |
> |
real( kind = dp ), dimension(3,nLocal) :: f |
54 |
> |
real( kind = dp ), dimension(3,nLocal) :: t |
55 |
|
|
56 |
|
real (kind = dp), dimension(3) :: ul1 |
57 |
|
real (kind = dp), dimension(3) :: ul2 |
176 |
|
t(2,atom2) = t(2,atom2) - ul2(3)*dudu2x + ul2(1)*dudu2z |
177 |
|
t(3,atom2) = t(3,atom2) - ul2(1)*dudu2y + ul2(2)*dudu2x |
178 |
|
#endif |
179 |
< |
|
179 |
> |
|
180 |
|
if (do_stress) then |
181 |
|
|
182 |
< |
if (molMembershipList(atom1) .ne. molMembershipList(atom2)) then |
182 |
> |
#ifdef IS_MPI |
183 |
> |
id1 = tagRow(atom1) |
184 |
> |
id2 = tagColumn(atom2) |
185 |
> |
#else |
186 |
> |
id1 = atom1 |
187 |
> |
id2 = atom2 |
188 |
> |
#endif |
189 |
> |
if (molMembershipList(id1) .ne. molMembershipList(id2)) then |
190 |
|
|
191 |
|
! because the d vector is the rj - ri vector, and |
192 |
|
! because dudx, dudy, dudz are the (positive) force on |