1 声明部分
implicit none
real :: read_null
# 用于读取时跳过输入文件中不需要的列
integer :: leap_year
# 用于判断是否为闰年。 0是平年;1是闰年
integer,allocatable :: year(:), month(:), day(:), hour(:)
# 时间间隔为1小时debug
2 输出时间格式生成
# 输出的时间格式生成,起始时段为净雨量文件中的起始时段
allocate(year(size(Q)),month(size(Q)),day(size(Q)),hour(size(Q))) ! 数组长度等于径流的长度
! 读取初始时间
filename = trim(Address)//'\'//'data_rs.txt'
open(10,file=filename,access='sequential',status='old')
read(10,*) year(1),month(1),day(1),hour(1)
close(10)
do t=2,size(Q)
leap_year = 0
! 一般情况下,“小时”+1,而“日,月,年”不变,把它们放在后边处理
hour(t) = hour(t-1)+1