- 积分
- 90
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-8-26
- 最后登录
- 1970-1-1
|
GrADS
系统平台: |
|
问题截图: |
- |
问题概况: |
This DO variable has already been used as an outer DO variable in the same nesting structure
菜鸟问题,不知道应该改哪里,有会的人不? |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
1 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
program main
implicit none
integer m,k,s1_,status,i,j !m代表文件数,k代表每个文件的行数
real sum1,sum2
character,allocatable::filename1(:)*50,filename2(:)*50
integer,allocatable::zhandian(:)
real,allocatable::temp(:),shidu(:)
character,allocatable::riqi(:)*15
character*15 rq
integer zd(56)
data zd /58015,58102,58122,58203,58215,58221,58236,58311,&
58314,58319,58321,58326,58334,58424,58436,58437,&
58531,58027,58040,58138,58144,58150,58238,58241,&
58251,58259,58265,58343,58345,58358,58445,58457,&
58464,58467,58472,58473,58477,58543,58549,58556,&
58562,58569,58633,58646,58647,58653,58659,58660,&
58665,58666,58667,58752,58760,58765,58362,58367/
open(1,file="f:\8089\namelist1.txt")
do while(.true.)
read(1,*,iostat=status)
i=i+1
if(status/=0) exit
enddo
m=i-1
print *,m
allocate(filename2(m))
allocate(filename1(m))
rewind(1)
do i=1,m
read(1,*) filename1(i)
enddo
close(1)
open(1,file="f:\8089\namelist2.txt")
do i=1,m
read(1,*) filename2(i)
enddo
close(1)
do i=1,m
open(2,file=filename1(i))
open(3,file=filename2(i))
k=0
do while(.true.)
read(2,*,iostat=status)
k=k+1
if(status/=0)exit
enddo
k=k-1
print*,k
allocate(riqi(k))
allocate(zhandian(k))
allocate(temp(k))
allocate(shidu(k))
rewind(2)
do j=1,k
read(2,*) zhandian(j),riqi(j),temp(j),shidu(j)
!print*,zhandian(j),riqi(j),shijian(j),q(j),nengjiandu(j)
end do
rewind(2)
s1_=zhandian(1)
do j=1,k
read(1,*) zhandian(j),riqi(j),temp(j),shidu(j)
end do
rewind(1)
do j=1,k
do i=1,56
if (zhandian(j)==s1_.and.zhandian(j)==zd(i)) then
sum1=sum1+temp(j)
sum2=sum2+shidu(j)
m=m+1
else
write(3,'(5i,3x,f6.2,3x,f6.2)') s1_,sum1/m,sum2/m
m=1
s1_=zhandian(j)
end if
end do
end do
write(3,'(5i,3x,f6.2,3x,f6.2)') s1_,sum1/m,sum2/m
close(3)
close(2)
deallocate(zhandian)
deallocate(riqi)
deallocate(temp)
deallocate(shidu)
enddo
end
|
|