23 character(len=LENFTYPE) ::
ftype =
'RCH'
24 character(len=LENPACKAGENAME) ::
text =
' RCH'
25 character(len=LENPACKAGENAME) ::
texta =
' RCHA'
28 real(dp),
dimension(:),
pointer,
contiguous :: recharge => null()
29 integer(I4B),
dimension(:),
pointer,
contiguous :: nodesontop => null()
30 logical,
pointer,
private :: fixed_cell
31 logical,
pointer,
private :: read_as_arrays
61 subroutine rch_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
64 class(
bndtype),
pointer :: packobj
65 integer(I4B),
intent(in) :: id
66 integer(I4B),
intent(in) :: ibcnum
67 integer(I4B),
intent(in) :: inunit
68 integer(I4B),
intent(in) :: iout
69 character(len=*),
intent(in) :: namemodel
70 character(len=*),
intent(in) :: pakname
71 character(len=*),
intent(in) :: mempath
73 type(
rchtype),
pointer :: rchobj
80 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
84 call rchobj%rch_allocate_scalars()
87 call packobj%pack_initialize()
89 packobj%inunit = inunit
92 packobj%ibcnum = ibcnum
100 class(
rchtype),
intent(inout) :: this
103 call this%BndExtType%allocate_scalars()
106 allocate (this%fixed_cell)
107 allocate (this%read_as_arrays)
110 this%fixed_cell = .false.
111 this%read_as_arrays = .false.
121 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
122 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
125 call this%BndExtType%allocate_arrays(nodelist, auxvar)
128 call mem_setptr(this%recharge,
'RECHARGE', this%input_mempath)
131 call mem_checkin(this%recharge,
'RECHARGE', this%memoryPath, &
132 'RECHARGE', this%input_mempath)
142 class(
rchtype),
intent(inout) :: this
144 logical(LGP) :: found_fixed_cell = .false.
145 logical(LGP) :: found_readasarrays = .false.
148 call this%BndExtType%source_options()
151 call mem_set_value(this%fixed_cell,
'FIXED_CELL', this%input_mempath, &
153 call mem_set_value(this%read_as_arrays,
'READASARRAYS', this%input_mempath, &
156 if (found_readasarrays)
then
157 if (this%dis%supports_layers())
then
160 errmsg =
'READASARRAYS option is not compatible with selected'// &
161 ' discretization type.'
168 call this%log_rch_options(found_fixed_cell, found_readasarrays)
176 class(
rchtype),
intent(inout) :: this
177 logical(LGP),
intent(in) :: found_fixed_cell
178 logical(LGP),
intent(in) :: found_readasarrays
180 character(len=*),
parameter :: fmtfixedcell = &
181 &
"(4x, 'RECHARGE WILL BE APPLIED TO SPECIFIED CELL.')"
182 character(len=*),
parameter :: fmtreadasarrays = &
183 &
"(4x, 'RECHARGE INPUT WILL BE READ AS ARRAY(S).')"
186 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%text)) &
189 if (found_fixed_cell)
then
190 write (this%iout, fmtfixedcell)
193 if (found_readasarrays)
then
194 write (this%iout, fmtreadasarrays)
198 write (this%iout,
'(1x,a)') &
199 'END OF '//trim(adjustl(this%text))//
' OPTIONS'
210 class(
rchtype),
intent(inout) :: this
212 if (this%read_as_arrays)
then
213 this%maxbound = this%dis%get_ncpl()
216 if (this%maxbound <= 0)
then
218 'MAXBOUND must be an integer greater than zero.'
226 call this%BndExtType%source_dimensions()
231 call this%define_listlabel()
238 class(
rchtype),
intent(inout) :: this
240 if (this%read_as_arrays)
then
241 call this%default_nodelist()
254 class(
rchtype),
intent(inout) :: this
256 if (this%iper /=
kper)
return
258 if (this%read_as_arrays)
then
262 this%dis, this%input_mempath)
266 call this%BndExtType%bnd_rp()
271 if (.not. this%fixed_cell)
call this%set_nodesontop()
274 if (this%iprpak /= 0)
then
275 call this%write_list()
284 class(
rchtype),
intent(inout) :: this
289 if (.not.
associated(this%nodesontop))
then
290 allocate (this%nodesontop(this%maxbound))
294 do n = 1, this%nbound
295 this%nodesontop(n) = this%nodelist(n)
307 integer(I4B) :: i, node
310 if (this%nbound == 0)
return
313 do i = 1, this%nbound
316 if (this%fixed_cell)
then
317 node = this%nodelist(i)
319 node = this%nodesontop(i)
330 if (.not. this%fixed_cell)
then
331 if (this%ibound(node) == 0) &
332 call this%dis%highest_active(node, this%ibound)
333 this%nodelist(i) = node
338 if (this%iauxmultcol > 0)
then
339 this%rhs(i) = -this%recharge(i) * this%dis%get_area(node) * &
340 this%auxvar(this%iauxmultcol, i)
342 this%rhs(i) = -this%recharge(i) * this%dis%get_area(node)
344 if (this%ibound(node) <= 0)
then
348 if (this%ibound(node) ==
iwetlake)
then
357 subroutine rch_fc(this, rhs, ia, idxglo, matrix_sln)
360 real(DP),
dimension(:),
intent(inout) :: rhs
361 integer(I4B),
dimension(:),
intent(in) :: ia
362 integer(I4B),
dimension(:),
intent(in) :: idxglo
365 integer(I4B) :: i, n, ipos
368 do i = 1, this%nbound
372 if (this%ibound(n) ==
iwetlake)
then
377 rhs(n) = rhs(n) + this%rhs(i)
379 call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
392 call this%BndExtType%bnd_da()
395 deallocate (this%fixed_cell)
396 deallocate (this%read_as_arrays)
399 if (
associated(this%nodesontop))
deallocate (this%nodesontop)
408 class(
rchtype),
intent(inout) :: this
411 this%listlabel = trim(this%filtyp)//
' NO.'
412 if (this%dis%ndim == 3)
then
413 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
414 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
415 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
416 elseif (this%dis%ndim == 2)
then
417 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
418 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
420 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
422 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'RECHARGE'
425 if (this%inamedbound == 1)
then
426 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
438 integer(I4B) :: il, ir, ic, ncol, nrow, nlay, nodeu, noder, ipos
441 if (this%dis%ndim == 3)
then
442 nlay = this%dis%mshape(1)
443 nrow = this%dis%mshape(2)
444 ncol = this%dis%mshape(3)
445 elseif (this%dis%ndim == 2)
then
446 nlay = this%dis%mshape(1)
448 ncol = this%dis%mshape(2)
456 nodeu =
get_node(il, ir, ic, nlay, nrow, ncol)
457 noder = this%dis%get_nodenumber(nodeu, 0)
458 this%nodelist(ipos) = noder
464 this%nbound = ipos - 1
468 if (.not. this%fixed_cell)
call this%set_nodesontop()
497 call this%obs%StoreObsType(
'rch', .true., indx)
507 class(
rchtype),
intent(inout) :: this
508 integer(I4B),
intent(in) :: col
509 integer(I4B),
intent(in) :: row
515 if (this%iauxmultcol > 0)
then
516 bndval = this%recharge(row) * this%auxvar(this%iauxmultcol, row)
518 bndval = this%recharge(row)
521 errmsg =
'Programming error. RCH bound value requested column '&
522 &
'outside range of ncolbnd (1).'
544 integer(I4B),
dimension(:),
contiguous, &
545 pointer,
intent(inout) :: nodelist
547 character(len=*),
intent(in) :: input_mempath
548 integer(I4B),
intent(inout) :: nbound
549 integer(I4B),
intent(in) :: maxbound
550 character(len=24) :: aname =
' LAYER OR NODE INDEX'
552 integer(I4B),
dimension(:),
contiguous, &
553 pointer :: irch => null()
554 integer(I4B),
pointer :: inirch => null()
557 call mem_setptr(inirch,
'INIRCH', input_mempath)
560 if (inirch == 1)
then
567 call dis%nlarray_to_nodelist(irch, nodelist, &
568 maxbound, nbound, aname)
This module contains block parser methods.
This module contains the extended boundary package.
This module contains the base boundary package.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lenpackagename
maximum length of the package name
integer(i4b), parameter iwetlake
integer constant for a dry lake
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
real(dp), parameter dzero
real constant zero
integer(i4b), parameter maxcharlen
maximum length of char string
integer(i4b) function, public get_node(ilay, irow, icol, nlay, nrow, ncol)
Get node number, given layer, row, and column indices for a structured grid. If any argument is inval...
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains the derived type ObsType.
subroutine, public defaultobsidprocessor(obsrv, dis, inunitobs, iout)
@ brief Process IDstring provided for each observation
subroutine rch_allocate_arrays(this, nodelist, auxvar)
Allocate package arrays.
logical function rch_obs_supported(this)
Overrides BndTypebnd_obs_supported()
subroutine nodelist_update(nodelist, nbound, maxbound, dis, input_mempath)
Update the nodelist based on IRCH input.
subroutine rch_df_obs(this)
Implements bnd_df_obs.
subroutine default_nodelist(this)
Assign default nodelist when READASARRAYS is specified.
subroutine, public rch_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a New Recharge Package.
subroutine rch_fc(this, rhs, ia, idxglo, matrix_sln)
Copy rhs and hcof into solution rhs and amat.
real(dp) function rch_bound_value(this, col, row)
Return requested boundary value.
subroutine log_rch_options(this, found_fixed_cell, found_readasarrays)
Log options specific to RchType.
subroutine rch_allocate_scalars(this)
Allocate scalar members.
character(len=lenpackagename) texta
subroutine rch_read_initial_attr(this)
Part of allocate and read.
subroutine rch_rp(this)
Read and Prepare.
subroutine rch_define_listlabel(this)
Define the list heading that is written to iout when PRINT_INPUT option is used.
subroutine rch_cf(this)
Formulate the HCOF and RHS terms.
subroutine rch_source_options(this)
Source options specific to RchType.
subroutine rch_da(this)
Deallocate memory.
character(len=lenpackagename) text
subroutine set_nodesontop(this)
Store nodelist in nodesontop.
character(len=lenftype) ftype
subroutine rch_source_dimensions(this)
Source the dimensions for this package.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
integer(i4b), pointer, public kper
current stress period number
This class is used to store a single deferred-length character string. It was designed to work in an ...