\hypertarget{namespacemom__time__manager}{}\doxysection{mom\+\_\+time\+\_\+manager Module Reference}
\label{namespacemom__time__manager}\index{mom\_time\_manager@{mom\_time\_manager}}


\doxysubsection{Detailed Description}
Wraps the F\+MS time manager functions. \doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
type(time\+\_\+type) function, public \mbox{\hyperlink{namespacemom__time__manager_ae2d8736d03ab62310f32ddf01e44a961}{real\+\_\+to\+\_\+time}} (x, err\+\_\+msg)
\begin{DoxyCompactList}\small\item\em This is an alternate implementation of the F\+MS function real\+\_\+to\+\_\+time\+\_\+type that is accurate over a larger range of input values. With 32 bit signed integers, this version should work over the entire valid range (2$^\wedge$31 days or $\sim$5.8835 million years) of time\+\_\+types, whereas the standard version in the F\+MS time\+\_\+manager stops working for conversions of times greater than 2$^\wedge$31 seconds, or $\sim$68.1 years. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__time__manager_ae2d8736d03ab62310f32ddf01e44a961}\label{namespacemom__time__manager_ae2d8736d03ab62310f32ddf01e44a961}} 
\index{mom\_time\_manager@{mom\_time\_manager}!real\_to\_time@{real\_to\_time}}
\index{real\_to\_time@{real\_to\_time}!mom\_time\_manager@{mom\_time\_manager}}
\doxysubsubsection{\texorpdfstring{real\_to\_time()}{real\_to\_time()}}
{\footnotesize\ttfamily type(time\+\_\+type) function, public mom\+\_\+time\+\_\+manager\+::real\+\_\+to\+\_\+time (\begin{DoxyParamCaption}\item[{real, intent(in)}]{x,  }\item[{character(len=$\ast$), intent(out), optional}]{err\+\_\+msg }\end{DoxyParamCaption})}



This is an alternate implementation of the F\+MS function real\+\_\+to\+\_\+time\+\_\+type that is accurate over a larger range of input values. With 32 bit signed integers, this version should work over the entire valid range (2$^\wedge$31 days or $\sim$5.8835 million years) of time\+\_\+types, whereas the standard version in the F\+MS time\+\_\+manager stops working for conversions of times greater than 2$^\wedge$31 seconds, or $\sim$68.1 years. 

\begin{DoxyReturn}{Returns}
The output time as a time\+\_\+type 
\end{DoxyReturn}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & The input time in real seconds. \\
\hline
\mbox{\texttt{ out}}  & {\em err\+\_\+msg} & An optional returned error message. \\
\hline
\end{DoxyParams}


Definition at line 47 of file M\+O\+M\+\_\+time\+\_\+manager.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{47   \textcolor{keywordtype}{type}(time\_type)  :: real\_to\_time\textcolor{comment}{ !< The output time as a time\_type}}
\DoxyCodeLine{48 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{            !< The input time in real seconds.}}
\DoxyCodeLine{49   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional} :: err\_msg\textcolor{comment}{ !< An optional returned error message.}}
\DoxyCodeLine{50 }
\DoxyCodeLine{51   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{52   \textcolor{keywordtype}{integer}          :: seconds, days, ticks}
\DoxyCodeLine{53 \textcolor{keywordtype}{  real}             :: real\_subsecond\_remainder}
\DoxyCodeLine{54 }
\DoxyCodeLine{55   days = floor(x/86400.)}
\DoxyCodeLine{56   seconds = floor(x -\/ 86400.*days)}
\DoxyCodeLine{57   real\_subsecond\_remainder = x -\/ (days*86400. + seconds)}
\DoxyCodeLine{58   ticks = nint(real\_subsecond\_remainder * get\_ticks\_per\_second())}
\DoxyCodeLine{59 }
\DoxyCodeLine{60   real\_to\_time = set\_time(seconds=seconds, days=days, ticks=ticks, err\_msg=err\_msg)}

\end{DoxyCode}
