hstnmlinfoputline.f90
Go to the documentation of this file.
1 != GTHST_NMLINFO 型の変数に設定される情報の印字
2 != Print information of "GTHST_NMLINFO"
3 !
4 ! Authors:: Yasuhiro MORIKAWA
5 ! Version:: $Id: hstnmlinfoputline.f90,v 1.2 2009-05-31 12:08:02 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 hstnmlinfoputline( gthstnml, unit, indent, err )
11  !
12  ! 引数 *gthstnml* に設定されている情報を印字します.
13  ! デフォルトではメッセージは標準出力に出力されます.
14  ! *unit* に装置番号を指定することで, 出力先を変更することが可能です.
15  !
16  ! Print information of *gthstnml*.
17  ! By default messages are output to standard output.
18  ! Unit number for output can be changed by *unit* argument.
19  !
23  use dc_trace, only: beginsub, endsub
25  use dc_types, only: dp, string, token, stdout
27  implicit none
28  type(gthst_nmlinfo), intent(in):: gthstnml
29  integer, intent(in), optional:: unit
30  ! 出力先の装置番号.
31  ! デフォルトの出力先は標準出力.
32  !
33  ! Unit number for output.
34  ! Default value is standard output.
35  character(*), intent(in), optional:: indent
36  ! 表示されるメッセージの字下げ.
37  !
38  ! Indent of displayed messages.
39  logical, intent(out), optional:: err
40  ! 例外処理用フラグ.
41  ! デフォルトでは, この手続き内でエラーが
42  ! 生じた場合, プログラムは強制終了します.
43  ! 引数 *err* が与えられる場合,
44  ! プログラムは強制終了せず, 代わりに
45  ! *err* に .true. が代入されます.
46  !
47  ! Exception handling flag.
48  ! By default, when error occur in
49  ! this procedure, the program aborts.
50  ! If this *err* argument is given,
51  ! .true. is substituted to *err* and
52  ! the program does not abort.
53 
54  !-----------------------------------
55  ! 作業変数
56  ! Work variables
57  type(gthst_nmlinfo_entry), pointer:: hptr =>null()
58  integer:: stat
59  character(STRING):: cause_c
60  integer:: out_unit
61  integer:: indent_len
62  character(STRING):: indent_str
63  character(*), parameter:: subname = 'HstNmlInfoPutLine'
64  continue
65  call beginsub( subname )
66  stat = dc_noerr
67  cause_c = ''
68 
69  !-----------------------------------------------------------------
70  ! 初期設定のチェック
71  ! Check initialization
72  !-----------------------------------------------------------------
73  if ( present(unit) ) then
74  out_unit = unit
75  else
76  out_unit = stdout
77  end if
78 
79  indent_len = 0
80  indent_str = ''
81  if ( present(indent) ) then
82  if ( len(indent) /= 0 ) then
83  indent_len = len(indent)
84  indent_str(1:indent_len) = indent
85  end if
86  end if
87 
88  !-----------------------------------------------------------------
89  ! "GTHST_NMLINFO" の設定の印字
90  ! Print the settings for "GTHST_NMLINFO"
91  !-----------------------------------------------------------------
92  if ( gthstnml % initialized ) then
93  call printf( out_unit, &
94  & indent_str(1:indent_len) // &
95  & '#<GTHST_NMLINFO:: @initialized=%y define_mode=%y', &
96  & l = (/gthstnml % initialized, gthstnml % define_mode/) )
97 
98  hptr => gthstnml % gthstnml_list
99 
100  do while ( associated( hptr ) )
101 
102  call printf( out_unit, &
103  & indent_str(1:indent_len) // &
104  & ' #<GTHST_NMLINFO_ENTRY:: @name=%c @file=%c', &
105  & c1 = trim(hptr % name), &
106  & c2 = trim(hptr % file) )
107 
108  call printf( out_unit, &
109  & indent_str(1:indent_len) // &
110  & ' @interval_value=%r @interval_unit=%c', &
111  & r = (/hptr % interval_value/), &
112  & c1 = trim(hptr % interval_unit) )
113 
114  call printf( out_unit, &
115  & indent_str(1:indent_len) // &
116  & ' @output_step_disable=%y', &
117  & l = (/hptr % output_step_disable/) )
118 
119  call printf( out_unit, &
120  & indent_str(1:indent_len) // &
121  & ' @precision=%c @time_average=%y', &
122  & c1 = trim(hptr % precision), &
123  & l = (/ hptr % time_average /) )
124 
125  call printf( out_unit, &
126  & indent_str(1:indent_len) // &
127  & ' @fileprefix=%c', &
128  & c1 = trim(hptr % fileprefix) )
129 
130  call printf( out_unit, &
131  & indent_str(1:indent_len) // &
132  & ' @origin_value=%r @origin_unit=%c', &
133  & r = (/hptr % origin_value/), &
134  & c1 = trim(hptr % origin_unit) )
135 
136  call printf( out_unit, &
137  & indent_str(1:indent_len) // &
138  & ' @terminus_value=%r @terminus_unit=%c', &
139  & r = (/hptr % terminus_value/), &
140  & c1 = trim(hptr % terminus_unit) )
141 
142  call printf( out_unit, &
143  & indent_str(1:indent_len) // &
144  & ' @slice_start=%*d ...', &
145  & i = (/hptr % slice_start(1:10)/), n = (/ 10 /) )
146 
147  call printf( out_unit, &
148  & indent_str(1:indent_len) // &
149  & ' @slice_end=%*d ...', &
150  & i = (/hptr % slice_end(1:10)/), n = (/ 10 /) )
151 
152  call printf( out_unit, &
153  & indent_str(1:indent_len) // &
154  & ' @slice_stride=%*d ...', &
155  & i = (/hptr % slice_stride(1:10)/), n = (/ 10 /) )
156 
157  call printf( out_unit, &
158  & indent_str(1:indent_len) // &
159  & ' @space_average=%*b ...', &
160  & l = (/hptr % space_average(1:10)/), n =(/ 10 /) )
161 
162  call printf( out_unit, &
163  & indent_str(1:indent_len) // &
164  & ' @newfile_intvalue=%d @newfile_intunit=%c', &
165  & i = (/hptr % newfile_intvalue/), &
166  & c1 = trim(hptr % newfile_intunit) )
167 
168  if ( .not. gthstnml % define_mode ) then
169  call printf( out_unit, &
170  & indent_str(1:indent_len) // &
171  & ' @history=' )
172 
173  call historyputline( hptr % history, &
174  & unit = out_unit, &
175  & indent = indent_str(1:indent_len) // &
176  & ' ' )
177  end if
178 
179  call listnext( gthstnml_list = hptr ) ! (inout)
180  end do
181 
182  call printf( out_unit, &
183  & indent_str(1:indent_len) // &
184  & ' >' )
185 
186  call printf( out_unit, &
187  & indent_str(1:indent_len) // &
188  & '>' )
189  else
190  call printf( out_unit, &
191  & indent_str(1:indent_len) // &
192  & '#<GTHST_NMLINFO:: @initialized=%y>', &
193  & l = (/gthstnml % initialized/) )
194  end if
195 
196  !-----------------------------------------------------------------
197  ! 終了処理, 例外処理
198  ! Termination and Exception handling
199  !-----------------------------------------------------------------
200 999 continue
201  call storeerror( stat, subname, err, cause_c )
202  call endsub( subname )
203  end subroutine hstnmlinfoputline
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
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 hstnmlinfoputline(gthstnml, unit, indent, err)
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