\hypertarget{gdncvarattrtrue_8f90}{}\section{gtdata/gtdata\+\_\+netcdf/gdncvarattrtrue.f90 File Reference}
\label{gdncvarattrtrue_8f90}\index{gtdata/gtdata\+\_\+netcdf/gdncvarattrtrue.\+f90@{gtdata/gtdata\+\_\+netcdf/gdncvarattrtrue.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gdncvarattrtrue_8f90_a5e83822aad5a18144a29c8557c431de4}{gdncvargetattrlogical} (var, name, value, default)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gdncvarattrtrue_8f90_a5e83822aad5a18144a29c8557c431de4}\label{gdncvarattrtrue_8f90_a5e83822aad5a18144a29c8557c431de4}} 
\index{gdncvarattrtrue.\+f90@{gdncvarattrtrue.\+f90}!gdncvargetattrlogical@{gdncvargetattrlogical}}
\index{gdncvargetattrlogical@{gdncvargetattrlogical}!gdncvarattrtrue.\+f90@{gdncvarattrtrue.\+f90}}
\subsubsection{\texorpdfstring{gdncvargetattrlogical()}{gdncvargetattrlogical()}}
{\footnotesize\ttfamily subroutine gdncvargetattrlogical (\begin{DoxyParamCaption}\item[{type(gd\+\_\+nc\+\_\+variable), intent(in)}]{var,  }\item[{character(len = $\ast$), intent(in)}]{name,  }\item[{logical, intent(out)}]{value,  }\item[{logical, intent(in), optional}]{default }\end{DoxyParamCaption})}



Definition at line 5 of file gdncvarattrtrue.\+f90.



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


\begin{DoxyCode}
5   \textcolor{comment}{! 真偽値の判定基準 ... 偽の例を示す。例を lowercase にしたもの以外の値は全部真。}
6   \textcolor{comment}{!   数値 0, 0.0}
7   \textcolor{comment}{!   文字列 "0", "0.0", ".0", "0.", "0.0D0", "FALSE", ".FALSE.", "F"}
8 
9   \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}
10   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__internal}{gtdata\_netcdf\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}
11   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__generic}{gtdata\_netcdf\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__netcdf__generic_1_1get__attr}{get\_attr}, 
      \hyperlink{interfacegtdata__netcdf__generic_1_1inquireplus}{inquireplus}
12   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
13   \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: nf90\_max\_name, nf90\_noerr, nf90\_char, nf90\_inquire\_attribute, nf90\_get\_att
14   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}
15   \textcolor{keywordtype}{use }dc\_string
16   \textcolor{keywordtype}{implicit none}
17   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}), \textcolor{keywordtype}{intent(in)}:: var
18   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: name
19   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}:: value
20   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: default
21   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__entry}{gd\_nc\_variable\_entry}):: ent
22   \textcolor{keywordtype}{character(len = STRING)}:: cbuffer
23   \textcolor{keywordtype}{character(len = 7)}:: c\_default
24   \textcolor{keywordtype}{character(len = NF90\_MAX\_NAME)}:: aname
25   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{allocatable}:: rbuf(:)
26   \textcolor{keywordtype}{integer}:: stat, xtype, attrlen
27   \textcolor{keywordtype}{integer}:: varid
28   stat = \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}(var, ent)
29   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{goto} 999
30   \textcolor{comment}{! 大域属性サポート}
31   \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1inquireplus}{inquireplus}(var, name, &
32     & varid=varid, nf\_attrname=aname)
33   stat = nf90\_inquire\_attribute(ent%fileid, varid, aname, xtype=xtype, len=attrlen)
34   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{goto} 999
35   \textcolor{keywordflow}{if} (xtype == nf90\_char) \textcolor{keywordflow}{then}
36     c\_default = \textcolor{stringliteral}{"0"}
37     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then}
38       \textcolor{keywordflow}{if} (default) c\_default = \textcolor{stringliteral}{"1"}
39 \textcolor{keywordflow}{    endif}
40     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1get__attr}{get\_attr}(var, name, cbuffer, c\_default, stat)
41     \textcolor{comment}{! もうちょっとましな方法があるべきだが。}
42     \textcolor{keywordflow}{select case}(cbuffer)
43     \textcolor{keywordflow}{case}(\textcolor{stringliteral}{""}, \textcolor{stringliteral}{"0"}, \textcolor{stringliteral}{"0.0"}, \textcolor{stringliteral}{"0."}, \textcolor{stringliteral}{".0"}, \textcolor{stringliteral}{"FALSE"}, \textcolor{stringliteral}{"false"}, \textcolor{stringliteral}{".FALSE."}, &
44       & \textcolor{stringliteral}{".false."}, \textcolor{stringliteral}{"F"}, \textcolor{stringliteral}{"f"}, \textcolor{stringliteral}{"0.0D0"}, \textcolor{stringliteral}{"0.0d0"})
45       \textcolor{keywordtype}{value} = .false.
46 \textcolor{keywordflow}{    case default}
47       \textcolor{keywordtype}{value} = .true.
48 \textcolor{keywordflow}{    end select}
49   \textcolor{keywordflow}{else}
50     \textcolor{keyword}{allocate}(rbuf(attrlen))
51     stat = nf90\_get\_att(ent%fileid, varid, aname, rbuf)
52     \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{goto} 999
53     \textcolor{keywordtype}{value} = (abs(rbuf(1)) > tiny(0.0))
54 \textcolor{keywordflow}{  endif}
55   \textcolor{keywordflow}{return}
56 
57 999 \textcolor{keywordflow}{continue}
58   \textcolor{keywordtype}{value} = .false.
59   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=336pt]{gdncvarattrtrue_8f90_a5e83822aad5a18144a29c8557c431de4_cgraph}
\end{center}
\end{figure}
