Loading...
Searching...
No Matches
Functions/Subroutines
dcdatetimeeval.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine dcdatetimeeval1 (time, year, mon, day, hour, min, sec, caltype, zone, sclyear, sclmon, sclday, sclsec)
 
subroutine dcdifftimeeval1 (diff, year, mon, day, hour, min, sec, nondim, sclyear, sclmon, sclday, sclsec, sclnondim, err)
 
real(dp) function dcdatetimeevalday (time)
 
real(dp) function dcdifftimeevalday (diff)
 
real(dp) function dcdatetimeevalhour (time)
 
real(dp) function dcdifftimeevalhour (diff)
 
real(dp) function dcdatetimeevalmin (time)
 
real(dp) function dcdifftimeevalmin (diff)
 
real(dp) function dcdatetimeevalsec (time)
 
real(dp) function dcdifftimeevalsec (diff)
 
real(dp) function dcdifftimeevalnondim (diff)
 
type(dc_scaled_sec) function dcdatetimeevalsclsec (time)
 
type(dc_scaled_sec) function dcdifftimeevalsclsec (diff)
 
real(dp) function dcdatetimeevalbyunit (time, unit, unit_symbol)
 
real(dp) function dcdifftimeevalbyunit (diff, unit, unit_symbol)
 

Function/Subroutine Documentation

◆ dcdatetimeeval1()

subroutine dcdatetimeeval1 ( type(dc_datetime), intent(in)  time,
integer, intent(out), optional  year,
integer, intent(out), optional  mon,
integer, intent(out), optional  day,
integer, intent(out), optional  hour,
integer, intent(out), optional  min,
real(dp), intent(out), optional  sec,
integer, intent(out), optional  caltype,
character(*), intent(out), optional  zone,
type(dc_scaled_sec), intent(out), optional  sclyear,
type(dc_scaled_sec), intent(out), optional  sclmon,
type(dc_scaled_sec), intent(out), optional  sclday,
type(dc_scaled_sec), intent(out), optional  sclsec 
)

Definition at line 12 of file dcdatetimeeval.f90.

14 !
15 ! dc_date_types#DC_DATETIME 型変数 *time* を
16 ! 年 *year*, 月 *mon*, 日 *day*, 時間 *hour*, 分 *min*, 秒 *sec*,
17 ! 暦法 *caltype*, タイムゾーン *zone* に変換して返します.
18 !
19 use dc_types, only: dp
20 use dc_date_types, only: dc_datetime, &
24 use dc_scaledsec, only: dc_scaled_sec, &
25 & assignment(=), dcscaledsecputline, &
26 & operator(==), operator(>), operator(<), operator(>=), operator(<=), &
27 & operator(+), operator(-), operator(*), operator(/), mod, modulo, &
28 & abs, int, floor, ceiling
29 use dc_trace, only: beginsub, endsub
30 implicit none
31 type(DC_DATETIME), intent(in):: time
32 integer, intent(out), optional:: year ! 年
33 integer, intent(out), optional:: mon ! 月
34 integer, intent(out), optional:: day ! 日
35 integer, intent(out), optional:: hour ! 時
36 integer, intent(out), optional:: min ! 分
37 real(DP),intent(out), optional:: sec ! 秒
38 integer, intent(out), optional:: caltype ! 暦法
39 character(*), intent(out), optional:: zone ! タイムゾーン (UTC からの時差)
40 type(DC_SCALED_SEC), intent(out), optional:: sclyear ! 年 (DC_SCALED_SEC 型)
41 type(DC_SCALED_SEC), intent(out), optional:: sclmon ! 月 (DC_SCALED_SEC 型)
42 type(DC_SCALED_SEC), intent(out), optional:: sclday ! 日 (DC_SCALED_SEC 型)
43 type(DC_SCALED_SEC), intent(out), optional:: sclsec ! 秒 (DC_SCALED_SEC 型)
44
45 type(DC_SCALED_SEC):: iyear, month, iday, imon, isec
46 !character(*), parameter :: subname = 'DCDateTimeEval1'
47continue
48 !call BeginSub(subname)
49 if (present(zone)) then
50 zone = time % zone
51 end if
52 if (present(caltype)) then
53 caltype = time % caltype
54 end if
55 isec = time % sec
56 if (present(hour)) then
57 hour = floor(isec / hour_seconds)
58 isec = modulo(isec, hour_seconds)
59 end if
60 if (present(min)) then
61 min = floor(isec / min_seconds)
62 isec = modulo(isec, min_seconds)
63 end if
64 if (present(sec)) then
65 sec = isec
66 end if
67 if (present(sclsec)) then
68 sclsec = isec
69 end if
70
71 if (time % caltype == cal_cyclic) then
72 iday = time % day
73 if (present(year)) year = 0
74 if (present(sclyear)) sclyear = 0
75 if (present(sclmon)) then
76 sclmon = floor(iday / cyclic_mdays)
77 iday = ceiling( modulo(iday, cyclic_mdays) )
78 elseif (present(mon)) then
79 mon = floor(iday / cyclic_mdays)
80 iday = ceiling( modulo(iday, cyclic_mdays) )
81 end if
82 if (present(day)) day = iday
83 if (present(sclday)) sclday = iday
84 goto 999
85 endif
86 if (time % caltype == cal_noleap) then
87 iday = int( modulo(time%day - 91, year_days) )
88 iyear = int( (time%day - 91 - iday) / year_days )
89 else
90 if (time % caltype == cal_julian .or. time%day < 640196) then
91 iday = int( modulo(time%day - 92, four_years) )
92 iyear = int( (time%day - 92 - iday) / four_years ) * 4
93 else
94 iday = int( modulo(time%day - 94, four_century) )
95 iyear = int( (time%day - 94 - iday) / four_century ) * 400
96 if (iday == four_century - 1) then
97 iyear = iyear + 300
98 iday = 36525
99 else
100 iyear = iyear + int( iday / 36524 ) * 100
101 iday = int( modulo(iday, 36524) )
102 endif
103 iyear = iyear + int( iday / four_years ) * 4
104 iday = int( modulo(iday, four_years) )
105 endif
106 if (iday == four_years - 1) then
107 iyear = iyear + 3
108 iday = year_days
109 else
110 iyear = iyear + int( iday / year_days )
111 iday = int( modulo(iday, year_days) )
112 endif
113 endif
114
115 iday = iday * 10 + 922
116 month = int( iday / 306 )
117
118 if (present(sclyear)) then
119 imon = mod(month - 1, year_months) + 1
120 sclyear = iyear + int( (month - imon) / year_months )
121 elseif (present(year)) then
122 imon = mod(month - 1, year_months) + 1
123 year = iyear + int( (month - imon) / year_months )
124 else
125 imon = month
126 end if
127 if (present(sclmon)) then
128 iday = int( mod(iday, 306) / 10 ) + 1
129 sclmon = imon
130 elseif (present(mon)) then
131 iday = int( mod(iday, 306) / 10 ) + 1
132 mon = imon
133 else
134 iday = int( iday / 10 ) + 1
135 end if
136
137 if (present(day)) day = iday
138 if (present(sclday)) sclday = iday
139
140999 continue
141 !call EndSub(subname)
integer, parameter, public cal_noleap
real(dp), parameter, public cyclic_mdays
integer, parameter, public hour_seconds
integer, parameter, public four_years
integer, parameter, public cal_cyclic
integer, save, public caltype
integer, parameter, public year_days
integer, parameter, public year_months
integer, parameter, public four_century
integer, parameter, public min_seconds
integer, parameter, public cal_julian
subroutine, public dcscaledsecputline(sclsec, unit, indent)
Provides kind type parameter values.
Definition dc_types.f90:49
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:83

References dc_date_types::cal_cyclic, dc_date_types::cal_julian, dc_date_types::cal_noleap, dc_date_types::cyclic_mdays, dc_scaledsec::dcscaledsecputline(), dc_types::dp, dc_date_types::four_century, dc_date_types::four_years, dc_date_types::hour_seconds, dc_date_types::min_seconds, dc_date_types::year_days, and dc_date_types::year_months.

Here is the call graph for this function:

◆ dcdatetimeevalbyunit()

real(dp) function dcdatetimeevalbyunit ( type(dc_datetime), intent(in)  time,
character(*), intent(in)  unit,
integer, intent(in), optional  unit_symbol 
)

Definition at line 499 of file dcdatetimeeval.f90.

500 !
501 ! dc_date_types#DC_DATETIME 型変数の日時を *unit* または
502 ! *unit_symbol* の単位
503 ! に換算して倍精度実数型変数で返します.
504 !
505 ! *unit* には
506 ! 日 dc_date_types#UNIT_DAY, 時 dc_date_types#UNIT_HOUR,
507 ! 分 dc_date_types#UNIT_MIN, 秒 dc_date_types#UNIT_SEC
508 ! を与えることが可能です.
509 !
510 ! *unit_symbol* には
511 ! 日 dc_date_types#UNIT_SYMBOL_DAY, 時 dc_date_types#UNIT_SYMBOL_HOUR,
512 ! 分 dc_date_types#UNIT_SYMBOL_MIN, 秒 dc_date_types#UNIT_SYMBOL_SEC
513 ! を与えることが可能です.
514 !
515 ! これらに該当しないものを *unit* または *unit_symbol*
516 ! に与えた場合, もしくは引数を両方とも与えない場合, 0.0 が返ります.
517 !
518 use dc_types, only: dp, token
520 use dc_date_types, only: dc_datetime, &
523 implicit none
524 real(DP):: result
525 type(DC_DATETIME), intent(in):: time
526 character(*), intent(in):: unit
527 integer, intent(in), optional:: unit_symbol
528 integer:: symbol
529continue
530 symbol = unit_symbol_err
531 if ( present(unit_symbol) ) then
532 symbol = unit_symbol
533 else
534 symbol = parsetimeunits(unit)
535 end if
536
537 if ( symbol == unit_symbol_sec ) then
538 result = evalsec(time)
539 elseif ( symbol == unit_symbol_min ) then
540 result = evalmin(time)
541 elseif ( symbol == unit_symbol_hour ) then
542 result = evalhour(time)
543 elseif ( symbol == unit_symbol_day ) then
544 result = evalday(time)
545 else
546 result = 0.0_dp
547 end if
integer, parameter, public unit_symbol_err
integer, parameter, public unit_symbol_hour
integer, parameter, public unit_symbol_min
integer, parameter, public unit_symbol_sec
integer, parameter, public unit_symbol_day
integer, parameter, public token
Character length for word, token
Definition dc_types.f90:109

References dc_types::dp, dc_types::token, dc_date_types::unit_symbol_day, dc_date_types::unit_symbol_err, dc_date_types::unit_symbol_hour, dc_date_types::unit_symbol_min, and dc_date_types::unit_symbol_sec.

◆ dcdatetimeevalday()

real(dp) function dcdatetimeevalday ( type(dc_datetime), intent(in)  time)

Definition at line 248 of file dcdatetimeeval.f90.

249 !
250 ! dc_date_types#DC_DATETIME 型変数の日時を日数に換算して
251 ! 倍精度実数型変数で返します. (例えば 12 時間は 0.5 日と換算されます).
252 !
253 use dc_types, only: dp
254 use dc_date_generic, only: eval
255 use dc_date_types, only: dc_datetime
256 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), operator(+)
257 implicit none
258 real(DP):: result
259 type(DC_DATETIME), intent(in):: time
260 type(DC_SCALED_SEC):: day, sec
261continue
262 call eval(time, sclday = day, sclsec = sec)
263 result = day + sec / time % day_seconds

References dc_types::dp.

◆ dcdatetimeevalhour()

real(dp) function dcdatetimeevalhour ( type(dc_datetime), intent(in)  time)

Definition at line 288 of file dcdatetimeeval.f90.

289 !
290 ! dc_date_types#DC_DATETIME 型変数の日時を時間に換算して
291 ! 倍精度実数型変数で返します.
292 ! (例えば 2 日は 48 時間に, 30 分 は 0.5 時間と換算されます).
293 !
294 use dc_types, only: dp
295 use dc_date_generic, only: eval
297 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
298 & operator(+), operator(*), int
299 implicit none
300 real(DP):: result
301 type(DC_DATETIME), intent(in):: time
302 type(DC_SCALED_SEC):: day, sec
303continue
304 call eval(time, sclday = day, sclsec = sec)
305 result = (day * time % day_seconds + sec) / hour_seconds

References dc_types::dp, and dc_date_types::hour_seconds.

◆ dcdatetimeevalmin()

real(dp) function dcdatetimeevalmin ( type(dc_datetime), intent(in)  time)

Definition at line 332 of file dcdatetimeeval.f90.

333 !
334 ! dc_date_types#DC_DATETIME 型変数の日時を分に換算して
335 ! 倍精度実数型変数で返します.
336 ! (例えば 1 日は 3600 分に, 30 秒 は 0.5 分と換算されます).
337 !
338 use dc_types, only: dp
339 use dc_date_generic, only: eval
341 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
342 & operator(+), operator(*), int
343 implicit none
344 real(DP):: result
345 type(DC_DATETIME), intent(in):: time
346 type(DC_SCALED_SEC):: day, sec
347continue
348 call eval(time, sclday = day, sclsec = sec)
349 result = (day * time % day_seconds + sec) / min_seconds

References dc_types::dp, and dc_date_types::min_seconds.

◆ dcdatetimeevalsclsec()

type(dc_scaled_sec) function dcdatetimeevalsclsec ( type(dc_datetime), intent(in)  time)

Definition at line 445 of file dcdatetimeeval.f90.

446 !
447 ! dc_date_types#DC_DATETIME 型変数の日時を秒に換算して
448 ! DC_SCALED_SEC 型で返します.
449 !
450 ! 年の要素は無視されます. すなわち, 1999-01-01 が格納された time と
451 ! 2007-01-01 が格納された time からは同じ値が返ります.
452 ! (これはもしかすると望ましく無い動作かもしれません).
453 !
454 use dc_types, only: dp
455 use dc_date_generic, only: eval
456 use dc_date_types, only: dc_datetime
457 use dc_scaledsec, only: dc_scaled_sec, operator(/), &
458 & operator(+), operator(*), int
459 implicit none
460 type(DC_SCALED_SEC):: result
461 type(DC_DATETIME), intent(in):: time
462 type(DC_SCALED_SEC):: day, sec
463continue
464 call eval(time, sclday = day, sclsec = sec)
465 result = day * time % day_seconds + sec

References dc_types::dp.

◆ dcdatetimeevalsec()

real(dp) function dcdatetimeevalsec ( type(dc_datetime), intent(in)  time)

Definition at line 376 of file dcdatetimeeval.f90.

377 !
378 ! dc_date_types#DC_DATETIME 型変数の日時を秒に換算して
379 ! 倍精度実数型変数で返します.
380 !
381 ! 年の要素は無視されます. すなわち, 1999-01-01 が格納された time と
382 ! 2007-01-01 が格納された time からは同じ値が返ります.
383 ! (これはもしかすると望ましく無い動作かもしれません).
384 !
385 use dc_types, only: dp
386 use dc_date_generic, only: eval
387 use dc_date_types, only: dc_datetime
388 use dc_scaledsec, only: assignment(=)
389 implicit none
390 real(DP):: result
391 type(DC_DATETIME), intent(in):: time
392 integer:: day
393 real(DP):: sec, day_seconds
394continue
395 call eval(time, day = day, sec = sec)
396 day_seconds = time % day_seconds
397 result = day * day_seconds + sec
real(dp), save, public day_seconds

References dc_date_types::day_seconds, and dc_types::dp.

◆ dcdifftimeeval1()

subroutine dcdifftimeeval1 ( type(dc_difftime), intent(in)  diff,
integer, intent(out), optional  year,
integer, intent(out), optional  mon,
integer, intent(out), optional  day,
integer, intent(out), optional  hour,
integer, intent(out), optional  min,
real(dp), intent(out), optional  sec,
real(dp), intent(out), optional  nondim,
type(dc_scaled_sec), intent(out), optional  sclyear,
type(dc_scaled_sec), intent(out), optional  sclmon,
type(dc_scaled_sec), intent(out), optional  sclday,
type(dc_scaled_sec), intent(out), optional  sclsec,
type(dc_scaled_sec), intent(out), optional  sclnondim,
logical, intent(out), optional  err 
)

Definition at line 145 of file dcdatetimeeval.f90.

148 !
149 ! dc_date_types#DC_DIFFTIME 型変数 *diff* を
150 ! 年 *year*, 月 *mon*, 日 *day*, 時間 *hour*, 分 *min*, 秒 *sec*,
151 ! 無次元時間 *nondim* に変換して返します.
152 !
153 use dc_types, only: dp
154 use dc_trace, only: beginsub, endsub
156 use dc_date_types, only: dc_difftime, &
158 use dc_scaledsec, only: dc_scaled_sec, &
159 & assignment(=), dcscaledsecputline, &
160 & operator(==), operator(>), operator(<), operator(>=), operator(<=), &
161 & operator(+), operator(-), operator(*), operator(/), mod, modulo, &
162 & abs, int, floor, ceiling
163 implicit none
164 type(DC_DIFFTIME), intent(in):: diff
165 integer, intent(out), optional:: year ! 年
166 integer, intent(out), optional:: mon ! 月
167 integer, intent(out), optional:: day ! 日
168 integer, intent(out), optional:: hour ! 時
169 integer, intent(out), optional:: min ! 分
170 real(DP),intent(out), optional:: sec ! 秒
171 real(DP),intent(out), optional:: nondim ! 無次元時間. Nondimensional time
172 type(DC_SCALED_SEC), intent(out), optional:: sclyear ! 年 (DC_SCALED_SEC 型)
173 type(DC_SCALED_SEC), intent(out), optional:: sclmon ! 月 (DC_SCALED_SEC 型)
174 type(DC_SCALED_SEC), intent(out), optional:: sclday ! 日 (DC_SCALED_SEC 型)
175 type(DC_SCALED_SEC), intent(out), optional:: sclsec ! 秒 (DC_SCALED_SEC 型)
176 type(DC_SCALED_SEC), intent(out), optional:: sclnondim ! 無次元時間 (DC_SCALED_SEC 型)
177 logical, intent(out), optional :: err
178 type(DC_SCALED_SEC):: imon, isec
179 integer:: stat
180 character(*), parameter :: subname = 'DCDiffTimeEval1'
181continue
182 !call BeginSub(subname)
183 stat = dc_noerr
184 if ( present(sclnondim) ) then
185 if ( .not. diff % nondim_flag ) then
186 stat = dc_edimtime
187 goto 999
188 end if
189 sclnondim = diff % sec
190 elseif ( present(nondim) ) then
191 if ( .not. diff % nondim_flag ) then
192 stat = dc_edimtime
193 goto 999
194 end if
195 nondim = diff % sec
196 else
197 if ( diff % nondim_flag ) then
198 stat = dc_enodimtime
199 goto 999
200 end if
201 end if
202
203 imon = diff % mon
204 isec = diff % sec
205 if (present(sclyear)) then
206 sclyear = int( imon / year_months )
207 imon = mod(imon, year_months)
208 elseif (present(year)) then
209 year = int( imon / year_months )
210 imon = mod(imon, year_months)
211 endif
212
213 if (present(sclmon)) then
214 sclmon = imon
215 elseif (present(mon)) then
216 mon = imon
217 endif
218
219 if (present(sclday)) then
220 sclday = diff % day
221 elseif (present(day)) then
222 day = diff % day
223 else
224 isec = isec + diff % day * diff % day_seconds
225 endif
226
227 if (present(hour)) then
228 hour = int(isec / hour_seconds)
229 isec = mod(isec, hour_seconds)
230 endif
231 if (present(min)) then
232 min = int(isec / min_seconds)
233 isec = mod(isec, min_seconds)
234 endif
235
236 if (present(sec)) then
237 sec = isec
238 endif
239 if (present(sclsec)) then
240 sclsec = isec
241 endif
242999 continue
243 call storeerror(stat, subname, err)
244 !call EndSub(subname)
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:830
integer, parameter, public dc_enodimtime
Definition dc_error.f90:572
integer, parameter, public dc_noerr
Definition dc_error.f90:509
integer, parameter, public dc_edimtime
Definition dc_error.f90:573

References dc_error::dc_edimtime, dc_error::dc_enodimtime, dc_error::dc_noerr, dc_scaledsec::dcscaledsecputline(), dc_types::dp, dc_date_types::hour_seconds, dc_date_types::min_seconds, dc_error::storeerror(), and dc_date_types::year_months.

Here is the call graph for this function:

◆ dcdifftimeevalbyunit()

real(dp) function dcdifftimeevalbyunit ( type(dc_difftime), intent(in)  diff,
character(*), intent(in)  unit,
integer, intent(in), optional  unit_symbol 
)

Definition at line 551 of file dcdatetimeeval.f90.

552 !
553 ! dc_date_types#DC_DIFFTIME 型変数の日時を *unit* の単位
554 ! に換算して倍精度実数型変数で返します.
555 !
556 ! *unit* には
557 ! 日 dc_date_types#UNIT_DAY, 時 dc_date_types#UNIT_HOUR,
558 ! 分 dc_date_types#UNIT_MIN, 秒 dc_date_types#UNIT_SEC,
559 ! 無次元時間 dc_date_types#UNIT_NONDIM
560 ! を与えることが可能です.
561 !
562 ! *unit_symbol* には
563 ! 日 dc_date_types#UNIT_SYMBOL_DAY, 時 dc_date_types#UNIT_SYMBOL_HOUR,
564 ! 分 dc_date_types#UNIT_SYMBOL_MIN, 秒 dc_date_types#UNIT_SYMBOL_SEC
565 ! 無次元時間 dc_date_types#UNIT_SYMBOL_NONDIM
566 ! を与えることが可能です.
567 !
568 ! これらに該当しないものを *unit* または *unit_symbol*
569 ! に与えた場合, もしくは引数を両方とも与えない場合, 0.0 が返ります.
570 !
571 use dc_types, only: dp, token
574 use dc_date_types, only: dc_difftime, &
577 implicit none
578 real(DP):: result
579 type(DC_DIFFTIME), intent(in):: diff
580 character(*), intent(in):: unit
581 integer, intent(in), optional:: unit_symbol
582 integer:: symbol
583continue
584 symbol = unit_symbol_err
585 if ( present(unit_symbol) ) then
586 symbol = unit_symbol
587 else
588 symbol = parsetimeunits(unit)
589 end if
590
591 if ( symbol == unit_symbol_nondim ) then
592 result = evalnondim(diff)
593 elseif ( symbol == unit_symbol_sec ) then
594 result = evalsec(diff)
595 elseif ( symbol == unit_symbol_min ) then
596 result = evalmin(diff)
597 elseif ( symbol == unit_symbol_hour ) then
598 result = evalhour(diff)
599 elseif ( symbol == unit_symbol_day ) then
600 result = evalday(diff)
601 else
602 result = 0.0_dp
603 end if
integer, parameter, public unit_symbol_nondim

References dc_types::dp, dc_types::token, dc_date_types::unit_symbol_day, dc_date_types::unit_symbol_err, dc_date_types::unit_symbol_hour, dc_date_types::unit_symbol_min, dc_date_types::unit_symbol_nondim, and dc_date_types::unit_symbol_sec.

◆ dcdifftimeevalday()

real(dp) function dcdifftimeevalday ( type(dc_difftime), intent(in)  diff)

Definition at line 266 of file dcdatetimeeval.f90.

267 !
268 ! dc_date_types#DC_DIFFTIME 型変数の日時を日数に換算して
269 ! 倍精度実数型変数で返します. (例えば 12 時間は 0.5 日と換算されます).
270 !
271 ! 1 ヶ月は dc_date_types#CYCLIC_MDAYS と換算します.
272 !
273 use dc_types, only: dp
274 use dc_date_generic, only: eval
276 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
277 & operator(+), operator(*), int
278 implicit none
279 real(DP):: result
280 type(DC_DIFFTIME), intent(in):: diff
281 type(DC_SCALED_SEC):: day, mon, sec
282continue
283 call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
284 result = int(mon * cyclic_mdays) + day + sec / diff % day_seconds

References dc_date_types::cyclic_mdays, and dc_types::dp.

◆ dcdifftimeevalhour()

real(dp) function dcdifftimeevalhour ( type(dc_difftime), intent(in)  diff)

Definition at line 308 of file dcdatetimeeval.f90.

309 !
310 ! dc_date_types#DC_DIFFTIME 型変数の日時を時間に換算して
311 ! 倍精度実数型変数で返します.
312 ! (例えば 2 日は 48 時間に, 30 分 は 0.5 時間と換算されます).
313 !
314 ! 1 ヶ月は dc_date_types#CYCLIC_MDAYS と換算します.
315 !
316 use dc_types, only: dp
317 use dc_date_generic, only: eval
319 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
320 & operator(+), operator(*), int
321 implicit none
322 real(DP):: result
323 type(DC_DIFFTIME), intent(in):: diff
324 type(DC_SCALED_SEC):: mon, day, sec
325continue
326 call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
327 result = ( int(mon * cyclic_mdays) + day &
328 & * diff % day_seconds + sec) / hour_seconds

References dc_date_types::cyclic_mdays, dc_types::dp, and dc_date_types::hour_seconds.

◆ dcdifftimeevalmin()

real(dp) function dcdifftimeevalmin ( type(dc_difftime), intent(in)  diff)

Definition at line 352 of file dcdatetimeeval.f90.

353 !
354 ! dc_date_types#DC_DIFFTIME 型変数の日時を分に換算して
355 ! 倍精度実数型変数で返します.
356 ! (例えば 1 日は 3600 分に, 30 秒 は 0.5 分と換算されます).
357 !
358 ! 1 ヶ月は dc_date_types#CYCLIC_MDAYS と換算します.
359 !
360 use dc_types, only: dp
361 use dc_date_generic, only: eval
363 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
364 & operator(+), operator(*), int
365 implicit none
366 real(DP):: result
367 type(DC_DIFFTIME), intent(in):: diff
368 type(DC_SCALED_SEC):: mon, day, sec
369continue
370 call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
371 result = ( int(mon * cyclic_mdays) + day &
372 & * diff % day_seconds + sec) / min_seconds

References dc_date_types::cyclic_mdays, dc_types::dp, and dc_date_types::min_seconds.

◆ dcdifftimeevalnondim()

real(dp) function dcdifftimeevalnondim ( type(dc_difftime), intent(in)  diff)

Definition at line 426 of file dcdatetimeeval.f90.

427 !
428 ! dc_date_types#DC_DIFFTIME 型変数の日時を無時限時間に換算して
429 ! 倍精度実数型変数で返します.
430 !
431 ! 1 ヶ月は dc_date_types#CYCLIC_MDAYS と換算します.
432 !
433 use dc_types, only: dp
434 use dc_date_generic, only: eval
436 implicit none
437 real(DP):: result
438 type(DC_DIFFTIME), intent(in):: diff
439 real(DP):: nondim
440continue
441 call eval(diff, nondim=nondim)
442 result = nondim

References dc_date_types::cyclic_mdays, and dc_types::dp.

◆ dcdifftimeevalsclsec()

type(dc_scaled_sec) function dcdifftimeevalsclsec ( type(dc_difftime), intent(in)  diff)

Definition at line 468 of file dcdatetimeeval.f90.

469 !
470 ! dc_date_types#DC_DIFFTIME 型変数の日時を秒に換算して
471 ! DC_SCALED_SEC 型で返します.
472 !
473 ! 1 ヶ月は dc_date_types#CYCLIC_MDAYS と換算します.
474 !
475 use dc_types, only: dp
476 use dc_date_generic, only: eval
478 use dc_scaledsec, only: dc_scaled_sec, operator(/), &
479 & operator(==), operator(+), operator(*), int
480 implicit none
481 type(DC_SCALED_SEC):: result
482 type(DC_DIFFTIME), intent(in):: diff
483 type(DC_SCALED_SEC):: mon, day, sec
484 type(DC_SCALED_SEC):: zero_sec
485continue
486 if ( .not. diff % nondim_flag ) then
487 call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
488 if ( mon == zero_sec ) then
489 result = day * diff % day_seconds + sec
490 else
491 result = ( int(mon * cyclic_mdays) + day ) * diff % day_seconds + sec
492 end if
493 else
494 call eval(diff, sclnondim = sec)
495 result = sec
496 end if

References dc_date_types::cyclic_mdays, and dc_types::dp.

◆ dcdifftimeevalsec()

real(dp) function dcdifftimeevalsec ( type(dc_difftime), intent(in)  diff)

Definition at line 400 of file dcdatetimeeval.f90.

401 !
402 ! dc_date_types#DC_DIFFTIME 型変数の日時を秒に換算して
403 ! 倍精度実数型変数で返します.
404 !
405 ! 1 ヶ月は dc_date_types#CYCLIC_MDAYS と換算します.
406 !
407 use dc_types, only: dp
408 use dc_date_generic, only: eval
410 use dc_scaledsec, only: assignment(=)
411 implicit none
412 real(DP):: result
413 type(DC_DIFFTIME), intent(in):: diff
414 integer:: mon, day
415 real(DP):: sec, day_seconds
416continue
417 if ( .not. diff % nondim_flag ) then
418 call eval(diff, mon = mon, day = day, sec = sec)
419 day_seconds = diff % day_seconds
420 result = int(mon * cyclic_mdays) + day * day_seconds + sec
421 else
422 call eval(diff, nondim = result)
423 end if

References dc_date_types::cyclic_mdays, dc_date_types::day_seconds, and dc_types::dp.