453 class(FlowModelInterfaceType) :: this
455 integer(I4B) :: user_nodes
456 integer(I4B),
allocatable :: idomain1d(:), idomain2d(:, :), idomain3d(:, :, :)
458 character(len=*),
parameter :: fmtdiserr = &
459 "('Error in ',a,': Models do not have the same discretization. &
460 &GWF model has ', i0, ' user nodes, this model has ', i0, '. &
461 &Ensure discretization packages, including IDOMAIN, are identical.')"
462 character(len=*),
parameter :: fmtidomerr = &
463 "('Error in ',a,': models do not have the same discretization. &
464 &Models have different IDOMAIN arrays. &
465 &Ensure discretization packages, including IDOMAIN, are identical.')"
467 call this%gfr%initialize(this%iugrb)
470 if (this%gfr%has_variable(
"ICELLTYPE"))
then
472 call mem_allocate(this%gwfceltyp, this%dis%nodesuser, &
473 'GWFCELTYP', this%memoryPath)
474 call this%gfr%read_int_1d_into(
"ICELLTYPE", this%gwfceltyp)
478 select case (this%gfr%grid_type)
480 select type (dis => this%dis)
482 user_nodes = this%gfr%read_int(
"NCELLS")
483 if (user_nodes /= this%dis%nodesuser)
then
484 write (errmsg, fmtdiserr) &
485 trim(this%text), user_nodes, this%dis%nodesuser
486 call store_error(errmsg, terminate=.true.)
488 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
489 idomain3d = reshape(idomain1d, [ &
490 this%gfr%read_int(
"NCOL"), &
491 this%gfr%read_int(
"NROW"), &
492 this%gfr%read_int(
"NLAY") &
494 if (.not. all(dis%idomain == idomain3d))
then
495 write (errmsg, fmtidomerr) trim(this%text)
496 call store_error(errmsg, terminate=.true.)
500 select type (dis => this%dis)
502 user_nodes = this%gfr%read_int(
"NCELLS")
503 if (user_nodes /= this%dis%nodesuser)
then
504 write (errmsg, fmtdiserr) &
505 trim(this%text), user_nodes, this%dis%nodesuser
506 call store_error(errmsg, terminate=.true.)
508 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
509 idomain2d = reshape(idomain1d, [ &
510 this%gfr%read_int(
"NCPL"), &
511 this%gfr%read_int(
"NLAY") &
513 if (.not. all(dis%idomain == idomain2d))
then
514 write (errmsg, fmtidomerr) trim(this%text)
515 call store_error(errmsg, terminate=.true.)
519 select type (dis => this%dis)
521 user_nodes = this%gfr%read_int(
"NODES")
522 if (user_nodes /= this%dis%nodesuser)
then
523 write (errmsg, fmtdiserr) &
524 trim(this%text), user_nodes, this%dis%nodesuser
525 call store_error(errmsg, terminate=.true.)
527 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
528 if (.not. all(dis%idomain == idomain1d))
then
529 write (errmsg, fmtidomerr) trim(this%text)
530 call store_error(errmsg, terminate=.true.)
534 select type (dis => this%dis)
536 user_nodes = this%gfr%read_int(
"NCELLS")
537 if (user_nodes /= this%dis%nodesuser)
then
538 write (errmsg, fmtdiserr) &
539 trim(this%text), user_nodes, this%dis%nodesuser
540 call store_error(errmsg, terminate=.true.)
542 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
543 idomain2d = reshape(idomain1d, [ &
544 this%gfr%read_int(
"NCOL"), &
545 this%gfr%read_int(
"NROW") &
547 if (.not. all(dis%idomain == idomain2d))
then
548 write (errmsg, fmtidomerr) trim(this%text)
549 call store_error(errmsg, terminate=.true.)
553 select type (dis => this%dis)
555 user_nodes = this%gfr%read_int(
"NODES")
556 if (user_nodes /= this%dis%nodesuser)
then
557 write (errmsg, fmtdiserr) &
558 trim(this%text), user_nodes, this%dis%nodesuser
559 call store_error(errmsg, terminate=.true.)
561 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
562 if (.not. all(dis%idomain == idomain1d))
then
563 write (errmsg, fmtidomerr) trim(this%text)
564 call store_error(errmsg, terminate=.true.)
568 select type (dis => this%dis)
570 user_nodes = this%gfr%read_int(
"NCELLS")
571 if (user_nodes /= this%dis%nodesuser)
then
572 write (errmsg, fmtdiserr) &
573 trim(this%text), user_nodes, this%dis%nodesuser
574 call store_error(errmsg, terminate=.true.)
576 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
577 if (.not. all(dis%idomain == idomain1d))
then
578 write (errmsg, fmtidomerr) trim(this%text)
579 call store_error(errmsg, terminate=.true.)
584 if (
allocated(idomain3d))
deallocate (idomain3d)
585 if (
allocated(idomain2d))
deallocate (idomain2d)
586 if (
allocated(idomain1d))
deallocate (idomain1d)
588 call this%gfr%finalize()
Structured grid discretization.
Structured grid discretization.
Unstructured grid discretization.
Vertex grid discretization.
Vertex grid discretization.