      SUBROUTINE BISHEL(*,LIST,NENT,NTERM,ARRAY)
C-----
C   BISHEL IS A MERGE/SORT/DUPLICATE ENTRY ELIMINATOR.  GIVEN A SORTED
C -ARRAY- AND A -LIST- TO MERGE, BISHEL ADDS THE -LIST- IN THE SORTED
C LOCATION.  SORT IS ONLY ON THE FIRST WORD OF LIST.
C
C   ARGUMENTS...
C
C     LIST  -- IN/OUT - LIST OF LENGTH NTERM TO MERGE INTO ARRAY.
C     NENT  -- IN/OUT - LENGTH OF LIST BEFORE/AFTER MERGE.
C     NTERM -- IN     - LENGTH OF ARRAY (AND LIST) ENTRIES.
C     ARRAY -- IN/OUT - ARRAY TO MERGE LIST INTO.
C     NONSTANDARD RETURN -- WHEN ARRAY(ITERM) IS A DUPLICATE.
C-----
      INTEGER LIST(1),ARRAY(1)
C
      K = 1
      L = NENT + 1
      M = NENT - NTERM + 1
C
C  . LOCATE DUPLICATES...
C
      IF (NENT.LT.NTERM) GO TO 50
      IF (LIST(1) - ARRAY(M) ) 10,20,60
   10 KID = LIST(1)
      CALL BISLOC (*30, KID, ARRAY, NTERM, NENT/NTERM, K)
   20 RETURN 1
C
C  . CREATE A HOLE IN THE LIST BY MOVING THE END OF THE LIST...
C
   30 CONTINUE
      J = L-K
      N = NENT+NTERM
      DO 40 I = 1,J
      M = L-I
      ARRAY(N) = ARRAY(M)
   40 N = N-1
C
C  . LOAD LIST INTO HOLE...
C
      GO TO 70
   50 NENT = 0
      GO TO 70
   60 K = L
   70 CONTINUE
      DO 80 I = 1,NTERM
      ARRAY(K)=LIST(I)
   80 K = K+1
      NENT = NENT + NTERM
      RETURN
      END
