li913 发表于 2020-6-7 13:08
open(s,file=dirname// '\' // filename)
fcode 发表于 2020-6-7 13:55
给出你的代码
necrohan 发表于 2020-6-7 16:25
建议给文本的代码,不要用图片
open那句用 trim(dirname) 试试
program main
implicit none
integer::i,s=1940
character(len=5)::dirname
character(len=8)::filename
real::a
open(10,file='TI.dat',form='unformatted',access='direct',recl=48)
do i=1,66
read(10,rec=i)a
write(dirname,'(i4,"s")')s
write(filename,'(i4,".dat")')s
call system("mkdir "//dirname)
open(s,file=trim(dirname)//'\'//filename,form='unformatted',access='direct',recl=48)
write(s,rec=i)a
close(s)
s=s+1
enddo
endprogram
青衣巷 发表于 2020-6-8 08:08
open(s,file=trim(dirname)//'/'//filename,form='unformatted',access='direct',recl=48)
1000 发表于 2020-6-8 20:37
哇塞!!! 感谢!!!!!
lumlngz 发表于 2023-4-23 16:42
你好,我用了这一段代码试了一下发现不行,是因为TI.dat里面有数据嘛?
necrohan 发表于 2023-4-24 08:42
是,而且有格式要求
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |