Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
d5b8a98
Add bowl-slosh test
mandli Apr 22, 2025
6c41c99
Merge branch 'master' into update-pytest
mandli Apr 22, 2025
f4562ba
Try removing PIC version of LAPACK
mandli Apr 22, 2025
db36a43
Fix silly error
mandli Apr 22, 2025
643ecba
Fix another silly bug, like with clowns
mandli Apr 22, 2025
4a320d9
Update action script to fix reference error
mandli Apr 22, 2025
9f99614
Minor changes now that things have hopefully been updated/working
mandli Apr 22, 2025
52b30e9
Fix flake errors part I
mandli Apr 22, 2025
240ac4d
Flake fixes part II
mandli Apr 22, 2025
a91c9b7
Flake fixes part III, the end
mandli Apr 22, 2025
ec4a4b7
Remove global from exported notebook
mandli Apr 22, 2025
4d3b878
Remove __init__ in tests to disable old tests
mandli Apr 22, 2025
84fc58f
Remove deprecated parameters
mandli Apr 22, 2025
1473d41
Move and modify test_data
mandli Apr 23, 2025
2c2d487
Add new storm I/O tests but skip a bunch
mandli Apr 23, 2025
027b91a
Refactor test_topotools and move test data
mandli Apr 23, 2025
9ff69ff
Convert dtopotools tests
mandli Apr 23, 2025
4d66533
Converted etopo1 tests
mandli Apr 23, 2025
57f6ef6
Remove setrun changes for bouss
mandli Apr 24, 2025
3440822
Add units tests
mandli Apr 24, 2025
6ec0cfc
Update test util
mandli Apr 24, 2025
cf8cb39
Bowl slosh NetCDF test working
mandli Apr 25, 2025
d3ad6b0
Add better handling of netcdf_test program
mandli Apr 25, 2025
25f27d1
Slightly tweak for better NetCDF flags
mandli Apr 25, 2025
9545ddf
Minor tweaks
mandli Apr 25, 2025
dce60e0
Fix missing modules and old calls to nose
mandli Apr 25, 2025
be16155
Add pandas and xarray to python packages to test with
mandli Apr 25, 2025
92f29ec
Modify code using xarray/netcdf4 and test code
mandli Apr 25, 2025
2d97d95
Fix import errors and numpy copy change warnings
mandli Apr 25, 2025
5f4469c
Remove netcdf_topo test directory
mandli Apr 25, 2025
6c3fd6c
Switch over dtopo test to example
mandli Apr 25, 2025
d35ce6a
Add multilayer planewave test
mandli Apr 28, 2025
5943bb4
Bug fix in custom QinitData class to write to the correct path
mandli Apr 28, 2025
2afd926
Modify gauge_comparison so that it can make more general comparisons
mandli Apr 28, 2025
10125ba
Merge remote-tracking branch 'clawpack/master' into update-pytest
mandli May 3, 2025
a5185f2
Merge remote-tracking branch 'clawpack/master' into update-pytest
mandli May 6, 2025
73f9c27
Ignore all test directories
mandli May 6, 2025
f333905
Fix latex escapes
mandli May 6, 2025
79c356d
Remove non-working code for flake
mandli May 6, 2025
742fa0e
Add archiving of test results
mandli May 6, 2025
e96bb38
Fix typo in archiving
mandli May 6, 2025
2a91847
Fix another typo in archiving
mandli May 6, 2025
0bfae3a
Fix another typo in archiving
mandli May 6, 2025
dc1504f
Move always trigger
mandli May 6, 2025
bd86469
Fix indentation error
mandli May 6, 2025
ce8b25e
Archive part VI
mandli May 6, 2025
d0748a9
Archive part VII
mandli May 6, 2025
031309f
Archive part VIII
mandli May 6, 2025
bc7c936
Archive part IX
mandli May 6, 2025
ee4478b
Archive part X
mandli May 6, 2025
b355efa
Archive part XI
mandli May 6, 2025
b757c37
Archive part XII
mandli May 6, 2025
401f601
Archive part XIII
mandli May 6, 2025
19e1f7c
Archive part pi
mandli May 6, 2025
eff557c
Archive part pii
mandli May 6, 2025
8563374
Archive part pii
mandli May 6, 2025
6863465
Archive part pii
mandli May 6, 2025
d3289a9
Archive part pii
mandli May 6, 2025
c2a289a
Archive part pii
mandli May 6, 2025
a89e709
Archive part pii
mandli May 6, 2025
846c4ef
Archive part 42
mandli May 6, 2025
54d2bb0
Add badge and more to readme
mandli May 6, 2025
cc6861c
Try explicit linking to lapack for linux
mandli May 6, 2025
ff43fed
Minor fixes to bowl slosh test
mandli May 7, 2025
4811768
Rework geoclaw test specifics
mandli May 7, 2025
3844870
Normalize character path arrays
mandli May 9, 2025
8dc5ed4
Remove old multilayer test
mandli May 9, 2025
b3e2d51
Add particles test
mandli May 9, 2025
02ac695
Remove old particles test
mandli May 9, 2025
e2c0461
Add Chile 2010 adjoint test
mandli May 12, 2025
0a59a39
Move maketopo to maketopo_adjoint to avoid name collisions
mandli May 12, 2025
afa406b
Add forward adjoint test
mandli May 12, 2025
ec94084
Change the way that ATCF data is downloaded
mandli May 15, 2025
8a5fccd
Fix typo in datetime handling
mandli May 15, 2025
ea67540
Remove non-working isaac tests and cleanup storm format test
mandli May 15, 2025
a52794e
Fix setbestsrc function signature bug
mandli May 15, 2025
2631a86
Remove local generation of bathy_geometry.data in test
mandli May 15, 2025
6396cda
Remove old import line
mandli May 15, 2025
59b6a71
Remove remaining old test directories
mandli May 15, 2025
c1df91b
Cleanup setrun regarding different isaac formats
mandli May 15, 2025
a697e4e
Remove extra test_storm
mandli May 15, 2025
58ed514
Reenable storm io tests
mandli May 15, 2025
b077935
Add vortex example
mandli May 15, 2025
7e5d6ce
Add working plotting and test to vortex example
mandli May 15, 2025
3ae4009
Convert numpy to np
mandli May 15, 2025
6c59113
Add time check on gauge updates
mandli May 17, 2025
90c2505
Change basetest path and copy in github test action
mandli May 21, 2025
95012cf
Minor updates to vortex run_tests.py
mandli May 21, 2025
dc4212c
Clean up test action
mandli May 30, 2025
87a58ce
Revert gauge update ordering
mandli May 30, 2025
d22f71c
Revert to correct version of advanc
mandli May 30, 2025
5b392b6
Merge remote-tracking branch 'clawpack/master' into update-pytest
mandli Jul 31, 2025
f309c34
Rework Ike test
mandli Aug 1, 2025
c59bd96
Merge remote-tracking branch 'clawpack/master' into update-pytest
mandli Aug 25, 2025
294ba2a
Move examples that are generic to base examples
mandli Aug 25, 2025
6284f1b
Add testing matrix
mandli Aug 28, 2025
6de0af5
Fix uninitialized eta in multilayer gauges
mandli Aug 28, 2025
fbb0ac2
Fix import numpy alias
mandli Aug 28, 2025
77ae9a2
Initialize tend_force_dry
mandli Aug 28, 2025
8acff7c
Fix maketopo import collision
mandli Aug 28, 2025
04b84f3
Turn on storm field testing in Ike
mandli Aug 28, 2025
f2940b3
Update Ike test gauge data
mandli Aug 28, 2025
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
192 changes: 162 additions & 30 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,189 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application
name: Test GeoClaw

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

workflow_dispatch:

permissions:
contents: read

jobs:
build:
env:
CLAW: ${{ github.workspace }}

runs-on: ubuntu-latest
jobs:
tests:
name: >
${{ matrix.os }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} - py ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true # Probably want to turn this off for a large matrix
matrix:
os: [ubuntu-latest, macos-latest]
build: [debug, opt]
python-version: [3.12]
toolchain:
- {compiler: gcc, version: 14}
- {compiler: gcc, version: 15}
# - {compiler: intel, version: '2025.0'}
# - {compiler: intel-classic, version: '2021.10'}
# - {compiler: nvidia-hpc, version: '25.1'} # does not build python
# - {compiler: lfortran, version: '0.45.0'} # lfortran not yet supported
# - {compiler: flang, version: '20.1.0'} # flang not yet supported
# include:
# 3.8 does not seem to work.
# - os: ubuntu-latest
# build: opt
# python-version: 3.8
# toolchain: {compiler: gcc, version: 14}
exclude:
- os: ubuntu-latest
toolchain: {compiler: gcc, version: 15}
- os: macos-latest
toolchain: {compiler: gcc, version: 14}

steps:
- name: Set up Python 3.10
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Checkout clawpack
uses: actions/[email protected]
python-version: ${{ matrix.python-version }}

- name: Set up compilers
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
repository: clawpack/clawpack
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gfortran
# sudo apt-get liblapack-pic
sudo apt-get install liblapack-dev
sudo apt-get install libnetcdf-dev libnetcdff-dev
python -m pip install --upgrade pip
pip install flake8 pytest
- name: Setup clawpack super repository
if [[ "${{ matrix.os }}" = "ubuntu-latest" ]]; then
sudo apt-get update
sudo apt-get install liblapack-dev
sudo apt-get install libnetcdf-dev libnetcdff-dev
elif [[ "${{ matrix.os }}" = "macos-latest" ]]; then
brew update
brew install netcdf netcdf-fortran
else
echo "${{ matrix.os }} not recognized."
exit 1
fi

- name: Install python dependencies
run: |
git submodule init
git submodule update
pip install --user -e .
- name: Setup geoclaw
python -m pip install --upgrade pip
pip install flake8 meson-python ninja pytest numpy
pip install netCDF4 pandas xarray

- name: Checkout Clawpack
uses: actions/[email protected]
with:
repository: clawpack/clawpack
submodules: true

- name: Checkout GeoClaw branch
uses: actions/[email protected]
with:
path: geoclaw

- name: Install clawpack
run: |
cd geoclaw
git checkout ${{ github.ref }}
cd ${CLAW}
pip install --no-build-isolation --editable .

- name: Lint with flake8
run: |
cd geoclaw
cd ${CLAW}/geoclaw
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude old_dtopotools.py
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
run: |
cd geoclaw
pytest
if [ "${{ matrix.toolchain.compiler }}" = "gcc" ]; then
if [ "${{ matrix.build }}" = "debug" ]; then
export FFLAGS="-O0 -g -fcheck=all -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow -finit-real=nan -finit-integer=nan -Wall -Wunderflow -Wextra -Wconversion -Wuninitialized -Warray-bounds -Wshadow -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-but-set-variable"
export OMP_NUM_THREADS=1
elif [ "${{ matrix.build }}" = "opt" ]; then
export FFLAGS="-O1 -fopenmp -funroll-loops -finline-functions -ftree-vectorize -fstack-protector-strong -flto -march=native"
export OMP_NUM_THREADS=2
else
echo "Unknown build type: ${{ matrix.build }}"
exit 1
fi
elif [ "${{ matrix.toolchain.compiler }}" = "intel-classic" ]; then
if [ "${{ matrix.build }}" = "debug" ]; then
export FFLAGS="-O0 -debug all -check all -warn all,nodec,interfaces -gen_interfaces -traceback -fpe0 -ftrapuv -init=snan,arrays -check bounds"
export OMP_NUM_THREADS=1
elif [ "${{ matrix.build }}" = "opt" ]; then
export FFLAGS="-O -qopenmp -unroll -finline-functions -inline-forceinline -ipo -ip"
export OMP_NUM_THREADS=2
fi
elif [ "${{ matrix.toolchain.compiler }}" = "intel" ]; then
if [ "${{ matrix.build }}" = "debug" ]; then
export FFLAGS="-O0 -debug all -check all -warn all,nodec,interfaces -gen_interfaces -traceback -fpe0 -ftrapuv -init=snan,arrays -check bounds"
export OMP_NUM_THREADS=1
elif [ "${{ matrix.build }}" = "opt" ]; then
export FFLAGS="-O -qopenmp -unroll -finline-functions -inline-forceinline -ipo -ip"
export OMP_NUM_THREADS=2
else
echo "Unknown build type: ${{ matrix.build }}"
exit 1
fi
elif [ "${{ matrix.toolchain.compiler }}" = "nvidia-hpc" ]; then
echo "nvidia-hpc compiler not yet supported"
exit 1
if [ "${{ matrix.build }}" = "debug" ]; then
export FFLAGS="-g -O0 -check all -traceback"
export OMP_NUM_THREADS=1
elif [ "${{ matrix.build }}" = "opt" ]; then
export FFLAGS="-O1 -qopenmp"
export OMP_NUM_THREADS=2
else
echo "Unknown build type: ${{ matrix.build }}"
exit 1
fi
elif [ "${{ matrix.toolchain.compiler }}" = "flang" ]; then
echo "flang compiler not yet supported"
exit 1
if [ "${{ matrix.build }}" = "debug" ]; then
export FFLAGS=""
export OMP_NUM_THREADS=1
elif [ "${{ matrix.build }}" = "opt" ]; then
export FFLAGS=""
export OMP_NUM_THREADS=2
else
echo "Unknown build type: ${{ matrix.build }}"
exit 1
fi
elif [ "${{ matrix.toolchain.compiler }}" = "lfortran" ]; then
if [ "${{ matrix.build }}" = "debug" ]; then
export FFLAGS=""
export OMP_NUM_THREADS=1
elif [ "${{ matrix.build }}" = "opt" ]; then
export FFLAGS="--fast --openmp"
export OMP_NUM_THREADS=2
else
echo "Unknown build type: ${{ matrix.build }}"
exit 1
fi
else
echo "Unknown compiler: ${{ matrix.toolchain.compiler }}"
exit 1
fi
echo "FFLAGS: $FFLAGS"
echo "OMP_NUM_THREADS: $OMP_NUM_THREADS"
cd ${CLAW}/geoclaw
pytest --basetemp=./test_output

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test_results
path: ${{ env.CLAW }}/geoclaw/*_output
if-no-files-found: ignore
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ xamr
xgeoclaw
xgeoclaw.dSYM
*.html
_output/
_plots/
*_output/
*_plots/
*~
# Topography
*.asc
*.tt3
*.tt1
*.tt*
*.topotype*
*.xyz

# Scratch directory
scratch/*
!scratch/README.txt

# Other data files
*.nc

# log files
*.log

Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# This repository hosts the GeoClaw code.
# GeoClaw Package
The GeoClaw version of Clawpack provides a specialized version of
[Clawpack](https://www.clawpack.org) for various geophysical flow problems and
includes adaptive mesh refinement (AMR) based on
[AMRClaw](https://www.clawpack.org/amrclaw.html).

See the main [clawpack/clawpack repository](https://github.com/clawpack/clawpack)
README for more links.
README for more links.

See the [Documentation](https://www.clawpack.org/)
for more details and installation instructions.


**Links**
- [Documentation for GeoClaw](https://www.clawpack.org/geoclaw.html)
- [More description of GeoClaw and references](http://www.geoclaw.org)
- [![Tests](https://github.com/clawpack/geoclaw/actions/workflows/testing.yml/badge.svg)](https://github.com/clawpack/geoclaw/actions/workflows/testing.yml)
- [Documentation](https://www.clawpack.org/geoclaw.html)
- [GeoClaw Web Site](https://www.geoclaw.org)
- ![Tests](https://github.com/clawpack/geoclaw/actions/workflows/testing.yml/badge.svg)
14 changes: 7 additions & 7 deletions examples/1d_classic/shoaling_qinit_box/setplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,26 @@ def add_annotations(current_data):
title('')
ylabel('meters', fontsize=14)
if current_data.frameno == 0:
text(-95,-0.4,'$\longrightarrow$',fontsize=20)
text(-95,-0.4,r'$\longrightarrow$',fontsize=20)
text(-95,-0.6,'Incident')
h = current_data.q[0,:]
mx2 = int(round(len(h)/2.))
etamax2 = (h[:mx2] - hl).max()
print('mx2 = %i, etamax2 = %g' % (mx2,etamax2))
if (current_data.frameno == 5) and (etamax2 > 0.1):
text(-190,-0.5,'$\longleftarrow$',fontsize=20)
text(-190,-0.5,r'$\longleftarrow$',fontsize=20)
text(-190,-0.7,'Reflected')
text(30,-0.5,'$\longrightarrow$',fontsize=20)
text(30,-0.5,r'$\longrightarrow$',fontsize=20)
text(15,-0.7,'Transmitted')
if (current_data.frameno == 6) and (etamax2 > 0.1):
text(-260,-0.5,'$\longleftarrow$',fontsize=20)
text(-260,-0.5,r'$\longleftarrow$',fontsize=20)
text(-260,-0.7,'Reflected')
text(40,-0.5,'$\longrightarrow$',fontsize=20)
text(40,-0.5,r'$\longrightarrow$',fontsize=20)
text(25,-0.7,'Transmitted')
elif (current_data.frameno == 6):
text(-20,-0.5,'$\longleftarrow$',fontsize=20)
text(-20,-0.5,r'$\longleftarrow$',fontsize=20)
text(-20,-0.7,'Reflected')
text(70,-0.5,'$\longrightarrow$',fontsize=20)
text(70,-0.5,r'$\longrightarrow$',fontsize=20)
text(65,-0.7,'Transmitted')


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def save_figure(fname):
plot(xgrid,0*zgrid,'b')
ylim(-3500,300)
#title('Bathymetry')
xticks([-xs,0,xs],['$-\epsilon$','0','$\epsilon$'])
xticks([-xs,0,xs],[r'$-\epsilon$','0',r'$\epsilon$'])
xlim(xlimits)
ylabel('meters')

Expand All @@ -71,8 +71,8 @@ def save_figure(fname):
if t==0:
title('t = 0')
else:
title('t = %4.3f$ \epsilon$' % txs)
xticks([-xs,0,xs],['$-\epsilon$','0','$\epsilon$'])
title(r't = %4.3f$ \epsilon$' % txs)
xticks([-xs,0,xs],[r'$-\epsilon$','0',r'$\epsilon$'])

hl = 3200.
hr = 200.
Expand Down
2 changes: 1 addition & 1 deletion examples/1d_classic/shoaling_qinit_step/setplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def add_annotation(current_data):
ylabel('meters', fontsize=14)

if current_data.frameno == 0:
text(-80,-0.4,'$\longrightarrow$',fontsize=20)
text(-80,-0.4,r'$\longrightarrow$',fontsize=20)
text(-80,-0.6,'Incident')
h = current_data.q[0,:]
mx2 = int(round(len(h)/2.))
Expand Down
2 changes: 2 additions & 0 deletions examples/bowl-slosh-netcdf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bowl.nc
netcdf_test
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ PLOTDIR = _plots # Directory for plots
# Environment variable FC should be set to fortran compiler, e.g. gfortran

# Compiler flags can be specified here or set as an environment variable
FFLAGS += -DNETCDF -lnetcdf -I$(NETCDF4_DIR)/include -L$(NETCDF4_DIR)/lib
LFLAGS += $(FFLAGS) -lnetcdff
FFLAGS += -DNETCDF -I$(NETCDF4_DIR)/include -L$(NETCDF4_DIR)/lib
LFLAGS += -I$(NETCDF4_DIR)/include -L$(NETCDF4_DIR)/lib -lnetcdff


# ---------------------------------
Expand Down Expand Up @@ -60,7 +60,7 @@ SOURCES = \
include $(CLAWMAKE)

# Construct the topography data
.PHONY: topo all
.PHONY: topo all netcdf_test netcdf_clean netcdf_clobber
topo:
$(CLAW_PYTHON) maketopo.py

Expand All @@ -69,3 +69,18 @@ all:
$(MAKE) .plots
$(MAKE) .htmls

netcdf_test: netcdf_test.f90
$(FC) netcdf_test.f90 $(FFLAGS) $(LFLAGS) -o netcdf_test

netcdf_clobber:
-rm -f netcdf_test.o

netcdf_clean:
-rm -f netcdf_test

# Requires :: syntax in Makefile.common to work
# clobber::
# -rm -f netcdf_test.o

# clean::
# -rm -f netcdf_test
Loading
Loading