program excise03
implicit none
integer,parameter::fileid=10
character(len=20)::filename="4.dat"
integer player,n1,n2
real u(29,34,35),v(29,34,35)
logical alive
integer error,i,j,k,t,rec1
inquire(file=filename,exist=alive)
if(.not.alive)then
write(*,*)trim(filename),"does not exist"
stop
end if
open(unit=fileid,file=filename,form="unformatted",access="direct",recl=29*34,status="old")
open(unit=11,file="41.dat",form="formatted",access="direct",recl=29*34*4,status="replace")
rec1=1
do t=1,6*24
do k=1,35
read(10,rec=rec1)((u(i,j,k),i=1,29),j=1,34)
!write(*,*)((u(i,j,k),i=1,29),j=1,34)
write(11,rec=rec1)((u(i,j,k),i=1,29),j=1,34)
rec1=rec1+1
end do
do k=1,35
read(10,rec=rec1)((v(i,j,k),i=1,29),j=1,34)
!write(*,*)((v(i,j,k),i=1,29),j=1,34)
write(11,rec=rec1)((v(i,j,k),i=1,29),j=1,34)
rec1=rec1+1
end do
end do
close(fileid)
close(11)
stop
end program
这个程序存成的还是二进制文件,高手指点一二