作者sjgau (sjgau)
看板Fortran
标题Re: [问题] 如何输出连续的档名?
时间Mon Sep 15 17:26:02 2008
--------------------Configuration: VF0910 - Win32 Debug--------------------
Compiling Fortran...
D:\VF0910\VF0910.f90
D:\VF0910\VF0910.f90(7) : Error: A * specifier is invalid
at this point in the control list.
write( unit = filename, * ) i, ".txt"
---------------------------^
D:\VF0910\VF0910.f90(7) : Error: Internal READ and WRITE statements
must not use the list, namelist, or unformatted forms.
write( unit = filename, * ) i, ".txt"
---------------------------^
Error executing df.exe.
VF0910.exe - 2 error(s), 0 warning(s)
※ 引述《latinboy (昵称)》之铭言:
: ※ 引述《kobenein (哈哈哈)》之铭言:
: : 例如回圈从1跑到16
: : 每跑一次就产生一个档案
: : 从 01.dat ~ 16.dat
: : 谢谢!
: program filenameList
: implicit none
: integer i
: character*8 filename
: do i = 1, 16
: write( unit = filename, * ) i, ".txt"
^^^ 这一行,error
message 在上面
: open( unit = 1, file = filename )
: close( 1 )
: end do
: end
: 随手打打 不一定能跑 囧
: 重点就是把档名字串当成输出位置 用write写入
: 怎麽补0...? 自己玩
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.231.4.235