! ------------------------------- ! Example program ! Binary data input and output ! ------------------------------- program test implicit none integer:: i,k integer, parameter:: n = 10 real(kind(1.d0)):: x(n),y(n) ! ! fill table x ! do i = 1, n x(i) = dble(i) end do ! ! write x to a binary data file ! open(12,file='input.bin',form='unformatted') write(12) x rewind(12) read(12) y write(*,*) "Binary date write/read test" write(*,'(2a10)') 'wrote','read' do k = 1, n write(*,'(2f10.3)') x(k),y(k) end do end program test