55 character(len=LENBUDTXT),
dimension(4) ::
budtxt = & !< text labels for budget terms
60 character(len=LENBUDTXT),
dimension(6) ::
comptxt = & !< text labels for compaction terms
75 character(len=LENLISTLABEL),
pointer :: listlabel => null()
76 character(len=LENMEMPATH),
pointer :: stomempath => null()
78 character(len=LENBOUNDNAME),
dimension(:), &
79 pointer,
contiguous :: boundname => null()
80 character(len=LENAUXNAME),
dimension(:), &
81 pointer,
contiguous :: auxname => null()
83 logical(LGP),
pointer :: lhead_based => null()
85 integer(I4B),
pointer :: istounit => null()
86 integer(I4B),
pointer :: istrainib => null()
87 integer(I4B),
pointer :: istrainsk => null()
88 integer(I4B),
pointer :: ioutcomp => null()
89 integer(I4B),
pointer :: ioutcompi => null()
90 integer(I4B),
pointer :: ioutcompe => null()
91 integer(I4B),
pointer :: ioutcompib => null()
92 integer(I4B),
pointer :: ioutcomps => null()
93 integer(I4B),
pointer :: ioutzdisp => null()
94 integer(I4B),
pointer :: ipakcsv => null()
95 integer(I4B),
pointer :: iupdatematprop => null()
96 integer(I4B),
pointer :: istoragec => null()
97 integer(I4B),
pointer :: icellf => null()
98 integer(I4B),
pointer :: ispecified_pcs => null()
99 integer(I4B),
pointer :: ispecified_dbh => null()
100 integer(I4B),
pointer :: inamedbound => null()
101 integer(I4B),
pointer :: iconvchk => null()
102 integer(I4B),
pointer :: naux => null()
103 integer(I4B),
pointer :: ninterbeds => null()
104 integer(I4B),
pointer :: maxsig0 => null()
105 integer(I4B),
pointer :: nbound => null()
106 integer(I4B),
pointer :: iscloc => null()
107 integer(I4B),
pointer :: iauxmultcol => null()
108 integer(I4B),
pointer :: ndelaycells => null()
109 integer(I4B),
pointer :: ndelaybeds => null()
110 integer(I4B),
pointer :: initialized => null()
111 integer(I4B),
pointer :: ieslag => null()
112 integer(I4B),
pointer :: ipch => null()
113 integer(I4B),
pointer :: iupdatestress => null()
115 real(dp),
pointer :: epsilon => null()
116 real(dp),
pointer :: cc_crit => null()
117 real(dp),
pointer :: gammaw => null()
118 real(dp),
pointer :: beta => null()
119 real(dp),
pointer :: brg => null()
120 real(dp),
pointer :: satomega => null()
122 integer(I4B),
pointer :: gwfiss => null()
123 integer(I4B),
pointer :: gwfiss0 => null()
125 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound => null()
126 integer(I4B),
dimension(:),
pointer,
contiguous :: stoiconv => null()
128 real(dp),
dimension(:),
pointer,
contiguous :: stoss => null()
129 real(dp),
dimension(:),
pointer,
contiguous :: buff => null()
130 real(dp),
dimension(:),
pointer,
contiguous :: buffusr => null()
131 integer,
dimension(:),
pointer,
contiguous :: nodelist => null()
132 integer,
dimension(:),
pointer,
contiguous :: unodelist => null()
135 real(dp),
dimension(:),
pointer,
contiguous :: sgm => null()
136 real(dp),
dimension(:),
pointer,
contiguous :: sgs => null()
137 real(dp),
dimension(:),
pointer,
contiguous :: cg_ske_cr => null()
138 real(dp),
dimension(:),
pointer,
contiguous :: cg_gs => null()
139 real(dp),
dimension(:),
pointer,
contiguous :: cg_es => null()
140 real(dp),
dimension(:),
pointer,
contiguous :: cg_es0 => null()
141 real(dp),
dimension(:),
pointer,
contiguous :: cg_pcs => null()
142 real(dp),
dimension(:),
pointer,
contiguous :: cg_comp => null()
143 real(dp),
dimension(:),
pointer,
contiguous :: cg_tcomp => null()
144 real(dp),
dimension(:),
pointer,
contiguous :: cg_stor => null()
145 real(dp),
dimension(:),
pointer,
contiguous :: cg_ske => null()
146 real(dp),
dimension(:),
pointer,
contiguous :: cg_sk => null()
147 real(dp),
dimension(:),
pointer,
contiguous :: cg_thickini => null()
148 real(dp),
dimension(:),
pointer,
contiguous :: cg_thetaini => null()
149 real(dp),
dimension(:),
pointer,
contiguous :: cg_thick => null()
150 real(dp),
dimension(:),
pointer,
contiguous :: cg_thick0 => null()
151 real(dp),
dimension(:),
pointer,
contiguous :: cg_theta => null()
152 real(dp),
dimension(:),
pointer,
contiguous :: cg_theta0 => null()
155 real(dp),
dimension(:),
pointer,
contiguous :: cell_wcstor => null()
156 real(dp),
dimension(:),
pointer,
contiguous :: cell_thick => null()
159 integer(I4B),
dimension(:),
pointer,
contiguous :: idelay => null()
160 integer(I4B),
dimension(:),
pointer,
contiguous :: ielastic => null()
161 integer(I4B),
dimension(:),
pointer,
contiguous :: iconvert => null()
162 real(dp),
dimension(:),
pointer,
contiguous :: ci => null()
163 real(dp),
dimension(:),
pointer,
contiguous :: rci => null()
164 real(dp),
dimension(:),
pointer,
contiguous :: pcs => null()
165 real(dp),
dimension(:),
pointer,
contiguous :: rnb => null()
166 real(dp),
dimension(:),
pointer,
contiguous :: kv => null()
167 real(dp),
dimension(:),
pointer,
contiguous :: h0 => null()
168 real(dp),
dimension(:),
pointer,
contiguous :: comp => null()
169 real(dp),
dimension(:),
pointer,
contiguous :: tcomp => null()
170 real(dp),
dimension(:),
pointer,
contiguous :: tcompi => null()
171 real(dp),
dimension(:),
pointer,
contiguous :: tcompe => null()
172 real(dp),
dimension(:),
pointer,
contiguous :: storagee => null()
173 real(dp),
dimension(:),
pointer,
contiguous :: storagei => null()
174 real(dp),
dimension(:),
pointer,
contiguous :: ske => null()
175 real(dp),
dimension(:),
pointer,
contiguous :: sk => null()
176 real(dp),
dimension(:),
pointer,
contiguous :: thickini => null()
177 real(dp),
dimension(:),
pointer,
contiguous :: thetaini => null()
178 real(dp),
dimension(:),
pointer,
contiguous :: thick => null()
179 real(dp),
dimension(:),
pointer,
contiguous :: thick0 => null()
180 real(dp),
dimension(:),
pointer,
contiguous :: theta => null()
181 real(dp),
dimension(:),
pointer,
contiguous :: theta0 => null()
182 real(dp),
dimension(:, :),
pointer,
contiguous :: auxvar => null()
185 integer(I4B),
dimension(:),
pointer,
contiguous :: idb_nconv_count => null()
186 integer(I4B),
dimension(:, :),
pointer,
contiguous :: idbconvert => null()
187 real(dp),
dimension(:),
pointer,
contiguous :: dbdhmax => null()
188 real(dp),
dimension(:, :),
pointer,
contiguous :: dbz => null()
189 real(dp),
dimension(:, :),
pointer,
contiguous :: dbrelz => null()
190 real(dp),
dimension(:, :),
pointer,
contiguous :: dbh => null()
191 real(dp),
dimension(:, :),
pointer,
contiguous :: dbh0 => null()
192 real(dp),
dimension(:, :),
pointer,
contiguous :: dbgeo => null()
193 real(dp),
dimension(:, :),
pointer,
contiguous :: dbes => null()
194 real(dp),
dimension(:, :),
pointer,
contiguous :: dbes0 => null()
195 real(dp),
dimension(:, :),
pointer,
contiguous :: dbpcs => null()
196 real(dp),
dimension(:),
pointer,
contiguous :: dbflowtop => null()
197 real(dp),
dimension(:),
pointer,
contiguous :: dbflowbot => null()
198 real(dp),
dimension(:, :),
pointer,
contiguous :: dbdzini => null()
199 real(dp),
dimension(:, :),
pointer,
contiguous :: dbthetaini => null()
200 real(dp),
dimension(:, :),
pointer,
contiguous :: dbdz => null()
201 real(dp),
dimension(:, :),
pointer,
contiguous :: dbdz0 => null()
202 real(dp),
dimension(:, :),
pointer,
contiguous :: dbtheta => null()
203 real(dp),
dimension(:, :),
pointer,
contiguous :: dbtheta0 => null()
204 real(dp),
dimension(:, :),
pointer,
contiguous :: dbcomp => null()
205 real(dp),
dimension(:, :),
pointer,
contiguous :: dbtcomp => null()
208 real(dp),
dimension(:),
pointer,
contiguous :: dbal => null()
209 real(dp),
dimension(:),
pointer,
contiguous :: dbad => null()
210 real(dp),
dimension(:),
pointer,
contiguous :: dbau => null()
211 real(dp),
dimension(:),
pointer,
contiguous :: dbrhs => null()
212 real(dp),
dimension(:),
pointer,
contiguous :: dbdh => null()
213 real(dp),
dimension(:),
pointer,
contiguous :: dbaw => null()
216 integer(I4B),
dimension(:),
pointer,
contiguous :: nodelistsig0 => null()
217 real(dp),
dimension(:),
pointer,
contiguous :: sig0 => null()
223 integer(I4B),
pointer :: inobspkg => null()
324 subroutine csub_cr(csubobj, name_model, istounit, stoPckName, inunit, iout)
327 character(len=*),
intent(in) :: name_model
328 integer(I4B),
intent(in) :: inunit
329 integer(I4B),
intent(in) :: istounit
330 character(len=*),
intent(in) :: stopckname
331 integer(I4B),
intent(in) :: iout
338 call csubobj%set_names(1, name_model,
'CSUB',
'CSUB')
341 call csubobj%csub_allocate_scalars()
347 csubobj%istounit = istounit
348 csubobj%inunit = inunit
352 call csubobj%parser%Initialize(csubobj%inunit, csubobj%iout)
368 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound
370 logical(LGP) :: isfound, endOfBlock
371 character(len=:),
allocatable :: line
372 character(len=LINELENGTH) :: keyword
373 character(len=20) :: cellid
375 integer(I4B) :: istheta
378 integer(I4B) :: idelay
381 integer(I4B) :: istart
382 integer(I4B) :: istop
385 integer(I4B) :: istoerr
389 real(DP) :: cg_ske_cr
393 character(len=*),
parameter :: fmtcsub = &
394 "(1x,/1x,'CSUB -- COMPACTION PACKAGE, VERSION 1, 12/15/2019', &
395 &' INPUT READ FROM UNIT ', i0, //)"
398 write (this%iout, fmtcsub) this%inunit
402 this%ibound => ibound
408 call obs_cr(this%obs, this%inobspkg)
411 call this%read_options()
415 call this%tsmanager%tsmanager_df()
418 call this%read_dimensions()
421 call this%obs%obs_ar()
424 call this%csub_initialize_tables()
428 call this%parser%StoreErrorUnit()
432 call this%csub_allocate_arrays()
441 call this%parser%GetBlock(
'GRIDDATA', isfound, ierr)
444 call this%parser%GetNextLine(endofblock)
446 call this%parser%GetStringCaps(keyword)
447 call this%parser%GetRemainingLine(line)
449 select case (keyword)
451 call this%dis%read_grid_array(line, lloc, istart, istop, &
452 this%iout, this%parser%iuactive, &
453 this%cg_ske_cr,
'CG_SKE_CR')
456 call this%dis%read_grid_array(line, lloc, istart, istop, &
457 this%iout, this%parser%iuactive, &
458 this%cg_thetaini,
'CG_THETA')
461 call this%dis%read_grid_array(line, lloc, istart, istop, &
462 this%iout, this%parser%iuactive, &
466 call this%dis%read_grid_array(line, lloc, istart, istop, &
467 this%iout, this%parser%iuactive, &
471 write (
errmsg,
'(a,1x,a,a)') &
472 "Unknown GRIDDATA tag '", trim(keyword),
"'."
477 call store_error(
'Required GRIDDATA block not found.')
482 write (
errmsg,
'(a)')
'CG_SKE GRIDDATA must be specified.'
485 if (istheta == 0)
then
486 write (
errmsg,
'(a)')
'CG_THETA GRIDDATA must be specified.'
492 do node = 1, this%dis%nodes
493 this%sgm(node) = 1.7d0
497 do node = 1, this%dis%nodes
498 this%sgs(node) = 2.0d0
506 do node = 1, this%dis%nodes
507 call this%dis%noder_to_string(node, cellid)
508 cg_ske_cr = this%cg_ske_cr(node)
509 theta = this%cg_thetaini(node)
512 if (cg_ske_cr < dzero)
then
513 write (
errmsg,
'(a,g0,a,1x,a,1x,a,a)') &
514 'Coarse-grained material CG_SKE_CR (', cg_ske_cr,
') is less', &
515 'than zero in cell', trim(adjustl(cellid)),
'.'
519 if (this%stoss(node) /= dzero)
then
524 if (theta > done .or. theta < dzero)
then
525 write (
errmsg,
'(a,g0,a,1x,a,1x,a,a)') &
526 'Coarse-grained material THETA (', theta,
') is less', &
527 'than zero or greater than 1 in cell', trim(adjustl(cellid)),
'.'
533 if (istoerr /= 0)
then
534 write (
errmsg,
'(a,3(1x,a))') &
535 'Specific storage values in the storage (STO) package must', &
536 'be zero in all active cells when using the', &
537 trim(adjustl(this%packName)), &
543 if (this%ninterbeds > 0)
then
544 call this%csub_read_packagedata()
548 do node = 1, this%dis%nodes
549 top = this%dis%top(node)
550 bot = this%dis%bot(node)
551 this%cg_thickini(node) = top - bot
552 this%cell_thick(node) = top - bot
556 do ib = 1, this%ninterbeds
557 node = this%nodelist(ib)
558 idelay = this%idelay(ib)
559 if (idelay == 0)
then
560 v = this%thickini(ib)
562 v = this%rnb(ib) * this%thickini(ib)
564 this%cg_thickini(node) = this%cg_thickini(node) - v
568 do node = 1, this%dis%nodes
569 thick = this%cg_thickini(node)
570 if (thick < dzero)
then
571 call this%dis%noder_to_string(node, cellid)
572 write (
errmsg,
'(a,g0,a,1x,a,a)') &
573 'Aquifer thickness is less than zero (', &
574 thick,
') in cell', trim(adjustl(cellid)),
'.'
581 call this%parser%StoreErrorUnit()
587 if (this%iupdatematprop /= 0)
then
588 do node = 1, this%dis%nodes
589 this%cg_thick(node) = this%cg_thickini(node)
590 this%cg_theta(node) = this%cg_thetaini(node)
609 character(len=LINELENGTH) :: keyword
610 character(len=:),
allocatable :: line
611 character(len=MAXCHARLEN) :: fname
612 character(len=LENAUXNAME),
dimension(:),
allocatable :: caux
613 logical(LGP) :: isfound
614 logical(LGP) :: endOfBlock
617 integer(I4B) :: istart
618 integer(I4B) :: istop
620 integer(I4B) :: inobs
622 integer(I4B) :: ieslag
623 integer(I4B) :: isetgamma
625 character(len=*),
parameter :: fmtts = &
626 &
"(4x,'TIME-SERIES DATA WILL BE READ FROM FILE: ',a)"
627 character(len=*),
parameter :: fmtflow = &
628 &
"(4x,'FLOWS WILL BE SAVED TO FILE: ',a,/4x,'OPENED ON UNIT: ',I7)"
629 character(len=*),
parameter :: fmtflow2 = &
630 &
"(4x,'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL')"
631 character(len=*),
parameter :: fmtssessv = &
632 &
"(4x,'USING SSE AND SSV INSTEAD OF CR AND CC.')"
633 character(len=*),
parameter :: fmtoffset = &
634 &
"(4x,'INITIAL_STRESS TREATED AS AN OFFSET.')"
635 character(len=*),
parameter :: fmtopt = &
637 character(len=*),
parameter :: fmtopti = &
639 character(len=*),
parameter :: fmtoptr = &
641 character(len=*),
parameter :: fmtfileout = &
642 "(4x,'CSUB ',1x,a,1x,' WILL BE SAVED TO FILE: ',a,/4x,&
643 &'OPENED ON UNIT: ',I7)"
651 call this%parser%GetBlock(
'OPTIONS', isfound, ierr, blockrequired=.false., &
652 supportopenclose=.true.)
656 write (this%iout,
'(1x,a)')
'PROCESSING CSUB OPTIONS'
658 call this%parser%GetNextLine(endofblock)
662 call this%parser%GetStringCaps(keyword)
663 select case (keyword)
664 case (
'AUX',
'AUXILIARY')
665 call this%parser%GetRemainingLine(line)
667 call urdaux(this%naux, this%parser%iuactive, this%iout, lloc, &
668 istart, istop, caux, line, this%packName)
670 'AUXNAME', this%memoryPath)
672 this%auxname(n) = caux(n)
677 write (this%iout, fmtflow2)
680 write (this%iout,
'(4x,a)') &
681 'LISTS OF '//trim(adjustl(this%packName))//
' CELLS WILL BE PRINTED.'
684 write (this%iout,
'(4x,a)') trim(adjustl(this%packName))// &
685 ' FLOWS WILL BE PRINTED TO LISTING FILE.'
688 write (this%iout,
'(4x,a)') trim(adjustl(this%packName))// &
689 ' BOUNDARIES HAVE NAMES IN LAST COLUMN.'
691 call this%parser%GetStringCaps(keyword)
692 if (trim(adjustl(keyword)) /=
'FILEIN')
then
693 errmsg =
'TS6 keyword must be followed by "FILEIN" '// &
696 call this%parser%StoreErrorUnit()
698 call this%parser%GetString(fname)
699 write (this%iout, fmtts) trim(fname)
700 call this%TsManager%add_tsfile(fname, this%inunit)
702 call this%parser%GetStringCaps(keyword)
703 if (trim(adjustl(keyword)) /=
'FILEIN')
then
704 errmsg =
'OBS6 keyword must be followed by "FILEIN" '// &
708 if (this%obs%active)
then
709 errmsg =
'Multiple OBS6 keywords detected in OPTIONS block. '// &
710 'Only one OBS6 entry allowed for a package.'
713 this%obs%active = .true.
714 call this%parser%GetString(this%obs%inputFilename)
716 call openfile(inobs, this%iout, this%obs%inputFilename,
'OBS')
717 this%obs%inUnitObs = inobs
718 this%inobspkg = inobs
720 call this%obs%obs_df(this%iout, this%packName, this%filtyp, this%dis)
721 call this%csub_df_obs()
725 this%gammaw = this%parser%GetDouble()
728 this%beta = this%parser%GetDouble()
732 this%lhead_based = .true.
733 case (
'INITIAL_PRECONSOLIDATION_HEAD')
736 this%ndelaycells = this%parser%GetInteger()
740 case (
'COMPRESSION_INDICES')
744 case (
'UPDATE_MATERIAL_PROPERTIES')
745 this%iupdatematprop = 1
748 case (
'CELL_FRACTION')
752 case (
'SPECIFIED_INITIAL_INTERBED_STATE')
753 this%ispecified_pcs = 1
754 this%ispecified_dbh = 1
757 case (
'SPECIFIED_INITIAL_PRECONSOLIDATION_STRESS')
758 this%ispecified_pcs = 1
761 case (
'SPECIFIED_INITIAL_DELAY_HEAD')
762 this%ispecified_dbh = 1
765 case (
'EFFECTIVE_STRESS_LAG')
769 case (
'STRAIN_CSV_INTERBED')
770 call this%parser%GetStringCaps(keyword)
771 if (keyword ==
'FILEOUT')
then
772 call this%parser%GetString(fname)
774 call openfile(this%istrainib, this%iout, fname,
'CSV_OUTPUT', &
775 filstat_opt=
'REPLACE', mode_opt=
mnormal)
776 write (this%iout, fmtfileout) &
777 'INTERBED STRAIN CSV', fname, this%istrainib
779 errmsg =
'Optional STRAIN_CSV_INTERBED keyword must be '// &
780 'followed by FILEOUT.'
783 case (
'STRAIN_CSV_COARSE')
784 call this%parser%GetStringCaps(keyword)
785 if (keyword ==
'FILEOUT')
then
786 call this%parser%GetString(fname)
788 call openfile(this%istrainsk, this%iout, fname,
'CSV_OUTPUT', &
789 filstat_opt=
'REPLACE', mode_opt=
mnormal)
790 write (this%iout, fmtfileout) &
791 'COARSE STRAIN CSV', fname, this%istrainsk
793 errmsg =
'Optional STRAIN_CSV_COARSE keyword must be '// &
794 'followed by fileout.'
800 call this%parser%GetStringCaps(keyword)
801 if (keyword ==
'FILEOUT')
then
802 call this%parser%GetString(fname)
804 call openfile(this%ioutcomp, this%iout, fname,
'DATA(BINARY)', &
806 write (this%iout, fmtfileout) &
807 'COMPACTION', fname, this%ioutcomp
809 errmsg =
'Optional COMPACTION keyword must be '// &
810 'followed by FILEOUT.'
813 case (
'COMPACTION_INELASTIC')
814 call this%parser%GetStringCaps(keyword)
815 if (keyword ==
'FILEOUT')
then
816 call this%parser%GetString(fname)
818 call openfile(this%ioutcompi, this%iout, fname, &
821 write (this%iout, fmtfileout) &
822 'COMPACTION_INELASTIC', fname, this%ioutcompi
824 errmsg =
'Optional COMPACTION_INELASTIC keyword must be '// &
825 'followed by fileout.'
828 case (
'COMPACTION_ELASTIC')
829 call this%parser%GetStringCaps(keyword)
830 if (keyword ==
'FILEOUT')
then
831 call this%parser%GetString(fname)
833 call openfile(this%ioutcompe, this%iout, fname, &
836 write (this%iout, fmtfileout) &
837 'COMPACTION_ELASTIC', fname, this%ioutcompe
839 errmsg =
'Optional COMPACTION_ELASTIC keyword must be '// &
840 'followed by FILEOUT.'
843 case (
'COMPACTION_INTERBED')
844 call this%parser%GetStringCaps(keyword)
845 if (keyword ==
'FILEOUT')
then
846 call this%parser%GetString(fname)
848 call openfile(this%ioutcompib, this%iout, fname, &
851 write (this%iout, fmtfileout) &
852 'COMPACTION_INTERBED', fname, this%ioutcompib
854 errmsg =
'Optional COMPACTION_INTERBED keyword must be '// &
855 'followed by FILEOUT.'
858 case (
'COMPACTION_COARSE')
859 call this%parser%GetStringCaps(keyword)
860 if (keyword ==
'FILEOUT')
then
861 call this%parser%GetString(fname)
863 call openfile(this%ioutcomps, this%iout, fname, &
866 write (this%iout, fmtfileout) &
867 'COMPACTION_COARSE', fname, this%ioutcomps
869 errmsg =
'Optional COMPACTION_COARSE keyword must be '// &
870 'followed by FILEOUT.'
875 case (
'ZDISPLACEMENT')
876 call this%parser%GetStringCaps(keyword)
877 if (keyword ==
'FILEOUT')
then
878 call this%parser%GetString(fname)
880 call openfile(this%ioutzdisp, this%iout, fname, &
883 write (this%iout, fmtfileout) &
884 'ZDISPLACEMENT', fname, this%ioutzdisp
886 errmsg =
'Optional ZDISPLACEMENT keyword must be '// &
887 'followed by FILEOUT.'
891 case (
'PACKAGE_CONVERGENCE')
892 call this%parser%GetStringCaps(keyword)
893 if (keyword ==
'FILEOUT')
then
894 call this%parser%GetString(fname)
896 call openfile(this%ipakcsv, this%iout, fname,
'CSV', &
897 filstat_opt=
'REPLACE', mode_opt=
mnormal)
898 write (this%iout, fmtfileout) &
899 'PACKAGE_CONVERGENCE', fname, this%ipakcsv
901 call store_error(
'Optional PACKAGE_CONVERGENCE keyword must be '// &
902 'followed by FILEOUT.')
909 case (
'DEV_NO_FINAL_CHECK')
910 call this%parser%DevOpt()
912 write (this%iout,
'(4x,a)') &
913 'A FINAL CONVERGENCE CHECK OF THE CHANGE IN DELAY INTERBED '// &
914 'HEADS AND FLOWS WILL NOT BE MADE'
919 write (
errmsg,
'(a,3(1x,a),a)') &
920 'Unknown', trim(adjustl(this%packName)),
"option '", &
925 write (this%iout,
'(1x,a)') &
926 'END OF '//trim(adjustl(this%packName))//
' OPTIONS'
930 write (this%iout,
'(//2(1X,A))') trim(adjustl(this%packName)), &
932 write (this%iout, fmtopti)
'NUMBER OF DELAY CELLS =', &
934 if (this%lhead_based .EQV. .true.)
then
935 write (this%iout,
'(4x,a)') &
936 'HEAD-BASED FORMULATION'
938 write (this%iout,
'(4x,a)') &
939 'EFFECTIVE-STRESS FORMULATION'
941 if (this%istoragec == 0)
then
942 write (this%iout,
'(4x,a,1(/,6x,a))') &
943 'COMPRESSION INDICES WILL BE SPECIFIED INSTEAD OF ELASTIC AND', &
944 'INELASTIC SPECIFIC STORAGE COEFFICIENTS'
946 write (this%iout,
'(4x,a,1(/,6x,a))') &
947 'ELASTIC AND INELASTIC SPECIFIC STORAGE COEFFICIENTS WILL BE ', &
950 if (this%iupdatematprop /= 1)
then
951 write (this%iout,
'(4x,a,1(/,6x,a))') &
952 'THICKNESS AND VOID RATIO WILL NOT BE ADJUSTED DURING THE', &
955 write (this%iout,
'(4x,a)') &
956 'THICKNESS AND VOID RATIO WILL BE ADJUSTED DURING THE SIMULATION'
958 if (this%icellf /= 1)
then
959 write (this%iout,
'(4x,a)') &
960 'INTERBED THICKNESS WILL BE SPECIFIED AS A THICKNESS'
962 write (this%iout,
'(4x,a,1(/,6x,a))') &
963 'INTERBED THICKNESS WILL BE SPECIFIED AS A AS A CELL FRACTION'
965 if (this%ispecified_pcs /= 1)
then
966 if (this%ipch /= 0)
then
967 write (this%iout,
'(4x,a,1(/,6x,a))') &
968 'PRECONSOLIDATION HEAD WILL BE SPECIFIED RELATIVE TO INITIAL', &
971 write (this%iout,
'(4x,a,1(/,6x,a))') &
972 'PRECONSOLIDATION STRESS WILL BE SPECIFIED RELATIVE TO INITIAL', &
976 if (this%ipch /= 0)
then
977 write (this%iout,
'(4x,a,1(/,6x,a))') &
978 'PRECONSOLIDATION HEAD WILL BE SPECIFIED AS ABSOLUTE VALUES', &
979 'INSTEAD OF RELATIVE TO INITIAL HEAD CONDITIONS'
981 write (this%iout,
'(4x,a,1(/,6x,a))') &
982 'PRECONSOLIDATION STRESS WILL BE SPECIFIED AS ABSOLUTE VALUES', &
983 'INSTEAD OF RELATIVE TO INITIAL STRESS CONDITIONS'
986 if (this%ispecified_dbh /= 1)
then
987 write (this%iout,
'(4x,a,1(/,6x,a))') &
988 'DELAY INTERBED HEADS WILL BE SPECIFIED RELATIVE TO INITIAL ', &
991 write (this%iout,
'(4x,a,1(/,6x,a))') &
992 'DELAY INTERBED HEADS WILL BE SPECIFIED AS ABSOLUTE VALUES INSTEAD', &
993 'OF RELATIVE TO INITIAL GWF HEADS'
997 if (this%lhead_based .EQV. .false.)
then
998 if (ieslag /= 0)
then
999 write (this%iout,
'(4x,a,1(/,6x,a))') &
1000 'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE EFFECTIVE', &
1001 'STRESS FROM THE PREVIOUS TIME STEP'
1003 write (this%iout,
'(4x,a,1(/,6x,a))') &
1004 'SPECIFIC STORAGE VALUES WILL BE CALCULATED USING THE CURRENT', &
1008 if (ieslag /= 0)
then
1010 write (this%iout,
'(4x,a,2(/,6x,a))') &
1011 'EFFECTIVE_STRESS_LAG HAS BEEN SPECIFIED BUT HAS NO EFFECT WHEN', &
1012 'USING THE HEAD-BASED FORMULATION (HEAD_BASED HAS BEEN SPECIFIED', &
1013 'IN THE OPTIONS BLOCK)'
1016 this%ieslag = ieslag
1021 this%brg = this%gammaw * this%beta
1023 write (this%iout, fmtoptr)
'GAMMAW =', this%gammaw
1024 write (this%iout, fmtoptr)
'BETA =', this%beta
1025 write (this%iout, fmtoptr)
'GAMMAW * BETA =', this%brg
1029 call this%parser%StoreErrorUnit()
1046 character(len=LENBOUNDNAME) :: keyword
1047 integer(I4B) :: ierr
1048 logical(LGP) :: isfound, endOfBlock
1052 this%ninterbeds = -1
1055 call this%parser%GetBlock(
'DIMENSIONS', isfound, ierr, &
1056 supportopenclose=.true.)
1060 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%packName))// &
1063 call this%parser%GetNextLine(endofblock)
1064 if (endofblock)
exit
1065 call this%parser%GetStringCaps(keyword)
1066 select case (keyword)
1068 this%ninterbeds = this%parser%GetInteger()
1069 write (this%iout,
'(4x,a,i0)')
'NINTERBEDS = ', this%ninterbeds
1071 this%maxsig0 = this%parser%GetInteger()
1072 write (this%iout,
'(4x,a,i0)')
'MAXSIG0 = ', this%maxsig0
1074 write (
errmsg,
'(a,3(1x,a),a)') &
1075 'Unknown', trim(this%packName),
"dimension '", trim(keyword),
"'."
1079 write (this%iout,
'(1x,a)') &
1080 'END OF '//trim(adjustl(this%packName))//
' DIMENSIONS'
1082 call store_error(
'Required dimensions block not found.')
1086 if (this%ninterbeds < 0)
then
1088 'NINTERBEDS was not specified or was specified incorrectly.'
1094 call this%parser%StoreErrorUnit()
1099 call this%define_listlabel()
1115 call this%NumericalPackageType%allocate_scalars()
1122 call mem_allocate(this%istounit,
'ISTOUNIT', this%memoryPath)
1123 call mem_allocate(this%inobspkg,
'INOBSPKG', this%memoryPath)
1124 call mem_allocate(this%ninterbeds,
'NINTERBEDS', this%memoryPath)
1125 call mem_allocate(this%maxsig0,
'MAXSIG0', this%memoryPath)
1126 call mem_allocate(this%nbound,
'NBOUND', this%memoryPath)
1127 call mem_allocate(this%iscloc,
'ISCLOC', this%memoryPath)
1128 call mem_allocate(this%iauxmultcol,
'IAUXMULTCOL', this%memoryPath)
1129 call mem_allocate(this%ndelaycells,
'NDELAYCELLS', this%memoryPath)
1130 call mem_allocate(this%ndelaybeds,
'NDELAYBEDS', this%memoryPath)
1131 call mem_allocate(this%initialized,
'INITIALIZED', this%memoryPath)
1132 call mem_allocate(this%ieslag,
'IESLAG', this%memoryPath)
1134 call mem_allocate(this%lhead_based,
'LHEAD_BASED', this%memoryPath)
1135 call mem_allocate(this%iupdatestress,
'IUPDATESTRESS', this%memoryPath)
1136 call mem_allocate(this%ispecified_pcs,
'ISPECIFIED_PCS', this%memoryPath)
1137 call mem_allocate(this%ispecified_dbh,
'ISPECIFIED_DBH', this%memoryPath)
1138 call mem_allocate(this%inamedbound,
'INAMEDBOUND', this%memoryPath)
1139 call mem_allocate(this%iconvchk,
'ICONVCHK', this%memoryPath)
1141 call mem_allocate(this%istoragec,
'ISTORAGEC', this%memoryPath)
1142 call mem_allocate(this%istrainib,
'ISTRAINIB', this%memoryPath)
1143 call mem_allocate(this%istrainsk,
'ISTRAINSK', this%memoryPath)
1144 call mem_allocate(this%ioutcomp,
'IOUTCOMP', this%memoryPath)
1145 call mem_allocate(this%ioutcompi,
'IOUTCOMPI', this%memoryPath)
1146 call mem_allocate(this%ioutcompe,
'IOUTCOMPE', this%memoryPath)
1147 call mem_allocate(this%ioutcompib,
'IOUTCOMPIB', this%memoryPath)
1148 call mem_allocate(this%ioutcomps,
'IOUTCOMPS', this%memoryPath)
1149 call mem_allocate(this%ioutzdisp,
'IOUTZDISP', this%memoryPath)
1150 call mem_allocate(this%ipakcsv,
'IPAKCSV', this%memoryPath)
1151 call mem_allocate(this%iupdatematprop,
'IUPDATEMATPROP', this%memoryPath)
1152 call mem_allocate(this%epsilon,
'EPSILON', this%memoryPath)
1153 call mem_allocate(this%cc_crit,
'CC_CRIT', this%memoryPath)
1154 call mem_allocate(this%gammaw,
'GAMMAW', this%memoryPath)
1157 call mem_allocate(this%satomega,
'SATOMEGA', this%memoryPath)
1158 call mem_allocate(this%icellf,
'ICELLF', this%memoryPath)
1159 call mem_allocate(this%gwfiss0,
'GWFISS0', this%memoryPath)
1162 allocate (this%TsManager)
1174 this%iauxmultcol = 0
1175 this%ndelaycells = 19
1177 this%initialized = 0
1180 this%lhead_based = .false.
1181 this%iupdatestress = 1
1182 this%ispecified_pcs = 0
1183 this%ispecified_dbh = 0
1184 this%inamedbound = 0
1197 this%iupdatematprop = 0
1198 this%epsilon =
dzero
1201 this%beta = 4.6512e-10_dp
1202 this%brg = this%gammaw * this%beta
1205 if (this%inewton /= 0)
then
1206 this%satomega =
dem6
1209 this%satomega =
dzero
1229 integer(I4B) :: iblen
1230 integer(I4B) :: ilen
1231 integer(I4B) :: naux
1234 if (this%ioutcomp == 0 .and. this%ioutcompi == 0 .and. &
1235 this%ioutcompe == 0 .and. this%ioutcompib == 0 .and. &
1236 this%ioutcomps == 0 .and. this%ioutzdisp == 0)
then
1237 call mem_allocate(this%buff, 1,
'BUFF', trim(this%memoryPath))
1239 call mem_allocate(this%buff, this%dis%nodes,
'BUFF', trim(this%memoryPath))
1241 if (this%ioutcomp == 0 .and. this%ioutzdisp == 0)
then
1242 call mem_allocate(this%buffusr, 1,
'BUFFUSR', trim(this%memoryPath))
1244 call mem_allocate(this%buffusr, this%dis%nodesuser,
'BUFFUSR', &
1245 trim(this%memoryPath))
1247 call mem_allocate(this%sgm, this%dis%nodes,
'SGM', trim(this%memoryPath))
1248 call mem_allocate(this%sgs, this%dis%nodes,
'SGS', trim(this%memoryPath))
1249 call mem_allocate(this%cg_ske_cr, this%dis%nodes,
'CG_SKE_CR', &
1250 trim(this%memoryPath))
1251 call mem_allocate(this%cg_es, this%dis%nodes,
'CG_ES', &
1252 trim(this%memoryPath))
1253 call mem_allocate(this%cg_es0, this%dis%nodes,
'CG_ES0', &
1254 trim(this%memoryPath))
1255 call mem_allocate(this%cg_pcs, this%dis%nodes,
'CG_PCS', &
1256 trim(this%memoryPath))
1257 call mem_allocate(this%cg_comp, this%dis%nodes,
'CG_COMP', &
1258 trim(this%memoryPath))
1259 call mem_allocate(this%cg_tcomp, this%dis%nodes,
'CG_TCOMP', &
1260 trim(this%memoryPath))
1261 call mem_allocate(this%cg_stor, this%dis%nodes,
'CG_STOR', &
1262 trim(this%memoryPath))
1263 call mem_allocate(this%cg_ske, this%dis%nodes,
'CG_SKE', &
1264 trim(this%memoryPath))
1265 call mem_allocate(this%cg_sk, this%dis%nodes,
'CG_SK', &
1266 trim(this%memoryPath))
1267 call mem_allocate(this%cg_thickini, this%dis%nodes,
'CG_THICKINI', &
1268 trim(this%memoryPath))
1269 call mem_allocate(this%cg_thetaini, this%dis%nodes,
'CG_THETAINI', &
1270 trim(this%memoryPath))
1271 if (this%iupdatematprop == 0)
then
1272 call mem_setptr(this%cg_thick,
'CG_THICKINI', trim(this%memoryPath))
1273 call mem_setptr(this%cg_thick0,
'CG_THICKINI', trim(this%memoryPath))
1274 call mem_setptr(this%cg_theta,
'CG_THETAINI', trim(this%memoryPath))
1275 call mem_setptr(this%cg_theta0,
'CG_THETAINI', trim(this%memoryPath))
1277 call mem_allocate(this%cg_thick, this%dis%nodes,
'CG_THICK', &
1278 trim(this%memoryPath))
1279 call mem_allocate(this%cg_thick0, this%dis%nodes,
'CG_THICK0', &
1280 trim(this%memoryPath))
1281 call mem_allocate(this%cg_theta, this%dis%nodes,
'CG_THETA', &
1282 trim(this%memoryPath))
1283 call mem_allocate(this%cg_theta0, this%dis%nodes,
'CG_THETA0', &
1284 trim(this%memoryPath))
1288 call mem_allocate(this%cell_wcstor, this%dis%nodes,
'CELL_WCSTOR', &
1289 trim(this%memoryPath))
1290 call mem_allocate(this%cell_thick, this%dis%nodes,
'CELL_THICK', &
1291 trim(this%memoryPath))
1295 if (this%ninterbeds > 0)
then
1296 iblen = this%ninterbeds
1299 if (this%naux > 0)
then
1302 call mem_allocate(this%auxvar, naux, iblen,
'AUXVAR', this%memoryPath)
1305 this%auxvar(j, n) =
dzero
1308 call mem_allocate(this%unodelist, iblen,
'UNODELIST', trim(this%memoryPath))
1309 call mem_allocate(this%nodelist, iblen,
'NODELIST', trim(this%memoryPath))
1310 call mem_allocate(this%cg_gs, this%dis%nodes,
'CG_GS', trim(this%memoryPath))
1311 call mem_allocate(this%pcs, iblen,
'PCS', trim(this%memoryPath))
1312 call mem_allocate(this%rnb, iblen,
'RNB', trim(this%memoryPath))
1313 call mem_allocate(this%kv, iblen,
'KV', trim(this%memoryPath))
1314 call mem_allocate(this%h0, iblen,
'H0', trim(this%memoryPath))
1315 call mem_allocate(this%ci, iblen,
'CI', trim(this%memoryPath))
1316 call mem_allocate(this%rci, iblen,
'RCI', trim(this%memoryPath))
1317 call mem_allocate(this%idelay, iblen,
'IDELAY', trim(this%memoryPath))
1318 call mem_allocate(this%ielastic, iblen,
'IELASTIC', trim(this%memoryPath))
1319 call mem_allocate(this%iconvert, iblen,
'ICONVERT', trim(this%memoryPath))
1320 call mem_allocate(this%comp, iblen,
'COMP', trim(this%memoryPath))
1321 call mem_allocate(this%tcomp, iblen,
'TCOMP', trim(this%memoryPath))
1322 call mem_allocate(this%tcompi, iblen,
'TCOMPI', trim(this%memoryPath))
1323 call mem_allocate(this%tcompe, iblen,
'TCOMPE', trim(this%memoryPath))
1324 call mem_allocate(this%storagee, iblen,
'STORAGEE', trim(this%memoryPath))
1325 call mem_allocate(this%storagei, iblen,
'STORAGEI', trim(this%memoryPath))
1326 call mem_allocate(this%ske, iblen,
'SKE', trim(this%memoryPath))
1327 call mem_allocate(this%sk, iblen,
'SK', trim(this%memoryPath))
1328 call mem_allocate(this%thickini, iblen,
'THICKINI', trim(this%memoryPath))
1329 call mem_allocate(this%thetaini, iblen,
'THETAINI', trim(this%memoryPath))
1330 if (this%iupdatematprop == 0)
then
1331 call mem_setptr(this%thick,
'THICKINI', trim(this%memoryPath))
1332 call mem_setptr(this%thick0,
'THICKINI', trim(this%memoryPath))
1333 call mem_setptr(this%theta,
'THETAINI', trim(this%memoryPath))
1334 call mem_setptr(this%theta0,
'THETAINI', trim(this%memoryPath))
1336 call mem_allocate(this%thick, iblen,
'THICK', trim(this%memoryPath))
1337 call mem_allocate(this%thick0, iblen,
'THICK0', trim(this%memoryPath))
1338 call mem_allocate(this%theta, iblen,
'THETA', trim(this%memoryPath))
1339 call mem_allocate(this%theta0, iblen,
'THETA0', trim(this%memoryPath))
1346 if (this%inamedbound /= 0)
then
1348 'BOUNDNAME', trim(this%memoryPath))
1351 'BOUNDNAME', trim(this%memoryPath))
1356 if (this%maxsig0 > 0)
then
1361 call mem_allocate(this%nodelistsig0, ilen,
'NODELISTSIG0', this%memoryPath)
1362 call mem_allocate(this%sig0, ilen,
'SIG0', this%memoryPath)
1365 call mem_setptr(this%gwfiss,
'ISS', trim(this%name_model))
1368 call mem_setptr(this%stoiconv,
'ICONVERT', this%stoMemPath)
1369 call mem_setptr(this%stoss,
'SS', this%stoMemPath)
1372 do n = 1, this%dis%nodes
1373 this%cg_gs(n) =
dzero
1374 this%cg_es(n) =
dzero
1375 this%cg_comp(n) =
dzero
1376 this%cg_tcomp(n) =
dzero
1377 this%cell_wcstor(n) =
dzero
1379 do n = 1, this%ninterbeds
1380 this%theta(n) =
dzero
1381 this%tcomp(n) =
dzero
1382 this%tcompi(n) =
dzero
1383 this%tcompe(n) =
dzero
1385 do n = 1, max(1, this%maxsig0)
1386 this%nodelistsig0(n) = 0
1387 this%sig0(n) =
dzero
1404 character(len=LINELENGTH) :: cellid
1405 character(len=LINELENGTH) :: title
1406 character(len=LINELENGTH) :: tag
1407 character(len=20) :: scellid
1408 character(len=10) :: text
1409 character(len=LENBOUNDNAME) :: bndName
1410 character(len=7) :: cdelay
1411 logical(LGP) :: isfound
1412 logical(LGP) :: endOfBlock
1413 integer(I4B) :: ival
1417 integer(I4B) :: itmp
1418 integer(I4B) :: ierr
1419 integer(I4B) :: ndelaybeds
1420 integer(I4B) :: idelay
1421 integer(I4B) :: ntabrows
1422 integer(I4B) :: ntabcols
1428 integer,
allocatable,
dimension(:) :: nboundchk
1434 allocate (nboundchk(this%ninterbeds))
1435 do n = 1, this%ninterbeds
1439 call this%parser%GetBlock(
'PACKAGEDATA', isfound, ierr, &
1440 supportopenclose=.true.)
1444 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%packName))// &
1447 call this%parser%GetNextLine(endofblock)
1448 if (endofblock)
then
1453 itmp = this%parser%GetInteger()
1456 if (itmp < 1 .or. itmp > this%ninterbeds)
then
1457 write (
errmsg,
'(a,1x,i0,2(1x,a),1x,i0,a)') &
1458 'Interbed number (', itmp,
') must be greater than 0 and ', &
1459 'less than or equal to', this%ninterbeds,
'.'
1465 nboundchk(itmp) = nboundchk(itmp) + 1
1468 call this%parser%GetCellid(this%dis%ndim, cellid)
1469 nn = this%dis%noder_from_cellid(cellid, &
1470 this%parser%iuactive, this%iout)
1471 n = this%dis%nodeu_from_cellid(cellid, &
1472 this%parser%iuactive, this%iout)
1473 top = this%dis%top(nn)
1474 bot = this%dis%bot(nn)
1479 write (
errmsg,
'(a,1x,i0,a)') &
1480 'Invalid cellid for packagedata entry', itmp,
'.'
1485 this%nodelist(itmp) = nn
1486 this%unodelist(itmp) = n
1489 call this%parser%GetStringCaps(cdelay)
1490 select case (cdelay)
1494 ndelaybeds = ndelaybeds + 1
1497 write (
errmsg,
'(a,1x,a,1x,i0,1x,a)') &
1498 'Invalid CDELAY ', trim(adjustl(cdelay)), &
1499 'for packagedata entry', itmp,
'.'
1504 this%idelay(itmp) = ival
1507 this%pcs(itmp) = this%parser%GetDouble()
1510 rval = this%parser%GetDouble()
1511 if (this%icellf == 0)
then
1512 if (rval < dzero .or. rval > baq)
then
1513 write (
errmsg,
'(a,g0,2(a,1x),g0,1x,a,1x,i0,a)') &
1514 'THICK (', rval,
') MUST BE greater than or equal to 0 ', &
1515 'and less than or equal to than', baq, &
1516 'for packagedata entry', itmp,
'.'
1520 if (rval < dzero .or. rval > done)
then
1521 write (
errmsg,
'(a,1x,a,1x,i0,a)') &
1522 'FRAC MUST BE greater than 0 and less than or equal to 1', &
1523 'for packagedata entry', itmp,
'.'
1528 this%thickini(itmp) = rval
1529 if (this%iupdatematprop /= 0)
then
1530 this%thick(itmp) = rval
1534 rval = this%parser%GetDouble()
1535 if (idelay > 0)
then
1536 if (rval < done)
then
1537 write (
errmsg,
'(a,g0,a,1x,a,1x,i0,a)') &
1538 'RNB (', rval,
') must be greater than or equal to 1', &
1539 'for packagedata entry', itmp,
'.'
1545 this%rnb(itmp) = rval
1548 rval = this%parser%GetDouble()
1549 if (rval < dzero)
then
1550 write (
errmsg,
'(2(a,1x),i0,a)') &
1551 '(SKV,CI) must be greater than or equal to 0', &
1552 'for packagedata entry', itmp,
'.'
1555 this%ci(itmp) = rval
1558 rval = this%parser%GetDouble()
1559 if (rval < dzero)
then
1560 write (
errmsg,
'(2(a,1x),i0,a)') &
1561 '(SKE,RCI) must be greater than or equal to 0', &
1562 'for packagedata entry', itmp,
'.'
1565 this%rci(itmp) = rval
1568 if (this%ci(itmp) == this%rci(itmp))
then
1569 this%ielastic(itmp) = 1
1571 this%ielastic(itmp) = 0
1575 rval = this%parser%GetDouble()
1576 this%thetaini(itmp) = rval
1577 if (this%iupdatematprop /= 0)
then
1578 this%theta(itmp) = rval
1580 if (rval <= dzero .or. rval > done)
then
1581 write (
errmsg,
'(a,1x,a,1x,i0,a)') &
1582 'THETA must be greater than 0 and less than or equal to 1', &
1583 'for packagedata entry', itmp,
'.'
1588 rval = this%parser%GetDouble()
1589 if (idelay > 0)
then
1590 if (rval <= 0.0)
then
1591 write (
errmsg,
'(a,1x,i0,a)') &
1592 'KV must be greater than 0 for packagedata entry', itmp,
'.'
1596 this%kv(itmp) = rval
1599 rval = this%parser%GetDouble()
1600 this%h0(itmp) = rval
1603 if (this%inamedbound /= 0)
then
1604 call this%parser%GetStringCaps(bndname)
1605 if (len_trim(bndname) < 1)
then
1606 write (
errmsg,
'(a,1x,i0,a)') &
1607 'BOUNDNAME must be specified for packagedata entry', itmp,
'.'
1610 this%boundname(itmp) = bndname
1615 write (this%iout,
'(1x,a)') &
1616 'END OF '//trim(adjustl(this%packName))//
' PACKAGEDATA'
1620 if (this%iprpak == 1)
then
1622 title = trim(adjustl(this%packName))//
' PACKAGE INTERBED DATA'
1625 ntabrows = this%ninterbeds
1627 if (this%inamedbound /= 0)
then
1628 ntabcols = ntabcols + 1
1632 call table_cr(this%inputtab, this%packName, title)
1633 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
1637 call this%inputtab%initialize_column(tag, 10, alignment=tableft)
1639 call this%inputtab%initialize_column(tag, 20, alignment=tabcenter)
1641 call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1643 call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1645 call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1647 call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1649 call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1651 call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1653 call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1655 call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1657 call this%inputtab%initialize_column(tag, 10, alignment=tabcenter)
1658 if (this%inamedbound /= 0)
then
1660 call this%inputtab%initialize_column(tag, lenboundname, &
1665 do ib = 1, this%ninterbeds
1666 call this%dis%noder_to_string(this%nodelist(ib), scellid)
1667 if (this%idelay(ib) == 0)
then
1672 call this%inputtab%add_term(ib)
1673 call this%inputtab%add_term(scellid)
1674 call this%inputtab%add_term(text)
1675 call this%inputtab%add_term(this%pcs(ib))
1676 call this%inputtab%add_term(this%thickini(ib))
1677 call this%inputtab%add_term(this%rnb(ib))
1678 call this%inputtab%add_term(this%ci(ib))
1679 call this%inputtab%add_term(this%rci(ib))
1680 call this%inputtab%add_term(this%thetaini(ib))
1681 if (this%idelay(ib) == 0)
then
1682 call this%inputtab%add_term(
'-')
1683 call this%inputtab%add_term(
'-')
1685 call this%inputtab%add_term(this%kv(ib))
1686 call this%inputtab%add_term(this%h0(ib))
1688 if (this%inamedbound /= 0)
then
1689 call this%inputtab%add_term(this%boundname(ib))
1696 do ib = 1, this%ninterbeds
1697 if (nboundchk(ib) == 0)
then
1698 write (
errmsg,
'(a,1x,i0,a)') &
1699 'Information for interbed', ib,
'not specified in packagedata block.'
1701 else if (nboundchk(ib) > 1)
then
1702 write (
errmsg,
'(2(a,1x,i0),a)') &
1703 'Information specified', nboundchk(ib),
'times for interbed', ib,
'.'
1707 deallocate (nboundchk)
1710 this%ndelaybeds = ndelaybeds
1713 if (ndelaybeds > 0)
then
1718 'IDB_NCONV_COUNT', trim(this%memoryPath))
1719 call mem_allocate(this%idbconvert, this%ndelaycells, ndelaybeds, &
1720 'IDBCONVERT', trim(this%memoryPath))
1722 'DBDHMAX', trim(this%memoryPath))
1723 call mem_allocate(this%dbz, this%ndelaycells, ndelaybeds, &
1724 'DBZ', trim(this%memoryPath))
1725 call mem_allocate(this%dbrelz, this%ndelaycells, ndelaybeds, &
1726 'DBRELZ', trim(this%memoryPath))
1727 call mem_allocate(this%dbh, this%ndelaycells, ndelaybeds, &
1728 'DBH', trim(this%memoryPath))
1729 call mem_allocate(this%dbh0, this%ndelaycells, ndelaybeds, &
1730 'DBH0', trim(this%memoryPath))
1731 call mem_allocate(this%dbgeo, this%ndelaycells, ndelaybeds, &
1732 'DBGEO', trim(this%memoryPath))
1733 call mem_allocate(this%dbes, this%ndelaycells, ndelaybeds, &
1734 'DBES', trim(this%memoryPath))
1735 call mem_allocate(this%dbes0, this%ndelaycells, ndelaybeds, &
1736 'DBES0', trim(this%memoryPath))
1737 call mem_allocate(this%dbpcs, this%ndelaycells, ndelaybeds, &
1738 'DBPCS', trim(this%memoryPath))
1740 'DBFLOWTOP', trim(this%memoryPath))
1742 'DBFLOWBOT', trim(this%memoryPath))
1743 call mem_allocate(this%dbdzini, this%ndelaycells, ndelaybeds, &
1744 'DBDZINI', trim(this%memoryPath))
1745 call mem_allocate(this%dbthetaini, this%ndelaycells, ndelaybeds, &
1746 'DBTHETAINI', trim(this%memoryPath))
1747 call mem_allocate(this%dbcomp, this%ndelaycells, ndelaybeds, &
1748 'DBCOMP', trim(this%memoryPath))
1749 call mem_allocate(this%dbtcomp, this%ndelaycells, ndelaybeds, &
1750 'DBTCOMP', trim(this%memoryPath))
1753 if (this%iupdatematprop == 0)
then
1754 call mem_setptr(this%dbdz,
'DBDZINI', trim(this%memoryPath))
1755 call mem_setptr(this%dbdz0,
'DBDZINI', trim(this%memoryPath))
1756 call mem_setptr(this%dbtheta,
'DBTHETAINI', trim(this%memoryPath))
1757 call mem_setptr(this%dbtheta0,
'DBTHETAINI', trim(this%memoryPath))
1759 call mem_allocate(this%dbdz, this%ndelaycells, ndelaybeds, &
1760 'DBDZ', trim(this%memoryPath))
1761 call mem_allocate(this%dbdz0, this%ndelaycells, ndelaybeds, &
1762 'DBDZ0', trim(this%memoryPath))
1763 call mem_allocate(this%dbtheta, this%ndelaycells, ndelaybeds, &
1764 'DBTHETA', trim(this%memoryPath))
1765 call mem_allocate(this%dbtheta0, this%ndelaycells, ndelaybeds, &
1766 'DBTHETA0', trim(this%memoryPath))
1771 'DBAL', trim(this%memoryPath))
1773 'DBAD', trim(this%memoryPath))
1775 'DBAU', trim(this%memoryPath))
1777 'DBRHS', trim(this%memoryPath))
1779 'DBDH', trim(this%memoryPath))
1781 'DBAW', trim(this%memoryPath))
1785 this%idb_nconv_count(n) = 0
1789 do ib = 1, this%ninterbeds
1790 idelay = this%idelay(ib)
1791 if (idelay == 0)
then
1796 do n = 1, this%ndelaycells
1797 rval = this%thickini(ib) / real(this%ndelaycells, dp)
1798 this%dbdzini(n, idelay) = rval
1799 this%dbh(n, idelay) = this%h0(ib)
1800 this%dbh0(n, idelay) = this%h0(ib)
1801 this%dbthetaini(n, idelay) = this%thetaini(ib)
1802 this%dbgeo(n, idelay) = dzero
1803 this%dbes(n, idelay) = dzero
1804 this%dbes0(n, idelay) = dzero
1805 this%dbpcs(n, idelay) = this%pcs(ib)
1806 this%dbcomp(n, idelay) = dzero
1807 this%dbtcomp(n, idelay) = dzero
1808 if (this%iupdatematprop /= 0)
then
1809 this%dbdz(n, idelay) = this%dbdzini(n, idelay)
1810 this%dbdz0(n, idelay) = this%dbdzini(n, idelay)
1811 this%dbtheta(n, idelay) = this%theta(ib)
1812 this%dbtheta0(n, idelay) = this%theta(ib)
1817 call this%csub_delay_init_zcell(ib)
1821 do n = 1, this%ndelaycells
1822 this%dbal(n) = dzero
1823 this%dbad(n) = dzero
1824 this%dbau(n) = dzero
1825 this%dbrhs(n) = dzero
1826 this%dbdh(n) = dzero
1827 this%dbaw(n) = dzero
1834 if (ndelaybeds > 0)
then
1835 q = mod(real(this%ndelaycells, dp), dtwo)
1836 if (q == dzero)
then
1837 write (
errmsg,
'(a,i0,a,1x,a)') &
1838 'NDELAYCELLS (', this%ndelaycells,
') must be an', &
1839 'odd number when using the effective stress formulation.'
1856 character(len=LINELENGTH) :: title
1857 character(len=LINELENGTH) :: tag
1858 character(len=LINELENGTH) :: msg
1859 character(len=10) :: ctype
1860 character(len=20) :: cellid
1861 character(len=10) :: cflag
1866 integer(I4B) :: node
1868 integer(I4B) :: idelay
1869 integer(I4B) :: iexceed
1870 integer(I4B),
parameter :: ncells = 20
1871 integer(I4B) :: nlen
1872 integer(I4B) :: ntabrows
1873 integer(I4B) :: ntabcols
1874 integer(I4B) :: ipos
1879 integer(I4B),
dimension(:),
allocatable :: imap_sel
1880 integer(I4B),
dimension(:),
allocatable :: locs
1881 real(DP),
dimension(:),
allocatable :: pctcomp_arr
1884 allocate (locs(this%dis%ndim))
1887 if (this%ninterbeds > 0)
then
1888 nlen = min(ncells, this%ninterbeds)
1889 allocate (imap_sel(nlen))
1890 allocate (pctcomp_arr(this%ninterbeds))
1892 do ib = 1, this%ninterbeds
1893 idelay = this%idelay(ib)
1894 b0 = this%thickini(ib)
1895 strain = this%tcomp(ib) / b0
1897 pctcomp_arr(ib) = pctcomp
1898 if (pctcomp >=
done)
then
1899 iexceed = iexceed + 1
1902 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
1905 i0 = max(1, this%ninterbeds - ncells + 1)
1906 i1 = this%ninterbeds
1908 if (iexceed /= 0)
then
1909 write (msg,
'(1x,a,1x,i0,1x,a,1x,i0,1x,a)') &
1910 'LARGEST', (i1 - i0 + 1),
'OF', this%ninterbeds, &
1911 'INTERBED STRAIN VALUES SHOWN'
1916 title = trim(adjustl(this%packName))//
' PACKAGE INTERBED STRAIN SUMMARY'
1923 call table_cr(this%outputtab, this%packName, title)
1924 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
1927 tag =
'INTERBED NUMBER'
1928 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1929 tag =
'INTERBED TYPE'
1930 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1932 call this%outputtab%initialize_column(tag, 20, alignment=
tableft)
1933 tag =
'INITIAL THICKNESS'
1934 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1935 tag =
'FINAL THICKNESS'
1936 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1937 tag =
'TOTAL COMPACTION'
1938 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1939 tag =
'FINAL STRAIN'
1940 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1941 tag =
'PERCENT COMPACTION'
1942 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
1944 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
1949 idelay = this%idelay(ib)
1950 b0 = this%thickini(ib)
1951 b1 = this%csub_calc_interbed_thickness(ib)
1952 if (idelay == 0)
then
1956 b0 = b0 * this%rnb(ib)
1958 strain = this%tcomp(ib) / b0
1960 if (pctcomp >= 5.0_dp)
then
1962 else if (pctcomp >=
done)
then
1967 node = this%nodelist(ib)
1968 call this%dis%noder_to_string(node, cellid)
1971 call this%outputtab%add_term(ib)
1972 call this%outputtab%add_term(ctype)
1973 call this%outputtab%add_term(cellid)
1974 call this%outputtab%add_term(b0)
1975 call this%outputtab%add_term(b1)
1976 call this%outputtab%add_term(this%tcomp(ib))
1977 call this%outputtab%add_term(strain)
1978 call this%outputtab%add_term(pctcomp)
1979 call this%outputtab%add_term(cflag)
1981 write (this%iout,
'(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
1982 'PERCENT COMPACTION IS GREATER THAN OR EQUAL TO 1 PERCENT IN', &
1983 iexceed,
'OF', this%ninterbeds,
'INTERBED(S).', &
1984 'USE THE STRAIN_CSV_INTERBED OPTION TO OUTPUT A CSV '// &
1985 'FILE WITH PERCENT COMPACTION ',
'VALUES FOR ALL INTERBEDS.'
1987 msg =
'PERCENT COMPACTION WAS LESS THAN 1 PERCENT IN ALL INTERBEDS'
1988 write (this%iout,
'(/1X,A)') trim(adjustl(msg))
1992 if (this%istrainib /= 0)
then
1995 ntabrows = this%ninterbeds
1997 if (this%dis%ndim > 1)
then
1998 ntabcols = ntabcols + 1
2000 ntabcols = ntabcols + this%dis%ndim
2003 call table_cr(this%outputtab, this%packName,
'')
2004 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainib, &
2005 lineseparator=.false., separator=
',')
2008 tag =
'INTERBED_NUMBER'
2009 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2010 tag =
'INTERBED_TYPE'
2011 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2013 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2014 if (this%dis%ndim == 2)
then
2016 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2018 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2021 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2023 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2025 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2027 tag =
'INITIAL_THICKNESS'
2028 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2029 tag =
'FINAL_THICKNESS'
2030 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2031 tag =
'TOTAL_COMPACTION'
2032 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2033 tag =
'TOTAL_STRAIN'
2034 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2035 tag =
'PERCENT_COMPACTION'
2036 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2039 do ib = 1, this%ninterbeds
2040 idelay = this%idelay(ib)
2041 b0 = this%thickini(ib)
2042 b1 = this%csub_calc_interbed_thickness(ib)
2043 if (idelay == 0)
then
2047 b0 = b0 * this%rnb(ib)
2049 strain = this%tcomp(ib) / b0
2051 node = this%nodelist(ib)
2052 call this%dis%noder_to_array(node, locs)
2055 call this%outputtab%add_term(ib)
2056 call this%outputtab%add_term(ctype)
2057 if (this%dis%ndim > 1)
then
2058 call this%outputtab%add_term(this%dis%get_nodeuser(node))
2060 do ipos = 1, this%dis%ndim
2061 call this%outputtab%add_term(locs(ipos))
2063 call this%outputtab%add_term(b0)
2064 call this%outputtab%add_term(b1)
2065 call this%outputtab%add_term(this%tcomp(ib))
2066 call this%outputtab%add_term(strain)
2067 call this%outputtab%add_term(pctcomp)
2072 deallocate (imap_sel)
2073 deallocate (pctcomp_arr)
2077 nlen = min(ncells, this%dis%nodes)
2078 allocate (imap_sel(nlen))
2079 allocate (pctcomp_arr(this%dis%nodes))
2081 do node = 1, this%dis%nodes
2083 if (this%cg_thickini(node) >
dzero)
then
2084 strain = this%cg_tcomp(node) / this%cg_thickini(node)
2087 pctcomp_arr(node) = pctcomp
2088 if (pctcomp >=
done)
then
2089 iexceed = iexceed + 1
2092 call selectn(imap_sel, pctcomp_arr, reverse=.true.)
2095 i0 = max(1, this%dis%nodes - ncells + 1)
2098 if (iexceed /= 0)
then
2099 write (msg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
2100 'LARGEST ', (i1 - i0 + 1),
'OF', this%dis%nodes, &
2101 'CELL COARSE-GRAINED VALUES SHOWN'
2105 title = trim(adjustl(this%packName))// &
2106 ' PACKAGE COARSE-GRAINED STRAIN SUMMARY'
2113 call table_cr(this%outputtab, this%packName, title)
2114 call this%outputtab%table_df(ntabrows, ntabcols, this%iout)
2118 call this%outputtab%initialize_column(tag, 20, alignment=
tableft)
2119 tag =
'INITIAL THICKNESS'
2120 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2121 tag =
'FINAL THICKNESS'
2122 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2123 tag =
'TOTAL COMPACTION'
2124 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2125 tag =
'FINAL STRAIN'
2126 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2127 tag =
'PERCENT COMPACTION'
2128 call this%outputtab%initialize_column(tag, 12, alignment=
tabcenter)
2130 call this%outputtab%initialize_column(tag, 10, alignment=
tabcenter)
2134 if (this%cg_thickini(node) >
dzero)
then
2135 strain = this%cg_tcomp(node) / this%cg_thickini(node)
2140 if (pctcomp >= 5.0_dp)
then
2142 else if (pctcomp >=
done)
then
2147 call this%dis%noder_to_string(node, cellid)
2150 call this%outputtab%add_term(cellid)
2151 call this%outputtab%add_term(this%cg_thickini(node))
2152 call this%outputtab%add_term(this%cg_thick(node))
2153 call this%outputtab%add_term(this%cg_tcomp(node))
2154 call this%outputtab%add_term(strain)
2155 call this%outputtab%add_term(pctcomp)
2156 call this%outputtab%add_term(cflag)
2158 write (this%iout,
'(/1X,A,1X,I0,1X,A,1X,I0,1X,A,/1X,A,/1X,A)') &
2159 'COARSE-GRAINED STORAGE PERCENT COMPACTION IS GREATER THAN OR '// &
2160 'EQUAL TO 1 PERCENT IN', iexceed,
'OF', this%dis%nodes,
'CELL(S).', &
2161 'USE THE STRAIN_CSV_COARSE OPTION TO OUTPUT A CSV '// &
2162 'FILE WITH PERCENT COMPACTION ',
'VALUES FOR ALL CELLS.'
2164 msg =
'COARSE-GRAINED STORAGE PERCENT COMPACTION WAS LESS THAN '// &
2165 '1 PERCENT IN ALL CELLS '
2166 write (this%iout,
'(/1X,A)') trim(adjustl(msg))
2170 if (this%istrainsk /= 0)
then
2173 ntabrows = this%dis%nodes
2175 if (this%dis%ndim > 1)
then
2176 ntabcols = ntabcols + 1
2178 ntabcols = ntabcols + this%dis%ndim
2181 call table_cr(this%outputtab, this%packName,
'')
2182 call this%outputtab%table_df(ntabrows, ntabcols, this%istrainsk, &
2183 lineseparator=.false., separator=
',')
2187 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2188 if (this%dis%ndim == 2)
then
2190 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2192 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2195 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2197 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2199 call this%outputtab%initialize_column(tag, 10, alignment=
tabright)
2201 tag =
'INITIAL_THICKNESS'
2202 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2203 tag =
'FINAL_THICKNESS'
2204 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2205 tag =
'TOTAL_COMPACTION'
2206 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2207 tag =
'TOTAL_STRAIN'
2208 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2209 tag =
'PERCENT_COMPACTION'
2210 call this%outputtab%initialize_column(tag, 20, alignment=
tabright)
2213 do node = 1, this%dis%nodes
2214 if (this%cg_thickini(node) >
dzero)
then
2215 strain = this%cg_tcomp(node) / this%cg_thickini(node)
2220 call this%dis%noder_to_array(node, locs)
2223 if (this%dis%ndim > 1)
then
2224 call this%outputtab%add_term(this%dis%get_nodeuser(node))
2226 do ipos = 1, this%dis%ndim
2227 call this%outputtab%add_term(locs(ipos))
2229 call this%outputtab%add_term(this%cg_thickini(node))
2230 call this%outputtab%add_term(this%cg_thick(node))
2231 call this%outputtab%add_term(this%cg_tcomp(node))
2232 call this%outputtab%add_term(strain)
2233 call this%outputtab%add_term(pctcomp)
2239 if (this%ndelaybeds > 0)
then
2240 if (this%idb_nconv_count(2) > 0)
then
2241 write (
warnmsg,
'(a,1x,a,1x,i0,1x,a,1x,a)') &
2242 'Delay interbed cell heads were less than the top of the interbed', &
2243 'cell in', this%idb_nconv_count(2),
'interbed cells in ', &
2244 'non-convertible GWF cells for at least one time step during '// &
2251 deallocate (imap_sel)
2253 deallocate (pctcomp_arr)
2268 if (this%inunit > 0)
then
2290 if (this%iupdatematprop == 0)
then
2291 nullify (this%cg_thick)
2292 nullify (this%cg_thick0)
2293 nullify (this%cg_theta)
2294 nullify (this%cg_theta0)
2309 call mem_deallocate(this%boundname,
'BOUNDNAME', this%memoryPath)
2326 if (this%iupdatematprop == 0)
then
2327 nullify (this%thick)
2328 nullify (this%thick0)
2329 nullify (this%theta)
2330 nullify (this%theta0)
2341 if (this%ndelaybeds > 0)
then
2342 if (this%iupdatematprop == 0)
then
2344 nullify (this%dbdz0)
2345 nullify (this%dbtheta)
2346 nullify (this%dbtheta0)
2385 nullify (this%gwfiss)
2388 nullify (this%stoiconv)
2389 nullify (this%stoss)
2392 if (this%iprpak > 0)
then
2393 call this%inputtab%table_da()
2394 deallocate (this%inputtab)
2395 nullify (this%inputtab)
2399 if (
associated(this%outputtab))
then
2400 call this%outputtab%table_da()
2401 deallocate (this%outputtab)
2402 nullify (this%outputtab)
2407 if (this%ipakcsv > 0)
then
2408 call this%pakcsvtab%table_da()
2409 deallocate (this%pakcsvtab)
2410 nullify (this%pakcsvtab)
2414 call mem_deallocate(this%listlabel,
'LISTLABEL', this%memoryPath)
2458 if (this%inunit > 0)
then
2459 call this%obs%obs_da()
2460 call this%TsManager%da()
2463 deallocate (this%obs)
2468 deallocate (this%TsManager)
2469 nullify (this%TsManager)
2473 call this%NumericalPackageType%da()
2491 character(len=LINELENGTH) :: line
2492 character(len=LINELENGTH) :: title
2493 character(len=LINELENGTH) :: text
2494 character(len=20) :: cellid
2495 logical(LGP) :: isfound
2496 logical(LGP) :: endOfBlock
2498 integer(I4B) :: ierr
2499 integer(I4B) :: node
2500 integer(I4B) :: nlist
2501 real(DP),
pointer :: bndElem => null()
2503 character(len=*),
parameter :: fmtblkerr = &
2504 &
"('Looking for BEGIN PERIOD iper. Found ',a,' instead.')"
2505 character(len=*),
parameter :: fmtlsp = &
2506 &
"(1X,/1X,'REUSING ',a,'S FROM LAST STRESS PERIOD')"
2509 if (this%inunit == 0)
return
2512 if (this%ionper <
kper)
then
2515 call this%parser%GetBlock(
'PERIOD', isfound, ierr, &
2516 supportopenclose=.true., &
2517 blockrequired=.false.)
2521 call this%read_check_ionper()
2527 this%ionper =
nper + 1
2530 call this%parser%GetCurrentLine(line)
2531 write (
errmsg, fmtblkerr) adjustl(trim(line))
2538 if (this%ionper ==
kper)
then
2541 if (this%iprpak /= 0)
then
2544 title =
'CSUB'//
' PACKAGE ('// &
2545 trim(adjustl(this%packName))//
') DATA FOR PERIOD'
2546 write (title,
'(a,1x,i6)') trim(adjustl(title)),
kper
2547 call table_cr(this%inputtab, this%packName, title)
2548 call this%inputtab%table_df(1, 2, this%iout, finalize=.false.)
2550 call this%inputtab%initialize_column(text, 20)
2552 call this%inputtab%initialize_column(text, 15, alignment=tableft)
2559 call this%TsManager%Reset(this%packName)
2563 call this%parser%GetNextLine(endofblock)
2566 if (endofblock)
then
2574 if (nlist > this%maxsig0)
then
2575 write (
errmsg,
'(a,i0,a,i0,a)') &
2576 'The number of stress period entries (', nlist, &
2577 ') exceeds the maximum number of stress period entries (', &
2584 call this%parser%GetCellid(this%dis%ndim, cellid)
2585 node = this%dis%noder_from_cellid(cellid, &
2586 this%parser%iuactive, this%iout)
2590 write (
errmsg,
'(a,2(1x,a))') &
2591 'CELLID', cellid,
'is not in the active model domain.'
2595 this%nodelistsig0(nlist) = node
2598 call this%parser%GetString(text)
2600 bndelem => this%sig0(nlist)
2602 this%packName,
'BND', &
2603 this%tsManager, this%iprpak, &
2607 if (this%iprpak /= 0)
then
2608 call this%dis%noder_to_string(node, cellid)
2609 call this%inputtab%add_term(cellid)
2610 call this%inputtab%add_term(bndelem)
2618 if (this%iprpak /= 0)
then
2619 call this%inputtab%finalize_table()
2624 write (this%iout, fmtlsp) trim(this%filtyp)
2629 call this%parser%StoreErrorUnit()
2633 call this%csub_rp_obs()
2649 integer(I4B),
intent(in) :: nodes
2650 real(DP),
dimension(nodes),
intent(in) :: hnew
2654 integer(I4B) :: idelay
2655 integer(I4B) :: node
2662 if (this%ninterbeds > 0)
then
2664 if (this%gwfiss /= 0)
then
2665 write (
errmsg,
'(a,i0,a,1x,a,1x,a,1x,i0,1x,a)') &
2666 'Only the first and last (',
nper,
')', &
2667 'stress period can be steady if interbeds are simulated.', &
2668 'Stress period',
kper,
'has been defined to be steady state.'
2675 if (this%initialized == 0)
then
2676 if (this%gwfiss == 0)
then
2677 call this%csub_set_initial_state(nodes, hnew)
2685 this%cg_comp(node) =
dzero
2686 this%cg_es0(node) = this%cg_es(node)
2687 if (this%iupdatematprop /= 0)
then
2688 this%cg_thick0(node) = this%cg_thick(node)
2689 this%cg_theta0(node) = this%cg_theta(node)
2694 do ib = 1, this%ninterbeds
2695 idelay = this%idelay(ib)
2698 this%comp(ib) =
dzero
2699 node = this%nodelist(ib)
2700 if (this%initialized /= 0)
then
2701 es = this%cg_es(node)
2707 if (this%iupdatematprop /= 0)
then
2708 this%thick0(ib) = this%thick(ib)
2709 this%theta0(ib) = this%theta(ib)
2713 if (idelay /= 0)
then
2717 if (this%gwfiss0 /= 0)
then
2718 node = this%nodelist(ib)
2720 do n = 1, this%ndelaycells
2721 this%dbh(n, idelay) = h
2727 do n = 1, this%ndelaycells
2729 if (this%initialized /= 0)
then
2730 if (this%dbes(n, idelay) > this%dbpcs(n, idelay))
then
2731 this%dbpcs(n, idelay) = this%dbes(n, idelay)
2734 this%dbh0(n, idelay) = this%dbh(n, idelay)
2735 this%dbes0(n, idelay) = this%dbes(n, idelay)
2736 if (this%iupdatematprop /= 0)
then
2737 this%dbdz0(n, idelay) = this%dbdz(n, idelay)
2738 this%dbtheta0(n, idelay) = this%dbtheta(n, idelay)
2745 this%gwfiss0 = this%gwfiss
2748 call this%TsManager%ad()
2753 call this%obs%obs_ad()
2761 subroutine csub_fc(this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
2766 integer(I4B),
intent(in) :: kiter
2767 real(DP),
intent(in),
dimension(:) :: hold
2768 real(DP),
intent(in),
dimension(:) :: hnew
2770 integer(I4B),
intent(in),
dimension(:) :: idxglo
2771 real(DP),
intent(inout),
dimension(:) :: rhs
2774 integer(I4B) :: node
2775 integer(I4B) :: idiag
2776 integer(I4B) :: idelay
2784 call this%csub_cg_calc_stress(this%dis%nodes, hnew)
2787 if (this%gwfiss == 0)
then
2793 do node = 1, this%dis%nodes
2794 idiag = this%dis%con%ia(node)
2795 area = this%dis%get_area(node)
2798 if (this%ibound(node) < 1) cycle
2801 if (this%iupdatematprop /= 0)
then
2802 if (this%ieslag == 0)
then
2805 call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
2806 this%cg_comp(node) = comp
2809 call this%csub_cg_update(node)
2814 call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
2818 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2819 rhs(node) = rhs(node) + rhsterm
2823 if (this%brg /=
dzero)
then
2824 call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
2829 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2830 rhs(node) = rhs(node) + rhsterm
2835 if (this%ninterbeds /= 0)
then
2839 do ib = 1, this%ninterbeds
2840 node = this%nodelist(ib)
2841 idelay = this%idelay(ib)
2842 idiag = this%dis%con%ia(node)
2843 area = this%dis%get_area(node)
2844 call this%csub_interbed_fc(ib, node, area, hnew(node), hold(node), &
2846 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2847 rhs(node) = rhs(node) + rhsterm
2851 call this%csub_nodelay_wcomp_fc(ib, node, tled, area, &
2852 hnew(node), hold(node), &
2856 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2857 rhs(node) = rhs(node) + rhsterm
2865 call this%parser%StoreErrorUnit()
2878 subroutine csub_fn(this, kiter, hold, hnew, matrix_sln, idxglo, rhs)
2883 integer(I4B),
intent(in) :: kiter
2884 real(DP),
intent(in),
dimension(:) :: hold
2885 real(DP),
intent(in),
dimension(:) :: hnew
2887 integer(I4B),
intent(in),
dimension(:) :: idxglo
2888 real(DP),
intent(inout),
dimension(:) :: rhs
2890 integer(I4B) :: idelay
2891 integer(I4B) :: node
2892 integer(I4B) :: idiag
2900 if (this%gwfiss == 0)
then
2904 do node = 1, this%dis%nodes
2905 idiag = this%dis%con%ia(node)
2906 area = this%dis%get_area(node)
2909 if (this%ibound(node) < 1) cycle
2912 call this%csub_cg_fn(node, tled, area, &
2913 hnew(node), hcof, rhsterm)
2917 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2918 rhs(node) = rhs(node) + rhsterm
2922 if (this%brg /=
dzero)
then
2923 call this%csub_cg_wcomp_fn(node, tled, area, hnew(node), hold(node), &
2928 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2929 rhs(node) = rhs(node) + rhsterm
2934 if (this%ninterbeds /= 0)
then
2938 do ib = 1, this%ninterbeds
2939 idelay = this%idelay(ib)
2940 node = this%nodelist(ib)
2943 if (this%ibound(node) < 1) cycle
2946 idiag = this%dis%con%ia(node)
2947 area = this%dis%get_area(node)
2948 call this%csub_interbed_fn(ib, node, hnew(node), hold(node), &
2952 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2953 rhs(node) = rhs(node) + rhsterm
2956 if (this%brg /=
dzero .and. idelay == 0)
then
2957 call this%csub_nodelay_wcomp_fn(ib, node, tled, area, &
2958 hnew(node), hold(node), &
2962 call matrix_sln%add_value_pos(idxglo(idiag), hcof)
2963 rhs(node) = rhs(node) + rhsterm
2979 character(len=LINELENGTH) :: tag
2980 integer(I4B) :: ntabrows
2981 integer(I4B) :: ntabcols
2983 if (this%ipakcsv > 0)
then
2984 if (this%ndelaybeds < 1)
then
2985 write (
warnmsg,
'(a,1x,3a)') &
2986 'Package convergence data is requested but delay interbeds', &
2987 'are not included in package (', &
2988 trim(adjustl(this%packName)),
').'
2996 call table_cr(this%pakcsvtab, this%packName,
'')
2997 call this%pakcsvtab%table_df(ntabrows, ntabcols, this%ipakcsv, &
2998 lineseparator=.false., separator=
',', &
3002 tag =
'total_inner_iterations'
3003 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
3005 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
3007 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
3009 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
3011 call this%pakcsvtab%initialize_column(tag, 10, alignment=
tableft)
3013 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
3015 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
3017 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
3018 tag =
'dstoragemax_loc'
3019 call this%pakcsvtab%initialize_column(tag, 15, alignment=
tableft)
3037 subroutine csub_cc(this, innertot, kiter, iend, icnvgmod, nodes, &
3038 hnew, hold, cpak, ipak, dpak)
3043 integer(I4B),
intent(in) :: innertot
3044 integer(I4B),
intent(in) :: kiter
3045 integer(I4B),
intent(in) :: iend
3046 integer(I4B),
intent(in) :: icnvgmod
3047 integer(I4B),
intent(in) :: nodes
3048 real(DP),
dimension(nodes),
intent(in) :: hnew
3049 real(DP),
dimension(nodes),
intent(in) :: hold
3050 character(len=LENPAKLOC),
intent(inout) :: cpak
3051 integer(I4B),
intent(inout) :: ipak
3052 real(DP),
intent(inout) :: dpak
3054 character(len=LENPAKLOC) :: cloc
3055 integer(I4B) :: icheck
3056 integer(I4B) :: ipakfail
3058 integer(I4B) :: node
3059 integer(I4B) :: idelay
3060 integer(I4B) :: locdhmax
3061 integer(I4B) :: locrmax
3062 integer(I4B) :: ifirst
3068 real(DP) :: hcellold
3082 icheck = this%iconvchk
3092 if (this%gwfiss /= 0)
then
3095 if (icnvgmod == 0)
then
3101 if (icheck /= 0)
then
3107 final_check:
do ib = 1, this%ninterbeds
3108 idelay = this%idelay(ib)
3109 node = this%nodelist(ib)
3112 if (idelay == 0) cycle
3115 if (this%ibound(node) < 1) cycle
3118 dh = this%dbdhmax(idelay)
3123 area = this%dis%get_area(node)
3125 hcellold = hold(node)
3128 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
3131 call this%csub_delay_calc_dstor(ib, hcell, stoe, stoi)
3132 v1 = (stoe + stoi) * area * this%rnb(ib) * tled
3135 call this%csub_delay_calc_wcomp(ib, dwc)
3136 v1 = v1 + dwc * area * this%rnb(ib)
3139 call this%csub_delay_fc(ib, hcof, rhs)
3140 v2 = (-hcof * hcell - rhs) * area * this%rnb(ib)
3147 df = df *
delt / area
3150 if (ifirst == 1)
then
3157 if (abs(dh) > abs(dhmax))
then
3161 if (abs(df) > abs(rmax))
then
3170 if (abs(dhmax) > abs(dpak))
then
3173 write (cloc,
"(a,'-',a)") trim(this%packName),
'head'
3178 if (abs(rmax) > abs(dpak))
then
3181 write (cloc,
"(a,'-',a)") trim(this%packName),
'storage'
3186 if (this%ipakcsv /= 0)
then
3189 call this%pakcsvtab%add_term(innertot)
3190 call this%pakcsvtab%add_term(
totim)
3191 call this%pakcsvtab%add_term(
kper)
3192 call this%pakcsvtab%add_term(
kstp)
3193 call this%pakcsvtab%add_term(kiter)
3194 if (this%ndelaybeds > 0)
then
3195 call this%pakcsvtab%add_term(dhmax)
3196 call this%pakcsvtab%add_term(locdhmax)
3197 call this%pakcsvtab%add_term(rmax)
3198 call this%pakcsvtab%add_term(locrmax)
3200 call this%pakcsvtab%add_term(
'--')
3201 call this%pakcsvtab%add_term(
'--')
3202 call this%pakcsvtab%add_term(
'--')
3203 call this%pakcsvtab%add_term(
'--')
3208 call this%pakcsvtab%finalize_table()
3223 subroutine csub_cq(this, nodes, hnew, hold, isuppress_output, flowja)
3229 integer(I4B),
intent(in) :: nodes
3230 real(DP),
intent(in),
dimension(nodes) :: hnew
3231 real(DP),
intent(in),
dimension(nodes) :: hold
3232 integer(I4B),
intent(in) :: isuppress_output
3233 real(DP),
dimension(:),
contiguous,
intent(inout) :: flowja
3236 integer(I4B) :: idelay
3237 integer(I4B) :: ielastic
3238 integer(I4B) :: iconvert
3239 integer(I4B) :: node
3242 integer(I4B) :: idiag
3269 integer(I4B) :: iprobslocal
3279 do node = 1, this%dis%nodes
3280 idiag = this%dis%con%ia(node)
3281 area = this%dis%get_area(node)
3285 if (this%gwfiss == 0)
then
3291 if (this%ibound(node) > 0 .and. this%cg_thickini(node) >
dzero)
then
3294 call this%csub_cg_fc(node, tled, area, hnew(node), hold(node), &
3296 rrate = hcof * hnew(node) - rhs
3299 call this%csub_cg_calc_comp(node, hnew(node), hold(node), comp)
3302 call this%csub_cg_wcomp_fc(node, tled, area, hnew(node), hold(node), &
3304 rratewc = hcof * hnew(node) - rhs
3310 this%cg_stor(node) = rrate
3311 this%cell_wcstor(node) = rratewc
3312 this%cell_thick(node) = this%cg_thick(node)
3315 this%cg_comp(node) = comp
3319 if (isuppress_output == 0)
then
3323 if (this%iupdatematprop /= 0)
then
3324 call this%csub_cg_update(node)
3328 this%cg_tcomp(node) = this%cg_tcomp(node) + comp
3332 flowja(idiag) = flowja(idiag) + rrate
3333 flowja(idiag) = flowja(idiag) + rratewc
3339 if (this%ndelaybeds > 0)
then
3340 this%idb_nconv_count(1) = 0
3347 do ib = 1, this%ninterbeds
3349 idelay = this%idelay(ib)
3350 ielastic = this%ielastic(ib)
3354 if (idelay == 0)
then
3358 b = this%thick(ib) * this%rnb(ib)
3362 node = this%nodelist(ib)
3363 idiag = this%dis%con%ia(node)
3364 area = this%dis%get_area(node)
3367 this%cell_thick(node) = this%cell_thick(node) + b
3370 if (this%gwfiss == 0)
then
3378 if (this%ibound(node) < 1) cycle
3381 if (idelay == 0)
then
3382 iconvert = this%iconvert(ib)
3386 call this%csub_nodelay_calc_comp(ib, hnew(node), hold(node), comp, &
3390 es = this%cg_es(node)
3392 es0 = this%cg_es0(node)
3395 if (ielastic > 0 .or. iconvert == 0)
then
3398 stoi = -pcs * rho2 + (rho2 * es)
3399 stoe = pcs * rho1 - (rho1 * es0)
3405 this%storagee(ib) = stoe * tledm
3406 this%storagei(ib) = stoi * tledm
3409 this%comp(ib) = comp
3412 if (isuppress_output == 0)
then
3415 if (this%iupdatematprop /= 0)
then
3416 call this%csub_nodelay_update(ib)
3420 this%tcomp(ib) = this%tcomp(ib) + comp
3421 this%tcompe(ib) = this%tcompe(ib) + compe
3422 this%tcompi(ib) = this%tcompi(ib) + compi
3431 call this%csub_calc_sat(node, h, h0, snnew, snold)
3434 call this%csub_delay_calc_dstor(ib, h, stoe, stoi)
3435 this%storagee(ib) = stoe * area * this%rnb(ib) * tledm
3436 this%storagei(ib) = stoi * area * this%rnb(ib) * tledm
3439 q = this%csub_calc_delay_flow(ib, 1, h) * area * this%rnb(ib)
3440 this%dbflowtop(idelay) = q
3441 nn = this%ndelaycells
3442 q = this%csub_calc_delay_flow(ib, nn, h) * area * this%rnb(ib)
3443 this%dbflowbot(idelay) = q
3446 if (isuppress_output == 0)
then
3449 call this%csub_delay_calc_comp(ib, h, h0, comp, compi, compe)
3453 if (this%iupdatematprop /= 0)
then
3454 call this%csub_delay_update(ib)
3458 this%tcomp(ib) = this%tcomp(ib) + comp
3459 this%tcompi(ib) = this%tcompi(ib) + compi
3460 this%tcompe(ib) = this%tcompe(ib) + compe
3463 do n = 1, this%ndelaycells
3464 this%dbtcomp(n, idelay) = this%dbtcomp(n, idelay) + &
3465 this%dbcomp(n, idelay)
3470 call this%csub_delay_head_check(ib)
3477 if (idelay == 0)
then
3478 call this%csub_nodelay_wcomp_fc(ib, node, tledm, area, &
3479 hnew(node), hold(node), hcof, rhs)
3480 rratewc = hcof * hnew(node) - rhs
3484 call this%csub_delay_calc_wcomp(ib, q)
3485 rratewc = q * area * this%rnb(ib)
3487 this%cell_wcstor(node) = this%cell_wcstor(node) + rratewc
3490 flowja(idiag) = flowja(idiag) + rratewc
3492 this%storagee(ib) =
dzero
3493 this%storagei(ib) =
dzero
3494 if (idelay /= 0)
then
3495 this%dbflowtop(idelay) =
dzero
3496 this%dbflowbot(idelay) =
dzero
3501 flowja(idiag) = flowja(idiag) + this%storagee(ib)
3502 flowja(idiag) = flowja(idiag) + this%storagei(ib)
3506 if (this%iupdatematprop /= 0)
then
3508 call this%parser%StoreErrorUnit()
3522 subroutine csub_bd(this, isuppress_output, model_budget)
3529 integer(I4B),
intent(in) :: isuppress_output
3530 type(
budgettype),
intent(inout) :: model_budget
3537 call model_budget%addentry(rin, rout,
delt,
budtxt(1), &
3538 isuppress_output,
' CSUB')
3539 if (this%ninterbeds > 0)
then
3543 call model_budget%addentry(rin, rout,
delt,
budtxt(2), &
3544 isuppress_output,
' CSUB')
3548 call model_budget%addentry(rin, rout,
delt,
budtxt(3), &
3549 isuppress_output,
' CSUB')
3552 call model_budget%addentry(rin, rout,
delt,
budtxt(4), &
3553 isuppress_output,
' CSUB')
3565 integer(I4B),
intent(in) :: icbcfl
3566 integer(I4B),
intent(in) :: icbcun
3568 character(len=1) :: cdatafmp =
' '
3569 character(len=1) :: editdesc =
' '
3570 integer(I4B) :: ibinun
3571 integer(I4B) :: iprint
3572 integer(I4B) :: nvaluesp
3573 integer(I4B) :: nwidthp
3575 integer(I4B) :: node
3576 integer(I4B) :: naux
3582 if (this%ipakcb < 0)
then
3584 elseif (this%ipakcb == 0)
then
3587 ibinun = this%ipakcb
3589 if (icbcfl == 0) ibinun = 0
3592 if (ibinun /= 0)
then
3597 call this%dis%record_array(this%cg_stor, this%iout, iprint, -ibinun, &
3598 budtxt(1), cdatafmp, nvaluesp, &
3599 nwidthp, editdesc, dinact)
3600 if (this%ninterbeds > 0)
then
3604 call this%dis%record_srcdst_list_header(
budtxt(2), &
3614 do ib = 1, this%ninterbeds
3615 q = this%storagee(ib)
3616 node = this%nodelist(ib)
3617 call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3622 call this%dis%record_srcdst_list_header(
budtxt(3), &
3632 do ib = 1, this%ninterbeds
3633 q = this%storagei(ib)
3634 node = this%nodelist(ib)
3635 call this%dis%record_mf6_list_entry(ibinun, node, node, q, naux, &
3641 call this%dis%record_array(this%cell_wcstor, this%iout, iprint, -ibinun, &
3642 budtxt(4), cdatafmp, nvaluesp, &
3643 nwidthp, editdesc, dinact)
3656 integer(I4B),
intent(in) :: idvfl
3657 integer(I4B),
intent(in) :: idvprint
3659 character(len=1) :: cdatafmp =
' '
3660 character(len=1) :: editdesc =
' '
3661 integer(I4B) :: ibinun
3662 integer(I4B) :: iprint
3663 integer(I4B) :: nvaluesp
3664 integer(I4B) :: nwidthp
3666 integer(I4B) :: node
3667 integer(I4B) :: nodem
3668 integer(I4B) :: nodeu
3671 integer(I4B) :: idx_conn
3673 integer(I4B) :: ncpl
3674 integer(I4B) :: nlay
3677 real(DP) :: va_scale
3679 character(len=*),
parameter :: fmtnconv = &
3680 "(/4x, 'DELAY INTERBED CELL HEADS IN ', i0, ' INTERBEDS IN', &
3681 &' NON-CONVERTIBLE GWF CELLS WERE LESS THAN THE TOP OF THE INTERBED CELL')"
3686 if (this%ioutcomp /= 0 .or. this%ioutzdisp /= 0)
then
3691 if (idvfl == 0) ibinun = 0
3694 if (ibinun /= 0)
then
3699 do node = 1, this%dis%nodes
3700 this%buff(node) = this%cg_tcomp(node)
3702 do ib = 1, this%ninterbeds
3703 node = this%nodelist(ib)
3704 this%buff(node) = this%buff(node) + this%tcomp(ib)
3708 if (this%ioutcomp /= 0)
then
3709 ibinun = this%ioutcomp
3710 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3711 comptxt(1), cdatafmp, nvaluesp, &
3712 nwidthp, editdesc, dinact)
3716 if (this%ioutzdisp /= 0)
then
3717 ibinun = this%ioutzdisp
3720 do nodeu = 1, this%dis%nodesuser
3721 this%buffusr(nodeu) =
dzero
3725 do node = 1, this%dis%nodes
3726 nodeu = this%dis%get_nodeuser(node)
3727 this%buffusr(nodeu) = this%buff(node)
3731 ncpl = this%dis%get_ncpl()
3734 if (this%dis%ndim == 1)
then
3735 do node = this%dis%nodes, 1, -1
3736 do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
3739 nodem = this%dis%con%ja(ii)
3740 idx_conn = this%dis%con%jas(ii)
3743 ihc = this%dis%con%ihc(idx_conn)
3747 if (node < nodem)
then
3748 va_scale = this%dis%get_area_factor(node, idx_conn)
3749 this%buffusr(node) = this%buffusr(node) + &
3750 va_scale * this%buffusr(nodem)
3757 nlay = this%dis%nodesuser / ncpl
3758 do k = nlay - 1, 1, -1
3760 node = (k - 1) * ncpl + i
3761 nodem = k * ncpl + i
3762 this%buffusr(node) = this%buffusr(node) + this%buffusr(nodem)
3768 do nodeu = 1, this%dis%nodesuser
3769 node = this%dis%get_nodenumber_idx1(nodeu, 1)
3771 this%buff(node) = this%buffusr(nodeu)
3776 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3777 comptxt(6), cdatafmp, nvaluesp, &
3778 nwidthp, editdesc, dinact)
3784 if (this%ioutcompi /= 0)
then
3785 ibinun = this%ioutcompi
3789 if (idvfl == 0) ibinun = 0
3792 if (ibinun /= 0)
then
3797 do node = 1, this%dis%nodes
3798 this%buff(node) =
dzero
3800 do ib = 1, this%ninterbeds
3801 node = this%nodelist(ib)
3802 this%buff(node) = this%buff(node) + this%tcompi(ib)
3806 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3807 comptxt(2), cdatafmp, nvaluesp, &
3808 nwidthp, editdesc, dinact)
3812 if (this%ioutcompe /= 0)
then
3813 ibinun = this%ioutcompe
3817 if (idvfl == 0) ibinun = 0
3820 if (ibinun /= 0)
then
3825 do node = 1, this%dis%nodes
3826 this%buff(node) =
dzero
3828 do ib = 1, this%ninterbeds
3829 node = this%nodelist(ib)
3830 this%buff(node) = this%buff(node) + this%tcompe(ib)
3834 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3835 comptxt(3), cdatafmp, nvaluesp, &
3836 nwidthp, editdesc, dinact)
3840 if (this%ioutcompib /= 0)
then
3841 ibinun = this%ioutcompib
3845 if (idvfl == 0) ibinun = 0
3848 if (ibinun /= 0)
then
3853 do node = 1, this%dis%nodes
3854 this%buff(node) =
dzero
3856 do ib = 1, this%ninterbeds
3857 node = this%nodelist(ib)
3858 this%buff(node) = this%buff(node) + this%tcompe(ib) + this%tcompi(ib)
3862 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3863 comptxt(4), cdatafmp, nvaluesp, &
3864 nwidthp, editdesc, dinact)
3868 if (this%ioutcomps /= 0)
then
3869 ibinun = this%ioutcomps
3873 if (idvfl == 0) ibinun = 0
3876 if (ibinun /= 0)
then
3881 do node = 1, this%dis%nodes
3882 this%buff(node) = this%cg_tcomp(node)
3886 call this%dis%record_array(this%buff, this%iout, iprint, ibinun, &
3887 comptxt(5), cdatafmp, nvaluesp, &
3888 nwidthp, editdesc, dinact)
3893 if (this%gwfiss == 0)
then
3894 call this%csub_cg_chk_stress()
3901 if (this%ndelaybeds > 0)
then
3902 if (this%idb_nconv_count(1) > this%idb_nconv_count(2))
then
3903 this%idb_nconv_count(2) = this%idb_nconv_count(1)
3905 if (this%idb_nconv_count(1) > 0)
then
3906 write (this%iout, fmtnconv) this%idb_nconv_count(1)
3921 integer(I4B),
intent(in) :: nodes
3922 real(DP),
dimension(nodes),
intent(in) :: hnew
3924 integer(I4B) :: node
3928 integer(I4B) :: idx_conn
3933 real(DP) :: va_scale
3942 if (this%iupdatestress /= 0)
then
3943 do node = 1, this%dis%nodes
3948 top = this%dis%top(node)
3949 bot = this%dis%bot(node)
3953 if (this%ibound(node) /= 0)
then
3963 if (hcell < top)
then
3964 gs = (top - hbar) * this%sgm(node) + (hbar - bot) * this%sgs(node)
3966 gs = thick * this%sgs(node)
3970 this%cg_gs(node) = gs
3974 do nn = 1, this%nbound
3975 node = this%nodelistsig0(nn)
3976 sadd = this%sig0(nn)
3977 this%cg_gs(node) = this%cg_gs(node) + sadd
3981 do node = 1, this%dis%nodes
3984 gs = this%cg_gs(node)
3988 do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
3991 m = this%dis%con%ja(ii)
3992 idx_conn = this%dis%con%jas(ii)
3995 if (this%dis%con%ihc(idx_conn) == 0)
then
4001 if (this%dis%ndim /= 1)
then
4002 gs = gs + this%cg_gs(m)
4006 va_scale = this%dis%get_area_factor(node, idx_conn)
4007 gs_conn = this%cg_gs(m)
4008 gs = gs + (gs_conn * va_scale)
4016 this%cg_gs(node) = gs
4022 do node = 1, this%dis%nodes
4023 top = this%dis%top(node)
4024 bot = this%dis%bot(node)
4025 if (this%ibound(node) /= 0)
then
4038 es = this%cg_gs(node) - phead
4039 this%cg_es(node) = es
4055 character(len=20) :: cellid
4056 integer(I4B) :: ierr
4057 integer(I4B) :: node
4071 do node = 1, this%dis%nodes
4072 if (this%ibound(node) < 1) cycle
4073 bot = this%dis%bot(node)
4074 gs = this%cg_gs(node)
4075 es = this%cg_es(node)
4077 if (this%ibound(node) /= 0)
then
4081 if (this%lhead_based .EQV. .false.)
then
4084 call this%dis%noder_to_string(node, cellid)
4085 write (
errmsg,
'(a,g0,a,1x,a,1x,a,4(g0,a))') &
4086 'Small to negative effective stress (', es,
') in cell', &
4087 trim(adjustl(cellid)),
'. (', es,
' = ', this%cg_gs(node), &
4088 ' - (', hcell,
' - ', bot,
').'
4096 write (
errmsg,
'(a,1x,i0,3(1x,a))') &
4097 'Solution: small to negative effective stress values in', ierr, &
4098 'cells can be eliminated by increasing storage values and/or ', &
4099 'adding/modifying stress boundaries to prevent water-levels from', &
4100 'exceeding the top of the model.'
4102 call this%parser%StoreErrorUnit()
4115 integer(I4B),
intent(in) :: i
4122 comp = this%tcomp(i) + this%comp(i)
4123 if (abs(comp) >
dzero)
then
4124 thick = this%thickini(i)
4125 theta = this%thetaini(i)
4126 call this%csub_adj_matprop(comp, thick, theta)
4127 if (thick <=
dzero)
then
4128 write (
errmsg,
'(a,1x,i0,1x,a,g0,a)') &
4129 'Adjusted thickness for no-delay interbed', i, &
4130 'is less than or equal to 0 (', thick,
').'
4133 if (theta <=
dzero)
then
4134 write (
errmsg,
'(a,1x,i0,1x,a,g0,a)') &
4135 'Adjusted theta for no-delay interbed', i, &
4136 'is less than or equal to 0 (', theta,
').'
4139 this%thick(i) = thick
4140 this%theta(i) = theta
4162 integer(I4B),
intent(in) :: ib
4163 real(DP),
intent(in) :: hcell
4164 real(DP),
intent(in) :: hcellold
4165 real(DP),
intent(inout) :: rho1
4166 real(DP),
intent(inout) :: rho2
4167 real(DP),
intent(inout) :: rhs
4168 real(DP),
intent(in),
optional :: argtled
4170 integer(I4B) :: node
4180 real(DP) :: sto_fac0
4190 if (
present(argtled))
then
4195 node = this%nodelist(ib)
4196 area = this%dis%get_area(node)
4197 bot = this%dis%bot(node)
4198 top = this%dis%top(node)
4199 thick = this%thickini(ib)
4205 this%iconvert(ib) = 0
4208 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4209 if (this%lhead_based .EQV. .true.)
then
4213 znode = this%csub_calc_znode(top, bot, hbar)
4214 es = this%cg_es(node)
4215 es0 = this%cg_es0(node)
4216 theta = this%thetaini(ib)
4221 call this%csub_calc_sfacts(node, bot, znode, theta, es, es0, f)
4223 sto_fac = tled * snnew * thick * f
4224 sto_fac0 = tled * snold * thick * f
4227 rho1 = this%rci(ib) * sto_fac0
4228 rho2 = this%rci(ib) * sto_fac
4229 if (this%cg_es(node) > this%pcs(ib))
then
4230 this%iconvert(ib) = 1
4231 rho2 = this%ci(ib) * sto_fac
4235 rcorr = rho2 * (hcell - hbar)
4238 if (this%ielastic(ib) /= 0)
then
4239 rhs = rho1 * this%cg_es0(node) - &
4240 rho2 * (this%cg_gs(node) + bot) - &
4243 rhs = -rho2 * (this%cg_gs(node) + bot) + &
4244 (this%pcs(ib) * (rho2 - rho1)) + &
4245 (rho1 * this%cg_es0(node)) - &
4267 integer(I4B),
intent(in) :: ib
4268 real(DP),
intent(in) :: hcell
4269 real(DP),
intent(in) :: hcellold
4270 real(DP),
intent(inout) :: comp
4271 real(DP),
intent(inout) :: rho1
4272 real(DP),
intent(inout) :: rho2
4274 integer(I4B) :: node
4282 node = this%nodelist(ib)
4284 es = this%cg_es(node)
4285 es0 = this%cg_es0(node)
4289 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhs, argtled=tled)
4292 if (this%ielastic(ib) /= 0)
then
4293 comp = rho2 * es - rho1 * es0
4295 comp = -pcs * (rho2 - rho1) - (rho1 * es0) + (rho2 * es)
4309 integer(I4B),
intent(in) :: nodes
4310 real(DP),
dimension(nodes),
intent(in) :: hnew
4312 character(len=LINELENGTH) :: title
4313 character(len=LINELENGTH) :: tag
4314 character(len=20) :: cellid
4316 integer(I4B) :: node
4318 integer(I4B) :: idelay
4319 integer(I4B) :: ntabrows
4320 integer(I4B) :: ntabcols
4326 real(DP) :: void_ratio
4336 call this%csub_cg_calc_stress(nodes, hnew)
4341 this%cg_es0(node) = this%cg_es(node)
4345 do ib = 1, this%ninterbeds
4346 idelay = this%idelay(ib)
4347 node = this%nodelist(ib)
4348 top = this%dis%top(node)
4349 bot = this%dis%bot(node)
4353 if (this%ispecified_pcs == 0)
then
4355 if (this%ipch /= 0)
then
4356 pcs = this%cg_es(node) - pcs0
4358 pcs = this%cg_es(node) + pcs0
4362 if (this%ipch /= 0)
then
4363 pcs = this%cg_gs(node) - (pcs0 - bot)
4365 if (pcs < this%cg_es(node))
then
4366 pcs = this%cg_es(node)
4372 if (idelay /= 0)
then
4373 dzhalf =
dhalf * this%dbdzini(1, idelay)
4378 do n = 1, this%ndelaycells
4379 if (this%ispecified_dbh == 0)
then
4380 this%dbh(n, idelay) = hcell + this%dbh(n, idelay)
4382 this%dbh(n, idelay) = hcell
4384 this%dbh0(n, idelay) = this%dbh(n, idelay)
4388 call this%csub_delay_calc_stress(ib, hcell)
4392 do n = 1, this%ndelaycells
4393 zbot = this%dbz(n, idelay) - dzhalf
4396 dbpcs = pcs - (zbot - bot) * (this%sgs(node) -
done)
4397 this%dbpcs(n, idelay) = dbpcs
4400 this%dbes0(n, idelay) = this%dbes(n, idelay)
4407 top = this%dis%top(node)
4408 bot = this%dis%bot(node)
4411 if (this%istoragec == 1)
then
4414 if (this%lhead_based .EQV. .true.)
then
4420 void_ratio = this%csub_calc_void_ratio(this%cg_theta(node))
4421 es = this%cg_es(node)
4428 znode = this%csub_calc_znode(top, bot, hbar)
4429 fact = this%csub_calc_adjes(node, es, bot, znode)
4430 fact = fact * (
done + void_ratio)
4437 this%cg_ske_cr(node) = this%cg_ske_cr(node) * fact
4440 if (fact <=
dzero)
then
4441 call this%dis%noder_to_string(node, cellid)
4442 write (
errmsg,
'(a,1x,a,a)') &
4443 'Negative recompression index calculated for cell', &
4444 trim(adjustl(cellid)),
'.'
4450 do ib = 1, this%ninterbeds
4451 idelay = this%idelay(ib)
4452 node = this%nodelist(ib)
4453 top = this%dis%top(node)
4454 bot = this%dis%bot(node)
4457 if (this%istoragec == 1)
then
4460 if (this%lhead_based .EQV. .true.)
then
4466 void_ratio = this%csub_calc_void_ratio(this%theta(ib))
4467 es = this%cg_es(node)
4474 znode = this%csub_calc_znode(top, bot, hbar)
4475 fact = this%csub_calc_adjes(node, es, bot, znode)
4476 fact = fact * (
done + void_ratio)
4483 this%ci(ib) = this%ci(ib) * fact
4484 this%rci(ib) = this%rci(ib) * fact
4487 if (fact <=
dzero)
then
4488 call this%dis%noder_to_string(node, cellid)
4489 write (
errmsg,
'(a,1x,i0,2(1x,a),a)') &
4490 'Negative compression indices calculated for interbed', ib, &
4491 'in cell', trim(adjustl(cellid)),
'.'
4497 if (this%iprpak == 1)
then
4499 title = trim(adjustl(this%packName))// &
4500 ' PACKAGE CALCULATED INITIAL INTERBED STRESSES AT THE CELL BOTTOM'
4503 ntabrows = this%ninterbeds
4505 if (this%inamedbound /= 0)
then
4506 ntabcols = ntabcols + 1
4510 call table_cr(this%inputtab, this%packName, title)
4511 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4514 tag =
'INTERBED NUMBER'
4515 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4517 call this%inputtab%initialize_column(tag, 20)
4518 tag =
'GEOSTATIC STRESS'
4519 call this%inputtab%initialize_column(tag, 16)
4520 tag =
'EFFECTIVE STRESS'
4521 call this%inputtab%initialize_column(tag, 16)
4522 tag =
'PRECONSOLIDATION STRESS'
4523 call this%inputtab%initialize_column(tag, 16)
4524 if (this%inamedbound /= 0)
then
4526 call this%inputtab%initialize_column(tag,
lenboundname, &
4531 do ib = 1, this%ninterbeds
4532 node = this%nodelist(ib)
4533 call this%dis%noder_to_string(node, cellid)
4536 call this%inputtab%add_term(ib)
4537 call this%inputtab%add_term(cellid)
4538 call this%inputtab%add_term(this%cg_gs(node))
4539 call this%inputtab%add_term(this%cg_es(node))
4540 call this%inputtab%add_term(this%pcs(ib))
4541 if (this%inamedbound /= 0)
then
4542 call this%inputtab%add_term(this%boundname(ib))
4549 title = trim(adjustl(this%packName))// &
4550 ' PACKAGE CALCULATED INITIAL DELAY INTERBED STRESSES'
4554 do ib = 1, this%ninterbeds
4555 idelay = this%idelay(ib)
4556 if (idelay /= 0)
then
4557 ntabrows = ntabrows + this%ndelaycells
4561 if (this%inamedbound /= 0)
then
4562 ntabcols = ntabcols + 1
4566 call table_cr(this%inputtab, this%packName, title)
4567 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4570 tag =
'INTERBED NUMBER'
4571 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4573 call this%inputtab%initialize_column(tag, 20)
4575 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4576 tag =
'GEOSTATIC STRESS'
4577 call this%inputtab%initialize_column(tag, 16)
4578 tag =
'EFFECTIVE STRESS'
4579 call this%inputtab%initialize_column(tag, 16)
4580 tag =
'PRECONSOLIDATION STRESS'
4581 call this%inputtab%initialize_column(tag, 16)
4582 if (this%inamedbound /= 0)
then
4584 call this%inputtab%initialize_column(tag,
lenboundname, &
4589 do ib = 1, this%ninterbeds
4590 idelay = this%idelay(ib)
4591 if (idelay /= 0)
then
4592 node = this%nodelist(ib)
4593 call this%dis%noder_to_string(node, cellid)
4596 do n = 1, this%ndelaycells
4598 call this%inputtab%add_term(ib)
4599 call this%inputtab%add_term(cellid)
4601 call this%inputtab%add_term(
' ')
4602 call this%inputtab%add_term(
' ')
4604 call this%inputtab%add_term(n)
4605 call this%inputtab%add_term(this%dbgeo(n, idelay))
4606 call this%inputtab%add_term(this%dbes(n, idelay))
4607 call this%inputtab%add_term(this%dbpcs(n, idelay))
4608 if (this%inamedbound /= 0)
then
4610 call this%inputtab%add_term(this%boundname(ib))
4612 call this%inputtab%add_term(
' ')
4620 if (this%istoragec == 1)
then
4621 if (this%lhead_based .EQV. .false.)
then
4623 title = trim(adjustl(this%packName))// &
4624 ' PACKAGE COMPRESSION INDICES'
4627 ntabrows = this%ninterbeds
4629 if (this%inamedbound /= 0)
then
4630 ntabcols = ntabcols + 1
4634 call table_cr(this%inputtab, this%packName, title)
4635 call this%inputtab%table_df(ntabrows, ntabcols, this%iout)
4638 tag =
'INTERBED NUMBER'
4639 call this%inputtab%initialize_column(tag, 10, alignment=
tableft)
4641 call this%inputtab%initialize_column(tag, 20)
4643 call this%inputtab%initialize_column(tag, 16)
4645 call this%inputtab%initialize_column(tag, 16)
4646 if (this%inamedbound /= 0)
then
4648 call this%inputtab%initialize_column(tag,
lenboundname, &
4653 do ib = 1, this%ninterbeds
4655 node = this%nodelist(ib)
4656 call this%dis%noder_to_string(node, cellid)
4659 call this%inputtab%add_term(ib)
4660 call this%inputtab%add_term(cellid)
4661 call this%inputtab%add_term(this%ci(ib) * fact)
4662 call this%inputtab%add_term(this%rci(ib) * fact)
4663 if (this%inamedbound /= 0)
then
4664 call this%inputtab%add_term(this%boundname(ib))
4673 call this%parser%StoreErrorUnit()
4677 this%initialized = 1
4680 if (this%lhead_based .EQV. .true.)
then
4681 this%iupdatestress = 0
4694 subroutine csub_cg_fc(this, node, tled, area, hcell, hcellold, hcof, rhs)
4697 integer(I4B),
intent(in) :: node
4698 real(DP),
intent(in) :: tled
4699 real(DP),
intent(in) :: area
4700 real(DP),
intent(in) :: hcell
4701 real(DP),
intent(in) :: hcellold
4702 real(DP),
intent(inout) :: hcof
4703 real(DP),
intent(inout) :: rhs
4719 top = this%dis%top(node)
4720 bot = this%dis%bot(node)
4721 tthk = this%cg_thickini(node)
4724 if (tthk >
dzero)
then
4727 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4733 call this%csub_cg_calc_sske(node, sske, hcell)
4734 rho1 = sske * area * tthk * tled
4737 this%cg_ske(node) = sske * tthk * snold
4738 this%cg_sk(node) = sske * tthk * snnew
4741 hcof = -rho1 * snnew
4742 rhs = rho1 * snold * this%cg_es0(node) - &
4743 rho1 * snnew * (this%cg_gs(node) + bot)
4746 rhs = rhs - rho1 * snnew * (hcell - hbar)
4763 integer(I4B),
intent(in) :: node
4764 real(DP),
intent(in) :: tled
4765 real(DP),
intent(in) :: area
4766 real(DP),
intent(in) :: hcell
4767 real(DP),
intent(inout) :: hcof
4768 real(DP),
intent(inout) :: rhs
4777 real(DP) :: hbarderv
4786 top = this%dis%top(node)
4787 bot = this%dis%bot(node)
4788 tthk = this%cg_thickini(node)
4791 if (tthk >
dzero)
then
4794 call this%csub_calc_sat(node, hcell, top, snnew, snold)
4797 satderv = this%csub_calc_sat_derivative(node, hcell)
4806 call this%csub_cg_calc_sske(node, sske, hcell)
4807 rho1 = sske * area * tthk * tled
4810 hcof = rho1 * snnew * (
done - hbarderv) + &
4811 rho1 * (this%cg_gs(node) - hbar + bot) * satderv
4814 if (this%ieslag /= 0)
then
4815 hcof = hcof - rho1 * this%cg_es0(node) * satderv
4835 integer(I4B),
intent(in) :: ib
4836 integer(I4B),
intent(in) :: node
4837 real(DP),
intent(in) :: area
4838 real(DP),
intent(in) :: hcell
4839 real(DP),
intent(in) :: hcellold
4840 real(DP),
intent(inout) :: hcof
4841 real(DP),
intent(inout) :: rhs
4860 if (this%ibound(node) > 0)
then
4861 if (this%idelay(ib) == 0)
then
4864 if (this%iupdatematprop /= 0)
then
4865 if (this%ieslag == 0)
then
4868 call this%csub_nodelay_calc_comp(ib, hcell, hcellold, comp, &
4870 this%comp(ib) = comp
4873 call this%csub_nodelay_update(ib)
4878 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, hcof, rhs)
4883 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4886 if (this%iupdatematprop /= 0)
then
4887 if (this%ieslag == 0)
then
4890 call this%csub_delay_calc_comp(ib, hcell, hcellold, &
4892 this%comp(ib) = comp
4895 call this%csub_delay_update(ib)
4900 call this%csub_delay_sln(ib, hcell)
4901 call this%csub_delay_fc(ib, hcof, rhs)
4902 f = area * this%rnb(ib)
4923 integer(I4B),
intent(in) :: ib
4924 integer(I4B),
intent(in) :: node
4925 real(DP),
intent(in) :: hcell
4926 real(DP),
intent(in) :: hcellold
4927 real(DP),
intent(inout) :: hcof
4928 real(DP),
intent(inout) :: rhs
4930 integer(I4B) :: idelay
4942 real(DP) :: hbarderv
4952 idelay = this%idelay(ib)
4953 top = this%dis%top(node)
4954 bot = this%dis%bot(node)
4957 if (this%ibound(node) > 0)
then
4959 tthk = this%thickini(ib)
4962 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
4965 if (idelay == 0)
then
4971 satderv = this%csub_calc_sat_derivative(node, hcell)
4980 call this%csub_nodelay_fc(ib, hcell, hcellold, rho1, rho2, rhsn)
4983 hcofn = rho2 * (
done - hbarderv) * snnew + &
4984 rho2 * (this%cg_gs(node) - hbar + bot) * satderv
4985 if (this%ielastic(ib) == 0)
then
4986 hcofn = hcofn - rho2 * this%pcs(ib) * satderv
4990 if (this%ieslag /= 0)
then
4991 if (this%ielastic(ib) /= 0)
then
4992 hcofn = hcofn - rho1 * this%cg_es0(node) * satderv
4994 hcofn = hcofn - rho1 * (this%pcs(ib) - this%cg_es0(node)) * satderv
5011 integer(I4B),
intent(in) :: n
5012 real(DP),
intent(inout) :: sske
5013 real(DP),
intent(in) :: hcell
5029 if (this%lhead_based .EQV. .true.)
then
5035 top = this%dis%top(n)
5036 bot = this%dis%bot(n)
5042 znode = this%csub_calc_znode(top, bot, hbar)
5046 es0 = this%cg_es0(n)
5047 theta = this%cg_thetaini(n)
5052 call this%csub_calc_sfacts(n, bot, znode, theta, es, es0, f)
5054 sske = f * this%cg_ske_cr(n)
5067 integer(I4B),
intent(in) :: node
5068 real(DP),
intent(in) :: hcell
5069 real(DP),
intent(in) :: hcellold
5070 real(DP),
intent(inout) :: comp
5082 call this%csub_cg_fc(node, tled, area, hcell, hcellold, hcof, rhs)
5085 comp = hcof * hcell - rhs
5096 integer(I4B),
intent(in) :: node
5098 character(len=20) :: cellid
5104 comp = this%cg_tcomp(node) + this%cg_comp(node)
5105 call this%dis%noder_to_string(node, cellid)
5106 if (abs(comp) >
dzero)
then
5107 thick = this%cg_thickini(node)
5108 theta = this%cg_thetaini(node)
5109 call this%csub_adj_matprop(comp, thick, theta)
5110 if (thick <=
dzero)
then
5111 write (
errmsg,
'(a,1x,a,1x,a,g0,a)') &
5112 'Adjusted thickness for cell', trim(adjustl(cellid)), &
5113 'is less than or equal to 0 (', thick,
').'
5116 if (theta <=
dzero)
then
5117 write (
errmsg,
'(a,1x,a,1x,a,g0,a)') &
5118 'Adjusted theta for cell', trim(adjustl(cellid)), &
5119 'is less than or equal to 0 (', theta,
').'
5122 this%cg_thick(node) = thick
5123 this%cg_theta(node) = theta
5141 integer(I4B),
intent(in) :: node
5142 real(DP),
intent(in) :: tled
5143 real(DP),
intent(in) :: area
5144 real(DP),
intent(in) :: hcell
5145 real(DP),
intent(in) :: hcellold
5146 real(DP),
intent(inout) :: hcof
5147 real(DP),
intent(inout) :: rhs
5163 top = this%dis%top(node)
5164 bot = this%dis%bot(node)
5165 tthk = this%cg_thick(node)
5166 tthk0 = this%cg_thick0(node)
5169 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
5172 wc0 = this%brg * area * tthk0 * this%cg_theta0(node) * tled
5173 wc = this%brg * area * tthk * this%cg_theta(node) * tled
5179 rhs = -wc0 * snold * hcellold
5195 integer(I4B),
intent(in) :: node
5196 real(DP),
intent(in) :: tled
5197 real(DP),
intent(in) :: area
5198 real(DP),
intent(in) :: hcell
5199 real(DP),
intent(in) :: hcellold
5200 real(DP),
intent(inout) :: hcof
5201 real(DP),
intent(inout) :: rhs
5217 top = this%dis%top(node)
5218 bot = this%dis%bot(node)
5219 tthk = this%cg_thick(node)
5222 satderv = this%csub_calc_sat_derivative(node, hcell)
5225 f = this%brg * area * tled
5228 wc = f * tthk * this%cg_theta(node)
5231 hcof = -wc * hcell * satderv
5234 if (this%ieslag /= 0)
then
5235 tthk0 = this%cg_thick0(node)
5236 wc0 = f * tthk0 * this%cg_theta0(node)
5237 hcof = hcof + wc * hcellold * satderv
5255 hcell, hcellold, hcof, rhs)
5258 integer(I4B),
intent(in) :: ib
5259 integer(I4B),
intent(in) :: node
5260 real(DP),
intent(in) :: tled
5261 real(DP),
intent(in) :: area
5262 real(DP),
intent(in) :: hcell
5263 real(DP),
intent(in) :: hcellold
5264 real(DP),
intent(inout) :: hcof
5265 real(DP),
intent(inout) :: rhs
5280 top = this%dis%top(node)
5281 bot = this%dis%bot(node)
5284 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
5287 f = this%brg * area * tled
5288 wc0 = f * this%theta0(ib) * this%thick0(ib)
5289 wc = f * this%theta(ib) * this%thick(ib)
5291 rhs = -wc0 * snold * hcellold
5305 hcell, hcellold, hcof, rhs)
5308 integer(I4B),
intent(in) :: ib
5309 integer(I4B),
intent(in) :: node
5310 real(DP),
intent(in) :: tled
5311 real(DP),
intent(in) :: area
5312 real(DP),
intent(in) :: hcell
5313 real(DP),
intent(in) :: hcellold
5314 real(DP),
intent(inout) :: hcof
5315 real(DP),
intent(inout) :: rhs
5329 top = this%dis%top(node)
5330 bot = this%dis%bot(node)
5333 f = this%brg * area * tled
5336 satderv = this%csub_calc_sat_derivative(node, hcell)
5339 wc = f * this%theta(ib) * this%thick(ib)
5342 hcof = -wc * hcell * satderv
5345 if (this%ieslag /= 0)
then
5346 wc0 = f * this%theta0(ib) * this%thick0(ib)
5347 hcof = hcof + wc0 * hcellold * satderv
5363 real(dp),
intent(in) :: theta
5365 real(dp) :: void_ratio
5367 void_ratio = theta / (
done - theta)
5379 real(dp),
intent(in) :: void_ratio
5384 theta = void_ratio / (
done + void_ratio)
5396 integer(I4B),
intent(in) :: ib
5398 integer(I4B) :: idelay
5402 idelay = this%idelay(ib)
5403 thick = this%thick(ib)
5404 if (idelay /= 0)
then
5405 thick = thick * this%rnb(ib)
5422 real(dp),
intent(in) :: top
5423 real(dp),
intent(in) :: bottom
5424 real(dp),
intent(in) :: zbar
5430 if (zbar > top)
then
5435 znode =
dhalf * (v + bottom)
5449 integer(I4B),
intent(in) :: node
5450 real(dp),
intent(in) :: es0
5451 real(dp),
intent(in) :: z0
5452 real(dp),
intent(in) :: z
5457 es = es0 - (z - z0) * (this%sgs(node) -
done)
5470 integer(I4B),
intent(in) :: ib
5472 integer(I4B) :: iviolate
5473 integer(I4B) :: idelay
5474 integer(I4B) :: node
5483 idelay = this%idelay(ib)
5484 node = this%nodelist(ib)
5487 idelaycells:
do n = 1, this%ndelaycells
5488 z = this%dbz(n, idelay)
5489 h = this%dbh(n, idelay)
5490 dzhalf =
dhalf * this%dbdzini(1, idelay)
5493 if (this%stoiconv(node) == 0)
then
5496 this%idb_nconv_count(1) = this%idb_nconv_count(1) + 1
5502 if (iviolate > 0)
then
5520 integer(I4B),
intent(in) :: node
5521 real(DP),
intent(in) :: hcell
5522 real(DP),
intent(in) :: hcellold
5523 real(DP),
intent(inout) :: snnew
5524 real(DP),
intent(inout) :: snold
5530 if (this%stoiconv(node) /= 0)
then
5531 top = this%dis%top(node)
5532 bot = this%dis%bot(node)
5539 if (this%ieslag /= 0)
then
5554 integer(I4B),
intent(in) :: node
5555 real(dp),
intent(in) :: hcell
5561 if (this%stoiconv(node) /= 0)
then
5562 top = this%dis%top(node)
5563 bot = this%dis%bot(node)
5582 integer(I4B),
intent(in) :: node
5583 real(DP),
intent(in) :: bot
5584 real(DP),
intent(in) :: znode
5585 real(DP),
intent(in) :: theta
5586 real(DP),
intent(in) :: es
5587 real(DP),
intent(in) :: es0
5588 real(DP),
intent(inout) :: fact
5591 real(DP) :: void_ratio
5596 if (this%ieslag /= 0)
then
5603 void_ratio = this%csub_calc_void_ratio(theta)
5604 denom = this%csub_calc_adjes(node, esv, bot, znode)
5605 denom = denom * (
done + void_ratio)
5606 if (denom /=
dzero)
then
5622 real(DP),
intent(in) :: comp
5623 real(DP),
intent(inout) :: thick
5624 real(DP),
intent(inout) :: theta
5627 real(DP) :: void_ratio
5631 void_ratio = this%csub_calc_void_ratio(theta)
5634 if (thick >
dzero) strain = -comp / thick
5637 void_ratio = void_ratio + strain * (
done + void_ratio)
5638 theta = this%csub_calc_theta(void_ratio)
5639 thick = thick - comp
5652 integer(I4B),
intent(in) :: ib
5653 real(DP),
intent(in) :: hcell
5654 logical(LGP),
intent(in),
optional :: update
5658 logical(LGP) :: lupdate
5660 integer(I4B) :: icnvg
5661 integer(I4B) :: iter
5662 integer(I4B) :: idelay
5669 if (
present(update))
then
5676 call this%csub_delay_calc_stress(ib, hcell)
5680 call this%parser%StoreErrorUnit()
5684 if (this%thickini(ib) >
dzero)
then
5687 idelay = this%idelay(ib)
5692 call this%csub_delay_assemble(ib, hcell)
5696 this%dbal, this%dbad, this%dbau, &
5697 this%dbrhs, this%dbdh, this%dbaw)
5701 do n = 1, this%ndelaycells
5702 dh = this%dbdh(n) - this%dbh(n, idelay)
5703 if (abs(dh) > abs(dhmax))
then
5706 this%dbdhmax(idelay) = dhmax
5710 this%dbh(n, idelay) = this%dbdh(n)
5714 call this%csub_delay_calc_stress(ib, hcell)
5717 if (abs(dhmax) < dclose)
then
5719 else if (iter /= 1)
then
5720 if (abs(dhmax) - abs(dhmax0) <
dprec)
then
5724 if (icnvg == 1)
then
5745 integer(I4B),
intent(in) :: ib
5748 integer(I4B) :: node
5749 integer(I4B) :: idelay
5761 idelay = this%idelay(ib)
5762 node = this%nodelist(ib)
5763 b = this%thickini(ib)
5764 bot = this%dis%bot(node)
5770 znode = this%csub_calc_znode(top, bot, hbar)
5771 dz =
dhalf * this%dbdzini(1, idelay)
5778 do n = 1, this%ndelaycells
5781 this%dbz(n, idelay) = z
5785 if (abs(zr) < dz)
then
5788 this%dbrelz(n, idelay) = zr
5802 integer(I4B),
intent(in) :: ib
5803 real(DP),
intent(in) :: hcell
5806 integer(I4B) :: idelay
5807 integer(I4B) :: node
5823 idelay = this%idelay(ib)
5824 node = this%nodelist(ib)
5825 sigma = this%cg_gs(node)
5826 topaq = this%dis%top(node)
5827 botaq = this%dis%bot(node)
5828 dzhalf =
dhalf * this%dbdzini(1, idelay)
5829 top = this%dbz(1, idelay) + dzhalf
5835 sgm = this%sgm(node)
5836 sgs = this%sgs(node)
5837 if (hcell < top)
then
5838 sadd = ((top - hbar) * sgm) + ((hbar - botaq) * sgs)
5840 sadd = (top - botaq) * sgs
5842 sigma = sigma - sadd
5845 do n = 1, this%ndelaycells
5846 h = this%dbh(n, idelay)
5849 z = this%dbz(n, idelay)
5858 sadd = ((top - hbar) * sgm) + ((hbar - bot) * sgs)
5860 sadd = (top - bot) * sgs
5862 sigma = sigma + sadd
5864 this%dbgeo(n, idelay) = sigma
5865 this%dbes(n, idelay) = sigma - phead
5882 integer(I4B),
intent(in) :: ib
5883 integer(I4B),
intent(in) :: n
5884 real(DP),
intent(in) :: hcell
5885 real(DP),
intent(inout) :: ssk
5886 real(DP),
intent(inout) :: sske
5888 integer(I4B) :: idelay
5889 integer(I4B) :: ielastic
5890 integer(I4B) :: node
5893 real(DP) :: hbarcell
5912 idelay = this%idelay(ib)
5913 ielastic = this%ielastic(ib)
5916 if (this%lhead_based .EQV. .true.)
then
5922 node = this%nodelist(ib)
5923 theta = this%dbthetaini(n, idelay)
5926 topcell = this%dis%top(node)
5927 botcell = this%dis%bot(node)
5934 zcell = this%csub_calc_znode(topcell, botcell, hbarcell)
5937 zcenter = zcell + this%dbrelz(n, idelay)
5938 dzhalf =
dhalf * this%dbdzini(1, idelay)
5939 top = zcenter + dzhalf
5940 bot = zcenter - dzhalf
5941 h = this%dbh(n, idelay)
5948 znode = this%csub_calc_znode(top, bot, hbar)
5952 zbot = this%dbz(n, idelay) - dzhalf
5955 es = this%dbes(n, idelay)
5956 es0 = this%dbes0(n, idelay)
5961 call this%csub_calc_sfacts(node, zbot, znode, theta, es, es0, f)
5963 this%idbconvert(n, idelay) = 0
5964 sske = f * this%rci(ib)
5965 ssk = f * this%rci(ib)
5966 if (ielastic == 0)
then
5967 if (this%dbes(n, idelay) > this%dbpcs(n, idelay))
then
5968 this%idbconvert(n, idelay) = 1
5969 ssk = f * this%ci(ib)
5984 integer(I4B),
intent(in) :: ib
5985 real(DP),
intent(in) :: hcell
5994 do n = 1, this%ndelaycells
5997 if (this%inewton == 0)
then
5998 call this%csub_delay_assemble_fc(ib, n, hcell, aii, au, al, r)
6000 call this%csub_delay_assemble_fn(ib, n, hcell, aii, au, al, r)
6022 integer(I4B),
intent(in) :: ib
6023 integer(I4B),
intent(in) :: n
6024 real(DP),
intent(in) :: hcell
6025 real(DP),
intent(inout) :: aii
6026 real(DP),
intent(inout) :: au
6027 real(DP),
intent(inout) :: al
6028 real(DP),
intent(inout) :: r
6030 integer(I4B) :: node
6031 integer(I4B) :: idelay
6032 integer(I4B) :: ielastic
6068 idelay = this%idelay(ib)
6069 ielastic = this%ielastic(ib)
6070 node = this%nodelist(ib)
6071 dzini = this%dbdzini(1, idelay)
6072 dzhalf =
dhalf * dzini
6074 c = this%kv(ib) / dzini
6082 if (n == 1 .or. n == this%ndelaycells)
then
6093 if (n < this%ndelaycells)
then
6098 z = this%dbz(n, idelay)
6101 h = this%dbh(n, idelay)
6102 h0 = this%dbh0(n, idelay)
6103 dz = this%dbdz(n, idelay)
6104 dz0 = this%dbdz0(n, idelay)
6105 theta = this%dbtheta(n, idelay)
6106 theta0 = this%dbtheta0(n, idelay)
6112 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6115 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6118 smult = dzini * tled
6119 gs = this%dbgeo(n, idelay)
6120 es0 = this%dbes0(n, idelay)
6121 pcs = this%dbpcs(n, idelay)
6122 aii = aii - smult * dsn * ssk
6123 if (ielastic /= 0)
then
6125 (dsn * ssk * (gs + zbot) - dsn0 * sske * es0)
6128 (dsn * ssk * (gs + zbot - pcs) + dsn0 * sske * (pcs - es0))
6132 r = r + smult * dsn * ssk * (h - hbar)
6135 wcf = this%brg * tled
6136 wc = dz * wcf * theta
6137 wc0 = dz0 * wcf * theta0
6138 aii = aii - dsn * wc
6139 r = r - dsn0 * wc0 * h0
6153 integer(I4B),
intent(in) :: ib
6154 integer(I4B),
intent(in) :: n
6155 real(DP),
intent(in) :: hcell
6156 real(DP),
intent(inout) :: aii
6157 real(DP),
intent(inout) :: au
6158 real(DP),
intent(inout) :: al
6159 real(DP),
intent(inout) :: r
6161 integer(I4B) :: node
6162 integer(I4B) :: idelay
6163 integer(I4B) :: ielastic
6189 real(DP) :: hbarderv
6205 idelay = this%idelay(ib)
6206 ielastic = this%ielastic(ib)
6207 node = this%nodelist(ib)
6208 dzini = this%dbdzini(1, idelay)
6209 dzhalf =
dhalf * dzini
6211 c = this%kv(ib) / dzini
6219 if (n == 1 .or. n == this%ndelaycells)
then
6230 if (n < this%ndelaycells)
then
6235 z = this%dbz(n, idelay)
6238 h = this%dbh(n, idelay)
6239 h0 = this%dbh0(n, idelay)
6240 dz = this%dbdz(n, idelay)
6241 dz0 = this%dbdz0(n, idelay)
6242 theta = this%dbtheta(n, idelay)
6243 theta0 = this%dbtheta0(n, idelay)
6252 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6255 dsnderv = this%csub_delay_calc_sat_derivative(node, idelay, n, hcell)
6258 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6261 smult = dzini * tled
6262 gs = this%dbgeo(n, idelay)
6263 es0 = this%dbes0(n, idelay)
6264 pcs = this%dbpcs(n, idelay)
6265 if (ielastic /= 0)
then
6266 qsto = smult * (dsn * ssk * (gs - hbar + zbot) - dsn0 * sske * es0)
6267 stoderv = -smult * dsn * ssk * hbarderv + &
6268 smult * ssk * (gs - hbar + zbot) * dsnderv
6270 qsto = smult * (dsn * ssk * (gs - hbar + zbot - pcs) + &
6271 dsn0 * sske * (pcs - es0))
6272 stoderv = -smult * dsn * ssk * hbarderv + &
6273 smult * ssk * (gs - hbar + zbot - pcs) * dsnderv
6277 if (this%ieslag /= 0)
then
6278 if (ielastic /= 0)
then
6279 stoderv = stoderv - smult * sske * es0 * dsnderv
6281 stoderv = stoderv + smult * sske * (pcs - es0) * dsnderv
6287 r = r - qsto + stoderv * h
6290 wcf = this%brg * tled
6291 wc = dz * wcf * theta
6292 wc0 = dz0 * wcf * theta0
6293 qwc = dsn0 * wc0 * h0 - dsn * wc * h
6294 wcderv = -dsn * wc - wc * h * dsnderv
6297 if (this%ieslag /= 0)
then
6298 wcderv = wcderv + wc0 * h0 * dsnderv
6303 r = r - qwc + wcderv * h
6318 integer(I4B),
intent(in) :: node
6319 integer(I4B),
intent(in) :: idelay
6320 integer(I4B),
intent(in) :: n
6321 real(DP),
intent(in) :: hcell
6322 real(DP),
intent(in) :: hcellold
6323 real(DP),
intent(inout) :: snnew
6324 real(DP),
intent(inout) :: snold
6331 if (this%stoiconv(node) /= 0)
then
6332 dzhalf =
dhalf * this%dbdzini(n, idelay)
6333 top = this%dbz(n, idelay) + dzhalf
6334 bot = this%dbz(n, idelay) - dzhalf
6341 if (this%ieslag /= 0)
then
6357 integer(I4B),
intent(in) :: node
6358 integer(I4B),
intent(in) :: idelay
6359 integer(I4B),
intent(in) :: n
6360 real(dp),
intent(in) :: hcell
6367 if (this%stoiconv(node) /= 0)
then
6368 dzhalf =
dhalf * this%dbdzini(n, idelay)
6369 top = this%dbz(n, idelay) + dzhalf
6370 bot = this%dbz(n, idelay) - dzhalf
6388 integer(I4B),
intent(in) :: ib
6389 real(DP),
intent(in) :: hcell
6390 real(DP),
intent(inout) :: stoe
6391 real(DP),
intent(inout) :: stoi
6393 integer(I4B) :: idelay
6394 integer(I4B) :: ielastic
6395 integer(I4B) :: node
6414 idelay = this%idelay(ib)
6415 ielastic = this%ielastic(ib)
6416 node = this%nodelist(ib)
6423 if (this%thickini(ib) >
dzero)
then
6424 fmult = this%dbdzini(1, idelay)
6425 dzhalf =
dhalf * this%dbdzini(1, idelay)
6426 do n = 1, this%ndelaycells
6427 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6428 z = this%dbz(n, idelay)
6430 h = this%dbh(n, idelay)
6431 h0 = this%dbh0(n, idelay)
6432 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6434 if (ielastic /= 0)
then
6435 v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot) - &
6436 dsn0 * sske * this%dbes0(n, idelay)
6439 v1 = dsn * ssk * (this%dbgeo(n, idelay) - hbar + zbot - &
6440 this%dbpcs(n, idelay))
6441 v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6445 if (this%idbconvert(n, idelay) /= 0)
then
6446 stoi = stoi + v1 * fmult
6447 stoe = stoe + v2 * fmult
6449 stoe = stoe + (v1 + v2) * fmult
6453 ske = ske + sske * fmult
6454 sk = sk + ssk * fmult
6475 integer(I4B),
intent(in) :: ib
6476 real(DP),
intent(inout) :: dwc
6478 integer(I4B) :: idelay
6479 integer(I4B) :: node
6496 if (this%thickini(ib) >
dzero)
then
6497 idelay = this%idelay(ib)
6498 node = this%nodelist(ib)
6500 do n = 1, this%ndelaycells
6501 h = this%dbh(n, idelay)
6502 h0 = this%dbh0(n, idelay)
6503 dz = this%dbdz(n, idelay)
6504 dz0 = this%dbdz0(n, idelay)
6505 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6506 wc = dz * this%brg * this%dbtheta(n, idelay)
6507 wc0 = dz0 * this%brg * this%dbtheta0(n, idelay)
6508 v = dsn0 * wc0 * h0 - dsn * wc * h
6509 dwc = dwc + v * tled
6526 integer(I4B),
intent(in) :: ib
6527 real(DP),
intent(in) :: hcell
6528 real(DP),
intent(in) :: hcellold
6529 real(DP),
intent(inout) :: comp
6530 real(DP),
intent(inout) :: compi
6531 real(DP),
intent(inout) :: compe
6533 integer(I4B) :: idelay
6534 integer(I4B) :: ielastic
6535 integer(I4B) :: node
6551 idelay = this%idelay(ib)
6552 ielastic = this%ielastic(ib)
6553 node = this%nodelist(ib)
6559 call this%csub_calc_sat(node, hcell, hcellold, snnew, snold)
6562 if (this%thickini(ib) >
dzero)
then
6563 fmult = this%dbdzini(1, idelay)
6564 do n = 1, this%ndelaycells
6565 h = this%dbh(n, idelay)
6566 h0 = this%dbh0(n, idelay)
6567 call this%csub_delay_calc_sat(node, idelay, n, h, h0, dsn, dsn0)
6568 call this%csub_delay_calc_ssksske(ib, n, hcell, ssk, sske)
6569 if (ielastic /= 0)
then
6570 v1 = dsn * ssk * this%dbes(n, idelay) - sske * this%dbes0(n, idelay)
6573 v1 = dsn * ssk * (this%dbes(n, idelay) - this%dbpcs(n, idelay))
6574 v2 = dsn0 * sske * (this%dbpcs(n, idelay) - this%dbes0(n, idelay))
6576 v = (v1 + v2) * fmult
6580 this%dbcomp(n, idelay) = v * snnew
6583 if (this%idbconvert(n, idelay) /= 0)
then
6584 compi = compi + v1 * fmult
6585 compe = compe + v2 * fmult
6587 compe = compe + (v1 + v2) * fmult
6593 comp = comp * this%rnb(ib)
6594 compi = compi * this%rnb(ib)
6595 compe = compe * this%rnb(ib)
6606 integer(I4B),
intent(in) :: ib
6608 integer(I4B) :: idelay
6617 idelay = this%idelay(ib)
6623 do n = 1, this%ndelaycells
6626 comp = this%dbtcomp(n, idelay) + this%dbcomp(n, idelay)
6630 comp = comp / this%rnb(ib)
6633 if (abs(comp) >
dzero)
then
6634 thick = this%dbdzini(n, idelay)
6635 theta = this%dbthetaini(n, idelay)
6636 call this%csub_adj_matprop(comp, thick, theta)
6637 if (thick <=
dzero)
then
6638 write (
errmsg,
'(2(a,i0),a,g0,a)') &
6639 'Adjusted thickness for delay interbed (', ib, &
6640 ') cell (', n,
') is less than or equal to 0 (', thick,
').'
6643 if (theta <=
dzero)
then
6644 write (
errmsg,
'(2(a,i0),a,g0,a)') &
6645 'Adjusted theta for delay interbed (', ib, &
6646 ') cell (', n,
'is less than or equal to 0 (', theta,
').'
6649 this%dbdz(n, idelay) = thick
6650 this%dbtheta(n, idelay) = theta
6651 tthick = tthick + thick
6652 wtheta = wtheta + thick * theta
6654 thick = this%dbdz(n, idelay)
6655 theta = this%dbtheta(n, idelay)
6656 tthick = tthick + thick
6657 wtheta = wtheta + thick * theta
6663 if (tthick >
dzero)
then
6664 wtheta = wtheta / tthick
6669 this%thick(ib) = tthick
6670 this%theta(ib) = wtheta
6686 integer(I4B),
intent(in) :: ib
6687 real(DP),
intent(inout) :: hcof
6688 real(DP),
intent(inout) :: rhs
6690 integer(I4B) :: idelay
6695 idelay = this%idelay(ib)
6698 if (this%thickini(ib) >
dzero)
then
6700 c1 =
dtwo * this%kv(ib) / this%dbdzini(1, idelay)
6701 rhs = -c1 * this%dbh(1, idelay)
6703 this%kv(ib) / this%dbdzini(this%ndelaycells, idelay)
6704 rhs = rhs - c2 * this%dbh(this%ndelaycells, idelay)
6719 integer(I4B),
intent(in) :: ib
6720 integer(I4B),
intent(in) :: n
6721 real(dp),
intent(in) :: hcell
6723 integer(I4B) :: idelay
6728 idelay = this%idelay(ib)
6729 c =
dtwo * this%kv(ib) / this%dbdzini(n, idelay)
6730 q = c * (hcell - this%dbh(n, idelay))
6759 integer(I4B) :: indx
6763 call this%obs%StoreObsType(
'csub', .true., indx)
6768 call this%obs%StoreObsType(
'inelastic-csub', .true., indx)
6773 call this%obs%StoreObsType(
'elastic-csub', .true., indx)
6778 call this%obs%StoreObsType(
'coarse-csub', .false., indx)
6783 call this%obs%StoreObsType(
'csub-cell', .true., indx)
6788 call this%obs%StoreObsType(
'wcomp-csub-cell', .false., indx)
6793 call this%obs%StoreObsType(
'ske', .true., indx)
6798 call this%obs%StoreObsType(
'sk', .true., indx)
6803 call this%obs%StoreObsType(
'ske-cell', .true., indx)
6808 call this%obs%StoreObsType(
'sk-cell', .true., indx)
6813 call this%obs%StoreObsType(
'gstress-cell', .false., indx)
6818 call this%obs%StoreObsType(
'estress-cell', .false., indx)
6823 call this%obs%StoreObsType(
'interbed-compaction', .true., indx)
6828 call this%obs%StoreObsType(
'inelastic-compaction', .true., indx)
6833 call this%obs%StoreObsType(
'elastic-compaction', .true., indx)
6838 call this%obs%StoreObsType(
'coarse-compaction', .false., indx)
6843 call this%obs%StoreObsType(
'inelastic-compaction-cell', .true., indx)
6848 call this%obs%StoreObsType(
'elastic-compaction-cell', .true., indx)
6853 call this%obs%StoreObsType(
'compaction-cell', .true., indx)
6858 call this%obs%StoreObsType(
'thickness', .true., indx)
6863 call this%obs%StoreObsType(
'coarse-thickness', .false., indx)
6868 call this%obs%StoreObsType(
'thickness-cell', .false., indx)
6873 call this%obs%StoreObsType(
'theta', .true., indx)
6878 call this%obs%StoreObsType(
'coarse-theta', .false., indx)
6883 call this%obs%StoreObsType(
'theta-cell', .true., indx)
6888 call this%obs%StoreObsType(
'preconstress-cell', .false., indx)
6893 call this%obs%StoreObsType(
'delay-preconstress', .false., indx)
6898 call this%obs%StoreObsType(
'delay-head', .false., indx)
6903 call this%obs%StoreObsType(
'delay-gstress', .false., indx)
6908 call this%obs%StoreObsType(
'delay-estress', .false., indx)
6913 call this%obs%StoreObsType(
'delay-compaction', .false., indx)
6918 call this%obs%StoreObsType(
'delay-thickness', .false., indx)
6923 call this%obs%StoreObsType(
'delay-theta', .false., indx)
6928 call this%obs%StoreObsType(
'delay-flowtop', .true., indx)
6933 call this%obs%StoreObsType(
'delay-flowbot', .true., indx)
6950 integer(I4B) :: idelay
6951 integer(I4B) :: ncol
6952 integer(I4B) :: node
6958 if (this%obs%npakobs > 0)
then
6959 call this%obs%obs_bd_clear()
6960 do i = 1, this%obs%npakobs
6961 obsrv => this%obs%pakobs(i)%obsrv
6962 if (obsrv%BndFound)
then
6963 if (obsrv%ObsTypeId ==
'SKE' .or. &
6964 obsrv%ObsTypeId ==
'SK' .or. &
6965 obsrv%ObsTypeId ==
'SKE-CELL' .or. &
6966 obsrv%ObsTypeId ==
'SK-CELL' .or. &
6967 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
6968 obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
6969 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
6970 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
6971 obsrv%ObsTypeId ==
'PRECONSTRESS-CELL')
then
6972 if (this%gwfiss /= 0)
then
6973 call this%obs%SaveOneSimval(obsrv,
dnodata)
6976 do j = 1, obsrv%indxbnds_count
6977 n = obsrv%indxbnds(j)
6978 select case (obsrv%ObsTypeId)
6999 case (
'DELAY-HEAD',
'DELAY-PRECONSTRESS', &
7000 'DELAY-GSTRESS',
'DELAY-ESTRESS')
7001 if (n > this%ndelaycells)
then
7002 r = real(n - 1, dp) / real(this%ndelaycells, dp)
7003 idelay = int(floor(r)) + 1
7004 ncol = n - int(floor(r)) * this%ndelaycells
7009 select case (obsrv%ObsTypeId)
7011 v = this%dbh(ncol, idelay)
7012 case (
'DELAY-PRECONSTRESS')
7013 v = this%dbpcs(ncol, idelay)
7014 case (
'DELAY-GSTRESS')
7015 v = this%dbgeo(ncol, idelay)
7016 case (
'DELAY-ESTRESS')
7017 v = this%dbes(ncol, idelay)
7019 case (
'PRECONSTRESS-CELL')
7022 errmsg =
"Unrecognized observation type '"// &
7023 trim(obsrv%ObsTypeId)//
"'."
7026 call this%obs%SaveOneSimval(obsrv, v)
7031 do j = 1, obsrv%indxbnds_count
7032 n = obsrv%indxbnds(j)
7033 select case (obsrv%ObsTypeId)
7035 v = this%storagee(n) + this%storagei(n)
7036 case (
'INELASTIC-CSUB')
7037 v = this%storagei(n)
7038 case (
'ELASTIC-CSUB')
7039 v = this%storagee(n)
7040 case (
'COARSE-CSUB')
7042 case (
'WCOMP-CSUB-CELL')
7043 v = this%cell_wcstor(n)
7050 v = this%storagee(n) + this%storagei(n)
7054 case (
'COARSE-THETA')
7055 v = this%cg_theta(n)
7060 f = this%cg_thick(n) / this%cell_thick(n)
7061 v = f * this%cg_theta(n)
7063 node = this%nodelist(n)
7064 f = this%csub_calc_interbed_thickness(n) / this%cell_thick(node)
7065 v = f * this%theta(n)
7067 case (
'GSTRESS-CELL')
7069 case (
'ESTRESS-CELL')
7071 case (
'INTERBED-COMPACTION')
7073 case (
'INELASTIC-COMPACTION')
7075 case (
'ELASTIC-COMPACTION')
7077 case (
'COARSE-COMPACTION')
7078 v = this%cg_tcomp(n)
7079 case (
'INELASTIC-COMPACTION-CELL')
7085 case (
'ELASTIC-COMPACTION-CELL')
7089 v = this%cg_tcomp(n)
7093 case (
'COMPACTION-CELL')
7097 v = this%cg_tcomp(n)
7102 idelay = this%idelay(n)
7104 if (idelay /= 0)
then
7107 case (
'COARSE-THICKNESS')
7108 v = this%cg_thick(n)
7109 case (
'THICKNESS-CELL')
7110 v = this%cell_thick(n)
7111 case (
'DELAY-COMPACTION',
'DELAY-THICKNESS', &
7113 if (n > this%ndelaycells)
then
7114 r = real(n, dp) / real(this%ndelaycells, dp)
7115 idelay = int(floor(r)) + 1
7116 ncol = mod(n, this%ndelaycells)
7121 select case (obsrv%ObsTypeId)
7122 case (
'DELAY-COMPACTION')
7123 v = this%dbtcomp(ncol, idelay)
7124 case (
'DELAY-THICKNESS')
7125 v = this%dbdz(ncol, idelay)
7126 case (
'DELAY-THETA')
7127 v = this%dbtheta(ncol, idelay)
7129 case (
'DELAY-FLOWTOP')
7130 idelay = this%idelay(n)
7131 v = this%dbflowtop(idelay)
7132 case (
'DELAY-FLOWBOT')
7133 idelay = this%idelay(n)
7134 v = this%dbflowbot(idelay)
7136 errmsg =
"Unrecognized observation type: '"// &
7137 trim(obsrv%ObsTypeId)//
"'."
7140 call this%obs%SaveOneSimval(obsrv, v)
7144 call this%obs%SaveOneSimval(obsrv,
dnodata)
7150 call this%parser%StoreErrorUnit()
7167 character(len=LENBOUNDNAME) :: bname
7172 integer(I4B) :: idelay
7175 if (.not. this%csub_obs_supported())
then
7183 do i = 1, this%obs%npakobs
7184 obsrv => this%obs%pakobs(i)%obsrv
7187 obsrv%BndFound = .false.
7189 bname = obsrv%FeatureName
7190 if (bname /=
'')
then
7195 do j = 1, this%ninterbeds
7196 if (this%boundname(j) == bname)
then
7197 obsrv%BndFound = .true.
7198 obsrv%CurrentTimeStepEndValue =
dzero
7199 call obsrv%AddObsIndex(j)
7204 else if (obsrv%ObsTypeId ==
'GSTRESS-CELL' .or. &
7205 obsrv%ObsTypeId ==
'ESTRESS-CELL' .or. &
7206 obsrv%ObsTypeId ==
'THICKNESS-CELL' .or. &
7207 obsrv%ObsTypeId ==
'COARSE-CSUB' .or. &
7208 obsrv%ObsTypeId ==
'WCOMP-CSUB-CELL' .or. &
7209 obsrv%ObsTypeId ==
'COARSE-COMPACTION' .or. &
7210 obsrv%ObsTypeId ==
'COARSE-THETA' .or. &
7211 obsrv%ObsTypeId ==
'COARSE-THICKNESS')
then
7212 obsrv%BndFound = .true.
7213 obsrv%CurrentTimeStepEndValue =
dzero
7214 call obsrv%AddObsIndex(obsrv%NodeNumber)
7215 else if (obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
7216 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
7217 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
7218 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
7219 obsrv%ObsTypeId ==
'DELAY-COMPACTION' .or. &
7220 obsrv%ObsTypeId ==
'DELAY-THICKNESS' .or. &
7221 obsrv%ObsTypeId ==
'DELAY-THETA')
then
7222 if (this%ninterbeds > 0)
then
7223 n = obsrv%NodeNumber
7224 idelay = this%idelay(n)
7225 if (idelay /= 0)
then
7226 j = (idelay - 1) * this%ndelaycells + 1
7227 n2 = obsrv%NodeNumber2
7228 if (n2 < 1 .or. n2 > this%ndelaycells)
then
7229 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7230 trim(adjustl(obsrv%ObsTypeId)),
'interbed cell must be ', &
7231 'greater than 0 and less than or equal to', this%ndelaycells, &
7232 '(specified value is ', n2,
').'
7235 j = (idelay - 1) * this%ndelaycells + n2
7237 obsrv%BndFound = .true.
7238 call obsrv%AddObsIndex(j)
7243 else if (obsrv%ObsTypeId ==
'CSUB' .or. &
7244 obsrv%ObsTypeId ==
'INELASTIC-CSUB' .or. &
7245 obsrv%ObsTypeId ==
'ELASTIC-CSUB' .or. &
7246 obsrv%ObsTypeId ==
'SK' .or. &
7247 obsrv%ObsTypeId ==
'SKE' .or. &
7248 obsrv%ObsTypeId ==
'THICKNESS' .or. &
7249 obsrv%ObsTypeId ==
'THETA' .or. &
7250 obsrv%ObsTypeId ==
'INTERBED-COMPACTION' .or. &
7251 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION' .or. &
7252 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION')
then
7253 if (this%ninterbeds > 0)
then
7254 j = obsrv%NodeNumber
7255 if (j < 1 .or. j > this%ninterbeds)
then
7256 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7257 trim(adjustl(obsrv%ObsTypeId)),
'interbed cell must be greater', &
7258 'than 0 and less than or equal to', this%ninterbeds, &
7259 '(specified value is ', j,
').'
7262 obsrv%BndFound = .true.
7263 obsrv%CurrentTimeStepEndValue =
dzero
7264 call obsrv%AddObsIndex(j)
7267 else if (obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
7268 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
7269 if (this%ninterbeds > 0)
then
7270 j = obsrv%NodeNumber
7271 if (j < 1 .or. j > this%ninterbeds)
then
7272 write (
errmsg,
'(a,2(1x,a),1x,i0,1x,a,i0,a)') &
7273 trim(adjustl(obsrv%ObsTypeId)), &
7274 'interbed cell must be greater ', &
7275 'than 0 and less than or equal to', this%ninterbeds, &
7276 '(specified value is ', j,
').'
7279 idelay = this%idelay(j)
7280 if (idelay /= 0)
then
7281 obsrv%BndFound = .true.
7282 obsrv%CurrentTimeStepEndValue =
dzero
7283 call obsrv%AddObsIndex(j)
7291 if (obsrv%ObsTypeId ==
'CSUB-CELL' .or. &
7292 obsrv%ObsTypeId ==
'SKE-CELL' .or. &
7293 obsrv%ObsTypeId ==
'SK-CELL' .or. &
7294 obsrv%ObsTypeId ==
'THETA-CELL' .or. &
7295 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION-CELL' .or. &
7296 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION-CELL' .or. &
7297 obsrv%ObsTypeId ==
'COMPACTION-CELL')
then
7298 if (.NOT. obsrv%BndFound)
then
7299 obsrv%BndFound = .true.
7300 obsrv%CurrentTimeStepEndValue =
dzero
7301 call obsrv%AddObsIndex(obsrv%NodeNumber)
7304 jloop:
do j = 1, this%ninterbeds
7305 if (this%nodelist(j) == obsrv%NodeNumber)
then
7306 obsrv%BndFound = .true.
7307 obsrv%CurrentTimeStepEndValue =
dzero
7308 call obsrv%AddObsIndex(j)
7335 integer(I4B),
intent(in) :: inunitobs
7336 integer(I4B),
intent(in) :: iout
7340 integer(I4B) :: icol, istart, istop
7341 character(len=LINELENGTH) :: string
7342 character(len=LENBOUNDNAME) :: bndname
7343 logical(LGP) :: flag_string
7346 string = obsrv%IDstring
7347 flag_string = .true.
7355 if (obsrv%ObsTypeId ==
'CSUB' .or. &
7356 obsrv%ObsTypeId ==
'INELASTIC-CSUB' .or. &
7357 obsrv%ObsTypeId ==
'ELASTIC-CSUB' .or. &
7358 obsrv%ObsTypeId ==
'SK' .or. &
7359 obsrv%ObsTypeId ==
'SKE' .or. &
7360 obsrv%ObsTypeId ==
'THETA' .or. &
7361 obsrv%ObsTypeId ==
'THICKNESS' .or. &
7362 obsrv%ObsTypeId ==
'INTERBED-COMPACTION' .or. &
7363 obsrv%ObsTypeId ==
'INELASTIC-COMPACTION' .or. &
7364 obsrv%ObsTypeId ==
'ELASTIC-COMPACTION' .or. &
7365 obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
7366 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
7367 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
7368 obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
7369 obsrv%ObsTypeId ==
'DELAY-COMPACTION' .or. &
7370 obsrv%ObsTypeId ==
'DELAY-THICKNESS' .or. &
7371 obsrv%ObsTypeId ==
'DELAY-THETA' .or. &
7372 obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
7373 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
7376 nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
7377 iout, string, flag_string)
7380 obsrv%FeatureName = bndname
7382 if (obsrv%ObsTypeId ==
'DELAY-HEAD' .or. &
7383 obsrv%ObsTypeId ==
'DELAY-GSTRESS' .or. &
7384 obsrv%ObsTypeId ==
'DELAY-ESTRESS' .or. &
7385 obsrv%ObsTypeId ==
'DELAY-PRECONSTRESS' .or. &
7386 obsrv%ObsTypeId ==
'DELAY-COMPACTION' .or. &
7387 obsrv%ObsTypeId ==
'DELAY-THICKNESS' .or. &
7388 obsrv%ObsTypeId ==
'DELAY-THETA')
then
7391 obsrv%FeatureName = bndname
7395 obsrv%NodeNumber2 = nn2
7401 obsrv%NodeNumber = nn1
7415 this%listlabel = trim(this%filtyp)//
' NO.'
7416 if (this%dis%ndim == 3)
then
7417 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
7418 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'ROW'
7419 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'COL'
7420 elseif (this%dis%ndim == 2)
then
7421 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'LAYER'
7422 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'CELL2D'
7424 write (this%listlabel,
'(a, a7)') trim(this%listlabel),
'NODE'
7426 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'SIG0'
7427 if (this%inamedbound == 1)
then
7428 write (this%listlabel,
'(a, a16)') trim(this%listlabel),
'BOUNDARY NAME'
This module contains block parser methods.
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
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
subroutine csub_read_packagedata(this)
@ brief Read packagedata for package
real(dp) function csub_calc_delay_flow(this, ib, n, hcell)
Calculate the flow from delay interbed top or bottom.
subroutine csub_cg_wcomp_fc(this, node, tled, area, hcell, hcellold, hcof, rhs)
@ brief Formulate coarse-grained water compressibility coefficients
subroutine csub_calc_sfacts(this, node, bot, znode, theta, es, es0, fact)
Calculate specific storage coefficient factor.
subroutine csub_read_dimensions(this)
@ brief Read dimensions for package
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_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 read_options(this)
@ brief Read options for package
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_allocate_arrays(this)
@ brief Allocate package arrays
subroutine csub_delay_calc_ssksske(this, ib, n, hcell, ssk, sske)
Calculate delay interbed cell storage coefficients.
subroutine csub_adj_matprop(this, comp, thick, theta)
Calculate new material properties.
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.
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 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_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, public csub_cr(csubobj, name_model, istounit, stoPckName, inunit, iout)
@ brief Create a new package object
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_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
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
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_unit(iunit, terminate)
Store the file unit number.
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)
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
type(timeserieslinktype) function, pointer, public gettimeserieslinkfromlist(list, indx)
Get time series link from a list.
subroutine, public read_value_or_time_series_adv(textInput, ii, jj, bndElem, pkgName, auxOrBnd, tsManager, iprpak, varName)
Call this subroutine from advanced packages to define timeseries link for a variable (varName).
subroutine, public tsmanager_cr(this, iout, removeTsLinksOnCompletion, extendTsToEndOfSimulation)
Create the tsmanager.
Derived type for the Budget object.
A generic heterogeneous doubly-linked list.