hstnmlinfoallnamevalid.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine hstnmlinfoallnamevalid (gthstnml, invalid, names, err)
 

Function/Subroutine Documentation

◆ hstnmlinfoallnamevalid()

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

Definition at line 14 of file hstnmlinfoallnamevalid.f90.

References dc_trace::beginsub(), dc_error::dc_earglack, dc_error::dc_enoentry, dc_error::dc_enotinit, dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), dc_string::joinchar(), gtool_history_nmlinfo_internal::name_delimiter, dc_present::present_and_not_empty(), dc_present::present_and_true(), dc_types::stdout, dc_error::storeerror(), dc_types::string, and dc_types::token.

14  !
15  ! 無効な変数名のチェック
16  !
17  ! HstNmlInfoSetValidName によって, 有効性を設定されていない変数が
18  ! ある場合,
19  ! *invalid* に .true. を返し, *names* には無効な
20  ! 変数名をカンマで区切った文字列を返します.
21  !
22  ! なお, 与えられた *gthstnml* が HstNmlInfoCreate によって初期設定
23  ! されていない場合, プログラムはエラーを発生させます.
24  !
25  ! Check invalid variable names
26  !
27  ! If variable names that are not set validation by
28  ! "HstNmlInfoSetValidName" are exist,
29  ! .true. is set to *invalid*, and invalid variable names
30  ! are joined with comma, and set to *names*.
31  !
32  ! If *gthstnml* is not initialized by "HstNmlInfoCreate" yet,
33  ! error is occurred.
34  !
39  use dc_trace, only: beginsub, endsub
42  use dc_types, only: dp, string, token, stdout
44  implicit none
45  type(gthst_nmlinfo), intent(in):: gthstnml
46  logical, intent(out):: invalid
47  ! 無効な変数名が存在する
48  ! 場合には .true. を返す.
49  !
50  ! If invalid variable names are exist,
51  ! .true. is returned.
52  !
53  character(*), intent(out):: names
54  ! 無効な変数名のリスト.
55  !
56  ! List of invalid variable names.
57  logical, intent(out), optional:: err
58  ! 例外処理用フラグ.
59  ! デフォルトでは, この手続き内でエラーが
60  ! 生じた場合, プログラムは強制終了します.
61  ! 引数 *err* が与えられる場合,
62  ! プログラムは強制終了せず, 代わりに
63  ! *err* に .true. が代入されます.
64  !
65  ! Exception handling flag.
66  ! By default, when error occur in
67  ! this procedure, the program aborts.
68  ! If this *err* argument is given,
69  ! .true. is substituted to *err* and
70  ! the program does not abort.
71 
72  !-----------------------------------
73  ! 作業変数
74  ! Work variables
75  type(gthst_nmlinfo_entry), pointer:: hptr =>null()
76  integer:: stat
77  character(STRING):: cause_c
78  character(*), parameter:: subname = 'HstNmlInfoAllNameValid'
79  continue
80  call beginsub( subname )
81  stat = dc_noerr
82  cause_c = ''
83 
84  names = ''
85  invalid = .false.
86 
87  !-----------------------------------------------------------------
88  ! 初期設定のチェック
89  ! Check initialization
90  !-----------------------------------------------------------------
91  if ( .not. gthstnml % initialized ) then
92  stat = dc_enotinit
93  cause_c = 'GTHST_NMLINFO'
94  goto 999
95  end if
96 
97  !-----------------------------------------------------------------
98  ! *gthstnml* 内から, *name* に関する情報を探査.
99  ! Search information correspond to *name* in *gthstnml*
100  !-----------------------------------------------------------------
101  hptr => gthstnml % gthstnml_list
102  do while ( associated( hptr % next ) )
103  call listnext( gthstnml_list = hptr ) ! (inout)
104 
105  if ( hptr % name_invalid ) then
106  invalid = .true.
107  if ( trim(names) /= '' ) names = trim(names) // name_delimiter
108  names = trim(names) // adjustl( hptr % name )
109  end if
110  end do
111 
112  !-----------------------------------------------------------------
113  ! 終了処理, 例外処理
114  ! Termination and Exception handling
115  !-----------------------------------------------------------------
116 999 continue
117  call storeerror( stat, subname, err, cause_c )
118  call endsub( subname, fmt = '@invalid=%y @names=%c', &
119  & l = (/ invalid /), c1 = trim(names) )
integer, parameter, public dc_earglack
Definition: dc_error.f90:569
integer, parameter, public dc_enotinit
Definition: dc_error.f90:557
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition: dc_types.f90:109
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character(1), parameter, public name_delimiter
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
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
logical function, public present_and_not_empty(arg)
Definition: dc_present.f90:276
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
integer, parameter, public dc_enoentry
Definition: dc_error.f90:571
integer, parameter, public stdout
標準出力の装置番号
Definition: dc_types.f90:98
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118
Here is the call graph for this function: