gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
gtool_history_nmlinfo_internal::listsearch Interface Reference

Public Member Functions

subroutine hstnmlinfolistsearch (gthstnml_list, name, previous, next, err)

Detailed Description

Definition at line 59 of file gtool_history_nmlinfo_internal.f90.

Member Function/Subroutine Documentation

◆ hstnmlinfolistsearch()

subroutine gtool_history_nmlinfo_internal::listsearch::hstnmlinfolistsearch ( type(gthst_nmlinfo_entry), pointer gthstnml_list,
character(*), intent(in) name,
type(gthst_nmlinfo_entry), optional, pointer previous,
type(gthst_nmlinfo_entry), optional, pointer next,
logical, intent(out), optional err )

名前でリストエントリを検索

リスト構造である gthstnml_list (GTHST_NMLINFO_ENTRY 型) を受け取り, 引数 name と同じ値を持つエントリに再結合して返します. 見つからない場合は空状態を返します. gthstnml_list が始めから空の場合には空状態を返します.

previous が与えられる場合, 当該エントリの一つ前の エントリに結合します. 前のエントリが無い場合には 空状態を返します.

next が与えられる場合, 当該エントリの一つ後ろの エントリに結合します. 後ろのエントリが無い場合には 空状態を返します.

Parameters
[in,out]gthstnml_listリストエントリポインタ
[in]name変数名 (先頭の空白は無視される)
[out]previous前のエントリポインタ (省略可能)
[out]next次のエントリポインタ (省略可能)
[out]err例外処理用フラグ (省略可能)

Definition at line 293 of file gtool_history_nmlinfo_internal.f90.

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 )
エラー処理用モジュール
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
エラー等を保持
Definition dc_error.f90:468
デバッグ時の追跡用モジュール
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
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137

References dc_trace::beginsub(), dc_error::dc_noerr, dc_trace::endsub(), dc_error::storeerror(), and dc_types::string.

Here is the call graph for this function:

The documentation for this interface was generated from the following file: