23 |
|
rt = this_rt |
24 |
|
rrfsq = rrf * rrf |
25 |
|
! pre converts from mu in units of debye to kcal/mol |
26 |
< |
pre = 14.38362d0 |
27 |
< |
|
26 |
> |
pre = 14.38362_dp |
27 |
> |
|
28 |
|
dipole_initialized = .true. |
29 |
|
|
30 |
|
return |
31 |
|
end subroutine initialize_dipole |
32 |
|
|
33 |
|
|
34 |
< |
subroutine do_dipole_pair(atom1, atom2, d, rij, r2, pot, u_l, f, t, & |
34 |
> |
subroutine do_dipole_pair(natoms, atom1, atom2, d, rij, r2, pot, u_l, f, t, & |
35 |
|
do_pot, do_stress) |
36 |
|
|
37 |
|
logical :: do_pot, do_stress |
38 |
|
|
39 |
+ |
integer :: natoms |
40 |
|
integer atom1, atom2, me1, me2 |
41 |
|
real(kind=dp) :: rij, mu1, mu2 |
42 |
|
real(kind=dp) :: dfact1, dfact2, dip2, r2, r3, r5, pre |
80 |
|
ul2(3) = u_l(3,atom2) |
81 |
|
#endif |
82 |
|
|
83 |
+ |
if( atom1 .eq. 2 )then |
84 |
+ |
write (*,*) 'ul =', ul1(1), ul1(2), ul1(3) |
85 |
+ |
endif |
86 |
+ |
|
87 |
+ |
if( atom2 .eq. 2 )then |
88 |
+ |
write (*,*) 'ul =', ul2(1), ul2(2), ul2(3) |
89 |
+ |
endif |
90 |
+ |
|
91 |
+ |
|
92 |
|
call getElementProperty(atypes, me1, "dipole_moment", mu1) |
93 |
|
call getElementProperty(atypes, me2, "dipole_moment", mu2) |
94 |
< |
|
94 |
> |
|
95 |
|
if (rij.le.rrf) then |
96 |
|
|
97 |
|
if (rij.lt.rt) then |
150 |
|
|
151 |
|
|
152 |
|
#ifdef IS_MPI |
153 |
< |
f_Row(1,atom1) = f_Row(1,atom1) + dudx |
154 |
< |
f_Row(2,atom1) = f_Row(2,atom1) + dudy |
155 |
< |
f_Row(3,atom1) = f_Row(3,atom1) + dudz |
153 |
> |
f_Row(1,atom1) = f_Row(1,atom1) - dudx |
154 |
> |
f_Row(2,atom1) = f_Row(2,atom1) - dudy |
155 |
> |
f_Row(3,atom1) = f_Row(3,atom1) - dudz |
156 |
|
|
157 |
< |
f_Col(1,atom2) = f_Col(1,atom2) - dudx |
158 |
< |
f_Col(2,atom2) = f_Col(2,atom2) - dudy |
159 |
< |
f_Col(3,atom2) = f_Col(3,atom2) - dudz |
157 |
> |
f_Col(1,atom2) = f_Col(1,atom2) + dudx |
158 |
> |
f_Col(2,atom2) = f_Col(2,atom2) + dudy |
159 |
> |
f_Col(3,atom2) = f_Col(3,atom2) + dudz |
160 |
|
|
161 |
|
t_Row(1,atom1) = t_Row(1,atom1) - ul1(2)*dudu1z + ul1(3)*dudu1y |
162 |
|
t_Row(2,atom1) = t_Row(2,atom1) - ul1(3)*dudu1x + ul1(1)*dudu1z |
166 |
|
t_Col(2,atom2) = t_Col(2,atom2) - ul2(3)*dudu2x + ul2(1)*dudu2z |
167 |
|
t_Col(3,atom2) = t_Col(3,atom2) - ul2(1)*dudu2y + ul2(2)*dudu2x |
168 |
|
#else |
169 |
< |
f(1,atom1) = f(1,atom1) + dudx |
170 |
< |
f(2,atom1) = f(2,atom1) + dudy |
171 |
< |
f(3,atom1) = f(3,atom1) + dudz |
169 |
> |
f(1,atom1) = f(1,atom1) - dudx |
170 |
> |
f(2,atom1) = f(2,atom1) - dudy |
171 |
> |
f(3,atom1) = f(3,atom1) - dudz |
172 |
|
|
173 |
< |
f(1,atom2) = f(1,atom2) - dudx |
174 |
< |
f(2,atom2) = f(2,atom2) - dudy |
175 |
< |
f(3,atom2) = f(3,atom2) - dudz |
173 |
> |
f(1,atom2) = f(1,atom2) + dudx |
174 |
> |
f(2,atom2) = f(2,atom2) + dudy |
175 |
> |
f(3,atom2) = f(3,atom2) + dudz |
176 |
|
|
177 |
|
t(1,atom1) = t(1,atom1) - ul1(2)*dudu1z + ul1(3)*dudu1y |
178 |
|
t(2,atom1) = t(2,atom1) - ul1(3)*dudu1x + ul1(1)*dudu1z |