gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
gtool_history_internal::append_attrs Interface Reference

Public Member Functions

subroutine append_attrs (varname, attrs, history)

Detailed Description

Definition at line 72 of file gtool_history_internal.f90.

Constructor & Destructor Documentation

◆ append_attrs()

subroutine gtool_history_internal::append_attrs::append_attrs ( character(*), intent(in) varname,
type(gt_history_attr), dimension(:), intent(in) attrs,
type(gt_history), intent(inout), optional, target history )

Definition at line 94 of file gtool_history_internal.f90.

95 !
96 ! GT_HISTORY_ATTR 変数を history の varname 変数に
97 ! 付加するためのサブルーチン. 公開用ではなく,
98 ! HistoryCreate や HistoryAddVariable に GT_HISTORY_AXIS
99 ! や GT_HISTORY_VARINFO が与えられた時に内部的に利用される.
100 !
102 use gtdata_generic, only: put_attr
104 use dc_string , only: strhead, lchar, tochar
106 implicit none
107 character(*), intent(in):: varname
108 type(GT_HISTORY_ATTR), intent(in):: attrs(:)
109 type(GT_HISTORY), intent(inout), target, optional:: history
110 type(GT_HISTORY), pointer:: hst =>null()
111 integer :: i
112 character(*), parameter:: subname = "append_attrs"
113 continue
114 call beginsub(subname, 'varname=<%c>, size(attrs(:))=<%d>', &
115 & c1=trim(varname), i=(/size(attrs(:))/))
116 if (present(history)) then
117 hst => history
118 else
119 hst => default
120 endif
121 ! attrs(:) のサイズ分だけループ
122 do i = 1, size( attrs(:) )
123 ! attrs(i)%attrtype の種別で与える変数を変える
124 if ( strhead( 'char', trim(lchar(attrs(i)%attrtype))) ) then
125 call historyaddattr( &
126 & varname, attrs(i)%attrname, &
127 & trim(attrs(i)%Charvalue), hst )
128 elseif ( strhead( 'int', trim(lchar(attrs(i)%attrtype))) ) then
129 if ( attrs(i)%array ) then
130 call dbgmessage('Intarray(:) is selected.')
131 call historyaddattr( &
132 & varname, attrs(i)%attrname , &
133 & attrs(i)%Intarray, hst )
134 else
135 call dbgmessage('Intvalue is selected')
136 call historyaddattr( &
137 & varname, attrs(i)%attrname , &
138 & attrs(i)%Intvalue, hst )
139 endif
140 elseif ( strhead( 'real', trim(lchar(attrs(i)%attrtype))) ) then
141 if ( attrs(i)%array ) then
142 call dbgmessage('Realarray(:) is selected.')
143 call historyaddattr( &
144 & varname, attrs(i)%attrname, attrs(i)%Realarray, hst)
145 else
146 call dbgmessage('Realvalue is selected')
147 call historyaddattr( &
148 & varname, attrs(i)%attrname, attrs(i)%Realvalue, hst)
149 endif
150 elseif ( strhead( 'double', trim(lchar(attrs(i)%attrtype))) ) then
151 if ( attrs(i)%array ) then
152 call dbgmessage('Doublearray(:) is selected.')
153 call historyaddattr( &
154 & varname, attrs(i)%attrname, attrs(i)%Doublearray, hst)
155 else
156 call dbgmessage('Doublevalue is selected')
157 call historyaddattr( &
158 & varname, attrs(i)%attrname, attrs(i)%Doublevalue, hst)
159 endif
160 elseif ( strhead( 'logical', trim(lchar(attrs(i)%attrtype))) ) then
161 call historyaddattr( &
162 & varname, attrs(i)%attrname, attrs(i)%Logicalvalue, hst)
163 else
164 call dbgmessage('attrtype=<%c>=<%c>is Invalid.' , &
165 & c1=trim(attrs(i)%attrtype) , &
166 & c2=trim(lchar(attrs(i)%attrtype)) )
167 endif
168 enddo
169 call endsub(subname)
文字型変数の操作
Definition dc_string.f90:83
デバッグ時の追跡用モジュール
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

References dc_trace::beginsub(), dc_trace::dbgmessage(), gtool_history_internal::default, and dc_trace::endsub().

Here is the call graph for this function:

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