gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
Functions/Subroutines
dcdatetimeeval.f90 File Reference

DC_DATETIME/DC_DIFFTIME 型変数から月日秒への変換 More...

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)
 

Detailed Description

DC_DATETIME/DC_DIFFTIME 型変数から月日秒への変換

Author
Yasuhiro MORIKAWA, Eizi TOYODA

Definition in file dcdatetimeeval.f90.

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 
)

DC_DATETIME を日時成分に変換

DC_DATETIME 型変数 time を年, 月, 日, 時間, 分, 秒, 暦法, タイムゾーンに変換して返します.

Parameters
[in]time変換する DC_DATETIME 型変数
[out]year年 (省略可能)
[out]mon月 (省略可能)
[out]day日 (省略可能)
[out]hour時 (省略可能)
[out]min分 (省略可能)
[out]sec秒 (省略可能)
[out]caltype暦法 (省略可能)
[out]zoneタイムゾーン (UTC からの時差) (省略可能)
[out]sclyear年 (DC_SCALED_SEC 型) (省略可能)
[out]sclmon月 (DC_SCALED_SEC 型) (省略可能)
[out]sclday日 (DC_SCALED_SEC 型) (省略可能)
[out]sclsec秒 (DC_SCALED_SEC 型) (省略可能)

Definition at line 63 of file dcdatetimeeval.f90.

65 use dc_types, only: dp
66 use dc_date_types, only: dc_datetime, &
70 use dc_scaledsec, only: dc_scaled_sec, &
71 & assignment(=), dcscaledsecputline, &
72 & operator(==), operator(>), operator(<), operator(>=), operator(<=), &
73 & operator(+), operator(-), operator(*), operator(/), mod, modulo, &
74 & abs, int, floor, ceiling
75 use dc_trace, only: beginsub, endsub
76 implicit none
77 type(DC_DATETIME), intent(in):: time
78 integer, intent(out), optional:: year ! 年
79 integer, intent(out), optional:: mon ! 月
80 integer, intent(out), optional:: day ! 日
81 integer, intent(out), optional:: hour ! 時
82 integer, intent(out), optional:: min ! 分
83 real(DP),intent(out), optional:: sec ! 秒
84 integer, intent(out), optional:: caltype ! 暦法
85 character(*), intent(out), optional:: zone ! タイムゾーン (UTC からの時差)
86 type(DC_SCALED_SEC), intent(out), optional:: sclyear ! 年 (DC_SCALED_SEC 型)
87 type(DC_SCALED_SEC), intent(out), optional:: sclmon ! 月 (DC_SCALED_SEC 型)
88 type(DC_SCALED_SEC), intent(out), optional:: sclday ! 日 (DC_SCALED_SEC 型)
89 type(DC_SCALED_SEC), intent(out), optional:: sclsec ! 秒 (DC_SCALED_SEC 型)
90
91 type(DC_SCALED_SEC):: iyear, month, iday, imon, isec
92 !character(*), parameter :: subname = 'DCDateTimeEval1'
93continue
94 !call BeginSub(subname)
95 if (present(zone)) then
96 zone = time % zone
97 end if
98 if (present(caltype)) then
99 caltype = time % caltype
100 end if
101 isec = time % sec
102 if (present(hour)) then
103 hour = floor(isec / hour_seconds)
104 isec = modulo(isec, hour_seconds)
105 end if
106 if (present(min)) then
107 min = floor(isec / min_seconds)
108 isec = modulo(isec, min_seconds)
109 end if
110 if (present(sec)) then
111 sec = isec
112 end if
113 if (present(sclsec)) then
114 sclsec = isec
115 end if
116
117 if (time % caltype == cal_cyclic) then
118 iday = time % day
119 if (present(year)) year = 0
120 if (present(sclyear)) sclyear = 0
121 if (present(sclmon)) then
122 sclmon = floor(iday / cyclic_mdays)
123 iday = ceiling( modulo(iday, cyclic_mdays) )
124 elseif (present(mon)) then
125 mon = floor(iday / cyclic_mdays)
126 iday = ceiling( modulo(iday, cyclic_mdays) )
127 end if
128 if (present(day)) day = iday
129 if (present(sclday)) sclday = iday
130 goto 999
131 endif
132 if (time % caltype == cal_noleap) then
133 iday = int( modulo(time%day - 91, year_days) )
134 iyear = int( (time%day - 91 - iday) / year_days )
135 else
136 if (time % caltype == cal_julian) then
137 iday = int( modulo(time%day - 92, four_years) )
138 iyear = int( (time%day - 92 - iday) / four_years ) * 4
139 elseif (time%day < 640196) then
140 iday = int( modulo(time%day - 92, four_years) )
141 iyear = int( (time%day - 92 - iday) / four_years ) * 4
142 else
143 iday = int( modulo(time%day - 94, four_century) )
144 iyear = int( (time%day - 94 - iday) / four_century ) * 400
145 if (iday == four_century - 1) then
146 iyear = iyear + 300
147 iday = 36525
148 else
149 iyear = iyear + int( iday / 36524 ) * 100
150 iday = int( modulo(iday, 36524) )
151 endif
152 iyear = iyear + int( iday / four_years ) * 4
153 iday = int( modulo(iday, four_years) )
154 endif
155 if (iday == four_years - 1) then
156 iyear = iyear + 3
157 iday = year_days
158 else
159 iyear = iyear + int( iday / year_days )
160 iday = int( modulo(iday, year_days) )
161 endif
162 endif
163
164 iday = iday * 10 + 922
165 month = int( iday / 306 )
166
167 if (present(sclyear)) then
168 imon = mod(month - 1, year_months) + 1
169 sclyear = iyear + int( (month - imon) / year_months )
170 elseif (present(year)) then
171 imon = mod(month - 1, year_months) + 1
172 year = iyear + int( (month - imon) / year_months )
173 else
174 imon = month
175 end if
176 if (present(sclmon)) then
177 iday = int( mod(iday, 306) / 10 ) + 1
178 sclmon = imon
179 elseif (present(mon)) then
180 iday = int( mod(iday, 306) / 10 ) + 1
181 mon = imon
182 else
183 iday = int( iday / 10 ) + 1
184 end if
185
186 if (present(day)) day = iday
187 if (present(sclday)) sclday = iday
188
189999 continue
190 !call EndSub(subname)
日付・時刻に関する構造データ型と定数
integer, parameter, public cal_noleap
閏年無しの暦 (1年 365 日)
real(dp), parameter, public cyclic_mdays
周期暦での1ヶ月の日数 (DC_DIFFTIME の月換算にも使用)
integer, parameter, public hour_seconds
1時間の秒数
integer, parameter, public four_years
4年の日数 (閏年を含む)
integer, parameter, public cal_cyclic
周期暦 (1ヶ月 30.6 日)
integer, save, public caltype
デフォルトの暦タイプ (グレゴリオ暦)
integer, parameter, public year_days
1年 (非閏年) の日数
integer, parameter, public year_months
1年の月数
integer, parameter, public four_century
400年の日数
integer, parameter, public min_seconds
1分の秒数
integer, parameter, public cal_julian
ユリウス暦
精密な時間演算のための秒スケールモジュール
subroutine, public dcscaledsecputline(sclsec, unit, indent)
デバッグ時の追跡用モジュール
Definition dc_trace.f90:150
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:92

References dc_trace::beginsub(), 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_trace::endsub(), 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 
)

DC_DATETIME を指定単位で変換

DC_DATETIME 型変数の日時を unit または unit_symbol の単位に 換算して倍精度実数型変数で返します.

unit には以下を与えることが可能です:

  • dc_date_types::UNIT_DAY (日)
  • dc_date_types::UNIT_HOUR (時)
  • dc_date_types::UNIT_MIN (分)
  • dc_date_types::UNIT_SEC (秒)

unit_symbol には以下を与えることが可能です:

  • dc_date_types::UNIT_SYMBOL_DAY (日)
  • dc_date_types::UNIT_SYMBOL_HOUR (時)
  • dc_date_types::UNIT_SYMBOL_MIN (分)
  • dc_date_types::UNIT_SYMBOL_SEC (秒)

これらに該当しないものを与えた場合, または引数を両方とも与えない場合, 0.0 が返ります.

Parameters
[in]time変換する DC_DATETIME 型変数
[in]unit単位文字列
[in]unit_symbol単位記号定数 (省略可能)
Returns
変換された値 (倍精度実数型)

Definition at line 807 of file dcdatetimeeval.f90.

808 use dc_types, only: dp
810 use dc_date_types, only: dc_datetime, &
813 implicit none
814 real(DP):: result
815 type(DC_DATETIME), intent(in):: time
816 character(*), intent(in):: unit
817 integer, intent(in), optional:: unit_symbol
818 integer:: symbol
819continue
820 symbol = unit_symbol_err
821 if ( present(unit_symbol) ) then
822 symbol = unit_symbol
823 else
824 symbol = parsetimeunits(unit)
825 end if
826
827 if ( symbol == unit_symbol_sec ) then
828 result = evalsec(time)
829 elseif ( symbol == unit_symbol_min ) then
830 result = evalmin(time)
831 elseif ( symbol == unit_symbol_hour ) then
832 result = evalhour(time)
833 elseif ( symbol == unit_symbol_day ) then
834 result = evalday(time)
835 else
836 result = 0.0_dp
837 end if
dc_date より提供される手続の引用仕様宣言
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
日の単位を示すシンボル

References dc_types::dp, 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)

DC_DATETIME を日数に変換

DC_DATETIME 型変数の日時を日数に換算して倍精度実数型変数で返します. (例えば 12 時間は 0.5 日と換算されます)

Parameters
[in]time変換する DC_DATETIME 型変数
Returns
日数 (倍精度実数型)

Definition at line 354 of file dcdatetimeeval.f90.

355 use dc_types, only: dp
356 use dc_date_generic, only: eval
357 use dc_date_types, only: dc_datetime
358 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), operator(+)
359 implicit none
360 real(DP):: result
361 type(DC_DATETIME), intent(in):: time
362 type(DC_SCALED_SEC):: day, sec
363continue
364 call eval(time, sclday = day, sclsec = sec)
365 result = day + sec / time % day_seconds

References dc_types::dp.

◆ dcdatetimeevalhour()

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

DC_DATETIME を時間に変換

DC_DATETIME 型変数の日時を時間に換算して倍精度実数型変数で返します. (例えば 2 日は 48 時間に, 30 分は 0.5 時間と換算されます)

Parameters
[in]time変換する DC_DATETIME 型変数
Returns
時間 (倍精度実数型)

Definition at line 426 of file dcdatetimeeval.f90.

427 use dc_types, only: dp
428 use dc_date_generic, only: eval
430 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
431 & operator(+), operator(*), int
432 implicit none
433 real(DP):: result
434 type(DC_DATETIME), intent(in):: time
435 type(DC_SCALED_SEC):: day, sec
436continue
437 call eval(time, sclday = day, sclsec = sec)
438 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)

DC_DATETIME を分に変換

DC_DATETIME 型変数の日時を分に換算して倍精度実数型変数で返します. (例えば 1 日は 1440 分に, 30 秒は 0.5 分と換算されます)

Parameters
[in]time変換する DC_DATETIME 型変数
Returns
分 (倍精度実数型)

Definition at line 500 of file dcdatetimeeval.f90.

501 use dc_types, only: dp
502 use dc_date_generic, only: eval
504 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
505 & operator(+), operator(*), int
506 implicit none
507 real(DP):: result
508 type(DC_DATETIME), intent(in):: time
509 type(DC_SCALED_SEC):: day, sec
510continue
511 call eval(time, sclday = day, sclsec = sec)
512 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)

DC_DATETIME を秒に変換 (DC_SCALED_SEC 型)

DC_DATETIME 型変数の日時を秒に換算して DC_SCALED_SEC 型で返します.

Warning
年の要素は無視されます. すなわち, 1999-01-01 が格納された time と 2007-01-01 が格納された time からは同じ値が返ります. (これはもしかすると望ましくない動作かもしれません)
Parameters
[in]time変換する DC_DATETIME 型変数
Returns
秒 (DC_SCALED_SEC 型)

Definition at line 696 of file dcdatetimeeval.f90.

697 use dc_date_generic, only: eval
698 use dc_date_types, only: dc_datetime
699 use dc_scaledsec, only: dc_scaled_sec, operator(/), &
700 & operator(+), operator(*), int
701 implicit none
702 type(DC_SCALED_SEC):: result
703 type(DC_DATETIME), intent(in):: time
704 type(DC_SCALED_SEC):: day, sec
705continue
706 call eval(time, sclday = day, sclsec = sec)
707 result = day * time % day_seconds + sec

◆ dcdatetimeevalsec()

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

DC_DATETIME を秒に変換

DC_DATETIME 型変数の日時を秒に換算して倍精度実数型変数で返します.

Warning
年の要素は無視されます. すなわち, 1999-01-01 が格納された time と 2007-01-01 が格納された time からは同じ値が返ります. (これはもしかすると望ましくない動作かもしれません)
Parameters
[in]time変換する DC_DATETIME 型変数
Returns
秒 (倍精度実数型)

Definition at line 580 of file dcdatetimeeval.f90.

581 use dc_types, only: dp
582 use dc_date_generic, only: eval
583 use dc_date_types, only: dc_datetime
584 use dc_scaledsec, only: assignment(=)
585 implicit none
586 real(DP):: result
587 type(DC_DATETIME), intent(in):: time
588 integer:: day
589 real(DP):: sec, day_seconds
590continue
591 call eval(time, day = day, sec = sec)
592 day_seconds = time % day_seconds
593 result = day * day_seconds + sec
real(dp), save, public day_seconds
1日の秒数 (可変, デフォルトは地球の1日)

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 
)

DC_DIFFTIME を時間成分に変換

DC_DIFFTIME 型変数 diff を年, 月, 日, 時間, 分, 秒, 無次元時間に変換して返します.

Parameters
[in]diff変換する DC_DIFFTIME 型変数
[out]year年 (省略可能)
[out]mon月 (省略可能)
[out]day日 (省略可能)
[out]hour時 (省略可能)
[out]min分 (省略可能)
[out]sec秒 (省略可能)
[out]nondim無次元時間 (省略可能)
[out]sclyear年 (DC_SCALED_SEC 型) (省略可能)
[out]sclmon月 (DC_SCALED_SEC 型) (省略可能)
[out]sclday日 (DC_SCALED_SEC 型) (省略可能)
[out]sclsec秒 (DC_SCALED_SEC 型) (省略可能)
[out]sclnondim無次元時間 (DC_SCALED_SEC 型) (省略可能)
[out]errエラーフラグ (省略可能)

Definition at line 237 of file dcdatetimeeval.f90.

240 use dc_types, only: dp
241 use dc_trace, only: beginsub, endsub
243 use dc_date_types, only: dc_difftime, &
245 use dc_scaledsec, only: dc_scaled_sec, &
246 & assignment(=), dcscaledsecputline, &
247 & operator(==), operator(>), operator(<), operator(>=), operator(<=), &
248 & operator(+), operator(-), operator(*), operator(/), mod, modulo, &
249 & abs, int, floor, ceiling
250 implicit none
251 type(DC_DIFFTIME), intent(in):: diff
252 integer, intent(out), optional:: year ! 年
253 integer, intent(out), optional:: mon ! 月
254 integer, intent(out), optional:: day ! 日
255 integer, intent(out), optional:: hour ! 時
256 integer, intent(out), optional:: min ! 分
257 real(DP),intent(out), optional:: sec ! 秒
258 real(DP),intent(out), optional:: nondim ! 無次元時間. Nondimensional time
259 type(DC_SCALED_SEC), intent(out), optional:: sclyear ! 年 (DC_SCALED_SEC 型)
260 type(DC_SCALED_SEC), intent(out), optional:: sclmon ! 月 (DC_SCALED_SEC 型)
261 type(DC_SCALED_SEC), intent(out), optional:: sclday ! 日 (DC_SCALED_SEC 型)
262 type(DC_SCALED_SEC), intent(out), optional:: sclsec ! 秒 (DC_SCALED_SEC 型)
263 type(DC_SCALED_SEC), intent(out), optional:: sclnondim ! 無次元時間 (DC_SCALED_SEC 型)
264 logical, intent(out), optional :: err
265 type(DC_SCALED_SEC):: imon, isec
266 integer:: stat
267 character(*), parameter :: subname = 'DCDiffTimeEval1'
268continue
269 !call BeginSub(subname)
270 stat = dc_noerr
271 if ( present(sclnondim) ) then
272 if ( .not. diff % nondim_flag ) then
273 stat = dc_edimtime
274 goto 999
275 end if
276 sclnondim = diff % sec
277 elseif ( present(nondim) ) then
278 if ( .not. diff % nondim_flag ) then
279 stat = dc_edimtime
280 goto 999
281 end if
282 nondim = diff % sec
283 else
284 if ( diff % nondim_flag ) then
285 stat = dc_enodimtime
286 goto 999
287 end if
288 end if
289
290 imon = diff % mon
291 isec = diff % sec
292 if (present(sclyear)) then
293 sclyear = int( imon / year_months )
294 imon = mod(imon, year_months)
295 elseif (present(year)) then
296 year = int( imon / year_months )
297 imon = mod(imon, year_months)
298 endif
299
300 if (present(sclmon)) then
301 sclmon = imon
302 elseif (present(mon)) then
303 mon = imon
304 endif
305
306 if (present(sclday)) then
307 sclday = diff % day
308 elseif (present(day)) then
309 day = diff % day
310 else
311 isec = isec + diff % day * diff % day_seconds
312 endif
313
314 if (present(hour)) then
315 hour = int(isec / hour_seconds)
316 isec = mod(isec, hour_seconds)
317 endif
318 if (present(min)) then
319 min = int(isec / min_seconds)
320 isec = mod(isec, min_seconds)
321 endif
322
323 if (present(sec)) then
324 sec = isec
325 endif
326 if (present(sclsec)) then
327 sclsec = isec
328 endif
329999 continue
330 call storeerror(stat, subname, err)
331 !call EndSub(subname)
エラー処理用モジュール
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public dc_noerr
エラー等を保持
Definition dc_error.f90:468
integer, parameter, public dc_enodimtime
Definition dc_error.f90:549
integer, parameter, public dc_edimtime
Definition dc_error.f90:550

References dc_trace::beginsub(), dc_error::dc_edimtime, dc_error::dc_enodimtime, dc_error::dc_noerr, dc_scaledsec::dcscaledsecputline(), dc_types::dp, dc_trace::endsub(), 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 
)

DC_DIFFTIME を指定単位で変換

DC_DIFFTIME 型変数の日時を unit の単位に換算して 倍精度実数型変数で返します.

unit には以下を与えることが可能です:

  • dc_date_types::UNIT_DAY (日)
  • dc_date_types::UNIT_HOUR (時)
  • dc_date_types::UNIT_MIN (分)
  • dc_date_types::UNIT_SEC (秒)
  • dc_date_types::UNIT_NONDIM (無次元時間)

unit_symbol には以下を与えることが可能です:

  • dc_date_types::UNIT_SYMBOL_DAY (日)
  • dc_date_types::UNIT_SYMBOL_HOUR (時)
  • dc_date_types::UNIT_SYMBOL_MIN (分)
  • dc_date_types::UNIT_SYMBOL_SEC (秒)
  • dc_date_types::UNIT_SYMBOL_NONDIM (無次元時間)

これらに該当しないものを与えた場合, または引数を両方とも与えない場合, 0.0 が返ります.

Parameters
[in]diff変換する DC_DIFFTIME 型変数
[in]unit単位文字列
[in]unit_symbol単位記号定数 (省略可能)
Returns
変換された値 (倍精度実数型)

Definition at line 897 of file dcdatetimeeval.f90.

898 use dc_types, only: dp
901 use dc_date_types, only: dc_difftime, &
904 implicit none
905 real(DP):: result
906 type(DC_DIFFTIME), intent(in):: diff
907 character(*), intent(in):: unit
908 integer, intent(in), optional:: unit_symbol
909 integer:: symbol
910continue
911 symbol = unit_symbol_err
912 if ( present(unit_symbol) ) then
913 symbol = unit_symbol
914 else
915 symbol = parsetimeunits(unit)
916 end if
917
918 if ( symbol == unit_symbol_nondim ) then
919 result = evalnondim(diff)
920 elseif ( symbol == unit_symbol_sec ) then
921 result = evalsec(diff)
922 elseif ( symbol == unit_symbol_min ) then
923 result = evalmin(diff)
924 elseif ( symbol == unit_symbol_hour ) then
925 result = evalhour(diff)
926 elseif ( symbol == unit_symbol_day ) then
927 result = evalday(diff)
928 else
929 result = 0.0_dp
930 end if
integer, parameter, public unit_symbol_nondim
無次元時間の単位を示すシンボル

References dc_types::dp, 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)

DC_DIFFTIME を日数に変換

DC_DIFFTIME 型変数の日時を日数に換算して倍精度実数型変数で返します. (例えば 12 時間は 0.5 日と換算されます)

1 ヶ月は dc_date_types::CYCLIC_MDAYS と換算します.

Parameters
[in]diff変換する DC_DIFFTIME 型変数
Returns
日数 (倍精度実数型)

Definition at line 391 of file dcdatetimeeval.f90.

392 use dc_types, only: dp
393 use dc_date_generic, only: eval
395 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
396 & operator(+), operator(*), int
397 implicit none
398 real(DP):: result
399 type(DC_DIFFTIME), intent(in):: diff
400 type(DC_SCALED_SEC):: day, mon, sec
401continue
402 call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
403 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)

DC_DIFFTIME を時間に変換

DC_DIFFTIME 型変数の日時を時間に換算して倍精度実数型変数で返します. (例えば 2 日は 48 時間に, 30 分は 0.5 時間と換算されます)

1 ヶ月は dc_date_types::CYCLIC_MDAYS と換算します.

Parameters
[in]diff変換する DC_DIFFTIME 型変数
Returns
時間 (倍精度実数型)

Definition at line 464 of file dcdatetimeeval.f90.

465 use dc_types, only: dp
466 use dc_date_generic, only: eval
468 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
469 & operator(+), operator(*), int
470 implicit none
471 real(DP):: result
472 type(DC_DIFFTIME), intent(in):: diff
473 type(DC_SCALED_SEC):: mon, day, sec
474continue
475 call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
476 result = ( int(mon * cyclic_mdays) + day &
477 & * 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)

DC_DIFFTIME を分に変換

DC_DIFFTIME 型変数の日時を分に換算して倍精度実数型変数で返します. (例えば 1 日は 1440 分に, 30 秒は 0.5 分と換算されます)

1 ヶ月は dc_date_types::CYCLIC_MDAYS と換算します.

Parameters
[in]diff変換する DC_DIFFTIME 型変数
Returns
分 (倍精度実数型)

Definition at line 538 of file dcdatetimeeval.f90.

539 use dc_types, only: dp
540 use dc_date_generic, only: eval
542 use dc_scaledsec, only: dc_scaled_sec, assignment(=), operator(/), &
543 & operator(+), operator(*), int
544 implicit none
545 real(DP):: result
546 type(DC_DIFFTIME), intent(in):: diff
547 type(DC_SCALED_SEC):: mon, day, sec
548continue
549 call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
550 result = ( int(mon * cyclic_mdays) + day &
551 & * 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)

DC_DIFFTIME を無次元時間に変換

DC_DIFFTIME 型変数の日時を無次元時間に換算して倍精度実数型変数で返します.

1 ヶ月は dc_date_types::CYCLIC_MDAYS と換算します.

Parameters
[in]diff変換する DC_DIFFTIME 型変数
Returns
無次元時間 (倍精度実数型)

Definition at line 658 of file dcdatetimeeval.f90.

659 use dc_types, only: dp
660 use dc_date_generic, only: eval
661 use dc_date_types, only: dc_difftime
662 implicit none
663 real(DP):: result
664 type(DC_DIFFTIME), intent(in):: diff
665 real(DP):: nondim
666continue
667 call eval(diff, nondim=nondim)
668 result = nondim

References dc_types::dp.

◆ dcdifftimeevalsclsec()

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

DC_DIFFTIME を秒に変換 (DC_SCALED_SEC 型)

DC_DIFFTIME 型変数の日時を秒に換算して DC_SCALED_SEC 型で返します.

1 ヶ月は dc_date_types::CYCLIC_MDAYS と換算します.

Parameters
[in]diff変換する DC_DIFFTIME 型変数
Returns
秒 (DC_SCALED_SEC 型)

Definition at line 731 of file dcdatetimeeval.f90.

732 use dc_date_generic, only: eval
734 use dc_scaledsec, only: dc_scaled_sec, operator(/), &
735 & operator(==), operator(+), operator(*), int
736 implicit none
737 type(DC_SCALED_SEC):: result
738 type(DC_DIFFTIME), intent(in):: diff
739 type(DC_SCALED_SEC):: mon, day, sec
740 type(DC_SCALED_SEC):: zero_sec
741continue
742 if ( .not. diff % nondim_flag ) then
743 call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
744 if ( mon == zero_sec ) then
745 result = day * diff % day_seconds + sec
746 else
747 result = ( int(mon * cyclic_mdays) + day ) * diff % day_seconds + sec
748 end if
749 else
750 call eval(diff, sclnondim = sec)
751 result = sec
752 end if

References dc_date_types::cyclic_mdays.

◆ dcdifftimeevalsec()

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

DC_DIFFTIME を秒に変換

DC_DIFFTIME 型変数の日時を秒に換算して倍精度実数型変数で返します.

1 ヶ月は dc_date_types::CYCLIC_MDAYS と換算します.

Parameters
[in]diff変換する DC_DIFFTIME 型変数
Returns
秒 (倍精度実数型)

Definition at line 617 of file dcdatetimeeval.f90.

618 use dc_types, only: dp
619 use dc_date_generic, only: eval
621 use dc_scaledsec, only: assignment(=)
622 implicit none
623 real(DP):: result
624 type(DC_DIFFTIME), intent(in):: diff
625 integer:: mon, day
626 real(DP):: sec, day_seconds
627continue
628 if ( .not. diff % nondim_flag ) then
629 call eval(diff, mon = mon, day = day, sec = sec)
630 day_seconds = diff % day_seconds
631 result = int(mon * cyclic_mdays) + day * day_seconds + sec
632 else
633 call eval(diff, nondim = result)
634 end if

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