441 class(FlowModelInterfaceType) :: this
443 integer(I4B) :: user_nodes
444 integer(I4B),
allocatable :: idomain1d(:), idomain2d(:, :), idomain3d(:, :, :)
446 character(len=*),
parameter :: fmtdiserr = &
447 "('Error in ',a,': Models do not have the same discretization. &
448 &GWF model has ', i0, ' user nodes, this model has ', i0, '. &
449 &Ensure discretization packages, including IDOMAIN, are identical.')"
450 character(len=*),
parameter :: fmtidomerr = &
451 "('Error in ',a,': models do not have the same discretization. &
452 &Models have different IDOMAIN arrays. &
453 &Ensure discretization packages, including IDOMAIN, are identical.')"
455 call this%gfr%initialize(this%iugrb)
458 if (this%gfr%has_variable(
"ICELLTYPE"))
then
460 call mem_allocate(this%gwfceltyp, this%dis%nodesuser, &
461 'GWFCELTYP', this%memoryPath)
462 call this%gfr%read_int_1d_into(
"ICELLTYPE", this%gwfceltyp)
466 select case (this%gfr%grid_type)
468 select type (dis => this%dis)
470 user_nodes = this%gfr%read_int(
"NCELLS")
471 if (user_nodes /= this%dis%nodesuser)
then
472 write (errmsg, fmtdiserr) &
473 trim(this%text), user_nodes, this%dis%nodesuser
474 call store_error(errmsg, terminate=.true.)
476 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
477 idomain3d = reshape(idomain1d, [ &
478 this%gfr%read_int(
"NCOL"), &
479 this%gfr%read_int(
"NROW"), &
480 this%gfr%read_int(
"NLAY") &
482 if (.not. all(dis%idomain == idomain3d))
then
483 write (errmsg, fmtidomerr) trim(this%text)
484 call store_error(errmsg, terminate=.true.)
488 select type (dis => this%dis)
490 user_nodes = this%gfr%read_int(
"NCELLS")
491 if (user_nodes /= this%dis%nodesuser)
then
492 write (errmsg, fmtdiserr) &
493 trim(this%text), user_nodes, this%dis%nodesuser
494 call store_error(errmsg, terminate=.true.)
496 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
497 idomain2d = reshape(idomain1d, [ &
498 this%gfr%read_int(
"NCPL"), &
499 this%gfr%read_int(
"NLAY") &
501 if (.not. all(dis%idomain == idomain2d))
then
502 write (errmsg, fmtidomerr) trim(this%text)
503 call store_error(errmsg, terminate=.true.)
507 select type (dis => this%dis)
509 user_nodes = this%gfr%read_int(
"NODES")
510 if (user_nodes /= this%dis%nodesuser)
then
511 write (errmsg, fmtdiserr) &
512 trim(this%text), user_nodes, this%dis%nodesuser
513 call store_error(errmsg, terminate=.true.)
515 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
516 if (.not. all(dis%idomain == idomain1d))
then
517 write (errmsg, fmtidomerr) trim(this%text)
518 call store_error(errmsg, terminate=.true.)
522 select type (dis => this%dis)
524 user_nodes = this%gfr%read_int(
"NCELLS")
525 if (user_nodes /= this%dis%nodesuser)
then
526 write (errmsg, fmtdiserr) &
527 trim(this%text), user_nodes, this%dis%nodesuser
528 call store_error(errmsg, terminate=.true.)
530 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
531 idomain2d = reshape(idomain1d, [ &
532 this%gfr%read_int(
"NCOL"), &
533 this%gfr%read_int(
"NROW") &
535 if (.not. all(dis%idomain == idomain2d))
then
536 write (errmsg, fmtidomerr) trim(this%text)
537 call store_error(errmsg, terminate=.true.)
541 select type (dis => this%dis)
543 user_nodes = this%gfr%read_int(
"NODES")
544 if (user_nodes /= this%dis%nodesuser)
then
545 write (errmsg, fmtdiserr) &
546 trim(this%text), user_nodes, this%dis%nodesuser
547 call store_error(errmsg, terminate=.true.)
549 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
550 if (.not. all(dis%idomain == idomain1d))
then
551 write (errmsg, fmtidomerr) trim(this%text)
552 call store_error(errmsg, terminate=.true.)
556 select type (dis => this%dis)
558 user_nodes = this%gfr%read_int(
"NCELLS")
559 if (user_nodes /= this%dis%nodesuser)
then
560 write (errmsg, fmtdiserr) &
561 trim(this%text), user_nodes, this%dis%nodesuser
562 call store_error(errmsg, terminate=.true.)
564 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
565 if (.not. all(dis%idomain == idomain1d))
then
566 write (errmsg, fmtidomerr) trim(this%text)
567 call store_error(errmsg, terminate=.true.)
572 if (
allocated(idomain3d))
deallocate (idomain3d)
573 if (
allocated(idomain2d))
deallocate (idomain2d)
574 if (
allocated(idomain1d))
deallocate (idomain1d)
576 call this%gfr%finalize()
Structured grid discretization.
Structured grid discretization.
Unstructured grid discretization.
Vertex grid discretization.
Vertex grid discretization.