307 |
|
end function getDipoleMoment |
308 |
|
|
309 |
|
subroutine doElectrostaticPair(atom1, atom2, d, rij, r2, sw, & |
310 |
< |
vpair, fpair, pot, eFrame, f, t, do_pot) |
310 |
> |
vpair, fpair, pot, eFrame, f, t, do_pot, ebalance) |
311 |
|
|
312 |
|
logical, intent(in) :: do_pot |
313 |
|
|
318 |
|
real(kind=dp), intent(in), dimension(3) :: d |
319 |
|
real(kind=dp), intent(inout) :: vpair |
320 |
|
real(kind=dp), intent(inout), dimension(3) :: fpair |
321 |
+ |
real(kind=dp), intent(inout) :: ebalance |
322 |
|
|
323 |
|
real( kind = dp ) :: pot |
324 |
|
real( kind = dp ), dimension(9,nLocal) :: eFrame |
488 |
|
|
489 |
|
switcher = 1.0d0 |
490 |
|
dswitcher = 0.0d0 |
491 |
+ |
ebalance = 0.0d0 |
492 |
+ |
! weaken the dipole interaction at close range for TAP water |
493 |
|
! if (j_is_Tap .and. i_is_Tap) then |
494 |
|
! call calc_switch(rij, mu_i, switcher, dswitcher) |
495 |
|
! endif |
662 |
|
|
663 |
|
pref = pre22 * mu_i * mu_j |
664 |
|
vterm = pref * ri3 * (ct_ij - 3.0d0 * ct_i * ct_j * sc2) |
665 |
< |
vpair = vpair + vterm |
666 |
< |
epot = epot + sw * vterm |
665 |
> |
ebalance = vterm * (1.0d0 - switcher) |
666 |
> |
vpair = vpair + switcher * vterm |
667 |
> |
epot = epot + sw * switcher * vterm |
668 |
|
|
669 |
|
a1 = 5.0d0 * ct_i * ct_j * sc2 - ct_ij |
670 |
|
|
854 |
|
|
855 |
|
! distances must be in angstroms |
856 |
|
rl = 2.75d0 |
857 |
< |
ru = 2.85d0 |
858 |
< |
mulow = 3.3856d0 ! 1.84 * 1.84 |
857 |
> |
ru = 3.75d0 |
858 |
> |
mulow = 0.0d0 !3.3856d0 ! 1.84 * 1.84 |
859 |
|
minRatio = mulow / (mu*mu) |
860 |
|
scaleVal = 1.0d0 - minRatio |
861 |
|
|