27 integer(I4B),
pointer :: ik22overk => null()
28 integer(I4B),
pointer :: ik33overk => null()
29 real(dp),
dimension(:),
pointer,
contiguous :: k11 => null()
30 real(dp),
dimension(:),
pointer,
contiguous :: k22 => null()
31 real(dp),
dimension(:),
pointer,
contiguous :: k33 => null()
32 integer(I4B),
pointer :: kchangeper => null()
33 integer(I4B),
pointer :: kchangestp => null()
34 integer(I4B),
dimension(:),
pointer,
contiguous :: nodekchange => null()
35 real(dp),
dimension(:),
pointer,
contiguous :: k11_src => null()
36 real(dp),
dimension(:),
pointer,
contiguous :: k22_src => null()
37 real(dp),
dimension(:),
pointer,
contiguous :: k33_src => null()
55 subroutine tvk_cr(tvk, name_model, mempath, inunit, iout)
57 type(
tvktype),
pointer,
intent(out) :: tvk
58 character(len=*),
intent(in) :: name_model
59 character(len=*),
intent(in) :: mempath
60 integer(I4B),
intent(in) :: inunit
61 integer(I4B),
intent(in) :: iout
64 call tvk%init(name_model,
'TVK',
'TVK', mempath, inunit, iout)
76 character(len=LENMEMPATH) :: npfMemoryPath
78 character(len=*),
parameter :: fmttvk = &
79 "(1x,/1x,'TVK -- TIME-VARYING K PACKAGE, VERSION 1, 08/18/2021', &
80 &' INPUT READ FROM MEMPATH ', A, //)"
82 write (this%iout, fmttvk) this%input_mempath
85 call mem_setptr(this%ik22overk,
'IK22OVERK', npfmemorypath)
86 call mem_setptr(this%ik33overk,
'IK33OVERK', npfmemorypath)
87 call mem_setptr(this%k11,
'K11', npfmemorypath)
88 call mem_setptr(this%k22,
'K22', npfmemorypath)
89 call mem_setptr(this%k33,
'K33', npfmemorypath)
90 call mem_setptr(this%kchangeper,
'KCHANGEPER', npfmemorypath)
91 call mem_setptr(this%kchangestp,
'KCHANGESTP', npfmemorypath)
92 call mem_setptr(this%nodekchange,
'NODEKCHANGE', npfmemorypath)
95 call mem_setptr(this%k11_src,
'K', this%input_mempath)
96 call mem_setptr(this%k22_src,
'K22', this%input_mempath)
97 call mem_setptr(this%k33_src,
'K33', this%input_mempath)
110 integer(I4B),
intent(in) :: nodeu
111 integer(I4B),
intent(in) :: node
113 character(len=LINELENGTH) :: cellstr
115 character(len=*),
parameter :: fmtvalchg = &
116 "(a, ' package: Setting ', a, ' value for cell ', a, ' at start of &
117 &stress period ', i0, ' = ', g12.5)"
121 if (this%k11_src(nodeu) /=
dnodata)
then
122 if (node < 1 .or. node > this%dis%nodes)
then
123 call this%dis%noder_to_string(node, cellstr)
124 write (
errmsg,
'(a,2(1x,a))') &
125 'CELLID', trim(cellstr),
'is not in the active model domain.'
128 this%k11(node) = this%k11_src(nodeu)
129 call this%validate_change(node,
'K')
130 if (this%iprpak /= 0)
then
131 call this%dis%noder_to_string(node, cellstr)
132 write (this%iout, fmtvalchg) &
133 trim(adjustl(this%packName)),
'K', trim(cellstr),
kper, &
139 if (this%k22_src(nodeu) /=
dnodata)
then
140 if (node < 1 .or. node > this%dis%nodes)
then
141 call this%dis%noder_to_string(node, cellstr)
142 write (
errmsg,
'(a,2(1x,a))') &
143 'CELLID', trim(cellstr),
'is not in the active model domain.'
146 this%k22(node) = this%k22_src(nodeu)
147 call this%validate_change(node,
'K22')
148 if (this%iprpak /= 0)
then
149 call this%dis%noder_to_string(node, cellstr)
150 write (this%iout, fmtvalchg) &
151 trim(adjustl(this%packName)),
'K22', trim(cellstr),
kper, &
157 if (this%k33_src(nodeu) /=
dnodata)
then
158 if (node < 1 .or. node > this%dis%nodes)
then
159 call this%dis%noder_to_string(node, cellstr)
160 write (
errmsg,
'(a,2(1x,a))') &
161 'CELLID', trim(cellstr),
'is not in the active model domain.'
164 this%k33(node) = this%k33_src(nodeu)
165 call this%validate_change(node,
'K33')
166 if (this%iprpak /= 0)
then
167 call this%dis%noder_to_string(node, cellstr)
168 write (this%iout, fmtvalchg) &
169 trim(adjustl(this%packName)),
'K33', trim(cellstr),
kper, &
184 integer(I4B),
intent(in) :: kper
185 integer(I4B),
intent(in) :: kstp
187 this%kchangeper = kper
188 this%kchangestp = kstp
203 do i = 1, this%dis%nodes
204 this%nodekchange(i) = 0
218 integer(I4B),
intent(in) :: n
219 character(len=*),
intent(in) :: varName
221 character(len=LINELENGTH) :: cellstr
223 character(len=*),
parameter :: fmtkerr = &
224 "(1x, a, ' changed hydraulic property ', a, ' is <= 0 for cell ', a, &
228 this%nodekchange(n) = 1
231 if (varname ==
'K')
then
232 if (this%k11(n) <=
dzero)
then
233 call this%dis%noder_to_string(n, cellstr)
235 trim(adjustl(this%packName)),
'K', trim(cellstr), this%k11(n)
238 elseif (varname ==
'K22')
then
239 if (this%ik22overk == 1)
then
240 this%k22(n) = this%k22(n) * this%k11(n)
242 if (this%k22(n) <=
dzero)
then
243 call this%dis%noder_to_string(n, cellstr)
245 trim(adjustl(this%packName)),
'K22', trim(cellstr), this%k22(n)
248 elseif (varname ==
'K33')
then
249 if (this%ik33overk == 1)
then
250 this%k33(n) = this%k33(n) * this%k11(n)
252 if (this%k33(n) <=
dzero)
then
253 call this%dis%noder_to_string(n, cellstr)
255 trim(adjustl(this%packName)),
'K33', trim(cellstr), this%k33(n)
269 nullify (this%ik22overk)
270 nullify (this%ik33overk)
274 nullify (this%kchangeper)
275 nullify (this%kchangestp)
276 nullify (this%nodekchange)
277 nullify (this%k11_src)
278 nullify (this%k22_src)
279 nullify (this%k33_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
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 time-varying conductivity package methods.
subroutine tvk_set_changed_at(this, kper, kstp)
Mark property changes as having occurred at (kper, kstp)
subroutine tvk_da(this)
Deallocate package memory.
subroutine tvk_ar_set_pointers(this)
Announce package and set pointers to variables.
subroutine tvk_validate_change(this, n, varName)
Check that a given property value is valid.
subroutine tvk_apply_row_changes(this, nodeu, node)
Apply this node's K/K22/K33 input values to node.
subroutine tvk_reset_change_flags(this)
Clear all per-node change flags.
subroutine, public tvk_cr(tvk, name_model, mempath, inunit, iout)
Create a new TvkType object.