26 integer(I4B),
pointer :: integratechanges => null()
27 integer(I4B),
pointer :: iusesy => null()
28 real(dp),
dimension(:),
pointer,
contiguous :: ss => null()
29 real(dp),
dimension(:),
pointer,
contiguous :: sy => null()
48 subroutine tvs_cr(tvs, name_model, inunit, iout)
50 type(
tvstype),
pointer,
intent(out) :: tvs
51 character(len=*),
intent(in) :: name_model
52 integer(I4B),
intent(in) :: inunit
53 integer(I4B),
intent(in) :: iout
56 call tvs%init(name_model,
'TVS',
'TVS', inunit, iout)
68 character(len=LENMEMPATH) :: stoMemoryPath
70 character(len=*),
parameter :: fmttvs = &
71 "(1x,/1x,'TVS -- TIME-VARYING S PACKAGE, VERSION 1, 08/18/2021', &
72 &' INPUT READ FROM UNIT ', i0, //)"
75 write (this%iout, fmttvs) this%inunit
80 call mem_setptr(this%integratechanges,
'INTEGRATECHANGES', stomemorypath)
81 call mem_setptr(this%iusesy,
'IUSESY', stomemorypath)
86 this%integratechanges = 1
97 character(len=*),
intent(in) :: keyword
101 character(len=*),
parameter :: fmtdsci = &
102 "(4X, 'DISABLE_STORAGE_CHANGE_INTEGRATION OPTION:', /, 1X, &
103 &'Storage derivative terms will not be added to STO matrix formulation')"
105 select case (keyword)
106 case (
'DISABLE_STORAGE_CHANGE_INTEGRATION')
108 this%integratechanges = 0
109 write (this%iout, fmtdsci)
123 integer(I4B),
intent(in) :: n
124 character(len=*),
intent(in) :: varname
126 real(dp),
pointer :: bndelem
128 select case (varname)
130 bndelem => this%ss(n)
132 bndelem => this%sy(n)
146 integer(I4B),
intent(in) :: kper
147 integer(I4B),
intent(in) :: kstp
176 integer(I4B),
intent(in) :: n
177 character(len=*),
intent(in) :: varName
179 character(len=LINELENGTH) :: cellstr
181 character(len=*),
parameter :: fmtserr = &
182 "(1x, a, ' changed storage property ', a, ' is < 0 for cell ', a,' ', &
184 character(len=*),
parameter :: fmtsyerr = &
185 "(1x, a, ' cannot change ', a ,' for cell ', a, ' because SY is unused &
186 &in this model (all ICONVERT flags are 0).')"
189 if (varname ==
'SS')
then
190 if (this%ss(n) <
dzero)
then
191 call this%dis%noder_to_string(n, cellstr)
192 write (
errmsg, fmtserr) trim(adjustl(this%packName)),
'SS', &
193 trim(cellstr), this%ss(n)
196 elseif (varname ==
'SY')
then
197 if (this%iusesy /= 1)
then
198 call this%dis%noder_to_string(n, cellstr)
199 write (
errmsg, fmtsyerr) trim(adjustl(this%packName)),
'SY', &
202 elseif (this%sy(n) <
dzero)
then
203 call this%dis%noder_to_string(n, cellstr)
204 write (
errmsg, fmtserr) trim(adjustl(this%packName)),
'SY', &
205 trim(cellstr), this%sy(n)
220 nullify (this%integratechanges)
221 nullify (this%iusesy)
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 lenmempath
maximum length of the memory path
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
This module contains common time-varying property functionality.
subroutine, public tvbase_da(this)
Deallocate package memory.
This module contains the time-varying storage package methods.
subroutine tvs_ar_set_pointers(this)
Announce package and set pointers to variables.
subroutine tvs_validate_change(this, n, varName)
Check that a given property value is valid.
subroutine tvs_set_changed_at(this, kper, kstp)
Mark property changes as having occurred at (kper, kstp)
logical function tvs_read_option(this, keyword)
Read a TVS-specific option from the OPTIONS block.
real(dp) function, pointer tvs_get_pointer_to_value(this, n, varName)
Get an array value pointer given a variable name and node index.
subroutine tvs_reset_change_flags(this)
Clear all per-node change flags.
subroutine tvs_da(this)
Deallocate package memory.
subroutine, public tvs_cr(tvs, name_model, inunit, iout)
Create a new TvsType object.