- 积分
- 1819
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-8-24
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2014-4-29 04:22:26
|
显示全部楼层
自己搞定了,跟帖子中提出的建议一样,自己建立一个完整的时间序列然后循环读取并对比。我也发现为什么我总是做不到自己想要的结果,就是我缺失的数据中并不是规范的缺失固定时间点,比如如果整体缺失以3h记,那么一天的时间只能是2000010100,03,06,09,12,15,18,21共计8个时次,而我缺失的固定时间中居然还有01,02这样的时刻,我真是对我国气象数据的可用性感到担忧。。。。
贡献代码:
a.txt就是缺失的数据格式,b就是完整的时间序列,c.txt就是最后补充完整的序列
思路如此,仅供参考
program main
!!====================================================
integer date1,date2,i,j,k,m,n,ii,jj,kk,mm,nn
open(300,file="d:\c.txt")
open(100,file="d:\a.txt")
open(200,file="d:\b.txt")
do while (.not.eof(100))
read(100,*) date1
read(200,*) date2
if (date1==date2) then
write(300,*) date1
else
write(300,*) date2
do while (date1/=date2)
read(200,*) date2
if (date1==date2) then
write(300,*) date1
else
write(300,*) date2
endif
enddo
endif
enddo
close(100)
close(200)
close(300)
end |
评分
-
参与人数 1 | 金钱 +15 |
贡献 +3 |
收起
理由
|
言深深
| + 15 |
+ 3 |
看得出来,这也是思考的结果!赞·· |
查看全部评分
|