\hypertarget{gtvarcreated_8f90}{}\section{gtdata/gtvarcreated.f90 File Reference}
\label{gtvarcreated_8f90}\index{gtdata/gtvarcreated.\+f90@{gtdata/gtvarcreated.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gtvarcreated_8f90_aed26da15fa82944c43fe1c045187be3b}{gtvarcreated} (var, url, length, xtype, long\+\_\+name, overwrite, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gtvarcreated_8f90_aed26da15fa82944c43fe1c045187be3b}\label{gtvarcreated_8f90_aed26da15fa82944c43fe1c045187be3b}} 
\index{gtvarcreated.\+f90@{gtvarcreated.\+f90}!gtvarcreated@{gtvarcreated}}
\index{gtvarcreated@{gtvarcreated}!gtvarcreated.\+f90@{gtvarcreated.\+f90}}
\subsubsection{\texorpdfstring{gtvarcreated()}{gtvarcreated()}}
{\footnotesize\ttfamily subroutine gtvarcreated (\begin{DoxyParamCaption}\item[{type(gt\+\_\+variable), intent(out)}]{var,  }\item[{character(len = $\ast$), intent(in)}]{url,  }\item[{integer, intent(in)}]{length,  }\item[{character(len = $\ast$), intent(in), optional}]{xtype,  }\item[{character(len = $\ast$), intent(in), optional}]{long\+\_\+name,  }\item[{logical, intent(in), optional}]{overwrite,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 14 of file gtvarcreated.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+trace\+::endsub(), gtdata\+\_\+internal\+\_\+map\+::gtvar\+\_\+dump(), gtdata\+\_\+internal\+\_\+map\+::map\+\_\+create(), dc\+\_\+error\+::storeerror(), and dc\+\_\+types\+::string.


\begin{DoxyCode}
14   \textcolor{comment}{!}
15   \textcolor{comment}{!== 独立変数 (次元) の作成}
16   \textcolor{comment}{!}
17   \textcolor{comment}{! 場所 *url* に長さ *length* の自分自身を次元とする変数つまり GT\_VARIABLE 型}
18   \textcolor{comment}{! の実体を作成し、それを第 1 引数 *var* にセットします。}
19   \textcolor{comment}{! Open されたものと同様、第1引数 *var* は後で必ず}
20   \textcolor{comment}{! Close されなければなりません。}
21   \textcolor{comment}{!}
22   \textcolor{comment}{! 長さ length == 0 を指定するとその変数は可変長次元となります。}
23   \textcolor{comment}{! 型 *xtype* を省略すると "+float+" と}
24   \textcolor{comment}{! みなされます。既存変数があるとき失敗しますが、}
25   \textcolor{comment}{! overwrite == .true. であれば上書きして続行します。}
26   \textcolor{comment}{! (まだ *overwrite* の動作は保障されていません)。}
27   \textcolor{comment}{! dims の省略は 0 次元変数の設定を意味します。}
28   \textcolor{comment}{!}
29   \textcolor{comment}{! 次元変数は自動生成されることが多いため、変数名部を欠く指定に対しては}
30   \textcolor{comment}{! 名前を自動生成します。}
31   \textcolor{comment}{!}
32   \textcolor{comment}{! 作成の際にエラーが生じた場合、メッセージを出力してプログラムは}
33   \textcolor{comment}{! 強制終了します。*err* を与えてある場合にはこの引数に .true.}
34   \textcolor{comment}{! が返り、プログラムは終了しません。}
35   \textcolor{comment}{!}
36   \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1strhead}{strhead}
37   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}
38   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__generic}{gtdata\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1gtdatatmpnam}{gtdatatmpnam}
39   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__generic}{gtdata\_netcdf\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1create}{create}, \hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}
40   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__types}{gtdata\_netcdf\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}
41   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__memory__generic}{gtdata\_memory\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1create}{create}
42   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__memory__types}{gtdata\_memory\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}
43   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__map}{gtdata\_internal\_map}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__internal__map_ab8c5494c00d4dd85417e891b762f77d9}{map\_create}, vtb\_class\_memory, 
      vtb\_class\_netcdf, \hyperlink{namespacegtdata__internal__map_acbda65a71acbd7d3ba6175c6f4fceff0}{gtvar\_dump}
44   \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__url_1_1urlsplit}{urlsplit}, \hyperlink{interfacedc__url_1_1urlmerge}{urlmerge}
45   \textcolor{keywordtype}{use }\hyperlink{namespacedc__trace}{dc\_trace}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}, \hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}, \hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}
46   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
47   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
48   \textcolor{keywordtype}{implicit none}
49   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}), \textcolor{keywordtype}{intent(out)}:: var
50   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: url
51   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: length
52   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: xtype
53   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: long\_name
54   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: overwrite
55   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
56   \textcolor{keywordtype}{character(len = STRING)}:: fnam, vnam, new\_url, data\_class
57   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}):: gdnc
58   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__memory__types_1_1gd__mem__variable}{gd\_mem\_variable}):: mem
59   \textcolor{keywordtype}{integer} :: stat, cause\_i
60   \textcolor{keywordtype}{character(len = *)},      \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"GTVarCreateD"}
61   \textcolor{keywordtype}{character(len = *)},      \textcolor{keywordtype}{parameter}:: version = &
62     & \textcolor{stringliteral}{'$Name:  $'} // &
63     & \textcolor{stringliteral}{'$Id: gtvarcreated.f90,v 1.5 2009-05-25 09:55:58 morikawa Exp $'}
64 continue
65   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname, \textcolor{stringliteral}{'url=<%c> length=%d'}, &
66     & c1=trim(url), i=(/length/), version=version)
67   stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
68   cause\_i = 0
69   data\_class = \textcolor{stringliteral}{''}
70   \textcolor{keywordflow}{if} (\hyperlink{interfacedc__string_1_1strhead}{strhead}(url, \textcolor{stringliteral}{"memory:"})) \textcolor{keywordflow}{then}
71     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1create}{create}(mem, url, length, xtype, long\_name, overwrite, err)
72     \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_ab8c5494c00d4dd85417e891b762f77d9}{map\_create}(var, vtb\_class\_memory, mem%id, 1, (/length/), stat)
73     \textcolor{keywordflow}{if} (stat /= \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}) \textcolor{keywordflow}{then}
74       cause\_i = 1
75       \textcolor{keywordflow}{goto} 999
76 \textcolor{keywordflow}{    end if}
77     \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_acbda65a71acbd7d3ba6175c6f4fceff0}{gtvar\_dump}(var)
78     data\_class = \textcolor{stringliteral}{'memory'}
79     \textcolor{keywordflow}{goto} 999
80 \textcolor{keywordflow}{  endif}
81   \textcolor{comment}{! URL の検査}
82   \textcolor{keyword}{call }\hyperlink{interfacedc__url_1_1urlsplit}{urlsplit}(url, file=fnam, var=vnam)
83   \textcolor{keywordflow}{if} (vnam == \textcolor{stringliteral}{""}) \textcolor{keywordflow}{then}
84     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1gtdatatmpnam}{gtdatatmpnam}(file=fnam, base=\textcolor{stringliteral}{"dim"}, result=new\_url)
85   \textcolor{keywordflow}{else}
86     new\_url = url
87 \textcolor{keywordflow}{  endif}
88   \textcolor{comment}{! gdnc 形式が選択される場合は}
89   \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1create}{create}(var=gdnc, url=new\_url, length=length, xtype=xtype, &
90     & overwrite=overwrite, err=err)
91   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(long\_name)) \textcolor{keywordflow}{then}
92     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put__attr}{put\_attr}(gdnc, \textcolor{stringliteral}{'long\_name'}, long\_name, err=err)
93 \textcolor{keywordflow}{  endif}
94   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_ab8c5494c00d4dd85417e891b762f77d9}{map\_create}(var, vtb\_class\_netcdf, gdnc%id, 1, (/length/), stat)
95     \textcolor{keywordflow}{if} (stat /= \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}) \textcolor{keywordflow}{then}
96       cause\_i = 1
97       \textcolor{keywordflow}{goto} 999
98 \textcolor{keywordflow}{    end if}
99   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_acbda65a71acbd7d3ba6175c6f4fceff0}{gtvar\_dump}(var)
100   data\_class = \textcolor{stringliteral}{'netcdf'}
101 999 \textcolor{keywordflow}{continue}
102   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, subname, err, cause\_i=cause\_i)
103   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}(subname, \textcolor{stringliteral}{'class=%c mapid=%d'}, &
104     & c1=trim(data\_class), i=(/var%mapid/) )
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvarcreated_8f90_aed26da15fa82944c43fe1c045187be3b_cgraph}
\end{center}
\end{figure}
