hstnmlinforesetdefault.f90
Go to the documentation of this file.
1 != デフォルト値を残し, 登録したデータを削除
2 != Stored data is deleted without default settings
3 !
4 ! Authors:: Yasuhiro MORIKAWA
5 ! Version:: $Id: hstnmlinforesetdefault.f90,v 1.1 2009-05-11 15:15:14 morikawa Exp $
6 ! Tag Name:: $Name: $
7 ! Copyright:: Copyright (C) GFD Dennou Club, 2007-2009. All rights reserved.
8 ! License:: See COPYRIGHT[link:../../../COPYRIGHT]
9 !
10  subroutine hstnmlinforesetdefault( gthstnml, err )
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
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  !-----------------------------------------------------------------
94 999 continue
95  call storeerror( stat, subname, err, cause_c )
96  call endsub( subname )
97  end subroutine hstnmlinforesetdefault
integer, parameter, public hst_enotindefine
Definition: dc_error.f90:581
integer, parameter, public dc_enotinit
Definition: dc_error.f90:557
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition: dc_types.f90:109
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
subroutine hstnmlinforesetdefault(gthstnml, err)
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
integer, parameter, public stdout
標準出力の装置番号
Definition: dc_types.f90:98
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118