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


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{hstnmlinfoclose_8f90_a36edea2f05bede51d12f5ebf8a1696eb}\label{hstnmlinfoclose_8f90_a36edea2f05bede51d12f5ebf8a1696eb}} 
\index{hstnmlinfoclose.\+f90@{hstnmlinfoclose.\+f90}!hstnmlinfoclose@{hstnmlinfoclose}}
\index{hstnmlinfoclose@{hstnmlinfoclose}!hstnmlinfoclose.\+f90@{hstnmlinfoclose.\+f90}}
\subsubsection{\texorpdfstring{hstnmlinfoclose()}{hstnmlinfoclose()}}
{\footnotesize\ttfamily subroutine hstnmlinfoclose (\begin{DoxyParamCaption}\item[{type(gthst\+\_\+nmlinfo), intent(inout)}]{gthstnml,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



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



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


\begin{DoxyCode}
11     \textcolor{comment}{!}
12     \textcolor{comment}{! GTHST\_NMLINFO 型の変数の終了処理を行います. }
13     \textcolor{comment}{!}
14     \textcolor{comment}{! このサブルーチンを使用する前に, *gthstnml* に格納されている}
15     \textcolor{comment}{! gtool\_history\_types#GT\_HISTORY 型の全ての変数に対して, }
16     \textcolor{comment}{! gtool\_history\_generic#HistoryClose を用いて終了処理を行ってください. }
17     \textcolor{comment}{! 終了処理されていないものがある場合, }
18     \textcolor{comment}{! プログラムはエラーを発生させます. }
19     \textcolor{comment}{!}
20     \textcolor{comment}{! なお, 与えられた *gthstnml* が HstNmlInfoCreate によって初期設定}
21     \textcolor{comment}{! されていない場合, プログラムはエラーを発生させます. }
22     \textcolor{comment}{!}
23     \textcolor{comment}{! Deconstructor of "GTHST\_NMLINFO". }
24     \textcolor{comment}{!}
25     \textcolor{comment}{! Terminate all "gtool\_history\_types#GT\_HISTORY" variables in *gthstnml*}
26     \textcolor{comment}{! by "gtool\_history\_generic#HistoryClose" before this subroutine is used. }
27     \textcolor{comment}{! If unterminated variables remain, }
28     \textcolor{comment}{! error is occurred. }
29     \textcolor{comment}{!}
30     \textcolor{comment}{! Note that if *gthstnml* is not initialized by "HstNmlInfoCreate" yet, }
31     \textcolor{comment}{! error is occurred. }
32     \textcolor{comment}{!}
33     \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}
34     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__nmlinfo__internal}{gtool\_history\_nmlinfo\_internal}\textcolor{keywordtype}{, only}: 
      \hyperlink{interfacegtool__history__nmlinfo__internal_1_1listlast}{listlast}
35     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history}{gtool\_history}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtool__history__generic_1_1historyinitialized}{historyinitialized}
36     \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}
37     \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}
38     \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}
39     \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}, \hyperlink{namespacedc__error_a1b7f69a0e7281ba928f45ef08ec005ce}{hst\_enottermgthist}
40     \textcolor{keywordtype}{implicit none}
41     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo}{gthst\_nmlinfo}), \textcolor{keywordtype}{intent(inout)}:: gthstnml
42     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
43                               \textcolor{comment}{! 例外処理用フラグ. }
44                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
45                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します. }
46                               \textcolor{comment}{! 引数 *err* が与えられる場合, }
47                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
48                               \textcolor{comment}{! *err* に .true. が代入されます. }
49                               \textcolor{comment}{!}
50                               \textcolor{comment}{! Exception handling flag. }
51                               \textcolor{comment}{! By default, when error occur in }
52                               \textcolor{comment}{! this procedure, the program aborts. }
53                               \textcolor{comment}{! If this *err* argument is given, }
54                               \textcolor{comment}{! .true. is substituted to *err* and }
55                               \textcolor{comment}{! the program does not abort. }
56 
57     \textcolor{comment}{!-----------------------------------}
58     \textcolor{comment}{!  作業変数}
59     \textcolor{comment}{!  Work variables}
60     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo__entry}{gthst\_nmlinfo\_entry}), \textcolor{keywordtype}{pointer}:: hptr =>null()
61     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__nmlinfo__types_1_1gthst__nmlinfo__entry}{gthst\_nmlinfo\_entry}), \textcolor{keywordtype}{pointer}:: hptr\_prev =>null()
62     \textcolor{keywordtype}{integer}:: stat
63     \textcolor{keywordtype}{character(STRING)}:: cause\_c
64     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'HstNmlInfoClose'}
65   \textcolor{keywordflow}{continue}
66     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}( subname )
67     stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
68     cause\_c = \textcolor{stringliteral}{''}
69 
70     \textcolor{comment}{!-----------------------------------------------------------------}
71     \textcolor{comment}{!  初期設定のチェック}
72     \textcolor{comment}{!  Check initialization}
73     \textcolor{comment}{!-----------------------------------------------------------------}
74     \textcolor{keywordflow}{if} ( .not. gthstnml % initialized ) \textcolor{keywordflow}{then}
75       stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
76       cause\_c = \textcolor{stringliteral}{'GTHST\_NMLINFO'}
77       \textcolor{keywordflow}{goto} 999
78 \textcolor{keywordflow}{    end if}
79 
80     \textcolor{comment}{!-----------------------------------------------------------------}
81     \textcolor{comment}{!  "GTHST\_NMLINFO" の設定の消去}
82     \textcolor{comment}{!  Clear the settings for "GTHST\_NMLINFO"}
83     \textcolor{comment}{!-----------------------------------------------------------------}
84     \textcolor{keywordflow}{do} 
85       hptr => gthstnml % gthstnml\_list
86       \textcolor{keyword}{call }\hyperlink{interfacegtool__history__nmlinfo__internal_1_1listlast}{listlast}( gthstnml\_list = hptr, & \textcolor{comment}{! (inout)}
87         & previous = hptr\_prev )             \textcolor{comment}{! (out)}
88       \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}( \textcolor{stringliteral}{'remove entry (%c)'}, c1 = trim(hptr % name) )
89       \textcolor{keywordflow}{if} ( trim( hptr % name ) == \textcolor{stringliteral}{''} ) \textcolor{keywordflow}{exit}
90       \textcolor{keywordflow}{if} ( .not. gthstnml % define\_mode ) \textcolor{keywordflow}{then}
91         \textcolor{keywordflow}{if} ( \hyperlink{interfacegtool__history__generic_1_1historyinitialized}{historyinitialized}( hptr % history ) ) \textcolor{keywordflow}{then}
92           stat = \hyperlink{namespacedc__error_a1b7f69a0e7281ba928f45ef08ec005ce}{hst\_enottermgthist}
93           cause\_c = hptr % name
94           \textcolor{keywordflow}{goto} 999
95 \textcolor{keywordflow}{        end if}
96 \textcolor{keywordflow}{      end if}
97       \textcolor{keyword}{deallocate}( hptr )
98       \textcolor{keyword}{nullify}( hptr\_prev % next )
99 \textcolor{keywordflow}{    end do}
100     \textcolor{keyword}{deallocate}( gthstnml % gthstnml\_list )
101 
102     \textcolor{comment}{!-----------------------------------------------------------------}
103     \textcolor{comment}{!  終了処理, 例外処理}
104     \textcolor{comment}{!  Termination and Exception handling}
105     \textcolor{comment}{!-----------------------------------------------------------------}
106     gthstnml % initialized = .false.
107     gthstnml % define\_mode = .true.
108 999 \textcolor{keywordflow}{continue}
109     \textcolor{keyword}{nullify}( hptr )
110     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}( stat, subname, err, cause\_c )
111     \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]{hstnmlinfoclose_8f90_a36edea2f05bede51d12f5ebf8a1696eb_cgraph}
\end{center}
\end{figure}
