      SUBROUTINE GTCDBV(CDBUNT,AT8ONOFF,CDBST)
      IMPLICIT NONE
C
C***********************************************************************
C
C   NAME- GTCDBV
C
C   LANGUAGE- FORTRAN 77      TYPE- SUBROUTINE      COMPUTER- CRAY   
C
C   VERSION- 1.0   DATE- 03/19/91  PROGRAMMER- CARLA NEIGH(SMSRC)
C   VERSION- 2.0   DATE- 10/11/94  PROGRAMMER- SURYA JANDHYALA(SMSRC)
C     ATOVS-25 ADDED AN EXTRA PARAMATER IN THE CALL TO GTCDB$.
C   VERSION- 3.0   DATE- 04/16/96  PROGRAMMER- ALEX POZDNYAK (FDC)   
C      MODIFIED TO RUN ON THE CRAY.  REPLACED I*4 WITH INT.
C   VERSION- 3.1   DATE- 07/25/97  PROGRAMMER- LEAH WILSON (HSTX)   
C   VERSION- 3.2   DATE- 03/02/98  PROGRAMMER- LEAH WILSON (RSTX)   
C   VERSION- 3.3   DATE- 09/15/98  PROGRAMMER- BRIAN BARIL (RSTX)
C   VERSION- 3.4   DATE- 05/04/99  PROGRAMMER- BRIAN BARIL (R-ITSS)
C  
C   FUNCTION- THIS SUBROUTINE GETS THE CDB VALUES USED FOR 1B DATA
C             INPUT FOR SPGS AND STORES THEM IN COMMON BLOCKS.
C   VERSION- 3.1 REMOVE FILEWS TO ALL SUBROUTINE CALLS DUE TO NEW
C                8-BYTE CDB UTILITIES.  REMOVE GTCDB$ SINCE CDB
C                UTILITIES HANDLE ERROR HANDLING.
C   VERSION- 3.2 ADD /ATTENU8/ AND REALCOEF CALL TO FILL H8WVC.
C                ADD /OZONE/ AND INTCOEF CALL TO FILL O3ONOFF.
C   VERSION- 3.3 ADDED AN ON/OFF FLAG TO THE CALL TO THE HIRS8
C                ATTENUATION COEFFICIENTS.
C   VERSION- 3.4 REMOVED CDB CALL TO GET OZONE ON/OFF FLAG.
C
C   FILES-
C     DSN OR DESCRIPTIVE TITLE  I/O  UNIT  FUNCTIONAL DECRIPTION
C     ------------------------  ---  ----  ---------------------
C     NSS. ... . ... .CDB        I  CDBUNT COEFFICIENT DATA BASE
C
C   CALLING SEQUENCE PARAMETERS-
C
C   NAME    TYPE  I/O    DESCRIPTION
C   ----    ----  ---    -----------
C   CDBUNT   INT   I     CDB UNIT NUMBER
C   AT8ONOFF REAL  I     ON/OFF FLAG TO GET HIRS ATTN8 COEFFS.
C   CDBST    INT   O     STATUS CODE RETURNED FROM ROUTINE
C                        INDICATING ERRORS IN OBTAINING AND
C                        CHECKING CDB VALUES
C                        = 0 IF NO ERROR ENCOUNTERED, <> 0 IF
C                        ERROR ENCOUNTERED
C
C   SUBPROGRAMS CALLED-  PLCDBV, COCDBV, INCDBV
C
C   EXIT STATES-
C      CDBST = 99 : ERROR ENCOUNTERED IN PROCESSING OR CHECKING
C                   CDB VALUES
C
C   COMMENTS- THIS SUBROUTINE ASSUMES THAT THE OPERATIONS TO OPEN/CLOSE
C             A CDB ARE DONE ELSEWHERE IN PROCESSING
C
C***********************************************************************
C
C
      INCLUDE 'ATTENU8'
      INCLUDE 'OZONE'
C
      INTEGER   CDBUNT, CDBST, ERSTAT
C     REAL AT8ONOFF
      INTEGER AT8ONOFF
C
C   INITIALIZE CDB STATUS
C
      CDBST = 0
C
C   CALL PLCDBV TO GET CDB VALUES FOR COMMON PLCOEF
C
      CALL PLCDBV(CDBUNT,CDBST)
      IF (CDBST.NE.0) RETURN
C
C   CALL COCDBV TO GET CDB VALUES FOR COMMON COLLOC
C
      CALL COCDBV(CDBUNT,CDBST)
      IF (CDBST.NE.0) RETURN   
C
C   CALL INCDBV TO GET CDB VALUES FOR COMMON INPCDB
C
      CALL INCDBV(CDBUNT,CDBST)
      IF (CDBST.GT.0) RETURN  
C
C   GET CDB VALUES FOR ATTENUATION CORRECTION OF HIRS CH.8
C
      IF(AT8ONOFF.EQ.1) THEN
      CDBST = 0
      CALL REALCOEF(CDBUNT,'ADJUST  ','ATTENU8 ','HIRS8   ',5,0,0,0,
     1              H8WVC,'GET',CDBST)
      ENDIF
C     
      RETURN
      END
