gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
hstnmlinfoallvarinicheck.f90 File Reference

Check uninitialized variable names . More...

Go to the source code of this file.

Functions/Subroutines

subroutine hstnmlinfoallvarinicheck (gthstnml, invalid, names, err)

Detailed Description

Check uninitialized variable names

.

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 )

Check uninitialized variable names

If uninitialized variable names exist, .true. is set to invalid, and uninitialized variable names are joined with comma, and set to names.

If gthstnml is not initialized by HstNmlInfoCreate yet, error is occurred.

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) )
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_enotinit
-400 or less: DC utilities errors
Definition dc_error.f90:534
integer, parameter, public dc_noerr
Error storage variables
Definition dc_error.f90:468
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

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: