\hypertarget{namespacemom__safe__alloc}{}\doxysection{mom\+\_\+safe\+\_\+alloc Module Reference}
\label{namespacemom__safe__alloc}\index{mom\_safe\_alloc@{mom\_safe\_alloc}}


\doxysubsection{Detailed Description}
Convenience functions for safely allocating memory without accidentally reallocating pointer and causing memory leaks. \doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
interface \mbox{\hyperlink{interfacemom__safe__alloc_1_1safe__alloc__alloc}{safe\+\_\+alloc\+\_\+alloc}}
\begin{DoxyCompactList}\small\item\em Allocate a 2-\/d or 3-\/d allocatable array. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__safe__alloc_1_1safe__alloc__ptr}{safe\+\_\+alloc\+\_\+ptr}}
\begin{DoxyCompactList}\small\item\em Allocate a pointer to a 1-\/d, 2-\/d or 3-\/d array. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{namespacemom__safe__alloc_a884f70b74863fa33d8956bcdc4bd331c}{safe\+\_\+alloc\+\_\+ptr\+\_\+1d}} (ptr, i1, i2)
\begin{DoxyCompactList}\small\item\em Allocate a pointer to a 1-\/d array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__safe__alloc_a93463ba87cbcc6bd34a528e05bc5d449}{safe\+\_\+alloc\+\_\+ptr\+\_\+2d\+\_\+2arg}} (ptr, ni, nj)
\begin{DoxyCompactList}\small\item\em Allocate a pointer to a 2-\/d array based on its dimension sizes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__safe__alloc_ab9e23cc5ed4635454b4412aa0eb8a4c4}{safe\+\_\+alloc\+\_\+ptr\+\_\+3d\+\_\+3arg}} (ptr, ni, nj, nk)
\begin{DoxyCompactList}\small\item\em Allocate a pointer to a 3-\/d array based on its dimension sizes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__safe__alloc_ae52e9466348c49c0ac3c21e1c2eb4073}{safe\+\_\+alloc\+\_\+ptr\+\_\+2d}} (ptr, is, ie, js, je)
\begin{DoxyCompactList}\small\item\em Allocate a pointer to a 2-\/d array based on its index starting and ending values. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__safe__alloc_a70e67bdc39ad0edb1f40b0ba533d44d5}{safe\+\_\+alloc\+\_\+ptr\+\_\+3d}} (ptr, is, ie, js, je, nk)
\begin{DoxyCompactList}\small\item\em Allocate a pointer to a 3-\/d array based on its index starting and ending values. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__safe__alloc_a6168c61b47b5e57b72f1481625076421}{safe\+\_\+alloc\+\_\+ptr\+\_\+3d\+\_\+6arg}} (ptr, is, ie, js, je, ks, ke)
\begin{DoxyCompactList}\small\item\em Allocate a pointer to a 3-\/d array based on its index starting and ending values. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__safe__alloc_ac762814e20f163c01cd2753b6757dc72}{safe\+\_\+alloc\+\_\+allocatable\+\_\+2d}} (ptr, is, ie, js, je)
\begin{DoxyCompactList}\small\item\em Allocate a 2-\/d allocatable array based on its index starting and ending values. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__safe__alloc_a8997262e361b426a15c77813adcc0aca}{safe\+\_\+alloc\+\_\+allocatable\+\_\+3d}} (ptr, is, ie, js, je, nk)
\begin{DoxyCompactList}\small\item\em Allocate a 3-\/d allocatable array based on its index starting and ending values and k-\/index size. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__safe__alloc_abcf3c91a8747ada0dfc258a8283ea051}{safe\+\_\+alloc\+\_\+allocatable\+\_\+3d\+\_\+6arg}} (ptr, is, ie, js, je, ks, ke)
\begin{DoxyCompactList}\small\item\em Allocate a 3-\/d allocatable array based on its 6 index starting and ending values. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__safe__alloc_ac762814e20f163c01cd2753b6757dc72}\label{namespacemom__safe__alloc_ac762814e20f163c01cd2753b6757dc72}} 
\index{mom\_safe\_alloc@{mom\_safe\_alloc}!safe\_alloc\_allocatable\_2d@{safe\_alloc\_allocatable\_2d}}
\index{safe\_alloc\_allocatable\_2d@{safe\_alloc\_allocatable\_2d}!mom\_safe\_alloc@{mom\_safe\_alloc}}
\doxysubsubsection{\texorpdfstring{safe\_alloc\_allocatable\_2d()}{safe\_alloc\_allocatable\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+safe\+\_\+alloc\+::safe\+\_\+alloc\+\_\+allocatable\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), allocatable}]{ptr,  }\item[{integer, intent(in)}]{is,  }\item[{integer, intent(in)}]{ie,  }\item[{integer, intent(in)}]{js,  }\item[{integer, intent(in)}]{je }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate a 2-\/d allocatable array based on its index starting and ending values. 


\begin{DoxyParams}[1]{Parameters}
 & {\em ptr} & An allocatable array to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The start index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The end index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The start index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The end index to allocate for the 2nd dimension \\
\hline
\end{DoxyParams}


Definition at line 117 of file M\+O\+M\+\_\+safe\+\_\+alloc.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{117 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)}, \textcolor{keywordtype}{allocatable} :: ptr\textcolor{comment}{ !< An allocatable array to allocate}}
\DoxyCodeLine{118   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: is\textcolor{comment}{ !< The start index to allocate for the 1st dimension}}
\DoxyCodeLine{119   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ie\textcolor{comment}{ !< The end index to allocate for the 1st dimension}}
\DoxyCodeLine{120   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: js\textcolor{comment}{ !< The start index to allocate for the 2nd dimension}}
\DoxyCodeLine{121   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: je\textcolor{comment}{ !< The end index to allocate for the 2nd dimension}}
\DoxyCodeLine{122   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{allocated}(ptr)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{123     \textcolor{keyword}{allocate}(ptr(is:ie,js:je))}
\DoxyCodeLine{124     ptr(:,:) = 0.0}
\DoxyCodeLine{125 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__safe__alloc_a8997262e361b426a15c77813adcc0aca}\label{namespacemom__safe__alloc_a8997262e361b426a15c77813adcc0aca}} 
\index{mom\_safe\_alloc@{mom\_safe\_alloc}!safe\_alloc\_allocatable\_3d@{safe\_alloc\_allocatable\_3d}}
\index{safe\_alloc\_allocatable\_3d@{safe\_alloc\_allocatable\_3d}!mom\_safe\_alloc@{mom\_safe\_alloc}}
\doxysubsubsection{\texorpdfstring{safe\_alloc\_allocatable\_3d()}{safe\_alloc\_allocatable\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+safe\+\_\+alloc\+::safe\+\_\+alloc\+\_\+allocatable\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), allocatable}]{ptr,  }\item[{integer, intent(in)}]{is,  }\item[{integer, intent(in)}]{ie,  }\item[{integer, intent(in)}]{js,  }\item[{integer, intent(in)}]{je,  }\item[{integer, intent(in)}]{nk }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate a 3-\/d allocatable array based on its index starting and ending values and k-\/index size. 


\begin{DoxyParams}[1]{Parameters}
 & {\em ptr} & An allocatable array to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The start index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The end index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The start index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The end index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em nk} & The size to allocate for the 3rd dimension \\
\hline
\end{DoxyParams}


Definition at line 131 of file M\+O\+M\+\_\+safe\+\_\+alloc.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{131 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{allocatable} :: ptr\textcolor{comment}{ !< An allocatable array to allocate}}
\DoxyCodeLine{132   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: is\textcolor{comment}{ !< The start index to allocate for the 1st dimension}}
\DoxyCodeLine{133   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ie\textcolor{comment}{ !< The end index to allocate for the 1st dimension}}
\DoxyCodeLine{134   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: js\textcolor{comment}{ !< The start index to allocate for the 2nd dimension}}
\DoxyCodeLine{135   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: je\textcolor{comment}{ !< The end index to allocate for the 2nd dimension}}
\DoxyCodeLine{136   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: nk\textcolor{comment}{ !< The size to allocate for the 3rd dimension}}
\DoxyCodeLine{137   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{allocated}(ptr)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{138     \textcolor{keyword}{allocate}(ptr(is:ie,js:je,nk))}
\DoxyCodeLine{139     ptr(:,:,:) = 0.0}
\DoxyCodeLine{140 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__safe__alloc_abcf3c91a8747ada0dfc258a8283ea051}\label{namespacemom__safe__alloc_abcf3c91a8747ada0dfc258a8283ea051}} 
\index{mom\_safe\_alloc@{mom\_safe\_alloc}!safe\_alloc\_allocatable\_3d\_6arg@{safe\_alloc\_allocatable\_3d\_6arg}}
\index{safe\_alloc\_allocatable\_3d\_6arg@{safe\_alloc\_allocatable\_3d\_6arg}!mom\_safe\_alloc@{mom\_safe\_alloc}}
\doxysubsubsection{\texorpdfstring{safe\_alloc\_allocatable\_3d\_6arg()}{safe\_alloc\_allocatable\_3d\_6arg()}}
{\footnotesize\ttfamily subroutine mom\+\_\+safe\+\_\+alloc\+::safe\+\_\+alloc\+\_\+allocatable\+\_\+3d\+\_\+6arg (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), allocatable}]{ptr,  }\item[{integer, intent(in)}]{is,  }\item[{integer, intent(in)}]{ie,  }\item[{integer, intent(in)}]{js,  }\item[{integer, intent(in)}]{je,  }\item[{integer, intent(in)}]{ks,  }\item[{integer, intent(in)}]{ke }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate a 3-\/d allocatable array based on its 6 index starting and ending values. 


\begin{DoxyParams}[1]{Parameters}
 & {\em ptr} & An allocatable array to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The start index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The end index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The start index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The end index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ks} & The start index to allocate for the 3rd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ke} & The end index to allocate for the 3rd dimension \\
\hline
\end{DoxyParams}


Definition at line 145 of file M\+O\+M\+\_\+safe\+\_\+alloc.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{145 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{allocatable} :: ptr\textcolor{comment}{ !< An allocatable array to allocate}}
\DoxyCodeLine{146   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: is\textcolor{comment}{ !< The start index to allocate for the 1st dimension}}
\DoxyCodeLine{147   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ie\textcolor{comment}{ !< The end index to allocate for the 1st dimension}}
\DoxyCodeLine{148   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: js\textcolor{comment}{ !< The start index to allocate for the 2nd dimension}}
\DoxyCodeLine{149   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: je\textcolor{comment}{ !< The end index to allocate for the 2nd dimension}}
\DoxyCodeLine{150   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ks\textcolor{comment}{ !< The start index to allocate for the 3rd dimension}}
\DoxyCodeLine{151   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ke\textcolor{comment}{ !< The end index to allocate for the 3rd dimension}}
\DoxyCodeLine{152   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{allocated}(ptr)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{153     \textcolor{keyword}{allocate}(ptr(is:ie,js:je,ks:ke))}
\DoxyCodeLine{154     ptr(:,:,:) = 0.0}
\DoxyCodeLine{155 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__safe__alloc_a884f70b74863fa33d8956bcdc4bd331c}\label{namespacemom__safe__alloc_a884f70b74863fa33d8956bcdc4bd331c}} 
\index{mom\_safe\_alloc@{mom\_safe\_alloc}!safe\_alloc\_ptr\_1d@{safe\_alloc\_ptr\_1d}}
\index{safe\_alloc\_ptr\_1d@{safe\_alloc\_ptr\_1d}!mom\_safe\_alloc@{mom\_safe\_alloc}}
\doxysubsubsection{\texorpdfstring{safe\_alloc\_ptr\_1d()}{safe\_alloc\_ptr\_1d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+safe\+\_\+alloc\+::safe\+\_\+alloc\+\_\+ptr\+\_\+1d (\begin{DoxyParamCaption}\item[{real, dimension(\+:), pointer}]{ptr,  }\item[{integer, intent(in)}]{i1,  }\item[{integer, intent(in), optional}]{i2 }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate a pointer to a 1-\/d array. 


\begin{DoxyParams}[1]{Parameters}
 & {\em ptr} & A pointer to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em i1} & The size of the array, or its starting index if i2 is present \\
\hline
\mbox{\texttt{ in}}  & {\em i2} & The ending index of the array \\
\hline
\end{DoxyParams}


Definition at line 36 of file M\+O\+M\+\_\+safe\+\_\+alloc.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{36 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{pointer} :: ptr\textcolor{comment}{ !< A pointer to allocate}}
\DoxyCodeLine{37   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)} :: i1\textcolor{comment}{ !< The size of the array, or its starting index if i2 is present}}
\DoxyCodeLine{38   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},  \textcolor{keywordtype}{intent(in)} :: i2\textcolor{comment}{ !< The ending index of the array}}
\DoxyCodeLine{39   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(ptr)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{40     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(i2)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{41       \textcolor{keyword}{allocate}(ptr(i1:i2))}
\DoxyCodeLine{42     \textcolor{keywordflow}{else}}
\DoxyCodeLine{43       \textcolor{keyword}{allocate}(ptr(i1))}
\DoxyCodeLine{44 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{45     ptr(:) = 0.0}
\DoxyCodeLine{46 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__safe__alloc_ae52e9466348c49c0ac3c21e1c2eb4073}\label{namespacemom__safe__alloc_ae52e9466348c49c0ac3c21e1c2eb4073}} 
\index{mom\_safe\_alloc@{mom\_safe\_alloc}!safe\_alloc\_ptr\_2d@{safe\_alloc\_ptr\_2d}}
\index{safe\_alloc\_ptr\_2d@{safe\_alloc\_ptr\_2d}!mom\_safe\_alloc@{mom\_safe\_alloc}}
\doxysubsubsection{\texorpdfstring{safe\_alloc\_ptr\_2d()}{safe\_alloc\_ptr\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+safe\+\_\+alloc\+::safe\+\_\+alloc\+\_\+ptr\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), pointer}]{ptr,  }\item[{integer, intent(in)}]{is,  }\item[{integer, intent(in)}]{ie,  }\item[{integer, intent(in)}]{js,  }\item[{integer, intent(in)}]{je }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate a pointer to a 2-\/d array based on its index starting and ending values. 


\begin{DoxyParams}[1]{Parameters}
 & {\em ptr} & A pointer to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The start index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The end index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The start index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The end index to allocate for the 2nd dimension \\
\hline
\end{DoxyParams}


Definition at line 74 of file M\+O\+M\+\_\+safe\+\_\+alloc.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{74 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)}, \textcolor{keywordtype}{pointer} :: ptr\textcolor{comment}{ !< A pointer to allocate}}
\DoxyCodeLine{75   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: is\textcolor{comment}{ !< The start index to allocate for the 1st dimension}}
\DoxyCodeLine{76   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ie\textcolor{comment}{ !< The end index to allocate for the 1st dimension}}
\DoxyCodeLine{77   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: js\textcolor{comment}{ !< The start index to allocate for the 2nd dimension}}
\DoxyCodeLine{78   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: je\textcolor{comment}{ !< The end index to allocate for the 2nd dimension}}
\DoxyCodeLine{79   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(ptr)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{80     \textcolor{keyword}{allocate}(ptr(is:ie,js:je))}
\DoxyCodeLine{81     ptr(:,:) = 0.0}
\DoxyCodeLine{82 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__safe__alloc_a93463ba87cbcc6bd34a528e05bc5d449}\label{namespacemom__safe__alloc_a93463ba87cbcc6bd34a528e05bc5d449}} 
\index{mom\_safe\_alloc@{mom\_safe\_alloc}!safe\_alloc\_ptr\_2d\_2arg@{safe\_alloc\_ptr\_2d\_2arg}}
\index{safe\_alloc\_ptr\_2d\_2arg@{safe\_alloc\_ptr\_2d\_2arg}!mom\_safe\_alloc@{mom\_safe\_alloc}}
\doxysubsubsection{\texorpdfstring{safe\_alloc\_ptr\_2d\_2arg()}{safe\_alloc\_ptr\_2d\_2arg()}}
{\footnotesize\ttfamily subroutine mom\+\_\+safe\+\_\+alloc\+::safe\+\_\+alloc\+\_\+ptr\+\_\+2d\+\_\+2arg (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), pointer}]{ptr,  }\item[{integer, intent(in)}]{ni,  }\item[{integer, intent(in)}]{nj }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate a pointer to a 2-\/d array based on its dimension sizes. 


\begin{DoxyParams}[1]{Parameters}
 & {\em ptr} & A pointer to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em ni} & The size of the 1st dimension of the array \\
\hline
\mbox{\texttt{ in}}  & {\em nj} & The size of the 2nd dimension of the array \\
\hline
\end{DoxyParams}


Definition at line 51 of file M\+O\+M\+\_\+safe\+\_\+alloc.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{51 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)}, \textcolor{keywordtype}{pointer} :: ptr\textcolor{comment}{ !< A pointer to allocate}}
\DoxyCodeLine{52   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ni\textcolor{comment}{ !< The size of the 1st dimension of the array}}
\DoxyCodeLine{53   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: nj\textcolor{comment}{ !< The size of the 2nd dimension of the array}}
\DoxyCodeLine{54   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(ptr)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{55     \textcolor{keyword}{allocate}(ptr(ni,nj))}
\DoxyCodeLine{56     ptr(:,:) = 0.0}
\DoxyCodeLine{57 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__safe__alloc_a70e67bdc39ad0edb1f40b0ba533d44d5}\label{namespacemom__safe__alloc_a70e67bdc39ad0edb1f40b0ba533d44d5}} 
\index{mom\_safe\_alloc@{mom\_safe\_alloc}!safe\_alloc\_ptr\_3d@{safe\_alloc\_ptr\_3d}}
\index{safe\_alloc\_ptr\_3d@{safe\_alloc\_ptr\_3d}!mom\_safe\_alloc@{mom\_safe\_alloc}}
\doxysubsubsection{\texorpdfstring{safe\_alloc\_ptr\_3d()}{safe\_alloc\_ptr\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+safe\+\_\+alloc\+::safe\+\_\+alloc\+\_\+ptr\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), pointer}]{ptr,  }\item[{integer, intent(in)}]{is,  }\item[{integer, intent(in)}]{ie,  }\item[{integer, intent(in)}]{js,  }\item[{integer, intent(in)}]{je,  }\item[{integer, intent(in)}]{nk }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate a pointer to a 3-\/d array based on its index starting and ending values. 


\begin{DoxyParams}[1]{Parameters}
 & {\em ptr} & A pointer to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The start index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The end index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The start index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The end index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em nk} & The size to allocate for the 3rd dimension \\
\hline
\end{DoxyParams}


Definition at line 87 of file M\+O\+M\+\_\+safe\+\_\+alloc.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{87 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{pointer} :: ptr\textcolor{comment}{ !< A pointer to allocate}}
\DoxyCodeLine{88   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: is\textcolor{comment}{ !< The start index to allocate for the 1st dimension}}
\DoxyCodeLine{89   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ie\textcolor{comment}{ !< The end index to allocate for the 1st dimension}}
\DoxyCodeLine{90   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: js\textcolor{comment}{ !< The start index to allocate for the 2nd dimension}}
\DoxyCodeLine{91   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: je\textcolor{comment}{ !< The end index to allocate for the 2nd dimension}}
\DoxyCodeLine{92   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: nk\textcolor{comment}{ !< The size to allocate for the 3rd dimension}}
\DoxyCodeLine{93   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(ptr)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{94     \textcolor{keyword}{allocate}(ptr(is:ie,js:je,nk))}
\DoxyCodeLine{95     ptr(:,:,:) = 0.0}
\DoxyCodeLine{96 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__safe__alloc_ab9e23cc5ed4635454b4412aa0eb8a4c4}\label{namespacemom__safe__alloc_ab9e23cc5ed4635454b4412aa0eb8a4c4}} 
\index{mom\_safe\_alloc@{mom\_safe\_alloc}!safe\_alloc\_ptr\_3d\_3arg@{safe\_alloc\_ptr\_3d\_3arg}}
\index{safe\_alloc\_ptr\_3d\_3arg@{safe\_alloc\_ptr\_3d\_3arg}!mom\_safe\_alloc@{mom\_safe\_alloc}}
\doxysubsubsection{\texorpdfstring{safe\_alloc\_ptr\_3d\_3arg()}{safe\_alloc\_ptr\_3d\_3arg()}}
{\footnotesize\ttfamily subroutine mom\+\_\+safe\+\_\+alloc\+::safe\+\_\+alloc\+\_\+ptr\+\_\+3d\+\_\+3arg (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), pointer}]{ptr,  }\item[{integer, intent(in)}]{ni,  }\item[{integer, intent(in)}]{nj,  }\item[{integer, intent(in)}]{nk }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate a pointer to a 3-\/d array based on its dimension sizes. 


\begin{DoxyParams}[1]{Parameters}
 & {\em ptr} & A pointer to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em ni} & The size of the 1st dimension of the array \\
\hline
\mbox{\texttt{ in}}  & {\em nj} & The size of the 2nd dimension of the array \\
\hline
\mbox{\texttt{ in}}  & {\em nk} & The size of the 3rd dimension of the array \\
\hline
\end{DoxyParams}


Definition at line 62 of file M\+O\+M\+\_\+safe\+\_\+alloc.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{62 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{pointer} :: ptr\textcolor{comment}{ !< A pointer to allocate}}
\DoxyCodeLine{63   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ni\textcolor{comment}{ !< The size of the 1st dimension of the array}}
\DoxyCodeLine{64   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: nj\textcolor{comment}{ !< The size of the 2nd dimension of the array}}
\DoxyCodeLine{65   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: nk\textcolor{comment}{ !< The size of the 3rd dimension of the array}}
\DoxyCodeLine{66   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(ptr)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{67     \textcolor{keyword}{allocate}(ptr(ni,nj,nk))}
\DoxyCodeLine{68     ptr(:,:,:) = 0.0}
\DoxyCodeLine{69 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__safe__alloc_a6168c61b47b5e57b72f1481625076421}\label{namespacemom__safe__alloc_a6168c61b47b5e57b72f1481625076421}} 
\index{mom\_safe\_alloc@{mom\_safe\_alloc}!safe\_alloc\_ptr\_3d\_6arg@{safe\_alloc\_ptr\_3d\_6arg}}
\index{safe\_alloc\_ptr\_3d\_6arg@{safe\_alloc\_ptr\_3d\_6arg}!mom\_safe\_alloc@{mom\_safe\_alloc}}
\doxysubsubsection{\texorpdfstring{safe\_alloc\_ptr\_3d\_6arg()}{safe\_alloc\_ptr\_3d\_6arg()}}
{\footnotesize\ttfamily subroutine mom\+\_\+safe\+\_\+alloc\+::safe\+\_\+alloc\+\_\+ptr\+\_\+3d\+\_\+6arg (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), pointer}]{ptr,  }\item[{integer, intent(in)}]{is,  }\item[{integer, intent(in)}]{ie,  }\item[{integer, intent(in)}]{js,  }\item[{integer, intent(in)}]{je,  }\item[{integer, intent(in)}]{ks,  }\item[{integer, intent(in)}]{ke }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate a pointer to a 3-\/d array based on its index starting and ending values. 


\begin{DoxyParams}[1]{Parameters}
 & {\em ptr} & A pointer to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The start index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The end index to allocate for the 1st dimension \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The start index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The end index to allocate for the 2nd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ks} & The start index to allocate for the 3rd dimension \\
\hline
\mbox{\texttt{ in}}  & {\em ke} & The end index to allocate for the 3rd dimension \\
\hline
\end{DoxyParams}


Definition at line 101 of file M\+O\+M\+\_\+safe\+\_\+alloc.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{101 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{pointer} :: ptr\textcolor{comment}{ !< A pointer to allocate}}
\DoxyCodeLine{102   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: is\textcolor{comment}{ !< The start index to allocate for the 1st dimension}}
\DoxyCodeLine{103   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ie\textcolor{comment}{ !< The end index to allocate for the 1st dimension}}
\DoxyCodeLine{104   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: js\textcolor{comment}{ !< The start index to allocate for the 2nd dimension}}
\DoxyCodeLine{105   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: je\textcolor{comment}{ !< The end index to allocate for the 2nd dimension}}
\DoxyCodeLine{106   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ks\textcolor{comment}{ !< The start index to allocate for the 3rd dimension}}
\DoxyCodeLine{107   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ke\textcolor{comment}{ !< The end index to allocate for the 3rd dimension}}
\DoxyCodeLine{108   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(ptr)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{109     \textcolor{keyword}{allocate}(ptr(is:ie,js:je,ks:ke))}
\DoxyCodeLine{110     ptr(:,:,:) = 0.0}
\DoxyCodeLine{111 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
