\hypertarget{dccaldatedifference_8f90}{}\section{dc\+\_\+utils/dccaldatedifference.f90 File Reference}
\label{dccaldatedifference_8f90}\index{dc\+\_\+utils/dccaldatedifference.\+f90@{dc\+\_\+utils/dccaldatedifference.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
real(dp) function \hyperlink{dccaldatedifference_8f90_ae950752933e2b65dfb1272a8a7f34f2b}{dccaldatedifference1} (start\+\_\+date, end\+\_\+date, cal)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{dccaldatedifference_8f90_ae950752933e2b65dfb1272a8a7f34f2b}\label{dccaldatedifference_8f90_ae950752933e2b65dfb1272a8a7f34f2b}} 
\index{dccaldatedifference.\+f90@{dccaldatedifference.\+f90}!dccaldatedifference1@{dccaldatedifference1}}
\index{dccaldatedifference1@{dccaldatedifference1}!dccaldatedifference.\+f90@{dccaldatedifference.\+f90}}
\subsubsection{\texorpdfstring{dccaldatedifference1()}{dccaldatedifference1()}}
{\footnotesize\ttfamily real(dp) function dccaldatedifference1 (\begin{DoxyParamCaption}\item[{type(dc\+\_\+cal\+\_\+date), intent(in)}]{start\+\_\+date,  }\item[{type(dc\+\_\+cal\+\_\+date), intent(in)}]{end\+\_\+date,  }\item[{type(dc\+\_\+cal), intent(in), optional, target}]{cal }\end{DoxyParamCaption})}



Definition at line 15 of file dccaldatedifference.\+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\+\_\+calendar\+\_\+types\+::cal\+\_\+user\+\_\+defined, 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}
15   \textcolor{comment}{!}
16   \textcolor{comment}{! 日時差を算出します. }
17   \textcolor{comment}{!}
18   \textcolor{comment}{! 省略可能引数 *cal* が省略された場合には, 日時差の算出に}
19   \textcolor{comment}{! dc\_calendar 内部で保持される暦が用いられます. }
20   \textcolor{comment}{! *cal* が省略されない場合にはその変数に設定された暦が用いられます. }
21   \textcolor{comment}{!}
22   \textcolor{comment}{! Evaluate difference of date. }
23   \textcolor{comment}{!}
24   \textcolor{comment}{! If an optional argument *cal* is omitted, }
25   \textcolor{comment}{! information of calendar that is stored in the "dc\_calendar" }
26   \textcolor{comment}{! is used for evaluation of difference of date. }
27   \textcolor{comment}{! If *cal* is not omitted, information of the variable is used. }
28   \textcolor{comment}{!}
29 
30   \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}, &
31     & \hyperlink{namespacedc__calendar__internal_aa5cfbed96ce640b2c6dd7bc0df513872}{dccaltype\_str}, \hyperlink{namespacedc__calendar__internal_ae2ad5ba61c1d074aea90ec876012150c}{dccaldate\_str2usym}
32   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__types}{dc\_calendar\_types}\textcolor{keywordtype}{, only}: dc\_cal, dc\_cal\_date, &
33     & \hyperlink{namespacedc__calendar__types_a9f02aaa42bc65301b0f6e86c34f5e975}{unit\_symbol\_year}, \hyperlink{namespacedc__calendar__types_a6a2218105981b62304a32c51f20e0824}{unit\_symbol\_month}, 
      \hyperlink{namespacedc__calendar__types_ab4be572292ddec215a2e956866a4d893}{unit\_symbol\_day}, &
34     & \hyperlink{namespacedc__calendar__types_ab35dfa690b91efaf7cfc2d056da4629b}{unit\_symbol\_hour}, \hyperlink{namespacedc__calendar__types_ac941d6da4d3fd07f09b543d20796e606}{unit\_symbol\_min}, 
      \hyperlink{namespacedc__calendar__types_a15ce2d6947c7143915fa55b6549d4997}{unit\_symbol\_sec}, &
35     & \hyperlink{namespacedc__calendar__types_a01862dd22ae24667d07cb523d6f7d6fc}{cal\_user\_defined}, &
36     & \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}
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)}:: sec
43                               \textcolor{comment}{! *start\_date* と *end\_date* との差 (秒数). }
44                               \textcolor{comment}{! Difference (seconds) between *start\_date* and *end\_date*.}
45   \textcolor{keywordtype}{type}(dc\_cal\_date), \textcolor{keywordtype}{intent(in)}:: start\_date
46                               \textcolor{comment}{! 起点となる日時. }
47                               \textcolor{comment}{! Date of origin. }
48   \textcolor{keywordtype}{type}(dc\_cal\_date), \textcolor{keywordtype}{intent(in)}:: end\_date
49                               \textcolor{comment}{! 終点となる日時. }
50                               \textcolor{comment}{! Date of terminus. }
51   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: cal
52                               \textcolor{comment}{! 暦情報を収めたオブジェクト. }
53                               \textcolor{comment}{! }
54                               \textcolor{comment}{! An object that stores information of }
55                               \textcolor{comment}{! calendar. }
56 
57   \textcolor{comment}{! 作業変数}
58   \textcolor{comment}{! Work variables}
59   \textcolor{comment}{!}
60   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{pointer}:: calp =>null()
61   \textcolor{keywordtype}{real(DP)}:: start\_year, start\_day, start\_sec, start\_neg\_offset\_day
62   \textcolor{keywordtype}{real(DP)}::   end\_year,   end\_day,   end\_sec,   end\_neg\_offset\_day
63   \textcolor{keywordtype}{integer}:: day\_in\_4years, day\_in\_400years
64   \textcolor{keywordtype}{integer}:: start\_year\_int, end\_year\_int
65   \textcolor{keywordtype}{integer}:: i, j
66   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCCalDateDifference1'}
67 \textcolor{keywordflow}{continue}
68   \textcolor{comment}{! オブジェクトのポインタ割付}
69   \textcolor{comment}{! Associate pointer of an object}
70   \textcolor{comment}{!}
71   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( cal ) ) \textcolor{keywordflow}{then}
72     calp => cal
73   \textcolor{keywordflow}{else}
74     calp => \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
75     \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keyword}{call }\hyperlink{namespacedc__calendar__internal_ab33be336dc4b2e284e99c43b24235728}{default\_cal\_set}
76 \textcolor{keywordflow}{  end if}
77 
78   \textcolor{comment}{! 初期設定のチェック}
79   \textcolor{comment}{! Check initialization}
80   \textcolor{comment}{!}
81   \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keywordflow}{then}
82     sec = 0.0\_dp
83     \textcolor{keywordflow}{return}
84 \textcolor{keywordflow}{  end if}
85 
86   \textcolor{keywordflow}{if} ( .not. start\_date % initialized ) \textcolor{keywordflow}{then}
87     sec = 0.0\_dp
88     \textcolor{keywordflow}{return}
89 \textcolor{keywordflow}{  end if}
90 
91   \textcolor{keywordflow}{if} ( .not. end\_date % initialized ) \textcolor{keywordflow}{then}
92     sec = 0.0\_dp
93     \textcolor{keywordflow}{return}
94 \textcolor{keywordflow}{  end if}
95 
96   start\_neg\_offset\_day = 0
97 \textcolor{keyword}{  end}\_neg\_offset\_day   = 0
98 
99   start\_year\_int = start\_date % year
100 \textcolor{keyword}{  end}\_year\_int   = end\_date % year
101 
102   \textcolor{comment}{! 日への変換}
103   \textcolor{comment}{! Convert into days}
104   \textcolor{comment}{! }
105   \textcolor{keywordflow}{select case}( calp % cal\_type )
106   \textcolor{keywordflow}{case}( \hyperlink{namespacedc__calendar__types_a0c7574e07214536d34d1a1ff6cd1703c}{cal\_julian} )
107 
108     day\_in\_4years = 1461
109 
110     \textcolor{comment}{! 年が負の場合，400 年単位で引き算し下駄を履かせる}
111     \textcolor{comment}{!}
112     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} ( start\_year\_int < 1 )
113       start\_neg\_offset\_day =   start\_neg\_offset\_day &
114         &                    + day\_in\_4years * 100
115       start\_year\_int       =   start\_year\_int &
116         &                    + 400
117 \textcolor{keywordflow}{    end do}
118 
119     \textcolor{comment}{! start\_date の日への変換}
120     \textcolor{comment}{! Convert start\_date into days}
121     \textcolor{comment}{! }
122     \textcolor{keywordflow}{if} ( ( start\_year\_int - 1 ) > 4 ) \textcolor{keywordflow}{then}
123       start\_day = int( ( start\_year\_int - 1 ) / 4 ) * day\_in\_4years
124       start\_year = mod( start\_year\_int - 1, 4 ) + 1
125     \textcolor{keywordflow}{else}
126       start\_day  = 0
127       start\_year = start\_year\_int
128 \textcolor{keywordflow}{    end if}
129 
130     start\_day = start\_day + ( start\_year - 1 ) * sum( calp % day\_in\_month(:) )
131     \textcolor{keywordflow}{do} i = 1, start\_date % month - 1
132       \textcolor{keywordflow}{if} ( start\_year == 4 .and. i == 2 ) \textcolor{keywordflow}{then}
133         start\_day = start\_day + 29
134       \textcolor{keywordflow}{else}
135         start\_day = start\_day + calp % day\_in\_month(i)
136 \textcolor{keywordflow}{      end if}
137 \textcolor{keywordflow}{    end do}
138     start\_day = start\_day + start\_date % day
139 
140     \textcolor{comment}{! 年が負の場合，400 年単位で引き算し下駄を履かせる}
141     \textcolor{comment}{!}
142     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} ( end\_year\_int < 1 )
143 \textcolor{keyword}{      end}\_neg\_offset\_day =   end\_neg\_offset\_day &
144         &                  + day\_in\_4years * 100
145 \textcolor{keyword}{      end}\_year\_int       =   end\_year\_int &
146         &                  + 400
147 \textcolor{keywordflow}{    end do}
148 
149     \textcolor{comment}{! end\_date の日への変換}
150     \textcolor{comment}{! Convert end\_date into days}
151     \textcolor{comment}{! }
152     \textcolor{keywordflow}{if} ( ( end\_year\_int - 1 ) > 4 ) \textcolor{keywordflow}{then}
153 \textcolor{keyword}{      end}\_day = int( ( end\_year\_int - 1 ) / 4 ) * day\_in\_4years
154 \textcolor{keyword}{      end}\_year = mod( end\_year\_int - 1, 4 ) + 1
155     \textcolor{keywordflow}{else}
156 \textcolor{keyword}{      end}\_day  = 0
157 \textcolor{keyword}{      end}\_year = end\_year\_int
158 \textcolor{keywordflow}{    end if}
159 
160 \textcolor{keyword}{    end}\_day = end\_day + ( end\_year - 1 ) * sum ( calp % day\_in\_month(:) )
161     \textcolor{keywordflow}{do} i = 1, end\_date % month - 1
162       \textcolor{keywordflow}{if} ( end\_year == 4 .and. i == 2 ) \textcolor{keywordflow}{then}
163 \textcolor{keyword}{        end}\_day = end\_day + 29
164       \textcolor{keywordflow}{else}
165 \textcolor{keyword}{        end}\_day = end\_day + calp % day\_in\_month(i)
166 \textcolor{keywordflow}{      end if}
167 \textcolor{keywordflow}{    end do}
168 \textcolor{keyword}{    end}\_day = end\_day + end\_date % day
169 
170   \textcolor{keywordflow}{case}( \hyperlink{namespacedc__calendar__types_a56becce7ca212d6f20b0f2d738ea4538}{cal\_gregorian} )
171 
172     day\_in\_400years = 146097
173 
174     \textcolor{comment}{! 年が負の場合，400 年単位で引き算し下駄を履かせる}
175     \textcolor{comment}{!}
176     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} ( start\_year\_int < 1 )
177       start\_neg\_offset\_day =   start\_neg\_offset\_day &
178         &                    + day\_in\_400years
179       start\_year\_int       =   start\_year\_int &
180         &                    + 400
181 \textcolor{keywordflow}{    end do}
182 
183     \textcolor{comment}{! start\_date の日への変換}
184     \textcolor{comment}{! Convert start\_date into days}
185     \textcolor{comment}{! }
186     \textcolor{keywordflow}{if} ( ( start\_year\_int - 1 ) > 400 ) \textcolor{keywordflow}{then}
187       start\_day = int( ( start\_year\_int - 1 ) / 400 ) * day\_in\_400years
188       start\_year = mod( start\_year\_int - 1, 400 ) + 1
189     \textcolor{keywordflow}{else}
190       start\_day  = 0
191       start\_year = start\_year\_int
192 \textcolor{keywordflow}{    end if}
193 
194     \textcolor{keywordflow}{do} j = 1, int( start\_year - 1 )
195       \textcolor{keywordflow}{do} i = 1, calp % month\_in\_year
196         \textcolor{keywordflow}{if} ( i == 2 ) \textcolor{keywordflow}{then}
197           \textcolor{keywordflow}{if}     ( mod( j, 400 ) == 0 ) \textcolor{keywordflow}{then}
198             start\_day = start\_day + 29
199           \textcolor{keywordflow}{elseif} ( mod( j, 100 ) == 0 ) \textcolor{keywordflow}{then}
200             start\_day = start\_day + 28
201           \textcolor{keywordflow}{elseif} ( mod( j, 4   ) == 0 ) \textcolor{keywordflow}{then}
202             start\_day = start\_day + 29
203           \textcolor{keywordflow}{else}
204             start\_day = start\_day + 28
205 \textcolor{keywordflow}{          end if}
206         \textcolor{keywordflow}{else}
207           start\_day = start\_day + calp % day\_in\_month(i)
208 \textcolor{keywordflow}{        end if}
209 \textcolor{keywordflow}{      end do}
210 \textcolor{keywordflow}{    end do}
211 
212     \textcolor{keywordflow}{do} i = 1, start\_date % month - 1
213       \textcolor{keywordflow}{if} ( i == 2 ) \textcolor{keywordflow}{then}
214         \textcolor{keywordflow}{if}     ( mod( start\_year, 400.0\_dp ) == 0 ) \textcolor{keywordflow}{then}
215           start\_day = start\_day + 29
216         \textcolor{keywordflow}{elseif} ( mod( start\_year, 100.0\_dp ) == 0 ) \textcolor{keywordflow}{then}
217           start\_day = start\_day + 28
218         \textcolor{keywordflow}{elseif} ( mod( start\_year, 4.0\_dp   ) == 0 ) \textcolor{keywordflow}{then}
219           start\_day = start\_day + 29
220         \textcolor{keywordflow}{else}
221           start\_day = start\_day + 28
222 \textcolor{keywordflow}{        end if}
223       \textcolor{keywordflow}{else}
224         start\_day = start\_day + calp % day\_in\_month(i)
225 \textcolor{keywordflow}{      end if}
226 \textcolor{keywordflow}{    end do}
227 
228     start\_day = start\_day + start\_date % day
229 
230     \textcolor{comment}{! 年が負の場合，400 年単位で引き算し下駄を履かせる}
231     \textcolor{comment}{!}
232     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} ( end\_year\_int < 1 )
233 \textcolor{keyword}{      end}\_neg\_offset\_day =   end\_neg\_offset\_day &
234         &                  + day\_in\_400years
235 \textcolor{keyword}{      end}\_year\_int       =   end\_year\_int &
236         &                  + 400
237 \textcolor{keywordflow}{    end do}
238 
239     \textcolor{comment}{! end\_date の日への変換}
240     \textcolor{comment}{! Convert end\_date into days}
241     \textcolor{comment}{! }
242     \textcolor{keywordflow}{if} ( ( end\_year\_int - 1 ) > 400 ) \textcolor{keywordflow}{then}
243 \textcolor{keyword}{      end}\_day = int( ( end\_year\_int - 1 ) / 400 ) * day\_in\_400years
244 \textcolor{keyword}{      end}\_year = mod( end\_year\_int - 1, 400 ) + 1
245     \textcolor{keywordflow}{else}
246 \textcolor{keyword}{      end}\_day  = 0
247 \textcolor{keyword}{      end}\_year = end\_year\_int
248 \textcolor{keywordflow}{    end if}
249 
250     \textcolor{keywordflow}{do} j = 1, int( end\_year - 1 )
251       \textcolor{keywordflow}{do} i = 1, calp % month\_in\_year
252         \textcolor{keywordflow}{if} ( i == 2 ) \textcolor{keywordflow}{then}
253           \textcolor{keywordflow}{if}     ( mod( j, 400 ) == 0 ) \textcolor{keywordflow}{then}
254 \textcolor{keyword}{            end}\_day = end\_day + 29
255           \textcolor{keywordflow}{elseif} ( mod( j, 100 ) == 0 ) \textcolor{keywordflow}{then}
256 \textcolor{keyword}{            end}\_day = end\_day + 28
257           \textcolor{keywordflow}{elseif} ( mod( j, 4   ) == 0 ) \textcolor{keywordflow}{then}
258 \textcolor{keyword}{            end}\_day = end\_day + 29
259           \textcolor{keywordflow}{else}
260 \textcolor{keyword}{            end}\_day = end\_day + 28
261 \textcolor{keywordflow}{          end if}
262         \textcolor{keywordflow}{else}
263 \textcolor{keyword}{          end}\_day = end\_day + calp % day\_in\_month(i)
264 \textcolor{keywordflow}{        end if}
265 \textcolor{keywordflow}{      end do}
266 \textcolor{keywordflow}{    end do}
267 
268     \textcolor{keywordflow}{do} i = 1, end\_date % month - 1
269       \textcolor{keywordflow}{if} ( i == 2 ) \textcolor{keywordflow}{then}
270         \textcolor{keywordflow}{if}     ( mod( end\_year, 400.0\_dp ) == 0 ) \textcolor{keywordflow}{then}
271 \textcolor{keyword}{          end}\_day = end\_day + 29
272         \textcolor{keywordflow}{elseif} ( mod( end\_year, 100.0\_dp ) == 0 ) \textcolor{keywordflow}{then}
273 \textcolor{keyword}{          end}\_day = end\_day + 28
274         \textcolor{keywordflow}{elseif} ( mod( end\_year, 4.0\_dp   ) == 0 ) \textcolor{keywordflow}{then}
275 \textcolor{keyword}{          end}\_day = end\_day + 29
276         \textcolor{keywordflow}{else}
277 \textcolor{keyword}{          end}\_day = end\_day + 28
278 \textcolor{keywordflow}{        end if}
279       \textcolor{keywordflow}{else}
280 \textcolor{keyword}{        end}\_day = end\_day + calp % day\_in\_month(i)
281 \textcolor{keywordflow}{      end if}
282 \textcolor{keywordflow}{    end do}
283 
284 \textcolor{keyword}{    end}\_day = end\_day + end\_date % day
285 
286 \textcolor{keywordflow}{  case default}
287     \textcolor{comment}{! start\_date の日への変換}
288     \textcolor{comment}{! Convert start\_date into days}
289     \textcolor{comment}{! }
290     start\_day = ( start\_year\_int - 1 ) * sum( calp % day\_in\_month(:) )
291     \textcolor{keywordflow}{do} i = 1, start\_date % month - 1
292       start\_day = start\_day + calp % day\_in\_month(i)
293 \textcolor{keywordflow}{    end do}
294     start\_day = start\_day + start\_date % day
295 
296     \textcolor{comment}{! end\_date の日への変換}
297     \textcolor{comment}{! Convert end\_date into days}
298     \textcolor{comment}{! }
299 \textcolor{keyword}{    end}\_day = ( end\_year\_int - 1 ) * sum ( calp % day\_in\_month(:) )
300     \textcolor{keywordflow}{do} i = 1, end\_date % month - 1
301 \textcolor{keyword}{      end}\_day = end\_day + calp % day\_in\_month(i)
302 \textcolor{keywordflow}{    end do}
303 \textcolor{keyword}{    end}\_day = end\_day + end\_date % day
304 \textcolor{keywordflow}{  end select}
305 
306   \textcolor{comment}{! start\_date の秒への変換}
307   \textcolor{comment}{! Convert start\_date into seconds}
308   \textcolor{comment}{! }
309   start\_sec =   ( start\_day - 1 - start\_neg\_offset\_day ) &
310       &                           * calp % hour\_in\_day &
311       &                           * calp % min\_in\_hour &
312       &                           * calp % sec\_in\_min  &
313       &       + start\_date % hour * calp % min\_in\_hour &
314       &                           * calp % sec\_in\_min  &
315       &       + start\_date % min  * calp % sec\_in\_min  &
316       &       + start\_date % sec
317 
318   \textcolor{comment}{! end\_date の秒への変換}
319   \textcolor{comment}{! Convert end\_date into seconds}
320   \textcolor{comment}{! }
321 \textcolor{keyword}{  end}\_sec =   ( end\_day - 1 - end\_neg\_offset\_day ) &
322       &                       * calp % hour\_in\_day &
323       &                       * calp % min\_in\_hour &
324       &                       * calp % sec\_in\_min  &
325       &     + end\_date % hour * calp % min\_in\_hour &
326       &                       * calp % sec\_in\_min  &
327       &     + end\_date % min  * calp % sec\_in\_min  &
328       &     + end\_date % sec
329 
330   \textcolor{comment}{! 差分の計算}
331   \textcolor{comment}{! Calculate difference}
332   \textcolor{comment}{!}
333   sec = end\_sec - start\_sec
334 
335   \textcolor{comment}{! 終了処理, 例外処理}
336   \textcolor{comment}{! Termination and Exception handling}
337   \textcolor{comment}{!}
338 999 \textcolor{keywordflow}{continue}
339   \textcolor{keyword}{nullify}( calp )
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{dccaldatedifference_8f90_ae950752933e2b65dfb1272a8a7f34f2b_cgraph}
\end{center}
\end{figure}
