22 character(len=LENFTYPE) ::
ftype =
'CNC'
23 character(len=LENPACKAGENAME) ::
text =
' CNC'
27 real(dp),
dimension(:),
pointer,
contiguous :: tspvar => null()
28 real(dp),
dimension(:),
pointer,
contiguous :: ratecncin => null()
29 real(dp),
dimension(:),
pointer,
contiguous :: ratecncout => null()
30 character(len=LENVARNAME) :: depvartype =
''
56 subroutine cnc_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
59 class(
bndtype),
pointer :: packobj
60 integer(I4B),
intent(in) :: id
61 integer(I4B),
intent(in) :: ibcnum
62 integer(I4B),
intent(in) :: inunit
63 integer(I4B),
intent(in) :: iout
64 character(len=*),
intent(in) :: namemodel
65 character(len=*),
intent(in) :: pakname
66 character(len=LENVARNAME),
intent(in) :: depvartype
67 character(len=*),
intent(in) :: mempath
76 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
80 call cncobj%allocate_scalars()
83 call packobj%pack_initialize()
86 packobj%inunit = inunit
89 packobj%ibcnum = ibcnum
92 cncobj%depvartype = depvartype
106 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
107 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
112 call this%BndExtType%allocate_arrays(nodelist, auxvar)
115 call mem_allocate(this%ratecncin, this%maxbound,
'RATECNCIN', this%memoryPath)
116 call mem_allocate(this%ratecncout, this%maxbound,
'RATECNCOUT', &
118 do i = 1, this%maxbound
119 this%ratecncin(i) =
dzero
120 this%ratecncout(i) =
dzero
123 call mem_setptr(this%tspvar,
'TSPVAR', this%input_mempath)
126 call mem_checkin(this%tspvar,
'TSPVAR', this%memoryPath, &
127 'TSPVAR', this%input_mempath)
144 integer(I4B) :: i, node, ibd, ierr
145 character(len=30) :: nodestr
146 character(len=LENVARNAME) :: dvtype
149 do i = 1, this%nbound
150 node = this%nodelist(i)
151 this%ibound(node) = this%ibcnum
155 call this%BndExtType%bnd_rp()
159 do i = 1, this%nbound
160 node = this%nodelist(i)
161 ibd = this%ibound(node)
163 call this%dis%noder_to_string(node, nodestr)
164 dvtype = trim(this%depvartype)
167 //dvtype//
': '//trim(adjustl(nodestr)))
170 this%ibound(node) = -this%ibcnum
176 call store_error_filename(this%input_fname)
180 if (this%iprpak /= 0)
then
181 call this%write_list()
197 integer(I4B) :: i, node
202 call this%TsManager%ad()
205 do i = 1, this%nbound
206 node = this%nodelist(i)
207 cb = this%conc_mult(i)
210 this%xold(node) = this%xnew(node)
216 call this%obs%obs_ad()
229 character(len=30) :: nodestr
233 character(len=*),
parameter :: fmtcncerr = &
234 &
"('Specified dependent variable boundary ',i0, &
235 &' conc (',g0,') is less than zero for cell', a)"
238 do i = 1, this%nbound
239 node = this%nodelist(i)
241 if (this%conc_mult(i) <
dzero)
then
242 call this%dis%noder_to_string(node, nodestr)
243 write (
errmsg, fmt=fmtcncerr) i, this%tspvar(i), trim(nodestr)
262 subroutine cnc_fc(this, rhs, ia, idxglo, matrix_sln)
265 real(DP),
dimension(:),
intent(inout) :: rhs
266 integer(I4B),
dimension(:),
intent(in) :: ia
267 integer(I4B),
dimension(:),
intent(in) :: idxglo
284 real(DP),
dimension(:),
intent(in) :: x
285 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
286 integer(I4B),
optional,
intent(in) :: iadv
292 integer(I4B) :: idiag
294 real(DP) :: ratein, rateout
298 if (this%nbound > 0)
then
301 do i = 1, this%nbound
302 node = this%nodelist(i)
303 idiag = this%dis%con%ia(node)
309 do ipos = this%dis%con%ia(node) + 1, &
310 this%dis%con%ia(node + 1) - 1
315 n2 = this%dis%con%ja(ipos)
316 if (this%ibound(n2) > 0)
then
320 rateout = rateout + q
331 this%simvals(i) = rate
332 this%ratecncin(i) = ratein
333 this%ratecncout(i) = rateout
334 flowja(idiag) = flowja(idiag) + rate
353 type(
budgettype),
intent(inout) :: model_budget
357 integer(I4B) :: isuppress_output
362 call model_budget%addentry(ratin, ratout,
delt, this%text, &
363 isuppress_output, this%packName)
380 call this%BndExtType%bnd_da()
401 this%listlabel = trim(this%filtyp)//
' NO.'
402 if (this%dis%ndim == 3)
then
403 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
404 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
405 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
406 elseif (this%dis%ndim == 2)
then
407 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
408 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
410 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
412 write (this%listlabel,
'(a, a16)') trim(this%listlabel), &
413 trim(this%depvartype)
414 if (this%inamedbound == 1)
then
415 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
451 call this%obs%StoreObsType(this%filtyp, .true., indx)
471 integer(I4B) :: i, nlinks
474 nlinks = this%TsManager%boundtslinks%Count()
477 if (
associated(tslink))
then
478 select case (tslink%JCol)
480 tslink%Text = trim(this%depvartype)
496 integer(I4B),
intent(in) :: row
500 if (this%iauxmultcol > 0)
then
501 conc = this%tspvar(row) * this%auxvar(this%iauxmultcol, row)
503 conc = this%tspvar(row)
519 integer(I4B),
intent(in) :: col
520 integer(I4B),
intent(in) :: row
526 bndval = this%conc_mult(row)
528 write (
errmsg,
'(3a)')
'Programming error. ', &
529 & adjustl(trim(this%filtyp)),
' bound value requested column '&
530 &
'outside range of ncolbnd (1).'
This module contains the extended boundary package.
This module contains the base boundary package.
This module contains the BudgetModule.
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
This module contains simulation constants.
integer(i4b), parameter lenpackagename
maximum length of the package name
integer(i4b), parameter namedboundflag
named bound flag
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
real(dp), parameter dzero
real constant zero
real(dp), parameter done
real constant 1
logical function cnc_obs_supported(this)
Procedure related to observation processing.
real(dp) function cnc_bound_value(this, col, row)
@ brief Return a bound value
subroutine define_listlabel(this)
Define labels used in list file.
character(len=lenpackagename) text
subroutine cnc_df_obs(this)
Procedure related to observation processing.
real(dp) function conc_mult(this, row)
Apply auxiliary multiplier to specified concentration if.
character(len=lenftype) ftype
subroutine cnc_ad(this)
Constant concentration/temperature package advance routine.
subroutine cnc_cq(this, x, flowja, iadv)
Calculate flow associated with constant concentration/temperature boundary.
subroutine cnc_rp_ts(this)
Procedure related to time series.
subroutine cnc_ck(this)
Check constant concentration/temperature boundary condition data.
subroutine, public cnc_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, depvartype, mempath)
Create a new constant concentration or temperature package.
subroutine cnc_da(this)
Deallocate memory.
subroutine cnc_allocate_arrays(this, nodelist, auxvar)
Allocate arrays specific to the constant concentration/tempeature package.
subroutine cnc_rp(this)
Constant concentration/temperature read and prepare (rp) routine.
subroutine cnc_bd(this, model_budget)
Add package ratin/ratout to model budget.
subroutine cnc_fc(this, rhs, ia, idxglo, matrix_sln)
Override bnd_fc and do nothing.
This module defines variable data types.
This module contains the derived types ObserveType and ObsDataType.
This module contains the derived type ObsType.
subroutine, public defaultobsidprocessor(obsrv, dis, inunitobs, iout)
@ brief 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.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
real(dp), pointer, public delt
length of the current time step
type(timeserieslinktype) function, pointer, public gettimeserieslinkfromlist(list, indx)
Get time series link from a list.
Derived type for the Budget object.