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
77 integer(I4B),
pointer :: invsc
79 character(len=*),
parameter :: fmttvk = &
80 "(1x,/1x,'TVK -- TIME-VARYING K PACKAGE, VERSION 1, 08/18/2021', &
81 &' INPUT READ FROM MEMPATH ', A, //)"
83 write (this%iout, fmttvk) this%input_mempath
86 call mem_setptr(this%ik22overk,
'IK22OVERK', npfmemorypath)
87 call mem_setptr(this%ik33overk,
'IK33OVERK', npfmemorypath)
93 call mem_setptr(this%k11,
'K11INPUT', npfmemorypath)
94 call mem_setptr(this%k22,
'K22INPUT', npfmemorypath)
95 call mem_setptr(this%k33,
'K33INPUT', npfmemorypath)
97 call mem_setptr(this%k11,
'K11', npfmemorypath)
98 call mem_setptr(this%k22,
'K22', npfmemorypath)
99 call mem_setptr(this%k33,
'K33', npfmemorypath)
101 call mem_setptr(this%kchangeper,
'KCHANGEPER', npfmemorypath)
102 call mem_setptr(this%kchangestp,
'KCHANGESTP', npfmemorypath)
103 call mem_setptr(this%nodekchange,
'NODEKCHANGE', npfmemorypath)
106 call mem_setptr(this%k11_src,
'K', this%input_mempath)
107 call mem_setptr(this%k22_src,
'K22', this%input_mempath)
108 call mem_setptr(this%k33_src,
'K33', this%input_mempath)
121 integer(I4B),
intent(in) :: nodeu
122 integer(I4B),
intent(in) :: node
124 character(len=LINELENGTH) :: cellstr
126 character(len=*),
parameter :: fmtvalchg = &
127 "(a, ' package: Setting ', a, ' value for cell ', a, ' at start of &
128 &stress period ', i0, ' = ', g12.5)"
132 if (this%k11_src(nodeu) /=
dnodata)
then
133 if (node < 1 .or. node > this%dis%nodes)
then
134 call this%dis%noder_to_string(node, cellstr)
135 write (
errmsg,
'(a,2(1x,a))') &
136 'CELLID', trim(cellstr),
'is not in the active model domain.'
139 this%k11(node) = this%k11_src(nodeu)
140 call this%validate_change(node,
'K')
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)),
'K', trim(cellstr),
kper, &
150 if (this%k22_src(nodeu) /=
dnodata)
then
151 if (node < 1 .or. node > this%dis%nodes)
then
152 call this%dis%noder_to_string(node, cellstr)
153 write (
errmsg,
'(a,2(1x,a))') &
154 'CELLID', trim(cellstr),
'is not in the active model domain.'
157 this%k22(node) = this%k22_src(nodeu)
158 call this%validate_change(node,
'K22')
159 if (this%iprpak /= 0)
then
160 call this%dis%noder_to_string(node, cellstr)
161 write (this%iout, fmtvalchg) &
162 trim(adjustl(this%packName)),
'K22', trim(cellstr),
kper, &
168 if (this%k33_src(nodeu) /=
dnodata)
then
169 if (node < 1 .or. node > this%dis%nodes)
then
170 call this%dis%noder_to_string(node, cellstr)
171 write (
errmsg,
'(a,2(1x,a))') &
172 'CELLID', trim(cellstr),
'is not in the active model domain.'
175 this%k33(node) = this%k33_src(nodeu)
176 call this%validate_change(node,
'K33')
177 if (this%iprpak /= 0)
then
178 call this%dis%noder_to_string(node, cellstr)
179 write (this%iout, fmtvalchg) &
180 trim(adjustl(this%packName)),
'K33', trim(cellstr),
kper, &
195 integer(I4B),
intent(in) :: kper
196 integer(I4B),
intent(in) :: kstp
198 this%kchangeper = kper
199 this%kchangestp = kstp
214 do i = 1, this%dis%nodes
215 this%nodekchange(i) = 0
229 integer(I4B),
intent(in) :: n
230 character(len=*),
intent(in) :: varName
232 character(len=LINELENGTH) :: cellstr
234 character(len=*),
parameter :: fmtkerr = &
235 "(1x, a, ' changed hydraulic property ', a, ' is <= 0 for cell ', a, &
239 this%nodekchange(n) = 1
242 if (varname ==
'K')
then
243 if (this%k11(n) <=
dzero)
then
244 call this%dis%noder_to_string(n, cellstr)
246 trim(adjustl(this%packName)),
'K', trim(cellstr), this%k11(n)
249 elseif (varname ==
'K22')
then
250 if (this%ik22overk == 1)
then
251 this%k22(n) = this%k22(n) * this%k11(n)
253 if (this%k22(n) <=
dzero)
then
254 call this%dis%noder_to_string(n, cellstr)
256 trim(adjustl(this%packName)),
'K22', trim(cellstr), this%k22(n)
259 elseif (varname ==
'K33')
then
260 if (this%ik33overk == 1)
then
261 this%k33(n) = this%k33(n) * this%k11(n)
263 if (this%k33(n) <=
dzero)
then
264 call this%dis%noder_to_string(n, cellstr)
266 trim(adjustl(this%packName)),
'K33', trim(cellstr), this%k33(n)
280 nullify (this%ik22overk)
281 nullify (this%ik33overk)
285 nullify (this%kchangeper)
286 nullify (this%kchangestp)
287 nullify (this%nodekchange)
288 nullify (this%k11_src)
289 nullify (this%k22_src)
290 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) iout
file unit number for simulation output
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.