8 module logical
function csub_obs_supported(this)
10 class(GwfCsubType) :: this
13 csub_obs_supported = .true.
14 end function csub_obs_supported
17 module subroutine csub_df_obs(this)
19 class(GwfCsubType) :: this
25 call this%obs%StoreObsType(
'csub', .true., indx)
26 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
30 call this%obs%StoreObsType(
'inelastic-csub', .true., indx)
31 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
35 call this%obs%StoreObsType(
'elastic-csub', .true., indx)
36 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
40 call this%obs%StoreObsType(
'coarse-csub', .false., indx)
41 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
45 call this%obs%StoreObsType(
'csub-cell', .true., indx)
46 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
50 call this%obs%StoreObsType(
'wcomp-csub-cell', .false., indx)
51 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
55 call this%obs%StoreObsType(
'ske', .true., indx)
56 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
60 call this%obs%StoreObsType(
'sk', .true., indx)
61 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
65 call this%obs%StoreObsType(
'ske-cell', .true., indx)
66 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
70 call this%obs%StoreObsType(
'sk-cell', .true., indx)
71 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
75 call this%obs%StoreObsType(
'gstress-cell', .false., indx)
76 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
80 call this%obs%StoreObsType(
'estress-cell', .false., indx)
81 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
85 call this%obs%StoreObsType(
'interbed-compaction', .true., indx)
86 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
90 call this%obs%StoreObsType(
'inelastic-compaction', .true., indx)
91 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
95 call this%obs%StoreObsType(
'elastic-compaction', .true., indx)
96 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
100 call this%obs%StoreObsType(
'coarse-compaction', .false., indx)
101 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
105 call this%obs%StoreObsType(
'inelastic-compaction-cell', .true., indx)
106 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
110 call this%obs%StoreObsType(
'elastic-compaction-cell', .true., indx)
111 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
115 call this%obs%StoreObsType(
'compaction-cell', .true., indx)
116 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
120 call this%obs%StoreObsType(
'thickness', .true., indx)
121 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
125 call this%obs%StoreObsType(
'coarse-thickness', .false., indx)
126 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
130 call this%obs%StoreObsType(
'thickness-cell', .false., indx)
131 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
135 call this%obs%StoreObsType(
'theta', .true., indx)
136 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
140 call this%obs%StoreObsType(
'coarse-theta', .false., indx)
141 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
145 call this%obs%StoreObsType(
'theta-cell', .true., indx)
146 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
150 call this%obs%StoreObsType(
'preconstress-cell', .false., indx)
151 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
155 call this%obs%StoreObsType(
'interbed-compaction-pct', .false., indx)
156 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
160 call this%obs%StoreObsType(
'delay-preconstress', .false., indx)
161 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
165 call this%obs%StoreObsType(
'delay-head', .false., indx)
166 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
170 call this%obs%StoreObsType(
'delay-gstress', .false., indx)
171 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
175 call this%obs%StoreObsType(
'delay-estress', .false., indx)
176 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
180 call this%obs%StoreObsType(
'delay-compaction', .false., indx)
181 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
185 call this%obs%StoreObsType(
'delay-thickness', .false., indx)
186 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
190 call this%obs%StoreObsType(
'delay-theta', .false., indx)
191 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
195 call this%obs%StoreObsType(
'delay-flowtop', .true., indx)
196 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
200 call this%obs%StoreObsType(
'delay-flowbot', .true., indx)
201 this%obs%obsData(indx)%ProcessIdPtr => csub_process_obsid
202 end subroutine csub_df_obs
205 module subroutine csub_bd_obs(this)
207 class(GwfCsubType),
intent(inout) :: this
209 type(ObserveType),
pointer :: obsrv => null()
213 integer(I4B) :: idelay
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)
240 do j = 1, obsrv%indxbnds_count
241 n = obsrv%indxbnds(j)
242 select case (obsrv%ObsTypeId)
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
273 select case (obsrv%ObsTypeId)
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)
283 case (
'PRECONSTRESS-CELL')
286 errmsg =
"Unrecognized observation type '"// &
287 trim(obsrv%ObsTypeId)//
"'."
288 call store_error(errmsg)
290 call this%obs%SaveOneSimval(obsrv, v)
295 do j = 1, obsrv%indxbnds_count
296 n = obsrv%indxbnds(j)
297 select case (obsrv%ObsTypeId)
299 v = this%storagee(n) + this%storagei(n)
300 case (
'INELASTIC-CSUB')
302 case (
'ELASTIC-CSUB')
306 case (
'WCOMP-CSUB-CELL')
307 v = this%cell_wcstor(n)
314 v = this%storagee(n) + this%storagei(n)
318 case (
'COARSE-THETA')
324 f = this%cg_thick(n) / this%cell_thick(n)
325 v = f * this%cg_theta(n)
327 node = this%nodelist(n)
328 f = this%csub_calc_interbed_thickness(n) / this%cell_thick(node)
329 v = f * this%theta(n)
331 case (
'GSTRESS-CELL')
333 case (
'ESTRESS-CELL')
335 case (
'INTERBED-COMPACTION')
337 case (
'INTERBED-COMPACTION-PCT')
338 b0 = this%thickini(n)
339 if (this%idelay(n) /= 0)
then
340 b0 = b0 * this%rnb(n)
342 v = dhundred * this%tcomp(n) / b0
343 case (
'INELASTIC-COMPACTION')
345 case (
'ELASTIC-COMPACTION')
347 case (
'COARSE-COMPACTION')
349 case (
'INELASTIC-COMPACTION-CELL')
355 case (
'ELASTIC-COMPACTION-CELL')
363 case (
'COMPACTION-CELL')
372 idelay = this%idelay(n)
374 if (idelay /= 0)
then
377 case (
'COARSE-THICKNESS')
379 case (
'THICKNESS-CELL')
380 v = this%cell_thick(n)
381 case (
'DELAY-COMPACTION',
'DELAY-THICKNESS', &
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)
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)
397 v = this%dbtheta(ncol, idelay)
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)
406 errmsg =
"Unrecognized observation type: '"// &
407 trim(obsrv%ObsTypeId)//
"'."
408 call store_error(errmsg)
410 call this%obs%SaveOneSimval(obsrv, v)
414 call this%obs%SaveOneSimval(obsrv, dnodata)
419 if (count_errors() > 0)
then
420 call store_error_filename(this%input_fname)
423 end subroutine csub_bd_obs
426 module subroutine csub_rp_obs(this)
430 class(GwfCsubType),
intent(inout) :: this
432 class(ObserveType),
pointer :: obsrv => null()
433 character(len=LENBOUNDNAME) :: bname
438 integer(I4B) :: idelay
441 if (.not. this%csub_obs_supported())
then
449 do i = 1, this%obs%npakobs
450 obsrv => this%obs%pakobs(i)%obsrv
453 obsrv%BndFound = .false.
455 bname = obsrv%FeatureName
456 if (bname /=
'')
then
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)
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)
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
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)
510 j = (idelay - 1) * this%ndelaycells + n2
512 obsrv%BndFound = .true.
513 call obsrv%AddObsIndex(j)
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
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)
538 obsrv%BndFound = .true.
539 obsrv%CurrentTimeStepEndValue = dzero
540 call obsrv%AddObsIndex(j)
543 else if (obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
544 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
545 if (this%ninterbeds > 0)
then
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)
555 idelay = this%idelay(j)
556 if (idelay /= 0)
then
557 obsrv%BndFound = .true.
558 obsrv%CurrentTimeStepEndValue = dzero
559 call obsrv%AddObsIndex(j)
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)
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)
591 if (count_errors() > 0)
then
592 call store_error_filename(this%input_fname)
595 end subroutine csub_rp_obs
605 module subroutine csub_process_obsid(obsrv, dis, inunitobs, iout)
607 type(ObserveType),
intent(inout) :: obsrv
608 class(DisBaseType),
intent(in) :: dis
609 integer(I4B),
intent(in) :: inunitobs
610 integer(I4B),
intent(in) :: iout
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
622 string = obsrv%IDstring
624 flag_idcellno = .false.
626 if (obsrv%ObsTypeId(1:5) ==
"DELAY" .AND. &
627 obsrv%ObsTypeId(1:10) /=
"DELAY-FLOW")
then
628 flag_idcellno = .true.
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)
660 nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
661 iout, string, flag_string)
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)
687 else if (obsrv%ObsTypeId ==
'CSUB' .or. &
688 obsrv%ObsTypeId ==
'INELASTIC-CSUB' .or. &
689 obsrv%ObsTypeId ==
'ELASTIC-CSUB' .or. &
693 obsrv%ObsTypeId ==
'DELAY-FLOWTOP' .or. &
694 obsrv%ObsTypeId ==
'DELAY-FLOWBOT')
then
695 if (nn1 == namedboundflag)
then
696 obsrv%FeatureName = bndname
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)
710 obsrv%NodeNumber2 = nn2
716 obsrv%NodeNumber = nn1
717 end subroutine csub_process_obsid
719end submodule gwfcsubmoduleobs
This module contains the CSUB package methods.
integer(i4b), pointer, public kper
current stress period number