gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
hstnmlinfoallvarinicheck.f90
Go to the documentation of this file.
1!> @file hstnmlinfoallvarinicheck.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 uninitialized variable names
9!> @enden
10!>
11!> @ja
12!> @brief 初期設定されていない変数名のチェック
13!> @endja
14
15 !> @en
16 !> @brief Check uninitialized variable names
17 !>
18 !> If uninitialized variable names exist,
19 !> .true. is set to @p invalid, and uninitialized variable names
20 !> are joined with comma, and set to @p names.
21 !>
22 !> If @p gthstnml is not initialized by HstNmlInfoCreate yet,
23 !> error is occurred.
24 !> @enden
25 !>
26 !> @ja
27 !> @brief 初期設定されていない変数名のチェック
28 !>
29 !> 初期設定されていない変数名がある場合,
30 !> @p invalid に .true. を返し, @p names には初期設定されていない
31 !> 変数名をカンマで区切った文字列を返します.
32 !>
33 !> なお, 与えられた @p gthstnml が HstNmlInfoCreate によって初期設定
34 !> されていない場合, プログラムはエラーを発生させます.
35 !> @endja
36 !>
37 !> @param[in] gthstnml gtool_history_nmlinfo_types::GTHST_NMLINFO 型変数
38 !> @param[out] invalid 初期設定されていない変数名が存在する場合に .true.
39 !> If uninitialized variable names exist, .true. is returned.
40 !> @param[out] names 初期設定されていない変数名のリスト.
41 !> List of uninitialized variable names.
42 !> @param[out] err 例外処理用フラグ. Exception handling flag.
43 subroutine hstnmlinfoallvarinicheck( gthstnml, &
44 & invalid, &
45 & names, &
46 & err )
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) )
129 end subroutine hstnmlinfoallvarinicheck
subroutine hstnmlinfoallvarinicheck(gthstnml, invalid, names, err)
エラー処理用モジュール
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:476
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:599
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137
character(1), parameter, public name_delimiter