	SUBROUTINE BITINT(I,IBIT)
C	Routine to convert binary pattern to integer:
C	BIT PATTERN: 15|14 13 12|11 10 9|8 7 6|5 4 3|2 1 0
C	0000000000001010 = OCTAL 12 = DECIMAL 10
C	IBIT(1)=BIT 0 (SIGN BIT), IBIT(2)=BIT 1, IBIT(3)=BIT 2, ETC.
C 
	LOGICAL*1 IBIT(16)
	I=0
	DO 1 J=1,15
	IF(IBIT(J).NE.0) I=I+2**(J-1)
1	CONTINUE
	IF(IBIT(16).NE.0) I=-((32767-I)+1)  ! SIGN BIT
	RETURN
	END
