IMPLICIT NONE integer i_mon,i_day,i_year,i_hour,i_min integer i_hour_d,i_min_d,i_year_d,i_day_d,i_mon_d integer num_hour_day,time_advance,time_inc integer i_time,n_times parameter (n_times=28) parameter (i_year=2017) parameter (i_mon=09) parameter (i_day=05) parameter (i_hour=12) parameter (time_inc=360) parameter (num_hour_day=24) parameter (time_advance=00) integer mon_days(12) data mon_days /31,28,31,30,31,30,31,31,30,31,30,31/ open(84,file='gfs_time.file') ! note, we start our GEFS forecasts 12 hours after the initial time, so ! we only want to write times GE than this. ! This is the third time step, hard coded here. i_year_d = i_year i_day_d=i_day i_mon_d=i_mon i_hour_d=i_hour+time_advance i_min_d = -time_inc do i_time=0,n_times i_min_d=i_min_d+time_inc if (i_min_d.eq.time_inc)then i_hour_d=i_hour_d+time_inc/60 i_min_d=0 end if if (i_hour_d.eq.num_hour_day)then i_day_d=i_day_d+1 i_hour_d=0 end if if (i_day_d.gt.mon_days(i_mon))then i_day_d=1 i_mon_d=i_mon_d+1 end if if (i_mon_d.gt.12)then i_mon_d=1 i_year_d=i_year_d+1 end if if (i_time.ge.2)then 104 format(' ',i4,', ',i2,', ',i2,', ',i2,', ',i2,', ') ! write(84,103) year(k),month(k),day(k),hour(k),minute(k) write(84,103) i_year_d,i_mon_d,i_day_d,i_hour_d,i_min_d end if end do 103 format(' ',i4,', ',i2,', ',i2,', ',i2,', ',i2,' ,') stop end