       SUBROUTINE WRWNSY
*
*  PROGRAMMER:  D. P. MATHEIS
*		ALFRED UNIVERSITY, JAN-1990
*
*	THIS ROUTINE WRITES OUT A NUSY RAW DATA FILE
*	FROM THE COMMON BLOCKS
*
     	INCLUDE 'FILECONV.CBS'
     	INTEGER*2 ITIT(40), ZERO
     	EQUIVALENCE (ITIT,SLID)
        CHARACTER RAW*4
        RAW='RAW '
*
        ZERO=0
        CLOSE(UNIT=IOUT)
     	OPEN( UNIT=IOUT, FILE=FILOUT, STATUS='NEW', ERR=888,
     	1 ACCESS='DIRECT', RECL=1 )
        WRITE(IOUT,REC=1,ERR=888)RAW
        WRITE(IOUT,REC=2,ERR=888)NPTS
        WRITE(IOUT,REC=3,ERR=888)BANG(10)
        WRITE(IOUT,REC=4,ERR=888)BANG(3)
        WRITE(IOUT,REC=5,ERR=888)ZERO
        WRITE(IOUT,REC=6,ERR=888)ZERO
        WRITE(IOUT,REC=7,ERR=888)BANG(1)
        IREC= 7
        DO I=1, 11
          IREC = IREC + 1
          WRITE(IOUT,REC=IREC,ERR=888)ZERO
        ENDDO
        WRITE(IOUT,REC=19,ERR=888)WAVE(1,6)
        WRITE(IOUT,REC=20,ERR=888)WAVE(2,6)
        IREC=20
        DO I=1, 19
          IREC = IREC + 1
          WRITE(IOUT,REC=IREC,ERR=888)ZERO
        ENDDO
        IREC = 39
        DO I=1, NPTS
          IREC = IREC + 1
          WRITE(IOUT,REC=IREC,ERR=888)YOBS(I)
        ENDDO
     	GOTO 999

777	IERR = 3		!BAIL OUT
     	GOTO 999
888	IERR = 1
999	RETURN
     	END

