C Operating system dependent subroutines.
C
C COPYRIGHT 1980, 1990, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA.
C ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
C WRITTEN BY R. M. SUPNIK
C
C ITIME - Return system time in component form
C
	SUBROUTINE ITIME (H, M, S)
	IMPLICIT INTEGER (A-Z)
	INTEGER*2 TIME (7)

	CALL SYS$NUMTIM (TIME, %VAL(0))
	H = TIME(4)
	M = TIME(5)
	S = TIME(6)
	RETURN

	END
C
C RND - Return a random integer mod n
C
	INTEGER FUNCTION RND (N)
	IMPLICIT INTEGER (A-Z)
	REAL RAN
	COMMON /SEED/ RNSEED

	RND = RAN(RNSEED)*FLOAT(N)
	RETURN

	END
C
C INIRND - Initialize random number seed
C
	SUBROUTINE INIRND (LOW, HIGH)
	IMPLICIT INTEGER (A-Z)
	COMMON /SEED/ RNSEED

	RNSEED = (ISHFT(HIGH,16)+LOW).OR.1
	RETURN

	END
	
