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

      PROGRAM sortbis
      !SUBROUTINE sortbis(ns,s)
      IMPLICIT NONE
      INCLUDE 'general.h'

* input/output      
      INTEGER,PARAMETER :: ns=3
      CHARACTER*(lco) s(ns)
* internal
      CHARACTER*(lco) store
      INTEGER i,j

      print*,"*sortbis*",ns
 
      s(1)(1:9) = '199999999'
      s(2)(1:9) = '299929992'
      s(3)(1:9) = '199999992'

      DO i=1,ns
      print*,s(i)
      ENDDO

20    i=1
30    j=i+1
      IF (s(i).LE.s(j)) GO TO 10
      store = s(j)  
      s(j)  = s(i)
      s(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    CONTINUE    

      print*,"end"
      DO i=1,ns
      print*,s(i)
      ENDDO

      RETURN
      END
