!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    SUBROUTINE RDTEMP
!     ******************************************************************
!$$$  SUBPROGRAM DOCUMENTATION BLOCK
!                .      .    .
! SUBPROGRAM:    RDTEMP      RADIATIVE TEMPERATURE CHANGE
!   PRGRMMR: BLACK           ORG: W/NP22     DATE: 93-12-29

! ABSTRACT:
!     RDTEMP APPLIES THE TEMPERATURE TENDENCIES DUE TO
!     RADIATION AT ALL LAYERS AT EACH ADJUSTMENT TIME STEP

! PROGRAM HISTORY LOG:
!   87-09-??  BLACK      - ORIGINATOR
!   95-03-25  BLACK      - CONVERSION FROM 1-D TO 2-D IN HORIZONTAL
!   95-11-20  ABELES     - PARALLEL OPTIMIZATION
!   98-10-30  BLACK      - MODIFIED FOR DISTRIBUTED MEMORY

! USAGE: CALL RDTEMP FROM MAIN PROGRAM EBU
!   INPUT ARGUMENT LIST:
!     NONE

!   OUTPUT ARGUMENT LIST:
!     NONE

!   OUTPUT FILES:
!     NONE

!   SUBPROGRAMS CALLED:

!     UNIQUE: NONE

!     LIBRARY: NONE

!   COMMON BLOCKS: CTLBLK
!                  MASKS
!                  VRBLS
!                  PVRBLS
!                  PHYS
!                  ACMRDS
!                  ACMRDL

! ATTRIBUTES:
!   LANGUAGE: FORTRAN 90
!   MACHINE : IBM SP
!$$$
!***********************************************************************
!-----------------------------------------------------------------------
    INCLUDE "parmeta.f90"
    INCLUDE "parm.tbl.f90"
    INCLUDE "mpp.h"
#include "sp.h"
!-----------------------------------------------------------------------
    PARAMETER &
    (LP1=LM+1)
!-----------------------------------------------------------------------
    LOGICAL :: &
    RUN,FIRST,RESTRT,SIGMA
!----------------------------------------------------------------------
    INCLUDE "COMM_CTLBLK.f90"
!-----------------------------------------------------------------------
    INCLUDE "COMM_MASKS.f90"
!-----------------------------------------------------------------------
    INCLUDE "COMM_VRBLS.f90"
!-----------------------------------------------------------------------
    INCLUDE "COMM_PVRBLS.f90"
!-----------------------------------------------------------------------
    INCLUDE "COMM_PHYS.f90"
!-----------------------------------------------------------------------
    INCLUDE "COMM_ACMRDS.f90"
!-----------------------------------------------------------------------
    INCLUDE "COMM_ACMRDL.f90"
!-----------------------------------------------------------------------
    DIMENSION &
    FACTR(IDIM1:IDIM2,JDIM1:JDIM2)
!-----------------------------------------------------------------------

!  GET CURRENT VALUE OF COS(ZENITH ANGLE)

    TIMES=(NTSD-1)*DT
    CALL ZENITH(TIMES,DAYI,HOUR)

! omp parallel do
    DO 50 J=MYJS,MYJE
        DO 50 I=MYIS,MYIE
            IF(CZMEAN(I,J) > 0.)THEN
                FACTR(I,J)=CZEN(I,J)/CZMEAN(I,J)
            ELSE
                FACTR(I,J)=0.
            ENDIF
    50 END DO

! omp parallel do private(ttndkl)
    DO 100 L=1,LM
        DO J=MYJS,MYJE
            DO I=MYIS,MYIE
                TTNDKL=RSWTT(I,J,L)*FACTR(I,J)+RLWTT(I,J,L)
                T(I,J,L)=T(I,J,L)+TTNDKL*DT*HTM(I,J,L)*HBM2(I,J)
                if(MYPE == 4 .AND. I == 16 .AND. J == 11 .AND. L >= 30)then
                !	write(6,633) L,T(I,J,L),TTNDKL*DT*HTM(I,J,L)*HBM2(I,J),
                !     +	RSWTT(I,J,L)*FACTR(I,J),RLWTT(I,J,L)
                endif
                633 format('L,TNEW,INCR,SW,LW: ',I2,1x,f8.3,1x,f8.5,1x,e12.6,1x,e12.6)
            ENDDO
        ENDDO
    100 END DO
!-----------------------------------------------------------------------
    RETURN
    END SUBROUTINE RDTEMP
