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

初期設定されていない変数名のチェック More...

Go to the source code of this file.

Functions/Subroutines

subroutine hstnmlinfoallvarinicheck (gthstnml, invalid, names, err)

Detailed Description

初期設定されていない変数名のチェック

Author
Yasuhiro MORIKAWA

Definition in file hstnmlinfoallvarinicheck.f90.

Function/Subroutine Documentation

◆ hstnmlinfoallvarinicheck()

subroutine hstnmlinfoallvarinicheck ( type(gthst_nmlinfo), intent(in) gthstnml,
logical, intent(out) invalid,
character(*), intent(out) names,
logical, intent(out), optional err )

初期設定されていない変数名のチェック

初期設定されていない変数名がある場合, invalid に .true. を返し, names には初期設定されていない 変数名をカンマで区切った文字列を返します.

なお, 与えられた gthstnml が HstNmlInfoCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.

Parameters
[in]gthstnmlgtool_history_nmlinfo_types::GTHST_NMLINFO 型変数
[out]invalid初期設定されていない変数名が存在する場合に .true. If uninitialized variable names exist, .true. is returned.
[out]names初期設定されていない変数名のリスト. List of uninitialized variable names.
[out]err例外処理用フラグ. Exception handling flag.

Definition at line 43 of file hstnmlinfoallvarinicheck.f90.

49 use gtool_history, only: historyinitialized
50 use dc_trace, only: beginsub, endsub
51 use dc_types, only: string
53 implicit none
54 type(GTHST_NMLINFO), intent(in):: gthstnml
55 logical, intent(out):: invalid
56 ! 初期設定されていない変数名が存在する
57 ! 場合には .true. を返す.
58 !
59 ! If uninitialized variable names are exist,
60 ! .true. is returned.
61 !
62 character(*), intent(out):: names
63 ! 初期設定されていない変数名のリスト.
64 !
65 ! List of uninitialized variable names.
66 logical, intent(out), optional:: err
67 ! 例外処理用フラグ.
68 ! デフォルトでは, この手続き内でエラーが
69 ! 生じた場合, プログラムは強制終了します.
70 ! 引数 *err* が与えられる場合,
71 ! プログラムは強制終了せず, 代わりに
72 ! *err* に .true. が代入されます.
73 !
74 ! Exception handling flag.
75 ! By default, when error occur in
76 ! this procedure, the program aborts.
77 ! If this *err* argument is given,
78 ! .true. is substituted to *err* and
79 ! the program does not abort.
80
81 !-----------------------------------
82 ! 作業変数
83 ! Work variables
84 type(GTHST_NMLINFO_ENTRY), pointer:: hptr =>null()
85 integer:: stat
86 character(STRING):: cause_c
87 character(*), parameter:: subname = 'HstNmlInfoAllVarIniCheck'
88 continue
89 call beginsub( subname )
90 stat = dc_noerr
91 cause_c = ''
92
93 names = ''
94 invalid = .false.
95
96 !-----------------------------------------------------------------
97 ! 初期設定のチェック
98 ! Check initialization
99 !-----------------------------------------------------------------
100 if ( .not. gthstnml % initialized ) then
101 stat = dc_enotinit
102 cause_c = 'GTHST_NMLINFO'
103 goto 999
104 end if
105
106 !-----------------------------------------------------------------
107 ! *gthstnml* 内から, *name* に関する情報を探査.
108 ! Search information correspond to *name* in *gthstnml*
109 !-----------------------------------------------------------------
110 hptr => gthstnml % gthstnml_list
111 do while ( associated( hptr % next ) )
112 call listnext( gthstnml_list = hptr ) ! (inout)
113
114 if ( .not. historyinitialized( hptr % history ) ) then
115 invalid = .true.
116 if ( trim(names) /= '' ) names = trim(names) // name_delimiter
117 names = trim(names) // adjustl( hptr % name )
118 end if
119 end do
120
121 !-----------------------------------------------------------------
122 ! 終了処理, 例外処理
123 ! Termination and Exception handling
124 !-----------------------------------------------------------------
125999 continue
126 call storeerror( stat, subname, err, cause_c )
127 call endsub( subname, fmt = '@invalid=%y @names=%c', &
128 & l = (/ invalid /), c1 = trim(names) )
エラー処理用モジュール
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_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 string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137
character(1), parameter, public name_delimiter

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

Here is the call graph for this function: