fff17ecf8ea305220f3b4a14ae7afcf30cbe2c4b
[pdp8.git] / sw / rescue / lab8e_goettingen / disk2_11 / rkb / paroff / haeopn.ft
1 C -+-+-+-+-+ \ e H A E O P N . F T \ e -+-+-+-+-+
2 C
3 C * UP 29-NOV-82
4 C
5 C OPEN THE OUTPUT FILE 6 FOR APPENDING
6 C
7 SUBROUTINE OPNSIX
8 INCLUDE HAEBUF.FI
9 INCLUDE HAETTY.FI
10 INCLUDE HAECLR.FI
11 C
12 \f INTEGER LOC
13 EXTERNAL LOC
14 INTEGER K,REV,
15 * TEMPB(85), @ TEMPORARY INPUT BUFFER FOR FILE HEADER
16 * TMAXBL, @ MAX BLOCKS IN THIS FILE
17 * TREC
18 C
19 INPREC=-1 @ SET THE 'NO SAMPLE IN CORE' FLAG FOR ESAM
20 UNIT=6 @ ESAM INPUT IS FROM FILE 6
21 IF (REC6.LT.1) DEFINE FILE 6(MAXREC,85,U,REC6) @ INIT THE INPUT UNIT
22 REC6=1 @ INIT TO THE FIRST RECORD
23 SIXCNT=0 @ COUNT THE DATA SETS FOUND ON UNIT 6
24 TMAXBL=MAXREC @ DEFAULT FILE LENGTH --> TMAXBL
25 BLKCNT=TMAXBL @ DEFAULT LENGTH INTO THE HEADER
26 5 READ(6'REC6) TEMPB @ READ THE NEXT HEADER BLOCK
27 SIXCNT=SIXCNT+1 @ INCREMENT DATA SET COUNTER
28 REV=TEMPB((LOC(REVSON)-LOC(RCRD0))/3+1) @ REVISON NUMBER --> K
29 IF (INT(REVSON).NE.INT(REV).AND..NOT.CLEAR
30 * .AND.REC6.EQ.1) GOTO 30 @ REVISON NUMBER INCOMPABILITY
31 K=TEMPB((LOC(REDVAL)-LOC(RCRD0))/3+1) @ ADR. OF READ VALID FLAG --> K
32 IF (.NOT.CLEAR .AND. K.EQ.6HDLWPD2) GOTO 10 @ IF CLEAR FLAG THEN WE START AT THE FIRST RECORD ELSE
33 C @ IF RECORD IS VALID THEN SKIP THE DATA SET
34 CLEAR=.FALSE. @ RESET THE CLEAR FLAG
35 TREC=REC6-1 @ THIS RECORD BECOMES THE HEADER BLOCK
36 REC6=TREC @ INDEX TO THE NEW HEADER BLOCK --> REC6
37 XSAML=(TMAXBL-REC6-1)*255 @ MAX SAMPLE COUNT FITTING INTO THE REMAINING FILE SPACE ( ONE CHANNEL INPUT) --> XSAML
38 IF (XSAML.LT.640) GOTO 20 @ IF AT LEAST 64 HZ *10 SEC SAMPLING IS NOT POSSIBLE THEN GOTO 20
39 SETNUM=SIXCNT @ SAVE THE CURRENT NUMBER OF THIS DATA SET
40 RETURN @ REC6 POINTS TO THE NEW HEADER BLOCK
41 C
42 C
43 10 K=TEMPB((LOC(LASREC)-LOC(RCRD0))/3+1) @ ADR. OF LASREC --> K
44 CLEAR=.FALSE.
45 REC6=K+1 @ BLOCK OF NEXT HEADER --> REC6
46 K=TEMPB((LOC(BLKCNT)-LOC(RCRD0))/3+1) @ ADR. OF BLKCNT --> K
47 TMAXBL=K @ LENGTH OF FILE --> TMAXBL
48 BLKCNT=TMAXBL @ INSERT THE LENGTH OF THE FILE INTO THE HEADER OF THE NEXT DATA SET
49 IF (REC6.LT.TMAXBL) GOTO 5 @ IF END OF FILE REACHED THEN READ THE NEXT DATA SET AT LASREC+1
50 20 WRITE (TTO,1) SIXCNT,REC6 @ END OF FILE
51 XSAML=0 @ ABORTS ADCON SINCE THERE IS NO SPACE FOR OUTPUT
52 SETNUM=0 @ NO DATA SET FOUND IN THE BUFFER
53 RETURN
54 30 CONTINUE
55 WRITE (TTO,2) REV,REVSON
56 GOTO 20
57 C
58 1 FORMAT (' AUSGABEDATEI 6 IST VOLL. LETZTER SATZ:',I3,
59 * ' BLOCK:',I4)
60 2 FORMAT (' AUSGABEDATEI 6 REV.:',F4.1,' - HAE REV.:',F4.1)
61 END
62 \1a