192
195
196 class(ChfGwfExchangeType) :: this
197 integer(I4B), intent(in) :: iout
198
199 integer(I4B), dimension(:, :), contiguous, pointer :: cellidm1
200 integer(I4B), dimension(:, :), contiguous, pointer :: cellidm2
201 real(DP), dimension(:), contiguous, pointer :: bedleak
202 real(DP), dimension(:), contiguous, pointer :: cfact
203 character(len=20) :: cellstr1, cellstr2
204 integer(I4B) :: nerr
205 integer(I4B) :: iexg, nodeswf, nodegwf
206
207 character(len=*), parameter :: fmtexglabel = "(1x, 3a10, 50(a16))"
208 character(len=*), parameter :: fmtexgdata = &
209 "(5x, a, 1x, a ,50(1pg16.6))"
210
211 call mem_setptr(cellidm1,
'CELLIDM1', this%input_mempath)
212 call mem_setptr(cellidm2,
'CELLIDM2', this%input_mempath)
213 call mem_setptr(bedleak,
'BEDLEAK', this%input_mempath)
214 call mem_setptr(cfact,
'CFACT', this%input_mempath)
215
216 write (iout, '(1x,a)') 'PROCESSING EXCHANGEDATA'
217
218 if (this%ipr_input /= 0) then
219 write (iout, fmtexglabel) 'NODEM1', 'NODEM2', 'BEDLEAK', 'CFACT'
220 end if
221
222 do iexg = 1, this%nexg
223
224 if (associated(this%model1)) then
225
226 nodeswf = this%noder(this%model1, cellidm1(:, iexg), iout)
227 this%nodeswf(iexg) = nodeswf
228 else
229 this%nodeswf(iexg) = -1
230 end if
231
232 if (associated(this%model2)) then
233
234 nodegwf = this%noder(this%model2, cellidm2(:, iexg), iout)
235 this%nodegwf(iexg) = nodegwf
236 else
237 this%nodegwf(iexg) = -1
238 end if
239
240
241 this%bedleak(iexg) = bedleak(iexg)
242 this%cfact(iexg) = cfact(iexg)
243
244
245 if (this%ipr_input /= 0) then
246 cellstr1 = this%cellstr(this%model1, cellidm1(:, iexg), iout)
247 cellstr2 = this%cellstr(this%model2, cellidm2(:, iexg), iout)
248 write (iout, fmtexgdata) trim(cellstr1), trim(cellstr2), &
249 this%bedleak(iexg), this%cfact(iexg)
250 end if
251
252
253 if (associated(this%model1)) then
254 if (nodeswf <= 0) then
255 cellstr1 = this%cellstr(this%model1, cellidm1(:, iexg), iout)
256 write (errmsg, *) &
257 trim(adjustl(this%model1%name))// &
258 ' Cell is outside active grid domain ('// &
259 trim(adjustl(cellstr1))//').'
260 call store_error(errmsg)
261 end if
262 end if
263
264
265 if (associated(this%model2)) then
266 if (nodegwf <= 0) then
267 cellstr2 = this%cellstr(this%model2, cellidm2(:, iexg), iout)
268 write (errmsg, *) &
269 trim(adjustl(this%model2%name))// &
270 ' Cell is outside active grid domain ('// &
271 trim(adjustl(cellstr2))//').'
272 call store_error(errmsg)
273 end if
274 end if
275 end do
276
277 write (iout, '(1x,a)') 'END OF EXCHANGEDATA'
278
279
280 nerr = count_errors()
281 if (nerr > 0) then
282 call store_error('Errors encountered in exchange input file.')
283 call store_error_filename(this%filename)
284 end if
285
290
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.