!+ Subroutine to find whether an entry has to be considered.
!
! Method:
!	The gas listed in the entry is checked to see whether it
!	agrees with that being considered, and the wavelengths
!	limiting the bands in which the absorber appears are checked 
!	to see that the entry covers the bands. A list of bands
!	across which the entry should be averaged is produced.
!
! 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 FIND_GAS_BAND(I_SPECIES
     &   , I_ENTRY, FREQ_LOW, FREQ_HIGH
     &   , FIRST_BAND, LAST_BAND
     &   , WAVE_LENGTH_SHORT, WAVE_LENGTH_LONG
     &   , N_BAND_ABSORB, INDEX_ABSORB
     &   , N_BAND_LIST, BAND_LIST
     &   )
!
!
      IMPLICIT NONE
!
!
!     INCLUDE HEADER FILES.
      INCLUDE 'incl/dimensions_spec.ucf'
      INCLUDE 'incl/def_std_io.icf'
!
!     DUMMY ARGUMENTS.
      INTEGER	!, INTENT(IN)
     &     I_SPECIES
!             SPECIES OF GAS CONSIDERED
     &   , I_ENTRY
!             NUMBER OF ENTRY IN ARCHIVE
     &   , FIRST_BAND
!             NUMBER OF SPECTRAL BANDS
     &   , LAST_BAND
!             NUMBER OF SPECTRAL BANDS
     &   , N_BAND_ABSORB(NPD_BAND)
!             NUMBER OF ABSORBERS IN BAND
     &   , INDEX_ABSORB(NPD_SPECIES, NPD_BAND)
!             INDICIES OF ABSORBING SPECIES
      INTEGER	!, INTENT(OUT)
     &     N_BAND_LIST
!             NUMBER OF BANDS IN THE LIST
     &   , BAND_LIST(NPD_BAND)
!             LIST OF BANDS
      REAL*8	!, INTENT(IN)
     &     FREQ_LOW
!             LOW FREQUENCY OF ENTRY
     &   , FREQ_HIGH
!             HIGH FREQUENCY OF ENTRY
     &   , WAVE_LENGTH_SHORT(NPD_BAND)
!             SHORT WAVELENGTHS OF BANDS
     &   , WAVE_LENGTH_LONG(NPD_BAND)
!             LONG WAVELENGTHS OF BANDS
!
!     LOCAL ARGUMENTS.
      INTEGER
     &     I
!             LOOP VARIABLE
     &   , J
!             LOOP VARIABLE
!
!
      N_BAND_LIST=0
      DO I=FIRST_BAND, LAST_BAND
         DO J=1, N_BAND_ABSORB(I)
            IF (INDEX_ABSORB(J, I).EQ.I_SPECIES) THEN
               IF ( (WAVE_LENGTH_SHORT(I)*FREQ_HIGH.GE.1).AND.
     &              (WAVE_LENGTH_LONG(I)*FREQ_LOW.LE.1) ) THEN
                  N_BAND_LIST=N_BAND_LIST+1
                  BAND_LIST(N_BAND_LIST)=I
               ELSE IF ( (WAVE_LENGTH_SHORT(I)*FREQ_HIGH.GE.1).NEQV.
     &              (WAVE_LENGTH_LONG(I)*FREQ_LOW.LE.1) ) THEN
                 WRITE(IU_ERR, '(/A)') '+++ WARNING:'
                 WRITE(IU_ERR, '(A, I5, A, I5)')
     &              'BAND ', I, 'IS ONLY PARTLY COVERED BY DATA IN '
     &              //'ENTRY ', I_ENTRY
                 WRITE(IU_ERR, '(A)')
     &              'AN AVERAGE TRANSMISSION WILL NOT BE GENERATED.'
               ENDIF
            ENDIF
         ENDDO
      ENDDO
!
!
      RETURN
      END
