\hypertarget{gtvarclose_8f90}{}\section{gtdata/gtvarclose.f90 File Reference}
\label{gtvarclose_8f90}\index{gtdata/gtvarclose.\+f90@{gtdata/gtvarclose.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gtvarclose_8f90_a8b672f04f3c616db6ad2e21a48fbb992}{gtvarclose} (var, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gtvarclose_8f90_a8b672f04f3c616db6ad2e21a48fbb992}\label{gtvarclose_8f90_a8b672f04f3c616db6ad2e21a48fbb992}} 
\index{gtvarclose.\+f90@{gtvarclose.\+f90}!gtvarclose@{gtvarclose}}
\index{gtvarclose@{gtvarclose}!gtvarclose.\+f90@{gtvarclose.\+f90}}
\subsubsection{\texorpdfstring{gtvarclose()}{gtvarclose()}}
{\footnotesize\ttfamily subroutine gtvarclose (\begin{DoxyParamCaption}\item[{type(gt\+\_\+variable), intent(in), target}]{var,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 14 of file gtvarclose.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+trace\+::endsub(), dc\+\_\+error\+::gt\+\_\+ebadvar, gtdata\+\_\+internal\+\_\+map\+::map\+\_\+lookup(), gtdata\+\_\+internal\+\_\+map\+::maptabdelete(), dc\+\_\+error\+::storeerror(), gtdata\+\_\+internal\+\_\+vartable\+::vartabledelete(), and gtdata\+\_\+internal\+\_\+vartable\+::vartablelookup().


\begin{DoxyCode}
14   \textcolor{comment}{!}
15   \textcolor{comment}{!== 変数の終了処理}
16   \textcolor{comment}{!}
17   \textcolor{comment}{! 変数 *var* の終了処理を行います。Open または Create されたものは}
18   \textcolor{comment}{! プログラムの最後に必ずこのサブルーチンを用いて終了処理を行ってください。}
19   \textcolor{comment}{!}
20   \textcolor{comment}{! 終了処理の際にエラーが生じた場合、メッセージを出力してプログラムは}
21   \textcolor{comment}{! 強制終了します。*err* を与えてある場合にはこの引数に .true.}
22   \textcolor{comment}{! が返り、プログラムは終了しません。}
23   \textcolor{comment}{!}
24   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}
25   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__map}{gtdata\_internal\_map}\textcolor{keywordtype}{, only}: vtb\_class\_netcdf, vtb\_class\_memory, &
26     & \hyperlink{namespacegtdata__internal__map_a4d64e68c2ccbf5729f07a64822f90726}{maptabdelete}, \hyperlink{namespacegtdata__internal__map_a076911f777be03f10a2c024dac7efdad}{map\_lookup}
27   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__vartable}{gtdata\_internal\_vartable}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__internal__vartable_a0fb95ab458f1dcd34f21b5c5574a63d2}{vartabledelete}, 
      \hyperlink{namespacegtdata__internal__vartable_a1bddf47a2cacc8db25b6fa2c32ed68db}{vartablelookup}
28   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__generic}{gtdata\_netcdf\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1close}{close}
29   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__types}{gtdata\_netcdf\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}
30   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a034d52028a635fe01d2ec4a960c5441c}{gt\_ebadvar}, 
      \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
31   \textcolor{keywordtype}{use }\hyperlink{namespacedc__trace}{dc\_trace}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}, \hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}, \hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}
32   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__memory__generic}{gtdata\_memory\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1close}{close}
33   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__memory__types}{gtdata\_memory\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}
34   \textcolor{keywordtype}{implicit none}
35   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: var
36   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
37   \textcolor{keywordtype}{integer}:: vid, \textcolor{keywordtype}{class}, cid
38   \textcolor{keywordtype}{logical}:: action, myerr
39 \textcolor{keywordflow}{continue}
40   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(\textcolor{stringliteral}{'gtvarclose'}, fmt=\textcolor{stringliteral}{'var=%d'}, i=(/var%mapid/))
41   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a076911f777be03f10a2c024dac7efdad}{map\_lookup}(var, vid=vid)
42   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a4d64e68c2ccbf5729f07a64822f90726}{maptabdelete}(var, myerr)
43   \textcolor{keywordflow}{if} (myerr) \textcolor{keywordflow}{goto} 999
44   \textcolor{comment}{! vid が 0 になるのは dup\_dimmap で作られたハンドル}
45   \textcolor{keywordflow}{if} (vid == 0) \textcolor{keywordflow}{goto} 999
46   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__vartable_a1bddf47a2cacc8db25b6fa2c32ed68db}{vartablelookup}(vid, \textcolor{keywordtype}{class}, cid)
47   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__vartable_a0fb95ab458f1dcd34f21b5c5574a63d2}{vartabledelete}(vid, action, myerr)
48   \textcolor{keywordflow}{if} (myerr) \textcolor{keywordflow}{goto} 999
49   \textcolor{keywordflow}{if} (.not. action) \textcolor{keywordflow}{then}
50     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'refcount decrement only, no close internal var'})
51     \textcolor{keywordflow}{goto} 999
52   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\textcolor{keywordtype}{class} == vtb\_class\_netcdf) \textcolor{keywordflow}{then}
53     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1close}{close}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}(cid), myerr)
54     \textcolor{keywordflow}{if} (myerr) \textcolor{keywordflow}{goto} 999
55   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\textcolor{keywordtype}{class} == vtb\_class\_memory) \textcolor{keywordflow}{then}
56     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1close}{close}(\hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}(cid))
57     myerr = .false.
58   \textcolor{keywordflow}{else}
59     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(\hyperlink{namespacedc__error_a034d52028a635fe01d2ec4a960c5441c}{gt\_ebadvar}, \textcolor{stringliteral}{"GTVarClose"}, err)
60     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}(\textcolor{stringliteral}{'GTVarClose'}, \textcolor{stringliteral}{'badvar'})
61     myerr = .true.
62 \textcolor{keywordflow}{  endif}
63 999 \textcolor{keywordflow}{continue}
64   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}(\textcolor{stringliteral}{'gtvarclose'})
65   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(err)) err = myerr
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvarclose_8f90_a8b672f04f3c616db6ad2e21a48fbb992_cgraph}
\end{center}
\end{figure}
