- 积分
- 40
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-10-16
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
- program tiqu
- integer,parameter::m=52,day=22647,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:2012)
- integer a(1951:2012)
- integer i,yrn
- !!!!!!读入站点名!!!!!!
- open(10,file='f:\fortran\shuju\52sta.txt')
- read(10,*) (id(i),i=1,m)
- do i=1,m
- j=1
- !print *,id(i)
- !!!!!!读入51-13年数据!!!!!!
- 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),temp,tmax,tmin,rain(i,j)
- ! print *, id(i),year(i,j),mon(i,j),dy(i,j),rain(i,j)
- j=j+1
- if(.not.eof(33)) goto 100
- write(33,*)
- close(33)
- enddo
- !!!!!!提取3-5月降水!!!!!!
- do i=1,m
- open(44,file='f:\fortran\shuju\51-13\'//id(i)//'.txt')
- !open(55,file='f:\fortran\shuju\chunji\'//id(i)//'.txt')
- do j=1,day
- if(mon(i,j).ge.6.and.mon(i,j).le.8) 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
- ! print *, id(i),year(i,j),mon(i,j),dy(i,j),rain(i,j)
- write(44,*) id(i),year(i,j),mon(i,j),dy(i,j),rain(i,j) !按台站存放!
- endif
- enddo
- close(44)
- !close(55)
- enddo
- !print *,'ok'
- !!!!!!按年存放!!!!!!
- 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)
- ! print *,id(i),year1(i,j),mon1(i,j),dy1(i,j),rain1(i,j)
- enddo
- print *,id(i),year1(i,j),mon1(i,j),dy1(i,j),rain1(i,j)
- enddo
- print *,'ok'
- j=1
- do yrn=1951,2012
- rainyr(yrn)=0.0
- write(yrc,'(i4)') yrn
- open(200,file='f:\fortran\shuju\yearly\'//yrc//'.txt')
- jj=j
- do i=1,m
- j=jj
- 400 if(year1(i,j)==yrn) then
- !print *,id(i),year1(i,j),mon1(i,j),dy1(i,j),rain1(i,j)
- 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
- enddo
- open(200,file='f:\fortran\shuju\yr_ave.txt')
- write(200,*) (rainyr(i),i=1951,2012)
- end
复制代码
运行出来如下图
求大神告知问题出在那里了!!!!
|
-
|