[Fortran] 纯文本查看 复制代码
Program Main
Integer :: a(100)
Character(len=2) , parameter :: CRLF = char(13)//char(10)
Character(len=420) :: c
integer :: i , j
open(13,File="test.txt",access="direct",form="formatted",recl=420)
Do i = 1 , 4
do j = 1 , 100
a(j) = i*100 + j
end do
WRITE(c,120) (a(j:j+9),CRLF,j=1,100,10)
write(13,"(a)",REC=i) c
ENd Do
Close(13)
120 FORMAT(10(10i4,a))
End Program Main
[Fortran] 纯文本查看 复制代码
subroutine TEXT2
INTEGER A
DIMENSION A(100)
CHARACTER CRLF
CHARACTER C(420)
INTEGER i,j
CHARACTER*80 ASCLIB
120 format(10(10i4,a2))
ASCLIB='45GTEST.txt'
crlf=char(13)//char(10)
OPEN(11,FILE=ASCLIB,STATUS='REPLACE',ACCESS='DIRECT',
1 FORM='FORMATTED',RECL=420)
DO i=1,100
a(i)=55
end do
write(c,120) (a(j:j+9),CRLF,j=1,91,10)
write(11,'(a)',rec=1) c
close (11)
return
END
您能看看为什么我的这个运行一直报错吗