- 积分
- 682
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-9-24
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
fortarn学渣求教读取EC文件,保存在数组中时会出现forrtl:severe(24):end-of-file during read
就是一个简单的程序 ,但是当数组第二层循环j=1,1改为其他数时就会出现end-of-file during read的错误,我该怎么办啊
读取的是ec数据 数据是从第四行开始的,前三行是描述,主要问题出在程序中感叹号标注的区域
求助论坛的大大们帮助
program text
implicit none
character(len = 79) :: filename
character(len = 79) :: temp
character(len = 79) :: dy,dx,sy,ey,sx,ex
integer(4) :: xnum,ynum
integer :: i,j,ii,jj
logical :: alive
real,allocatable :: EC_data(:,:)
inquire(file="16061108.012",exist=alive)
if(alive)then
open(10,file="16061108.012")
print*, 'file exist'
else
print*, 'file dosen`t exist'
stop
endif
allocate(EC_data(xnum,ynum))
EC_data=0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
do i=1,3
read(10,*)temp
print*, temp
end do
do i=1,xnum
do j=1,ynum
read(10,*) EC_data(i,j)
write(*,"(1X,F5.2)") EC_data(i,j)
end do
end do
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
close(10)
open(20,file="text1.txt")
do
write(20,"(1X,F5.2)") EC_data
stop
end do
end program text
|
|