gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
hstnmlinfoallnamevalid.f90
Go to the documentation of this file.
1!> @file hstnmlinfoallnamevalid.f90
2!>
3!> @author Yasuhiro MORIKAWA
4!> @copyright Copyright (C) GFD Dennou Club, 2007-2026. All rights reserved. <br/>
5!> License is BSD-2-Clause. See [COPYRIGHT](@ref COPYRIGHT) in detail
6!>
7!> @en
8!> @brief Check invalid variable names
9!> @enden
10!>
11!> @ja
12!> @brief 無効な変数名のチェック
13!> @endja
14
15 !> @en
16 !> @brief Check invalid variable names
17 !>
18 !> If variable names that are not set validation by
19 !> HstNmlInfoSetValidName exist,
20 !> .true. is set to @p invalid, and invalid variable names
21 !> are joined with comma, and set to @p names.
22 !>
23 !> If @p gthstnml is not initialized by HstNmlInfoCreate yet,
24 !> error is occurred.
25 !> @enden
26 !>
27 !> @ja
28 !> @brief 無効な変数名のチェック
29 !>
30 !> HstNmlInfoSetValidName によって, 有効性を設定されていない変数が
31 !> ある場合,
32 !> @p invalid に .true. を返し, @p names には無効な
33 !> 変数名をカンマで区切った文字列を返します.
34 !>
35 !> なお, 与えられた @p gthstnml が HstNmlInfoCreate によって初期設定
36 !> されていない場合, プログラムはエラーを発生させます.
37 !> @endja
38 !>
39 !> @param[in] gthstnml gtool_history_nmlinfo_types::GTHST_NMLINFO 型変数
40 !> @param[out] invalid 無効な変数名が存在する場合に .true.
41 !> If invalid variable names exist, .true. is returned.
42 !> @param[out] names 無効な変数名のリスト. List of invalid variable names.
43 !> @param[out] err 例外処理用フラグ. Exception handling flag.
44 subroutine hstnmlinfoallnamevalid( gthstnml, &
45 & invalid, &
46 & names, &
47 & err )
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 invalid variable names are exist,
60 ! .true. is returned.
61 !
62 character(*), intent(out):: names
63 ! 無効な変数名のリスト.
64 !
65 ! List of invalid 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 = 'HstNmlInfoAllNameValid'
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 ( hptr % name_invalid ) 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) )
129 end subroutine hstnmlinfoallnamevalid
subroutine hstnmlinfoallnamevalid(gthstnml, invalid, names, err)
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:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
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