CDECK  ID>, QSORVH.
      SUBROUTINE QSORVH (JWORD,NWORDS,KGOP)

C-    SORT BANKS AT KGO SUCH THAT THE 'NWORDS' LONG KEY STRINGS
C-    STARTING AT Q(L+JWORD) ARE IN INCREASING ORDER

      PARAMETER      (IQBDRO=25, IQBMAR=26, IQBCRI=27, IQBSYS=31)
      COMMON /QBITS/ IQDROP,IQMARK,IQCRIT,IQZIM,IQZIP,IQSYS
                         DIMENSION    IQUEST(30)
                         DIMENSION                 LQ(99), IQ(99), Q(99)
                         EQUIVALENCE (QUEST,IQUEST),    (LQUSER,LQ,IQ,Q)
      COMMON //      QUEST(30),LQUSER(7),LQMAIN,LQSYS(24),LQPRIV(7)
     +,              LQ1,LQ2,LQ3,LQ4,LQ5,LQ6,LQ7,LQSV,LQAN,LQDW,LQUP
C--------------    END CDE                             -----------------  ------
      DIMENSION    JWORD(9), NWORDS(9), KGOP(9)


      JW  = JWORD(1)
      NCH = 4*NWORDS(1)
      KGO = KGOP(1)
      LL  = LQ(KGO)
      IF (LL.EQ.0)           RETURN

   11 LN = LQ(LL-1)
      IF (LN.EQ.0)           RETURN
      IF (IUCOMH(IQ(LN+JW),IQ(LL+JW),NCH).LT.0)   GO TO 21
      LL = LN
      GO TO 11

C--                BANK  LN  OUT OF SEQUENCE

   21 LQ(LL-1)= LQ(LN-1)
      K = KGO

   24 L = LQ(K)
      IF (IUCOMH(IQ(LN+JW),IQ(L+JW),NCH).LT.0)   GO TO 29
      K = L-1
      GO TO 24

C--                PLACE FOR BANK  LN  FOUND

   29 LQ(LN-1)= L
      LQ(K)   = LN
      GO TO 11
      END
