25
10
0
熟手
program hello implicit none integer(kind=4) :: a,b namelist /legend/ a,b a=0 b=0 open(10,file="test01.txt",status="replace") read(10,nml=legend) write(*,*) a+b end program
使用道具 举报
风平老涡 发表于 2020-9-19 21:35 在Open语句中,Status="replace"会导致”test01.txt"文件被删除,然后产生一个同名的空白文件。 改"replace ...
胆怯滴大侠 发表于 2020-9-19 21:41 At line 9 of file D:\wendang\fortran\test\20200919\main.f90 (unit = 10, file = 'test01.txt') Fortr ...
风平老涡 发表于 2020-9-19 22:21 文件"test01.txt"改为 &legend a=1, b=2 /
program hello implicit none integer:: a,b namelist /pa /a,b open(101,file="test01.txt",status="old") read(101,nml=pa) write(*,*) a+b end program
胆怯滴大侠 发表于 2020-9-20 20:03 你好,这是改过的txt &pa / a=1 /
风平老涡 发表于 2020-9-20 21:15 namelist的变量名不能有空格,namelist /pa /a,b 可改为namelist /pa/a,b。 "test01.txt"文件可改为: &pa ...
本版积分规则 发表回复 回帖后跳转到最后一页
捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )
GMT+8, 2024-5-14 12:16
Powered by Tencent X3.4
© 2013-2024 Tencent