\hypertarget{namespacegtdata__memory__internal}{}\section{gtdata\+\_\+memory\+\_\+internal Module Reference}
\label{namespacegtdata__memory__internal}\index{gtdata\+\_\+memory\+\_\+internal@{gtdata\+\_\+memory\+\_\+internal}}
\subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
interface \hyperlink{interfacegtdata__memory__internal_1_1memtab__add}{memtab\+\_\+add}
\item 
interface \hyperlink{interfacegtdata__memory__internal_1_1memtab__lookup}{memtab\+\_\+lookup}
\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
integer function, public \hyperlink{namespacegtdata__memory__internal_a9031dfc04f2fd17452d298f91f3b4ecf}{memtab\+\_\+add} (var, name)
\item 
integer function, public \hyperlink{namespacegtdata__memory__internal_aaebf31814f0484e2b28660a831144757}{memtab\+\_\+lookup} (var, ent)
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
type(gd\+\_\+mem\+\_\+variable\+\_\+entry), dimension(\+:), allocatable, target, save, public \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacegtdata__memory__internal_a9031dfc04f2fd17452d298f91f3b4ecf}\label{namespacegtdata__memory__internal_a9031dfc04f2fd17452d298f91f3b4ecf}} 
\index{gtdata\+\_\+memory\+\_\+internal@{gtdata\+\_\+memory\+\_\+internal}!memtab\+\_\+add@{memtab\+\_\+add}}
\index{memtab\+\_\+add@{memtab\+\_\+add}!gtdata\+\_\+memory\+\_\+internal@{gtdata\+\_\+memory\+\_\+internal}}
\subsubsection{\texorpdfstring{memtab\+\_\+add()}{memtab\_add()}}
{\footnotesize\ttfamily integer function, public \hyperlink{interfacegtdata__memory__internal_1_1memtab__add}{gtdata\+\_\+memory\+\_\+internal\+::memtab\+\_\+add} (\begin{DoxyParamCaption}\item[{type(gd\+\_\+mem\+\_\+variable), intent(out)}]{var,  }\item[{character(len = $\ast$), intent(in)}]{name }\end{DoxyParamCaption})}



Definition at line 38 of file gtdata\+\_\+memory\+\_\+internal.\+f90.



References dc\+\_\+error\+::gt\+\_\+enomem, and memtab.


\begin{DoxyCode}
38     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__memory__types}{gtdata\_memory\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}, 
      \hyperlink{structgtdata__memory__types_1_1gd__mem__variable__entry}{gd\_mem\_variable\_entry}
39     \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a253c222db80053c2ddcac9a384424949}{gt\_enomem}
40     \textcolor{keywordtype}{type}(\hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}), \textcolor{keywordtype}{intent(out)}:: var
41     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: name
42     \textcolor{keywordtype}{type}(\hyperlink{structgtdata__memory__types_1_1gd__mem__variable__entry}{gd\_mem\_variable\_entry}), \textcolor{keywordtype}{allocatable}:: tmptab(:)
43     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, n
44 
45     \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{allocated}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab})) \textcolor{keywordflow}{then}
46       \textcolor{keyword}{allocate}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(16), stat=stat)
47       \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{then}
48         stat = \hyperlink{namespacedc__error_a253c222db80053c2ddcac9a384424949}{gt\_enomem}
49         \textcolor{keywordflow}{return}
50 \textcolor{keywordflow}{      endif}
51       \textcolor{keywordflow}{do}, \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, \textcolor{keyword}{size}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab})
52         \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%name = \textcolor{stringliteral}{""}
53         \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%xtype = \textcolor{stringliteral}{""}
54         \textcolor{keyword}{nullify}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%dbuf)
55         \textcolor{keyword}{nullify}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%attr, \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%current)
56 \textcolor{keywordflow}{      enddo}
57 \textcolor{keywordflow}{    endif}
58     \textcolor{keywordflow}{do}, \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, \textcolor{keyword}{size}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab})
59       \textcolor{keywordflow}{if} (\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%name == \textcolor{stringliteral}{""}) \textcolor{keywordflow}{then}
60         stat = 0
61         var = \hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
62         \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%name = name
63         \textcolor{keywordflow}{return}
64 \textcolor{keywordflow}{      endif}
65 \textcolor{keywordflow}{    end do}
66 
67     n = \textcolor{keyword}{size}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab})
68     \textcolor{keyword}{allocate}(tmptab(n), stat=stat)
69     \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{then}
70       stat = \hyperlink{namespacedc__error_a253c222db80053c2ddcac9a384424949}{gt\_enomem}
71       \textcolor{keywordflow}{return}
72 \textcolor{keywordflow}{    endif}
73     tmptab(:) = \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(:)
74     \textcolor{keyword}{deallocate}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab})
75     \textcolor{keyword}{allocate}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(n * 2), stat=stat)
76     \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{then}
77       stat = \hyperlink{namespacedc__error_a253c222db80053c2ddcac9a384424949}{gt\_enomem}
78       \textcolor{keywordflow}{return}
79 \textcolor{keywordflow}{    endif}
80     \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(1:n) = tmptab(1:n)
81     \textcolor{keyword}{deallocate}(tmptab)
82     \textcolor{keywordflow}{do}, \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = n + 1, n * 2
83       \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%name = \textcolor{stringliteral}{""}
84       \textcolor{keyword}{nullify}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%dbuf)
85       \textcolor{keyword}{nullify}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%attr, \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%current)
86 \textcolor{keywordflow}{    enddo}
87 
88     \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = n + 1
89     var = \hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
90     \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})%name = name
\end{DoxyCode}
\mbox{\Hypertarget{namespacegtdata__memory__internal_aaebf31814f0484e2b28660a831144757}\label{namespacegtdata__memory__internal_aaebf31814f0484e2b28660a831144757}} 
\index{gtdata\+\_\+memory\+\_\+internal@{gtdata\+\_\+memory\+\_\+internal}!memtab\+\_\+lookup@{memtab\+\_\+lookup}}
\index{memtab\+\_\+lookup@{memtab\+\_\+lookup}!gtdata\+\_\+memory\+\_\+internal@{gtdata\+\_\+memory\+\_\+internal}}
\subsubsection{\texorpdfstring{memtab\+\_\+lookup()}{memtab\_lookup()}}
{\footnotesize\ttfamily integer function, public \hyperlink{interfacegtdata__memory__internal_1_1memtab__lookup}{gtdata\+\_\+memory\+\_\+internal\+::memtab\+\_\+lookup} (\begin{DoxyParamCaption}\item[{type(gd\+\_\+mem\+\_\+variable), intent(in)}]{var,  }\item[{type(gd\+\_\+mem\+\_\+variable\+\_\+entry), pointer}]{ent }\end{DoxyParamCaption})}



Definition at line 94 of file gtdata\+\_\+memory\+\_\+internal.\+f90.



References memtab.


\begin{DoxyCode}
94     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__memory__types}{gtdata\_memory\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}, 
      \hyperlink{structgtdata__memory__types_1_1gd__mem__variable__entry}{gd\_mem\_variable\_entry}
95     \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: nf90\_enotvar
96     \textcolor{keywordtype}{type}(\hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}), \textcolor{keywordtype}{intent(in)}:: var
97     \textcolor{keywordtype}{type}(\hyperlink{structgtdata__memory__types_1_1gd__mem__variable__entry}{gd\_mem\_variable\_entry}), \textcolor{keywordtype}{pointer}:: ent
98 
99     \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{allocated}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab})) \textcolor{keywordflow}{goto} 999
100     \textcolor{keywordflow}{if} (var%id <= 0 .or. var%id > \textcolor{keyword}{size}(\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab})) \textcolor{keywordflow}{goto} 999
101     \textcolor{keywordflow}{if} (\hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(var%id)%name == \textcolor{stringliteral}{""}) \textcolor{keywordflow}{goto} 999
102     ent => \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(var%id)
103     stat = 0
104 999 \textcolor{keywordflow}{continue}
105     \textcolor{keyword}{nullify}(ent)
106     stat = nf90\_enotvar
\end{DoxyCode}


\subsection{Variable Documentation}
\mbox{\Hypertarget{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}\label{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}} 
\index{gtdata\+\_\+memory\+\_\+internal@{gtdata\+\_\+memory\+\_\+internal}!memtab@{memtab}}
\index{memtab@{memtab}!gtdata\+\_\+memory\+\_\+internal@{gtdata\+\_\+memory\+\_\+internal}}
\subsubsection{\texorpdfstring{memtab}{memtab}}
{\footnotesize\ttfamily type(gd\+\_\+mem\+\_\+variable\+\_\+entry), dimension(\+:), allocatable, target, save, public gtdata\+\_\+memory\+\_\+internal\+::memtab}



Definition at line 23 of file gtdata\+\_\+memory\+\_\+internal.\+f90.



Referenced by gdmemvarcreated(), memtab\+\_\+add(), and memtab\+\_\+lookup().


\begin{DoxyCode}
23   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__memory__types_1_1gd__mem__variable__entry}{gd\_mem\_variable\_entry}), \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{save}, \textcolor{keywordtype}{target}:: 
      \hyperlink{namespacegtdata__memory__internal_aee5ec46e8f8811c6c5e170cfff9b2ce4}{memtab}(:)
\end{DoxyCode}
