- 积分
- 40
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-10-16
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
program tiqu
integer,parameter::m=54,day=22646,yr=62,dd=92*62,yrd=92
character*5 id(m)
character*4 yrc
integer year(m,day),mon(m,day),dy(m,day),temp,tmax,tmin,rain(m,day)
integer year1(m,dd),mon1(m,dd),dy1(m,dd),rain1(m,dd)
real rainyr(1951:2013)
integer a(1951:2013)
integer i,yrn
!!!!!!读入站点名!!!!!!
open(10,file='f:\fortran\shuju\54sta.txt')
read(10,*) (id(i),i=1,m)
do i=1,m
j=1
!!!!!!读入51-12年数据!!!!!!
open(33,file='f:\fortran\shuju\51-13\'//id(i)//'.txt')
100 read(33,*) id(i),year(i,j),mon(i,j),dy(i,j),rain(i,j)
j=j+1
if(.not.eof(33)) goto 100
enddo
!!!!!!提取3-5月降水!!!!!!
do i=1,m
open(44,file='f:\fortran\shuju\51-13\'//id(i)//'.txt')
do j=1,day
if(mon(i,j).ge.4.and.mon(i,j).le.6) then
if(rain(i,j)>=30000) then
rain(i,j)=0.0
end if
if(rain(i,j)==-32744.or.rain(i,j)==32744.or.rain(i,j)==32766.or.rain(i,j)==-32766) then
rain(i,j)=0.0
end if
write(44,*) id(i),year(i,j),mon(i,j),dy(i,j),rain(i,j) !按台站存放!
endif
enddo
close(44)
enddo
!!!!!!按年存放!!!!!!
do i=1,m
open(100,file='f:\fortran\shuju\51-13\'//id(i)//'.txt')
do j=1,day
read(100,*) id(i),year1(i,j),mon1(i,j),dy1(i,j),rain1(i,j)
enddo
enddo
j=1
do yrn=1961,2012
rainyr(yrn)=0.0
write(yrc,'(i4)') yrn
open(200,file='f:\fortran\753shuju\753\yearly\'//yrc//'.txt')
jj=j
do i=1,m
j=jj
400 if(year1(i,j)==yrn) then
write(200,*) id(i),year1(i,j),mon1(i,j),dy1(i,j),rain1(i,j)
rainyr(yrn)=rainyr(yrn)+rain1(i,j)
j=j+1
if(j<=day) goto 400
endif
enddo
rainyr(yrn)=rainyr(yrn)/54.0/10.0
enddo
open(200,file='f:\fortran\shuju\yr_ave.txt')
write(200,*) (rainyr(i),i=1951,2012)
end
每次运行后都出现这个
数据格式是这样的
51053 1978 4 30 163 226 108 0
51053 1978 5 1 153 235 70 0
51053 1978 5 2 146 222 85 32700
51053 1978 5 3 162 250 70 0
51053 1978 5 4 135 244 73 5
51053 1978 5 5 104 162 52 0
51053 1978 5 6 115 185 55 0
51053 1978 5 7 132 206 50 0
51053 1978 5 8 156 228 46 0
51053 1978 5 9 190 254 87 0
51053 1978 5 10 170 251 83 0
51053 1978 5 11 154 234 60 0
51053 1978 5 12 149 226 85 0
求大神们帮帮忙啊!!!
|
-
|