      PROGRAM DRSEARCH
C
C     Driver for testing single precision SEARCH/WHEN/Ordered Search routines.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
C     FORTRAN logical unit numbers used:
C         Input:    3       One line containing CRAY information
C         Input:    7       Input data for SEARCH/WHEN/Ordered Search
C         Output:   8       Output data for SEARCH/WHEN/Ordered Search
C
      PARAMETER(NROUTS = 34)
      CHARACTER ROUTNME*31,SUBNAME*31,IDENT*5,DATEIN*8
      CHARACTER COMMENTS*23,HRDWRE*30,DUMMY*30,PERSON*5
      CHARACTER DATERUN*8
      INTEGER NTESTS,NFAILS,TEMP,TTESTS,TFAILS
      REAL PFAILS
      DIMENSION NTESTS(NROUTS),NFAILS(NROUTS),SUBNAME(NROUTS)
      DATA NTESTS,NFAILS /NROUTS*0,NROUTS*0/

C  An array is set up to hold the names of the 34 subprograms of SEARCH/WHEN.
      SUBNAME(1) = 'ISRCHIEQ'
      SUBNAME(2) = 'ISRCHFEQ'
      SUBNAME(3) = 'ISRCHINE'
      SUBNAME(4) = 'ISRCHFNE'
      SUBNAME(5) = 'ISRCHILT'
      SUBNAME(6) = 'ISRCHFLT'
      SUBNAME(7) = 'ISRCHILE'
      SUBNAME(8) = 'ISRCHFLE'
      SUBNAME(9) = 'ISRCHIGT'
      SUBNAME(10) = 'ISRCHFGT'
      SUBNAME(11) = 'ISRCHIGE'
      SUBNAME(12) = 'ISRCHFGE'
      SUBNAME(13) = 'WHENIEQ'
      SUBNAME(14) = 'WHENFEQ'
      SUBNAME(15) = 'WHENINE'
      SUBNAME(16) = 'WHENFNE'
      SUBNAME(17) = 'WHENILT'
      SUBNAME(18) = 'WHENFLT'
      SUBNAME(19) = 'WHENILE'
      SUBNAME(20) = 'WHENFLE'
      SUBNAME(21) = 'WHENIGT'
      SUBNAME(22) = 'WHENFGT'
      SUBNAME(23) = 'WHENIGE'
      SUBNAME(24) = 'WHENFGE'
      SUBNAME(25) = 'OSRCHI'
      SUBNAME(26) = 'OSRCHF'
      SUBNAME(27) = 'IILZ'
      SUBNAME(28) = 'IFLZ'
      SUBNAME(29) = 'ILLZ'
      SUBNAME(30) = 'ILIZ'
      SUBNAME(31) = 'ILFZ'
      SUBNAME(32) = 'ILSUM'
      SUBNAME(33) = 'IISUM'
      SUBNAME(34) = 'IFSUM'

C  Initialization of CRAY information.
      READ(3,505) HRDWRE
      CLOSE(3)

C  Initialization of input data heading.
      READ(7,500) ROUTNME,IDENT,DATEIN,PERSON,DATERUN,COMMENTS
   15 IF (ROUTNME .NE. ' ') GO TO 20
         READ(7,500) ROUTNME,IDENT,DATEIN,PERSON,DATERUN,COMMENTS
         GO TO 15

C  Loop to run through all sets of input data, which ends with XXX.
   20 IF (ROUTNME .EQ. 'XXX') GO TO 99
         READ(7,505) DUMMY
         CALL FDATE(DATERUN)
         WRITE(8,600)
         WRITE(8,600)
         WRITE(8,610) ROUTNME,IDENT,DATEIN,PERSON,DATERUN,COMMENTS
         WRITE(8,620) HRDWRE
  500    FORMAT(A31,A5,A8,A5,A8,A23)
  505    FORMAT(A30)
  600    FORMAT(1X)
  610    FORMAT(A31,A5,A8,A5,A8,A23)
  620    FORMAT(A30)

C  Determine which subprogram is currently being tested.
         IF (ROUTNME .EQ. 'ISRCHIEQ') THEN
            TEMP = NFAILS(1)
            CALL DRSCHIEQ(NTESTS(1),NFAILS(1))
            IF (NFAILS(1) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHFEQ') THEN
            TEMP = NFAILS(2)
            CALL DRSCHFEQ(NTESTS(2),NFAILS(2))
            IF (NFAILS(2) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHINE') THEN
            TEMP = NFAILS(3)
            CALL DRSCHINE(NTESTS(3),NFAILS(3))
            IF (NFAILS(3) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHFNE') THEN
            TEMP = NFAILS(4)
            CALL DRSCHFNE(NTESTS(4),NFAILS(4))
            IF (NFAILS(4) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHILT') THEN
            TEMP = NFAILS(5)
            CALL DRSCHILT(NTESTS(5),NFAILS(5))
            IF (NFAILS(5) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHFLT') THEN
            TEMP = NFAILS(6)
            CALL DRSCHFLT(NTESTS(6),NFAILS(6))
            IF (NFAILS(6) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHILE') THEN
            TEMP = NFAILS(7)
            CALL DRSCHILE(NTESTS(7),NFAILS(7))
            IF (NFAILS(7) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHFLE') THEN
            TEMP = NFAILS(8)
            CALL DRSCHFLE(NTESTS(8),NFAILS(8))
            IF (NFAILS(8) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHIGT') THEN
            TEMP = NFAILS(9)
            CALL DRSCHIGT(NTESTS(9),NFAILS(9))
            IF (NFAILS(9) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHFGT') THEN
            TEMP = NFAILS(10)
            CALL DRSCHFGT(NTESTS(10),NFAILS(10))
            IF (NFAILS(10) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHIGE') THEN
            TEMP = NFAILS(11)
            CALL DRSCHIGE(NTESTS(11),NFAILS(11))
            IF (NFAILS(11) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ISRCHFGE') THEN
            TEMP = NFAILS(12)
            CALL DRSCHFGE(NTESTS(12),NFAILS(12))
            IF (NFAILS(12) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENIEQ') THEN
            TEMP = NFAILS(13)
            CALL DRWHNIEQ(NTESTS(13),NFAILS(13))
            IF (NFAILS(13) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENFEQ') THEN
            TEMP = NFAILS(14)
            CALL DRWHNFEQ(NTESTS(14),NFAILS(14))
            IF (NFAILS(14) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENINE') THEN
            TEMP = NFAILS(15)
            CALL DRWHNINE(NTESTS(15),NFAILS(15))
            IF (NFAILS(15) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENFNE') THEN
            TEMP = NFAILS(16)
            CALL DRWHNFNE(NTESTS(16),NFAILS(16))
            IF (NFAILS(16) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENILT') THEN
            TEMP = NFAILS(17)
            CALL DRWHNILT(NTESTS(17),NFAILS(17))
            IF (NFAILS(17) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENFLT') THEN
            TEMP = NFAILS(18)
            CALL DRWHNFLT(NTESTS(18),NFAILS(18))
            IF (NFAILS(18) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENILE') THEN
            TEMP = NFAILS(19)
            CALL DRWHNILE(NTESTS(19),NFAILS(19))
            IF (NFAILS(19) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENFLE') THEN
            TEMP = NFAILS(20)
            CALL DRWHNFLE(NTESTS(20),NFAILS(20))
            IF (NFAILS(20) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENIGT') THEN
            TEMP = NFAILS(21)
            CALL DRWHNIGT(NTESTS(21),NFAILS(21))
            IF (NFAILS(21) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENFGT') THEN
            TEMP = NFAILS(22)
            CALL DRWHNFGT(NTESTS(22),NFAILS(22))
            IF (NFAILS(22) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENIGE') THEN
            TEMP = NFAILS(23)
            CALL DRWHNIGE(NTESTS(23),NFAILS(23))
            IF (NFAILS(23) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'WHENFGE') THEN
            TEMP = NFAILS(24)
            CALL DRWHNFGE(NTESTS(24),NFAILS(24))
            IF (NFAILS(24) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'OSRCHI') THEN
            TEMP = NFAILS(25)
            CALL DROSRCHI(NTESTS(25),NFAILS(25))
            IF (NFAILS(25) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'OSRCHF') THEN
            TEMP = NFAILS(26)
            CALL DROSRCHF(NTESTS(26),NFAILS(26))
            IF (NFAILS(26) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'IILZ') THEN
            TEMP = NFAILS(27)
            CALL DRIILZ(NTESTS(27),NFAILS(27))
            IF (NFAILS(27) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'IFLZ') THEN
            TEMP = NFAILS(28)
            CALL DRIFLZ(NTESTS(28),NFAILS(28))
            IF (NFAILS(28) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ILLZ') THEN
            TEMP = NFAILS(29)
            CALL DRILLZ(NTESTS(29),NFAILS(29))
            IF (NFAILS(29) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ILIZ') THEN
            TEMP = NFAILS(30)
            CALL DRILIZ(NTESTS(30),NFAILS(30))
            IF (NFAILS(30) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ILFZ') THEN
            TEMP = NFAILS(31)
            CALL DRILFZ(NTESTS(31),NFAILS(31))
            IF (NFAILS(31) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'ILSUM') THEN
            TEMP = NFAILS(32)
            CALL DRILSUM(NTESTS(32),NFAILS(32))
            IF (NFAILS(32) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'IISUM') THEN
            TEMP = NFAILS(33)
            CALL DRIISUM(NTESTS(33),NFAILS(33))
            IF (NFAILS(33) .GT. TEMP) WRITE(6,900) IDENT
         ELSE IF (ROUTNME .EQ. 'IFSUM') THEN
            TEMP = NFAILS(34)
            CALL DRIFSUM(NTESTS(34),NFAILS(34))
            IF (NFAILS(34) .GT. TEMP) WRITE(6,900) IDENT
         ELSE
            WRITE(6,*) 'ERROR IN ROUTINE NAME --- ',ROUTNME
            WRITE(6,*) '  IDENTIFICATION #',IDENT
            STOP
         ENDIF
  900    FORMAT(1X,'ERROR IN SCIPORT RESULT - DATA ID# ',A5)

C  Read next data input heading and loop back to top.
         READ(7,500) ROUTNME,IDENT,DATEIN,PERSON,DATERUN,COMMENTS
   30    IF (ROUTNME .NE. ' ') GO TO 20
            READ(7,500) ROUTNME,IDENT,DATEIN,PERSON,DATERUN,COMMENTS
            GO TO 30

C  Write the XXX at the bottom of the output data file.
   99 CONTINUE
      WRITE(8,600)
      WRITE(8,600)
      WRITE(8,605) ROUTNME
  605 FORMAT(A31)

C  Output of the results of all test data.
      DO 55 I = 1,NROUTS
         WRITE(6,700)
         WRITE(6,705) SUBNAME(I)
         IF (NTESTS(I) .EQ. 0) THEN
            WRITE(6,708)
            WRITE(6,707)
            WRITE(6,708)
         ELSE IF (NFAILS(I) .GT. 0) THEN
            PFAILS = REAL(NFAILS(I))/REAL(NTESTS(I)) * 100.0
            WRITE(6,708)
            WRITE(6,710) NTESTS(I)
            WRITE(6,715) NFAILS(I)
            WRITE(6,720) PFAILS
            WRITE(6,708)
         ELSE
            WRITE(6,710) NTESTS(I)
            WRITE(6,730)
         ENDIF
   55 CONTINUE

C  Compute and print totals.
      TTESTS = 0
      TFAILS = 0
      DO 65 I = 1,NROUTS
         TTESTS = TTESTS + NTESTS(I)
         TFAILS = TFAILS + NFAILS(I)
   65 CONTINUE
      WRITE(6,700)
      WRITE(6,700)
      WRITE(6,701)
      WRITE(6,700)
      WRITE(6,702)
      PFAILS = REAL(TFAILS)/REAL(TTESTS) * 100.0
      WRITE(6,710) TTESTS
      WRITE(6,715) TFAILS
      WRITE(6,720) PFAILS
      WRITE(6,700)

  700 FORMAT(1X)
  701 FORMAT(1X,50('-'))
  702 FORMAT(1X,'TOTALS')
  705 FORMAT(1X,A31)
  707 FORMAT(5X,'There were no tests performed on this unit.')
  708 FORMAT(45X,'******')
  710 FORMAT(5X,'Number of tests performed:    ',I4)
  715 FORMAT(5X,'Number of tests that failed:  ',I4)
  720 FORMAT(5X,'Percentage of failures:     ',F6.2)
  730 FORMAT(5X,'All tests on this unit were successful.')

      CLOSE(7)
      CLOSE(8)
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHIEQ
C                                                                  ************
      SUBROUTINE DRSCHIEQ(NTESTS,NFAILS)
C
C     Test driver for ISRCHIEQ.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      INTEGER ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHIEQ'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHIEQ(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHFEQ
C                                                                  ************
      SUBROUTINE DRSCHFEQ(NTESTS,NFAILS)
C
C     Test driver for ISRCHFEQ.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHFEQ'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHFEQ(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHINE
C                                                                  ************
      SUBROUTINE DRSCHINE(NTESTS,NFAILS)
C
C     Test driver for ISRCHINE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      INTEGER ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHINE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHINE(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHFNE
C                                                                  ************
      SUBROUTINE DRSCHFNE(NTESTS,NFAILS)
C
C     Test driver for ISRCHFNE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHFNE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHFNE(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHILT
C                                                                  ************
      SUBROUTINE DRSCHILT(NTESTS,NFAILS)
C
C     Test driver for ISRCHILT.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      INTEGER ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHILT'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHILT(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHFLT
C                                                                  ************
      SUBROUTINE DRSCHFLT(NTESTS,NFAILS)
C
C     Test driver for ISRCHFLT.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHFLT'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHFLT(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHILE
C                                                                  ************
      SUBROUTINE DRSCHILE(NTESTS,NFAILS)
C
C     Test driver for ISRCHILE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      INTEGER ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHILE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHILE(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHFLE
C                                                                  ************
      SUBROUTINE DRSCHFLE(NTESTS,NFAILS)
C
C     Test driver for ISRCHFLE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHFLE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHFLE(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHIGT
C                                                                  ************
      SUBROUTINE DRSCHIGT(NTESTS,NFAILS)
C
C     Test driver for ISRCHIGT.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      INTEGER ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHIGT'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHIGT(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHFGT
C                                                                  ************
      SUBROUTINE DRSCHFGT(NTESTS,NFAILS)
C
C     Test driver for ISRCHFGT.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHFGT'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHFGT(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHIGE
C                                                                  ************
      SUBROUTINE DRSCHIGE(NTESTS,NFAILS)
C
C     Test driver for ISRCHIGE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      INTEGER ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHIGE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHIGE(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRSCHFGE
C                                                                  ************
      SUBROUTINE DRSCHFGE(NTESTS,NFAILS)
C
C     Test driver for ISRCHFGE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,MESS*8
      INTEGER N,INC,NUM,I,CRLOC,LOC,ABSINC,NTESTS,NFAILS
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRSCHFGE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRLOC
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      LOC = ISRCHFGE(N,ARRAY,INC,TARGET)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,LOC
      IF (LOC .NE. CRLOC) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNIEQ
C                                                                  ************
      SUBROUTINE DRWHNIEQ(NTESTS,NFAILS)
C
C     Test driver for WHENIEQ.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER ARRAY,TARGET,NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNIEQ'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENIEQ(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNFEQ
C                                                                  ************
      SUBROUTINE DRWHNFEQ(NTESTS,NFAILS)
C
C     Test driver for WHENFEQ.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNFEQ'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENFEQ(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNINE
C                                                                  ************
      SUBROUTINE DRWHNINE(NTESTS,NFAILS)
C
C     Test driver for WHENINE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER ARRAY,TARGET,NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNINE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENINE(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNFNE
C                                                                  ************
      SUBROUTINE DRWHNFNE(NTESTS,NFAILS)
C
C     Test driver for WHENFNE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNFNE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENFNE(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNILT
C                                                                  ************
      SUBROUTINE DRWHNILT(NTESTS,NFAILS)
C
C     Test driver for WHENILT.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER ARRAY,TARGET,NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNILT'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENILT(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNFLT
C                                                                  ************
      SUBROUTINE DRWHNFLT(NTESTS,NFAILS)
C
C     Test driver for WHENFLT.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNFLT'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENFLT(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNILE
C                                                                  ************
      SUBROUTINE DRWHNILE(NTESTS,NFAILS)
C
C     Test driver for WHENILE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER ARRAY,TARGET,NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNILE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENILE(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNFLE
C                                                                  ************
      SUBROUTINE DRWHNFLE(NTESTS,NFAILS)
C
C     Test driver for WHENFLE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNFLE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENFLE(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNIGT
C                                                                  ************
      SUBROUTINE DRWHNIGT(NTESTS,NFAILS)
C
C     Test driver for WHENIGT.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER ARRAY,TARGET,NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNIGT'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENIGT(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNFGT
C                                                                  ************
      SUBROUTINE DRWHNFGT(NTESTS,NFAILS)
C
C     Test driver for WHENFGT.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNFGT'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENFGT(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNIGE
C                                                                  ************
      SUBROUTINE DRWHNIGE(NTESTS,NFAILS)
C
C     Test driver for WHENIGE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER ARRAY,TARGET,NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNIGE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENIGE(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRWHNFGE
C                                                                  ************
      SUBROUTINE DRWHNFGE(NTESTS,NFAILS)
C
C     Test driver for WHENFGE.
C     Martin J. McBride.  7/18/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,MESS*8
      INTEGER N,INC,INDEX,NVAL,NUM,CRNVAL,CRINDEX,I
      INTEGER NTESTS,NFAILS,ABSINC
      LOGICAL FAILED
      REAL ARRAY,TARGET
      DIMENSION ARRAY(MAXDIM),INDEX(MAXDIM),CRINDEX(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRWHNFGE'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRNVAL
      READ(7,*) STR6,(CRINDEX(I), I=1,CRNVAL)
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC - 1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL WHENFGE(N,ARRAY,INC,TARGET,INDEX,NVAL)

C  Compare new results with old results.
      FAILED = .FALSE.
      DO 10 I=1,NVAL
         IF (NVAL .NE. CRNVAL .OR. INDEX(I) .NE. CRINDEX(I))
     &      FAILED = .TRUE.
   10 CONTINUE

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR5,NVAL
      WRITE(8,615) STR6,(INDEX(I), I=1,NVAL)
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
  615 FORMAT('''',A10,'''',1X,9(I5,','),I5,:/(13X,I5,',',I5,',',
     &     I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5,',',I5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DROSRCHI
C                                                                  ************
      SUBROUTINE DROSRCHI(NTESTS,NFAILS)
C
C     Test driver for OSRCHI.
C     Martin J. McBride.  8/2/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,STR7,MESS*8
      LOGICAL FAILED
      INTEGER N,INC,INDEX,IWHERE,INUM,NUM,ABSINC
      INTEGER TARGET,ARRAY,CRINDEX,CRWHERE,CRNUM
      INTEGER NFAILS,NTESTS
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DROSRCHI'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRINDEX
      READ(7,*) STR6,CRWHERE
      READ(7,*) STR7,CRNUM
      INUM = CRNUM
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC-1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL OSRCHI(N,ARRAY,INC,TARGET,INDEX,IWHERE,INUM)

C  Write new results.
      WRITE(8,600) STR5,INDEX
      WRITE(8,600) STR6,IWHERE
      WRITE(8,600) STR7,INUM

C  Test new results and increment counters, if necessary.
      FAILED = .FALSE.
      IF (CRINDEX .NE. INDEX) FAILED = .TRUE.
      IF (CRWHERE .NE. IWHERE) FAILED = .TRUE.
      IF (CRNUM .NE. INUM) FAILED = .TRUE.
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,I10)
  610 FORMAT('''',A10,'''',1X,5(I10,:,','),I10,:/(13X,I10,',',
     &    I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DROSRCHF
C                                                                  ************
      SUBROUTINE DROSRCHF(NTESTS,NFAILS)
C
C     Test driver for OSRCHF.
C     Martin J. McBride.  8/2/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,STR5,STR6,STR7,MESS*8
      LOGICAL FAILED
      INTEGER N,INC,INDEX,IWHERE,INUM,NUM,ABSINC
      INTEGER CRINDEX,CRWHERE,CRNUM
      INTEGER NFAILS,NTESTS
      REAL TARGET,ARRAY
      DIMENSION ARRAY(MAXDIM)

C  Read and write input data and read CRAY results.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DROSRCHF'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INC
      READ(7,*) STR3,TARGET
      READ(7,*) STR4,(ARRAY(I), I=1,NUM)
      READ(7,*) STR5,CRINDEX
      READ(7,*) STR6,CRWHERE
      READ(7,*) STR7,CRNUM
      INUM = CRNUM
      ABSINC = ABS(INC)
      IF (INC .NE. 0) N = (NUM + (ABSINC-1))/ABSINC
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INC
      WRITE(8,605) STR3,TARGET
      WRITE(8,610) STR4,(ARRAY(I), I=1,NUM)

      CALL OSRCHF(N,ARRAY,INC,TARGET,INDEX,IWHERE,INUM)

C  Write new results.
      WRITE(8,600) STR5,INDEX
      WRITE(8,600) STR6,IWHERE
      WRITE(8,600) STR7,INUM

C  Test new results and increment counters, if necessary.
      FAILED = .FALSE.
      IF (CRINDEX .NE. INDEX) FAILED = .TRUE.
      IF (CRWHERE .NE. IWHERE) FAILED = .TRUE.
      IF (CRNUM .NE. INUM) FAILED = .TRUE.
      IF (FAILED) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  605 FORMAT('''',A10,'''',1X,G14.7)
  610 FORMAT('''',A10,'''',1X,3(G14.7,:,','),G14.7,:/(13X,
     &    G14.7,',',G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                     DRIILZ
C                                                                  ************
      SUBROUTINE DRIILZ(NTESTS,NFAILS)
C
C     Test driver for IILZ.
C     Martin J. McBride.  8/6/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,MESS*6
      INTEGER N,INCL,L,NTESTS,NFAILS,I,COUNT,CRCOUNT,ABSINCL
      DIMENSION L(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRIILZ'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INCL
      READ(7,*) STR3,(L(I), I=1,NUM)
      READ(7,*) STR4,CRCOUNT
      ABSINCL = ABS(INCL)
      IF (INCL .NE. 0) N = (NUM + (ABSINCL-1))/ABSINCL
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INCL
      WRITE(8,610) STR3,(L(I), I=1,NUM)

      COUNT = IILZ(N,L,INCL)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR4,COUNT
      IF (COUNT .NE. CRCOUNT) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                     DRIFLZ
C                                                                  ************
      SUBROUTINE DRIFLZ(NTESTS,NFAILS)
C
C     Test driver for IFLZ.
C     Martin J. McBride.  8/6/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,MESS*6
      INTEGER N,INCL,NTESTS,NFAILS,I,COUNT,CRCOUNT,ABSINCL
      REAL L
      DIMENSION L(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRIFLZ'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INCL
      READ(7,*) STR3,(L(I), I=1,NUM)
      READ(7,*) STR4,CRCOUNT
      ABSINCL = ABS(INCL)
      IF (INCL .NE. 0) N = (NUM + (ABSINCL-1))/ABSINCL
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INCL
      WRITE(8,610) STR3,(L(I), I=1,NUM)

      COUNT = IFLZ(N,L,INCL)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR4,COUNT
      IF (COUNT .NE. CRCOUNT) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                     DRILLZ
C                                                                  ************
      SUBROUTINE DRILLZ(NTESTS,NFAILS)
C
C     Test driver for ILLZ.
C     Martin J. McBride.  8/6/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,MESS*6
      INTEGER N,INCL,NTESTS,NFAILS,I,COUNT,CRCOUNT,ABSINCL
      LOGICAL L
      DIMENSION L(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRILLZ'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INCL
      READ(7,*) STR3,(L(I), I=1,NUM)
      READ(7,*) STR4,CRCOUNT
      ABSINCL = ABS(INCL)
      IF (INCL .NE. 0) N = (NUM + (ABSINCL-1))/ABSINCL
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INCL
      WRITE(8,610) STR3,(L(I), I=1,NUM)

      COUNT = ILLZ(N,L,INCL)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR4,COUNT
      IF (COUNT .NE. CRCOUNT) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  610 FORMAT('''',A10,'''',1X,9(L5,','),L5,:/(13X,L5,',',L5,',',
     &     L5,',',L5,',',L5,',',L5,',',L5,',',L5,',',L5,',',L5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                     DRILIZ
C                                                                  ************
      SUBROUTINE DRILIZ(NTESTS,NFAILS)
C
C     Test driver for ILIZ.
C     Martin J. McBride.  8/6/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,MESS*6
      INTEGER N,INCL,L,NTESTS,NFAILS,I,COUNT,CRCOUNT,ABSINCL
      DIMENSION L(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRILIZ'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INCL
      READ(7,*) STR3,(L(I), I=1,NUM)
      READ(7,*) STR4,CRCOUNT
      ABSINCL = ABS(INCL)
      IF (INCL .NE. 0) N = (NUM + (ABSINCL-1))/ABSINCL
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INCL
      WRITE(8,610) STR3,(L(I), I=1,NUM)

      COUNT = ILIZ(N,L,INCL)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR4,COUNT
      IF (COUNT .NE. CRCOUNT) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                     DRILFZ
C                                                                  ************
      SUBROUTINE DRILFZ(NTESTS,NFAILS)
C
C     Test driver for ILFZ.
C     Martin J. McBride.  8/6/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,MESS*6
      INTEGER N,INCL,NTESTS,NFAILS,I,COUNT,CRCOUNT,ABSINCL
      REAL L
      DIMENSION L(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRILFZ'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INCL
      READ(7,*) STR3,(L(I), I=1,NUM)
      READ(7,*) STR4,CRCOUNT
      ABSINCL = ABS(INCL)
      IF (INCL .NE. 0) N = (NUM + (ABSINCL-1))/ABSINCL
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INCL
      WRITE(8,610) STR3,(L(I), I=1,NUM)

      COUNT = ILFZ(N,L,INCL)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR4,COUNT
      IF (COUNT .NE. CRCOUNT) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRILSUM
C                                                                  ************
      SUBROUTINE DRILSUM(NTESTS,NFAILS)
C
C     Test driver for ILSUM.
C     Martin J. McBride.  8/6/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,MESS*7
      INTEGER N,INCL,NTESTS,NFAILS,I,COUNT,CRCOUNT,ABSINCL
      LOGICAL L
      DIMENSION L(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRILSUM'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INCL
      READ(7,*) STR3,(L(I), I=1,NUM)
      READ(7,*) STR4,CRCOUNT
      ABSINCL = ABS(INCL)
      IF (INCL .NE. 0) N = (NUM + (ABSINCL-1))/ABSINCL
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INCL
      WRITE(8,610) STR3,(L(I), I=1,NUM)

      COUNT = ILSUM(N,L,INCL)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR4,COUNT
      IF (COUNT .NE. CRCOUNT) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  610 FORMAT('''',A10,'''',1X,9(L5,','),L5,:/(13X,L5,',',L5,',',
     &     L5,',',L5,',',L5,',',L5,',',L5,',',L5,',',L5,',',L5))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRIISUM
C                                                                  ************
      SUBROUTINE DRIISUM(NTESTS,NFAILS)
C
C     Test driver for IISUM.
C     Martin J. McBride.  8/6/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,MESS*7
      INTEGER N,INCL,L,NTESTS,NFAILS,I,COUNT,CRCOUNT,ABSINCL
      DIMENSION L(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRIISUM'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INCL
      READ(7,*) STR3,(L(I), I=1,NUM)
      READ(7,*) STR4,CRCOUNT
      ABSINCL = ABS(INCL)
      IF (INCL .NE. 0) N = (NUM + (ABSINCL-1))/ABSINCL
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INCL
      WRITE(8,610) STR3,(L(I), I=1,NUM)

      COUNT = IISUM(N,L,INCL)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR4,COUNT
      IF (COUNT .NE. CRCOUNT) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  610 FORMAT('''',A10,'''',1X,5(I10,','),I10,:/(13X,I10,',',
     &     I10,',',I10,',',I10,',',I10,',',I10))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DRIFSUM
C                                                                  ************
      SUBROUTINE DRIFSUM(NTESTS,NFAILS)
C
C     Test driver for IFSUM.
C     Martin J. McBride.  8/6/85.
C     General Electric CRD, Information System Operation.
C
      PARAMETER(MAXDIM = 50)
      CHARACTER*10 STR1,STR2,STR3,STR4,MESS*7
      INTEGER N,INCL,NTESTS,NFAILS,I,COUNT,CRCOUNT,ABSINCL
      REAL L
      DIMENSION L(MAXDIM)

C  Read and write input data and read CRAY result.
      READ(7,*) STR1,NUM
      N = NUM
      MESS = 'DRIFSUM'
      CALL DIMCHECK(NUM,MAXDIM,MESS)
      READ(7,*) STR2,INCL
      READ(7,*) STR3,(L(I), I=1,NUM)
      READ(7,*) STR4,CRCOUNT
      ABSINCL = ABS(INCL)
      IF (INCL .NE. 0) N = (NUM + (ABSINCL-1))/ABSINCL
      WRITE(8,600) STR1,NUM
      WRITE(8,600) STR2,INCL
      WRITE(8,610) STR3,(L(I), I=1,NUM)

      COUNT = IFSUM(N,L,INCL)

C  Write new results and increment counters, if necessary.
      WRITE(8,600) STR4,COUNT
      IF (COUNT .NE. CRCOUNT) NFAILS = NFAILS + 1
      NTESTS = NTESTS + 1
  600 FORMAT('''',A10,'''',1X,I4)
  610 FORMAT('''',A10,'''',1X,3(G14.7,','),G14.7,:/(13X,G14.7,',',
     &     G14.7,',',G14.7,',',G14.7))
      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    DIMCHECK
C                                                                  ************
      SUBROUTINE DIMCHECK(NUSED,NALLCTD,MESS)
C
      CHARACTER*(*) MESS
      IF(NUSED.LE.NALLCTD)RETURN
      PRINT *,' DIMENSION FOR ',MESS,' = ',NALLCTD,' EXCEEDED BY ',
     1  NUSED - NALLCTD
      STOP ' SORRY '
      END