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 14 of file dcdatetimeeval.f90.

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.

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'
47 continue
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 
140 999 continue
141  !call EndSub(subname)
integer, parameter, public cal_noleap
integer, parameter, public four_century
integer, parameter, public year_months
integer, parameter, public cal_julian
integer, parameter, public cal_cyclic
real(dp), parameter, public cyclic_mdays
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
integer, parameter, public hour_seconds
integer, parameter, public year_days
種別型パラメタを提供します。
Definition: dc_types.f90:49
integer, parameter, public four_years
subroutine, public dcscaledsecputline(sclsec, unit, indent)
integer, parameter, public min_seconds
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
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 500 of file dcdatetimeeval.f90.

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.

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
529 continue
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_min
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition: dc_types.f90:109
integer, parameter, public unit_symbol_hour
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49
integer, parameter, public unit_symbol_sec
integer, parameter, public unit_symbol_day

◆ dcdatetimeevalday()

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

Definition at line 249 of file dcdatetimeeval.f90.

References dc_types::dp.

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
261 continue
262  call eval(time, sclday = day, sclsec = sec)
263  result = day + sec / time % day_seconds
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49

◆ dcdatetimeevalhour()

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

Definition at line 289 of file dcdatetimeeval.f90.

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

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
303 continue
304  call eval(time, sclday = day, sclsec = sec)
305  result = (day * time % day_seconds + sec) / hour_seconds
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
integer, parameter, public hour_seconds
種別型パラメタを提供します。
Definition: dc_types.f90:49

◆ dcdatetimeevalmin()

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

Definition at line 333 of file dcdatetimeeval.f90.

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

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
347 continue
348  call eval(time, sclday = day, sclsec = sec)
349  result = (day * time % day_seconds + sec) / min_seconds
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49
integer, parameter, public min_seconds

◆ dcdatetimeevalsclsec()

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

Definition at line 446 of file dcdatetimeeval.f90.

References dc_types::dp.

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
463 continue
464  call eval(time, sclday = day, sclsec = sec)
465  result = day * time % day_seconds + sec
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49

◆ dcdatetimeevalsec()

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

Definition at line 377 of file dcdatetimeeval.f90.

References dc_types::dp.

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
394 continue
395  call eval(time, day = day, sec = sec)
396  day_seconds = time % day_seconds
397  result = day * day_seconds + sec
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49

◆ 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 148 of file dcdatetimeeval.f90.

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.

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'
181 continue
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
242 999 continue
243  call storeerror(stat, subname, err)
244  !call EndSub(subname)
integer, parameter, public year_months
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
integer, parameter, public hour_seconds
種別型パラメタを提供します。
Definition: dc_types.f90:49
integer, parameter, public dc_edimtime
Definition: dc_error.f90:573
subroutine, public dcscaledsecputline(sclsec, unit, indent)
integer, parameter, public dc_enodimtime
Definition: dc_error.f90:572
integer, parameter, public min_seconds
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
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 552 of file dcdatetimeeval.f90.

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.

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
583 continue
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
integer, parameter, public unit_symbol_err
integer, parameter, public unit_symbol_min
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition: dc_types.f90:109
integer, parameter, public unit_symbol_hour
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49
integer, parameter, public unit_symbol_sec
integer, parameter, public unit_symbol_day

◆ dcdifftimeevalday()

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

Definition at line 267 of file dcdatetimeeval.f90.

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

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
282 continue
283  call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
284  result = int(mon * cyclic_mdays) + day + sec / diff % day_seconds
real(dp), parameter, public cyclic_mdays
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49

◆ dcdifftimeevalhour()

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

Definition at line 309 of file dcdatetimeeval.f90.

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

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
325 continue
326  call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
327  result = ( int(mon * cyclic_mdays) + day &
328  & * diff % day_seconds + sec) / hour_seconds
real(dp), parameter, public cyclic_mdays
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
integer, parameter, public hour_seconds
種別型パラメタを提供します。
Definition: dc_types.f90:49

◆ dcdifftimeevalmin()

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

Definition at line 353 of file dcdatetimeeval.f90.

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

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
369 continue
370  call eval(diff, sclmon = mon, sclday = day, sclsec = sec)
371  result = ( int(mon * cyclic_mdays) + day &
372  & * diff % day_seconds + sec) / min_seconds
real(dp), parameter, public cyclic_mdays
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49
integer, parameter, public min_seconds

◆ dcdifftimeevalnondim()

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

Definition at line 427 of file dcdatetimeeval.f90.

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

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
440 continue
441  call eval(diff, nondim=nondim)
442  result = nondim
real(dp), parameter, public cyclic_mdays
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49

◆ dcdifftimeevalsclsec()

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

Definition at line 469 of file dcdatetimeeval.f90.

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

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
485 continue
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
real(dp), parameter, public cyclic_mdays
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49

◆ dcdifftimeevalsec()

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

Definition at line 401 of file dcdatetimeeval.f90.

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

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
416 continue
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
real(dp), parameter, public cyclic_mdays
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
種別型パラメタを提供します。
Definition: dc_types.f90:49