*************************************************************
* simple bubble sort

      SUBROUTINE dctsort(a,ns,s)
      IMPLICIT NONE
      INCLUDE 'general.h'

* input/output      
      INTEGER     a,ns
      CHARACTER(LEN=ldi) s(mca,ns)
* internal
      CHARACTER(LEN=ldi) store
      INTEGER i,j

20    i=1
30    j=i+1
      IF (s(a,i).LE.s(a,j)) GO TO 10
      store = s(a,j)  
      s(a,j)  = s(a,i)
      s(a,i)  = store
      i     = i-1
      IF (i.EQ.0) GO TO 20
      GO TO 30
10    IF (j.EQ.ns) GO TO 40
      i = i + 1
      GO TO 30
40    RETURN
      END
