       FUNCTION IPLKRD(RAD,CHAN)
       IMPLICIT NONE
C***********************************************************************
C
C   NAME- IPLKRD
C
C   LANGUAGE- VS FORTRAN  TYPE- FUNCTION        COMPUTER-  HDS 9000
C
C   VERSION- 1.0    DATE- 06/01/92     PROGRAMMER- CARLA NEIGH (SMSRC)
C   VERSION- 2.0    DATE- 11/08/94     PROGRAMMER- ALEX POZDNYAK (SMSRC)
C       XATOV-67: THE VALUE OF CHAN CHANGES TO: 1-20 - SAME AS CURRENT,
C                 21-35 - AMSU-A CHANNELS 1-15, 36-40 - AMSU-B CHANNELS
C                 1-5, 41-42 - AVHRR GAC CHANNELS 1-2, 43 - AVHRR GAC
C                 CHANNELS 3A, 44 - AVHRR GAC CHANNELS 3B, 45-46 AVHRR
C                 GAC CHANNELS 4-5. VALUES EXTRACTED FROM /PLCOEF/
C                 CHANGED TO THE NEW NAMES FOR THE AMSU-A, AMSU-B,
C                 AND AVHRR GAC COEFFICIENT NAMES.
C  VERSION- 3.0    DATE- 05/21/96   PROGRAMMER- ALEX POZDNYAK, FDC
C   VERSION- 3.1    DATE- 02/27/03   PROGRAMMER- Rickey Rollins (CSC)
C        Replace R4SPV equivalence test with ISR4SPV function 
C     FOR REHOSTING TO THE CRAY, CHANGED ALL I*4 DECLARATIONS TO
C     INTEGER, ALL R*4 TO REAL.
C
C   FUNCTION- THIS REAL FUNCTION CONVERTS A RADIANCE VALUE IN
C             (MW/(M*M*SR/CM)) TO BRIGHTNESS TEMPERATURE IN K USING
C             THE INVERSE OF THE PLANCK FUNCTION.
C
C   CALLING SEQUENCE PARAMETERS-
C   NAME    TYPE   I/O   DESCRIPTION
C   -----   ----   ---   -----------
C   RAD     REAL   I     RADIANCE (MW/(M*M*SR/CM)).
C   CHAN    INT    I     CHANNEL NUMBER (OF SOUNDINGS INSTRUMENT
C                        CHANNELS) CORRESPONDING TO RADIANCE VALUE.
C                        CHANNELS 1-20  = HIRS CHANNELS 1-20
C                        CHANNELS 21-35 = AMSU-A CHANNELS 1-15
C                        CHANNELS 36-40 = AMSU-B CHANNELS 1-5
C                        CHANNELS 41-42 = AVHRR GAC CHANNELS 1-2
C                        CHANNEL  43    = AVHRR GAC CHANNEL  3A
C                        CHANNEL  44    = AVHRR GAC CHANNEL  3B
C                        CHANNELS 45-46 = AVHRR GAC CHANNELS 4-5
C
C   COMMON AREA PARAMETERS- SPVAL, PLCOEF, INPARM
C
C   LOCAL VARIABLES-
C   NAME    TYPE    DESCRIPTION
C   ----    ----    -----------
C   COEFF1  REAL    PLANCK EQUATION COEFFICIENT 1.
C   COEFF2  REAL    PLANCK EQUATION COEFFICIENT 2.
C   SUM1     INT    TOTAL NUMBER OF HIRS AND AMSU-A CHANNELS.
C   SUM2     INT    TOTAL NUMBER OF HIRS, AMSU-A, AND AMSU-B CHANNELS.
C
C   FUNCTIONS USED- ALOG
C
C   EXIT STATES- NONE
C
C   COMMENTS- THIS FUNCTION ASSUMES THAT VALUES HAVE BEEN PLACED IN THE
C             COMMON BLOCK /PLCOEF/ AND THAT THE RADIANCE VALUE PASSED
C             IN IS REASONABLE.
C
C***********************************************************************
C
      INTEGER  CHAN
      REAL     RAD, IPLKRD
C
      INTEGER  SUM1,SUM2
      REAL     COEFF1, COEFF2
      LOGICAL   ISR4SPV
C
      INCLUDE 'PLCOEF'
      INCLUDE 'INPARM'
      INCLUDE 'SPVAL'
C
C  SET THE VALUES OF SUM1 AND SUM2.
C
      SUM1 = HNCHAN + ANCHAN
      SUM2 = HNCHAN + ANCHAN + BNCHAN
C
C  GET THE APPROPRIATE VALUES OF THE PLANCK EQUATION COEFFICIENTS
C  FOR THE CHANNEL FROM COMMON /PLCOEF/.
C
      IF (.NOT. ISR4SPV(RAD)) THEN
        IF (CHAN .LE. HNCHAN) THEN
           COEFF1 = C1V3H(CHAN)
           COEFF2 = C2V1H(CHAN)
        ELSE IF ((CHAN .GT. HNCHAN) .AND. (CHAN .LE. SUM1)) THEN
           COEFF1 = C1V3A(CHAN-HNCHAN)
           COEFF2 = C2V1A(CHAN-HNCHAN)
        ELSE IF ((CHAN .GT. SUM1) .AND. (CHAN .LE. SUM2)) THEN
           COEFF1 = C1V3B(CHAN-SUM1)
           COEFF2 = C2V1B(CHAN-SUM1)
        ELSE
           COEFF1 = C1V3G(CHAN-SUM2)
           COEFF2 = C2V1G(CHAN-SUM2)
        ENDIF
C
C  COMPUTE THE BRIGHTNESS TEMPERATURE.
C
        IPLKRD = COEFF2 / ALOG((COEFF1/RAD) + 1.0)
C
      ELSE
        IPLKRD = R4SPV
      ENDIF
C
      RETURN
      END
