gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
hstnmlinfoclose.f90 File Reference

gtool_history_nmlinfo_types::GTHST_NMLINFO 型の変数の終了処理 More...

Go to the source code of this file.

Functions/Subroutines

subroutine hstnmlinfoclose (gthstnml, err)

Detailed Description

gtool_history_nmlinfo_types::GTHST_NMLINFO 型の変数の終了処理

Author
Yasuhiro MORIKAWA

Definition in file hstnmlinfoclose.f90.

Function/Subroutine Documentation

◆ hstnmlinfoclose()

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

gtool_history_nmlinfo_types::GTHST_NMLINFO 型の変数の終了処理

このサブルーチンを使用する前に, gthstnml に格納されている gtool_history_types::GT_HISTORY 型の全ての変数に対して, gtool_history_generic::HistoryClose を用いて終了処理を行ってください. 終了処理されていないものがある場合, プログラムはエラーを発生させます.

なお, 与えられた gthstnml が HstNmlInfoCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.

Parameters
[in,out]gthstnmlgtool_history_nmlinfo_types::GTHST_NMLINFO 型変数
[out]err例外処理用フラグ. Exception handling flag.

Definition at line 42 of file hstnmlinfoclose.f90.

45 use gtool_history, only: historyinitialized
47 use dc_types, only: string
49 implicit none
50 type(GTHST_NMLINFO), intent(inout):: gthstnml
51 logical, intent(out), optional:: err
52 ! 例外処理用フラグ.
53 ! デフォルトでは, この手続き内でエラーが
54 ! 生じた場合, プログラムは強制終了します.
55 ! 引数 *err* が与えられる場合,
56 ! プログラムは強制終了せず, 代わりに
57 ! *err* に .true. が代入されます.
58 !
59 ! Exception handling flag.
60 ! By default, when error occur in
61 ! this procedure, the program aborts.
62 ! If this *err* argument is given,
63 ! .true. is substituted to *err* and
64 ! the program does not abort.
65
66 !-----------------------------------
67 ! 作業変数
68 ! Work variables
69 type(GTHST_NMLINFO_ENTRY), pointer:: hptr =>null()
70 type(GTHST_NMLINFO_ENTRY), pointer:: hptr_prev =>null()
71 integer:: stat
72 character(STRING):: cause_c
73 character(*), parameter:: subname = 'HstNmlInfoClose'
74 continue
75 call beginsub( subname )
76 stat = dc_noerr
77 cause_c = ''
78
79 !-----------------------------------------------------------------
80 ! 初期設定のチェック
81 ! Check initialization
82 !-----------------------------------------------------------------
83 if ( .not. gthstnml % initialized ) then
84 stat = dc_enotinit
85 cause_c = 'GTHST_NMLINFO'
86 goto 999
87 end if
88
89 !-----------------------------------------------------------------
90 ! "GTHST_NMLINFO" の設定の消去
91 ! Clear the settings for "GTHST_NMLINFO"
92 !-----------------------------------------------------------------
93 do
94 hptr => gthstnml % gthstnml_list
95 call listlast( gthstnml_list = hptr, & ! (inout)
96 & previous = hptr_prev ) ! (out)
97 call dbgmessage( 'remove entry (%c)', c1 = trim(hptr % name) )
98 if ( trim( hptr % name ) == '' ) exit
99 if ( .not. gthstnml % define_mode ) then
100 if ( historyinitialized( hptr % history ) ) then
101 stat = hst_enottermgthist
102 cause_c = hptr % name
103 goto 999
104 end if
105 end if
106 deallocate( hptr )
107 nullify( hptr_prev % next )
108 end do
109 deallocate( gthstnml % gthstnml_list )
110
111 !-----------------------------------------------------------------
112 ! 終了処理, 例外処理
113 ! Termination and Exception handling
114 !-----------------------------------------------------------------
115 gthstnml % initialized = .false.
116 gthstnml % define_mode = .true.
117999 continue
118 nullify( hptr )
119 call storeerror( stat, subname, err, cause_c )
120 call endsub( subname )
エラー処理用モジュール
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public hst_enottermgthist
Definition dc_error.f90:561
integer, parameter, public dc_enotinit
-400 以下: dc ユーティリティのエラー
Definition dc_error.f90:534
integer, parameter, public dc_noerr
エラー等を保持
Definition dc_error.f90:468
デバッグ時の追跡用モジュール
Definition dc_trace.f90:150
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:680
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:476
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:599
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137

References dc_trace::beginsub(), dc_trace::dbgmessage(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_trace::endsub(), dc_error::hst_enottermgthist, dc_error::storeerror(), and dc_types::string.

Here is the call graph for this function: