program main implicit none integer, parameter :: nx = 720, ny = 360 real :: dat(nx,ny) open(11, file='in.bin', form='unformatted', access='direct', recl=4*nx*ny, status='old') read(11, rec=1) dat close(11) open(21, file='out.bin', form='unformatted', access='direct', recl=4*nx*ny, status='replace') write(21, rec=1) dat write(21, rec=3) dat close(21) end program main