      subroutine potts_ran(ista,ns,nq) ! bernd berg, nov 10 2007.
c assigns random (i.e. beta=0) values 0,..,nq-1 to the states ista(is).
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      dimension ista(ns)
      q=one*nq
      do is=1,ns
        call ranmar(xr)
        ista(is)=int(q*xr)
      end do
      return
      end
