438 class(FlowModelInterfaceType) :: this
440 integer(I4B) :: user_nodes
441 integer(I4B),
allocatable :: idomain1d(:), idomain2d(:, :), idomain3d(:, :, :)
443 character(len=*),
parameter :: fmticterr = &
444 &
"('Error in ',a,': Binary grid file does not contain ICELLTYPE.')"
445 character(len=*),
parameter :: fmtdiserr = &
446 "('Error in ',a,': Models do not have the same discretization. &
447 &GWF model has ', i0, ' user nodes, this model has ', i0, '. &
448 &Ensure discretization packages, including IDOMAIN, are identical.')"
449 character(len=*),
parameter :: fmtidomerr = &
450 "('Error in ',a,': models do not have the same discretization. &
451 &Models have different IDOMAIN arrays. &
452 &Ensure discretization packages, including IDOMAIN, are identical.')"
454 call this%gfr%initialize(this%iugrb)
457 if (.not. this%gfr%has_variable(
"ICELLTYPE"))
then
458 write (errmsg, fmticterr) trim(this%text)
459 call store_error(errmsg, terminate=.true.)
462 call mem_allocate(this%gwfceltyp, this%dis%nodesuser, &
463 'GWFCELTYP', this%memoryPath)
464 call this%gfr%read_int_1d_into(
"ICELLTYPE", this%gwfceltyp)
467 select case (this%gfr%grid_type)
469 select type (dis => this%dis)
471 user_nodes = this%gfr%read_int(
"NCELLS")
472 if (user_nodes /= this%dis%nodesuser)
then
473 write (errmsg, fmtdiserr) &
474 trim(this%text), user_nodes, this%dis%nodesuser
475 call store_error(errmsg, terminate=.true.)
477 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
478 idomain3d = reshape(idomain1d, [ &
479 this%gfr%read_int(
"NCOL"), &
480 this%gfr%read_int(
"NROW"), &
481 this%gfr%read_int(
"NLAY") &
483 if (.not. all(dis%idomain == idomain3d))
then
484 write (errmsg, fmtidomerr) trim(this%text)
485 call store_error(errmsg, terminate=.true.)
489 select type (dis => this%dis)
491 user_nodes = this%gfr%read_int(
"NCELLS")
492 if (user_nodes /= this%dis%nodesuser)
then
493 write (errmsg, fmtdiserr) &
494 trim(this%text), user_nodes, this%dis%nodesuser
495 call store_error(errmsg, terminate=.true.)
497 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
498 idomain2d = reshape(idomain1d, [ &
499 this%gfr%read_int(
"NCPL"), &
500 this%gfr%read_int(
"NLAY") &
502 if (.not. all(dis%idomain == idomain2d))
then
503 write (errmsg, fmtidomerr) trim(this%text)
504 call store_error(errmsg, terminate=.true.)
508 select type (dis => this%dis)
510 user_nodes = this%gfr%read_int(
"NODES")
511 if (user_nodes /= this%dis%nodesuser)
then
512 write (errmsg, fmtdiserr) &
513 trim(this%text), user_nodes, this%dis%nodesuser
514 call store_error(errmsg, terminate=.true.)
516 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
517 if (.not. all(dis%idomain == idomain1d))
then
518 write (errmsg, fmtidomerr) trim(this%text)
519 call store_error(errmsg, terminate=.true.)
523 select type (dis => this%dis)
525 user_nodes = this%gfr%read_int(
"NCELLS")
526 if (user_nodes /= this%dis%nodesuser)
then
527 write (errmsg, fmtdiserr) &
528 trim(this%text), user_nodes, this%dis%nodesuser
529 call store_error(errmsg, terminate=.true.)
531 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
532 idomain2d = reshape(idomain1d, [ &
533 this%gfr%read_int(
"NCOL"), &
534 this%gfr%read_int(
"NROW") &
536 if (.not. all(dis%idomain == idomain2d))
then
537 write (errmsg, fmtidomerr) trim(this%text)
538 call store_error(errmsg, terminate=.true.)
542 select type (dis => this%dis)
544 user_nodes = this%gfr%read_int(
"NODES")
545 if (user_nodes /= this%dis%nodesuser)
then
546 write (errmsg, fmtdiserr) &
547 trim(this%text), user_nodes, this%dis%nodesuser
548 call store_error(errmsg, terminate=.true.)
550 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
551 if (.not. all(dis%idomain == idomain1d))
then
552 write (errmsg, fmtidomerr) trim(this%text)
553 call store_error(errmsg, terminate=.true.)
557 select type (dis => this%dis)
559 user_nodes = this%gfr%read_int(
"NCELLS")
560 if (user_nodes /= this%dis%nodesuser)
then
561 write (errmsg, fmtdiserr) &
562 trim(this%text), user_nodes, this%dis%nodesuser
563 call store_error(errmsg, terminate=.true.)
565 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
566 if (.not. all(dis%idomain == idomain1d))
then
567 write (errmsg, fmtidomerr) trim(this%text)
568 call store_error(errmsg, terminate=.true.)
573 if (
allocated(idomain3d))
deallocate (idomain3d)
574 if (
allocated(idomain2d))
deallocate (idomain2d)
575 if (
allocated(idomain1d))
deallocate (idomain1d)
577 call this%gfr%finalize()
Structured grid discretization.
Structured grid discretization.
Unstructured grid discretization.
Vertex grid discretization.
Vertex grid discretization.