      SUBROUTINE GLCDVR2
      IMPLICIT NONE
C***********************************************************************
C
C   NAME- GLCDVR
C
C   LANGUAGE-VS FORTRAN        TYPE-SUBROUTINE
C
C   VERSION-1.0      DATE- 10/25/91     PROGRAMMER-TERESA SIMMS (SMSRC)
C   VERSION- 2.0     DATE- 05/06/94   PROGRAMMER- FRANK TILLEY (SMSRC)
C                    XATOV-3 REPLACE COMMON BLOCK /BUFFER/ WITH
C                    PARAMETER FILE INSPARM AND COMMON BLOCK /INSCOM/.
C   VERSION- 2.1     DATE- 10/17/94   PROGRAMMER- TERESA SIMMS (SMSRC)
C                    XATOV-61 CALLS TO LCHIRS, LCMSU & LCSSU REPLACED
C                    WITH CALL TO LIMCOR.  COMMON /LCCOEF/ AND INCLUDE
C                    /INPARM/ ARE ADDED. CALLING ARGUMENTS REMOVED.
C   VERSION- 3.0     DATE- 06/13/96  PROGRAMMER- LEAH CASEY (HSTX)
C                    MODIFICATIONS FOR ATOVS BASELINE ON CRAY.
C   VERSION- 3.1     DATE- 10/06/98  PROGRAMMER- A. ALLEGRINO (RITSS)
C                    ADDED THE ANCILLARY DATA SETS AND SIZE TO THE CALL
C                    OF LIMCOR SO THAT TERRAIN TYPE CAN BE USED IN LIMCOR
C                    TO LIMB CORRECTION THE COEFFICIENTS.
C                    ALSO ELIMINATED THE PASSING OF THE LIMB CORRECTION
C                    COEFFICIENTS VIA THE CALLING PARAMETERS. THEY WILL
C                    BE PASSED IN COMMON.
C   VERSION- 3.2     DATE- 03/14/02  PROGRAMMER- FRANK TILLEY (RAYTHEON)
C                    UNDER WR #22 CHANGED THE CALL FROM LIMCOR2 TO LIMCOR
C                    FOR AMSU-B, SINCE IT USES GLOBAL LIMB CORRECTION
C                    COEFFICIENTS.
C
C   FUNCTION- THIS ROUTINE IS THE DRIVER FOR ALL THE GLOBAL LIMB
C   CORRECTION ROUTINES.  IT REPLACES THE VALUES IN THE AMSU-A, AMSU-B,
C   AND HIRS BUFFERS WITH THEIR LIMB CORRECTED VALUES.
C
C   COMMON AREA PARAMETERS - INSCOM,ERPARM,ERINFO,INSPARM,INPARM,LCCOEF
C
C   SUBROUTINES CALLED - LIMCOR,LIMCOR2
C
C   FUNCTIONS USED - BTEST
C
C   EXIT STATES - NONE
C
C**********************************************************************
C
      INCLUDE 'INSPARM'
      INCLUDE 'INSCOM'
      INCLUDE 'ERPARM'
      INCLUDE 'ERINFO'
      INCLUDE 'INPARM'
      INCLUDE 'LCCOEF'
C
C  CHECK THAT THE HIRS DATA IS AVAILABLE FOR THIS FRAME.
      IF (.NOT. BTEST(FRMCNF,31)) GOTO 10
C
C  PERFORM LIMB CORRECTION ON THE HIRS DATA.
C     CALL LIMCOR(HIRDAT,HIRANC,HNSPOT,HTOTLN,HDATEL,HNANC,HNCHAN,
C    >ASOHIR,LCCHIR)
      CALL LIMCOR2(HIRDAT,HIRANC,HNSPOT,HTOTLN,HDATEL,HNANC,HNCHAN,
     >ASOHIR)
C
C  CHECK THAT THE AMSU-A DATA IS AVAILABLE FOR THIS FRAME.
   10 IF (.NOT. BTEST(FRMCNF,30)) GOTO 20
C
C  PERFORM LIMB CORRECTION ON THE AMSU-A DATA.
      CALL LIMCOR2(AMADAT,AMAANC,ANSPOT,ATOTLN,ADATEL,ANANC,ANCHAN,
     >ASOAMA)
C
C  CHECK THAT THE AMSU-B DATA IS AVAILABLE FOR THIS FRAME.
   20 IF (.NOT. BTEST(FRMCNF,29)) GOTO 30
C
C  PERFORM LIMB CORRECTION ON THE AMSU-B DATA. SINCE THE INSTRUMENT
C  USES A SET OF GLOBAL LIMB CORRECTION COEFFICIENTS. USE LIMCOR
C  INSTEAD OF LIMCOR2.
C
      CALL LIMCOR(AMBDAT,BNSPOT,BTOTLN,BDATEL,BNCHAN,ASOAMB,LCCAMB)
 
ccft  CALL LIMCOR2(AMBDAT,AMBANC,BNSPOT,BTOTLN,BDATEL,BNANC,BNCHAN,
ccft >ASOAMB)
C
   30 RETURN
      END
