我准备通过文件读入u0y和n0这个量,编译后发现n0可以正常读入,但u0y报错。然而这两个变量从文件中读入的代码几乎是一样的,这是为什么呢?
报错信息及源代码如下:
84 | read(29,*) (u0y(i,j),i=ypml_cell+1,Nx-ypml_cell)
| 1
Error: Expecting variable in READ statement at (1)
[Fortran] 纯文本查看 复制代码 select case(u0_use_file)
case(.True.)
open(29,file="vy.dat")
do j=pml_cell+1,Ny-pml_cell
read(29,*) (u0y(i,j),i=ypml_cell+1,Nx-ypml_cell)
end do
close(29)
case(.False.)
u0x=u0x_const
u0y=u0y_const
end select
end if
select case(n0_use_file)
case(.True.)
open(30,file="density.dat")
do j=pml_cell+1,Ny-pml_cell
read(30,*) (n0(i,j),i=ypml_cell+1,Nx-ypml_cell)
end do
close(30)
case(.False.)
n0=n0_constant
end select
|