      double precision function amcb_bcc(alat,p)
      implicit double precision (A-H,O-Z)
c this program simulates total energy of a Cu bulk
c using the embeding atom potential
      parameter (n=160)
      parameter (rad=5.5d0,nat=4320)
      dimension x(n),y(n),z(n),xn(n),yn(n),zn(n)
      dimension pos(nat,3),upos(500)
      dimension list(n,100)
      dimension xp(3),yp(3),zp(3),np(8),p(n,3)
      dimension pax(3000),edx(3000),emx(3000),pay(3000)
      dimension emy(3000),edy(3000)
      dimension pa2(3000),em2(3000),ed2(3000)
c     character*9 set(11)
c
c
      do i=1,n
    	 x(i)=p(i,1)
    	 y(i)=p(i,2)
	     z(i)=p(i,3)
      end do
c ----------------------------------
      xd=4.0d0*alat/dsqrt(2.d0)
      xdn=-xd
      yd=2.d0*alat
      ydn=-yd
      zd=5.0d0*alat
      zdn=-zd
      xp(1)=0.d0
      yp(1)=0.d0
      zp(1)=0.d0
      xp(2)=xdn
      yp(2)=ydn
      zp(2)=zdn
      xp(3)=xd
      yp(3)=yd
      zp(3)=zd
c
c program for calculation of EAM energy
      call daread(pax,pay,pa2,edx,edy,ed2,emx,emy,em2)
      call multy(n,x,y,z,pos,xp,yp,zp,0.0d0)
      call neigh(n,nat,pos,list,rad)
      fe1=fe(n,pos,pax,pay,pa2,edx,edy,ed2,emx,emy,em2,list)
c     step=0.005
      amcb_bcc=fe1
      return
      end