\hypertarget{dcdatetimemod_8f90}{}\section{dc\+\_\+utils/dcdatetimemod.f90 File Reference}
\label{dcdatetimemod_8f90}\index{dc\+\_\+utils/dcdatetimemod.\+f90@{dc\+\_\+utils/dcdatetimemod.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
type(dc\+\_\+difftime) function \hyperlink{dcdatetimemod_8f90_ace8774c88c464f706808fbad3ce1f11a}{dcdatetime\+\_\+mod\+\_\+ff} (diff1, diff2)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{dcdatetimemod_8f90_ace8774c88c464f706808fbad3ce1f11a}\label{dcdatetimemod_8f90_ace8774c88c464f706808fbad3ce1f11a}} 
\index{dcdatetimemod.\+f90@{dcdatetimemod.\+f90}!dcdatetime\+\_\+mod\+\_\+ff@{dcdatetime\+\_\+mod\+\_\+ff}}
\index{dcdatetime\+\_\+mod\+\_\+ff@{dcdatetime\+\_\+mod\+\_\+ff}!dcdatetimemod.\+f90@{dcdatetimemod.\+f90}}
\subsubsection{\texorpdfstring{dcdatetime\+\_\+mod\+\_\+ff()}{dcdatetime\_mod\_ff()}}
{\footnotesize\ttfamily type(dc\+\_\+difftime) function dcdatetime\+\_\+mod\+\_\+ff (\begin{DoxyParamCaption}\item[{type(dc\+\_\+difftime), intent(in)}]{diff1,  }\item[{type(dc\+\_\+difftime), intent(in)}]{diff2 }\end{DoxyParamCaption})}



Definition at line 11 of file dcdatetimemod.\+f90.



References dc\+\_\+date\+\_\+types\+::cyclic\+\_\+mdays, dc\+\_\+date\+\_\+internal\+::dcdate\+\_\+nondimcheck(), and dc\+\_\+date\+\_\+internal\+::dcdate\+\_\+normalize().


\begin{DoxyCode}
11     \textcolor{comment}{!}
12     \textcolor{comment}{! 引数 <b>diff1</b> を <b>diff2</b> で除算した際の余りを返します.}
13     \textcolor{comment}{!}
14     \textcolor{comment}{! ※ 注意: 月差と日時の混在する除算は近似的結果になるおそれがあります}
15     \textcolor{comment}{!}
16     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__internal}{dc\_date\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__date__internal_ac3f0935623089b447b453928ff99b788}{dcdate\_normalize}, 
      \hyperlink{namespacedc__date__internal_ad90bad9c02e4b49abc3d68572bb74798}{dcdate\_nondimcheck}
17     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__date__types_a1b048467a83d24231df41029f3d8f30e}{cyclic\_mdays}, dc\_datetime, dc\_difftime
18     \textcolor{keywordtype}{use }\hyperlink{namespacedc__scaledsec}{dc\_scaledsec}\textcolor{keywordtype}{, only}: dc\_scaled\_sec, &
19       & \textcolor{keyword}{operator}(==), \textcolor{keyword}{operator}(<), \textcolor{keyword}{operator}(>), \textcolor{keyword}{operator}(<=), \textcolor{keyword}{operator}(>=), &
20       & \textcolor{keyword}{operator}(+), \textcolor{keyword}{operator}(-), \textcolor{keyword}{operator}(*), \textcolor{keyword}{operator}(/), &
21       & modscl => mod, modulo, int, abs, sign
22     \textcolor{keywordtype}{implicit none}
23     \textcolor{keywordtype}{type}(dc\_difftime):: result
24     \textcolor{keywordtype}{type}(dc\_difftime), \textcolor{keywordtype}{intent(in)}:: diff1, diff2
25     \textcolor{keywordtype}{type}(dc\_scaled\_sec):: sec1, sec2
26     \textcolor{keywordtype}{type}(dc\_scaled\_sec):: zero\_sec
27   \textcolor{keywordflow}{continue}
28     result % day\_seconds = diff1 % day\_seconds
29     \textcolor{keywordflow}{if} (diff1 % day == zero\_sec .and. diff2 % day == zero\_sec .and. &
30       & diff1 % sec == zero\_sec .and. diff2 % sec == zero\_sec) \textcolor{keywordflow}{then}
31       result % mon = modscl(diff1 % mon, diff2 % mon)
32       result % day = zero\_sec
33       result % sec = zero\_sec
34     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (diff1 % sec == zero\_sec .and. diff2 % sec == zero\_sec) \textcolor{keywordflow}{then}
35       result % mon = zero\_sec
36       result % day = modscl((\hyperlink{namespacedc__date__types_a1b048467a83d24231df41029f3d8f30e}{cyclic\_mdays} * diff1 % mon + diff1 % day), &
37         & (\hyperlink{namespacedc__date__types_a1b048467a83d24231df41029f3d8f30e}{cyclic\_mdays} * diff2 % mon + diff2 % day))
38       result % sec = zero\_sec
39     \textcolor{keywordflow}{else}
40       sec1 = diff1 % day\_seconds * (\hyperlink{namespacedc__date__types_a1b048467a83d24231df41029f3d8f30e}{cyclic\_mdays} * diff1 % mon + diff1 % day) &
41         & + diff1 % sec
42       sec2 = diff2 % day\_seconds * (\hyperlink{namespacedc__date__types_a1b048467a83d24231df41029f3d8f30e}{cyclic\_mdays} * diff2 % mon + diff2 % day) &
43         & + diff2 % sec
44       result % sec = modscl(sec1, sec2)
45       result % day = zero\_sec
46       result % mon = zero\_sec
47       \textcolor{keyword}{call }\hyperlink{namespacedc__date__internal_ac3f0935623089b447b453928ff99b788}{dcdate\_normalize}(result % day, result % sec, result % day\_seconds, result %
       nondim\_flag)
48 \textcolor{keywordflow}{    endif}
49     \textcolor{keyword}{call }\hyperlink{namespacedc__date__internal_ad90bad9c02e4b49abc3d68572bb74798}{dcdate\_nondimcheck}(\textcolor{stringliteral}{'dc\_date#mod'}, diff1, diff2, result)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{dcdatetimemod_8f90_ace8774c88c464f706808fbad3ce1f11a_cgraph}
\end{center}
\end{figure}
