- 积分
- 6650
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-4-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
搜索了论坛上的帖子,试过dos2unix,也改过函数名字(不能带_),但是一直没用,一直显示,除此以外没有出错内容了,实在找不出来哪里不行
f90代码如下:
subroutine fortranrun(num, nlat, nlon, rundays, need_run, run, undef)
implicit none
integer, intent(in)::num, rundays, nlat, nlon !num is the days which need doing running mean, rundays is the required running days.
real, intent(in)::need_run(num,nlat,nlon), undef
real, intent(out)::run(num,nlat,nlon)
integer i,j,bb,m,n
real sum,count1,a(3*num,nlat,nlon)
if(mod(rundays,2)==1) then
do m=1,nlat
do n=1,nlon
do i=1,3*num
a(i,m,n)=need_run(mod(i,num),m,n) !allocate dynamic arrays
enddo
enddo
enddo
bb = int(rundays/2)
run(:,:,:) = undef
do m=1,nlat
do n=1,nlon
do i = 1,num
sum = 0.0
count1 = 0.
do j = -bb,bb
if(a(num+j,m,n)/=undef) then
sum=sum+a(num+j,m,n)
count1=count1+1
endif
enddo
if(sum/=0.0) run(i,m,n)=sum/real(count1)
enddo
enddo
enddo
endif
return
end subroutine fortranrun
stub文件:
C NCLFORSTART
subroutine fortranrun(num, nlat, nlon, rundays, need_run, run, undef)
implicit none
real undef
integer num,rundays,nlat,nlon
real need_run(num,nlat,nlon),run(num,nlat,nlon)
C NCLEND
感谢大家
|
|