| 
 
	积分459贡献 精华在线时间 小时注册时间2022-10-28最后登录1970-1-1 
 | 
 
| 
gfortran在读取一个用grads读取的.nc文件生成的.grd文件时,一直报错,无法读取,求求大佬们帮忙看一看这个是f90文件
x
登录后查看更多精彩内容~您需要 登录 才可以下载或查看,没有帐号?立即注册 
  program main
 implicit none
 integer,parameter::it=73,jt=144,lt=30
 integer i,j,l
 real u(it,jt,lt),ux(it,jt),us(it,jt)
 open(1,file='D:\fortran\qitong\u.grd',form='unformatted',access='stream')
 do l=1,lt
 read(1) ((u(i,j,l),i=1,it),j=1,jt)
 end do
 close(1)
 do j=1,jt
 do i=1,it
 ux(i,j)=0
 us(i,j)=0
 end do
 end do
 do j=1,jt
 do i=1,it
 do l=1,lt
 ux(i,j)=ux(i,j)+u(i,j,l)
 end do
 ux(i,j)=ux(i,j)/lt
 end do
 end do
 do j=1,jt
 do i=1,it
 do l=1,lt
 us(i,j)=us(i,j)+(u(i,j,l)-ux(i,j))**2
 end do
 us(i,j)=((1.0/lt)*us(i,j))**0.5
 end do
 end do
 open(2,file='d:\fortran\qitong\ux1.grd',access='stream',form='unformatted')
 write(2)((ux(i,j),i=1,it),j=1,jt)
 close(2)
 open(3,file='d:\fortran\qitong\us1.grd',access='stream',form='unformatted')
 write(3)((us(i,j),i=1,it),j=1,jt)
 close(3)
 end program main
 
 
 这是他报错的
 [Running] cd "d:\fortran\qitong\" && gfortran u.f90 -o u && "d:\fortran\qitong\"u
 At line 8 of file u.f90 (unit = 1, file = 'D:\fortran\qitong\u.grd')
 Fortran runtime error: End of file
 
 Error termination. Backtrace:
 
 Could not print backtrace: libbacktrace could not find executable to open
 #0  0xffffffff
 #1  0xffffffff
 #2  0xffffffff
 #3  0xffffffff
 #4  0xffffffff
 #5  0xffffffff
 #6  0xffffffff
 #7  0xffffffff
 #8  0xffffffff
 #9  0xffffffff
 #10  0xffffffff
 #11  0xffffffff
 #12  0xffffffff
 #13  0xffffffff
 
 [Done] exited with code=2 in 0.302 seconds
 
 
 
 
 | 
 |