From 0a6cb23abb605f05e66cfc0fd960f7ac25e99c06 Mon Sep 17 00:00:00 2001 From: "Langevin, Christian D" Date: Tue, 13 Sep 2022 08:38:28 -0500 Subject: [PATCH] fix(exg): cellid not correct in error message * If cellid in exchange is in IDOMAIN<1 cell, then the cellid written to the error message was wrong * Close #1038 --- src/Exchange/DisConnExchange.f90 | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/Exchange/DisConnExchange.f90 b/src/Exchange/DisConnExchange.f90 index 0f02cdc32de..88f0551e621 100644 --- a/src/Exchange/DisConnExchange.f90 +++ b/src/Exchange/DisConnExchange.f90 @@ -179,10 +179,10 @@ subroutine read_data(this, iout) class(DisConnExchangeType) :: this !< instance of exchange object integer(I4B), intent(in) :: iout !< the output file unit ! local - character(len=LINELENGTH) :: nodestr, node1str, node2str, cellid + character(len=20) :: cellid1, cellid2 character(len=2) :: cnfloat integer(I4B) :: lloc, ierr, nerr, iaux - integer(I4B) :: iexg, nodem1, nodem2, nodeum1, nodeum2 + integer(I4B) :: iexg, nodem1, nodem2 logical :: isfound, endOfBlock character(len=*), parameter :: fmtexglabel = "(5x, 3a10, 50(a16))" @@ -216,16 +216,18 @@ subroutine read_data(this, iout) lloc = 1 ! ! -- Read and check node 1 - call this%parser%GetCellid(this%model1%dis%ndim, cellid, & + call this%parser%GetCellid(this%model1%dis%ndim, cellid1, & flag_string=.true.) - nodem1 = this%model1%dis%noder_from_cellid(cellid, this%parser%iuactive, & + nodem1 = this%model1%dis%noder_from_cellid(cellid1, & + this%parser%iuactive, & iout, flag_string=.true.) this%nodem1(iexg) = nodem1 ! ! -- Read and check node 2 - call this%parser%GetCellid(this%model2%dis%ndim, cellid, & + call this%parser%GetCellid(this%model2%dis%ndim, cellid2, & flag_string=.true.) - nodem2 = this%model2%dis%noder_from_cellid(cellid, this%parser%iuactive, & + nodem2 = this%model2%dis%noder_from_cellid(cellid2, & + this%parser%iuactive, & iout, flag_string=.true.) this%nodem2(iexg) = nodem2 ! @@ -243,17 +245,13 @@ subroutine read_data(this, iout) ! ! -- Write the data to listing file if requested if (this%iprpak /= 0) then - nodeum1 = this%model1%dis%get_nodeuser(nodem1) - call this%model1%dis%nodeu_to_string(nodeum1, node1str) - nodeum2 = this%model2%dis%get_nodeuser(nodem2) - call this%model2%dis%nodeu_to_string(nodeum2, node2str) if (this%inamedbound == 0) then - write (iout, fmtexgdata) trim(node1str), trim(node2str), & + write (iout, fmtexgdata) trim(cellid1), trim(cellid2), & this%ihc(iexg), this%cl1(iexg), this%cl2(iexg), & this%hwva(iexg), & (this%auxvar(iaux, iexg), iaux=1, this%naux) else - write (iout, fmtexgdata2) trim(node1str), trim(node2str), & + write (iout, fmtexgdata2) trim(cellid1), trim(cellid2), & this%ihc(iexg), this%cl1(iexg), this%cl2(iexg), & this%hwva(iexg), & (this%auxvar(iaux, iexg), iaux=1, this%naux), & @@ -263,21 +261,19 @@ subroutine read_data(this, iout) ! ! -- Check to see if nodem1 is outside of active domain if (nodem1 <= 0) then - call this%model1%dis%nodeu_to_string(nodeum1, nodestr) write (errmsg, *) & trim(adjustl(this%model1%name))// & - ' Cell is outside active grid domain '// & - trim(adjustl(nodestr))//'.' + ' Cell is outside active grid domain ('// & + trim(adjustl(cellid1))//').' call store_error(errmsg) end if ! ! -- Check to see if nodem2 is outside of active domain if (nodem2 <= 0) then - call this%model2%dis%nodeu_to_string(nodeum2, nodestr) write (errmsg, *) & trim(adjustl(this%model2%name))// & - ' Cell is outside active grid domain '// & - trim(adjustl(nodestr))//'.' + ' Cell is outside active grid domain ('// & + trim(adjustl(cellid2))//').' call store_error(errmsg) end if end do