!+ Subroutine to make spectral blocks of type 1.
!
! 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_1(IERR
     &   , N_BAND, WAVE_LENGTH_SHORT, WAVE_LENGTH_LONG
     &   )
!
!
!
      IMPLICIT NONE
!
!
!     INCLUDE HEADER FILES.
      INCLUDE 'incl/def_std_io.icf'
      INCLUDE 'incl/def_pp_io.icf'
      INCLUDE 'incl/error.pcf'
      INCLUDE 'incl/dimensions_spec.ucf'
!
!
!     DUMMY ARGUMENTS.
      INTEGER	!, INTENT(OUT)
     &     IERR
!             ERROR FLAG
      INTEGER	!, INTENT(IN)
     &     N_BAND
!             NUMBER OF BANDS
      REAL*8	!, INTENT(OUT)
     &     WAVE_LENGTH_SHORT(NPD_BAND)
!             SHORTER LIMITS OF BANDS
     &   , WAVE_LENGTH_LONG(NPD_BAND)
!             LONGER LIMITS OF BANDS
!
!
!     LOCAL VARIABLES.
!
      LOGICAL
     &     LOCK_CODE
!             LOGICAL TO FORBID INTERACTIVE LOOPING
      EXTERNAL
     &     LOCK_CODE
!
      CHARACTER
     &     CHAR_UNIT*1
!             UNIT TYPE
      INTEGER
     &     IOS
!             READING ERROR FLAG
     &   , I
!             LOOP VARIABLE
      LOGICAL
     &     L_METRE
!             LOGICAL FOR UNITS OF METRES
     &   , L_INVERSE_CM
!             LOGICAL FOR UNITS OF INVERSE CM
     &   , L_MICRON
!             LOGICAL FOR UNITS OF MICRONS
      REAL*8
     &     WAVE_LENGTH_TEMP
!             TEMPORARY FOR INTERCHANGE
!
!
      DATA L_METRE/.FALSE./
     &   , L_INVERSE_CM/.FALSE./
     &   , L_MICRON/.FALSE./
!
!
!
!     OBTAIN THE LIMITS FOR EACH BAND.
      WRITE(IU_USER, '(/A)')
     &   'FOR EACH BAND IN TURN SPECIFY THE LIMITS OF THE BANDS IN '
      WRITE(IU_USER, '(A/)')
     &   'METRES, INVERSE CENTIMETRES OR MICRONS.'
      WRITE(IU_USER, '(A)') 'TYPE "M" FOR METRES, "C" FOR INVERSE '
     &   //'CENTIMTRES, OR "U" FOR MICRONS.'
1     READ(IU_STDIN, '(A)') CHAR_UNIT
      IF ( (CHAR_UNIT.EQ.'M').OR.(CHAR_UNIT.EQ.'m') ) THEN
         L_METRE=.TRUE.
      ELSE IF ( (CHAR_UNIT.EQ.'C').OR.(CHAR_UNIT.EQ.'c') ) THEN
         L_INVERSE_CM=.TRUE.
      ELSE IF ( (CHAR_UNIT.EQ.'U').OR.(CHAR_UNIT.EQ.'u') ) THEN
         L_MICRON=.TRUE.
      ELSE
         WRITE(IU_ERR, '(A)') 'UNKNOWN REPONSE:'
         IF (LOCK_CODE(.TRUE.)) THEN
            INCLUDE 'batch_error.finc'
         ELSE
            WRITE(IU_USER, '(A)') 'PLEASE RE-ENTER.'
            GOTO 1
         ENDIF
      ENDIF
!
      DO I=1, N_BAND
         WRITE(IU_USER, '(A15, 1X, I5)') 'LIMITS FOR BAND',I
2        READ(IU_STDIN, *, IOSTAT=IOS)
     &      WAVE_LENGTH_SHORT(I), WAVE_LENGTH_LONG(I)
         IF (IOS.NE.0) THEN
            IF (LOCK_CODE(.TRUE.)) THEN
               INCLUDE 'batch_error.finc'
            ELSE
               WRITE(IU_USER, '(A)') '** PLEASE RE-ENTER.'
               GOTO 2
            ENDIF
         ENDIF
!
!        CONVERT TO METRES IF IN INVERSE CM OR MICRONS.
         IF (L_INVERSE_CM) THEN
            WAVE_LENGTH_SHORT(I)=1.0D-02/WAVE_LENGTH_SHORT(I)
            WAVE_LENGTH_LONG(I)=1.0D-02/WAVE_LENGTH_LONG(I)
         ELSE IF (L_MICRON) THEN
            WAVE_LENGTH_SHORT(I)=1.0D-06*WAVE_LENGTH_SHORT(I)
            WAVE_LENGTH_LONG(I)=1.0D-06*WAVE_LENGTH_LONG(I)
         ENDIF
!        INTERCHANGE THE LIMITS IF THEY ARE IN THE WRONG ORDER.
         IF (WAVE_LENGTH_SHORT(I).GT.WAVE_LENGTH_LONG(I)) THEN
            WAVE_LENGTH_TEMP=WAVE_LENGTH_SHORT(I)
            WAVE_LENGTH_SHORT(I)=WAVE_LENGTH_LONG(I)
            WAVE_LENGTH_LONG(I)=WAVE_LENGTH_TEMP
         ENDIF
      ENDDO
!
      WRITE(IU_STDOUT, '(A//)') 'ALL BANDS SPECIFIED.'
!
!
      RETURN
      END
