如果你非要直接读写。那么 recl 应该和每次循环输出的长度相匹配。 
[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode open(12,file='F:/station_operation1.grd',access='direct',status='replace',form='unformatted',recl=18627*9)
write(12,rec=1) h(1:18627,1:9)
close(12)  
或者 
[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode open(12,file='F:/station_operation1.grd',access='direct',status='replace',form='unformatted',recl=1)
irec = 1
do m=1,9
  do n=1,18627
   write(12,rec=irec) h(n,m)
   irec = irec + 1
  end do
end do
close(12)  |