168
169 class(BudgetObjectType) :: this
170 integer(I4B), intent(in) :: iout
171 character(len=*), intent(in), optional :: cellids
172
173 character(len=LINELENGTH) :: title
174 character(len=LINELENGTH) :: text
175 character(len=LENBUDTXT) :: flowtype
176 character(len=LENBUDTXT) :: tag
177 character(len=LENBUDTXT) :: coupletype
178 logical :: lfound
179 logical :: add_cellids
180 integer(I4B) :: maxcol
181 integer(I4B) :: idx
182 integer(I4B) :: ipos
183 integer(I4B) :: i
184
185
186 if (present(cellids)) then
187 add_cellids = .true.
188 coupletype = cellids
189 else
190 add_cellids = .false.
191 end if
192
193
194 allocate (this%add_cellids)
195 allocate (this%icellid)
196 allocate (this%nflowterms)
197
198
199 this%add_cellids = add_cellids
200 this%nflowterms = 0
201 this%icellid = 0
202
203
204 maxcol = 3
205 if (add_cellids) then
206 maxcol = maxcol + 1
207 end if
208 do i = 1, this%nbudterm
209 lfound = .false.
210 flowtype = this%budterm(i)%get_flowtype()
211 if (trim(adjustl(flowtype)) == 'FLOW-JA-FACE') then
212 lfound = .true.
213 maxcol = maxcol + 2
214 else if (trim(adjustl(flowtype)) /= 'AUXILIARY') then
215 lfound = .true.
216 maxcol = maxcol + 1
217 end if
218 if (lfound) then
219 this%nflowterms = this%nflowterms + 1
220 if (add_cellids) then
221 if (trim(adjustl(flowtype)) == trim(adjustl(coupletype))) then
222 this%icellid = i
223 end if
224 end if
225 end if
226 end do
227
228
229 allocate (this%istart(this%nflowterms))
230 allocate (this%iflowterms(this%nflowterms))
231
232
233 title = trim(this%name)//' PACKAGE - SUMMARY OF FLOWS FOR '// &
234 'EACH CONTROL VOLUME'
235 call table_cr(this%flowtab, this%name, title)
236 call this%flowtab%table_df(this%ncv, maxcol, iout, transient=.true.)
237
238
239 text = 'NUMBER'
240 call this%flowtab%initialize_column(text, 10, alignment=tabcenter)
241 if (add_cellids) then
242 text = 'CELLID'
243 call this%flowtab%initialize_column(text, 20, alignment=tableft)
244 end if
245 idx = 1
246 do i = 1, this%nbudterm
247 lfound = .false.
248 flowtype = this%budterm(i)%get_flowtype()
249 tag = trim(adjustl(flowtype))
250 ipos = index(tag, '-')
251 if (ipos > 0) then
252 tag(ipos:ipos) = ' '
253 end if
254 if (trim(adjustl(flowtype)) == 'FLOW-JA-FACE') then
255 lfound = .true.
256 text = 'INFLOW'
257 call this%flowtab%initialize_column(text, 12, alignment=tabcenter)
258 text = 'OUTFLOW'
259 call this%flowtab%initialize_column(text, 12, alignment=tabcenter)
260 else if (trim(adjustl(flowtype)) /= 'AUXILIARY') then
261 lfound = .true.
262 call this%flowtab%initialize_column(tag, 12, alignment=tabcenter)
263 end if
264 if (lfound) then
265 this%iflowterms(idx) = i
266 idx = idx + 1
267 end if
268 end do
269 text = 'IN - OUT'
270 call this%flowtab%initialize_column(text, 12, alignment=tabcenter)
271 text = 'PERCENT DIFFERENCE'
272 call this%flowtab%initialize_column(text, 12, alignment=tabcenter)