28 logical(LGP) :: ts_active = .false.
29 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid => null()
78 integer(I4B),
intent(in) :: nodeu
79 integer(I4B),
intent(in) :: node
93 integer(I4B),
intent(in) :: kper
94 integer(I4B),
intent(in) :: kstp
124 integer(I4B),
intent(in) :: n
125 character(len=*),
intent(in) :: varName
136 subroutine init(this, name_model, pakname, ftype, mempath, inunit, iout)
139 character(len=*),
intent(in) :: name_model
140 character(len=*),
intent(in) :: pakname
141 character(len=*),
intent(in) :: ftype
142 character(len=*),
intent(in) :: mempath
143 integer(I4B),
intent(in) :: inunit
144 integer(I4B),
intent(in) :: iout
146 call this%set_names(1, name_model, pakname, ftype, mempath)
147 call this%tvbase_allocate_scalars()
161 call this%NumericalPackageType%allocate_scalars()
175 integer(I4B) :: isize
176 logical(LGP) :: found_print_input
178 write (this%iout,
'(1x,a)') &
179 'PROCESSING '//trim(adjustl(this%packName))//
' OPTIONS'
181 call mem_set_value(this%iprpak,
'PRINT_INPUT', this%input_mempath, &
184 if (found_print_input)
then
185 write (this%iout,
'(4x,a)')
'TIME-VARYING INPUT WILL BE PRINTED.'
188 call get_isize(
'TS6_FILENAME', this%input_mempath, isize)
189 if (isize > 0) this%ts_active = .true.
192 call this%source_package_options()
194 write (this%iout,
'(1x,a)') &
195 'END OF '//trim(adjustl(this%packName))//
' OPTIONS'
212 subroutine ar(this, dis)
218 call this%ar_set_pointers()
220 call this%source_options()
223 call mem_setptr(this%cellid,
'CELLID', this%input_mempath)
224 call this%tracked_nodeu%init()
237 integer(I4B),
pointer :: iper, nbound
238 integer(I4B) :: n, nodeu, nodeu_count
241 call mem_setptr(iper,
'IPER', this%input_mempath)
242 if (iper /=
kper)
return
247 call mem_setptr(nbound,
'NBOUND', this%input_mempath)
249 nodeu_count = product(this%dis%mshape)
251 nodeu = this%cellid_to_nodeu(n)
252 if (nodeu < 1 .or. nodeu > nodeu_count)
then
253 write (
errmsg,
'(a,i0,a)') &
254 'CELLID at PERIOD row ', n,
' is not in the active model domain.'
258 call this%tracked_nodeu%push_back_unique(nodeu)
263 if (this%ts_active)
return
265 call this%sync_node_changes()
275 if (.not. this%ts_active)
return
277 call this%sync_node_changes()
287 integer(I4B) :: i, nodeu, node
289 if (this%tracked_nodeu%size <= 0)
return
291 call this%set_changed_at(
kper,
kstp)
292 call this%reset_change_flags()
294 do i = 1, this%tracked_nodeu%size
295 nodeu = this%tracked_nodeu%at(i)
296 node = this%dis%get_nodenumber(nodeu, 1)
297 call this%apply_row_changes(nodeu, node)
310 integer(I4B),
intent(in) :: n
312 integer(I4B) :: nodeu
314 if (this%dis%ndim == 1)
then
315 nodeu = this%cellid(1, n)
316 elseif (this%dis%ndim == 2)
then
317 nodeu =
get_node(this%cellid(1, n), 1, &
319 this%dis%mshape(1), 1, &
322 nodeu =
get_node(this%cellid(1, n), &
325 this%dis%mshape(1), &
326 this%dis%mshape(2), &
339 nullify (this%cellid)
340 call this%tracked_nodeu%destroy()
341 call this%NumericalPackageType%da()
Apply this node's current input value(s) to the model property array(s).
Announce package and set pointers to variables.
Clear all per-node change flags.
Mark property changes as having occurred at (kper, kstp)
Check that a given property value is valid.
This module contains simulation constants.
real(dp), parameter dzero
real constant zero
integer(i4b), parameter maxcharlen
maximum length of char string
integer(i4b) function, public get_node(ilay, irow, icol, nlay, nrow, ncol)
Get node number, given layer, row, and column indices for a structured grid. If any argument is inval...
This module defines variable data types.
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
This module contains the base numerical package type.
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
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
integer(i4b), pointer, public nper
number of stress period
This module contains common time-varying property functionality.
subroutine tvbase_source_options(this)
Source common options from the input memory path.
integer(i4b) function cellid_to_nodeu(this, n)
Return the unreduced node number for CELLID row n.
subroutine, public tvbase_da(this)
Deallocate package memory.
subroutine tvbase_allocate_scalars(this)
Allocate scalar variables.
subroutine rp(this)
Read and prepare stress period data for the package.
subroutine tvbase_source_package_options(this)
Source package-specific options from the input memory path.
subroutine sync_node_changes(this)
Sync every tracked node's current input value into the model property array(s) it belongs to (e....
subroutine ad(this)
Apply advanced values at each time step.
subroutine ar(this, dis)
Allocate and read static data for the package.