Loading...
Searching...
No Matches
Functions/Subroutines
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 10 of file hstnmlinfoallnamevalid.f90.

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 !
38 use gtool_history, only: historyinitialized
39 use dc_trace, only: beginsub, endsub
40 use dc_string, only: putline, printf, split, strinclude, stoa, joinchar
41 use dc_present, only: present_and_not_empty, present_and_true
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 !-----------------------------------------------------------------
116999 continue
117 call storeerror( stat, subname, err, cause_c )
118 call endsub( subname, fmt = '@invalid=%y @names=%c', &
119 & l = (/ invalid /), c1 = trim(names) )
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:830
integer, parameter, public dc_enotinit
Definition dc_error.f90:557
integer, parameter, public dc_earglack
Definition dc_error.f90:569
integer, parameter, public dc_noerr
Definition dc_error.f90:509
integer, parameter, public dc_enoentry
Definition dc_error.f90:571
Provides kind type parameter values.
Definition dc_types.f90:49
integer, parameter, public stdout
Unit number for Standard OUTPUT
Definition dc_types.f90:98
integer, parameter, public token
Character length for word, token
Definition dc_types.f90:109
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:83
integer, parameter, public string
Character length for string
Definition dc_types.f90:118
character(1), parameter, public name_delimiter

References dc_error::dc_earglack, dc_error::dc_enoentry, dc_error::dc_enotinit, dc_error::dc_noerr, dc_types::dp, gtool_history_nmlinfo_internal::name_delimiter, dc_types::stdout, dc_error::storeerror(), dc_types::string, and dc_types::token.

Here is the call graph for this function: