gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dcdatetimelt.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

logical function dcdatetime_lt_tt (time1, time2)
 Functions for user defined operation (<).
logical function dcdatetime_lt_ff (diff1, diff2)
logical function dcdatetime_lt_fi (diff, factor)
logical function dcdatetime_lt_if (factor, diff)

Function/Subroutine Documentation

◆ dcdatetime_lt_ff()

logical function dcdatetime_lt_ff ( type(dc_difftime), intent(in) diff1,
type(dc_difftime), intent(in) diff2 )

Compare two DC_DIFFTIME variables (<)

Compare two time difference values. Returns .true. if the time difference stored in the second argument is greater than the time difference stored in the first argument.

Parameters
[in]diff1First time difference to compare
[in]diff2Second time difference to compare
Returns
.true. if diff1 < diff2, .false. otherwise

Definition at line 98 of file dcdatetimelt.f90.

99
100 use dc_date_generic, only: evalsec
102 use dc_scaledsec, only: &
103 & operator(<), operator(>), operator(<=), operator(>=), operator(==)
104 implicit none
105 type(DC_DIFFTIME), intent(in):: diff1, diff2
106continue
107 if ( diff1 % day_seconds == diff2 % day_seconds ) then
108
109 if ( diff1 % mon < diff2 % mon ) then
110 result = .true. ; return
111 elseif ( diff1 % mon > diff2 % mon ) then
112 result = .false. ; return
113 end if
114 if ( diff1 % day < diff2 % day ) then
115 result = .true. ; return
116 elseif ( diff1 % day > diff2 % day ) then
117 result = .false. ; return
118 end if
119 if ( diff1 % sec < diff2 % sec ) then
120 result = .true. ; return
121 elseif ( diff1 % sec > diff2 % sec ) then
122 result = .false. ; return
123 end if
124 result = .false.
125 else
126
127 if (evalsec(diff1) < evalsec(diff2)) then
128 result = .true.
129 else
130 result = .false.
131 end if
132 end if
133
Interface declarations for procedures provided from dc_date.
Derived types and parameters for date and time.
Scaled seconds module for precise time operations.

◆ dcdatetime_lt_fi()

logical function dcdatetime_lt_fi ( type(dc_difftime), intent(in) diff,
integer, intent(in) factor )

Compare DC_DIFFTIME with integer (<)

Compare a time difference value with an integer. Returns .true. if the time difference stored in the first argument is less than the integer stored in the second argument.

Parameters
[in]diffTime difference to compare
[in]factorInteger value to compare
Returns
.true. if diff < factor, .false. otherwise

Definition at line 159 of file dcdatetimelt.f90.

160
161 use dc_date_generic, only: evalsec
163 implicit none
164 type(DC_DIFFTIME), intent(in):: diff
165 integer, intent(in):: factor
166continue
167 result = evalsec(diff) < factor

◆ dcdatetime_lt_if()

logical function dcdatetime_lt_if ( integer, intent(in) factor,
type(dc_difftime), intent(in) diff )

Compare integer with DC_DIFFTIME (<)

Compare an integer with a time difference value. Returns .true. if the integer stored in the first argument is less than the time difference stored in the second argument.

Parameters
[in]factorInteger value to compare
[in]diffTime difference to compare
Returns
.true. if factor < diff, .false. otherwise

Definition at line 193 of file dcdatetimelt.f90.

194
195 use dc_date_generic, only: evalsec
197 implicit none
198 integer, intent(in):: factor
199 type(DC_DIFFTIME), intent(in):: diff
200continue
201 result = factor < evalsec(diff)

◆ dcdatetime_lt_tt()

logical function dcdatetime_lt_tt ( type(dc_datetime), intent(in) time1,
type(dc_datetime), intent(in) time2 )

Functions for user defined operation (<).

Author
Yasuhiro MORIKAWA

This file contains implementation procedures of less-than comparison for dc_date_types#DC_DATETIME and dc_date_types#DC_DIFFTIME.

Compare two DC_DATETIME variables (<)

Compare two datetime values. Returns .true. if the datetime stored in the second argument is later than the datetime stored in the first argument.

Parameters
[in]time1First datetime to compare
[in]time2Second datetime to compare
Returns
.true. if time1 < time2, .false. otherwise

Definition at line 47 of file dcdatetimelt.f90.

48
51 use dc_scaledsec, only: dc_scaled_sec, &
52 & operator(==), operator(<), operator(>), operator(<=), operator(>=), &
53 & operator(+)
54 implicit none
55 type(DC_DATETIME), intent(in):: time1, time2
56 type(DC_SCALED_SEC):: year1, year2, time1_sec, time2_sec
57continue
58 call eval(time1, sclyear=year1)
59 call eval(time2, sclyear=year2)
60 if (year1 < year2) then
61 result = .true.
62 elseif (year1 > year2) then
63 result = .false.
64 else
65 time1_sec = evalsclsec(time1) + evalsclsec(zonetodiff(time1 % zone))
66 time2_sec = evalsclsec(time2) + evalsclsec(zonetodiff(time2 % zone))
67 if (time1_sec < time2_sec) then
68 result = .true.
69 else
70 result = .false.
71 end if
72 end if