48 character(len=LENBUDTXT),
dimension(4) ::
budtxt = & !< text labels for budget terms
53 character(len=LENBUDTXT),
dimension(6) ::
comptxt = & !< text labels for compaction terms
69 character(len=LENLISTLABEL),
pointer :: listlabel => null()
70 character(len=LENMEMPATH),
pointer :: stomempath => null()
72 character(len=LENBOUNDNAME),
dimension(:), &
73 pointer,
contiguous :: boundname => null()
74 character(len=LENAUXNAME),
dimension(:), &
75 pointer,
contiguous :: auxname => null()
77 logical(LGP),
pointer :: lhead_based => null()
79 integer(I4B),
pointer :: istounit => null()
80 integer(I4B),
pointer :: istrict_stress => null()
81 integer(I4B),
pointer :: nreg_ts => null()
82 integer(I4B),
pointer :: istrainib => null()
83 integer(I4B),
pointer :: istrainsk => null()
84 integer(I4B),
pointer :: ioutcomp => null()
85 integer(I4B),
pointer :: ioutcompi => null()
86 integer(I4B),
pointer :: ioutcompe => null()
87 integer(I4B),
pointer :: ioutcompib => null()
88 integer(I4B),
pointer :: ioutcomps => null()
89 integer(I4B),
pointer :: ioutzdisp => null()
90 integer(I4B),
pointer :: ipakcsv => null()
91 integer(I4B),
pointer :: iupdatematprop => null()
92 integer(I4B),
pointer :: istoragec => null()
93 integer(I4B),
pointer :: icellf => null()
94 integer(I4B),
pointer :: ispecified_pcs => null()
95 integer(I4B),
pointer :: ispecified_dbh => null()
96 integer(I4B),
pointer :: inamedbound => null()
97 integer(I4B),
pointer :: iconvchk => null()
98 integer(I4B),
pointer :: naux => null()
99 integer(I4B),
pointer :: ninterbeds => null()
100 integer(I4B),
pointer :: maxsig0 => null()
101 integer(I4B),
pointer :: nbound => null()
102 integer(I4B),
pointer :: iscloc => null()
103 integer(I4B),
pointer :: iauxmultcol => null()
104 integer(I4B),
pointer :: ndelaycells => null()
105 integer(I4B),
pointer :: ndelaybeds => null()
106 integer(I4B),
pointer :: initialized => null()
107 integer(I4B),
pointer :: ieslag => null()
108 integer(I4B),
pointer :: ipch => null()
109 integer(I4B),
pointer :: iupdatestress => null()
111 real(dp),
pointer :: epsilon => null()
112 real(dp),
pointer :: cc_crit => null()
113 real(dp),
pointer :: gammaw => null()
114 real(dp),
pointer :: beta => null()
115 real(dp),
pointer :: brg => null()
116 real(dp),
pointer :: satomega => null()
117 real(dp),
pointer :: pcsomega => null()
119 integer(I4B),
pointer :: gwfiss => null()
120 integer(I4B),
pointer :: gwfiss0 => null()
122 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound => null()
123 integer(I4B),
dimension(:),
pointer,
contiguous :: stoiconv => null()
125 real(dp),
dimension(:),
pointer,
contiguous :: stoss => null()
126 real(dp),
dimension(:),
pointer,
contiguous :: buff => null()
127 real(dp),
dimension(:),
pointer,
contiguous :: buffusr => null()
128 integer,
dimension(:),
pointer,
contiguous :: nodelist => null()
129 integer,
dimension(:),
pointer,
contiguous :: unodelist => null()
132 real(dp),
dimension(:),
pointer,
contiguous :: sgm => null()
133 real(dp),
dimension(:),
pointer,
contiguous :: sgs => null()
134 real(dp),
dimension(:),
pointer,
contiguous :: cg_ske_cr => null()
135 real(dp),
dimension(:),
pointer,
contiguous :: cg_gs => null()
136 real(dp),
dimension(:),
pointer,
contiguous :: cg_es => null()
137 real(dp),
dimension(:),
pointer,
contiguous :: cg_es0 => null()
138 real(dp),
dimension(:),
pointer,
contiguous :: cg_pcs => null()
139 real(dp),
dimension(:),
pointer,
contiguous :: cg_comp => null()
140 real(dp),
dimension(:),
pointer,
contiguous :: cg_tcomp => null()
141 real(dp),
dimension(:),
pointer,
contiguous :: cg_stor => null()
142 real(dp),
dimension(:),
pointer,
contiguous :: cg_ske => null()
143 real(dp),
dimension(:),
pointer,
contiguous :: cg_sk => null()
144 real(dp),
dimension(:),
pointer,
contiguous :: cg_thickini => null()
145 real(dp),
dimension(:),
pointer,
contiguous :: cg_thetaini => null()
146 real(dp),
dimension(:),
pointer,
contiguous :: cg_thick => null()
147 real(dp),
dimension(:),
pointer,
contiguous :: cg_thick0 => null()
148 real(dp),
dimension(:),
pointer,
contiguous :: cg_theta => null()
149 real(dp),
dimension(:),
pointer,
contiguous :: cg_theta0 => null()
152 real(dp),
dimension(:),
pointer,
contiguous :: cell_wcstor => null()
153 real(dp),
dimension(:),
pointer,
contiguous :: cell_thick => null()
156 integer(I4B),
dimension(:),
pointer,
contiguous :: idelay => null()
157 integer(I4B),
dimension(:),
pointer,
contiguous :: ielastic => null()
158 integer(I4B),
dimension(:),
pointer,
contiguous :: iconvert => null()
159 real(dp),
dimension(:),
pointer,
contiguous :: ci => null()
160 real(dp),
dimension(:),
pointer,
contiguous :: rci => null()
161 real(dp),
dimension(:),
pointer,
contiguous :: pcs => null()
162 real(dp),
dimension(:),
pointer,
contiguous :: rnb => null()
163 real(dp),
dimension(:),
pointer,
contiguous :: kv => null()
164 real(dp),
dimension(:),
pointer,
contiguous :: h0 => null()
165 real(dp),
dimension(:),
pointer,
contiguous :: comp => null()
166 real(dp),
dimension(:),
pointer,
contiguous :: tcomp => null()
167 real(dp),
dimension(:),
pointer,
contiguous :: tcompi => null()
168 real(dp),
dimension(:),
pointer,
contiguous :: tcompe => null()
169 real(dp),
dimension(:),
pointer,
contiguous :: storagee => null()
170 real(dp),
dimension(:),
pointer,
contiguous :: storagei => null()
171 real(dp),
dimension(:),
pointer,
contiguous :: ske => null()
172 real(dp),
dimension(:),
pointer,
contiguous :: sk => null()
173 real(dp),
dimension(:),
pointer,
contiguous :: thickini => null()
174 real(dp),
dimension(:),
pointer,
contiguous :: thetaini => null()
175 real(dp),
dimension(:),
pointer,
contiguous :: thick => null()
176 real(dp),
dimension(:),
pointer,
contiguous :: thick0 => null()
177 real(dp),
dimension(:),
pointer,
contiguous :: theta => null()
178 real(dp),
dimension(:),
pointer,
contiguous :: theta0 => null()
179 real(dp),
dimension(:, :),
pointer,
contiguous :: auxvar => null()
182 integer(I4B),
dimension(:),
pointer,
contiguous :: idb_nconv_count => null()
183 integer(I4B),
dimension(:, :),
pointer,
contiguous :: idbconvert => null()
184 real(dp),
dimension(:),
pointer,
contiguous :: dbdhmax => null()
185 real(dp),
dimension(:, :),
pointer,
contiguous :: dbz => null()
186 real(dp),
dimension(:, :),
pointer,
contiguous :: dbrelz => null()
187 real(dp),
dimension(:, :),
pointer,
contiguous :: dbh => null()
188 real(dp),
dimension(:, :),
pointer,
contiguous :: dbh0 => null()
189 real(dp),
dimension(:, :),
pointer,
contiguous :: dbgeo => null()
190 real(dp),
dimension(:, :),
pointer,
contiguous :: dbes => null()
191 real(dp),
dimension(:, :),
pointer,
contiguous :: dbes0 => null()
192 real(dp),
dimension(:, :),
pointer,
contiguous :: dbpcs => null()
193 real(dp),
dimension(:),
pointer,
contiguous :: dbflowtop => null()
194 real(dp),
dimension(:),
pointer,
contiguous :: dbflowbot => null()
195 real(dp),
dimension(:, :),
pointer,
contiguous :: dbdzini => null()
196 real(dp),
dimension(:, :),
pointer,
contiguous :: dbthetaini => null()
197 real(dp),
dimension(:, :),
pointer,
contiguous :: dbdz => null()
198 real(dp),
dimension(:, :),
pointer,
contiguous :: dbdz0 => null()
199 real(dp),
dimension(:, :),
pointer,
contiguous :: dbtheta => null()
200 real(dp),
dimension(:, :),
pointer,
contiguous :: dbtheta0 => null()
201 real(dp),
dimension(:, :),
pointer,
contiguous :: dbcomp => null()
202 real(dp),
dimension(:, :),
pointer,
contiguous :: dbtcomp => null()
205 real(dp),
dimension(:),
pointer,
contiguous :: dbal => null()
206 real(dp),
dimension(:),
pointer,
contiguous :: dbad => null()
207 real(dp),
dimension(:),
pointer,
contiguous :: dbau => null()
208 real(dp),
dimension(:),
pointer,
contiguous :: dbrhs => null()
209 real(dp),
dimension(:),
pointer,
contiguous :: dbdh => null()
210 real(dp),
dimension(:),
pointer,
contiguous :: dbaw => null()
213 integer(I4B),
dimension(:),
pointer,
contiguous :: nodelistsig0 => null()
214 real(dp),
dimension(:),
pointer,
contiguous :: sig0 => null()
217 integer(I4B),
pointer :: inobspkg => null()
321 subroutine csub_cr(csubobj, name_model, mempath, istounit, stoPckName, inunit, &
325 character(len=*),
intent(in) :: name_model
326 character(len=*),
intent(in) :: mempath
327 integer(I4B),
intent(in) :: inunit
328 integer(I4B),
intent(in) :: istounit
329 character(len=*),
intent(in) :: stopckname
330 integer(I4B),
intent(in) :: iout
337 call csubobj%set_names(1, name_model,
'CSUB',
'CSUB', mempath)
340 call csubobj%csub_allocate_scalars()
346 csubobj%istounit = istounit
347 csubobj%inunit = inunit
364 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound
366 character(len=20) :: cellid
367 integer(I4B) :: idelay
371 integer(I4B) :: istoerr
375 real(DP) :: cg_ske_cr
379 real(DP) :: cell_thickness
380 real(DP) :: overshoot
384 character(len=*),
parameter :: fmtcsub = &
385 "(1x,/1x,'CSUB -- COMPACTION PACKAGE, VERSION 1.15, 7/27/2026', &
386 &' INPUT READ FROM MEMPATH: ', A, /)"
389 write (this%iout, fmtcsub) this%input_mempath
393 this%ibound => ibound
396 call obs_cr(this%obs, this%inobspkg)
399 call this%source_options()
402 call this%source_dimensions()
405 call this%obs%obs_ar()
413 call this%csub_allocate_arrays()
416 call this%csub_source_griddata()
422 do node = 1, this%dis%nodes
423 call this%dis%noder_to_string(node, cellid)
424 cg_ske_cr = this%cg_ske_cr(node)
425 theta = this%cg_thetaini(node)
428 if (cg_ske_cr < dzero)
then
429 write (
errmsg,
'(a,g0,a,1x,a,1x,a,a)') &
430 'Coarse-grained material CG_SKE_CR (', cg_ske_cr,
') is less', &
431 'than zero in cell', trim(adjustl(cellid)),
'.'
435 if (this%stoss(node) /= dzero)
then
440 if (theta > done .or. theta < dzero)
then
441 write (
errmsg,
'(a,g0,a,1x,a,1x,a,a)') &
442 'Coarse-grained material THETA (', theta,
') is less', &
443 'than zero or greater than 1 in cell', trim(adjustl(cellid)),
'.'
449 if (istoerr /= 0)
then
450 write (
errmsg,
'(a,3(1x,a))') &
451 'Specific storage values in the storage (STO) package must', &
452 'be zero in all active cells when using the', &
453 trim(adjustl(this%packName)), &
459 if (this%ninterbeds > 0)
then
460 call this%csub_source_packagedata()
464 call this%csub_initialize_tables()
467 do node = 1, this%dis%nodes
468 top = this%dis%top(node)
469 bot = this%dis%bot(node)
470 this%cg_thickini(node) = top - bot
471 this%cell_thick(node) = top - bot
475 do ib = 1, this%ninterbeds
476 node = this%nodelist(ib)
477 idelay = this%idelay(ib)
478 if (idelay == 0)
then
479 v = this%thickini(ib)
481 v = this%rnb(ib) * this%thickini(ib)
483 this%cg_thickini(node) = this%cg_thickini(node) - v
491 do node = 1, this%dis%nodes
492 thick = this%cg_thickini(node)
493 if (thick >= dzero) cycle
494 cell_thickness = this%cell_thick(node)
496 if (overshoot <= dem5 * cell_thickness)
then
500 f = cell_thickness / (cell_thickness - thick)
501 do ib = 1, this%ninterbeds
502 if (node /= this%nodelist(ib)) cycle
503 this%thickini(ib) = this%thickini(ib) * f
504 if (this%iupdatematprop /= 0)
then
505 this%thick(ib) = this%thick(ib) * f
507 idelay = this%idelay(ib)
508 if (idelay /= 0)
then
509 rval = this%thickini(ib) / real(this%ndelaycells, dp)
510 do n = 1, this%ndelaycells
511 this%dbdzini(n, idelay) = rval
512 this%dbdz(n, idelay) = rval
513 this%dbdz0(n, idelay) = rval
516 call this%csub_delay_init_zcell(ib)
519 this%cg_thickini(node) = dzero
521 call this%dis%noder_to_string(node, cellid)
522 write (
errmsg,
'(a,g0,a,1x,a,a)') &
523 'Coarse grained material thickness is less than zero (', &
524 thick,
') in cell', trim(adjustl(cellid)),
'. Interbed thicknesses:'
527 do ib = 1, this%ninterbeds
528 if (node /= this%nodelist(ib))
then
531 idelay = this%idelay(ib)
532 v = this%thickini(ib)
533 if (idelay /= 0)
then
537 write (
errmsg,
'(a,1x,a,i0,a,g0)') &
539 'icbno(', ib,
')=', v
541 write (
errmsg,
'(a,a,g0,a)') &
543 '. Total interbed thickness=', vtot,
'.'
556 if (this%iupdatematprop /= 0)
then
557 do node = 1, this%dis%nodes
558 this%cg_thick(node) = this%cg_thickini(node)
559 this%cg_theta(node) = this%cg_thetaini(node)
581 integer(I4B),
pointer :: ibs
582 integer(I4B) :: inobs
583 integer(I4B),
pointer :: iei_smoothing
584 integer(I4B),
pointer :: istrict
585 character(len=LINELENGTH) :: csv_interbed, csv_coarse
586 character(len=LINELENGTH) :: cmp_fn, ecmp_fn, iecmp_fn, ibcmp_fn, cmpcoarse_fn
587 character(len=LINELENGTH) :: zdisp_fn, pkg_converge_fn
589 logical(LGP) :: warn_estress_lag = .false.
596 call mem_set_value(this%inamedbound,
'BOUNDNAMES', this%input_mempath, &
598 call mem_set_value(this%iprpak,
'PRINT_INPUT', this%input_mempath, &
600 call mem_set_value(this%ipakcb,
'SAVE_FLOWS', this%input_mempath, &
602 call mem_set_value(this%gammaw,
'GAMMAW', this%input_mempath, found%gammaw)
603 call mem_set_value(this%beta,
'BETA', this%input_mempath, found%beta)
605 allocate (iei_smoothing)
608 this%input_mempath, found%ei_smoothing)
609 if (found%ei_smoothing)
then
612 deallocate (iei_smoothing)
616 call mem_set_value(istrict,
'STRICT_STRESS', this%input_mempath, &
618 if (found%strict_stress)
then
619 this%istrict_stress = 1
622 call mem_set_value(this%ipch,
'HEAD_BASED', this%input_mempath, &
624 call mem_set_value(this%ipch,
'PRECON_HEAD', this%input_mempath, &
626 call mem_set_value(this%ndelaycells,
'NDELAYCELLS', this%input_mempath, &
628 call mem_set_value(this%istoragec,
'ICOMPRESS', this%input_mempath, &
630 call mem_set_value(this%iupdatematprop,
'MATPROP', this%input_mempath, &
632 call mem_set_value(this%icellf,
'CELL_FRACTION', this%input_mempath, &
634 call mem_set_value(ibs,
'INTERBED_STATE', this%input_mempath, &
635 found%interbed_state)
636 call mem_set_value(this%ispecified_pcs,
'PRECON_STRESS', this%input_mempath, &
638 call mem_set_value(this%ispecified_dbh,
'DELAY_HEAD', this%input_mempath, &
640 call mem_set_value(this%ieslag,
'STRESS_LAG', this%input_mempath, &
642 call mem_set_value(csv_interbed,
'INTERBEDSTRAINFN', this%input_mempath, &
643 found%interbedstrainfn)
644 call mem_set_value(csv_coarse,
'COARSESTRAINFN', this%input_mempath, &
645 found%coarsestrainfn)
646 call mem_set_value(cmp_fn,
'CMPFN', this%input_mempath, found%cmpfn)
647 call mem_set_value(ecmp_fn,
'ELASTICCMPFN', this%input_mempath, &
649 call mem_set_value(iecmp_fn,
'INELASTICCMPFN', this%input_mempath, &
650 found%inelasticcmpfn)
651 call mem_set_value(ibcmp_fn,
'INTERBEDCMPFN', this%input_mempath, &
653 call mem_set_value(cmpcoarse_fn,
'CMPCOARSEFN', this%input_mempath, &
655 call mem_set_value(zdisp_fn,
'ZDISPFN', this%input_mempath, found%zdispfn)
656 call mem_set_value(pkg_converge_fn,
'PKGCONVERGEFN', this%input_mempath, &
660 if (
filein_fname(this%obs%inputFilename,
'OBS6_FILENAME', &
661 this%input_mempath, this%input_fname))
then
662 this%obs%active = .true.
664 call openfile(inobs, this%iout, this%obs%inputFilename,
'OBS')
665 this%obs%inUnitObs = inobs
666 this%inobspkg = inobs
667 call this%obs%obs_df(this%iout, this%packName, this%filtyp, this%dis)
668 call this%csub_df_obs()
672 if (found%save_flows) this%ipakcb = -1
673 if (found%head_based)
then
674 this%lhead_based = .true.
675 if (this%ieslag /= 0)
then
677 warn_estress_lag = .true.
680 if (found%icompress) this%istoragec = 0
681 if (found%interbed_state)
then
682 this%ispecified_pcs = 1
683 this%ispecified_dbh = 1
685 if (found%gammaw .or. found%beta)
then
686 this%brg = this%gammaw * this%beta
690 if (found%interbedstrainfn)
then
692 call openfile(this%istrainib, this%iout, csv_interbed,
'CSV_OUTPUT', &
693 filstat_opt=
'REPLACE', mode_opt=
mnormal)
695 if (found%coarsestrainfn)
then
697 call openfile(this%istrainsk, this%iout, csv_coarse,
'CSV_OUTPUT', &
698 filstat_opt=
'REPLACE', mode_opt=
mnormal)
700 if (found%cmpfn)
then
702 call openfile(this%ioutcomp, this%iout, cmp_fn,
'DATA(BINARY)', &
705 if (found%elasticcmpfn)
then
707 call openfile(this%ioutcompe, this%iout, ecmp_fn, &
711 if (found%inelasticcmpfn)
then
713 call openfile(this%ioutcompi, this%iout, iecmp_fn, &
717 if (found%interbedcmpfn)
then
719 call openfile(this%ioutcompib, this%iout, ibcmp_fn, &
723 if (found%cmpcoarsefn)
then
725 call openfile(this%ioutcomps, this%iout, cmpcoarse_fn, &
729 if (found%zdispfn)
then
731 call openfile(this%ioutzdisp, this%iout, zdisp_fn, &
735 if (found%pkgconvergefn)
then
737 call openfile(this%ipakcsv, this%iout, pkg_converge_fn,
'CSV', &
738 filstat_opt=
'REPLACE', mode_opt=
mnormal)
742 call this%log_options(warn_estress_lag)
757 logical(LGP),
intent(in) :: warn_estress_lag
760 character(len=*),
parameter :: fmtts = &
761 &
"(4x,'TIME-SERIES DATA WILL BE READ FROM FILE: ',a)"
762 character(len=*),
parameter :: fmtflow = &
763 &
"(4x,'FLOWS WILL BE SAVED TO FILE: ',a,/4x,'OPENED ON UNIT: ',I7)"
764 character(len=*),
parameter :: fmtflow2 = &
765 &
"(4x,'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL')"
766 character(len=*),
parameter :: fmtssessv = &
767 &
"(4x,'USING SSE AND SSV INSTEAD OF CR AND CC.')"
768 character(len=*),
parameter :: fmtoffset = &
769 &
"(4x,'INITIAL_STRESS TREATED AS AN OFFSET.')"
770 character(len=*),
parameter :: fmtopt = &
772 character(len=*),
parameter :: fmtopti = &
774 character(len=*),
parameter :: fmtoptr = &
776 character(len=*),
parameter :: fmtfileout = &
777 "(4x,'CSUB ',1x,a,1x,' WILL BE SAVED TO FILE: ',a,/4x,&
778 &'OPENED ON UNIT: ',I7)"
781 write (this%iout,
'(//2(1X,A))') trim(adjustl(this%packName)), &
783 write (this%iout, fmtopti)
'NUMBER OF DELAY CELLS =', &
785 if (this%lhead_based .EQV. .true.)
then
786 write (this%iout,
'(4x,a)') &
787 'HEAD-BASED FORMULATION'
789 write (this%iout,
'(4x,a)') &
790 'EFFECTIVE-STRESS FORMULATION'
792 if (this%istoragec == 0)
then
793 write (this%iout,
'(4x,a,1(/,6x,a))') &
794 'COMPRESSION INDICES WILL BE SPECIFIED INSTEAD OF ELASTIC AND', &
795 'INELASTIC SPECIFIC STORAGE COEFFICIENTS'
797 write (this%iout,
'(4x,a,1(/,6x,a))') &
798 'ELASTIC AND INELASTIC SPECIFIC STORAGE COEFFICIENTS WILL BE ', &
801 if (this%iupdatematprop /= 1)
then
802 write (this%iout,
'(4x,a,1(/,6x,a))') &
803 'THICKNESS AND VOID RATIO WILL NOT BE ADJUSTED DURING THE', &
806 write (this%iout,
'(4x,a)') &
807 'THICKNESS AND VOID RATIO WILL BE ADJUSTED DURING THE SIMULATION'
809 if (this%icellf /= 1)
then
810 write (this%iout,
'(4x,a)') &
811 'INTERBED THICKNESS WILL BE SPECIFIED AS A THICKNESS'
813 write (this%iout,
'(4x,a,1(/,6x,a))') &
814 'INTERBED THICKNESS WILL BE SPECIFIED AS A AS A CELL FRACTION'
816 if (this%ispecified_pcs /= 1)
then
817 if (this%ipch /= 0)
then
818 write (this%iout,
'(4x,a,1(/,6x,a))') &
819 'PRECONSOLIDATION HEAD WILL BE SPECIFIED RELATIVE TO INITIAL', &
822 write (this%iout,
'(4x,a,1(/,6x,a))') &
823 'PRECONSOLIDATION STRESS WILL BE SPECIFIED RELATIVE TO INITIAL', &
827 if (this%ipch /= 0)
then
828 write (this%iout,
'(4x,a,1(/,6x,a))') &
829 'PRECONSOLIDATION HEAD WILL BE SPECIFIED AS ABSOLUTE VALUES', &
830 'INSTEAD OF RELATIVE TO INITIAL HEAD CONDITIONS'
832 write (this%iout,
'(4x,a,1(/,6x,a))') &
833 'PRECONSOLIDATION STRESS WILL BE SPECIFIED AS ABSOLUTE VALUES', &
834 'INSTEAD OF RELATIVE TO INITIAL STRESS CONDITIONS'
837 if (this%ispecified_dbh /= 1)
then
838 write (this%iout,
'(4x,a,1(/,6x,a))') &
839 'DELAY INTERBED HEADS WILL BE SPECIFIED RELATIVE TO INITIAL ', &
842 write (this%iout,
'(4x,a,1(/,6x,a))') &
843 'DELAY INTERBED HEADS WILL BE SPECIFIED AS ABSOLUTE VALUES INSTEAD', &
844 'OF RELATIVE TO INITIAL GWF HEADS'
847 if (this%lhead_based .EQV. .false.)
then
848 if (this%ieslag /= 0)
then
849 write (this%iout,
'(4x,a,1(/,6x,a))') &
850 'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE EFFECTIVE', &
851 'STRESS FROM THE PREVIOUS TIME STEP'
853 write (this%iout,
'(4x,a,1(/,6x,a))') &
854 'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE CURRENT', &
857 if (this%istrict_stress == 0)
then
858 write (this%iout,
'(4x,a,1(/,6x,a))') &
859 'SMALL OR NEGATIVE EFFECTIVE STRESS WILL BE REGULARIZED BY FLOORING', &
860 'THE EFFECTIVE STRESS USED TO CALCULATE THE SPECIFIC STORAGE'
862 write (this%iout,
'(4x,a,1(/,6x,a))') &
863 'SMALL OR NEGATIVE EFFECTIVE STRESS WILL TERMINATE THE SIMULATION', &
864 '(STRICT_EFFECTIVE_STRESS SPECIFIED)'
866 else if (warn_estress_lag)
then
867 write (this%iout,
'(4x,a,2(/,6x,a))') &
868 'EFFECTIVE_STRESS_LAG HAS BEEN SPECIFIED BUT HAS NO EFFECT WHEN', &
869 'USING THE HEAD-BASED FORMULATION (HEAD_BASED HAS BEEN SPECIFIED', &
870 'IN THE OPTIONS BLOCK)'
873 write (this%iout, fmtoptr)
'GAMMAW =', this%gammaw
874 write (this%iout, fmtoptr)
'BETA =', this%beta
875 write (this%iout, fmtoptr)
'GAMMAW * BETA =', this%brg
876 write (this%iout,
'((1X,A))')
'END PACKAGE SETTINGS'
898 call mem_set_value(this%ninterbeds,
'NINTERBEDS', this%input_mempath, &
900 call mem_set_value(this%maxsig0,
'MAXBOUND', this%input_mempath, &
904 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%packName))// &
906 write (this%iout,
'(4x,a,i0)')
'NINTERBEDS = ', this%ninterbeds
907 write (this%iout,
'(4x,a,i0)')
'MAXSIG0 = ', this%maxsig0
908 write (this%iout,
'(1x,a)') &
909 'END OF '//trim(adjustl(this%packName))//
' DIMENSIONS'
912 if (.not. found%ninterbeds)
then
914 'NINTERBEDS is a required dimension.'
921 call this%define_listlabel()
937 call this%NumericalPackageType%allocate_scalars()
944 call mem_allocate(this%istounit,
'ISTOUNIT', this%memoryPath)
945 call mem_allocate(this%inobspkg,
'INOBSPKG', this%memoryPath)
946 call mem_allocate(this%ninterbeds,
'NINTERBEDS', this%memoryPath)
947 call mem_allocate(this%maxsig0,
'MAXSIG0', this%memoryPath)
948 call mem_allocate(this%nbound,
'NBOUND', this%memoryPath)
949 call mem_allocate(this%iscloc,
'ISCLOC', this%memoryPath)
950 call mem_allocate(this%iauxmultcol,
'IAUXMULTCOL', this%memoryPath)
951 call mem_allocate(this%ndelaycells,
'NDELAYCELLS', this%memoryPath)
952 call mem_allocate(this%ndelaybeds,
'NDELAYBEDS', this%memoryPath)
953 call mem_allocate(this%initialized,
'INITIALIZED', this%memoryPath)
954 call mem_allocate(this%ieslag,
'IESLAG', this%memoryPath)
956 call mem_allocate(this%istrict_stress,
'ISTRICT_STRESS', this%memoryPath)
957 call mem_allocate(this%nreg_ts,
'NREG_TS', this%memoryPath)
958 call mem_allocate(this%lhead_based,
'LHEAD_BASED', this%memoryPath)
959 call mem_allocate(this%iupdatestress,
'IUPDATESTRESS', this%memoryPath)
960 call mem_allocate(this%ispecified_pcs,
'ISPECIFIED_PCS', this%memoryPath)
961 call mem_allocate(this%ispecified_dbh,
'ISPECIFIED_DBH', this%memoryPath)
962 call mem_allocate(this%inamedbound,
'INAMEDBOUND', this%memoryPath)
963 call mem_allocate(this%iconvchk,
'ICONVCHK', this%memoryPath)
965 call mem_allocate(this%istoragec,
'ISTORAGEC', this%memoryPath)
966 call mem_allocate(this%istrainib,
'ISTRAINIB', this%memoryPath)
967 call mem_allocate(this%istrainsk,
'ISTRAINSK', this%memoryPath)
968 call mem_allocate(this%ioutcomp,
'IOUTCOMP', this%memoryPath)
969 call mem_allocate(this%ioutcompi,
'IOUTCOMPI', this%memoryPath)
970 call mem_allocate(this%ioutcompe,
'IOUTCOMPE', this%memoryPath)
971 call mem_allocate(this%ioutcompib,
'IOUTCOMPIB', this%memoryPath)
972 call mem_allocate(this%ioutcomps,
'IOUTCOMPS', this%memoryPath)
973 call mem_allocate(this%ioutzdisp,
'IOUTZDISP', this%memoryPath)
974 call mem_allocate(this%ipakcsv,
'IPAKCSV', this%memoryPath)
975 call mem_allocate(this%iupdatematprop,
'IUPDATEMATPROP', this%memoryPath)
976 call mem_allocate(this%epsilon,
'EPSILON', this%memoryPath)
977 call mem_allocate(this%cc_crit,
'CC_CRIT', this%memoryPath)
978 call mem_allocate(this%gammaw,
'GAMMAW', this%memoryPath)
981 call mem_allocate(this%satomega,
'SATOMEGA', this%memoryPath)
982 call mem_allocate(this%pcsomega,
'PCSOMEGA', this%memoryPath)
983 call mem_allocate(this%icellf,
'ICELLF', this%memoryPath)
984 call mem_allocate(this%gwfiss0,
'GWFISS0', this%memoryPath)
997 this%ndelaycells = 19
1002 this%istrict_stress = 0
1004 this%lhead_based = .false.
1005 this%iupdatestress = 1
1006 this%ispecified_pcs = 0
1007 this%ispecified_dbh = 0
1008 this%inamedbound = 0
1021 this%iupdatematprop = 0
1022 this%epsilon =
dzero
1025 this%beta = 4.6512e-10_dp
1026 this%brg = this%gammaw * this%beta
1028 this%pcsomega =
dzero
1031 if (this%inewton /= 0)
then
1032 this%satomega =
dem6
1035 this%satomega =
dzero
1055 integer(I4B) :: iblen
1056 integer(I4B) :: naux
1059 if (this%ioutcomp == 0 .and. this%ioutcompi == 0 .and. &
1060 this%ioutcompe == 0 .and. this%ioutcompib == 0 .and. &
1061 this%ioutcomps == 0 .and. this%ioutzdisp == 0)
then
1062 call mem_allocate(this%buff, 1,
'BUFF', trim(this%memoryPath))
1064 call mem_allocate(this%buff, this%dis%nodes,
'BUFF', trim(this%memoryPath))
1066 if (this%ioutcomp == 0 .and. this%ioutzdisp == 0)
then
1067 call mem_allocate(this%buffusr, 1,
'BUFFUSR', trim(this%memoryPath))
1069 call mem_allocate(this%buffusr, this%dis%nodesuser,
'BUFFUSR', &
1070 trim(this%memoryPath))
1072 call mem_allocate(this%sgm, this%dis%nodes,
'SGM', trim(this%memoryPath))
1073 call mem_allocate(this%sgs, this%dis%nodes,
'SGS', trim(this%memoryPath))
1074 call mem_allocate(this%cg_ske_cr, this%dis%nodes,
'CG_SKE_CR', &
1075 trim(this%memoryPath))
1076 call mem_allocate(this%cg_es, this%dis%nodes,
'CG_ES', &
1077 trim(this%memoryPath))
1078 call mem_allocate(this%cg_es0, this%dis%nodes,
'CG_ES0', &
1079 trim(this%memoryPath))
1080 call mem_allocate(this%cg_pcs, this%dis%nodes,
'CG_PCS', &
1081 trim(this%memoryPath))
1082 call mem_allocate(this%cg_comp, this%dis%nodes,
'CG_COMP', &
1083 trim(this%memoryPath))
1084 call mem_allocate(this%cg_tcomp, this%dis%nodes,
'CG_TCOMP', &
1085 trim(this%memoryPath))
1086 call mem_allocate(this%cg_stor, this%dis%nodes,
'CG_STOR', &
1087 trim(this%memoryPath))
1088 call mem_allocate(this%cg_ske, this%dis%nodes,
'CG_SKE', &
1089 trim(this%memoryPath))
1090 call mem_allocate(this%cg_sk, this%dis%nodes,
'CG_SK', &
1091 trim(this%memoryPath))
1092 call mem_allocate(this%cg_thickini, this%dis%nodes,
'CG_THICKINI', &
1093 trim(this%memoryPath))
1094 call mem_allocate(this%cg_thetaini, this%dis%nodes,
'CG_THETAINI', &
1095 trim(this%memoryPath))
1096 if (this%iupdatematprop == 0)
then
1097 call mem_setptr(this%cg_thick,
'CG_THICKINI', trim(this%memoryPath))
1098 call mem_setptr(this%cg_thick0,
'CG_THICKINI', trim(this%memoryPath))
1099 call mem_setptr(this%cg_theta,
'CG_THETAINI', trim(this%memoryPath))
1100 call mem_setptr(this%cg_theta0,
'CG_THETAINI', trim(this%memoryPath))
1102 call mem_allocate(this%cg_thick, this%dis%nodes,
'CG_THICK', &
1103 trim(this%memoryPath))
1104 call mem_allocate(this%cg_thick0, this%dis%nodes,
'CG_THICK0', &
1105 trim(this%memoryPath))
1106 call mem_allocate(this%cg_theta, this%dis%nodes,
'CG_THETA', &
1107 trim(this%memoryPath))
1108 call mem_allocate(this%cg_theta0, this%dis%nodes,
'CG_THETA0', &
1109 trim(this%memoryPath))
1113 call mem_allocate(this%cell_wcstor, this%dis%nodes,
'CELL_WCSTOR', &
1114 trim(this%memoryPath))
1115 call mem_allocate(this%cell_thick, this%dis%nodes,
'CELL_THICK', &
1116 trim(this%memoryPath))
1120 if (this%ninterbeds > 0)
then
1121 iblen = this%ninterbeds
1124 if (this%naux > 0)
then
1127 call mem_allocate(this%auxvar, naux, iblen,
'AUXVAR', this%memoryPath)
1130 this%auxvar(j, n) =
dzero
1133 call mem_allocate(this%unodelist, iblen,
'UNODELIST', trim(this%memoryPath))
1134 call mem_allocate(this%nodelist, iblen,
'NODELIST', trim(this%memoryPath))
1135 call mem_allocate(this%cg_gs, this%dis%nodes,
'CG_GS', trim(this%memoryPath))
1136 call mem_allocate(this%pcs, iblen,
'PCS', trim(this%memoryPath))
1137 call mem_allocate(this%rnb, iblen,
'RNB', trim(this%memoryPath))
1138 call mem_allocate(this%kv, iblen,
'KV', trim(this%memoryPath))
1139 call mem_allocate(this%h0, iblen,
'H0', trim(this%memoryPath))
1140 call mem_allocate(this%ci, iblen,
'CI', trim(this%memoryPath))
1141 call mem_allocate(this%rci, iblen,
'RCI', trim(this%memoryPath))
1142 call mem_allocate(this%idelay, iblen,
'IDELAY', trim(this%memoryPath))
1143 call mem_allocate(this%ielastic, iblen,
'IELASTIC', trim(this%memoryPath))
1144 call mem_allocate(this%iconvert, iblen,
'ICONVERT', trim(this%memoryPath))
1145 call mem_allocate(this%comp, iblen,
'COMP', trim(this%memoryPath))
1146 call mem_allocate(this%tcomp, iblen,
'TCOMP', trim(this%memoryPath))
1147 call mem_allocate(this%tcompi, iblen,
'TCOMPI', trim(this%memoryPath))
1148 call mem_allocate(this%tcompe, iblen,
'TCOMPE', trim(this%memoryPath))
1149 call mem_allocate(this%storagee, iblen,
'STORAGEE', trim(this%memoryPath))
1150 call mem_allocate(this%storagei, iblen,
'STORAGEI', trim(this%memoryPath))
1151 call mem_allocate(this%ske, iblen,
'SKE', trim(this%memoryPath))
1152 call mem_allocate(this%sk, iblen,
'SK', trim(this%memoryPath))
1153 call mem_allocate(this%thickini, iblen,
'THICKINI', trim(this%memoryPath))
1154 call mem_allocate(this%thetaini, iblen,
'THETAINI', trim(this%memoryPath))
1155 if (this%iupdatematprop == 0)
then
1156 call mem_setptr(this%thick,
'THICKINI', trim(this%memoryPath))
1157 call mem_setptr(this%thick0,
'THICKINI', trim(this%memoryPath))
1158 call mem_setptr(this%theta,
'THETAINI', trim(this%memoryPath))
1159 call mem_setptr(this%theta0,
'THETAINI', trim(this%memoryPath))
1161 call mem_allocate(this%thick, iblen,
'THICK', trim(this%memoryPath))
1162 call mem_allocate(this%thick0, iblen,
'THICK0', trim(this%memoryPath))
1163 call mem_allocate(this%theta, iblen,
'THETA', trim(this%memoryPath))
1164 call mem_allocate(this%theta0, iblen,
'THETA0', trim(this%memoryPath))
1171 if (this%inamedbound /= 0)
then
1173 'BOUNDNAME', trim(this%memoryPath))
1176 'BOUNDNAME', trim(this%memoryPath))
1181 call mem_allocate(this%nodelistsig0, this%maxsig0,
'NODELISTSIG0', &
1185 call mem_setptr(this%sig0,
'SIG0', this%input_mempath)
1186 call mem_checkin(this%sig0,
'SIG0', this%memoryPath, &
1187 'SIG0', this%input_mempath)
1190 call mem_setptr(this%gwfiss,
'ISS', trim(this%name_model))
1193 call mem_setptr(this%stoiconv,
'ICONVERT', this%stoMemPath)
1194 call mem_setptr(this%stoss,
'SS', this%stoMemPath)
1197 do n = 1, this%dis%nodes
1198 this%cg_gs(n) =
dzero
1199 this%cg_es(n) =
dzero
1200 this%cg_comp(n) =
dzero
1201 this%cg_tcomp(n) =
dzero
1202 this%cell_wcstor(n) =
dzero
1204 do n = 1, this%ninterbeds
1205 this%theta(n) =
dzero
1206 this%tcomp(n) =
dzero
1207 this%tcompi(n) =
dzero
1208 this%tcompe(n) =
dzero
1210 do n = 1, this%maxsig0
1211 this%nodelistsig0(n) = 0
1224 integer(I4B) :: node
1226 integer(I4B),
dimension(:),
pointer,
contiguous :: map
1230 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1233 call mem_set_value(this%cg_ske_cr,
'CG_SKE_CR', this%input_mempath, &
1234 map, found%cg_ske_cr)
1235 call mem_set_value(this%cg_thetaini,
'CG_THETA', this%input_mempath, &
1236 map, found%cg_theta)
1237 call mem_set_value(this%sgm,
'SGM', this%input_mempath, map, found%sgm)
1238 call mem_set_value(this%sgs,
'SGS', this%input_mempath, map, found%sgs)
1241 if (.not. found%cg_ske_cr)
then
1242 call store_error(
'CG_SKE GRIDDATA must be specified.')
1245 if (.not. found%cg_theta)
then
1246 call store_error(
'CG_THETA GRIDDATA must be specified.')
1251 if (.not. found%sgm)
then
1252 do node = 1, this%dis%nodes
1253 this%sgm(node) = 1.7d0
1256 if (.not. found%sgs)
then
1257 do node = 1, this%dis%nodes
1258 this%sgs(node) = 2.0d0
1276 integer(I4B),
dimension(:),
pointer,
contiguous :: icsubno
1277 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid_pkgdata
1278 integer(I4B),
dimension(:),
pointer :: cellid
1280 contiguous :: cdelay
1282 contiguous :: boundname
1283 real(DP),
dimension(:),
pointer,
contiguous :: pcs, thick_frac, rnb
1284 real(DP),
dimension(:),
pointer,
contiguous :: ssv_cc, sse_cr, theta, kv, h0
1285 character(len=LINELENGTH) :: cdelaystr
1286 character(len=LENBOUNDNAME) :: bndname
1287 character(len=20) :: cellidstr
1288 real(DP) :: top, botm, baq, q, thick, rval
1289 integer(I4B) :: idelay, ndelaybeds, csubno
1290 integer(I4B) :: ib, n, nodeu, noder
1293 call mem_setptr(icsubno,
'ICSUBNO', this%input_mempath)
1294 call mem_setptr(cellid_pkgdata,
'CELLID_PKGDATA', this%input_mempath)
1295 call mem_setptr(cdelay,
'CDELAY', this%input_mempath)
1296 call mem_setptr(pcs,
'PCS0', this%input_mempath)
1297 call mem_setptr(thick_frac,
'THICK_FRAC', this%input_mempath)
1298 call mem_setptr(rnb,
'RNB', this%input_mempath)
1299 call mem_setptr(ssv_cc,
'SSV_CC', this%input_mempath)
1300 call mem_setptr(sse_cr,
'SSE_CR', this%input_mempath)
1301 call mem_setptr(theta,
'THETA', this%input_mempath)
1302 call mem_setptr(kv,
'KV', this%input_mempath)
1303 call mem_setptr(h0,
'H0', this%input_mempath)
1304 call mem_setptr(boundname,
'BOUNDNAME', this%input_mempath)
1310 do n = 1,
size(icsubno)
1316 if (csubno < 1 .or. csubno > this%ninterbeds)
then
1317 write (
errmsg,
'(a,1x,i0,2(1x,a),1x,i0,a)') &
1318 'Interbed number (', csubno,
') must be greater than 0 and ', &
1319 'less than or equal to', this%ninterbeds,
'.'
1325 cellid => cellid_pkgdata(:, n)
1328 if (this%dis%ndim == 1)
then
1330 elseif (this%dis%ndim == 2)
then
1331 nodeu =
get_node(cellid(1), 1, cellid(2), &
1332 this%dis%mshape(1), 1, &
1335 nodeu =
get_node(cellid(1), cellid(2), cellid(3), &
1336 this%dis%mshape(1), &
1337 this%dis%mshape(2), &
1342 noder = this%dis%get_nodenumber(nodeu, 1)
1343 if (noder <= 0)
then
1344 call this%dis%nodeu_to_string(nodeu, cellidstr)
1346 'CSUB configured for inactive cell: '// &
1347 trim(adjustl(cellidstr))//
'.'
1353 this%nodelist(csubno) = noder
1354 this%unodelist(csubno) = nodeu
1357 top = this%dis%top(noder)
1358 botm = this%dis%bot(noder)
1362 cdelaystr = cdelay(n)
1363 select case (cdelaystr)
1367 ndelaybeds = ndelaybeds + 1
1370 write (
errmsg,
'(a,1x,a,1x,i0,1x,a)') &
1371 'Invalid CDELAY ', trim(adjustl(cdelaystr)), &
1372 'for packagedata entry', csubno,
'.'
1376 this%idelay(csubno) = idelay
1379 this%pcs(csubno) = pcs(n)
1382 if (this%icellf == 0)
then
1383 if (thick_frac(n) <
dzero .or. thick_frac(n) > baq)
then
1384 write (
errmsg,
'(a,g0,2(a,1x),g0,1x,a,1x,i0,a)') &
1385 'THICK (', thick_frac(n),
') MUST BE greater than or equal to 0 ', &
1386 'and less than or equal to than', baq, &
1387 'for packagedata entry', csubno,
'.'
1390 thick = thick_frac(n)
1392 if (thick_frac(n) <
dzero .or. thick_frac(n) >
done)
then
1393 write (
errmsg,
'(a,1x,a,1x,i0,a)') &
1394 'FRAC MUST BE greater than 0 and less than or equal to 1', &
1395 'for packagedata entry', csubno,
'.'
1398 thick = thick_frac(n) * baq
1400 this%thickini(csubno) = thick
1401 if (this%iupdatematprop /= 0)
then
1402 this%thick(csubno) = thick
1406 if (idelay > 0)
then
1407 if (rnb(n) <
done)
then
1408 write (
errmsg,
'(a,g0,a,1x,a,1x,i0,a)') &
1409 'RNB (', rnb(n),
') must be greater than or equal to 1', &
1410 'for packagedata entry', csubno,
'.'
1413 this%rnb(csubno) = rnb(n)
1415 this%rnb(csubno) =
done
1419 if (ssv_cc(n) <
dzero)
then
1420 write (
errmsg,
'(2(a,1x),i0,a)') &
1421 '(SKV,CI) must be greater than or equal to 0', &
1422 'for packagedata entry', csubno,
'.'
1425 this%ci(csubno) = ssv_cc(n)
1428 if (sse_cr(n) <
dzero)
then
1429 write (
errmsg,
'(2(a,1x),i0,a)') &
1430 '(SKE,RCI) must be greater than or equal to 0', &
1431 'for packagedata entry', csubno,
'.'
1434 this%rci(csubno) = sse_cr(n)
1437 if (this%ci(csubno) == this%rci(csubno))
then
1438 this%ielastic(csubno) = 1
1440 this%ielastic(csubno) = 0
1444 if (theta(n) <=
dzero .or. theta(n) >
done)
then
1445 write (
errmsg,
'(a,1x,a,1x,i0,a)') &
1446 'THETA must be greater than 0 and less than or equal to 1', &
1447 'for packagedata entry', csubno,
'.'
1450 this%thetaini(csubno) = theta(n)
1451 if (this%iupdatematprop /= 0)
then
1452 this%theta(csubno) = theta(n)
1456 if (idelay > 0)
then
1457 if (kv(n) <= 0.0)
then
1458 write (
errmsg,
'(a,1x,i0,a)') &
1459 'KV must be greater than 0 for packagedata entry', csubno,
'.'
1463 this%kv(csubno) = kv(n)
1466 this%h0(csubno) = h0(n)
1469 if (this%inamedbound /= 0)
then
1470 bndname = boundname(n)
1471 if (len_trim(bndname) < 1)
then
1472 write (
errmsg,
'(a,1x,i0,a)') &
1473 'BOUNDNAME must be specified for packagedata entry', csubno,
'.'
1476 this%boundname(csubno) = bndname
1482 this%ndelaybeds = ndelaybeds
1485 if (ndelaybeds > 0)
then
1489 'IDB_NCONV_COUNT', trim(this%memoryPath))
1490 call mem_allocate(this%idbconvert, this%ndelaycells, ndelaybeds, &
1491 'IDBCONVERT', trim(this%memoryPath))
1493 'DBDHMAX', trim(this%memoryPath))
1494 call mem_allocate(this%dbz, this%ndelaycells, ndelaybeds, &
1495 'DBZ', trim(this%memoryPath))
1496 call mem_allocate(this%dbrelz, this%ndelaycells, ndelaybeds, &
1497 'DBRELZ', trim(this%memoryPath))
1498 call mem_allocate(this%dbh, this%ndelaycells, ndelaybeds, &
1499 'DBH', trim(this%memoryPath))
1500 call mem_allocate(this%dbh0, this%ndelaycells, ndelaybeds, &
1501 'DBH0', trim(this%memoryPath))
1502 call mem_allocate(this%dbgeo, this%ndelaycells, ndelaybeds, &
1503 'DBGEO', trim(this%memoryPath))
1504 call mem_allocate(this%dbes, this%ndelaycells, ndelaybeds, &
1505 'DBES', trim(this%memoryPath))
1506 call mem_allocate(this%dbes0, this%ndelaycells, ndelaybeds, &
1507 'DBES0', trim(this%memoryPath))
1508 call mem_allocate(this%dbpcs, this%ndelaycells, ndelaybeds, &
1509 'DBPCS', trim(this%memoryPath))
1511 'DBFLOWTOP', trim(this%memoryPath))
1513 'DBFLOWBOT', trim(this%memoryPath))
1514 call mem_allocate(this%dbdzini, this%ndelaycells, ndelaybeds, &
1515 'DBDZINI', trim(this%memoryPath))
1516 call mem_allocate(this%dbthetaini, this%ndelaycells, ndelaybeds, &
1517 'DBTHETAINI', trim(this%memoryPath))
1518 call mem_allocate(this%dbcomp, this%ndelaycells, ndelaybeds, &
1519 'DBCOMP', trim(this%memoryPath))
1520 call mem_allocate(this%dbtcomp, this%ndelaycells, ndelaybeds, &
1521 'DBTCOMP', trim(this%memoryPath))
1524 if (this%iupdatematprop == 0)
then
1525 call mem_setptr(this%dbdz,
'DBDZINI', trim(this%memoryPath))
1526 call mem_setptr(this%dbdz0,
'DBDZINI', trim(this%memoryPath))
1527 call mem_setptr(this%dbtheta,
'DBTHETAINI', trim(this%memoryPath))
1528 call mem_setptr(this%dbtheta0,
'DBTHETAINI', trim(this%memoryPath))
1530 call mem_allocate(this%dbdz, this%ndelaycells, ndelaybeds, &
1531 'DBDZ', trim(this%memoryPath))
1532 call mem_allocate(this%dbdz0, this%ndelaycells, ndelaybeds, &
1533 'DBDZ0', trim(this%memoryPath))
1534 call mem_allocate(this%dbtheta, this%ndelaycells, ndelaybeds, &
1535 'DBTHETA', trim(this%memoryPath))
1536 call mem_allocate(this%dbtheta0, this%ndelaycells, ndelaybeds, &
1537 'DBTHETA0', trim(this%memoryPath))
1542 'DBAL', trim(this%memoryPath))
1544 'DBAD', trim(this%memoryPath))
1546 'DBAU', trim(this%memoryPath))
1548 'DBRHS', trim(this%memoryPath))
1550 'DBDH', trim(this%memoryPath))
1552 'DBAW', trim(this%memoryPath))
1556 this%idb_nconv_count(n) = 0
1560 do ib = 1, this%ninterbeds
1561 idelay = this%idelay(ib)
1562 if (idelay == 0)
then
1567 do n = 1, this%ndelaycells
1568 rval = this%thickini(ib) / real(this%ndelaycells, dp)
1569 this%dbdzini(n, idelay) = rval
1570 this%dbh(n, idelay) = this%h0(ib)
1571 this%dbh0(n, idelay) = this%h0(ib)
1572 this%dbthetaini(n, idelay) = this%thetaini(ib)
1573 this%dbgeo(n, idelay) =
dzero
1574 this%dbes(n, idelay) =
dzero
1575 this%dbes0(n, idelay) =
dzero
1576 this%dbpcs(n, idelay) = this%pcs(ib)
1577 this%dbcomp(n, idelay) =
dzero
1578 this%dbtcomp(n, idelay) =
dzero
1579 if (this%iupdatematprop /= 0)
then
1580 this%dbdz(n, idelay) = this%dbdzini(n, idelay)
1581 this%dbdz0(n, idelay) = this%dbdzini(n, idelay)
1582 this%dbtheta(n, idelay) = this%theta(ib)
1583 this%dbtheta0(n, idelay) = this%theta(ib)
1588 call this%csub_delay_init_zcell(ib)
1592 do n = 1, this%ndelaycells
1593 this%dbal(n) =
dzero
1594 this%dbad(n) =
dzero
1595 this%dbau(n) =
dzero
1596 this%dbrhs(n) =
dzero
1597 this%dbdh(n) =
dzero
1598 this%dbaw(n) =
dzero
1604 if (ndelaybeds > 0)
then
1605 q = mod(real(this%ndelaycells, dp),
dtwo)
1606 if (q ==
dzero)
then
1607 write (
errmsg,
'(a,i0,a,1x,a)') &
1608 'NDELAYCELLS (', this%ndelaycells,
') must be an', &
1609 'odd number when using the effective stress formulation.'
1614 if (this%iprpak /= 0)
then
1615 call this%csub_print_packagedata()
1642 character(len=LINELENGTH) :: title
1643 character(len=LINELENGTH) :: tag
1644 character(len=10) :: ctype
1645 character(len=20) :: cellid
1646 integer(I4B) :: ntabrows
1647 integer(I4B) :: ntabcols
1649 integer(I4b) :: idelay
1650 integer(I4B) :: node
1653 title =
'CSUB'//
' PACKAGE ('// &
1654 trim(adjustl(this%packName))//
') INTERBED DATA'
1657 ntabrows = this%ninterbeds
1659 if (this%inamedbound /= 0)
then
1660 ntabcols = ntabcols + 1
1664 call table_cr(this%inputtab, this%packName, title)
1665 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
1670 tag =
'INTERBED NUMBER'
1671 call this%inputtab%initialize_column(tag, 10, alignment=
tabcenter)
1673 call this%inputtab%initialize_column(tag, 20, alignment=
tableft)
1674 tag =
'INTERBED TYPE'
1675 call this%inputtab%initialize_column(tag, 10, alignment=
tabcenter)
1677 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1679 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1681 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1682 tag =
'INTERBED THICKNESS'
1683 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1684 tag =
'CELL THICKNESS'
1685 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1687 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1689 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1691 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1693 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1695 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1696 if (this%inamedbound /= 0)
then
1698 call this%inputtab%initialize_column(tag, 40, alignment=
tableft)
1701 do ib = 1, this%ninterbeds
1702 idelay = this%idelay(ib)
1703 node = this%nodelist(ib)
1704 call this%dis%noder_to_string(node, cellid)
1705 if (idelay == 0)
then
1712 call this%inputtab%add_term(ib)
1713 call this%inputtab%add_term(cellid)
1714 call this%inputtab%add_term(ctype)
1715 call this%inputtab%add_term(this%pcs(ib))
1716 call this%inputtab%add_term(this%thickini(ib))
1717 call this%inputtab%add_term(this%rnb(ib))
1718 call this%inputtab%add_term(this%thickini(ib) * this%rnb(ib))
1719 call this%inputtab%add_term(this%dis%top(node) - this%dis%bot(node))
1720 call this%inputtab%add_term(this%ci(ib))
1721 call this%inputtab%add_term(this%rci(ib))
1722 call this%inputtab%add_term(this%theta(ib))
1723 if (idelay == 0)
then
1724 call this%inputtab%add_term(
"--")
1725 call this%inputtab%add_term(
"--")
1727 call this%inputtab%add_term(this%kv(ib))
1728 call this%inputtab%add_term(this%h0(ib))
1730 if (this%inamedbound /= 0)
then
1731 call this%inputtab%add_term(this%boundname(ib))
1748 character(len=LINELENGTH) :: title
1749 character(len=LINELENGTH) :: tag
1750 character(len=LINELENGTH) :: msg
1751 character(len=10) :: ctype
1752 character(len=20) :: cellid
1753 character(len=10) :: cflag
1758 integer(I4B) :: node
1760 integer(I4B) :: idelay
1761 integer(I4B) :: iexceed
1762 integer(I4B),
parameter :: ncells = 20
1763 integer(I4B) :: nlen
1764 integer(I4B) :: ntabrows
1765 integer(I4B) :: ntabcols
1766 integer(I4B) :: ipos
1771 integer(I4B),
dimension(:),
allocatable :: imap_sel
1772 integer(I4B),
dimension(:),
allocatable :: locs
1773 real(DP),
dimension(:),
allocatable :: pctcomp_arr
1776 allocate (locs(this%dis%ndim))
1779 if (this%ninterbeds > 0)
then
1780 nlen = min(ncells, this%ninterbeds)
1781 allocate (imap_sel(nlen))
1782 allocate (pctcomp_arr(this%ninterbeds))
1784 do ib = 1, this%ninterbeds
1785 idelay = this%idelay(ib)
1786 b0 = this%thickini(ib)
1787 strain = this%tcomp(ib) / b0
1789 pctcomp_arr(ib) = pctcomp
1790 if (pctcomp >=
done)
then
1791 iexceed = iexceed + 1
1794 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
1797 i0 = max(1, this%ninterbeds - ncells + 1)
1798 i1 = this%ninterbeds
1800 if (iexceed /= 0)
then
1801 write (msg,
'(1x,a,1x,i0,1x,a,1x,i0,1x,a)') &
1802 'LARGEST', (i1 - i0 + 1),
'OF', this%ninterbeds, &
1803 'INTERBED STRAIN VALUES SHOWN'
1808 title = trim(adjustl(this%packName))//
' PACKAGE INTERBED STRAIN SUMMARY'
1815 call table_cr(this%outputtab, this%packName, title)
1816 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
1819 tag =
'INTERBED NUMBER'
1820 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1821 tag =
'INTERBED TYPE'
1822 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1824 call this%outputtab%initialize_column(tag, 20, alignment=
tableft)
1825 tag =
'INITIAL THICKNESS'
1826 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1827 tag =
'FINAL THICKNESS'
1828 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1829 tag =
'TOTAL COMPACTION'
1830 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1831 tag =
'FINAL STRAIN'
1832 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1833 tag =
'PERCENT COMPACTION'
1834 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1836 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1841 idelay = this%idelay(ib)
1842 b0 = this%thickini(ib)
1843 b1 = this%csub_calc_interbed_thickness(ib)
1844 if (idelay == 0)
then
1848 b0 = b0 * this%rnb(ib)
1850 strain = this%tcomp(ib) / b0
1852 if (pctcomp >= 5.0_dp)
then
1854 else if (pctcomp >=
done)
then
1859 node = this%nodelist(ib)
1860 call this%dis%noder_to_string(node, cellid)
1863 call this%outputtab%add_term(ib)
1864 call this%outputtab%add_term(ctype)
1865 call this%outputtab%add_term(cellid)
1866 call this%outputtab%add_term(b0)
1867 call this%outputtab%add_term(b1)
1868 call this%outputtab%add_term(this%tcomp(ib))
1869 call this%outputtab%add_term(strain)
1870 call this%outputtab%add_term(pctcomp)
1871 call this%outputtab%add_term(cflag)
1873 write (this%iout,
'(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
1874 'PERCENT COMPACTION IS GREATER THAN OR EQUAL TO 1 PERCENT IN', &
1875 iexceed,
'OF', this%ninterbeds,
'INTERBED(S).', &
1876 'USE THE STRAIN_CSV_INTERBED OPTION TO OUTPUT A CSV '// &
1877 'FILE WITH PERCENT COMPACTION ',
'VALUES FOR ALL INTERBEDS.'
1879 msg =
'PERCENT COMPACTION WAS LESS THAN 1 PERCENT IN ALL INTERBEDS'
1880 write (this%iout,
'(/1X,A)') trim(adjustl(msg))
1884 if (this%istrainib /= 0)
then
1887 ntabrows = this%ninterbeds
1889 if (this%dis%ndim > 1)
then
1890 ntabcols = ntabcols + 1
1892 ntabcols = ntabcols + this%dis%ndim
1895 call table_cr(this%outputtab, this%packName,
'')
1896 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainib, &
1897 lineseparator=.false., separator=
',')
1900 tag =
'INTERBED_NUMBER'
1901 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1902 tag =
'INTERBED_TYPE'
1903 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1905 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1906 if (this%dis%ndim == 2)
then
1908 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1910 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1913 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1915 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1917 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1919 tag =
'INITIAL_THICKNESS'
1920 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1921 tag =
'FINAL_THICKNESS'
1922 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1923 tag =
'TOTAL_COMPACTION'
1924 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1925 tag =
'TOTAL_STRAIN'
1926 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1927 tag =
'PERCENT_COMPACTION'
1928 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1931 do ib = 1, this%ninterbeds
1932 idelay = this%idelay(ib)
1933 b0 = this%thickini(ib)
1934 b1 = this%csub_calc_interbed_thickness(ib)
1935 if (idelay == 0)
then
1939 b0 = b0 * this%rnb(ib)
1941 strain = this%tcomp(ib) / b0
1943 node = this%nodelist(ib)
1944 call this%dis%noder_to_array(node, locs)
1947 call this%outputtab%add_term(ib)
1948 call this%outputtab%add_term(ctype)
1949 if (this%dis%ndim > 1)
then
1950 call this%outputtab%add_term(this%dis%get_nodeuser(node))
1952 do ipos = 1, this%dis%ndim
1953 call this%outputtab%add_term(locs(ipos))
1955 call this%outputtab%add_term(b0)
1956 call this%outputtab%add_term(b1)
1957 call this%outputtab%add_term(this%tcomp(ib))
1958 call this%outputtab%add_term(strain)
1959 call this%outputtab%add_term(pctcomp)
1964 deallocate (imap_sel)
1965 deallocate (pctcomp_arr)
1969 nlen = min(ncells, this%dis%nodes)
1970 allocate (imap_sel(nlen))
1971 allocate (pctcomp_arr(this%dis%nodes))
1973 do node = 1, this%dis%nodes
1975 if (this%cg_thickini(node) >
dzero)
then
1976 strain = this%cg_tcomp(node) / this%cg_thickini(node)
1979 pctcomp_arr(node) = pctcomp
1980 if (pctcomp >=
done)
then
1981 iexceed = iexceed + 1
1984 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
1987 i0 = max(1, this%dis%nodes - ncells + 1)
1990 if (iexceed /= 0)
then
1991 write (msg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
1992 'LARGEST ', (i1 - i0 + 1),
'OF', this%dis%nodes, &
1993 'CELL COARSE-GRAINED VALUES SHOWN'
1997 title = trim(adjustl(this%packName))// &
1998 ' PACKAGE COARSE-GRAINED STRAIN SUMMARY'
2005 call table_cr(this%outputtab, this%packName, title)
2006 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
2010 call this%outputtab%initialize_column(tag, 20, alignment=
tableft)
2011 tag =
'INITIAL THICKNESS'
2012 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2013 tag =
'FINAL THICKNESS'
2014 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2015 tag =
'TOTAL COMPACTION'
2016 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2017 tag =
'FINAL STRAIN'
2018 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2019 tag =
'PERCENT COMPACTION'
2020 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2022 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
2026 if (this%cg_thickini(node) >
dzero)
then
2027 strain = this%cg_tcomp(node) / this%cg_thickini(node)
2032 if (pctcomp >= 5.0_dp)
then
2034 else if (pctcomp >=
done)
then
2039 call this%dis%noder_to_string(node, cellid)
2042 call this%outputtab%add_term(cellid)
2043 call this%outputtab%add_term(this%cg_thickini(node))
2044 call this%outputtab%add_term(this%cg_thick(node))
2045 call this%outputtab%add_term(this%cg_tcomp(node))
2046 call this%outputtab%add_term(strain)
2047 call this%outputtab%add_term(pctcomp)
2048 call this%outputtab%add_term(cflag)
2050 write (this%iout,
'(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
2051 'COARSE-GRAINED STORAGE PERCENT COMPACTION IS GREATER THAN OR '// &
2052 'EQUAL TO 1 PERCENT IN', iexceed,
'OF', this%dis%nodes,
'CELL(S).', &
2053 'USE THE STRAIN_CSV_COARSE OPTION TO OUTPUT A CSV '// &
2054 'FILE WITH PERCENT COMPACTION ',
'VALUES FOR ALL CELLS.'
2056 msg =
'COARSE-GRAINED STORAGE PERCENT COMPACTION WAS LESS THAN '// &
2057 '1 PERCENT IN ALL CELLS '
2058 write (this%iout,
'(/1X,A)') trim(adjustl(msg))
2062 if (this%istrainsk /= 0)
then
2065 ntabrows = this%dis%nodes
2067 if (this%dis%ndim > 1)
then
2068 ntabcols = ntabcols + 1
2070 ntabcols = ntabcols + this%dis%ndim
2073 call table_cr(this%outputtab, this%packName,
'')
2074 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainsk, &
2075 lineseparator=.false., separator=
',')
2079 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2080 if (this%dis%ndim == 2)
then
2082 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2084 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2087 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2089 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2091 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2093 tag =
'INITIAL_THICKNESS'
2094 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2095 tag =
'FINAL_THICKNESS'
2096 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2097 tag =
'TOTAL_COMPACTION'
2098 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2099 tag =
'TOTAL_STRAIN'
2100 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2101 tag =
'PERCENT_COMPACTION'
2102 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2105 do node = 1, this%dis%nodes
2106 if (this%cg_thickini(node) >
dzero)
then
2107 strain = this%cg_tcomp(node) / this%cg_thickini(node)
2112 call this%dis%noder_to_array(node, locs)
2115 if (this%dis%ndim > 1)
then
2116 call this%outputtab%add_term(this%dis%get_nodeuser(node))
2118 do ipos = 1, this%dis%ndim
2119 call this%outputtab%add_term(locs(ipos))
2121 call this%outputtab%add_term(this%cg_thickini(node))
2122 call this%outputtab%add_term(this%cg_thick(node))
2123 call this%outputtab%add_term(this%cg_tcomp(node))
2124 call this%outputtab%add_term(strain)
2125 call this%outputtab%add_term(pctcomp)
2131 if (this%ndelaybeds > 0)
then
2132 if (this%idb_nconv_count(2) > 0)
then
2133 write (
warnmsg,
'(a,1x,a,1x,i0,1x,a,1x,a)') &
2134 'Delay interbed cell heads were less than the top of the interbed', &
2135 'cell in', this%idb_nconv_count(2),
'interbed cells in ', &
2136 'non-convertible GWF cells for at least one time step during '// &
2143 deallocate (imap_sel)
2145 deallocate (pctcomp_arr)
2160 if (this%nreg_ts > 0)
then
2161 write (
warnmsg,
'(a,1x,i0,1x,3a)') &
2162 'CSUB negative effective stress was regularized in', this%nreg_ts, &
2163 'time step(s); see the model listing file for the number of cells ', &
2164 'regularized in each time step. This typically occurs in uppermost ', &
2165 'cells where simulated water levels rise above land surface.'
2170 if (this%inunit > 0)
then
2192 if (this%iupdatematprop == 0)
then
2193 nullify (this%cg_thick)
2194 nullify (this%cg_thick0)
2195 nullify (this%cg_theta)
2196 nullify (this%cg_theta0)
2211 call mem_deallocate(this%boundname,
'BOUNDNAME', this%memoryPath)
2228 if (this%iupdatematprop == 0)
then
2229 nullify (this%thick)
2230 nullify (this%thick0)
2231 nullify (this%theta)
2232 nullify (this%theta0)
2243 if (this%ndelaybeds > 0)
then
2244 if (this%iupdatematprop == 0)
then
2246 nullify (this%dbdz0)
2247 nullify (this%dbtheta)
2248 nullify (this%dbtheta0)
2287 nullify (this%gwfiss)
2290 nullify (this%stoiconv)
2291 nullify (this%stoss)
2294 if (this%iprpak > 0)
then
2295 call this%inputtab%table_da()
2296 deallocate (this%inputtab)
2297 nullify (this%inputtab)
2301 if (
associated(this%outputtab))
then
2302 call this%outputtab%table_da()
2303 deallocate (this%outputtab)
2304 nullify (this%outputtab)
2309 if (this%ipakcsv > 0)
then
2310 call this%pakcsvtab%table_da()
2311 deallocate (this%pakcsvtab)
2312 nullify (this%pakcsvtab)
2316 call mem_deallocate(this%listlabel,
'LISTLABEL', this%memoryPath)
2363 if (this%inunit > 0)
then
2364 call this%obs%obs_da()
2367 deallocate (this%obs)
2373 call this%NumericalPackageType%da()
2392 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellids
2393 integer(I4B),
dimension(:),
pointer,
contiguous :: cellid
2394 integer(I4B),
pointer :: iper
2395 integer(I4B) :: n, nodeu, noder
2396 character(len=LINELENGTH) :: title, text
2397 character(len=20) :: cellstr
2398 logical(LGP) :: found
2400 character(len=*),
parameter :: fmtlsp = &
2401 &
"(1X,/1X,'REUSING ',a,'S FROM LAST STRESS PERIOD')"
2403 call mem_setptr(iper,
'IPER', this%input_mempath)
2404 if (iper /=
kper)
then
2405 write (this%iout, fmtlsp) trim(this%filtyp)
2406 call this%csub_rp_obs()
2410 call mem_setptr(cellids,
'CELLID', this%input_mempath)
2411 call mem_set_value(this%nbound,
'NBOUND', this%input_mempath, &
2412 found, release=.false.)
2415 if (this%iprpak /= 0)
then
2417 title =
'CSUB'//
' PACKAGE ('// &
2418 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
2419 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2420 call table_cr(this%inputtab, this%packName, title)
2421 call this%inputtab%table_df(1, 2, this%iout, finalize=.false.)
2423 call this%inputtab%initialize_column(text, 20)
2425 call this%inputtab%initialize_column(text, 15, alignment=tableft)
2429 do n = 1, this%nbound
2432 cellid => cellids(:, n)
2435 if (this%dis%ndim == 1)
then
2437 elseif (this%dis%ndim == 2)
then
2438 nodeu =
get_node(cellid(1), 1, cellid(2), &
2439 this%dis%mshape(1), 1, &
2442 nodeu =
get_node(cellid(1), cellid(2), cellid(3), &
2443 this%dis%mshape(1), &
2444 this%dis%mshape(2), &
2449 noder = this%dis%get_nodenumber(nodeu, 1)
2450 if (noder <= 0)
then
2454 this%nodelistsig0(n) = noder
2457 if (this%iprpak /= 0)
then
2458 call this%dis%noder_to_string(noder, cellstr)
2459 call this%inputtab%add_term(cellstr)
2460 call this%inputtab%add_term(this%sig0(n))
2470 if (this%iprpak /= 0)
then
2471 call this%inputtab%finalize_table()
2475 call this%csub_rp_obs()
2491 integer(I4B),
intent(in) :: nodes
2492 real(DP),
dimension(nodes),
intent(in) :: hnew
2496 integer(I4B) :: idelay
2497 integer(I4B) :: node
2504 if (this%ninterbeds > 0)
then
2506 if (this%gwfiss /= 0)
then
2507 write (
errmsg,
'(a,i0,a,1x,a,1x,a,1x,i0,1x,a)') &
2508 'Only the first and last (',
nper,
')', &
2509 'stress period can be steady if interbeds are simulated.', &
2510 'Stress period',
kper,
'has been defined to be steady state.'
2517 if (this%initialized == 0)
then
2518 if (this%gwfiss == 0)
then
2519 call this%csub_set_initial_state(nodes, hnew)
2527 this%cg_comp(node) =
dzero
2528 this%cg_es0(node) = this%cg_es(node)
2529 if (this%iupdatematprop /= 0)
then
2530 this%cg_thick0(node) = this%cg_thick(node)
2531 this%cg_theta0(node) = this%cg_theta(node)
2536 do ib = 1, this%ninterbeds
2537 idelay = this%idelay(ib)
2540 this%comp(ib) =
dzero
2541 node = this%nodelist(ib)
2542 if (this%initialized /= 0)
then
2543 es = this%cg_es(node)
2549 if (this%iupdatematprop /= 0)
then
2550 this%thick0(ib) = this%thick(ib)
2551 this%theta0(ib) = this%theta(ib)
2555 if (idelay /= 0)
then
2559 if (this%gwfiss0 /= 0)
then
2560 node = this%nodelist(ib)
2562 do n = 1, this%ndelaycells
2563 this%dbh(n, idelay) = h
2569 do n = 1, this%ndelaycells
2571 if (this%initialized /= 0)
then
2572 if (this%dbes(n, idelay) > this%dbpcs(n, idelay))
then
2573 this%dbpcs(n, idelay) = this%dbes(n, idelay)
2576 this%dbh0(n, idelay) = this%dbh(n, idelay)
2577 this%dbes0(n, idelay) = this%dbes(n, idelay)
2578 if (this%iupdatematprop /= 0)
then
2579 this%dbdz0(n, idelay) = this%dbdz(n, idelay)
2580 this%dbtheta0(n, idelay) = this%dbtheta(n, idelay)
2587 this%gwfiss0 = this%gwfiss
2592 call this%obs%obs_ad()
2600 subroutine csub_fc(this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
2605 integer(I4B),
intent(in) :: kiter
2606 real(DP),
intent(in),
dimension(:) :: hold
2607 real(DP),
intent(in),
dimension(:) :: hnew
2609 integer(I4B),
intent(in),
dimension(:) :: idxglo
2610 real(DP),
intent(inout),
dimension(:) :: rhs
2613 integer(I4B) :: node
2614 integer(I4B) :: idiag
2615 integer(I4B) :: idelay
2623 call this%csub_cg_calc_stress(this%dis%nodes, hnew)
2626 if (this%gwfiss == 0)
then
2632 do node = 1, this%dis%nodes
2633 idiag = this%dis%con%ia(node)
2634 area = this%dis%get_area(node)
2637 if (this%ibound(node) < 1) cycle
2640 if (this%iupdatematprop /= 0)
then
2641 if (this%ieslag == 0)
then
2644 call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
2645 this%cg_comp(node) = comp
2648 call this%csub_cg_update(node)
2653 call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
2657 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2658 rhs(node) = rhs(node) + rhsterm
2662 if (this%brg /=
dzero)
then
2663 call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
2668 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2669 rhs(node) = rhs(node) + rhsterm
2674 if (this%ninterbeds /= 0)
then
2678 do ib = 1, this%ninterbeds
2679 node = this%nodelist(ib)
2680 idelay = this%idelay(ib)
2681 idiag = this%dis%con%ia(node)
2682 area = this%dis%get_area(node)
2683 call this%csub_interbed_fc(ib, node, area, hnew(node), hold(node), &
2685 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2686 rhs(node) = rhs(node) + rhsterm
2690 call this%csub_nodelay_wcomp_fc(ib, node, tled, area, &
2691 hnew(node), hold(node), &
2695 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2696 rhs(node) = rhs(node) + rhsterm
2717 subroutine csub_fn(this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
2722 integer(I4B),
intent(in) :: kiter
2723 real(DP),
intent(in),
dimension(:) :: hold
2724 real(DP),
intent(in),
dimension(:) :: hnew
2726 integer(I4B),
intent(in),
dimension(:) :: idxglo
2727 real(DP),
intent(inout),
dimension(:) :: rhs
2729 integer(I4B) :: idelay
2730 integer(I4B) :: node
2731 integer(I4B) :: idiag
2739 if (this%gwfiss == 0)
then
2743 do node = 1, this%dis%nodes
2744 idiag = this%dis%con%ia(node)
2745 area = this%dis%get_area(node)
2748 if (this%ibound(node) < 1) cycle
2751 call this%csub_cg_fn(node, tled, area, &
2752 hnew(node), hcof, rhsterm)
2756 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2757 rhs(node) = rhs(node) + rhsterm
2761 if (this%brg /=
dzero)
then
2762 call this%csub_cg_wcomp_fn(node, tled, area, hnew(node), hold(node), &
2767 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2768 rhs(node) = rhs(node) + rhsterm
2773 if (this%ninterbeds /= 0)
then
2777 do ib = 1, this%ninterbeds
2778 idelay = this%idelay(ib)
2779 node = this%nodelist(ib)
2782 if (this%ibound(node) < 1) cycle
2785 idiag = this%dis%con%ia(node)
2786 area = this%dis%get_area(node)
2787 call this%csub_interbed_fn(ib, node, hnew(node), hold(node), &
2791 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2792 rhs(node) = rhs(node) + rhsterm
2795 if (this%brg /=
dzero .and. idelay == 0)
then
2796 call this%csub_nodelay_wcomp_fn(ib, node, tled, area, &
2797 hnew(node), hold(node), &
2801 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2802 rhs(node) = rhs(node) + rhsterm
2818 character(len=LINELENGTH) :: tag
2819 integer(I4B) :: ntabrows
2820 integer(I4B) :: ntabcols
2822 if (this%ipakcsv > 0)
then
2823 if (this%ndelaybeds < 1)
then
2824 write (
warnmsg,
'(a,1x,3a)') &
2825 'Package convergence data is requested but delay interbeds', &
2826 'are not included in package (', &
2827 trim(adjustl(this%packName)),
').'
2835 call table_cr(this%pakcsvtab, this%packName,
'')
2836 call this%pakcsvtab%table_df(ntabrows, ntabcols, this%ipakcsv, &
2837 lineseparator=.false., separator=
',', &
2841 tag =
'total_inner_iterations'
2842 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2844 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2846 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2848 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2850 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2852 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
2854 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
2856 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
2857 tag =
'dstoragemax_loc'
2858 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
2876 subroutine csub_cc(this, innertot, kiter, iend, icnvgmod, nodes, &
2877 hnew, hold, cpak, ipak, dpak)
2882 integer(I4B),
intent(in) :: innertot
2883 integer(I4B),
intent(in) :: kiter
2884 integer(I4B),
intent(in) :: iend
2885 integer(I4B),
intent(in) :: icnvgmod
2886 integer(I4B),
intent(in) :: nodes
2887 real(DP),
dimension(nodes),
intent(in) :: hnew
2888 real(DP),
dimension(nodes),
intent(in) :: hold
2889 character(len=LENPAKLOC),
intent(inout) :: cpak
2890 integer(I4B),
intent(inout) :: ipak
2891 real(DP),
intent(inout) :: dpak
2893 character(len=LENPAKLOC) :: cloc
2894 integer(I4B) :: icheck
2895 integer(I4B) :: ipakfail
2897 integer(I4B) :: node
2898 integer(I4B) :: idelay
2899 integer(I4B) :: locdhmax
2900 integer(I4B) :: locrmax
2901 integer(I4B) :: ifirst
2907 real(DP) :: hcellold
2921 icheck = this%iconvchk
2931 if (this%gwfiss /= 0)
then
2934 if (icnvgmod == 0)
then
2940 if (icheck /= 0)
then
2946 final_check:
do ib = 1, this%ninterbeds
2947 idelay = this%idelay(ib)
2948 node = this%nodelist(ib)
2951 if (idelay == 0) cycle
2954 if (this%ibound(node) < 1) cycle
2957 dh = this%dbdhmax(idelay)
2962 area = this%dis%get_area(node)
2964 hcellold = hold(node)
2967 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
2970 call this%csub_delay_calc_dstor(ib, hcell, stoe, stoi)
2971 v1 = (stoe + stoi) * area * this%rnb(ib) * tled
2974 call this%csub_delay_calc_wcomp(ib, dwc)
2975 v1 = v1 + dwc * area * this%rnb(ib)
2978 call this%csub_delay_fc(ib, hcof, rhs)
2979 v2 = (-hcof * hcell - rhs) * area * this%rnb(ib)
2986 df = df *
delt / area
2989 if (ifirst == 1)
then
2996 if (abs(dh) > abs(dhmax))
then
3000 if (abs(df) > abs(rmax))
then
3009 if (abs(dhmax) > abs(dpak))
then
3012 write (cloc,
"(a,'-',a)") trim(this%packName),
'head'
3017 if (abs(rmax) > abs(dpak))
then
3020 write (cloc,
"(a,'-',a)") trim(this%packName),
'storage'
3025 if (this%ipakcsv /= 0)
then
3028 call this%pakcsvtab%add_term(innertot)
3029 call this%pakcsvtab%add_term(
totim)
3030 call this%pakcsvtab%add_term(
kper)
3031 call this%pakcsvtab%add_term(
kstp)
3032 call this%pakcsvtab%add_term(kiter)
3033 if (this%ndelaybeds > 0)
then
3034 call this%pakcsvtab%add_term(dhmax)
3035 call this%pakcsvtab%add_term(locdhmax)
3036 call this%pakcsvtab%add_term(rmax)
3037 call this%pakcsvtab%add_term(locrmax)
3039 call this%pakcsvtab%add_term(
'--')
3040 call this%pakcsvtab%add_term(
'--')
3041 call this%pakcsvtab%add_term(
'--')
3042 call this%pakcsvtab%add_term(
'--')
3047 call this%pakcsvtab%finalize_table()
3062 subroutine csub_cq(this, nodes, hnew, hold, isuppress_output, flowja)
3068 integer(I4B),
intent(in) :: nodes
3069 real(DP),
intent(in),
dimension(nodes) :: hnew
3070 real(DP),
intent(in),
dimension(nodes) :: hold
3071 integer(I4B),
intent(in) :: isuppress_output
3072 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
3075 integer(I4B) :: idelay
3076 integer(I4B) :: ielastic
3077 integer(I4B) :: iconvert
3078 integer(I4B) :: node
3081 integer(I4B) :: idiag
3108 integer(I4B) :: iprobslocal
3118 do node = 1, this%dis%nodes
3119 idiag = this%dis%con%ia(node)
3120 area = this%dis%get_area(node)
3124 if (this%gwfiss == 0)
then
3130 if (this%ibound(node) > 0 .and. this%cg_thickini(node) >
dzero)
then
3133 call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
3135 rrate = hcof * hnew(node) - rhs
3138 call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
3141 call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
3143 rratewc = hcof * hnew(node) - rhs
3149 this%cg_stor(node) = rrate
3150 this%cell_wcstor(node) = rratewc
3151 this%cell_thick(node) = this%cg_thick(node)
3154 this%cg_comp(node) = comp
3158 if (isuppress_output == 0)
then
3162 if (this%iupdatematprop /= 0)
then
3163 call this%csub_cg_update(node)
3167 this%cg_tcomp(node) = this%cg_tcomp(node) + comp
3171 flowja(idiag) = flowja(idiag) + rrate
3172 flowja(idiag) = flowja(idiag) + rratewc
3178 if (this%ndelaybeds > 0)
then
3179 this%idb_nconv_count(1) = 0
3186 do ib = 1, this%ninterbeds
3188 idelay = this%idelay(ib)
3189 ielastic = this%ielastic(ib)
3193 if (idelay == 0)
then
3197 b = this%thick(ib) * this%rnb(ib)
3201 node = this%nodelist(ib)
3202 idiag = this%dis%con%ia(node)
3203 area = this%dis%get_area(node)
3206 this%cell_thick(node) = this%cell_thick(node) + b
3209 if (this%gwfiss == 0)
then
3217 if (this%ibound(node) < 1) cycle
3220 if (idelay == 0)
then
3221 iconvert = this%iconvert(ib)
3225 call this%csub_nodelay_calc_comp(ib, hnew(node), hold(node), comp, &
3229 es = this%cg_es(node)
3231 es0 = this%cg_es0(node)
3234 if (ielastic > 0 .or. iconvert == 0)
then
3237 stoi = -pcs * rho2 + (rho2 * es)
3238 stoe = pcs * rho1 - (rho1 * es0)
3244 this%storagee(ib) = stoe * tledm
3245 this%storagei(ib) = stoi * tledm
3248 this%comp(ib) = comp
3251 if (isuppress_output == 0)
then
3254 if (this%iupdatematprop /= 0)
then
3255 call this%csub_nodelay_update(ib)
3259 this%tcomp(ib) = this%tcomp(ib) + comp
3260 this%tcompe(ib) = this%tcompe(ib) + compe
3261 this%tcompi(ib) = this%tcompi(ib) + compi
3270 call this%csub_calc_sat(node, h, h0, snnew, snold)
3273 call this%csub_delay_calc_dstor(ib, h, stoe, stoi)
3274 this%storagee(ib) = stoe * area * this%rnb(ib) * tledm
3275 this%storagei(ib) = stoi * area * this%rnb(ib) * tledm
3278 q = this%csub_calc_delay_flow(ib, 1, h) * area * this%rnb(ib)
3279 this%dbflowtop(idelay) = q
3280 nn = this%ndelaycells
3281 q = this%csub_calc_delay_flow(ib, nn, h) * area * this%rnb(ib)
3282 this%dbflowbot(idelay) = q
3285 if (isuppress_output == 0)
then
3288 call this%csub_delay_calc_comp(ib, h, h0, comp, compi, compe)
3292 if (this%iupdatematprop /= 0)
then
3293 call this%csub_delay_update(ib)
3297 this%tcomp(ib) = this%tcomp(ib) + comp
3298 this%tcompi(ib) = this%tcompi(ib) + compi
3299 this%tcompe(ib) = this%tcompe(ib) + compe
3302 do n = 1, this%ndelaycells
3303 this%dbtcomp(n, idelay) = this%dbtcomp(n, idelay) + &
3304 this%dbcomp(n, idelay)
3309 call this%csub_delay_head_check(ib)
3316 if (idelay == 0)
then
3317 call this%csub_nodelay_wcomp_fc(ib, node, tledm, area, &
3318 hnew(node), hold(node), hcof, rhs)
3319 rratewc = hcof * hnew(node) - rhs
3323 call this%csub_delay_calc_wcomp(ib, q)
3324 rratewc = q * area * this%rnb(ib)
3326 this%cell_wcstor(node) = this%cell_wcstor(node) + rratewc
3329 flowja(idiag) = flowja(idiag) + rratewc
3331 this%storagee(ib) =
dzero
3332 this%storagei(ib) =
dzero
3333 if (idelay /= 0)
then
3334 this%dbflowtop(idelay) =
dzero
3335 this%dbflowbot(idelay) =
dzero
3340 flowja(idiag) = flowja(idiag) + this%storagee(ib)
3341 flowja(idiag) = flowja(idiag) + this%storagei(ib)
3345 if (this%iupdatematprop /= 0)
then
3361 subroutine csub_bd(this, isuppress_output, model_budget)
3368 integer(I4B),
intent(in) :: isuppress_output
3369 type(
budgettype),
intent(inout) :: model_budget
3376 call model_budget%addentry(rin, rout,
delt,
budtxt(1), &
3377 isuppress_output,
' CSUB')
3378 if (this%ninterbeds > 0)
then
3382 call model_budget%addentry(rin, rout,
delt,
budtxt(2), &
3383 isuppress_output,
' CSUB')
3387 call model_budget%addentry(rin, rout,
delt,
budtxt(3), &
3388 isuppress_output,
' CSUB')
3391 call model_budget%addentry(rin, rout,
delt,
budtxt(4), &
3392 isuppress_output,
' CSUB')
3404 integer(I4B),
intent(in) :: icbcfl
3405 integer(I4B),
intent(in) :: icbcun
3407 character(len=1) :: cdatafmp =
' '
3408 character(len=1) :: editdesc =
' '
3409 integer(I4B) :: ibinun
3410 integer(I4B) :: iprint
3411 integer(I4B) :: nvaluesp
3412 integer(I4B) :: nwidthp
3414 integer(I4B) :: node
3415 integer(I4B) :: naux
3421 if (this%ipakcb < 0)
then
3423 elseif (this%ipakcb == 0)
then
3426 ibinun = this%ipakcb
3428 if (icbcfl == 0) ibinun = 0
3431 if (ibinun /= 0)
then
3436 call this%dis%record_array(this%cg_stor, this%iout, iprint, -ibinun, &
3437 budtxt(1), cdatafmp, nvaluesp, &
3438 nwidthp, editdesc, dinact)
3439 if (this%ninterbeds > 0)
then
3443 call this%dis%record_srcdst_list_header(
budtxt(2), &
3453 do ib = 1, this%ninterbeds
3454 q = this%storagee(ib)
3455 node = this%nodelist(ib)
3456 call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3461 call this%dis%record_srcdst_list_header(
budtxt(3), &
3471 do ib = 1, this%ninterbeds
3472 q = this%storagei(ib)
3473 node = this%nodelist(ib)
3474 call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3480 call this%dis%record_array(this%cell_wcstor, this%iout, iprint, -ibinun, &
3481 budtxt(4), cdatafmp, nvaluesp, &
3482 nwidthp, editdesc, dinact)
3495 integer(I4B),
intent(in) :: idvfl
3496 integer(I4B),
intent(in) :: idvprint
3498 character(len=1) :: cdatafmp =
' '
3499 character(len=1) :: editdesc =
' '
3500 integer(I4B) :: ibinun
3501 integer(I4B) :: iprint
3502 integer(I4B) :: nvaluesp
3503 integer(I4B) :: nwidthp
3505 integer(I4B) :: node
3506 integer(I4B) :: nodem
3507 integer(I4B) :: nodeu
3510 integer(I4B) :: idx_conn
3512 integer(I4B) :: ncpl
3513 integer(I4B) :: nlay
3516 real(DP) :: va_scale
3518 character(len=*),
parameter :: fmtnconv = &
3519 "(/4x, 'DELAY INTERBED CELL HEADS IN ', i0, ' INTERBEDS IN', &
3520 &' NON-CONVERTIBLE GWF CELLS WERE LESS THAN THE TOP OF THE INTERBED CELL')"
3525 if (this%ioutcomp /= 0 .or. this%ioutzdisp /= 0)
then
3530 if (idvfl == 0) ibinun = 0
3533 if (ibinun /= 0)
then
3538 do node = 1, this%dis%nodes
3539 this%buff(node) = this%cg_tcomp(node)
3541 do ib = 1, this%ninterbeds
3542 node = this%nodelist(ib)
3543 this%buff(node) = this%buff(node) + this%tcomp(ib)
3547 if (this%ioutcomp /= 0)
then
3548 ibinun = this%ioutcomp
3549 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3550 comptxt(1), cdatafmp, nvaluesp, &
3551 nwidthp, editdesc, dinact)
3555 if (this%ioutzdisp /= 0)
then
3556 ibinun = this%ioutzdisp
3559 do nodeu = 1, this%dis%nodesuser
3560 this%buffusr(nodeu) =
dzero
3564 do node = 1, this%dis%nodes
3565 nodeu = this%dis%get_nodeuser(node)
3566 this%buffusr(nodeu) = this%buff(node)
3570 ncpl = this%dis%get_ncpl()
3573 if (this%dis%ndim == 1)
then
3574 do node = this%dis%nodes, 1, -1
3575 do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
3578 nodem = this%dis%con%ja(ii)
3579 idx_conn = this%dis%con%jas(ii)
3582 ihc = this%dis%con%ihc(idx_conn)
3586 if (node < nodem)
then
3587 va_scale = this%dis%get_area_factor(node, idx_conn)
3588 this%buffusr(node) = this%buffusr(node) + &
3589 va_scale * this%buffusr(nodem)
3596 nlay = this%dis%nodesuser / ncpl
3597 do k = nlay - 1, 1, -1
3599 node = (k - 1) * ncpl + i
3600 nodem = k * ncpl + i
3601 this%buffusr(node) = this%buffusr(node) + this%buffusr(nodem)
3607 do nodeu = 1, this%dis%nodesuser
3608 node = this%dis%get_nodenumber_idx1(nodeu, 1)
3610 this%buff(node) = this%buffusr(nodeu)
3615 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3616 comptxt(6), cdatafmp, nvaluesp, &
3617 nwidthp, editdesc, dinact)
3623 if (this%ioutcompi /= 0)
then
3624 ibinun = this%ioutcompi
3628 if (idvfl == 0) ibinun = 0
3631 if (ibinun /= 0)
then
3636 do node = 1, this%dis%nodes
3637 this%buff(node) =
dzero
3639 do ib = 1, this%ninterbeds
3640 node = this%nodelist(ib)
3641 this%buff(node) = this%buff(node) + this%tcompi(ib)
3645 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3646 comptxt(2), cdatafmp, nvaluesp, &
3647 nwidthp, editdesc, dinact)
3651 if (this%ioutcompe /= 0)
then
3652 ibinun = this%ioutcompe
3656 if (idvfl == 0) ibinun = 0
3659 if (ibinun /= 0)
then
3664 do node = 1, this%dis%nodes
3665 this%buff(node) =
dzero
3667 do ib = 1, this%ninterbeds
3668 node = this%nodelist(ib)
3669 this%buff(node) = this%buff(node) + this%tcompe(ib)
3673 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3674 comptxt(3), cdatafmp, nvaluesp, &
3675 nwidthp, editdesc, dinact)
3679 if (this%ioutcompib /= 0)
then
3680 ibinun = this%ioutcompib
3684 if (idvfl == 0) ibinun = 0
3687 if (ibinun /= 0)
then
3692 do node = 1, this%dis%nodes
3693 this%buff(node) =
dzero
3695 do ib = 1, this%ninterbeds
3696 node = this%nodelist(ib)
3697 this%buff(node) = this%buff(node) + this%tcompe(ib) + this%tcompi(ib)
3701 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3702 comptxt(4), cdatafmp, nvaluesp, &
3703 nwidthp, editdesc, dinact)
3707 if (this%ioutcomps /= 0)
then
3708 ibinun = this%ioutcomps
3712 if (idvfl == 0) ibinun = 0
3715 if (ibinun /= 0)
then
3720 do node = 1, this%dis%nodes
3721 this%buff(node) = this%cg_tcomp(node)
3725 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3726 comptxt(5), cdatafmp, nvaluesp, &
3727 nwidthp, editdesc, dinact)
3732 if (this%gwfiss == 0)
then
3733 call this%csub_cg_chk_stress()
3740 if (this%ndelaybeds > 0)
then
3741 if (this%idb_nconv_count(1) > this%idb_nconv_count(2))
then
3742 this%idb_nconv_count(2) = this%idb_nconv_count(1)
3744 if (this%idb_nconv_count(1) > 0)
then
3745 write (this%iout, fmtnconv) this%idb_nconv_count(1)
3760 integer(I4B),
intent(in) :: nodes
3761 real(DP),
dimension(nodes),
intent(in) :: hnew
3763 integer(I4B) :: node
3767 integer(I4B) :: idx_conn
3772 real(DP) :: va_scale
3781 if (this%iupdatestress /= 0)
then
3782 do node = 1, this%dis%nodes
3787 top = this%dis%top(node)
3788 bot = this%dis%bot(node)
3792 if (this%ibound(node) /= 0)
then
3802 if (hcell < top)
then
3803 gs = (top - hbar) * this%sgm(node) + (hbar - bot) * this%sgs(node)
3805 gs = thick * this%sgs(node)
3809 this%cg_gs(node) = gs
3813 do nn = 1, this%nbound
3814 node = this%nodelistsig0(nn)
3815 sadd = this%sig0(nn)
3816 this%cg_gs(node) = this%cg_gs(node) + sadd
3820 do node = 1, this%dis%nodes
3823 gs = this%cg_gs(node)
3827 do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
3830 m = this%dis%con%ja(ii)
3831 idx_conn = this%dis%con%jas(ii)
3834 if (this%dis%con%ihc(idx_conn) == 0)
then
3840 if (this%dis%ndim /= 1)
then
3841 gs = gs + this%cg_gs(m)
3845 va_scale = this%dis%get_area_factor(node, idx_conn)
3846 gs_conn = this%cg_gs(m)
3847 gs = gs + (gs_conn * va_scale)
3855 this%cg_gs(node) = gs
3861 do node = 1, this%dis%nodes
3862 top = this%dis%top(node)
3863 bot = this%dis%bot(node)
3864 if (this%ibound(node) /= 0)
then
3877 es = this%cg_gs(node) - phead
3878 this%cg_es(node) = es
3896 character(len=20) :: cellid
3897 integer(I4B) :: ierr
3898 integer(I4B) :: iwarn
3899 integer(I4B) :: node
3911 do node = 1, this%dis%nodes
3912 if (this%ibound(node) < 1) cycle
3913 if (this%lhead_based .EQV. .true.) cycle
3914 bot = this%dis%bot(node)
3915 gs = this%cg_gs(node)
3916 es = this%cg_es(node)
3919 if (this%istrict_stress /= 0)
then
3923 call this%dis%noder_to_string(node, cellid)
3924 write (
errmsg,
'(a,g0,a,1x,a,1x,a,4(g0,a))') &
3925 'Small to negative effective stress (', es,
') in cell', &
3926 trim(adjustl(cellid)),
'. (', es,
' = ', this%cg_gs(node), &
3927 ' - (', hcell,
' - ', bot,
').'
3940 write (
errmsg,
'(a,1x,i0,3(1x,a))') &
3941 'Solution: small to negative effective stress values in', ierr, &
3942 'cells can be eliminated by increasing storage values and/or ', &
3943 'adding/modifying stress boundaries to prevent water-levels from', &
3944 'exceeding the top of the model.'
3951 this%nreg_ts = this%nreg_ts + 1
3952 write (this%iout,
'(1x,a,1x,i0,1x,a,1x,i0,1x,a,1x,i0,a)') &
3953 'CSUB negative effective stress regularized in', iwarn, &
3954 'cell(s) in stress period',
kper,
'time step',
kstp,
'.'
3967 integer(I4B),
intent(in) :: i
3974 comp = this%tcomp(i) + this%comp(i)
3975 if (abs(comp) >
dzero)
then
3976 thick = this%thickini(i)
3977 theta = this%thetaini(i)
3978 call this%csub_adj_matprop(comp, thick, theta)
3979 if (thick <=
dzero)
then
3980 write (
errmsg,
'(a,1x,i0,1x,a,g0,a)') &
3981 'Adjusted thickness for no-delay interbed', i, &
3982 'is less than or equal to 0 (', thick,
').'
3985 if (theta <=
dzero)
then
3986 write (
errmsg,
'(a,1x,i0,1x,a,g0,a)') &
3987 'Adjusted theta for no-delay interbed', i, &
3988 'is less than or equal to 0 (', theta,
').'
3991 this%thick(i) = thick
3992 this%theta(i) = theta
4014 integer(I4B),
intent(in) :: ib
4015 real(DP),
intent(in) :: hcell
4016 real(DP),
intent(in) :: hcellold
4017 real(DP),
intent(inout) :: rho1
4018 real(DP),
intent(inout) :: rho2
4019 real(DP),
intent(inout) :: rhs
4020 real(DP),
intent(in),
optional :: argtled
4022 integer(I4B) :: node
4032 real(DP) :: sto_fac0
4042 if (
present(argtled))
then
4047 node = this%nodelist(ib)
4048 area = this%dis%get_area(node)
4049 bot = this%dis%bot(node)
4050 top = this%dis%top(node)
4051 thick = this%thickini(ib)
4057 this%iconvert(ib) = 0
4060 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4061 if (this%lhead_based .EQV. .true.)
then
4065 znode = this%csub_calc_znode(top, bot, hbar)
4066 es = this%cg_es(node)
4067 es0 = this%cg_es0(node)
4068 theta = this%thetaini(ib)
4073 call this%csub_calc_sfacts(node, bot, znode, theta, es, es0, &
4074 this%cg_gs(node), f)
4076 sto_fac = tled * snnew * thick * f
4077 sto_fac0 = tled * snold * thick * f
4080 rho1 = this%rci(ib) * sto_fac0
4081 rho2 = this%rci(ib) * sto_fac
4082 if (this%cg_es(node) > this%pcs(ib))
then
4083 this%iconvert(ib) = 1
4084 rho2 = this%ci(ib) * sto_fac
4088 rcorr = rho2 * (hcell - hbar)
4091 if (this%ielastic(ib) /= 0)
then
4092 rhs = rho1 * this%cg_es0(node) - &
4093 rho2 * (this%cg_gs(node) + bot) - &
4096 rhs = -rho2 * (this%cg_gs(node) + bot) + &
4097 (this%pcs(ib) * (rho2 - rho1)) + &
4098 (rho1 * this%cg_es0(node)) - &
4120 integer(I4B),
intent(in) :: ib
4121 real(DP),
intent(in) :: hcell
4122 real(DP),
intent(in) :: hcellold
4123 real(DP),
intent(inout) :: comp
4124 real(DP),
intent(inout) :: rho1
4125 real(DP),
intent(inout) :: rho2
4127 integer(I4B) :: node
4135 node = this%nodelist(ib)
4137 es = this%cg_es(node)
4138 es0 = this%cg_es0(node)
4142 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhs, argtled=tled)
4145 if (this%ielastic(ib) /= 0)
then
4146 comp = rho2 * es - rho1 * es0
4148 comp = -pcs * (rho2 - rho1) - (rho1 * es0) + (rho2 * es)
4162 integer(I4B),
intent(in) :: nodes
4163 real(DP),
dimension(nodes),
intent(in) :: hnew
4165 character(len=LINELENGTH) :: title
4166 character(len=LINELENGTH) :: tag
4167 character(len=20) :: cellid
4169 integer(I4B) :: node
4171 integer(I4B) :: idelay
4172 integer(I4B) :: ntabrows
4173 integer(I4B) :: ntabcols
4179 real(DP) :: void_ratio
4189 call this%csub_cg_calc_stress(nodes, hnew)
4194 this%cg_es0(node) = this%cg_es(node)
4198 do ib = 1, this%ninterbeds
4199 idelay = this%idelay(ib)
4200 node = this%nodelist(ib)
4201 top = this%dis%top(node)
4202 bot = this%dis%bot(node)
4206 if (this%ispecified_pcs == 0)
then
4208 if (this%ipch /= 0)
then
4209 pcs = this%cg_es(node) - pcs0
4211 pcs = this%cg_es(node) + pcs0
4215 if (this%ipch /= 0)
then
4216 pcs = this%cg_gs(node) - (pcs0 - bot)
4218 if (pcs < this%cg_es(node))
then
4219 pcs = this%cg_es(node)
4225 if (idelay /= 0)
then
4226 dzhalf =
dhalf * this%dbdzini(1, idelay)
4231 do n = 1, this%ndelaycells
4232 if (this%ispecified_dbh == 0)
then
4233 this%dbh(n, idelay) = hcell + this%dbh(n, idelay)
4235 this%dbh(n, idelay) = hcell
4237 this%dbh0(n, idelay) = this%dbh(n, idelay)
4241 call this%csub_delay_calc_stress(ib, hcell)
4245 do n = 1, this%ndelaycells
4246 zbot = this%dbz(n, idelay) - dzhalf
4249 dbpcs = pcs - (zbot - bot) * (this%sgs(node) -
done)
4250 this%dbpcs(n, idelay) = dbpcs
4253 this%dbes0(n, idelay) = this%dbes(n, idelay)
4260 top = this%dis%top(node)
4261 bot = this%dis%bot(node)
4264 if (this%istoragec == 1)
then
4267 if (this%lhead_based .EQV. .true.)
then
4273 void_ratio = this%csub_calc_void_ratio(this%cg_theta(node))
4274 es = this%cg_es(node)
4281 znode = this%csub_calc_znode(top, bot, hbar)
4282 fact = this%csub_calc_adjes(node, es, bot, znode)
4283 fact = fact * (
done + void_ratio)
4290 this%cg_ske_cr(node) = this%cg_ske_cr(node) * fact
4293 if (fact <=
dzero)
then
4294 call this%dis%noder_to_string(node, cellid)
4295 write (
errmsg,
'(a,1x,a,a)') &
4296 'Negative recompression index calculated for cell', &
4297 trim(adjustl(cellid)),
'.'
4303 do ib = 1, this%ninterbeds
4304 idelay = this%idelay(ib)
4305 node = this%nodelist(ib)
4306 top = this%dis%top(node)
4307 bot = this%dis%bot(node)
4310 if (this%istoragec == 1)
then
4313 if (this%lhead_based .EQV. .true.)
then
4319 void_ratio = this%csub_calc_void_ratio(this%theta(ib))
4320 es = this%cg_es(node)
4327 znode = this%csub_calc_znode(top, bot, hbar)
4328 fact = this%csub_calc_adjes(node, es, bot, znode)
4329 fact = fact * (
done + void_ratio)
4336 this%ci(ib) = this%ci(ib) * fact
4337 this%rci(ib) = this%rci(ib) * fact
4340 if (fact <=
dzero)
then
4341 call this%dis%noder_to_string(node, cellid)
4342 write (
errmsg,
'(a,1x,i0,2(1x,a),a)') &
4343 'Negative compression indices calculated for interbed', ib, &
4344 'in cell', trim(adjustl(cellid)),
'.'
4350 if (this%iprpak == 1)
then
4352 title = trim(adjustl(this%packName))// &
4353 ' PACKAGE CALCULATED INITIAL INTERBED STRESSES AT THE CELL BOTTOM'
4356 ntabrows = this%ninterbeds
4358 if (this%inamedbound /= 0)
then
4359 ntabcols = ntabcols + 1
4363 call table_cr(this%inputtab, this%packName, title)
4364 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4367 tag =
'INTERBED NUMBER'
4368 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4370 call this%inputtab%initialize_column(tag, 20)
4371 tag =
'GEOSTATIC STRESS'
4372 call this%inputtab%initialize_column(tag, 16)
4373 tag =
'EFFECTIVE STRESS'
4374 call this%inputtab%initialize_column(tag, 16)
4375 tag =
'PRECONSOLIDATION STRESS'
4376 call this%inputtab%initialize_column(tag, 16)
4377 if (this%inamedbound /= 0)
then
4379 call this%inputtab%initialize_column(tag,
lenboundname, &
4384 do ib = 1, this%ninterbeds
4385 node = this%nodelist(ib)
4386 call this%dis%noder_to_string(node, cellid)
4389 call this%inputtab%add_term(ib)
4390 call this%inputtab%add_term(cellid)
4391 call this%inputtab%add_term(this%cg_gs(node))
4392 call this%inputtab%add_term(this%cg_es(node))
4393 call this%inputtab%add_term(this%pcs(ib))
4394 if (this%inamedbound /= 0)
then
4395 call this%inputtab%add_term(this%boundname(ib))
4402 title = trim(adjustl(this%packName))// &
4403 ' PACKAGE CALCULATED INITIAL DELAY INTERBED STRESSES'
4407 do ib = 1, this%ninterbeds
4408 idelay = this%idelay(ib)
4409 if (idelay /= 0)
then
4410 ntabrows = ntabrows + this%ndelaycells
4414 if (this%inamedbound /= 0)
then
4415 ntabcols = ntabcols + 1
4419 call table_cr(this%inputtab, this%packName, title)
4420 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4423 tag =
'INTERBED NUMBER'
4424 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4426 call this%inputtab%initialize_column(tag, 20)
4428 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4429 tag =
'GEOSTATIC STRESS'
4430 call this%inputtab%initialize_column(tag, 16)
4431 tag =
'EFFECTIVE STRESS'
4432 call this%inputtab%initialize_column(tag, 16)
4433 tag =
'PRECONSOLIDATION STRESS'
4434 call this%inputtab%initialize_column(tag, 16)
4435 if (this%inamedbound /= 0)
then
4437 call this%inputtab%initialize_column(tag,
lenboundname, &
4442 do ib = 1, this%ninterbeds
4443 idelay = this%idelay(ib)
4444 if (idelay /= 0)
then
4445 node = this%nodelist(ib)
4446 call this%dis%noder_to_string(node, cellid)
4449 do n = 1, this%ndelaycells
4451 call this%inputtab%add_term(ib)
4452 call this%inputtab%add_term(cellid)
4454 call this%inputtab%add_term(
' ')
4455 call this%inputtab%add_term(
' ')
4457 call this%inputtab%add_term(n)
4458 call this%inputtab%add_term(this%dbgeo(n, idelay))
4459 call this%inputtab%add_term(this%dbes(n, idelay))
4460 call this%inputtab%add_term(this%dbpcs(n, idelay))
4461 if (this%inamedbound /= 0)
then
4463 call this%inputtab%add_term(this%boundname(ib))
4465 call this%inputtab%add_term(
' ')
4473 if (this%istoragec == 1)
then
4474 if (this%lhead_based .EQV. .false.)
then
4476 title = trim(adjustl(this%packName))// &
4477 ' PACKAGE COMPRESSION INDICES'
4480 ntabrows = this%ninterbeds
4482 if (this%inamedbound /= 0)
then
4483 ntabcols = ntabcols + 1
4487 call table_cr(this%inputtab, this%packName, title)
4488 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4491 tag =
'INTERBED NUMBER'
4492 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4494 call this%inputtab%initialize_column(tag, 20)
4496 call this%inputtab%initialize_column(tag, 16)
4498 call this%inputtab%initialize_column(tag, 16)
4499 if (this%inamedbound /= 0)
then
4501 call this%inputtab%initialize_column(tag,
lenboundname, &
4506 do ib = 1, this%ninterbeds
4508 node = this%nodelist(ib)
4509 call this%dis%noder_to_string(node, cellid)
4512 call this%inputtab%add_term(ib)
4513 call this%inputtab%add_term(cellid)
4514 call this%inputtab%add_term(this%ci(ib) * fact)
4515 call this%inputtab%add_term(this%rci(ib) * fact)
4516 if (this%inamedbound /= 0)
then
4517 call this%inputtab%add_term(this%boundname(ib))
4530 this%initialized = 1
4533 if (this%lhead_based .EQV. .true.)
then
4534 this%iupdatestress = 0
4547 subroutine csub_cg_fc(this, node, tled, area, hcell, hcellold, hcof, rhs)
4550 integer(I4B),
intent(in) :: node
4551 real(DP),
intent(in) :: tled
4552 real(DP),
intent(in) :: area
4553 real(DP),
intent(in) :: hcell
4554 real(DP),
intent(in) :: hcellold
4555 real(DP),
intent(inout) :: hcof
4556 real(DP),
intent(inout) :: rhs
4572 top = this%dis%top(node)
4573 bot = this%dis%bot(node)
4574 tthk = this%cg_thickini(node)
4577 if (tthk >
dzero)
then
4580 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4586 call this%csub_cg_calc_sske(node, sske, hcell)
4587 rho1 = sske * area * tthk * tled
4590 this%cg_ske(node) = sske * tthk * snold
4591 this%cg_sk(node) = sske * tthk * snnew
4594 hcof = -rho1 * snnew
4595 rhs = rho1 * snold * this%cg_es0(node) - &
4596 rho1 * snnew * (this%cg_gs(node) + bot)
4599 rhs = rhs - rho1 * snnew * (hcell - hbar)
4616 integer(I4B),
intent(in) :: node
4617 real(DP),
intent(in) :: tled
4618 real(DP),
intent(in) :: area
4619 real(DP),
intent(in) :: hcell
4620 real(DP),
intent(inout) :: hcof
4621 real(DP),
intent(inout) :: rhs
4630 real(DP) :: hbarderv
4639 top = this%dis%top(node)
4640 bot = this%dis%bot(node)
4641 tthk = this%cg_thickini(node)
4644 if (tthk >
dzero)
then
4647 call this%csub_calc_sat(node, hcell, top, snnew, snold)
4650 satderv = this%csub_calc_sat_derivative(node, hcell)
4659 call this%csub_cg_calc_sske(node, sske, hcell)
4660 rho1 = sske * area * tthk * tled
4663 hcof = rho1 * snnew * (
done - hbarderv) + &
4664 rho1 * (this%cg_gs(node) - hbar + bot) * satderv
4667 if (this%ieslag /= 0)
then
4668 hcof = hcof - rho1 * this%cg_es0(node) * satderv
4688 integer(I4B),
intent(in) :: ib
4689 integer(I4B),
intent(in) :: node
4690 real(DP),
intent(in) :: area
4691 real(DP),
intent(in) :: hcell
4692 real(DP),
intent(in) :: hcellold
4693 real(DP),
intent(inout) :: hcof
4694 real(DP),
intent(inout) :: rhs
4713 if (this%ibound(node) > 0)
then
4714 if (this%idelay(ib) == 0)
then
4717 if (this%iupdatematprop /= 0)
then
4718 if (this%ieslag == 0)
then
4721 call this%csub_nodelay_calc_comp(ib, hcell, hcellold, comp, &
4723 this%comp(ib) = comp
4726 call this%csub_nodelay_update(ib)
4731 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, hcof, rhs)
4736 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4739 if (this%iupdatematprop /= 0)
then
4740 if (this%ieslag == 0)
then
4743 call this%csub_delay_calc_comp(ib, hcell, hcellold, &
4745 this%comp(ib) = comp
4748 call this%csub_delay_update(ib)
4753 call this%csub_delay_sln(ib, hcell)
4754 call this%csub_delay_fc(ib, hcof, rhs)
4755 f = area * this%rnb(ib)
4776 integer(I4B),
intent(in) :: ib
4777 integer(I4B),
intent(in) :: node
4778 real(DP),
intent(in) :: hcell
4779 real(DP),
intent(in) :: hcellold
4780 real(DP),
intent(inout) :: hcof
4781 real(DP),
intent(inout) :: rhs
4783 integer(I4B) :: idelay
4795 real(DP) :: hbarderv
4805 idelay = this%idelay(ib)
4806 top = this%dis%top(node)
4807 bot = this%dis%bot(node)
4810 if (this%ibound(node) > 0)
then
4812 tthk = this%thickini(ib)
4815 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4818 if (idelay == 0)
then
4824 satderv = this%csub_calc_sat_derivative(node, hcell)
4833 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhsn)
4836 hcofn = rho2 * (
done - hbarderv) * snnew + &
4837 rho2 * (this%cg_gs(node) - hbar + bot) * satderv
4838 if (this%ielastic(ib) == 0)
then
4839 hcofn = hcofn - rho2 * this%pcs(ib) * satderv
4843 if (this%ieslag /= 0)
then
4844 if (this%ielastic(ib) /= 0)
then
4845 hcofn = hcofn - rho1 * this%cg_es0(node) * satderv
4847 hcofn = hcofn - rho1 * (this%pcs(ib) - this%cg_es0(node)) * satderv
4864 integer(I4B),
intent(in) :: n
4865 real(DP),
intent(inout) :: sske
4866 real(DP),
intent(in) :: hcell
4882 if (this%lhead_based .EQV. .true.)
then
4888 top = this%dis%top(n)
4889 bot = this%dis%bot(n)
4895 znode = this%csub_calc_znode(top, bot, hbar)
4899 es0 = this%cg_es0(n)
4900 theta = this%cg_thetaini(n)
4905 call this%csub_calc_sfacts(n, bot, znode, theta, es, es0, &
4908 sske = f * this%cg_ske_cr(n)
4921 integer(I4B),
intent(in) :: node
4922 real(DP),
intent(in) :: hcell
4923 real(DP),
intent(in) :: hcellold
4924 real(DP),
intent(inout) :: comp
4936 call this%csub_cg_fc(node, tled, area, hcell, hcellold, hcof, rhs)
4939 comp = hcof * hcell - rhs
4950 integer(I4B),
intent(in) :: node
4952 character(len=20) :: cellid
4958 comp = this%cg_tcomp(node) + this%cg_comp(node)
4959 call this%dis%noder_to_string(node, cellid)
4960 if (abs(comp) >
dzero)
then
4961 thick = this%cg_thickini(node)
4962 theta = this%cg_thetaini(node)
4963 call this%csub_adj_matprop(comp, thick, theta)
4964 if (thick <=
dzero)
then
4965 write (
errmsg,
'(a,1x,a,1x,a,g0,a)') &
4966 'Adjusted thickness for cell', trim(adjustl(cellid)), &
4967 'is less than or equal to 0 (', thick,
').'
4970 if (theta <=
dzero)
then
4971 write (
errmsg,
'(a,1x,a,1x,a,g0,a)') &
4972 'Adjusted theta for cell', trim(adjustl(cellid)), &
4973 'is less than or equal to 0 (', theta,
').'
4976 this%cg_thick(node) = thick
4977 this%cg_theta(node) = theta
4995 integer(I4B),
intent(in) :: node
4996 real(DP),
intent(in) :: tled
4997 real(DP),
intent(in) :: area
4998 real(DP),
intent(in) :: hcell
4999 real(DP),
intent(in) :: hcellold
5000 real(DP),
intent(inout) :: hcof
5001 real(DP),
intent(inout) :: rhs
5017 top = this%dis%top(node)
5018 bot = this%dis%bot(node)
5019 tthk = this%cg_thick(node)
5020 tthk0 = this%cg_thick0(node)
5023 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
5026 wc0 = this%brg * area * tthk0 * this%cg_theta0(node) * tled
5027 wc = this%brg * area * tthk * this%cg_theta(node) * tled
5033 rhs = -wc0 * snold * hcellold
5049 integer(I4B),
intent(in) :: node
5050 real(DP),
intent(in) :: tled
5051 real(DP),
intent(in) :: area
5052 real(DP),
intent(in) :: hcell
5053 real(DP),
intent(in) :: hcellold
5054 real(DP),
intent(inout) :: hcof
5055 real(DP),
intent(inout) :: rhs
5071 top = this%dis%top(node)
5072 bot = this%dis%bot(node)
5073 tthk = this%cg_thick(node)
5076 satderv = this%csub_calc_sat_derivative(node, hcell)
5079 f = this%brg * area * tled
5082 wc = f * tthk * this%cg_theta(node)
5085 hcof = -wc * hcell * satderv
5088 if (this%ieslag /= 0)
then
5089 tthk0 = this%cg_thick0(node)
5090 wc0 = f * tthk0 * this%cg_theta0(node)
5091 hcof = hcof + wc * hcellold * satderv
5109 hcell, hcellold, hcof, rhs)
5112 integer(I4B),
intent(in) :: ib
5113 integer(I4B),
intent(in) :: node
5114 real(DP),
intent(in) :: tled
5115 real(DP),
intent(in) :: area
5116 real(DP),
intent(in) :: hcell
5117 real(DP),
intent(in) :: hcellold
5118 real(DP),
intent(inout) :: hcof
5119 real(DP),
intent(inout) :: rhs
5134 top = this%dis%top(node)
5135 bot = this%dis%bot(node)
5138 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
5141 f = this%brg * area * tled
5142 wc0 = f * this%theta0(ib) * this%thick0(ib)
5143 wc = f * this%theta(ib) * this%thick(ib)
5145 rhs = -wc0 * snold * hcellold
5159 hcell, hcellold, hcof, rhs)
5162 integer(I4B),
intent(in) :: ib
5163 integer(I4B),
intent(in) :: node
5164 real(DP),
intent(in) :: tled
5165 real(DP),
intent(in) :: area
5166 real(DP),
intent(in) :: hcell
5167 real(DP),
intent(in) :: hcellold
5168 real(DP),
intent(inout) :: hcof
5169 real(DP),
intent(inout) :: rhs
5183 top = this%dis%top(node)
5184 bot = this%dis%bot(node)
5187 f = this%brg * area * tled
5190 satderv = this%csub_calc_sat_derivative(node, hcell)
5193 wc = f * this%theta(ib) * this%thick(ib)
5196 hcof = -wc * hcell * satderv
5199 if (this%ieslag /= 0)
then
5200 wc0 = f * this%theta0(ib) * this%thick0(ib)
5201 hcof = hcof + wc0 * hcellold * satderv
5217 real(dp),
intent(in) :: theta
5219 real(dp) :: void_ratio
5221 void_ratio = theta / (
done - theta)
5233 real(dp),
intent(in) :: void_ratio
5238 theta = void_ratio / (
done + void_ratio)
5250 integer(I4B),
intent(in) :: ib
5252 integer(I4B) :: idelay
5256 idelay = this%idelay(ib)
5257 thick = this%thick(ib)
5258 if (idelay /= 0)
then
5259 thick = thick * this%rnb(ib)
5276 real(dp),
intent(in) :: top
5277 real(dp),
intent(in) :: bottom
5278 real(dp),
intent(in) :: zbar
5284 if (zbar > top)
then
5289 znode =
dhalf * (v + bottom)
5303 integer(I4B),
intent(in) :: node
5304 real(dp),
intent(in) :: es0
5305 real(dp),
intent(in) :: z0
5306 real(dp),
intent(in) :: z
5311 es = es0 - (z - z0) * (this%sgs(node) -
done)
5324 integer(I4B),
intent(in) :: ib
5326 integer(I4B) :: iviolate
5327 integer(I4B) :: idelay
5328 integer(I4B) :: node
5337 idelay = this%idelay(ib)
5338 node = this%nodelist(ib)
5341 idelaycells:
do n = 1, this%ndelaycells
5342 z = this%dbz(n, idelay)
5343 h = this%dbh(n, idelay)
5344 dzhalf =
dhalf * this%dbdzini(1, idelay)
5347 if (this%stoiconv(node) == 0)
then
5350 this%idb_nconv_count(1) = this%idb_nconv_count(1) + 1
5356 if (iviolate > 0)
then
5374 integer(I4B),
intent(in) :: node
5375 real(DP),
intent(in) :: hcell
5376 real(DP),
intent(in) :: hcellold
5377 real(DP),
intent(inout) :: snnew
5378 real(DP),
intent(inout) :: snold
5384 if (this%stoiconv(node) /= 0)
then
5385 top = this%dis%top(node)
5386 bot = this%dis%bot(node)
5393 if (this%ieslag /= 0)
then
5408 integer(I4B),
intent(in) :: node
5409 real(dp),
intent(in) :: hcell
5415 if (this%stoiconv(node) /= 0)
then
5416 top = this%dis%top(node)
5417 bot = this%dis%bot(node)
5436 integer(I4B),
intent(in) :: node
5437 real(DP),
intent(in) :: bot
5438 real(DP),
intent(in) :: znode
5439 real(DP),
intent(in) :: theta
5440 real(DP),
intent(in) :: es
5441 real(DP),
intent(in) :: es0
5442 real(DP),
intent(in) :: geo
5443 real(DP),
intent(inout) :: fact
5446 real(DP) :: void_ratio
5453 if (this%ieslag /= 0)
then
5460 adjes = this%csub_calc_adjes(node, esv, bot, znode)
5465 if (this%istrict_stress == 0 .and. geo >
dzero)
then
5471 void_ratio = this%csub_calc_void_ratio(theta)
5472 denom = adjes * (
done + void_ratio)
5473 if (denom /=
dzero)
then
5489 real(DP),
intent(in) :: comp
5490 real(DP),
intent(inout) :: thick
5491 real(DP),
intent(inout) :: theta
5494 real(DP) :: void_ratio
5498 void_ratio = this%csub_calc_void_ratio(theta)
5501 if (thick >
dzero) strain = -comp / thick
5504 void_ratio = void_ratio + strain * (
done + void_ratio)
5505 theta = this%csub_calc_theta(void_ratio)
5506 thick = thick - comp
5519 integer(I4B),
intent(in) :: ib
5520 real(DP),
intent(in) :: hcell
5521 logical(LGP),
intent(in),
optional :: update
5525 logical(LGP) :: lupdate
5527 integer(I4B) :: icnvg
5528 integer(I4B) :: iter
5529 integer(I4B) :: idelay
5536 if (
present(update))
then
5543 call this%csub_delay_calc_stress(ib, hcell)
5551 if (this%thickini(ib) >
dzero)
then
5554 idelay = this%idelay(ib)
5559 call this%csub_delay_assemble(ib, hcell)
5563 this%dbal, this%dbad, this%dbau, &
5564 this%dbrhs, this%dbdh, this%dbaw)
5568 do n = 1, this%ndelaycells
5569 dh = this%dbdh(n) - this%dbh(n, idelay)
5570 if (abs(dh) > abs(dhmax))
then
5573 this%dbdhmax(idelay) = dhmax
5577 this%dbh(n, idelay) = this%dbdh(n)
5581 call this%csub_delay_calc_stress(ib, hcell)
5584 if (abs(dhmax) < dclose)
then
5586 else if (iter /= 1)
then
5587 if (abs(dhmax) - abs(dhmax0) <
dprec)
then
5591 if (icnvg == 1)
then
5612 integer(I4B),
intent(in) :: ib
5615 integer(I4B) :: node
5616 integer(I4B) :: idelay
5628 idelay = this%idelay(ib)
5629 node = this%nodelist(ib)
5630 b = this%thickini(ib)
5631 bot = this%dis%bot(node)
5637 znode = this%csub_calc_znode(top, bot, hbar)
5638 dz =
dhalf * this%dbdzini(1, idelay)
5645 do n = 1, this%ndelaycells
5648 this%dbz(n, idelay) = z
5652 if (abs(zr) < dz)
then
5655 this%dbrelz(n, idelay) = zr
5669 integer(I4B),
intent(in) :: ib
5670 real(DP),
intent(in) :: hcell
5673 integer(I4B) :: idelay
5674 integer(I4B) :: node
5690 idelay = this%idelay(ib)
5691 node = this%nodelist(ib)
5692 sigma = this%cg_gs(node)
5693 topaq = this%dis%top(node)
5694 botaq = this%dis%bot(node)
5695 dzhalf =
dhalf * this%dbdzini(1, idelay)
5696 top = this%dbz(1, idelay) + dzhalf
5702 sgm = this%sgm(node)
5703 sgs = this%sgs(node)
5704 if (hcell < top)
then
5705 sadd = ((top - hbar) * sgm) + ((hbar - botaq) * sgs)
5707 sadd = (top - botaq) * sgs
5709 sigma = sigma - sadd
5712 do n = 1, this%ndelaycells
5713 h = this%dbh(n, idelay)
5716 z = this%dbz(n, idelay)
5725 sadd = ((top - hbar) * sgm) + ((hbar - bot) * sgs)
5727 sadd = (top - bot) * sgs
5729 sigma = sigma + sadd
5731 this%dbgeo(n, idelay) = sigma
5732 this%dbes(n, idelay) = sigma - phead
5741 integer(I4B),
intent(in) :: ib
5742 integer(I4B),
intent(in) :: n
5743 real(DP),
intent(in) :: hcell
5744 real(DP),
intent(inout) :: ssk
5745 real(DP),
intent(inout) :: sske
5746 real(DP),
intent(out),
optional :: dsskde
5747 real(DP),
intent(out),
optional :: wfac
5749 integer(I4B) :: idelay
5750 integer(I4B) :: ielastic
5751 integer(I4B) :: node
5754 real(DP) :: hbarcell
5777 idelay = this%idelay(ib)
5778 ielastic = this%ielastic(ib)
5781 if (this%lhead_based .EQV. .true.)
then
5787 node = this%nodelist(ib)
5788 theta = this%dbthetaini(n, idelay)
5791 topcell = this%dis%top(node)
5792 botcell = this%dis%bot(node)
5799 zcell = this%csub_calc_znode(topcell, botcell, hbarcell)
5802 zcenter = zcell + this%dbrelz(n, idelay)
5803 dzhalf =
dhalf * this%dbdzini(1, idelay)
5804 top = zcenter + dzhalf
5805 bot = zcenter - dzhalf
5806 h = this%dbh(n, idelay)
5813 znode = this%csub_calc_znode(top, bot, hbar)
5817 zbot = this%dbz(n, idelay) - dzhalf
5820 es = this%dbes(n, idelay)
5821 es0 = this%dbes0(n, idelay)
5826 call this%csub_calc_sfacts(node, zbot, znode, theta, es, es0, &
5827 this%dbgeo(n, idelay), f)
5829 this%idbconvert(n, idelay) = 0
5830 sske = f * this%rci(ib)
5831 ssk = f * this%rci(ib)
5832 if (
present(dsskde)) dsskde =
dzero
5836 if (
present(wfac)) wfac =
dzero
5837 if (ielastic == 0)
then
5838 es = this%dbes(n, idelay)
5839 pcs = this%dbpcs(n, idelay)
5842 if (this%pcsomega >
dzero .and. pcs >
dzero)
then
5845 estop = pcs + this%pcsomega * pcs
5847 ssk = f * (this%rci(ib) + w * (this%ci(ib) - this%rci(ib)))
5848 if (w >
dhalf) this%idbconvert(n, idelay) = 1
5849 if (
present(wfac)) wfac = w
5850 if (
present(dsskde))
then
5852 dsskde = f * (this%ci(ib) - this%rci(ib)) * dwde
5857 this%idbconvert(n, idelay) = 1
5858 ssk = f * this%ci(ib)
5859 if (
present(wfac)) wfac =
done
5875 integer(I4B),
intent(in) :: ib
5876 real(DP),
intent(in) :: hcell
5885 do n = 1, this%ndelaycells
5888 if (this%inewton == 0)
then
5889 call this%csub_delay_assemble_fc(ib, n, hcell, aii, au, al, r)
5891 call this%csub_delay_assemble_fn(ib, n, hcell, aii, au, al, r)
5913 integer(I4B),
intent(in) :: ib
5914 integer(I4B),
intent(in) :: n
5915 real(DP),
intent(in) :: hcell
5916 real(DP),
intent(inout) :: aii
5917 real(DP),
intent(inout) :: au
5918 real(DP),
intent(inout) :: al
5919 real(DP),
intent(inout) :: r
5921 integer(I4B) :: node
5922 integer(I4B) :: idelay
5923 integer(I4B) :: ielastic
5959 idelay = this%idelay(ib)
5960 ielastic = this%ielastic(ib)
5961 node = this%nodelist(ib)
5962 dzini = this%dbdzini(1, idelay)
5963 dzhalf =
dhalf * dzini
5965 c = this%kv(ib) / dzini
5973 if (n == 1 .or. n == this%ndelaycells)
then
5984 if (n < this%ndelaycells)
then
5989 z = this%dbz(n, idelay)
5992 h = this%dbh(n, idelay)
5993 h0 = this%dbh0(n, idelay)
5994 dz = this%dbdz(n, idelay)
5995 dz0 = this%dbdz0(n, idelay)
5996 theta = this%dbtheta(n, idelay)
5997 theta0 = this%dbtheta0(n, idelay)
6003 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6006 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6009 smult = dzini * tled
6010 gs = this%dbgeo(n, idelay)
6011 es0 = this%dbes0(n, idelay)
6012 pcs = this%dbpcs(n, idelay)
6013 aii = aii - smult * dsn * ssk
6014 if (ielastic /= 0)
then
6016 (dsn * ssk * (gs + zbot) - dsn0 * sske * es0)
6019 (dsn * ssk * (gs + zbot - pcs) + dsn0 * sske * (pcs - es0))
6023 r = r + smult * dsn * ssk * (h - hbar)
6026 wcf = this%brg * tled
6027 wc = dz * wcf * theta
6028 wc0 = dz0 * wcf * theta0
6029 aii = aii - dsn * wc
6030 r = r - dsn0 * wc0 * h0
6044 integer(I4B),
intent(in) :: ib
6045 integer(I4B),
intent(in) :: n
6046 real(DP),
intent(in) :: hcell
6047 real(DP),
intent(inout) :: aii
6048 real(DP),
intent(inout) :: au
6049 real(DP),
intent(inout) :: al
6050 real(DP),
intent(inout) :: r
6052 integer(I4B) :: node
6053 integer(I4B) :: idelay
6054 integer(I4B) :: ielastic
6080 real(DP) :: hbarderv
6097 idelay = this%idelay(ib)
6098 ielastic = this%ielastic(ib)
6099 node = this%nodelist(ib)
6100 dzini = this%dbdzini(1, idelay)
6101 dzhalf =
dhalf * dzini
6103 c = this%kv(ib) / dzini
6111 if (n == 1 .or. n == this%ndelaycells)
then
6122 if (n < this%ndelaycells)
then
6127 z = this%dbz(n, idelay)
6130 h = this%dbh(n, idelay)
6131 h0 = this%dbh0(n, idelay)
6132 dz = this%dbdz(n, idelay)
6133 dz0 = this%dbdz0(n, idelay)
6134 theta = this%dbtheta(n, idelay)
6135 theta0 = this%dbtheta0(n, idelay)
6144 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6147 dsnderv = this%csub_delay_calc_sat_derivative(node, idelay, n, hcell)
6150 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske, dsskde)
6153 smult = dzini * tled
6154 gs = this%dbgeo(n, idelay)
6155 es0 = this%dbes0(n, idelay)
6156 pcs = this%dbpcs(n, idelay)
6157 if (ielastic /= 0)
then
6158 qsto = smult * (dsn * ssk * (gs - hbar + zbot) - dsn0 * sske * es0)
6159 stoderv = -smult * dsn * ssk * hbarderv + &
6160 smult * ssk * (gs - hbar + zbot) * dsnderv
6162 qsto = smult * (dsn * ssk * (gs - hbar + zbot - pcs) + &
6163 dsn0 * sske * (pcs - es0))
6164 stoderv = -smult * dsn * ssk * hbarderv + &
6165 smult * ssk * (gs - hbar + zbot - pcs) * dsnderv
6168 stoderv = stoderv - &
6169 smult * dsn * dsskde * hbarderv * (gs - hbar + zbot - pcs)
6173 if (this%ieslag /= 0)
then
6174 if (ielastic /= 0)
then
6175 stoderv = stoderv - smult * sske * es0 * dsnderv
6177 stoderv = stoderv + smult * sske * (pcs - es0) * dsnderv
6183 r = r - qsto + stoderv * h
6186 wcf = this%brg * tled
6187 wc = dz * wcf * theta
6188 wc0 = dz0 * wcf * theta0
6189 qwc = dsn0 * wc0 * h0 - dsn * wc * h
6190 wcderv = -dsn * wc - wc * h * dsnderv
6193 if (this%ieslag /= 0)
then
6194 wcderv = wcderv + wc0 * h0 * dsnderv
6199 r = r - qwc + wcderv * h
6214 integer(I4B),
intent(in) :: node
6215 integer(I4B),
intent(in) :: idelay
6216 integer(I4B),
intent(in) :: n
6217 real(DP),
intent(in) :: hcell
6218 real(DP),
intent(in) :: hcellold
6219 real(DP),
intent(inout) :: snnew
6220 real(DP),
intent(inout) :: snold
6227 if (this%stoiconv(node) /= 0)
then
6228 dzhalf =
dhalf * this%dbdzini(n, idelay)
6229 top = this%dbz(n, idelay) + dzhalf
6230 bot = this%dbz(n, idelay) - dzhalf
6237 if (this%ieslag /= 0)
then
6253 integer(I4B),
intent(in) :: node
6254 integer(I4B),
intent(in) :: idelay
6255 integer(I4B),
intent(in) :: n
6256 real(dp),
intent(in) :: hcell
6263 if (this%stoiconv(node) /= 0)
then
6264 dzhalf =
dhalf * this%dbdzini(n, idelay)
6265 top = this%dbz(n, idelay) + dzhalf
6266 bot = this%dbz(n, idelay) - dzhalf
6284 integer(I4B),
intent(in) :: ib
6285 real(DP),
intent(in) :: hcell
6286 real(DP),
intent(inout) :: stoe
6287 real(DP),
intent(inout) :: stoi
6289 integer(I4B) :: idelay
6290 integer(I4B) :: ielastic
6291 integer(I4B) :: node
6311 idelay = this%idelay(ib)
6312 ielastic = this%ielastic(ib)
6313 node = this%nodelist(ib)
6320 if (this%thickini(ib) >
dzero)
then
6321 fmult = this%dbdzini(1, idelay)
6322 dzhalf =
dhalf * this%dbdzini(1, idelay)
6323 do n = 1, this%ndelaycells
6324 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske, wfac=wfac)
6325 z = this%dbz(n, idelay)
6327 h = this%dbh(n, idelay)
6328 h0 = this%dbh0(n, idelay)
6329 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6331 if (ielastic /= 0)
then
6332 v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot) - &
6333 dsn0 * sske * this%dbes0(n, idelay)
6336 v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot - &
6337 this%dbpcs(n, idelay))
6338 v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6344 stoi = stoi + wfac * v1 * fmult
6345 stoe = stoe + ((
done - wfac) * v1 + v2) * fmult
6348 ske = ske + sske * fmult
6349 sk = sk + ssk * fmult
6370 integer(I4B),
intent(in) :: ib
6371 real(DP),
intent(inout) :: dwc
6373 integer(I4B) :: idelay
6374 integer(I4B) :: node
6391 if (this%thickini(ib) >
dzero)
then
6392 idelay = this%idelay(ib)
6393 node = this%nodelist(ib)
6395 do n = 1, this%ndelaycells
6396 h = this%dbh(n, idelay)
6397 h0 = this%dbh0(n, idelay)
6398 dz = this%dbdz(n, idelay)
6399 dz0 = this%dbdz0(n, idelay)
6400 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6401 wc = dz * this%brg * this%dbtheta(n, idelay)
6402 wc0 = dz0 * this%brg * this%dbtheta0(n, idelay)
6403 v = dsn0 * wc0 * h0 - dsn * wc * h
6404 dwc = dwc + v * tled
6421 integer(I4B),
intent(in) :: ib
6422 real(DP),
intent(in) :: hcell
6423 real(DP),
intent(in) :: hcellold
6424 real(DP),
intent(inout) :: comp
6425 real(DP),
intent(inout) :: compi
6426 real(DP),
intent(inout) :: compe
6428 integer(I4B) :: idelay
6429 integer(I4B) :: ielastic
6430 integer(I4B) :: node
6447 idelay = this%idelay(ib)
6448 ielastic = this%ielastic(ib)
6449 node = this%nodelist(ib)
6455 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
6458 if (this%thickini(ib) >
dzero)
then
6459 fmult = this%dbdzini(1, idelay)
6460 do n = 1, this%ndelaycells
6461 h = this%dbh(n, idelay)
6462 h0 = this%dbh0(n, idelay)
6463 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6464 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske, wfac=wfac)
6465 if (ielastic /= 0)
then
6466 v1 = dsn * ssk * this%dbes(n, idelay) - sske * this%dbes0(n, idelay)
6469 v1 = dsn * ssk * (this%dbes(n, idelay) - this%dbpcs(n, idelay))
6470 v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6472 v = (v1 + v2) * fmult
6476 this%dbcomp(n, idelay) = v * snnew
6481 compi = compi + wfac * v1 * fmult
6482 compe = compe + ((
done - wfac) * v1 + v2) * fmult
6487 comp = comp * this%rnb(ib)
6488 compi = compi * this%rnb(ib)
6489 compe = compe * this%rnb(ib)
6500 integer(I4B),
intent(in) :: ib
6502 integer(I4B) :: idelay
6511 idelay = this%idelay(ib)
6517 do n = 1, this%ndelaycells
6520 comp = this%dbtcomp(n, idelay) + this%dbcomp(n, idelay)
6524 comp = comp / this%rnb(ib)
6527 if (abs(comp) >
dzero)
then
6528 thick = this%dbdzini(n, idelay)
6529 theta = this%dbthetaini(n, idelay)
6530 call this%csub_adj_matprop(comp, thick, theta)
6531 if (thick <=
dzero)
then
6532 write (
errmsg,
'(2(a,i0),a,g0,a)') &
6533 'Adjusted thickness for delay interbed (', ib, &
6534 ') cell (', n,
') is less than or equal to 0 (', thick,
').'
6537 if (theta <=
dzero)
then
6538 write (
errmsg,
'(2(a,i0),a,g0,a)') &
6539 'Adjusted theta for delay interbed (', ib, &
6540 ') cell (', n,
'is less than or equal to 0 (', theta,
').'
6543 this%dbdz(n, idelay) = thick
6544 this%dbtheta(n, idelay) = theta
6545 tthick = tthick + thick
6546 wtheta = wtheta + thick * theta
6548 thick = this%dbdz(n, idelay)
6549 theta = this%dbtheta(n, idelay)
6550 tthick = tthick + thick
6551 wtheta = wtheta + thick * theta
6557 if (tthick >
dzero)
then
6558 wtheta = wtheta / tthick
6563 this%thick(ib) = tthick
6564 this%theta(ib) = wtheta
6580 integer(I4B),
intent(in) :: ib
6581 real(DP),
intent(inout) :: hcof
6582 real(DP),
intent(inout) :: rhs
6584 integer(I4B) :: idelay
6589 idelay = this%idelay(ib)
6592 if (this%thickini(ib) >
dzero)
then
6594 c1 =
dtwo * this%kv(ib) / this%dbdzini(1, idelay)
6595 rhs = -c1 * this%dbh(1, idelay)
6597 this%kv(ib) / this%dbdzini(this%ndelaycells, idelay)
6598 rhs = rhs - c2 * this%dbh(this%ndelaycells, idelay)
6613 integer(I4B),
intent(in) :: ib
6614 integer(I4B),
intent(in) :: n
6615 real(dp),
intent(in) :: hcell
6617 integer(I4B) :: idelay
6622 idelay = this%idelay(ib)
6623 c =
dtwo * this%kv(ib) / this%dbdzini(n, idelay)
6624 q = c * (hcell - this%dbh(n, idelay))
6653 integer(I4B) :: indx
6657 call this%obs%StoreObsType(
'csub', .true., indx)
6662 call this%obs%StoreObsType(
'inelastic-csub', .true., indx)
6667 call this%obs%StoreObsType(
'elastic-csub', .true., indx)
6672 call this%obs%StoreObsType(
'coarse-csub', .false., indx)
6677 call this%obs%StoreObsType(
'csub-cell', .true., indx)
6682 call this%obs%StoreObsType(
'wcomp-csub-cell', .false., indx)
6687 call this%obs%StoreObsType(
'ske', .true., indx)
6692 call this%obs%StoreObsType(
'sk', .true., indx)
6697 call this%obs%StoreObsType(
'ske-cell', .true., indx)
6702 call this%obs%StoreObsType(
'sk-cell', .true., indx)
6707 call this%obs%StoreObsType(
'gstress-cell', .false., indx)
6712 call this%obs%StoreObsType(
'estress-cell', .false., indx)
6717 call this%obs%StoreObsType(
'interbed-compaction', .true., indx)
6722 call this%obs%StoreObsType(
'inelastic-compaction', .true., indx)
6727 call this%obs%StoreObsType(
'elastic-compaction', .true., indx)
6732 call this%obs%StoreObsType(
'coarse-compaction', .false., indx)
6737 call this%obs%StoreObsType(
'inelastic-compaction-cell', .true., indx)
6742 call this%obs%StoreObsType(
'elastic-compaction-cell', .true., indx)
6747 call this%obs%StoreObsType(
'compaction-cell', .true., indx)
6752 call this%obs%StoreObsType(
'thickness', .true., indx)
6757 call this%obs%StoreObsType(
'coarse-thickness', .false., indx)
6762 call this%obs%StoreObsType(
'thickness-cell', .false., indx)
6767 call this%obs%StoreObsType(
'theta', .true., indx)
6772 call this%obs%StoreObsType(
'coarse-theta', .false., indx)
6777 call this%obs%StoreObsType(
'theta-cell', .true., indx)
6782 call this%obs%StoreObsType(
'preconstress-cell', .false., indx)
6787 call this%obs%StoreObsType(
'interbed-compaction-pct', .false., indx)
6792 call this%obs%StoreObsType(
'delay-preconstress', .false., indx)
6797 call this%obs%StoreObsType(
'delay-head', .false., indx)
6802 call this%obs%StoreObsType(
'delay-gstress', .false., indx)
6807 call this%obs%StoreObsType(
'delay-estress', .false., indx)
6812 call this%obs%StoreObsType(
'delay-compaction', .false., indx)
6817 call this%obs%StoreObsType(
'delay-thickness', .false., indx)
6822 call this%obs%StoreObsType(
'delay-theta', .false., indx)
6827 call this%obs%StoreObsType(
'delay-flowtop', .true., indx)
6832 call this%obs%StoreObsType(
'delay-flowbot', .true., indx)
6849 integer(I4B) :: idelay
6850 integer(I4B) :: ncol
6851 integer(I4B) :: node
6858 if (this%obs%npakobs > 0)
then
6859 call this%obs%obs_bd_clear()
6860 do i = 1, this%obs%npakobs
6861 obsrv => this%obs%pakobs(i)%obsrv
6862 if (obsrv%BndFound)
then
6863 if (obsrv%ObsTypeId ==
'SKE' .or. &
6864 obsrv%ObsTypeId ==
'SK' .or. &
6865 obsrv%ObsTypeId ==
'SKE-CELL' .or. &
6866 obsrv%ObsTypeId ==
'SK-CELL' .or. &
6867 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
6868 obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
6869 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
6870 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
6871 obsrv%ObsTypeId ==
'PRECONSTRESS-CELL')
then
6872 if (this%gwfiss /= 0)
then
6873 call this%obs%SaveOneSimval(obsrv,
dnodata)
6876 do j = 1, obsrv%indxbnds_count
6877 n = obsrv%indxbnds(j)
6878 select case (obsrv%ObsTypeId)
6899 case (
'DELAY-HEAD',
'DELAY-PRECONSTRESS', &
6900 'DELAY-GSTRESS',
'DELAY-ESTRESS')
6901 if (n > this%ndelaycells)
then
6902 r = real(n - 1, dp) / real(this%ndelaycells, dp)
6903 idelay = int(floor(r)) + 1
6904 ncol = n - int(floor(r)) * this%ndelaycells
6909 select case (obsrv%ObsTypeId)
6911 v = this%dbh(ncol, idelay)
6912 case (
'DELAY-PRECONSTRESS')
6913 v = this%dbpcs(ncol, idelay)
6914 case (
'DELAY-GSTRESS')
6915 v = this%dbgeo(ncol, idelay)
6916 case (
'DELAY-ESTRESS')
6917 v = this%dbes(ncol, idelay)
6919 case (
'PRECONSTRESS-CELL')
6922 errmsg =
"Unrecognized observation type '"// &
6923 trim(obsrv%ObsTypeId)//
"'."
6926 call this%obs%SaveOneSimval(obsrv, v)
6931 do j = 1, obsrv%indxbnds_count
6932 n = obsrv%indxbnds(j)
6933 select case (obsrv%ObsTypeId)
6935 v = this%storagee(n) + this%storagei(n)
6936 case (
'INELASTIC-CSUB')
6937 v = this%storagei(n)
6938 case (
'ELASTIC-CSUB')
6939 v = this%storagee(n)
6940 case (
'COARSE-CSUB')
6942 case (
'WCOMP-CSUB-CELL')
6943 v = this%cell_wcstor(n)
6950 v = this%storagee(n) + this%storagei(n)
6954 case (
'COARSE-THETA')
6955 v = this%cg_theta(n)
6960 f = this%cg_thick(n) / this%cell_thick(n)
6961 v = f * this%cg_theta(n)
6963 node = this%nodelist(n)
6964 f = this%csub_calc_interbed_thickness(n) / this%cell_thick(node)
6965 v = f * this%theta(n)
6967 case (
'GSTRESS-CELL')
6969 case (
'ESTRESS-CELL')
6971 case (
'INTERBED-COMPACTION')
6973 case (
'INTERBED-COMPACTION-PCT')
6974 b0 = this%thickini(n)
6975 if (this%idelay(n) /= 0)
then
6976 b0 = b0 * this%rnb(n)
6979 case (
'INELASTIC-COMPACTION')
6981 case (
'ELASTIC-COMPACTION')
6983 case (
'COARSE-COMPACTION')
6984 v = this%cg_tcomp(n)
6985 case (
'INELASTIC-COMPACTION-CELL')
6991 case (
'ELASTIC-COMPACTION-CELL')
6995 v = this%cg_tcomp(n)
6999 case (
'COMPACTION-CELL')
7003 v = this%cg_tcomp(n)
7008 idelay = this%idelay(n)
7010 if (idelay /= 0)
then
7013 case (
'COARSE-THICKNESS')
7014 v = this%cg_thick(n)
7015 case (
'THICKNESS-CELL')
7016 v = this%cell_thick(n)
7017 case (
'DELAY-COMPACTION',
'DELAY-THICKNESS', &
7019 if (n > this%ndelaycells)
then
7020 r = real(n, dp) / real(this%ndelaycells, dp)
7021 idelay = int(floor(r)) + 1
7022 ncol = mod(n, this%ndelaycells)
7027 select case (obsrv%ObsTypeId)
7028 case (
'DELAY-COMPACTION')
7029 v = this%dbtcomp(ncol, idelay)
7030 case (
'DELAY-THICKNESS')
7031 v = this%dbdz(ncol, idelay)
7032 case (
'DELAY-THETA')
7033 v = this%dbtheta(ncol, idelay)
7035 case (
'DELAY-FLOWTOP')
7036 idelay = this%idelay(n)
7037 v = this%dbflowtop(idelay)
7038 case (
'DELAY-FLOWBOT')
7039 idelay = this%idelay(n)
7040 v = this%dbflowbot(idelay)
7042 errmsg =
"Unrecognized observation type: '"// &
7043 trim(obsrv%ObsTypeId)//
"'."
7046 call this%obs%SaveOneSimval(obsrv, v)
7050 call this%obs%SaveOneSimval(obsrv,
dnodata)
7073 character(len=LENBOUNDNAME) :: bname
7078 integer(I4B) :: idelay
7081 if (.not. this%csub_obs_supported())
then
7089 do i = 1, this%obs%npakobs
7090 obsrv => this%obs%pakobs(i)%obsrv
7093 obsrv%BndFound = .false.
7095 bname = obsrv%FeatureName
7096 if (bname /=
'')
then
7101 do j = 1, this%ninterbeds
7102 if (this%boundname(j) == bname)
then
7103 obsrv%BndFound = .true.
7104 obsrv%CurrentTimeStepEndValue =
dzero
7105 call obsrv%AddObsIndex(j)
7110 else if (obsrv%ObsTypeId ==
'GSTRESS-CELL' .or. &
7111 obsrv%ObsTypeId ==
'ESTRESS-CELL' .or. &
7112 obsrv%ObsTypeId ==
'THICKNESS-CELL' .or. &
7113 obsrv%ObsTypeId ==
'COARSE-CSUB' .or. &
7114 obsrv%ObsTypeId ==
'WCOMP-CSUB-CELL' .or. &
7115 obsrv%ObsTypeId ==
'COARSE-COMPACTION' .or. &
7116 obsrv%ObsTypeId ==
'COARSE-THETA' .or. &
7117 obsrv%ObsTypeId ==
'COARSE-THICKNESS')
then
7118 obsrv%BndFound = .true.
7119 obsrv%CurrentTimeStepEndValue =
dzero
7120 call obsrv%AddObsIndex(obsrv%NodeNumber)
7121 else if (obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
7122 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
7123 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
7124 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
7125 obsrv%ObsTypeId ==
'DELAY-COMPACTION' .or. &
7126 obsrv%ObsTypeId ==
'DELAY-THICKNESS' .or. &
7127 obsrv%ObsTypeId ==
'DELAY-THETA')
then
7128 if (this%ninterbeds > 0)
then
7129 n = obsrv%NodeNumber
7130 idelay = this%idelay(n)
7131 if (idelay /= 0)
then
7132 j = (idelay - 1) * this%ndelaycells + 1
7133 n2 = obsrv%NodeNumber2
7134 if (n2 < 1 .or. n2 > this%ndelaycells)
then
7135 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7136 trim(adjustl(obsrv%ObsTypeId)),
'interbed cell must be ', &
7137 'greater than 0 and less than or equal to', this%ndelaycells, &
7138 '(specified value is ', n2,
').'
7141 j = (idelay - 1) * this%ndelaycells + n2
7143 obsrv%BndFound = .true.
7144 call obsrv%AddObsIndex(j)
7149 else if (obsrv%ObsTypeId ==
'CSUB' .or. &
7150 obsrv%ObsTypeId ==
'INELASTIC-CSUB' .or. &
7151 obsrv%ObsTypeId ==
'ELASTIC-CSUB' .or. &
7152 obsrv%ObsTypeId ==
'SK' .or. &
7153 obsrv%ObsTypeId ==
'SKE' .or. &
7154 obsrv%ObsTypeId ==
'THICKNESS' .or. &
7155 obsrv%ObsTypeId ==
'THETA' .or. &
7156 obsrv%ObsTypeId ==
'INTERBED-COMPACTION' .or. &
7157 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION' .or. &
7158 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION' .or. &
7159 obsrv%ObsTypeId ==
'INTERBED-COMPACTION-PCT')
then
7160 if (this%ninterbeds > 0)
then
7161 j = obsrv%NodeNumber
7162 if (j < 1 .or. j > this%ninterbeds)
then
7163 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7164 trim(adjustl(obsrv%ObsTypeId)),
'interbed cell must be greater', &
7165 'than 0 and less than or equal to', this%ninterbeds, &
7166 '(specified value is ', j,
').'
7169 obsrv%BndFound = .true.
7170 obsrv%CurrentTimeStepEndValue =
dzero
7171 call obsrv%AddObsIndex(j)
7174 else if (obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
7175 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
7176 if (this%ninterbeds > 0)
then
7177 j = obsrv%NodeNumber
7178 if (j < 1 .or. j > this%ninterbeds)
then
7179 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7180 trim(adjustl(obsrv%ObsTypeId)), &
7181 'interbed cell must be greater ', &
7182 'than 0 and less than or equal to', this%ninterbeds, &
7183 '(specified value is ', j,
').'
7186 idelay = this%idelay(j)
7187 if (idelay /= 0)
then
7188 obsrv%BndFound = .true.
7189 obsrv%CurrentTimeStepEndValue =
dzero
7190 call obsrv%AddObsIndex(j)
7198 if (obsrv%ObsTypeId ==
'CSUB-CELL' .or. &
7199 obsrv%ObsTypeId ==
'SKE-CELL' .or. &
7200 obsrv%ObsTypeId ==
'SK-CELL' .or. &
7201 obsrv%ObsTypeId ==
'THETA-CELL' .or. &
7202 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION-CELL' .or. &
7203 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION-CELL' .or. &
7204 obsrv%ObsTypeId ==
'COMPACTION-CELL')
then
7205 if (.NOT. obsrv%BndFound)
then
7206 obsrv%BndFound = .true.
7207 obsrv%CurrentTimeStepEndValue =
dzero
7208 call obsrv%AddObsIndex(obsrv%NodeNumber)
7211 jloop:
do j = 1, this%ninterbeds
7212 if (this%nodelist(j) == obsrv%NodeNumber)
then
7213 obsrv%BndFound = .true.
7214 obsrv%CurrentTimeStepEndValue =
dzero
7215 call obsrv%AddObsIndex(j)
7242 integer(I4B),
intent(in) :: inunitobs
7243 integer(I4B),
intent(in) :: iout
7247 integer(I4B) :: icol, istart, istop
7248 character(len=LINELENGTH) :: string
7249 character(len=LENBOUNDNAME) :: bndname
7250 logical(LGP) :: flag_string
7251 logical(LGP) :: flag_idcellno
7252 logical(LGP) :: flag_error
7255 string = obsrv%IDstring
7256 flag_string = .true.
7257 flag_idcellno = .false.
7258 flag_error = .false.
7259 if (obsrv%ObsTypeId(1:5) ==
"DELAY" .AND. &
7260 obsrv%ObsTypeId(1:10) /=
"DELAY-FLOW")
then
7261 flag_idcellno = .true.
7270 if (obsrv%ObsTypeId ==
'CSUB' .or. &
7271 obsrv%ObsTypeId ==
'INELASTIC-CSUB' .or. &
7272 obsrv%ObsTypeId ==
'ELASTIC-CSUB' .or. &
7273 obsrv%ObsTypeId ==
'SK' .or. &
7274 obsrv%ObsTypeId ==
'SKE' .or. &
7275 obsrv%ObsTypeId ==
'THETA' .or. &
7276 obsrv%ObsTypeId ==
'THICKNESS' .or. &
7277 obsrv%ObsTypeId ==
'INTERBED-COMPACTION' .or. &
7278 obsrv%ObsTypeId ==
'INTERBED-COMPACTION-PCT' .or. &
7279 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION' .or. &
7280 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION' .or. &
7281 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
7282 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
7283 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
7284 obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
7285 obsrv%ObsTypeId ==
'DELAY-COMPACTION' .or. &
7286 obsrv%ObsTypeId ==
'DELAY-THICKNESS' .or. &
7287 obsrv%ObsTypeId ==
'DELAY-THETA' .or. &
7288 obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
7289 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
7293 nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
7294 iout, string, flag_string)
7297 if (obsrv%ObsTypeId ==
'SK' .or. &
7298 obsrv%ObsTypeId ==
'SKE' .or. &
7299 obsrv%ObsTypeId ==
'THETA' .or. &
7300 obsrv%ObsTypeId ==
'THICKNESS' .or. &
7301 obsrv%ObsTypeId ==
'INTERBED-COMPACTION' .or. &
7302 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION' .or. &
7303 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION' .or. &
7304 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
7305 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
7306 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
7307 obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
7308 obsrv%ObsTypeId ==
'DELAY-COMPACTION' .or. &
7309 obsrv%ObsTypeId ==
'DELAY-THICKNESS' .or. &
7310 obsrv%ObsTypeId ==
'DELAY-THETA')
then
7313 "BOUNDNAME ('", trim(adjustl(bndname)), &
7314 "') not allowed for CSUB observation type '", &
7315 trim(adjustl(obsrv%ObsTypeId)),
"'."
7320 else if (obsrv%ObsTypeId ==
'CSUB' .or. &
7321 obsrv%ObsTypeId ==
'INELASTIC-CSUB' .or. &
7322 obsrv%ObsTypeId ==
'ELASTIC-CSUB' .or. &
7326 obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
7327 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
7329 obsrv%FeatureName = bndname
7333 if (flag_idcellno .EQV. .true. .AND. flag_error .EQV. .false.)
then
7338 "BOUNDNAME ('", trim(adjustl(bndname)), &
7339 "') not allowed for CSUB observation type '", &
7340 trim(adjustl(obsrv%ObsTypeId)),
"' idcellno."
7343 obsrv%NodeNumber2 = nn2
7349 obsrv%NodeNumber = nn1
7363 this%listlabel = trim(this%filtyp)//
' NO.'
7364 if (this%dis%ndim == 3)
then
7365 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
7366 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
7367 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
7368 elseif (this%dis%ndim == 2)
then
7369 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
7370 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
7372 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
7374 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'SIG0'
7375 if (this%inamedbound == 1)
then
7376 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
This module contains the BudgetModule.
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ tabcenter
centered table column
@ tabright
right justified table column
@ tableft
left justified table column
@ mnormal
normal output mode
real(dp), parameter dem20
real constant 1e-20
@ tabucstring
upper case string table data
@ tabstring
string table data
@ tabinteger
integer table data
integer(i4b), parameter lenpackagename
maximum length of the package name
real(dp), parameter dp9
real constant 9/10
real(dp), parameter dem10
real constant 1e-10
real(dp), parameter dem7
real constant 1e-7
real(dp), parameter dem8
real constant 1e-8
integer(i4b), parameter namedboundflag
named bound flag
real(dp), parameter dnodata
real no data constant
real(dp), parameter dhnoflo
real no flow constant
integer(i4b), parameter lenlistlabel
maximum length of a llist label
real(dp), parameter dhundred
real constant 100
integer(i4b), parameter lenpakloc
maximum length of a package location
real(dp), parameter dem1
real constant 1e-1
real(dp), parameter dhalf
real constant 1/2
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
real(dp), parameter dgravity
real constant gravitational acceleration (m/(s s))
integer(i4b), parameter lenauxname
maximum length of a aux variable
real(dp), parameter dem3
real constant 1e-3
integer(i4b), parameter lenboundname
maximum length of a bound name
real(dp), parameter dem4
real constant 1e-4
real(dp), parameter dem6
real constant 1e-6
real(dp), parameter dzero
real constant zero
real(dp), parameter dem5
real constant 1e-5
real(dp), parameter dten
real constant 10
real(dp), parameter dprec
real constant machine precision
integer(i4b), parameter maxcharlen
maximum length of char string
real(dp), parameter dem15
real constant 1e-15
real(dp), parameter dtwo
real constant 2
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter dthree
real constant 3
real(dp), parameter done
real constant 1
integer(i4b) function, public get_node(ilay, irow, icol, nlay, nrow, ncol)
Get node number, given layer, row, and column indices for a structured grid. If any argument is inval...
This module contains the CSUB package methods.
subroutine csub_nodelay_wcomp_fn(this, ib, node, tled, area, hcell, hcellold, hcof, rhs)
@ brief Formulate no-delay interbed water compressibility coefficients
real(dp) function csub_calc_delay_flow(this, ib, n, hcell)
Calculate the flow from delay interbed top or bottom.
subroutine csub_source_dimensions(this)
@ brief Source dimensions for package
subroutine csub_cg_wcomp_fc(this, node, tled, area, hcell, hcellold, hcof, rhs)
@ brief Formulate coarse-grained water compressibility coefficients
subroutine, public csub_cr(csubobj, name_model, mempath, istounit, stoPckName, inunit, iout)
@ brief Create a new package object
subroutine csub_delay_assemble_fn(this, ib, n, hcell, aii, au, al, r)
Assemble delay interbed Newton-Raphson formulation coefficients.
subroutine csub_ar(this, dis, ibound)
@ brief Allocate and read method for package
subroutine csub_delay_calc_ssksske(this, ib, n, hcell, ssk, sske, dsskde, wfac)
Calculate delay interbed cell storage coefficients.
subroutine csub_initialize_tables(this)
@ brief Initialize optional tables
subroutine csub_nodelay_wcomp_fc(this, ib, node, tled, area, hcell, hcellold, hcof, rhs)
@ brief Formulate no-delay interbed water compressibility coefficients
real(dp) function csub_calc_sat_derivative(this, node, hcell)
Calculate the saturation derivative.
character(len=lenbudtxt), dimension(4) budtxt
subroutine csub_cg_calc_comp(this, node, hcell, hcellold, comp)
@ brief Calculate coarse-grained compaction in a cell
real(dp) function csub_calc_adjes(this, node, es0, z0, z)
Calculate the effective stress at elevation z.
subroutine csub_cg_wcomp_fn(this, node, tled, area, hcell, hcellold, hcof, rhs)
@ brief Formulate coarse-grained water compressibility coefficients
subroutine csub_interbed_fc(this, ib, node, area, hcell, hcellold, hcof, rhs)
@ brief Formulate the coefficients for a interbed
subroutine csub_delay_fc(this, ib, hcof, rhs)
Calculate delay interbed contribution to the cell.
subroutine csub_delay_update(this, ib)
Update delay interbed material properties.
subroutine csub_delay_init_zcell(this, ib)
Calculate delay interbed znode and z relative to interbed center.
subroutine csub_nodelay_update(this, i)
@ brief Update no-delay material properties
subroutine csub_source_packagedata(this)
@ brief source packagedata for package
subroutine csub_allocate_arrays(this)
@ brief Allocate package arrays
subroutine csub_adj_matprop(this, comp, thick, theta)
Calculate new material properties.
subroutine log_options(this, warn_estress_lag)
@ brief log options for package
subroutine csub_cg_calc_sske(this, n, sske, hcell)
@ brief Calculate Sske for a cell
real(dp) function csub_calc_void_ratio(this, theta)
Calculate the void ratio.
subroutine csub_fc(this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
@ brief Fill A and r for the package
subroutine csub_calc_sat(this, node, hcell, hcellold, snnew, snold)
Calculate cell saturation.
real(dp) function csub_calc_theta(this, void_ratio)
Calculate the porosity.
subroutine csub_cc(this, innertot, kiter, iend, icnvgmod, nodes, hnew, hold, cpak, ipak, dpak)
@ brief Final convergence check
subroutine csub_delay_calc_wcomp(this, ib, dwc)
Calculate delay interbed water compressibility.
subroutine csub_delay_calc_sat(this, node, idelay, n, hcell, hcellold, snnew, snold)
Calculate delay interbed saturation.
subroutine csub_source_griddata(this)
@ brief Source griddata for package
real(dp) function csub_calc_znode(this, top, bottom, zbar)
Calculate the cell node.
subroutine csub_delay_calc_comp(this, ib, hcell, hcellold, comp, compi, compe)
Calculate delay interbed compaction.
subroutine csub_delay_calc_stress(this, ib, hcell)
Calculate delay interbed stress values.
subroutine source_options(this)
@ brief Source options for package
subroutine csub_nodelay_calc_comp(this, ib, hcell, hcellold, comp, rho1, rho2)
@ brief Calculate no-delay interbed compaction
subroutine csub_set_initial_state(this, nodes, hnew)
@ brief Set initial states for the package
subroutine csub_cg_calc_stress(this, nodes, hnew)
@ brief Calculate the stress for model cells
real(dp) function csub_calc_interbed_thickness(this, ib)
Calculate the interbed thickness.
real(dp), parameter dlog10es
derivative of the log of effective stress
subroutine csub_delay_assemble_fc(this, ib, n, hcell, aii, au, al, r)
Assemble delay interbed standard formulation coefficients.
subroutine csub_interbed_fn(this, ib, node, hcell, hcellold, hcof, rhs)
@ brief Formulate the coefficients for a interbed
subroutine csub_print_packagedata(this)
@ brief Print packagedata
subroutine csub_rp_obs(this)
Read and prepare the observations.
subroutine csub_rp(this)
@ brief Read and prepare stress period data for package
subroutine csub_nodelay_fc(this, ib, hcell, hcellold, rho1, rho2, rhs, argtled)
@ brief Calculate no-delay interbed storage coefficients
subroutine csub_ad(this, nodes, hnew)
@ brief Advance the package
subroutine csub_bd_obs(this)
Set the observations for this time step.
subroutine csub_cg_update(this, node)
@ brief Update coarse-grained material properties
subroutine csub_delay_assemble(this, ib, hcell)
Assemble delay interbed coefficients.
subroutine csub_bd(this, isuppress_output, model_budget)
@ brief Model budget calculation for package
subroutine define_listlabel(this)
@ brief Define the list label for the package
subroutine csub_ot_dv(this, idvfl, idvprint)
@ brief Save and print dependent values for package
real(dp) function csub_delay_calc_sat_derivative(this, node, idelay, n, hcell)
Calculate the delay interbed cell saturation derivative.
subroutine csub_da(this)
@ brief Deallocate package memory
subroutine csub_save_model_flows(this, icbcfl, icbcun)
@ brief Save model flows for package
subroutine csub_calc_sfacts(this, node, bot, znode, theta, es, es0, geo, fact)
Calculate specific storage coefficient factor.
subroutine csub_cg_fn(this, node, tled, area, hcell, hcof, rhs)
@ brief Formulate coarse-grained Newton-Raphson terms
subroutine csub_delay_head_check(this, ib)
Check delay interbed head.
subroutine csub_delay_sln(this, ib, hcell, update)
Solve delay interbed continuity equation.
subroutine csub_fp(this)
@ brief Final processing for package
subroutine csub_process_obsid(obsrv, dis, inunitobs, iout)
Process the observation IDs for the package.
subroutine csub_fn(this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
@ brief Fill Newton-Raphson terms in A and r for the package
real(dp), parameter stressfloor
effective-stress regularization floor (fraction of geostatic stress)
logical function csub_obs_supported(this)
Determine if observations are supported.
character(len=lenbudtxt), dimension(6) comptxt
subroutine csub_delay_calc_dstor(this, ib, hcell, stoe, stoi)
Calculate delay interbed storage change.
subroutine csub_cg_chk_stress(this)
@ brief Check effective stress values
subroutine csub_cg_fc(this, node, tled, area, hcell, hcellold, hcof, rhs)
@ brief Formulate the coefficients for coarse-grained materials
subroutine csub_cq(this, nodes, hnew, hold, isuppress_output, flowja)
@ brief Calculate flows for package
subroutine csub_allocate_scalars(this)
@ brief Allocate scalars
subroutine csub_df_obs(this)
Define the observation types available in the package.
subroutine, public ims_misc_thomas(n, tl, td, tu, b, x, w)
Tridiagonal solve using the Thomas algorithm.
This module defines variable data types.
pure logical function, public is_close(a, b, rtol, atol, symmetric)
Check if a real value is approximately equal to another.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.
Store and issue logging messages to output units.
subroutine, public write_message(text, iunit, fmt, skipbefore, skipafter, advance)
Write a message to an output unit.
This module contains the base numerical package type.
This module contains the derived types ObserveType and ObsDataType.
This module contains the derived type ObsType.
subroutine, public obs_cr(obs, inobs)
@ brief Create a new ObsType object
This module contains simulation methods.
subroutine, public store_warning(msg, substring)
Store warning message.
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.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=maxcharlen) warnmsg
warning message string
real(dp) function squadraticsaturation(top, bot, x, eps)
@ brief sQuadraticSaturation
real(dp) function squadraticsaturationderivative(top, bot, x, eps)
@ brief Derivative of the quadratic saturation function
real(dp) function squadratic0spderivative(x, xi, tomega)
@ brief sQuadratic0spDerivative
real(dp) function squadratic0sp(x, xi, tomega)
@ brief sQuadratic0sp
subroutine, public selectn(indx, v, reverse)
This module contains the SourceCommonModule.
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
subroutine, public table_cr(this, name, title)
real(dp), pointer, public totim
time relative to start of simulation
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
integer(i4b), pointer, public nper
number of stress period
Derived type for the Budget object.
This class is used to store a single deferred-length character string. It was designed to work in an ...