\hypertarget{gtvartmpnam_8f90}{}\section{gtdata/gtvartmpnam.f90 File Reference}
\label{gtvartmpnam_8f90}\index{gtdata/gtvartmpnam.\+f90@{gtdata/gtvartmpnam.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gtvartmpnam_8f90_a90f5569744229f60a4991029192eb213}{gtvartmpnam} (file, base, result)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gtvartmpnam_8f90_a90f5569744229f60a4991029192eb213}\label{gtvartmpnam_8f90_a90f5569744229f60a4991029192eb213}} 
\index{gtvartmpnam.\+f90@{gtvartmpnam.\+f90}!gtvartmpnam@{gtvartmpnam}}
\index{gtvartmpnam@{gtvartmpnam}!gtvartmpnam.\+f90@{gtvartmpnam.\+f90}}
\subsubsection{\texorpdfstring{gtvartmpnam()}{gtvartmpnam()}}
{\footnotesize\ttfamily subroutine gtvartmpnam (\begin{DoxyParamCaption}\item[{character(len = $\ast$), intent(in)}]{file,  }\item[{character(len = $\ast$), intent(in)}]{base,  }\item[{character(len = $\ast$), intent(out)}]{result }\end{DoxyParamCaption})}



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



References dc\+\_\+types\+::string.


\begin{DoxyCode}
15   \textcolor{comment}{!}
16   \textcolor{comment}{!== 変数名の自動作成}
17   \textcolor{comment}{!}
18   \textcolor{comment}{! ファイル名 *file* と変数名 *base* から <b>file@base</b> を}
19   \textcolor{comment}{! 作成して *result* に返す。}
20   \textcolor{comment}{! *file* が空文字の場合は <b>gtool.nc</b> がファイル名として代用され、}
21   \textcolor{comment}{! *base* が空文字の場合は <b>tmp</b> が変数名として代用される。}
22   \textcolor{comment}{!}
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}: urlmerge
25   \textcolor{keywordtype}{use }gtdata\_generic\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__netcdf__generic_1_1open}{open}, \hyperlink{interfacegtdata__netcdf__generic_1_1close}{close}
26   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: gt\_variable
27   \textcolor{keywordtype}{implicit none}
28   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: file
29   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: base
30   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(out)}:: result
31   \textcolor{keywordtype}{type}(gt\_variable):: var
32   \textcolor{keywordtype}{integer}:: n
33   \textcolor{keywordtype}{logical}:: failed
34   \textcolor{keywordtype}{character(len = STRING)}:: fnam, vnam, vnambase
35 \textcolor{keywordflow}{continue}
36   \textcolor{keywordflow}{if} (file == \textcolor{stringliteral}{""}) \textcolor{keywordflow}{then}
37     fnam = \textcolor{stringliteral}{"gtool.nc"}
38   \textcolor{keywordflow}{else}
39     fnam = file
40 \textcolor{keywordflow}{  endif}
41   \textcolor{keywordflow}{if} (base == \textcolor{stringliteral}{""}) \textcolor{keywordflow}{then}
42     vnambase = \textcolor{stringliteral}{"tmp"}
43   \textcolor{keywordflow}{else}
44     vnambase = base
45 \textcolor{keywordflow}{  endif}
46   n = 0
47   \textcolor{keywordflow}{do}
48     n = n + 1
49     \textcolor{comment}{! compatibility note (2001-12-02, TOYODA Eizi)}
50     \textcolor{comment}{! dc\_string の toChar を使いたいのだが FQS Fortran が失敗する}
51     \textcolor{keyword}{write}(unit=vnam, fmt=\textcolor{stringliteral}{"(i32)"}) n
52     vnam = trim(vnambase) // trim(adjustl(vnam))
53     result = urlmerge(file=fnam, var=vnam)
54     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1open}{open}(var, result, writable=.false., err=failed)
55     \textcolor{keywordflow}{if} (failed) \textcolor{keywordflow}{return}
56     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1close}{close}(var)
57 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
