\hypertarget{gtvaropen_8f90}{}\section{gtdata/gtvaropen.f90 File Reference}
\label{gtvaropen_8f90}\index{gtdata/gtvaropen.\+f90@{gtdata/gtvaropen.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gtvaropen_8f90_a3a7a45433751844e3f994e6aa971514b}{gtvaropen} (var, url, writable, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gtvaropen_8f90_a3a7a45433751844e3f994e6aa971514b}\label{gtvaropen_8f90_a3a7a45433751844e3f994e6aa971514b}} 
\index{gtvaropen.\+f90@{gtvaropen.\+f90}!gtvaropen@{gtvaropen}}
\index{gtvaropen@{gtvaropen}!gtvaropen.\+f90@{gtvaropen.\+f90}}
\subsubsection{\texorpdfstring{gtvaropen()}{gtvaropen()}}
{\footnotesize\ttfamily subroutine gtvaropen (\begin{DoxyParamCaption}\item[{type(gt\+\_\+variable), intent(out)}]{var,  }\item[{character($\ast$), intent(in)}]{url,  }\item[{logical, intent(in), optional}]{writable,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 13 of file gtvaropen.\+f90.



References dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+error\+::gt\+\_\+efake, dc\+\_\+error\+::gt\+\_\+enotvar, gtdata\+\_\+internal\+\_\+map\+::gtvar\+\_\+dump(), gtdata\+\_\+internal\+\_\+map\+::map\+\_\+create(), dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, and dc\+\_\+url\+::url\+\_\+chop\+\_\+iorange().


\begin{DoxyCode}
13   \textcolor{comment}{!}
14   \textcolor{comment}{!== gtool4 データのオープン}
15   \textcolor{comment}{!}
16   \textcolor{comment}{! *url* で識別される gtool 変数を開き、*var* に格納します。}
17   \textcolor{comment}{! *writable* を <tt>.true.</tt> に指定すると書き込み可で開こうとします。}
18   \textcolor{comment}{! デフォルトは書き込み不可で開きます。}
19   \textcolor{comment}{! (まだ *writable* の動作は保障されていません)。}
20   \textcolor{comment}{!}
21   \textcolor{comment}{! Open された変数は必ず Close されなければなりません。}
22   \textcolor{comment}{!}
23   \textcolor{comment}{! エラーが発生した場合、引数 *err* が与えられる場合は *err* が}
24   \textcolor{comment}{! <tt>.true.</tt> となって返ります。}
25   \textcolor{comment}{! 引数 *err* を与えなければプログラムは停止します。}
26   \textcolor{comment}{!}
27   \textcolor{comment}{! *Open* は 2 つのサブルーチンの総称名であり、}
28   \textcolor{comment}{! ある変数の次元を指定することで開くことも可能です。}
29   \textcolor{comment}{! 上記のサブルーチンを参照ください。}
30   \textcolor{comment}{!}
31   \textcolor{comment}{!=== 補足}
32   \textcolor{comment}{!}
33   \textcolor{comment}{! 上記の Open を参照してください。}
34   \textcolor{comment}{!}
35   \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: strhead
36   \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
37   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: gt\_variable
38   \textcolor{keywordtype}{use }gtdata\_generic\textcolor{keywordtype}{, only}: limit
39   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__map}{gtdata\_internal\_map}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__internal__map_ab8c5494c00d4dd85417e891b762f77d9}{map\_create}, vtb\_class\_netcdf, 
      \hyperlink{namespacegtdata__internal__map_acbda65a71acbd7d3ba6175c6f4fceff0}{gtvar\_dump}
40   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__generic}{gtdata\_netcdf\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__netcdf__generic_1_1open}{open}, \hyperlink{interfacegtdata__netcdf__generic_1_1inquire}{inquire}
41   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__types}{gtdata\_netcdf\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}
42   \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__url_a6e8628cb51802dea9310a52cb051f63f}{url\_chop\_iorange}
43   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a3c706700d7fb6c0ff705558066f8e583}{gt\_efake}, \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}, 
      \hyperlink{namespacedc__error_abf5d06cefc18fb371ac66ef70aadb05f}{gt\_enotvar}
44   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub
45   \textcolor{keywordtype}{use }dc\_present\textcolor{keywordtype}{, only}: present\_and\_true
46   \textcolor{keywordtype}{implicit none}
47   \textcolor{keywordtype}{type}(gt\_variable), \textcolor{keywordtype}{intent(out)}:: var
48   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: url
49   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: writable
50   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
51   \textcolor{keywordtype}{integer}:: ndims, stat, cause\_i
52   \textcolor{keywordtype}{character(STRING)}:: cause\_c
53   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{allocatable}:: dimlen(:)
54   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}):: gdnc
55   \textcolor{keywordtype}{character(STRING)}:: filevar, iorange
56   \textcolor{keywordtype}{character(*)},      \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"GTVarOpen"}
57   \textcolor{keywordtype}{character(*)},      \textcolor{keywordtype}{parameter}:: version = &
58     & \textcolor{stringliteral}{'$Name:  $'} // &
59     & \textcolor{stringliteral}{'$Id: gtvaropen.f90,v 1.4 2009-05-25 09:55:57 morikawa Exp $'}
60 continue
61   \textcolor{keyword}{call }beginsub(subname, fmt=\textcolor{stringliteral}{'<%c>'}, c1=trim(url), version=version)
62   stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
63   cause\_i = 0
64   cause\_c = \textcolor{stringliteral}{''}
65   var = gt\_variable(-1)
66   \textcolor{keyword}{call }\hyperlink{namespacedc__url_a6e8628cb51802dea9310a52cb051f63f}{url\_chop\_iorange}(url, iorange=iorange, remainder=filevar)
67   \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1open}{open}(gdnc, filevar, writable, err)
68   \textcolor{keywordflow}{if} ( present\_and\_true(err) ) \textcolor{keywordflow}{then}
69     stat = \hyperlink{namespacedc__error_abf5d06cefc18fb371ac66ef70aadb05f}{gt\_enotvar}
70     \textcolor{keywordflow}{goto} 999
71 \textcolor{keywordflow}{  end if}
72   \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1inquire}{inquire}(gdnc, ndims=ndims)
73   \textcolor{keyword}{allocate}(dimlen(\hyperlink{interfacedc__date__generic_1_1max}{max}(1, ndims)))
74   \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1inquire}{inquire}(gdnc, dimlen=dimlen)
75   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_ab8c5494c00d4dd85417e891b762f77d9}{map\_create}(var, vtb\_class\_netcdf, gdnc%id, ndims, dimlen, stat)
76   \textcolor{keywordflow}{if} (stat /= \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}) \textcolor{keywordflow}{then}
77     cause\_i = ndims
78     \textcolor{keywordflow}{goto} 999
79 \textcolor{keywordflow}{  end if}
80   \textcolor{keyword}{deallocate}(dimlen)
81   \textcolor{keyword}{call }limit(var, trim(iorange))
82   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_acbda65a71acbd7d3ba6175c6f4fceff0}{gtvar\_dump}(var)
83 999 \textcolor{keywordflow}{continue}
84   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, subname, err, cause\_c = cause\_c, cause\_i = cause\_i)
85   \textcolor{keyword}{call }endsub(subname, \textcolor{stringliteral}{'mapid=%d'}, i=(/var%mapid/))
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvaropen_8f90_a3a7a45433751844e3f994e6aa971514b_cgraph}
\end{center}
\end{figure}
