gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dc_calendar_types.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 Youhei SASAKI, Yasuhiro MORIKAWA
7!> @copyright Copyright (C) GFD Dennou Club, 2009-2026. All rights reserved. <br/>
8!> License is BSD-2-Clause. see [COPYRIGHT](@ref COPYRIGHT) in detail
9!> @en
10!> @brief Derived types and parameters of calendar and date
11!> @details
12!> Derived types and parameters for "dc_calendar" are provided.
13!>
14!> @section caltypes_types Derived types
15!>
16!> | Type | Description |
17!> |--------------|--------------------------------------------------|
18!> | DC_CAL | Calendar information |
19!> | DC_CAL_DATE | Date information |
20!>
21!> @section caltypes_calparams Calendar type parameters
22!>
23!> | Parameter | Description |
24!> |-------------------|---------------------------------------------|
25!> | CAL_USER_DEFINED | User-defined calendar with arbitrary settings |
26!> | CAL_GREGORIAN | Gregorian calendar |
27!> | CAL_JULIAN | Julian calendar |
28!> | CAL_NOLEAP | Calendar without leap year |
29!> | CAL_360DAY | Calendar with 30 days per month |
30!> | CAL_CYCLIC | Cyclic calendar (30.6 days per month) |
31!>
32!> @section caltypes_units Unit strings and symbols
33!>
34!> | Parameter | Description |
35!> |------------------|----------------------------------------------|
36!> | UNIT_SEC | Strings for second unit |
37!> | UNIT_MIN | Strings for minute unit |
38!> | UNIT_HOUR | Strings for hour unit |
39!> | UNIT_DAY | Strings for day unit |
40!> | UNIT_MONTH | Strings for month unit |
41!> | UNIT_YEAR | Strings for year unit |
42!> | UNIT_SYMBOL_* | Integer symbols for units |
43!>
44!> @enden
45!>
46!> @ja
47!> @brief 暦と日時に関する構造データ型と定数
48!> @details
49!> dc_calendar に関連する構造体や定数を提供します.
50!>
51!> @section caltypes_types_ja 派生型一覧
52!>
53!> | 型 | 説明 |
54!> |--------------|------------------------------------------------|
55!> | DC_CAL | 暦情報 |
56!> | DC_CAL_DATE | 日時情報 |
57!>
58!> @section caltypes_calparams_ja 暦タイプパラメータ
59!>
60!> | パラメータ | 説明 |
61!> |-------------------|---------------------------------------------|
62!> | CAL_USER_DEFINED | 任意に設定可能なユーザー定義暦 |
63!> | CAL_GREGORIAN | グレゴリオ暦 |
64!> | CAL_JULIAN | ユリウス暦 |
65!> | CAL_NOLEAP | 閏年無しの暦 |
66!> | CAL_360DAY | 1ヶ月が 30 日の暦 |
67!> | CAL_CYCLIC | 周期暦 (1ヶ月 30.6 日) |
68!>
69!> @section caltypes_units_ja 単位文字列とシンボル
70!>
71!> | パラメータ | 説明 |
72!> |------------------|----------------------------------------------|
73!> | UNIT_SEC | 秒の単位を示す文字列 |
74!> | UNIT_MIN | 分の単位を示す文字列 |
75!> | UNIT_HOUR | 時間の単位を示す文字列 |
76!> | UNIT_DAY | 日の単位を示す文字列 |
77!> | UNIT_MONTH | 月の単位を示す文字列 |
78!> | UNIT_YEAR | 年の単位を示す文字列 |
79!> | UNIT_SYMBOL_* | 単位を示す整数シンボル |
80!>
81!> @endja
82!>
83
85 !
86
87 use dc_types, only: dp, token
88 implicit none
89
90 private
91 public:: dc_cal, dc_cal_date
94 public:: unit_sec, unit_min, unit_hour, &
99
100 integer, parameter:: cal_user_defined = 1
101 ! 利用者が任意で指定する暦.
102 ! User defined calendar.
103 !
104 integer, parameter:: cal_cyclic = 2 ! 1 ヵ月を 30.6 日 (CYCLIC_MDAYS)
105 ! とする暦.
106 !
107 ! All months are 30.6 day.
108 !
109 integer, parameter:: cal_noleap = 3 ! 1 年 365 日 (閏年無し) の暦.
110 !
111 ! Gregorian calendar without
112 ! leap years, i.e., all years
113 ! are 365 days long.
114 !
115 integer, parameter:: cal_julian = 4 ! ユリウス暦.
116 ! Julian calendar.
117 !
118 integer, parameter:: cal_gregorian = 5 ! グレゴリオ暦.
119 ! Gregorian calendar.
120 !
121 integer, parameter:: cal_360day = 6 ! 1 年 360 日 (1 月 30 日) の暦.
122 !
123 ! All years are 360 days
124 ! divided into 30 day months.
125
126 !> @en
127 !> @brief Derived type for calendar
128 !> @details
129 !> A derived type that expresses calendar.
130 !>
131 !> Do not refer and modify elements of this derived type directly.
132 !> Use procedures provided by "dc_calendar_generic" for handling
133 !> this derived type.
134 !> @enden
135 !>
136 !> @ja
137 !> @brief 暦を表現する派生型
138 !> @details
139 !> 暦を表現する構造体.
140 !>
141 !> この構造体の要素を直接参照および変更してはなりません.
142 !> この構造体を扱う上では必ず dc_calendar_generic より提供される
143 !> 手続きを用いてください.
144 !> @endja
146 logical:: initialized = .false. !< @en Initialization flag @enden @ja 初期設定フラグ @endja
147 integer:: month_in_year !< @en Months in a year @enden @ja 1年の月数 @endja
148 integer, pointer:: day_in_month(:) => null() !< @en Days in months @enden @ja 1ヶ月の日数 @endja
149 integer:: hour_in_day !< @en Hours in a day @enden @ja 1日の時間数 @endja
150 integer:: min_in_hour !< @en Minutes in a hour @enden @ja 1時間の分数 @endja
151 real(dp):: sec_in_min !< @en Seconds in a minute @enden @ja 1分の秒数 @endja
152 integer:: cal_type !< @en Kind of calendar @enden @ja 暦の種別 @endja
153 end type dc_cal
154
155 !> @en
156 !> @brief Derived type for date
157 !> @details
158 !> A derived type that expresses date.
159 !>
160 !> Do not refer and modify elements of this derived type directly.
161 !> Use procedures provided by "dc_calendar_generic" for handling
162 !> this derived type.
163 !> @enden
164 !>
165 !> @ja
166 !> @brief 日時を表現する派生型
167 !> @details
168 !> 日時を表現する構造体.
169 !>
170 !> この構造体の要素を直接参照および変更してはなりません.
171 !> この構造体を扱う上では必ず dc_calendar_generic より提供される
172 !> 手続きを用いてください.
173 !> @endja
175 logical:: initialized = .false. !< @en Initialization flag @enden @ja 初期設定フラグ @endja
176 integer:: year !< @en Year @enden @ja 年 @endja
177 integer:: month !< @en Month @enden @ja 月 @endja
178 integer:: day !< @en Day @enden @ja 日 @endja
179 integer:: hour !< @en Hour @enden @ja 時 @endja
180 integer:: min !< @en Minute @enden @ja 分 @endja
181 real(dp):: sec !< @en Seconds @enden @ja 秒 @endja
182 character(TOKEN):: zone !< @en Time-zone (offset from UTC) @enden @ja UTCからの時差 @endja
183 end type dc_cal_date
184
185 ! 日時の単位として認識される文字列
186 ! Strings recognized as units of date and time
187 !
188 character(*), parameter, dimension(8) :: unit_sec = (/ &
189 & 'seconds', 'second ', 'secs. ', 'secs ', &
190 & 'sec. ', 'sec ', 's. ', 's '/) ! 秒の単位を示す文字列
191
192 character(*), parameter, dimension(4) :: unit_min = (/ &
193 & 'minutes', 'minute ', 'min. ', 'min '/) ! 分の単位を示す文字列
194 character(*), parameter, dimension(8) :: unit_hour = (/ &
195 & 'hours', 'hour ', 'hrs. ', 'hrs ', &
196 & 'hr. ', 'hr ', 'h. ', 'h '/) ! 時の単位を示す文字列
197 character(*), parameter, dimension(4) :: unit_day = (/ &
198 & 'days', 'day ', 'd. ', 'd '/) ! 日の単位を示す文字列
199 character(*), parameter, dimension(6) :: unit_month = (/ &
200 & 'months', 'month ', 'mon. ', &
201 & 'mon ', 'mo. ', 'mo '/) ! 月の単位を示す文字列
202 character(*), parameter, dimension(4) :: unit_year = (/ &
203 & 'years', 'year ', 'yr. ', 'yr '/) ! 年の単位を示す文字列
204
205
206 ! 日時の単位のシンボル
207 ! Synbols of units of date and time
208 !
209 integer, parameter:: unit_symbol_err = -1 ! 無効な単位を示すシンボル
210 integer, parameter:: unit_symbol_sec = 2 ! 秒の単位を示すシンボル
211 integer, parameter:: unit_symbol_min = 3 ! 分の単位を示すシンボル
212 integer, parameter:: unit_symbol_hour = 4 ! 時間の単位を示すシンボル
213 integer, parameter:: unit_symbol_day = 5 ! 日の単位を示すシンボル
214 integer, parameter:: unit_symbol_month = 6 ! 月の単位を示すシンボル
215 integer, parameter:: unit_symbol_year = 7 ! 年の単位を示すシンボル
216
217 !> @namespace dc_calendar_types
218end module dc_calendar_types
暦と日時に関する構造データ型と定数
integer, parameter, public cal_user_defined
integer, parameter, public cal_julian
character(*), dimension(6), parameter, public unit_month
integer, parameter, public unit_symbol_sec
character(*), dimension(4), parameter, public unit_year
character(*), dimension(8), parameter, public unit_hour
integer, parameter, public cal_gregorian
character(*), dimension(8), parameter, public unit_sec
integer, parameter, public unit_symbol_month
integer, parameter, public unit_symbol_year
integer, parameter, public unit_symbol_hour
integer, parameter, public unit_symbol_day
integer, parameter, public unit_symbol_min
character(*), dimension(4), parameter, public unit_day
character(*), dimension(4), parameter, public unit_min
integer, parameter, public unit_symbol_err
integer, parameter, public cal_360day
integer, parameter, public cal_noleap
integer, parameter, public cal_cyclic
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition dc_types.f90:128
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:92