18 character(len=LENFTYPE) ::
ftype =
'GHB'
19 character(len=LENPACKAGENAME) ::
text =
' GHB'
22 real(dp),
dimension(:),
pointer,
contiguous :: bhead => null()
23 real(dp),
dimension(:),
pointer,
contiguous :: cond => null()
46 subroutine ghb_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
49 class(
bndtype),
pointer :: packobj
50 integer(I4B),
intent(in) :: id
51 integer(I4B),
intent(in) :: ibcnum
52 integer(I4B),
intent(in) :: inunit
53 integer(I4B),
intent(in) ::
iout
54 character(len=*),
intent(in) :: namemodel
55 character(len=*),
intent(in) :: pakname
56 character(len=*),
intent(in) :: mempath
58 type(
ghbtype),
pointer :: ghbobj
65 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
69 call packobj%allocate_scalars()
72 call packobj%pack_initialize()
74 packobj%inunit = inunit
77 packobj%ibcnum = ibcnum
91 call this%BndExtType%bnd_da()
105 class(
ghbtype),
intent(inout) :: this
107 logical(LGP) :: found_mover
110 call this%BndExtType%source_options()
113 call mem_set_value(this%imover,
'MOVER', this%input_mempath, found_mover)
116 call this%log_ghb_options(found_mover)
124 class(
ghbtype),
intent(inout) :: this
125 logical(LGP),
intent(in) :: found_mover
128 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%text)) &
131 if (found_mover)
then
132 write (this%iout,
'(4x,A)')
'MOVER OPTION ENABLED'
136 write (this%iout,
'(1x,a)') &
137 'END OF '//trim(adjustl(this%text))//
' OPTIONS'
147 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
148 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
151 call this%BndExtType%allocate_arrays(nodelist, auxvar)
154 call mem_setptr(this%bhead,
'BHEAD', this%input_mempath)
155 call mem_setptr(this%cond,
'COND', this%input_mempath)
158 call mem_checkin(this%bhead,
'BHEAD', this%memoryPath, &
159 'BHEAD', this%input_mempath)
160 call mem_checkin(this%cond,
'COND', this%memoryPath, &
161 'COND', this%input_mempath)
170 class(
ghbtype),
intent(inout) :: this
172 if (this%iper /=
kper)
return
175 call this%BndExtType%bnd_rp()
178 if (this%ivsc == 1)
then
179 call this%ghb_store_user_cond()
190 class(
ghbtype),
intent(inout) :: this
192 character(len=LINELENGTH) :: errmsg
197 character(len=*),
parameter :: fmtghberr = &
198 "('GHB BOUNDARY (',i0,') HEAD (',f10.3,') IS LESS THAN CELL &
199 &BOTTOM (',f10.3,')')"
200 character(len=*),
parameter :: fmtcondmulterr = &
201 "('GHB BOUNDARY (',i0,') CONDUCTANCE MULTIPLIER (',g10.3,') IS &
203 character(len=*),
parameter :: fmtconderr = &
204 "('GHB BOUNDARY (',i0,') CONDUCTANCE (',g10.3,') IS LESS THAN &
208 do i = 1, this%nbound
209 node = this%nodelist(i)
211 bt = this%dis%bot(node)
213 if (this%bhead(i) < bt .and. this%icelltype(node) /= 0)
then
214 write (errmsg, fmt=fmtghberr) i, this%bhead(i), bt
217 if (this%iauxmultcol > 0)
then
218 if (this%auxvar(this%iauxmultcol, i) <
dzero)
then
219 write (errmsg, fmt=fmtcondmulterr) &
220 i, this%auxvar(this%iauxmultcol, i)
224 if (this%cond(i) <
dzero)
then
225 write (errmsg, fmt=fmtconderr) i, this%cond(i)
244 integer(I4B) :: i, node
247 if (this%nbound .eq. 0)
return
250 do i = 1, this%nbound
251 node = this%nodelist(i)
253 if (this%ibound(node) .le. 0)
then
258 this%hcof(i) = -this%cond_mult(i)
259 this%rhs(i) = -this%cond_mult(i) * this%bhead(i)
265 subroutine ghb_fc(this, rhs, ia, idxglo, matrix_sln)
268 real(DP),
dimension(:),
intent(inout) :: rhs
269 integer(I4B),
dimension(:),
intent(in) :: ia
270 integer(I4B),
dimension(:),
intent(in) :: idxglo
273 integer(I4B) :: i, n, ipos
277 if (this%imover == 1)
then
278 call this%pakmvrobj%fc()
282 do i = 1, this%nbound
285 rhs(n) = rhs(n) + this%rhs(i)
287 call matrix_sln%add_value_pos(idxglo(ipos), this%hcof(i))
293 if (this%imover == 1)
then
294 qghb = this%rhs(i) - this%hcof(i) * this%xnew(n)
295 if (qghb > dzero)
then
296 call this%pakmvrobj%accumulate_qformvr(i, qghb)
307 class(
ghbtype),
intent(inout) :: this
310 this%listlabel = trim(this%filtyp)//
' NO.'
311 if (this%dis%ndim == 3)
then
312 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
313 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
314 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
315 elseif (this%dis%ndim == 2)
then
316 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
317 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
319 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
321 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'STAGE'
322 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'CONDUCTANCE'
323 if (this%inamedbound == 1)
then
324 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
353 call this%obs%StoreObsType(
'ghb', .true., indx)
358 call this%obs%StoreObsType(
'to-mvr', .true., indx)
366 class(
ghbtype),
intent(inout) :: this
371 do n = 1, this%nbound
372 this%condinput(n) = this%cond(n)
382 class(
ghbtype),
intent(inout) :: this
383 integer(I4B),
intent(in) :: row
387 if (this%iauxmultcol > 0)
then
388 cond = this%cond(row) * this%auxvar(this%iauxmultcol, row)
390 cond = this%cond(row)
394 if (this%ivsc == 1) cond = cond * this%viscratio(row)
403 class(
ghbtype),
intent(inout) :: this
404 integer(I4B),
intent(in) :: col
405 integer(I4B),
intent(in) :: row
411 bndval = this%bhead(row)
414 bndval = this%cond(row)
415 if (this%iauxmultcol > 0)
then
416 bndval = bndval * this%auxvar(this%iauxmultcol, row)
419 errmsg =
'Programming error. GHB bound value requested column '&
420 &
'outside range of ncolbnd (2).'
422 call store_error_filename(this%input_fname)
This module contains the extended boundary package.
real(dp) function bound_value(this, col, row)
Return a bound value.
subroutine source_options(this)
Source package options from input context.
This module contains the base boundary package.
logical(lgp) function bnd_obs_supported(this)
Determine if observations are supported.
subroutine bnd_rp(this)
Allocate and read method for package.
subroutine bnd_da(this)
Deallocate package memory.
subroutine bnd_fc(this, rhs, ia, idxglo, matrix_sln)
Copy hcof and rhs terms into solution.
subroutine allocate_arrays(this, nodelist, auxvar)
Allocate package arrays.
subroutine bnd_ck(this)
Check boundary package period data.
subroutine bnd_df_obs(this)
Define the observation types available in the package.
subroutine bnd_cf(this)
Formulate the package hcof and rhs terms.
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 lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
real(dp), parameter dzero
real constant zero
subroutine ghb_cf(this)
Formulate the HCOF and RHS terms.
subroutine ghb_allocate_arrays(this, nodelist, auxvar)
Allocate arrays.
subroutine ghb_ck(this)
Check ghb boundary condition data.
subroutine ghb_da(this)
Deallocate memory.
subroutine ghb_fc(this, rhs, ia, idxglo, matrix_sln)
Copy rhs and hcof into solution rhs and amat.
subroutine ghb_df_obs(this)
Store observation type supported by GHB package.
character(len=lenpackagename) text
real(dp) function ghb_bound_value(this, col, row)
Return requested boundary value.
real(dp) function cond_mult(this, row)
Apply multiplier to GHB conductance if option AUXMULTCOL is used.
character(len=lenftype) ftype
subroutine ghb_store_user_cond(this)
Store user-specified conductance for GHB boundary type.
logical function ghb_obs_supported(this)
Return true because GHB package supports observations.
subroutine ghb_rp(this)
Read and prepare.
subroutine, public ghb_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a New Ghb Package and point bndobj to the new package.
subroutine log_ghb_options(this, found_mover)
Log options specific to GhbType.
subroutine ghb_options(this)
Set options specific to GhbType.
subroutine define_listlabel(this)
Define the list heading that is written to iout when PRINT_INPUT option is used.
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)
Process IDstring provided for each observation.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
integer(i4b) iout
file unit number for simulation output
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 ...