      subroutine dipoless(m,n,icontr,inddyy,density,zeta,px,py,pz,base,
     &                    ss,sscond,dipole)

c  this subroutine written by alain st-amant of the department of
c  pharmaceutical chemistry, university of california, san francisco.
c  all rights reserved.  this is part of the DeFT project.

      implicit real*8(a-h,o-z)

      dimension icontr(*),inddyy(*)

      dimension density(*),zeta(*),px(*),py(*),pz(*),base(*),ss(n,*),
     &          sscond(m,*),dipole(*)

      data zero,thrhlf,two,pi/0.0d0,1.5d0,2.0d0,3.1415926535898d0/

      do 1001 i=1,n
 1001 base(i)=base(i)*((pi/zeta(i))**thrhlf)

      do 1002 i=1,n
      ss(i,1)=px(i)*base(i)
      ss(i,2)=py(i)*base(i)
 1002 ss(i,3)=pz(i)*base(i)

      do 1003 j=1,3
      do 1003 i=1,m
 1003 sscond(i,j)=zero

      do 1004 j=1,3
      do 1004 i=1,n
 1004 sscond(icontr(i),j)=sscond(icontr(i),j)+ss(i,j)

      do 1005 j=1,3
      do 1005 i=1,m
 1005 dipole(j)=dipole(j)-density(inddyy(i))*sscond(i,j)

      return
      end
