\hypertarget{namespacemom__time__manager}{}\section{mom\+\_\+time\+\_\+manager Module Reference}
\label{namespacemom__time__manager}\index{mom\+\_\+time\+\_\+manager@{mom\+\_\+time\+\_\+manager}}


\subsection{Detailed Description}
Wraps the F\+MS time manager functions. \subsection*{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}


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