19 character(len=LENFTYPE) ::
ftype =
'RCH'
20 character(len=LENPACKAGENAME) ::
text =
' RCH'
21 character(len=LENPACKAGENAME) ::
texta =
' RCHA'
24 real(dp),
dimension(:),
pointer,
contiguous :: recharge => null()
25 integer(I4B),
dimension(:),
pointer,
contiguous :: nodesontop => null()
26 logical,
pointer,
private :: fixed_cell
54 subroutine rch_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
57 class(
bndtype),
pointer :: packobj
58 integer(I4B),
intent(in) :: id
59 integer(I4B),
intent(in) :: ibcnum
60 integer(I4B),
intent(in) :: inunit
61 integer(I4B),
intent(in) :: iout
62 character(len=*),
intent(in) :: namemodel
63 character(len=*),
intent(in) :: pakname
64 character(len=*),
intent(in) :: mempath
66 type(
rchtype),
pointer :: rchobj
73 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
77 call rchobj%rch_allocate_scalars()
80 call packobj%pack_initialize()
82 packobj%inunit = inunit
85 packobj%ibcnum = ibcnum
94 class(
rchtype),
intent(inout) :: this
97 call this%BndExtType%allocate_scalars()
100 allocate (this%fixed_cell)
103 this%fixed_cell = .false.
113 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
114 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
117 call this%BndExtType%allocate_arrays(nodelist, auxvar)
120 call mem_setptr(this%recharge,
'RECHARGE', this%input_mempath)
123 call mem_checkin(this%recharge,
'RECHARGE', this%memoryPath, &
124 'RECHARGE', this%input_mempath)
134 class(
rchtype),
intent(inout) :: this
136 logical(LGP) :: found_fixed_cell = .false.
139 call this%BndExtType%source_options()
142 call mem_set_value(this%fixed_cell,
'FIXED_CELL', this%input_mempath, &
145 if (this%readasarrays)
then
150 call this%log_rch_options(found_fixed_cell)
158 class(
rchtype),
intent(inout) :: this
159 logical(LGP),
intent(in) :: found_fixed_cell
161 character(len=*),
parameter :: fmtfixedcell = &
162 &
"(4x, 'RECHARGE WILL BE APPLIED TO SPECIFIED CELL.')"
165 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%text)) &
168 if (found_fixed_cell)
then
169 write (this%iout, fmtfixedcell)
173 write (this%iout,
'(1x,a)') &
174 'END OF '//trim(adjustl(this%text))//
' OPTIONS'
181 class(
rchtype),
intent(inout) :: this
183 if (this%readasarrays)
then
184 call this%default_nodelist()
189 if (.not. this%fixed_cell)
call this%set_nodesontop()
201 class(
rchtype),
intent(inout) :: this
203 if (this%iper /=
kper)
return
205 call this%BndExtType%bnd_rp()
208 if (.not. this%fixed_cell)
call this%set_nodesontop()
217 class(
rchtype),
intent(inout) :: this
222 if (.not.
associated(this%nodesontop))
then
223 allocate (this%nodesontop(this%maxbound))
227 do n = 1, this%nbound
228 this%nodesontop(n) = this%nodelist(n)
240 integer(I4B) :: i, node
243 if (this%nbound == 0)
return
246 do i = 1, this%nbound
249 if (this%fixed_cell)
then
250 node = this%nodelist(i)
252 node = this%nodesontop(i)
263 if (.not. this%fixed_cell)
then
264 if (this%ibound(node) == 0) &
265 call this%dis%highest_active(node, this%ibound)
266 this%nodelist(i) = node
271 if (this%iauxmultcol > 0)
then
272 this%rhs(i) = -this%recharge(i) * this%dis%get_area(node) * &
273 this%auxvar(this%iauxmultcol, i)
275 this%rhs(i) = -this%recharge(i) * this%dis%get_area(node)
277 if (this%ibound(node) <= 0)
then
281 if (this%ibound(node) ==
iwetlake)
then
290 subroutine rch_fc(this, rhs, ia, idxglo, matrix_sln)
293 real(DP),
dimension(:),
intent(inout) :: rhs
294 integer(I4B),
dimension(:),
intent(in) :: ia
295 integer(I4B),
dimension(:),
intent(in) :: idxglo
298 integer(I4B) :: i, n, ipos
301 do i = 1, this%nbound
305 if (this%ibound(n) ==
iwetlake)
then
310 rhs(n) = rhs(n) + this%rhs(i)
312 call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
325 call this%BndExtType%bnd_da()
328 deallocate (this%fixed_cell)
331 if (
associated(this%nodesontop))
deallocate (this%nodesontop)
340 class(
rchtype),
intent(inout) :: this
343 this%listlabel = trim(this%filtyp)//
' NO.'
344 if (this%dis%ndim == 3)
then
345 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
346 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
347 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
348 elseif (this%dis%ndim == 2)
then
349 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
350 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
352 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
354 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'RECHARGE'
357 if (this%inamedbound == 1)
then
358 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
388 call this%obs%StoreObsType(
'rch', .true., indx)
398 class(
rchtype),
intent(inout) :: this
399 integer(I4B),
intent(in) :: col
400 integer(I4B),
intent(in) :: row
406 if (this%iauxmultcol > 0)
then
407 bndval = this%recharge(row) * this%auxvar(this%iauxmultcol, row)
409 bndval = this%recharge(row)
412 errmsg =
'Programming error. RCH bound value requested column '&
413 &
'outside range of ncolbnd (1).'
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
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 rch_df_obs(this)
Implements bnd_df_obs.
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 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 log_rch_options(this, found_fixed_cell)
Log options specific to RchType.
subroutine set_nodesontop(this)
Store nodelist in nodesontop.
character(len=lenftype) ftype
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