gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dcdatetimeparseunits.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!-----------------------------------------------------------------------
22
94function dcdatetimeparseunits(str) result(symbol)
95
96 use dc_types, only: token
102 use dc_string, only: strieq
103 implicit none
104 character(*), intent(in):: str
105 integer:: symbol
106 integer:: unit_str_size, i
107 character(TOKEN):: unit
108continue
109 unit = adjustl(str)
110 unit_str_size = size(unit_nondim)
111 do i = 1, unit_str_size
112 if (strieq(trim(unit), trim(unit_nondim(i)))) then
113 symbol = unit_symbol_nondim
114 return
115 end if
116 end do
117
118 unit_str_size = size(unit_sec)
119 do i = 1, unit_str_size
120 if (strieq(trim(unit), trim(unit_sec(i)))) then
121 symbol = unit_symbol_sec
122 return
123 end if
124 end do
125
126 unit_str_size = size(unit_min)
127 do i = 1, unit_str_size
128 if (strieq(trim(unit), trim(unit_min(i)))) then
129 symbol = unit_symbol_min
130 return
131 end if
132 end do
133
134 unit_str_size = size(unit_hour)
135 do i = 1, unit_str_size
136 if (strieq(trim(unit), trim(unit_hour(i)))) then
137 symbol = unit_symbol_hour
138 return
139 end if
140 end do
141
142 unit_str_size = size(unit_day)
143 do i = 1, unit_str_size
144 if (strieq(trim(unit), trim(unit_day(i)))) then
145 symbol = unit_symbol_day
146 return
147 end if
148 end do
149
150 unit_str_size = size(unit_month)
151 do i = 1, unit_str_size
152 if (strieq(trim(unit), trim(unit_month(i)))) then
153 symbol = unit_symbol_month
154 return
155 end if
156 end do
157
158 unit_str_size = size(unit_year)
159 do i = 1, unit_str_size
160 if (strieq(trim(unit), trim(unit_year(i)))) then
161 symbol = unit_symbol_year
162 return
163 end if
164 end do
165
166 symbol = unit_symbol_err
167
168end function dcdatetimeparseunits
integer function dcdatetimeparseunits(str)
単位を表す文字列の解析
日付・時刻に関する構造データ型と定数
character(*), dimension(6), parameter, public unit_month
月の単位を示す文字列
integer, parameter, public unit_symbol_err
無効な単位を示すシンボル
integer, parameter, public unit_symbol_hour
時間の単位を示すシンボル
integer, parameter, public unit_symbol_min
分の単位を示すシンボル
integer, parameter, public unit_symbol_month
月の単位を示すシンボル
character(*), dimension(1), parameter, public unit_nondim
無次元時間の単位を示す文字列
integer, parameter, public unit_symbol_sec
秒の単位を示すシンボル
integer, parameter, public unit_symbol_nondim
無次元時間の単位を示すシンボル
character(*), dimension(4), parameter, public unit_day
日の単位を示す文字列
character(*), dimension(8), parameter, public unit_sec
秒の単位を示す文字列
character(*), dimension(8), parameter, public unit_hour
時間の単位を示す文字列
integer, parameter, public unit_symbol_day
日の単位を示すシンボル
character(*), dimension(4), parameter, public unit_year
年の単位を示す文字列
integer, parameter, public unit_symbol_year
年の単位を示すシンボル
character(*), dimension(4), parameter, public unit_min
分の単位を示す文字列
文字型変数の操作
Definition dc_string.f90:83
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition dc_types.f90:128