Skip to content

Commit

Permalink
Removed an unnecessary limitation on the grid structure that caused r…
Browse files Browse the repository at this point in the history
…uns 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.'
  • Loading branch information
aprovost-usgs committed Jan 29, 2021
1 parent b2346f7 commit f382506
Showing 1 changed file with 51 additions and 21 deletions.
72 changes: 51 additions & 21 deletions source/ModflowRectangularGrid.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f382506

Please sign in to comment.