	program binarywrite

	parameter (nx=240, ny=240)
	dimension x(nx,ny) 
	do i = 1,240
          do j = 1,240
          x(i,j)=-9999.
	 end do
	end do

	open(unit=1,file='pred10min-locfit.out', status='unknown')
	open(unit=2,file='pred10min-locfit.bin', 
     *	access='random',form='unformatted',recl=nx*ny*4)
19	read(1,*, end=20)xlong, xlat, elev, xx
	    long=(xlong-60)/0.166667
	    lat=((xlat-0)/0.166667) + 1
            x(long,lat)=xx
	goto 19
20	continue

	write(2,rec=1)((x(i,j),i=1,240),j=1,240)

	stop
	end 
