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
370 integer(I4B) :: istoerr
374 real(DP) :: cg_ske_cr
379 character(len=*),
parameter :: fmtcsub = &
380 "(1x,/1x,'CSUB -- COMPACTION PACKAGE, VERSION 1, 12/15/2019', &
381 &' INPUT READ FROM MEMPATH: ', A, /)"
384 write (this%iout, fmtcsub) this%input_mempath
388 this%ibound => ibound
391 call obs_cr(this%obs, this%inobspkg)
394 call this%source_options()
397 call this%source_dimensions()
400 call this%obs%obs_ar()
408 call this%csub_allocate_arrays()
411 call this%csub_source_griddata()
417 do node = 1, this%dis%nodes
418 call this%dis%noder_to_string(node, cellid)
419 cg_ske_cr = this%cg_ske_cr(node)
420 theta = this%cg_thetaini(node)
423 if (cg_ske_cr < dzero)
then
424 write (
errmsg,
'(a,g0,a,1x,a,1x,a,a)') &
425 'Coarse-grained material CG_SKE_CR (', cg_ske_cr,
') is less', &
426 'than zero in cell', trim(adjustl(cellid)),
'.'
430 if (this%stoss(node) /= dzero)
then
435 if (theta > done .or. theta < dzero)
then
436 write (
errmsg,
'(a,g0,a,1x,a,1x,a,a)') &
437 'Coarse-grained material THETA (', theta,
') is less', &
438 'than zero or greater than 1 in cell', trim(adjustl(cellid)),
'.'
444 if (istoerr /= 0)
then
445 write (
errmsg,
'(a,3(1x,a))') &
446 'Specific storage values in the storage (STO) package must', &
447 'be zero in all active cells when using the', &
448 trim(adjustl(this%packName)), &
454 if (this%ninterbeds > 0)
then
455 call this%csub_source_packagedata()
459 call this%csub_initialize_tables()
462 do node = 1, this%dis%nodes
463 top = this%dis%top(node)
464 bot = this%dis%bot(node)
465 this%cg_thickini(node) = top - bot
466 this%cell_thick(node) = top - bot
470 do ib = 1, this%ninterbeds
471 node = this%nodelist(ib)
472 idelay = this%idelay(ib)
473 if (idelay == 0)
then
474 v = this%thickini(ib)
476 v = this%rnb(ib) * this%thickini(ib)
478 this%cg_thickini(node) = this%cg_thickini(node) - v
482 do node = 1, this%dis%nodes
483 thick = this%cg_thickini(node)
484 if (thick < dzero)
then
485 call this%dis%noder_to_string(node, cellid)
486 write (
errmsg,
'(a,g0,a,1x,a,a)') &
487 'Coarse grained material thickness is less than zero (', &
488 thick,
') in cell', trim(adjustl(cellid)),
'. Interbed thicknesses:'
491 do ib = 1, this%ninterbeds
492 if (node /= this%nodelist(ib))
then
495 idelay = this%idelay(ib)
496 v = this%thickini(ib)
497 if (idelay /= 0)
then
501 write (
errmsg,
'(a,1x,a,i0,a,g0)') &
503 'icbno(', ib,
')=', v
505 write (
errmsg,
'(a,a,g0,a)') &
507 '. Total interbed thickness=', vtot,
'.'
520 if (this%iupdatematprop /= 0)
then
521 do node = 1, this%dis%nodes
522 this%cg_thick(node) = this%cg_thickini(node)
523 this%cg_theta(node) = this%cg_thetaini(node)
545 integer(I4B),
pointer :: ibs
546 integer(I4B) :: inobs
547 integer(I4B),
pointer :: iei_smoothing
548 integer(I4B),
pointer :: istrict
549 character(len=LINELENGTH) :: csv_interbed, csv_coarse
550 character(len=LINELENGTH) :: cmp_fn, ecmp_fn, iecmp_fn, ibcmp_fn, cmpcoarse_fn
551 character(len=LINELENGTH) :: zdisp_fn, pkg_converge_fn
553 logical(LGP) :: warn_estress_lag = .false.
560 call mem_set_value(this%inamedbound,
'BOUNDNAMES', this%input_mempath, &
562 call mem_set_value(this%iprpak,
'PRINT_INPUT', this%input_mempath, &
564 call mem_set_value(this%ipakcb,
'SAVE_FLOWS', this%input_mempath, &
566 call mem_set_value(this%gammaw,
'GAMMAW', this%input_mempath, found%gammaw)
567 call mem_set_value(this%beta,
'BETA', this%input_mempath, found%beta)
569 allocate (iei_smoothing)
572 this%input_mempath, found%ei_smoothing)
573 if (found%ei_smoothing)
then
576 deallocate (iei_smoothing)
580 call mem_set_value(istrict,
'STRICT_STRESS', this%input_mempath, &
582 if (found%strict_stress)
then
583 this%istrict_stress = 1
586 call mem_set_value(this%ipch,
'HEAD_BASED', this%input_mempath, &
588 call mem_set_value(this%ipch,
'PRECON_HEAD', this%input_mempath, &
590 call mem_set_value(this%ndelaycells,
'NDELAYCELLS', this%input_mempath, &
592 call mem_set_value(this%istoragec,
'ICOMPRESS', this%input_mempath, &
594 call mem_set_value(this%iupdatematprop,
'MATPROP', this%input_mempath, &
596 call mem_set_value(this%icellf,
'CELL_FRACTION', this%input_mempath, &
598 call mem_set_value(ibs,
'INTERBED_STATE', this%input_mempath, &
599 found%interbed_state)
600 call mem_set_value(this%ispecified_pcs,
'PRECON_STRESS', this%input_mempath, &
602 call mem_set_value(this%ispecified_dbh,
'DELAY_HEAD', this%input_mempath, &
604 call mem_set_value(this%ieslag,
'STRESS_LAG', this%input_mempath, &
606 call mem_set_value(csv_interbed,
'INTERBEDSTRAINFN', this%input_mempath, &
607 found%interbedstrainfn)
608 call mem_set_value(csv_coarse,
'COARSESTRAINFN', this%input_mempath, &
609 found%coarsestrainfn)
610 call mem_set_value(cmp_fn,
'CMPFN', this%input_mempath, found%cmpfn)
611 call mem_set_value(ecmp_fn,
'ELASTICCMPFN', this%input_mempath, &
613 call mem_set_value(iecmp_fn,
'INELASTICCMPFN', this%input_mempath, &
614 found%inelasticcmpfn)
615 call mem_set_value(ibcmp_fn,
'INTERBEDCMPFN', this%input_mempath, &
617 call mem_set_value(cmpcoarse_fn,
'CMPCOARSEFN', this%input_mempath, &
619 call mem_set_value(zdisp_fn,
'ZDISPFN', this%input_mempath, found%zdispfn)
620 call mem_set_value(pkg_converge_fn,
'PKGCONVERGEFN', this%input_mempath, &
624 if (
filein_fname(this%obs%inputFilename,
'OBS6_FILENAME', &
625 this%input_mempath, this%input_fname))
then
626 this%obs%active = .true.
628 call openfile(inobs, this%iout, this%obs%inputFilename,
'OBS')
629 this%obs%inUnitObs = inobs
630 this%inobspkg = inobs
631 call this%obs%obs_df(this%iout, this%packName, this%filtyp, this%dis)
632 call this%csub_df_obs()
636 if (found%save_flows) this%ipakcb = -1
637 if (found%head_based)
then
638 this%lhead_based = .true.
639 if (this%ieslag /= 0)
then
641 warn_estress_lag = .true.
644 if (found%icompress) this%istoragec = 0
645 if (found%interbed_state)
then
646 this%ispecified_pcs = 1
647 this%ispecified_dbh = 1
649 if (found%gammaw .or. found%beta)
then
650 this%brg = this%gammaw * this%beta
654 if (found%interbedstrainfn)
then
656 call openfile(this%istrainib, this%iout, csv_interbed,
'CSV_OUTPUT', &
657 filstat_opt=
'REPLACE', mode_opt=
mnormal)
659 if (found%coarsestrainfn)
then
661 call openfile(this%istrainsk, this%iout, csv_coarse,
'CSV_OUTPUT', &
662 filstat_opt=
'REPLACE', mode_opt=
mnormal)
664 if (found%cmpfn)
then
666 call openfile(this%ioutcomp, this%iout, cmp_fn,
'DATA(BINARY)', &
669 if (found%elasticcmpfn)
then
671 call openfile(this%ioutcompe, this%iout, ecmp_fn, &
675 if (found%inelasticcmpfn)
then
677 call openfile(this%ioutcompi, this%iout, iecmp_fn, &
681 if (found%interbedcmpfn)
then
683 call openfile(this%ioutcompib, this%iout, ibcmp_fn, &
687 if (found%cmpcoarsefn)
then
689 call openfile(this%ioutcomps, this%iout, cmpcoarse_fn, &
693 if (found%zdispfn)
then
695 call openfile(this%ioutzdisp, this%iout, zdisp_fn, &
699 if (found%pkgconvergefn)
then
701 call openfile(this%ipakcsv, this%iout, pkg_converge_fn,
'CSV', &
702 filstat_opt=
'REPLACE', mode_opt=
mnormal)
706 call this%log_options(warn_estress_lag)
721 logical(LGP),
intent(in) :: warn_estress_lag
724 character(len=*),
parameter :: fmtts = &
725 &
"(4x,'TIME-SERIES DATA WILL BE READ FROM FILE: ',a)"
726 character(len=*),
parameter :: fmtflow = &
727 &
"(4x,'FLOWS WILL BE SAVED TO FILE: ',a,/4x,'OPENED ON UNIT: ',I7)"
728 character(len=*),
parameter :: fmtflow2 = &
729 &
"(4x,'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL')"
730 character(len=*),
parameter :: fmtssessv = &
731 &
"(4x,'USING SSE AND SSV INSTEAD OF CR AND CC.')"
732 character(len=*),
parameter :: fmtoffset = &
733 &
"(4x,'INITIAL_STRESS TREATED AS AN OFFSET.')"
734 character(len=*),
parameter :: fmtopt = &
736 character(len=*),
parameter :: fmtopti = &
738 character(len=*),
parameter :: fmtoptr = &
740 character(len=*),
parameter :: fmtfileout = &
741 "(4x,'CSUB ',1x,a,1x,' WILL BE SAVED TO FILE: ',a,/4x,&
742 &'OPENED ON UNIT: ',I7)"
745 write (this%iout,
'(//2(1X,A))') trim(adjustl(this%packName)), &
747 write (this%iout, fmtopti)
'NUMBER OF DELAY CELLS =', &
749 if (this%lhead_based .EQV. .true.)
then
750 write (this%iout,
'(4x,a)') &
751 'HEAD-BASED FORMULATION'
753 write (this%iout,
'(4x,a)') &
754 'EFFECTIVE-STRESS FORMULATION'
756 if (this%istoragec == 0)
then
757 write (this%iout,
'(4x,a,1(/,6x,a))') &
758 'COMPRESSION INDICES WILL BE SPECIFIED INSTEAD OF ELASTIC AND', &
759 'INELASTIC SPECIFIC STORAGE COEFFICIENTS'
761 write (this%iout,
'(4x,a,1(/,6x,a))') &
762 'ELASTIC AND INELASTIC SPECIFIC STORAGE COEFFICIENTS WILL BE ', &
765 if (this%iupdatematprop /= 1)
then
766 write (this%iout,
'(4x,a,1(/,6x,a))') &
767 'THICKNESS AND VOID RATIO WILL NOT BE ADJUSTED DURING THE', &
770 write (this%iout,
'(4x,a)') &
771 'THICKNESS AND VOID RATIO WILL BE ADJUSTED DURING THE SIMULATION'
773 if (this%icellf /= 1)
then
774 write (this%iout,
'(4x,a)') &
775 'INTERBED THICKNESS WILL BE SPECIFIED AS A THICKNESS'
777 write (this%iout,
'(4x,a,1(/,6x,a))') &
778 'INTERBED THICKNESS WILL BE SPECIFIED AS A AS A CELL FRACTION'
780 if (this%ispecified_pcs /= 1)
then
781 if (this%ipch /= 0)
then
782 write (this%iout,
'(4x,a,1(/,6x,a))') &
783 'PRECONSOLIDATION HEAD WILL BE SPECIFIED RELATIVE TO INITIAL', &
786 write (this%iout,
'(4x,a,1(/,6x,a))') &
787 'PRECONSOLIDATION STRESS WILL BE SPECIFIED RELATIVE TO INITIAL', &
791 if (this%ipch /= 0)
then
792 write (this%iout,
'(4x,a,1(/,6x,a))') &
793 'PRECONSOLIDATION HEAD WILL BE SPECIFIED AS ABSOLUTE VALUES', &
794 'INSTEAD OF RELATIVE TO INITIAL HEAD CONDITIONS'
796 write (this%iout,
'(4x,a,1(/,6x,a))') &
797 'PRECONSOLIDATION STRESS WILL BE SPECIFIED AS ABSOLUTE VALUES', &
798 'INSTEAD OF RELATIVE TO INITIAL STRESS CONDITIONS'
801 if (this%ispecified_dbh /= 1)
then
802 write (this%iout,
'(4x,a,1(/,6x,a))') &
803 'DELAY INTERBED HEADS WILL BE SPECIFIED RELATIVE TO INITIAL ', &
806 write (this%iout,
'(4x,a,1(/,6x,a))') &
807 'DELAY INTERBED HEADS WILL BE SPECIFIED AS ABSOLUTE VALUES INSTEAD', &
808 'OF RELATIVE TO INITIAL GWF HEADS'
811 if (this%lhead_based .EQV. .false.)
then
812 if (this%ieslag /= 0)
then
813 write (this%iout,
'(4x,a,1(/,6x,a))') &
814 'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE EFFECTIVE', &
815 'STRESS FROM THE PREVIOUS TIME STEP'
817 write (this%iout,
'(4x,a,1(/,6x,a))') &
818 'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE CURRENT', &
821 if (this%istrict_stress == 0)
then
822 write (this%iout,
'(4x,a,1(/,6x,a))') &
823 'SMALL OR NEGATIVE EFFECTIVE STRESS WILL BE REGULARIZED BY FLOORING', &
824 'THE EFFECTIVE STRESS USED TO CALCULATE THE SPECIFIC STORAGE'
826 write (this%iout,
'(4x,a,1(/,6x,a))') &
827 'SMALL OR NEGATIVE EFFECTIVE STRESS WILL TERMINATE THE SIMULATION', &
828 '(STRICT_EFFECTIVE_STRESS SPECIFIED)'
830 else if (warn_estress_lag)
then
831 write (this%iout,
'(4x,a,2(/,6x,a))') &
832 'EFFECTIVE_STRESS_LAG HAS BEEN SPECIFIED BUT HAS NO EFFECT WHEN', &
833 'USING THE HEAD-BASED FORMULATION (HEAD_BASED HAS BEEN SPECIFIED', &
834 'IN THE OPTIONS BLOCK)'
837 write (this%iout, fmtoptr)
'GAMMAW =', this%gammaw
838 write (this%iout, fmtoptr)
'BETA =', this%beta
839 write (this%iout, fmtoptr)
'GAMMAW * BETA =', this%brg
840 write (this%iout,
'((1X,A))')
'END PACKAGE SETTINGS'
862 call mem_set_value(this%ninterbeds,
'NINTERBEDS', this%input_mempath, &
864 call mem_set_value(this%maxsig0,
'MAXBOUND', this%input_mempath, &
868 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%packName))// &
870 write (this%iout,
'(4x,a,i0)')
'NINTERBEDS = ', this%ninterbeds
871 write (this%iout,
'(4x,a,i0)')
'MAXSIG0 = ', this%maxsig0
872 write (this%iout,
'(1x,a)') &
873 'END OF '//trim(adjustl(this%packName))//
' DIMENSIONS'
876 if (.not. found%ninterbeds)
then
878 'NINTERBEDS is a required dimension.'
885 call this%define_listlabel()
901 call this%NumericalPackageType%allocate_scalars()
908 call mem_allocate(this%istounit,
'ISTOUNIT', this%memoryPath)
909 call mem_allocate(this%inobspkg,
'INOBSPKG', this%memoryPath)
910 call mem_allocate(this%ninterbeds,
'NINTERBEDS', this%memoryPath)
911 call mem_allocate(this%maxsig0,
'MAXSIG0', this%memoryPath)
912 call mem_allocate(this%nbound,
'NBOUND', this%memoryPath)
913 call mem_allocate(this%iscloc,
'ISCLOC', this%memoryPath)
914 call mem_allocate(this%iauxmultcol,
'IAUXMULTCOL', this%memoryPath)
915 call mem_allocate(this%ndelaycells,
'NDELAYCELLS', this%memoryPath)
916 call mem_allocate(this%ndelaybeds,
'NDELAYBEDS', this%memoryPath)
917 call mem_allocate(this%initialized,
'INITIALIZED', this%memoryPath)
918 call mem_allocate(this%ieslag,
'IESLAG', this%memoryPath)
920 call mem_allocate(this%istrict_stress,
'ISTRICT_STRESS', this%memoryPath)
921 call mem_allocate(this%nreg_ts,
'NREG_TS', this%memoryPath)
922 call mem_allocate(this%lhead_based,
'LHEAD_BASED', this%memoryPath)
923 call mem_allocate(this%iupdatestress,
'IUPDATESTRESS', this%memoryPath)
924 call mem_allocate(this%ispecified_pcs,
'ISPECIFIED_PCS', this%memoryPath)
925 call mem_allocate(this%ispecified_dbh,
'ISPECIFIED_DBH', this%memoryPath)
926 call mem_allocate(this%inamedbound,
'INAMEDBOUND', this%memoryPath)
927 call mem_allocate(this%iconvchk,
'ICONVCHK', this%memoryPath)
929 call mem_allocate(this%istoragec,
'ISTORAGEC', this%memoryPath)
930 call mem_allocate(this%istrainib,
'ISTRAINIB', this%memoryPath)
931 call mem_allocate(this%istrainsk,
'ISTRAINSK', this%memoryPath)
932 call mem_allocate(this%ioutcomp,
'IOUTCOMP', this%memoryPath)
933 call mem_allocate(this%ioutcompi,
'IOUTCOMPI', this%memoryPath)
934 call mem_allocate(this%ioutcompe,
'IOUTCOMPE', this%memoryPath)
935 call mem_allocate(this%ioutcompib,
'IOUTCOMPIB', this%memoryPath)
936 call mem_allocate(this%ioutcomps,
'IOUTCOMPS', this%memoryPath)
937 call mem_allocate(this%ioutzdisp,
'IOUTZDISP', this%memoryPath)
938 call mem_allocate(this%ipakcsv,
'IPAKCSV', this%memoryPath)
939 call mem_allocate(this%iupdatematprop,
'IUPDATEMATPROP', this%memoryPath)
940 call mem_allocate(this%epsilon,
'EPSILON', this%memoryPath)
941 call mem_allocate(this%cc_crit,
'CC_CRIT', this%memoryPath)
942 call mem_allocate(this%gammaw,
'GAMMAW', this%memoryPath)
945 call mem_allocate(this%satomega,
'SATOMEGA', this%memoryPath)
946 call mem_allocate(this%pcsomega,
'PCSOMEGA', this%memoryPath)
947 call mem_allocate(this%icellf,
'ICELLF', this%memoryPath)
948 call mem_allocate(this%gwfiss0,
'GWFISS0', this%memoryPath)
961 this%ndelaycells = 19
966 this%istrict_stress = 0
968 this%lhead_based = .false.
969 this%iupdatestress = 1
970 this%ispecified_pcs = 0
971 this%ispecified_dbh = 0
985 this%iupdatematprop = 0
989 this%beta = 4.6512e-10_dp
990 this%brg = this%gammaw * this%beta
992 this%pcsomega =
dzero
995 if (this%inewton /= 0)
then
999 this%satomega =
dzero
1019 integer(I4B) :: iblen
1020 integer(I4B) :: naux
1023 if (this%ioutcomp == 0 .and. this%ioutcompi == 0 .and. &
1024 this%ioutcompe == 0 .and. this%ioutcompib == 0 .and. &
1025 this%ioutcomps == 0 .and. this%ioutzdisp == 0)
then
1026 call mem_allocate(this%buff, 1,
'BUFF', trim(this%memoryPath))
1028 call mem_allocate(this%buff, this%dis%nodes,
'BUFF', trim(this%memoryPath))
1030 if (this%ioutcomp == 0 .and. this%ioutzdisp == 0)
then
1031 call mem_allocate(this%buffusr, 1,
'BUFFUSR', trim(this%memoryPath))
1033 call mem_allocate(this%buffusr, this%dis%nodesuser,
'BUFFUSR', &
1034 trim(this%memoryPath))
1036 call mem_allocate(this%sgm, this%dis%nodes,
'SGM', trim(this%memoryPath))
1037 call mem_allocate(this%sgs, this%dis%nodes,
'SGS', trim(this%memoryPath))
1038 call mem_allocate(this%cg_ske_cr, this%dis%nodes,
'CG_SKE_CR', &
1039 trim(this%memoryPath))
1040 call mem_allocate(this%cg_es, this%dis%nodes,
'CG_ES', &
1041 trim(this%memoryPath))
1042 call mem_allocate(this%cg_es0, this%dis%nodes,
'CG_ES0', &
1043 trim(this%memoryPath))
1044 call mem_allocate(this%cg_pcs, this%dis%nodes,
'CG_PCS', &
1045 trim(this%memoryPath))
1046 call mem_allocate(this%cg_comp, this%dis%nodes,
'CG_COMP', &
1047 trim(this%memoryPath))
1048 call mem_allocate(this%cg_tcomp, this%dis%nodes,
'CG_TCOMP', &
1049 trim(this%memoryPath))
1050 call mem_allocate(this%cg_stor, this%dis%nodes,
'CG_STOR', &
1051 trim(this%memoryPath))
1052 call mem_allocate(this%cg_ske, this%dis%nodes,
'CG_SKE', &
1053 trim(this%memoryPath))
1054 call mem_allocate(this%cg_sk, this%dis%nodes,
'CG_SK', &
1055 trim(this%memoryPath))
1056 call mem_allocate(this%cg_thickini, this%dis%nodes,
'CG_THICKINI', &
1057 trim(this%memoryPath))
1058 call mem_allocate(this%cg_thetaini, this%dis%nodes,
'CG_THETAINI', &
1059 trim(this%memoryPath))
1060 if (this%iupdatematprop == 0)
then
1061 call mem_setptr(this%cg_thick,
'CG_THICKINI', trim(this%memoryPath))
1062 call mem_setptr(this%cg_thick0,
'CG_THICKINI', trim(this%memoryPath))
1063 call mem_setptr(this%cg_theta,
'CG_THETAINI', trim(this%memoryPath))
1064 call mem_setptr(this%cg_theta0,
'CG_THETAINI', trim(this%memoryPath))
1066 call mem_allocate(this%cg_thick, this%dis%nodes,
'CG_THICK', &
1067 trim(this%memoryPath))
1068 call mem_allocate(this%cg_thick0, this%dis%nodes,
'CG_THICK0', &
1069 trim(this%memoryPath))
1070 call mem_allocate(this%cg_theta, this%dis%nodes,
'CG_THETA', &
1071 trim(this%memoryPath))
1072 call mem_allocate(this%cg_theta0, this%dis%nodes,
'CG_THETA0', &
1073 trim(this%memoryPath))
1077 call mem_allocate(this%cell_wcstor, this%dis%nodes,
'CELL_WCSTOR', &
1078 trim(this%memoryPath))
1079 call mem_allocate(this%cell_thick, this%dis%nodes,
'CELL_THICK', &
1080 trim(this%memoryPath))
1084 if (this%ninterbeds > 0)
then
1085 iblen = this%ninterbeds
1088 if (this%naux > 0)
then
1091 call mem_allocate(this%auxvar, naux, iblen,
'AUXVAR', this%memoryPath)
1094 this%auxvar(j, n) =
dzero
1097 call mem_allocate(this%unodelist, iblen,
'UNODELIST', trim(this%memoryPath))
1098 call mem_allocate(this%nodelist, iblen,
'NODELIST', trim(this%memoryPath))
1099 call mem_allocate(this%cg_gs, this%dis%nodes,
'CG_GS', trim(this%memoryPath))
1100 call mem_allocate(this%pcs, iblen,
'PCS', trim(this%memoryPath))
1101 call mem_allocate(this%rnb, iblen,
'RNB', trim(this%memoryPath))
1102 call mem_allocate(this%kv, iblen,
'KV', trim(this%memoryPath))
1103 call mem_allocate(this%h0, iblen,
'H0', trim(this%memoryPath))
1104 call mem_allocate(this%ci, iblen,
'CI', trim(this%memoryPath))
1105 call mem_allocate(this%rci, iblen,
'RCI', trim(this%memoryPath))
1106 call mem_allocate(this%idelay, iblen,
'IDELAY', trim(this%memoryPath))
1107 call mem_allocate(this%ielastic, iblen,
'IELASTIC', trim(this%memoryPath))
1108 call mem_allocate(this%iconvert, iblen,
'ICONVERT', trim(this%memoryPath))
1109 call mem_allocate(this%comp, iblen,
'COMP', trim(this%memoryPath))
1110 call mem_allocate(this%tcomp, iblen,
'TCOMP', trim(this%memoryPath))
1111 call mem_allocate(this%tcompi, iblen,
'TCOMPI', trim(this%memoryPath))
1112 call mem_allocate(this%tcompe, iblen,
'TCOMPE', trim(this%memoryPath))
1113 call mem_allocate(this%storagee, iblen,
'STORAGEE', trim(this%memoryPath))
1114 call mem_allocate(this%storagei, iblen,
'STORAGEI', trim(this%memoryPath))
1115 call mem_allocate(this%ske, iblen,
'SKE', trim(this%memoryPath))
1116 call mem_allocate(this%sk, iblen,
'SK', trim(this%memoryPath))
1117 call mem_allocate(this%thickini, iblen,
'THICKINI', trim(this%memoryPath))
1118 call mem_allocate(this%thetaini, iblen,
'THETAINI', trim(this%memoryPath))
1119 if (this%iupdatematprop == 0)
then
1120 call mem_setptr(this%thick,
'THICKINI', trim(this%memoryPath))
1121 call mem_setptr(this%thick0,
'THICKINI', trim(this%memoryPath))
1122 call mem_setptr(this%theta,
'THETAINI', trim(this%memoryPath))
1123 call mem_setptr(this%theta0,
'THETAINI', trim(this%memoryPath))
1125 call mem_allocate(this%thick, iblen,
'THICK', trim(this%memoryPath))
1126 call mem_allocate(this%thick0, iblen,
'THICK0', trim(this%memoryPath))
1127 call mem_allocate(this%theta, iblen,
'THETA', trim(this%memoryPath))
1128 call mem_allocate(this%theta0, iblen,
'THETA0', trim(this%memoryPath))
1135 if (this%inamedbound /= 0)
then
1137 'BOUNDNAME', trim(this%memoryPath))
1140 'BOUNDNAME', trim(this%memoryPath))
1145 call mem_allocate(this%nodelistsig0, this%maxsig0,
'NODELISTSIG0', &
1149 call mem_setptr(this%sig0,
'SIG0', this%input_mempath)
1150 call mem_checkin(this%sig0,
'SIG0', this%memoryPath, &
1151 'SIG0', this%input_mempath)
1154 call mem_setptr(this%gwfiss,
'ISS', trim(this%name_model))
1157 call mem_setptr(this%stoiconv,
'ICONVERT', this%stoMemPath)
1158 call mem_setptr(this%stoss,
'SS', this%stoMemPath)
1161 do n = 1, this%dis%nodes
1162 this%cg_gs(n) =
dzero
1163 this%cg_es(n) =
dzero
1164 this%cg_comp(n) =
dzero
1165 this%cg_tcomp(n) =
dzero
1166 this%cell_wcstor(n) =
dzero
1168 do n = 1, this%ninterbeds
1169 this%theta(n) =
dzero
1170 this%tcomp(n) =
dzero
1171 this%tcompi(n) =
dzero
1172 this%tcompe(n) =
dzero
1174 do n = 1, this%maxsig0
1175 this%nodelistsig0(n) = 0
1188 integer(I4B) :: node
1190 integer(I4B),
dimension(:),
pointer,
contiguous :: map
1194 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1197 call mem_set_value(this%cg_ske_cr,
'CG_SKE_CR', this%input_mempath, &
1198 map, found%cg_ske_cr)
1199 call mem_set_value(this%cg_thetaini,
'CG_THETA', this%input_mempath, &
1200 map, found%cg_theta)
1201 call mem_set_value(this%sgm,
'SGM', this%input_mempath, map, found%sgm)
1202 call mem_set_value(this%sgs,
'SGS', this%input_mempath, map, found%sgs)
1205 if (.not. found%cg_ske_cr)
then
1206 call store_error(
'CG_SKE GRIDDATA must be specified.')
1209 if (.not. found%cg_theta)
then
1210 call store_error(
'CG_THETA GRIDDATA must be specified.')
1215 if (.not. found%sgm)
then
1216 do node = 1, this%dis%nodes
1217 this%sgm(node) = 1.7d0
1220 if (.not. found%sgs)
then
1221 do node = 1, this%dis%nodes
1222 this%sgs(node) = 2.0d0
1240 integer(I4B),
dimension(:),
pointer,
contiguous :: icsubno
1241 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid_pkgdata
1242 integer(I4B),
dimension(:),
pointer :: cellid
1244 contiguous :: cdelay
1246 contiguous :: boundname
1247 real(DP),
dimension(:),
pointer,
contiguous :: pcs, thick_frac, rnb
1248 real(DP),
dimension(:),
pointer,
contiguous :: ssv_cc, sse_cr, theta, kv, h0
1249 character(len=LINELENGTH) :: cdelaystr
1250 character(len=LENBOUNDNAME) :: bndname
1251 character(len=20) :: cellidstr
1252 real(DP) :: top, botm, baq, q, thick, rval
1253 integer(I4B) :: idelay, ndelaybeds, csubno
1254 integer(I4B) :: ib, n, nodeu, noder
1257 call mem_setptr(icsubno,
'ICSUBNO', this%input_mempath)
1258 call mem_setptr(cellid_pkgdata,
'CELLID_PKGDATA', this%input_mempath)
1259 call mem_setptr(cdelay,
'CDELAY', this%input_mempath)
1260 call mem_setptr(pcs,
'PCS0', this%input_mempath)
1261 call mem_setptr(thick_frac,
'THICK_FRAC', this%input_mempath)
1262 call mem_setptr(rnb,
'RNB', this%input_mempath)
1263 call mem_setptr(ssv_cc,
'SSV_CC', this%input_mempath)
1264 call mem_setptr(sse_cr,
'SSE_CR', this%input_mempath)
1265 call mem_setptr(theta,
'THETA', this%input_mempath)
1266 call mem_setptr(kv,
'KV', this%input_mempath)
1267 call mem_setptr(h0,
'H0', this%input_mempath)
1268 call mem_setptr(boundname,
'BOUNDNAME', this%input_mempath)
1274 do n = 1,
size(icsubno)
1280 if (csubno < 1 .or. csubno > this%ninterbeds)
then
1281 write (
errmsg,
'(a,1x,i0,2(1x,a),1x,i0,a)') &
1282 'Interbed number (', csubno,
') must be greater than 0 and ', &
1283 'less than or equal to', this%ninterbeds,
'.'
1289 cellid => cellid_pkgdata(:, n)
1292 if (this%dis%ndim == 1)
then
1294 elseif (this%dis%ndim == 2)
then
1295 nodeu =
get_node(cellid(1), 1, cellid(2), &
1296 this%dis%mshape(1), 1, &
1299 nodeu =
get_node(cellid(1), cellid(2), cellid(3), &
1300 this%dis%mshape(1), &
1301 this%dis%mshape(2), &
1306 noder = this%dis%get_nodenumber(nodeu, 1)
1307 if (noder <= 0)
then
1308 call this%dis%nodeu_to_string(nodeu, cellidstr)
1310 'CSUB configured for inactive cell: '// &
1311 trim(adjustl(cellidstr))//
'.'
1317 this%nodelist(csubno) = noder
1318 this%unodelist(csubno) = nodeu
1321 top = this%dis%top(noder)
1322 botm = this%dis%bot(noder)
1326 cdelaystr = cdelay(n)
1327 select case (cdelaystr)
1331 ndelaybeds = ndelaybeds + 1
1334 write (
errmsg,
'(a,1x,a,1x,i0,1x,a)') &
1335 'Invalid CDELAY ', trim(adjustl(cdelaystr)), &
1336 'for packagedata entry', csubno,
'.'
1340 this%idelay(csubno) = idelay
1343 this%pcs(csubno) = pcs(n)
1346 if (this%icellf == 0)
then
1347 if (thick_frac(n) <
dzero .or. thick_frac(n) > baq)
then
1348 write (
errmsg,
'(a,g0,2(a,1x),g0,1x,a,1x,i0,a)') &
1349 'THICK (', thick_frac(n),
') MUST BE greater than or equal to 0 ', &
1350 'and less than or equal to than', baq, &
1351 'for packagedata entry', csubno,
'.'
1354 thick = thick_frac(n)
1356 if (thick_frac(n) <
dzero .or. thick_frac(n) >
done)
then
1357 write (
errmsg,
'(a,1x,a,1x,i0,a)') &
1358 'FRAC MUST BE greater than 0 and less than or equal to 1', &
1359 'for packagedata entry', csubno,
'.'
1362 thick = thick_frac(n) * baq
1364 this%thickini(csubno) = thick
1365 if (this%iupdatematprop /= 0)
then
1366 this%thick(csubno) = thick
1370 if (idelay > 0)
then
1371 if (rnb(n) <
done)
then
1372 write (
errmsg,
'(a,g0,a,1x,a,1x,i0,a)') &
1373 'RNB (', rnb(n),
') must be greater than or equal to 1', &
1374 'for packagedata entry', csubno,
'.'
1377 this%rnb(csubno) = rnb(n)
1379 this%rnb(csubno) =
done
1383 if (ssv_cc(n) <
dzero)
then
1384 write (
errmsg,
'(2(a,1x),i0,a)') &
1385 '(SKV,CI) must be greater than or equal to 0', &
1386 'for packagedata entry', csubno,
'.'
1389 this%ci(csubno) = ssv_cc(n)
1392 if (sse_cr(n) <
dzero)
then
1393 write (
errmsg,
'(2(a,1x),i0,a)') &
1394 '(SKE,RCI) must be greater than or equal to 0', &
1395 'for packagedata entry', csubno,
'.'
1398 this%rci(csubno) = sse_cr(n)
1401 if (this%ci(csubno) == this%rci(csubno))
then
1402 this%ielastic(csubno) = 1
1404 this%ielastic(csubno) = 0
1408 if (theta(n) <=
dzero .or. theta(n) >
done)
then
1409 write (
errmsg,
'(a,1x,a,1x,i0,a)') &
1410 'THETA must be greater than 0 and less than or equal to 1', &
1411 'for packagedata entry', csubno,
'.'
1414 this%thetaini(csubno) = theta(n)
1415 if (this%iupdatematprop /= 0)
then
1416 this%theta(csubno) = theta(n)
1420 if (idelay > 0)
then
1421 if (kv(n) <= 0.0)
then
1422 write (
errmsg,
'(a,1x,i0,a)') &
1423 'KV must be greater than 0 for packagedata entry', csubno,
'.'
1427 this%kv(csubno) = kv(n)
1430 this%h0(csubno) = h0(n)
1433 if (this%inamedbound /= 0)
then
1434 bndname = boundname(n)
1435 if (len_trim(bndname) < 1)
then
1436 write (
errmsg,
'(a,1x,i0,a)') &
1437 'BOUNDNAME must be specified for packagedata entry', csubno,
'.'
1440 this%boundname(csubno) = bndname
1446 this%ndelaybeds = ndelaybeds
1449 if (ndelaybeds > 0)
then
1453 'IDB_NCONV_COUNT', trim(this%memoryPath))
1454 call mem_allocate(this%idbconvert, this%ndelaycells, ndelaybeds, &
1455 'IDBCONVERT', trim(this%memoryPath))
1457 'DBDHMAX', trim(this%memoryPath))
1458 call mem_allocate(this%dbz, this%ndelaycells, ndelaybeds, &
1459 'DBZ', trim(this%memoryPath))
1460 call mem_allocate(this%dbrelz, this%ndelaycells, ndelaybeds, &
1461 'DBRELZ', trim(this%memoryPath))
1462 call mem_allocate(this%dbh, this%ndelaycells, ndelaybeds, &
1463 'DBH', trim(this%memoryPath))
1464 call mem_allocate(this%dbh0, this%ndelaycells, ndelaybeds, &
1465 'DBH0', trim(this%memoryPath))
1466 call mem_allocate(this%dbgeo, this%ndelaycells, ndelaybeds, &
1467 'DBGEO', trim(this%memoryPath))
1468 call mem_allocate(this%dbes, this%ndelaycells, ndelaybeds, &
1469 'DBES', trim(this%memoryPath))
1470 call mem_allocate(this%dbes0, this%ndelaycells, ndelaybeds, &
1471 'DBES0', trim(this%memoryPath))
1472 call mem_allocate(this%dbpcs, this%ndelaycells, ndelaybeds, &
1473 'DBPCS', trim(this%memoryPath))
1475 'DBFLOWTOP', trim(this%memoryPath))
1477 'DBFLOWBOT', trim(this%memoryPath))
1478 call mem_allocate(this%dbdzini, this%ndelaycells, ndelaybeds, &
1479 'DBDZINI', trim(this%memoryPath))
1480 call mem_allocate(this%dbthetaini, this%ndelaycells, ndelaybeds, &
1481 'DBTHETAINI', trim(this%memoryPath))
1482 call mem_allocate(this%dbcomp, this%ndelaycells, ndelaybeds, &
1483 'DBCOMP', trim(this%memoryPath))
1484 call mem_allocate(this%dbtcomp, this%ndelaycells, ndelaybeds, &
1485 'DBTCOMP', trim(this%memoryPath))
1488 if (this%iupdatematprop == 0)
then
1489 call mem_setptr(this%dbdz,
'DBDZINI', trim(this%memoryPath))
1490 call mem_setptr(this%dbdz0,
'DBDZINI', trim(this%memoryPath))
1491 call mem_setptr(this%dbtheta,
'DBTHETAINI', trim(this%memoryPath))
1492 call mem_setptr(this%dbtheta0,
'DBTHETAINI', trim(this%memoryPath))
1494 call mem_allocate(this%dbdz, this%ndelaycells, ndelaybeds, &
1495 'DBDZ', trim(this%memoryPath))
1496 call mem_allocate(this%dbdz0, this%ndelaycells, ndelaybeds, &
1497 'DBDZ0', trim(this%memoryPath))
1498 call mem_allocate(this%dbtheta, this%ndelaycells, ndelaybeds, &
1499 'DBTHETA', trim(this%memoryPath))
1500 call mem_allocate(this%dbtheta0, this%ndelaycells, ndelaybeds, &
1501 'DBTHETA0', trim(this%memoryPath))
1506 'DBAL', trim(this%memoryPath))
1508 'DBAD', trim(this%memoryPath))
1510 'DBAU', trim(this%memoryPath))
1512 'DBRHS', trim(this%memoryPath))
1514 'DBDH', trim(this%memoryPath))
1516 'DBAW', trim(this%memoryPath))
1520 this%idb_nconv_count(n) = 0
1524 do ib = 1, this%ninterbeds
1525 idelay = this%idelay(ib)
1526 if (idelay == 0)
then
1531 do n = 1, this%ndelaycells
1532 rval = this%thickini(ib) / real(this%ndelaycells, dp)
1533 this%dbdzini(n, idelay) = rval
1534 this%dbh(n, idelay) = this%h0(ib)
1535 this%dbh0(n, idelay) = this%h0(ib)
1536 this%dbthetaini(n, idelay) = this%thetaini(ib)
1537 this%dbgeo(n, idelay) =
dzero
1538 this%dbes(n, idelay) =
dzero
1539 this%dbes0(n, idelay) =
dzero
1540 this%dbpcs(n, idelay) = this%pcs(ib)
1541 this%dbcomp(n, idelay) =
dzero
1542 this%dbtcomp(n, idelay) =
dzero
1543 if (this%iupdatematprop /= 0)
then
1544 this%dbdz(n, idelay) = this%dbdzini(n, idelay)
1545 this%dbdz0(n, idelay) = this%dbdzini(n, idelay)
1546 this%dbtheta(n, idelay) = this%theta(ib)
1547 this%dbtheta0(n, idelay) = this%theta(ib)
1552 call this%csub_delay_init_zcell(ib)
1556 do n = 1, this%ndelaycells
1557 this%dbal(n) =
dzero
1558 this%dbad(n) =
dzero
1559 this%dbau(n) =
dzero
1560 this%dbrhs(n) =
dzero
1561 this%dbdh(n) =
dzero
1562 this%dbaw(n) =
dzero
1568 if (ndelaybeds > 0)
then
1569 q = mod(real(this%ndelaycells, dp),
dtwo)
1570 if (q ==
dzero)
then
1571 write (
errmsg,
'(a,i0,a,1x,a)') &
1572 'NDELAYCELLS (', this%ndelaycells,
') must be an', &
1573 'odd number when using the effective stress formulation.'
1578 if (this%iprpak /= 0)
then
1579 call this%csub_print_packagedata()
1606 character(len=LINELENGTH) :: title
1607 character(len=LINELENGTH) :: tag
1608 character(len=10) :: ctype
1609 character(len=20) :: cellid
1610 integer(I4B) :: ntabrows
1611 integer(I4B) :: ntabcols
1613 integer(I4b) :: idelay
1614 integer(I4B) :: node
1617 title =
'CSUB'//
' PACKAGE ('// &
1618 trim(adjustl(this%packName))//
') INTERBED DATA'
1621 ntabrows = this%ninterbeds
1623 if (this%inamedbound /= 0)
then
1624 ntabcols = ntabcols + 1
1628 call table_cr(this%inputtab, this%packName, title)
1629 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
1634 tag =
'INTERBED NUMBER'
1635 call this%inputtab%initialize_column(tag, 10, alignment=
tabcenter)
1637 call this%inputtab%initialize_column(tag, 20, alignment=
tableft)
1638 tag =
'INTERBED TYPE'
1639 call this%inputtab%initialize_column(tag, 10, alignment=
tabcenter)
1641 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1643 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1645 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1646 tag =
'INTERBED THICKNESS'
1647 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1648 tag =
'CELL THICKNESS'
1649 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1651 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1653 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1655 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1657 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1659 call this%inputtab%initialize_column(tag, 12, alignment=
tabcenter)
1660 if (this%inamedbound /= 0)
then
1662 call this%inputtab%initialize_column(tag, 40, alignment=
tableft)
1665 do ib = 1, this%ninterbeds
1666 idelay = this%idelay(ib)
1667 node = this%nodelist(ib)
1668 call this%dis%noder_to_string(node, cellid)
1669 if (idelay == 0)
then
1676 call this%inputtab%add_term(ib)
1677 call this%inputtab%add_term(cellid)
1678 call this%inputtab%add_term(ctype)
1679 call this%inputtab%add_term(this%pcs(ib))
1680 call this%inputtab%add_term(this%thickini(ib))
1681 call this%inputtab%add_term(this%rnb(ib))
1682 call this%inputtab%add_term(this%thickini(ib) * this%rnb(ib))
1683 call this%inputtab%add_term(this%dis%top(node) - this%dis%bot(node))
1684 call this%inputtab%add_term(this%ci(ib))
1685 call this%inputtab%add_term(this%rci(ib))
1686 call this%inputtab%add_term(this%theta(ib))
1687 if (idelay == 0)
then
1688 call this%inputtab%add_term(
"--")
1689 call this%inputtab%add_term(
"--")
1691 call this%inputtab%add_term(this%kv(ib))
1692 call this%inputtab%add_term(this%h0(ib))
1694 if (this%inamedbound /= 0)
then
1695 call this%inputtab%add_term(this%boundname(ib))
1712 character(len=LINELENGTH) :: title
1713 character(len=LINELENGTH) :: tag
1714 character(len=LINELENGTH) :: msg
1715 character(len=10) :: ctype
1716 character(len=20) :: cellid
1717 character(len=10) :: cflag
1722 integer(I4B) :: node
1724 integer(I4B) :: idelay
1725 integer(I4B) :: iexceed
1726 integer(I4B),
parameter :: ncells = 20
1727 integer(I4B) :: nlen
1728 integer(I4B) :: ntabrows
1729 integer(I4B) :: ntabcols
1730 integer(I4B) :: ipos
1735 integer(I4B),
dimension(:),
allocatable :: imap_sel
1736 integer(I4B),
dimension(:),
allocatable :: locs
1737 real(DP),
dimension(:),
allocatable :: pctcomp_arr
1740 allocate (locs(this%dis%ndim))
1743 if (this%ninterbeds > 0)
then
1744 nlen = min(ncells, this%ninterbeds)
1745 allocate (imap_sel(nlen))
1746 allocate (pctcomp_arr(this%ninterbeds))
1748 do ib = 1, this%ninterbeds
1749 idelay = this%idelay(ib)
1750 b0 = this%thickini(ib)
1751 strain = this%tcomp(ib) / b0
1753 pctcomp_arr(ib) = pctcomp
1754 if (pctcomp >=
done)
then
1755 iexceed = iexceed + 1
1758 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
1761 i0 = max(1, this%ninterbeds - ncells + 1)
1762 i1 = this%ninterbeds
1764 if (iexceed /= 0)
then
1765 write (msg,
'(1x,a,1x,i0,1x,a,1x,i0,1x,a)') &
1766 'LARGEST', (i1 - i0 + 1),
'OF', this%ninterbeds, &
1767 'INTERBED STRAIN VALUES SHOWN'
1772 title = trim(adjustl(this%packName))//
' PACKAGE INTERBED STRAIN SUMMARY'
1779 call table_cr(this%outputtab, this%packName, title)
1780 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
1783 tag =
'INTERBED NUMBER'
1784 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1785 tag =
'INTERBED TYPE'
1786 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1788 call this%outputtab%initialize_column(tag, 20, alignment=
tableft)
1789 tag =
'INITIAL THICKNESS'
1790 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1791 tag =
'FINAL THICKNESS'
1792 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1793 tag =
'TOTAL COMPACTION'
1794 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1795 tag =
'FINAL STRAIN'
1796 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1797 tag =
'PERCENT COMPACTION'
1798 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1800 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1805 idelay = this%idelay(ib)
1806 b0 = this%thickini(ib)
1807 b1 = this%csub_calc_interbed_thickness(ib)
1808 if (idelay == 0)
then
1812 b0 = b0 * this%rnb(ib)
1814 strain = this%tcomp(ib) / b0
1816 if (pctcomp >= 5.0_dp)
then
1818 else if (pctcomp >=
done)
then
1823 node = this%nodelist(ib)
1824 call this%dis%noder_to_string(node, cellid)
1827 call this%outputtab%add_term(ib)
1828 call this%outputtab%add_term(ctype)
1829 call this%outputtab%add_term(cellid)
1830 call this%outputtab%add_term(b0)
1831 call this%outputtab%add_term(b1)
1832 call this%outputtab%add_term(this%tcomp(ib))
1833 call this%outputtab%add_term(strain)
1834 call this%outputtab%add_term(pctcomp)
1835 call this%outputtab%add_term(cflag)
1837 write (this%iout,
'(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
1838 'PERCENT COMPACTION IS GREATER THAN OR EQUAL TO 1 PERCENT IN', &
1839 iexceed,
'OF', this%ninterbeds,
'INTERBED(S).', &
1840 'USE THE STRAIN_CSV_INTERBED OPTION TO OUTPUT A CSV '// &
1841 'FILE WITH PERCENT COMPACTION ',
'VALUES FOR ALL INTERBEDS.'
1843 msg =
'PERCENT COMPACTION WAS LESS THAN 1 PERCENT IN ALL INTERBEDS'
1844 write (this%iout,
'(/1X,A)') trim(adjustl(msg))
1848 if (this%istrainib /= 0)
then
1851 ntabrows = this%ninterbeds
1853 if (this%dis%ndim > 1)
then
1854 ntabcols = ntabcols + 1
1856 ntabcols = ntabcols + this%dis%ndim
1859 call table_cr(this%outputtab, this%packName,
'')
1860 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainib, &
1861 lineseparator=.false., separator=
',')
1864 tag =
'INTERBED_NUMBER'
1865 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1866 tag =
'INTERBED_TYPE'
1867 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1869 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1870 if (this%dis%ndim == 2)
then
1872 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1874 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1877 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1879 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1881 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
1883 tag =
'INITIAL_THICKNESS'
1884 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1885 tag =
'FINAL_THICKNESS'
1886 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1887 tag =
'TOTAL_COMPACTION'
1888 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1889 tag =
'TOTAL_STRAIN'
1890 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1891 tag =
'PERCENT_COMPACTION'
1892 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
1895 do ib = 1, this%ninterbeds
1896 idelay = this%idelay(ib)
1897 b0 = this%thickini(ib)
1898 b1 = this%csub_calc_interbed_thickness(ib)
1899 if (idelay == 0)
then
1903 b0 = b0 * this%rnb(ib)
1905 strain = this%tcomp(ib) / b0
1907 node = this%nodelist(ib)
1908 call this%dis%noder_to_array(node, locs)
1911 call this%outputtab%add_term(ib)
1912 call this%outputtab%add_term(ctype)
1913 if (this%dis%ndim > 1)
then
1914 call this%outputtab%add_term(this%dis%get_nodeuser(node))
1916 do ipos = 1, this%dis%ndim
1917 call this%outputtab%add_term(locs(ipos))
1919 call this%outputtab%add_term(b0)
1920 call this%outputtab%add_term(b1)
1921 call this%outputtab%add_term(this%tcomp(ib))
1922 call this%outputtab%add_term(strain)
1923 call this%outputtab%add_term(pctcomp)
1928 deallocate (imap_sel)
1929 deallocate (pctcomp_arr)
1933 nlen = min(ncells, this%dis%nodes)
1934 allocate (imap_sel(nlen))
1935 allocate (pctcomp_arr(this%dis%nodes))
1937 do node = 1, this%dis%nodes
1939 if (this%cg_thickini(node) >
dzero)
then
1940 strain = this%cg_tcomp(node) / this%cg_thickini(node)
1943 pctcomp_arr(node) = pctcomp
1944 if (pctcomp >=
done)
then
1945 iexceed = iexceed + 1
1948 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
1951 i0 = max(1, this%dis%nodes - ncells + 1)
1954 if (iexceed /= 0)
then
1955 write (msg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
1956 'LARGEST ', (i1 - i0 + 1),
'OF', this%dis%nodes, &
1957 'CELL COARSE-GRAINED VALUES SHOWN'
1961 title = trim(adjustl(this%packName))// &
1962 ' PACKAGE COARSE-GRAINED STRAIN SUMMARY'
1969 call table_cr(this%outputtab, this%packName, title)
1970 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
1974 call this%outputtab%initialize_column(tag, 20, alignment=
tableft)
1975 tag =
'INITIAL THICKNESS'
1976 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1977 tag =
'FINAL THICKNESS'
1978 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1979 tag =
'TOTAL COMPACTION'
1980 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1981 tag =
'FINAL STRAIN'
1982 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1983 tag =
'PERCENT COMPACTION'
1984 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1986 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1990 if (this%cg_thickini(node) >
dzero)
then
1991 strain = this%cg_tcomp(node) / this%cg_thickini(node)
1996 if (pctcomp >= 5.0_dp)
then
1998 else if (pctcomp >=
done)
then
2003 call this%dis%noder_to_string(node, cellid)
2006 call this%outputtab%add_term(cellid)
2007 call this%outputtab%add_term(this%cg_thickini(node))
2008 call this%outputtab%add_term(this%cg_thick(node))
2009 call this%outputtab%add_term(this%cg_tcomp(node))
2010 call this%outputtab%add_term(strain)
2011 call this%outputtab%add_term(pctcomp)
2012 call this%outputtab%add_term(cflag)
2014 write (this%iout,
'(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
2015 'COARSE-GRAINED STORAGE PERCENT COMPACTION IS GREATER THAN OR '// &
2016 'EQUAL TO 1 PERCENT IN', iexceed,
'OF', this%dis%nodes,
'CELL(S).', &
2017 'USE THE STRAIN_CSV_COARSE OPTION TO OUTPUT A CSV '// &
2018 'FILE WITH PERCENT COMPACTION ',
'VALUES FOR ALL CELLS.'
2020 msg =
'COARSE-GRAINED STORAGE PERCENT COMPACTION WAS LESS THAN '// &
2021 '1 PERCENT IN ALL CELLS '
2022 write (this%iout,
'(/1X,A)') trim(adjustl(msg))
2026 if (this%istrainsk /= 0)
then
2029 ntabrows = this%dis%nodes
2031 if (this%dis%ndim > 1)
then
2032 ntabcols = ntabcols + 1
2034 ntabcols = ntabcols + this%dis%ndim
2037 call table_cr(this%outputtab, this%packName,
'')
2038 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainsk, &
2039 lineseparator=.false., separator=
',')
2043 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2044 if (this%dis%ndim == 2)
then
2046 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2048 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2051 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2053 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2055 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2057 tag =
'INITIAL_THICKNESS'
2058 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2059 tag =
'FINAL_THICKNESS'
2060 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2061 tag =
'TOTAL_COMPACTION'
2062 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2063 tag =
'TOTAL_STRAIN'
2064 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2065 tag =
'PERCENT_COMPACTION'
2066 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2069 do node = 1, this%dis%nodes
2070 if (this%cg_thickini(node) >
dzero)
then
2071 strain = this%cg_tcomp(node) / this%cg_thickini(node)
2076 call this%dis%noder_to_array(node, locs)
2079 if (this%dis%ndim > 1)
then
2080 call this%outputtab%add_term(this%dis%get_nodeuser(node))
2082 do ipos = 1, this%dis%ndim
2083 call this%outputtab%add_term(locs(ipos))
2085 call this%outputtab%add_term(this%cg_thickini(node))
2086 call this%outputtab%add_term(this%cg_thick(node))
2087 call this%outputtab%add_term(this%cg_tcomp(node))
2088 call this%outputtab%add_term(strain)
2089 call this%outputtab%add_term(pctcomp)
2095 if (this%ndelaybeds > 0)
then
2096 if (this%idb_nconv_count(2) > 0)
then
2097 write (
warnmsg,
'(a,1x,a,1x,i0,1x,a,1x,a)') &
2098 'Delay interbed cell heads were less than the top of the interbed', &
2099 'cell in', this%idb_nconv_count(2),
'interbed cells in ', &
2100 'non-convertible GWF cells for at least one time step during '// &
2107 deallocate (imap_sel)
2109 deallocate (pctcomp_arr)
2124 if (this%nreg_ts > 0)
then
2125 write (
warnmsg,
'(a,1x,i0,1x,3a)') &
2126 'CSUB negative effective stress was regularized in', this%nreg_ts, &
2127 'time step(s); see the model listing file for the number of cells ', &
2128 'regularized in each time step. This typically occurs in uppermost ', &
2129 'cells where simulated water levels rise above land surface.'
2134 if (this%inunit > 0)
then
2156 if (this%iupdatematprop == 0)
then
2157 nullify (this%cg_thick)
2158 nullify (this%cg_thick0)
2159 nullify (this%cg_theta)
2160 nullify (this%cg_theta0)
2175 call mem_deallocate(this%boundname,
'BOUNDNAME', this%memoryPath)
2192 if (this%iupdatematprop == 0)
then
2193 nullify (this%thick)
2194 nullify (this%thick0)
2195 nullify (this%theta)
2196 nullify (this%theta0)
2207 if (this%ndelaybeds > 0)
then
2208 if (this%iupdatematprop == 0)
then
2210 nullify (this%dbdz0)
2211 nullify (this%dbtheta)
2212 nullify (this%dbtheta0)
2251 nullify (this%gwfiss)
2254 nullify (this%stoiconv)
2255 nullify (this%stoss)
2258 if (this%iprpak > 0)
then
2259 call this%inputtab%table_da()
2260 deallocate (this%inputtab)
2261 nullify (this%inputtab)
2265 if (
associated(this%outputtab))
then
2266 call this%outputtab%table_da()
2267 deallocate (this%outputtab)
2268 nullify (this%outputtab)
2273 if (this%ipakcsv > 0)
then
2274 call this%pakcsvtab%table_da()
2275 deallocate (this%pakcsvtab)
2276 nullify (this%pakcsvtab)
2280 call mem_deallocate(this%listlabel,
'LISTLABEL', this%memoryPath)
2327 if (this%inunit > 0)
then
2328 call this%obs%obs_da()
2331 deallocate (this%obs)
2337 call this%NumericalPackageType%da()
2356 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellids
2357 integer(I4B),
dimension(:),
pointer,
contiguous :: cellid
2358 integer(I4B),
pointer :: iper
2359 integer(I4B) :: n, nodeu, noder
2360 character(len=LINELENGTH) :: title, text
2361 character(len=20) :: cellstr
2362 logical(LGP) :: found
2364 character(len=*),
parameter :: fmtlsp = &
2365 &
"(1X,/1X,'REUSING ',a,'S FROM LAST STRESS PERIOD')"
2367 call mem_setptr(iper,
'IPER', this%input_mempath)
2368 if (iper /=
kper)
then
2369 write (this%iout, fmtlsp) trim(this%filtyp)
2370 call this%csub_rp_obs()
2374 call mem_setptr(cellids,
'CELLID', this%input_mempath)
2375 call mem_set_value(this%nbound,
'NBOUND', this%input_mempath, &
2376 found, release=.false.)
2379 if (this%iprpak /= 0)
then
2381 title =
'CSUB'//
' PACKAGE ('// &
2382 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
2383 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2384 call table_cr(this%inputtab, this%packName, title)
2385 call this%inputtab%table_df(1, 2, this%iout, finalize=.false.)
2387 call this%inputtab%initialize_column(text, 20)
2389 call this%inputtab%initialize_column(text, 15, alignment=tableft)
2393 do n = 1, this%nbound
2396 cellid => cellids(:, n)
2399 if (this%dis%ndim == 1)
then
2401 elseif (this%dis%ndim == 2)
then
2402 nodeu =
get_node(cellid(1), 1, cellid(2), &
2403 this%dis%mshape(1), 1, &
2406 nodeu =
get_node(cellid(1), cellid(2), cellid(3), &
2407 this%dis%mshape(1), &
2408 this%dis%mshape(2), &
2413 noder = this%dis%get_nodenumber(nodeu, 1)
2414 if (noder <= 0)
then
2418 this%nodelistsig0(n) = noder
2421 if (this%iprpak /= 0)
then
2422 call this%dis%noder_to_string(noder, cellstr)
2423 call this%inputtab%add_term(cellstr)
2424 call this%inputtab%add_term(this%sig0(n))
2434 if (this%iprpak /= 0)
then
2435 call this%inputtab%finalize_table()
2439 call this%csub_rp_obs()
2455 integer(I4B),
intent(in) :: nodes
2456 real(DP),
dimension(nodes),
intent(in) :: hnew
2460 integer(I4B) :: idelay
2461 integer(I4B) :: node
2468 if (this%ninterbeds > 0)
then
2470 if (this%gwfiss /= 0)
then
2471 write (
errmsg,
'(a,i0,a,1x,a,1x,a,1x,i0,1x,a)') &
2472 'Only the first and last (',
nper,
')', &
2473 'stress period can be steady if interbeds are simulated.', &
2474 'Stress period',
kper,
'has been defined to be steady state.'
2481 if (this%initialized == 0)
then
2482 if (this%gwfiss == 0)
then
2483 call this%csub_set_initial_state(nodes, hnew)
2491 this%cg_comp(node) =
dzero
2492 this%cg_es0(node) = this%cg_es(node)
2493 if (this%iupdatematprop /= 0)
then
2494 this%cg_thick0(node) = this%cg_thick(node)
2495 this%cg_theta0(node) = this%cg_theta(node)
2500 do ib = 1, this%ninterbeds
2501 idelay = this%idelay(ib)
2504 this%comp(ib) =
dzero
2505 node = this%nodelist(ib)
2506 if (this%initialized /= 0)
then
2507 es = this%cg_es(node)
2513 if (this%iupdatematprop /= 0)
then
2514 this%thick0(ib) = this%thick(ib)
2515 this%theta0(ib) = this%theta(ib)
2519 if (idelay /= 0)
then
2523 if (this%gwfiss0 /= 0)
then
2524 node = this%nodelist(ib)
2526 do n = 1, this%ndelaycells
2527 this%dbh(n, idelay) = h
2533 do n = 1, this%ndelaycells
2535 if (this%initialized /= 0)
then
2536 if (this%dbes(n, idelay) > this%dbpcs(n, idelay))
then
2537 this%dbpcs(n, idelay) = this%dbes(n, idelay)
2540 this%dbh0(n, idelay) = this%dbh(n, idelay)
2541 this%dbes0(n, idelay) = this%dbes(n, idelay)
2542 if (this%iupdatematprop /= 0)
then
2543 this%dbdz0(n, idelay) = this%dbdz(n, idelay)
2544 this%dbtheta0(n, idelay) = this%dbtheta(n, idelay)
2551 this%gwfiss0 = this%gwfiss
2556 call this%obs%obs_ad()
2564 subroutine csub_fc(this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
2569 integer(I4B),
intent(in) :: kiter
2570 real(DP),
intent(in),
dimension(:) :: hold
2571 real(DP),
intent(in),
dimension(:) :: hnew
2573 integer(I4B),
intent(in),
dimension(:) :: idxglo
2574 real(DP),
intent(inout),
dimension(:) :: rhs
2577 integer(I4B) :: node
2578 integer(I4B) :: idiag
2579 integer(I4B) :: idelay
2587 call this%csub_cg_calc_stress(this%dis%nodes, hnew)
2590 if (this%gwfiss == 0)
then
2596 do node = 1, this%dis%nodes
2597 idiag = this%dis%con%ia(node)
2598 area = this%dis%get_area(node)
2601 if (this%ibound(node) < 1) cycle
2604 if (this%iupdatematprop /= 0)
then
2605 if (this%ieslag == 0)
then
2608 call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
2609 this%cg_comp(node) = comp
2612 call this%csub_cg_update(node)
2617 call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
2621 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2622 rhs(node) = rhs(node) + rhsterm
2626 if (this%brg /=
dzero)
then
2627 call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
2632 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2633 rhs(node) = rhs(node) + rhsterm
2638 if (this%ninterbeds /= 0)
then
2642 do ib = 1, this%ninterbeds
2643 node = this%nodelist(ib)
2644 idelay = this%idelay(ib)
2645 idiag = this%dis%con%ia(node)
2646 area = this%dis%get_area(node)
2647 call this%csub_interbed_fc(ib, node, area, hnew(node), hold(node), &
2649 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2650 rhs(node) = rhs(node) + rhsterm
2654 call this%csub_nodelay_wcomp_fc(ib, node, tled, area, &
2655 hnew(node), hold(node), &
2659 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2660 rhs(node) = rhs(node) + rhsterm
2681 subroutine csub_fn(this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
2686 integer(I4B),
intent(in) :: kiter
2687 real(DP),
intent(in),
dimension(:) :: hold
2688 real(DP),
intent(in),
dimension(:) :: hnew
2690 integer(I4B),
intent(in),
dimension(:) :: idxglo
2691 real(DP),
intent(inout),
dimension(:) :: rhs
2693 integer(I4B) :: idelay
2694 integer(I4B) :: node
2695 integer(I4B) :: idiag
2703 if (this%gwfiss == 0)
then
2707 do node = 1, this%dis%nodes
2708 idiag = this%dis%con%ia(node)
2709 area = this%dis%get_area(node)
2712 if (this%ibound(node) < 1) cycle
2715 call this%csub_cg_fn(node, tled, area, &
2716 hnew(node), hcof, rhsterm)
2720 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2721 rhs(node) = rhs(node) + rhsterm
2725 if (this%brg /=
dzero)
then
2726 call this%csub_cg_wcomp_fn(node, tled, area, hnew(node), hold(node), &
2731 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2732 rhs(node) = rhs(node) + rhsterm
2737 if (this%ninterbeds /= 0)
then
2741 do ib = 1, this%ninterbeds
2742 idelay = this%idelay(ib)
2743 node = this%nodelist(ib)
2746 if (this%ibound(node) < 1) cycle
2749 idiag = this%dis%con%ia(node)
2750 area = this%dis%get_area(node)
2751 call this%csub_interbed_fn(ib, node, hnew(node), hold(node), &
2755 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2756 rhs(node) = rhs(node) + rhsterm
2759 if (this%brg /=
dzero .and. idelay == 0)
then
2760 call this%csub_nodelay_wcomp_fn(ib, node, tled, area, &
2761 hnew(node), hold(node), &
2765 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2766 rhs(node) = rhs(node) + rhsterm
2782 character(len=LINELENGTH) :: tag
2783 integer(I4B) :: ntabrows
2784 integer(I4B) :: ntabcols
2786 if (this%ipakcsv > 0)
then
2787 if (this%ndelaybeds < 1)
then
2788 write (
warnmsg,
'(a,1x,3a)') &
2789 'Package convergence data is requested but delay interbeds', &
2790 'are not included in package (', &
2791 trim(adjustl(this%packName)),
').'
2799 call table_cr(this%pakcsvtab, this%packName,
'')
2800 call this%pakcsvtab%table_df(ntabrows, ntabcols, this%ipakcsv, &
2801 lineseparator=.false., separator=
',', &
2805 tag =
'total_inner_iterations'
2806 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2808 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2810 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2812 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2814 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
2816 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
2818 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
2820 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
2821 tag =
'dstoragemax_loc'
2822 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
2840 subroutine csub_cc(this, innertot, kiter, iend, icnvgmod, nodes, &
2841 hnew, hold, cpak, ipak, dpak)
2846 integer(I4B),
intent(in) :: innertot
2847 integer(I4B),
intent(in) :: kiter
2848 integer(I4B),
intent(in) :: iend
2849 integer(I4B),
intent(in) :: icnvgmod
2850 integer(I4B),
intent(in) :: nodes
2851 real(DP),
dimension(nodes),
intent(in) :: hnew
2852 real(DP),
dimension(nodes),
intent(in) :: hold
2853 character(len=LENPAKLOC),
intent(inout) :: cpak
2854 integer(I4B),
intent(inout) :: ipak
2855 real(DP),
intent(inout) :: dpak
2857 character(len=LENPAKLOC) :: cloc
2858 integer(I4B) :: icheck
2859 integer(I4B) :: ipakfail
2861 integer(I4B) :: node
2862 integer(I4B) :: idelay
2863 integer(I4B) :: locdhmax
2864 integer(I4B) :: locrmax
2865 integer(I4B) :: ifirst
2871 real(DP) :: hcellold
2885 icheck = this%iconvchk
2895 if (this%gwfiss /= 0)
then
2898 if (icnvgmod == 0)
then
2904 if (icheck /= 0)
then
2910 final_check:
do ib = 1, this%ninterbeds
2911 idelay = this%idelay(ib)
2912 node = this%nodelist(ib)
2915 if (idelay == 0) cycle
2918 if (this%ibound(node) < 1) cycle
2921 dh = this%dbdhmax(idelay)
2926 area = this%dis%get_area(node)
2928 hcellold = hold(node)
2931 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
2934 call this%csub_delay_calc_dstor(ib, hcell, stoe, stoi)
2935 v1 = (stoe + stoi) * area * this%rnb(ib) * tled
2938 call this%csub_delay_calc_wcomp(ib, dwc)
2939 v1 = v1 + dwc * area * this%rnb(ib)
2942 call this%csub_delay_fc(ib, hcof, rhs)
2943 v2 = (-hcof * hcell - rhs) * area * this%rnb(ib)
2950 df = df *
delt / area
2953 if (ifirst == 1)
then
2960 if (abs(dh) > abs(dhmax))
then
2964 if (abs(df) > abs(rmax))
then
2973 if (abs(dhmax) > abs(dpak))
then
2976 write (cloc,
"(a,'-',a)") trim(this%packName),
'head'
2981 if (abs(rmax) > abs(dpak))
then
2984 write (cloc,
"(a,'-',a)") trim(this%packName),
'storage'
2989 if (this%ipakcsv /= 0)
then
2992 call this%pakcsvtab%add_term(innertot)
2993 call this%pakcsvtab%add_term(
totim)
2994 call this%pakcsvtab%add_term(
kper)
2995 call this%pakcsvtab%add_term(
kstp)
2996 call this%pakcsvtab%add_term(kiter)
2997 if (this%ndelaybeds > 0)
then
2998 call this%pakcsvtab%add_term(dhmax)
2999 call this%pakcsvtab%add_term(locdhmax)
3000 call this%pakcsvtab%add_term(rmax)
3001 call this%pakcsvtab%add_term(locrmax)
3003 call this%pakcsvtab%add_term(
'--')
3004 call this%pakcsvtab%add_term(
'--')
3005 call this%pakcsvtab%add_term(
'--')
3006 call this%pakcsvtab%add_term(
'--')
3011 call this%pakcsvtab%finalize_table()
3026 subroutine csub_cq(this, nodes, hnew, hold, isuppress_output, flowja)
3032 integer(I4B),
intent(in) :: nodes
3033 real(DP),
intent(in),
dimension(nodes) :: hnew
3034 real(DP),
intent(in),
dimension(nodes) :: hold
3035 integer(I4B),
intent(in) :: isuppress_output
3036 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
3039 integer(I4B) :: idelay
3040 integer(I4B) :: ielastic
3041 integer(I4B) :: iconvert
3042 integer(I4B) :: node
3045 integer(I4B) :: idiag
3072 integer(I4B) :: iprobslocal
3082 do node = 1, this%dis%nodes
3083 idiag = this%dis%con%ia(node)
3084 area = this%dis%get_area(node)
3088 if (this%gwfiss == 0)
then
3094 if (this%ibound(node) > 0 .and. this%cg_thickini(node) >
dzero)
then
3097 call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
3099 rrate = hcof * hnew(node) - rhs
3102 call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
3105 call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
3107 rratewc = hcof * hnew(node) - rhs
3113 this%cg_stor(node) = rrate
3114 this%cell_wcstor(node) = rratewc
3115 this%cell_thick(node) = this%cg_thick(node)
3118 this%cg_comp(node) = comp
3122 if (isuppress_output == 0)
then
3126 if (this%iupdatematprop /= 0)
then
3127 call this%csub_cg_update(node)
3131 this%cg_tcomp(node) = this%cg_tcomp(node) + comp
3135 flowja(idiag) = flowja(idiag) + rrate
3136 flowja(idiag) = flowja(idiag) + rratewc
3142 if (this%ndelaybeds > 0)
then
3143 this%idb_nconv_count(1) = 0
3150 do ib = 1, this%ninterbeds
3152 idelay = this%idelay(ib)
3153 ielastic = this%ielastic(ib)
3157 if (idelay == 0)
then
3161 b = this%thick(ib) * this%rnb(ib)
3165 node = this%nodelist(ib)
3166 idiag = this%dis%con%ia(node)
3167 area = this%dis%get_area(node)
3170 this%cell_thick(node) = this%cell_thick(node) + b
3173 if (this%gwfiss == 0)
then
3181 if (this%ibound(node) < 1) cycle
3184 if (idelay == 0)
then
3185 iconvert = this%iconvert(ib)
3189 call this%csub_nodelay_calc_comp(ib, hnew(node), hold(node), comp, &
3193 es = this%cg_es(node)
3195 es0 = this%cg_es0(node)
3198 if (ielastic > 0 .or. iconvert == 0)
then
3201 stoi = -pcs * rho2 + (rho2 * es)
3202 stoe = pcs * rho1 - (rho1 * es0)
3208 this%storagee(ib) = stoe * tledm
3209 this%storagei(ib) = stoi * tledm
3212 this%comp(ib) = comp
3215 if (isuppress_output == 0)
then
3218 if (this%iupdatematprop /= 0)
then
3219 call this%csub_nodelay_update(ib)
3223 this%tcomp(ib) = this%tcomp(ib) + comp
3224 this%tcompe(ib) = this%tcompe(ib) + compe
3225 this%tcompi(ib) = this%tcompi(ib) + compi
3234 call this%csub_calc_sat(node, h, h0, snnew, snold)
3237 call this%csub_delay_calc_dstor(ib, h, stoe, stoi)
3238 this%storagee(ib) = stoe * area * this%rnb(ib) * tledm
3239 this%storagei(ib) = stoi * area * this%rnb(ib) * tledm
3242 q = this%csub_calc_delay_flow(ib, 1, h) * area * this%rnb(ib)
3243 this%dbflowtop(idelay) = q
3244 nn = this%ndelaycells
3245 q = this%csub_calc_delay_flow(ib, nn, h) * area * this%rnb(ib)
3246 this%dbflowbot(idelay) = q
3249 if (isuppress_output == 0)
then
3252 call this%csub_delay_calc_comp(ib, h, h0, comp, compi, compe)
3256 if (this%iupdatematprop /= 0)
then
3257 call this%csub_delay_update(ib)
3261 this%tcomp(ib) = this%tcomp(ib) + comp
3262 this%tcompi(ib) = this%tcompi(ib) + compi
3263 this%tcompe(ib) = this%tcompe(ib) + compe
3266 do n = 1, this%ndelaycells
3267 this%dbtcomp(n, idelay) = this%dbtcomp(n, idelay) + &
3268 this%dbcomp(n, idelay)
3273 call this%csub_delay_head_check(ib)
3280 if (idelay == 0)
then
3281 call this%csub_nodelay_wcomp_fc(ib, node, tledm, area, &
3282 hnew(node), hold(node), hcof, rhs)
3283 rratewc = hcof * hnew(node) - rhs
3287 call this%csub_delay_calc_wcomp(ib, q)
3288 rratewc = q * area * this%rnb(ib)
3290 this%cell_wcstor(node) = this%cell_wcstor(node) + rratewc
3293 flowja(idiag) = flowja(idiag) + rratewc
3295 this%storagee(ib) =
dzero
3296 this%storagei(ib) =
dzero
3297 if (idelay /= 0)
then
3298 this%dbflowtop(idelay) =
dzero
3299 this%dbflowbot(idelay) =
dzero
3304 flowja(idiag) = flowja(idiag) + this%storagee(ib)
3305 flowja(idiag) = flowja(idiag) + this%storagei(ib)
3309 if (this%iupdatematprop /= 0)
then
3325 subroutine csub_bd(this, isuppress_output, model_budget)
3332 integer(I4B),
intent(in) :: isuppress_output
3333 type(
budgettype),
intent(inout) :: model_budget
3340 call model_budget%addentry(rin, rout,
delt,
budtxt(1), &
3341 isuppress_output,
' CSUB')
3342 if (this%ninterbeds > 0)
then
3346 call model_budget%addentry(rin, rout,
delt,
budtxt(2), &
3347 isuppress_output,
' CSUB')
3351 call model_budget%addentry(rin, rout,
delt,
budtxt(3), &
3352 isuppress_output,
' CSUB')
3355 call model_budget%addentry(rin, rout,
delt,
budtxt(4), &
3356 isuppress_output,
' CSUB')
3368 integer(I4B),
intent(in) :: icbcfl
3369 integer(I4B),
intent(in) :: icbcun
3371 character(len=1) :: cdatafmp =
' '
3372 character(len=1) :: editdesc =
' '
3373 integer(I4B) :: ibinun
3374 integer(I4B) :: iprint
3375 integer(I4B) :: nvaluesp
3376 integer(I4B) :: nwidthp
3378 integer(I4B) :: node
3379 integer(I4B) :: naux
3385 if (this%ipakcb < 0)
then
3387 elseif (this%ipakcb == 0)
then
3390 ibinun = this%ipakcb
3392 if (icbcfl == 0) ibinun = 0
3395 if (ibinun /= 0)
then
3400 call this%dis%record_array(this%cg_stor, this%iout, iprint, -ibinun, &
3401 budtxt(1), cdatafmp, nvaluesp, &
3402 nwidthp, editdesc, dinact)
3403 if (this%ninterbeds > 0)
then
3407 call this%dis%record_srcdst_list_header(
budtxt(2), &
3417 do ib = 1, this%ninterbeds
3418 q = this%storagee(ib)
3419 node = this%nodelist(ib)
3420 call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3425 call this%dis%record_srcdst_list_header(
budtxt(3), &
3435 do ib = 1, this%ninterbeds
3436 q = this%storagei(ib)
3437 node = this%nodelist(ib)
3438 call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3444 call this%dis%record_array(this%cell_wcstor, this%iout, iprint, -ibinun, &
3445 budtxt(4), cdatafmp, nvaluesp, &
3446 nwidthp, editdesc, dinact)
3459 integer(I4B),
intent(in) :: idvfl
3460 integer(I4B),
intent(in) :: idvprint
3462 character(len=1) :: cdatafmp =
' '
3463 character(len=1) :: editdesc =
' '
3464 integer(I4B) :: ibinun
3465 integer(I4B) :: iprint
3466 integer(I4B) :: nvaluesp
3467 integer(I4B) :: nwidthp
3469 integer(I4B) :: node
3470 integer(I4B) :: nodem
3471 integer(I4B) :: nodeu
3474 integer(I4B) :: idx_conn
3476 integer(I4B) :: ncpl
3477 integer(I4B) :: nlay
3480 real(DP) :: va_scale
3482 character(len=*),
parameter :: fmtnconv = &
3483 "(/4x, 'DELAY INTERBED CELL HEADS IN ', i0, ' INTERBEDS IN', &
3484 &' NON-CONVERTIBLE GWF CELLS WERE LESS THAN THE TOP OF THE INTERBED CELL')"
3489 if (this%ioutcomp /= 0 .or. this%ioutzdisp /= 0)
then
3494 if (idvfl == 0) ibinun = 0
3497 if (ibinun /= 0)
then
3502 do node = 1, this%dis%nodes
3503 this%buff(node) = this%cg_tcomp(node)
3505 do ib = 1, this%ninterbeds
3506 node = this%nodelist(ib)
3507 this%buff(node) = this%buff(node) + this%tcomp(ib)
3511 if (this%ioutcomp /= 0)
then
3512 ibinun = this%ioutcomp
3513 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3514 comptxt(1), cdatafmp, nvaluesp, &
3515 nwidthp, editdesc, dinact)
3519 if (this%ioutzdisp /= 0)
then
3520 ibinun = this%ioutzdisp
3523 do nodeu = 1, this%dis%nodesuser
3524 this%buffusr(nodeu) =
dzero
3528 do node = 1, this%dis%nodes
3529 nodeu = this%dis%get_nodeuser(node)
3530 this%buffusr(nodeu) = this%buff(node)
3534 ncpl = this%dis%get_ncpl()
3537 if (this%dis%ndim == 1)
then
3538 do node = this%dis%nodes, 1, -1
3539 do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
3542 nodem = this%dis%con%ja(ii)
3543 idx_conn = this%dis%con%jas(ii)
3546 ihc = this%dis%con%ihc(idx_conn)
3550 if (node < nodem)
then
3551 va_scale = this%dis%get_area_factor(node, idx_conn)
3552 this%buffusr(node) = this%buffusr(node) + &
3553 va_scale * this%buffusr(nodem)
3560 nlay = this%dis%nodesuser / ncpl
3561 do k = nlay - 1, 1, -1
3563 node = (k - 1) * ncpl + i
3564 nodem = k * ncpl + i
3565 this%buffusr(node) = this%buffusr(node) + this%buffusr(nodem)
3571 do nodeu = 1, this%dis%nodesuser
3572 node = this%dis%get_nodenumber_idx1(nodeu, 1)
3574 this%buff(node) = this%buffusr(nodeu)
3579 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3580 comptxt(6), cdatafmp, nvaluesp, &
3581 nwidthp, editdesc, dinact)
3587 if (this%ioutcompi /= 0)
then
3588 ibinun = this%ioutcompi
3592 if (idvfl == 0) ibinun = 0
3595 if (ibinun /= 0)
then
3600 do node = 1, this%dis%nodes
3601 this%buff(node) =
dzero
3603 do ib = 1, this%ninterbeds
3604 node = this%nodelist(ib)
3605 this%buff(node) = this%buff(node) + this%tcompi(ib)
3609 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3610 comptxt(2), cdatafmp, nvaluesp, &
3611 nwidthp, editdesc, dinact)
3615 if (this%ioutcompe /= 0)
then
3616 ibinun = this%ioutcompe
3620 if (idvfl == 0) ibinun = 0
3623 if (ibinun /= 0)
then
3628 do node = 1, this%dis%nodes
3629 this%buff(node) =
dzero
3631 do ib = 1, this%ninterbeds
3632 node = this%nodelist(ib)
3633 this%buff(node) = this%buff(node) + this%tcompe(ib)
3637 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3638 comptxt(3), cdatafmp, nvaluesp, &
3639 nwidthp, editdesc, dinact)
3643 if (this%ioutcompib /= 0)
then
3644 ibinun = this%ioutcompib
3648 if (idvfl == 0) ibinun = 0
3651 if (ibinun /= 0)
then
3656 do node = 1, this%dis%nodes
3657 this%buff(node) =
dzero
3659 do ib = 1, this%ninterbeds
3660 node = this%nodelist(ib)
3661 this%buff(node) = this%buff(node) + this%tcompe(ib) + this%tcompi(ib)
3665 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3666 comptxt(4), cdatafmp, nvaluesp, &
3667 nwidthp, editdesc, dinact)
3671 if (this%ioutcomps /= 0)
then
3672 ibinun = this%ioutcomps
3676 if (idvfl == 0) ibinun = 0
3679 if (ibinun /= 0)
then
3684 do node = 1, this%dis%nodes
3685 this%buff(node) = this%cg_tcomp(node)
3689 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3690 comptxt(5), cdatafmp, nvaluesp, &
3691 nwidthp, editdesc, dinact)
3696 if (this%gwfiss == 0)
then
3697 call this%csub_cg_chk_stress()
3704 if (this%ndelaybeds > 0)
then
3705 if (this%idb_nconv_count(1) > this%idb_nconv_count(2))
then
3706 this%idb_nconv_count(2) = this%idb_nconv_count(1)
3708 if (this%idb_nconv_count(1) > 0)
then
3709 write (this%iout, fmtnconv) this%idb_nconv_count(1)
3724 integer(I4B),
intent(in) :: nodes
3725 real(DP),
dimension(nodes),
intent(in) :: hnew
3727 integer(I4B) :: node
3731 integer(I4B) :: idx_conn
3736 real(DP) :: va_scale
3745 if (this%iupdatestress /= 0)
then
3746 do node = 1, this%dis%nodes
3751 top = this%dis%top(node)
3752 bot = this%dis%bot(node)
3756 if (this%ibound(node) /= 0)
then
3766 if (hcell < top)
then
3767 gs = (top - hbar) * this%sgm(node) + (hbar - bot) * this%sgs(node)
3769 gs = thick * this%sgs(node)
3773 this%cg_gs(node) = gs
3777 do nn = 1, this%nbound
3778 node = this%nodelistsig0(nn)
3779 sadd = this%sig0(nn)
3780 this%cg_gs(node) = this%cg_gs(node) + sadd
3784 do node = 1, this%dis%nodes
3787 gs = this%cg_gs(node)
3791 do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
3794 m = this%dis%con%ja(ii)
3795 idx_conn = this%dis%con%jas(ii)
3798 if (this%dis%con%ihc(idx_conn) == 0)
then
3804 if (this%dis%ndim /= 1)
then
3805 gs = gs + this%cg_gs(m)
3809 va_scale = this%dis%get_area_factor(node, idx_conn)
3810 gs_conn = this%cg_gs(m)
3811 gs = gs + (gs_conn * va_scale)
3819 this%cg_gs(node) = gs
3825 do node = 1, this%dis%nodes
3826 top = this%dis%top(node)
3827 bot = this%dis%bot(node)
3828 if (this%ibound(node) /= 0)
then
3841 es = this%cg_gs(node) - phead
3842 this%cg_es(node) = es
3860 character(len=20) :: cellid
3861 integer(I4B) :: ierr
3862 integer(I4B) :: iwarn
3863 integer(I4B) :: node
3875 do node = 1, this%dis%nodes
3876 if (this%ibound(node) < 1) cycle
3877 if (this%lhead_based .EQV. .true.) cycle
3878 bot = this%dis%bot(node)
3879 gs = this%cg_gs(node)
3880 es = this%cg_es(node)
3883 if (this%istrict_stress /= 0)
then
3887 call this%dis%noder_to_string(node, cellid)
3888 write (
errmsg,
'(a,g0,a,1x,a,1x,a,4(g0,a))') &
3889 'Small to negative effective stress (', es,
') in cell', &
3890 trim(adjustl(cellid)),
'. (', es,
' = ', this%cg_gs(node), &
3891 ' - (', hcell,
' - ', bot,
').'
3904 write (
errmsg,
'(a,1x,i0,3(1x,a))') &
3905 'Solution: small to negative effective stress values in', ierr, &
3906 'cells can be eliminated by increasing storage values and/or ', &
3907 'adding/modifying stress boundaries to prevent water-levels from', &
3908 'exceeding the top of the model.'
3915 this%nreg_ts = this%nreg_ts + 1
3916 write (this%iout,
'(1x,a,1x,i0,1x,a,1x,i0,1x,a,1x,i0,a)') &
3917 'CSUB negative effective stress regularized in', iwarn, &
3918 'cell(s) in stress period',
kper,
'time step',
kstp,
'.'
3931 integer(I4B),
intent(in) :: i
3938 comp = this%tcomp(i) + this%comp(i)
3939 if (abs(comp) >
dzero)
then
3940 thick = this%thickini(i)
3941 theta = this%thetaini(i)
3942 call this%csub_adj_matprop(comp, thick, theta)
3943 if (thick <=
dzero)
then
3944 write (
errmsg,
'(a,1x,i0,1x,a,g0,a)') &
3945 'Adjusted thickness for no-delay interbed', i, &
3946 'is less than or equal to 0 (', thick,
').'
3949 if (theta <=
dzero)
then
3950 write (
errmsg,
'(a,1x,i0,1x,a,g0,a)') &
3951 'Adjusted theta for no-delay interbed', i, &
3952 'is less than or equal to 0 (', theta,
').'
3955 this%thick(i) = thick
3956 this%theta(i) = theta
3978 integer(I4B),
intent(in) :: ib
3979 real(DP),
intent(in) :: hcell
3980 real(DP),
intent(in) :: hcellold
3981 real(DP),
intent(inout) :: rho1
3982 real(DP),
intent(inout) :: rho2
3983 real(DP),
intent(inout) :: rhs
3984 real(DP),
intent(in),
optional :: argtled
3986 integer(I4B) :: node
3996 real(DP) :: sto_fac0
4006 if (
present(argtled))
then
4011 node = this%nodelist(ib)
4012 area = this%dis%get_area(node)
4013 bot = this%dis%bot(node)
4014 top = this%dis%top(node)
4015 thick = this%thickini(ib)
4021 this%iconvert(ib) = 0
4024 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4025 if (this%lhead_based .EQV. .true.)
then
4029 znode = this%csub_calc_znode(top, bot, hbar)
4030 es = this%cg_es(node)
4031 es0 = this%cg_es0(node)
4032 theta = this%thetaini(ib)
4037 call this%csub_calc_sfacts(node, bot, znode, theta, es, es0, &
4038 this%cg_gs(node), f)
4040 sto_fac = tled * snnew * thick * f
4041 sto_fac0 = tled * snold * thick * f
4044 rho1 = this%rci(ib) * sto_fac0
4045 rho2 = this%rci(ib) * sto_fac
4046 if (this%cg_es(node) > this%pcs(ib))
then
4047 this%iconvert(ib) = 1
4048 rho2 = this%ci(ib) * sto_fac
4052 rcorr = rho2 * (hcell - hbar)
4055 if (this%ielastic(ib) /= 0)
then
4056 rhs = rho1 * this%cg_es0(node) - &
4057 rho2 * (this%cg_gs(node) + bot) - &
4060 rhs = -rho2 * (this%cg_gs(node) + bot) + &
4061 (this%pcs(ib) * (rho2 - rho1)) + &
4062 (rho1 * this%cg_es0(node)) - &
4084 integer(I4B),
intent(in) :: ib
4085 real(DP),
intent(in) :: hcell
4086 real(DP),
intent(in) :: hcellold
4087 real(DP),
intent(inout) :: comp
4088 real(DP),
intent(inout) :: rho1
4089 real(DP),
intent(inout) :: rho2
4091 integer(I4B) :: node
4099 node = this%nodelist(ib)
4101 es = this%cg_es(node)
4102 es0 = this%cg_es0(node)
4106 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhs, argtled=tled)
4109 if (this%ielastic(ib) /= 0)
then
4110 comp = rho2 * es - rho1 * es0
4112 comp = -pcs * (rho2 - rho1) - (rho1 * es0) + (rho2 * es)
4126 integer(I4B),
intent(in) :: nodes
4127 real(DP),
dimension(nodes),
intent(in) :: hnew
4129 character(len=LINELENGTH) :: title
4130 character(len=LINELENGTH) :: tag
4131 character(len=20) :: cellid
4133 integer(I4B) :: node
4135 integer(I4B) :: idelay
4136 integer(I4B) :: ntabrows
4137 integer(I4B) :: ntabcols
4143 real(DP) :: void_ratio
4153 call this%csub_cg_calc_stress(nodes, hnew)
4158 this%cg_es0(node) = this%cg_es(node)
4162 do ib = 1, this%ninterbeds
4163 idelay = this%idelay(ib)
4164 node = this%nodelist(ib)
4165 top = this%dis%top(node)
4166 bot = this%dis%bot(node)
4170 if (this%ispecified_pcs == 0)
then
4172 if (this%ipch /= 0)
then
4173 pcs = this%cg_es(node) - pcs0
4175 pcs = this%cg_es(node) + pcs0
4179 if (this%ipch /= 0)
then
4180 pcs = this%cg_gs(node) - (pcs0 - bot)
4182 if (pcs < this%cg_es(node))
then
4183 pcs = this%cg_es(node)
4189 if (idelay /= 0)
then
4190 dzhalf =
dhalf * this%dbdzini(1, idelay)
4195 do n = 1, this%ndelaycells
4196 if (this%ispecified_dbh == 0)
then
4197 this%dbh(n, idelay) = hcell + this%dbh(n, idelay)
4199 this%dbh(n, idelay) = hcell
4201 this%dbh0(n, idelay) = this%dbh(n, idelay)
4205 call this%csub_delay_calc_stress(ib, hcell)
4209 do n = 1, this%ndelaycells
4210 zbot = this%dbz(n, idelay) - dzhalf
4213 dbpcs = pcs - (zbot - bot) * (this%sgs(node) -
done)
4214 this%dbpcs(n, idelay) = dbpcs
4217 this%dbes0(n, idelay) = this%dbes(n, idelay)
4224 top = this%dis%top(node)
4225 bot = this%dis%bot(node)
4228 if (this%istoragec == 1)
then
4231 if (this%lhead_based .EQV. .true.)
then
4237 void_ratio = this%csub_calc_void_ratio(this%cg_theta(node))
4238 es = this%cg_es(node)
4245 znode = this%csub_calc_znode(top, bot, hbar)
4246 fact = this%csub_calc_adjes(node, es, bot, znode)
4247 fact = fact * (
done + void_ratio)
4254 this%cg_ske_cr(node) = this%cg_ske_cr(node) * fact
4257 if (fact <=
dzero)
then
4258 call this%dis%noder_to_string(node, cellid)
4259 write (
errmsg,
'(a,1x,a,a)') &
4260 'Negative recompression index calculated for cell', &
4261 trim(adjustl(cellid)),
'.'
4267 do ib = 1, this%ninterbeds
4268 idelay = this%idelay(ib)
4269 node = this%nodelist(ib)
4270 top = this%dis%top(node)
4271 bot = this%dis%bot(node)
4274 if (this%istoragec == 1)
then
4277 if (this%lhead_based .EQV. .true.)
then
4283 void_ratio = this%csub_calc_void_ratio(this%theta(ib))
4284 es = this%cg_es(node)
4291 znode = this%csub_calc_znode(top, bot, hbar)
4292 fact = this%csub_calc_adjes(node, es, bot, znode)
4293 fact = fact * (
done + void_ratio)
4300 this%ci(ib) = this%ci(ib) * fact
4301 this%rci(ib) = this%rci(ib) * fact
4304 if (fact <=
dzero)
then
4305 call this%dis%noder_to_string(node, cellid)
4306 write (
errmsg,
'(a,1x,i0,2(1x,a),a)') &
4307 'Negative compression indices calculated for interbed', ib, &
4308 'in cell', trim(adjustl(cellid)),
'.'
4314 if (this%iprpak == 1)
then
4316 title = trim(adjustl(this%packName))// &
4317 ' PACKAGE CALCULATED INITIAL INTERBED STRESSES AT THE CELL BOTTOM'
4320 ntabrows = this%ninterbeds
4322 if (this%inamedbound /= 0)
then
4323 ntabcols = ntabcols + 1
4327 call table_cr(this%inputtab, this%packName, title)
4328 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4331 tag =
'INTERBED NUMBER'
4332 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4334 call this%inputtab%initialize_column(tag, 20)
4335 tag =
'GEOSTATIC STRESS'
4336 call this%inputtab%initialize_column(tag, 16)
4337 tag =
'EFFECTIVE STRESS'
4338 call this%inputtab%initialize_column(tag, 16)
4339 tag =
'PRECONSOLIDATION STRESS'
4340 call this%inputtab%initialize_column(tag, 16)
4341 if (this%inamedbound /= 0)
then
4343 call this%inputtab%initialize_column(tag,
lenboundname, &
4348 do ib = 1, this%ninterbeds
4349 node = this%nodelist(ib)
4350 call this%dis%noder_to_string(node, cellid)
4353 call this%inputtab%add_term(ib)
4354 call this%inputtab%add_term(cellid)
4355 call this%inputtab%add_term(this%cg_gs(node))
4356 call this%inputtab%add_term(this%cg_es(node))
4357 call this%inputtab%add_term(this%pcs(ib))
4358 if (this%inamedbound /= 0)
then
4359 call this%inputtab%add_term(this%boundname(ib))
4366 title = trim(adjustl(this%packName))// &
4367 ' PACKAGE CALCULATED INITIAL DELAY INTERBED STRESSES'
4371 do ib = 1, this%ninterbeds
4372 idelay = this%idelay(ib)
4373 if (idelay /= 0)
then
4374 ntabrows = ntabrows + this%ndelaycells
4378 if (this%inamedbound /= 0)
then
4379 ntabcols = ntabcols + 1
4383 call table_cr(this%inputtab, this%packName, title)
4384 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4387 tag =
'INTERBED NUMBER'
4388 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4390 call this%inputtab%initialize_column(tag, 20)
4392 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4393 tag =
'GEOSTATIC STRESS'
4394 call this%inputtab%initialize_column(tag, 16)
4395 tag =
'EFFECTIVE STRESS'
4396 call this%inputtab%initialize_column(tag, 16)
4397 tag =
'PRECONSOLIDATION STRESS'
4398 call this%inputtab%initialize_column(tag, 16)
4399 if (this%inamedbound /= 0)
then
4401 call this%inputtab%initialize_column(tag,
lenboundname, &
4406 do ib = 1, this%ninterbeds
4407 idelay = this%idelay(ib)
4408 if (idelay /= 0)
then
4409 node = this%nodelist(ib)
4410 call this%dis%noder_to_string(node, cellid)
4413 do n = 1, this%ndelaycells
4415 call this%inputtab%add_term(ib)
4416 call this%inputtab%add_term(cellid)
4418 call this%inputtab%add_term(
' ')
4419 call this%inputtab%add_term(
' ')
4421 call this%inputtab%add_term(n)
4422 call this%inputtab%add_term(this%dbgeo(n, idelay))
4423 call this%inputtab%add_term(this%dbes(n, idelay))
4424 call this%inputtab%add_term(this%dbpcs(n, idelay))
4425 if (this%inamedbound /= 0)
then
4427 call this%inputtab%add_term(this%boundname(ib))
4429 call this%inputtab%add_term(
' ')
4437 if (this%istoragec == 1)
then
4438 if (this%lhead_based .EQV. .false.)
then
4440 title = trim(adjustl(this%packName))// &
4441 ' PACKAGE COMPRESSION INDICES'
4444 ntabrows = this%ninterbeds
4446 if (this%inamedbound /= 0)
then
4447 ntabcols = ntabcols + 1
4451 call table_cr(this%inputtab, this%packName, title)
4452 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4455 tag =
'INTERBED NUMBER'
4456 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4458 call this%inputtab%initialize_column(tag, 20)
4460 call this%inputtab%initialize_column(tag, 16)
4462 call this%inputtab%initialize_column(tag, 16)
4463 if (this%inamedbound /= 0)
then
4465 call this%inputtab%initialize_column(tag,
lenboundname, &
4470 do ib = 1, this%ninterbeds
4472 node = this%nodelist(ib)
4473 call this%dis%noder_to_string(node, cellid)
4476 call this%inputtab%add_term(ib)
4477 call this%inputtab%add_term(cellid)
4478 call this%inputtab%add_term(this%ci(ib) * fact)
4479 call this%inputtab%add_term(this%rci(ib) * fact)
4480 if (this%inamedbound /= 0)
then
4481 call this%inputtab%add_term(this%boundname(ib))
4494 this%initialized = 1
4497 if (this%lhead_based .EQV. .true.)
then
4498 this%iupdatestress = 0
4511 subroutine csub_cg_fc(this, node, tled, area, hcell, hcellold, hcof, rhs)
4514 integer(I4B),
intent(in) :: node
4515 real(DP),
intent(in) :: tled
4516 real(DP),
intent(in) :: area
4517 real(DP),
intent(in) :: hcell
4518 real(DP),
intent(in) :: hcellold
4519 real(DP),
intent(inout) :: hcof
4520 real(DP),
intent(inout) :: rhs
4536 top = this%dis%top(node)
4537 bot = this%dis%bot(node)
4538 tthk = this%cg_thickini(node)
4541 if (tthk >
dzero)
then
4544 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4550 call this%csub_cg_calc_sske(node, sske, hcell)
4551 rho1 = sske * area * tthk * tled
4554 this%cg_ske(node) = sske * tthk * snold
4555 this%cg_sk(node) = sske * tthk * snnew
4558 hcof = -rho1 * snnew
4559 rhs = rho1 * snold * this%cg_es0(node) - &
4560 rho1 * snnew * (this%cg_gs(node) + bot)
4563 rhs = rhs - rho1 * snnew * (hcell - hbar)
4580 integer(I4B),
intent(in) :: node
4581 real(DP),
intent(in) :: tled
4582 real(DP),
intent(in) :: area
4583 real(DP),
intent(in) :: hcell
4584 real(DP),
intent(inout) :: hcof
4585 real(DP),
intent(inout) :: rhs
4594 real(DP) :: hbarderv
4603 top = this%dis%top(node)
4604 bot = this%dis%bot(node)
4605 tthk = this%cg_thickini(node)
4608 if (tthk >
dzero)
then
4611 call this%csub_calc_sat(node, hcell, top, snnew, snold)
4614 satderv = this%csub_calc_sat_derivative(node, hcell)
4623 call this%csub_cg_calc_sske(node, sske, hcell)
4624 rho1 = sske * area * tthk * tled
4627 hcof = rho1 * snnew * (
done - hbarderv) + &
4628 rho1 * (this%cg_gs(node) - hbar + bot) * satderv
4631 if (this%ieslag /= 0)
then
4632 hcof = hcof - rho1 * this%cg_es0(node) * satderv
4652 integer(I4B),
intent(in) :: ib
4653 integer(I4B),
intent(in) :: node
4654 real(DP),
intent(in) :: area
4655 real(DP),
intent(in) :: hcell
4656 real(DP),
intent(in) :: hcellold
4657 real(DP),
intent(inout) :: hcof
4658 real(DP),
intent(inout) :: rhs
4677 if (this%ibound(node) > 0)
then
4678 if (this%idelay(ib) == 0)
then
4681 if (this%iupdatematprop /= 0)
then
4682 if (this%ieslag == 0)
then
4685 call this%csub_nodelay_calc_comp(ib, hcell, hcellold, comp, &
4687 this%comp(ib) = comp
4690 call this%csub_nodelay_update(ib)
4695 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, hcof, rhs)
4700 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4703 if (this%iupdatematprop /= 0)
then
4704 if (this%ieslag == 0)
then
4707 call this%csub_delay_calc_comp(ib, hcell, hcellold, &
4709 this%comp(ib) = comp
4712 call this%csub_delay_update(ib)
4717 call this%csub_delay_sln(ib, hcell)
4718 call this%csub_delay_fc(ib, hcof, rhs)
4719 f = area * this%rnb(ib)
4740 integer(I4B),
intent(in) :: ib
4741 integer(I4B),
intent(in) :: node
4742 real(DP),
intent(in) :: hcell
4743 real(DP),
intent(in) :: hcellold
4744 real(DP),
intent(inout) :: hcof
4745 real(DP),
intent(inout) :: rhs
4747 integer(I4B) :: idelay
4759 real(DP) :: hbarderv
4769 idelay = this%idelay(ib)
4770 top = this%dis%top(node)
4771 bot = this%dis%bot(node)
4774 if (this%ibound(node) > 0)
then
4776 tthk = this%thickini(ib)
4779 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4782 if (idelay == 0)
then
4788 satderv = this%csub_calc_sat_derivative(node, hcell)
4797 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhsn)
4800 hcofn = rho2 * (
done - hbarderv) * snnew + &
4801 rho2 * (this%cg_gs(node) - hbar + bot) * satderv
4802 if (this%ielastic(ib) == 0)
then
4803 hcofn = hcofn - rho2 * this%pcs(ib) * satderv
4807 if (this%ieslag /= 0)
then
4808 if (this%ielastic(ib) /= 0)
then
4809 hcofn = hcofn - rho1 * this%cg_es0(node) * satderv
4811 hcofn = hcofn - rho1 * (this%pcs(ib) - this%cg_es0(node)) * satderv
4828 integer(I4B),
intent(in) :: n
4829 real(DP),
intent(inout) :: sske
4830 real(DP),
intent(in) :: hcell
4846 if (this%lhead_based .EQV. .true.)
then
4852 top = this%dis%top(n)
4853 bot = this%dis%bot(n)
4859 znode = this%csub_calc_znode(top, bot, hbar)
4863 es0 = this%cg_es0(n)
4864 theta = this%cg_thetaini(n)
4869 call this%csub_calc_sfacts(n, bot, znode, theta, es, es0, &
4872 sske = f * this%cg_ske_cr(n)
4885 integer(I4B),
intent(in) :: node
4886 real(DP),
intent(in) :: hcell
4887 real(DP),
intent(in) :: hcellold
4888 real(DP),
intent(inout) :: comp
4900 call this%csub_cg_fc(node, tled, area, hcell, hcellold, hcof, rhs)
4903 comp = hcof * hcell - rhs
4914 integer(I4B),
intent(in) :: node
4916 character(len=20) :: cellid
4922 comp = this%cg_tcomp(node) + this%cg_comp(node)
4923 call this%dis%noder_to_string(node, cellid)
4924 if (abs(comp) >
dzero)
then
4925 thick = this%cg_thickini(node)
4926 theta = this%cg_thetaini(node)
4927 call this%csub_adj_matprop(comp, thick, theta)
4928 if (thick <=
dzero)
then
4929 write (
errmsg,
'(a,1x,a,1x,a,g0,a)') &
4930 'Adjusted thickness for cell', trim(adjustl(cellid)), &
4931 'is less than or equal to 0 (', thick,
').'
4934 if (theta <=
dzero)
then
4935 write (
errmsg,
'(a,1x,a,1x,a,g0,a)') &
4936 'Adjusted theta for cell', trim(adjustl(cellid)), &
4937 'is less than or equal to 0 (', theta,
').'
4940 this%cg_thick(node) = thick
4941 this%cg_theta(node) = theta
4959 integer(I4B),
intent(in) :: node
4960 real(DP),
intent(in) :: tled
4961 real(DP),
intent(in) :: area
4962 real(DP),
intent(in) :: hcell
4963 real(DP),
intent(in) :: hcellold
4964 real(DP),
intent(inout) :: hcof
4965 real(DP),
intent(inout) :: rhs
4981 top = this%dis%top(node)
4982 bot = this%dis%bot(node)
4983 tthk = this%cg_thick(node)
4984 tthk0 = this%cg_thick0(node)
4987 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4990 wc0 = this%brg * area * tthk0 * this%cg_theta0(node) * tled
4991 wc = this%brg * area * tthk * this%cg_theta(node) * tled
4997 rhs = -wc0 * snold * hcellold
5013 integer(I4B),
intent(in) :: node
5014 real(DP),
intent(in) :: tled
5015 real(DP),
intent(in) :: area
5016 real(DP),
intent(in) :: hcell
5017 real(DP),
intent(in) :: hcellold
5018 real(DP),
intent(inout) :: hcof
5019 real(DP),
intent(inout) :: rhs
5035 top = this%dis%top(node)
5036 bot = this%dis%bot(node)
5037 tthk = this%cg_thick(node)
5040 satderv = this%csub_calc_sat_derivative(node, hcell)
5043 f = this%brg * area * tled
5046 wc = f * tthk * this%cg_theta(node)
5049 hcof = -wc * hcell * satderv
5052 if (this%ieslag /= 0)
then
5053 tthk0 = this%cg_thick0(node)
5054 wc0 = f * tthk0 * this%cg_theta0(node)
5055 hcof = hcof + wc * hcellold * satderv
5073 hcell, hcellold, hcof, rhs)
5076 integer(I4B),
intent(in) :: ib
5077 integer(I4B),
intent(in) :: node
5078 real(DP),
intent(in) :: tled
5079 real(DP),
intent(in) :: area
5080 real(DP),
intent(in) :: hcell
5081 real(DP),
intent(in) :: hcellold
5082 real(DP),
intent(inout) :: hcof
5083 real(DP),
intent(inout) :: rhs
5098 top = this%dis%top(node)
5099 bot = this%dis%bot(node)
5102 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
5105 f = this%brg * area * tled
5106 wc0 = f * this%theta0(ib) * this%thick0(ib)
5107 wc = f * this%theta(ib) * this%thick(ib)
5109 rhs = -wc0 * snold * hcellold
5123 hcell, hcellold, hcof, rhs)
5126 integer(I4B),
intent(in) :: ib
5127 integer(I4B),
intent(in) :: node
5128 real(DP),
intent(in) :: tled
5129 real(DP),
intent(in) :: area
5130 real(DP),
intent(in) :: hcell
5131 real(DP),
intent(in) :: hcellold
5132 real(DP),
intent(inout) :: hcof
5133 real(DP),
intent(inout) :: rhs
5147 top = this%dis%top(node)
5148 bot = this%dis%bot(node)
5151 f = this%brg * area * tled
5154 satderv = this%csub_calc_sat_derivative(node, hcell)
5157 wc = f * this%theta(ib) * this%thick(ib)
5160 hcof = -wc * hcell * satderv
5163 if (this%ieslag /= 0)
then
5164 wc0 = f * this%theta0(ib) * this%thick0(ib)
5165 hcof = hcof + wc0 * hcellold * satderv
5181 real(dp),
intent(in) :: theta
5183 real(dp) :: void_ratio
5185 void_ratio = theta / (
done - theta)
5197 real(dp),
intent(in) :: void_ratio
5202 theta = void_ratio / (
done + void_ratio)
5214 integer(I4B),
intent(in) :: ib
5216 integer(I4B) :: idelay
5220 idelay = this%idelay(ib)
5221 thick = this%thick(ib)
5222 if (idelay /= 0)
then
5223 thick = thick * this%rnb(ib)
5240 real(dp),
intent(in) :: top
5241 real(dp),
intent(in) :: bottom
5242 real(dp),
intent(in) :: zbar
5248 if (zbar > top)
then
5253 znode =
dhalf * (v + bottom)
5267 integer(I4B),
intent(in) :: node
5268 real(dp),
intent(in) :: es0
5269 real(dp),
intent(in) :: z0
5270 real(dp),
intent(in) :: z
5275 es = es0 - (z - z0) * (this%sgs(node) -
done)
5288 integer(I4B),
intent(in) :: ib
5290 integer(I4B) :: iviolate
5291 integer(I4B) :: idelay
5292 integer(I4B) :: node
5301 idelay = this%idelay(ib)
5302 node = this%nodelist(ib)
5305 idelaycells:
do n = 1, this%ndelaycells
5306 z = this%dbz(n, idelay)
5307 h = this%dbh(n, idelay)
5308 dzhalf =
dhalf * this%dbdzini(1, idelay)
5311 if (this%stoiconv(node) == 0)
then
5314 this%idb_nconv_count(1) = this%idb_nconv_count(1) + 1
5320 if (iviolate > 0)
then
5338 integer(I4B),
intent(in) :: node
5339 real(DP),
intent(in) :: hcell
5340 real(DP),
intent(in) :: hcellold
5341 real(DP),
intent(inout) :: snnew
5342 real(DP),
intent(inout) :: snold
5348 if (this%stoiconv(node) /= 0)
then
5349 top = this%dis%top(node)
5350 bot = this%dis%bot(node)
5357 if (this%ieslag /= 0)
then
5372 integer(I4B),
intent(in) :: node
5373 real(dp),
intent(in) :: hcell
5379 if (this%stoiconv(node) /= 0)
then
5380 top = this%dis%top(node)
5381 bot = this%dis%bot(node)
5400 integer(I4B),
intent(in) :: node
5401 real(DP),
intent(in) :: bot
5402 real(DP),
intent(in) :: znode
5403 real(DP),
intent(in) :: theta
5404 real(DP),
intent(in) :: es
5405 real(DP),
intent(in) :: es0
5406 real(DP),
intent(in) :: geo
5407 real(DP),
intent(inout) :: fact
5410 real(DP) :: void_ratio
5417 if (this%ieslag /= 0)
then
5424 adjes = this%csub_calc_adjes(node, esv, bot, znode)
5429 if (this%istrict_stress == 0 .and. geo >
dzero)
then
5435 void_ratio = this%csub_calc_void_ratio(theta)
5436 denom = adjes * (
done + void_ratio)
5437 if (denom /=
dzero)
then
5453 real(DP),
intent(in) :: comp
5454 real(DP),
intent(inout) :: thick
5455 real(DP),
intent(inout) :: theta
5458 real(DP) :: void_ratio
5462 void_ratio = this%csub_calc_void_ratio(theta)
5465 if (thick >
dzero) strain = -comp / thick
5468 void_ratio = void_ratio + strain * (
done + void_ratio)
5469 theta = this%csub_calc_theta(void_ratio)
5470 thick = thick - comp
5483 integer(I4B),
intent(in) :: ib
5484 real(DP),
intent(in) :: hcell
5485 logical(LGP),
intent(in),
optional :: update
5489 logical(LGP) :: lupdate
5491 integer(I4B) :: icnvg
5492 integer(I4B) :: iter
5493 integer(I4B) :: idelay
5500 if (
present(update))
then
5507 call this%csub_delay_calc_stress(ib, hcell)
5515 if (this%thickini(ib) >
dzero)
then
5518 idelay = this%idelay(ib)
5523 call this%csub_delay_assemble(ib, hcell)
5527 this%dbal, this%dbad, this%dbau, &
5528 this%dbrhs, this%dbdh, this%dbaw)
5532 do n = 1, this%ndelaycells
5533 dh = this%dbdh(n) - this%dbh(n, idelay)
5534 if (abs(dh) > abs(dhmax))
then
5537 this%dbdhmax(idelay) = dhmax
5541 this%dbh(n, idelay) = this%dbdh(n)
5545 call this%csub_delay_calc_stress(ib, hcell)
5548 if (abs(dhmax) < dclose)
then
5550 else if (iter /= 1)
then
5551 if (abs(dhmax) - abs(dhmax0) <
dprec)
then
5555 if (icnvg == 1)
then
5576 integer(I4B),
intent(in) :: ib
5579 integer(I4B) :: node
5580 integer(I4B) :: idelay
5592 idelay = this%idelay(ib)
5593 node = this%nodelist(ib)
5594 b = this%thickini(ib)
5595 bot = this%dis%bot(node)
5601 znode = this%csub_calc_znode(top, bot, hbar)
5602 dz =
dhalf * this%dbdzini(1, idelay)
5609 do n = 1, this%ndelaycells
5612 this%dbz(n, idelay) = z
5616 if (abs(zr) < dz)
then
5619 this%dbrelz(n, idelay) = zr
5633 integer(I4B),
intent(in) :: ib
5634 real(DP),
intent(in) :: hcell
5637 integer(I4B) :: idelay
5638 integer(I4B) :: node
5654 idelay = this%idelay(ib)
5655 node = this%nodelist(ib)
5656 sigma = this%cg_gs(node)
5657 topaq = this%dis%top(node)
5658 botaq = this%dis%bot(node)
5659 dzhalf =
dhalf * this%dbdzini(1, idelay)
5660 top = this%dbz(1, idelay) + dzhalf
5666 sgm = this%sgm(node)
5667 sgs = this%sgs(node)
5668 if (hcell < top)
then
5669 sadd = ((top - hbar) * sgm) + ((hbar - botaq) * sgs)
5671 sadd = (top - botaq) * sgs
5673 sigma = sigma - sadd
5676 do n = 1, this%ndelaycells
5677 h = this%dbh(n, idelay)
5680 z = this%dbz(n, idelay)
5689 sadd = ((top - hbar) * sgm) + ((hbar - bot) * sgs)
5691 sadd = (top - bot) * sgs
5693 sigma = sigma + sadd
5695 this%dbgeo(n, idelay) = sigma
5696 this%dbes(n, idelay) = sigma - phead
5705 integer(I4B),
intent(in) :: ib
5706 integer(I4B),
intent(in) :: n
5707 real(DP),
intent(in) :: hcell
5708 real(DP),
intent(inout) :: ssk
5709 real(DP),
intent(inout) :: sske
5710 real(DP),
intent(out),
optional :: dsskde
5711 real(DP),
intent(out),
optional :: wfac
5713 integer(I4B) :: idelay
5714 integer(I4B) :: ielastic
5715 integer(I4B) :: node
5718 real(DP) :: hbarcell
5741 idelay = this%idelay(ib)
5742 ielastic = this%ielastic(ib)
5745 if (this%lhead_based .EQV. .true.)
then
5751 node = this%nodelist(ib)
5752 theta = this%dbthetaini(n, idelay)
5755 topcell = this%dis%top(node)
5756 botcell = this%dis%bot(node)
5763 zcell = this%csub_calc_znode(topcell, botcell, hbarcell)
5766 zcenter = zcell + this%dbrelz(n, idelay)
5767 dzhalf =
dhalf * this%dbdzini(1, idelay)
5768 top = zcenter + dzhalf
5769 bot = zcenter - dzhalf
5770 h = this%dbh(n, idelay)
5777 znode = this%csub_calc_znode(top, bot, hbar)
5781 zbot = this%dbz(n, idelay) - dzhalf
5784 es = this%dbes(n, idelay)
5785 es0 = this%dbes0(n, idelay)
5790 call this%csub_calc_sfacts(node, zbot, znode, theta, es, es0, &
5791 this%dbgeo(n, idelay), f)
5793 this%idbconvert(n, idelay) = 0
5794 sske = f * this%rci(ib)
5795 ssk = f * this%rci(ib)
5796 if (
present(dsskde)) dsskde =
dzero
5800 if (
present(wfac)) wfac =
dzero
5801 if (ielastic == 0)
then
5802 es = this%dbes(n, idelay)
5803 pcs = this%dbpcs(n, idelay)
5806 if (this%pcsomega >
dzero .and. pcs >
dzero)
then
5809 estop = pcs + this%pcsomega * pcs
5811 ssk = f * (this%rci(ib) + w * (this%ci(ib) - this%rci(ib)))
5812 if (w >
dhalf) this%idbconvert(n, idelay) = 1
5813 if (
present(wfac)) wfac = w
5814 if (
present(dsskde))
then
5816 dsskde = f * (this%ci(ib) - this%rci(ib)) * dwde
5821 this%idbconvert(n, idelay) = 1
5822 ssk = f * this%ci(ib)
5823 if (
present(wfac)) wfac =
done
5839 integer(I4B),
intent(in) :: ib
5840 real(DP),
intent(in) :: hcell
5849 do n = 1, this%ndelaycells
5852 if (this%inewton == 0)
then
5853 call this%csub_delay_assemble_fc(ib, n, hcell, aii, au, al, r)
5855 call this%csub_delay_assemble_fn(ib, n, hcell, aii, au, al, r)
5877 integer(I4B),
intent(in) :: ib
5878 integer(I4B),
intent(in) :: n
5879 real(DP),
intent(in) :: hcell
5880 real(DP),
intent(inout) :: aii
5881 real(DP),
intent(inout) :: au
5882 real(DP),
intent(inout) :: al
5883 real(DP),
intent(inout) :: r
5885 integer(I4B) :: node
5886 integer(I4B) :: idelay
5887 integer(I4B) :: ielastic
5923 idelay = this%idelay(ib)
5924 ielastic = this%ielastic(ib)
5925 node = this%nodelist(ib)
5926 dzini = this%dbdzini(1, idelay)
5927 dzhalf =
dhalf * dzini
5929 c = this%kv(ib) / dzini
5937 if (n == 1 .or. n == this%ndelaycells)
then
5948 if (n < this%ndelaycells)
then
5953 z = this%dbz(n, idelay)
5956 h = this%dbh(n, idelay)
5957 h0 = this%dbh0(n, idelay)
5958 dz = this%dbdz(n, idelay)
5959 dz0 = this%dbdz0(n, idelay)
5960 theta = this%dbtheta(n, idelay)
5961 theta0 = this%dbtheta0(n, idelay)
5967 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
5970 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
5973 smult = dzini * tled
5974 gs = this%dbgeo(n, idelay)
5975 es0 = this%dbes0(n, idelay)
5976 pcs = this%dbpcs(n, idelay)
5977 aii = aii - smult * dsn * ssk
5978 if (ielastic /= 0)
then
5980 (dsn * ssk * (gs + zbot) - dsn0 * sske * es0)
5983 (dsn * ssk * (gs + zbot - pcs) + dsn0 * sske * (pcs - es0))
5987 r = r + smult * dsn * ssk * (h - hbar)
5990 wcf = this%brg * tled
5991 wc = dz * wcf * theta
5992 wc0 = dz0 * wcf * theta0
5993 aii = aii - dsn * wc
5994 r = r - dsn0 * wc0 * h0
6008 integer(I4B),
intent(in) :: ib
6009 integer(I4B),
intent(in) :: n
6010 real(DP),
intent(in) :: hcell
6011 real(DP),
intent(inout) :: aii
6012 real(DP),
intent(inout) :: au
6013 real(DP),
intent(inout) :: al
6014 real(DP),
intent(inout) :: r
6016 integer(I4B) :: node
6017 integer(I4B) :: idelay
6018 integer(I4B) :: ielastic
6044 real(DP) :: hbarderv
6061 idelay = this%idelay(ib)
6062 ielastic = this%ielastic(ib)
6063 node = this%nodelist(ib)
6064 dzini = this%dbdzini(1, idelay)
6065 dzhalf =
dhalf * dzini
6067 c = this%kv(ib) / dzini
6075 if (n == 1 .or. n == this%ndelaycells)
then
6086 if (n < this%ndelaycells)
then
6091 z = this%dbz(n, idelay)
6094 h = this%dbh(n, idelay)
6095 h0 = this%dbh0(n, idelay)
6096 dz = this%dbdz(n, idelay)
6097 dz0 = this%dbdz0(n, idelay)
6098 theta = this%dbtheta(n, idelay)
6099 theta0 = this%dbtheta0(n, idelay)
6108 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6111 dsnderv = this%csub_delay_calc_sat_derivative(node, idelay, n, hcell)
6114 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske, dsskde)
6117 smult = dzini * tled
6118 gs = this%dbgeo(n, idelay)
6119 es0 = this%dbes0(n, idelay)
6120 pcs = this%dbpcs(n, idelay)
6121 if (ielastic /= 0)
then
6122 qsto = smult * (dsn * ssk * (gs - hbar + zbot) - dsn0 * sske * es0)
6123 stoderv = -smult * dsn * ssk * hbarderv + &
6124 smult * ssk * (gs - hbar + zbot) * dsnderv
6126 qsto = smult * (dsn * ssk * (gs - hbar + zbot - pcs) + &
6127 dsn0 * sske * (pcs - es0))
6128 stoderv = -smult * dsn * ssk * hbarderv + &
6129 smult * ssk * (gs - hbar + zbot - pcs) * dsnderv
6132 stoderv = stoderv - &
6133 smult * dsn * dsskde * hbarderv * (gs - hbar + zbot - pcs)
6137 if (this%ieslag /= 0)
then
6138 if (ielastic /= 0)
then
6139 stoderv = stoderv - smult * sske * es0 * dsnderv
6141 stoderv = stoderv + smult * sske * (pcs - es0) * dsnderv
6147 r = r - qsto + stoderv * h
6150 wcf = this%brg * tled
6151 wc = dz * wcf * theta
6152 wc0 = dz0 * wcf * theta0
6153 qwc = dsn0 * wc0 * h0 - dsn * wc * h
6154 wcderv = -dsn * wc - wc * h * dsnderv
6157 if (this%ieslag /= 0)
then
6158 wcderv = wcderv + wc0 * h0 * dsnderv
6163 r = r - qwc + wcderv * h
6178 integer(I4B),
intent(in) :: node
6179 integer(I4B),
intent(in) :: idelay
6180 integer(I4B),
intent(in) :: n
6181 real(DP),
intent(in) :: hcell
6182 real(DP),
intent(in) :: hcellold
6183 real(DP),
intent(inout) :: snnew
6184 real(DP),
intent(inout) :: snold
6191 if (this%stoiconv(node) /= 0)
then
6192 dzhalf =
dhalf * this%dbdzini(n, idelay)
6193 top = this%dbz(n, idelay) + dzhalf
6194 bot = this%dbz(n, idelay) - dzhalf
6201 if (this%ieslag /= 0)
then
6217 integer(I4B),
intent(in) :: node
6218 integer(I4B),
intent(in) :: idelay
6219 integer(I4B),
intent(in) :: n
6220 real(dp),
intent(in) :: hcell
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
6248 integer(I4B),
intent(in) :: ib
6249 real(DP),
intent(in) :: hcell
6250 real(DP),
intent(inout) :: stoe
6251 real(DP),
intent(inout) :: stoi
6253 integer(I4B) :: idelay
6254 integer(I4B) :: ielastic
6255 integer(I4B) :: node
6275 idelay = this%idelay(ib)
6276 ielastic = this%ielastic(ib)
6277 node = this%nodelist(ib)
6284 if (this%thickini(ib) >
dzero)
then
6285 fmult = this%dbdzini(1, idelay)
6286 dzhalf =
dhalf * this%dbdzini(1, idelay)
6287 do n = 1, this%ndelaycells
6288 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske, wfac=wfac)
6289 z = this%dbz(n, idelay)
6291 h = this%dbh(n, idelay)
6292 h0 = this%dbh0(n, idelay)
6293 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6295 if (ielastic /= 0)
then
6296 v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot) - &
6297 dsn0 * sske * this%dbes0(n, idelay)
6300 v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot - &
6301 this%dbpcs(n, idelay))
6302 v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6308 stoi = stoi + wfac * v1 * fmult
6309 stoe = stoe + ((
done - wfac) * v1 + v2) * fmult
6312 ske = ske + sske * fmult
6313 sk = sk + ssk * fmult
6334 integer(I4B),
intent(in) :: ib
6335 real(DP),
intent(inout) :: dwc
6337 integer(I4B) :: idelay
6338 integer(I4B) :: node
6355 if (this%thickini(ib) >
dzero)
then
6356 idelay = this%idelay(ib)
6357 node = this%nodelist(ib)
6359 do n = 1, this%ndelaycells
6360 h = this%dbh(n, idelay)
6361 h0 = this%dbh0(n, idelay)
6362 dz = this%dbdz(n, idelay)
6363 dz0 = this%dbdz0(n, idelay)
6364 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6365 wc = dz * this%brg * this%dbtheta(n, idelay)
6366 wc0 = dz0 * this%brg * this%dbtheta0(n, idelay)
6367 v = dsn0 * wc0 * h0 - dsn * wc * h
6368 dwc = dwc + v * tled
6385 integer(I4B),
intent(in) :: ib
6386 real(DP),
intent(in) :: hcell
6387 real(DP),
intent(in) :: hcellold
6388 real(DP),
intent(inout) :: comp
6389 real(DP),
intent(inout) :: compi
6390 real(DP),
intent(inout) :: compe
6392 integer(I4B) :: idelay
6393 integer(I4B) :: ielastic
6394 integer(I4B) :: node
6411 idelay = this%idelay(ib)
6412 ielastic = this%ielastic(ib)
6413 node = this%nodelist(ib)
6419 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
6422 if (this%thickini(ib) >
dzero)
then
6423 fmult = this%dbdzini(1, idelay)
6424 do n = 1, this%ndelaycells
6425 h = this%dbh(n, idelay)
6426 h0 = this%dbh0(n, idelay)
6427 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6428 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske, wfac=wfac)
6429 if (ielastic /= 0)
then
6430 v1 = dsn * ssk * this%dbes(n, idelay) - sske * this%dbes0(n, idelay)
6433 v1 = dsn * ssk * (this%dbes(n, idelay) - this%dbpcs(n, idelay))
6434 v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6436 v = (v1 + v2) * fmult
6440 this%dbcomp(n, idelay) = v * snnew
6445 compi = compi + wfac * v1 * fmult
6446 compe = compe + ((
done - wfac) * v1 + v2) * fmult
6451 comp = comp * this%rnb(ib)
6452 compi = compi * this%rnb(ib)
6453 compe = compe * this%rnb(ib)
6464 integer(I4B),
intent(in) :: ib
6466 integer(I4B) :: idelay
6475 idelay = this%idelay(ib)
6481 do n = 1, this%ndelaycells
6484 comp = this%dbtcomp(n, idelay) + this%dbcomp(n, idelay)
6488 comp = comp / this%rnb(ib)
6491 if (abs(comp) >
dzero)
then
6492 thick = this%dbdzini(n, idelay)
6493 theta = this%dbthetaini(n, idelay)
6494 call this%csub_adj_matprop(comp, thick, theta)
6495 if (thick <=
dzero)
then
6496 write (
errmsg,
'(2(a,i0),a,g0,a)') &
6497 'Adjusted thickness for delay interbed (', ib, &
6498 ') cell (', n,
') is less than or equal to 0 (', thick,
').'
6501 if (theta <=
dzero)
then
6502 write (
errmsg,
'(2(a,i0),a,g0,a)') &
6503 'Adjusted theta for delay interbed (', ib, &
6504 ') cell (', n,
'is less than or equal to 0 (', theta,
').'
6507 this%dbdz(n, idelay) = thick
6508 this%dbtheta(n, idelay) = theta
6509 tthick = tthick + thick
6510 wtheta = wtheta + thick * theta
6512 thick = this%dbdz(n, idelay)
6513 theta = this%dbtheta(n, idelay)
6514 tthick = tthick + thick
6515 wtheta = wtheta + thick * theta
6521 if (tthick >
dzero)
then
6522 wtheta = wtheta / tthick
6527 this%thick(ib) = tthick
6528 this%theta(ib) = wtheta
6544 integer(I4B),
intent(in) :: ib
6545 real(DP),
intent(inout) :: hcof
6546 real(DP),
intent(inout) :: rhs
6548 integer(I4B) :: idelay
6553 idelay = this%idelay(ib)
6556 if (this%thickini(ib) >
dzero)
then
6558 c1 =
dtwo * this%kv(ib) / this%dbdzini(1, idelay)
6559 rhs = -c1 * this%dbh(1, idelay)
6561 this%kv(ib) / this%dbdzini(this%ndelaycells, idelay)
6562 rhs = rhs - c2 * this%dbh(this%ndelaycells, idelay)
6577 integer(I4B),
intent(in) :: ib
6578 integer(I4B),
intent(in) :: n
6579 real(dp),
intent(in) :: hcell
6581 integer(I4B) :: idelay
6586 idelay = this%idelay(ib)
6587 c =
dtwo * this%kv(ib) / this%dbdzini(n, idelay)
6588 q = c * (hcell - this%dbh(n, idelay))
6617 integer(I4B) :: indx
6621 call this%obs%StoreObsType(
'csub', .true., indx)
6626 call this%obs%StoreObsType(
'inelastic-csub', .true., indx)
6631 call this%obs%StoreObsType(
'elastic-csub', .true., indx)
6636 call this%obs%StoreObsType(
'coarse-csub', .false., indx)
6641 call this%obs%StoreObsType(
'csub-cell', .true., indx)
6646 call this%obs%StoreObsType(
'wcomp-csub-cell', .false., indx)
6651 call this%obs%StoreObsType(
'ske', .true., indx)
6656 call this%obs%StoreObsType(
'sk', .true., indx)
6661 call this%obs%StoreObsType(
'ske-cell', .true., indx)
6666 call this%obs%StoreObsType(
'sk-cell', .true., indx)
6671 call this%obs%StoreObsType(
'gstress-cell', .false., indx)
6676 call this%obs%StoreObsType(
'estress-cell', .false., indx)
6681 call this%obs%StoreObsType(
'interbed-compaction', .true., indx)
6686 call this%obs%StoreObsType(
'inelastic-compaction', .true., indx)
6691 call this%obs%StoreObsType(
'elastic-compaction', .true., indx)
6696 call this%obs%StoreObsType(
'coarse-compaction', .false., indx)
6701 call this%obs%StoreObsType(
'inelastic-compaction-cell', .true., indx)
6706 call this%obs%StoreObsType(
'elastic-compaction-cell', .true., indx)
6711 call this%obs%StoreObsType(
'compaction-cell', .true., indx)
6716 call this%obs%StoreObsType(
'thickness', .true., indx)
6721 call this%obs%StoreObsType(
'coarse-thickness', .false., indx)
6726 call this%obs%StoreObsType(
'thickness-cell', .false., indx)
6731 call this%obs%StoreObsType(
'theta', .true., indx)
6736 call this%obs%StoreObsType(
'coarse-theta', .false., indx)
6741 call this%obs%StoreObsType(
'theta-cell', .true., indx)
6746 call this%obs%StoreObsType(
'preconstress-cell', .false., indx)
6751 call this%obs%StoreObsType(
'interbed-compaction-pct', .false., indx)
6756 call this%obs%StoreObsType(
'delay-preconstress', .false., indx)
6761 call this%obs%StoreObsType(
'delay-head', .false., indx)
6766 call this%obs%StoreObsType(
'delay-gstress', .false., indx)
6771 call this%obs%StoreObsType(
'delay-estress', .false., indx)
6776 call this%obs%StoreObsType(
'delay-compaction', .false., indx)
6781 call this%obs%StoreObsType(
'delay-thickness', .false., indx)
6786 call this%obs%StoreObsType(
'delay-theta', .false., indx)
6791 call this%obs%StoreObsType(
'delay-flowtop', .true., indx)
6796 call this%obs%StoreObsType(
'delay-flowbot', .true., indx)
6813 integer(I4B) :: idelay
6814 integer(I4B) :: ncol
6815 integer(I4B) :: node
6822 if (this%obs%npakobs > 0)
then
6823 call this%obs%obs_bd_clear()
6824 do i = 1, this%obs%npakobs
6825 obsrv => this%obs%pakobs(i)%obsrv
6826 if (obsrv%BndFound)
then
6827 if (obsrv%ObsTypeId ==
'SKE' .or. &
6828 obsrv%ObsTypeId ==
'SK' .or. &
6829 obsrv%ObsTypeId ==
'SKE-CELL' .or. &
6830 obsrv%ObsTypeId ==
'SK-CELL' .or. &
6831 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
6832 obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
6833 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
6834 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
6835 obsrv%ObsTypeId ==
'PRECONSTRESS-CELL')
then
6836 if (this%gwfiss /= 0)
then
6837 call this%obs%SaveOneSimval(obsrv,
dnodata)
6840 do j = 1, obsrv%indxbnds_count
6841 n = obsrv%indxbnds(j)
6842 select case (obsrv%ObsTypeId)
6863 case (
'DELAY-HEAD',
'DELAY-PRECONSTRESS', &
6864 'DELAY-GSTRESS',
'DELAY-ESTRESS')
6865 if (n > this%ndelaycells)
then
6866 r = real(n - 1, dp) / real(this%ndelaycells, dp)
6867 idelay = int(floor(r)) + 1
6868 ncol = n - int(floor(r)) * this%ndelaycells
6873 select case (obsrv%ObsTypeId)
6875 v = this%dbh(ncol, idelay)
6876 case (
'DELAY-PRECONSTRESS')
6877 v = this%dbpcs(ncol, idelay)
6878 case (
'DELAY-GSTRESS')
6879 v = this%dbgeo(ncol, idelay)
6880 case (
'DELAY-ESTRESS')
6881 v = this%dbes(ncol, idelay)
6883 case (
'PRECONSTRESS-CELL')
6886 errmsg =
"Unrecognized observation type '"// &
6887 trim(obsrv%ObsTypeId)//
"'."
6890 call this%obs%SaveOneSimval(obsrv, v)
6895 do j = 1, obsrv%indxbnds_count
6896 n = obsrv%indxbnds(j)
6897 select case (obsrv%ObsTypeId)
6899 v = this%storagee(n) + this%storagei(n)
6900 case (
'INELASTIC-CSUB')
6901 v = this%storagei(n)
6902 case (
'ELASTIC-CSUB')
6903 v = this%storagee(n)
6904 case (
'COARSE-CSUB')
6906 case (
'WCOMP-CSUB-CELL')
6907 v = this%cell_wcstor(n)
6914 v = this%storagee(n) + this%storagei(n)
6918 case (
'COARSE-THETA')
6919 v = this%cg_theta(n)
6924 f = this%cg_thick(n) / this%cell_thick(n)
6925 v = f * this%cg_theta(n)
6927 node = this%nodelist(n)
6928 f = this%csub_calc_interbed_thickness(n) / this%cell_thick(node)
6929 v = f * this%theta(n)
6931 case (
'GSTRESS-CELL')
6933 case (
'ESTRESS-CELL')
6935 case (
'INTERBED-COMPACTION')
6937 case (
'INTERBED-COMPACTION-PCT')
6938 b0 = this%thickini(n)
6939 if (this%idelay(n) /= 0)
then
6940 b0 = b0 * this%rnb(n)
6943 case (
'INELASTIC-COMPACTION')
6945 case (
'ELASTIC-COMPACTION')
6947 case (
'COARSE-COMPACTION')
6948 v = this%cg_tcomp(n)
6949 case (
'INELASTIC-COMPACTION-CELL')
6955 case (
'ELASTIC-COMPACTION-CELL')
6959 v = this%cg_tcomp(n)
6963 case (
'COMPACTION-CELL')
6967 v = this%cg_tcomp(n)
6972 idelay = this%idelay(n)
6974 if (idelay /= 0)
then
6977 case (
'COARSE-THICKNESS')
6978 v = this%cg_thick(n)
6979 case (
'THICKNESS-CELL')
6980 v = this%cell_thick(n)
6981 case (
'DELAY-COMPACTION',
'DELAY-THICKNESS', &
6983 if (n > this%ndelaycells)
then
6984 r = real(n, dp) / real(this%ndelaycells, dp)
6985 idelay = int(floor(r)) + 1
6986 ncol = mod(n, this%ndelaycells)
6991 select case (obsrv%ObsTypeId)
6992 case (
'DELAY-COMPACTION')
6993 v = this%dbtcomp(ncol, idelay)
6994 case (
'DELAY-THICKNESS')
6995 v = this%dbdz(ncol, idelay)
6996 case (
'DELAY-THETA')
6997 v = this%dbtheta(ncol, idelay)
6999 case (
'DELAY-FLOWTOP')
7000 idelay = this%idelay(n)
7001 v = this%dbflowtop(idelay)
7002 case (
'DELAY-FLOWBOT')
7003 idelay = this%idelay(n)
7004 v = this%dbflowbot(idelay)
7006 errmsg =
"Unrecognized observation type: '"// &
7007 trim(obsrv%ObsTypeId)//
"'."
7010 call this%obs%SaveOneSimval(obsrv, v)
7014 call this%obs%SaveOneSimval(obsrv,
dnodata)
7037 character(len=LENBOUNDNAME) :: bname
7042 integer(I4B) :: idelay
7045 if (.not. this%csub_obs_supported())
then
7053 do i = 1, this%obs%npakobs
7054 obsrv => this%obs%pakobs(i)%obsrv
7057 obsrv%BndFound = .false.
7059 bname = obsrv%FeatureName
7060 if (bname /=
'')
then
7065 do j = 1, this%ninterbeds
7066 if (this%boundname(j) == bname)
then
7067 obsrv%BndFound = .true.
7068 obsrv%CurrentTimeStepEndValue =
dzero
7069 call obsrv%AddObsIndex(j)
7074 else if (obsrv%ObsTypeId ==
'GSTRESS-CELL' .or. &
7075 obsrv%ObsTypeId ==
'ESTRESS-CELL' .or. &
7076 obsrv%ObsTypeId ==
'THICKNESS-CELL' .or. &
7077 obsrv%ObsTypeId ==
'COARSE-CSUB' .or. &
7078 obsrv%ObsTypeId ==
'WCOMP-CSUB-CELL' .or. &
7079 obsrv%ObsTypeId ==
'COARSE-COMPACTION' .or. &
7080 obsrv%ObsTypeId ==
'COARSE-THETA' .or. &
7081 obsrv%ObsTypeId ==
'COARSE-THICKNESS')
then
7082 obsrv%BndFound = .true.
7083 obsrv%CurrentTimeStepEndValue =
dzero
7084 call obsrv%AddObsIndex(obsrv%NodeNumber)
7085 else if (obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
7086 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
7087 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
7088 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
7089 obsrv%ObsTypeId ==
'DELAY-COMPACTION' .or. &
7090 obsrv%ObsTypeId ==
'DELAY-THICKNESS' .or. &
7091 obsrv%ObsTypeId ==
'DELAY-THETA')
then
7092 if (this%ninterbeds > 0)
then
7093 n = obsrv%NodeNumber
7094 idelay = this%idelay(n)
7095 if (idelay /= 0)
then
7096 j = (idelay - 1) * this%ndelaycells + 1
7097 n2 = obsrv%NodeNumber2
7098 if (n2 < 1 .or. n2 > this%ndelaycells)
then
7099 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7100 trim(adjustl(obsrv%ObsTypeId)),
'interbed cell must be ', &
7101 'greater than 0 and less than or equal to', this%ndelaycells, &
7102 '(specified value is ', n2,
').'
7105 j = (idelay - 1) * this%ndelaycells + n2
7107 obsrv%BndFound = .true.
7108 call obsrv%AddObsIndex(j)
7113 else if (obsrv%ObsTypeId ==
'CSUB' .or. &
7114 obsrv%ObsTypeId ==
'INELASTIC-CSUB' .or. &
7115 obsrv%ObsTypeId ==
'ELASTIC-CSUB' .or. &
7116 obsrv%ObsTypeId ==
'SK' .or. &
7117 obsrv%ObsTypeId ==
'SKE' .or. &
7118 obsrv%ObsTypeId ==
'THICKNESS' .or. &
7119 obsrv%ObsTypeId ==
'THETA' .or. &
7120 obsrv%ObsTypeId ==
'INTERBED-COMPACTION' .or. &
7121 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION' .or. &
7122 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION' .or. &
7123 obsrv%ObsTypeId ==
'INTERBED-COMPACTION-PCT')
then
7124 if (this%ninterbeds > 0)
then
7125 j = obsrv%NodeNumber
7126 if (j < 1 .or. j > this%ninterbeds)
then
7127 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7128 trim(adjustl(obsrv%ObsTypeId)),
'interbed cell must be greater', &
7129 'than 0 and less than or equal to', this%ninterbeds, &
7130 '(specified value is ', j,
').'
7133 obsrv%BndFound = .true.
7134 obsrv%CurrentTimeStepEndValue =
dzero
7135 call obsrv%AddObsIndex(j)
7138 else if (obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
7139 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
7140 if (this%ninterbeds > 0)
then
7141 j = obsrv%NodeNumber
7142 if (j < 1 .or. j > this%ninterbeds)
then
7143 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7144 trim(adjustl(obsrv%ObsTypeId)), &
7145 'interbed cell must be greater ', &
7146 'than 0 and less than or equal to', this%ninterbeds, &
7147 '(specified value is ', j,
').'
7150 idelay = this%idelay(j)
7151 if (idelay /= 0)
then
7152 obsrv%BndFound = .true.
7153 obsrv%CurrentTimeStepEndValue =
dzero
7154 call obsrv%AddObsIndex(j)
7162 if (obsrv%ObsTypeId ==
'CSUB-CELL' .or. &
7163 obsrv%ObsTypeId ==
'SKE-CELL' .or. &
7164 obsrv%ObsTypeId ==
'SK-CELL' .or. &
7165 obsrv%ObsTypeId ==
'THETA-CELL' .or. &
7166 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION-CELL' .or. &
7167 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION-CELL' .or. &
7168 obsrv%ObsTypeId ==
'COMPACTION-CELL')
then
7169 if (.NOT. obsrv%BndFound)
then
7170 obsrv%BndFound = .true.
7171 obsrv%CurrentTimeStepEndValue =
dzero
7172 call obsrv%AddObsIndex(obsrv%NodeNumber)
7175 jloop:
do j = 1, this%ninterbeds
7176 if (this%nodelist(j) == obsrv%NodeNumber)
then
7177 obsrv%BndFound = .true.
7178 obsrv%CurrentTimeStepEndValue =
dzero
7179 call obsrv%AddObsIndex(j)
7206 integer(I4B),
intent(in) :: inunitobs
7207 integer(I4B),
intent(in) :: iout
7211 integer(I4B) :: icol, istart, istop
7212 character(len=LINELENGTH) :: string
7213 character(len=LENBOUNDNAME) :: bndname
7214 logical(LGP) :: flag_string
7215 logical(LGP) :: flag_idcellno
7216 logical(LGP) :: flag_error
7219 string = obsrv%IDstring
7220 flag_string = .true.
7221 flag_idcellno = .false.
7222 flag_error = .false.
7223 if (obsrv%ObsTypeId(1:5) ==
"DELAY" .AND. &
7224 obsrv%ObsTypeId(1:10) /=
"DELAY-FLOW")
then
7225 flag_idcellno = .true.
7234 if (obsrv%ObsTypeId ==
'CSUB' .or. &
7235 obsrv%ObsTypeId ==
'INELASTIC-CSUB' .or. &
7236 obsrv%ObsTypeId ==
'ELASTIC-CSUB' .or. &
7237 obsrv%ObsTypeId ==
'SK' .or. &
7238 obsrv%ObsTypeId ==
'SKE' .or. &
7239 obsrv%ObsTypeId ==
'THETA' .or. &
7240 obsrv%ObsTypeId ==
'THICKNESS' .or. &
7241 obsrv%ObsTypeId ==
'INTERBED-COMPACTION' .or. &
7242 obsrv%ObsTypeId ==
'INTERBED-COMPACTION-PCT' .or. &
7243 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION' .or. &
7244 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION' .or. &
7245 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
7246 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
7247 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
7248 obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
7249 obsrv%ObsTypeId ==
'DELAY-COMPACTION' .or. &
7250 obsrv%ObsTypeId ==
'DELAY-THICKNESS' .or. &
7251 obsrv%ObsTypeId ==
'DELAY-THETA' .or. &
7252 obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
7253 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
7257 nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
7258 iout, string, flag_string)
7261 if (obsrv%ObsTypeId ==
'SK' .or. &
7262 obsrv%ObsTypeId ==
'SKE' .or. &
7263 obsrv%ObsTypeId ==
'THETA' .or. &
7264 obsrv%ObsTypeId ==
'THICKNESS' .or. &
7265 obsrv%ObsTypeId ==
'INTERBED-COMPACTION' .or. &
7266 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION' .or. &
7267 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION' .or. &
7268 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
7269 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
7270 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
7271 obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
7272 obsrv%ObsTypeId ==
'DELAY-COMPACTION' .or. &
7273 obsrv%ObsTypeId ==
'DELAY-THICKNESS' .or. &
7274 obsrv%ObsTypeId ==
'DELAY-THETA')
then
7277 "BOUNDNAME ('", trim(adjustl(bndname)), &
7278 "') not allowed for CSUB observation type '", &
7279 trim(adjustl(obsrv%ObsTypeId)),
"'."
7284 else if (obsrv%ObsTypeId ==
'CSUB' .or. &
7285 obsrv%ObsTypeId ==
'INELASTIC-CSUB' .or. &
7286 obsrv%ObsTypeId ==
'ELASTIC-CSUB' .or. &
7290 obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
7291 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
7293 obsrv%FeatureName = bndname
7297 if (flag_idcellno .EQV. .true. .AND. flag_error .EQV. .false.)
then
7302 "BOUNDNAME ('", trim(adjustl(bndname)), &
7303 "') not allowed for CSUB observation type '", &
7304 trim(adjustl(obsrv%ObsTypeId)),
"' idcellno."
7307 obsrv%NodeNumber2 = nn2
7313 obsrv%NodeNumber = nn1
7327 this%listlabel = trim(this%filtyp)//
' NO.'
7328 if (this%dis%ndim == 3)
then
7329 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
7330 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
7331 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
7332 elseif (this%dis%ndim == 2)
then
7333 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
7334 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
7336 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
7338 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'SIG0'
7339 if (this%inamedbound == 1)
then
7340 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 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 ...