8 module procedure uzf_source_packagedata
12 integer(I4B),
dimension(:),
pointer,
contiguous :: ifno => null()
13 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid_idm => null()
14 integer(I4B),
dimension(:),
pointer,
contiguous :: landflag => null()
15 integer(I4B),
dimension(:),
pointer,
contiguous :: ivertcon => null()
16 real(DP),
dimension(:),
pointer,
contiguous :: surfdep => null()
17 real(DP),
dimension(:),
pointer,
contiguous :: vks => null()
18 real(DP),
dimension(:),
pointer,
contiguous :: thtr => null()
19 real(DP),
dimension(:),
pointer,
contiguous :: thts => null()
20 real(DP),
dimension(:),
pointer,
contiguous :: thti => null()
21 real(DP),
dimension(:),
pointer,
contiguous :: eps => null()
22 type(CharacterStringType),
dimension(:),
pointer,
contiguous :: &
24 character(len=LINELENGTH) :: cellid_str
29 integer(I4B) :: j, jcol
30 integer(I4B),
dimension(:),
allocatable :: rowmaxnnz
31 type(sparsematrix) :: sparse
32 integer(I4B),
dimension(:),
allocatable :: nboundchk
34 write (this%iout,
'(/1x,3a)')
'PROCESSING ', trim(adjustl(this%text)), &
38 call mem_setptr(ifno,
'PACKAGEDATA_IFNO', this%input_mempath)
39 call mem_setptr(cellid_idm,
'CELLID', this%input_mempath)
40 call mem_setptr(landflag,
'LANDFLAG', this%input_mempath)
41 call mem_setptr(ivertcon,
'IVERTCON', this%input_mempath)
42 call mem_setptr(surfdep,
'SURFDEP', this%input_mempath)
43 call mem_setptr(vks,
'VKS', this%input_mempath)
44 call mem_setptr(thtr,
'THTR', this%input_mempath)
45 call mem_setptr(thts,
'THTS', this%input_mempath)
46 call mem_setptr(thti,
'THTI', this%input_mempath)
47 call mem_setptr(eps,
'EPS', this%input_mempath)
48 if (this%inamedbound /= 0)
then
49 call mem_setptr(bndname,
'BOUNDNAME', this%input_mempath)
53 allocate (rowmaxnnz(this%dis%nodes))
54 do node = 1, this%dis%nodes
57 allocate (nboundchk(this%nodes))
64 n = this%validate_ifno(ifno(i), this%nodes, nboundchk, &
65 'IUZNO',
'PACKAGEDATA')
69 write (cellid_str,
'(10(i0,1x))') cellid_idm(1:this%dis%ndim, i)
70 node = this%dis%noder_from_cellid(cellid_str, this%inunit, this%iout)
71 this%igwfnode(n) = node
72 rowmaxnnz(node) = rowmaxnnz(node) + 1
75 if (landflag(i) < 0 .OR. landflag(i) > 1)
then
76 write (errmsg,
'(a,1x,i0,1x,a,1x,i0,a)') &
77 'LANDFLAG for uzf cell', n, &
78 'must be 0 or 1 (specified value is', landflag(i),
').'
83 if (ivertcon(i) < 0 .OR. ivertcon(i) > this%nodes)
then
84 write (errmsg,
'(a,1x,i0,1x,a,1x,i0,a)') &
85 'IVERTCON for uzf cell', n, &
86 'must be 0 or less than NUZFCELLS (specified value is', &
92 if (surfdep(i) <= dzero .and. landflag(i) > 0)
then
93 write (errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
94 'SURFDEP for uzf cell', n, &
95 'must be greater than 0 (specified value is', surfdep(i),
').'
98 if (surfdep(i) >= this%dis%top(node) - this%dis%bot(node))
then
99 write (errmsg,
'(a,1x,i0,1x,a)') &
100 'SURFDEP for uzf cell', n, &
101 'cannot be greater than the cell thickness.'
106 if (vks(i) <= dzero)
then
107 write (errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
108 'VKS for uzf cell', n, &
109 'must be greater than 0 (specified value ia', vks(i),
').'
114 if (thtr(i) <= dzero)
then
115 write (errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
116 'THTR for uzf cell', n, &
117 'must be greater than 0 (specified value is', thtr(i),
').'
122 if (thts(i) <= thtr(i))
then
123 write (errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
124 'THTS for uzf cell', n, &
125 'must be greater than THTR (specified value is', thts(i),
').'
130 if (thti(i) < thtr(i) .OR. thti(i) > thts(i))
then
131 write (errmsg,
'(a,1x,i0,1x,a,1x,a,1x,g0,a)') &
132 'THTI for uzf cell', n, &
133 'must be greater than or equal to THTR AND less than THTS', &
134 '(specified value is', thti(i),
').'
139 if (eps(i) < 3.5 .OR. eps(i) > 14)
then
140 write (errmsg,
'(a,1x,i0,1x,a,1x,g0,a)') &
141 'EPSILON for uzf cell', n, &
142 'must be between 3.5 and 14.0 (specified value is', eps(i),
').'
147 if (this%inamedbound == 1)
then
148 this%uzfname(n) = bndname(i)
153 call this%uzfobj%setdata(n, this%dis%area(node), &
154 this%dis%top(node), this%dis%bot(node), &
155 surfdep(i), vks(i), thtr(i), thts(i), &
156 thti(i), eps(i), this%ntrail_input, &
157 landflag(i), ivertcon(i))
158 if (ivertcon(i) > 0)
then
163 write (this%iout,
'(1x,3a)') &
164 'END OF ', trim(adjustl(this%text)),
' PACKAGEDATA'
167 call this%report_ifno_coverage(nboundchk, this%nodes,
'uzf cell', &
175 call sparse%init(this%dis%nodes, this%dis%nodes, rowmaxnnz)
177 node = this%igwfnode(n)
178 call sparse%addconnection(node, n, 1)
182 call sparse%filliaja(this%ia, this%ja, ierr)
185 do i = 1, this%dis%nodes
187 do j = this%ia(i), this%ia(i + 1) - 1
190 if (jcol > this%imaxcellcnt)
then
191 this%imaxcellcnt = jcol
195 if (this%imaxcellcnt > 1 .and. this%iauxmultcol < 1)
then
196 call this%check_cell_area()
199 deallocate (rowmaxnnz)
200 deallocate (nboundchk)
203 call memorystore_release(
'PACKAGEDATA_IFNO', this%input_mempath)
204 call memorystore_release(
'CELLID', this%input_mempath)
205 call memorystore_release(
'LANDFLAG', this%input_mempath)
206 call memorystore_release(
'IVERTCON', this%input_mempath)
207 call memorystore_release(
'SURFDEP', this%input_mempath)
208 call memorystore_release(
'VKS', this%input_mempath)
209 call memorystore_release(
'THTR', this%input_mempath)
210 call memorystore_release(
'THTS', this%input_mempath)
211 call memorystore_release(
'THTI', this%input_mempath)
212 call memorystore_release(
'EPS', this%input_mempath)
213 call memorystore_release(
'BOUNDNAME', this%input_mempath)
214 end procedure uzf_source_packagedata
218 module procedure print_cell_properties
220 character(len=20) :: cellid
221 character(len=LINELENGTH) :: title
222 character(len=LINELENGTH) :: tag
223 integer(I4B) :: ntabrows
224 integer(I4B) :: ntabcols
228 ntabrows = this%nodes
230 if (this%inamedbound == 1)
then
231 ntabcols = ntabcols + 1
235 title = trim(adjustl(this%text))//
' PACKAGE ('// &
236 trim(adjustl(this%packName))//
') STATIC UZF CELL DATA'
237 call table_cr(this%inputtab, this%packName, title)
238 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
240 call this%inputtab%initialize_column(tag, 10)
242 call this%inputtab%initialize_column(tag, 20, alignment=tableft)
244 call this%inputtab%initialize_column(tag, 12)
246 call this%inputtab%initialize_column(tag, 12)
248 call this%inputtab%initialize_column(tag, 12)
250 call this%inputtab%initialize_column(tag, 12)
252 call this%inputtab%initialize_column(tag, 12)
254 call this%inputtab%initialize_column(tag, 12)
256 call this%inputtab%initialize_column(tag, 12)
258 call this%inputtab%initialize_column(tag, 12)
259 if (this%inamedbound == 1)
then
261 call this%inputtab%initialize_column(tag, lenboundname, alignment=tableft)
268 node = this%igwfnode(n)
270 call this%dis%noder_to_string(node, cellid)
276 call this%inputtab%add_term(n)
277 call this%inputtab%add_term(cellid)
278 call this%inputtab%add_term(this%uzfobj%landflag(n))
279 call this%inputtab%add_term(this%uzfobj%cell_below(n))
280 call this%inputtab%add_term(this%uzfobj%surfdep(n))
281 call this%inputtab%add_term(this%uzfobj%vks(n))
282 call this%inputtab%add_term(this%uzfobj%theta_res(n))
283 call this%inputtab%add_term(this%uzfobj%theta_sat(n))
284 call this%inputtab%add_term(this%uzfobj%theta_init(n))
285 call this%inputtab%add_term(this%uzfobj%bc_eps(n))
286 if (this%inamedbound == 1)
then
287 call this%inputtab%add_term(this%uzfname(n))
290 end procedure print_cell_properties
294 module procedure check_cell_area
299 character(len=16) :: cuzf
300 character(len=20) :: cellid
301 character(len=LINELENGTH) :: cuzfcells
317 n2 = this%uzfobj%cell_below(n)
318 area = this%uzfobj%uzfarea(n)
322 area2 = this%uzfobj%uzfarea(n2)
323 d = abs(area - area2)
325 write (errmsg,
'(2(a,1x,g0,1x,a,1x,i0,1x),a)') &
326 'UZF cell area (', area,
') for cell ', n, &
327 'does not equal uzf cell area (', area2,
') for cell ', n2,
'.'
335 do node = 1, this%dis%nodes
337 i1 = this%ia(node + 1)
339 if ((i1 - i0) < 1) cycle
345 write (cuzf,
'(i0)') n
346 cuzfcells = trim(adjustl(cuzfcells))//
' '//trim(adjustl(cuzf))
347 sumarea = sumarea + this%uzfobj%uzfarea(n)
348 cellarea = this%uzfobj%cellarea(n)
351 d = sumarea - cellarea
353 call this%dis%noder_to_string(node, cellid)
354 write (errmsg,
'(a,1x,g0,1x,a,1x,g0,1x,a,1x,a,1x,a,a,a)') &
355 'Total uzf cell area (', sumarea, &
356 ') exceeds the gwf cell area (', cellarea,
') of cell', cellid, &
357 'which includes uzf cell(s): ', trim(adjustl(cuzfcells)),
'.'
366 end procedure check_cell_area
368end submodule uzfmoduleinput
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.