- 积分
- 347
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-10-22
- 最后登录
- 1970-1-1

|

楼主 |
发表于 2012-12-29 11:24:07
|
显示全部楼层
言深深 发表于 2012-12-29 11:02
楼主如何判断外层循环没有运作?
write的时候format和定义需要相匹配,a默认是实型的,写成I型的不妥,再者 ...
额,对,从新看了下数据,数据格式是这样的
33 32 37 33 33 33 .....
33 33 33 33 33 38 ....
20 50 33 33 33 74 ......
总共71行,73列,我自己写的程序只能读出来第一列,比如上面的33,33,20.。。。
这是写的完整代码,不知哪儿出的问题,求指导一下
program ex19951
implicit none
integer,parameter::inputfileid=10,outputfileid=11
integer m,n,t,i,j,k
character(len=80)::inputfile,outputfile
parameter(m=71,n=73)
integer x(m,n)
integer a
real b
a=-180
b=90.0
inputfile="0010.txt"
outputfile="1.txt"
open(10,file=inputfile,status='old')
open(11,file=outputfile,status="replace")
do t=1,71
do j=1,73
read(10,*)(x(t,j))
b=b-2.5
a=a+5
write(11,"(I8,3XF5.1,I6,I6,I6)")a,b,(x(1,j)),j,t
end do
end do
stop
end program
|
|