21 character(len=LENFTYPE) ::
ftype =
'CTP'
22 character(len=LENPACKAGENAME) ::
text =
' CTP'
26 real(dp),
dimension(:),
pointer,
contiguous :: tspvar => null()
27 real(dp),
dimension(:),
pointer,
contiguous :: ratectpin => null()
28 real(dp),
dimension(:),
pointer,
contiguous :: ratectpout => null()
29 character(len=LENVARNAME) :: depvartype =
''
55 subroutine ctp_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 ctpobj%allocate_scalars()
82 call packobj%pack_initialize()
85 packobj%inunit = inunit
88 packobj%ibcnum = ibcnum
93 ctpobj%depvartype = depvartype
103 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
104 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
109 call this%BndExtType%allocate_arrays(nodelist, auxvar)
112 call mem_allocate(this%ratectpin, this%maxbound,
'RATECTPIN', this%memoryPath)
113 call mem_allocate(this%ratectpout, this%maxbound,
'RATECTPOUT', &
115 do i = 1, this%maxbound
116 this%ratectpin(i) =
dzero
117 this%ratectpout(i) =
dzero
120 call mem_setptr(this%tspvar,
'TSPVAR', this%input_mempath)
123 call mem_checkin(this%tspvar,
'TSPVAR', this%memoryPath, &
124 'TSPVAR', this%input_mempath)
138 integer(I4B) :: i, node, ibd, ierr
139 character(len=30) :: nodestr
140 character(len=LENVARNAME) :: dvtype
143 do i = 1, this%nbound
144 node = this%nodelist(i)
145 this%ibound(node) = this%ibcnum
149 call this%BndExtType%bnd_rp()
153 do i = 1, this%nbound
154 node = this%nodelist(i)
155 ibd = this%ibound(node)
157 call this%dis%noder_to_string(node, nodestr)
158 dvtype = trim(this%depvartype)
161 //dvtype//
': '//trim(adjustl(nodestr)))
164 this%ibound(node) = -this%ibcnum
170 call store_error_filename(this%input_fname)
174 if (this%iprpak /= 0)
then
175 call this%write_list()
187 integer(I4B) :: i, node
191 call this%TsManager%ad()
194 do i = 1, this%nbound
195 node = this%nodelist(i)
196 cb = this%temp_mult(i)
199 this%xold(node) = this%xnew(node)
205 call this%obs%obs_ad()
214 character(len=30) :: nodestr
218 character(len=*),
parameter :: fmtctperr = &
219 &
"('Specified dependent variable boundary ',i0, &
220 &' temperature (',g0,') is less than zero for cell', a)"
223 do i = 1, this%nbound
224 node = this%nodelist(i)
226 if (this%temp_mult(i) <
dzero)
then
227 call this%dis%noder_to_string(node, nodestr)
228 write (
errmsg, fmt=fmtctperr) i, this%tspvar(i), trim(nodestr)
244 subroutine ctp_fc(this, rhs, ia, idxglo, matrix_sln)
247 real(DP),
dimension(:),
intent(inout) :: rhs
248 integer(I4B),
dimension(:),
intent(in) :: ia
249 integer(I4B),
dimension(:),
intent(in) :: idxglo
260 real(DP),
dimension(:),
intent(in) :: x
261 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
262 integer(I4B),
optional,
intent(in) :: iadv
268 integer(I4B) :: idiag
270 real(DP) :: ratein, rateout
274 if (this%nbound > 0)
then
277 do i = 1, this%nbound
278 node = this%nodelist(i)
279 idiag = this%dis%con%ia(node)
285 do ipos = this%dis%con%ia(node) + 1, &
286 this%dis%con%ia(node + 1) - 1
291 n2 = this%dis%con%ja(ipos)
292 if (this%ibound(n2) > 0)
then
296 rateout = rateout + q
307 this%simvals(i) = rate
308 this%ratectpin(i) = ratein
309 this%ratectpout(i) = rateout
310 flowja(idiag) = flowja(idiag) + rate
326 type(
budgettype),
intent(inout) :: model_budget
330 integer(I4B) :: isuppress_output
335 call model_budget%addentry(ratin, ratout,
delt, this%text, &
336 isuppress_output, this%packName)
350 call this%BndExtType%bnd_da()
368 this%listlabel = trim(this%filtyp)//
' NO.'
369 if (this%dis%ndim == 3)
then
370 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
371 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
372 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
373 elseif (this%dis%ndim == 2)
then
374 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
375 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
377 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
379 write (this%listlabel,
'(a, a16)') trim(this%listlabel), &
380 trim(this%depvartype)
381 if (this%inamedbound == 1)
then
382 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
412 call this%obs%StoreObsType(this%filtyp, .true., indx)
428 integer(I4B) :: i, nlinks
431 nlinks = this%TsManager%boundtslinks%Count()
434 if (
associated(tslink))
then
435 select case (tslink%JCol)
437 tslink%Text = trim(this%depvartype)
450 integer(I4B),
intent(in) :: row
454 if (this%iauxmultcol > 0)
then
455 temp = this%tspvar(row) * this%auxvar(this%iauxmultcol, row)
457 temp = this%tspvar(row)
470 integer(I4B),
intent(in) :: col
471 integer(I4B),
intent(in) :: row
477 bndval = this%temp_mult(row)
479 write (
errmsg,
'(3a)')
'Programming error. ', &
480 & adjustl(trim(this%filtyp)),
' bound value requested column '&
481 &
'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.