subroutine elecsr(eelecsr,deelecsr,iat,jat) implicit double precision(a-h,o-z) #include "divcon.dim" #include "divcon.h" dimension deelecsr(3) C C C C eelecsr=0.0d0 do i=1,3 deelecsr(i)=0.0d0 enddo if (iat.eq.jat) then goto 10 else iat3 = 3*iat-2 xi = xyz(1,iat) yi = xyz(2,iat) zi = xyz(3,iat) jat3 = 3*jat-2 if (pbc) then call pbcxyz(iat,jat,xj,yj,zj) else xj = xyz(1,jat) yj = xyz(2,jat) zj = xyz(3,jat) endif x = xi-xj y = yi-yj z = zi-zj rsqr = x*x + y*y + z*z rr = dsqrt(rsqr) rr3 = rr**3 dx = x/rr3 dy = y/rr3 dz = z/rr3 eelecsr= - 14.39964521/rr deelecsr(1)=14.39964521*dx deelecsr(2)=14.39964521*dy deelecsr(3)=14.39964521*dz endif 10 END