Public Instance methods
Create( time, [year], [mon], [day], [hour], [min], [sec], [zone], [caltype], [day_seconds], [err] )
Subroutine : |
|
time : | type(DC_DATETIME), intent(out)
|
year : | integer, intent(in), optional
|
mon : | integer, intent(in), optional
|
day : | integer, intent(in), optional
|
hour : | integer, intent(in), optional
|
min : | integer, intent(in), optional
|
sec : | real(DP),intent(in), optional
|
zone : | character(*), intent(in), optional
|
caltype : | integer, intent(in), optional
|
day_seconds : | real(DP),intent(in), optional
|
err : | logical, intent(out), optional
|
Original external subprogram is dcdatetimecreate.f90#DCDateTimeCreate1_bc
Create( diff, [year], [mon], [day], [hour], [min], [sec], [day_seconds] )
Subroutine : |
|
diff : | type(DC_DIFFTIME), intent(out)
|
year : | integer, intent(in), optional
|
mon : | integer, intent(in), optional
|
day : | integer, intent(in), optional
|
hour : | integer, intent(in), optional
|
min : | integer, intent(in), optional
|
sec : | real(DP),intent(in), optional
|
day_seconds : | real(DP),intent(in), optional
|
Original external subprogram is dcdatetimecreate.f90#DCDiffTimeCreate1_bc
Create( diff, value, unit, [err] )
Subroutine : |
|
diff : | type(DC_DIFFTIME), intent(out)
|
value : | real(DP), intent(in)
|
unit : | character(*), intent(in)
|
err : | logical, intent(out), optional
|
Original external subprogram is dcdatetimecreate.f90#DCDiffTimeCreate2_bc
DCDateTimeCreate( time, [year], [mon], [day], [hour], [min], [sec], [zone], [caltype], [day_seconds], [sclyear], [sclmon], [sclday], [sclsec], [err] )
Subroutine : |
|
time : | type(DC_DATETIME), intent(out)
|
year : | integer, intent(in), optional
|
mon : | integer, intent(in), optional
|
day : | integer, intent(in), optional
|
hour : | integer, intent(in), optional
|
min : | integer, intent(in), optional
|
sec : | real(DP),intent(in), optional
|
zone : | character(*), intent(in), optional
|
caltype : | integer, intent(in), optional
|
day_seconds : | real(DP),intent(in), optional
|
sclyear : | type(DC_SCALED_SEC), intent(in), optional
|
sclmon : | type(DC_SCALED_SEC), intent(in), optional
|
sclday : | type(DC_SCALED_SEC), intent(in), optional
|
sclsec : | type(DC_SCALED_SEC), intent(in), optional
|
err : | logical, intent(out), optional
|
dc_date_types#DC_DATETIME
型変数の生成を行います. 引数 year, mon, day,
hour, min, sec
の全てを与えない場合, このサブルーチンが呼ばれた際の時刻が使用されます.
引数 caltype には暦法を設定します. dc_date_types#CAL_CYCLIC, dc_date_types#CAL_NOLEAP, dc_date_types#CAL_JULIAN, dc_date_types#CAL_GREGORIAN
のいづれかを与えてください. 引数 caltype を指定しない場合, 暦法は dc_date_types#CAL_GREGORIAN
に設定されます.
引数 zone には UTC からの時差を設定します. ’+09:00’ や
’-13:00’ のように時差を 6 文字で指定してください. 引数
zone を指定しない場合, date_and_time 組み込みサブルーチン
によって得られる時差を設定します.
引数 day_seconds には 1 日何秒かを設定します. この引数を
指定しない場合, dc_date_types#day_seconds
の値が用いられます. dc_date_types#day_seconds は SetSecOfDay で変更可能です.
引数 caltype および, zone に不適切な値が与えられた場合,
エラーを発生させます. 引数 err を与えている場合には err に
.true. が返り, プログラムは続行します.
Original external subprogram is dcdatetimecreate.f90#DCDateTimeCreate1
DCDateTimePutLine( time, [unit], [indent] )
Subroutine : |
|
time : | type(DC_DATETIME), intent(in)
|
unit : | integer, intent(in), optional
: | 出力先の装置番号. デフォルトの出力先は標準出力.
Unit number for output. Default value is standard output.
|
|
indent : | character(*), intent(in), optional
: | 表示されるメッセージの字下げ.
Indent of displayed messages.
|
|
引数 time に設定されている情報を印字します.
デフォルトではメッセージは標準出力に出力されます. unit
に装置番号を指定することで, 出力先を変更することが可能です.
Print information of time. By default messages are output to
standard output. Unit number for output can be changed by unit
argument.
Original external subprogram is dcdatetimeputline.f90#DCDateTimePutLine
DCDiffTimeCreate( diff, [year], [mon], [day], [hour], [min], [sec], [day_seconds], [nondim], [sclyear], [sclmon], [sclday], [sclsec] )
Subroutine : |
|
diff : | type(DC_DIFFTIME), intent(out)
|
year : | integer, intent(in), optional
|
mon : | integer, intent(in), optional
|
day : | integer, intent(in), optional
|
hour : | integer, intent(in), optional
|
min : | integer, intent(in), optional
|
sec : | real(DP), intent(in), optional
|
day_seconds : | real(DP), intent(in), optional
|
nondim : | real(DP), intent(in), optional
: | 無次元時間. Nondimensional time
|
|
sclyear : | type(DC_SCALED_SEC), intent(in), optional
|
sclmon : | type(DC_SCALED_SEC), intent(in), optional
|
sclday : | type(DC_SCALED_SEC), intent(in), optional
|
sclsec : | type(DC_SCALED_SEC), intent(in), optional
|
dc_date_types#DC_DIFFTIME
型変数の生成を行います. 引数 year, mon, day, hour, min, sec, nondim を与えない場合, 0
が与えられたことになります.
引数 day_seconds には 1 日何秒かを設定します. この引数を
指定しない場合, dc_date_types#day_seconds
の値が用いられます. dc_date_types#day_seconds は SetSecOfDay で変更可能です.
Original external subprogram is dcdatetimecreate.f90#DCDiffTimeCreate1
DCDiffTimeCreate( diff, value, unit, [err] )
Subroutine : |
|
diff : | type(DC_DIFFTIME), intent(out)
|
value : | real(DP), intent(in)
|
unit : | character(*), intent(in)
|
err : | logical, intent(out), optional
|
dc_date_types#DC_DIFFTIME
型変数の生成を行います. 引数 value に数値を, unit
に単位を表す文字列を与えてください. unit に指定できるのは以下の文字列です.
(大文字小文字は区別しません).
これらに該当しない文字列を unit に与えた場合, エラーを発生させます.
引数 err を与えている場合には err に .true. が返り,
プログラムは続行します.
Original external subprogram is dcdatetimecreate.f90#DCDiffTimeCreate2D
DCDiffTimeCreate( diff, value, unit, [err] )
Subroutine : |
|
diff : | type(DC_DIFFTIME), intent(out)
|
value : | real, intent(in)
|
unit : | character(*), intent(in)
|
err : | logical, intent(out), optional
|
Original external subprogram is dcdatetimecreate.f90#DCDiffTimeCreate2R
DCDiffTimeCreate( diff, value, unit, [err] )
Subroutine : |
|
diff : | type(DC_DIFFTIME), intent(out)
|
value : | integer, intent(in)
|
unit : | character(*), intent(in)
|
err : | logical, intent(out), optional
|
Original external subprogram is dcdatetimecreate.f90#DCDiffTimeCreate2I
DCDiffTimePutLine( diff, [unit], [indent] )
Subroutine : |
|
diff : | type(DC_DIFFTIME), intent(in)
|
unit : | integer, intent(in), optional
: | 出力先の装置番号. デフォルトの出力先は標準出力.
Unit number for output. Default value is standard output.
|
|
indent : | character(*), intent(in), optional
: | 表示されるメッセージの字下げ.
Indent of displayed messages.
|
|
引数 diff に設定されている情報を印字します.
デフォルトではメッセージは標準出力に出力されます. unit
に装置番号を指定することで, 出力先を変更することが可能です.
Print information of diff. By default messages are output to
standard output. Unit number for output can be changed by unit
argument.
Original external subprogram is dcdatetimeputline.f90#DCDiffTimePutLine
Eval( time, [year], [mon], [day], [hour], [min], [sec], [caltype], [zone], [sclyear], [sclmon], [sclday], [sclsec] )
Subroutine : |
|
time : | type(DC_DATETIME), intent(in)
|
year : | integer, intent(out), optional
|
mon : | integer, intent(out), optional
|
day : | integer, intent(out), optional
|
hour : | integer, intent(out), optional
|
min : | integer, intent(out), optional
|
sec : | real(DP),intent(out), optional
|
caltype : | integer, intent(out), optional
|
zone : | character(*), 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
|
dc_date_types#DC_DATETIME 型変数
time を 年 year, 月 mon, 日 day, 時間
hour, 分 min, 秒
sec, 暦法 caltype, タイムゾーン zone
に変換して返します.
Original external subprogram is dcdatetimeeval.f90#DCDateTimeEval1
Eval( diff, [year], [mon], [day], [hour], [min], [sec], [nondim], [sclyear], [sclmon], [sclday], [sclsec], [sclnondim], [err] )
Subroutine : |
|
diff : | type(DC_DIFFTIME), intent(in)
|
year : | integer, intent(out), optional
|
mon : | integer, intent(out), optional
|
day : | integer, intent(out), optional
|
hour : | integer, intent(out), optional
|
min : | integer, intent(out), optional
|
sec : | real(DP),intent(out), optional
|
nondim : | real(DP),intent(out), optional
: | 無次元時間. Nondimensional time
|
|
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 : | type(DC_SCALED_SEC), intent(out), optional
: | 無次元時間 (DC_SCALED_SEC 型)
|
|
err : | logical, intent(out), optional
|
dc_date_types#DC_DIFFTIME 型変数
diff を 年 year, 月 mon, 日 day, 時間
hour, 分 min, 秒
sec, 無次元時間 nondim に変換して返します.
Original external subprogram is dcdatetimeeval.f90#DCDiffTimeEval1
EvalByUnit( diff, unit ) result(result)
EvalByUnit( time, unit ) result(result)
EvalDay( time ) result(result)
EvalDay( diff ) result(result)
EvalHour( time ) result(result)
EvalHour( diff ) result(result)
EvalMin( time ) result(result)
EvalMin( diff ) result(result)
EvalNondim( diff ) result(result)
EvalSec( time ) result(result)
EvalSec( diff ) result(result)
SetZone( time, zone, [err] )
Subroutine : |
|
time : | type(DC_DATETIME), intent(inout)
|
zone : | character(*), intent(in)
|
err : | logical, intent(out), optional
|
引数 time のタイムゾーンを zone へと変更します.
実質的な日時は変更しません.
引数 zone に不適切な値が与えられた場合, エラーを発生させます. 引数
err を与えている場合には err に .true. が返り,
プログラムは続行します.
Original external subprogram is dcdatetimezone.f90#DCDateTimeSetZone
ValidCaltype( caltype ) result(result)
ValidZone( zone ) result(result)
Function : |
|
result : | logical
|
zone : | character(*), intent(in)
|
与えられるタイムゾーンの表記が有効であれば .true. を, それ以外の場合は
.false. を返します.
タイムゾーンの表記は ’+09:00’ のように, 1 文字目が
’+’ または ’-’, 2〜3, 5〜6 文字目が数値で, 4
文字目が ’:’ となります.
Original external subprogram is dcdatetimezone.f90#DCDateTimeValidZone
ZoneToDiff( zone ) result(diff)
assignment(=)( time, sec )
assignment(=)( time, sec )
assignment(=)( time, sec )
assignment(=)( diff, sec )
assignment(=)( diff, sec )
assignment(=)( diff, sec )
Subroutine : |
|
day : | type(DC_SCALED_SEC), intent(inout)
|
sec : | type(DC_SCALED_SEC), intent(inout)
|
day_seconds : | type(DC_SCALED_SEC), intent(in), optional
|
nondim_flag : | logical, intent(in)
|
日と秒の正規化
このサブルーチンは内部向けなので dc_date
モジュール外では 極力使用しないでください.
日付 day と秒数 sec の正規化を行います. sec が
day_seconds (省略される場合は dc_date_types#day_seconds)
を超える場合, day に繰上げを行います. また, sec と day
の符号が逆の場合, 同符号になるよう 設定します.
[Source]
subroutine dcdate_normalize(day, sec, day_seconds, nondim_flag)
!
!=== 日と秒の正規化
!
! このサブルーチンは内部向けなので dc_date モジュール外では
! 極力使用しないでください.
!
! 日付 *day* と秒数 *sec* の正規化を行います. *sec* が *day_seconds*
! (省略される場合は dc_date_types#day_seconds) を超える場合, *day*
! に繰上げを行います.
! また, *sec* と *day* の符号が逆の場合, 同符号になるよう
! 設定します.
!
use dc_date_types, only: day_seconds_default => day_seconds
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), modulo, int, abs, sign
implicit none
type(DC_SCALED_SEC), intent(inout):: day
type(DC_SCALED_SEC), intent(inout):: sec
type(DC_SCALED_SEC), intent(in), optional:: day_seconds
logical, intent(in):: nondim_flag
type(DC_SCALED_SEC):: sgn, day_sec, zero_sec
continue
if ( nondim_flag ) return
if (present(day_seconds)) then
day_sec = day_seconds
else
day_sec = day_seconds_default
end if
if (abs(sec) >= day_sec) then
day = day + int(sec / day_sec)
sec = modulo(sec, day_sec)
end if
zero_sec = 0
if ( ( sec > zero_sec .and. day < zero_sec ) .or. ( sec < zero_sec .and. day > zero_sec ) ) then
sgn = sign(day, 1)
day = day - sgn
sec = sec + sgn * day_sec
endif
end subroutine dcdate_normalize
Function : |
|
unit : | character(TOKEN)
|
str : | character(*), intent(in)
|
このサブルーチンは内部向けなので dc_date
モジュール外では 極力使用しないでください.
引数 str に与えられた文字列を解釈し, 日時の単位を 返します.
それぞれ以下の文字列が日時の単位として解釈されます.
大文字と小文字は区別されません.
返る文字列は以下の文字型の配列の先頭の文字列です. (例: str に
‘hrs.’ が与えられる場合, dc_date_types#UNIT_HOUR
配列の先頭の文字列 UNIT_HOUR(1) が返ります.)
これらに該当しない文字列を str に与えた場合, 空文字が返ります.
[Source]
character(TOKEN) function dcdate_parse_unit(str) result(unit)
!
! このサブルーチンは内部向けなので dc_date モジュール外では
! 極力使用しないでください.
!
! 引数 *str* に与えられた文字列を解釈し, 日時の単位を
! 返します. それぞれ以下の文字列が日時の単位として解釈されます.
! 大文字と小文字は区別されません.
! 返る文字列は以下の文字型の配列の先頭の文字列です.
! (例: *str* に 'hrs.' が与えられる場合, dc_date_types#UNIT_HOUR
! 配列の先頭の文字列 UNIT_HOUR(1) が返ります.)
!
! 年 :: dc_date_types#UNIT_YEAR
! 月 :: dc_date_types#UNIT_MONTH
! 日 :: 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
!
! これらに該当しない文字列を *str* に与えた場合, 空文字が返ります.
!
use dc_types, only: TOKEN
use dc_date_types, only: UNIT_YEAR, UNIT_MONTH, UNIT_DAY, UNIT_HOUR, UNIT_MIN, UNIT_SEC, UNIT_NONDIM
use dc_string, only: StriEq
implicit none
character(*), intent(in):: str
integer :: unit_str_size, i
continue
unit = adjustl(str)
unit_str_size = size(UNIT_NONDIM)
do i = 1, unit_str_size
if (StriEq(trim(unit), trim(UNIT_NONDIM(i)))) then
unit = UNIT_NONDIM(1)
return
end if
end do
unit_str_size = size(UNIT_SEC)
do i = 1, unit_str_size
if (StriEq(trim(unit), trim(UNIT_SEC(i)))) then
unit = UNIT_SEC(1)
return
end if
end do
unit_str_size = size(UNIT_MIN)
do i = 1, unit_str_size
if (StriEq(trim(unit), trim(UNIT_MIN(i)))) then
unit = UNIT_MIN(1)
return
end if
end do
unit_str_size = size(UNIT_HOUR)
do i = 1, unit_str_size
if (StriEq(trim(unit), trim(UNIT_HOUR(i)))) then
unit = UNIT_HOUR(1)
return
end if
end do
unit_str_size = size(UNIT_DAY)
do i = 1, unit_str_size
if (StriEq(trim(unit), trim(UNIT_DAY(i)))) then
unit = UNIT_DAY(1)
return
end if
end do
unit_str_size = size(UNIT_MONTH)
do i = 1, unit_str_size
if (StriEq(trim(unit), trim(UNIT_MONTH(i)))) then
unit = UNIT_MONTH(1)
return
end if
end do
unit_str_size = size(UNIT_YEAR)
do i = 1, unit_str_size
if (StriEq(trim(unit), trim(UNIT_YEAR(i)))) then
unit = UNIT_YEAR(1)
return
end if
end do
unit = ''
end function dcdate_parse_unit
Function : |
|
result : | type(DC_DATETIME)
|
time1 : | type(DC_DATETIME), intent(in)
|
time2 : | type(DC_DATETIME), intent(in)
|
2 つの引数の日時を比較し, より日時が進んでいる方を返します.
[Source]
type(DC_DATETIME) function dcdate_max_tt(time1, time2) result(result)
!
! 2 つの引数の日時を比較し, より日時が進んでいる方を返します.
!
implicit none
type(DC_DATETIME), intent(in):: time1, time2
continue
if ( time1 > time2 ) then
result = time1
else
result = time2
end if
end function dcdate_max_tt
Function : |
|
result : | type(DC_DIFFTIME)
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較し, より大きい方を返します.
[Source]
type(DC_DIFFTIME) function dcdate_max_ff(diff1, diff2) result(result)
!
! 2 つの引数の日時差を比較し, より大きい方を返します.
!
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
if ( diff1 > diff2 ) then
result = diff1
else
result = diff2
end if
call dcdate_nondimcheck('dc_date#max', diff1, diff2, result)
end function dcdate_max_ff
Function : |
|
result : | type(DC_DATETIME)
|
time1 : | type(DC_DATETIME), intent(in)
|
time2 : | type(DC_DATETIME), intent(in)
|
2 つの引数の日時を比較し, より日時が遅れている方を返します.
[Source]
type(DC_DATETIME) function dcdate_min_tt(time1, time2) result(result)
!
! 2 つの引数の日時を比較し, より日時が遅れている方を返します.
!
implicit none
type(DC_DATETIME), intent(in):: time1, time2
continue
if ( time1 < time2 ) then
result = time1
else
result = time2
end if
end function dcdate_min_tt
Function : |
|
result : | type(DC_DIFFTIME)
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較し, より小さい方を返します.
[Source]
type(DC_DIFFTIME) function dcdate_min_ff(diff1, diff2) result(result)
!
! 2 つの引数の日時差を比較し, より小さい方を返します.
!
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
if ( diff1 < diff2 ) then
result = diff1
else
result = diff2
end if
call dcdate_nondimcheck('dc_date#min', diff1, diff2, result)
end function dcdate_min_ff
Function : |
|
result : | type(DC_DIFFTIME)
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
引数 diff1 を diff2 で除算した際の余りを返します.
※ 注意: 月差と日時の混在する除算は近似的結果になるおそれがあります
[Source]
type(DC_DIFFTIME) function dcdate_mod_ff(diff1, diff2) result(result)
!
! 引数 <b>diff1</b> を <b>diff2</b> で除算した際の余りを返します.
!
! ※ 注意: 月差と日時の混在する除算は近似的結果になるおそれがあります
!
use dc_date_types, only: CYCLIC_MDAYS
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(==), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), mod, modulo, int, abs, sign
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
real(DP):: sec1, sec2
continue
result % day_seconds = diff1 % day_seconds
if (diff1 % day == 0 .and. diff2 % day == 0 .and. diff1 % sec == 0.0 .and. diff2 % sec == 0.0) then
result % mon = mod(diff1 % mon, diff2 % mon)
result % day = 0
result % sec = 0.0
else if (diff1 % sec == 0.0 .and. diff2 % sec == 0.0) then
result % mon = 0
result % day = mod((CYCLIC_MDAYS * diff1 % mon + diff1 % day), (CYCLIC_MDAYS * diff2 % mon + diff2 % day))
result % sec = 0.0
else
sec1 = diff1 % day_seconds * (CYCLIC_MDAYS * diff1 % mon + diff1 % day) + diff1 % sec
sec2 = diff2 % day_seconds * (CYCLIC_MDAYS * diff2 % mon + diff2 % day) + diff2 % sec
result % sec = mod(sec1, sec2)
result % day = 0.0
result % mon = 0.0
call dcdate_normalize(result % day, result % sec, result % day_seconds, result % nondim_flag)
endif
call dcdate_nondimcheck('dc_date#mod', diff1, diff2, result)
end function dcdate_mod_ff
Function : |
|
result : | type(DC_DIFFTIME)
|
factor : | integer, intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
日時差 diff と facter とを乗算した結果を返します.
[Source]
type(DC_DIFFTIME) function dcdate_mul_if(factor, diff) result(result)
!
! 日時差 *diff* と *facter* とを乗算した結果を返します.
!
use dc_scaledsec, only: operator(*)
implicit none
integer, intent(in):: factor
type(DC_DIFFTIME), intent(in):: diff
continue
result % mon = factor * diff % mon
result % day = factor * diff % day
result % sec = factor * diff % sec
result % day_seconds = diff % day_seconds
result % nondim_flag = diff % nondim_flag
call dcdate_normalize(result % day, result % sec, result % day_seconds, result % nondim_flag)
end function dcdate_mul_if
Function : |
|
result : | type(DC_DIFFTIME)
|
diff : | type(DC_DIFFTIME), intent(in)
|
factor : | integer, intent(in)
|
[Source]
type(DC_DIFFTIME) function dcdate_mul_fi(diff, factor) result(result)
implicit none
type(DC_DIFFTIME), intent(in):: diff
integer, intent(in):: factor
continue
result = dcdate_mul_if(factor, diff)
end function dcdate_mul_fi
Function : |
|
result : | type(DC_DIFFTIME)
|
factor : | real, intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
※ 注意 : 月差を非整数倍すると近似的結果になるおそれがあります
[Source]
type(DC_DIFFTIME) function dcdate_mul_rf(factor, diff) result(result)
!
! ※ 注意 : 月差を非整数倍すると近似的結果になるおそれがあります
use dc_types, only: DP
implicit none
real, intent(in):: factor
type(DC_DIFFTIME), intent(in):: diff
continue
result = dcdate_mul_df(real(factor, DP), diff)
end function dcdate_mul_rf
Function : |
|
result : | type(DC_DIFFTIME)
|
diff : | type(DC_DIFFTIME), intent(in)
|
factor : | real, intent(in)
|
※ 注意 : 月差を非整数倍すると近似的結果になるおそれがあります
[Source]
type(DC_DIFFTIME) function dcdate_mul_fr(diff, factor) result(result)
!
! ※ 注意 : 月差を非整数倍すると近似的結果になるおそれがあります
implicit none
type(DC_DIFFTIME), intent(in):: diff
real, intent(in):: factor
continue
result = dcdate_mul_rf(factor, diff)
end function dcdate_mul_fr
Function : |
|
result : | type(DC_DIFFTIME)
|
factor : | real(DP), intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
※ 注意 : 月差を非整数倍すると近似的結果になるおそれがあります
[Source]
type(DC_DIFFTIME) function dcdate_mul_df(factor, diff) result(result)
!
! ※ 注意 : 月差を非整数倍すると近似的結果になるおそれがあります
use dc_types, only: DP
use dc_date_types, only: CYCLIC_MDAYS
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), modulo, int, abs, sign
implicit none
real(DP), intent(in):: factor
type(DC_DIFFTIME), intent(in):: diff
type(DC_SCALED_SEC):: month, day
continue
month = factor * diff % mon
result % mon = int(month)
day = factor * diff % day + int(CYCLIC_MDAYS * (month - result % mon))
result % day = int(day)
result % sec = factor * diff % sec + (day - result % day) * diff % day_seconds
result % day_seconds = diff % day_seconds
result % nondim_flag = diff % nondim_flag
call dcdate_normalize(result % day, result % sec, result % day_seconds, result % nondim_flag)
end function dcdate_mul_df
Function : |
|
result : | type(DC_DIFFTIME)
|
diff : | type(DC_DIFFTIME), intent(in)
|
factor : | real(DP), intent(in)
|
※ 注意 : 月差を非整数倍すると近似的結果になるおそれがあります
[Source]
type(DC_DIFFTIME) function dcdate_mul_fd(diff, factor) result(result)
!
! ※ 注意 : 月差を非整数倍すると近似的結果になるおそれがあります
use dc_types, only: DP
implicit none
type(DC_DIFFTIME), intent(in):: diff
real(DP), intent(in):: factor
continue
result = dcdate_mul_df(factor, diff)
end function dcdate_mul_fd
Function : |
|
result : | type(DC_DATETIME)
|
diff : | type(DC_DIFFTIME), intent(in)
|
time : | type(DC_DATETIME), intent(in)
|
2 つの日時 (DC_DATETIME 型) もしくは 日時差 (DC_DIFFTIME
型)の加算を行います.
[Source]
type(DC_DATETIME) function dcdate_add_ft(diff, time) result(result)
!
! 2 つの日時 (DC_DATETIME 型) もしくは
! 日時差 (DC_DIFFTIME 型)の加算を行います.
!
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), modulo, int, abs, sign
implicit none
type(DC_DIFFTIME), intent(in):: diff
type(DC_DATETIME), intent(in):: time
type(DC_SCALED_SEC):: time_year, time_mon, time_day, time_sec
integer:: time_caltype
character(6):: time_zone
continue
call Eval(time, sclyear = time_year, sclmon = time_mon, sclday = time_day, sclsec = time_sec, caltype = time_caltype, zone = time_zone)
call DCDateTimeCreate(result, sclyear = time_year, sclmon = time_mon + diff % mon, sclday = time_day + diff % day, sclsec = time_sec + diff % sec, caltype = time_caltype, zone = time_zone)
end function dcdate_add_ft
Function : |
|
result : | type(DC_DIFFTIME)
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
[Source]
type(DC_DIFFTIME) function dcdate_add_ff(diff1, diff2) result(result)
use dc_scaledsec, only: operator(+)
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
result % mon = diff1 % mon + diff2 % mon
result % day = diff1 % day + diff2 % day
result % sec = diff1 % sec + diff2 % sec
result % day_seconds = diff1 % day_seconds
call dcdate_nondimcheck('dc_date#operator(+)', diff1, diff2, result)
call dcdate_normalize(result % day, result % sec, result % day_seconds, result % nondim_flag)
end function dcdate_add_ff
Function : |
|
result : | type(DC_DATETIME)
|
time : | type(DC_DATETIME), intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
[Source]
type(DC_DATETIME) function dcdate_add_tf(time, diff) result(result)
use dc_types, only: DP
implicit none
type(DC_DATETIME), intent(in):: time
type(DC_DIFFTIME), intent(in):: diff
continue
result = dcdate_add_ft(diff, time)
end function dcdate_add_tf
Function : |
|
result : | type(DC_DATETIME)
|
time : | type(DC_DATETIME), intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
2 つの日時 (DC_DATETIME 型) もしくは 日時差 (DC_DIFFTIME
型)の減算を行います.
[Source]
type(DC_DATETIME) function dcdate_sub_tf(time, diff) result(result)
!
! 2 つの日時 (DC_DATETIME 型) もしくは
! 日時差 (DC_DIFFTIME 型)の減算を行います.
!
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), modulo, int, abs, sign
implicit none
type(DC_DATETIME), intent(in):: time
type(DC_DIFFTIME), intent(in):: diff
type(DC_SCALED_SEC):: time_year, time_mon, time_day, time_sec
integer:: time_caltype
character(6):: time_zone
continue
call Eval(time, sclyear = time_year, sclmon = time_mon, sclday = time_day, sclsec = time_sec, caltype = time_caltype, zone = time_zone )
call DCDateTimeCreate(result, sclyear = time_year, sclmon = time_mon - diff % mon, sclday = time_day - diff % day, sclsec = time_sec - diff % sec, caltype = time_caltype, zone = time_zone)
end function dcdate_sub_tf
Function : |
|
result : | type(DC_DIFFTIME)
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
[Source]
type(DC_DIFFTIME) function dcdate_sub_ff(diff1, diff2) result(result)
use dc_scaledsec, only: operator(-)
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
result % mon = diff1 % mon - diff2 % mon
result % day = diff1 % day - diff2 % day
result % sec = diff1 % sec - diff2 % sec
result % day_seconds = diff1 % day_seconds
call dcdate_nondimcheck('dc_date#operator(-)', diff1, diff2, result)
call dcdate_normalize(result % day, result % sec, result % day_seconds, result % nondim_flag)
end function dcdate_sub_ff
Function : |
|
result : | type(DC_DIFFTIME)
|
time1 : | type(DC_DATETIME), intent(in)
|
time2 : | type(DC_DATETIME), intent(in)
|
[Source]
type(DC_DIFFTIME) function dcdate_sub_tt(time1, time2) result(result)
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), modulo, int, abs, sign
implicit none
type(DC_DATETIME), intent(in):: time1, time2
continue
result % day = time1 % day - time2 % day
result % sec = time1 % sec - time2 % sec + EvalSclSec(ZoneToDiff(time1 % zone) - ZoneToDiff(time2 % zone))
result % day_seconds = time1 % day_seconds
call dcdate_normalize(result % day, result % sec, result % day_seconds, result % nondim_flag)
end function dcdate_sub_tt
Function : |
|
result : | type(DC_DIFFTIME)
|
diff : | type(DC_DIFFTIME), intent(in)
|
denominator : | integer, intent(in)
|
日時差 diff を denominator で除算した結果を返します.
※ 注意 : 月差を除算すると近似的結果になるおそれがあります
[Source]
type(DC_DIFFTIME) function dcdate_div_fi(diff, denominator) result(result)
!
! 日時差 *diff* を *denominator* で除算した結果を返します.
!
! ※ 注意 : 月差を除算すると近似的結果になるおそれがあります
use dc_date_types, only: CYCLIC_MDAYS
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), mod, modulo, int, abs, sign
implicit none
type(DC_DIFFTIME), intent(in):: diff
integer, intent(in):: denominator
continue
result % mon = int( diff % mon / denominator )
! 月からの近似的繰り下がりは日単位でしか行わない
result % day = int( diff % day / denominator ) + int( (CYCLIC_MDAYS * mod(diff % mon, denominator)) / denominator )
result % sec = diff % sec / denominator + (diff % day_seconds * mod(diff % day, denominator)) / denominator
result % nondim_flag = diff % nondim_flag
end function dcdate_div_fi
Function : |
|
result : | type(DC_DIFFTIME)
|
diff : | type(DC_DIFFTIME), intent(in)
|
denominator : | real(DP), intent(in)
|
※ 注意 : 月差を除算すると近似的結果になるおそれがあります
[Source]
type(DC_DIFFTIME) function dcdate_div_fd(diff, denominator) result(result)
!
! ※ 注意 : 月差を除算すると近似的結果になるおそれがあります
use dc_date_types, only: CYCLIC_MDAYS
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), modulo, int, abs, sign
implicit none
type(DC_DIFFTIME), intent(in):: diff
real(DP), intent(in):: denominator
type(DC_SCALED_SEC):: month, day
continue
month = int( diff % mon / denominator )
result % mon = int(month)
day = int( diff % day / denominator ) + int(CYCLIC_MDAYS * (month - result % mon))
result % day = int(day)
result % sec = diff % sec / denominator + (day - result % day) * diff % day_seconds
result % day_seconds = diff % day_seconds
result % nondim_flag = diff % nondim_flag
call dcdate_normalize(result % day, result % sec, result % day_seconds, result % nondim_flag)
end function dcdate_div_fd
Function : |
|
result : | type(DC_DIFFTIME)
|
diff : | type(DC_DIFFTIME), intent(in)
|
denominator : | real, intent(in)
|
※ 注意 : 月差を除算すると近似的結果になるおそれがあります
[Source]
type(DC_DIFFTIME) function dcdate_div_fr(diff, denominator) result(result)
!
! ※ 注意 : 月差を除算すると近似的結果になるおそれがあります
implicit none
type(DC_DIFFTIME), intent(in):: diff
real, intent(in):: denominator
continue
result = dcdate_div_fd(diff, real(denominator, DP))
end function dcdate_div_fr
Function : |
|
result : | real(DP)
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
※ 注意 : 月差と日時の混在する除算は近似的結果になるおそれがあります
[Source]
real(DP) function dcdate_div_ff(diff1, diff2) result(result)
!
! ※ 注意 : 月差と日時の混在する除算は近似的結果になるおそれがあります
use dc_date_types, only: CYCLIC_MDAYS
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), modulo, int, abs, sign
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
! ゼロ割対応コードが必要か?
result = (diff1 % day_seconds * (CYCLIC_MDAYS * diff1 % mon + diff1 % day) + diff1 % sec) / (diff2 % day_seconds * (CYCLIC_MDAYS * diff2 % mon + diff2 % day) + diff2 % sec)
end function dcdate_div_ff
Function : |
|
result : | logical
|
time1 : | type(DC_DATETIME), intent(in)
|
time2 : | type(DC_DATETIME), intent(in)
|
2 つの引数の日時を比較します. 2 つ目の引数に格納される日時が 1
つ目の引数に格納される日時 よりも進んでいる場合, .true. が返ります.
[Source]
logical function dcdate_lt_tt(time1, time2) result(result)
!
! 2 つの引数の日時を比較します.
! 2 つ目の引数に格納される日時が 1 つ目の引数に格納される日時
! よりも進んでいる場合, .true. が返ります.
!
use dc_scaledsec, only: DC_SCALED_SEC, operator(==), operator(<), operator(>), operator(<=), operator(>=), operator(+)
implicit none
type(DC_DATETIME), intent(in):: time1, time2
type(DC_SCALED_SEC):: year1, year2, time1_sec, time2_sec
continue
call Eval(time1, sclyear=year1)
call Eval(time2, sclyear=year2)
if (year1 < year2) then
result = .true.
elseif (year1 > year2) then
result = .false.
else
time1_sec = EvalSclSec(time1) + EvalSclSec(ZoneToDiff(time1 % zone))
time2_sec = EvalSclSec(time2) + EvalSclSec(ZoneToDiff(time2 % zone))
if (time1_sec < time2_sec) then
result = .true.
else
result = .false.
end if
end if
end function dcdate_lt_tt
Function : |
|
result : | logical
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較します. 2 つ目の引数に格納される日時差が 1
つ目の引数に格納される日時差 よりも大きい場合, .true. が返ります.
[Source]
logical function dcdate_lt_ff(diff1, diff2) result(result)
!
! 2 つの引数の日時差を比較します.
! 2 つ目の引数に格納される日時差が 1 つ目の引数に格納される日時差
! よりも大きい場合, .true. が返ります.
!
use dc_scaledsec, only: operator(<), operator(>), operator(<=), operator(>=)
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
if (EvalSclSec(diff1) < EvalSclSec(diff2)) then
result = .true.
else
result = .false.
end if
end function dcdate_lt_ff
Function : |
|
result : | logical
|
diff : | type(DC_DIFFTIME), intent(in)
|
factor : | integer, intent(in)
|
2 つの引数の日時差を比較します. 2 つ目の引数に格納される日時差が 1
つ目の引数に格納される日時差 よりも大きい場合, .true. が返ります.
[Source]
logical function dcdate_lt_fi(diff, factor) result(result)
!
! 2 つの引数の日時差を比較します.
! 2 つ目の引数に格納される日時差が 1 つ目の引数に格納される日時差
! よりも大きい場合, .true. が返ります.
!
implicit none
type(DC_DIFFTIME), intent(in):: diff
integer, intent(in):: factor
type(DC_DIFFTIME):: fdiff
continue
call DCDiffTimeCreate( fdiff, sec = real( factor, DP ) ) ! (in)
result = diff < fdiff
end function dcdate_lt_fi
Function : |
|
result : | logical
|
factor : | integer, intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較します. 2 つ目の引数に格納される日時差が 1
つ目の引数に格納される日時差 よりも大きい場合, .true. が返ります.
[Source]
logical function dcdate_lt_if(factor, diff) result(result)
!
! 2 つの引数の日時差を比較します.
! 2 つ目の引数に格納される日時差が 1 つ目の引数に格納される日時差
! よりも大きい場合, .true. が返ります.
!
implicit none
integer, intent(in):: factor
type(DC_DIFFTIME), intent(in):: diff
type(DC_DIFFTIME):: fdiff
continue
call DCDiffTimeCreate( fdiff, sec = real( factor, DP ) ) ! (in)
result = fdiff < diff
end function dcdate_lt_if
Function : |
|
result : | logical
|
time1 : | type(DC_DATETIME), intent(in)
|
time2 : | type(DC_DATETIME), intent(in)
|
2 つの引数の日時を比較します. 2 つ目の引数に格納される日時が 1
つ目の引数に格納される日時 よりも進んでいる場合かもしくは等しい場合, .true.
が返ります.
[Source]
logical function dcdate_le_tt(time1, time2) result(result)
!
! 2 つの引数の日時を比較します.
! 2 つ目の引数に格納される日時が 1 つ目の引数に格納される日時
! よりも進んでいる場合かもしくは等しい場合, .true. が返ります.
!
implicit none
type(DC_DATETIME), intent(in):: time1, time2
continue
if ( time1 == time2 ) then
result = .true.
elseif ( time1 < time2 ) then
result = .true.
else
result = .false.
end if
end function dcdate_le_tt
Function : |
|
result : | logical
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較します. 2 つ目の引数に格納される日時差が 1
つ目の引数に格納される日時差 よりも大きい場合かもしくは等しい場合, .true.
が返ります.
[Source]
logical function dcdate_le_ff(diff1, diff2) result(result)
!
! 2 つの引数の日時差を比較します.
! 2 つ目の引数に格納される日時差が 1 つ目の引数に格納される日時差
! よりも大きい場合かもしくは等しい場合, .true. が返ります.
!
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
if ( diff1 == diff2 ) then
result = .true.
elseif ( diff1 < diff2 ) then
result = .true.
else
result = .false.
end if
end function dcdate_le_ff
Function : |
|
result : | logical
|
diff : | type(DC_DIFFTIME), intent(in)
|
factor : | integer, intent(in)
|
2 つの引数の日時差を比較します. 2 つ目の引数に格納される日時差が 1
つ目の引数に格納される日時差 よりも大きい場合かもしくは等しい場合, .true.
が返ります.
[Source]
logical function dcdate_le_fi(diff, factor) result(result)
!
! 2 つの引数の日時差を比較します.
! 2 つ目の引数に格納される日時差が 1 つ目の引数に格納される日時差
! よりも大きい場合かもしくは等しい場合, .true. が返ります.
!
implicit none
type(DC_DIFFTIME), intent(in):: diff
integer, intent(in):: factor
type(DC_DIFFTIME):: fdiff
continue
call DCDiffTimeCreate( fdiff, sec = real( factor, DP ) ) ! (in)
result = diff <= fdiff
end function dcdate_le_fi
Function : |
|
result : | logical
|
factor : | integer, intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較します. 2 つ目の引数に格納される日時差が 1
つ目の引数に格納される日時差 よりも大きい場合かもしくは等しい場合, .true.
が返ります.
[Source]
logical function dcdate_le_if(factor, diff) result(result)
!
! 2 つの引数の日時差を比較します.
! 2 つ目の引数に格納される日時差が 1 つ目の引数に格納される日時差
! よりも大きい場合かもしくは等しい場合, .true. が返ります.
!
implicit none
integer, intent(in):: factor
type(DC_DIFFTIME), intent(in):: diff
type(DC_DIFFTIME):: fdiff
continue
call DCDiffTimeCreate( fdiff, sec = real( factor, DP ) ) ! (in)
result = fdiff <= diff
end function dcdate_le_if
Function : |
|
result : | logical
|
time1 : | type(DC_DATETIME), intent(in)
|
time2 : | type(DC_DATETIME), intent(in)
|
2 つの引数の日時を比較します. 1 つ目の引数に格納される日時が 2
つ目の引数に格納される日時 と同じ場合, .true. が返ります.
[Source]
logical function dcdate_eq_tt(time1, time2) result(result)
!
! 2 つの引数の日時を比較します.
! 1 つ目の引数に格納される日時が 2 つ目の引数に格納される日時
! と同じ場合, .true. が返ります.
!
use dc_scaledsec, only: DC_SCALED_SEC, operator(==), operator(<), operator(>), operator(<=), operator(>=), operator(+), assignment(=)
implicit none
type(DC_DATETIME), intent(in):: time1, time2
type(DC_SCALED_SEC):: year1, year2, time1_sec, time2_sec
continue
call Eval(time1, sclyear=year1)
call Eval(time2, sclyear=year2)
time1_sec = EvalSclSec(time1) + EvalSclSec(ZoneToDiff(time1 % zone))
time2_sec = EvalSclSec(time2) + EvalSclSec(ZoneToDiff(time2 % zone))
if (year1 == year2 .and. time1_sec == time2_sec) then
result = .true.
else
result = .false.
end if
end function dcdate_eq_tt
Function : |
|
result : | logical
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較します. 1 つ目の引数に格納される日時差が 2
つ目の引数に格納される日時差 と同じ場合, .true. が返ります.
[Source]
logical function dcdate_eq_ff(diff1, diff2) result(result)
!
! 2 つの引数の日時差を比較します.
! 1 つ目の引数に格納される日時差が 2 つ目の引数に格納される日時差
! と同じ場合, .true. が返ります.
!
use dc_scaledsec, only: operator(==)
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
if (EvalSclSec(diff1) == EvalSclSec(diff2)) then
result = .true.
else
result = .false.
end if
end function dcdate_eq_ff
Function : |
|
result : | logical
|
i : | integer, intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
引数 diff の日時差が i と等しいかどうかを比較します.
diff を秒数に換算した値と i とが等しい場合, .true.
が返ります.
[Source]
logical function dcdate_eq_if(i, diff) result(result)
!
! 引数 *diff* の日時差が *i* と等しいかどうかを比較します. *diff*
! を秒数に換算した値と *i* とが等しい場合, .true. が返ります.
!
implicit none
type(DC_DIFFTIME), intent(in):: diff
integer, intent(in):: i
continue
result = dcdate_eq_rf(real(i), diff)
end function dcdate_eq_if
Function : |
|
result : | logical
|
diff : | type(DC_DIFFTIME), intent(in)
|
i : | integer, intent(in)
|
[Source]
logical function dcdate_eq_fi(diff, i) result(result)
implicit none
type(DC_DIFFTIME), intent(in):: diff
integer, intent(in):: i
continue
result = dcdate_eq_if(i, diff)
end function dcdate_eq_fi
Function : |
|
result : | logical
|
r : | real, intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
引数 diff の日時差が r と等しいかどうかを比較します.
diff を秒数に換算した値と r とが等しい場合, .true.
が返ります.
[Source]
logical function dcdate_eq_rf(r, diff) result(result)
!
! 引数 *diff* の日時差が *r* と等しいかどうかを比較します. *diff*
! を秒数に換算した値と *r* とが等しい場合, .true. が返ります.
!
use dc_scaledsec, only: operator(==)
implicit none
type(DC_DIFFTIME), intent(in):: diff
real, intent(in):: r
continue
if (EvalSclSec(diff) == r) then
result = .true.
else
result = .false.
end if
end function dcdate_eq_rf
Function : |
|
result : | logical
|
diff : | type(DC_DIFFTIME), intent(in)
|
r : | real, intent(in)
|
[Source]
logical function dcdate_eq_fr(diff, r) result(result)
implicit none
type(DC_DIFFTIME), intent(in):: diff
real, intent(in):: r
continue
result = dcdate_eq_rf(r, diff)
end function dcdate_eq_fr
Function : |
|
result : | logical
|
d : | real(DP), intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
引数 diff の日時差が d と等しいかどうかを比較します.
diff を秒数に換算した値と d とが等しい場合, .true.
が返ります.
[Source]
logical function dcdate_eq_df(d, diff) result(result)
!
! 引数 *diff* の日時差が *d* と等しいかどうかを比較します. *diff*
! を秒数に換算した値と *d* とが等しい場合, .true. が返ります.
!
use dc_types, only: DP
use dc_scaledsec, only: operator(==)
implicit none
type(DC_DIFFTIME), intent(in):: diff
real(DP), intent(in):: d
continue
if (EvalSclSec(diff) == d) then
result = .true.
else
result = .false.
end if
end function dcdate_eq_df
Function : |
|
result : | logical
|
diff : | type(DC_DIFFTIME), intent(in)
|
d : | real(DP), intent(in)
|
[Source]
logical function dcdate_eq_fd(diff, d) result(result)
use dc_types, only: DP
implicit none
type(DC_DIFFTIME), intent(in):: diff
real(DP), intent(in):: d
continue
result = dcdate_eq_df(d, diff)
end function dcdate_eq_fd
Function : |
|
result : | logical
|
time1 : | type(DC_DATETIME), intent(in)
|
time2 : | type(DC_DATETIME), intent(in)
|
2 つの引数の日時を比較します. 1 つ目の引数に格納される日時が 2
つ目の引数に格納される日時 よりも進んでいる場合, .true. が返ります.
[Source]
logical function dcdate_gt_tt(time1, time2) result(result)
!
! 2 つの引数の日時を比較します.
! 1 つ目の引数に格納される日時が 2 つ目の引数に格納される日時
! よりも進んでいる場合, .true. が返ります.
!
use dc_scaledsec, only: DC_SCALED_SEC, assignment(=), operator(==), operator(<), operator(>), operator(<=), operator(>=), operator(+), operator(-), operator(*), operator(/), mod, modulo, int, abs, sign
implicit none
type(DC_DATETIME), intent(in):: time1, time2
type(DC_SCALED_SEC):: year1, year2, time1_sec, time2_sec
continue
call Eval(time1, sclyear=year1)
call Eval(time2, sclyear=year2)
if (year1 > year2) then
result = .true.
elseif (year1 < year2) then
result = .false.
else
time1_sec = EvalSclSec(time1) + EvalSclSec(ZoneToDiff(time1 % zone))
time2_sec = EvalSclSec(time2) + EvalSclSec(ZoneToDiff(time2 % zone))
if (time1_sec > time2_sec) then
result = .true.
else
result = .false.
end if
end if
end function dcdate_gt_tt
Function : |
|
result : | logical
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較します. 1 つ目の引数に格納される日時差が 2
つ目の引数に格納される日時差 よりも大きい場合, .true. が返ります.
[Source]
logical function dcdate_gt_ff(diff1, diff2) result(result)
!
! 2 つの引数の日時差を比較します.
! 1 つ目の引数に格納される日時差が 2 つ目の引数に格納される日時差
! よりも大きい場合, .true. が返ります.
!
use dc_date_types, only: CYCLIC_MDAYS
use dc_scaledsec, only: operator(<), operator(>), operator(<=), operator(>=)
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
if (EvalSclSec(diff1) > EvalSclSec(diff2)) then
result = .true.
else
result = .false.
end if
end function dcdate_gt_ff
Function : |
|
result : | logical
|
diff : | type(DC_DIFFTIME), intent(in)
|
factor : | integer, intent(in)
|
2 つの引数の日時差を比較します. 1 つ目の引数に格納される日時差が 2
つ目の引数に格納される日時差 よりも大きい場合, .true. が返ります.
[Source]
logical function dcdate_gt_fi(diff, factor) result(result)
!
! 2 つの引数の日時差を比較します.
! 1 つ目の引数に格納される日時差が 2 つ目の引数に格納される日時差
! よりも大きい場合, .true. が返ります.
!
use dc_date_types, only: CYCLIC_MDAYS
implicit none
type(DC_DIFFTIME), intent(in):: diff
integer, intent(in):: factor
type(DC_DIFFTIME):: fdiff
continue
call DCDiffTimeCreate( fdiff, sec = real( factor, DP ) ) ! (in)
result = diff > fdiff
end function dcdate_gt_fi
Function : |
|
result : | logical
|
factor : | integer, intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較します. 1 つ目の引数に格納される日時差が 2
つ目の引数に格納される日時差 よりも大きい場合, .true. が返ります.
[Source]
logical function dcdate_gt_if(factor, diff) result(result)
!
! 2 つの引数の日時差を比較します.
! 1 つ目の引数に格納される日時差が 2 つ目の引数に格納される日時差
! よりも大きい場合, .true. が返ります.
!
use dc_date_types, only: CYCLIC_MDAYS
implicit none
integer, intent(in):: factor
type(DC_DIFFTIME), intent(in):: diff
type(DC_DIFFTIME):: fdiff
continue
call DCDiffTimeCreate( fdiff, sec = real( factor, DP ) ) ! (in)
result = fdiff > diff
end function dcdate_gt_if
Function : |
|
result : | logical
|
time1 : | type(DC_DATETIME), intent(in)
|
time2 : | type(DC_DATETIME), intent(in)
|
2 つの引数の日時を比較します. 1 つ目の引数に格納される日時が 2
つ目の引数に格納される日時 よりも進んでいる場合かもしくは等しい場合, .true.
が返ります.
[Source]
logical function dcdate_ge_tt(time1, time2) result(result)
!
! 2 つの引数の日時を比較します.
! 1 つ目の引数に格納される日時が 2 つ目の引数に格納される日時
! よりも進んでいる場合かもしくは等しい場合, .true. が返ります.
!
implicit none
type(DC_DATETIME), intent(in):: time1, time2
continue
if ( time1 == time2 ) then
result = .true.
elseif ( time1 > time2 ) then
result = .true.
else
result = .false.
end if
end function dcdate_ge_tt
Function : |
|
result : | logical
|
diff1 : | type(DC_DIFFTIME), intent(in)
|
diff2 : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較します. 1 つ目の引数に格納される日時差が 2
つ目の引数に格納される日時差 よりも大きい場合かもしくは等しい場合, .true.
が返ります.
[Source]
logical function dcdate_ge_ff(diff1, diff2) result(result)
!
! 2 つの引数の日時差を比較します.
! 1 つ目の引数に格納される日時差が 2 つ目の引数に格納される日時差
! よりも大きい場合かもしくは等しい場合, .true. が返ります.
!
implicit none
type(DC_DIFFTIME), intent(in):: diff1, diff2
continue
if ( diff1 == diff2 ) then
result = .true.
elseif ( diff1 > diff2 ) then
result = .true.
else
result = .false.
end if
end function dcdate_ge_ff
Function : |
|
result : | logical
|
diff : | type(DC_DIFFTIME), intent(in)
|
factor : | integer, intent(in)
|
2 つの引数の日時差を比較します. 1 つ目の引数に格納される日時差が 2
つ目の引数に格納される日時差 よりも大きい場合かもしくは等しい場合, .true.
が返ります.
[Source]
logical function dcdate_ge_fi(diff, factor) result(result)
!
! 2 つの引数の日時差を比較します.
! 1 つ目の引数に格納される日時差が 2 つ目の引数に格納される日時差
! よりも大きい場合かもしくは等しい場合, .true. が返ります.
!
implicit none
type(DC_DIFFTIME), intent(in):: diff
integer, intent(in):: factor
type(DC_DIFFTIME):: fdiff
continue
call DCDiffTimeCreate( fdiff, sec = real( factor, DP ) ) ! (in)
result = diff >= fdiff
end function dcdate_ge_fi
Function : |
|
result : | logical
|
factor : | integer, intent(in)
|
diff : | type(DC_DIFFTIME), intent(in)
|
2 つの引数の日時差を比較します. 1 つ目の引数に格納される日時差が 2
つ目の引数に格納される日時差 よりも大きい場合かもしくは等しい場合, .true.
が返ります.
[Source]
logical function dcdate_ge_if(factor, diff) result(result)
!
! 2 つの引数の日時差を比較します.
! 1 つ目の引数に格納される日時差が 2 つ目の引数に格納される日時差
! よりも大きい場合かもしくは等しい場合, .true. が返ります.
!
implicit none
integer, intent(in):: factor
type(DC_DIFFTIME), intent(in):: diff
type(DC_DIFFTIME):: fdiff
continue
call DCDiffTimeCreate( fdiff, sec = real( factor, DP ) ) ! (in)
result = fdiff >= diff
end function dcdate_ge_if
toChar( time ) result(result)
toChar( diff ) result(result)
Function : |
|
result : | character(STRING)
|
diff : | type(DC_DIFFTIME), intent(in)
|
dc_date_types#DC_DIFFTIME
型変数を文字型変数へ変換して返します. 書式は以下のようになります.
YYYY-MM-DDThh:mm:ss.s
YYYY は年, MM は月, DD は日, hh は時, mm は分, ss.s は秒を表します. ただし,
DD は 2 桁を超える場合があります. (dc_date_types#DC_DIFFTIME は X
ヶ月後, X 日前, などを表現するため のデータ型なので, 日を月に繰り上げたり,
月を日に繰り下げることを しません. また「年」の情報も持ちません. 1
年の日数や 1 月の日数は dc_date_types#DC_DATETIME
側で決まります).
なお, DCDiffTimeCreate において, 単位を
‘1’ とした場合は無時限時間と 扱うため,
以下のような書式となります.
ss.s
Original external subprogram is dcdatetimetochar.f90#DCDiffTimeToChar