C     .TITLE SETUP
C
C  18 SEPT 73
C  19 SEPT 73 - CHANGE ISSUANCE OF MESSAGE TECHNIQUES
C  16 OCT 73 - CHANGE SYCHRONIZATION TECHNIQUE
C
C     ASSIGN DK5=5 (CAN USE CD,TT OR PR)
C     USED SWITCHED ACCUMULATOR (SAC) TO ALTER
C     A SINGLE OR MANY VARIABLES FROM TT
C
C     ORDER OF VARIABLES AND ASSOCIATED SAC POSITION
C
C     REAL VARIABLES
C
C     SAC=0  'T' - TIME INTERVAL
C     SAC=1  'SAMPLS' - NUMBER OF SAMPLES PER CHANNEL
C     SAC=2  'UPPER' - POSITIVE REFERENCE VALUE FOR START-STOP OPTION
C                  (NEG VALUE INDICATES NO START-STOP DESIRED)
C     SAC=3  'LOWER' - NEGATIVE REFERENCE VALUE FOR START-STOP OPTION
C     SAC=4  'XMV' - REFERENCE VALUE FOR SYNCHRONIZATION OPTION
C
C     INTEGER VARIABLES
C
C     SAC=5  'STRSTP' - NUMBER OF DATA SETS REQUIRED FOR START-STOP OPTION
C     SAC=6  'MM' - CHANNEL USED IF SYNCHRONIZATION OPTION USED
C                  (NEG VALUE INDICATES NO SYCHRONIZATION DESIRED)
C     SAC=7  'IC' - INITIAL CHANNEL USED
C     SAC=8  'NOCHLS' - NUMBER OF CHANNELS USED
C
C     LOGICAL VARIABLES
C
C     SAC=9 'SEE' -FLAG FOR MONITORING LOW FREQUENCY DATA
C     SAC=10 'TT' - FLAG FOR ISSUING PROGRAM INFORMATION
C     SAC=11 'OMIT' - FLAG FOR PERMITTING AN AUTOMATIC OR BATCH MODE RUN
C     SAC=12 'FAST' - FLAG FOR USING MACHINE CYCLES RATHER THAN CLOCK
C     SAC=13 'INOUT' - FLAG FOR DETERMINING WHICH BAND OF INFO S-S WILL USE
C                     (.TRUE.=OUTSIDE; .FALSE.=INSIDE)
C
C     SAC=14 INVALID
C     SAC=15 INVALID
C     SAC=16 USED WITH FETCH FOR WRITING ON LP INSTEAD OF PPD
C     SAC=17 FOR USE WITH FETCH PROGRAM TO GIVE NUMERICAL INTERRUPTATION
C              TO DATA
      LOGICAL ERROR,LDUMB,LOG (5)
      DIMENSION FILENM (2),W(13,14)
      COMMON /BUFF1/IY(6144)
      COMMON /MAN6/R(5),INT(4),LOG,ERROR
      COMMON /BLK/I(18)
C
      DATA FILENM (1),FILENM (2)/5HDFILE,4H SRC/
      DATA W(1,1),W(2,1),W(3,1)/5HENTER,5H 'T' ,5H- TIM/
      DATA W(4,1),W(5,1)/5HE INT,5HERVAL/
      DATA W(1,2),W(2,2),W(3,2)/5HENTER,5H 'SAM,5HPLS' /
      DATA W(4,2),W(5,2),W(6,2)/5H- NUM,5HBER O,5HF SAM/
      DATA W(7,2),W(8,2),W(9,2)/5HPLES ,5HPER C,5HHANNE/
      DATA W(10,2)/1HL/
      DATA W(1,3),W(2,3),W(3,3)/5HENTER,5H 'UPP,5HER' -/
      DATA W(4,3),W(5,3),W(6,3)/5H POSI,5HTIVE ,5HREFER/
      DATA W(7,3),W(8,3),W(9,3)/5HENCE ,5HVALUE,5H FOR /
      DATA W(10,3)/3HS-S/
      DATA W(1,4),W(2,4),W(3,4)/5HENTER,5H 'LOW,5HER' -/
      DATA W(4,4),W(5,4),W(6,4)/5H NEGA,5HTIVE ,5HREFER/
      DATA W(7,4),W(8,4),W(9,4)/5HENCE ,5HVALUE,5H FOR /
      DATA W(10,4)/3HS-S/
      DATA W(1,6),W(2,6),W(3,6)/5HENTER,5H 'STR,5HSTP' /
      DATA W(4,6),W(5,6),W(6,6)/5H- NUM,5HBER O,5HF DAT/
      DATA W(7,6),W(8,6),W(9,6)/5HA SET,5HS REQ,5HUIRED/
      DATA W(1,7),W(2,7),W(3,7)/5HENTER,5H 'MM',5H - SY/
      DATA W(4,7),W(5,7),W(6,7)/5HNCHRO,5HNIZAT,5HION C/
      DATA W(7,7),W(8,7)/5HHANNE,1HL/
      DATA W(1,5),W(2,5),W(3,5)/5HENTER,5H 'XMV,5H' - A/
      DATA W(4,5),W(5,5),W(6,5)/5HBSOLU,5HTE RE,5HFEREN/
      DATA W(7,5),W(8,5),W(9,5)/5HCE VA,5HLUE F,5HOR SY/
      DATA W(10,5),W(11,5),W(12,5)/5HNCHRO,5HNIZAT,5HION O/
      DATA W(13,5)/5HPTION/
      DATA W(1,8),W(2,8),W(3,8)/5HENTER,5H 'IC',5H - IN/
      DATA W(4,8),W(5,8),W(6,8)/5HITIAL,5H CHAN,5HNEL U/
      DATA W(7,8)/3HSED/
      DATA W(1,9),W(2,9),W(3,9)/5HENTER,5H 'NOC,5HHLS' /
      DATA W(4,9),W(5,9),W(6,9)/5H- NUM,5HBER O,5HF CON/
      DATA W(7,9),W(8,9),W(9,9)/5HSECUT,5HIVE C,5HHANNE/
      DATA W(10,9),W(11,9)/5HLS US,2HED/
      DATA W(1,10),W(2,10),W(3,10)/5HENTER,5H 'SEE,5H' - C/
      DATA W(4,10),W(5,10),W(6,10)/5HHANNE,5HL MON,5HITORI/
      DATA W(7,10),W(8,10)/5HNG OP,4HTION/
      DATA W(1,11),W(2,11),W(3,11)/5HENTER,5H 'TT',5H - US/
      DATA W(4,11),W(5,11),W(6,11)/5HER ME,5HSSAGE,5H OPTI/
      DATA W(7,11)/2HON/
      DATA W(1,12),W(2,12),W(3,12)/5HENTER,5H 'OMI,5HT' - /
      DATA W(4,12),W(5,12),W(6,12)/5HBATCH,5H MODE,5H OPTI/
      DATA W(7,12)/2HON/
      DATA W(1,13),W(2,13),W(3,13)/5HENTER,5H 'FAS,5HT' - /
      DATA W(4,13),W(5,13),W(6,13)/5HNO CL,5HOCK O,5HPTION/
      DATA W(1,14),W(2,14),W(3,14)/5HENTER,5H 'INO,5HUT' -/
      DATA W(4,14),W(5,14),W(6,14)/5H BOUN,5HDRY C,5HONDIT/
      DATA W(7,14),W(8,14),W(9,14)/5HION F,5HOR S-,5HS OPT/
      DATA W(10,14)/3HION/
C
C
99    CALL SEEK (5,FILENM)
C
100   CALL SELECT
C
      DO 1000 K=1,2
      IF (I(K+14).NE.0) GO TO 111
1000  CONTINUE
C
      L=1
      DO 108 K=1,14
      IF (K.EQ.6) L=L+1
      IF (K.EQ.10) L=L+1
      IF (I(K).NE.0) GO TO 104
C
C     NO VARIABLE CHANGE
C
      GO TO (101,102,103),L
101   READ (5,15) R(K)
      GO TO 108
102   READ (5,16) INT(K-5)
      GO TO 108
103   READ (5,17) LOG(K-9)
      GO TO 108
C
C     CHANGE A VARIABLE
C
104   WRITE (8,905) (W(KK,K),KK=1,11)
      GO TO (105,106,107),L
105   READ (5,15)DUMB
      READ (4,15)R(K)
      GO TO 108
106   READ (5,16) IDUMB
      READ (4,16) INT(K-5)
      GO TO 108
107   READ (5,17) LDUMB
      READ (4,17) LOG (K-9)
C
108   CONTINUE
C
      WRITE (8,900) (R(K),K=1,5)
      WRITE (8,901) (INT(K),K=1,4)
      WRITE (8,902) (LOG(K),K=1,5)
C
      CALL FSAMPL
      IF (ERROR) GO TO 110
109   CALL CLOSE (5)
      CALL FETCH (I(18),INT(4),-1)
      GO TO 99
C
110   WRITE (8,903) INT(2)
      PAUSE 2
      GO TO 109
C
111   WRITE (8,904)
      PAUSE 3
      GO TO 100
C
C     FORMAT STATEMENTS
C
15    FORMAT (F14.6)
16    FORMAT (I2)
17    FORMAT (L1)
18    FORMAT (1H ,2I12)
C
900   FORMAT (1H ,2HT=,F8.6,2X,7HSAMPLS=,F7.0,2X,6HUPPER=,F6.2,2X,6HLO
     3WER=,F6.2,2X,5HXMV= ,F6.2)
901   FORMAT (1H ,7HSTRSTP=,I3,2X,3HMM=,I3,2X,3HIC=,I3,2X,7HNOCHLS=,I3
     4)
902   FORMAT (1H ,5HSEE= ,L1,2X,4HTT= ,L1,2X,6HOMIT= ,L1,2X,6HFAST= ,L
     51,2X,6HINOUT= ,L1)
903   FORMAT (1H ,16HCLOCK VALUE WAS ,I8)
904   FORMAT (1H ,26HCHECK SWITCHED ACCUMULATOR)
905   FORMAT (1H ,11A5)
C
      END
