\hypertarget{dccalconvertbyunit_8f90}{}\section{dc\+\_\+utils/dccalconvertbyunit.f90 File Reference}
\label{dccalconvertbyunit_8f90}\index{dc\+\_\+utils/dccalconvertbyunit.\+f90@{dc\+\_\+utils/dccalconvertbyunit.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
real(dp) function \hyperlink{dccalconvertbyunit_8f90_a622c4e32defde37ef5b538a40eb4b599}{dccalconvertbyunit1} (in\+\_\+time, in\+\_\+unit, out\+\_\+unit, cal)
\item 
real(dp) function \hyperlink{dccalconvertbyunit_8f90_ae50a2800e7b808b9ceea8fde6e5968eb}{dccalconvertbyunit2} (in\+\_\+time, in\+\_\+unit, out\+\_\+unit, cal)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{dccalconvertbyunit_8f90_a622c4e32defde37ef5b538a40eb4b599}\label{dccalconvertbyunit_8f90_a622c4e32defde37ef5b538a40eb4b599}} 
\index{dccalconvertbyunit.\+f90@{dccalconvertbyunit.\+f90}!dccalconvertbyunit1@{dccalconvertbyunit1}}
\index{dccalconvertbyunit1@{dccalconvertbyunit1}!dccalconvertbyunit.\+f90@{dccalconvertbyunit.\+f90}}
\subsubsection{\texorpdfstring{dccalconvertbyunit1()}{dccalconvertbyunit1()}}
{\footnotesize\ttfamily real(dp) function dccalconvertbyunit1 (\begin{DoxyParamCaption}\item[{real(dp), intent(in)}]{in\+\_\+time,  }\item[{character($\ast$), intent(in)}]{in\+\_\+unit,  }\item[{character($\ast$), intent(in)}]{out\+\_\+unit,  }\item[{type(dc\+\_\+cal), intent(in), optional, target}]{cal }\end{DoxyParamCaption})}



Definition at line 2 of file dccalconvertbyunit.\+f90.



References dc\+\_\+error\+::dc\+\_\+ebadunit, dc\+\_\+error\+::dc\+\_\+enotinit, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+calendar\+\_\+internal\+::dccaldate\+\_\+str2usym(), dc\+\_\+calendar\+\_\+internal\+::dccaltype\+\_\+str(), dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal, dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal\+\_\+set(), dc\+\_\+types\+::dp, dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, dc\+\_\+types\+::token, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+day, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+hour, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+min, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+month, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+sec, and dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+year.


\begin{DoxyCode}
2   \textcolor{comment}{!}
3   \textcolor{comment}{! 単位の変換を行います. }
4   \textcolor{comment}{!}
5   \textcolor{comment}{! 時間の単位として有効な文字列については以下を参照下さい.}
6   \textcolor{comment}{!}
7   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SEC          :: 秒の単位}
8   \textcolor{comment}{! dc\_calendar\_types#UNIT\_MIN          :: 分の単位}
9   \textcolor{comment}{! dc\_calendar\_types#UNIT\_HOUR         :: 時間の単位}
10   \textcolor{comment}{! dc\_calendar\_types#UNIT\_DAY          :: 日の単位}
11   \textcolor{comment}{! }
12   \textcolor{comment}{! 省略可能引数 *cal* が省略された場合には, dc\_calendar 内部で}
13   \textcolor{comment}{! 保持される暦に関する情報を用いた単位の変換が行われます. }
14   \textcolor{comment}{! *cal* が省略されない場合にはその変数に設定された暦の情報を}
15   \textcolor{comment}{! 用いて単位の変換が行われます. }
16   \textcolor{comment}{!}
17   \textcolor{comment}{! Convert of unit. }
18   \textcolor{comment}{!}
19   \textcolor{comment}{! Valid strings as units of time are follows. }
20   \textcolor{comment}{! }
21   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SEC          :: Units of second}
22   \textcolor{comment}{! dc\_calendar\_types#UNIT\_MIN          :: Units of minute}
23   \textcolor{comment}{! dc\_calendar\_types#UNIT\_HOUR         :: Units of hour}
24   \textcolor{comment}{! dc\_calendar\_types#UNIT\_DAY          :: Units of day}
25   \textcolor{comment}{!}
26   \textcolor{comment}{! If an optional argument *cal* is omitted, }
27   \textcolor{comment}{! unit is converted with information of a calendar }
28   \textcolor{comment}{! that is stored in the "dc\_calendar". }
29   \textcolor{comment}{! If *cal* is not omitted, unit is converted with information of the variable.}
30   \textcolor{comment}{!}
31   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__internal}{dc\_calendar\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}, 
      \hyperlink{namespacedc__calendar__internal_ab33be336dc4b2e284e99c43b24235728}{default\_cal\_set}, &
32     & \hyperlink{namespacedc__calendar__internal_aa5cfbed96ce640b2c6dd7bc0df513872}{dccaltype\_str}, \hyperlink{namespacedc__calendar__internal_ae2ad5ba61c1d074aea90ec876012150c}{dccaldate\_str2usym}
33   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__types}{dc\_calendar\_types}\textcolor{keywordtype}{, only}: dc\_cal, &
34     & \hyperlink{namespacedc__calendar__types_a9f02aaa42bc65301b0f6e86c34f5e975}{unit\_symbol\_year}, \hyperlink{namespacedc__calendar__types_a6a2218105981b62304a32c51f20e0824}{unit\_symbol\_month}, 
      \hyperlink{namespacedc__calendar__types_ab4be572292ddec215a2e956866a4d893}{unit\_symbol\_day}, &
35     & \hyperlink{namespacedc__calendar__types_ab35dfa690b91efaf7cfc2d056da4629b}{unit\_symbol\_hour}, \hyperlink{namespacedc__calendar__types_ac941d6da4d3fd07f09b543d20796e606}{unit\_symbol\_min}, 
      \hyperlink{namespacedc__calendar__types_a15ce2d6947c7143915fa55b6549d4997}{unit\_symbol\_sec}
36   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__generic}{dc\_calendar\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__calendar__generic_1_1dccalconvertbyunit}{dccalconvertbyunit}
37   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}, 
      \hyperlink{namespacedc__error_a19b63488d4f7bc5507179bb795640f5f}{dc\_ebadunit}, \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
38   \textcolor{keywordtype}{use }dc\_message\textcolor{keywordtype}{, only}: messagenotify
39   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub
40   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}, \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
41   \textcolor{keywordtype}{implicit none}
42   \textcolor{keywordtype}{real(DP)}:: out\_time
43                               \textcolor{comment}{! 変換後の時間の数値. }
44                               \textcolor{comment}{! }
45                               \textcolor{comment}{! Numerical value of time after conversion. }
46 
47   \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: in\_time
48                               \textcolor{comment}{! 変換前の時間の数値. }
49                               \textcolor{comment}{! }
50                               \textcolor{comment}{! Numerical value of time before conversion. }
51   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: in\_unit
52                               \textcolor{comment}{! 変換前の時間の単位. }
53                               \textcolor{comment}{! }
54                               \textcolor{comment}{! Units of time before conversion. }
55   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: out\_unit
56                               \textcolor{comment}{! 変換後の時間の単位. }
57                               \textcolor{comment}{! }
58                               \textcolor{comment}{! Units of time after conversion. }
59   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: cal
60                               \textcolor{comment}{! 暦情報を収めたオブジェクト. }
61                               \textcolor{comment}{! }
62                               \textcolor{comment}{! An object that stores information of }
63                               \textcolor{comment}{! calendar. }
64 
65   \textcolor{comment}{! 作業変数}
66   \textcolor{comment}{! Work variables}
67   \textcolor{comment}{!}
68   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{pointer}:: calp =>null()
69   \textcolor{keywordtype}{real(DP)}:: in\_timew
70   \textcolor{keywordtype}{integer}:: in\_unit\_sym, out\_unit\_sym
71 \textcolor{comment}{!!$  integer:: stat}
72 \textcolor{comment}{!!$  character(STRING):: cause\_c}
73   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCCalConvertByUnit1'}
74 \textcolor{keywordflow}{continue}
75 \textcolor{comment}{!!$  call BeginSub( subname )}
76 \textcolor{comment}{!!$  stat = DC\_NOERR}
77 \textcolor{comment}{!!$  cause\_c = ''}
78 
79   out\_time = -1.0
80 
81   \textcolor{comment}{! オブジェクトのポインタ割付}
82   \textcolor{comment}{! Associate pointer of an object}
83   \textcolor{comment}{!}
84   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( cal ) ) \textcolor{keywordflow}{then}
85     calp => cal
86   \textcolor{keywordflow}{else}
87     calp => \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
88     \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keyword}{call }\hyperlink{namespacedc__calendar__internal_ab33be336dc4b2e284e99c43b24235728}{default\_cal\_set}
89 \textcolor{keywordflow}{  end if}
90 
91   \textcolor{comment}{! 初期設定のチェック}
92   \textcolor{comment}{! Check initialization}
93   \textcolor{comment}{!}
94   \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keywordflow}{then}
95     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'"cal" is not initialized. <-1> is returned.'} )
96 \textcolor{comment}{!!$    stat = DC\_ENOTINIT}
97 \textcolor{comment}{!!$    cause\_c = 'DC\_CAL'}
98     \textcolor{keywordflow}{goto} 999
99 \textcolor{keywordflow}{  end if}
100 
101   \textcolor{comment}{! 単位の解釈}
102   \textcolor{comment}{! Parse units}
103   \textcolor{comment}{!}
104   in\_unit\_sym  = \hyperlink{namespacedc__calendar__internal_ae2ad5ba61c1d074aea90ec876012150c}{dccaldate\_str2usym}( in\_unit )
105   out\_unit\_sym = \hyperlink{namespacedc__calendar__internal_ae2ad5ba61c1d074aea90ec876012150c}{dccaldate\_str2usym}( out\_unit )
106 
107   \textcolor{comment}{! 数値の変換}
108   \textcolor{comment}{! Convert a value}
109   \textcolor{comment}{!}
110   out\_time = \hyperlink{interfacedc__calendar__generic_1_1dccalconvertbyunit}{dccalconvertbyunit}( in\_time, in\_unit\_sym, out\_unit\_sym, cal )
111 
112   \textcolor{comment}{! 終了処理, 例外処理}
113   \textcolor{comment}{! Termination and Exception handling}
114   \textcolor{comment}{!}
115 999 \textcolor{keywordflow}{continue}
116   \textcolor{keyword}{nullify}( calp )
117 \textcolor{comment}{!!$  call StoreError( stat, subname, err, cause\_c )}
118 \textcolor{comment}{!!$  call EndSub( subname )}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{dccalconvertbyunit_8f90_a622c4e32defde37ef5b538a40eb4b599_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{dccalconvertbyunit_8f90_ae50a2800e7b808b9ceea8fde6e5968eb}\label{dccalconvertbyunit_8f90_ae50a2800e7b808b9ceea8fde6e5968eb}} 
\index{dccalconvertbyunit.\+f90@{dccalconvertbyunit.\+f90}!dccalconvertbyunit2@{dccalconvertbyunit2}}
\index{dccalconvertbyunit2@{dccalconvertbyunit2}!dccalconvertbyunit.\+f90@{dccalconvertbyunit.\+f90}}
\subsubsection{\texorpdfstring{dccalconvertbyunit2()}{dccalconvertbyunit2()}}
{\footnotesize\ttfamily real(dp) function dccalconvertbyunit2 (\begin{DoxyParamCaption}\item[{real(dp), intent(in)}]{in\+\_\+time,  }\item[{integer, intent(in)}]{in\+\_\+unit,  }\item[{integer, intent(in)}]{out\+\_\+unit,  }\item[{type(dc\+\_\+cal), intent(in), optional, target}]{cal }\end{DoxyParamCaption})}



Definition at line 124 of file dccalconvertbyunit.\+f90.



References dc\+\_\+error\+::dc\+\_\+ebadunit, dc\+\_\+error\+::dc\+\_\+enotinit, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+calendar\+\_\+internal\+::dccaldate\+\_\+str2usym(), dc\+\_\+calendar\+\_\+internal\+::dccaltype\+\_\+str(), dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal, dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal\+\_\+set(), dc\+\_\+types\+::dp, dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, dc\+\_\+types\+::token, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+day, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+hour, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+min, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+month, dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+sec, and dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+year.


\begin{DoxyCode}
124   \textcolor{comment}{!}
125   \textcolor{comment}{! 単位の変換を行います. }
126   \textcolor{comment}{!}
127   \textcolor{comment}{! 時間の単位として有効な整数型変数については以下を参照下さい. }
128   \textcolor{comment}{! 単位として整数値を直接与えることはせず, 以下の変数を}
129   \textcolor{comment}{! 与えてください. }
130   \textcolor{comment}{!}
131   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_SEC          :: 秒の単位}
132   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_MIN          :: 分の単位}
133   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_HOUR         :: 時間の単位}
134   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_DAY          :: 日の単位}
135   \textcolor{comment}{! }
136   \textcolor{comment}{! 省略可能引数 *cal* が省略された場合には, dc\_calendar 内部で}
137   \textcolor{comment}{! 保持される暦に関する情報を用いた単位の変換が行われます. }
138   \textcolor{comment}{! *cal* が省略されない場合にはその変数に設定された暦の情報を}
139   \textcolor{comment}{! 用いて単位の変換が行われます. }
140   \textcolor{comment}{!}
141   \textcolor{comment}{! Convert of unit. }
142   \textcolor{comment}{!}
143   \textcolor{comment}{! Valid integer variables as units of time are follows. }
144   \textcolor{comment}{! Do not specify integer directly, but specify following variables. }
145   \textcolor{comment}{! }
146   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_SEC          :: Units of second}
147   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_MIN          :: Units of minute}
148   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_HOUR         :: Units of hour}
149   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_DAY          :: Units of day}
150   \textcolor{comment}{!}
151   \textcolor{comment}{! If an optional argument *cal* is omitted, }
152   \textcolor{comment}{! unit is converted with information of a calendar }
153   \textcolor{comment}{! that is stored in the "dc\_calendar". }
154   \textcolor{comment}{! If *cal* is not omitted, unit is converted with information of the variable.}
155   \textcolor{comment}{!}
156   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__internal}{dc\_calendar\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}, 
      \hyperlink{namespacedc__calendar__internal_ab33be336dc4b2e284e99c43b24235728}{default\_cal\_set}, &
157     & \hyperlink{namespacedc__calendar__internal_aa5cfbed96ce640b2c6dd7bc0df513872}{dccaltype\_str}, \hyperlink{namespacedc__calendar__internal_ae2ad5ba61c1d074aea90ec876012150c}{dccaldate\_str2usym}
158   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__types}{dc\_calendar\_types}\textcolor{keywordtype}{, only}: dc\_cal, &
159     & \hyperlink{namespacedc__calendar__types_a9f02aaa42bc65301b0f6e86c34f5e975}{unit\_symbol\_year}, \hyperlink{namespacedc__calendar__types_a6a2218105981b62304a32c51f20e0824}{unit\_symbol\_month}, 
      \hyperlink{namespacedc__calendar__types_ab4be572292ddec215a2e956866a4d893}{unit\_symbol\_day}, &
160     & \hyperlink{namespacedc__calendar__types_ab35dfa690b91efaf7cfc2d056da4629b}{unit\_symbol\_hour}, \hyperlink{namespacedc__calendar__types_ac941d6da4d3fd07f09b543d20796e606}{unit\_symbol\_min}, 
      \hyperlink{namespacedc__calendar__types_a15ce2d6947c7143915fa55b6549d4997}{unit\_symbol\_sec}
161   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}, 
      \hyperlink{namespacedc__error_a19b63488d4f7bc5507179bb795640f5f}{dc\_ebadunit}, \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
162   \textcolor{keywordtype}{use }dc\_message\textcolor{keywordtype}{, only}: messagenotify
163   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub
164   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}, \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
165   \textcolor{keywordtype}{implicit none}
166   \textcolor{keywordtype}{real(DP)}:: out\_time
167                               \textcolor{comment}{! 変換後の時間の数値. }
168                               \textcolor{comment}{! }
169                               \textcolor{comment}{! Numerical value of time after conversion. }
170   \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: in\_time
171                               \textcolor{comment}{! 変換前の時間の数値. }
172                               \textcolor{comment}{! }
173                               \textcolor{comment}{! Numerical value of time before conversion. }
174   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: in\_unit
175                               \textcolor{comment}{! 変換前の時間の単位. }
176                               \textcolor{comment}{! }
177                               \textcolor{comment}{! Units of time before conversion. }
178   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: out\_unit
179                               \textcolor{comment}{! 変換後の時間の単位. }
180                               \textcolor{comment}{! }
181                               \textcolor{comment}{! Units of time after conversion. }
182   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: cal
183                               \textcolor{comment}{! 暦情報を収めたオブジェクト. }
184                               \textcolor{comment}{! }
185                               \textcolor{comment}{! An object that stores information of }
186                               \textcolor{comment}{! calendar. }
187 
188   \textcolor{comment}{! 作業変数}
189   \textcolor{comment}{! Work variables}
190   \textcolor{comment}{!}
191   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{pointer}:: calp =>null()
192   \textcolor{keywordtype}{real(DP)}:: in\_timew
193 \textcolor{comment}{!!$  integer:: stat}
194 \textcolor{comment}{!!$  character(STRING):: cause\_c}
195   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCCalConvertByUnit2'}
196 \textcolor{keywordflow}{continue}
197 \textcolor{comment}{!!$  call BeginSub( subname )}
198 \textcolor{comment}{!!$  stat = DC\_NOERR}
199 \textcolor{comment}{!!$  cause\_c = ''}
200 
201   out\_time = -1.0
202 
203   \textcolor{comment}{! オブジェクトのポインタ割付}
204   \textcolor{comment}{! Associate pointer of an object}
205   \textcolor{comment}{!}
206   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( cal ) ) \textcolor{keywordflow}{then}
207     calp => cal
208   \textcolor{keywordflow}{else}
209     calp => \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
210     \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keyword}{call }\hyperlink{namespacedc__calendar__internal_ab33be336dc4b2e284e99c43b24235728}{default\_cal\_set}
211 \textcolor{keywordflow}{  end if}
212 
213   \textcolor{comment}{! 初期設定のチェック}
214   \textcolor{comment}{! Check initialization}
215   \textcolor{comment}{!}
216   \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keywordflow}{then}
217     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'"cal" is not initialized. <-1> is returned.'} )
218 \textcolor{comment}{!!$    stat = DC\_ENOTINIT}
219 \textcolor{comment}{!!$    cause\_c = 'DC\_CAL'}
220     \textcolor{keywordflow}{goto} 999
221 \textcolor{keywordflow}{  end if}
222 
223   \textcolor{comment}{! 数値の変換}
224   \textcolor{comment}{! Convert a value}
225   \textcolor{comment}{!}
226   \textcolor{keywordflow}{select case}(in\_unit)
227   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_ab4be572292ddec215a2e956866a4d893}{unit\_symbol\_day})
228     in\_timew = in\_time * calp % hour\_in\_day &
229       &                * calp % min\_in\_hour &
230       &                * calp % sec\_in\_min
231   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_ab35dfa690b91efaf7cfc2d056da4629b}{unit\_symbol\_hour})
232     in\_timew = in\_time * calp % min\_in\_hour &
233       &                * calp % sec\_in\_min
234   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_ac941d6da4d3fd07f09b543d20796e606}{unit\_symbol\_min})
235     in\_timew = in\_time * calp % sec\_in\_min
236   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_a15ce2d6947c7143915fa55b6549d4997}{unit\_symbol\_sec})
237     in\_timew = in\_time
238 \textcolor{keywordflow}{  case default}
239 \textcolor{comment}{!    cause\_c = in\_unit}
240     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'in\_unit=<%d> is invalid. (ONLY day,hour,min,sec are valid).'}  // &
241       & \textcolor{stringliteral}{' <-1> is returned.'}, &
242       & i = (/ in\_unit /) )
243 \textcolor{comment}{!!$    stat = DC\_EBADUNIT}
244     \textcolor{keywordflow}{goto} 999
245 \textcolor{keywordflow}{  end select}
246 
247   \textcolor{keywordflow}{select case}(out\_unit)
248   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_ab4be572292ddec215a2e956866a4d893}{unit\_symbol\_day})
249     out\_time = in\_timew / calp % hour\_in\_day &
250       &                 / calp % min\_in\_hour &
251       &                 / calp % sec\_in\_min
252   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_ab35dfa690b91efaf7cfc2d056da4629b}{unit\_symbol\_hour})
253     out\_time = in\_timew / calp % min\_in\_hour &
254       &                 / calp % sec\_in\_min
255   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_ac941d6da4d3fd07f09b543d20796e606}{unit\_symbol\_min})
256     out\_time = in\_timew / calp % sec\_in\_min
257   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_a15ce2d6947c7143915fa55b6549d4997}{unit\_symbol\_sec})
258     out\_time = in\_timew
259 \textcolor{keywordflow}{  case default}
260 \textcolor{comment}{!    cause\_c = out\_unit}
261     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'out\_unit=<%d> is invalid. (ONLY day,hour,min,sec are valid).'}  // &
262       & \textcolor{stringliteral}{' <-1> is returned.'}, &
263       & i = (/ out\_unit /) )
264 \textcolor{comment}{!!$    stat = DC\_EBADUNIT}
265     \textcolor{keywordflow}{goto} 999
266 \textcolor{keywordflow}{  end select}
267 
268   \textcolor{comment}{! 終了処理, 例外処理}
269   \textcolor{comment}{! Termination and Exception handling}
270   \textcolor{comment}{!}
271 999 \textcolor{keywordflow}{continue}
272   \textcolor{keyword}{nullify}( calp )
273 \textcolor{comment}{!!$  call StoreError( stat, subname, err, cause\_c )}
274 \textcolor{comment}{!!$  call EndSub( subname )}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{dccalconvertbyunit_8f90_ae50a2800e7b808b9ceea8fde6e5968eb_cgraph}
\end{center}
\end{figure}
