- 积分
- 54
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-5-22
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
fortran代码:
program EP
real ii,jj,m,n,mo,year
parameter(ii=89,jj=180,m=55,n=3,mo=12,year=63)
real sst(ii,jj,mo,year),sst_12(ii,jj,year),sst_s_12(ii,jj,m)
real sst_ave(ii,jj),ddi(m,n),num(n),sst_yb(ii,jj,n),sst_s(ii,jj,n),sst_jp(ii,jj,n)
real sst_1_2(ii,jj),sst_1_3(ii,jj),sst_2_3(ii,jj)
real s(ii,jj,n)
real t_12(ii,jj),t_13(ii,jj),t_23(ii,jj)
open(7,file='F:\dqsxk\dqyc\shixi6\6\data\ddi')
open(10,file='F:\dqsxk\dqyc\shixi6\6\data\sst.grb',form='binary')
open(8,file='F:\dqsxk\dqyc\shixi6\6\data\t.grb',form='binary')
!读取三类雨型的标记矩阵
do it=1,m
read(7,*)(ddi(it,j),j=1,3)
enddo
close(7)
!ccccccccccccccc 读数据(海洋温度,1947年到2009年,12个月,纬向格点180,经向格点89)
do yr=1,year
do imo=1,mo
do j=1,jj
do i=1,ii
read(10)sst(i,j,imo,yr)
enddo
enddo
enddo
enddo
close(10)
!write(*,*) sst(1,1,1,1)
!ccccccccccccccc 存储数据(每一年12月份的海洋温度数值)
imo=mo
do yr=1,year
do j=1,jj
do i=1,ii
sst_12(i,j,yr)=sst(i,j,imo,yr)
enddo
enddo
enddo
!write(*,*) sst_12(1,1,1)
!ccccccccccccccc归纳对应三类雨型的12月份的海洋温度数值
do yr=5,59
do j=1,jj
do i=1,ii
sst_s_12(i,j,yr-4)=sst_12(i,j,yr)
enddo
enddo
enddo
!write(*,*) sst_s_12(1,1,1)
!求解出55年海洋温度的总体平均值
do j=1,jj
do i=1,ii
sst_ave(i,j)=0.0
do it=1,m
sst_ave(i,j)=sst_ave(i,j)+sst_s_12(i,j,it)
enddo
sst_ave(i,j)=sst_ave(i,j)/m
enddo
enddo
!write(*,*) sst_ave(1,1)
!再求解三类雨型海洋温度的样本均值,三类雨型海洋温度的合成分析
do k=1,n
do j=1,jj
do i=1,ii
num(k)=0
sst_yb(i,j,k)=0
do it=1,m
num(k)=num(k)+ddi(it,k)
sst_yb(i,j,k)=sst_yb(i,j,k)+sst_s_12(i,j,it)*ddi(it,k)
enddo
sst_yb(i,j,k)=sst_yb(i,j,k)/real(num(k))
enddo;enddo;enddo;
!write(*,*) sst_yb(1,1,1)
!三类雨型海洋温度的距平合成分析
do k=1,n
do j=1,jj
do i=1,ii
num(k)=0
sst_jp(i,j,k)=0
do it=1,m
num(k)=num(k)+ddi(it,k)
sst_jp(i,j,k)=(sst_s_12(i,j,it)-sst_ave(i,j))*ddi(it,k)+sst_jp(i,j,k)
enddo
sst_jp(i,j,k)=sst_jp(i,j,k)/real(num(k))
enddo;enddo;enddo;
open(100,file='F:\dqsxk\dqyc\shixi6\6\data\sst_jp.grb',form='binary')
do k=1,n
write(100)((sst_jp(i,j,k),i=1,ii),j=1,jj)
enddo
close(100)
!write(*,*) sst_jp(:,:,1)
!三类雨型对应海温的差值分析
do j=1,jj
do i=1,ii
sst_1_2(i,j)=sst_yb(i,j,1)-sst_yb(i,j,2)
sst_1_3(i,j)=sst_yb(i,j,1)-sst_yb(i,j,3)
sst_2_3(i,j)=sst_yb(i,j,2)-sst_yb(i,j,3)
enddo;enddo;
open(101,file='F:\dqsxk\dqyc\shixi6\6\data\sst_cz.grb',form='binary')
do j=1,jj
do i=1,ii
write(101) sst_1_2(i,j),sst_1_3(i,j),sst_2_3(i,j)
enddo
enddo
close(101)
! write(*,*) sst_1_2
!求解三类雨型对应海温的标准差
do k=1,n
do j=1,jj
do i=1,ii
num(k)=0
s(i,j,k)=0
do it=1,m
num(k)=num(k)+ddi(it,k)
s(i,j,k)=((sst_s_12(i,j,it)-sst_yb(i,j,k))*ddi(it,k))**2+s(i,j,k)
enddo
s(i,j,k)=sqrt(s(i,j,k)/real(num(k)))
enddo;enddo;enddo;
!write(*,*) s(:,:,1)
!求解三类雨型样本之间的t统计量
do j=1,jj
do i=1,ii
t_12(i,j)=(sst_yb(i,j,1)-sst_yb(i,j,2))/sqrt(1/num(1)+1/num(2))/sqrt(((num(1)-1)*s(i,j,1)**2+(num(2)-1)*s(i,j,2)**2)/(num(1)+num(2)-2))
t_13(i,j)=(sst_yb(i,j,1)-sst_yb(i,j,3))/sqrt(1/num(1)+1/num(3))/sqrt(((num(1)-1)*s(i,j,1)**2+(num(3)-1)*s(i,j,3)**2)/(num(1)+num(3)-2))
t_23(i,j)=(sst_yb(i,j,2)-sst_yb(i,j,3))/sqrt(1/num(2)+1/num(3))/sqrt(((num(2)-1)*s(i,j,2)**2+(num(3)-1)*s(i,j,3)**2)/(num(2)+num(3)-2))
enddo
enddo
do j=1,jj
do i=1,ii
write(8) t_12(i,j),t_13(i,j),t_23(i,j)
enddo
enddo
close(8)
!write(*,*) num
!write(*,*) t_12
end program
一类雨型海温距平合成ctl
dset F:\dqsxk\dqyc\shixi6\6\data\sst_jp.grb
undef 32767
title NCEP/NACR slp
xdef 180 linear 0.000 2.000
ydef 89 linear -88.000 2.000
zdef 1 levels 1000
tdef 1 linear jan1947 1mo
vars 3
sst1 0 -999 monthly mean sst
sst2 0 -999 monthly mean sst
sst3 0 -999 monthly mean sst
endvars
;
一类雨型海温距平合成gs
'reinit'
'open F:\dqsxk\dqyc\shixi6\6\data\sst_jp.ctl'
'set xlopts 1 2 0.2'
'set ylopts 1 2 0.2'
'set gxout shaded'
'define_colors'
'set ccols 41 43 45 0 62 64 66 '
'd sst1'
'F:\dqsxk\dqyc\shixi5\copy5\copy\map\cbarn.gs'
'set gxout contour'
'd sst1'
'printim F:\dqsxk\dqyc\shixi6\6\data\sst1.png white'
;
附图
|
-
|