!+ Subroutine to read an unformatted TAPE8 file.
!
! 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 READ_TAPE8_UNFORM(IERR
     &   , N_WAVENUMBER_TRANS, WAVENUMBER_TRANS, TRANSMITTANCE
     &   , N_ABSORB, I_LOWTRAN_COLUMN)
!
!
      IMPLICIT NONE
!
!
!     INCLUDE HEADER FILES.
      INCLUDE 'incl/dimensions_spec.ucf'
      INCLUDE 'incl/dimensions_pp.ucf'
      INCLUDE 'incl/def_std_io.icf'
      INCLUDE 'incl/def_lwtrn_io.icf'
      INCLUDE 'incl/gas_list.pcf'
      INCLUDE 'incl/lowtran_parameters.ecf'
      INCLUDE 'incl/error.pcf'
!
!     DUMMY ARGUMENTS
      INTEGER	!, INTENT(OUT)
     &     IERR
!             OUT  ERROR FLAG
     &   , N_WAVENUMBER_TRANS
!             OUT  NUMBER OF WAVENUMBERS
      INTEGER	!, INTENT(IN)
     &     N_ABSORB
!             NUMBER OF ABSORBERS
     &   , I_LOWTRAN_COLUMN(NPD_SPECIES)
!             LOWTRAN COLUMN NUMBER FOR GASES
      REAL*8
     &     TRANSMITTANCE(NPD_WAVENUMBER_TRANS, NPD_SPECIES)
!             OUT  LOWTRAN TRANSMITTANCES
     &   , WAVENUMBER_TRANS(NPD_WAVENUMBER_TRANS)
!
!     LOCAL VARIABLES.
      REAL*8
     &     QUOTIENT
!             TEMPORARY VARIABLE
     &   , TRANSMITTANCE_IN(NPD_GAS_LOW)
!             TEMPORARY INPUT ARRAY
      CHARACTER
     &     HMODEL(5, 8)*4
!             LOWTRAN CHARACTER NAME
      INTEGER
     &     I
!             LOOP VARIABLE
     &   , J
!             LOOP VARIABLE
      INTEGER
     &     MODEL
!             LOWTRAN VARIABLE
     &   , ITYPE
!              "
     &   , IEMSCT
!              "
     &   , IMULT
!              "
     &   , M1, M2, M3, M4, M5, M6
!              "
     &   , MDEF
!              "
     &   , IM
!              "
     &   , NOPRT
!              "
     &   , IHAZE
!              "
     &   , ISEASN
!              "
     &   , IVULCN
!              "
     &   , ICSTL
!              "
     &   , ICIR
!              "
     &   , IVSA
!              "
     &   , ISEED
!              "
     &   , ML
!              "
      INTEGER
     &     IPARM
!              "
     &   , IPH
!              "
     &   , IDAY
!              "
     &   , ISOURC
!              "
     &   , LEN
!              "
     &   , IPRT
!              "
      REAL*8
     &     TBOUND
!              "
     &   , SALB
!              "
     &   , VIS
!              "
     &   , WSS
!              "
     &   , WHH
!              "
     &   , RAINRT
!              "
     &   , GNDALT
!              "
     &   , CTHIK
!              "
     &   , CALT
!              "
     &   , CEXT
!              "
     &   , ZCVSA
!              "
     &   , ZTVSA
!              "
     &   , ZINVSA
!              "
      REAL*8
     &     H1
!              "
     &   , H2
!              "
     &   , ANGLE
!              "
     &   , RANGE_1
!              "
     &   , BETA
!              "
     &   , RO
!              "
     &   , P
!              "
     &   , T
!              "
     &   , DP
!              "
     &   , RH
!              "
     &   , WH
!              "
     &   , WO
!              "
      REAL*8
     &     PARM1
!              "
     &   , PARM2
!              "
     &   , PARM3
!              "
     &   , PARM4
!              "
     &   , TIME
!              "
     &   , PSIPO
!              "
     &   , ANGLEM
!              "
     &   , G
!              "
     &   , V1
!              "
     &   , V2
!              "
     &   , DV
!              "
      REAL*8
     &     FEND
!             LOWTRAN END FLAG
!
!
!
!     READ THE HEADER CARDS.
      READ(IU_LOWTRAN_TAPE8)
     &     MODEL, ITYPE, IEMSCT, IMULT, M1, M2, M3, M4, M5, M6
     &   , MDEF, IM, NOPRT, TBOUND, SALB
      READ(IU_LOWTRAN_TAPE8)
     &     IHAZE, ISEASN, IVULCN, ICSTL, ICIR, IVSA
     &   , VIS, WSS, WHH, RAINRT, GNDALT
      READ(IU_LOWTRAN_TAPE8) CTHIK, CALT, CEXT, ISEED
      READ(IU_LOWTRAN_TAPE8) ZCVSA, ZTVSA, ZINVSA
      READ(IU_LOWTRAN_TAPE8) ML, (HMODEL(I,7), I=1, 5)
      IF (MODEL.NE.0) THEN
         READ(IU_LOWTRAN_TAPE8)
     &      H1, H2, ANGLE, RANGE_1, BETA, RO, LEN
      ELSE
         READ(IU_LOWTRAN_TAPE8)
     &      H1, P, T, DP, RH, WH, WO, RANGE_1
      ENDIF
      READ(IU_LOWTRAN_TAPE8) IPARM, IPH, IDAY, ISOURC
      READ(IU_LOWTRAN_TAPE8) PARM1, PARM2, PARM3, PARM4
     &   , TIME, PSIPO, ANGLEM, G
      READ(IU_LOWTRAN_TAPE8) V1, V2, DV
      READ(IU_LOWTRAN_TAPE8) IPRT
!
!     FIND THE NUMBER OF INPUT LINES AND READ THE TRANSMISSIONS.
!     A LITTLE CARE IS REQUIRED HERE SINCE THE NUMBER OF DATA VALUES
!     PRODUCED BY LOWTRAN IS MACHINE-DEPENDENT.
      QUOTIENT=(V2-V1)/DV
      N_WAVENUMBER_TRANS=INT(QUOTIENT)
      IF ( (QUOTIENT-DBLE(N_WAVENUMBER_TRANS)).GT.1.0D-04) THEN
         N_WAVENUMBER_TRANS=N_WAVENUMBER_TRANS+1
      ENDIF
      N_WAVENUMBER_TRANS=N_WAVENUMBER_TRANS+1
      IF (N_WAVENUMBER_TRANS.GT.NPD_WAVENUMBER_TRANS) THEN
         WRITE(IU_ERR, '(/A)')
     &      '*** ERROR: TOO MANY DATA POINTS IN THIS BAND.'
         WRITE(IU_ERR, '(A)')
     &      'INCREASE NPD_WAVENUMBER_TRANS AND RECOMPILE.'
         IERR=I_ERR_FATAL
         RETURN
      ENDIF
!
      DO I=1, N_WAVENUMBER_TRANS
         READ(IU_LOWTRAN_TAPE8)
     &      WAVENUMBER_TRANS(I), (TRANSMITTANCE_IN(J), J=1, 11)
!        CONVERT TO S. I. UNITS.
         WAVENUMBER_TRANS(I)=1.0D+02*WAVENUMBER_TRANS(I)
!        TRANSFER TO SUITABLE POSITIONS IN THE TRANSMITTANCE ARRAY.
         DO J=1, N_ABSORB
            TRANSMITTANCE(I, J)
     &         =TRANSMITTANCE_IN(I_LOWTRAN_COLUMN(J))
         ENDDO
      ENDDO
!
!     READ THE TERMINATION FLAG.
      READ (IU_LOWTRAN_TAPE8) FEND
!
!
      RETURN
      END
