\hypertarget{gtvaraddmember_8f90}{}\section{gtdata/gtvaraddmember.f90 File Reference}
\label{gtvaraddmember_8f90}\index{gtdata/gtvaraddmember.\+f90@{gtdata/gtvaraddmember.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gtvaraddmember_8f90_a664ea3206eec6e8dde29fcdd3bfb512a}{gtvaraddmember} (var, member\+\_\+url, link\+\_\+name)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gtvaraddmember_8f90_a664ea3206eec6e8dde29fcdd3bfb512a}\label{gtvaraddmember_8f90_a664ea3206eec6e8dde29fcdd3bfb512a}} 
\index{gtvaraddmember.\+f90@{gtvaraddmember.\+f90}!gtvaraddmember@{gtvaraddmember}}
\index{gtvaraddmember@{gtvaraddmember}!gtvaraddmember.\+f90@{gtvaraddmember.\+f90}}
\subsubsection{\texorpdfstring{gtvaraddmember()}{gtvaraddmember()}}
{\footnotesize\ttfamily subroutine gtvaraddmember (\begin{DoxyParamCaption}\item[{type(gt\+\_\+variable), intent(inout)}]{var,  }\item[{character(len = $\ast$), intent(in)}]{member\+\_\+url,  }\item[{character(len = $\ast$), intent(in), optional}]{link\+\_\+name }\end{DoxyParamCaption})}



Definition at line 15 of file gtvaraddmember.\+f90.



References dc\+\_\+error\+::gt\+\_\+efake, dc\+\_\+error\+::storeerror(), and dc\+\_\+types\+::string.


\begin{DoxyCode}
15   \textcolor{comment}{!}
16   \textcolor{comment}{!== 構造型変数の gt\_structure\_member 属性の追加}
17   \textcolor{comment}{!}
18   \textcolor{comment}{! 変数 *var* の gt\_structure\_member 属性 }
19   \textcolor{comment}{! (\{gtool4 netCDF 規約\}[link:../xref.htm#label-6] の 「4. 構造体変数」参照)}
20   \textcolor{comment}{! に *member\_url* の変数名部分を追加します。}
21   \textcolor{comment}{!}
22   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}
23   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
24   \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__url_1_1urlsplit}{urlsplit}
25   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__generic}{gtdata\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}, \hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}
26   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}
27   \textcolor{keywordtype}{implicit none}
28   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}), \textcolor{keywordtype}{intent(inout)}:: var
29   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: member\_url
30   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: link\_name
31   \textcolor{keywordtype}{character(len = string)}:: members, myshortname, conv
32 \textcolor{keywordflow}{continue}
33   \textcolor{comment}{! 短縮名称の決定}
34   \textcolor{comment}{! 既存のメンバ名に重複しないものを選ぶ}
35   \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}(var, \textcolor{stringliteral}{'gt\_structure\_member'}, members)
36   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(link\_name)) \textcolor{keywordflow}{then}
37     \textcolor{keywordflow}{if} (index(members, \textcolor{stringliteral}{' '} //link\_name) == 0) \textcolor{keywordflow}{then}
38       myshortname = link\_name
39       \textcolor{keywordflow}{goto} 1000
40 \textcolor{keywordflow}{    endif}
41 \textcolor{keywordflow}{  endif}
42   conv = member\_url
43   \textcolor{keyword}{call }\hyperlink{interfacedc__url_1_1urlsplit}{urlsplit}(conv, var=myshortname)
44   \textcolor{comment}{! fake 判定}
45   \textcolor{keywordflow}{if} (index(members, trim(myshortname)) /= 0) \textcolor{keywordflow}{then}
46     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(\hyperlink{namespacedc__error_a3c706700d7fb6c0ff705558066f8e583}{gt\_efake}, \textcolor{stringliteral}{"GTVarAddMember(making unique name)"})
47 \textcolor{keywordflow}{  endif}
48 1000 \textcolor{keywordflow}{continue}
49   members = trim(members) // \textcolor{stringliteral}{' '} // trim(myshortname)
50   \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(var, \textcolor{stringliteral}{'gt\_structure\_member'}, trim(members))
51   myshortname = \textcolor{stringliteral}{'gt\_structure\_link\_'} // trim(myshortname)
52   \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(var, myshortname, trim(member\_url))
53 
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvaraddmember_8f90_a664ea3206eec6e8dde29fcdd3bfb512a_cgraph}
\end{center}
\end{figure}
