29 integer date1(7), date2(7), date3(7), iargc, day, month, year
30 character*40 string, filename
31 character*40 date, time
33 character*132 wid2line
34 real sffu_seconds, seconds
45 call head(
'time_libversion')
48 call head(
'time_isleapyear')
56 call head(
'time_fullyear')
59 print *,
'year 0: ',year
62 print *,
'year 15: ',year
65 print *,
'year 97: ',year
68 print *,
'year 70: ',year
71 print *,
'year 100: ',year
74 print *,
'year 69: ',year
77 print *,
'year 99: ',year
80 print *,
'year 1831: ',year
83 print *,
'year 2061: ',year
86 print *,
'full year: ',string
90 print *,
'full year 50: ',string
92 call head(
'time_sprint (time_getdate is implicit)')
102 print *,
'date: ',string
105 print *,
'other year: ',string
108 print *,
'last doy (set by doy): ',string
112 print *,
'relative time value: ',string
114 call head(
'time_setdoy')
124 print *,
'jan first: ',string
127 print *,
'dec last: ',string
129 call head(
'time_clear')
133 print *,
'after clear: ',string
135 call head(
'time_norm')
147 print *,
'after norm: ',string
159 print *,
'after norm: ',string
171 print *,
'after norm: ',string
183 print *,
'after norm: ',string
185 call head(
'time_getdate after time_clear')
189 print *,
'date after time_clear ',day,month
191 call head(
'time_add and time_sub')
200 call subhead(
'absolute & absolute')
215 call subhead(
'absolute & relative')
226 call subhead(
'relative & relative')
244 call head(
'time_copy')
254 print *,
'date1: ',string
256 print *,
'date2 after clear: ',string
259 print *,
'date2 after copy: ',string
261 call head(
'time_finish')
273 call head(
'time_compare')
292 call head(
'time_mul and time_div and time_nfit')
308 if (iargc().eq.1)
then 309 call head(
'sffu_timesrce and sffu_timewid2 and sffu_setwid2time')
310 call getarg(1, filename)
311 print *,
'evaluate sff file ',filename
312 open(10, file=filename, status=
'old', err=99)
313 1
read(10,
'(a200)', end=2, err=98) line
314 if (line(1:5).eq.
'SRCE ')
then 315 print *,
'found SRCE line:' 317 date(1:6)=line(75:80)
318 time(1:10)=line(82:91)
319 call sffu_timesrce(date, time, date1)
321 print *,
'SRCE time: ',string
322 elseif (line(1:5).eq.
'WID2 ')
then 323 write(wid2line,
'(a132)') line(1:132)
324 call sffu_timewid2(wid2line, date1)
326 print *,
'WID2 time: ',string
330 print *,
'closed file' 339 print *,
'set WID2 to ',string
341 call sffu_setwid2time(wid2line, date1)
346 print *,
'set WID2 to ',string
348 call sffu_setwid2time(wid2line, date1)
358 print *,
'time span from ',string
359 seconds=sffu_seconds(date3)
360 print *,
'to first sample is ',seconds,
' seconds:' 368 99 stop
'ERROR: opening file' 369 98 stop
'ERROR: reading from file' 375 integer date1(8), date2(8), date3(8), date4(8)
378 print *,
'*** date1: ',string
380 print *,
' date2: ',string
383 print *,
' date1-date2=date3: ',string
386 print *,
' date3+date2=date4: ',string
391 subroutine head(routine)
392 character routine*(*)
394 print *,
'TEST ',routine
407 subroutine arout(date)
410 print 50,(date(i), i=1,7)
411 50
format(
'date-array: ',7(i6,1x))
415 subroutine cmptest(date1, date2)
416 integer date1(7), date2(7)
417 character*34 string1, string2
418 integer time_compare, val
421 val=time_compare(date1, date2)
423 print *,string1,
'> ',string2
424 else if (val.lt.0)
then 425 print *,string1,
'< ',string2
427 print *,string1,
'= ',string2
429 val=time_compare(date2, date1)
431 print *,string2,
'> ',string1
432 else if (val.lt.0)
then 433 print *,string2,
'< ',string1
435 print *,string2,
'= ',string1
441 integer date1(7), date2(7), n, nfit
442 integer date3(7), date4(7), rest, full(7)
443 character*40 string1, string3, string4, stringf
448 print *,string1,
' * ',n,
' -> ',string3
451 print *,
'fitting: ',nfit,
' to ',string3,
' leads to ',stringf
452 call time_div(date3, date4, n, rest)
454 print *,string3,
' / ',n,
' -> ',string4,
' rest ', rest
456 call time_div(date4, date3, n, rest)
459 print *,string4,
' / ',n,
' -> ',string3,
' rest ', rest
462 print *,
'fitting: ',nfit,
' to ',string4,
' leads to ',stringf
467 print *,
'fitting: ',nfit,
' to ',string3,
' leads to ',stringf
473 logical time_isleapyear
474 if (time_isleapyear(year))
then 480 50
format(
'year ',i4,
' is a leap year')
481 51
format(
'year ',i4,
' is no leap year')
491 integer date1(7), date2(7), date3(7)
void time_div(time_Ts Date1, time_Ts *Pdate2, timeint n, timeint *rest)
char * time_sprint(time_Ts Date)
subroutine time_util_warning_report_time(caller, date)
void divmultest(time_Ts date1, long int n, time_Ts date2)
void time_add(time_Ts Date1, time_Ts Date2, time_Ts *Pdate3)
void subhead(char *routine)
void time_getdate(timeint *day, timeint *month, time_Ts Date)
subroutine testleap(year)
void subaddtest(time_Ts date1, time_Ts date2)
void time_setdoy(timeint day, timeint month, time_Ts *Pdate)
void time_clear(time_Ts *Pdate)
void time_copy(time_Ts Date1, time_Ts *Pdate2)
void time_norm(time_Ts *Pdate)
void time_fullyear(timeint *year)
void time_sub(time_Ts Date1, time_Ts Date2, time_Ts *Pdate3)
void time_nfit(time_Ts Date1, time_Ts Date2, timeint *n, time_Ts *Pfull)
void time_mul(time_Ts Date1, time_Ts *Pdate2, integer n)
void time_finish(time_Ts *Pdate)
void cmptest(time_Ts date1, time_Ts date2)