MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
gwf-csub-output.f90
Go to the documentation of this file.
1!> @brief CSUB package output
2!<
3submodule(gwfcsubmodule) gwfcsubmoduleoutput
4
5 character(len=LENBUDTXT), dimension(6) :: comptxt = & !< text labels for compaction terms
6 ['CSUB-COMPACTION', &
7 ' CSUB-INELASTIC', &
8 ' CSUB-ELASTIC', &
9 ' CSUB-INTERBED', &
10 ' CSUB-COARSE', &
11 ' CSUB-ZDISPLACE']
12
13contains
14
15 ! -- documented on the GwfCsubType type-bound procedure in gwf-csub.f90
16 module subroutine csub_fp(this)
17 ! -- dummy variables
18 class(GwfCsubType) :: this
19 ! -- local variables
20 character(len=LINELENGTH) :: title
21 character(len=LINELENGTH) :: tag
22 character(len=LINELENGTH) :: msg
23 character(len=10) :: ctype
24 character(len=20) :: cellid
25 character(len=10) :: cflag
26 integer(I4B) :: i
27 integer(I4B) :: ib
28 integer(I4B) :: i0
29 integer(I4B) :: i1
30 integer(I4B) :: node
31 integer(I4B) :: nn
32 integer(I4B) :: idelay
33 integer(I4B) :: iexceed
34 integer(I4B), parameter :: ncells = 20
35 integer(I4B) :: nlen
36 integer(I4B) :: ntabrows
37 integer(I4B) :: ntabcols
38 integer(I4B) :: ipos
39 real(DP) :: b0
40 real(DP) :: b1
41 real(DP) :: strain
42 real(DP) :: pctcomp
43 integer(I4B), dimension(:), allocatable :: imap_sel
44 integer(I4B), dimension(:), allocatable :: locs
45 real(DP), dimension(:), allocatable :: pctcomp_arr
46 !
47 ! -- initialize locs
48 allocate (locs(this%dis%ndim))
49 !
50 ! -- calculate and report strain for interbeds
51 if (this%ninterbeds > 0) then
52 nlen = min(ncells, this%ninterbeds)
53 allocate (imap_sel(nlen))
54 allocate (pctcomp_arr(this%ninterbeds))
55 iexceed = 0
56 do ib = 1, this%ninterbeds
57 idelay = this%idelay(ib)
58 b0 = this%thickini(ib)
59 strain = this%tcomp(ib) / b0
60 pctcomp = dhundred * strain
61 pctcomp_arr(ib) = pctcomp
62 if (pctcomp >= done) then
63 iexceed = iexceed + 1
64 end if
65 end do
66 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
67 !
68 ! -- summary interbed strain table
69 i0 = max(1, this%ninterbeds - ncells + 1)
70 i1 = this%ninterbeds
71 msg = ''
72 if (iexceed /= 0) then
73 write (msg, '(1x,a,1x,i0,1x,a,1x,i0,1x,a)') &
74 'LARGEST', (i1 - i0 + 1), 'OF', this%ninterbeds, &
75 'INTERBED STRAIN VALUES SHOWN'
76 call write_message(msg, this%iout, skipbefore=1)
77 !
78 ! -- interbed strain data
79 ! -- set title
80 title = trim(adjustl(this%packName))//' PACKAGE INTERBED STRAIN SUMMARY'
81 !
82 ! -- determine the number of columns and rows
83 ntabrows = nlen
84 ntabcols = 9
85 !
86 ! -- setup table
87 call table_cr(this%outputtab, this%packName, title)
88 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
89 !
90 ! add columns
91 tag = 'INTERBED NUMBER'
92 call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
93 tag = 'INTERBED TYPE'
94 call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
95 tag = 'CELLID'
96 call this%outputtab%initialize_column(tag, 20, alignment=tableft)
97 tag = 'INITIAL THICKNESS'
98 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
99 tag = 'FINAL THICKNESS'
100 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
101 tag = 'TOTAL COMPACTION'
102 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
103 tag = 'FINAL STRAIN'
104 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
105 tag = 'PERCENT COMPACTION'
106 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
107 tag = 'FLAG'
108 call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
109 !
110 ! -- write data
111 do i = 1, nlen
112 ib = imap_sel(i)
113 idelay = this%idelay(ib)
114 b0 = this%thickini(ib)
115 b1 = this%csub_calc_interbed_thickness(ib)
116 if (idelay == 0) then
117 ctype = 'no-delay'
118 else
119 ctype = 'delay'
120 b0 = b0 * this%rnb(ib)
121 end if
122 strain = this%tcomp(ib) / b0
123 pctcomp = dhundred * strain
124 if (pctcomp >= 5.0_dp) then
125 cflag = '**>=5%'
126 else if (pctcomp >= done) then
127 cflag = '*>=1%'
128 else
129 cflag = ''
130 end if
131 node = this%nodelist(ib)
132 call this%dis%noder_to_string(node, cellid)
133 !
134 ! -- fill table line
135 call this%outputtab%add_term(ib)
136 call this%outputtab%add_term(ctype)
137 call this%outputtab%add_term(cellid)
138 call this%outputtab%add_term(b0)
139 call this%outputtab%add_term(b1)
140 call this%outputtab%add_term(this%tcomp(ib))
141 call this%outputtab%add_term(strain)
142 call this%outputtab%add_term(pctcomp)
143 call this%outputtab%add_term(cflag)
144 end do
145 write (this%iout, '(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
146 'PERCENT COMPACTION IS GREATER THAN OR EQUAL TO 1 PERCENT IN', &
147 iexceed, 'OF', this%ninterbeds, 'INTERBED(S).', &
148 'USE THE STRAIN_CSV_INTERBED OPTION TO OUTPUT A CSV '// &
149 'FILE WITH PERCENT COMPACTION ', 'VALUES FOR ALL INTERBEDS.'
150 else
151 msg = 'PERCENT COMPACTION WAS LESS THAN 1 PERCENT IN ALL INTERBEDS'
152 write (this%iout, '(/1X,A)') trim(adjustl(msg))
153 end if
154 !
155 ! -- write csv file
156 if (this%istrainib /= 0) then
157 !
158 ! -- determine the number of columns and rows
159 ntabrows = this%ninterbeds
160 ntabcols = 7
161 if (this%dis%ndim > 1) then
162 ntabcols = ntabcols + 1
163 end if
164 ntabcols = ntabcols + this%dis%ndim
165 !
166 ! -- setup table
167 call table_cr(this%outputtab, this%packName, '')
168 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainib, &
169 lineseparator=.false., separator=',')
170 !
171 ! add columns
172 tag = 'INTERBED_NUMBER'
173 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
174 tag = 'INTERBED_TYPE'
175 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
176 tag = 'NODE'
177 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
178 if (this%dis%ndim == 2) then
179 tag = 'LAYER'
180 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
181 tag = 'ICELL2D'
182 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
183 else
184 tag = 'LAYER'
185 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
186 tag = 'ROW'
187 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
188 tag = 'COLUMN'
189 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
190 end if
191 tag = 'INITIAL_THICKNESS'
192 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
193 tag = 'FINAL_THICKNESS'
194 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
195 tag = 'TOTAL_COMPACTION'
196 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
197 tag = 'TOTAL_STRAIN'
198 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
199 tag = 'PERCENT_COMPACTION'
200 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
201 !
202 ! -- write data
203 do ib = 1, this%ninterbeds
204 idelay = this%idelay(ib)
205 b0 = this%thickini(ib)
206 b1 = this%csub_calc_interbed_thickness(ib)
207 if (idelay == 0) then
208 ctype = 'no-delay'
209 else
210 ctype = 'delay'
211 b0 = b0 * this%rnb(ib)
212 end if
213 strain = this%tcomp(ib) / b0
214 pctcomp = dhundred * strain
215 node = this%nodelist(ib)
216 call this%dis%noder_to_array(node, locs)
217 !
218 ! -- fill table line
219 call this%outputtab%add_term(ib)
220 call this%outputtab%add_term(ctype)
221 if (this%dis%ndim > 1) then
222 call this%outputtab%add_term(this%dis%get_nodeuser(node))
223 end if
224 do ipos = 1, this%dis%ndim
225 call this%outputtab%add_term(locs(ipos))
226 end do
227 call this%outputtab%add_term(b0)
228 call this%outputtab%add_term(b1)
229 call this%outputtab%add_term(this%tcomp(ib))
230 call this%outputtab%add_term(strain)
231 call this%outputtab%add_term(pctcomp)
232 end do
233 end if
234 !
235 ! -- deallocate temporary storage
236 deallocate (imap_sel)
237 deallocate (pctcomp_arr)
238 end if
239 !
240 ! -- calculate and report strain for coarse-grained materials
241 nlen = min(ncells, this%dis%nodes)
242 allocate (imap_sel(nlen))
243 allocate (pctcomp_arr(this%dis%nodes))
244 iexceed = 0
245 do node = 1, this%dis%nodes
246 strain = dzero
247 if (this%cg_thickini(node) > dzero) then
248 strain = this%cg_tcomp(node) / this%cg_thickini(node)
249 end if
250 pctcomp = dhundred * strain
251 pctcomp_arr(node) = pctcomp
252 if (pctcomp >= done) then
253 iexceed = iexceed + 1
254 end if
255 end do
256 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
257 !
258 ! -- summary coarse-grained strain table
259 i0 = max(1, this%dis%nodes - ncells + 1)
260 i1 = this%dis%nodes
261 msg = ''
262 if (iexceed /= 0) then
263 write (msg, '(a,1x,i0,1x,a,1x,i0,1x,a)') &
264 'LARGEST ', (i1 - i0 + 1), 'OF', this%dis%nodes, &
265 'CELL COARSE-GRAINED VALUES SHOWN'
266 call write_message(msg, this%iout, skipbefore=1)
267 !
268 ! -- set title
269 title = trim(adjustl(this%packName))// &
270 ' PACKAGE COARSE-GRAINED STRAIN SUMMARY'
271 !
272 ! -- determine the number of columns and rows
273 ntabrows = nlen
274 ntabcols = 7
275 !
276 ! -- setup table
277 call table_cr(this%outputtab, this%packName, title)
278 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
279 !
280 ! add columns
281 tag = 'CELLID'
282 call this%outputtab%initialize_column(tag, 20, alignment=tableft)
283 tag = 'INITIAL THICKNESS'
284 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
285 tag = 'FINAL THICKNESS'
286 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
287 tag = 'TOTAL COMPACTION'
288 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
289 tag = 'FINAL STRAIN'
290 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
291 tag = 'PERCENT COMPACTION'
292 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
293 tag = 'FLAG'
294 call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
295 ! -- write data
296 do nn = 1, nlen
297 node = imap_sel(nn)
298 if (this%cg_thickini(node) > dzero) then
299 strain = this%cg_tcomp(node) / this%cg_thickini(node)
300 else
301 strain = dzero
302 end if
303 pctcomp = dhundred * strain
304 if (pctcomp >= 5.0_dp) then
305 cflag = '**>=5%'
306 else if (pctcomp >= done) then
307 cflag = '*>=1%'
308 else
309 cflag = ''
310 end if
311 call this%dis%noder_to_string(node, cellid)
312 !
313 ! -- fill table line
314 call this%outputtab%add_term(cellid)
315 call this%outputtab%add_term(this%cg_thickini(node))
316 call this%outputtab%add_term(this%cg_thick(node))
317 call this%outputtab%add_term(this%cg_tcomp(node))
318 call this%outputtab%add_term(strain)
319 call this%outputtab%add_term(pctcomp)
320 call this%outputtab%add_term(cflag)
321 end do
322 write (this%iout, '(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
323 'COARSE-GRAINED STORAGE PERCENT COMPACTION IS GREATER THAN OR '// &
324 'EQUAL TO 1 PERCENT IN', iexceed, 'OF', this%dis%nodes, 'CELL(S).', &
325 'USE THE STRAIN_CSV_COARSE OPTION TO OUTPUT A CSV '// &
326 'FILE WITH PERCENT COMPACTION ', 'VALUES FOR ALL CELLS.'
327 else
328 msg = 'COARSE-GRAINED STORAGE PERCENT COMPACTION WAS LESS THAN '// &
329 '1 PERCENT IN ALL CELLS '
330 write (this%iout, '(/1X,A)') trim(adjustl(msg))
331 end if
332 !
333 ! -- write csv file
334 if (this%istrainsk /= 0) then
335 !
336 ! -- determine the number of columns and rows
337 ntabrows = this%dis%nodes
338 ntabcols = 5
339 if (this%dis%ndim > 1) then
340 ntabcols = ntabcols + 1
341 end if
342 ntabcols = ntabcols + this%dis%ndim
343 !
344 ! -- setup table
345 call table_cr(this%outputtab, this%packName, '')
346 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainsk, &
347 lineseparator=.false., separator=',')
348 !
349 ! add columns
350 tag = 'NODE'
351 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
352 if (this%dis%ndim == 2) then
353 tag = 'LAYER'
354 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
355 tag = 'ICELL2D'
356 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
357 else
358 tag = 'LAYER'
359 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
360 tag = 'ROW'
361 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
362 tag = 'COLUMN'
363 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
364 end if
365 tag = 'INITIAL_THICKNESS'
366 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
367 tag = 'FINAL_THICKNESS'
368 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
369 tag = 'TOTAL_COMPACTION'
370 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
371 tag = 'TOTAL_STRAIN'
372 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
373 tag = 'PERCENT_COMPACTION'
374 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
375 !
376 ! -- write data
377 do node = 1, this%dis%nodes
378 if (this%cg_thickini(node) > dzero) then
379 strain = this%cg_tcomp(node) / this%cg_thickini(node)
380 else
381 strain = dzero
382 end if
383 pctcomp = dhundred * strain
384 call this%dis%noder_to_array(node, locs)
385 !
386 ! -- fill table line
387 if (this%dis%ndim > 1) then
388 call this%outputtab%add_term(this%dis%get_nodeuser(node))
389 end if
390 do ipos = 1, this%dis%ndim
391 call this%outputtab%add_term(locs(ipos))
392 end do
393 call this%outputtab%add_term(this%cg_thickini(node))
394 call this%outputtab%add_term(this%cg_thick(node))
395 call this%outputtab%add_term(this%cg_tcomp(node))
396 call this%outputtab%add_term(strain)
397 call this%outputtab%add_term(pctcomp)
398 end do
399 end if
400 !
401 ! -- write a warning message for delay interbeds in non-convertible gwf
402 ! cells that violate minimum head assumptions
403 if (this%ndelaybeds > 0) then
404 if (this%idb_nconv_count(2) > 0) then
405 write (warnmsg, '(a,1x,a,1x,i0,1x,a,1x,a)') &
406 'Delay interbed cell heads were less than the top of the interbed', &
407 'cell in', this%idb_nconv_count(2), 'interbed cells in ', &
408 'non-convertible GWF cells for at least one time step during '// &
409 'the simulation.'
410 call store_warning(warnmsg)
411 end if
412 end if
413 !
414 ! -- deallocate temporary storage
415 deallocate (imap_sel)
416 deallocate (locs)
417 deallocate (pctcomp_arr)
418 end subroutine csub_fp
419
420 ! -- documented on the GwfCsubType type-bound procedure in gwf-csub.f90
421 module subroutine csub_ot_dv(this, idvfl, idvprint)
422 ! -- dummy variables
423 class(GwfCsubType) :: this
424 integer(I4B), intent(in) :: idvfl !< flag to save dependent variable data
425 integer(I4B), intent(in) :: idvprint !< flag to print dependent variable data
426 ! -- local variables
427 character(len=1) :: cdatafmp = ' '
428 character(len=1) :: editdesc = ' '
429 integer(I4B) :: ibinun
430 integer(I4B) :: iprint
431 integer(I4B) :: nvaluesp
432 integer(I4B) :: nwidthp
433 integer(I4B) :: ib
434 integer(I4B) :: node
435 integer(I4B) :: nodem
436 integer(I4B) :: nodeu
437 integer(I4B) :: i
438 integer(I4B) :: ii
439 integer(I4B) :: idx_conn
440 integer(I4B) :: k
441 integer(I4B) :: ncpl
442 integer(I4B) :: nlay
443 integer(I4B) :: ihc
444 real(DP) :: dinact
445 real(DP) :: va_scale
446 ! -- formats
447 character(len=*), parameter :: fmtnconv = &
448 "(/4x, 'DELAY INTERBED CELL HEADS IN ', i0, ' INTERBEDS IN', &
449 &' NON-CONVERTIBLE GWF CELLS WERE LESS THAN THE TOP OF THE INTERBED CELL')"
450 !
451 ! -- Save compaction results
452 !
453 ! -- Set unit number for binary compaction and z-displacement output
454 if (this%ioutcomp /= 0 .or. this%ioutzdisp /= 0) then
455 ibinun = 1
456 else
457 ibinun = 0
458 end if
459 if (idvfl == 0) ibinun = 0
460 !
461 ! -- save compaction results
462 if (ibinun /= 0) then
463 iprint = 0
464 dinact = dhnoflo
465 !
466 ! -- fill buff with total compaction
467 do node = 1, this%dis%nodes
468 this%buff(node) = this%cg_tcomp(node)
469 end do
470 do ib = 1, this%ninterbeds
471 node = this%nodelist(ib)
472 this%buff(node) = this%buff(node) + this%tcomp(ib)
473 end do
474 !
475 ! -- write compaction data to binary file
476 if (this%ioutcomp /= 0) then
477 ibinun = this%ioutcomp
478 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
479 comptxt(1), cdatafmp, nvaluesp, &
480 nwidthp, editdesc, dinact)
481 end if
482 !
483 ! -- calculate z-displacement (subsidence) and write data to binary file
484 if (this%ioutzdisp /= 0) then
485 ibinun = this%ioutzdisp
486 !
487 ! -- initialize buffusr
488 do nodeu = 1, this%dis%nodesuser
489 this%buffusr(nodeu) = dzero
490 end do
491 !
492 ! -- fill buffusr with buff
493 do node = 1, this%dis%nodes
494 nodeu = this%dis%get_nodeuser(node)
495 this%buffusr(nodeu) = this%buff(node)
496 end do
497 !
498 ! -- calculate z-displacement
499 ncpl = this%dis%get_ncpl()
500 !
501 ! -- disu
502 if (this%dis%ndim == 1) then
503 do node = this%dis%nodes, 1, -1
504 do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
505 !
506 ! -- Set the m cell number
507 nodem = this%dis%con%ja(ii)
508 idx_conn = this%dis%con%jas(ii)
509 !
510 ! -- vertical connection
511 ihc = this%dis%con%ihc(idx_conn)
512 if (ihc == 0) then
513 !
514 ! -- node has an underlying cell
515 if (node < nodem) then
516 va_scale = this%dis%get_area_factor(node, idx_conn)
517 this%buffusr(node) = this%buffusr(node) + &
518 va_scale * this%buffusr(nodem)
519 end if
520 end if
521 end do
522 end do
523 ! -- disv or dis
524 else
525 nlay = this%dis%nodesuser / ncpl
526 do k = nlay - 1, 1, -1
527 do i = 1, ncpl
528 node = (k - 1) * ncpl + i
529 nodem = k * ncpl + i
530 this%buffusr(node) = this%buffusr(node) + this%buffusr(nodem)
531 end do
532 end do
533 end if
534 !
535 ! -- fill buff with data from buffusr
536 do nodeu = 1, this%dis%nodesuser
537 node = this%dis%get_nodenumber_idx1(nodeu, 1)
538 if (node > 0) then
539 this%buff(node) = this%buffusr(nodeu)
540 end if
541 end do
542 !
543 ! -- write z-displacement
544 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
545 comptxt(6), cdatafmp, nvaluesp, &
546 nwidthp, editdesc, dinact)
547
548 end if
549 end if
550 !
551 ! -- Set unit number for binary inelastic interbed compaction
552 if (this%ioutcompi /= 0) then
553 ibinun = this%ioutcompi
554 else
555 ibinun = 0
556 end if
557 if (idvfl == 0) ibinun = 0
558 !
559 ! -- save inelastic interbed compaction results
560 if (ibinun /= 0) then
561 iprint = 0
562 dinact = dhnoflo
563 !
564 ! -- fill buff with inelastic interbed compaction
565 do node = 1, this%dis%nodes
566 this%buff(node) = dzero
567 end do
568 do ib = 1, this%ninterbeds
569 node = this%nodelist(ib)
570 this%buff(node) = this%buff(node) + this%tcompi(ib)
571 end do
572 !
573 ! -- write inelastic interbed compaction data to binary file
574 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
575 comptxt(2), cdatafmp, nvaluesp, &
576 nwidthp, editdesc, dinact)
577 end if
578 !
579 ! -- Set unit number for binary elastic interbed compaction
580 if (this%ioutcompe /= 0) then
581 ibinun = this%ioutcompe
582 else
583 ibinun = 0
584 end if
585 if (idvfl == 0) ibinun = 0
586 !
587 ! -- save elastic interbed compaction results
588 if (ibinun /= 0) then
589 iprint = 0
590 dinact = dhnoflo
591 !
592 ! -- fill buff with elastic interbed compaction
593 do node = 1, this%dis%nodes
594 this%buff(node) = dzero
595 end do
596 do ib = 1, this%ninterbeds
597 node = this%nodelist(ib)
598 this%buff(node) = this%buff(node) + this%tcompe(ib)
599 end do
600 !
601 ! -- write elastic interbed compaction data to binary file
602 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
603 comptxt(3), cdatafmp, nvaluesp, &
604 nwidthp, editdesc, dinact)
605 end if
606 !
607 ! -- Set unit number for binary interbed compaction
608 if (this%ioutcompib /= 0) then
609 ibinun = this%ioutcompib
610 else
611 ibinun = 0
612 end if
613 if (idvfl == 0) ibinun = 0
614 !
615 ! -- save interbed compaction results
616 if (ibinun /= 0) then
617 iprint = 0
618 dinact = dhnoflo
619 !
620 ! -- fill buff with interbed compaction
621 do node = 1, this%dis%nodes
622 this%buff(node) = dzero
623 end do
624 do ib = 1, this%ninterbeds
625 node = this%nodelist(ib)
626 this%buff(node) = this%buff(node) + this%tcompe(ib) + this%tcompi(ib)
627 end do
628 !
629 ! -- write interbed compaction data to binary file
630 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
631 comptxt(4), cdatafmp, nvaluesp, &
632 nwidthp, editdesc, dinact)
633 end if
634 !
635 ! -- Set unit number for binary coarse-grained compaction
636 if (this%ioutcomps /= 0) then
637 ibinun = this%ioutcomps
638 else
639 ibinun = 0
640 end if
641 if (idvfl == 0) ibinun = 0
642 !
643 ! -- save coarse-grained compaction results
644 if (ibinun /= 0) then
645 iprint = 0
646 dinact = dhnoflo
647 !
648 ! -- fill buff with coarse-grained compaction
649 do node = 1, this%dis%nodes
650 this%buff(node) = this%cg_tcomp(node)
651 end do
652 !
653 ! -- write coarse-grained compaction data to binary file
654 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
655 comptxt(5), cdatafmp, nvaluesp, &
656 nwidthp, editdesc, dinact)
657 end if
658 !
659 ! -- check that final effective stress values for the time step
660 ! are greater than zero
661 if (this%gwfiss == 0) then
662 call this%csub_cg_chk_stress()
663 end if
664 !
665 ! -- update maximum count of delay interbeds that violate
666 ! basic head assumptions for delay beds and write a message
667 ! for delay interbeds in non-convertible gwf cells that
668 ! violate these head assumptions
669 if (this%ndelaybeds > 0) then
670 if (this%idb_nconv_count(1) > this%idb_nconv_count(2)) then
671 this%idb_nconv_count(2) = this%idb_nconv_count(1)
672 end if
673 if (this%idb_nconv_count(1) > 0) then
674 write (this%iout, fmtnconv) this%idb_nconv_count(1)
675 end if
676 end if
677 end subroutine csub_ot_dv
678
679 ! -- documented on the GwfCsubType type-bound procedure in gwf-csub.f90
680 module subroutine csub_cg_chk_stress(this)
681 ! -- modules
682 use tdismodule, only: kper, kstp
683 ! -- dummy variables
684 class(GwfCsubType) :: this
685 ! -- local variables
686 character(len=20) :: cellid
687 integer(I4B) :: ierr
688 integer(I4B) :: iwarn
689 integer(I4B) :: node
690 real(DP) :: gs
691 real(DP) :: bot
692 real(DP) :: hcell
693 real(DP) :: es
694 real(DP) :: phead
695 !
696 ! -- initialize variables
697 ierr = 0
698 iwarn = 0
699 !
700 ! -- check effective stress in each cell (effective-stress formulation only)
701 do node = 1, this%dis%nodes
702 if (this%ibound(node) < 1) cycle
703 if (this%lhead_based .EQV. .true.) cycle
704 bot = this%dis%bot(node)
705 gs = this%cg_gs(node)
706 es = this%cg_es(node)
707 phead = gs - es
708 hcell = phead + bot
709 if (this%istrict_stress /= 0) then
710 ! -- deprecated STRICT_EFFECTIVE_STRESS: terminate on negative stress
711 if (es < dem6) then
712 ierr = ierr + 1
713 call this%dis%noder_to_string(node, cellid)
714 write (errmsg, '(a,g0,a,1x,a,1x,a,4(g0,a))') &
715 'Small to negative effective stress (', es, ') in cell', &
716 trim(adjustl(cellid)), '. (', es, ' = ', this%cg_gs(node), &
717 ' - (', hcell, ' - ', bot, ').'
718 call store_error(errmsg)
719 end if
720 else
721 ! -- default: count cells with negative (regularized) effective stress
722 if (es < dem6) then
723 iwarn = iwarn + 1
724 end if
725 end if
726 end do
727 !
728 ! -- STRICT_EFFECTIVE_STRESS: write a summary error message and terminate
729 if (ierr > 0) then
730 write (errmsg, '(a,1x,i0,3(1x,a))') &
731 'Solution: small to negative effective stress values in', ierr, &
732 'cells can be eliminated by increasing storage values and/or ', &
733 'adding/modifying stress boundaries to prevent water-levels from', &
734 'exceeding the top of the model.'
735 call store_error(errmsg)
736 call store_error_filename(this%input_fname)
737 end if
738 !
739 ! -- default: note the regularized cells and count the time step
740 if (iwarn > 0) then
741 this%nreg_ts = this%nreg_ts + 1
742 write (this%iout, '(1x,a,1x,i0,1x,a,1x,i0,1x,a,1x,i0,a)') &
743 'CSUB negative effective stress regularized in', iwarn, &
744 'cell(s) in stress period', kper, 'time step', kstp, '.'
745 end if
746 end subroutine csub_cg_chk_stress
747
748end submodule gwfcsubmoduleoutput
This module contains the CSUB package methods.
Definition gwf-csub.f90:23
integer(i4b), pointer, public kstp
current time step number
Definition tdis.f90:27
integer(i4b), pointer, public kper
current stress period number
Definition tdis.f90:26