historyautoclose.f90
Go to the documentation of this file.
1 !--
2 ! *** Caution!! ***
3 !
4 ! This file is generated from "historyautoclose.rb2f90" by Ruby 2.3.3.
5 ! Please do not edit this file directly.
6 !
7 ! [JAPANESE]
8 !
9 ! ※※※ 注意!!! ※※※
10 !
11 ! このファイルは "historyautoclose.rb2f90" から Ruby 2.3.3
12 ! によって自動生成されたファイルです.
13 ! このファイルを直接編集しませんようお願い致します.
14 !
15 !
16 !++
17 !
18 != gtool_historyauto の終了処理
19 != Termination of gtool_historyauto
20 !
21 ! Authors:: Yasuhiro MORIKAWA
22 ! Version:: $Id: historyautoclose.rb2f90,v 1.3 2009-10-11 03:55:57 morikawa Exp $
23 ! Tag Name:: $Name: $
24 ! Copyright:: Copyright (C) GFD Dennou Club, 2008-2009. All rights reserved.
25 ! License:: See COPYRIGHT[link:../../../COPYRIGHT]
26 !
27  subroutine historyautoclose1
28  !
29  ! HistoryAutoCreate で始まったデータ出力の終了処理を行います.
30  ! プログラムを終了する前に必ずこのサブルーチンを呼んでください.
31  !
32  ! Terminates data output with "HistoryAutoCreate".
33  ! Call this subroutine certainly before a progrem is finished.
34  !
50  use gtool_history, only: gt_history, historyclose, historyinitialized, &
51  & historyaxisclear, historyvarinfoclear
52  use dc_trace, only: beginsub, endsub
55  use dc_date, only: dcdifftimecreate
57  use dc_types, only: dp, string, token
58  implicit none
59 
60  ! ヒストリファイルへのデータ出力設定
61  ! Configure the settings for history data output
62  !
63  character(STRING):: name = ''
64  ! 変数名. Variable identifier
65  character(TOKEN), pointer:: varnames_array(:) =>null()
66  ! 変数名リスト配列.
67  ! List of variables (array)
68  integer:: i, vnmax
69  type(gt_history), pointer:: gthist =>null()
70  ! gtool_history モジュール用構造体.
71  ! Derived type for "gtool_history" module
72 
73  ! 作業変数
74  ! Work variables
75  !
76  integer:: stat
77  character(STRING):: cause_c
78  character(*), parameter:: subname = 'HistoryAutoClose1'
79  continue
80  call beginsub( subname )
81  stat = dc_noerr
82  cause_c = ''
83 
84  ! 初期設定チェック
85  ! Check initialization
86  !
87  if ( .not. initialized ) then
88  stat = dc_enotinit
89  cause_c = 'gtool_historyauto'
90  goto 999
91  end if
92 
93  ! ヒストリファイルへのデータ出力の終了処理
94  ! Terminate the settings for history data output
95  !
96  call hstnmlinfogetnames( gthstnml, & ! (in)
97  & varnames_array ) ! (out)
98  vnmax = size( varnames_array )
99 
100  do i = 1, vnmax
101  name = varnames_array(i)
102  if ( trim( name ) == '' ) exit
103  nullify( gthist )
104  call hstnmlinfoassocgthist( &
105  & gthstnml = gthstnml, & ! (in)
106  & name = name, & ! (in)
107  & history = gthist ) ! (out)
108  if ( historyinitialized( gthist ) ) then
109  call historyclose( history = gthist ) ! (inout)
110  end if
111  end do
112 
113  ! ヒストリファイルへのデータ出力設定の割付解除
114  ! Deallocate the settings for history data output
115  !
116  call hstnmlinfoclose( gthstnml ) ! (inout)
117 
118  ! 座標軸情報のクリア
119  ! Create axes information
120  !
121  do i = 1, numdims
122  call historyaxisclear( gthst_axes(i) )
123  deallocate( data_axes(i) % a_axis )
124  end do
125  numdims = 0
126 
127  ! 座標重み情報のクリア
128  ! Create axes weights information
129  !
130  do i = 1, numwgts
131  call historyvarinfoclear( gthst_weights(i) )
132  deallocate( data_weights(i) % a_axis )
133  end do
134  numwgts = 0
135 
136  ! 変数情報のクリア
137  ! Create variables information
138  !
139  do i = 1, numvars
140  call historyvarinfoclear( gthst_vars(i) )
141 
142  if ( associated( slice_vars(i) % st ) ) deallocate( slice_vars(i) % st )
143  if ( associated( slice_vars(i) % ed ) ) deallocate( slice_vars(i) % ed )
144  if ( associated( slice_vars(i) % sd ) ) deallocate( slice_vars(i) % sd )
145 
146  if ( associated( weight_vars(i) % wgt1 ) ) deallocate( weight_vars(i) % wgt1 )
147 
148  if ( associated( weight_vars(i) % wgt2 ) ) deallocate( weight_vars(i) % wgt2 )
149 
150  if ( associated( weight_vars(i) % wgt3 ) ) deallocate( weight_vars(i) % wgt3 )
151 
152  if ( associated( weight_vars(i) % wgt4 ) ) deallocate( weight_vars(i) % wgt4 )
153 
154  if ( associated( weight_vars(i) % wgt5 ) ) deallocate( weight_vars(i) % wgt5 )
155 
156  if ( associated( weight_vars(i) % wgt6 ) ) deallocate( weight_vars(i) % wgt6 )
157 
158  if ( associated( weight_vars(i) % wgt7 ) ) deallocate( weight_vars(i) % wgt7 )
159 
160 
161  if ( associated( space_avr_vars(i) % avr ) ) deallocate( space_avr_vars(i) % avr )
162 
163  varname_vars(i) = ''
164  output_valid_vars(i) = .false.
165  create_timing_vars(i,:) = .false.
166  close_timing_vars(i,:) = .false.
167  renew_timing_vars(i,:) = .false.
168  output_timing_vars(i,:) = .false.
169  output_timing_avr_vars(i,:) = .false.
170  tavr_vars(i) = .false.
171  interval_time_vars(i) = 0.0_dp
172  prev_outtime_vars(i) = 0.0_dp
173  origin_time_vars(i) = 0.0_dp
174  terminus_time_vars(i) = -1.0_dp
175  histaddvar_vars(i) = .false.
176  newfile_inttime_vars(i) = -1.0_dp
177  newfile_createtime_vars(i) = 0.0_dp
178 
179 !!$ ! dc_date 使用版
180 !!$
181 !!$ call DCDiffTimeCreate( interval_time_vars(i), & ! (out)
182 !!$ & sec = 0.0_DP ) ! (in)
183 !!$ call DCDiffTimeCreate( prev_outtime_vars(i), & ! (out)
184 !!$ & sec = 0.0_DP ) ! (in)
185 !!$ call DCDiffTimeCreate( origin_time_vars(i), & ! (out)
186 !!$ & sec = 0.0_DP ) ! (in)
187 !!$ call DCDiffTimeCreate( terminus_time_vars(i), & ! (out)
188 !!$ & sec = -1.0_DP ) ! (in)
189 !!$ histaddvar_vars(i) = .false.
190 !!$ call DCDiffTimeCreate( newfile_inttime_vars(i), & ! (out)
191 !!$ & sec = -1.0_DP ) ! (in)
192 !!$ call DCDiffTimeCreate( newfile_createtime_vars(i), & ! (out)
193 !!$ & sec = 0.0_DP ) ! (in)
194 
195  end do
196  numvars = 0
197 
198  ! 時間ステップに関する情報のクリア
199  ! Clear information about time steps
200  !
201  checked_tstepnum = 0
203  saved_tstep = 1
204 
205  ! MPI に関する情報のクリア
206  ! Clear information about MPI
207  !
208  save_mpi_split = .false.
209  save_mpi_gather = .false.
210 
211  ! 終了処理, 例外処理
212  ! Termination and Exception handling
213  !
214  initialized = .false.
215  flag_allvarfixed = .false.
216  all_output_save = .false.
217  time_unit_bycreate = ''
218  time_unit_suffix = ''
219 
220 999 continue
221  call storeerror( stat, subname, cause_c = cause_c )
222  call endsub( subname )
223  end subroutine historyautoclose1
224 
225 !--
226 ! vi:set readonly sw=4 ts=8:
227 !
228 !Local Variables:
229 !mode: f90
230 !buffer-read-only: t
231 !End:
232 !
233 !++
subroutine historyaxisclear(axis)
character(string), save, public time_unit_suffix
type(slice_info), dimension(1:max_vars), target, save, public slice_vars
integer, parameter, public dc_enotinit
Definition: dc_error.f90:557
real(dp), dimension(1:max_vars), save, public newfile_inttime_vars
logical, dimension(1:max_vars, 1:save_tstepnum), save, public renew_timing_vars
real(dp), dimension(1:max_vars), save, public interval_time_vars
type(space_avr_info), dimension(1:max_vars), target, save, public space_avr_vars
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition: dc_types.f90:109
real(dp), dimension(1:max_vars), save, public terminus_time_vars
logical, dimension(1:max_vars, 1:save_tstepnum), save, public output_timing_vars
type(gt_history_axis_data), dimension(1:nf90_max_dims), target, save, public data_weights
logical, dimension(1:max_vars, 1:save_tstepnum), save, public output_timing_avr_vars
type(gt_history_varinfo), dimension(1:max_vars), save, public gthst_vars
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
type(gt_history_varinfo), dimension(1:nf90_max_dims), save, public gthst_weights
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
type(gt_history_axis_data), dimension(1:nf90_max_dims), target, save, public data_axes
real(dp), dimension(1:max_vars), save, public origin_time_vars
subroutine historyclose(history, quiet, err)
type(gt_history_axis), dimension(1:nf90_max_dims), target, save, public gthst_axes
logical, dimension(1:max_vars, 1:save_tstepnum), save, public create_timing_vars
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
character(token), dimension(1:max_vars), save, public varname_vars
real(dp), dimension(1:max_vars), save, public prev_outtime_vars
logical, dimension(1:max_vars), save, public histaddvar_vars
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
character(token), save, public time_unit_bycreate
type(gthst_nmlinfo), save, public gthstnml
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
logical, dimension(1:max_vars), save, public tavr_vars
type(axes_weight), dimension(1:max_vars), target, save, public weight_vars
logical, dimension(1:max_vars), save, public output_valid_vars
real(dp), dimension(1:max_vars), save, public newfile_createtime_vars
logical, dimension(1:max_vars, 1:save_tstepnum), save, public close_timing_vars
subroutine historyautoclose1
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118