爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 2836|回复: 3

[求助] FORTRAN计算本站四季时间,在线等

[复制链接]

新浪微博达人勋

发表于 2015-2-12 15:28:33 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
program yjj
integer dat(22645)
real tmp(22645)
open(10,file='yjj.txt')
do i=1,22645
read(10,*) dat(i),tmp(i)
print*,dat(i),tmp(i)
enddo
open(11,file='yjj-spring.txt')
open(12,file='yjj-summer.txt')
open(13,file='yjj-autumn.txt')
open(14,file='yjj-winter.txt')

do i=2,22645
if(tmp(i-1)<=10.0 .and. tmp(i)>10.0 .and. tmp(i+1)>10.0 .and. (tmp(i+1)+tmp(i+2)+tmp(i+3)+tmp(i+4)+tmp(i+5))>50.0 .and. tmp(i+2)>10.0 .and. (tmp(i+2)+tmp(i+3)+tmp(i+4)+tmp(i+5)+tmp(i+6))>50.0 .and. tmp(i+3)>10.0 .and. (tmp(i+3)+tmp(i+4)+tmp(i+5)+tmp(i+6)+tmp(i+7))>50.0 .and. tmp(i+4)>10.0 .and. (tmp(i+4)+tmp(i+5)+tmp(i+6)+tmp(i+7)+tmp(i+8))>50.0) then
write(11,*) dat(i)
endif
enddo

do i=2,22645
if(tmp(i-1)<=22.0 .and. tmp(i)>22.0 .and. tmp(i+1)>22.0 .and. (tmp(i+1)+tmp(i+2)+tmp(i+3)+tmp(i+4)+tmp(i+5))>110.0 .and. tmp(i+2)>22.0 .and. (tmp(i+2)+tmp(i+3)+tmp(i+4)+tmp(i+5)+tmp(i+6))>110.0 .and. tmp(i+3)>22.0 .and. (tmp(i+3)+tmp(i+4)+tmp(i+5)+tmp(i+6)+tmp(i+7))>110.0 .and. tmp(i+4)>22.0 .and. (tmp(i+4)+tmp(i+5)+tmp(i+6)+tmp(i+7)+tmp(i+8))>110.0) then
write(12,*) dat(i)
endif
enddo

do i=2,22645
if(tmp(i-1)>=22.0 .and. tmp(i)<22.0 .and. tmp(i+1)<22.0 .and. (tmp(i+1)+tmp(i+2)+tmp(i+3)+tmp(i+4)+tmp(i+5))<110.0 .and. tmp(i+2)<22.0 .and. (tmp(i+2)+tmp(i+3)+tmp(i+4)+tmp(i+5)+tmp(i+6))<110.0 .and. tmp(i+3)<22.0 .and. (tmp(i+3)+tmp(i+4)+tmp(i+5)+tmp(i+6)+tmp(i+7))<110.0 .and. tmp(i+4)<22.0 .and. (tmp(i+4)+tmp(i+5)+tmp(i+6)+tmp(i+7)+tmp(i+8))<110.0) then
write(13,*) dat(i)
endif
enddo

do i=2,22645
if(tmp(i-1)>=10.0 .and. tmp(i)<10.0 .and. tmp(i+1)<10.0 .and. (tmp(i+1)+tmp(i+2)+tmp(i+3)+tmp(i+4)+tmp(i+5))<50.0 .and. tmp(i+2)<10.0 .and. (tmp(i+2)+tmp(i+3)+tmp(i+4)+tmp(i+5)+tmp(i+6))<50.0 .and. tmp(i+3)<10.0 .and. (tmp(i+3)+tmp(i+4)+tmp(i+5)+tmp(i+6)+tmp(i+7))<50.0 .and. tmp(i+4)<10.0 .and. (tmp(i+4)+tmp(i+5)+tmp(i+6)+tmp(i+7)+tmp(i+8))<50.0) then
write(14,*) dat(i)
endif
enddo

end
有没有大神帮忙修改下?顺便算下,最好能够自动筛选取每年符合要求的第一个,应该怎么加进去?
以入春为例:连续5天平均气温大于10度,且这5天,每天与之后的4天平均气温大于10度。


yjj.txt

643.06 KB, 下载次数: 9, 下载积分: 金钱 -5

日平均气温资料

yjjxin.f90

1.89 KB, 下载次数: 5, 下载积分: 金钱 -5

程序改

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-2-13 03:55:37 来自手机 | 显示全部楼层
学习了,等待结果
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-2-13 08:09:28 | 显示全部楼层
有点麻烦吧
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-2-13 18:17:33 | 显示全部楼层
先算好 5 天平均好。。。

你那个 .and. 是 fortran 吗?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表