<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\hypertarget{gdncfileclose_8f90}{}\section{gtdata/gtdata\+\_\+netcdf/gtdata\+\_\+netcdf\+\_\+file/gdncfileclose.f90 File Reference}
\label{gdncfileclose_8f90}\index{gtdata/gtdata\+\_\+netcdf/gtdata\+\_\+netcdf\+\_\+file/gdncfileclose.\+f90@{gtdata/gtdata\+\_\+netcdf/gtdata\+\_\+netcdf\+\_\+file/gdncfileclose.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gdncfileclose_8f90_a66baca675a6538aeb500f29c3e36f905}{gdncfileclose} (fileid, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gdncfileclose_8f90_a66baca675a6538aeb500f29c3e36f905}\label{gdncfileclose_8f90_a66baca675a6538aeb500f29c3e36f905}} 
\index{gdncfileclose.\+f90@{gdncfileclose.\+f90}!gdncfileclose@{gdncfileclose}}
\index{gdncfileclose@{gdncfileclose}!gdncfileclose.\+f90@{gdncfileclose.\+f90}}
\subsubsection{\texorpdfstring{gdncfileclose()}{gdncfileclose()}}
{\footnotesize\ttfamily subroutine gdncfileclose (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{fileid,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 2 of file gdncfileclose.\+f90.



References gtdata\+\_\+netcdf\+\_\+file\+\_\+internal\+::id\+\_\+head, gtdata\+\_\+netcdf\+\_\+file\+\_\+internal\+::id\+\_\+used, and dc\+\_\+error\+::storeerror().


\begin{DoxyCode}
2   \textcolor{comment}{! 縺翫↑縺� id 縺ｮ繝輔ぃ繧､繝ｫ縺ｮ蜿ら�繧ｫ繧ｦ繝ｳ繧ｿ繧呈ｸ帷ｮ励＠縲√ぞ繝ｭ縺ｫ縺ｪ縺｣縺溘ｉ髢峨§繧急
3   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__file__types}{gtdata\_netcdf\_file\_types}\textcolor{keywordtype}{, only}: gd\_nc\_file\_id\_entry
4   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__file__internal}{gtdata\_netcdf\_file\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__netcdf__file__internal_adc425214d1fe0c8803e7b91f0d2074f8}{id\_head}, 
      \hyperlink{namespacegtdata__netcdf__file__internal_ad13ad75c1b2a9be6fd6f67d457dd710f}{id\_used}
5   \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: nf90\_close, nf90\_enotnc, nf90\_noerr
6   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}
7   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub, dbgmessage
8   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: fileid
9   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
10   \textcolor{keywordtype}{type}(gd\_nc\_file\_id\_entry), \textcolor{keywordtype}{pointer}:: identptr, prev
11   \textcolor{keywordtype}{integer}:: stat
12   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"GDNcFileClose"}
13 \textcolor{keywordflow}{continue}
14   \textcolor{keyword}{call }beginsub(subname)
15   stat = nf90\_enotnc
16   \textcolor{keywordflow}{if} (.not. \hyperlink{namespacegtdata__netcdf__file__internal_ad13ad75c1b2a9be6fd6f67d457dd710f}{id\_used}) \textcolor{keywordflow}{goto} 999
17   identptr =&gt; \hyperlink{namespacegtdata__netcdf__file__internal_adc425214d1fe0c8803e7b91f0d2074f8}{id\_head}
18   \textcolor{keyword}{nullify}(prev)
19   \textcolor{keywordflow}{do}
20     \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(identptr)) \textcolor{keywordflow}{goto} 999
21     \textcolor{keywordflow}{if} (identptr % id == fileid) \textcolor{keywordflow}{exit}
22     prev =&gt; identptr
23     identptr =&gt; identptr % next
24 \textcolor{keywordflow}{  enddo}
25   identptr % count = identptr % count - 1
26   \textcolor{keywordflow}{if} (identptr % count &lt;= 0) \textcolor{keywordflow}{then}
27     stat = nf90\_close(fileid)
28     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(prev)) \textcolor{keywordflow}{then}
29       prev%next =&gt; identptr % next
30     \textcolor{keywordflow}{else}
31       \hyperlink{namespacegtdata__netcdf__file__internal_adc425214d1fe0c8803e7b91f0d2074f8}{id\_head} =&gt; identptr % next
32       \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(\hyperlink{namespacegtdata__netcdf__file__internal_adc425214d1fe0c8803e7b91f0d2074f8}{id\_head})) \hyperlink{namespacegtdata__netcdf__file__internal_ad13ad75c1b2a9be6fd6f67d457dd710f}{id\_used} = .false.
33 \textcolor{keywordflow}{    endif}
34     \textcolor{keyword}{call }dbgmessage(subname // \textcolor{stringliteral}{': &lt;%c&gt; closed'}, c1=trim(identptr % filename))
35     \textcolor{keyword}{deallocate}(identptr)
36   \textcolor{keywordflow}{else}
37     \textcolor{keyword}{call }dbgmessage(subname // \textcolor{stringliteral}{': %d&lt;%c&gt; skipped for refcount=%d'}, &amp;
38       &amp; c1=trim(identptr % filename), i=(/fileid, identptr % count/))
39     stat = nf90\_noerr
40 \textcolor{keywordflow}{  endif}
41 999 \textcolor{keywordflow}{continue}
42   \textcolor{keyword}{call }endsub(subname)
43   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, \textcolor{stringliteral}{'GDNcFileClose'}, err)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gdncfileclose_8f90_a66baca675a6538aeb500f29c3e36f905_cgraph}
\end{center}
\end{figure}
</pre></body></html>