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
93 class(
rchtype),
intent(inout) :: this
96 call this%BndExtType%allocate_scalars()
99 allocate (this%fixed_cell)
102 this%fixed_cell = .false.
112 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
113 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
116 call this%BndExtType%allocate_arrays(nodelist, auxvar)
119 call mem_setptr(this%recharge,
'RECHARGE', this%input_mempath)
122 call mem_checkin(this%recharge,
'RECHARGE', this%memoryPath, &
123 'RECHARGE', this%input_mempath)
133 class(
rchtype),
intent(inout) :: this
135 logical(LGP) :: found_fixed_cell = .false.
138 call this%BndExtType%source_options()
141 call mem_set_value(this%fixed_cell,
'FIXED_CELL', this%input_mempath, &
144 if (this%readasarrays)
then
149 call this%log_rch_options(found_fixed_cell)
157 class(
rchtype),
intent(inout) :: this
158 logical(LGP),
intent(in) :: found_fixed_cell
160 character(len=*),
parameter :: fmtfixedcell = &
161 &
"(4x, 'RECHARGE WILL BE APPLIED TO SPECIFIED CELL.')"
164 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%text)) &
167 if (found_fixed_cell)
then
168 write (this%iout, fmtfixedcell)
172 write (this%iout,
'(1x,a)') &
173 'END OF '//trim(adjustl(this%text))//
' OPTIONS'
180 class(
rchtype),
intent(inout) :: this
182 if (this%readasarrays)
then
183 call this%default_nodelist()
188 if (.not. this%fixed_cell)
call this%set_nodesontop()
200 class(
rchtype),
intent(inout) :: this
202 if (this%iper /=
kper)
return
204 call this%BndExtType%bnd_rp()
207 if (.not. this%fixed_cell)
call this%set_nodesontop()
209 if (this%iprpak /= 0)
then
210 if (this%readasarrays)
then
214 call this%write_list()
224 class(
rchtype),
intent(inout) :: this
229 if (.not.
associated(this%nodesontop))
then
230 allocate (this%nodesontop(this%maxbound))
234 do n = 1, this%nbound
235 this%nodesontop(n) = this%nodelist(n)
247 integer(I4B) :: i, node
250 if (this%nbound == 0)
return
253 do i = 1, this%nbound
256 if (this%fixed_cell)
then
257 node = this%nodelist(i)
259 node = this%nodesontop(i)
270 if (.not. this%fixed_cell)
then
271 if (this%ibound(node) == 0) &
272 call this%dis%highest_active(node, this%ibound)
273 this%nodelist(i) = node
278 if (this%iauxmultcol > 0)
then
279 this%rhs(i) = -this%recharge(i) * this%dis%get_area(node) * &
280 this%auxvar(this%iauxmultcol, i)
282 this%rhs(i) = -this%recharge(i) * this%dis%get_area(node)
284 if (this%ibound(node) <= 0)
then
288 if (this%ibound(node) ==
iwetlake)
then
297 subroutine rch_fc(this, rhs, ia, idxglo, matrix_sln)
300 real(DP),
dimension(:),
intent(inout) :: rhs
301 integer(I4B),
dimension(:),
intent(in) :: ia
302 integer(I4B),
dimension(:),
intent(in) :: idxglo
305 integer(I4B) :: i, n, ipos
308 do i = 1, this%nbound
312 if (this%ibound(n) ==
iwetlake)
then
317 rhs(n) = rhs(n) + this%rhs(i)
319 call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
332 call this%BndExtType%bnd_da()
335 deallocate (this%fixed_cell)
338 if (
associated(this%nodesontop))
deallocate (this%nodesontop)
347 class(
rchtype),
intent(inout) :: this
350 this%listlabel = trim(this%filtyp)//
' NO.'
351 if (this%dis%ndim == 3)
then
352 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
353 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
354 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
355 elseif (this%dis%ndim == 2)
then
356 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
357 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
359 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
361 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'RECHARGE'
364 if (this%inamedbound == 1)
then
365 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
395 call this%obs%StoreObsType(
'rch', .true., indx)
405 class(
rchtype),
intent(inout) :: this
406 integer(I4B),
intent(in) :: col
407 integer(I4B),
intent(in) :: row
413 if (this%iauxmultcol > 0)
then
414 bndval = this%recharge(row) * this%auxvar(this%iauxmultcol, row)
416 bndval = this%recharge(row)
419 errmsg =
'Programming error. RCH bound value requested column '&
420 &
'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