72 character(len=*),
intent(in) :: keyword
89 integer(I4B),
intent(in) :: n
90 character(len=*),
intent(in) :: varname
92 real(dp),
pointer :: bndelem
107 integer(I4B),
intent(in) :: kper
108 integer(I4B),
intent(in) :: kstp
139 integer(I4B),
intent(in) :: n
140 character(len=*),
intent(in) :: varName
152 subroutine init(this, name_model, pakname, ftype, inunit, iout)
155 character(len=*),
intent(in) :: name_model
156 character(len=*),
intent(in) :: pakname
157 character(len=*),
intent(in) :: ftype
158 integer(I4B),
intent(in) :: inunit
159 integer(I4B),
intent(in) :: iout
161 call this%set_names(1, name_model, pakname, ftype)
162 call this%tvbase_allocate_scalars()
165 call this%parser%Initialize(this%inunit, this%iout)
178 call this%NumericalPackageType%allocate_scalars()
181 allocate (this%tsmanager)
189 subroutine ar(this, dis)
196 call this%ar_set_pointers()
201 removetslinksoncompletion=.true., &
202 extendtstoendofsimulation=.true.)
205 call this%read_options()
209 call this%tsmanager%tsmanager_df()
213 call this%parser%StoreErrorUnit()
228 character(len=LINELENGTH) :: keyword
229 character(len=MAXCHARLEN) :: fname
231 logical :: endOfBlock
234 character(len=*),
parameter :: fmtts = &
235 &
"(4x, 'TIME-SERIES DATA WILL BE READ FROM FILE: ', a)"
238 call this%parser%GetBlock(
'OPTIONS', isfound, ierr, &
239 blockrequired=.false., supportopenclose=.true.)
243 write (this%iout,
'(1x,a)') &
244 'PROCESSING '//trim(adjustl(this%packName))//
' OPTIONS'
246 call this%parser%GetNextLine(endofblock)
250 call this%parser%GetStringCaps(keyword)
251 select case (keyword)
254 write (this%iout,
'(4x,a)')
'TIME-VARYING INPUT WILL BE PRINTED.'
258 call this%parser%GetStringCaps(keyword)
259 if (trim(adjustl(keyword)) /=
'FILEIN')
then
261 'TS6 keyword must be followed by "FILEIN" then by filename.'
263 call this%parser%StoreErrorUnit()
266 call this%parser%GetString(fname)
267 write (this%iout, fmtts) trim(fname)
268 call this%tsmanager%add_tsfile(fname, this%inunit)
273 if (.not. this%read_option(keyword))
then
274 write (
errmsg,
'(a,3(1x,a),a)') &
275 'Unknown', trim(adjustl(this%packName)),
"option '", &
281 write (this%iout,
'(1x,a)') &
282 'END OF '//trim(adjustl(this%packName))//
' OPTIONS'
295 character(len=LINELENGTH) :: line, cellid, varName, text
296 logical :: isfound, endOfBlock, haveChanges
297 integer(I4B) :: ierr, node
298 real(DP),
pointer :: bndElem => null()
300 character(len=*),
parameter :: fmtblkerr = &
301 &
"('Looking for BEGIN PERIOD iper. Found ', a, ' instead.')"
302 character(len=*),
parameter :: fmtvalchg = &
303 "(a, ' package: Setting ', a, ' value for cell ', a, ' at start of &
304 &stress period ', i0, ' = ', g12.5)"
306 if (this%inunit == 0)
return
309 if (this%ionper <
kper)
then
312 call this%parser%GetBlock(
'PERIOD', isfound, ierr, &
313 supportopenclose=.true., &
314 blockrequired=.false.)
318 call this%read_check_ionper()
324 this%ionper =
nper + 1
327 call this%parser%GetCurrentLine(line)
328 write (
errmsg, fmtblkerr) adjustl(trim(line))
335 if (this%ionper ==
kper)
then
338 call this%reset_change_flags()
340 havechanges = .false.
342 call this%parser%GetNextLine(endofblock)
348 call this%parser%GetCellid(this%dis%ndim, cellid)
349 node = this%dis%noder_from_cellid(cellid, this%parser%iuactive, &
353 if (node < 1 .or. node > this%dis%nodes)
then
354 write (
errmsg,
'(a,2(1x,a))') &
355 'CELLID', cellid,
'is not in the active model domain.'
361 call this%parser%GetStringCaps(varname)
365 bndelem => this%get_pointer_to_value(node, varname)
366 if (.not.
associated(bndelem))
then
367 write (
errmsg,
'(a,3(1x,a),a)') &
368 'Unknown', trim(adjustl(this%packName)),
"variable '", &
375 call this%parser%GetString(text)
377 this%packName,
'BND', &
378 this%tsmanager, this%iprpak, &
382 if (this%iprpak /= 0)
then
383 write (this%iout, fmtvalchg) &
384 trim(adjustl(this%packName)), trim(varname), trim(cellid), &
389 call this%validate_change(node, varname)
395 if (havechanges)
then
396 call this%set_changed_at(
kper, 1)
402 call this%parser%StoreErrorUnit()
416 integer(I4B) :: i, n, numlinks
421 call this%tsmanager%ad()
425 numlinks = this%tsmanager%CountLinks(
'BND')
426 if (numlinks <= 0)
then
432 call this%set_changed_at(
kper,
kstp)
437 call this%reset_change_flags()
442 tslink => this%tsmanager%GetLink(
'BND', i)
444 call this%validate_change(n, tslink%Text)
449 call this%parser%StoreErrorUnit()
464 deallocate (this%tsmanager)
467 call this%NumericalPackageType%da()
Announce package and set pointers to variables.
Get an array value pointer given a variable name and node index.
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.
integer(i4b), parameter linelength
maximum length of a standard line
real(dp), parameter dzero
real constant zero
integer(i4b), parameter maxcharlen
maximum length of char string
This module defines variable data types.
This module contains the base numerical package type.
This module contains simulation methods.
subroutine, public ustop(stopmess, ioutlocal)
Stop the simulation.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
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
subroutine, public read_value_or_time_series_adv(textInput, ii, jj, bndElem, pkgName, auxOrBnd, tsManager, iprpak, varName)
Call this subroutine from advanced packages to define timeseries link for a variable (varName).
subroutine, public tsmanager_cr(this, iout, removeTsLinksOnCompletion, extendTsToEndOfSimulation)
Create the tsmanager.
This module contains common time-varying property functionality.
subroutine read_options(this)
Read OPTIONS block of package input file.
subroutine, public tvbase_da(this)
Deallocate package memory.
subroutine tvbase_allocate_scalars(this)
Allocate scalar variables.
subroutine rp(this)
Read and prepare method for package.
subroutine ad(this)
Advance the package.
subroutine ar(this, dis)
Allocate and read method for package.