      subroutine latt(alat,pos)
      implicit double precision (A-H,O-Z)
      parameter (nat=160)
      dimension pos(nat,3),pos1(8,3)
      alat2=0.5d0*alat
      pos1(1,1)=0.0d0
      pos1(1,2)=0.0d0
      pos1(1,3)=0.0d0
      pos1(2,1)=alat2
      pos1(2,2)=alat2
      pos1(2,3)=0.0d0
      pos1(3,1)=alat
      pos1(3,2)=0.0d0
      pos1(3,3)=0.0d0
      pos1(4,1)=1.5d0*alat
      pos1(4,2)=alat2
      pos1(4,3)=0.0d0
c ============================
      pos1(5,1)=0.0d0
      pos1(5,2)=alat2
      pos1(5,3)=alat2
      pos1(6,1)=alat2
      pos1(6,2)=0.0d0
      pos1(6,3)=alat2
      pos1(7,1)=alat
      pos1(7,2)=alat2
      pos1(7,3)=alat2
      pos1(8,1)=1.5d0*alat
      pos1(8,2)=0.0d0
      pos1(8,3)=alat2
c ================================
      n=0
      do i=1,2
	 do j=1,5
	    do k=1,8
              do l=1,2
	       n=n+1
	       pos(n,1)=pos1(k,1)+dble((i-1))*2.0d0*alat
	       pos(n,3)=pos1(k,2)+dble((j-1))*alat
	       pos(n,2)=pos1(k,3)+dble(l-1)*alat
              end do
	    end do
	 end do
      end do
      do i=1,n
c        pos(i,1)=pos(i,1)-2.0d0*alat
c        pos(i,3)=pos(i,3)-2.0d0*alat
      end do
c     open (1,file='latt.mol')
c     write(1,*) 'TITLE'
c     write(1,*) '    Al - inteface'
c     write(1,*) 'CELL'
c     write(1,*) '  1   1   1   90   90   90'
c     write(1,*) 'COORD'
c     write(1,*) nat
c     write(1,*) 'AL bulk'
c     do i=1,nat
c        write(1,*) '13',(pos(i,j),j=1,3)
c     end do
c     close(1)
      return
      end
