27 integer(I4B),
pointer :: integratechanges => null()
28 integer(I4B),
pointer :: iusesy => null()
29 real(dp),
dimension(:),
pointer,
contiguous :: ss => null()
30 real(dp),
dimension(:),
pointer,
contiguous :: sy => null()
31 real(dp),
dimension(:),
pointer,
contiguous :: ss_src => null()
32 real(dp),
dimension(:),
pointer,
contiguous :: sy_src => null()
51 subroutine tvs_cr(tvs, name_model, mempath, inunit, iout)
53 type(
tvstype),
pointer,
intent(out) :: tvs
54 character(len=*),
intent(in) :: name_model
55 character(len=*),
intent(in) :: mempath
56 integer(I4B),
intent(in) :: inunit
57 integer(I4B),
intent(in) :: iout
60 call tvs%init(name_model,
'TVS',
'TVS', mempath, inunit, iout)
72 character(len=LENMEMPATH) :: stoMemoryPath
74 character(len=*),
parameter :: fmttvs = &
75 "(1x,/1x,'TVS -- TIME-VARYING S PACKAGE, VERSION 1, 08/18/2021', &
76 &' INPUT READ FROM MEMPATH ', A, //)"
78 write (this%iout, fmttvs) this%input_mempath
81 call mem_setptr(this%integratechanges,
'INTEGRATECHANGES', stomemorypath)
82 call mem_setptr(this%iusesy,
'IUSESY', stomemorypath)
87 this%integratechanges = 1
90 call mem_setptr(this%ss_src,
'SS', this%input_mempath)
91 call mem_setptr(this%sy_src,
'SY', this%input_mempath)
100 integer(I4B) :: isize
102 character(len=*),
parameter :: fmtdsci = &
103 "(4X, 'DISABLE_STORAGE_CHANGE_INTEGRATION OPTION:', /, 6X, &
104 &'Storage derivative terms will not be added to STO matrix formulation')"
107 call get_isize(
'DISABLE_SC_INT', this%input_mempath, isize)
109 this%integratechanges = 0
110 write (this%iout, fmtdsci)
119 integer(I4B),
intent(in) :: n
120 integer(I4B),
intent(in) :: node
122 character(len=LINELENGTH) :: cellstr
124 character(len=*),
parameter :: fmtvalchg = &
125 "(a, ' package: Setting ', a, ' value for cell ', a, ' at start of &
126 &stress period ', i0, ' = ', g12.5)"
128 if (this%ss_src(n) /=
dnodata)
then
129 this%ss(node) = this%ss_src(n)
130 call this%validate_change(node,
'SS')
131 if (this%iprpak /= 0)
then
132 call this%dis%noder_to_string(node, cellstr)
133 write (this%iout, fmtvalchg) &
134 trim(adjustl(this%packName)),
'SS', trim(cellstr),
kper, this%ss(node)
138 if (this%sy_src(n) /=
dnodata)
then
139 this%sy(node) = this%sy_src(n)
140 call this%validate_change(node,
'SY')
141 if (this%iprpak /= 0)
then
142 call this%dis%noder_to_string(node, cellstr)
143 write (this%iout, fmtvalchg) &
144 trim(adjustl(this%packName)),
'SY', trim(cellstr),
kper, this%sy(node)
157 integer(I4B),
intent(in) :: kper
158 integer(I4B),
intent(in) :: kstp
187 integer(I4B),
intent(in) :: n
188 character(len=*),
intent(in) :: varName
190 character(len=LINELENGTH) :: cellstr
192 character(len=*),
parameter :: fmtserr = &
193 "(1x, a, ' changed storage property ', a, ' is < 0 for cell ', a,' ', &
195 character(len=*),
parameter :: fmtsyerr = &
196 "(1x, a, ' cannot change ', a ,' for cell ', a, ' because SY is unused &
197 &in this model (all ICONVERT flags are 0).')"
199 if (varname ==
'SS')
then
200 if (this%ss(n) <
dzero)
then
201 call this%dis%noder_to_string(n, cellstr)
202 write (
errmsg, fmtserr) trim(adjustl(this%packName)),
'SS', &
203 trim(cellstr), this%ss(n)
206 elseif (varname ==
'SY')
then
207 if (this%iusesy /= 1)
then
208 call this%dis%noder_to_string(n, cellstr)
209 write (
errmsg, fmtsyerr) trim(adjustl(this%packName)),
'SY', &
212 elseif (this%sy(n) <
dzero)
then
213 call this%dis%noder_to_string(n, cellstr)
214 write (
errmsg, fmtserr) trim(adjustl(this%packName)),
'SY', &
215 trim(cellstr), this%sy(n)
229 nullify (this%integratechanges)
230 nullify (this%iusesy)
233 nullify (this%ss_src)
234 nullify (this%sy_src)
Apply input column changes for period-data row n to node.
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 dnodata
real no data constant
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
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
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
integer(i4b), pointer, public kper
current stress period number
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)
subroutine tvs_source_package_options(this)
Source TVS-specific options from the input memory path.
subroutine tvs_reset_change_flags(this)
Clear all per-node change flags.
subroutine tvs_apply_row_changes(this, n, node)
Apply input SS/SY column changes for period-data row n to node.
subroutine tvs_da(this)
Deallocate package memory.
subroutine, public tvs_cr(tvs, name_model, mempath, inunit, iout)
Create a new TvsType object.