      SUBROUTINE GLOB_THRSH_AO()
C----------------------------------------------------------------------
C-
C-   Purpose and Methods : Assign a value (True, False, Not allocated) to each
C-      Global Threshold cleared value.
C-
C-   Inputs  : common block variables
C-   Outputs : common block variables
C-   Controls: none
C-
C-   Created  30-APR-1991   MICHIGAN STATE UNIVERSITY, TRIGGER CONTROL SOFTWARE
C-
C----------------------------------------------------------------------
      IMPLICIT NONE
      INCLUDE 'LV1_MPOOL.PARAMS'
      INCLUDE 'LV1_GLOB_THRSH_AO.INC'
      INCLUDE 'LV1_MPOOL_DERIVED.INC'
      INCLUDE 'LV1_MPOOL_FORMATTED.INC'
      INCLUDE 'LV1_MPOOL_RAW.INC'
      LOGICAL  STATE_AOTERM
      EXTERNAL STATE_AOTERM
C
      INTEGER THRSH_INDEX
      INTEGER THRSH_TYPE
      INTEGER RS_NUM
C
C       Do Global E (and Pt) thresholds
C
      DO THRSH_TYPE = GT_EM_ET_THRSH, GT_MIS_PT_THRSH
        DO THRSH_INDEX = 0, GT_MAX_E_THRSH-1
          IF (IBITS(GL_ENG_THRSH(GT_ALLOC_INDEX, THRSH_INDEX,
     &      THRSH_TYPE), GT_ALLOCATED_BIT, GT_ALLOCATED_LEN)
     &      .EQ. GT_ALLOCATED) THEN
C
            IF (STATE_AOTERM(GT_E_AO_TERM(THRSH_INDEX,THRSH_TYPE))
     &        .EQV. .TRUE.) THEN
              CALTRIG_DATA.GLOB_THRSH_E_CLEARED(THRSH_INDEX,
     &          THRSH_TYPE) = GT_T
            ELSE
              CALTRIG_DATA.GLOB_THRSH_E_CLEARED(THRSH_INDEX,
     &          THRSH_TYPE) = GT_F
C
            ENDIF
C
          ELSE !Not allocated
            CALTRIG_DATA.GLOB_THRSH_E_CLEARED(THRSH_INDEX,
     &        THRSH_TYPE) = GT_NA
          ENDIF
C
        END DO
      END DO
C
C
      DO THRSH_TYPE = GT_EM_CNT_THRSH, GT_TOT_CNT_THRSH
        DO RS_NUM = GT_RS_MIN, GT_RS_MAX
          DO THRSH_INDEX = 0, GT_MAX_CNT_THRSH-1
            IF (IBITS(GL_CNT_THRSH(GT_ALLOC_INDEX, THRSH_INDEX,
     &        RS_NUM, THRSH_TYPE), GT_ALLOCATED_BIT, GT_ALLOCATED_LEN)
     &        .EQ. GT_ALLOCATED) THEN
C
              IF (STATE_AOTERM(GT_CNT_AO_TERM(THRSH_INDEX, 
     &          RS_NUM, THRSH_TYPE)) .EQV. .TRUE.) THEN
                CALTRIG_DATA.GLOB_THRSH_CNT_CLEARED(THRSH_INDEX,
     &            RS_NUM, THRSH_TYPE) = GT_T
              ELSE
                CALTRIG_DATA.GLOB_THRSH_CNT_CLEARED(THRSH_INDEX,
     &            RS_NUM, THRSH_TYPE) = GT_F
C
              ENDIF
C
            ELSE !Not allocated
              CALTRIG_DATA.GLOB_THRSH_CNT_CLEARED(THRSH_INDEX,
     &          RS_NUM, THRSH_TYPE) = GT_NA
            ENDIF
C
          END DO
        END DO
      END DO
C----------------------------------------------------------------------
  999 RETURN
      END
C
C
C
      SUBROUTINE INIT_GLOB_THRSH_AO()
C----------------------------------------------------------------------
C-
C-   Purpose and Methods : Initialize the arrays that map global thresholds to
C-      AndOr terms. If a term is undefined, give it an index of -1.
C-
C-      Searches for the Trigger Resource file in the following order:
C-      
C-      Logical name TRGMON_RESOURCE
C-      COOR's resource file for the current run ONLINE:[COOR_EXEC]TRIGGER.RES
C-      D0$LEVEL1$DATA:TRIGGER_RESOURCES.RCP
C-      HTRGMON:TRIGGER_RESOURCES.RCP
C-      Hard coded values.
C-
C-
C-   Inputs  : none
C-   Outputs : filled common block array
C-   Controls: none
C-
C-   Created   3-MAY-1991   MICHIGAN STATE UNIVERSITY, TRIGGER CONTROL SOFTWARE
C-   Updated  20-MAR-1992   Philippe Laurens, Steven Klocek  
C-                      Get Andor Term index definitions from Trigger Resource
C-                        file. 
C-
C----------------------------------------------------------------------
      IMPLICIT NONE
      INCLUDE 'LV1_MPOOL.PARAMS'
      INCLUDE 'LV1_GLOB_THRSH_AO.INC'
C
      INTEGER IER
      INTEGER COUNT
      INTEGER THRSH, REF
      INTEGER TERM_INDEX
      INTEGER NEWLEN
      INTEGER NID, ID
      INTEGER TERM_NUM
      INTEGER RCPKEY_LEN
      CHARACTER*32 RCPKEY
      CHARACTER*3 NUM_STR(0:15)
      DATA NUM_STR / '_0 ', '_1 ', '_2 ', '_3 ', '_4 ', '_5 ', '_6 ', 
     &        '_7 ', '_8 ', '_9 ', '_10', '_11', '_12', '_13', '_14',
     &        '_15' /
C
      CHARACTER*32 THRSH_STR(GT_EM_ET_THRSH:GT_MIS_PT_THRSH)
      DATA THRSH_STR / 'L1C_EMETSUM_CMP', 'L1C_HDETSUM_CMP', 
     &  'L1C_TOTETSUM_CMP', 'L1C_EML2SUM_CMP',
     &  'L1C_HDL2SUM_CMP',  'L1C_TOTL2SUM_CMP', 'L1C_MISPTSUM_CMP'  /
C
      CHARACTER*32 CNT_THRSH_STR(GT_EM_CNT_THRSH:GT_TOT_CNT_THRSH)
      DATA CNT_THRSH_STR / 'L1C_EMETCNT_REF', 'L1C_TOTETCNT_REF' /
C
      INTEGER RCPOK
      PARAMETER (RCPOK = 0)
C
C       Clear the term names
C
      DO TERM_INDEX = ANDOR_NUM_MIN, ANDOR_NUM_MAX
        ANDOR_TERM_NAME(TERM_INDEX) = ' '
      END DO
C
C       INRCP should not abort if it finds an error.
C
      CALL EZ_ABORT_ON_BAD_VALUE(.FALSE.)
C
C       Load in the Trigger Resource file.
C       Try to get it from the most authoritative source.
C
C       First, try the logical TRGMON_RESOURCE
C         This is so the defaults can be overridden at any time.
C
      CALL INRCP('TRGMON_RESOURCE', IER)
      IF (IER .EQ. RCPOK) GOTO 100
      CALL OUTMSG(
     &  ' Could not open Trigger Resource file "TRGMON_RESOURCE"')
      CALL WAITIT(2.0)
C
C       Try COOR's files from the current run:
C
      CALL INRCP('ONLINE:[COOR_EXEC]TRIGGER.RES', IER)
      IF (IER .EQ. RCPOK) GOTO 100
      CALL OUTMSG(
     &  ' Could not open Trigger Resource file ' 
     &  // '"ONLINE:[COOR_EXEC]TRIGGER.RES"')
      CALL WAITIT(2.0)
C
C       Next, try the D0$LEVEL1: area
C
      CALL INRCP('D0$LEVEL1$DATA:TRIGGER_RESOURCES.RCP', IER)
      IF (IER .EQ. RCPOK) GOTO 100
      CALL OUTMSG(
     &  ' Could not open Trigger Resource file ' 
     &  // '"D0$LEVEL1$DATA:TRIGGER_RESOURCES.RCP"')
      CALL WAITIT(2.0)
C
C       At the time this routine was written, the official RELEASE of LEVEL1
C       did not include the resource file. So, also look for a copy in HTRGMON:
C
      CALL INRCP('HTRGMON:TRIGGER_RESOURCES.RCP', IER)
      IF (IER .EQ. RCPOK) GOTO 100
      CALL OUTMSG(
     &  ' Could not open Trigger Resource file ' 
     &  // '"HTRGMON:TRIGGER_RESOURCES.RCP"')
      CALL WAITIT(2.0)
C
C       If none of these exist, use hard-coded parameters
C       
      CALL OUTMSG(
     &  ' Could not find a Trigger Resource file')
      GOTO 300
C
C       Get the term definitions from the RCP bank
C
  100 CONTINUE
C 
      CALL EZPICK('L1_ANDOR_RESOURCE')
      CALL EZERR(IER)
      IF (IER .NE. RCPOK) THEN
        CALL ERRMSG('NO RESOURCE BANK', 'GLOB_THRSH_AO',
     &    ' Could not find RCP bank L1_ANDOR_RESOURCE', 'W')
        GOTO 300
      ENDIF
C
C       Store the Term Names by index
C
      NID = 1
      ID = 1
      DO WHILE (ID .NE. 0) 
        TERM_INDEX = ANDOR_NUM_MAX + 1
        ID = 0
        CALL EZGNXT(' ', NID, ID)
        IF (ID .NE. 0) THEN
          CALL EZGETN(ID, RCPKEY, RCPKEY_LEN)
          CALL EZGET(RCPKEY(1:RCPKEY_LEN), TERM_INDEX, IER)
          IF ((TERM_INDEX .GE. ANDOR_NUM_MIN) 
     &      .AND. (TERM_INDEX .LE. ANDOR_NUM_MAX) ) THEN
            ANDOR_TERM_NAME(TERM_INDEX) = RCPKEY(1:RCPKEY_LEN)
          ENDIF
        ENDIF
      END DO
C
C       Energy thresholds
C
      DO THRSH = GT_EM_ET_THRSH, GT_MIS_PT_THRSH
        DO COUNT = 0, 15
          RCPKEY = THRSH_STR(THRSH) 
          CALL ADDSTR(RCPKEY, NUM_STR(COUNT), RCPKEY, NEWLEN)
          CALL EZGET(RCPKEY, TERM_INDEX, IER)
          IF (IER .NE. RCPOK) THEN
            TERM_INDEX = -1
          ENDIF
          GT_E_AO_TERM(COUNT, THRSH) = TERM_INDEX
        END DO
      END DO
C
C       Count Thresholds
C
      DO THRSH = GT_EM_CNT_THRSH, GT_TOT_CNT_THRSH
        DO REF = 0, 3
          DO COUNT = 0, 7
            RCPKEY = CNT_THRSH_STR(THRSH)
            CALL ADDSTR(RCPKEY, NUM_STR(REF), RCPKEY, NEWLEN)
            CALL ADDSTR(RCPKEY, '_CMP', RCPKEY, NEWLEN)
            CALL ADDSTR(RCPKEY, NUM_STR(COUNT), RCPKEY, NEWLEN)
            CALL EZGET(RCPKEY, TERM_INDEX, IER)
            IF (IER .NE. RCPOK) THEN
              TERM_INDEX = -1
            ENDIF
            GT_CNT_AO_TERM(COUNT, REF, THRSH) = TERM_INDEX
          END DO
        END DO
      END DO
C
      CALL EZRSET()
      GOTO 999
C
C       Hard-coded parameters
C
  300 CONTINUE
      CALL OUTMSG(
     &  ' Using hard-coded parameters for Andor Term Index definitions')
      CALL WAITIT(2.0)
C
C       The following are the terms as of 20-MAR-1992 
C
C       The arrays are indexed as:
C       GT_E_AO_TERM(<Threshold number>,<Threshold Type>)
C
      GT_E_AO_TERM(0, GT_EM_ET_THRSH) =  128
      GT_E_AO_TERM(01, GT_EM_ET_THRSH) = 129
      GT_E_AO_TERM(02, GT_EM_ET_THRSH) = 130
      GT_E_AO_TERM(03, GT_EM_ET_THRSH) = 131
      GT_E_AO_TERM(04, GT_EM_ET_THRSH) = 132
      GT_E_AO_TERM(05, GT_EM_ET_THRSH) = 133
      GT_E_AO_TERM(06, GT_EM_ET_THRSH) = 134
      GT_E_AO_TERM(07, GT_EM_ET_THRSH) = 135
      GT_E_AO_TERM(08, GT_EM_ET_THRSH) = -1
      GT_E_AO_TERM(09, GT_EM_ET_THRSH) = -1
      GT_E_AO_TERM(10, GT_EM_ET_THRSH) = -1
      GT_E_AO_TERM(11, GT_EM_ET_THRSH) = -1
      GT_E_AO_TERM(12, GT_EM_ET_THRSH) = -1
      GT_E_AO_TERM(13, GT_EM_ET_THRSH) = -1
      GT_E_AO_TERM(14, GT_EM_ET_THRSH) = -1
      GT_E_AO_TERM(15, GT_EM_ET_THRSH) = -1
C
      GT_E_AO_TERM(0, GT_HD_ET_THRSH) =  136
      GT_E_AO_TERM(01, GT_HD_ET_THRSH) = 137
      GT_E_AO_TERM(02, GT_HD_ET_THRSH) = 138
      GT_E_AO_TERM(03, GT_HD_ET_THRSH) = 139
      GT_E_AO_TERM(04, GT_HD_ET_THRSH) = 140
      GT_E_AO_TERM(05, GT_HD_ET_THRSH) = 141
      GT_E_AO_TERM(06, GT_HD_ET_THRSH) = 142
      GT_E_AO_TERM(07, GT_HD_ET_THRSH) = 143
      GT_E_AO_TERM(08, GT_HD_ET_THRSH) = -1
      GT_E_AO_TERM(09, GT_HD_ET_THRSH) = -1
      GT_E_AO_TERM(10, GT_HD_ET_THRSH) = -1
      GT_E_AO_TERM(11, GT_HD_ET_THRSH) = -1
      GT_E_AO_TERM(12, GT_HD_ET_THRSH) = -1
      GT_E_AO_TERM(13, GT_HD_ET_THRSH) = -1
      GT_E_AO_TERM(14, GT_HD_ET_THRSH) = -1
      GT_E_AO_TERM(15, GT_HD_ET_THRSH) = -1
C
      GT_E_AO_TERM(0, GT_TOT_ET_THRSH) =  144
      GT_E_AO_TERM(01, GT_TOT_ET_THRSH) = 145
      GT_E_AO_TERM(02, GT_TOT_ET_THRSH) = 146
      GT_E_AO_TERM(03, GT_TOT_ET_THRSH) = 147
      GT_E_AO_TERM(04, GT_TOT_ET_THRSH) = 148
      GT_E_AO_TERM(05, GT_TOT_ET_THRSH) = 149
      GT_E_AO_TERM(06, GT_TOT_ET_THRSH) = 150
      GT_E_AO_TERM(07, GT_TOT_ET_THRSH) = 151
      GT_E_AO_TERM(08, GT_TOT_ET_THRSH) = 152
      GT_E_AO_TERM(09, GT_TOT_ET_THRSH) = 153
      GT_E_AO_TERM(10, GT_TOT_ET_THRSH) = 154
      GT_E_AO_TERM(11, GT_TOT_ET_THRSH) = 155
      GT_E_AO_TERM(12, GT_TOT_ET_THRSH) = -1
      GT_E_AO_TERM(13, GT_TOT_ET_THRSH) = -1
      GT_E_AO_TERM(14, GT_TOT_ET_THRSH) = -1
      GT_E_AO_TERM(15, GT_TOT_ET_THRSH) = -1
C
      GT_E_AO_TERM(0, GT_EM_L2_THRSH) =  164
      GT_E_AO_TERM(01, GT_EM_L2_THRSH) = 165
      GT_E_AO_TERM(02, GT_EM_L2_THRSH) = 166
      GT_E_AO_TERM(03, GT_EM_L2_THRSH) = 167
      GT_E_AO_TERM(04, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(05, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(06, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(07, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(08, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(09, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(10, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(11, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(12, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(13, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(14, GT_EM_L2_THRSH) = -1
      GT_E_AO_TERM(15, GT_EM_L2_THRSH) = -1
C
      GT_E_AO_TERM(0, GT_HD_L2_THRSH) =  168
      GT_E_AO_TERM(01, GT_HD_L2_THRSH) = 169
      GT_E_AO_TERM(02, GT_HD_L2_THRSH) = 170
      GT_E_AO_TERM(03, GT_HD_L2_THRSH) = 171
      GT_E_AO_TERM(04, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(05, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(06, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(07, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(08, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(09, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(10, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(11, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(12, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(13, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(14, GT_HD_L2_THRSH) = -1
      GT_E_AO_TERM(15, GT_HD_L2_THRSH) = -1
C
      GT_E_AO_TERM(0, GT_TOT_L2_THRSH) =  172
      GT_E_AO_TERM(01, GT_TOT_L2_THRSH) = 173
      GT_E_AO_TERM(02, GT_TOT_L2_THRSH) = 174
      GT_E_AO_TERM(03, GT_TOT_L2_THRSH) = 175
      GT_E_AO_TERM(04, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(05, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(06, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(07, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(08, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(09, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(10, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(11, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(12, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(13, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(14, GT_TOT_L2_THRSH) = -1
      GT_E_AO_TERM(15, GT_TOT_L2_THRSH) = -1
C
      GT_E_AO_TERM(0, GT_MIS_PT_THRSH) =  156
      GT_E_AO_TERM(01, GT_MIS_PT_THRSH) = 157
      GT_E_AO_TERM(02, GT_MIS_PT_THRSH) = 158
      GT_E_AO_TERM(03, GT_MIS_PT_THRSH) = 159
      GT_E_AO_TERM(04, GT_MIS_PT_THRSH) = 160
      GT_E_AO_TERM(05, GT_MIS_PT_THRSH) = 161
      GT_E_AO_TERM(06, GT_MIS_PT_THRSH) = 162
      GT_E_AO_TERM(07, GT_MIS_PT_THRSH) = 163
      GT_E_AO_TERM(08, GT_MIS_PT_THRSH) = -1
      GT_E_AO_TERM(09, GT_MIS_PT_THRSH) = -1
      GT_E_AO_TERM(10, GT_MIS_PT_THRSH) = -1
      GT_E_AO_TERM(11, GT_MIS_PT_THRSH) = -1
      GT_E_AO_TERM(12, GT_MIS_PT_THRSH) = -1
      GT_E_AO_TERM(13, GT_MIS_PT_THRSH) = -1
      GT_E_AO_TERM(14, GT_MIS_PT_THRSH) = -1
      GT_E_AO_TERM(15, GT_MIS_PT_THRSH) = -1
C
      GT_CNT_AO_TERM(00, 0, GT_EM_CNT_THRSH) = 176
      GT_CNT_AO_TERM(01, 0, GT_EM_CNT_THRSH) = 177
      GT_CNT_AO_TERM(02, 0, GT_EM_CNT_THRSH) = 178
      GT_CNT_AO_TERM(03, 0, GT_EM_CNT_THRSH) = 179
      GT_CNT_AO_TERM(04, 0, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(05, 0, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(06, 0, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(07, 0, GT_EM_CNT_THRSH) = -1
C
      GT_CNT_AO_TERM(00, 1, GT_EM_CNT_THRSH) = 180     
      GT_CNT_AO_TERM(01, 1, GT_EM_CNT_THRSH) = 181
      GT_CNT_AO_TERM(02, 1, GT_EM_CNT_THRSH) = 182
      GT_CNT_AO_TERM(03, 1, GT_EM_CNT_THRSH) = 183
      GT_CNT_AO_TERM(04, 1, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(05, 1, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(06, 1, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(07, 1, GT_EM_CNT_THRSH) = -1
C
      GT_CNT_AO_TERM(00, 2, GT_EM_CNT_THRSH) = 184
      GT_CNT_AO_TERM(01, 2, GT_EM_CNT_THRSH) = 185
      GT_CNT_AO_TERM(02, 2, GT_EM_CNT_THRSH) = 186
      GT_CNT_AO_TERM(03, 2, GT_EM_CNT_THRSH) = 187
      GT_CNT_AO_TERM(04, 2, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(05, 2, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(06, 2, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(07, 2, GT_EM_CNT_THRSH) = -1
C
      GT_CNT_AO_TERM(00, 3, GT_EM_CNT_THRSH) = 188
      GT_CNT_AO_TERM(01, 3, GT_EM_CNT_THRSH) = 189
      GT_CNT_AO_TERM(02, 3, GT_EM_CNT_THRSH) = 190
      GT_CNT_AO_TERM(03, 3, GT_EM_CNT_THRSH) = 191
      GT_CNT_AO_TERM(04, 3, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(05, 3, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(06, 3, GT_EM_CNT_THRSH) = -1
      GT_CNT_AO_TERM(07, 3, GT_EM_CNT_THRSH) = -1
C
      GT_CNT_AO_TERM(00, 0, GT_TOT_CNT_THRSH) = 192
      GT_CNT_AO_TERM(01, 0, GT_TOT_CNT_THRSH) = 193
      GT_CNT_AO_TERM(02, 0, GT_TOT_CNT_THRSH) = 194
      GT_CNT_AO_TERM(03, 0, GT_TOT_CNT_THRSH) = 195
      GT_CNT_AO_TERM(04, 0, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(05, 0, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(06, 0, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(07, 0, GT_TOT_CNT_THRSH) = -1
C
      GT_CNT_AO_TERM(00, 1, GT_TOT_CNT_THRSH) = 196
      GT_CNT_AO_TERM(01, 1, GT_TOT_CNT_THRSH) = 197
      GT_CNT_AO_TERM(02, 1, GT_TOT_CNT_THRSH) = 198
      GT_CNT_AO_TERM(03, 1, GT_TOT_CNT_THRSH) = 199
      GT_CNT_AO_TERM(04, 1, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(05, 1, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(06, 1, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(07, 1, GT_TOT_CNT_THRSH) = -1
C
      GT_CNT_AO_TERM(00, 2, GT_TOT_CNT_THRSH) = 200
      GT_CNT_AO_TERM(01, 2, GT_TOT_CNT_THRSH) = 201
      GT_CNT_AO_TERM(02, 2, GT_TOT_CNT_THRSH) = 202
      GT_CNT_AO_TERM(03, 2, GT_TOT_CNT_THRSH) = 203
      GT_CNT_AO_TERM(04, 2, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(05, 2, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(06, 2, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(07, 2, GT_TOT_CNT_THRSH) = -1
C
      GT_CNT_AO_TERM(00, 3, GT_TOT_CNT_THRSH) = 204
      GT_CNT_AO_TERM(01, 3, GT_TOT_CNT_THRSH) = 205
      GT_CNT_AO_TERM(02, 3, GT_TOT_CNT_THRSH) = 206
      GT_CNT_AO_TERM(03, 3, GT_TOT_CNT_THRSH) = 207
      GT_CNT_AO_TERM(04, 3, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(05, 3, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(06, 3, GT_TOT_CNT_THRSH) = -1
      GT_CNT_AO_TERM(07, 3, GT_TOT_CNT_THRSH) = -1
C
C----------------------------------------------------------------------
  999 RETURN
      END
