登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
程序如下:
program main
implicit none
integer,parameter::x=17,y=15
integer i,j,m,n,t,k,l
real::hgt(x,y,365)
open(11,file='f:\1949.grd',form='binary')
open(12,file='hgt.xls')
read(11)hgt(:,:,:)
!write(12,*)(((hgt(i,j,l),i=1,17),j=1,15),l=1,1)
!stop
do l=1,365
do j=3,15
do i=3,13
if(hgt(i,j,l)<hgt(i-1,j,l).and.hgt(i,j,l)<hgt(i+1,j,l).and.hgt(i,j,l)<hgt(i,j-1,l).and.hgt(i,j,l)<hgt(i,j+1,l).and.hgt(i,j,l)<hgt(i-1,j-1,l).and.hgt(i,j,l)<hgt(i-1,j+1,l).and.hgt(i,j,l)<hgt(i+1,j-1,l).and.hgt(i,j,l)<hgt(i+1,j+1,l)) then
write(*,*)i,j,l
end if
end do
end do
end do
close(11)
close(12)
end program
运行后stop以上是正常的,数据正确,但是到下面进行判断时,只能循环一个时间,之后就错误了!提示如图:
|