Skip to content

Commit

Permalink
merge in develop (#1044)
Browse files Browse the repository at this point in the history
* fix(exg): cellid not correct in error message (#1040)

* If cellid in exchange is in IDOMAIN<1 cell, then the cellid written to the error message was wrong
* Close #1038

* docs(mf6io): fix discrepancy in EVT example (#1041)

* data in the period block contains pxpd1 and pxpd2, implying nseg=3, but nseg not specified which suggests a default value of 1
* cleanup variable names

Co-authored-by: Eric Morway <emorway@usgs.gov>
  • Loading branch information
langevin-usgs and emorway-usgs authored Sep 14, 2022
1 parent 4c599a8 commit 1423361
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
3 changes: 2 additions & 1 deletion doc/mf6io/mf6ivar/examples/gwf-evt-example.dat
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ PRINT_INPUT

BEGIN DIMENSIONS
MAXBOUND 10
NSEG 3
END DIMENSIONS

BEGIN PERIOD 1
# Lay Row Col SURFACE RATE DEPTH PXPD1 PXPD2 PETM1 PETM2 Mult Name
# Lay Row Col SURFACE RATE DEPTH PXDP1 PXDP2 PETM1 PETM2 Mult Name
1 1 13 110.0 et_rate 10.0 0.2 0.5 0.3 0.1 0.2 ET-1
1 2 13 110.0 et_rate 10.0 0.2 0.5 0.3 0.1 0.4 ET-2
1 3 13 110.0 et_rate 10.0 0.2 0.5 0.3 0.1 0.6 ET-3
Expand Down
32 changes: 14 additions & 18 deletions src/Exchange/DisConnExchange.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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))"
Expand Down Expand Up @@ -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
!
Expand All @@ -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), &
Expand All @@ -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
Expand Down

0 comments on commit 1423361

Please sign in to comment.