419 class(FlowModelInterfaceType) :: this
421 integer(I4B) :: user_nodes
422 integer(I4B),
allocatable :: idomain1d(:), idomain2d(:, :), idomain3d(:, :, :)
424 character(len=*),
parameter :: fmtdiserr = &
425 "('Error in ',a,': Models do not have the same discretization. &
426 &GWF model has ', i0, ' user nodes, this model has ', i0, '. &
427 &Ensure discretization packages, including IDOMAIN, are identical.')"
428 character(len=*),
parameter :: fmtidomerr = &
429 "('Error in ',a,': models do not have the same discretization. &
430 &Models have different IDOMAIN arrays. &
431 &Ensure discretization packages, including IDOMAIN, are identical.')"
433 call this%gfr%initialize(this%iugrb)
436 select case (this%gfr%grid_type)
438 select type (dis => this%dis)
440 user_nodes = this%gfr%read_int(
"NCELLS")
441 if (user_nodes /= this%dis%nodesuser)
then
442 write (errmsg, fmtdiserr) &
443 trim(this%text), user_nodes, this%dis%nodesuser
444 call store_error(errmsg, terminate=.true.)
446 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
447 idomain3d = reshape(idomain1d, [ &
448 this%gfr%read_int(
"NCOL"), &
449 this%gfr%read_int(
"NROW"), &
450 this%gfr%read_int(
"NLAY") &
452 if (.not. all(dis%idomain == idomain3d))
then
453 write (errmsg, fmtidomerr) trim(this%text)
454 call store_error(errmsg, terminate=.true.)
458 select type (dis => this%dis)
460 user_nodes = this%gfr%read_int(
"NCELLS")
461 if (user_nodes /= this%dis%nodesuser)
then
462 write (errmsg, fmtdiserr) &
463 trim(this%text), user_nodes, this%dis%nodesuser
464 call store_error(errmsg, terminate=.true.)
466 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
467 idomain2d = reshape(idomain1d, [ &
468 this%gfr%read_int(
"NCPL"), &
469 this%gfr%read_int(
"NLAY") &
471 if (.not. all(dis%idomain == idomain2d))
then
472 write (errmsg, fmtidomerr) trim(this%text)
473 call store_error(errmsg, terminate=.true.)
477 select type (dis => this%dis)
479 user_nodes = this%gfr%read_int(
"NODES")
480 if (user_nodes /= this%dis%nodesuser)
then
481 write (errmsg, fmtdiserr) &
482 trim(this%text), user_nodes, this%dis%nodesuser
483 call store_error(errmsg, terminate=.true.)
485 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
486 if (.not. all(dis%idomain == idomain1d))
then
487 write (errmsg, fmtidomerr) trim(this%text)
488 call store_error(errmsg, terminate=.true.)
492 select type (dis => this%dis)
494 user_nodes = this%gfr%read_int(
"NCELLS")
495 if (user_nodes /= this%dis%nodesuser)
then
496 write (errmsg, fmtdiserr) &
497 trim(this%text), user_nodes, this%dis%nodesuser
498 call store_error(errmsg, terminate=.true.)
500 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
501 idomain2d = reshape(idomain1d, [ &
502 this%gfr%read_int(
"NCOL"), &
503 this%gfr%read_int(
"NROW") &
505 if (.not. all(dis%idomain == idomain2d))
then
506 write (errmsg, fmtidomerr) trim(this%text)
507 call store_error(errmsg, terminate=.true.)
511 select type (dis => this%dis)
513 user_nodes = this%gfr%read_int(
"NODES")
514 if (user_nodes /= this%dis%nodesuser)
then
515 write (errmsg, fmtdiserr) &
516 trim(this%text), user_nodes, this%dis%nodesuser
517 call store_error(errmsg, terminate=.true.)
519 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
520 if (.not. all(dis%idomain == idomain1d))
then
521 write (errmsg, fmtidomerr) trim(this%text)
522 call store_error(errmsg, terminate=.true.)
526 select type (dis => this%dis)
528 user_nodes = this%gfr%read_int(
"NCELLS")
529 if (user_nodes /= this%dis%nodesuser)
then
530 write (errmsg, fmtdiserr) &
531 trim(this%text), user_nodes, this%dis%nodesuser
532 call store_error(errmsg, terminate=.true.)
534 idomain1d = this%gfr%read_int_1d(
"IDOMAIN")
535 if (.not. all(dis%idomain == idomain1d))
then
536 write (errmsg, fmtidomerr) trim(this%text)
537 call store_error(errmsg, terminate=.true.)
542 if (
allocated(idomain3d))
deallocate (idomain3d)
543 if (
allocated(idomain2d))
deallocate (idomain2d)
544 if (
allocated(idomain1d))
deallocate (idomain1d)
546 call this%gfr%finalize()
Structured grid discretization.
Structured grid discretization.
Unstructured grid discretization.
Vertex grid discretization.
Vertex grid discretization.