\hypertarget{gdncattrgetnum_8f90}{}\section{gtdata/gtdata\+\_\+netcdf/gdncattrgetnum.f90 File Reference}
\label{gdncattrgetnum_8f90}\index{gtdata/gtdata\+\_\+netcdf/gdncattrgetnum.\+f90@{gtdata/gtdata\+\_\+netcdf/gdncattrgetnum.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gdncattrgetnum_8f90_adfb1bd202c5104347b6f47960f38ba17}{gdncattrgetint} (var, name, value, stat, default)
\item 
subroutine \hyperlink{gdncattrgetnum_8f90_a581a2949bd735900141b38aa365db4be}{gdncattrgetreal} (var, name, value, stat, default)
\item 
subroutine \hyperlink{gdncattrgetnum_8f90_aa05ea5f749d15a9d16fef37bb64a49c5}{gdncattrgetdouble} (var, name, value, stat, default)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gdncattrgetnum_8f90_aa05ea5f749d15a9d16fef37bb64a49c5}\label{gdncattrgetnum_8f90_aa05ea5f749d15a9d16fef37bb64a49c5}} 
\index{gdncattrgetnum.\+f90@{gdncattrgetnum.\+f90}!gdncattrgetdouble@{gdncattrgetdouble}}
\index{gdncattrgetdouble@{gdncattrgetdouble}!gdncattrgetnum.\+f90@{gdncattrgetnum.\+f90}}
\subsubsection{\texorpdfstring{gdncattrgetdouble()}{gdncattrgetdouble()}}
{\footnotesize\ttfamily subroutine gdncattrgetdouble (\begin{DoxyParamCaption}\item[{type(gd\+\_\+nc\+\_\+variable), intent(in)}]{var,  }\item[{character(len = $\ast$), intent(in)}]{name,  }\item[{real(dp), dimension(\+:), intent(out)}]{value,  }\item[{integer, intent(out)}]{stat,  }\item[{real(dp), intent(in), optional}]{default }\end{DoxyParamCaption})}



Definition at line 200 of file gdncattrgetnum.\+f90.



References dc\+\_\+types\+::dp, dc\+\_\+url\+::gt\+\_\+plus, dc\+\_\+types\+::string, and gtdata\+\_\+netcdf\+\_\+internal\+::vtable\+\_\+lookup().


\begin{DoxyCode}
200   \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}
201   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__internal}{gtdata\_netcdf\_internal}\textcolor{keywordtype}{,only}: \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}
202   \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: &
203     & nf90\_noerr, &
204     & nf90\_global, &
205     & nf90\_char, &
206     & nf90\_enomem, &
207     & nf90\_inquire\_attribute, &
208     & nf90\_get\_att
209   \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{,     only}: \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}
210   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__generic}{gtdata\_netcdf\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}
211   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{,   only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
212   \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}
213   \textcolor{keywordtype}{implicit none}
214   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}),       \textcolor{keywordtype}{intent(in)} :: var
215   \textcolor{keywordtype}{character(len = *)},      \textcolor{keywordtype}{intent(in)} :: name
216   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(out)}:: stat
217   \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(out)}:: \textcolor{keywordtype}{value}(:)
218   \textcolor{keywordtype}{real(DP)},  \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: default
219   \textcolor{keywordtype}{real(DP)},  \textcolor{keywordtype}{allocatable}:: rbuffer(:)
220   \textcolor{keywordtype}{character(STRING)}      :: cbuffer
221   \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{pointer} :: lbuffer(:)
222   \textcolor{keywordtype}{integer}           :: attrlen, xtype, i, xferend, iname, varid
223   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__entry}{gd\_nc\_variable\_entry}):: ent
224   \textcolor{keywordflow}{continue}
225   stat = \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}(var, ent)
226   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{then}
227     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) value(:) = default
228     \textcolor{keywordflow}{return}
229 \textcolor{keywordflow}{  endif}
230   \textcolor{comment}{! 型と長さを取得}
231   \textcolor{keywordflow}{if} (name(1:1) == \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}) \textcolor{keywordflow}{then}
232     iname = 2
233     varid = nf90\_global
234   \textcolor{keywordflow}{else}
235     iname = 1
236     varid = ent%varid
237 \textcolor{keywordflow}{  endif}
238   stat = nf90\_inquire\_attribute(ent%fileid, varid, &
239     name = name(iname:), xtype = xtype, len = attrlen)
240   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{then}
241     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) value(:) = default
242     \textcolor{keywordflow}{return}
243 \textcolor{keywordflow}{  endif}
244   \textcolor{comment}{! 文字型の場合は長さをコンマで分解した語数と読み替える}
245   \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keywordflow}{then}
246     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}(var, name, cbuffer, \textcolor{stringliteral}{""}, stat)
247     \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{return}
248     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1split}{split}(cbuffer, lbuffer, \textcolor{stringliteral}{", "})
249     attrlen = \textcolor{keyword}{size}(lbuffer)
250 \textcolor{keywordflow}{  endif}
251   \textcolor{comment}{! 結果を入れるところがなければ長さだけを伝え終了}
252   \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(\textcolor{keywordtype}{value}) == 0) \textcolor{keywordflow}{then}
253     \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keyword}{deallocate}(lbuffer)
254     stat = attrlen
255     \textcolor{keywordflow}{return}
256 \textcolor{keywordflow}{  endif}
257   \textcolor{comment}{! 型に応じて要求されただけ値を転送}
258   xferend = \hyperlink{interfacedc__date__generic_1_1min}{min}(\textcolor{keyword}{size}(\textcolor{keywordtype}{value}), attrlen)
259   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) value(xferend+1: ) = default
260   \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keywordflow}{then}
261     \textcolor{keywordflow}{do}, i = 1, xferend
262       value(i) = \hyperlink{interfacedc__string_1_1stod}{stod}(lbuffer(i))
263 \textcolor{keywordflow}{    enddo}
264     \textcolor{keyword}{deallocate}(lbuffer)
265     stat = attrlen
266     \textcolor{keywordflow}{return}
267   \textcolor{keywordflow}{else}
268     \textcolor{keyword}{allocate}(rbuffer(attrlen), stat=stat)
269     \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{then}
270       stat = nf90\_enomem
271       \textcolor{keywordflow}{return}
272 \textcolor{keywordflow}{    endif}
273     stat = nf90\_get\_att(ent%fileid, varid, name(iname:), rbuffer)
274     \textcolor{keywordflow}{if} (stat == nf90\_noerr) \textcolor{keywordflow}{then}
275       value(1:xferend) = rbuffer(1:xferend)
276       stat = attrlen
277 \textcolor{keywordflow}{    endif}
278     \textcolor{keyword}{deallocate}(rbuffer)
279     \textcolor{keywordflow}{return}
280 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=323pt]{gdncattrgetnum_8f90_aa05ea5f749d15a9d16fef37bb64a49c5_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{gdncattrgetnum_8f90_adfb1bd202c5104347b6f47960f38ba17}\label{gdncattrgetnum_8f90_adfb1bd202c5104347b6f47960f38ba17}} 
\index{gdncattrgetnum.\+f90@{gdncattrgetnum.\+f90}!gdncattrgetint@{gdncattrgetint}}
\index{gdncattrgetint@{gdncattrgetint}!gdncattrgetnum.\+f90@{gdncattrgetnum.\+f90}}
\subsubsection{\texorpdfstring{gdncattrgetint()}{gdncattrgetint()}}
{\footnotesize\ttfamily subroutine gdncattrgetint (\begin{DoxyParamCaption}\item[{type(gd\+\_\+nc\+\_\+variable), intent(in)}]{var,  }\item[{character(len = $\ast$), intent(in)}]{name,  }\item[{integer, dimension(\+:), intent(out)}]{value,  }\item[{integer, intent(out)}]{stat,  }\item[{integer, intent(in), optional}]{default }\end{DoxyParamCaption})}



Definition at line 32 of file gdncattrgetnum.\+f90.



References dc\+\_\+url\+::gt\+\_\+plus, dc\+\_\+types\+::string, and gtdata\+\_\+netcdf\+\_\+internal\+::vtable\+\_\+lookup().


\begin{DoxyCode}
32   \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}
33   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__internal}{gtdata\_netcdf\_internal}\textcolor{keywordtype}{,only}: \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}
34   \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: &
35     & nf90\_noerr, &
36     & nf90\_global, &
37     & nf90\_char, &
38     & nf90\_enomem, &
39     & nf90\_inquire\_attribute, &
40     & nf90\_get\_att
41   \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{,     only}: \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}
42   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__generic}{gtdata\_netcdf\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}
43   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{,   only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
44   \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}
45   \textcolor{keywordtype}{implicit none}
46   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}),       \textcolor{keywordtype}{intent(in)} :: var
47   \textcolor{keywordtype}{character(len = *)},      \textcolor{keywordtype}{intent(in)} :: name
48   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(out)}:: stat
49   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}:: \textcolor{keywordtype}{value}(:)
50   \textcolor{keywordtype}{integer},  \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: default
51   \textcolor{keywordtype}{integer},  \textcolor{keywordtype}{allocatable}:: rbuffer(:)
52   \textcolor{keywordtype}{character(STRING)}      :: cbuffer
53   \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{pointer} :: lbuffer(:)
54   \textcolor{keywordtype}{integer}           :: attrlen, xtype, i, xferend, iname, varid
55   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__entry}{gd\_nc\_variable\_entry}):: ent
56   \textcolor{keywordflow}{continue}
57   stat = \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}(var, ent)
58   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{then}
59     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) value(:) = default
60     \textcolor{keywordflow}{return}
61 \textcolor{keywordflow}{  endif}
62   \textcolor{comment}{! 型と長さを取得}
63   \textcolor{keywordflow}{if} (name(1:1) == \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}) \textcolor{keywordflow}{then}
64     iname = 2
65     varid = nf90\_global
66   \textcolor{keywordflow}{else}
67     iname = 1
68     varid = ent%varid
69 \textcolor{keywordflow}{  endif}
70   stat = nf90\_inquire\_attribute(ent%fileid, varid, &
71     name = name(iname:), xtype = xtype, len = attrlen)
72   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{then}
73     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) value(:) = default
74     \textcolor{keywordflow}{return}
75 \textcolor{keywordflow}{  endif}
76   \textcolor{comment}{! 文字型の場合は長さをコンマで分解した語数と読み替える}
77   \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keywordflow}{then}
78     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}(var, name, cbuffer, \textcolor{stringliteral}{""}, stat)
79     \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{return}
80     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1split}{split}(cbuffer, lbuffer, \textcolor{stringliteral}{", "})
81     attrlen = \textcolor{keyword}{size}(lbuffer)
82 \textcolor{keywordflow}{  endif}
83   \textcolor{comment}{! 結果を入れるところがなければ長さだけを伝え終了}
84   \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(\textcolor{keywordtype}{value}) == 0) \textcolor{keywordflow}{then}
85     \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keyword}{deallocate}(lbuffer)
86     stat = attrlen
87     \textcolor{keywordflow}{return}
88 \textcolor{keywordflow}{  endif}
89   \textcolor{comment}{! 型に応じて要求されただけ値を転送}
90   xferend = \hyperlink{interfacedc__date__generic_1_1min}{min}(\textcolor{keyword}{size}(\textcolor{keywordtype}{value}), attrlen)
91   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) value(xferend+1: ) = default
92   \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keywordflow}{then}
93     \textcolor{keywordflow}{do}, i = 1, xferend
94       value(i) = \hyperlink{interfacedc__string_1_1stod}{stod}(lbuffer(i))
95 \textcolor{keywordflow}{    enddo}
96     \textcolor{keyword}{deallocate}(lbuffer)
97     stat = attrlen
98     \textcolor{keywordflow}{return}
99   \textcolor{keywordflow}{else}
100     \textcolor{keyword}{allocate}(rbuffer(attrlen), stat=stat)
101     \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{then}
102       stat = nf90\_enomem
103       \textcolor{keywordflow}{return}
104 \textcolor{keywordflow}{    endif}
105     stat = nf90\_get\_att(ent%fileid, varid, name(iname:), rbuffer)
106     \textcolor{keywordflow}{if} (stat == nf90\_noerr) \textcolor{keywordflow}{then}
107       value(1:xferend) = rbuffer(1:xferend)
108       stat = attrlen
109 \textcolor{keywordflow}{    endif}
110     \textcolor{keyword}{deallocate}(rbuffer)
111     \textcolor{keywordflow}{return}
112 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=305pt]{gdncattrgetnum_8f90_adfb1bd202c5104347b6f47960f38ba17_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{gdncattrgetnum_8f90_a581a2949bd735900141b38aa365db4be}\label{gdncattrgetnum_8f90_a581a2949bd735900141b38aa365db4be}} 
\index{gdncattrgetnum.\+f90@{gdncattrgetnum.\+f90}!gdncattrgetreal@{gdncattrgetreal}}
\index{gdncattrgetreal@{gdncattrgetreal}!gdncattrgetnum.\+f90@{gdncattrgetnum.\+f90}}
\subsubsection{\texorpdfstring{gdncattrgetreal()}{gdncattrgetreal()}}
{\footnotesize\ttfamily subroutine gdncattrgetreal (\begin{DoxyParamCaption}\item[{type(gd\+\_\+nc\+\_\+variable), intent(in)}]{var,  }\item[{character(len = $\ast$), intent(in)}]{name,  }\item[{real(sp), dimension(\+:), intent(out)}]{value,  }\item[{integer, intent(out)}]{stat,  }\item[{real(sp), intent(in), optional}]{default }\end{DoxyParamCaption})}



Definition at line 116 of file gdncattrgetnum.\+f90.



References dc\+\_\+url\+::gt\+\_\+plus, dc\+\_\+types\+::sp, dc\+\_\+types\+::string, and gtdata\+\_\+netcdf\+\_\+internal\+::vtable\+\_\+lookup().


\begin{DoxyCode}
116   \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}
117   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__internal}{gtdata\_netcdf\_internal}\textcolor{keywordtype}{,only}: \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}
118   \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: &
119     & nf90\_noerr, &
120     & nf90\_global, &
121     & nf90\_char, &
122     & nf90\_enomem, &
123     & nf90\_inquire\_attribute, &
124     & nf90\_get\_att
125   \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{,     only}: \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}
126   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__generic}{gtdata\_netcdf\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}
127   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{,   only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a1059e567d99c60c9d08992a95cd2e9a5}{sp}
128   \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}
129   \textcolor{keywordtype}{implicit none}
130   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}),       \textcolor{keywordtype}{intent(in)} :: var
131   \textcolor{keywordtype}{character(len = *)},      \textcolor{keywordtype}{intent(in)} :: name
132   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(out)}:: stat
133   \textcolor{keywordtype}{real(SP)}, \textcolor{keywordtype}{intent(out)}:: \textcolor{keywordtype}{value}(:)
134   \textcolor{keywordtype}{real(SP)},  \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: default
135   \textcolor{keywordtype}{real(SP)},  \textcolor{keywordtype}{allocatable}:: rbuffer(:)
136   \textcolor{keywordtype}{character(STRING)}      :: cbuffer
137   \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{pointer} :: lbuffer(:)
138   \textcolor{keywordtype}{integer}           :: attrlen, xtype, i, xferend, iname, varid
139   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__entry}{gd\_nc\_variable\_entry}):: ent
140   \textcolor{keywordflow}{continue}
141   stat = \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}(var, ent)
142   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{then}
143     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) value(:) = default
144     \textcolor{keywordflow}{return}
145 \textcolor{keywordflow}{  endif}
146   \textcolor{comment}{! 型と長さを取得}
147   \textcolor{keywordflow}{if} (name(1:1) == \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}) \textcolor{keywordflow}{then}
148     iname = 2
149     varid = nf90\_global
150   \textcolor{keywordflow}{else}
151     iname = 1
152     varid = ent%varid
153 \textcolor{keywordflow}{  endif}
154   stat = nf90\_inquire\_attribute(ent%fileid, varid, &
155     name = name(iname:), xtype = xtype, len = attrlen)
156   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{then}
157     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) value(:) = default
158     \textcolor{keywordflow}{return}
159 \textcolor{keywordflow}{  endif}
160   \textcolor{comment}{! 文字型の場合は長さをコンマで分解した語数と読み替える}
161   \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keywordflow}{then}
162     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}(var, name, cbuffer, \textcolor{stringliteral}{""}, stat)
163     \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{return}
164     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1split}{split}(cbuffer, lbuffer, \textcolor{stringliteral}{", "})
165     attrlen = \textcolor{keyword}{size}(lbuffer)
166 \textcolor{keywordflow}{  endif}
167   \textcolor{comment}{! 結果を入れるところがなければ長さだけを伝え終了}
168   \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(\textcolor{keywordtype}{value}) == 0) \textcolor{keywordflow}{then}
169     \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keyword}{deallocate}(lbuffer)
170     stat = attrlen
171     \textcolor{keywordflow}{return}
172 \textcolor{keywordflow}{  endif}
173   \textcolor{comment}{! 型に応じて要求されただけ値を転送}
174   xferend = \hyperlink{interfacedc__date__generic_1_1min}{min}(\textcolor{keyword}{size}(\textcolor{keywordtype}{value}), attrlen)
175   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) value(xferend+1: ) = default
176   \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keywordflow}{then}
177     \textcolor{keywordflow}{do}, i = 1, xferend
178       value(i) = \hyperlink{interfacedc__string_1_1stod}{stod}(lbuffer(i))
179 \textcolor{keywordflow}{    enddo}
180     \textcolor{keyword}{deallocate}(lbuffer)
181     stat = attrlen
182     \textcolor{keywordflow}{return}
183   \textcolor{keywordflow}{else}
184     \textcolor{keyword}{allocate}(rbuffer(attrlen), stat=stat)
185     \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{then}
186       stat = nf90\_enomem
187       \textcolor{keywordflow}{return}
188 \textcolor{keywordflow}{    endif}
189     stat = nf90\_get\_att(ent%fileid, varid, name(iname:), rbuffer)
190     \textcolor{keywordflow}{if} (stat == nf90\_noerr) \textcolor{keywordflow}{then}
191       value(1:xferend) = rbuffer(1:xferend)
192       stat = attrlen
193 \textcolor{keywordflow}{    endif}
194     \textcolor{keyword}{deallocate}(rbuffer)
195     \textcolor{keywordflow}{return}
196 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=310pt]{gdncattrgetnum_8f90_a581a2949bd735900141b38aa365db4be_cgraph}
\end{center}
\end{figure}
