!+ Subroutine to calculate direct transmissions and reflections.
!
! Method:
!	 Straightforward.
!
! Current Owner of Code: J. M. Edwards
!
! History:
!	Version		Date			Comment
!	1.0		12-04-95		First Version under RCS
!						(J. M. Edwards)
!
! Description of Code:
!   FORTRAN 77  with extensions listed in documentation.
!
!- ---------------------------------------------------------------------
      SUBROUTINE DIR_TRANS_COEFF(N_PROFILE, I_LAYER_FIRST, I_LAYER_LAST
     &   , TAU, GAMMA_1, GAMMA_2, TRANS, REFLECT, SEC_0
     &   , TRANS_DIR, TRANS_DIR_DIFF, REFLECT_DIR_DIFF
     &   )
!
!
      IMPLICIT NONE
!
!
!     INCLUDE HEADER FILES.
      INCLUDE 'incl/dimensions_field.ucf'
!
!     DUMMY VARIABLES.
      INTEGER	!, INTENT(IN)
     &     N_PROFILE
!             NUMBER OF PROFILES
     &   , I_LAYER_FIRST
!             FIRST LAYER TO CONSIDER
     &   , I_LAYER_LAST
!             LAST LAYER TO CONSIDER
!
      REAL*8	!, INTENT(IN)
     &     TAU(NPD_PROFILE, NPD_LAYER)
!             OPTICAL DEPTH
     &   , GAMMA_1(NPD_PROFILE, NPD_LAYER)
!             FIRST SOLAR COEFFICIENT
     &   , GAMMA_2(NPD_PROFILE, NPD_LAYER)
!             SECOND SOLAR COEFFICIENT
     &   , SEC_0(NPD_PROFILE)
!             SECANT OF ZENITH ANGLE
!
      REAL*8	!, INTENT(IN)
     &     TRANS(NPD_PROFILE, NPD_LAYER)
!             DIFFUSE TRANSMISSION COEFFICIENT
     &   , REFLECT(NPD_PROFILE, NPD_LAYER)
!             DIFFUSE REFLECTION COEFFICIENT
!
      REAL*8	!, INTENT(OUT)
     &     TRANS_DIR(NPD_PROFILE, NPD_LAYER)
!             DIRECT TRANSMISSION COEFFICIENT
     &   , TRANS_DIR_DIFF(NPD_PROFILE, NPD_LAYER)
!             DIRECT-TO-DIFFUSE TRANSMISSION COEFFICIENT
     &   , REFLECT_DIR_DIFF(NPD_PROFILE, NPD_LAYER)
!             DIRECT-TO-DIFFUSE REFLECTION COEFFICIENT
!
!
!
!     LOCAL VARIABLES
      INTEGER
     &     I
!             LOOP VARIABLE
     &   , L
!             LOOP VARIABLE
!
!
!
!     THE PROPERTIES OF THE LAYERS ARE CALCULATED USING THE STANDARD
!     FORMULAE.
      DO I=I_LAYER_FIRST, I_LAYER_LAST
         DO L=1, N_PROFILE
            TRANS_DIR(L, I)=EXP(-TAU(L, I)*SEC_0(L))
            TRANS_DIR_DIFF(L, I)
     &         =GAMMA_2(L, I)*(TRANS_DIR(L, I)-TRANS(L, I))
     &         -GAMMA_1(L, I)*TRANS(L, I)*TRANS_DIR(L, I)
            REFLECT_DIR_DIFF(L, I)
     &         =GAMMA_1(L, I)*(1.0D+00-TRANS(L, I)*TRANS_DIR(L, I))
     &         -GAMMA_2(L, I)*REFLECT(L, I)
         ENDDO
      ENDDO
!
!
!
      RETURN
      END
