\hypertarget{dccalcreate_8f90}{}\section{dc\+\_\+utils/dccalcreate.f90 File Reference}
\label{dccalcreate_8f90}\index{dc\+\_\+utils/dccalcreate.\+f90@{dc\+\_\+utils/dccalcreate.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{dccalcreate_8f90_a9b6a7a4b39f15e205d05e87be8d5e38f}{dccalcreate1} (cal\+\_\+type, cal, err)
\item 
subroutine \hyperlink{dccalcreate_8f90_a744b4f80f1874ce765ed99e683985029}{dccalcreate2} (month\+\_\+in\+\_\+year, day\+\_\+in\+\_\+month, hour\+\_\+in\+\_\+day, min\+\_\+in\+\_\+hour, sec\+\_\+in\+\_\+min, cal, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{dccalcreate_8f90_a9b6a7a4b39f15e205d05e87be8d5e38f}\label{dccalcreate_8f90_a9b6a7a4b39f15e205d05e87be8d5e38f}} 
\index{dccalcreate.\+f90@{dccalcreate.\+f90}!dccalcreate1@{dccalcreate1}}
\index{dccalcreate1@{dccalcreate1}!dccalcreate.\+f90@{dccalcreate.\+f90}}
\subsubsection{\texorpdfstring{dccalcreate1()}{dccalcreate1()}}
{\footnotesize\ttfamily subroutine dccalcreate1 (\begin{DoxyParamCaption}\item[{character($\ast$), intent(in)}]{cal\+\_\+type,  }\item[{type(dc\+\_\+cal), intent(out), optional, target}]{cal,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



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



References dc\+\_\+calendar\+\_\+types\+::cal\+\_\+360day, dc\+\_\+calendar\+\_\+types\+::cal\+\_\+cyclic, dc\+\_\+calendar\+\_\+types\+::cal\+\_\+gregorian, dc\+\_\+calendar\+\_\+types\+::cal\+\_\+julian, dc\+\_\+calendar\+\_\+types\+::cal\+\_\+noleap, dc\+\_\+error\+::dc\+\_\+ealreadyinit, dc\+\_\+error\+::dc\+\_\+ebadcaltype, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal, dc\+\_\+types\+::dp, dc\+\_\+error\+::storeerror(), and dc\+\_\+types\+::string.


\begin{DoxyCode}
16   \textcolor{comment}{!}
17   \textcolor{comment}{! 暦の設定を行います. }
18   \textcolor{comment}{!}
19   \textcolor{comment}{! このサブルーチンは "dc\_calendar" モジュールで用意した}
20   \textcolor{comment}{! 既定の暦を設定するものです. 1 ヶ月の日数, 1 日の秒数などを}
21   \textcolor{comment}{! 任意に指定する場合には, 下記の同名のサブルーチンを使用して下さい. }
22   \textcolor{comment}{!}
23   \textcolor{comment}{! *cal\_type* として以下のものが有効です. これ以外の文字列}
24   \textcolor{comment}{! を与えた場合にはエラーが発生します. 大文字と小文字は区別しません. }
25   \textcolor{comment}{!}
26   \textcolor{comment}{! gregorian         :: グレゴリオ暦}
27   \textcolor{comment}{! julian            :: ユリウス暦}
28   \textcolor{comment}{! noleap            :: 閏年無しの暦}
29   \textcolor{comment}{! 360day            :: 1ヶ月が 30 日の暦}
30   \textcolor{comment}{! cyclic            :: ある月の日数を}
31   \textcolor{comment}{!                      「30.6 × 月数 − 前月までの総日数」}
32   \textcolor{comment}{!                      の小数点以下切捨とする暦}
33   \textcolor{comment}{!}
34   \textcolor{comment}{! 省略可能引数 *cal* が省略された場合には, dc\_calendar 内部で}
35   \textcolor{comment}{! 保持される "dc\_calendar\_types#DC\_CAL" 型の変数に暦が}
36   \textcolor{comment}{! 設定されます. その後の手続きで *cal* を省略した場合には}
37   \textcolor{comment}{! この暦が使用されます. }
38   \textcolor{comment}{! *cal* が省略されない場合にはその変数に暦が設定されます.}
39   \textcolor{comment}{! その暦を使用する場合, 手続きにその "dc\_calendar\_types#DC\_CAL" 型の変数}
40   \textcolor{comment}{! を与えてください. }
41   \textcolor{comment}{!}
42   \textcolor{comment}{! Set calendar. }
43   \textcolor{comment}{!}
44   \textcolor{comment}{! This subroutine set previously-defined calendars by "dc\_calendar" module. }
45   \textcolor{comment}{! If number of days of a month, number of seconds of a day, etc. }
46   \textcolor{comment}{! want to be specified arbitrarily, use a following homonymous subroutine. }
47   \textcolor{comment}{! }
48   \textcolor{comment}{! Following strings are valid as *cal\_type*. }
49   \textcolor{comment}{! If any other strings is specified, an error is caused. }
50   \textcolor{comment}{! They are not case-sensitive. }
51   \textcolor{comment}{!}
52   \textcolor{comment}{! gregorian         :: Gregorian calendar. }
53   \textcolor{comment}{! julian            :: Julian calendar. }
54   \textcolor{comment}{! noleap            :: A calendar without leap year. }
55   \textcolor{comment}{! 360day            :: A calendar in which number of days of a month is 30. }
56   \textcolor{comment}{! cyclic            :: A calendar in which number of days of a year is}
57   \textcolor{comment}{!                      "30.6 x (number of months) - (total days until last month)"}
58   \textcolor{comment}{!                      (truncate fractional part). }
59   \textcolor{comment}{!}
60   \textcolor{comment}{! If an optional argument *cal* is omitted, }
61   \textcolor{comment}{! the calendar setting is stored to a "dc\_calendar\_types#DC\_CAL" }
62   \textcolor{comment}{! variable that is saved in the "dc\_calendar". }
63   \textcolor{comment}{! When *cal* is omitted in subsequent procedures, the internal calendar}
64   \textcolor{comment}{! is used. }
65   \textcolor{comment}{! If *cal* is not omitted, the settings is stored to the *cal*. }
66   \textcolor{comment}{! In order to use the calendar setting, use the "dc\_calendar\_types#DC\_CAL" }
67   \textcolor{comment}{! varieble to subsequent procedures. }
68   \textcolor{comment}{!}
69 
70   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__types}{dc\_calendar\_types}\textcolor{keywordtype}{, only}: dc\_cal, &
71     & \hyperlink{namespacedc__calendar__types_aff25d0687bf75b37d319ef5e68b942bb}{cal\_cyclic}, \hyperlink{namespacedc__calendar__types_af6212ffe5e51fc8c270d28a0754c71da}{cal\_noleap}, \hyperlink{namespacedc__calendar__types_a0c7574e07214536d34d1a1ff6cd1703c}{cal\_julian}, 
      \hyperlink{namespacedc__calendar__types_a56becce7ca212d6f20b0f2d738ea4538}{cal\_gregorian}, \hyperlink{namespacedc__calendar__types_ae8c1fb15e0255aa447017a0ab468e747}{cal\_360day}
72   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__internal}{dc\_calendar\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
73   \textcolor{keywordtype}{use }dc\_message\textcolor{keywordtype}{, only}: messagenotify
74   \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: lchar
75   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub
76   \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}
77   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
78   \textcolor{keywordtype}{implicit none}
79   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: cal\_type
80                               \textcolor{comment}{! 既定の暦を指定する文字列. }
81                               \textcolor{comment}{! }
82                               \textcolor{comment}{! Strings that specify a previously-defined calendar. }
83   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: cal
84                               \textcolor{comment}{! 暦情報を収めたオブジェクト. }
85                               \textcolor{comment}{! }
86                               \textcolor{comment}{! An object that stores information of }
87                               \textcolor{comment}{! calendar. }
88   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
89                               \textcolor{comment}{! 例外処理用フラグ. }
90                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
91                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します. }
92                               \textcolor{comment}{! 引数 *err* が与えられる場合, }
93                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
94                               \textcolor{comment}{! *err* に .true. が代入されます. }
95                               \textcolor{comment}{!}
96                               \textcolor{comment}{! Exception handling flag. }
97                               \textcolor{comment}{! By default, when error occur in }
98                               \textcolor{comment}{! this procedure, the program aborts. }
99                               \textcolor{comment}{! If this *err* argument is given, }
100                               \textcolor{comment}{! .true. is substituted to *err* and }
101                               \textcolor{comment}{! the program does not abort. }
102 
103 
104   \textcolor{comment}{! 作業変数}
105   \textcolor{comment}{! Work variables}
106   \textcolor{comment}{!}
107   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{pointer}:: calp =>null()
108   \textcolor{keywordtype}{integer}:: stat
109   \textcolor{keywordtype}{character(STRING)}:: cause\_c
110   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: version = &
111     & \textcolor{stringliteral}{'$Name:  $'} // &
112     & \textcolor{stringliteral}{'$Id: dccalcreate.f90,v 1.4 2009-10-18 12:02:32 morikawa Exp $'}
113   character(*), \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCCalCreate1'}
114 \textcolor{keywordflow}{continue}
115   \textcolor{keyword}{call }beginsub( subname, version )
116   stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
117   cause\_c = \textcolor{stringliteral}{''}
118 
119   \textcolor{comment}{! オブジェクトのポインタ割付}
120   \textcolor{comment}{! Associate pointer of an object}
121   \textcolor{comment}{!}
122   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( cal ) ) \textcolor{keywordflow}{then}
123     calp => cal
124   \textcolor{keywordflow}{else}
125     calp => \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
126 \textcolor{keywordflow}{  end if}
127 
128 \textcolor{comment}{!!$  ! 初期設定のチェック}
129 \textcolor{comment}{!!$  ! Check initialization}
130 \textcolor{comment}{!!$  !}
131 \textcolor{comment}{!!$  if ( calp % initialized ) then}
132 \textcolor{comment}{!!$    stat = DC\_EALREADYINIT}
133 \textcolor{comment}{!!$    cause\_c = 'DC\_CAL'}
134 \textcolor{comment}{!!$    goto 999}
135 \textcolor{comment}{!!$  end if}
136 
137   \textcolor{comment}{! 暦の種別の正当性のチェック}
138   \textcolor{comment}{! Validate a kind of calendar}
139   \textcolor{comment}{!}
140   \textcolor{keywordflow}{select case}( lchar(trim(cal\_type)) )
141   \textcolor{keywordflow}{case}(\textcolor{stringliteral}{'cyclic'})
142     calp % cal\_type = \hyperlink{namespacedc__calendar__types_aff25d0687bf75b37d319ef5e68b942bb}{cal\_cyclic}
143   \textcolor{keywordflow}{case}(\textcolor{stringliteral}{'noleap'})
144     calp % cal\_type = \hyperlink{namespacedc__calendar__types_af6212ffe5e51fc8c270d28a0754c71da}{cal\_noleap}
145   \textcolor{keywordflow}{case}(\textcolor{stringliteral}{'julian'})
146     calp % cal\_type = \hyperlink{namespacedc__calendar__types_a0c7574e07214536d34d1a1ff6cd1703c}{cal\_julian}
147   \textcolor{keywordflow}{case}(\textcolor{stringliteral}{'gregorian'})
148     calp % cal\_type = \hyperlink{namespacedc__calendar__types_a56becce7ca212d6f20b0f2d738ea4538}{cal\_gregorian}
149   \textcolor{keywordflow}{case}(\textcolor{stringliteral}{'360day'})
150     calp % cal\_type = \hyperlink{namespacedc__calendar__types_ae8c1fb15e0255aa447017a0ab468e747}{cal\_360day}
151 \textcolor{keywordflow}{  case default}
152     stat = \hyperlink{namespacedc__error_acb56887bf09e6518808f8f4c95650b04}{dc\_ebadcaltype}
153     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, &
154       & \textcolor{stringliteral}{'cal\_type=<%c> is invalid calender type.'}, &
155       & c1 = trim(cal\_type) )
156     \textcolor{keywordflow}{goto} 999
157 \textcolor{keywordflow}{  end select}
158 
159   \textcolor{comment}{! 各要素への値の設定}
160   \textcolor{comment}{! Configure elements}
161   \textcolor{comment}{!}
162   \textcolor{keyword}{allocate}( calp % day\_in\_month(1:12) )
163   calp % month\_in\_year = 12
164   calp % hour\_in\_day   = 24
165   calp % min\_in\_hour   = 60
166   calp % sec\_in\_min    = 60.0\_dp
167 
168   \textcolor{keywordflow}{select case}( calp % cal\_type )
169   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_aff25d0687bf75b37d319ef5e68b942bb}{cal\_cyclic})
170     calp % day\_in\_month(1:12) = &
171       & (/ 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 30 /)
172   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_af6212ffe5e51fc8c270d28a0754c71da}{cal\_noleap})
173     calp % day\_in\_month(1:12) = &
174       & (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
175   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_a0c7574e07214536d34d1a1ff6cd1703c}{cal\_julian})
176     calp % day\_in\_month(1:12) = &
177       & (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
178   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_a56becce7ca212d6f20b0f2d738ea4538}{cal\_gregorian})
179     calp % day\_in\_month(1:12) = &
180       & (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /)
181   \textcolor{keywordflow}{case}(\hyperlink{namespacedc__calendar__types_ae8c1fb15e0255aa447017a0ab468e747}{cal\_360day})
182     calp % day\_in\_month(1:12) = &
183       & (/ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 /)
184 \textcolor{keywordflow}{  case default}
185 \textcolor{keywordflow}{  end select}
186 
187   \textcolor{comment}{! 終了処理, 例外処理}
188   \textcolor{comment}{! Termination and Exception handling}
189   \textcolor{comment}{!}
190   calp % initialized = .true.
191 999 \textcolor{keywordflow}{continue}
192   \textcolor{keyword}{nullify}( calp )
193   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}( stat, subname, err, cause\_c )
194   \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]{dccalcreate_8f90_a9b6a7a4b39f15e205d05e87be8d5e38f_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{dccalcreate_8f90_a744b4f80f1874ce765ed99e683985029}\label{dccalcreate_8f90_a744b4f80f1874ce765ed99e683985029}} 
\index{dccalcreate.\+f90@{dccalcreate.\+f90}!dccalcreate2@{dccalcreate2}}
\index{dccalcreate2@{dccalcreate2}!dccalcreate.\+f90@{dccalcreate.\+f90}}
\subsubsection{\texorpdfstring{dccalcreate2()}{dccalcreate2()}}
{\footnotesize\ttfamily subroutine dccalcreate2 (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{month\+\_\+in\+\_\+year,  }\item[{integer, dimension(\+:), intent(in)}]{day\+\_\+in\+\_\+month,  }\item[{integer, intent(in)}]{hour\+\_\+in\+\_\+day,  }\item[{integer, intent(in)}]{min\+\_\+in\+\_\+hour,  }\item[{real(dp), intent(in)}]{sec\+\_\+in\+\_\+min,  }\item[{type(dc\+\_\+cal), intent(out), optional, target}]{cal,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 200 of file dccalcreate.\+f90.



References dc\+\_\+calendar\+\_\+types\+::cal\+\_\+user\+\_\+defined, dc\+\_\+error\+::dc\+\_\+ealreadyinit, dc\+\_\+error\+::dc\+\_\+ebadcaltype, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal, dc\+\_\+types\+::dp, dc\+\_\+error\+::storeerror(), and dc\+\_\+types\+::string.


\begin{DoxyCode}
200   \textcolor{comment}{!}
201   \textcolor{comment}{! 暦の設定を行います. }
202   \textcolor{comment}{!}
203   \textcolor{comment}{! 1 ヶ月の日数, 1 日の秒数などを引数に指定して下さい. }
204   \textcolor{comment}{! グレゴリオ暦やユリウス暦などを利用する場合には}
205   \textcolor{comment}{! 上記の同名のサブルーチンを使用して下さい. }
206   \textcolor{comment}{!}
207   \textcolor{comment}{! 省略可能引数 *cal* が省略された場合には, dc\_calendar 内部で}
208   \textcolor{comment}{! 保持される "dc\_calendar\_types#DC\_CAL" 型の変数に暦が}
209   \textcolor{comment}{! 設定されます. その後の手続きで *cal* を省略した場合には}
210   \textcolor{comment}{! この暦が使用されます. }
211   \textcolor{comment}{! *cal* が省略されない場合にはその変数に暦が設定されます.}
212   \textcolor{comment}{! その暦を使用する場合, 手続きにその "dc\_calendar\_types#DC\_CAL" 型の変数}
213   \textcolor{comment}{! を与えてください. }
214   \textcolor{comment}{!}
215   \textcolor{comment}{! Set calendar. }
216   \textcolor{comment}{!}
217   \textcolor{comment}{! Specify number of days of a month, number of seconds of a day, etc. }
218   \textcolor{comment}{! to arguments. If Gregorian calendar, Julian calendar are needed, }
219   \textcolor{comment}{! see a foregoing homonymous subroutine. }
220   \textcolor{comment}{! }
221   \textcolor{comment}{! If an optional argument *cal* is omitted. }
222   \textcolor{comment}{! The calendar setting is stored to a "dc\_calendar\_types#DC\_CAL" }
223   \textcolor{comment}{! variable that is saved in the "dc\_calendar". }
224   \textcolor{comment}{! When *cal* is omitted in subsequent procedures, the internal calendar}
225   \textcolor{comment}{! is used. }
226   \textcolor{comment}{! If *cal* is not omitted, the settings is stored to the *cal*. }
227   \textcolor{comment}{! In order to use the calendar setting, use the "dc\_calendar\_types#DC\_CAL" }
228   \textcolor{comment}{! varieble to subsequent procedures. }
229   \textcolor{comment}{!}
230   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__types}{dc\_calendar\_types}\textcolor{keywordtype}{, only}: dc\_cal, \hyperlink{namespacedc__calendar__types_a01862dd22ae24667d07cb523d6f7d6fc}{cal\_user\_defined}
231   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__internal}{dc\_calendar\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
232   \textcolor{keywordtype}{use }dc\_message\textcolor{keywordtype}{, only}: messagenotify
233   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
234   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub
235   \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}
236   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
237   \textcolor{keywordtype}{implicit none}
238   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: month\_in\_year
239                               \textcolor{comment}{! 1 年の月数. }
240                               \textcolor{comment}{! Months in a year. }
241   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: day\_in\_month(:)
242                               \textcolor{comment}{! 1 ヶ月の日数. }
243                               \textcolor{comment}{! Days in months. }
244   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: hour\_in\_day
245                               \textcolor{comment}{! 1 日の時間数. }
246                               \textcolor{comment}{! Hours in a day. }
247   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: min\_in\_hour
248                               \textcolor{comment}{! 1 時間の分数. }
249                               \textcolor{comment}{! Minutes in a hour. }
250   \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: sec\_in\_min
251                               \textcolor{comment}{! 1 分の秒数. }
252                               \textcolor{comment}{! Seconds in a minute. }
253   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: cal
254                               \textcolor{comment}{! 暦情報を収めたオブジェクト. }
255                               \textcolor{comment}{! }
256                               \textcolor{comment}{! An object that stores information of }
257                               \textcolor{comment}{! calendar. }
258   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
259                               \textcolor{comment}{! 例外処理用フラグ. }
260                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
261                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します. }
262                               \textcolor{comment}{! 引数 *err* が与えられる場合, }
263                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
264                               \textcolor{comment}{! *err* に .true. が代入されます. }
265                               \textcolor{comment}{!}
266                               \textcolor{comment}{! Exception handling flag. }
267                               \textcolor{comment}{! By default, when error occur in }
268                               \textcolor{comment}{! this procedure, the program aborts. }
269                               \textcolor{comment}{! If this *err* argument is given, }
270                               \textcolor{comment}{! .true. is substituted to *err* and }
271                               \textcolor{comment}{! the program does not abort. }
272 
273 
274   \textcolor{comment}{! 作業変数}
275   \textcolor{comment}{! Work variables}
276   \textcolor{comment}{!}
277   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{pointer}:: calp =>null()
278   \textcolor{keywordtype}{integer}:: size\_day\_in\_month
279   \textcolor{keywordtype}{integer}:: stat
280   \textcolor{keywordtype}{character(STRING)}:: cause\_c
281   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: version = &
282     & \textcolor{stringliteral}{'$Name:  $'} // &
283     & \textcolor{stringliteral}{'$Id: dccalcreate.f90,v 1.4 2009-10-18 12:02:32 morikawa Exp $'}
284   character(*), \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCCalCreate2'}
285 \textcolor{keywordflow}{continue}
286   \textcolor{keyword}{call }beginsub( subname, version )
287   stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
288   cause\_c = \textcolor{stringliteral}{''}
289 
290   \textcolor{comment}{! オブジェクトのポインタ割付}
291   \textcolor{comment}{! Associate pointer of an object}
292   \textcolor{comment}{!}
293   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( cal ) ) \textcolor{keywordflow}{then}
294     calp => cal
295   \textcolor{keywordflow}{else}
296     calp => \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
297 \textcolor{keywordflow}{  end if}
298 
299 \textcolor{comment}{!!$  ! 初期設定のチェック}
300 \textcolor{comment}{!!$  ! Check initialization}
301 \textcolor{comment}{!!$  !}
302 \textcolor{comment}{!!$  if ( calp % initialized ) then}
303 \textcolor{comment}{!!$    stat = DC\_EALREADYINIT}
304 \textcolor{comment}{!!$    cause\_c = 'DC\_CAL'}
305 \textcolor{comment}{!!$    goto 999}
306 \textcolor{comment}{!!$  end if}
307 
308   \textcolor{comment}{! 月数の算出}
309   \textcolor{comment}{! Evaluate number of months}
310   \textcolor{comment}{!}
311   size\_day\_in\_month = \textcolor{keyword}{size} ( day\_in\_month ) 
312 
313   \textcolor{comment}{! 引数の正当性のチェック}
314   \textcolor{comment}{! Validate arguments}
315   \textcolor{comment}{!}
316   \textcolor{keywordflow}{if} ( .not. month\_in\_year == size\_day\_in\_month ) \textcolor{keywordflow}{then}
317     stat = \hyperlink{namespacedc__error_acb56887bf09e6518808f8f4c95650b04}{dc\_ebadcaltype}
318     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, &
319       & \textcolor{stringliteral}{'month\_in\_year=<%d> is not equal to size of day\_in\_month=<%d>'}, &
320       & i = (/ month\_in\_year, size\_day\_in\_month /) )
321     \textcolor{keywordflow}{goto} 999
322 \textcolor{keywordflow}{  end if}
323 
324   \textcolor{keywordflow}{if} ( month\_in\_year < 1 ) \textcolor{keywordflow}{then}
325     stat = \hyperlink{namespacedc__error_acb56887bf09e6518808f8f4c95650b04}{dc\_ebadcaltype}
326     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'month\_in\_year=<%d> must be positive'}, &
327       & i = (/ month\_in\_year /) )
328     \textcolor{keywordflow}{goto} 999
329 \textcolor{keywordflow}{  end if}
330 
331   \textcolor{keywordflow}{if} ( hour\_in\_day < 1 ) \textcolor{keywordflow}{then}
332     stat = \hyperlink{namespacedc__error_acb56887bf09e6518808f8f4c95650b04}{dc\_ebadcaltype}
333     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'hour\_in\_day=<%d> must be positive'}, &
334       & i = (/ hour\_in\_day /) )
335     \textcolor{keywordflow}{goto} 999
336 \textcolor{keywordflow}{  end if}
337 
338   \textcolor{keywordflow}{if} ( min\_in\_hour < 1 ) \textcolor{keywordflow}{then}
339     stat = \hyperlink{namespacedc__error_acb56887bf09e6518808f8f4c95650b04}{dc\_ebadcaltype}
340     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'min\_in\_hour=<%d> must be positive'}, &
341       & i = (/ min\_in\_hour /) )
342     \textcolor{keywordflow}{goto} 999
343 \textcolor{keywordflow}{  end if}
344 
345   \textcolor{keywordflow}{if} ( .not. sec\_in\_min > 0.0\_dp ) \textcolor{keywordflow}{then}
346     stat = \hyperlink{namespacedc__error_acb56887bf09e6518808f8f4c95650b04}{dc\_ebadcaltype}
347     \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'sec\_in\_min=<%f> must be positive'}, &
348       & d = (/ sec\_in\_min /) )
349     \textcolor{keywordflow}{goto} 999
350 \textcolor{keywordflow}{  end if}
351 
352   \textcolor{comment}{! 各要素への値の設定}
353   \textcolor{comment}{! Configure elements}
354   \textcolor{comment}{!}
355   calp % cal\_type      = \hyperlink{namespacedc__calendar__types_a01862dd22ae24667d07cb523d6f7d6fc}{cal\_user\_defined}
356   calp % month\_in\_year = month\_in\_year
357   \textcolor{keyword}{allocate}( calp % day\_in\_month(1:size\_day\_in\_month) )
358   calp % day\_in\_month  = day\_in\_month 
359   calp % hour\_in\_day   = hour\_in\_day  
360   calp % min\_in\_hour   = min\_in\_hour  
361   calp % sec\_in\_min    = sec\_in\_min   
362 
363   \textcolor{comment}{! 終了処理, 例外処理}
364   \textcolor{comment}{! Termination and Exception handling}
365   \textcolor{comment}{!}
366   calp % initialized = .true.
367 999 \textcolor{keywordflow}{continue}
368   \textcolor{keyword}{nullify}( calp )
369   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}( stat, subname, err, cause\_c )
370   \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]{dccalcreate_8f90_a744b4f80f1874ce765ed99e683985029_cgraph}
\end{center}
\end{figure}
