	SUBROUTINE TSORT (TTHETA,INT,NDSINT)
C
C  BUBBLE SORTS TTHETA ARRAY FROM LOW TO HIGH
C
	LOGICAL NSWAP
	DIMENSION TTHETA(100)
	INTEGER*2 INT(100)
	N=NDSINT-1
100	NSWAP = .false.
	DO 300 K=1,N
	  IF (TTHETA(K).GT.TTHETA(K+1)) THEN 
	    TEMP=TTHETA(K+1)
	    TTHETA(K+1)=TTHETA(K)
	    TTHETA(K)=TEMP
	    ITEMP=INT(K+1)
	    INT(K+1)=INT(K)
	    INT(K)=ITEMP
	    NSWAP = .true.
	  ENDIF
300	CONTINUE
	IF (NSWAP) GO TO 100
	RETURN
	END
