7 module subroutine csub_allocate_scalars(this)
11 class(GwfCsubType),
intent(inout) :: this
14 call this%NumericalPackageType%allocate_scalars()
17 call mem_allocate(this%listlabel, lenlistlabel,
'LISTLABEL', this%memoryPath)
18 call mem_allocate(this%stoMemPath, lenmempath,
'STONAME', this%memoryPath)
21 call mem_allocate(this%istounit,
'ISTOUNIT', this%memoryPath)
22 call mem_allocate(this%inobspkg,
'INOBSPKG', this%memoryPath)
23 call mem_allocate(this%ninterbeds,
'NINTERBEDS', this%memoryPath)
24 call mem_allocate(this%maxsig0,
'MAXSIG0', this%memoryPath)
25 call mem_allocate(this%nbound,
'NBOUND', this%memoryPath)
26 call mem_allocate(this%iscloc,
'ISCLOC', this%memoryPath)
27 call mem_allocate(this%iauxmultcol,
'IAUXMULTCOL', this%memoryPath)
28 call mem_allocate(this%ndelaycells,
'NDELAYCELLS', this%memoryPath)
29 call mem_allocate(this%ndelaybeds,
'NDELAYBEDS', this%memoryPath)
30 call mem_allocate(this%initialized,
'INITIALIZED', this%memoryPath)
31 call mem_allocate(this%ieslag,
'IESLAG', this%memoryPath)
33 call mem_allocate(this%istrict_stress,
'ISTRICT_STRESS', this%memoryPath)
34 call mem_allocate(this%nreg_ts,
'NREG_TS', this%memoryPath)
35 call mem_allocate(this%lhead_based,
'LHEAD_BASED', this%memoryPath)
36 call mem_allocate(this%iupdatestress,
'IUPDATESTRESS', this%memoryPath)
37 call mem_allocate(this%ispecified_pcs,
'ISPECIFIED_PCS', this%memoryPath)
38 call mem_allocate(this%ispecified_dbh,
'ISPECIFIED_DBH', this%memoryPath)
39 call mem_allocate(this%inamedbound,
'INAMEDBOUND', this%memoryPath)
40 call mem_allocate(this%iconvchk,
'ICONVCHK', this%memoryPath)
42 call mem_allocate(this%istoragec,
'ISTORAGEC', this%memoryPath)
43 call mem_allocate(this%istrainib,
'ISTRAINIB', this%memoryPath)
44 call mem_allocate(this%istrainsk,
'ISTRAINSK', this%memoryPath)
45 call mem_allocate(this%ioutcomp,
'IOUTCOMP', this%memoryPath)
46 call mem_allocate(this%ioutcompi,
'IOUTCOMPI', this%memoryPath)
47 call mem_allocate(this%ioutcompe,
'IOUTCOMPE', this%memoryPath)
48 call mem_allocate(this%ioutcompib,
'IOUTCOMPIB', this%memoryPath)
49 call mem_allocate(this%ioutcomps,
'IOUTCOMPS', this%memoryPath)
50 call mem_allocate(this%ioutzdisp,
'IOUTZDISP', this%memoryPath)
51 call mem_allocate(this%ipakcsv,
'IPAKCSV', this%memoryPath)
52 call mem_allocate(this%iupdatematprop,
'IUPDATEMATPROP', this%memoryPath)
53 call mem_allocate(this%epsilon,
'EPSILON', this%memoryPath)
54 call mem_allocate(this%cc_crit,
'CC_CRIT', this%memoryPath)
55 call mem_allocate(this%gammaw,
'GAMMAW', this%memoryPath)
58 call mem_allocate(this%satomega,
'SATOMEGA', this%memoryPath)
59 call mem_allocate(this%pcsomega,
'PCSOMEGA', this%memoryPath)
60 call mem_allocate(this%icellf,
'ICELLF', this%memoryPath)
61 call mem_allocate(this%gwfiss0,
'GWFISS0', this%memoryPath)
64 call mem_allocate(this%auxname, lenauxname, 0,
'AUXNAME', this%memoryPath)
79 this%istrict_stress = 0
81 this%lhead_based = .false.
82 this%iupdatestress = 1
83 this%ispecified_pcs = 0
84 this%ispecified_dbh = 0
98 this%iupdatematprop = 0
101 this%gammaw = dgravity * 1000._dp
102 this%beta = 4.6512e-10_dp
103 this%brg = this%gammaw * this%beta
105 this%pcsomega = dzero
108 if (this%inewton /= 0)
then
110 this%epsilon = dhalf * dem6
112 this%satomega = dzero
117 end subroutine csub_allocate_scalars
120 module subroutine csub_allocate_arrays(this)
124 class(GwfCsubType),
intent(inout) :: this
128 integer(I4B) :: iblen
132 if (this%ioutcomp == 0 .and. this%ioutcompi == 0 .and. &
133 this%ioutcompe == 0 .and. this%ioutcompib == 0 .and. &
134 this%ioutcomps == 0 .and. this%ioutzdisp == 0)
then
135 call mem_allocate(this%buff, 1,
'BUFF', trim(this%memoryPath))
137 call mem_allocate(this%buff, this%dis%nodes,
'BUFF', trim(this%memoryPath))
139 if (this%ioutcomp == 0 .and. this%ioutzdisp == 0)
then
140 call mem_allocate(this%buffusr, 1,
'BUFFUSR', trim(this%memoryPath))
142 call mem_allocate(this%buffusr, this%dis%nodesuser,
'BUFFUSR', &
143 trim(this%memoryPath))
145 call mem_allocate(this%sgm, this%dis%nodes,
'SGM', trim(this%memoryPath))
146 call mem_allocate(this%sgs, this%dis%nodes,
'SGS', trim(this%memoryPath))
147 call mem_allocate(this%cg_ske_cr, this%dis%nodes,
'CG_SKE_CR', &
148 trim(this%memoryPath))
149 call mem_allocate(this%cg_es, this%dis%nodes,
'CG_ES', &
150 trim(this%memoryPath))
151 call mem_allocate(this%cg_es0, this%dis%nodes,
'CG_ES0', &
152 trim(this%memoryPath))
153 call mem_allocate(this%cg_pcs, this%dis%nodes,
'CG_PCS', &
154 trim(this%memoryPath))
155 call mem_allocate(this%cg_comp, this%dis%nodes,
'CG_COMP', &
156 trim(this%memoryPath))
157 call mem_allocate(this%cg_tcomp, this%dis%nodes,
'CG_TCOMP', &
158 trim(this%memoryPath))
159 call mem_allocate(this%cg_stor, this%dis%nodes,
'CG_STOR', &
160 trim(this%memoryPath))
161 call mem_allocate(this%cg_ske, this%dis%nodes,
'CG_SKE', &
162 trim(this%memoryPath))
163 call mem_allocate(this%cg_sk, this%dis%nodes,
'CG_SK', &
164 trim(this%memoryPath))
165 call mem_allocate(this%cg_thickini, this%dis%nodes,
'CG_THICKINI', &
166 trim(this%memoryPath))
167 call mem_allocate(this%cg_thetaini, this%dis%nodes,
'CG_THETAINI', &
168 trim(this%memoryPath))
169 if (this%iupdatematprop == 0)
then
170 call mem_setptr(this%cg_thick,
'CG_THICKINI', trim(this%memoryPath))
171 call mem_setptr(this%cg_thick0,
'CG_THICKINI', trim(this%memoryPath))
172 call mem_setptr(this%cg_theta,
'CG_THETAINI', trim(this%memoryPath))
173 call mem_setptr(this%cg_theta0,
'CG_THETAINI', trim(this%memoryPath))
175 call mem_allocate(this%cg_thick, this%dis%nodes,
'CG_THICK', &
176 trim(this%memoryPath))
177 call mem_allocate(this%cg_thick0, this%dis%nodes,
'CG_THICK0', &
178 trim(this%memoryPath))
179 call mem_allocate(this%cg_theta, this%dis%nodes,
'CG_THETA', &
180 trim(this%memoryPath))
181 call mem_allocate(this%cg_theta0, this%dis%nodes,
'CG_THETA0', &
182 trim(this%memoryPath))
186 call mem_allocate(this%cell_wcstor, this%dis%nodes,
'CELL_WCSTOR', &
187 trim(this%memoryPath))
188 call mem_allocate(this%cell_thick, this%dis%nodes,
'CELL_THICK', &
189 trim(this%memoryPath))
193 if (this%ninterbeds > 0)
then
194 iblen = this%ninterbeds
197 if (this%naux > 0)
then
200 call mem_allocate(this%auxvar, naux, iblen,
'AUXVAR', this%memoryPath)
203 this%auxvar(j, n) = dzero
206 call mem_allocate(this%unodelist, iblen,
'UNODELIST', trim(this%memoryPath))
207 call mem_allocate(this%nodelist, iblen,
'NODELIST', trim(this%memoryPath))
208 call mem_allocate(this%cg_gs, this%dis%nodes,
'CG_GS', trim(this%memoryPath))
209 call mem_allocate(this%pcs, iblen,
'PCS', trim(this%memoryPath))
210 call mem_allocate(this%rnb, iblen,
'RNB', trim(this%memoryPath))
211 call mem_allocate(this%kv, iblen,
'KV', trim(this%memoryPath))
212 call mem_allocate(this%h0, iblen,
'H0', trim(this%memoryPath))
213 call mem_allocate(this%ci, iblen,
'CI', trim(this%memoryPath))
214 call mem_allocate(this%rci, iblen,
'RCI', trim(this%memoryPath))
215 call mem_allocate(this%idelay, iblen,
'IDELAY', trim(this%memoryPath))
216 call mem_allocate(this%ielastic, iblen,
'IELASTIC', trim(this%memoryPath))
217 call mem_allocate(this%iconvert, iblen,
'ICONVERT', trim(this%memoryPath))
218 call mem_allocate(this%comp, iblen,
'COMP', trim(this%memoryPath))
219 call mem_allocate(this%tcomp, iblen,
'TCOMP', trim(this%memoryPath))
220 call mem_allocate(this%tcompi, iblen,
'TCOMPI', trim(this%memoryPath))
221 call mem_allocate(this%tcompe, iblen,
'TCOMPE', trim(this%memoryPath))
222 call mem_allocate(this%storagee, iblen,
'STORAGEE', trim(this%memoryPath))
223 call mem_allocate(this%storagei, iblen,
'STORAGEI', trim(this%memoryPath))
224 call mem_allocate(this%ske, iblen,
'SKE', trim(this%memoryPath))
225 call mem_allocate(this%sk, iblen,
'SK', trim(this%memoryPath))
226 call mem_allocate(this%thickini, iblen,
'THICKINI', trim(this%memoryPath))
227 call mem_allocate(this%thetaini, iblen,
'THETAINI', trim(this%memoryPath))
228 if (this%iupdatematprop == 0)
then
229 call mem_setptr(this%thick,
'THICKINI', trim(this%memoryPath))
230 call mem_setptr(this%thick0,
'THICKINI', trim(this%memoryPath))
231 call mem_setptr(this%theta,
'THETAINI', trim(this%memoryPath))
232 call mem_setptr(this%theta0,
'THETAINI', trim(this%memoryPath))
234 call mem_allocate(this%thick, iblen,
'THICK', trim(this%memoryPath))
235 call mem_allocate(this%thick0, iblen,
'THICK0', trim(this%memoryPath))
236 call mem_allocate(this%theta, iblen,
'THETA', trim(this%memoryPath))
237 call mem_allocate(this%theta0, iblen,
'THETA0', trim(this%memoryPath))
244 if (this%inamedbound /= 0)
then
245 call mem_allocate(this%boundname, lenboundname, this%ninterbeds, &
246 'BOUNDNAME', trim(this%memoryPath))
249 'BOUNDNAME', trim(this%memoryPath))
254 call mem_allocate(this%nodelistsig0, this%maxsig0,
'NODELISTSIG0', &
258 call mem_setptr(this%sig0,
'SIG0', this%input_mempath)
259 call mem_checkin(this%sig0,
'SIG0', this%memoryPath, &
260 'SIG0', this%input_mempath)
263 call mem_setptr(this%gwfiss,
'ISS', trim(this%name_model))
266 call mem_setptr(this%stoiconv,
'ICONVERT', this%stoMemPath)
267 call mem_setptr(this%stoss,
'SS', this%stoMemPath)
270 do n = 1, this%dis%nodes
271 this%cg_gs(n) = dzero
272 this%cg_es(n) = dzero
273 this%cg_comp(n) = dzero
274 this%cg_tcomp(n) = dzero
275 this%cell_wcstor(n) = dzero
277 do n = 1, this%ninterbeds
278 this%theta(n) = dzero
279 this%tcomp(n) = dzero
280 this%tcompi(n) = dzero
281 this%tcompe(n) = dzero
283 do n = 1, this%maxsig0
284 this%nodelistsig0(n) = 0
286 end subroutine csub_allocate_arrays
289 module subroutine csub_da(this)
293 class(GwfCsubType) :: this
296 if (this%nreg_ts > 0)
then
297 write (warnmsg,
'(a,1x,i0,1x,3a)') &
298 'CSUB negative effective stress was regularized in', this%nreg_ts, &
299 'time step(s); see the model listing file for the number of cells ', &
300 'regularized in each time step. This typically occurs in uppermost ', &
301 'cells where simulated water levels rise above land surface.'
302 call store_warning(warnmsg)
306 if (this%inunit > 0)
then
328 if (this%iupdatematprop == 0)
then
329 nullify (this%cg_thick)
330 nullify (this%cg_thick0)
331 nullify (this%cg_theta)
332 nullify (this%cg_theta0)
364 if (this%iupdatematprop == 0)
then
366 nullify (this%thick0)
368 nullify (this%theta0)
379 if (this%ndelaybeds > 0)
then
380 if (this%iupdatematprop == 0)
then
383 nullify (this%dbtheta)
384 nullify (this%dbtheta0)
423 nullify (this%gwfiss)
426 nullify (this%stoiconv)
430 if (this%iprpak > 0)
then
431 call this%inputtab%table_da()
432 deallocate (this%inputtab)
433 nullify (this%inputtab)
437 if (
associated(this%outputtab))
then
438 call this%outputtab%table_da()
439 deallocate (this%outputtab)
440 nullify (this%outputtab)
445 if (this%ipakcsv > 0)
then
446 call this%pakcsvtab%table_da()
447 deallocate (this%pakcsvtab)
448 nullify (this%pakcsvtab)
499 if (this%inunit > 0)
then
500 call this%obs%obs_da()
503 deallocate (this%obs)
509 call this%NumericalPackageType%da()
510 end subroutine csub_da
512end submodule gwfcsubmodulememory
This module contains the CSUB package methods.