Method to allocate and read static data for the CSUB package.
1109
1113
1114 class(GwfCsubType), intent(inout) :: this
1115 class(DisBaseType), pointer, intent(in) :: dis
1116 integer(I4B), dimension(:), pointer, contiguous :: ibound
1117
1118 character(len=20) :: cellid
1119 integer(I4B) :: idelay
1120 integer(I4B) :: ib
1121 integer(I4B) :: node
1122 integer(I4B) :: n
1123 integer(I4B) :: istoerr
1124 real(DP) :: top
1125 real(DP) :: bot
1126 real(DP) :: thick
1127 real(DP) :: cg_ske_cr
1128 real(DP) :: theta
1129 real(DP) :: v
1130 real(DP) :: vtot
1131 real(DP) :: cell_thickness
1132 real(DP) :: overshoot
1133 real(DP) :: f
1134 real(DP) :: rval
1135
1136 character(len=*), parameter :: fmtcsub = &
1137 "(1x,/1x,'CSUB -- COMPACTION PACKAGE, VERSION 1.15, 7/27/2026', &
1138 &' INPUT READ FROM MEMPATH: ', A, /)"
1139
1140
1141 write (this%iout, fmtcsub) this%input_mempath
1142
1143
1145 this%ibound => ibound
1146
1147
1148 call obs_cr(this%obs, this%inobspkg)
1149
1150
1151 call this%source_options()
1152
1153
1154 call this%source_dimensions()
1155
1156
1157 call this%obs%obs_ar()
1158
1159
1160 if (count_errors() > 0) then
1161 call store_error_filename(this%input_fname)
1162 end if
1163
1164
1165 call this%csub_allocate_arrays()
1166
1167
1168 call this%csub_source_griddata()
1169
1170
1171
1172
1173 istoerr = 0
1174 do node = 1, this%dis%nodes
1175 call this%dis%noder_to_string(node, cellid)
1176 cg_ske_cr = this%cg_ske_cr(node)
1177 theta = this%cg_thetaini(node)
1178
1179
1180 if (cg_ske_cr <
dzero)
then
1181 write (errmsg, '(a,g0,a,1x,a,1x,a,a)') &
1182 'Coarse-grained material CG_SKE_CR (', cg_ske_cr, ') is less', &
1183 'than zero in cell', trim(adjustl(cellid)), '.'
1184 end if
1185
1186
1187 if (this%stoss(node) /=
dzero)
then
1188 istoerr = 1
1189 end if
1190
1191
1192 if (theta >
done .or. theta <
dzero)
then
1193 write (errmsg, '(a,g0,a,1x,a,1x,a,a)') &
1194 'Coarse-grained material THETA (', theta, ') is less', &
1195 'than zero or greater than 1 in cell', trim(adjustl(cellid)), '.'
1196 end if
1197 end do
1198
1199
1200
1201 if (istoerr /= 0) then
1202 write (errmsg, '(a,3(1x,a))') &
1203 'Specific storage values in the storage (STO) package must', &
1204 'be zero in all active cells when using the', &
1205 trim(adjustl(this%packName)), &
1206 'package.'
1207 call store_error(errmsg)
1208 end if
1209
1210
1211 if (this%ninterbeds > 0) then
1212 call this%csub_source_packagedata()
1213 end if
1214
1215
1216 call this%csub_initialize_tables()
1217
1218
1219 do node = 1, this%dis%nodes
1220 top = this%dis%top(node)
1221 bot = this%dis%bot(node)
1222 this%cg_thickini(node) = top - bot
1223 this%cell_thick(node) = top - bot
1224 end do
1225
1226
1227 do ib = 1, this%ninterbeds
1228 node = this%nodelist(ib)
1229 idelay = this%idelay(ib)
1230 if (idelay == 0) then
1231 v = this%thickini(ib)
1232 else
1233 v = this%rnb(ib) * this%thickini(ib)
1234 end if
1235 this%cg_thickini(node) = this%cg_thickini(node) - v
1236 end do
1237
1238
1239
1240
1241
1242
1243 do node = 1, this%dis%nodes
1244 thick = this%cg_thickini(node)
1245 if (thick >=
dzero) cycle
1246 cell_thickness = this%cell_thick(node)
1247 overshoot = -thick
1248 if (overshoot <=
dem5 * cell_thickness)
then
1249
1250
1251
1252 f = cell_thickness / (cell_thickness - thick)
1253 do ib = 1, this%ninterbeds
1254 if (node /= this%nodelist(ib)) cycle
1255 this%thickini(ib) = this%thickini(ib) * f
1256 if (this%iupdatematprop /= 0) then
1257 this%thick(ib) = this%thick(ib) * f
1258 end if
1259 idelay = this%idelay(ib)
1260 if (idelay /= 0) then
1261 rval = this%thickini(ib) / real(this%ndelaycells, dp)
1262 do n = 1, this%ndelaycells
1263 this%dbdzini(n, idelay) = rval
1264 this%dbdz(n, idelay) = rval
1265 this%dbdz0(n, idelay) = rval
1266 end do
1267
1268 call this%csub_delay_init_zcell(ib)
1269 end if
1270 end do
1271 this%cg_thickini(node) =
dzero
1272 else
1273 call this%dis%noder_to_string(node, cellid)
1274 write (errmsg, '(a,g0,a,1x,a,a)') &
1275 'Coarse grained material thickness is less than zero (', &
1276 thick, ') in cell', trim(adjustl(cellid)), '. Interbed thicknesses:'
1277
1279 do ib = 1, this%ninterbeds
1280 if (node /= this%nodelist(ib)) then
1281 cycle
1282 end if
1283 idelay = this%idelay(ib)
1284 v = this%thickini(ib)
1285 if (idelay /= 0) then
1286 v = v * this%rnb(ib)
1287 end if
1288 vtot = vtot + v
1289 write (errmsg, '(a,1x,a,i0,a,g0)') &
1290 trim(adjustl(errmsg)), &
1291 'icbno(', ib, ')=', v
1292 end do
1293 write (errmsg, '(a,a,g0,a)') &
1294 trim(adjustl(errmsg)), &
1295 '. Total interbed thickness=', vtot, '.'
1296 call store_error(errmsg)
1297 end if
1298 end do
1299
1300
1301 if (count_errors() > 0) then
1302 call store_error_filename(this%input_fname)
1303 end if
1304
1305
1306
1307
1308 if (this%iupdatematprop /= 0) then
1309 do node = 1, this%dis%nodes
1310 this%cg_thick(node) = this%cg_thickini(node)
1311 this%cg_theta(node) = this%cg_thetaini(node)
1312 end do
1313 end if
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ dis
DIS6 discretization.
real(dp), parameter dzero
real constant zero
real(dp), parameter dem5
real constant 1e-5
real(dp), parameter done
real constant 1
This module defines variable data types.