- 积分
- 1528
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-12-24
- 最后登录
- 1970-1-1
|
1金钱
本帖最后由 叁玖壹 于 2020-3-17 18:16 编辑
求指正,各位大佬三维数组的第三维度与一维数组怎么做逻辑运算,我写的程序总提示超出数组边界
program test
integer,parameter::m=121,h=689,n=42
integer i,j,k,f
character*4 nian(n)
character*5 tzh(h)
integer tz1(h),jd1(h),wd1(h),ps(h),zjs(h)
real yz(h),qd(h)
integer tz(n,h,m),jd(n,h,m),wd(n,h,m)
real R24(n,h,m)
ps(1)=0
open(10,file='G:\yuzhi.txt')
do i=1,h
read(10,*) tz1(i),wd1(i),jd1(i),yz(i)
enddo
close(10)
open(11,file='G:\tzh.txt')
do i=1,h
read(11,*) tzh(i)
enddo
close(11)
open(12,file='G:\sj\nian1.txt')
do k=1,n
read(12,*) nian(k)
enddo
close(12)
do k=1,n
do i=1,h
open(13,file='G:\sj\'//nian(k)//'\'//trim(tzh(i))//'.txt')
open(15,file='f:\ps.txt')
open(16,file='f:\qd.txt')
open(17,file='f:\zjs.txt')
do j=1,m
read(13,*) tz(k,i,j),jd(k,i,j),wd(k,i,j),R24(k,i,j)
do while((R24(k,i,j)>=yz(i)))
ps(i)=ps(i)+1
qd(i)=sum(R24(k,i,:),dim=1)
enddo
zjs(i)=sum(R24(k,i,:),dim=1)
enddo
enddo
enddo
do i=1,h
write(15,*) tz1(i),jd1(i),wd1(i),ps
write(16,*) tz1(i),jd1(i),wd1(i),qd
write(17,*) tz1(i),jd1(i),wd1(i),zjs
enddo
close(13)
close(15)
close(16)
close(17)
end
|
|