442 class(FlowModelInterfaceType) :: this
444 integer(I4B) :: user_nodes
445 integer(I4B),
allocatable :: idomain1d(:), idomain2d(:, :), idomain3d(:, :, :)
447 character(len=*),
parameter :: fmticterr = &
448 &
"('Error in ',a,': Binary grid file does not contain ICELLTYPE.')"
449 character(len=*),
parameter :: fmtdiserr = &
450 "('Error in ',a,': Models do not have the same discretization. &
451 &GWF model has ', i0, ' user nodes, this model has ', i0, '. &
452 &Ensure discretization packages, including IDOMAIN, are identical.')"
453 character(len=*),
parameter :: fmtidomerr = &
454 "('Error in ',a,': models do not have the same discretization. &
455 &Models have different IDOMAIN arrays. &
456 &Ensure discretization packages, including IDOMAIN, are identical.')"
458 call this%gfr%initialize(this%iugrb)
461 if (.not. this%gfr%has_variable(
"ICELLTYPE"))
then
462 write (errmsg, fmticterr) trim(this%text)
463 call store_error(errmsg, terminate=.true.)
466 call mem_allocate(this%gwfceltyp, this%dis%nodesuser, &
467 'GWFCELTYP', this%memoryPath)
468 call this%gfr%read_int_1d_into(
"ICELLTYPE", this%gwfceltyp)
471 select case (this%gfr%grid_type)
473 select type (dis => this%dis)
475 user_nodes = this%gfr%read_int(
"NCELLS")
476 if (user_nodes /= this%dis%nodesuser)
then
477 write (errmsg, fmtdiserr) &
478 trim(this%text), user_nodes, this%dis%nodesuser
479 call store_error(errmsg, terminate=.true.)
481 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
482 idomain3d = reshape(idomain1d, [ &
483 this%gfr%read_int(
"NCOL"), &
484 this%gfr%read_int(
"NROW"), &
485 this%gfr%read_int(
"NLAY") &
487 if (.not. all(dis%idomain == idomain3d))
then
488 write (errmsg, fmtidomerr) trim(this%text)
489 call store_error(errmsg, terminate=.true.)
493 select type (dis => this%dis)
495 user_nodes = this%gfr%read_int(
"NCELLS")
496 if (user_nodes /= this%dis%nodesuser)
then
497 write (errmsg, fmtdiserr) &
498 trim(this%text), user_nodes, this%dis%nodesuser
499 call store_error(errmsg, terminate=.true.)
501 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
502 idomain2d = reshape(idomain1d, [ &
503 this%gfr%read_int(
"NCPL"), &
504 this%gfr%read_int(
"NLAY") &
506 if (.not. all(dis%idomain == idomain2d))
then
507 write (errmsg, fmtidomerr) trim(this%text)
508 call store_error(errmsg, terminate=.true.)
512 select type (dis => this%dis)
514 user_nodes = this%gfr%read_int(
"NODES")
515 if (user_nodes /= this%dis%nodesuser)
then
516 write (errmsg, fmtdiserr) &
517 trim(this%text), user_nodes, this%dis%nodesuser
518 call store_error(errmsg, terminate=.true.)
520 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
521 if (.not. all(dis%idomain == idomain1d))
then
522 write (errmsg, fmtidomerr) trim(this%text)
523 call store_error(errmsg, terminate=.true.)
527 select type (dis => this%dis)
529 user_nodes = this%gfr%read_int(
"NCELLS")
530 if (user_nodes /= this%dis%nodesuser)
then
531 write (errmsg, fmtdiserr) &
532 trim(this%text), user_nodes, this%dis%nodesuser
533 call store_error(errmsg, terminate=.true.)
535 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
536 idomain2d = reshape(idomain1d, [ &
537 this%gfr%read_int(
"NCOL"), &
538 this%gfr%read_int(
"NROW") &
540 if (.not. all(dis%idomain == idomain2d))
then
541 write (errmsg, fmtidomerr) trim(this%text)
542 call store_error(errmsg, terminate=.true.)
546 select type (dis => this%dis)
548 user_nodes = this%gfr%read_int(
"NODES")
549 if (user_nodes /= this%dis%nodesuser)
then
550 write (errmsg, fmtdiserr) &
551 trim(this%text), user_nodes, this%dis%nodesuser
552 call store_error(errmsg, terminate=.true.)
554 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
555 if (.not. all(dis%idomain == idomain1d))
then
556 write (errmsg, fmtidomerr) trim(this%text)
557 call store_error(errmsg, terminate=.true.)
561 select type (dis => this%dis)
563 user_nodes = this%gfr%read_int(
"NCELLS")
564 if (user_nodes /= this%dis%nodesuser)
then
565 write (errmsg, fmtdiserr) &
566 trim(this%text), user_nodes, this%dis%nodesuser
567 call store_error(errmsg, terminate=.true.)
569 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
570 if (.not. all(dis%idomain == idomain1d))
then
571 write (errmsg, fmtidomerr) trim(this%text)
572 call store_error(errmsg, terminate=.true.)
577 if (
allocated(idomain3d))
deallocate (idomain3d)
578 if (
allocated(idomain2d))
deallocate (idomain2d)
579 if (
allocated(idomain1d))
deallocate (idomain1d)
581 call this%gfr%finalize()
Structured grid discretization.
Structured grid discretization.
Unstructured grid discretization.
Vertex grid discretization.
Vertex grid discretization.