Loading...
Searching...
No Matches
gtool_history_nmlinfo_internal::listsearch Interface Reference

Public Member Functions

subroutine hstnmlinfolistsearch (gthstnml_list, name, previous, next, err)

Detailed Description

Definition at line 51 of file gtool_history_nmlinfo_internal.f90.

Member Function/Subroutine Documentation

◆ hstnmlinfolistsearch()

subroutine gtool_history_nmlinfo_internal::listsearch::hstnmlinfolistsearch ( type(gthst_nmlinfo_entry), pointer gthstnml_list,
character(*), intent(in) name,
type(gthst_nmlinfo_entry), optional, pointer previous,
type(gthst_nmlinfo_entry), optional, pointer next,
logical, intent(out), optional err )

Definition at line 206 of file gtool_history_nmlinfo_internal.f90.

209 !
210 ! リスト構造である *gthstnml_list* (GTHST_NMLINFO_ENTRY 型) を受け取り,
211 ! 引数 *name* と同じ値を持つエントリに再結合して返します.
212 ! 見つからない場合は空状態を返します.
213 ! *gthstnml_list* が始めから空の場合には空状態を返します.
214 !
215 ! *previous* が与えられる場合, 当該エントリの一つ前の
216 ! エントリに結合します. 前のエントリが無い場合には
217 ! 空状態を返します.
218 !
219 ! *next* が与えられる場合, 当該エントリの一つ後ろの
220 ! エントリに結合します. 後ろのエントリが無い場合には
221 ! 空状態を返します.
222 !
223 ! *gthstnml_list* (type "GTHST_NMLINFO_ENTRY") that is a list structure
224 ! is recieved, and *gthstnml_list* is reassociated to
225 ! the entry that has a value that is same as argument *name*,
226 ! and returned.
227 ! If the entry is not found, null is returned.
228 ! If *gthstnml_list* is null from the beginning, null is returned.
229 !
230 ! If *previous* is given, an entry previous to the above entry
231 ! is associated. If previous entries are not found,
232 ! null is returned.
233 !
234 ! If *next* is given, an entry next to the above entry
235 ! is associated. If next entries are not found,
236 ! null is returned.
237 !
239 use dc_trace, only: beginsub, endsub
240 use dc_error, only: storeerror, dc_noerr
241 use dc_types, only: token, string
242 implicit none
243 type(GTHST_NMLINFO_ENTRY), pointer:: gthstnml_list
244 ! (inout)
245 character(*), intent(in):: name
246 ! 変数名.
247 ! 先頭の空白は無視されます.
248 !
249 ! Variable identifier.
250 ! Blanks at the head of the name are ignored.
251 type(GTHST_NMLINFO_ENTRY), pointer, optional:: previous
252 ! (out)
253 type(GTHST_NMLINFO_ENTRY), pointer, optional:: next
254 ! (out)
255 logical, intent(out), optional:: err
256 ! 例外処理用フラグ.
257 ! デフォルトでは, この手続き内でエラーが
258 ! 生じた場合, プログラムは強制終了します.
259 ! 引数 *err* が与えられる場合,
260 ! プログラムは強制終了せず, 代わりに
261 ! *err* に .true. が代入されます.
262 !
263 ! Exception handling flag.
264 ! By default, when error occur in
265 ! this procedure, the program aborts.
266 ! If this *err* argument is given,
267 ! .true. is substituted to *err* and
268 ! the program does not abort.
269
270 !-----------------------------------
271 ! 作業変数
272 ! Work variables
273 integer:: stat
274 character(STRING):: cause_c
275 character(*), parameter:: subname = 'HstNmlInfoListSearch'
276 continue
277 call beginsub( subname )
278 stat = dc_noerr
279 cause_c = ''
280
281 !-----------------------------------------------------------------
282 ! 空状態の場合は何もしないで返す
283 ! If null, return without change
284 !-----------------------------------------------------------------
285 if ( .not. associated( gthstnml_list ) ) goto 999
286
287 !-----------------------------------------------------------------
288 ! 引数 *name* と同じ *name* を持つエントリを探査
289 ! The entry that has *name* that is same as argument *name* is searched
290 !-----------------------------------------------------------------
291 if ( present( previous ) ) nullify( previous )
292 if ( present( next ) ) nullify( next )
293 if ( trim( adjustl( gthstnml_list % name ) ) == trim( adjustl( name ) ) ) then
294 if ( present( next ) ) then
295 next => gthstnml_list % next
296 end if
297 goto 999
298 end if
299
300 do while ( associated( gthstnml_list ) )
301 if ( present( previous ) ) previous => gthstnml_list
302 call listnext( gthstnml_list = gthstnml_list ) ! (inout)
303 if ( .not. associated( gthstnml_list ) ) goto 999
304 if ( trim( adjustl( gthstnml_list % name ) ) == trim( adjustl( name ) ) ) then
305 if ( present( next ) ) then
306 next => gthstnml_list % next
307 end if
308 goto 999
309 end if
310 end do
311
312 !-----------------------------------------------------------------
313 ! 終了処理, 例外処理
314 ! Termination and Exception handling
315 !-----------------------------------------------------------------
316999 continue
317 call storeerror( stat, subname, err, cause_c )
318 call endsub( subname )
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
種別型パラメタを提供します。
Definition dc_types.f90:49
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition dc_types.f90:109
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:118

References dc_error::dc_noerr, dc_error::storeerror(), dc_types::string, and dc_types::token.

Here is the call graph for this function:

The documentation for this interface was generated from the following file: