
      SUBROUTINE RAD2BT (INSTRU, CHAN, VALUE, RADVEC, LEN)
      IMPLICIT NONE
C
C***********************************************************************
C   NAME- RAD2BT
C
C   LANGUAGE- FORTRAN 77      TYPE- SUBROUTINE      COMPUTER- CRAY   
C
C   VERSION- 1.0    DATE- 02/06/91 PROGRAMMER- D.NELSON, SMSRC
C   VERSION- 3.0    DATE- 05/10/96 PROGRAMMER- A.POZDNYAK, FDC 
C     FOR REHOSTING TO THE CRAY, CHANGED ALL I*4 DECLARATIONS TO
C      INTEGER AND ALL R*4 DECLARATIONS TO REAL.
C
C   FUNCTION- THIS ROUTINE CONVERTS RADIANCE VALUES TO BRIGHTNESS
C             TEMPERATURE FOR 1 SCAN LINE FOR A GIVEN INSTRUMENT AND
C             CHANNEL USING COEFFICIENTS C1V3 AND C2V1 FROM LABELED
C             COMMON /PLCOEF/.
C
C   CALLING SEQUENCE PARAMETERS-
C
C   NAME    TYPE  I/O    DESCRIPTION
C   INSTRU  INT    I     1=HIRS  2=AMSU-A  3=AMSU-B  4=AVHRR
C   CHAN    INT    I     CHANNEL NUMBER
C   VALUE   REAL   O     OUTPUT VECTOR OF BRIGHTNESS VALUES,
C                        DIMENSION LEN
C   RADVEC  REAL   I     INPUT VECTOR OF RADIANCE VALUES,
C                        DIMENSION LEN
C   LEN     INT    I     NUMBER OF ELEMENTS IN A SCAN
C
C   COMMON AREA PARAMETERS-
      INCLUDE 'PLCOEF'
      INCLUDE 'PLPHSCON'
C
C   LOCAL VARIABLES-
C   I       INT          DO LOOP INDEX
C   C1V3    REAL         C1PLNK * CENTER FREQ**3
C   C2V     REAL         C2PLNK * CENTER FREQ
C
C   SUBPROGRAMS CALLED- VCOPY, VRCPK, VMULTK, VADDK, VLN
C
C   EXIT STATES- NONE
C
C***********************************************************************
C
      INTEGER INSTRU, CHAN, LEN, I
      REAL    VALUE(LEN), RADVEC(LEN), C1V3, C2V
      INCLUDE 'SPVAL'
C
C    INITIALIZE VARIABLES
C
      DO 10 I =1, LEN
         VALUE(I) = R4SPV
   10 CONTINUE
C
C
C    MATCH INSTRU TO ITS SECTION OF FREQUENCY SCALED COEFFICIENTS
C
      IF (INSTRU .EQ. 1) THEN
C
C        SET COEFS FOR THIS INSTRU AND CHANNEL FROM COMMON DATA
C
         C1V3 = C1V3H(CHAN)
         C2V = C2V1H(CHAN)
         GO TO 20
C
C
      ELSE IF (INSTRU .EQ. 2) THEN
C
C        SET COEFS FOR THIS INSTRU AND CHANNEL FROM COMMON DATA
C
         C1V3 = C1V3A(CHAN)
         C2V  = C2V1A(CHAN)
         GO TO 20
C
C
      ELSE IF (INSTRU .EQ. 3) THEN
C
C        SET COEFS FOR THIS INSTRU AND CHANNEL FROM COMMON DATA
C
         C1V3 = C1V3B(CHAN)
         C2V = C2V1B(CHAN)
         GO TO 20
C
C
      ELSE IF (INSTRU .EQ. 4) THEN
C
C        SET COEFS FOR THIS INSTRU AND CHANNEL FROM COMMON DATA
C
         C1V3 = C1V3G(CHAN)
         C2V = C2V1G(CHAN)
         GO TO 20
C
      ENDIF
C
C
C
   20 CONTINUE
C
C    CONVERT EACH RADIANCE IN THE SCAN LINE TO BRIGHTNESS VALUE
C    BRITE = C2V / ALOG ((C1V3/RADIANCE) +1.0)
C    USING SEQUENCE OF VECTOR OPERATORS
C
        CALL VCOPY (RADVEC, VALUE, LEN )
        CALL VRCPK (VALUE, LEN, 1.0)
        CALL VMULTK(VALUE, LEN, C1V3)
        CALL VADDK (VALUE, LEN, 1.0)
        CALL VLN   (VALUE, LEN )
        CALL VRCPK (VALUE, LEN, 1.0)
        CALL VMULTK(VALUE, LEN, C2V)
C
       RETURN
C
C
      END
