想用FORTRAN把不为MaxR的值都变为0 为maxR的值保留 可为什么运行后数据都变为0了呢
integeri,j,k,nx,ny,nzparameter(nx=460,ny=360,nz=11)reals(nx,ny,nz),e(20),maxRopen(1,f...
integer i,j,k,nx,ny,nz
parameter(nx=460,ny=360,nz=11)
real s(nx,ny,nz),e(20),maxR
open(1,file='E:\mdraw\smoothed\Ref200606301659.txt')
open(12,file='E:\mdraw\14max5\200606301659.txt')
read(1,*)(e(k),k=1,12)
read(1,*)(((s(i,j,k),i=1,nx),j=1,ny),k=1,nz)
maxR=maxval(s)
print*,maxR
do k=3,3
do j=1,ny
do i=1,nx
if (s(i,j,k).ne.maxR) then
s(i,j,k)=0
end if
end do
end do
end do
close(1)
write(12,'(14f8.3)')(((s(i,j,k),i=37,50),j=264,277),k=3,3)
close(12)
end 展开
parameter(nx=460,ny=360,nz=11)
real s(nx,ny,nz),e(20),maxR
open(1,file='E:\mdraw\smoothed\Ref200606301659.txt')
open(12,file='E:\mdraw\14max5\200606301659.txt')
read(1,*)(e(k),k=1,12)
read(1,*)(((s(i,j,k),i=1,nx),j=1,ny),k=1,nz)
maxR=maxval(s)
print*,maxR
do k=3,3
do j=1,ny
do i=1,nx
if (s(i,j,k).ne.maxR) then
s(i,j,k)=0
end if
end do
end do
end do
close(1)
write(12,'(14f8.3)')(((s(i,j,k),i=37,50),j=264,277),k=3,3)
close(12)
end 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询