- 积分
- 296
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-5-28
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 lqouc 于 2014-7-22 13:17 编辑
C THIS IS A PROGRAM FOR DETECTING ABRUPT CLIMATIC CHANGE
C BY USING MOVING t-TEST TECHNIQUE
PROGRAM MTT
DIMENSION Y(1000),YN1(1000),YN2(1000),YC1(1000),YC2(1000),
& S(1000),T(1000),NY1(1000),NY2(1000),NNY1(1000),NNY2(1000)
WRITE(*,10)
10 FORMAT(5X,'N=70,IH=5,NYEAR=1930')
READ(*,*)N,IH,NYEAR
C **************************************************
C * N: SAMPLE SIZE *
C * IH: LENGTH OF SUB-SERIES *
C * NYEAR: FIRST YEAR OF THE TIME SERIES *
C * Y(N): ORIGINAL TIME SERIES *
C * ************************************************
OPEN(2,FILE='d:\2.DAT')
READ(2,*)(Y(I),I=1,N)
N1=N-IH+1
N2=N-2*IH+1
C1=0.0
C2=0.0
DO 20 I=1,IH
20 C1=C1+Y(I)
DO 30 I=IH+1,2*IH
30 C2=C2+Y(I)
DO 40 I=1,N-IH
D1=C1-Y(I)+Y(I+IH)
YN1(I)=C1/IH
40 C1=D1
DO 50 I=IH+1,N-IH
D2=C2-Y(I)+Y(I+IH)
YN2(I-IH)=C2/IH
50 C2=D2
YN1(N1)=C1/IH
YN2(N2)=C2/IH
DO 60 I=1,N1
YC1(I)=0.0
DO 70 J=I,IH+I-1
70 YC1(I)=YC1(I)+(Y(J)-YN1(I))*(Y(J)-YN1(I))
60 CONTINUE
DO 80 I=1,N2
YC2(I)=0.0
DO 90 J=IH+I,2*IH+I-1
90 YC2(I)=YC2(I)+(Y(J)-YN2(I))*(Y(J)-YN2(I))
80 CONTINUE
DO 100 I=1,N2
100 S(I)=SQRT((YC1(I)+YC2(I))/(IH+IH-2))
DO 110 I=1,N2
110 T(I)=(YN1(I)-YN2(I))/(S(I)*SQRT(2.0/IH))
DO 120 I=1,N2
NY1(I)=NYEAR+I-1
NNY1(I)=NY1(I)+IH-1
NY2(I)=NYEAR+I+IH-1
120 NNY2(I)=NY2(I)+IH-1
IF(IH.EQ.5)THEN
A=4.0
B=-4.0
ELSE IF(IH.EQ.10)THEN
A=3.2
B=-3.2
ELSE
A=3.0
B=-3.0
END IF
OPEN(3,FILE='d:\3.DAT',STATUS='NEW')
WRITE(3,130)
130 FORMAT(30X,'ABRUPT CLIMATIC CHANGE ANALYSIS'/)
WRITE(3,140)
140 FORMAT(25X,'TM',4X,'t-TEST(0.01)'/)
DO 150 I=1,N2
WRITE(3,160)NY1(I),NNY1(I),NY2(I),NNY2(I),T(I),A,B
160 FORMAT(1X,I4,'-',I4,'--',I4,'-',I4,1X,3F8.2)
150 CONTINUE
OPEN(4,FILE='d:\4.DAT',STATUS='NEW')
DO 170 I=1,N2
WRITE(4,180)NNY1(I),T(I),A,B
180 FORMAT(1X,I4,3F8.2)
170 CONTINUE
STOP
END
我想求的是,1960-2013,气温序列,N=54,IH=5,
数据是,2.txt,希望得到的是,mtt.txt
大一新生,网上看到t检验的f程序,求各位大侠,哪些地方需要改动的,帮忙指出来,
OPEN(3,FILE='d:\3.DAT',STATUS='NEW')这个意思不明白,不是就一个读入的数据文件2.txt吗
谢谢
|
|