423 class(FlowModelInterfaceType) :: this
425 integer(I4B) :: user_nodes
426 integer(I4B),
allocatable :: idomain1d(:), idomain2d(:, :), idomain3d(:, :, :)
428 character(len=*),
parameter :: fmtdiserr = &
429 "('Error in ',a,': Models do not have the same discretization. &
430 &GWF model has ', i0, ' user nodes, this model has ', i0, '. &
431 &Ensure discretization packages, including IDOMAIN, are identical.')"
432 character(len=*),
parameter :: fmtidomerr = &
433 "('Error in ',a,': models do not have the same discretization. &
434 &Models have different IDOMAIN arrays. &
435 &Ensure discretization packages, including IDOMAIN, are identical.')"
437 call this%gfr%initialize(this%iugrb)
440 select case (this%gfr%grid_type)
442 select type (dis => this%dis)
444 user_nodes = this%gfr%read_int(
"NCELLS")
445 if (user_nodes /= this%dis%nodesuser)
then
446 write (errmsg, fmtdiserr) &
447 trim(this%text), user_nodes, this%dis%nodesuser
448 call store_error(errmsg, terminate=.true.)
450 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
451 idomain3d = reshape(idomain1d, [ &
452 this%gfr%read_int(
"NCOL"), &
453 this%gfr%read_int(
"NROW"), &
454 this%gfr%read_int(
"NLAY") &
456 if (.not. all(dis%idomain == idomain3d))
then
457 write (errmsg, fmtidomerr) trim(this%text)
458 call store_error(errmsg, terminate=.true.)
462 select type (dis => this%dis)
464 user_nodes = this%gfr%read_int(
"NCELLS")
465 if (user_nodes /= this%dis%nodesuser)
then
466 write (errmsg, fmtdiserr) &
467 trim(this%text), user_nodes, this%dis%nodesuser
468 call store_error(errmsg, terminate=.true.)
470 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
471 idomain2d = reshape(idomain1d, [ &
472 this%gfr%read_int(
"NCPL"), &
473 this%gfr%read_int(
"NLAY") &
475 if (.not. all(dis%idomain == idomain2d))
then
476 write (errmsg, fmtidomerr) trim(this%text)
477 call store_error(errmsg, terminate=.true.)
481 select type (dis => this%dis)
483 user_nodes = this%gfr%read_int(
"NODES")
484 if (user_nodes /= this%dis%nodesuser)
then
485 write (errmsg, fmtdiserr) &
486 trim(this%text), user_nodes, this%dis%nodesuser
487 call store_error(errmsg, terminate=.true.)
489 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
490 if (.not. all(dis%idomain == idomain1d))
then
491 write (errmsg, fmtidomerr) trim(this%text)
492 call store_error(errmsg, terminate=.true.)
496 select type (dis => this%dis)
498 user_nodes = this%gfr%read_int(
"NCELLS")
499 if (user_nodes /= this%dis%nodesuser)
then
500 write (errmsg, fmtdiserr) &
501 trim(this%text), user_nodes, this%dis%nodesuser
502 call store_error(errmsg, terminate=.true.)
504 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
505 idomain2d = reshape(idomain1d, [ &
506 this%gfr%read_int(
"NCOL"), &
507 this%gfr%read_int(
"NROW") &
509 if (.not. all(dis%idomain == idomain2d))
then
510 write (errmsg, fmtidomerr) trim(this%text)
511 call store_error(errmsg, terminate=.true.)
515 select type (dis => this%dis)
517 user_nodes = this%gfr%read_int(
"NODES")
518 if (user_nodes /= this%dis%nodesuser)
then
519 write (errmsg, fmtdiserr) &
520 trim(this%text), user_nodes, this%dis%nodesuser
521 call store_error(errmsg, terminate=.true.)
523 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
524 if (.not. all(dis%idomain == idomain1d))
then
525 write (errmsg, fmtidomerr) trim(this%text)
526 call store_error(errmsg, terminate=.true.)
530 select type (dis => this%dis)
532 user_nodes = this%gfr%read_int(
"NCELLS")
533 if (user_nodes /= this%dis%nodesuser)
then
534 write (errmsg, fmtdiserr) &
535 trim(this%text), user_nodes, this%dis%nodesuser
536 call store_error(errmsg, terminate=.true.)
538 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
539 if (.not. all(dis%idomain == idomain1d))
then
540 write (errmsg, fmtidomerr) trim(this%text)
541 call store_error(errmsg, terminate=.true.)
546 if (
allocated(idomain3d))
deallocate (idomain3d)
547 if (
allocated(idomain2d))
deallocate (idomain2d)
548 if (
allocated(idomain1d))
deallocate (idomain1d)
550 call this%gfr%finalize()
Structured grid discretization.
Structured grid discretization.
Unstructured grid discretization.
Vertex grid discretization.
Vertex grid discretization.