- 积分
- 1594
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-12-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
参考这个帖子试着写了16个时次的降水http://bbs.06climate.com/forum.php?mod=viewthread&tid=13648&extra=&page=1
然后卡在fortran程序上了,希望大家能帮我解答一下。我怀疑可能是红字部分可能有问题,但是原作者运行是OK的。
错误提示为如下:
program p
parameter(nt=16)
integer::n,nlev,nflag
real,allocatable::lon(:),lat(:),pp(:) !动态数组存储经纬度和p
real:: temp(9)
character*8,allocatable::sta(:) !动态数组存储站号,8个字符
character*12 filename(nt) !用于储存16个时次的文件名
open(11,file='filename.txt') !
do i=1,nt
read(11,*) filename(i)
print*,filename(i)
enddo
close(11)
open(12,file='p.grd',form='binary') !储存248个时次的能见度场
tim=0.0;nlev=1;nflag=1
do k=1,nt
open(11,file=filename(k))
read(11,*)
read(11,*) n,n,n,n,n !将该时次的站点数赋值于n
allocate(lat(n))
allocate(lon(n))
allocate(pp(n))
allocate(sta(n))
close(11)
open(11,file=filename(k)) !获知n后,重新读取。
read(11,*)
read(11,*)
do i=1,n !只读降水资料
read(11,*) sta(i),lon(i),lat(i),(temp(j),j=1,9),pp(i)
write(12) sta(i),lat(i),lon(i),tim,nlev,nflag,pp(i)
enddo
nlev=0
write(12) sta(n),lat(n),lon(n),tim,nlev,nflag !一个时次的能见度场输入完毕
deallocate(lat)
deallocate(lon)
deallocate(vi)
deallocate(sta)
close(11)
enddo
close(12)
end
|
|