21 character(len=LENFTYPE) ::
ftype =
'CNC'
22 character(len=LENPACKAGENAME) ::
text =
' CNC'
26 real(dp),
dimension(:),
pointer,
contiguous :: tspvar => null()
27 real(dp),
dimension(:),
pointer,
contiguous :: ratecncin => null()
28 real(dp),
dimension(:),
pointer,
contiguous :: ratecncout => null()
29 character(len=LENVARNAME) :: depvartype =
''
55 subroutine cnc_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
58 class(
bndtype),
pointer :: packobj
59 integer(I4B),
intent(in) :: id
60 integer(I4B),
intent(in) :: ibcnum
61 integer(I4B),
intent(in) :: inunit
62 integer(I4B),
intent(in) :: iout
63 character(len=*),
intent(in) :: namemodel
64 character(len=*),
intent(in) :: pakname
65 character(len=LENVARNAME),
intent(in) :: depvartype
66 character(len=*),
intent(in) :: mempath
75 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, mempath)
79 call cncobj%allocate_scalars()
82 call packobj%pack_initialize()
85 packobj%inunit = inunit
88 packobj%ibcnum = ibcnum
91 cncobj%depvartype = depvartype
102 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
103 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
108 call this%BndExtType%allocate_arrays(nodelist, auxvar)
111 call mem_allocate(this%ratecncin, this%maxbound,
'RATECNCIN', this%memoryPath)
112 call mem_allocate(this%ratecncout, this%maxbound,
'RATECNCOUT', &
114 do i = 1, this%maxbound
115 this%ratecncin(i) =
dzero
116 this%ratecncout(i) =
dzero
119 call mem_setptr(this%tspvar,
'TSPVAR', this%input_mempath)
122 call mem_checkin(this%tspvar,
'TSPVAR', this%memoryPath, &
123 'TSPVAR', this%input_mempath)
137 integer(I4B) :: i, node, ibd, ierr
138 character(len=30) :: nodestr
139 character(len=LENVARNAME) :: dvtype
142 do i = 1, this%nbound
143 node = this%nodelist(i)
144 this%ibound(node) = this%ibcnum
148 call this%BndExtType%bnd_rp()
152 do i = 1, this%nbound
153 node = this%nodelist(i)
154 ibd = this%ibound(node)
156 call this%dis%noder_to_string(node, nodestr)
157 dvtype = trim(this%depvartype)
160 //dvtype//
': '//trim(adjustl(nodestr)))
163 this%ibound(node) = -this%ibcnum
169 call store_error_filename(this%input_fname)
173 if (this%iprpak /= 0)
then
174 call this%write_list()
187 integer(I4B) :: i, node
192 call this%TsManager%ad()
195 do i = 1, this%nbound
196 node = this%nodelist(i)
197 cb = this%conc_mult(i)
200 this%xold(node) = this%xnew(node)
206 call this%obs%obs_ad()
216 character(len=30) :: nodestr
220 character(len=*),
parameter :: fmtcncerr = &
221 &
"('Specified dependent variable boundary ',i0, &
222 &' conc (',g0,') is less than zero for cell', a)"
225 do i = 1, this%nbound
226 node = this%nodelist(i)
228 if (this%conc_mult(i) <
dzero)
then
229 call this%dis%noder_to_string(node, nodestr)
230 write (
errmsg, fmt=fmtcncerr) i, this%tspvar(i), trim(nodestr)
246 subroutine cnc_fc(this, rhs, ia, idxglo, matrix_sln)
249 real(DP),
dimension(:),
intent(inout) :: rhs
250 integer(I4B),
dimension(:),
intent(in) :: ia
251 integer(I4B),
dimension(:),
intent(in) :: idxglo
265 real(DP),
dimension(:),
intent(in) :: x
266 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
267 integer(I4B),
optional,
intent(in) :: iadv
273 integer(I4B) :: idiag
275 real(DP) :: ratein, rateout
279 if (this%nbound > 0)
then
282 do i = 1, this%nbound
283 node = this%nodelist(i)
284 idiag = this%dis%con%ia(node)
290 do ipos = this%dis%con%ia(node) + 1, &
291 this%dis%con%ia(node + 1) - 1
296 n2 = this%dis%con%ja(ipos)
297 if (this%ibound(n2) > 0)
then
301 rateout = rateout + q
312 this%simvals(i) = rate
313 this%ratecncin(i) = ratein
314 this%ratecncout(i) = rateout
315 flowja(idiag) = flowja(idiag) + rate
331 type(
budgettype),
intent(inout) :: model_budget
335 integer(I4B) :: isuppress_output
340 call model_budget%addentry(ratin, ratout,
delt, this%text, &
341 isuppress_output, this%packName)
355 call this%BndExtType%bnd_da()
373 this%listlabel = trim(this%filtyp)//
' NO.'
374 if (this%dis%ndim == 3)
then
375 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
376 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
377 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
378 elseif (this%dis%ndim == 2)
then
379 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
380 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
382 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
384 write (this%listlabel,
'(a, a16)') trim(this%listlabel), &
385 trim(this%depvartype)
386 if (this%inamedbound == 1)
then
387 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
417 call this%obs%StoreObsType(this%filtyp, .true., indx)
434 integer(I4B) :: i, nlinks
437 nlinks = this%TsManager%boundtslinks%Count()
440 if (
associated(tslink))
then
441 select case (tslink%JCol)
443 tslink%Text = trim(this%depvartype)
456 integer(I4B),
intent(in) :: row
460 if (this%iauxmultcol > 0)
then
461 conc = this%tspvar(row) * this%auxvar(this%iauxmultcol, row)
463 conc = this%tspvar(row)
476 integer(I4B),
intent(in) :: col
477 integer(I4B),
intent(in) :: row
483 bndval = this%conc_mult(row)
485 write (
errmsg,
'(3a)')
'Programming error. ', &
486 & adjustl(trim(this%filtyp)),
' bound value requested column '&
487 &
'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.