From f382506f094805d0e3bbc917ffb0c7cbe5cb91bd Mon Sep 17 00:00:00 2001 From: Alden Provost Date: Fri, 29 Jan 2021 08:39:05 -0500 Subject: [PATCH] Removed an unnecessary limitation on the grid structure that caused runs using regular grids (other than MF-2005 grids) with row-to-row or column-to-column variations in spacing by factors other than 0.5, 1.0, or 2.0 to terminate with the error 'Invalid grid structure. stop.' --- source/ModflowRectangularGrid.f90 | 72 ++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 21 deletions(-) diff --git a/source/ModflowRectangularGrid.f90 b/source/ModflowRectangularGrid.f90 index 7d87e80..d8ff4b1 100644 --- a/source/ModflowRectangularGrid.f90 +++ b/source/ModflowRectangularGrid.f90 @@ -109,10 +109,10 @@ subroutine ComputeFaceAssignments(this) rx = 1.0 else if(abs(rx - 2.0) .le. tol) then rx = 2.0 - else - ! exit with error message that this grid is not consistent with a - ! smoothed quad grid. - call ustop('Invalid grid spacing structure. stop.') +!! else +!! ! exit with error message that this grid is not consistent with a +!! ! smoothed quad grid. +!! call ustop('Invalid grid spacing structure. stop.') end if ry = this%DelY(conn) / this%DelY(n) if(abs(ry - 0.5) .le. tol) then @@ -121,10 +121,10 @@ subroutine ComputeFaceAssignments(this) ry = 1.0 else if(abs(ry - 2.0) .le. tol) then ry = 2.0 - else - ! exit with error message that this grid is not consistent with a - ! smoothed quad grid. - call ustop('Invalid grid spacing structure. stop.') +!! else +!! ! exit with error message that this grid is not consistent with a +!! ! smoothed quad grid. +!! call ustop('Invalid grid spacing structure. stop.') end if ! Assign face connections @@ -141,8 +141,13 @@ subroutine ComputeFaceAssignments(this) else if((this%CellY(conn) .lt. this%CellY(n)) .and. (this%CellX(conn) .gt. this%CellX(n))) then m = m + 404 end if - else if((rx .ge. 1.0) .and. (ry .ge. 1.0)) then - m = m + 101 +!! else if((rx .ge. 1.0) .and. (ry .ge. 1.0)) then + else if(((rx .eq. 1.0) .or. (rx .eq. 2.0)) .and. (rx .eq. ry)) then + m = m + 101 + else + ! exit with error message that this grid is not + ! consistent with a smoothed quad grid. + call ustop('Invalid grid spacing structure. stop.') end if else if(connLayer .lt. layer) then m = 60000 @@ -156,8 +161,13 @@ subroutine ComputeFaceAssignments(this) else if((this%CellY(conn) .lt. this%CellY(n)) .and. (this%CellX(conn) .gt. this%CellX(n))) then m = m + 404 end if - else if((rx .ge. 1.0) .and. (ry .ge. 1.0)) then - m = m + 101 +!! else if((rx .ge. 1.0) .and. (ry .ge. 1.0)) then + else if(((rx .eq. 1.0) .or. (rx .eq. 2.0)) .and. (rx .eq. ry)) then + m = m + 101 + else + ! exit with error message that this grid is not + ! consistent with a smoothed quad grid. + call ustop('Invalid grid spacing structure. stop.') end if else if(abs(left - connRight) .le. tol) then @@ -168,8 +178,13 @@ subroutine ComputeFaceAssignments(this) else if(this%CellY(conn) .lt. this%CellY(n)) then m = m + 202 end if - else if(ry .ge. 1.0) then - m = m + 101 +!! else if(ry .ge. 1.0) then + else if((ry .eq. 1.0) .or. ((ry .eq. 2.0))) then + m = m + 101 + else + ! exit with error message that this grid is not + ! consistent with a smoothed quad grid. + call ustop('Invalid grid spacing structure. stop.') end if else if(abs(right - connLeft) .le. tol) then m = 20000 @@ -179,9 +194,14 @@ subroutine ComputeFaceAssignments(this) else if(this%CellY(conn) .lt. this%CellY(n)) then m = m + 202 end if - else if(ry .ge. 1.0) then - m = m + 101 - end if +!! else if(ry .ge. 1.0) then + else if((ry .eq. 1.0) .or. ((ry .eq. 2.0))) then + m = m + 101 + else + ! exit with error message that this grid is not + ! consistent with a smoothed quad grid. + call ustop('Invalid grid spacing structure. stop.') + end if else if(abs(front - connBack) .le. tol) then m = 30000 if(rx .le. 0.5) then @@ -190,8 +210,13 @@ subroutine ComputeFaceAssignments(this) else if(this%CellX(conn) .gt. this%CellX(n)) then m = m + 202 end if - else if(rx .ge. 1.0) then - m = m + 101 +!! else if(rx .ge. 1.0) then + else if((rx .eq. 1.0) .or. ((rx .eq. 2.0))) then + m = m + 101 + else + ! exit with error message that this grid is not + ! consistent with a smoothed quad grid. + call ustop('Invalid grid spacing structure. stop.') end if else if(abs(back - connFront) .le. tol) then m = 40000 @@ -201,8 +226,13 @@ subroutine ComputeFaceAssignments(this) else if(this%CellX(conn) .gt. this%CellX(n)) then m = m + 202 end if - else if(rx .ge. 1.0) then - m = m + 101 +!! else if(rx .ge. 1.0) then + else if((rx .eq. 1.0) .or. ((rx .eq. 2.0))) then + m = m + 101 + else + ! exit with error message that this grid is not + ! consistent with a smoothed quad grid. + call ustop('Invalid grid spacing structure. stop.') end if end if end if