     	SUBROUTINE RDINIC
C
C  PROGRAMMER:  R.S. ZHOU
C		ALFRED UNIVERSITY   FEB-1987
C
C	THIS ROUTINE READS FROM A NICOLET DIFILE
C	AND STORES IN THE CORRESPONDING COMMON BLOCKS
C
     	INCLUDE 'FILECONV.CBS'
     	INTEGER*2 IBUF(149), HKLP(3,150), IDUM, NOD
     	DIMENSION FWAVE(3)
     	EQUIVALENCE (IBUF(1),SLID(1)), (IBUF(47), FWAVE(1))

     	CLOSE( UNIT=IINP )
     	OPEN( UNIT=IINP, FILE=FILINP, STATUS='OLD',
     	1 FORM='UNFORMATTED', READONLY, ERR=888 )
C
C  READ THE HEADER INFORMATION...
C
     	READ(IINP,ERR=777,END=777) IBUF

     	WAVE(1,6) = FWAVE(2)
     	WAVE(2,6) = FWAVE(3)
     	WAVE(3,6) = FWAVE(1)
     	WAVE(5,6) = 2.0
     	DO I=1, 5
     	   IF( ABS(WAVE(1,6)-WAVE(1,I)).LT.0.001 ) IELE = I
     	ENDDO
C
C  READ THE PEAK INFORMATION...
C
     	READ(IINP,ERR=777,END=777) NOD, ( FDSP(I), RELA(I), F2TH(I),
     	1 FWHM(I), (HKLP(J,I),J=1,3), IDUM, I=1, NOD )

     	NPKS = NOD
     	DO I=1, NPKS
     	   PHKL(1,I) = HKLP(1,I)
     	   PHKL(2,I) = HKLP(2,I)
     	   PHKL(3,I) = HKLP(3,I)
     	   C2TH(I) = F2TH(I)
     	   CDSP(I) = FDSP(I)
     	   PHGH(I) = RELA(I)
     	   AREA(I,JRES) = RELA(I)
     	   PEAK(I) = 'KA1'
     	ENDDO
     	GOTO 999

777	IERR = 1
     	GOTO 999
888	IERR = 2
999	RETURN
     	END
