- 积分
- 493
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-12-16
- 最后登录
- 1970-1-1
|
发表于 2018-2-11 11:17:58
|
显示全部楼层
谢谢你的答复,我在论坛上面找到了一个带通的Fortran程序,这个里面的一些参数不是很理解,比如我要看十年之内,那么我的mw1=1,mw2=10可以吗?还有这个里面的dt源程序取的是1.0,我的资料是逐月的,是不是应该取30呢?
C-------------PROGRAM MAIN---------------C
c Array hgt(nx,ny,nt) shows the HGT data
c 'nx' is the number of grids in x-direction
c 'ny' is the number of grids in y-direction
c 'nt' is day
c 'mw1' is bottom days
c 'mw2' is top days
c----------------------------------------C
parameter(nx=180,ny=89,nt=636,mw1=1,mw2=10)
dimension hgt(nx,ny,nt),hgt1(nx,ny,nt)
dimension cx(nt),xy(nt),bx(nt),tt(nt)
c-----------input data------------------
open(11,file='d:\AENSO\sst.mnmeanqvshi.grd',form='binary')
read(11) (((hgt(i,j,it),i=1,nx),j=1,ny),it=1,nt)
close(11)
do 70 i=1,nx
do 70 j=1,ny
do 50 it=1,nt
50 tt(it)=hgt(i,j,it)
call filter(nt,tt,bx,cx,xy,mw1,mw2)
do 60 it=1,nt
60 hgt1(i,j,it)=bx(it)
70 continue
c----writing hgt1(nx,ny,nt) to file 'hgt.2000lb.grd'-----
open(12,file='D:\AENSO\sst.mnmeanqvniandaiji.grd',form='binary')
do 80 it=1,nt
80 write(12) ((hgt1(i,j,it),i=1,nx),j=1,ny)
close(12)
end
c
subroutine filter(n,x,bx,cx,xy,mw1,mw2)
dimension x(n),bx(n),cx(n),xy(n)
w1=2*3.1415926/float(mw1)
w2=2*3.1415926/float(mw2)
w0=sqrt(w1*w2)
dt=30
ww=2*abs(sin(w1*dt)/(1+cos(w1*dt))
$ -sin(w2*dt)/(1+cos(w2*dt)))
ww0=4*sin(w1*dt)*sin(w2*dt)/((1+cos(w1*dt))
$ *(1+cos(w2*dt)))
a0=2*ww/(4+2*ww+ww0)
b1=2*(ww0-4)/(4+2*ww+ww0)
b2=(4-2*ww+ww0)/(4+2*ww+ww0)
do 89 i0=1,n-2
i=i0+2
bx(1)=0.0
bx(2)=0.0
cx(i)=a0*(x(i)-x(i-2))-b1*bx(i-1)-b2*bx(i-2)
89 bx(i)=cx(i)
do 91 i=1,n
91 x(i)=bx(n+1-i)
do 92 i0=1,n-2
i=i0+2
xy(1)=x(1)
xy(2)=x(2)
cx(i)=a0*(x(i)-x(i-2))-b1*xy(i-1)-b2*xy(i-2)
92 xy(i)=cx(i)
do 93 i=1,n
93 bx(i)=xy(n+1-i)
end |
|