      subroutine lat0_init(ns,nd,ipf,ipb,nla,ix) ! BB Dec 6 2011 
      dimension ipf(nd,ns),ipb(nd,ns),nla(nd),ix(nd)
C Initialize number of lattice sites and links. Initialize pointer arrays.
      if(ns.ne.nsfun(nla,nd)) then 
        print*,"lat_init stop ns-nla mismatch: nd,ns,nla:",nd,ns,nla
        stop "lat_init: ns-nla mismatch!"
      end if
C Initialize pointers:
      do is=1,ns
        call ipointer0(ipf,ipb,nla,ix,ns,is,nd)
      end do
      return
      end 
      
