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)
71 character(len=LENMEMPATH) :: stoMemoryPath
73 character(len=*),
parameter :: fmttvs = &
74 "(1x,/1x,'TVS -- TIME-VARYING S PACKAGE, VERSION 1, 08/18/2021', &
75 &' INPUT READ FROM UNIT ', i0, //)"
78 write (this%iout, fmttvs) this%inunit
83 call mem_setptr(this%integratechanges,
'INTEGRATECHANGES', stomemorypath)
84 call mem_setptr(this%iusesy,
'IUSESY', stomemorypath)
89 this%integratechanges = 1
103 character(len=*),
intent(in) :: keyword
107 character(len=*),
parameter :: fmtdsci = &
108 "(4X, 'DISABLE_STORAGE_CHANGE_INTEGRATION OPTION:', /, 1X, &
109 &'Storage derivative terms will not be added to STO matrix formulation')"
111 select case (keyword)
112 case (
'DISABLE_STORAGE_CHANGE_INTEGRATION')
114 this%integratechanges = 0
115 write (this%iout, fmtdsci)
132 integer(I4B),
intent(in) :: n
133 character(len=*),
intent(in) :: varname
135 real(dp),
pointer :: bndelem
137 select case (varname)
139 bndelem => this%ss(n)
141 bndelem => this%sy(n)
158 integer(I4B),
intent(in) :: kper
159 integer(I4B),
intent(in) :: kstp
194 integer(I4B),
intent(in) :: n
195 character(len=*),
intent(in) :: varName
197 character(len=LINELENGTH) :: cellstr
199 character(len=*),
parameter :: fmtserr = &
200 "(1x, a, ' changed storage property ', a, ' is < 0 for cell ', a,' ', &
202 character(len=*),
parameter :: fmtsyerr = &
203 "(1x, a, ' cannot change ', a ,' for cell ', a, ' because SY is unused &
204 &in this model (all ICONVERT flags are 0).')"
207 if (varname ==
'SS')
then
208 if (this%ss(n) <
dzero)
then
209 call this%dis%noder_to_string(n, cellstr)
210 write (
errmsg, fmtserr) trim(adjustl(this%packName)),
'SS', &
211 trim(cellstr), this%ss(n)
214 elseif (varname ==
'SY')
then
215 if (this%iusesy /= 1)
then
216 call this%dis%noder_to_string(n, cellstr)
217 write (
errmsg, fmtsyerr) trim(adjustl(this%packName)),
'SY', &
220 elseif (this%sy(n) <
dzero)
then
221 call this%dis%noder_to_string(n, cellstr)
222 write (
errmsg, fmtserr) trim(adjustl(this%packName)),
'SY', &
223 trim(cellstr), this%sy(n)
241 nullify (this%integratechanges)
242 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.