\hypertarget{dccaldateinquire_8f90}{}\section{dc\+\_\+utils/dccaldateinquire.f90 File Reference}
\label{dccaldateinquire_8f90}\index{dc\+\_\+utils/dccaldateinquire.\+f90@{dc\+\_\+utils/dccaldateinquire.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{dccaldateinquire_8f90_a3a8ff6ff68019efe72b2c429c95ffc50}{dccaldateinquire1} (year, month, day, hour, min, sec, zone, elapse\+\_\+sec, date, cal, err)
\item 
subroutine \hyperlink{dccaldateinquire_8f90_aebf93d0a2e98a3d641e2d1a0cb1fc1c1}{dccaldateinquire2} (date\+\_\+str, elapse\+\_\+sec, date, cal, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{dccaldateinquire_8f90_a3a8ff6ff68019efe72b2c429c95ffc50}\label{dccaldateinquire_8f90_a3a8ff6ff68019efe72b2c429c95ffc50}} 
\index{dccaldateinquire.\+f90@{dccaldateinquire.\+f90}!dccaldateinquire1@{dccaldateinquire1}}
\index{dccaldateinquire1@{dccaldateinquire1}!dccaldateinquire.\+f90@{dccaldateinquire.\+f90}}
\subsubsection{\texorpdfstring{dccaldateinquire1()}{dccaldateinquire1()}}
{\footnotesize\ttfamily subroutine dccaldateinquire1 (\begin{DoxyParamCaption}\item[{integer, intent(out), optional}]{year,  }\item[{integer, intent(out), optional}]{month,  }\item[{integer, intent(out), optional}]{day,  }\item[{integer, intent(out), optional}]{hour,  }\item[{integer, intent(out), optional}]{min,  }\item[{real(dp), intent(out), optional}]{sec,  }\item[{character($\ast$), intent(out), optional}]{zone,  }\item[{real(dp), intent(in), optional}]{elapse\+\_\+sec,  }\item[{type(dc\+\_\+cal\+\_\+date), intent(in), optional, target}]{date,  }\item[{type(dc\+\_\+cal), intent(in), optional, target}]{cal,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 17 of file dccaldateinquire.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+error\+::dc\+\_\+einconsistcaldate, dc\+\_\+error\+::dc\+\_\+enegative, dc\+\_\+error\+::dc\+\_\+enotinit, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+calendar\+\_\+internal\+::dccaldate\+\_\+normalize(), dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal, dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal\+\_\+set(), dc\+\_\+calendar\+\_\+internal\+::default\+\_\+date, dc\+\_\+types\+::dp, dc\+\_\+trace\+::endsub(), dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, and dc\+\_\+types\+::token.


\begin{DoxyCode}
17   \textcolor{comment}{!}
18   \textcolor{comment}{! 日時情報の問い合わせを行います. }
19   \textcolor{comment}{!}
20   \textcolor{comment}{! 問い合わせの結果を}
21   \textcolor{comment}{! YYYY-MM-DDThh:mm:ss.sTZD のような文字列 }
22   \textcolor{comment}{! (YYYY は年, MM は月, DD は日, hh は時, mm は分, ss.s は秒,}
23   \textcolor{comment}{! TZD はタイムゾーン) で受け取りたい場合には, }
24   \textcolor{comment}{! 下記の同名のサブルーチンを使用して下さい. }
25   \textcolor{comment}{! }
26   \textcolor{comment}{! 省略可能引数 *date* が省略された場合には, dc\_calendar 内部で}
27   \textcolor{comment}{! 保持される日時に関する情報が得られます. }
28   \textcolor{comment}{! *date* が省略されない場合にはその変数に設定された日時の情報が得られます. }
29   \textcolor{comment}{!}
30   \textcolor{comment}{! 省略可能引数 *cal* が省略された場合には, 経過秒数 *elapse\_sec* }
31   \textcolor{comment}{! の年月日時分への変換に dc\_calendar 内部で保持される暦が用いられます. }
32   \textcolor{comment}{! *cal* が省略されない場合にはその変数に設定された暦が用いられます. }
33   \textcolor{comment}{!}
34   \textcolor{comment}{! Inquire information of date. }
35   \textcolor{comment}{!}
36   \textcolor{comment}{! If a string like as "YYYY-MM-DDThh:mm:ss.sTZD"}
37   \textcolor{comment}{! (YYYY is year, MM is month, DD is day, hh is hour, mm is minute, }
38   \textcolor{comment}{! ss.s is second, TZD is time zone) is needed, }
39   \textcolor{comment}{! use a following homonymous subroutine. }
40   \textcolor{comment}{! }
41   \textcolor{comment}{! If an optional argument *date* is omitted, }
42   \textcolor{comment}{! information of date that is stored in the "dc\_calendar" }
43   \textcolor{comment}{! is returned, }
44   \textcolor{comment}{! If *date* is not omitted, information of the variable is returned. }
45   \textcolor{comment}{!}
46   \textcolor{comment}{! If an optional argument *cal* is omitted, }
47   \textcolor{comment}{! information of calendar that is stored in the "dc\_calendar" }
48   \textcolor{comment}{! is used for conversion of elapsed seconds *elapse\_sec* into }
49   \textcolor{comment}{! year-month-day etc.}
50   \textcolor{comment}{! If *cal* is not omitted, information of the variable is used. }
51   \textcolor{comment}{!}
52   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__types}{dc\_calendar\_types}\textcolor{keywordtype}{, only}: \hyperlink{structdc__calendar__types_1_1dc__cal}{dc\_cal}, \hyperlink{structdc__calendar__types_1_1dc__cal__date}{dc\_cal\_date}
53   \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}, \hyperlink{namespacedc__calendar__internal_a3bc8a36b4f46e738aefa1d702a571111}{default\_date}, &
54     & \hyperlink{namespacedc__calendar__internal_a5aaf74615ddc4b9e53d67d4949c55dd5}{dccaldate\_normalize}
55   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__generic}{dc\_calendar\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__calendar__generic_1_1dccaldatetochar}{dccaldatetochar}, 
      \hyperlink{interfacedc__calendar__generic_1_1dccaltochar}{dccaltochar}
56   \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
57   \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1lchar}{lchar}
58   \textcolor{keywordtype}{use }\hyperlink{namespacedc__trace}{dc\_trace}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}, \hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}
59   \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_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}, &
60     & \hyperlink{namespacedc__error_af615e5370c2a4be7e491ababe9171027}{dc\_einconsistcaldate}, \hyperlink{namespacedc__error_a64f090fc161836514c614059f74c23e6}{dc\_enegative}
61   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}
62   \textcolor{keywordtype}{implicit none}
63   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: year           \textcolor{comment}{! 年. Year.  }
64   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: month          \textcolor{comment}{! 月. Month. }
65   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: day            \textcolor{comment}{! 日. Day. }
66   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: hour           \textcolor{comment}{! 時. Hour. }
67   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: min            \textcolor{comment}{! 分. Minute. }
68   \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: sec           \textcolor{comment}{! 秒. Sec. }
69   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: zone      \textcolor{comment}{! UTC からの時差. Time-zone. }
70   \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: elapse\_sec
71                               \textcolor{comment}{! *date* からの経過秒数. }
72                               \textcolor{comment}{! Elapsed seconds from *date*. }
73   \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal__date}{dc\_cal\_date}), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: date
74                               \textcolor{comment}{! 日時情報を収めたオブジェクト. }
75                               \textcolor{comment}{! }
76                               \textcolor{comment}{! An object that stores information of }
77                               \textcolor{comment}{! date and time. }
78   \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal}{dc\_cal}), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: cal
79                               \textcolor{comment}{! 暦情報を収めたオブジェクト. }
80                               \textcolor{comment}{! }
81                               \textcolor{comment}{! An object that stores information of }
82                               \textcolor{comment}{! calendar. }
83   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
84                               \textcolor{comment}{! 例外処理用フラグ. }
85                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
86                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します. }
87                               \textcolor{comment}{! 引数 *err* が与えられる場合, }
88                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
89                               \textcolor{comment}{! *err* に .true. が代入されます. }
90                               \textcolor{comment}{!}
91                               \textcolor{comment}{! Exception handling flag. }
92                               \textcolor{comment}{! By default, when error occur in }
93                               \textcolor{comment}{! this procedure, the program aborts. }
94                               \textcolor{comment}{! If this *err* argument is given, }
95                               \textcolor{comment}{! .true. is substituted to *err* and }
96                               \textcolor{comment}{! the program does not abort. }
97 
98 
99   \textcolor{comment}{! 作業変数}
100   \textcolor{comment}{! Work variables}
101   \textcolor{comment}{!}
102   \textcolor{keywordtype}{integer}:: wyear, wmonth, wday, whour, wmin
103   \textcolor{keywordtype}{real(DP)}:: wsec
104   \textcolor{keywordtype}{character(TOKEN)}:: wzone
105   \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal__date}{dc\_cal\_date}), \textcolor{keywordtype}{pointer}:: datep =>null()
106   \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal}{dc\_cal}), \textcolor{keywordtype}{pointer}:: calp =>null()
107   \textcolor{keywordtype}{character(STRING)}:: e\_date\_str, e\_cal\_str
108   \textcolor{keywordtype}{integer}:: stat
109   \textcolor{keywordtype}{character(STRING)}:: cause\_c
110   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCCalInquire1'}
111 \textcolor{keywordflow}{continue}
112   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}( subname )
113   stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
114   cause\_c = \textcolor{stringliteral}{''}
115 
116   \textcolor{comment}{! オブジェクトのポインタ割付}
117   \textcolor{comment}{! Associate pointer of an object}
118   \textcolor{comment}{!}
119   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( date ) ) \textcolor{keywordflow}{then}
120     datep => date
121   \textcolor{keywordflow}{else}
122     datep => \hyperlink{namespacedc__calendar__internal_a3bc8a36b4f46e738aefa1d702a571111}{default\_date}
123 \textcolor{keywordflow}{  end if}
124 
125   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( cal ) ) \textcolor{keywordflow}{then}
126     calp => cal
127   \textcolor{keywordflow}{else}
128     calp => \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
129     \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keyword}{call }\hyperlink{namespacedc__calendar__internal_ab33be336dc4b2e284e99c43b24235728}{default\_cal\_set}
130 \textcolor{keywordflow}{  end if}
131 
132   \textcolor{comment}{! 初期設定のチェック}
133   \textcolor{comment}{! Check initialization}
134   \textcolor{comment}{!}
135   \textcolor{keywordflow}{if} ( .not. datep % initialized ) \textcolor{keywordflow}{then}
136     stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
137     cause\_c = \textcolor{stringliteral}{'DC\_CAL\_DATE'}
138     \textcolor{keywordflow}{goto} 999
139 \textcolor{keywordflow}{  end if}
140 
141   \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keywordflow}{then}
142     stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
143     cause\_c = \textcolor{stringliteral}{'DC\_CAL'}
144     \textcolor{keywordflow}{goto} 999
145 \textcolor{keywordflow}{  end if}
146 
147   \textcolor{comment}{! 各要素への値の参照}
148   \textcolor{comment}{! Refer elements}
149   \textcolor{comment}{!}
150   wyear  = datep % year
151   wmonth = datep % month
152   wday   = datep % day
153   whour  = datep % hour
154   wmin   = datep % min
155   wsec   = datep % sec
156   wzone  = datep % zone
157 
158   \textcolor{comment}{! 経過時間(秒)の追加}
159   \textcolor{comment}{! Add elapsed time (seconds)}
160   \textcolor{comment}{!}
161   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( elapse\_sec ) ) \textcolor{keywordflow}{then}
162 \textcolor{comment}{!!$    if ( elapse\_sec < 0.0\_DP ) then}
163 \textcolor{comment}{!!$      stat = DC\_ENEGATIVE}
164 \textcolor{comment}{!!$      cause\_c = 'elapse\_sec'}
165 \textcolor{comment}{!!$      goto 999}
166 \textcolor{comment}{!!$    end if}
167 
168     wsec = wsec + elapse\_sec
169 \textcolor{keywordflow}{  end if}
170 
171   \textcolor{comment}{! 日時の正規化}
172   \textcolor{comment}{! Normalize date and time }
173   \textcolor{comment}{!}
174   stat = \hyperlink{namespacedc__calendar__internal_a5aaf74615ddc4b9e53d67d4949c55dd5}{dccaldate\_normalize}( wyear, wmonth, wday, whour, wmin, wsec, & \textcolor{comment}{! (inout)}
175     &                         calp )                                    \textcolor{comment}{! (in)}
176   \textcolor{keywordflow}{if} ( stat == \hyperlink{namespacedc__error_af615e5370c2a4be7e491ababe9171027}{dc\_einconsistcaldate} ) \textcolor{keywordflow}{then}
177     e\_cal\_str = \hyperlink{interfacedc__calendar__generic_1_1dccaltochar}{dccaltochar}( calp )
178     e\_date\_str = \hyperlink{interfacedc__calendar__generic_1_1dccaldatetochar}{dccaldatetochar}( wyear, wmonth, wday, whour, wmin, wsec, wzone )
179     \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'cal=<%c> and date=<%c> are inconsistency'}, &
180       & c1 = trim(e\_cal\_str), c2 = trim(e\_date\_str) )
181     \textcolor{keywordflow}{goto} 999
182 \textcolor{keywordflow}{  end if}
183 
184   \textcolor{comment}{! 引数への代入}
185   \textcolor{comment}{! Substitute arguments}
186   \textcolor{comment}{!}
187   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(year ) ) year  = wyear
188   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(month) ) month = wmonth
189   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(day  ) ) day   = wday
190   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(hour ) ) hour  = whour
191   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(min  ) ) min   = wmin
192   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(sec  ) ) sec   = wsec
193   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(zone ) ) zone  = wzone
194 
195   \textcolor{comment}{! 終了処理, 例外処理}
196   \textcolor{comment}{! Termination and Exception handling}
197   \textcolor{comment}{!}
198 999 \textcolor{keywordflow}{continue}
199   \textcolor{keyword}{nullify}( calp, datep )
200   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}( stat, subname, err, cause\_c )
201   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}( subname )
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{dccaldateinquire_8f90_a3a8ff6ff68019efe72b2c429c95ffc50_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{dccaldateinquire_8f90_aebf93d0a2e98a3d641e2d1a0cb1fc1c1}\label{dccaldateinquire_8f90_aebf93d0a2e98a3d641e2d1a0cb1fc1c1}} 
\index{dccaldateinquire.\+f90@{dccaldateinquire.\+f90}!dccaldateinquire2@{dccaldateinquire2}}
\index{dccaldateinquire2@{dccaldateinquire2}!dccaldateinquire.\+f90@{dccaldateinquire.\+f90}}
\subsubsection{\texorpdfstring{dccaldateinquire2()}{dccaldateinquire2()}}
{\footnotesize\ttfamily subroutine dccaldateinquire2 (\begin{DoxyParamCaption}\item[{character($\ast$), intent(out)}]{date\+\_\+str,  }\item[{real(dp), intent(in), optional}]{elapse\+\_\+sec,  }\item[{type(dc\+\_\+cal\+\_\+date), intent(in), optional, target}]{date,  }\item[{type(dc\+\_\+cal), intent(in), optional, target}]{cal,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 205 of file dccaldateinquire.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+error\+::dc\+\_\+einconsistcaldate, dc\+\_\+error\+::dc\+\_\+enegative, dc\+\_\+error\+::dc\+\_\+enotinit, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+calendar\+\_\+internal\+::dccaldate\+\_\+normalize(), dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal, dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal\+\_\+set(), dc\+\_\+calendar\+\_\+internal\+::default\+\_\+date, dc\+\_\+types\+::dp, dc\+\_\+trace\+::endsub(), dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, and dc\+\_\+types\+::token.


\begin{DoxyCode}
205   \textcolor{comment}{!}
206   \textcolor{comment}{! 日時情報の問い合わせを行います. }
207   \textcolor{comment}{! 問い合わせ結果は YYYY-MM-DDThh:mm:ss.sTZD のような文字列 }
208   \textcolor{comment}{! (YYYY は年, MM は月, DD は日, hh は時, mm は分, ss.s は秒,}
209   \textcolor{comment}{! TZD はタイムゾーン) で返ります. }
210   \textcolor{comment}{! 日時の文字列形式は }
211   \textcolor{comment}{! gtool4 netCDF 規約「5.5 日時形式」に準拠しています. }
212   \textcolor{comment}{!}
213   \textcolor{comment}{! 問い合わせの結果を年月日時分秒で各個変数で受け取りたい場合は}
214   \textcolor{comment}{! 上記の同名のサブルーチンを使用して下さい. }
215   \textcolor{comment}{!}
216   \textcolor{comment}{! 省略可能引数 *date* が省略された場合には, dc\_calendar 内部で}
217   \textcolor{comment}{! 保持される日時に関する情報が得られます. }
218   \textcolor{comment}{! *date* が省略されない場合にはその変数に設定された日時の情報が得られます. }
219   \textcolor{comment}{!}
220   \textcolor{comment}{! 省略可能引数 *cal* が省略された場合には, 経過秒数 *elapse\_sec* }
221   \textcolor{comment}{! の年月日時分への変換に dc\_calendar 内部で保持される暦が用いられます. }
222   \textcolor{comment}{! *cal* が省略されない場合にはその変数に設定された暦が用いられます. }
223   \textcolor{comment}{!}
224   \textcolor{comment}{! Inquire information of date. }
225   \textcolor{comment}{! A result is returned as a string like as }
226   \textcolor{comment}{! YYYY-MM-DDThh:mm:ss.sTZD }
227   \textcolor{comment}{! (YYYY is year, MM is month, DD is day, hh is hour, mm is minute, }
228   \textcolor{comment}{! ss.s is second, TZD is time zone). }
229   \textcolor{comment}{! Format of date is conformed to gtool4 netCDF Convention "5.5 Expression of date and time" }
230   \textcolor{comment}{!}
231   \textcolor{comment}{! If individual variables (year, month, day, hour, minute, second, zone) }
232   \textcolor{comment}{! are needed, use a foregoing homonymous subroutine. }
233   \textcolor{comment}{!}
234   \textcolor{comment}{! If an optional argument *date* is omitted, }
235   \textcolor{comment}{! information of date that is stored in the "dc\_calendar" }
236   \textcolor{comment}{! is returned, }
237   \textcolor{comment}{! If *date* is not omitted, information of the variable is returned. }
238   \textcolor{comment}{!}
239   \textcolor{comment}{! If an optional argument *cal* is omitted, }
240   \textcolor{comment}{! information of calendar that is stored in the "dc\_calendar" }
241   \textcolor{comment}{! is used for conversion of elapsed seconds *elapse\_sec* into }
242   \textcolor{comment}{! year-month-day etc.}
243   \textcolor{comment}{! If *cal* is not omitted, information of the variable is used. }
244   \textcolor{comment}{!}
245   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__generic}{dc\_calendar\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__calendar__generic_1_1dccaldatetochar}{dccaldatetochar}
246   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__types}{dc\_calendar\_types}\textcolor{keywordtype}{, only}: \hyperlink{structdc__calendar__types_1_1dc__cal}{dc\_cal}, \hyperlink{structdc__calendar__types_1_1dc__cal__date}{dc\_cal\_date}
247   \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}, \hyperlink{namespacedc__calendar__internal_a3bc8a36b4f46e738aefa1d702a571111}{default\_date}, &
248     & \hyperlink{namespacedc__calendar__internal_a5aaf74615ddc4b9e53d67d4949c55dd5}{dccaldate\_normalize}
249   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__generic}{dc\_calendar\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__calendar__generic_1_1dccaldatetochar}{dccaldatetochar}, 
      \hyperlink{interfacedc__calendar__generic_1_1dccaltochar}{dccaltochar}
250   \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
251   \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1lchar}{lchar}
252   \textcolor{keywordtype}{use }\hyperlink{namespacedc__trace}{dc\_trace}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}, \hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}
253   \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_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}, &
254     & \hyperlink{namespacedc__error_af615e5370c2a4be7e491ababe9171027}{dc\_einconsistcaldate}, \hyperlink{namespacedc__error_a64f090fc161836514c614059f74c23e6}{dc\_enegative}
255   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}
256   \textcolor{keywordtype}{implicit none}
257   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(out)}:: date\_str
258                               \textcolor{comment}{! 日時情報を表す文字列. }
259                               \textcolor{comment}{! 表示形式については gtool4 netCDF 規約}
260                               \textcolor{comment}{! 5.5 日時形式を参照のこと. }
261                               \textcolor{comment}{! }
262                               \textcolor{comment}{! Strings that express date and time. }
263                               \textcolor{comment}{! See gtool4 netCDF Convention }
264                               \textcolor{comment}{! 5.5 Expression of date and time for details. }
265   \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: elapse\_sec
266                               \textcolor{comment}{! *date* からの経過秒数. }
267                               \textcolor{comment}{! Elapsed seconds from *date*. }
268   \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal__date}{dc\_cal\_date}), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: date
269                               \textcolor{comment}{! 日時情報を収めたオブジェクト. }
270                               \textcolor{comment}{! }
271                               \textcolor{comment}{! An object that stores information of }
272                               \textcolor{comment}{! date and time. }
273   \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal}{dc\_cal}), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: cal
274                               \textcolor{comment}{! 暦情報を収めたオブジェクト. }
275                               \textcolor{comment}{! }
276                               \textcolor{comment}{! An object that stores information of }
277                               \textcolor{comment}{! calendar. }
278   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
279                               \textcolor{comment}{! 例外処理用フラグ. }
280                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
281                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します. }
282                               \textcolor{comment}{! 引数 *err* が与えられる場合, }
283                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
284                               \textcolor{comment}{! *err* に .true. が代入されます. }
285                               \textcolor{comment}{!}
286                               \textcolor{comment}{! Exception handling flag. }
287                               \textcolor{comment}{! By default, when error occur in }
288                               \textcolor{comment}{! this procedure, the program aborts. }
289                               \textcolor{comment}{! If this *err* argument is given, }
290                               \textcolor{comment}{! .true. is substituted to *err* and }
291                               \textcolor{comment}{! the program does not abort. }
292 
293 
294   \textcolor{comment}{! 作業変数}
295   \textcolor{comment}{! Work variables}
296   \textcolor{comment}{!}
297   \textcolor{keywordtype}{integer}:: year, month, day, hour, min
298   \textcolor{keywordtype}{real(DP)}:: sec
299   \textcolor{keywordtype}{character(TOKEN)}:: zone
300   \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal__date}{dc\_cal\_date}), \textcolor{keywordtype}{pointer}:: datep =>null()
301   \textcolor{keywordtype}{type}(\hyperlink{structdc__calendar__types_1_1dc__cal}{dc\_cal}), \textcolor{keywordtype}{pointer}:: calp =>null()
302   \textcolor{keywordtype}{character(STRING)}:: e\_date\_str, e\_cal\_str
303   \textcolor{keywordtype}{integer}:: stat
304   \textcolor{keywordtype}{character(STRING)}:: cause\_c
305   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCCalInquire2'}
306 \textcolor{keywordflow}{continue}
307   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}( subname )
308   stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
309   cause\_c = \textcolor{stringliteral}{''}
310 
311   \textcolor{comment}{! オブジェクトのポインタ割付}
312   \textcolor{comment}{! Associate pointer of an object}
313   \textcolor{comment}{!}
314   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( date ) ) \textcolor{keywordflow}{then}
315     datep => date
316   \textcolor{keywordflow}{else}
317     datep => \hyperlink{namespacedc__calendar__internal_a3bc8a36b4f46e738aefa1d702a571111}{default\_date}
318 \textcolor{keywordflow}{  end if}
319 
320   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( cal ) ) \textcolor{keywordflow}{then}
321     calp => cal
322   \textcolor{keywordflow}{else}
323     calp => \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
324     \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keyword}{call }\hyperlink{namespacedc__calendar__internal_ab33be336dc4b2e284e99c43b24235728}{default\_cal\_set}
325 \textcolor{keywordflow}{  end if}
326 
327   \textcolor{comment}{! 初期設定のチェック}
328   \textcolor{comment}{! Check initialization}
329   \textcolor{comment}{!}
330   \textcolor{keywordflow}{if} ( .not. datep % initialized ) \textcolor{keywordflow}{then}
331     stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
332     cause\_c = \textcolor{stringliteral}{'DC\_CAL\_DATE'}
333     \textcolor{keywordflow}{goto} 999
334 \textcolor{keywordflow}{  end if}
335 
336   \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keywordflow}{then}
337     stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
338     cause\_c = \textcolor{stringliteral}{'DC\_CAL'}
339     \textcolor{keywordflow}{goto} 999
340 \textcolor{keywordflow}{  end if}
341 
342   \textcolor{comment}{! 各要素の取得}
343   \textcolor{comment}{! Get elements}
344   \textcolor{comment}{!}
345   year  = datep % year
346   month = datep % month
347   day   = datep % day
348   hour  = datep % hour
349   min   = datep % min
350   sec   = datep % sec
351   zone  = datep % zone
352 
353 
354   \textcolor{comment}{! 経過時間(秒)の追加}
355   \textcolor{comment}{! Add elapsed time (seconds)}
356   \textcolor{comment}{!}
357   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( elapse\_sec ) ) \textcolor{keywordflow}{then}
358 \textcolor{comment}{!!$    if ( elapse\_sec < 0.0\_DP ) then}
359 \textcolor{comment}{!!$      stat = DC\_ENEGATIVE}
360 \textcolor{comment}{!!$      cause\_c = 'elapse\_sec'}
361 \textcolor{comment}{!!$      goto 999}
362 \textcolor{comment}{!!$    end if}
363 
364     sec = sec + elapse\_sec
365 \textcolor{keywordflow}{  end if}
366 
367   \textcolor{comment}{! 日時の正規化}
368   \textcolor{comment}{! Normalize date and time }
369   \textcolor{comment}{!}
370   stat = \hyperlink{namespacedc__calendar__internal_a5aaf74615ddc4b9e53d67d4949c55dd5}{dccaldate\_normalize}( year, month, day, hour, min, sec, & \textcolor{comment}{! (inout)}
371     &                         calp )                              \textcolor{comment}{! (in)}
372   \textcolor{keywordflow}{if} ( stat == \hyperlink{namespacedc__error_af615e5370c2a4be7e491ababe9171027}{dc\_einconsistcaldate} ) \textcolor{keywordflow}{then}
373     e\_cal\_str = \hyperlink{interfacedc__calendar__generic_1_1dccaltochar}{dccaltochar}( calp )
374     e\_date\_str = \hyperlink{interfacedc__calendar__generic_1_1dccaldatetochar}{dccaldatetochar}( year, month, day, hour, min, sec, zone )
375     \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'cal=<%c> and date=<%c> are inconsistency'}, &
376       & c1 = trim(e\_cal\_str), c2 = trim(e\_date\_str) )
377     \textcolor{keywordflow}{goto} 999
378 \textcolor{keywordflow}{  end if}
379 
380   \textcolor{comment}{! 日時表記（gtool4 netCDF 規約 5.5 日時形式）への変換}
381   \textcolor{comment}{! Convert expression of date (gtool4 netCDF Convention 5.5 Expression of date and time)}
382   \textcolor{comment}{!}
383   date\_str = \hyperlink{interfacedc__calendar__generic_1_1dccaldatetochar}{dccaldatetochar}( year, month, day, hour, min, sec, zone )
384 
385   \textcolor{comment}{! 終了処理, 例外処理}
386   \textcolor{comment}{! Termination and Exception handling}
387   \textcolor{comment}{!}
388 999 \textcolor{keywordflow}{continue}
389   \textcolor{keyword}{nullify}( calp, datep )
390   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}( stat, subname, err, cause\_c )
391   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}( subname )
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{dccaldateinquire_8f90_aebf93d0a2e98a3d641e2d1a0cb1fc1c1_cgraph}
\end{center}
\end{figure}
