\hypertarget{gdncsearchdim_8f90}{}\section{gtdata/gtdata\+\_\+netcdf/gdncsearchdim.f90 File Reference}
\label{gdncsearchdim_8f90}\index{gtdata/gtdata\+\_\+netcdf/gdncsearchdim.\+f90@{gtdata/gtdata\+\_\+netcdf/gdncsearchdim.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
integer function \hyperlink{gdncsearchdim_8f90_ad88b5b9bc280638d1d65b5e6a9291c54}{gdncsearchdim} (var, dimname)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gdncsearchdim_8f90_ad88b5b9bc280638d1d65b5e6a9291c54}\label{gdncsearchdim_8f90_ad88b5b9bc280638d1d65b5e6a9291c54}} 
\index{gdncsearchdim.\+f90@{gdncsearchdim.\+f90}!gdncsearchdim@{gdncsearchdim}}
\index{gdncsearchdim@{gdncsearchdim}!gdncsearchdim.\+f90@{gdncsearchdim.\+f90}}
\subsubsection{\texorpdfstring{gdncsearchdim()}{gdncsearchdim()}}
{\footnotesize\ttfamily integer function gdncsearchdim (\begin{DoxyParamCaption}\item[{type(gd\+\_\+nc\+\_\+variable), intent(in)}]{var,  }\item[{character($\ast$), intent(in)}]{dimname }\end{DoxyParamCaption})}



Definition at line 11 of file gdncsearchdim.\+f90.



References dc\+\_\+error\+::gt\+\_\+enomoredims, and gtdata\+\_\+netcdf\+\_\+internal\+::vtable\+\_\+lookup().


\begin{DoxyCode}
11   \textcolor{comment}{!}
12   \textcolor{comment}{! 次元変数 ID の取得}
13   \textcolor{comment}{!}
14   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__types}{gtdata\_netcdf\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}, 
      \hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__entry}{gd\_nc\_variable\_entry}, \hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__search}{gd\_nc\_variable\_search}
15   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__internal}{gtdata\_netcdf\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}
16   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__file__generic}{gtdata\_netcdf\_file\_generic}
17   \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: nf90\_ebaddim, nf90\_noerr, nf90\_inq\_dimid
18   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}
19   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub
20   \textcolor{keywordtype}{implicit none}
21   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}), \textcolor{keywordtype}{intent(in)}:: var
22   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: dimname
23   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__entry}{gd\_nc\_variable\_entry}):: ent
24   \textcolor{keywordtype}{integer}:: stat, dimid, i
25   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'GDNcSearchDim'}
26 \textcolor{keywordflow}{continue}
27   \textcolor{keyword}{call }beginsub(subname, \textcolor{stringliteral}{'var=%d dimname=%c'}, i=(/var%id/), c1=trim(dimname))
28   result = nf90\_ebaddim
29   stat = \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}(var, ent)
30   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{goto} 999
31 
32   stat = nf90\_inq\_dimid(ent%fileid, dimname, dimid)
33   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{goto} 999
34 
35   \textcolor{keywordflow}{if} (dimid == ent%dimid) \textcolor{keywordflow}{then}
36     result = 1
37     \textcolor{keywordflow}{goto} 999
38 \textcolor{keywordflow}{  endif}
39 
40   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(ent%dimids)) \textcolor{keywordflow}{then}
41     stat = \hyperlink{namespacedc__error_adbe5d07dca84213ae01fef87caf04be3}{gt\_enomoredims}
42     \textcolor{keywordflow}{goto} 999
43 \textcolor{keywordflow}{  endif}
44   \textcolor{keywordflow}{do}, i = 1, \textcolor{keyword}{size}(ent%dimids)
45     \textcolor{keywordflow}{if} (ent%dimids(i) == dimid) \textcolor{keywordflow}{then}
46       result = i
47       \textcolor{keywordflow}{goto} 999
48 \textcolor{keywordflow}{    endif}
49 \textcolor{keywordflow}{  enddo}
50 
51 999 \textcolor{keywordflow}{continue}
52   \textcolor{keyword}{call }endsub(subname, \textcolor{stringliteral}{'result=%d'}, i=(/result/))
53   \textcolor{keywordflow}{return}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=312pt]{gdncsearchdim_8f90_ad88b5b9bc280638d1d65b5e6a9291c54_cgraph}
\end{center}
\end{figure}
