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)
124 integer(I4B),
intent(in) :: nodeu
125 integer(I4B),
intent(in) :: node
127 character(len=LINELENGTH) :: cellstr
129 character(len=*),
parameter :: fmtvalchg = &
130 "(a, ' package: Setting ', a, ' value for cell ', a, ' at start of &
131 &stress period ', i0, ' = ', g12.5)"
133 if (this%ss_src(nodeu) /=
dnodata)
then
134 if (node < 1 .or. node > this%dis%nodes)
then
135 call this%dis%noder_to_string(node, cellstr)
136 write (
errmsg,
'(a,2(1x,a))') &
137 'CELLID', trim(cellstr),
'is not in the active model domain.'
140 this%ss(node) = this%ss_src(nodeu)
141 call this%validate_change(node,
'SS')
142 if (this%iprpak /= 0)
then
143 call this%dis%noder_to_string(node, cellstr)
144 write (this%iout, fmtvalchg) &
145 trim(adjustl(this%packName)),
'SS', trim(cellstr),
kper, &
151 if (this%sy_src(nodeu) /=
dnodata)
then
152 if (node < 1 .or. node > this%dis%nodes)
then
153 call this%dis%noder_to_string(node, cellstr)
154 write (
errmsg,
'(a,2(1x,a))') &
155 'CELLID', trim(cellstr),
'is not in the active model domain.'
158 this%sy(node) = this%sy_src(nodeu)
159 call this%validate_change(node,
'SY')
160 if (this%iprpak /= 0)
then
161 call this%dis%noder_to_string(node, cellstr)
162 write (this%iout, fmtvalchg) &
163 trim(adjustl(this%packName)),
'SY', trim(cellstr),
kper, &
178 integer(I4B),
intent(in) :: kper
179 integer(I4B),
intent(in) :: kstp
208 integer(I4B),
intent(in) :: n
209 character(len=*),
intent(in) :: varName
211 character(len=LINELENGTH) :: cellstr
213 character(len=*),
parameter :: fmtserr = &
214 "(1x, a, ' changed storage property ', a, ' is < 0 for cell ', a,' ', &
216 character(len=*),
parameter :: fmtsyerr = &
217 "(1x, a, ' cannot change ', a ,' for cell ', a, ' because SY is unused &
218 &in this model (all ICONVERT flags are 0).')"
220 if (varname ==
'SS')
then
221 if (this%ss(n) <
dzero)
then
222 call this%dis%noder_to_string(n, cellstr)
223 write (
errmsg, fmtserr) trim(adjustl(this%packName)),
'SS', &
224 trim(cellstr), this%ss(n)
227 elseif (varname ==
'SY')
then
228 if (this%iusesy /= 1)
then
229 call this%dis%noder_to_string(n, cellstr)
230 write (
errmsg, fmtsyerr) trim(adjustl(this%packName)),
'SY', &
233 elseif (this%sy(n) <
dzero)
then
234 call this%dis%noder_to_string(n, cellstr)
235 write (
errmsg, fmtserr) trim(adjustl(this%packName)),
'SY', &
236 trim(cellstr), this%sy(n)
250 nullify (this%integratechanges)
251 nullify (this%iusesy)
254 nullify (this%ss_src)
255 nullify (this%sy_src)
Apply this node's current input value(s) to the model property array(s).
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_apply_row_changes(this, nodeu, node)
Apply this node's SS/SY input values to node.
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_da(this)
Deallocate package memory.
subroutine, public tvs_cr(tvs, name_model, mempath, inunit, iout)
Create a new TvsType object.