gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
hstnmlinfoclose.f90
Go to the documentation of this file.
1!> @file hstnmlinfoclose.f90
2!>
3!> @author Yasuhiro MORIKAWA
4!> @copyright Copyright (C) GFD Dennou Club, 2007-2026. All rights reserved. <br/>
5!> License is BSD-2-Clause. See [COPYRIGHT](@ref COPYRIGHT) in detail
6!>
7!> @en
8!> @brief Destructor of gtool_history_nmlinfo_types::GTHST_NMLINFO
9!> @enden
10!>
11!> @ja
12!> @brief gtool_history_nmlinfo_types::GTHST_NMLINFO 型の変数の終了処理
13!> @endja
14
15 !> @en
16 !> @brief Destructor of gtool_history_nmlinfo_types::GTHST_NMLINFO
17 !>
18 !> Terminate all gtool_history_types::GT_HISTORY variables in @p gthstnml
19 !> by gtool_history_generic::HistoryClose before this subroutine is used.
20 !> If unterminated variables remain,
21 !> error is occurred.
22 !>
23 !> Note that if @p gthstnml is not initialized by HstNmlInfoCreate yet,
24 !> error is occurred.
25 !> @enden
26 !>
27 !> @ja
28 !> @brief gtool_history_nmlinfo_types::GTHST_NMLINFO 型の変数の終了処理
29 !>
30 !> このサブルーチンを使用する前に, @p gthstnml に格納されている
31 !> gtool_history_types::GT_HISTORY 型の全ての変数に対して,
32 !> gtool_history_generic::HistoryClose を用いて終了処理を行ってください.
33 !> 終了処理されていないものがある場合,
34 !> プログラムはエラーを発生させます.
35 !>
36 !> なお, 与えられた @p gthstnml が HstNmlInfoCreate によって初期設定
37 !> されていない場合, プログラムはエラーを発生させます.
38 !> @endja
39 !>
40 !> @param[inout] gthstnml gtool_history_nmlinfo_types::GTHST_NMLINFO 型変数
41 !> @param[out] err 例外処理用フラグ. Exception handling flag.
42 subroutine hstnmlinfoclose( gthstnml, err )
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 )
121 end subroutine hstnmlinfoclose
subroutine hstnmlinfoclose(gthstnml, err)
エラー処理用モジュール
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:661
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137