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
103 class(
rchtype),
intent(inout) :: this
106 call this%BndExtType%allocate_scalars()
109 allocate (this%fixed_cell)
110 allocate (this%read_as_arrays)
113 this%fixed_cell = .false.
114 this%read_as_arrays = .false.
127 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
128 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
131 call this%BndExtType%allocate_arrays(nodelist, auxvar)
134 call mem_setptr(this%recharge,
'RECHARGE', this%input_mempath)
137 call mem_checkin(this%recharge,
'RECHARGE', this%memoryPath, &
138 'RECHARGE', this%input_mempath)
151 class(
rchtype),
intent(inout) :: this
153 logical(LGP) :: found_fixed_cell = .false.
154 logical(LGP) :: found_readasarrays = .false.
157 call this%BndExtType%source_options()
160 call mem_set_value(this%fixed_cell,
'FIXED_CELL', this%input_mempath, &
162 call mem_set_value(this%read_as_arrays,
'READASARRAYS', this%input_mempath, &
165 if (found_readasarrays)
then
166 if (this%dis%supports_layers())
then
169 errmsg =
'READASARRAYS option is not compatible with selected'// &
170 ' discretization type.'
177 call this%log_rch_options(found_fixed_cell, found_readasarrays)
188 class(
rchtype),
intent(inout) :: this
189 logical(LGP),
intent(in) :: found_fixed_cell
190 logical(LGP),
intent(in) :: found_readasarrays
192 character(len=*),
parameter :: fmtfixedcell = &
193 &
"(4x, 'RECHARGE WILL BE APPLIED TO SPECIFIED CELL.')"
194 character(len=*),
parameter :: fmtreadasarrays = &
195 &
"(4x, 'RECHARGE INPUT WILL BE READ AS ARRAY(S).')"
198 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%text)) &
201 if (found_fixed_cell)
then
202 write (this%iout, fmtfixedcell)
205 if (found_readasarrays)
then
206 write (this%iout, fmtreadasarrays)
210 write (this%iout,
'(1x,a)') &
211 'END OF '//trim(adjustl(this%text))//
' OPTIONS'
225 class(
rchtype),
intent(inout) :: this
227 if (this%read_as_arrays)
then
228 this%maxbound = this%dis%get_ncpl()
231 if (this%maxbound <= 0)
then
233 'MAXBOUND must be an integer greater than zero.'
241 call this%BndExtType%source_dimensions()
246 call this%define_listlabel()
256 class(
rchtype),
intent(inout) :: this
258 if (this%read_as_arrays)
then
259 call this%default_nodelist()
275 class(
rchtype),
intent(inout) :: this
277 if (this%iper /=
kper)
return
279 if (this%read_as_arrays)
then
283 this%dis, this%input_mempath)
287 call this%BndExtType%bnd_rp()
292 if (.not. this%fixed_cell)
call this%set_nodesontop()
295 if (this%iprpak /= 0)
then
296 call this%write_list()
308 class(
rchtype),
intent(inout) :: this
313 if (.not.
associated(this%nodesontop))
then
314 allocate (this%nodesontop(this%maxbound))
318 do n = 1, this%nbound
319 this%nodesontop(n) = this%nodelist(n)
334 integer(I4B) :: i, node
337 if (this%nbound == 0)
return
340 do i = 1, this%nbound
343 if (this%fixed_cell)
then
344 node = this%nodelist(i)
346 node = this%nodesontop(i)
357 if (.not. this%fixed_cell)
then
358 if (this%ibound(node) == 0) &
359 call this%dis%highest_active(node, this%ibound)
360 this%nodelist(i) = node
365 if (this%iauxmultcol > 0)
then
366 this%rhs(i) = -this%recharge(i) * this%dis%get_area(node) * &
367 this%auxvar(this%iauxmultcol, i)
369 this%rhs(i) = -this%recharge(i) * this%dis%get_area(node)
371 if (this%ibound(node) <= 0)
then
375 if (this%ibound(node) ==
iwetlake)
then
387 subroutine rch_fc(this, rhs, ia, idxglo, matrix_sln)
390 real(DP),
dimension(:),
intent(inout) :: rhs
391 integer(I4B),
dimension(:),
intent(in) :: ia
392 integer(I4B),
dimension(:),
intent(in) :: idxglo
395 integer(I4B) :: i, n, ipos
398 do i = 1, this%nbound
402 if (this%ibound(n) ==
iwetlake)
then
407 rhs(n) = rhs(n) + this%rhs(i)
409 call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
425 call this%BndExtType%bnd_da()
428 deallocate (this%fixed_cell)
429 deallocate (this%read_as_arrays)
432 if (
associated(this%nodesontop))
deallocate (this%nodesontop)
444 class(
rchtype),
intent(inout) :: this
447 this%listlabel = trim(this%filtyp)//
' NO.'
448 if (this%dis%ndim == 3)
then
449 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
450 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
451 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
452 elseif (this%dis%ndim == 2)
then
453 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
454 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
456 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
458 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'RECHARGE'
461 if (this%inamedbound == 1)
then
462 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
477 integer(I4B) :: il, ir, ic, ncol, nrow, nlay, nodeu, noder, ipos
480 if (this%dis%ndim == 3)
then
481 nlay = this%dis%mshape(1)
482 nrow = this%dis%mshape(2)
483 ncol = this%dis%mshape(3)
484 elseif (this%dis%ndim == 2)
then
485 nlay = this%dis%mshape(1)
487 ncol = this%dis%mshape(2)
495 nodeu =
get_node(il, ir, ic, nlay, nrow, ncol)
496 noder = this%dis%get_nodenumber(nodeu, 0)
497 this%nodelist(ipos) = noder
503 this%nbound = ipos - 1
507 if (.not. this%fixed_cell)
call this%set_nodesontop()
542 call this%obs%StoreObsType(
'rch', .true., indx)
555 class(
rchtype),
intent(inout) :: this
556 integer(I4B),
intent(in) :: col
557 integer(I4B),
intent(in) :: row
563 if (this%iauxmultcol > 0)
then
564 bndval = this%recharge(row) * this%auxvar(this%iauxmultcol, row)
566 bndval = this%recharge(row)
569 errmsg =
'Programming error. RCH bound value requested column '&
570 &
'outside range of ncolbnd (1).'
595 integer(I4B),
dimension(:),
contiguous, &
596 pointer,
intent(inout) :: nodelist
598 character(len=*),
intent(in) :: input_mempath
599 integer(I4B),
intent(inout) :: nbound
600 integer(I4B),
intent(in) :: maxbound
601 character(len=24) :: aname =
' LAYER OR NODE INDEX'
603 integer(I4B),
dimension(:),
contiguous, &
604 pointer :: irch => null()
605 integer(I4B),
pointer :: inirch => null()
608 call mem_setptr(inirch,
'INIRCH', input_mempath)
611 if (inirch == 1)
then
618 call dis%nlarray_to_nodelist(irch, nodelist, &
619 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 ...