\hypertarget{historyclose_8f90}{}\section{gtool/gtool\+\_\+history/historyclose.f90 File Reference}
\label{historyclose_8f90}\index{gtool/gtool\+\_\+history/historyclose.\+f90@{gtool/gtool\+\_\+history/historyclose.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{historyclose_8f90_a05bd27232ee951cef8bb19bd8a6f1a05}{historyclose} (history, quiet, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{historyclose_8f90_a05bd27232ee951cef8bb19bd8a6f1a05}\label{historyclose_8f90_a05bd27232ee951cef8bb19bd8a6f1a05}} 
\index{historyclose.\+f90@{historyclose.\+f90}!historyclose@{historyclose}}
\index{historyclose@{historyclose}!historyclose.\+f90@{historyclose.\+f90}}
\subsubsection{\texorpdfstring{historyclose()}{historyclose()}}
{\footnotesize\ttfamily subroutine historyclose (\begin{DoxyParamCaption}\item[{type(gt\+\_\+history), intent(inout), optional, target}]{history,  }\item[{logical, intent(in), optional}]{quiet,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



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



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), dc\+\_\+error\+::dc\+\_\+enotinit, dc\+\_\+error\+::dc\+\_\+noerr, gtool\+\_\+history\+\_\+internal\+::default, dc\+\_\+types\+::dp, dc\+\_\+trace\+::endsub(), dc\+\_\+present\+::present\+\_\+and\+\_\+true(), dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, and dc\+\_\+date\+\_\+types\+::unit\+\_\+symbol\+\_\+err.



Referenced by historyautoclose1(), historyautoputdouble0(), historyautoputdouble1(), historyautoputdouble2(), historyautoputdouble3(), historyautoputdouble4(), historyautoputdouble5(), historyautoputdouble6(), historyautoputdouble7(), historyautoputint0(), historyautoputint1(), historyautoputint2(), historyautoputint3(), historyautoputint4(), historyautoputint5(), historyautoputint6(), historyautoputint7(), historyautoputreal0(), historyautoputreal1(), historyautoputreal2(), historyautoputreal3(), historyautoputreal4(), historyautoputreal5(), historyautoputreal6(), historyautoputreal7(), hsclse(), and gtool\+\_\+historyauto\+\_\+internal\+::hstvarsoutputcheck().


\begin{DoxyCode}
11     \textcolor{comment}{!}
12     \textcolor{comment}{!== gtool4 データの終了処理}
13     \textcolor{comment}{!}
14     \textcolor{comment}{! HistoryCreate で始まったデータ出力の終了処理をおこなうものです.}
15     \textcolor{comment}{! プログラム内で HistoryCreate を用いた場合, プログラムを終了する}
16     \textcolor{comment}{! 前に必ずこのサブルーチンを呼んで下さい.}
17     \textcolor{comment}{!}
18     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__types}{gtool\_history\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}
19     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__internal}{gtool\_history\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}, 
      \hyperlink{interfacegtool__history__internal_1_1set__fake__dim__value}{set\_fake\_dim\_value}
20     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__generic}{gtool\_history\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtool__history__generic_1_1historyvarinfoclear}{historyvarinfoclear}
21     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__generic}{gtdata\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1close}{close}, \hyperlink{interfacegtdata__generic_1_1inquire}{inquire}
22     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}
23     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
24     \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__url_1_1urlsplit}{urlsplit}
25     \textcolor{keywordtype}{use }\hyperlink{namespacedc__present}{dc\_present}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}
26     \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}
27     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
28     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__date__types_a079bd1036fe904752c0423b145cdff22}{unit\_symbol\_err}
29     \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}
30     \textcolor{keywordtype}{implicit none}
31     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{intent(inout)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: history
32                               \textcolor{comment}{! 出力ファイルの設定に関する情報を}
33                               \textcolor{comment}{! 格納した構造体}
34                               \textcolor{comment}{! }
35                               \textcolor{comment}{! ここに指定するものは,}
36                               \textcolor{comment}{! HistoryCreate によって初期設定}
37                               \textcolor{comment}{! されていなければなりません.}
38                               \textcolor{comment}{! }
39     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: quiet
40                               \textcolor{comment}{! .true. を与えた場合, }
41                               \textcolor{comment}{! メッセージ出力が抑制されます. }
42                               \textcolor{comment}{!}
43                               \textcolor{comment}{! If ".true." is given, }
44                               \textcolor{comment}{! messages are suppressed. }
45                               \textcolor{comment}{! }
46     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
47                               \textcolor{comment}{! 例外処理用フラグ.}
48                               \textcolor{comment}{! デフォルトでは, この手続き内でエラーが}
49                               \textcolor{comment}{! 生じた場合, プログラムは強制終了します.}
50                               \textcolor{comment}{! 引数 *err* が与えられる場合,}
51                               \textcolor{comment}{! プログラムは強制終了せず, 代わりに}
52                               \textcolor{comment}{! *err* に .true. が代入されます.}
53                               \textcolor{comment}{!}
54                               \textcolor{comment}{! Exception handling flag. }
55                               \textcolor{comment}{! By default, when error occur in }
56                               \textcolor{comment}{! this procedure, the program aborts. }
57                               \textcolor{comment}{! If this *err* argument is given, }
58                               \textcolor{comment}{! .true. is substituted to *err* and }
59                               \textcolor{comment}{! the program does not abort. }
60     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{pointer}:: hst =>null()
61     \textcolor{keywordtype}{character(STRING)}:: url, file
62     \textcolor{keywordtype}{integer}:: i, v\_size
63     \textcolor{keywordtype}{integer}:: stat
64     \textcolor{keywordtype}{character(STRING)}:: cause\_c
65     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"HistoryClose"}
66   \textcolor{keywordflow}{continue}
67     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname)
68     stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
69     cause\_c = \textcolor{stringliteral}{""}
70 
71     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(history)) \textcolor{keywordflow}{then}
72       hst => history
73     \textcolor{keywordflow}{else}
74       hst => \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}
75 \textcolor{keywordflow}{    endif}
76 
77     \textcolor{comment}{!-----------------------------------------------------------------}
78     \textcolor{comment}{!  初期設定のチェック}
79     \textcolor{comment}{!  Check initialization}
80     \textcolor{comment}{!-----------------------------------------------------------------}
81     \textcolor{keywordflow}{if} ( .not. hst % initialized ) \textcolor{keywordflow}{then}
82       stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
83       cause\_c = \textcolor{stringliteral}{'GT\_HISTORY'}
84       \textcolor{keywordflow}{goto} 999
85 \textcolor{keywordflow}{    end if}
86 
87     \textcolor{comment}{!-----------------------------------------------------------------}
88     \textcolor{comment}{!  メッセージ出力用にファイル名取得}
89     \textcolor{comment}{!  Get filename for output messages}
90     \textcolor{comment}{!-----------------------------------------------------------------}
91 
92 
93 
94 
95 
96     \textcolor{keywordflow}{if} ( .not. \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}(quiet) ) \textcolor{keywordflow}{then}
97       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1inquire}{inquire}( hst % dimvars(1), & \textcolor{comment}{! (in)}
98         & url = url )                   \textcolor{comment}{! (out)}
99       \textcolor{keyword}{call }\hyperlink{interfacedc__url_1_1urlsplit}{urlsplit}( fullname = url, &  \textcolor{comment}{! (in)}
100         & file = file )                 \textcolor{comment}{! (out)}
101 \textcolor{keywordflow}{    end if}
102 
103 
104 
105 
106 
107     \textcolor{comment}{!-----------------------------------------------------------------}
108     \textcolor{comment}{!  変数のクローズ}
109     \textcolor{comment}{!  Close variables}
110     \textcolor{comment}{!-----------------------------------------------------------------}
111 
112 
113 
114 
115 
116     v\_size = \textcolor{keyword}{size}(hst % dimvars)
117     \textcolor{keywordflow}{do}, i = 1, v\_size
118       \textcolor{keywordflow}{if} (.not. hst % dim\_value\_written(i)) &
119         \textcolor{keyword}{call }\hyperlink{interfacegtool__history__internal_1_1set__fake__dim__value}{set\_fake\_dim\_value}(hst, i)
120       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1close}{close}(hst % dimvars(i))
121 \textcolor{keywordflow}{    enddo}
122     v\_size = \textcolor{keyword}{size}(hst % vars)
123     \textcolor{keywordflow}{do}, i = 1, v\_size
124       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1close}{close}(hst % vars(i))
125 \textcolor{keywordflow}{    enddo}
126 
127 
128 
129 
130 
131     \textcolor{keyword}{deallocate}(hst % dimvars)
132     v\_size = \textcolor{keyword}{size}(hst % vars)
133 
134     \textcolor{comment}{!-----------------------------------------------------------------}
135     \textcolor{comment}{!  設定のクリア}
136     \textcolor{comment}{!  Clear configurations}
137     \textcolor{comment}{!-----------------------------------------------------------------}
138     hst % unlimited\_index = 0
139     hst % unlimited\_units = \textcolor{stringliteral}{''}
140     hst % unlimited\_units\_symbol = \hyperlink{namespacedc__date__types_a079bd1036fe904752c0423b145cdff22}{unit\_symbol\_err}
141     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % dim\_value\_written)) \textcolor{keyword}{deallocate}(hst % dim\_value\_written)
142     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % vars)) \textcolor{keyword}{deallocate}(hst % vars)
143     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % growable\_indices)) \textcolor{keyword}{deallocate}(hst % growable\_indices)
144     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % count)) \textcolor{keyword}{deallocate}(hst % count)
145     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % var\_avr\_count)) \textcolor{keyword}{deallocate}(hst % var\_avr\_count)
146     \textcolor{keywordflow}{do}, i = 1, v\_size
147       \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % var\_avr\_data(i) % a\_DataAvr)) \textcolor{keyword}{deallocate}(hst % var\_avr\_data(i) % a\_DataAvr)
148 \textcolor{keywordflow}{    enddo}
149     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % var\_avr\_data)) \textcolor{keyword}{deallocate}(hst % var\_avr\_data)
150     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % var\_avr\_firstput)) \textcolor{keyword}{deallocate}(hst % var\_avr\_firstput)
151     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % var\_avr\_coefsum)) \textcolor{keyword}{deallocate}(hst % var\_avr\_coefsum)
152     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % var\_avr\_baseint)) \textcolor{keyword}{deallocate}(hst % var\_avr\_baseint)
153     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hst % var\_avr\_prevtime)) \textcolor{keyword}{deallocate}(hst % var\_avr\_prevtime)
154     hst % time\_bnds = 0.0\_dp
155     hst % time\_bnds\_output\_count = 0
156     hst % time\_nv\_index = 0
157     hst % origin\_setting = .false.
158 
159 
160     \textcolor{comment}{!-----------------------------------------------------------------}
161     \textcolor{comment}{!  メッセージ出力}
162     \textcolor{comment}{!  Output messages}
163     \textcolor{comment}{!-----------------------------------------------------------------}
164 
165 
166 
167 
168 
169     \textcolor{keywordflow}{if} ( .not. \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}(quiet) ) \textcolor{keywordflow}{then}
170       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'M'}, subname, &
171         & \textcolor{stringliteral}{'"%c" is closed'}, &
172         & c1 = trim( file ), rank\_mpi = -1 )
173 \textcolor{keywordflow}{    end if}
174 
175 
176 
177     \textcolor{comment}{!-----------------------------------------------------------------}
178     \textcolor{comment}{!  終了処理, 例外処理}
179     \textcolor{comment}{!  Termination and Exception handling}
180     \textcolor{comment}{!-----------------------------------------------------------------}
181     hst % initialized = .false.
182 999 \textcolor{keywordflow}{continue}
183     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}( stat, subname, err, cause\_c )
184     \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]{historyclose_8f90_a05bd27232ee951cef8bb19bd8a6f1a05_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{historyclose_8f90_a05bd27232ee951cef8bb19bd8a6f1a05_icgraph}
\end{center}
\end{figure}
