      SUBROUTINE RDBG1BS(RETCOD)
      IMPLICIT NONE
C***********************************************************************
C    NAME- RDBG1BS
C
C    LANGUAGE- FORTRAN 77     TYPE- SUBROUTINE   COMPUTER- CRAY    
C
C    VERSION- 1.0     DATE- 3/29/99  PROGRAMMER- LEAH WILSON, RAYTHEON
C
C    FUNCTION-  THIS SUBROUTINE READS THE 1B* DEBUG PRINT CONTROL 
C               FILE AND STORES PERTINENT INFORMATION INTO /DEBUG/.
C
C    FILES-
C    FILENAME                UNIT   I/O  DESCRIPTION
C    --------                ----   ---  -----------
C    1bstar.debug.flags       72     I    1B* DEBUG PRINT CONTROL FLAGS:
C
C                  1b* DATA TYPE               ACTIVE?   
C               ------------------------------ -------  
C            1. HIRS RAW COUNTS                .FALSE.
C            2. AMSU-A RAW COUNTS              .FALSE.
C            3. HIRS CALIBRATION COEFFICIENTS  .TRUE.
C            4. AMSU-A CALIBRATION COEFFS.     .TRUE. 
C            5. HIRS RADIANCES                 .FALSE.
C            6. AMSU-A RADIANCES               .FALSE.
C            7. HIRS B-TEMPS (UN-LIMB CORR)    .FALSE.
C            8. AMSU-A B-TEMPS (UN-LIMB CORR)  .FALSE.
C                                         NOTE: .TRUE. OR .FALSE. MUST 
C                                         BEGIN IN COLUMN 37 OF ACTUAL 
C                                         DATA MEMBER.
C
C   COMMON AREA PARAMETERS- DEBUG, SPGUNT
C
C   SUBROUTINES- KIDS
C
C   EXIT STATES-  RETCOD =  0  - NORMAL COMPLETION, NO ERRORS DETECTED.
C                         ELSE - ERROR RETURNED FROM READ OR OPEN. THIS
C                                IS NON-FATAL TO THE SPGDVR.
C
C   ASSUMPTIONS- THIS SUBROUTINE ASSUMES THE KIDS FILE HAS BEEN OPENED
C                PREVIOUSLY.
C
C***********************************************************************
C
      INCLUDE 'DEBUG'
      INCLUDE 'SPGUNT'
      INTEGER   RETCOD, CONTROL_UNIT, IDUM, III
      CHARACTER*1 ADUM
      CHARACTER*8 SUBNAM
      CHARACTER*100 KMSG
      SUBNAM = 'SPGDVR  '
C
C  OPEN CONTROL FILE FOR READING 
C
      CONTROL_UNIT = 72
      OPEN(UNIT=CONTROL_UNIT,ACCESS='SEQUENTIAL',ACTION='READ',
     1     FORM='FORMATTED',IOSTAT=RETCOD,ERR=9000)
C
C  SKIP OVER 2 DATA DESCRIPTION LINES
C
      READ(UNIT=CONTROL_UNIT,FMT=100,ERR=9100,IOSTAT=RETCOD)
      READ(UNIT=CONTROL_UNIT,FMT=100,ERR=9100,IOSTAT=RETCOD)
  100 FORMAT(1X)
C
C   READ 10 DATA TYPES AND ACTIVITY FLAGS
C
      KMSG= 'The following 1b* DATA TYPES will be printed to FT06:'
      CALL KIDS(KUNIT,SUBNAM,1,KMSG,0)
      DO III=1,8
         READ(UNIT=CONTROL_UNIT,FMT=200,ERR=9100,IOSTAT=RETCOD) 
     1       IDUM,ADUM,TYPE1BSTAR(III),ACTIVETYPE(III)
         IF(ACTIVETYPE(III)) THEN
            KMSG(5:100) = TYPE1BSTAR(III)
            CALL KIDS(KUNIT,SUBNAM,1,KMSG,0)
         ENDIF
      ENDDO
  200 FORMAT(1X,I2,A1,1X,A30,1X,L7)
C
C   CLOSE CONTROL FILE
C
      CLOSE(CONTROL_UNIT)
      RETURN

 9000 KMSG='* WARNING! * Error opening 1b* Debug Print Control File'
      CALL KIDS(KUNIT,SUBNAM,0,KMSG,0)
      KMSG=' 1b* debug print flag is automatically turned OFF.'
      CALL KIDS(KUNIT,SUBNAM,0,KMSG,0)
      RETURN

 9100 KMSG='* WARNING! * Error reading 1b* Debug Print Control File'
      CALL KIDS(KUNIT,SUBNAM,0,KMSG,0)
      KMSG=' 1b* debug print flag is automatically turned OFF.'
      CALL KIDS(KUNIT,SUBNAM,0,KMSG,0)
      RETURN
      END
