5 character(len=LENBUDTXT),
dimension(6) :: comptxt = & !< text labels for compaction terms
16 module subroutine csub_fp(this)
18 class(GwfCsubType) :: this
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
32 integer(I4B) :: idelay
33 integer(I4B) :: iexceed
34 integer(I4B),
parameter :: ncells = 20
36 integer(I4B) :: ntabrows
37 integer(I4B) :: ntabcols
43 integer(I4B),
dimension(:),
allocatable :: imap_sel
44 integer(I4B),
dimension(:),
allocatable :: locs
45 real(DP),
dimension(:),
allocatable :: pctcomp_arr
48 allocate (locs(this%dis%ndim))
51 if (this%ninterbeds > 0)
then
52 nlen = min(ncells, this%ninterbeds)
53 allocate (imap_sel(nlen))
54 allocate (pctcomp_arr(this%ninterbeds))
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
66 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
69 i0 = max(1, this%ninterbeds - ncells + 1)
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)
80 title = trim(adjustl(this%packName))//
' PACKAGE INTERBED STRAIN SUMMARY'
87 call table_cr(this%outputtab, this%packName, title)
88 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
91 tag =
'INTERBED NUMBER'
92 call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
94 call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
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)
104 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
105 tag =
'PERCENT COMPACTION'
106 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
108 call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
113 idelay = this%idelay(ib)
114 b0 = this%thickini(ib)
115 b1 = this%csub_calc_interbed_thickness(ib)
116 if (idelay == 0)
then
120 b0 = b0 * this%rnb(ib)
122 strain = this%tcomp(ib) / b0
123 pctcomp = dhundred * strain
124 if (pctcomp >= 5.0_dp)
then
126 else if (pctcomp >= done)
then
131 node = this%nodelist(ib)
132 call this%dis%noder_to_string(node, cellid)
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)
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.'
151 msg =
'PERCENT COMPACTION WAS LESS THAN 1 PERCENT IN ALL INTERBEDS'
152 write (this%iout,
'(/1X,A)') trim(adjustl(msg))
156 if (this%istrainib /= 0)
then
159 ntabrows = this%ninterbeds
161 if (this%dis%ndim > 1)
then
162 ntabcols = ntabcols + 1
164 ntabcols = ntabcols + this%dis%ndim
167 call table_cr(this%outputtab, this%packName,
'')
168 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainib, &
169 lineseparator=.false., separator=
',')
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)
177 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
178 if (this%dis%ndim == 2)
then
180 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
182 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
185 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
187 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
189 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
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)
198 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
199 tag =
'PERCENT_COMPACTION'
200 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
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
211 b0 = b0 * this%rnb(ib)
213 strain = this%tcomp(ib) / b0
214 pctcomp = dhundred * strain
215 node = this%nodelist(ib)
216 call this%dis%noder_to_array(node, locs)
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))
224 do ipos = 1, this%dis%ndim
225 call this%outputtab%add_term(locs(ipos))
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)
236 deallocate (imap_sel)
237 deallocate (pctcomp_arr)
241 nlen = min(ncells, this%dis%nodes)
242 allocate (imap_sel(nlen))
243 allocate (pctcomp_arr(this%dis%nodes))
245 do node = 1, this%dis%nodes
247 if (this%cg_thickini(node) > dzero)
then
248 strain = this%cg_tcomp(node) / this%cg_thickini(node)
250 pctcomp = dhundred * strain
251 pctcomp_arr(node) = pctcomp
252 if (pctcomp >= done)
then
253 iexceed = iexceed + 1
256 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
259 i0 = max(1, this%dis%nodes - ncells + 1)
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)
269 title = trim(adjustl(this%packName))// &
270 ' PACKAGE COARSE-GRAINED STRAIN SUMMARY'
277 call table_cr(this%outputtab, this%packName, title)
278 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
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)
290 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
291 tag =
'PERCENT COMPACTION'
292 call this%outputtab%initialize_column(tag, 12, alignment=tabcenter)
294 call this%outputtab%initialize_column(tag, 10, alignment=tabcenter)
298 if (this%cg_thickini(node) > dzero)
then
299 strain = this%cg_tcomp(node) / this%cg_thickini(node)
303 pctcomp = dhundred * strain
304 if (pctcomp >= 5.0_dp)
then
306 else if (pctcomp >= done)
then
311 call this%dis%noder_to_string(node, cellid)
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)
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.'
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))
334 if (this%istrainsk /= 0)
then
337 ntabrows = this%dis%nodes
339 if (this%dis%ndim > 1)
then
340 ntabcols = ntabcols + 1
342 ntabcols = ntabcols + this%dis%ndim
345 call table_cr(this%outputtab, this%packName,
'')
346 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainsk, &
347 lineseparator=.false., separator=
',')
351 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
352 if (this%dis%ndim == 2)
then
354 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
356 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
359 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
361 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
363 call this%outputtab%initialize_column(tag, 10, alignment=tabright)
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)
372 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
373 tag =
'PERCENT_COMPACTION'
374 call this%outputtab%initialize_column(tag, 20, alignment=tabright)
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)
383 pctcomp = dhundred * strain
384 call this%dis%noder_to_array(node, locs)
387 if (this%dis%ndim > 1)
then
388 call this%outputtab%add_term(this%dis%get_nodeuser(node))
390 do ipos = 1, this%dis%ndim
391 call this%outputtab%add_term(locs(ipos))
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)
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 '// &
410 call store_warning(warnmsg)
415 deallocate (imap_sel)
417 deallocate (pctcomp_arr)
418 end subroutine csub_fp
421 module subroutine csub_ot_dv(this, idvfl, idvprint)
423 class(GwfCsubType) :: this
424 integer(I4B),
intent(in) :: idvfl
425 integer(I4B),
intent(in) :: idvprint
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
435 integer(I4B) :: nodem
436 integer(I4B) :: nodeu
439 integer(I4B) :: idx_conn
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')"
454 if (this%ioutcomp /= 0 .or. this%ioutzdisp /= 0)
then
459 if (idvfl == 0) ibinun = 0
462 if (ibinun /= 0)
then
467 do node = 1, this%dis%nodes
468 this%buff(node) = this%cg_tcomp(node)
470 do ib = 1, this%ninterbeds
471 node = this%nodelist(ib)
472 this%buff(node) = this%buff(node) + this%tcomp(ib)
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)
484 if (this%ioutzdisp /= 0)
then
485 ibinun = this%ioutzdisp
488 do nodeu = 1, this%dis%nodesuser
489 this%buffusr(nodeu) = dzero
493 do node = 1, this%dis%nodes
494 nodeu = this%dis%get_nodeuser(node)
495 this%buffusr(nodeu) = this%buff(node)
499 ncpl = this%dis%get_ncpl()
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
507 nodem = this%dis%con%ja(ii)
508 idx_conn = this%dis%con%jas(ii)
511 ihc = this%dis%con%ihc(idx_conn)
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)
525 nlay = this%dis%nodesuser / ncpl
526 do k = nlay - 1, 1, -1
528 node = (k - 1) * ncpl + i
530 this%buffusr(node) = this%buffusr(node) + this%buffusr(nodem)
536 do nodeu = 1, this%dis%nodesuser
537 node = this%dis%get_nodenumber_idx1(nodeu, 1)
539 this%buff(node) = this%buffusr(nodeu)
544 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
545 comptxt(6), cdatafmp, nvaluesp, &
546 nwidthp, editdesc, dinact)
552 if (this%ioutcompi /= 0)
then
553 ibinun = this%ioutcompi
557 if (idvfl == 0) ibinun = 0
560 if (ibinun /= 0)
then
565 do node = 1, this%dis%nodes
566 this%buff(node) = dzero
568 do ib = 1, this%ninterbeds
569 node = this%nodelist(ib)
570 this%buff(node) = this%buff(node) + this%tcompi(ib)
574 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
575 comptxt(2), cdatafmp, nvaluesp, &
576 nwidthp, editdesc, dinact)
580 if (this%ioutcompe /= 0)
then
581 ibinun = this%ioutcompe
585 if (idvfl == 0) ibinun = 0
588 if (ibinun /= 0)
then
593 do node = 1, this%dis%nodes
594 this%buff(node) = dzero
596 do ib = 1, this%ninterbeds
597 node = this%nodelist(ib)
598 this%buff(node) = this%buff(node) + this%tcompe(ib)
602 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
603 comptxt(3), cdatafmp, nvaluesp, &
604 nwidthp, editdesc, dinact)
608 if (this%ioutcompib /= 0)
then
609 ibinun = this%ioutcompib
613 if (idvfl == 0) ibinun = 0
616 if (ibinun /= 0)
then
621 do node = 1, this%dis%nodes
622 this%buff(node) = dzero
624 do ib = 1, this%ninterbeds
625 node = this%nodelist(ib)
626 this%buff(node) = this%buff(node) + this%tcompe(ib) + this%tcompi(ib)
630 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
631 comptxt(4), cdatafmp, nvaluesp, &
632 nwidthp, editdesc, dinact)
636 if (this%ioutcomps /= 0)
then
637 ibinun = this%ioutcomps
641 if (idvfl == 0) ibinun = 0
644 if (ibinun /= 0)
then
649 do node = 1, this%dis%nodes
650 this%buff(node) = this%cg_tcomp(node)
654 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
655 comptxt(5), cdatafmp, nvaluesp, &
656 nwidthp, editdesc, dinact)
661 if (this%gwfiss == 0)
then
662 call this%csub_cg_chk_stress()
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)
673 if (this%idb_nconv_count(1) > 0)
then
674 write (this%iout, fmtnconv) this%idb_nconv_count(1)
677 end subroutine csub_ot_dv
680 module subroutine csub_cg_chk_stress(this)
684 class(GwfCsubType) :: this
686 character(len=20) :: cellid
688 integer(I4B) :: iwarn
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)
709 if (this%istrict_stress /= 0)
then
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)
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)
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,
'.'
746 end subroutine csub_cg_chk_stress
748end submodule gwfcsubmoduleoutput
This module contains the CSUB package methods.
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number