\hypertarget{dcdatetimediv_8f90}{}\section{dc\+\_\+utils/dcdatetimediv.f90 File Reference}
\label{dcdatetimediv_8f90}\index{dc\+\_\+utils/dcdatetimediv.\+f90@{dc\+\_\+utils/dcdatetimediv.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
type(dc\+\_\+difftime) function \hyperlink{dcdatetimediv_8f90_a70ce0c279ecb01be7ce9a5d728d99f79}{dcdatetime\+\_\+div\+\_\+fi} (diff, denominator)
\item 
type(dc\+\_\+difftime) function \hyperlink{dcdatetimediv_8f90_a7f644d7506039ae8e076ae7206b630a1}{dcdatetime\+\_\+div\+\_\+fr} (diff, denominator)
\item 
type(dc\+\_\+difftime) function \hyperlink{dcdatetimediv_8f90_ac1464adce4b98596284188e9c40431a4}{dcdatetime\+\_\+div\+\_\+fd} (diff, denominator)
\item 
real(dp) function \hyperlink{dcdatetimediv_8f90_a8deebb80e741481ca6922ef7695998c5}{dcdatetime\+\_\+div\+\_\+ff} (diff1, diff2)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{dcdatetimediv_8f90_ac1464adce4b98596284188e9c40431a4}\label{dcdatetimediv_8f90_ac1464adce4b98596284188e9c40431a4}} 
\index{dcdatetimediv.\+f90@{dcdatetimediv.\+f90}!dcdatetime\+\_\+div\+\_\+fd@{dcdatetime\+\_\+div\+\_\+fd}}
\index{dcdatetime\+\_\+div\+\_\+fd@{dcdatetime\+\_\+div\+\_\+fd}!dcdatetimediv.\+f90@{dcdatetimediv.\+f90}}
\subsubsection{\texorpdfstring{dcdatetime\+\_\+div\+\_\+fd()}{dcdatetime\_div\_fd()}}
{\footnotesize\ttfamily type(dc\+\_\+difftime) function dcdatetime\+\_\+div\+\_\+fd (\begin{DoxyParamCaption}\item[{type(dc\+\_\+difftime), intent(in)}]{diff,  }\item[{real(dp), intent(in)}]{denominator }\end{DoxyParamCaption})}



Definition at line 52 of file dcdatetimediv.\+f90.



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


\begin{DoxyCode}
52     \textcolor{comment}{!}
53     \textcolor{comment}{! ※ 注意 : 月差を除算すると近似的結果になるおそれがあります}
54     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__internal}{dc\_date\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__date__internal_ac3f0935623089b447b453928ff99b788}{dcdate\_normalize}
55     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__date__types_a1b048467a83d24231df41029f3d8f30e}{cyclic\_mdays}, dc\_datetime, dc\_difftime
56     \textcolor{keywordtype}{use }\hyperlink{namespacedc__scaledsec}{dc\_scaledsec}\textcolor{keywordtype}{, only}: dc\_scaled\_sec, &
57       & \textcolor{keyword}{operator}(<), \textcolor{keyword}{operator}(>), \textcolor{keyword}{operator}(<=), \textcolor{keyword}{operator}(>=), &
58       & \textcolor{keyword}{operator}(+), \textcolor{keyword}{operator}(-), \textcolor{keyword}{operator}(*), \textcolor{keyword}{operator}(/), &
59       & modulo, int, abs, sign
60     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
61     \textcolor{keywordtype}{implicit none}
62     \textcolor{keywordtype}{type}(dc\_difftime):: result
63     \textcolor{keywordtype}{type}(dc\_difftime), \textcolor{keywordtype}{intent(in)}:: diff
64     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: denominator
65     \textcolor{keywordtype}{type}(dc\_scaled\_sec):: month, day
66   \textcolor{keywordflow}{continue}
67     month = int( diff % mon / denominator )
68     result % mon = int(month)
69     day =   int( diff % day / denominator ) &
70       &   + int(\hyperlink{namespacedc__date__types_a1b048467a83d24231df41029f3d8f30e}{cyclic\_mdays} * (month - result % mon))
71     result % day = int(day)
72     result % sec = &
73       & diff % sec / denominator + (day - result % day) * diff % day\_seconds
74     result % day\_seconds = diff % day\_seconds
75     result % nondim\_flag = diff % nondim\_flag
76     \textcolor{keyword}{call }\hyperlink{namespacedc__date__internal_ac3f0935623089b447b453928ff99b788}{dcdate\_normalize}(result % day, result % sec, result % day\_seconds, result %
       nondim\_flag)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{dcdatetimediv_8f90_ac1464adce4b98596284188e9c40431a4_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{dcdatetimediv_8f90_a8deebb80e741481ca6922ef7695998c5}\label{dcdatetimediv_8f90_a8deebb80e741481ca6922ef7695998c5}} 
\index{dcdatetimediv.\+f90@{dcdatetimediv.\+f90}!dcdatetime\+\_\+div\+\_\+ff@{dcdatetime\+\_\+div\+\_\+ff}}
\index{dcdatetime\+\_\+div\+\_\+ff@{dcdatetime\+\_\+div\+\_\+ff}!dcdatetimediv.\+f90@{dcdatetimediv.\+f90}}
\subsubsection{\texorpdfstring{dcdatetime\+\_\+div\+\_\+ff()}{dcdatetime\_div\_ff()}}
{\footnotesize\ttfamily real(dp) function dcdatetime\+\_\+div\+\_\+ff (\begin{DoxyParamCaption}\item[{type(dc\+\_\+difftime), intent(in)}]{diff1,  }\item[{type(dc\+\_\+difftime), intent(in)}]{diff2 }\end{DoxyParamCaption})}



Definition at line 80 of file dcdatetimediv.\+f90.



References dc\+\_\+date\+\_\+types\+::cyclic\+\_\+mdays, and dc\+\_\+types\+::dp.


\begin{DoxyCode}
80     \textcolor{comment}{!}
81     \textcolor{comment}{! ※ 注意 : 月差と日時の混在する除算は近似的結果になるおそれがあります}
82     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__date__types_a1b048467a83d24231df41029f3d8f30e}{cyclic\_mdays}
83     \textcolor{keywordtype}{use }\hyperlink{namespacedc__scaledsec}{dc\_scaledsec}\textcolor{keywordtype}{, only}: dc\_scaled\_sec, \textcolor{keyword}{assignment}(=), &
84       & \textcolor{keyword}{operator}(<), \textcolor{keyword}{operator}(>), \textcolor{keyword}{operator}(<=), \textcolor{keyword}{operator}(>=), &
85       & \textcolor{keyword}{operator}(+), \textcolor{keyword}{operator}(-), \textcolor{keyword}{operator}(*), \textcolor{keyword}{operator}(/), &
86       & modulo, int, abs, sign
87     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: dc\_datetime, dc\_difftime
88     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
89     \textcolor{keywordtype}{implicit none}
90     \textcolor{keywordtype}{real(DP)}:: result
91     \textcolor{keywordtype}{type}(dc\_difftime), \textcolor{keywordtype}{intent(in)}:: diff1, diff2
92   \textcolor{keywordflow}{continue}
93     \textcolor{comment}{! ゼロ割対応コードが必要か?}
94     result = &
95       & (diff1 % day\_seconds * (cyclic\_mdays * diff1 % mon + diff1 % day) &
96       & + diff1 % sec) / &
97       & (diff2 % day\_seconds * (cyclic\_mdays * diff2 % mon + diff2 % day) &
98       & + diff2 % sec)
\end{DoxyCode}
\mbox{\Hypertarget{dcdatetimediv_8f90_a70ce0c279ecb01be7ce9a5d728d99f79}\label{dcdatetimediv_8f90_a70ce0c279ecb01be7ce9a5d728d99f79}} 
\index{dcdatetimediv.\+f90@{dcdatetimediv.\+f90}!dcdatetime\+\_\+div\+\_\+fi@{dcdatetime\+\_\+div\+\_\+fi}}
\index{dcdatetime\+\_\+div\+\_\+fi@{dcdatetime\+\_\+div\+\_\+fi}!dcdatetimediv.\+f90@{dcdatetimediv.\+f90}}
\subsubsection{\texorpdfstring{dcdatetime\+\_\+div\+\_\+fi()}{dcdatetime\_div\_fi()}}
{\footnotesize\ttfamily type(dc\+\_\+difftime) function dcdatetime\+\_\+div\+\_\+fi (\begin{DoxyParamCaption}\item[{type(dc\+\_\+difftime), intent(in)}]{diff,  }\item[{integer, intent(in)}]{denominator }\end{DoxyParamCaption})}



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



References dc\+\_\+date\+\_\+types\+::cyclic\+\_\+mdays.


\begin{DoxyCode}
11     \textcolor{comment}{!}
12     \textcolor{comment}{! 日時差 *diff* を *denominator* で除算した結果を返します.}
13     \textcolor{comment}{!}
14     \textcolor{comment}{! ※ 注意 : 月差を除算すると近似的結果になるおそれがあります}
15     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__date__types_a1b048467a83d24231df41029f3d8f30e}{cyclic\_mdays}
16     \textcolor{keywordtype}{use }\hyperlink{namespacedc__scaledsec}{dc\_scaledsec}\textcolor{keywordtype}{, only}: dc\_scaled\_sec, &
17       & \textcolor{keyword}{operator}(<), \textcolor{keyword}{operator}(>), \textcolor{keyword}{operator}(<=), \textcolor{keyword}{operator}(>=), &
18       & \textcolor{keyword}{operator}(+), \textcolor{keyword}{operator}(-), \textcolor{keyword}{operator}(*), \textcolor{keyword}{operator}(/), &
19       & modscl => mod, modulo, int, abs, sign
20     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: dc\_datetime, dc\_difftime
21     \textcolor{keywordtype}{implicit none}
22     \textcolor{keywordtype}{type}(dc\_difftime):: result
23     \textcolor{keywordtype}{type}(dc\_difftime), \textcolor{keywordtype}{intent(in)}:: diff
24     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: denominator
25   \textcolor{keywordflow}{continue}
26     result % mon = int( diff % mon / denominator )
27     \textcolor{comment}{! 月からの近似的繰り下がりは日単位でしか行わない}
28     result % day = &
29       &   int( diff % day / denominator ) &
30       & + int( (cyclic\_mdays * modscl(diff % mon, denominator)) / denominator )
31     result % sec = diff % sec / denominator + &
32       & (diff % day\_seconds * modscl(diff % day, denominator)) / &
33       & denominator
34     result % nondim\_flag = diff % nondim\_flag
\end{DoxyCode}
\mbox{\Hypertarget{dcdatetimediv_8f90_a7f644d7506039ae8e076ae7206b630a1}\label{dcdatetimediv_8f90_a7f644d7506039ae8e076ae7206b630a1}} 
\index{dcdatetimediv.\+f90@{dcdatetimediv.\+f90}!dcdatetime\+\_\+div\+\_\+fr@{dcdatetime\+\_\+div\+\_\+fr}}
\index{dcdatetime\+\_\+div\+\_\+fr@{dcdatetime\+\_\+div\+\_\+fr}!dcdatetimediv.\+f90@{dcdatetimediv.\+f90}}
\subsubsection{\texorpdfstring{dcdatetime\+\_\+div\+\_\+fr()}{dcdatetime\_div\_fr()}}
{\footnotesize\ttfamily type(dc\+\_\+difftime) function dcdatetime\+\_\+div\+\_\+fr (\begin{DoxyParamCaption}\item[{type(dc\+\_\+difftime), intent(in)}]{diff,  }\item[{real, intent(in)}]{denominator }\end{DoxyParamCaption})}



Definition at line 38 of file dcdatetimediv.\+f90.



References dc\+\_\+types\+::dp.


\begin{DoxyCode}
38     \textcolor{comment}{!}
39     \textcolor{comment}{! ※ 注意 : 月差を除算すると近似的結果になるおそれがあります}
40     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__generic}{dc\_date\_generic}\textcolor{keywordtype}{, only}: \textcolor{keyword}{operator}(/)
41     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: dc\_datetime, dc\_difftime
42     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
43     \textcolor{keywordtype}{implicit none}
44     \textcolor{keywordtype}{type}(dc\_difftime):: result
45     \textcolor{keywordtype}{type}(dc\_difftime), \textcolor{keywordtype}{intent(in)}:: diff
46     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}:: denominator
47   \textcolor{keywordflow}{continue}
48     result = diff / \textcolor{keywordtype}{real}(denominator, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp})
\end{DoxyCode}
