!* wrapper around SRAND
!      SUBROUTINE RNDINI ()
!       IMPLICIT NONE
!       REAL R
!       COMMON R
!       CALL SRAND(TIME())
!       R = RAND(0) ! burn first number in sequence (compensate for gfortran)
!       RETURN
!      END  ! of RNDINI


* wrapper around RAND
      FUNCTION URAND ()
       IMPLICIT NONE
       REAL URAND
       URAND = RAND(0)
       RETURN
      END  ! of URAND


* pull a number out of a hat. ie- uniform distribution 1 to n
      FUNCTION HAT (N)
       IMPLICIT NONE
       INTEGER N, HAT
       HAT = MIN(INT(RAND(0) * N) + 1, N)
       RETURN
      END  ! of HAT
*+++++++++++++++++++ End of file random.f ++++++++++++++++++++++++++++++
