gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
Public Member Functions | List of all members
gtool_history_internal::append_attrs Interface Reference

Public Member Functions

subroutine append_attrs (varname, attrs, history)
 

Detailed Description

Definition at line 73 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 101 of file gtool_history_internal.f90.

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

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: