Skip to content

Commit

Permalink
fix(exg): GWF-GWF exchange can be configured with a mover and no actu…
Browse files Browse the repository at this point in the history
…al connections (nexg = 0) (#2044)

* fix(mvr): exchange mover with nexg=0 connected cells was failing

* - add release note

* upgrade petsc for macos to 3.22.1

* - forgot extended (sorry MR)

* try bumping up to macos-14

* - set back to macos-13

* - try debugging petsc error

* - change openmpi version

* - trigger new build

* - merged linux and macos build steps
  • Loading branch information
mjr-deltares authored Nov 2, 2024
1 parent 626a145 commit 3be3c39
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 103 deletions.
28 changes: 5 additions & 23 deletions .github/actions/test-extended/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ description: Build and test Extended MODFLOW 6
runs:
using: "composite"
steps:

- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
with:
Expand All @@ -17,44 +16,27 @@ runs:
repository: petsc/petsc
path: petsc
ref: release

- name: Checkout PETSc
if: runner.os == 'macOS'
uses: actions/checkout@v4
with:
repository: petsc/petsc
path: petsc
ref: release-3.21

- name: Configure environment
if: runner.os == 'Linux'
shell: bash
run: |
echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/petsc/linux-gnu/lib/pkgconfig" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/petsc/linux-gnu/bin" >> $GITHUB_PATH
ref: v3.22.1

- name: Configure environment
if: runner.os == 'macOS'
shell: bash
run: |
echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/petsc/arch-darwin-gcc/lib/pkgconfig" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/petsc/arch-darwin-gcc/bin" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/petsc/arch-gcc-opt/lib/pkgconfig" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/petsc/arch-gcc-opt/bin" >> $GITHUB_PATH
- name: Configure PETSc
if: runner.os == 'Linux'
shell: bash
working-directory: petsc
run: |
sudo wget -P $GITHUB_WORKSPACE/petsc https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.2.tar.gz
sudo ./configure PETSC_ARCH=linux-gnu --download-fblaslapack --download-openmpi=$GITHUB_WORKSPACE/petsc/openmpi-5.0.2.tar.gz --with-debugging=0
sudo make all
- name: Configure PETSc
if: runner.os == 'macOS'
shell: bash
working-directory: petsc
run: |
sudo ./configure PETSC_DIR="$GITHUB_WORKSPACE/petsc" PETSC_ARCH=arch-darwin-gcc --download-fblaslapack --download-openmpi --with-debugging=0
sudo ./configure PETSC_ARCH=arch-gcc-opt --download-fblaslapack --download-openmpi=$GITHUB_WORKSPACE/petsc/openmpi-5.0.2.tar.gz --with-debugging=0
sudo make all
- name: Install netcdf
Expand Down
28 changes: 5 additions & 23 deletions .github/actions/test-par/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ description: Build and test parallel MODFLOW 6
runs:
using: "composite"
steps:

- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
with:
Expand All @@ -17,44 +16,27 @@ runs:
repository: petsc/petsc
path: petsc
ref: release

- name: Checkout PETSc
if: runner.os == 'macOS'
uses: actions/checkout@v4
with:
repository: petsc/petsc
path: petsc
ref: release-3.21
ref: v3.22.1

- name: Configure environment
if: runner.os == 'Linux'
shell: bash
run: |
echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/petsc/linux-gnu/lib/pkgconfig" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/petsc/linux-gnu/bin" >> $GITHUB_PATH
- name: Configure environment
if: runner.os == 'macOS'
shell: bash
run: |
echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/petsc/arch-darwin-gcc/lib/pkgconfig" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/petsc/arch-darwin-gcc/bin" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/petsc/arch-gcc-opt/lib/pkgconfig" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/petsc/arch-gcc-opt/bin" >> $GITHUB_PATH
- name: Configure PETSc
if: runner.os == 'Linux'
shell: bash
working-directory: petsc
run: |
sudo wget -P $GITHUB_WORKSPACE/petsc https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.2.tar.gz
sudo ./configure PETSC_ARCH=linux-gnu --download-fblaslapack --download-openmpi=$GITHUB_WORKSPACE/petsc/openmpi-5.0.2.tar.gz --with-debugging=0
sudo make all
- name: Configure PETSc
if: runner.os == 'macOS'
shell: bash
working-directory: petsc
run: |
sudo ./configure PETSC_DIR="$GITHUB_WORKSPACE/petsc" PETSC_ARCH=arch-darwin-gcc --download-fblaslapack --download-openmpi --with-debugging=0
sudo ./configure PETSC_ARCH=arch-gcc-opt --download-fblaslapack --download-openmpi=$GITHUB_WORKSPACE/petsc/openmpi-5.0.2.tar.gz --with-debugging=0
sudo make all
- name: Build modflow6
Expand Down
93 changes: 44 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@ name: MODFLOW 6 continuous integration
on:
push:
paths-ignore:
- '**.md'
- '**.pdf'
- '**.tex'
- '**.jpg'
- '**.jpeg'
- '**.png'
- '**.bbl'
- '**.bib'
- 'doc/**.dat'
- 'doc/**.ipynb'
- 'doc/**.py'
- 'doc/**.sh'
- 'doc/**.xlsx'
- '.hpc/**'
- "**.md"
- "**.pdf"
- "**.tex"
- "**.jpg"
- "**.jpeg"
- "**.png"
- "**.bbl"
- "**.bib"
- "doc/**.dat"
- "doc/**.ipynb"
- "doc/**.py"
- "doc/**.sh"
- "doc/**.xlsx"
- ".hpc/**"
pull_request:
branches:
- master
- develop
paths-ignore:
- '**.md'
- '**.pdf'
- '**.tex'
- '**.jpg'
- '**.jpeg'
- '**.png'
- '**.bbl'
- '**.bib'
- 'doc/**.dat'
- 'doc/**.ipynb'
- 'doc/**.py'
- 'doc/**.sh'
- 'doc/**.xlsx'
- '.hpc/**'
- "**.md"
- "**.pdf"
- "**.tex"
- "**.jpg"
- "**.jpeg"
- "**.png"
- "**.bbl"
- "**.bib"
- "doc/**.dat"
- "doc/**.ipynb"
- "doc/**.py"
- "doc/**.sh"
- "doc/**.xlsx"
- ".hpc/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -45,7 +45,6 @@ jobs:
name: Check format
runs-on: ubuntu-latest
steps:

- name: Checkout MF6
uses: actions/checkout@v4

Expand All @@ -65,7 +64,7 @@ jobs:

- name: Check python format
run: pixi run check-python-format

- name: Check CITATION.cff
uses: dieghernan/cff-validator@v3

Expand All @@ -76,10 +75,9 @@ jobs:
FC: gfortran
FC_V: 13
steps:

- name: Checkout MF6
uses: actions/checkout@v4

- name: Setup ${{ env.FC }} ${{ env.FC_V }}
uses: fortran-lang/setup-fortran@v1
with:
Expand Down Expand Up @@ -118,7 +116,7 @@ jobs:
uses: actions/checkout@v4
with:
path: modflow6

- name: Checkout test-drive
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -158,7 +156,7 @@ jobs:
if: failure()
working-directory: modflow6
run: cat builddir/meson-logs/meson-log.txt

- name: Unit test MF6
working-directory: modflow6
run: pixi run test builddir
Expand Down Expand Up @@ -229,13 +227,13 @@ jobs:
with:
repository: MODFLOW-USGS/modflow6-testmodels
path: modflow6-testmodels

- name: Checkout examples
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6-examples
path: modflow6-examples

- name: Setup ${{ env.FC }} ${{ env.FC_V }}
uses: fortran-lang/setup-fortran@v1
with:
Expand Down Expand Up @@ -277,7 +275,7 @@ jobs:
if: failure()
working-directory: modflow6
run: cat builddir/meson-logs/meson-log.txt

- name: Unit test MF6
working-directory: modflow6
run: pixi run test builddir
Expand Down Expand Up @@ -311,7 +309,7 @@ jobs:
fi
pixi run autotest -m "$markers" -k "$filters"
- name: Install executables
if: runner.os == 'Linux'
uses: modflowpy/install-modflow-action@v1
Expand All @@ -332,7 +330,7 @@ jobs:
with:
name: failed-${{ matrix.os }}-${{ env.FC }}-${{ env.FC_V }}
path: modflow6/autotest/.failed

- name: Checkout usgslatex
if: runner.os == 'Linux'
uses: actions/checkout@v4
Expand All @@ -354,7 +352,7 @@ jobs:
if: runner.os == 'Linux'
working-directory: usgslatex/usgsLaTeX
run: sudo ./install.sh --all-users

- name: Test distribution scripts
working-directory: modflow6
env:
Expand All @@ -379,7 +377,6 @@ jobs:
run:
shell: bash
steps:

- name: Free disk space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
Expand All @@ -402,7 +399,7 @@ jobs:
with:
repository: MODFLOW-USGS/modflow6-testmodels
path: modflow6-testmodels

- name: Checkout examples
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -478,7 +475,7 @@ jobs:
cp bin/libmf6.so ~/.local/bin/modflow/
cd ../modflow6-examples/autotest
pytest -v -n auto test_scripts.py
- name: Upload failed test output
if: failure()
uses: actions/upload-artifact@v4
Expand All @@ -491,7 +488,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run test-dist-scripts

parallel_test:
name: Parallel testing
needs:
Expand All @@ -502,13 +499,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-13, windows-2022 ]
os: [ubuntu-22.04, macos-13, windows-2022]
defaults:
run:
shell: bash

steps:

steps:
- name: Checkout MF6
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -564,13 +560,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-13 ]
os: [ubuntu-22.04, macos-13]
defaults:
run:
shell: bash

steps:

- name: Checkout MF6
uses: actions/checkout@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions doc/ReleaseNotes/develop.tex
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
\item A new option RELEASE\_TIME\_FREQUENCY was added to the PRT model's particle release point (PRP) package. This option configures release times on a regular interval for the duration of the simulation, with the first release at the simulation start time. The PRP package's release schedule is the union of times configured via RELEASE\_TIME\_FREQUENCY, the RELEASETIMES block, and period block release settings, up to the tolerance mentioned in the previous item. If none of these are provided, a single release time is configured at the beginning of the first stress period's first time step. (A related bug has also been fixed which erroneously activated this default when user-specified release times were configured.)
\item The PRT model's particle release point (PRP) package's FRACTION period-block release time setting has been removed. Period-block release settings can now be used only to release particles at the beginning of specified time steps, as is the case for period-block timing settings in the output control (OC) packages for all models. For fine control over release timing, specify times explicitly using the RELEASETIMES block.
\item The Stress Package Concentration (SPC) utility available with the SSM Package is now the referred to as the Stress Package Component utility in the MF6IO guide. Additionally, some relatively minor refactoring of the code facilitates use of the SPC utility with the GWE model type so that TEMPERATURE arrays may be read by the utility. The SPC acronym was maintained to preserve backward compatibility.
\item The GWF-GWF Exchange has been fixed to support the configuration of the Mover package (MVR) also in cases where the number of exchanges equals zero (NEXG = 0). In earlier versions this has caused MODFLOW to terminate with an error.

\end{itemize}

%\underline{INTERNAL FLOW PACKAGES}
Expand Down
18 changes: 10 additions & 8 deletions src/Model/ModelUtilities/Connections.f90
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,16 @@ subroutine con_da(this)
!
! -- Arrays
call mem_deallocate(this%ia)
call mem_deallocate(this%ja)
call mem_deallocate(this%isym)
call mem_deallocate(this%jas)
call mem_deallocate(this%hwva)
call mem_deallocate(this%anglex)
call mem_deallocate(this%ihc)
call mem_deallocate(this%cl1)
call mem_deallocate(this%cl2)
if (size(this%ja) > 0) then
call mem_deallocate(this%ja)
call mem_deallocate(this%isym)
call mem_deallocate(this%jas)
call mem_deallocate(this%hwva)
call mem_deallocate(this%anglex)
call mem_deallocate(this%ihc)
call mem_deallocate(this%cl1)
call mem_deallocate(this%cl2)
end if
end subroutine con_da

!> @brief Allocate scalars for ConnectionsType
Expand Down

0 comments on commit 3be3c39

Please sign in to comment.