!+ Subroutine to make spectral blocks of type 14.
!
! 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 MAKE_BLOCK_14(IERR
     &   , L_EXCLUDE, N_BAND
     &   , N_BAND_EXCLUDE, INDEX_EXCLUDE
     &   )
!
!
!
      IMPLICIT NONE
!
!
!     INCLUDE HEADER FILES.
      INCLUDE 'incl/def_std_io.icf'
      INCLUDE 'incl/def_pp_io.icf'
      INCLUDE 'incl/dimensions_spec.ucf'
      INCLUDE 'incl/error.pcf'
!
!
!     DUMMY ARGUMENTS
      INTEGER	!, INTENT(OUT)
     &     IERR
!             ERROR FLAG
      LOGICAL	!, INTENT(OUT)
     &     L_EXCLUDE
!             FLAG FOR EXCLUSION OF BANDS
      INTEGER	!, INTENT(IN)
     &     N_BAND
!             NUMBER OF BANDS
      INTEGER	!, INTENT(OUT)
     &     N_BAND_EXCLUDE(NPD_BAND)
!             NUMBER OF ABSORBERS IN EACH BAND
     &   , INDEX_EXCLUDE(NPD_EXCLUDE, NPD_BAND)
!             ARRAY OF INDICES FOR ABSORBERS
!
!
!     LOCAL VARIABLES
      CHARACTER
     &     PROMPT*25
!             PROMPT FOR INPUT
     &   , CHAR_YN*1
!             CHARACTER RESPONSE VARIABLE
      INTEGER
     &     I
!             LOOP VARIABLE
     &   , J
!             LOOP VARIABLE
     &   , I_LIST(NPD_BAND)
!             INDICES FOR ONE BAND
!
      LOGICAL
     &     LOCK_CODE
!             LOGICAL TO FORBID INTERACTIVE LOOPING
      EXTERNAL
     &     LOCK_CODE
!
!
      DATA PROMPT/'BANDS EXCLUDED FROM BAND '/
!
!
!
!     DETERMINE WHETHER EXCLUSION WILL OCCUR.
      L_EXCLUDE=.FALSE.
      WRITE(IU_USER, '(//A)')
     &   'DO YOU WISH TO EXCLUDE REGIONS FROM PARTICULAR BANDS? (Y/N)'
      READ(IU_STDIN, '(A)') CHAR_YN
      IF ( (CHAR_YN.NE.'Y').AND.(CHAR_YN.NE.'y') ) RETURN
!
      L_EXCLUDE=.TRUE.
      WRITE(IU_USER, '(A)')
     &   'FOR EACH BAND ENTER THE LIST OF BANDS TO BE EXCLUDED '
     &   //'THEREFROM.'
      WRITE(IU_USER, '(A)')
     &   'TO CONTINUE INPUT ON THE NEXT LINE TERMINATE THE LINE'
      WRITE(IU_USER, '(A)')
     &   'WITH AN &.'
      WRITE(IU_USER, '(/A/)')
     &   'ENTER ''0'' IF NO BANDS ARE TO BE EXCLUDED.'
      DO I=1, N_BAND
1        CALL READ_LINE(IERR, I, PROMPT, NPD_EXCLUDE
     &      , N_BAND, N_BAND_EXCLUDE(I), I_LIST)
         IF (IERR.NE.I_NORMAL) RETURN
         IF ( (N_BAND_EXCLUDE(I).GT.NPD_EXCLUDE) ) THEN
            WRITE(IU_ERR, '(/A)')
     &         '*** ERROR:  THE LIST OF EXCLUDED BANDS IS TOO LARGE.'
            WRITE(IU_ERR, '(/A)')
     &         'INCREASE NPD_EXCLUDE AND RECOMPILE.'
            IERR=I_ERR_FATAL
            RETURN
         ENDIF
         DO J=1, N_BAND_EXCLUDE(I)
            INDEX_EXCLUDE(J, I)=I_LIST(J)
            IF ( (I_LIST(J).LT.1).OR.(I_LIST(J).GT.N_BAND) ) THEN
               WRITE(IU_ERR, '(/A)')
     &            '+++ ERRONEOUS INPUT:  AN EXCLUDED BAND IS OUT '
     &            //'OF RANGE.'
               IF (LOCK_CODE(.TRUE.)) THEN
                  INCLUDE 'batch_error.finc'
               ELSE
                  WRITE(IU_ERR, '(A/)') 'PLEASE RE-SPECIFY.'
                  GOTO 1
               ENDIF
            ENDIF
         ENDDO
      ENDDO
!
!
!
      RETURN
      END
