\hypertarget{dccalparseunit_8f90}{}\section{dc\+\_\+utils/dccalparseunit.f90 File Reference}
\label{dccalparseunit_8f90}\index{dc\+\_\+utils/dccalparseunit.\+f90@{dc\+\_\+utils/dccalparseunit.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{dccalparseunit_8f90_aa5bfcfa594382cbd5a1f7be6c581fa95}{dccalparseunit1} (unit\+\_\+str, unit\+\_\+sym, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{dccalparseunit_8f90_aa5bfcfa594382cbd5a1f7be6c581fa95}\label{dccalparseunit_8f90_aa5bfcfa594382cbd5a1f7be6c581fa95}} 
\index{dccalparseunit.\+f90@{dccalparseunit.\+f90}!dccalparseunit1@{dccalparseunit1}}
\index{dccalparseunit1@{dccalparseunit1}!dccalparseunit.\+f90@{dccalparseunit.\+f90}}
\subsubsection{\texorpdfstring{dccalparseunit1()}{dccalparseunit1()}}
{\footnotesize\ttfamily subroutine dccalparseunit1 (\begin{DoxyParamCaption}\item[{character($\ast$), intent(in)}]{unit\+\_\+str,  }\item[{integer, intent(out)}]{unit\+\_\+sym,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 16 of file dccalparseunit.\+f90.



References dc\+\_\+error\+::dc\+\_\+ealreadyinit, dc\+\_\+error\+::dc\+\_\+ebadcaltype, dc\+\_\+error\+::dc\+\_\+ebadunit, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+calendar\+\_\+internal\+::dccaldate\+\_\+str2usym(), dc\+\_\+types\+::dp, dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, and dc\+\_\+calendar\+\_\+types\+::unit\+\_\+symbol\+\_\+err.


\begin{DoxyCode}
16   \textcolor{comment}{!}
17   \textcolor{comment}{! 文字列変数の日時単位 *unit\_str* を整数型変数の日時単位}
18   \textcolor{comment}{! *unit\_sym* に変換します. }
19   \textcolor{comment}{! *unit\_str* として有効な文字列は以下の通りです. }
20   \textcolor{comment}{!}
21   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SEC          :: 秒の単位}
22   \textcolor{comment}{! dc\_calendar\_types#UNIT\_MIN          :: 分の単位}
23   \textcolor{comment}{! dc\_calendar\_types#UNIT\_HOUR         :: 時間の単位}
24   \textcolor{comment}{! dc\_calendar\_types#UNIT\_DAY          :: 日の単位}
25   \textcolor{comment}{! dc\_calendar\_types#UNIT\_MONTH        :: 月の単位}
26   \textcolor{comment}{! dc\_calendar\_types#UNIT\_YEAR         :: 年の単位}
27   \textcolor{comment}{! }
28   \textcolor{comment}{! 有効な文字列が与えられた場合, *uni\_sym* に以下の変数に相当する}
29   \textcolor{comment}{! 整数が返ります. }
30   \textcolor{comment}{!}
31   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_SEC          :: 秒の単位}
32   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_MIN          :: 分の単位}
33   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_HOUR         :: 時間の単位}
34   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_DAY          :: 日の単位}
35   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_MONTH        :: 月の単位}
36   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_YEAR         :: 年の単位}
37   \textcolor{comment}{!}
38   \textcolor{comment}{! 無効な値が与えられた場合, エラーを生じます. }
39   \textcolor{comment}{!}
40   \textcolor{comment}{! Parse a character variable of units of date *unit\_str*, and }
41   \textcolor{comment}{! return an integer variable of units of date *unit\_sym*. }
42   \textcolor{comment}{! Valid strings as *unit\_str* are as follows. }
43   \textcolor{comment}{!}
44   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SEC          :: Units of second}
45   \textcolor{comment}{! dc\_calendar\_types#UNIT\_MIN          :: Units of minute}
46   \textcolor{comment}{! dc\_calendar\_types#UNIT\_HOUR         :: Units of hour}
47   \textcolor{comment}{! dc\_calendar\_types#UNIT\_DAY          :: Units of day}
48   \textcolor{comment}{! dc\_calendar\_types#UNIT\_MONTH        :: Units of month}
49   \textcolor{comment}{! dc\_calendar\_types#UNIT\_YEAR         :: Units of year}
50   \textcolor{comment}{!}
51   \textcolor{comment}{! When a valid string is specified, an integer corresponding }
52   \textcolor{comment}{! one of following variables is returned to *unit\_sym*. }
53   \textcolor{comment}{!}
54   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_SEC          :: Units of second}
55   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_MIN          :: Units of minute}
56   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_HOUR         :: Units of hour}
57   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_DAY          :: Units of day}
58   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_MONTH        :: Units of month}
59   \textcolor{comment}{! dc\_calendar\_types#UNIT\_SYMBOL\_YEAR         :: Units of year}
60   \textcolor{comment}{!}
61   \textcolor{comment}{! If an invalid string is specified an error is caused. }
62   \textcolor{comment}{!}
63 
64   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__types}{dc\_calendar\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__calendar__types_ae69b4825c7774e217d64eb366ef797c3}{unit\_symbol\_err}
65   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__internal}{dc\_calendar\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__calendar__internal_ae2ad5ba61c1d074aea90ec876012150c}{dccaldate\_str2usym}
66   \textcolor{keywordtype}{use }dc\_message\textcolor{keywordtype}{, only}: messagenotify
67   \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: lchar
68   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub
69   \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_a3302263a8c976235052a305d54572070}{dc\_ealreadyinit}, \hyperlink{namespacedc__error_acb56887bf09e6518808f8f4c95650b04}{dc\_ebadcaltype}, \hyperlink{namespacedc__error_a19b63488d4f7bc5507179bb795640f5f}{dc\_ebadunit}
70   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
71   \textcolor{keywordtype}{implicit none}
72   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: unit\_str
73   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}:: unit\_sym
74   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
75                               \textcolor{comment}{! 例外処理用フラグ. }
76                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
77                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します. }
78                               \textcolor{comment}{! 引数 *err* が与えられる場合, }
79                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
80                               \textcolor{comment}{! *err* に .true. が代入されます. }
81                               \textcolor{comment}{!}
82                               \textcolor{comment}{! Exception handling flag. }
83                               \textcolor{comment}{! By default, when error occur in }
84                               \textcolor{comment}{! this procedure, the program aborts. }
85                               \textcolor{comment}{! If this *err* argument is given, }
86                               \textcolor{comment}{! .true. is substituted to *err* and }
87                               \textcolor{comment}{! the program does not abort. }
88 
89 
90   \textcolor{comment}{! 作業変数}
91   \textcolor{comment}{! Work variables}
92   \textcolor{comment}{!}
93   \textcolor{keywordtype}{integer}:: stat
94   \textcolor{keywordtype}{character(STRING)}:: cause\_c
95   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCCalParseUnit1'}
96 \textcolor{keywordflow}{continue}
97   \textcolor{keyword}{call }beginsub( subname )
98   stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
99   cause\_c = \textcolor{stringliteral}{''}
100 
101   \textcolor{comment}{! 単位の文字列をシンボル (整数型変数) に変換}
102   \textcolor{comment}{! Convert strings of units into symbols (integer variables)}
103   \textcolor{comment}{!}
104   unit\_sym = \hyperlink{namespacedc__calendar__internal_ae2ad5ba61c1d074aea90ec876012150c}{dccaldate\_str2usym}( unit\_str )
105 
106   \textcolor{comment}{! エラー処理}
107   \textcolor{comment}{! Error Handling}
108   \textcolor{comment}{!}
109   \textcolor{keywordflow}{if} ( unit\_sym == \hyperlink{namespacedc__calendar__types_ae69b4825c7774e217d64eb366ef797c3}{unit\_symbol\_err} ) \textcolor{keywordflow}{then}
110     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'unit\_str=<%c> is invalid. (ONLY day,hour,min,sec are valid)'}, &
111       & c1 = trim(unit\_str) )
112     stat = \hyperlink{namespacedc__error_a19b63488d4f7bc5507179bb795640f5f}{dc\_ebadunit}
113     \textcolor{keywordflow}{goto} 999
114 \textcolor{keywordflow}{  end if}
115 
116   \textcolor{comment}{! 終了処理, 例外処理}
117   \textcolor{comment}{! Termination and Exception handling}
118   \textcolor{comment}{!}
119 999 \textcolor{keywordflow}{continue}
120   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}( stat, subname, err, cause\_c )
121   \textcolor{keyword}{call }endsub( subname )
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{dccalparseunit_8f90_aa5bfcfa594382cbd5a1f7be6c581fa95_cgraph}
\end{center}
\end{figure}
