- 积分
- 63
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-12-13
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
fortran程序如下:
program main
implicit none
external sx !标准化EU指数
external rxy !求相关系数
external stntogrd !输出站点格式文件
integer,parameter::m=144,n=73,mo=12,yr=65,z=160,ye=62
integer i,j,k,t
real height(m,n,mo,yr),tempe(z,yr),eui(yr),aver1,sx1,rxy1(m,n),eui1(yr)
open(1,file='e:\sx3\data\hgt500.grd',form='binary')
open(2,file='e:\sx3\data\t1601.txt')
read(1) ((((height(i,j,k,t),i=1,m),j=1,n),k=1,mo),t=1,yr)
read(2,*) ((tempe(i,j),i=1,z),j=1,ye)
do i=1,z
do j=1,ye
tempe(i,j)=tempe(i,j)*0.1
end do
end do
do i=1,yr
eui(i)=-0.25*height(9,59,1,i)+0.5*height(31,59,1,i)-0.25*height(59,53,1,i)
end do
call sx(yr,eui,aver1,sx1,eui1)
call rxy(eui,sx1,aver1,height,m,n,yr,mo,rxy1)
call stntogrd(tempe,z,ye,eui,aver1,sx1)
close(1)
close(2)
end
subroutine sx(yr1,eui,aver1,sx1,eui1)
implicit none
integer i,yr1
real sum1,sum2,eui(yr1),aver1,sx1,eui1(yr1)
sum1=0.0
sum2=0.0
do i=1,yr1
sum1=sum1+eui(i)
end do
aver1=sum1/yr1
do i=1,yr1
sum2=sum2+(eui(i)-aver1)**2
end do
sx1=(sum2/yr1)**0.5
do i=1,yr1
eui1(i)=(eui(i)-aver1)/sx1
end do
end subroutine
subroutine rxy(eui,sx1,aver1,height,m1,n1,yr1,mo1,rxy1)
implicit none
integer m1,n1,mo1,yr1,i,j,k,t
real eui(yr1),height(m1,n1,mo1,yr1),aver2(m1,n1,mo1),sum3(m1,n1,mo1),sum4(m1,n1,mo1),sy(m1,n1,mo1),sx1,aver1,rxy1(m1,n1)
real a
do k=1,mo1
do i=1,m1
do j=1,n1
do t=1,yr1
sum3(i,j,k)=sum3(i,j,k)+height(i,j,k,t)
end do
aver2(i,j,k)=sum3(i,j,k)/yr1
end do
end do
end do
do k=1,mo1
do i=1,m1
do j=1,n1
do t=1,yr1
sum4(i,j,k)=sum4(i,j,k)+(height(i,j,k,t)-aver2(i,j,k))**2
end do
end do
end do
end do
do i=1,m1
do j=1,n1
do k=1,mo1
sy(i,j,k)=(sum4(i,j,k)/yr1)**0.5
end do
end do
end do
do t=1,yr1
do i=1,m1
do j=1,n1
rxy1(i,j)=rxy1(i,j)+(eui(t)-aver1)*(height(i,j,1,t)-aver2(i,j,1))
end do
end do
end do
do i=1,m1
do j=1,n1
rxy1(i,j)=rxy1(i,j)/65/(sx1*sy(i,j,1))
end do
end do
end subroutine rxy
subroutine stntogrd(tempe,z1,ye1,eui,aver1,sx1)
implicit none
integer i,j,z1,ye1,nlev,nflag
real tempe(z1,ye1),lat(z1),lon(z1),ri(z1),eui(65),aver1,sx1,sumt,avert(z1),syt(z1),sumt2(z1),tim
character*8 id(z1)
open(3,file='e:\sx3\data\lat_lon.txt')
open(4,file='e:\sx3\data\r160.grd',form='binary')
sumt=0.0
do i=1,z1
read(3,*) id(i),lat(i),lon(i)
end do
do i=1,z1
do j=1,ye1
sumt=sumt+tempe(i,j)
end do
avert(i)=sumt/ye1
end do
sumt2=0.0
do i=1,z1
do j=1,ye1
sumt2(i)=sumt2(i)+(tempe(i,j)-avert(i))**2
end do
syt(i)=(sumt2(i)/ye1)**0.5
end do
do i=1,z1
do j=1,ye1
ri(i)=ri(i)+(tempe(i,j)-avert(i))*(eui(j)-aver1)/65
end do
end do
do i=1,z1
ri(i)=ri(i)/syt(i)/sx1
end do
do i=1,160
id(i)=char(i)
tim=0.0
nlev=1
nflag=1
write(4) id(i),lat(i),lon(i),tim,nlev,nflag,ri(i)
end do
tim=0.0
nlev=0
nflag=1
write(4) id(i-1),lat(i-1),lon(i-1),tim,nlev,nflag
close(3)
close(4)
write(*,*) ri
end subroutine stntogrd
求给位大神帮忙
|
-
-
-
grid.ctl
195 Bytes, 下载次数: 0, 下载积分: 金钱 -5
-
-
grid.grb
11.37 KB, 下载次数: 0, 下载积分: 金钱 -5
-
-
r160.ctl
219 Bytes, 下载次数: 1, 下载积分: 金钱 -5
-
-
r160.grd
5.03 KB, 下载次数: 0, 下载积分: 金钱 -5
|