C**********************************************************************
C
	SUBROUTINE FINISH
C
C	CLEAN UP AFTER DATA COLLECTION.
C
C	This procedure calls SYTIME and IFEXIT
C
      INCLUDE 'COMMON.FTN'
C
C Uses ITYP, IRUN, IRAW, ITIM, IDAT
C Calls SYTIME, IFEXIT
C
C   Close files
	CLOSE(UNIT=IRAW)
	CLOSE(UNIT=IRUN)
C
C   Print message with completion time
	CALL SYTIME
	WRITE(ITYP,1004) ITIM, IDAT
1004	FORMAT(' DATA COLLECTION TERMINATED AT ',
     &   I2,':',I2,':',I2,' ON ',I2,'/',I2,'/',I2)
C
C   Shut down diffractometer and ask user to remove sample.
	CALL IFEXIT
C
C   Return to main program
9999	RETURN
	END
