\hypertarget{dccaldatechkleapyear_8f90}{}\section{dc\+\_\+utils/dccaldatechkleapyear.f90 File Reference}
\label{dccaldatechkleapyear_8f90}\index{dc\+\_\+utils/dccaldatechkleapyear.\+f90@{dc\+\_\+utils/dccaldatechkleapyear.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
logical function \hyperlink{dccaldatechkleapyear_8f90_ae4797b0580a0734308de5cbda99dc7e3}{dccaldatechkleapyear1} (elapse\+\_\+sec, date, cal)
\end{DoxyCompactItemize}


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



Definition at line 15 of file dccaldatechkleapyear.\+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\+\_\+calendar\+\_\+internal\+::dccaldate\+\_\+normalize(), dc\+\_\+calendar\+\_\+internal\+::dccaldate\+\_\+ym2d(), dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal, dc\+\_\+calendar\+\_\+internal\+::default\+\_\+cal\+\_\+set(), dc\+\_\+calendar\+\_\+internal\+::default\+\_\+date, and dc\+\_\+types\+::dp.


\begin{DoxyCode}
15   \textcolor{comment}{! 閏年かどうかの判定. }
16   \textcolor{comment}{!}
17   \textcolor{comment}{! 省略可能引数 *date* が省略された場合には, dc\_calendar 内部で}
18   \textcolor{comment}{! 保持される日時が起点の日時として用いられます. }
19   \textcolor{comment}{! *date* が省略されない場合にはその変数に設定された日時が}
20   \textcolor{comment}{! 起点の日時として用いられます. }
21   \textcolor{comment}{!}
22   \textcolor{comment}{! 省略可能引数 *cal* が省略された場合には, 経過秒数 *elapse\_sec* }
23   \textcolor{comment}{! の年月日時分への変換に dc\_calendar 内部で保持される暦が用いられます. }
24   \textcolor{comment}{! *cal* が省略されない場合にはその変数に設定された暦が用いられます. }
25   \textcolor{comment}{!}
26   \textcolor{comment}{! Judge whether it is a leap year. }
27   \textcolor{comment}{!}
28   \textcolor{comment}{! If an optional argument *date* is omitted, }
29   \textcolor{comment}{! information of date that is stored in the "dc\_calendar" }
30   \textcolor{comment}{! is used as date of origin, }
31   \textcolor{comment}{! If *date* is not omitted, information of the variable is used as }
32   \textcolor{comment}{! date of origin. }
33   \textcolor{comment}{!}
34   \textcolor{comment}{! If an optional argument *cal* is omitted, }
35   \textcolor{comment}{! information of calendar that is stored in the "dc\_calendar" }
36   \textcolor{comment}{! is used for conversion of elapsed seconds *elapse\_sec* into }
37   \textcolor{comment}{! year-month-day etc.}
38   \textcolor{comment}{! If *cal* is not omitted, information of the variable is used. }
39   \textcolor{comment}{!}
40   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__types}{dc\_calendar\_types}\textcolor{keywordtype}{, only}: dc\_cal\_date, dc\_cal, &
41     & \hyperlink{namespacedc__calendar__types_a01862dd22ae24667d07cb523d6f7d6fc}{cal\_user\_defined}, &
42     & \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}
43   \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}, &
44     & \hyperlink{namespacedc__calendar__internal_a5aaf74615ddc4b9e53d67d4949c55dd5}{dccaldate\_normalize}, \hyperlink{namespacedc__calendar__internal_a5f6fb926707ca4deb84a454527b8c7f9}{dccaldate\_ym2d}
45   \textcolor{keywordtype}{use }\hyperlink{namespacedc__calendar__generic}{dc\_calendar\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__calendar__generic_1_1dccaldateinquire}{dccaldateinquire}
46   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
47   \textcolor{keywordtype}{implicit none}
48   \textcolor{keywordtype}{logical}:: result
49                               \textcolor{comment}{! 閏年であれば .true., そうでなければ .false.}
50                               \textcolor{comment}{!}
51                               \textcolor{comment}{! Leap year: .true., No leap year: .false.}
52   \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: elapse\_sec
53                               \textcolor{comment}{! *date* からの経過秒数. }
54                               \textcolor{comment}{! Elapsed seconds from *date*. }
55   \textcolor{keywordtype}{type}(dc\_cal\_date), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: date
56                               \textcolor{comment}{! 起点となる日時情報を収めたオブジェクト. }
57                               \textcolor{comment}{! }
58                               \textcolor{comment}{! An object that stores information of }
59                               \textcolor{comment}{! date of origin. }
60   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: cal
61                               \textcolor{comment}{! 暦情報を収めたオブジェクト. }
62                               \textcolor{comment}{! }
63                               \textcolor{comment}{! An object that stores information of }
64                               \textcolor{comment}{! calendar. }
65   \textcolor{comment}{! 作業変数}
66   \textcolor{comment}{! Work variables}
67   \textcolor{comment}{!}
68   \textcolor{keywordtype}{type}(dc\_cal\_date), \textcolor{keywordtype}{pointer}:: datep =>null()
69   \textcolor{keywordtype}{type}(dc\_cal), \textcolor{keywordtype}{pointer}:: calp =>null()
70   \textcolor{keywordtype}{integer}:: year, month, day, hour, min
71   \textcolor{keywordtype}{real(DP)}:: sec
72 \textcolor{keywordflow}{continue}
73 
74   \textcolor{comment}{! オブジェクトのポインタ割付}
75   \textcolor{comment}{! Associate pointer of an object}
76   \textcolor{comment}{!}
77   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( date ) ) \textcolor{keywordflow}{then}
78     datep => date
79   \textcolor{keywordflow}{else}
80     datep => \hyperlink{namespacedc__calendar__internal_a3bc8a36b4f46e738aefa1d702a571111}{default\_date}
81 \textcolor{keywordflow}{  end if}
82 
83   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}( cal ) ) \textcolor{keywordflow}{then}
84     calp => cal
85   \textcolor{keywordflow}{else}
86     calp => \hyperlink{namespacedc__calendar__internal_a19929403a35d14fa0c6ce80f5e4392a5}{default\_cal}
87     \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keyword}{call }\hyperlink{namespacedc__calendar__internal_ab33be336dc4b2e284e99c43b24235728}{default\_cal\_set}
88 \textcolor{keywordflow}{  end if}
89 
90   \textcolor{comment}{! 初期設定のチェック}
91   \textcolor{comment}{! Check initialization}
92   \textcolor{comment}{!}
93   result = .false.
94   \textcolor{keywordflow}{if} ( .not. datep % initialized ) \textcolor{keywordflow}{return}
95   \textcolor{keywordflow}{if} ( .not. calp % initialized ) \textcolor{keywordflow}{return}
96 
97   \textcolor{comment}{! 経過時間を与えた場合の日時を取得}
98   \textcolor{comment}{! Inquire date and time when elapse time is given}
99   \textcolor{comment}{!}
100   \textcolor{keyword}{call }\hyperlink{interfacedc__calendar__generic_1_1dccaldateinquire}{dccaldateinquire}( year, month, day, hour, min, sec, & \textcolor{comment}{! (out)}
101     & elapse\_sec = elapse\_sec, date = datep , cal = calp )   \textcolor{comment}{! (in)}
102 
103   \textcolor{comment}{! 閏年の判定}
104   \textcolor{comment}{! Judge leap year}
105   \textcolor{comment}{!}
106   \textcolor{keywordflow}{select case}( calp % cal\_type )
107   \textcolor{keywordflow}{case}( \hyperlink{namespacedc__calendar__types_a0c7574e07214536d34d1a1ff6cd1703c}{cal\_julian} )
108     \textcolor{keywordflow}{if} ( mod( year, 4 ) == 0 ) \textcolor{keywordflow}{then}
109       result = .true.
110     \textcolor{keywordflow}{else}
111       result = .false.
112 \textcolor{keywordflow}{    end if}
113 
114   \textcolor{keywordflow}{case}( \hyperlink{namespacedc__calendar__types_a56becce7ca212d6f20b0f2d738ea4538}{cal\_gregorian} )
115     \textcolor{keywordflow}{if} ( mod( year, 400 ) == 0 ) \textcolor{keywordflow}{then}
116       result = .true.
117     \textcolor{keywordflow}{elseif} ( mod( year, 100 ) == 0 ) \textcolor{keywordflow}{then}
118       result = .false.
119     \textcolor{keywordflow}{elseif} ( mod( year, 4 ) == 0 ) \textcolor{keywordflow}{then}
120       result = .true.
121     \textcolor{keywordflow}{else}
122       result = .false.
123 \textcolor{keywordflow}{    end if}
124 
125 \textcolor{keywordflow}{  case default}
126     result = .false.
127 \textcolor{keywordflow}{  end select}
128 
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=344pt]{dccaldatechkleapyear_8f90_ae4797b0580a0734308de5cbda99dc7e3_cgraph}
\end{center}
\end{figure}
