gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
gtool_history_nmlinfo_internal.f90
Go to the documentation of this file.
1
14
25
26 use dc_hash, only: hash
27 implicit none
28 private
30
31 character(1), parameter, public:: name_delimiter = ','
32 ! 複数の変数名の区切り文字
33 ! Delimiter for multiple variable names
34
35 type(hash), save, public:: opened_files
36 ! 複数の変数を一つのファイルへ
37 ! 出力するためのチェック用変数.
38 !
39 ! Variables for checking for
40 ! output multiple variables to one file.
41
42 character(*), parameter, public:: version = &
43 & '$Name: $' // &
44 & '$Id: gtool_history_nmlinfo_internal.f90,v 1.1 2009-05-11 15:15:15 morikawa Exp $'
45
46 !-----------------------------------------------------------------
47 ! 非公開手続
48 ! Private procedures
49 !-----------------------------------------------------------------
50
51 interface listnext
52 module procedure hstnmlinfolistnext
53 end interface
54
55 interface listlast
56 module procedure hstnmlinfolistlast
57 end interface
58
59 interface listsearch
60 module procedure hstnmlinfolistsearch
61 end interface
62
63contains
64
93 subroutine hstnmlinfolistnext( &
94 & gthstnml_list, err )
96 use dc_trace, only: beginsub, endsub
97 use dc_error, only: storeerror, dc_noerr
98 use dc_types, only: string
99 implicit none
100 type(gthst_nmlinfo_entry), pointer:: gthstnml_list
101 ! (inout)
102 logical, intent(out), optional:: err
103 ! 例外処理用フラグ.
104 ! デフォルトでは, この手続き内でエラーが
105 ! 生じた場合, プログラムは強制終了します.
106 ! 引数 *err* が与えられる場合,
107 ! プログラムは強制終了せず, 代わりに
108 ! *err* に .true. が代入されます.
109 !
110 ! Exception handling flag.
111 ! By default, when error occur in
112 ! this procedure, the program aborts.
113 ! If this *err* argument is given,
114 ! .true. is substituted to *err* and
115 ! the program does not abort.
116
117 !-----------------------------------
118 ! 作業変数
119 ! Work variables
120 integer:: stat
121 character(STRING):: cause_c
122 character(*), parameter:: subname = 'HstNmlInfoListNext'
123 continue
124 call beginsub( subname )
125 stat = dc_noerr
126 cause_c = ''
127
128 !-----------------------------------------------------------------
129 ! 空状態の場合は何もしないで返す
130 ! If null, return without change
131 !-----------------------------------------------------------------
132 if ( .not. associated( gthstnml_list ) ) goto 999
133
134 !-----------------------------------------------------------------
135 ! 次のエントリに結合して返す
136 ! Next entry is associated, and returned
137 !-----------------------------------------------------------------
138 gthstnml_list => gthstnml_list % next
139
140 !-----------------------------------------------------------------
141 ! 終了処理, 例外処理
142 ! Termination and Exception handling
143 !-----------------------------------------------------------------
144999 continue
145 call storeerror( stat, subname, err, cause_c )
146 call endsub( subname )
147 end subroutine hstnmlinfolistnext
148
181 subroutine hstnmlinfolistlast( &
182 & gthstnml_list, previous, err )
184 use dc_trace, only: beginsub, endsub
185 use dc_error, only: storeerror, dc_noerr
186 use dc_types, only: string
187 implicit none
188 type(gthst_nmlinfo_entry), pointer:: gthstnml_list
189 ! (inout)
190 type(gthst_nmlinfo_entry), pointer, optional:: previous
191 ! (out)
192 logical, intent(out), optional:: err
193 ! 例外処理用フラグ.
194 ! デフォルトでは, この手続き内でエラーが
195 ! 生じた場合, プログラムは強制終了します.
196 ! 引数 *err* が与えられる場合,
197 ! プログラムは強制終了せず, 代わりに
198 ! *err* に .true. が代入されます.
199 !
200 ! Exception handling flag.
201 ! By default, when error occur in
202 ! this procedure, the program aborts.
203 ! If this *err* argument is given,
204 ! .true. is substituted to *err* and
205 ! the program does not abort.
206
207 !-----------------------------------
208 ! 作業変数
209 ! Work variables
210 integer:: stat
211 character(STRING):: cause_c
212 character(*), parameter:: subname = 'HstNmlInfoListLast'
213 continue
214 call beginsub( subname )
215 stat = dc_noerr
216 cause_c = ''
217
218 if ( present( previous ) ) nullify( previous )
219
220 !-----------------------------------------------------------------
221 ! 空状態の場合は何もしないで返す
222 ! If null, return without change
223 !-----------------------------------------------------------------
224 if ( .not. associated( gthstnml_list ) ) goto 999
225
226 !-----------------------------------------------------------------
227 ! 最後のエントリの *next* に結合して返す
228 ! "*next*" in last entry is associated, and returned
229 !-----------------------------------------------------------------
230 do while ( associated( gthstnml_list % next ) )
231 if ( present( previous ) ) previous => gthstnml_list
232 call listnext( gthstnml_list = gthstnml_list ) ! (inout)
233 end do
234
235 !-----------------------------------------------------------------
236 ! 終了処理, 例外処理
237 ! Termination and Exception handling
238 !-----------------------------------------------------------------
239999 continue
240 call storeerror( stat, subname, err, cause_c )
241 call endsub( subname )
242 end subroutine hstnmlinfolistlast
243
293 subroutine hstnmlinfolistsearch( &
294 & gthstnml_list, name, &
295 & previous, next, err )
297 use dc_trace, only: beginsub, endsub
298 use dc_error, only: storeerror, dc_noerr
299 use dc_types, only: string
300 implicit none
301 type(gthst_nmlinfo_entry), pointer:: gthstnml_list
302 ! (inout)
303 character(*), intent(in):: name
304 ! 変数名.
305 ! 先頭の空白は無視されます.
306 !
307 ! Variable identifier.
308 ! Blanks at the head of the name are ignored.
309 type(gthst_nmlinfo_entry), pointer, optional:: previous
310 ! (out)
311 type(gthst_nmlinfo_entry), pointer, optional:: next
312 ! (out)
313 logical, intent(out), optional:: err
314 ! 例外処理用フラグ.
315 ! デフォルトでは, この手続き内でエラーが
316 ! 生じた場合, プログラムは強制終了します.
317 ! 引数 *err* が与えられる場合,
318 ! プログラムは強制終了せず, 代わりに
319 ! *err* に .true. が代入されます.
320 !
321 ! Exception handling flag.
322 ! By default, when error occur in
323 ! this procedure, the program aborts.
324 ! If this *err* argument is given,
325 ! .true. is substituted to *err* and
326 ! the program does not abort.
327
328 !-----------------------------------
329 ! 作業変数
330 ! Work variables
331 integer:: stat
332 character(STRING):: cause_c
333 character(*), parameter:: subname = 'HstNmlInfoListSearch'
334 continue
335 call beginsub( subname )
336 stat = dc_noerr
337 cause_c = ''
338
339 !-----------------------------------------------------------------
340 ! 空状態の場合は何もしないで返す
341 ! If null, return without change
342 !-----------------------------------------------------------------
343 if ( .not. associated( gthstnml_list ) ) goto 999
344
345 !-----------------------------------------------------------------
346 ! 引数 *name* と同じ *name* を持つエントリを探査
347 ! The entry that has *name* that is same as argument *name* is searched
348 !-----------------------------------------------------------------
349 if ( present( previous ) ) nullify( previous )
350 if ( present( next ) ) nullify( next )
351 if ( trim( adjustl( gthstnml_list % name ) ) == trim( adjustl( name ) ) ) then
352 if ( present( next ) ) then
353 next => gthstnml_list % next
354 end if
355 goto 999
356 end if
357
358 do while ( associated( gthstnml_list ) )
359 if ( present( previous ) ) previous => gthstnml_list
360 call listnext( gthstnml_list = gthstnml_list ) ! (inout)
361 if ( .not. associated( gthstnml_list ) ) goto 999
362 if ( trim( adjustl( gthstnml_list % name ) ) == trim( adjustl( name ) ) ) then
363 if ( present( next ) ) then
364 next => gthstnml_list % next
365 end if
366 goto 999
367 end if
368 end do
369
370 !-----------------------------------------------------------------
371 ! 終了処理, 例外処理
372 ! Termination and Exception handling
373 !-----------------------------------------------------------------
374999 continue
375 call storeerror( stat, subname, err, cause_c )
376 call endsub( subname )
377 end subroutine hstnmlinfolistsearch
378
Error handling module.
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public dc_noerr
Error storage variables
Definition dc_error.f90:468
Hash (associative array) module.
Definition dc_hash.f90:143
Debug tracing module.
Definition dc_trace.f90:150
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:476
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:599
Provides kind type parameter values.
Definition dc_types.f90:55
integer, parameter, public string
Character length for string
Definition dc_types.f90:137
character(1), parameter, public name_delimiter