Loading...
Searching...
No Matches
hstnmlinforesetdefault.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine hstnmlinforesetdefault (gthstnml, err)

Function/Subroutine Documentation

◆ hstnmlinforesetdefault()

subroutine hstnmlinforesetdefault ( type(gthst_nmlinfo), intent(inout) gthstnml,
logical, intent(out), optional err )

Definition at line 10 of file hstnmlinforesetdefault.f90.

11 !
12 ! デフォルト値を残し, 登録したデータを削除します.
13 !
14 ! なお, 与えられた *gthstnml* が HstNmlInfoCreate によって初期設定
15 ! されていない場合, プログラムはエラーを発生させます.
16 !
17 ! Stored data is deleted without default settings.
18 !
19 ! If *gthstnml* is not initialized by "HstNmlInfoCreate" yet,
20 ! error is occurred.
21 !
24 use dc_trace, only: beginsub, endsub
25 use dc_string, only: putline, printf, split, strinclude, stoa, joinchar
26 use dc_types, only: dp, string, token, stdout
28 implicit none
29 type(GTHST_NMLINFO), intent(inout):: gthstnml
30 logical, intent(out), optional:: err
31 ! 例外処理用フラグ.
32 ! デフォルトでは, この手続き内でエラーが
33 ! 生じた場合, プログラムは強制終了します.
34 ! 引数 *err* が与えられる場合,
35 ! プログラムは強制終了せず, 代わりに
36 ! *err* に .true. が代入されます.
37 !
38 ! Exception handling flag.
39 ! By default, when error occur in
40 ! this procedure, the program aborts.
41 ! If this *err* argument is given,
42 ! .true. is substituted to *err* and
43 ! the program does not abort.
44
45 !-----------------------------------
46 ! 作業変数
47 ! Work variables
48 character(TOKEN), pointer:: varnames_array(:) =>null()
49 integer:: i, vnmax
50 integer:: stat
51 character(STRING):: cause_c
52 character(*), parameter:: subname = 'HstNmlInfoResetDefault'
53 continue
54 call beginsub( subname )
55 stat = dc_noerr
56 cause_c = ''
57
58 !-----------------------------------------------------------------
59 ! 初期設定のチェック
60 ! Check initialization
61 !-----------------------------------------------------------------
62 if ( .not. gthstnml % initialized ) then
63 stat = dc_enotinit
64 cause_c = 'GTHST_NMLINFO'
65 goto 999
66 end if
67
68 if ( .not. gthstnml % define_mode ) then
69 stat = hst_enotindefine
70 cause_c = 'ResetDefault'
71 goto 999
72 end if
73
74 !-----------------------------------------------------------------
75 ! 変数名リストの取得
76 ! Get varnames list
77 !-----------------------------------------------------------------
78 call hstnmlinfogetnames( gthstnml, & ! (in)
79 & varnames_array ) ! (out)
80 vnmax = size( varnames_array )
81
82 do i = 1, vnmax
83 call hstnmlinfodelete( &
84 & gthstnml = gthstnml, & ! (inout)
85 & name = varnames_array(i) ) ! (in)
86 end do
87
88 deallocate( varnames_array )
89
90 !-----------------------------------------------------------------
91 ! 終了処理, 例外処理
92 ! Termination and Exception handling
93 !-----------------------------------------------------------------
94999 continue
95 call storeerror( stat, subname, err, cause_c )
96 call endsub( subname )
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_noerr
Definition dc_error.f90:509
integer, parameter, public hst_enotindefine
Definition dc_error.f90:581
Provides kind type parameter values.
Definition dc_types.f90:49
integer, parameter, public token
Character length for word, token
Definition dc_types.f90:109
integer, parameter, public string
Character length for string
Definition dc_types.f90:118
integer, parameter, public stdout
Unit number for Standard OUTPUT
Definition dc_types.f90:98
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:83

References dc_error::dc_enotinit, dc_error::dc_noerr, dc_types::dp, dc_error::hst_enotindefine, dc_types::stdout, dc_error::storeerror(), dc_types::string, and dc_types::token.

Here is the call graph for this function: