MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
gwf-csub-obs.f90
Go to the documentation of this file.
1!> @brief CSUB package observations
2!<
3submodule(gwfcsubmodule) gwfcsubmoduleobs
4contains
5
6 ! -- Procedures related to observations (type-bound)
7 ! -- documented on the GwfCsubType type-bound procedure in gwf-csub.f90
8 module logical function csub_obs_supported(this)
9 ! -- dummy variables
10 class(GwfCsubType) :: this
11 !
12 ! -- initialize variables
13 csub_obs_supported = .true.
14 end function csub_obs_supported
15
16 ! -- documented on the GwfCsubType type-bound procedure in gwf-csub.f90
17 module subroutine csub_df_obs(this)
18 ! -- dummy variables
19 class(GwfCsubType) :: this
20 ! -- local variables
21 integer(I4B) :: indx
22 !
23 ! -- Store obs type and assign procedure pointer
24 ! for csub observation type.
25 call this%obs%StoreObsType('csub', .true., indx)
26 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
27 !
28 ! -- Store obs type and assign procedure pointer
29 ! for inelastic-csub observation type.
30 call this%obs%StoreObsType('inelastic-csub', .true., indx)
31 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
32 !
33 ! -- Store obs type and assign procedure pointer
34 ! for elastic-csub observation type.
35 call this%obs%StoreObsType('elastic-csub', .true., indx)
36 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
37 !
38 ! -- Store obs type and assign procedure pointer
39 ! for coarse-csub observation type.
40 call this%obs%StoreObsType('coarse-csub', .false., indx)
41 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
42 !
43 ! -- Store obs type and assign procedure pointer
44 ! for csub-cell observation type.
45 call this%obs%StoreObsType('csub-cell', .true., indx)
46 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
47 !
48 ! -- Store obs type and assign procedure pointer
49 ! for watercomp-csub observation type.
50 call this%obs%StoreObsType('wcomp-csub-cell', .false., indx)
51 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
52 !
53 ! -- Store obs type and assign procedure pointer
54 ! for interbed ske observation type.
55 call this%obs%StoreObsType('ske', .true., indx)
56 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
57 !
58 ! -- Store obs type and assign procedure pointer
59 ! for interbed sk observation type.
60 call this%obs%StoreObsType('sk', .true., indx)
61 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
62 !
63 ! -- Store obs type and assign procedure pointer
64 ! for ske-cell observation type.
65 call this%obs%StoreObsType('ske-cell', .true., indx)
66 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
67 !
68 ! -- Store obs type and assign procedure pointer
69 ! for sk-cell observation type.
70 call this%obs%StoreObsType('sk-cell', .true., indx)
71 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
72 !
73 ! -- Store obs type and assign procedure pointer
74 ! for geostatic-stress-cell observation type.
75 call this%obs%StoreObsType('gstress-cell', .false., indx)
76 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
77 !
78 ! -- Store obs type and assign procedure pointer
79 ! for effective-stress-cell observation type.
80 call this%obs%StoreObsType('estress-cell', .false., indx)
81 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
82 !
83 ! -- Store obs type and assign procedure pointer
84 ! for total-compaction observation type.
85 call this%obs%StoreObsType('interbed-compaction', .true., indx)
86 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
87 !
88 ! -- Store obs type and assign procedure pointer
89 ! for inelastic-compaction observation type.
90 call this%obs%StoreObsType('inelastic-compaction', .true., indx)
91 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
92 !
93 ! -- Store obs type and assign procedure pointer
94 ! for inelastic-compaction observation type.
95 call this%obs%StoreObsType('elastic-compaction', .true., indx)
96 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
97 !
98 ! -- Store obs type and assign procedure pointer
99 ! for coarse-compaction observation type.
100 call this%obs%StoreObsType('coarse-compaction', .false., indx)
101 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
102 !
103 ! -- Store obs type and assign procedure pointer
104 ! for inelastic-compaction-cell observation type.
105 call this%obs%StoreObsType('inelastic-compaction-cell', .true., indx)
106 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
107 !
108 ! -- Store obs type and assign procedure pointer
109 ! for elastic-compaction-cell observation type.
110 call this%obs%StoreObsType('elastic-compaction-cell', .true., indx)
111 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
112 !
113 ! -- Store obs type and assign procedure pointer
114 ! for compaction-cell observation type.
115 call this%obs%StoreObsType('compaction-cell', .true., indx)
116 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
117 !
118 ! -- Store obs type and assign procedure pointer
119 ! for interbed thickness observation type.
120 call this%obs%StoreObsType('thickness', .true., indx)
121 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
122 !
123 ! -- Store obs type and assign procedure pointer
124 ! for coarse-thickness observation type.
125 call this%obs%StoreObsType('coarse-thickness', .false., indx)
126 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
127 !
128 ! -- Store obs type and assign procedure pointer
129 ! for thickness-cell observation type.
130 call this%obs%StoreObsType('thickness-cell', .false., indx)
131 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
132 !
133 ! -- Store obs type and assign procedure pointer
134 ! for interbed theta observation type.
135 call this%obs%StoreObsType('theta', .true., indx)
136 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
137 !
138 ! -- Store obs type and assign procedure pointer
139 ! for coarse-theta observation type.
140 call this%obs%StoreObsType('coarse-theta', .false., indx)
141 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
142 !
143 ! -- Store obs type and assign procedure pointer
144 ! for theta-cell observation type.
145 call this%obs%StoreObsType('theta-cell', .true., indx)
146 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
147 !
148 ! -- Store obs type and assign procedure pointer
149 ! for preconstress-cell observation type.
150 call this%obs%StoreObsType('preconstress-cell', .false., indx)
151 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
152 !
153 ! -- Store obs type and assign procedure pointer
154 ! for interbed-compaction-pct observation type.
155 call this%obs%StoreObsType('interbed-compaction-pct', .false., indx)
156 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
157 !
158 ! -- Store obs type and assign procedure pointer
159 ! for delay-preconstress observation type.
160 call this%obs%StoreObsType('delay-preconstress', .false., indx)
161 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
162 !
163 ! -- Store obs type and assign procedure pointer
164 ! for delay-head observation type.
165 call this%obs%StoreObsType('delay-head', .false., indx)
166 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
167 !
168 ! -- Store obs type and assign procedure pointer
169 ! for delay-gstress observation type.
170 call this%obs%StoreObsType('delay-gstress', .false., indx)
171 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
172 !
173 ! -- Store obs type and assign procedure pointer
174 ! for delay-estress observation type.
175 call this%obs%StoreObsType('delay-estress', .false., indx)
176 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
177 !
178 ! -- Store obs type and assign procedure pointer
179 ! for delay-compaction observation type.
180 call this%obs%StoreObsType('delay-compaction', .false., indx)
181 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
182 !
183 ! -- Store obs type and assign procedure pointer
184 ! for delay-thickness observation type.
185 call this%obs%StoreObsType('delay-thickness', .false., indx)
186 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
187 !
188 ! -- Store obs type and assign procedure pointer
189 ! for delay-theta observation type.
190 call this%obs%StoreObsType('delay-theta', .false., indx)
191 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
192 !
193 ! -- Store obs type and assign procedure pointer
194 ! for delay-flowtop observation type.
195 call this%obs%StoreObsType('delay-flowtop', .true., indx)
196 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
197 !
198 ! -- Store obs type and assign procedure pointer
199 ! for delay-flowbot observation type.
200 call this%obs%StoreObsType('delay-flowbot', .true., indx)
201 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
202 end subroutine csub_df_obs
203
204 ! -- documented on the GwfCsubType type-bound procedure in gwf-csub.f90
205 module subroutine csub_bd_obs(this)
206 ! -- dummy variables
207 class(GwfCsubType), intent(inout) :: this
208 ! -- local variables
209 type(ObserveType), pointer :: obsrv => null()
210 integer(I4B) :: i
211 integer(I4B) :: j
212 integer(I4B) :: n
213 integer(I4B) :: idelay
214 integer(I4B) :: ncol
215 integer(I4B) :: node
216 real(DP) :: v
217 real(DP) :: r
218 real(DP) :: f
219 real(DP) :: b0
220 !
221 ! -- Fill simulated values for all csub observations
222 if (this%obs%npakobs > 0) then
223 call this%obs%obs_bd_clear()
224 do i = 1, this%obs%npakobs
225 obsrv => this%obs%pakobs(i)%obsrv
226 if (obsrv%BndFound) then
227 if (obsrv%ObsTypeId == 'SKE' .or. &
228 obsrv%ObsTypeId == 'SK' .or. &
229 obsrv%ObsTypeId == 'SKE-CELL' .or. &
230 obsrv%ObsTypeId == 'SK-CELL' .or. &
231 obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
232 obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
233 obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
234 obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
235 obsrv%ObsTypeId == 'PRECONSTRESS-CELL') then
236 if (this%gwfiss /= 0) then
237 call this%obs%SaveOneSimval(obsrv, dnodata)
238 else
239 v = dzero
240 do j = 1, obsrv%indxbnds_count
241 n = obsrv%indxbnds(j)
242 select case (obsrv%ObsTypeId)
243 case ('SKE')
244 v = this%ske(n)
245 case ('SK')
246 v = this%sk(n)
247 case ('SKE-CELL')
248 !
249 ! -- add the coarse component
250 if (j == 1) then
251 v = this%cg_ske(n)
252 else
253 v = this%ske(n)
254 end if
255 case ('SK-CELL')
256 !
257 ! -- add the coarse component
258 if (j == 1) then
259 v = this%cg_sk(n)
260 else
261 v = this%sk(n)
262 end if
263 case ('DELAY-HEAD', 'DELAY-PRECONSTRESS', &
264 'DELAY-GSTRESS', 'DELAY-ESTRESS')
265 if (n > this%ndelaycells) then
266 r = real(n - 1, dp) / real(this%ndelaycells, dp)
267 idelay = int(floor(r)) + 1
268 ncol = n - int(floor(r)) * this%ndelaycells
269 else
270 idelay = 1
271 ncol = n
272 end if
273 select case (obsrv%ObsTypeId)
274 case ('DELAY-HEAD')
275 v = this%dbh(ncol, idelay)
276 case ('DELAY-PRECONSTRESS')
277 v = this%dbpcs(ncol, idelay)
278 case ('DELAY-GSTRESS')
279 v = this%dbgeo(ncol, idelay)
280 case ('DELAY-ESTRESS')
281 v = this%dbes(ncol, idelay)
282 end select
283 case ('PRECONSTRESS-CELL')
284 v = this%pcs(n)
285 case default
286 errmsg = "Unrecognized observation type '"// &
287 trim(obsrv%ObsTypeId)//"'."
288 call store_error(errmsg)
289 end select
290 call this%obs%SaveOneSimval(obsrv, v)
291 end do
292 end if
293 else
294 v = dzero
295 do j = 1, obsrv%indxbnds_count
296 n = obsrv%indxbnds(j)
297 select case (obsrv%ObsTypeId)
298 case ('CSUB')
299 v = this%storagee(n) + this%storagei(n)
300 case ('INELASTIC-CSUB')
301 v = this%storagei(n)
302 case ('ELASTIC-CSUB')
303 v = this%storagee(n)
304 case ('COARSE-CSUB')
305 v = this%cg_stor(n)
306 case ('WCOMP-CSUB-CELL')
307 v = this%cell_wcstor(n)
308 case ('CSUB-CELL')
309 !
310 ! -- add the coarse component
311 if (j == 1) then
312 v = this%cg_stor(n)
313 else
314 v = this%storagee(n) + this%storagei(n)
315 end if
316 case ('THETA')
317 v = this%theta(n)
318 case ('COARSE-THETA')
319 v = this%cg_theta(n)
320 case ('THETA-CELL')
321 !
322 ! -- add the coarse component
323 if (j == 1) then
324 f = this%cg_thick(n) / this%cell_thick(n)
325 v = f * this%cg_theta(n)
326 else
327 node = this%nodelist(n)
328 f = this%csub_calc_interbed_thickness(n) / this%cell_thick(node)
329 v = f * this%theta(n)
330 end if
331 case ('GSTRESS-CELL')
332 v = this%cg_gs(n)
333 case ('ESTRESS-CELL')
334 v = this%cg_es(n)
335 case ('INTERBED-COMPACTION')
336 v = this%tcomp(n)
337 case ('INTERBED-COMPACTION-PCT')
338 b0 = this%thickini(n)
339 if (this%idelay(n) /= 0) then
340 b0 = b0 * this%rnb(n)
341 end if
342 v = dhundred * this%tcomp(n) / b0
343 case ('INELASTIC-COMPACTION')
344 v = this%tcompi(n)
345 case ('ELASTIC-COMPACTION')
346 v = this%tcompe(n)
347 case ('COARSE-COMPACTION')
348 v = this%cg_tcomp(n)
349 case ('INELASTIC-COMPACTION-CELL')
350 !
351 ! -- no coarse inelastic component
352 if (j > 1) then
353 v = this%tcompi(n)
354 end if
355 case ('ELASTIC-COMPACTION-CELL')
356 !
357 ! -- add the coarse component
358 if (j == 1) then
359 v = this%cg_tcomp(n)
360 else
361 v = this%tcompe(n)
362 end if
363 case ('COMPACTION-CELL')
364 !
365 ! -- add the coarse component
366 if (j == 1) then
367 v = this%cg_tcomp(n)
368 else
369 v = this%tcomp(n)
370 end if
371 case ('THICKNESS')
372 idelay = this%idelay(n)
373 v = this%thick(n)
374 if (idelay /= 0) then
375 v = v * this%rnb(n)
376 end if
377 case ('COARSE-THICKNESS')
378 v = this%cg_thick(n)
379 case ('THICKNESS-CELL')
380 v = this%cell_thick(n)
381 case ('DELAY-COMPACTION', 'DELAY-THICKNESS', &
382 'DELAY-THETA')
383 if (n > this%ndelaycells) then
384 r = real(n, dp) / real(this%ndelaycells, dp)
385 idelay = int(floor(r)) + 1
386 ncol = mod(n, this%ndelaycells)
387 else
388 idelay = 1
389 ncol = n
390 end if
391 select case (obsrv%ObsTypeId)
392 case ('DELAY-COMPACTION')
393 v = this%dbtcomp(ncol, idelay)
394 case ('DELAY-THICKNESS')
395 v = this%dbdz(ncol, idelay)
396 case ('DELAY-THETA')
397 v = this%dbtheta(ncol, idelay)
398 end select
399 case ('DELAY-FLOWTOP')
400 idelay = this%idelay(n)
401 v = this%dbflowtop(idelay)
402 case ('DELAY-FLOWBOT')
403 idelay = this%idelay(n)
404 v = this%dbflowbot(idelay)
405 case default
406 errmsg = "Unrecognized observation type: '"// &
407 trim(obsrv%ObsTypeId)//"'."
408 call store_error(errmsg)
409 end select
410 call this%obs%SaveOneSimval(obsrv, v)
411 end do
412 end if
413 else
414 call this%obs%SaveOneSimval(obsrv, dnodata)
415 end if
416 end do
417 !
418 ! -- write summary of package error messages
419 if (count_errors() > 0) then
420 call store_error_filename(this%input_fname)
421 end if
422 end if
423 end subroutine csub_bd_obs
424
425 ! -- documented on the GwfCsubType type-bound procedure in gwf-csub.f90
426 module subroutine csub_rp_obs(this)
427 ! -- modules
428 use tdismodule, only: kper
429 ! -- dummy variables
430 class(GwfCsubType), intent(inout) :: this
431 ! -- local variables
432 class(ObserveType), pointer :: obsrv => null()
433 character(len=LENBOUNDNAME) :: bname
434 integer(I4B) :: i
435 integer(I4B) :: j
436 integer(I4B) :: n
437 integer(I4B) :: n2
438 integer(I4B) :: idelay
439 !
440 ! -- return if observations are not supported
441 if (.not. this%csub_obs_supported()) then
442 return
443 end if
444 !
445 ! -- process each package observation
446 ! only done the first stress period since boundaries are fixed
447 ! for the simulation
448 if (kper == 1) then
449 do i = 1, this%obs%npakobs
450 obsrv => this%obs%pakobs(i)%obsrv
451 !
452 ! -- initialize BndFound to .false.
453 obsrv%BndFound = .false.
454 !
455 bname = obsrv%FeatureName
456 if (bname /= '') then
457 !
458 ! -- Observation location(s) is(are) based on a boundary name.
459 ! Iterate through all boundaries to identify and store
460 ! corresponding index(indices) in bound array.
461 if (this%inamedbound /= 0) then
462 do j = 1, this%ninterbeds
463 if (this%boundname(j) == bname) then
464 obsrv%BndFound = .true.
465 obsrv%CurrentTimeStepEndValue = dzero
466 call obsrv%AddObsIndex(j)
467 end if
468 end do
469 end if
470 if (.not. obsrv%BndFound) then
471 write (errmsg, '(7a)') &
472 'Boundary "', trim(bname), '" for observation "', &
473 trim(obsrv%Name), '" is invalid in package "', &
474 trim(this%packName), '"'
475 call store_error(errmsg)
476 end if
477 !
478 ! -- one value per cell
479 else if (obsrv%ObsTypeId == 'GSTRESS-CELL' .or. &
480 obsrv%ObsTypeId == 'ESTRESS-CELL' .or. &
481 obsrv%ObsTypeId == 'THICKNESS-CELL' .or. &
482 obsrv%ObsTypeId == 'COARSE-CSUB' .or. &
483 obsrv%ObsTypeId == 'WCOMP-CSUB-CELL' .or. &
484 obsrv%ObsTypeId == 'COARSE-COMPACTION' .or. &
485 obsrv%ObsTypeId == 'COARSE-THETA' .or. &
486 obsrv%ObsTypeId == 'COARSE-THICKNESS') then
487 obsrv%BndFound = .true.
488 obsrv%CurrentTimeStepEndValue = dzero
489 call obsrv%AddObsIndex(obsrv%NodeNumber)
490 else if (obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
491 obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
492 obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
493 obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
494 obsrv%ObsTypeId == 'DELAY-COMPACTION' .or. &
495 obsrv%ObsTypeId == 'DELAY-THICKNESS' .or. &
496 obsrv%ObsTypeId == 'DELAY-THETA') then
497 if (this%ninterbeds > 0) then
498 n = obsrv%NodeNumber
499 idelay = this%idelay(n)
500 if (idelay /= 0) then
501 j = (idelay - 1) * this%ndelaycells + 1
502 n2 = obsrv%NodeNumber2
503 if (n2 < 1 .or. n2 > this%ndelaycells) then
504 write (errmsg, '(a,2(1x,a),1x,i0,1x,a,i0,a)') &
505 trim(adjustl(obsrv%ObsTypeId)), 'interbed cell must be ', &
506 'greater than 0 and less than or equal to', this%ndelaycells, &
507 '(specified value is ', n2, ').'
508 call store_error(errmsg)
509 else
510 j = (idelay - 1) * this%ndelaycells + n2
511 end if
512 obsrv%BndFound = .true.
513 call obsrv%AddObsIndex(j)
514 end if
515 end if
516 !
517 ! -- interbed value
518 else if (obsrv%ObsTypeId == 'CSUB' .or. &
519 obsrv%ObsTypeId == 'INELASTIC-CSUB' .or. &
520 obsrv%ObsTypeId == 'ELASTIC-CSUB' .or. &
521 obsrv%ObsTypeId == 'SK' .or. &
522 obsrv%ObsTypeId == 'SKE' .or. &
523 obsrv%ObsTypeId == 'THICKNESS' .or. &
524 obsrv%ObsTypeId == 'THETA' .or. &
525 obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
526 obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
527 obsrv%ObsTypeId == 'ELASTIC-COMPACTION' .or. &
528 obsrv%ObsTypeId == 'INTERBED-COMPACTION-PCT') then
529 if (this%ninterbeds > 0) then
530 j = obsrv%NodeNumber
531 if (j < 1 .or. j > this%ninterbeds) then
532 write (errmsg, '(a,2(1x,a),1x,i0,1x,a,i0,a)') &
533 trim(adjustl(obsrv%ObsTypeId)), 'interbed cell must be greater', &
534 'than 0 and less than or equal to', this%ninterbeds, &
535 '(specified value is ', j, ').'
536 call store_error(errmsg)
537 else
538 obsrv%BndFound = .true.
539 obsrv%CurrentTimeStepEndValue = dzero
540 call obsrv%AddObsIndex(j)
541 end if
542 end if
543 else if (obsrv%ObsTypeId == 'DELAY-FLOWTOP' .or. &
544 obsrv%ObsTypeId == 'DELAY-FLOWBOT') then
545 if (this%ninterbeds > 0) then
546 j = obsrv%NodeNumber
547 if (j < 1 .or. j > this%ninterbeds) then
548 write (errmsg, '(a,2(1x,a),1x,i0,1x,a,i0,a)') &
549 trim(adjustl(obsrv%ObsTypeId)), &
550 'interbed cell must be greater ', &
551 'than 0 and less than or equal to', this%ninterbeds, &
552 '(specified value is ', j, ').'
553 call store_error(errmsg)
554 end if
555 idelay = this%idelay(j)
556 if (idelay /= 0) then
557 obsrv%BndFound = .true.
558 obsrv%CurrentTimeStepEndValue = dzero
559 call obsrv%AddObsIndex(j)
560 end if
561 end if
562 else
563 !
564 ! -- Accumulate values in a single cell
565 ! -- Observation location is a single node number
566 ! -- save node number in first position
567 if (obsrv%ObsTypeId == 'CSUB-CELL' .or. &
568 obsrv%ObsTypeId == 'SKE-CELL' .or. &
569 obsrv%ObsTypeId == 'SK-CELL' .or. &
570 obsrv%ObsTypeId == 'THETA-CELL' .or. &
571 obsrv%ObsTypeId == 'INELASTIC-COMPACTION-CELL' .or. &
572 obsrv%ObsTypeId == 'ELASTIC-COMPACTION-CELL' .or. &
573 obsrv%ObsTypeId == 'COMPACTION-CELL') then
574 if (.NOT. obsrv%BndFound) then
575 obsrv%BndFound = .true.
576 obsrv%CurrentTimeStepEndValue = dzero
577 call obsrv%AddObsIndex(obsrv%NodeNumber)
578 end if
579 end if
580 jloop: do j = 1, this%ninterbeds
581 if (this%nodelist(j) == obsrv%NodeNumber) then
582 obsrv%BndFound = .true.
583 obsrv%CurrentTimeStepEndValue = dzero
584 call obsrv%AddObsIndex(j)
585 end if
586 end do jloop
587 end if
588 end do
589 !
590 ! -- evaluate if there are any observation errors
591 if (count_errors() > 0) then
592 call store_error_filename(this%input_fname)
593 end if
594 end if
595 end subroutine csub_rp_obs
596
597 ! -- Procedures related to observations (NOT type-bound)
598 !> @brief Process the observation IDs for the package
599 !!
600 !! Method to process the observation IDs for the CSUB package. This
601 !! procedure is pointed to by ObsDataType%ProcesssIdPtr. It processes the
602 !! ID string of an observation definition for csub-package observations.
603 !!
604 !<
605 module subroutine csub_process_obsid(obsrv, dis, inunitobs, iout)
606 ! -- dummy variables
607 type(ObserveType), intent(inout) :: obsrv !< observation type
608 class(DisBaseType), intent(in) :: dis !< pointer to the model discretization
609 integer(I4B), intent(in) :: inunitobs !< unit number of the observation file
610 integer(I4B), intent(in) :: iout !< unit number to the model listing file
611 ! -- local variables
612 integer(I4B) :: nn1
613 integer(I4B) :: nn2
614 integer(I4B) :: icol, istart, istop
615 character(len=LINELENGTH) :: string
616 character(len=LENBOUNDNAME) :: bndname
617 logical(LGP) :: flag_string
618 logical(LGP) :: flag_idcellno
619 logical(LGP) :: flag_error
620 !
621 ! -- initialize variables
622 string = obsrv%IDstring
623 flag_string = .true.
624 flag_idcellno = .false.
625 flag_error = .false.
626 if (obsrv%ObsTypeId(1:5) == "DELAY" .AND. &
627 obsrv%ObsTypeId(1:10) /= "DELAY-FLOW") then
628 flag_idcellno = .true.
629 end if
630 !
631 ! -- Extract reach number from string and store it.
632 ! If 1st item is not an integer(I4B), it should be a
633 ! boundary name--deal with it.
634 icol = 1
635 !
636 ! -- get icsubno number or boundary name
637 if (obsrv%ObsTypeId == 'CSUB' .or. &
638 obsrv%ObsTypeId == 'INELASTIC-CSUB' .or. &
639 obsrv%ObsTypeId == 'ELASTIC-CSUB' .or. &
640 obsrv%ObsTypeId == 'SK' .or. &
641 obsrv%ObsTypeId == 'SKE' .or. &
642 obsrv%ObsTypeId == 'THETA' .or. &
643 obsrv%ObsTypeId == 'THICKNESS' .or. &
644 obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
645 obsrv%ObsTypeId == 'INTERBED-COMPACTION-PCT' .or. &
646 obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
647 obsrv%ObsTypeId == 'ELASTIC-COMPACTION' .or. &
648 obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
649 obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
650 obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
651 obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
652 obsrv%ObsTypeId == 'DELAY-COMPACTION' .or. &
653 obsrv%ObsTypeId == 'DELAY-THICKNESS' .or. &
654 obsrv%ObsTypeId == 'DELAY-THETA' .or. &
655 obsrv%ObsTypeId == 'DELAY-FLOWTOP' .or. &
656 obsrv%ObsTypeId == 'DELAY-FLOWBOT') then
657 call extract_idnum_or_bndname(string, icol, istart, istop, nn1, bndname)
658 ! read cellid
659 else
660 nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
661 iout, string, flag_string)
662 end if
663 ! boundnames are not allowed for these observation types
664 if (obsrv%ObsTypeId == 'SK' .or. &
665 obsrv%ObsTypeId == 'SKE' .or. &
666 obsrv%ObsTypeId == 'THETA' .or. &
667 obsrv%ObsTypeId == 'THICKNESS' .or. &
668 obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
669 obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
670 obsrv%ObsTypeId == 'ELASTIC-COMPACTION' .or. &
671 obsrv%ObsTypeId == 'DELAY-HEAD' .or. &
672 obsrv%ObsTypeId == 'DELAY-GSTRESS' .or. &
673 obsrv%ObsTypeId == 'DELAY-ESTRESS' .or. &
674 obsrv%ObsTypeId == 'DELAY-PRECONSTRESS' .or. &
675 obsrv%ObsTypeId == 'DELAY-COMPACTION' .or. &
676 obsrv%ObsTypeId == 'DELAY-THICKNESS' .or. &
677 obsrv%ObsTypeId == 'DELAY-THETA') then
678 if (nn1 == namedboundflag) then
679 write (errmsg, '(5a)') &
680 "BOUNDNAME ('", trim(adjustl(bndname)), &
681 "') not allowed for CSUB observation type '", &
682 trim(adjustl(obsrv%ObsTypeId)), "'."
683 call store_error(errmsg)
684 flag_error = .true.
685 end if
686 ! boundnames are allowed for these observation types
687 else if (obsrv%ObsTypeId == 'CSUB' .or. &
688 obsrv%ObsTypeId == 'INELASTIC-CSUB' .or. &
689 obsrv%ObsTypeId == 'ELASTIC-CSUB' .or. &
690 ! obsrv%ObsTypeId == 'INTERBED-COMPACTION' .or. &
691 ! obsrv%ObsTypeId == 'INELASTIC-COMPACTION' .or. &
692 ! obsrv%ObsTypeId == 'ELASTIC-COMPACTION' .or. &
693 obsrv%ObsTypeId == 'DELAY-FLOWTOP' .or. &
694 obsrv%ObsTypeId == 'DELAY-FLOWBOT') then
695 if (nn1 == namedboundflag) then
696 obsrv%FeatureName = bndname
697 end if
698 end if
699 ! read idcellno for delay observations
700 if (flag_idcellno .EQV. .true. .AND. flag_error .EQV. .false.) then
701 if (nn1 /= namedboundflag) then
702 call extract_idnum_or_bndname(string, icol, istart, istop, nn2, bndname)
703 if (nn2 == namedboundflag) then
704 write (errmsg, '(5a)') &
705 "BOUNDNAME ('", trim(adjustl(bndname)), &
706 "') not allowed for CSUB observation type '", &
707 trim(adjustl(obsrv%ObsTypeId)), "' idcellno."
708 call store_error(errmsg)
709 else
710 obsrv%NodeNumber2 = nn2
711 end if
712 end if
713 end if
714 !
715 ! -- store reach number (NodeNumber)
716 obsrv%NodeNumber = nn1
717 end subroutine csub_process_obsid
718
719end submodule gwfcsubmoduleobs
This module contains the CSUB package methods.
Definition gwf-csub.f90:23
integer(i4b), pointer, public kper
current stress period number
Definition tdis.f90:26