gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
hstnmlinforesetdefault.f90
Go to the documentation of this file.
1!> @file hstnmlinforesetdefault.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 Stored data is deleted without default settings
9!> @enden
10!>
11!> @ja
12!> @brief デフォルト値を残し, 登録したデータを削除
13!> @endja
14
15 !> @en
16 !> @brief Reset to default settings
17 !>
18 !> Stored data is deleted without default settings.
19 !>
20 !> If @p gthstnml is not initialized by HstNmlInfoCreate yet,
21 !> error is occurred.
22 !> @enden
23 !>
24 !> @ja
25 !> @brief デフォルト設定のみに戻す
26 !>
27 !> デフォルト値を残し, 登録したデータを削除します.
28 !>
29 !> なお, 与えられた @p gthstnml が HstNmlInfoCreate によって初期設定
30 !> されていない場合, プログラムはエラーを発生させます.
31 !> @endja
32 !>
33 !> @param[inout] gthstnml gtool_history_nmlinfo_types::GTHST_NMLINFO 型変数
34 !> @param[out] err 例外処理用フラグ. Exception handling flag.
35 subroutine hstnmlinforesetdefault( gthstnml, err )
38 use dc_trace, only: beginsub, endsub
39 use dc_types, only: string, token
41 implicit none
42 type(gthst_nmlinfo), intent(inout):: gthstnml
43 logical, intent(out), optional:: err
44 ! 例外処理用フラグ.
45 ! デフォルトでは, この手続き内でエラーが
46 ! 生じた場合, プログラムは強制終了します.
47 ! 引数 *err* が与えられる場合,
48 ! プログラムは強制終了せず, 代わりに
49 ! *err* に .true. が代入されます.
50 !
51 ! Exception handling flag.
52 ! By default, when error occur in
53 ! this procedure, the program aborts.
54 ! If this *err* argument is given,
55 ! .true. is substituted to *err* and
56 ! the program does not abort.
57
58 !-----------------------------------
59 ! 作業変数
60 ! Work variables
61 character(TOKEN), pointer:: varnames_array(:) =>null()
62 integer:: i, vnmax
63 integer:: stat
64 character(STRING):: cause_c
65 character(*), parameter:: subname = 'HstNmlInfoResetDefault'
66 continue
67 call beginsub( subname )
68 stat = dc_noerr
69 cause_c = ''
70
71 !-----------------------------------------------------------------
72 ! 初期設定のチェック
73 ! Check initialization
74 !-----------------------------------------------------------------
75 if ( .not. gthstnml % initialized ) then
76 stat = dc_enotinit
77 cause_c = 'GTHST_NMLINFO'
78 goto 999
79 end if
80
81 if ( .not. gthstnml % define_mode ) then
82 stat = hst_enotindefine
83 cause_c = 'ResetDefault'
84 goto 999
85 end if
86
87 !-----------------------------------------------------------------
88 ! 変数名リストの取得
89 ! Get varnames list
90 !-----------------------------------------------------------------
91 call hstnmlinfogetnames( gthstnml, & ! (in)
92 & varnames_array ) ! (out)
93 vnmax = size( varnames_array )
94
95 do i = 1, vnmax
96 call hstnmlinfodelete( &
97 & gthstnml = gthstnml, & ! (inout)
98 & name = varnames_array(i) ) ! (in)
99 end do
100
101 deallocate( varnames_array )
102
103 !-----------------------------------------------------------------
104 ! 終了処理, 例外処理
105 ! Termination and Exception handling
106 !-----------------------------------------------------------------
107999 continue
108 call storeerror( stat, subname, err, cause_c )
109 call endsub( subname )
110 end subroutine hstnmlinforesetdefault
subroutine hstnmlinforesetdefault(gthstnml, 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
integer, parameter, public hst_enotindefine
-500 or less: Data I/O layer errors
Definition dc_error.f90:557
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 token
Character length for word, token
Definition dc_types.f90:128
integer, parameter, public string
Character length for string
Definition dc_types.f90:137