     	SUBROUTINE RRWSPP
C
C  PROGRAMMER:  R.S. ZHOU
C		ALFRED UNIVERSITY   FEB-1987
C
C	THIS ROUTINE READS FROM A SPECPLOT RAW DATA FILE
C	AND STORES IN THE CORRESPONDING COMMON BLOCKS
C
     	INCLUDE 'FILECONV.CBS'
     	INTEGER*2 SNUM, MONT, DATE, YEAR, ELEM, NPTT, INST(2)
     	BYTE TITL(48)
     	DIMENSION A(32)
     	CHARACTER ANOD*2
     	EQUIVALENCE (TITL(1),SLID(1))
     	EQUIVALENCE (ELEM, ANOD)

     	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) SNUM, DATE, MONT, YEAR, INST, TITL,
     	1 BANG(1), BANG(3), BANG(10), ELEM, WLEN, BANG(2), NPTT
     	ANODE(IELE) = ANOD
     	WAVE(1,IELE)= WLEN 
     	JUNK1= DATE
     	JUNK2= 3*(MONT-1)+1
     	JUNK3= YEAR
     	DATM = FLOAT(JUNK1)*1.0E+4 + FLOAT(JUNK2)*1.0E+2 + FLOAT(JUNK3)
C
C  READ THE INTENSITY DATA --- 32 POINTS PER RECORD...
C
     	NPTS = 0		!INITIALIZE THE COUNTER
111	READ(IINP,ERR=777,END=666) A
     	DO I=1, 32
     	   IF( A(I).LT.0.0 ) GOTO 666
     	   NPTS = NPTS + 1
     	   YOBS(NPTS) = A(I)
     	   IF( NPTS.EQ.MNP ) GOTO 999
     	ENDDO
     	GOTO 111

666	IF( NPTS.GT.0 ) GOTO 999
777	IERR = 1
     	GOTO 999
888	IERR = 2
999	RETURN
     	END
