	SUBROUTINE CSM5
C	FUNCTION GENERATOR SPECIFICATIONS
	INTEGER TEST2,TEST9
	LOGICAL RSAC
	DIMENSION MTRX(75,5),NOFG(3),F(3,11),C(76),PAR1(75),PAR2(75)
	COMMON REALS(395),INTS(547)
	EQUIVALENCE (INTS(1),MTRX(1,1))
	EQUIVALENCE (INTS(421),NOFG(1))
	EQUIVALENCE (INTS(526),TEST2),(INTS(533),TEST9)
	EQUIVALENCE (REALS(2),C(1)),(REALS(81),PAR1(1))
	EQUIVALENCE (REALS(156),PAR2(1)),(REALS(306),F(1,1))
C	GET INPUT UNIT TEST2
	CALL INUNIT
	WRITE(4,10)
10	FORMAT(/10X,33HFUNCTION GENERATOR SPECIFICATIONS/)
C	GET BLOCK NUMBER
20	I=KINPUT(0,IERR)
	IF (IERR) 300,30,200
30	IF (I) 240,300,40
40	IF (I.GT.75.OR.MTRX(I,1).NE.6) GO TO 240
C	FIND SPOT FOR THE FUNCTION GENERATOR
	DO 50 M=1,3
	IF (I.EQ.NOFG(M)) GO TO 70
50	CONTINUE
	DO 60 M=1,3
	N=NOFG(M)
	IF (N.EQ.0.OR.MTRX(N,1).NE.6) GO TO 70
60	CONTINUE
	GO TO 240
70	N=1
C	GET INTERCEPTS
80	C(N)=FINPUT(0,IERR)
	IF (IERR) 80,90,200
90	N=N+1
	IF (N.LE.11) GO TO 80
	IF (FINPUT(-1,IERR).NE.0.0) GO TO 220
C	STORE FUNCTION GENERATOR
	MTRX(I,5)=M
	NOFG(M)=I
	DO 100 N=1,11
100	F(M,N)=C(N)
	IF (TEST2.NE.4.AND..NOT.RSAC(10)) WRITE(4,110) I,(C(N),N=1,11)
C 	TELEPRINTER RECORD
110	FORMAT(I3,9X,5(1X,G11.4)/6(1X,G11.4))
C	CHECK PAR1 AND PAR2
120	IF (PAR1(I).GT.PAR2(I)) GO TO 20
	WRITE(4,130) I
130	FORMAT(44H SPECIFY LIMITS FOR FUNCTION GENERATOR BLOCK,I3)
140	WRITE(4,150)
150	FORMAT(14H UPPER, LOWER=)
	PAR1(I)=FINPUT(0,IERR)
	IF (IERR.NE.0) GO TO 140
	PAR2(I)=FINPUT(0,IERR)
	IF (IERR) 120,160,140
160	IF (FINPUT(-1,IERR).NE.0.0) GO TO 140
	GO TO 120
C	ERROR SECTION
200	WRITE(4,210)
210	FORMAT(13H SYNTAX ERROR)
	GO TO 260
220	WRITE(4,230)
230	FORMAT(30H TOO MANY INTERCEPTS SPECIFIED)
	GO TO 260
240	WRITE(4,250) I
250	FORMAT(6H BLOCK,I3,40H WAS NOT DEFINED AS A FUNCTION GENERATOR)
260	TEST9=-1
	GO TO 20
C	END OF FUNCTION GENERATOR SPECIFICATION
300	TEST9=0
	RETURN
	END
