\hypertarget{hstnmlinfogetnames_8f90}{}\section{gtool/gtool\+\_\+history\+\_\+nmlinfo/hstnmlinfogetnames.f90 File Reference}
\label{hstnmlinfogetnames_8f90}\index{gtool/gtool\+\_\+history\+\_\+nmlinfo/hstnmlinfogetnames.\+f90@{gtool/gtool\+\_\+history\+\_\+nmlinfo/hstnmlinfogetnames.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{hstnmlinfogetnames_8f90_a13cf552d111261bee8ac183d4b0614d2}{hstnmlinfogetnames} (gthstnml, varnames\+\_\+ary, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{hstnmlinfogetnames_8f90_a13cf552d111261bee8ac183d4b0614d2}\label{hstnmlinfogetnames_8f90_a13cf552d111261bee8ac183d4b0614d2}} 
\index{hstnmlinfogetnames.\+f90@{hstnmlinfogetnames.\+f90}!hstnmlinfogetnames@{hstnmlinfogetnames}}
\index{hstnmlinfogetnames@{hstnmlinfogetnames}!hstnmlinfogetnames.\+f90@{hstnmlinfogetnames.\+f90}}
\subsubsection{\texorpdfstring{hstnmlinfogetnames()}{hstnmlinfogetnames()}}
{\footnotesize\ttfamily subroutine hstnmlinfogetnames (\begin{DoxyParamCaption}\item[{type(gthst\+\_\+nmlinfo), intent(in)}]{gthstnml,  }\item[{character(token), dimension(\+:), pointer}]{varnames\+\_\+ary,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 11 of file hstnmlinfogetnames.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+error\+::dc\+\_\+enotinit, dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+types\+::dp, dc\+\_\+trace\+::endsub(), dc\+\_\+string\+::joinchar(), dc\+\_\+types\+::stdout, dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, and dc\+\_\+types\+::token.


\begin{DoxyCode}
11     \textcolor{comment}{!}
12     \textcolor{comment}{! *gthstnml* が設定されている変数リストを文字型配列ポインタに}
13     \textcolor{comment}{! 返します. varnames\_ary は空状態にして与えてください.}
14     \textcolor{comment}{!}
15     \textcolor{comment}{! なお, 与えられた *gthstnml* が HstNmlInfoCreate によって初期設定}
16     \textcolor{comment}{! されていない場合, プログラムはエラーを発生させます.}
17     \textcolor{comment}{!}
18     \textcolor{comment}{! List of variables registered in *gthstnml* is returned to}
19     \textcolor{comment}{! character array pointer.}
20     \textcolor{comment}{! Nullify "varnames\_ary" before it is given to this subroutine.}
21     \textcolor{comment}{!}
22     \textcolor{comment}{! If *gthstnml* is not initialized by "HstNmlInfoCreate" yet,}
23     \textcolor{comment}{! error is occurred.}
24     \textcolor{comment}{!}
25     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__nmlinfo__types}{gtool\_history\_nmlinfo\_types}\textcolor{keywordtype}{, only}: 
      \hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo}{gthst\_nmlinfo}, \hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo__entry}{gthst\_nmlinfo\_entry}
26     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__nmlinfo__internal}{gtool\_history\_nmlinfo\_internal}\textcolor{keywordtype}{, only}: 
      \hyperlink{interfacegtool__history__nmlinfo__internal_1_1listsearch}{listsearch}, \hyperlink{interfacegtool__history__nmlinfo__internal_1_1listnext}{listnext}
27     \textcolor{keywordtype}{use }\hyperlink{namespacedc__trace}{dc\_trace}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}, \hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}
28     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1putline}{putline}, \hyperlink{interfacedc__string_1_1printf}{printf}, \hyperlink{interfacedc__string_1_1split}{split}, 
      \hyperlink{interfacedc__string_1_1strinclude}{strinclude}, \hyperlink{interfacedc__string_1_1stoa}{stoa}, \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}
29     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}, \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}, \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
30     \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}, 
      \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
31     \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: nf90\_max\_vars
32     \textcolor{keywordtype}{implicit none}
33     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo}{gthst\_nmlinfo}), \textcolor{keywordtype}{intent(in)}:: gthstnml
34     \textcolor{keywordtype}{character(TOKEN)}, \textcolor{keywordtype}{pointer}:: varnames\_ary(:) \textcolor{comment}{! (out)}
35     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
36                               \textcolor{comment}{! 例外処理用フラグ.}
37                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
38                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します.}
39                               \textcolor{comment}{! 引数 *err* が与えられる場合,}
40                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
41                               \textcolor{comment}{! *err* に .true. が代入されます.}
42                               \textcolor{comment}{!}
43                               \textcolor{comment}{! Exception handling flag.}
44                               \textcolor{comment}{! By default, when error occur in}
45                               \textcolor{comment}{! this procedure, the program aborts.}
46                               \textcolor{comment}{! If this *err* argument is given,}
47                               \textcolor{comment}{! .true. is substituted to *err* and}
48                               \textcolor{comment}{! the program does not abort.}
49 
50     \textcolor{comment}{!-----------------------------------}
51     \textcolor{comment}{!  作業変数}
52     \textcolor{comment}{!  Work variables}
53     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo__entry}{gthst\_nmlinfo\_entry}), \textcolor{keywordtype}{pointer}:: hptr =>null()
54     \textcolor{keywordtype}{integer}:: varnums, ary\_size
55     \textcolor{keywordtype}{character(TOKEN)}, \textcolor{keywordtype}{allocatable}:: varnames\_ary\_tmp1(:), varnames\_ary\_tmp2(:)
56     \textcolor{keywordtype}{integer}:: stat
57     \textcolor{keywordtype}{character(STRING)}:: cause\_c
58     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'HstNmlInfoNames'}
59   \textcolor{keywordflow}{continue}
60     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}( subname )
61     stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
62     cause\_c = \textcolor{stringliteral}{''}
63 
64     varnums = 0
65 
66     \textcolor{comment}{!-----------------------------------------------------------------}
67     \textcolor{comment}{!  初期設定のチェック}
68     \textcolor{comment}{!  Check initialization}
69     \textcolor{comment}{!-----------------------------------------------------------------}
70     \textcolor{keywordflow}{if} ( .not. gthstnml % initialized ) \textcolor{keywordflow}{then}
71       stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
72       cause\_c = \textcolor{stringliteral}{'GTHST\_NMLINFO'}
73       \textcolor{keywordflow}{goto} 999
74 \textcolor{keywordflow}{    end if}
75 
76     \textcolor{comment}{!-----------------------------------------------------------------}
77     \textcolor{comment}{!  割り付け}
78     \textcolor{comment}{!  Allocate}
79     \textcolor{comment}{!-----------------------------------------------------------------}
80     \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}(varnames\_ary) ) \textcolor{keyword}{deallocate}(varnames\_ary)
81     \textcolor{keyword}{allocate}( varnames\_ary\_tmp1(1:nf90\_max\_vars) )
82 
83     \textcolor{comment}{!-----------------------------------------------------------------}
84     \textcolor{comment}{!  情報の取り出し}
85     \textcolor{comment}{!  Fetch information}
86     \textcolor{comment}{!-----------------------------------------------------------------}
87     hptr => gthstnml % gthstnml\_list
88     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} ( \textcolor{keyword}{associated}( hptr % next ) )
89       \textcolor{keyword}{call }\hyperlink{interfacegtool__history__nmlinfo__internal_1_1listnext}{listnext}( gthstnml\_list = hptr ) \textcolor{comment}{! (inout)}
90       varnums = varnums + 1
91       ary\_size = \textcolor{keyword}{size}( varnames\_ary\_tmp1 )
92       \textcolor{keywordflow}{if} ( varnums > ary\_size ) \textcolor{keywordflow}{then}
93         \textcolor{keyword}{allocate}( varnames\_ary\_tmp2(1:ary\_size) )
94         varnames\_ary\_tmp2(1:ary\_size) = varnames\_ary\_tmp1(1:ary\_size)
95         \textcolor{keyword}{deallocate}( varnames\_ary\_tmp1 )
96         \textcolor{keyword}{allocate}( varnames\_ary\_tmp1(1:varnums*2) )
97         varnames\_ary\_tmp1(1:ary\_size) = varnames\_ary\_tmp2(1:ary\_size)
98         \textcolor{keyword}{deallocate}( varnames\_ary\_tmp2 )
99 \textcolor{keywordflow}{      end if}
100 
101       varnames\_ary\_tmp1(varnums) = adjustl( hptr % name )
102 \textcolor{keywordflow}{    end do}
103 
104     \textcolor{keywordflow}{if} ( varnums > 0 ) \textcolor{keywordflow}{then}
105       \textcolor{keyword}{allocate}( varnames\_ary(1:varnums) )
106       varnames\_ary(1:varnums) = varnames\_ary\_tmp1(1:varnums)
107     \textcolor{keywordflow}{else}
108       \textcolor{keyword}{allocate}( varnames\_ary(1:1) )
109       varnames\_ary = \textcolor{stringliteral}{''}
110 \textcolor{keywordflow}{    end if}
111 
112     \textcolor{comment}{!-----------------------------------------------------------------}
113     \textcolor{comment}{!  終了処理, 例外処理}
114     \textcolor{comment}{!  Termination and Exception handling}
115     \textcolor{comment}{!-----------------------------------------------------------------}
116 999 \textcolor{keywordflow}{continue}
117     \textcolor{keyword}{nullify}( hptr )
118     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}( stat, subname, err, cause\_c )
119     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}( subname )
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{hstnmlinfogetnames_8f90_a13cf552d111261bee8ac183d4b0614d2_cgraph}
\end{center}
\end{figure}
