	SUBROUTINE DUMPFILE(nfil,*)
	include 'cmpr.common'

	integer nfil

	open(unit=out,file='CMPRFILE.DUMP',status='new',
	1	carriagecontrol='list')
	write (out,*) 'Title: '//ATITLE(nfil)(:lench(ATITLE(nfil)))
	write (out,*) 'Original name: ',ofilnam(nfil)(:lench(ofilnam(nfil)))
	write (out,*) 'Current name: ',cfilnam(nfil)(:lench(cfilnam(nfil)))
	write (out,*) 'Axis types  X:',fxtyp(nfil),'  Y:',fytyp(nfil)

	WRITE (OUT,120) date(1,nfil),date(2,nfil),date(3,nfil),
	1	INST(nfil),SOURCE(nfil),MONO(nfil)
120	FORMAT('DATE = ',2(I2'/')I2,3X,'INST = 'A2,5X,'SOURCE = ',
	1	A2,5X,'MONO = ',L5)

	WRITE (OUT,140) IRAD(nfil),WAVE(nfil),WKA1(nfil),WKA2(nfil)
140	FORMAT ('IRAD = 'A2,9X,'WAVE = ',F8.6,4X,'WKA1 = 'F8.6,4X,
	1	'WKA2 = 'F8.6)

	WRITE (OUT,160) TIME(nfil),TEMP1(nfil),TEMP2(nfil),REFINT(nfil)
160	FORMAT ('TIME = 'F6.2,5X,'TEMP1 ='F7.2,5X,'TEMP2 ='F7.2,5X,
	1	'REFINT ='F7.0)

	write (out,*) 'MONO(*)', MONO(nfil),'FEXISTS(*)',FEXISTS(nfil)

	write (out,*) 'Number of points = ',NPOINT(nfil)
	write (out,*) 'Start, end, step: ',START(nfil),FINISH(nfil),DELTA(nfil)
	do J=1,npoint(nfil),100
	  write (out,*) J, BX(j,nfil),B(j,nfil),BESD(j,nfil)
	enddo

C	IF PEAKS ARE PRESENT, WRITE THEM
C
	write (out,*) 'Number of peaks = ',NPKS(nfil)
	WRITE(OUT,61) ' # ','  2Theta',' 2Theta(C)',' Dspace','Peak H.',
	1	' Back',' FWHM',' R Int',' W#',' I Inten',' Comment'
61	FORMAT(/A3,2A10,A8,A8,3A6,A3,A8,A)
	DO J=1,NPKS(nfil)
	  WRITE(OUT,62) J,TT(J,nfil),TTCOR(J,nfil),DSPACE(J,nfil),
	1	PKHT(J,nfil),BKG(J,nfil),FWHM(J,nfil),RELINT(J,nfil),
	2	IWAVE(J,nfil),FINTEG(j,nfil),COMMT1(J,nfil),COMMT2(J,nfil)
62	  FORMAT(I3,2F10.3,F8.4,F8.0,F6.0,F6.2,F6.0,I3,F8.1,2A4)
	ENDDO

63	FORMAT(/A3,2A8,A9,7A8)
	WRITE(OUT,63) ' # ','Dspace', '" (ESD)','  H  K  L',
	2	'CORINT','ESDINT','FLPCOR','ABSCOR','DELTT','WTINT','WTHKL'
	DO J=1,NPKS(nfil)
	  WRITE(OUT,64) J,DSPACE(J,nfil),ESDDSP(J,nfil),
	1	IH(J,nfil),IK(J,nfil),IL(J,nfil),
	2	CORINT(J,nfil),ESDINT(J,nfil),FLPCOR(J,nfil),ABSCOR(J,nfil),
	3	DELTT(J,nfil),WTINT(J,nfil),WTHKL(J,nfil)
64	  FORMAT(I3,2F8.4,3I3,7F8.2)
	ENDDO

C arrays of background points -  positions, intensities, esd's and stiffness #
	write (out,*) 'Number of background points = ',NBKGP(nfil)
	write (out,*) 'Stiffness = ',bstiff(nfil)
	DO J=1,NBKGP(nfil)
	  WRITE(OUT,*) J,xbkg(J,nfil),ybkg(J,nfil),ybkgdel(J,nfil)
	ENDDO
	close(unit=out)
	RETURN
	END
