hstnmlinfooutputstepdisable.f90
Go to the documentation of this file.
1 != HstNmlInfoOutputStep の無効化
2 != Invalidate "HstNmlInfoOutputStep"
3 !
4 ! Authors:: Yasuhiro MORIKAWA
5 ! Version:: $Id: hstnmlinfooutputstepdisable.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 hstnmlinfooutputstepdisable( gthstnml, &
11  & name, err )
12  !
13  ! このサブルーチンを使用すると, *name* に関して,
14  ! 以降は HstNmlInfoOutputStep が常に .false. を返すようになります.
15  !
16  ! データ出力間隔を出力の初期設定から変更し,
17  ! データを出力するたびに時刻を明示的に指定する場合に利用することを
18  ! 想定しています.
19  !
20  ! HstNmlInfoEndDefine で定義モードから出力モードに
21  ! 移行した後に呼び出してください.
22  ! HstNmlInfoEndDefine を呼ぶ前にこのサブルーチンを使用すると,
23  ! プログラムはエラーを発生させます.
24  !
25  ! *name* に関する情報が見当たらない場合,
26  ! プログラムはエラーを発生させます.
27  ! *name* が空文字の場合にも,
28  ! プログラムはエラーを発生させます.
29  !
30  ! なお, 与えられた *gthstnml* が HstNmlInfoCreate によって初期設定
31  ! されていない場合にも, プログラムはエラーを発生させます.
32  !
33  ! After this subroutine is used,
34  ! "HstNmlInfoOutputStep" returns .false. already
35  ! corresponding to the *name*.
36  !
37  ! This subroutine expected to use when
38  ! interval of data output is changed from initialization of output,
39  ! and time is specified explicitly whenever data is output.
40  !
41  ! Use after state is changed from define mode to
42  ! output mode by "HstNmlInfoEndDefine".
43  ! If this subroutine is used before
44  ! "HstNmlInfoEndDefine" is used, error is occurred.
45  !
46  ! When data correspond to *name* is not found, error is occurred.
47  ! When *name* is blank, error is occurred too.
48  !
49  ! If *gthstnml* is not initialized by "HstNmlInfoCreate" yet,
50  ! error is occurred.
51  !
54  use dc_trace, only: beginsub, endsub
56  use dc_types, only: dp, string, token, stdout
58  implicit none
59  type(gthst_nmlinfo), intent(in):: gthstnml
60  character(*), intent(in):: name
61  ! 変数名.
62  ! 先頭の空白は無視されます.
63  !
64  ! Variable identifier.
65  ! Blanks at the head of the name are ignored.
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 = 'HstNmlInfoOutputStepDisable'
88  continue
89  call beginsub( subname )
90  stat = dc_noerr
91  cause_c = ''
92 
93  !-----------------------------------------------------------------
94  ! 初期設定のチェック
95  ! Check initialization
96  !-----------------------------------------------------------------
97  if ( .not. gthstnml % initialized ) then
98  stat = dc_enotinit
99  cause_c = 'GTHST_NMLINFO'
100  goto 999
101  end if
102 
103  if ( trim( name ) == '' ) then
104  stat = hst_ebadname
105  cause_c = ''
106  goto 999
107  end if
108 
109  if ( gthstnml % define_mode ) then
110  stat = hst_eindefine
111  cause_c = 'OutputStepDisable'
112  goto 999
113  end if
114 
115  !-----------------------------------------------------------------
116  ! *gthstnml* 内から, *name* に関する history を探査.
117  ! Search "history" correspond to *name* in *gthstnml*
118  !-----------------------------------------------------------------
119  hptr => gthstnml % gthstnml_list
120  call listsearch( gthstnml_list = hptr, & ! (inout)
121  & name = name ) ! (in)
122 
123  if ( .not. associated( hptr ) ) then
124  stat = dc_enoentry
125  cause_c = adjustl( name )
126  goto 999
127  end if
128 
129  hptr % output_step_disable = .true.
130 
131  nullify( hptr )
132 
133  !-----------------------------------------------------------------
134  ! 終了処理, 例外処理
135  ! Termination and Exception handling
136  !-----------------------------------------------------------------
137 999 continue
138  call storeerror( stat, subname, err, cause_c )
139  call endsub( subname )
140  end subroutine hstnmlinfooutputstepdisable
subroutine hstnmlinfooutputstepdisable(gthstnml, name, err)
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
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public hst_eindefine
Definition: dc_error.f90:582
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 dc_enoentry
Definition: dc_error.f90:571
integer, parameter, public stdout
標準出力の装置番号
Definition: dc_types.f90:98
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
integer, parameter, public hst_ebadname
Definition: dc_error.f90:584
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