     	SUBROUTINE RRWMAC
C
C  PROGRAMMER:  R.S. ZHOU
C		ALFRED UNIVERSITY   FEB-1987
C
C	THIS ROUTINE WRITES OUT AN X-RAY RIETVELD RAW DATA FILE
C	FROM THE COMMON BLOCKS
C
C       MODIFIED TO READ AN ASCI FILE OUTPUT FROM OPT. [18]
C       FEB-9-1994 S. ZDZIESZYNSKI
C
     	INCLUDE 'FILECONV.CBS'
     	CHARACTER IQS*1, DAY*9, TIM*8, DTEXT(15)*1

     	CALL COLORS(1)
     	CALL PUTEXT('Reading the input file... Please wait...',41,24,1)
C
C  READ OUT AN ASCII FILE...
C

     	CLOSE( UNIT=IINP )

     	OPEN( UNIT=IINP, FILE=FILINP, STATUS='OLD', ERR=888,
     	1 FORM='FORMATTED',READONLY )

     	READ(IINP,1000) SLID
1000	FORMAT(20A4)
        READ(IINP,1005) (DTEXT(I),I=1,8)
1005    FORMAT(8A1)
     	READ(IINP,1001) BANG(10)
1001	FORMAT(11X,f10.4)
        READ(IINP,1006) WAVE(1,4)
1006    FORMAT(F6.4)
        READ(IINP,1007) (DTEXT(I),I=1,3)
1007    FORMAT(A1)
        READ(iINP,1002)(Bang(I),I=1,3)
1002    format(f10.4)
        NPTS=INT((BANG(2)-BANG(1))/BANG(3)+0.5)+1
     	READ(IINP,1003) (YOBS(I), I=1, NPTS)
1003	FORMAT(F7.0)
     	GOTO 999
888	IERR = 3		!BAIL OUT
     	GOTO 999
777	IERR = 1
999	RETURN
     	END
