- 积分
- 4493
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-4-2
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2015-7-10 19:55:14
|
显示全部楼层
program data_extraction
implicit none
character *4 nian
integer,parameter::yr1=1951,yr2=2013
integer station,p1,p2,p3,year,num,i,nline,j
open(2,file='E:\SURF_CLI_CHN-WEP-SNOW\datasets\SNOW\YER\SURF_CLI_CHN_YER-SNOWMAX-54401.TXT')
do i=yr1,yr2
write(nian,'(i4)') i
open(1,file='E:\SURF_CLI_CHN-WEP-SNOW\datasets\SNOW\YER\SURF_CLI_CHN_YER-SNOWMAX-'//nian//'.TXT')
nline=0
do while(.true.)
read(1,*,end=999)
nline=nline+1
end do
999 rewind(1)
do j=1,nline
read(1,*) station,p1,p2,p3,year,num
do while(station==54401)
write(2,*) station,p1,p2,p3,year,num
write(*,*) station,p1,p2,p3,year,num
end do
end do
end do
close(1)
close(2)
end
这是完整的,帮忙看看 |
|