	SUBROUTINE GSORT(N,MAX,STUDY,ISIZE)
C
C	SORTS STUDY NAMES IN ORDER
C	OF INCREASING FILE SIZE
C
	VIRTUAL STUDY(300),ISIZE(300)
	REAL*8 STUDY,XDUM
	INTEGER*2 ISIZE,IXDUM(4)
	LOGICAL*1 SNAME(12)
	EQUIVALENCE(XDUM,IXDUM)
	MAX = 0
	DO 20 I=1,N
	XDUM = STUDY(I)
	CALL R50ASC(12,XDUM,SNAME)
20	CONTINUE
	DO 100 I=1,N-1
	MIN=ISIZE(I)
	INDEX=I
	DO 80 J=I+1,N
	IF (ISIZE(I).GT.MAX) MAX = ISIZE(I)
	IF(ISIZE(J).GE.MIN)GO TO 80
	MIN=ISIZE(J)
	INDEX=J
80	CONTINUE
	IF(ISIZE(I).EQ.MIN)GO TO 100
	IDUM=ISIZE(I)
	ISIZE(I)=ISIZE(INDEX)
	ISIZE(INDEX)=IDUM
	XDUM=STUDY(I)
	STUDY(I)=STUDY(INDEX)
	STUDY(INDEX)=XDUM
100	CONTINUE
	DO 200 I=1,N
	XDUM = STUDY(I)
	CALL R50ASC(12,XDUM,SNAME)
200	CONTINUE
	RETURN
	END
