从文件中读取整数值到实变量

问题描述 投票:0回答:0

例如:

real :: a(3)
open(newunit=u,file='t.txt', status='old')
do j=1,3
  read(u,*) a(j)
enddo

“t.txt”中的数据如下所示:

1 
2 
3 

ifort
编译的代码给出以下错误:

forrtl: severe (59): list-directed I/O syntax error

我尝试了几个编译选项,仍然出现错误。

为什么ifort不能处理这种简单的数据转换?

casting fortran readfile
© www.soinside.com 2019 - 2024. All rights reserved.