gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dcdatetimemin.f90
Go to the documentation of this file.
1! -*- mode: f90; coding: utf-8 -*-
2!-----------------------------------------------------------------------
3! Copyright (c) 2000-2026 Gtool Development Group. All rights reserved.
4!-----------------------------------------------------------------------
5!>
6!> @author Yasuhiro MORIKAWA
7!> @copyright Copyright (C) GFD Dennou Club, 2000-2026. All rights reserved. <br/>
8!> License is BSD-2-Clause. see [COPYRIGHT](@ref COPYRIGHT) in detail
9!> @en
10!> @brief User defined function "min"
11!> @details
12!> This file contains implementation procedures of "min" function
13!> for dc_date_types#DC_DATETIME and dc_date_types#DC_DIFFTIME.
14!> @enden
15!>
16!> @ja
17!> @brief 利用者定義関数 min
18!> @details
19!> このファイルには dc_date_types#DC_DATETIME および dc_date_types#DC_DIFFTIME
20!> 用の "min" 関数の実装手続きが含まれています。
21!> @endja
22!>
23
24!> @en
25!> @brief Return the earlier of two DC_DATETIME values
26!> @details
27!> Compare two datetime values and return the one that is earlier.
28!>
29!> @param[in] time1 First datetime to compare
30!> @param[in] time2 Second datetime to compare
31!> @return The datetime that is earlier
32!> @enden
33!>
34!> @ja
35!> @brief 2つの DC_DATETIME 値のうち、より遅れている方を返す
36!> @details
37!> 2 つの引数の日時を比較し, より日時が遅れている方を返します.
38!>
39!> @param[in] time1 比較する1番目の日時
40!> @param[in] time2 比較する2番目の日時
41!> @return より遅れている日時
42!> @endja
43function dcdatetime_min_tt(time1, time2) result(result)
44
45 use dc_date_generic, only: operator(<)
47 implicit none
48 type(dc_datetime):: result
49 type(dc_datetime), intent(in):: time1, time2
50continue
51 if ( time1 < time2 ) then
52 result = time1
53 else
54 result = time2
55 end if
56end function dcdatetime_min_tt
57
58!> @en
59!> @brief Return the smaller of two DC_DIFFTIME values
60!> @details
61!> Compare two time difference values and return the smaller one.
62!>
63!> @param[in] diff1 First time difference to compare
64!> @param[in] diff2 Second time difference to compare
65!> @return The time difference that is smaller
66!> @enden
67!>
68!> @ja
69!> @brief 2つの DC_DIFFTIME 値のうち、より小さい方を返す
70!> @details
71!> 2 つの引数の日時差を比較し, より小さい方を返します.
72!>
73!> @param[in] diff1 比較する1番目の日時差
74!> @param[in] diff2 比較する2番目の日時差
75!> @return より小さい日時差
76!> @endja
77function dcdatetime_min_ff(diff1, diff2) result(result)
78
79 use dc_date_generic, only: operator(<)
82 implicit none
83 type(dc_difftime):: result
84 type(dc_difftime), intent(in):: diff1, diff2
85continue
86 if ( diff1 < diff2 ) then
87 result = diff1
88 else
89 result = diff2
90 end if
91 call dcdate_nondimcheck('dc_date#min', diff1, diff2, result)
92end function dcdatetime_min_ff
type(dc_difftime) function dcdatetime_min_ff(diff1, diff2)
type(dc_datetime) function dcdatetime_min_tt(time1, time2)
利用者定義関数 min
dc_date より提供される手続の引用仕様宣言
dc_date用の内部モジュール
subroutine, public dcdate_nondimcheck(opr, diff1, diff2, rslt)
日付・時刻に関する構造データ型と定数