22 character(len=LENFTYPE) ::
ftype =
'CTP'
23 character(len=LENPACKAGENAME) ::
text =
' CTP'
27 real(dp),
dimension(:),
pointer,
contiguous :: tspvar => null()
28 real(dp),
dimension(:),
pointer,
contiguous :: ratectpin => null()
29 real(dp),
dimension(:),
pointer,
contiguous :: ratectpout => null()
30 character(len=LENVARNAME) :: depvartype =
''
56 subroutine ctp_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 ctpobj%allocate_scalars()
83 call packobj%pack_initialize()
86 packobj%inunit = inunit
89 packobj%ibcnum = ibcnum
94 ctpobj%depvartype = depvartype
107 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
108 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
113 call this%BndExtType%allocate_arrays(nodelist, auxvar)
116 call mem_allocate(this%ratectpin, this%maxbound,
'RATECTPIN', this%memoryPath)
117 call mem_allocate(this%ratectpout, this%maxbound,
'RATECTPOUT', &
119 do i = 1, this%maxbound
120 this%ratectpin(i) =
dzero
121 this%ratectpout(i) =
dzero
124 call mem_setptr(this%tspvar,
'TSPVAR', this%input_mempath)
127 call mem_checkin(this%tspvar,
'TSPVAR', this%memoryPath, &
128 'TSPVAR', this%input_mempath)
145 integer(I4B) :: i, node, ibd, ierr
146 character(len=30) :: nodestr
147 character(len=LENVARNAME) :: dvtype
150 do i = 1, this%nbound
151 node = this%nodelist(i)
152 this%ibound(node) = this%ibcnum
156 call this%BndExtType%bnd_rp()
160 do i = 1, this%nbound
161 node = this%nodelist(i)
162 ibd = this%ibound(node)
164 call this%dis%noder_to_string(node, nodestr)
165 dvtype = trim(this%depvartype)
168 //dvtype//
': '//trim(adjustl(nodestr)))
171 this%ibound(node) = -this%ibcnum
177 call store_error_filename(this%input_fname)
181 if (this%iprpak /= 0)
then
182 call this%write_list()
197 integer(I4B) :: i, node
201 call this%TsManager%ad()
204 do i = 1, this%nbound
205 node = this%nodelist(i)
206 cb = this%temp_mult(i)
209 this%xold(node) = this%xnew(node)
215 call this%obs%obs_ad()
227 character(len=30) :: nodestr
231 character(len=*),
parameter :: fmtctperr = &
232 &
"('Specified dependent variable boundary ',i0, &
233 &' temperature (',g0,') is less than zero for cell', a)"
236 do i = 1, this%nbound
237 node = this%nodelist(i)
239 if (this%temp_mult(i) <
dzero)
then
240 call this%dis%noder_to_string(node, nodestr)
241 write (
errmsg, fmt=fmtctperr) i, this%tspvar(i), trim(nodestr)
260 subroutine ctp_fc(this, rhs, ia, idxglo, matrix_sln)
263 real(DP),
dimension(:),
intent(inout) :: rhs
264 integer(I4B),
dimension(:),
intent(in) :: ia
265 integer(I4B),
dimension(:),
intent(in) :: idxglo
279 real(DP),
dimension(:),
intent(in) :: x
280 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
281 integer(I4B),
optional,
intent(in) :: iadv
287 integer(I4B) :: idiag
289 real(DP) :: ratein, rateout
293 if (this%nbound > 0)
then
296 do i = 1, this%nbound
297 node = this%nodelist(i)
298 idiag = this%dis%con%ia(node)
304 do ipos = this%dis%con%ia(node) + 1, &
305 this%dis%con%ia(node + 1) - 1
310 n2 = this%dis%con%ja(ipos)
311 if (this%ibound(n2) > 0)
then
315 rateout = rateout + q
326 this%simvals(i) = rate
327 this%ratectpin(i) = ratein
328 this%ratectpout(i) = rateout
329 flowja(idiag) = flowja(idiag) + rate
348 type(
budgettype),
intent(inout) :: model_budget
352 integer(I4B) :: isuppress_output
357 call model_budget%addentry(ratin, ratout,
delt, this%text, &
358 isuppress_output, this%packName)
375 call this%BndExtType%bnd_da()
396 this%listlabel = trim(this%filtyp)//
' NO.'
397 if (this%dis%ndim == 3)
then
398 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
399 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
400 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
401 elseif (this%dis%ndim == 2)
then
402 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
403 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
405 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
407 write (this%listlabel,
'(a, a16)') trim(this%listlabel), &
408 trim(this%depvartype)
409 if (this%inamedbound == 1)
then
410 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
446 call this%obs%StoreObsType(this%filtyp, .true., indx)
465 integer(I4B) :: i, nlinks
468 nlinks = this%TsManager%boundtslinks%Count()
471 if (
associated(tslink))
then
472 select case (tslink%JCol)
474 tslink%Text = trim(this%depvartype)
490 integer(I4B),
intent(in) :: row
494 if (this%iauxmultcol > 0)
then
495 temp = this%tspvar(row) * this%auxvar(this%iauxmultcol, row)
497 temp = this%tspvar(row)
513 integer(I4B),
intent(in) :: col
514 integer(I4B),
intent(in) :: row
520 bndval = this%temp_mult(row)
522 write (
errmsg,
'(3a)')
'Programming error. ', &
523 & adjustl(trim(this%filtyp)),
' bound value requested column '&
524 &
'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
subroutine ctp_bd(this, model_budget)
Add package ratin/ratout to model budget.
character(len=lenpackagename) text
subroutine ctp_cq(this, x, flowja, iadv)
Calculate flow associated with constant temperature boundary.
real(dp) function temp_mult(this, row)
Apply auxiliary multiplier to specified temperature if.
subroutine ctp_rp(this)
Constant temperature read and prepare (rp) routine.
real(dp) function ctp_bound_value(this, col, row)
@ brief Return a bound value
subroutine ctp_rp_ts(this)
Procedure related to time series.
logical function ctp_obs_supported(this)
Procedure related to observation processing.
subroutine ctp_df_obs(this)
Procedure related to observation processing.
subroutine ctp_da(this)
Deallocate memory.
subroutine define_listlabel(this)
Define labels used in list file.
subroutine ctp_allocate_arrays(this, nodelist, auxvar)
Allocate arrays specific to the constant temperature package.
character(len=lenftype) ftype
subroutine ctp_fc(this, rhs, ia, idxglo, matrix_sln)
Override bnd_fc and do nothing.
subroutine ctp_ad(this)
Constant temperature package advance routine.
subroutine ctp_ck(this)
Check constant temperature boundary condition data.
subroutine, public ctp_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, depvartype, mempath)
Create a new constant temperature package.
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.