gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
historyautoclose.f90 File Reference

gtool_historyauto の終了処理 More...

Go to the source code of this file.

Functions/Subroutines

subroutine historyautoclose1

Detailed Description

gtool_historyauto の終了処理

Author
Yasuhiro MORIKAWA

Definition in file historyautoclose.f90.

Function/Subroutine Documentation

◆ historyautoclose1()

subroutine historyautoclose1

HistoryAutoCreate で始まったデータ出力の終了処理を行います.

HistoryAutoCreate で始まったデータ出力の終了処理を行います. プログラムを終了する前に必ずこのサブルーチンを呼んでください.

Definition at line 44 of file historyautoclose.f90.

60 use gtool_history, only: gt_history, historyclose, historyinitialized, &
61 & historyaxisclear, historyvarinfoclear
62 use dc_trace, only: beginsub, endsub
65 use dc_date, only: dcdifftimecreate
67 use dc_types, only: dp, string, token
68 implicit none
69
70 ! ヒストリファイルへのデータ出力設定
71 ! Configure the settings for history data output
72 !
73 character(STRING):: name = ''
74 ! 変数名. Variable identifier
75 character(TOKEN), pointer:: varnames_array(:) =>null()
76 ! 変数名リスト配列.
77 ! List of variables (array)
78 integer:: i, vnmax
79 type(GT_HISTORY), pointer:: gthist =>null()
80 ! gtool_history モジュール用構造体.
81 ! Derived type for "gtool_history" module
82
83 ! 作業変数
84 ! Work variables
85 !
86 integer:: stat
87 character(STRING):: cause_c
88 character(*), parameter:: subname = 'HistoryAutoClose1'
89 continue
90 call beginsub( subname )
91 stat = dc_noerr
92 cause_c = ''
93
94 ! 初期設定チェック
95 ! Check initialization
96 !
97 if ( .not. initialized ) then
98 stat = dc_enotinit
99 cause_c = 'gtool_historyauto'
100 goto 999
101 end if
102
103 ! ヒストリファイルへのデータ出力の終了処理
104 ! Terminate the settings for history data output
105 !
106 call hstnmlinfogetnames( gthstnml, & ! (in)
107 & varnames_array ) ! (out)
108 vnmax = size( varnames_array )
109
110 do i = 1, vnmax
111 name = varnames_array(i)
112 if ( trim( name ) == '' ) exit
113 nullify( gthist )
114 call hstnmlinfoassocgthist( &
115 & gthstnml = gthstnml, & ! (in)
116 & name = name, & ! (in)
117 & history = gthist ) ! (out)
118 if ( historyinitialized( gthist ) ) then
119 call historyclose( history = gthist ) ! (inout)
120 end if
121 end do
122
123 ! ヒストリファイルへのデータ出力設定の割付解除
124 ! Deallocate the settings for history data output
125 !
126 call hstnmlinfoclose( gthstnml ) ! (inout)
127
128 ! 座標軸情報のクリア
129 ! Create axes information
130 !
131 do i = 1, numdims
133 deallocate( data_axes(i) % a_axis )
134 end do
135 numdims = 0
136
137 ! 座標重み情報のクリア
138 ! Create axes weights information
139 !
140 do i = 1, numwgts
141 call historyvarinfoclear( gthst_weights(i) )
142 deallocate( data_weights(i) % a_axis )
143 end do
144 numwgts = 0
145
146 ! 変数情報のクリア
147 ! Create variables information
148 !
149 do i = 1, numvars
150 call historyvarinfoclear( gthst_vars(i) )
151
152 if ( associated( slice_vars(i) % st ) ) deallocate( slice_vars(i) % st )
153 if ( associated( slice_vars(i) % ed ) ) deallocate( slice_vars(i) % ed )
154 if ( associated( slice_vars(i) % sd ) ) deallocate( slice_vars(i) % sd )
155
156 if ( associated( weight_vars(i) % wgt1 ) ) deallocate( weight_vars(i) % wgt1 )
157
158 if ( associated( weight_vars(i) % wgt2 ) ) deallocate( weight_vars(i) % wgt2 )
159
160 if ( associated( weight_vars(i) % wgt3 ) ) deallocate( weight_vars(i) % wgt3 )
161
162 if ( associated( weight_vars(i) % wgt4 ) ) deallocate( weight_vars(i) % wgt4 )
163
164 if ( associated( weight_vars(i) % wgt5 ) ) deallocate( weight_vars(i) % wgt5 )
165
166 if ( associated( weight_vars(i) % wgt6 ) ) deallocate( weight_vars(i) % wgt6 )
167
168 if ( associated( weight_vars(i) % wgt7 ) ) deallocate( weight_vars(i) % wgt7 )
169
170
171 if ( associated( space_avr_vars(i) % avr ) ) deallocate( space_avr_vars(i) % avr )
172
173 varname_vars(i) = ''
174 output_valid_vars(i) = .false.
175 create_timing_vars(i,:) = .false.
176 close_timing_vars(i,:) = .false.
177 renew_timing_vars(i,:) = .false.
178 output_timing_vars(i,:) = .false.
179 output_timing_avr_vars(i,:) = .false.
180 tavr_vars(i) = .false.
181 interval_time_vars(i) = 0.0_dp
182 prev_outtime_vars(i) = 0.0_dp
183 origin_time_vars(i) = 0.0_dp
184 terminus_time_vars(i) = -1.0_dp
185 histaddvar_vars(i) = .false.
186 newfile_inttime_vars(i) = -1.0_dp
187 newfile_createtime_vars(i) = 0.0_dp
188
189!!$ ! dc_date 使用版
190!!$
191!!$ call DCDiffTimeCreate( interval_time_vars(i), & ! (out)
192!!$ & sec = 0.0_DP ) ! (in)
193!!$ call DCDiffTimeCreate( prev_outtime_vars(i), & ! (out)
194!!$ & sec = 0.0_DP ) ! (in)
195!!$ call DCDiffTimeCreate( origin_time_vars(i), & ! (out)
196!!$ & sec = 0.0_DP ) ! (in)
197!!$ call DCDiffTimeCreate( terminus_time_vars(i), & ! (out)
198!!$ & sec = -1.0_DP ) ! (in)
199!!$ histaddvar_vars(i) = .false.
200!!$ call DCDiffTimeCreate( newfile_inttime_vars(i), & ! (out)
201!!$ & sec = -1.0_DP ) ! (in)
202!!$ call DCDiffTimeCreate( newfile_createtime_vars(i), & ! (out)
203!!$ & sec = 0.0_DP ) ! (in)
204
205 end do
206 numvars = 0
207
208 ! 時間ステップに関する情報のクリア
209 ! Clear information about time steps
210 !
213 saved_tstep = 1
214
215 ! MPI に関する情報のクリア
216 ! Clear information about MPI
217 !
218 save_mpi_split = .false.
219 save_mpi_gather = .false.
220
221 ! 終了処理, 例外処理
222 ! Termination and Exception handling
223 !
224 initialized = .false.
225 flag_allvarfixed = .false.
226 all_output_save = .false.
229
230999 continue
231 call storeerror( stat, subname, cause_c = cause_c )
232 call endsub( subname )
subroutine historyaxisclear(axis)
subroutine historyclose(history, quiet, err)
日付・時刻に関する構造データ型と定数
日付および時刻に関する手続きを提供するモジュール
Definition dc_date.f90:57
エラー処理用モジュール
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public dc_enotinit
-400 以下: dc ユーティリティのエラー
Definition dc_error.f90:534
integer, parameter, public dc_noerr
エラー等を保持
Definition dc_error.f90:468
文字型変数の操作
Definition dc_string.f90:83
character(string) function, public joinchar(carray, expr)
デバッグ時の追跡用モジュール
Definition dc_trace.f90:150
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition dc_types.f90:128
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:92
type(axes_weight), dimension(1:max_vars), target, save, public weight_vars
logical, dimension(1:max_vars, 1:save_tstepnum), save, public close_timing_vars
type(gthst_nmlinfo), save, public gthstnml
logical, dimension(1:max_vars, 1:save_tstepnum), save, public create_timing_vars
character(token), dimension(1:max_vars), save, public varname_vars
real(dp), dimension(1:max_vars), save, public newfile_inttime_vars
type(space_avr_info), dimension(1:max_vars), target, save, public space_avr_vars
type(slice_info), dimension(1:max_vars), target, save, public slice_vars
real(dp), dimension(1:max_vars), save, public interval_time_vars
logical, dimension(1:max_vars, 1:save_tstepnum), save, public renew_timing_vars
character(token), save, public time_unit_bycreate
type(gt_history_varinfo), dimension(1:max_vars), save, public gthst_vars
logical, dimension(1:max_vars, 1:save_tstepnum), save, public output_timing_vars
real(dp), dimension(1:max_vars), save, public newfile_createtime_vars
real(dp), dimension(1:max_vars), save, public terminus_time_vars
logical, dimension(1:max_vars), save, public tavr_vars
logical, dimension(1:max_vars, 1:save_tstepnum), save, public output_timing_avr_vars
real(dp), dimension(1:max_vars), save, public prev_outtime_vars
type(gt_history_axis_data), dimension(1:nf90_max_dims), target, save, public data_weights
type(gt_history_varinfo), dimension(1:nf90_max_dims), save, public gthst_weights
real(dp), dimension(1:max_vars), save, public origin_time_vars
character(string), save, public time_unit_suffix
type(gt_history_axis), dimension(1:nf90_max_dims), target, save, public gthst_axes
type(gt_history_axis_data), dimension(1:nf90_max_dims), target, save, public data_axes
logical, dimension(1:max_vars), save, public output_valid_vars
logical, dimension(1:max_vars), save, public histaddvar_vars

References gtool_historyauto_internal::all_output_save, dc_trace::beginsub(), gtool_historyauto_internal::checked_tstep_varnum, gtool_historyauto_internal::checked_tstepnum, gtool_historyauto_internal::close_timing_vars, gtool_historyauto_internal::create_timing_vars, gtool_historyauto_internal::data_axes, gtool_historyauto_internal::data_weights, dc_error::dc_enotinit, dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), gtool_historyauto_internal::flag_allvarfixed, gtool_historyauto_internal::gthst_axes, gtool_historyauto_internal::gthst_vars, gtool_historyauto_internal::gthst_weights, gtool_historyauto_internal::gthstnml, gtool_historyauto_internal::histaddvar_vars, historyaxisclear(), historyclose(), gtool_historyauto_internal::initialized, gtool_historyauto_internal::interval_time_vars, dc_string::joinchar(), gtool_historyauto_internal::newfile_createtime_vars, gtool_historyauto_internal::newfile_inttime_vars, gtool_historyauto_internal::numdims, gtool_historyauto_internal::numvars, gtool_historyauto_internal::numwgts, gtool_historyauto_internal::origin_time_vars, gtool_historyauto_internal::output_timing_avr_vars, gtool_historyauto_internal::output_timing_vars, gtool_historyauto_internal::output_valid_vars, gtool_historyauto_internal::prev_outtime_vars, gtool_historyauto_internal::renew_timing_vars, gtool_historyauto_internal::save_mpi_gather, gtool_historyauto_internal::save_mpi_split, gtool_historyauto_internal::saved_tstep, gtool_historyauto_internal::slice_vars, gtool_historyauto_internal::space_avr_vars, dc_error::storeerror(), dc_types::string, gtool_historyauto_internal::tavr_vars, gtool_historyauto_internal::terminus_time_vars, gtool_historyauto_internal::time_unit_bycreate, gtool_historyauto_internal::time_unit_suffix, dc_types::token, gtool_historyauto_internal::varname_vars, and gtool_historyauto_internal::weight_vars.

Here is the call graph for this function: