	INTEGER FUNCTION RND(LIMIT)

C
C	GENERATES RANDOM INTEGER IN THE RANGE
C		0 < N < LIMIT
C
C	USES THE RANDOM SEED GENERATED BY THE
C	RALF MODULE "SEED"
C
	COMMON/NUMCOM/NUMBER
	LOGICAL FLAG
	DATA FLAG/.FALSE./,NUMBER/0/
	IF(FLAG)GOTO 10
	FLAG=.TRUE.
	IRND=132*(NUMBER+327)
10	IRND=MOD(IRND*1021,1048576)
	RND=(LIMIT*IRND)/1048576
	RETURN
	END
