      program random
      integer K, N, init
      parameter (K = 16, N=50000)
      integer C(0:K-1)
      integer A(N), HA(N)
cmf$  layout HA(:host)
cmf$  layout C(:host)
      print *, 'Init (seed for random numbers): '
      read *, init
      call cmf_randomize (init)
      print *, 'Get ', N, ' random numbers in range 0 - ', K-1
      call cmf_random (A,K)
      HA = A
      print *, 'Counting: '
c     print *, HA
      C = 0
      do I = 1, N
        C(HA(I)) = C(HA(I)) + 1
      end do
      do I = 1, K
        print *, I-1, ' : ', C(I-1)
      end do
      end
