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)
180 call this%NumericalPackageType%allocate_scalars()
183 allocate (this%tsmanager)
193 subroutine ar(this, dis)
200 call this%ar_set_pointers()
205 removetslinksoncompletion=.true., &
206 extendtstoendofsimulation=.true.)
209 call this%read_options()
213 call this%tsmanager%tsmanager_df()
217 call this%parser%StoreErrorUnit()
234 character(len=LINELENGTH) :: keyword
235 character(len=MAXCHARLEN) :: fname
237 logical :: endOfBlock
240 character(len=*),
parameter :: fmtts = &
241 &
"(4x, 'TIME-SERIES DATA WILL BE READ FROM FILE: ', a)"
244 call this%parser%GetBlock(
'OPTIONS', isfound, ierr, &
245 blockrequired=.false., supportopenclose=.true.)
249 write (this%iout,
'(1x,a)') &
250 'PROCESSING '//trim(adjustl(this%packName))//
' OPTIONS'
252 call this%parser%GetNextLine(endofblock)
256 call this%parser%GetStringCaps(keyword)
257 select case (keyword)
260 write (this%iout,
'(4x,a)')
'TIME-VARYING INPUT WILL BE PRINTED.'
264 call this%parser%GetStringCaps(keyword)
265 if (trim(adjustl(keyword)) /=
'FILEIN')
then
267 'TS6 keyword must be followed by "FILEIN" then by filename.'
269 call this%parser%StoreErrorUnit()
272 call this%parser%GetString(fname)
273 write (this%iout, fmtts) trim(fname)
274 call this%tsmanager%add_tsfile(fname, this%inunit)
279 if (.not. this%read_option(keyword))
then
280 write (
errmsg,
'(a,3(1x,a),a)') &
281 'Unknown', trim(adjustl(this%packName)),
"option '", &
287 write (this%iout,
'(1x,a)') &
288 'END OF '//trim(adjustl(this%packName))//
' OPTIONS'
303 character(len=LINELENGTH) :: line, cellid, varName, text
304 logical :: isfound, endOfBlock, haveChanges
305 integer(I4B) :: ierr, node
306 real(DP),
pointer :: bndElem => null()
308 character(len=*),
parameter :: fmtblkerr = &
309 &
"('Looking for BEGIN PERIOD iper. Found ', a, ' instead.')"
310 character(len=*),
parameter :: fmtvalchg = &
311 "(a, ' package: Setting ', a, ' value for cell ', a, ' at start of &
312 &stress period ', i0, ' = ', g12.5)"
314 if (this%inunit == 0)
return
317 if (this%ionper <
kper)
then
320 call this%parser%GetBlock(
'PERIOD', isfound, ierr, &
321 supportopenclose=.true., &
322 blockrequired=.false.)
326 call this%read_check_ionper()
332 this%ionper =
nper + 1
335 call this%parser%GetCurrentLine(line)
336 write (
errmsg, fmtblkerr) adjustl(trim(line))
343 if (this%ionper ==
kper)
then
346 call this%reset_change_flags()
348 havechanges = .false.
350 call this%parser%GetNextLine(endofblock)
356 call this%parser%GetCellid(this%dis%ndim, cellid)
357 node = this%dis%noder_from_cellid(cellid, this%parser%iuactive, &
361 if (node < 1 .or. node > this%dis%nodes)
then
362 write (
errmsg,
'(a,2(1x,a))') &
363 'CELLID', cellid,
'is not in the active model domain.'
369 call this%parser%GetStringCaps(varname)
373 bndelem => this%get_pointer_to_value(node, varname)
374 if (.not.
associated(bndelem))
then
375 write (
errmsg,
'(a,3(1x,a),a)') &
376 'Unknown', trim(adjustl(this%packName)),
"variable '", &
383 call this%parser%GetString(text)
385 this%packName,
'BND', &
386 this%tsmanager, this%iprpak, &
390 if (this%iprpak /= 0)
then
391 write (this%iout, fmtvalchg) &
392 trim(adjustl(this%packName)), trim(varname), trim(cellid), &
397 call this%validate_change(node, varname)
403 if (havechanges)
then
404 call this%set_changed_at(
kper, 1)
410 call this%parser%StoreErrorUnit()
426 integer(I4B) :: i, n, numlinks
431 call this%tsmanager%ad()
435 numlinks = this%tsmanager%CountLinks(
'BND')
436 if (numlinks <= 0)
then
442 call this%set_changed_at(
kper,
kstp)
447 call this%reset_change_flags()
452 tslink => this%tsmanager%GetLink(
'BND', i)
454 call this%validate_change(n, tslink%Text)
459 call this%parser%StoreErrorUnit()
476 deallocate (this%tsmanager)
479 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.