      subroutine boys_ss(n,icontr,inddyy,zeta,px,py,pz,base,ss,x_moment,
     &                   y_moment,z_moment)

c  this subroutine written by alain st-amant of the
c  department of chemistry, university of ottawa, ottawa, canada.
c  all rights reserved.  this is part of the DeFT project.

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

      dimension icontr(*),inddyy(*)

      dimension zeta(*),px(*),py(*),pz(*),base(*),ss(n,*),x_moment(*),
     &          y_moment(*),z_moment(*)

      data zero,thrhlf,pi/0.0d0,1.5d0,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 i=1,n
      ii=inddyy(icontr(i))
      x_moment(ii)=x_moment(ii)+ss(i,1)
      y_moment(ii)=y_moment(ii)+ss(i,2)
 1003 z_moment(ii)=z_moment(ii)+ss(i,3)

      return
      end
