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

Feature/update upstream #38

Merged
merged 55 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0607026
change nodata_value to -99999 in topotools
rjleveque Apr 14, 2024
803816a
Merge pull request #599 from rjleveque/topo99999
mandli Apr 14, 2024
481b2b9
Fix bug related to tracking pressure at gauges
mandli Apr 19, 2024
ec7682d
Merge pull request #600 from mandli/rm-pressure-gauge-adjustment
rjleveque Apr 21, 2024
d87ca99
simplify make_fgout_animation.py use of update_artists
rjleveque Apr 26, 2024
e01df84
use image backend Agg in make_fgout_animation.py so animation size ag…
rjleveque Apr 26, 2024
5c6ea17
set blit=False and auto-detect number of fgout frames
rjleveque Apr 27, 2024
5b17562
clean up make_fgout_animation.py
rjleveque Apr 27, 2024
7917432
added new chile2010_fgmax-fgout/make_fgout_animation_with_transect.py
rjleveque Apr 27, 2024
19ba0ff
Add dZ_format parameter to DTopography.write function
rjleveque Apr 27, 2024
9c8ac0d
Merge pull request #602 from rjleveque/chile2010_fgout_animation
mandli Apr 30, 2024
183d913
Merge pull request #603 from rjleveque/dtopo_dZ_format
mandli Apr 30, 2024
dc82bc0
handle 0 radius
bolliger32 May 1, 2024
556e182
fix type on set_pressure
bolliger32 May 1, 2024
4dce9de
fix duplicate r
bolliger32 May 1, 2024
5cd4424
make comparison fp-safe
bolliger32 May 3, 2024
d683a20
handle underflow
bolliger32 May 4, 2024
843a0e8
avoid underflow in wind setting too
bolliger32 May 7, 2024
8b6bc84
point to riemann/src for Riemann solvers
rjleveque May 8, 2024
4148a02
Remove Riemann solvers from src/2d/bouss, Makefile.common points to r…
rjleveque May 8, 2024
2ef5b58
Merge pull request #604 from ClimateImpactLab/bugfix/zero-radius
mandli May 8, 2024
924237b
Initial CI GitHub action script
mandli May 10, 2024
08cfa95
Update testing.yml
mandli May 10, 2024
322831e
Add checking out of clawpack and geoclaw
mandli May 10, 2024
56fa638
Add lint and testing to CI
mandli May 10, 2024
2181d25
Disable linting for the time being
mandli May 10, 2024
cf0f3c9
Re-enable linting but only for geoclaw
mandli May 10, 2024
80e0804
Exclude old_topotools.py
mandli May 10, 2024
1bd6508
Fix up gauge plotting for storm surge
mandli May 22, 2024
c678e33
Add dry gauge plotting
mandli May 22, 2024
51c0d27
create gauge filenames that allow more than 5 digits in gauge number
rjleveque May 30, 2024
794e751
cleaner way to zero pad only if fewer than 5 digits using I0.5 format
rjleveque May 30, 2024
b975fef
Merge pull request #615 from rjleveque/gauge_filenames
mandli May 30, 2024
fb77742
Merge pull request #612 from mandli/update-surge-gauge-plot
mandli May 30, 2024
aabfe24
Cleanup and reimplement reading of ATCF and writing of GeoClaw storms
mandli May 30, 2024
e2dde74
Minor string comparison bug fix
mandli May 30, 2024
4579554
Extract name of storm from file name
mandli May 30, 2024
9a7be84
Merge pull request #607 from rjleveque/bouss_rp
rjleveque May 31, 2024
860ba23
Minor tweaks and fixes
mandli Jun 3, 2024
37d24dc
Fix missing comma
mandli Jun 3, 2024
a716f4c
AutoPEP8 surge code
mandli Jun 3, 2024
ff1ce7c
add fgout output_style parameter and support for array of output_times
rjleveque Jun 5, 2024
564cbbc
remove trailing whitespaces in fgout_module.f990
rjleveque Jun 5, 2024
bcc4288
Refactor fgout_module.f90 so it works for either GeoClaw or D-Claw
rjleveque Jun 6, 2024
3d3db46
Use geoclaw module rho
mandli Jun 6, 2024
f2a1c93
Remove module level parameters that were not needed or were specific
mandli Jun 6, 2024
12f4233
Initial implementation of rotation control
mandli Jun 6, 2024
8179cb4
Merge branch 'improve-storm-io' into add-hemisphere-control
mandli Jun 6, 2024
c122f6a
Minor bugfixes and rearranging
mandli Jun 6, 2024
e7b24e5
Fix bugs in the non-spherical coordinates for storms"
mandli Jun 7, 2024
8636c04
Merge pull request #616 from mandli/improve-storm-io
mandli Jun 10, 2024
1f8fe48
Merge pull request #617 from rjleveque/fgout_tarray
rjleveque Jun 11, 2024
5fa6561
fix fgout_tools.FGoutGrid.read_fgout_grids_data for time array
rjleveque Jun 19, 2024
0386136
Merge pull request #621 from rjleveque/fgout_tarray_read
rjleveque Jul 1, 2024
71087c0
Merge branch 'master' of github.com:clawpack/geoclaw into feature/upd…
bolliger32 Jul 9, 2024
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
7 changes: 1 addition & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ jobs:
- name: Setup geoclaw
run: |
cd geoclaw
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git fetch origin pull/${{ github.event.pull_request.number }}/merge:PR
git checkout PR
else
git checkout ${{ github.ref_name }}
fi
git checkout ${{ github.ref }}
- name: Lint with flake8
run: |
cd geoclaw
Expand Down
43 changes: 14 additions & 29 deletions examples/storm-surge/ike/setplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,38 +155,23 @@ def friction_after_axes(cd):
plotfigure.show = True
plotfigure.clf_each_gauge = True

# Set up for axes in this figure:
plotaxes = plotfigure.new_plotaxes()
plotaxes.xlimits = [-2, 1]
# plotaxes.xlabel = "Days from landfall"
# plotaxes.ylabel = "Surface (m)"
plotaxes.ylimits = [-1, 5]
plotaxes.title = 'Surface'

def gauge_afteraxes(cd):

axes = plt.gca()
surgeplot.plot_landfall_gauge(cd.gaugesoln, axes)

# Fix up plot - in particular fix time labels
axes.set_title('Station %s' % cd.gaugeno)
axes.set_xlabel('Days relative to landfall')
axes.set_ylabel('Surface (m)')
axes.set_xlim([-2, 1])
axes.set_ylim([-1, 5])
axes.set_xticks([-2, -1, 0, 1])
axes.set_xticklabels([r"$-2$", r"$-1$", r"$0$", r"$1$"])
axes.grid(True)
plotaxes.afteraxes = gauge_afteraxes

# Plot surface as blue curve:
plotaxes.time_scale = 1 / (24 * 60**2)
plotaxes.grid = True
plotaxes.xlimits = 'auto'
plotaxes.ylimits = 'auto'
plotaxes.title = "Surface"
plotaxes.ylabel = "Surface (m)"
plotaxes.time_label = "Days relative to landfall"

plotitem = plotaxes.new_plotitem(plot_type='1d_plot')
# plotitem.plot_var = 3
# plotitem.plotstyle = 'b-'

#
plotitem.plot_var = surgeplot.gauge_surface
# Plot red area if gauge is dry
plotitem = plotaxes.new_plotitem(plot_type='1d_plot')
plotitem.plot_var = surgeplot.gauge_dry_regions
plotitem.kwargs = {"color":'lightcoral', "linewidth":5}

# Gauge Location Plot
#
def gauge_location_afteraxes(cd):
plt.subplots_adjust(left=0.12, bottom=0.06, right=0.97, top=0.97)
surge_afteraxes(cd)
Expand Down
116 changes: 78 additions & 38 deletions examples/storm-surge/isaac/setplot.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@

from __future__ import absolute_import
from __future__ import print_function
#!/usr/bin/env python

import os
import warnings
import datetime

import numpy
import numpy as np
import matplotlib.pyplot as plt
import datetime

import clawpack.visclaw.colormaps as colormap
import clawpack.visclaw.gaugetools as gaugetools
import clawpack.clawutil.data as clawutil
import clawpack.amrclaw.data as amrclaw
import clawpack.geoclaw.data as geodata


import clawpack.geoclaw.util as geoutil
import clawpack.geoclaw.surge.plot as surgeplot

try:
Expand Down Expand Up @@ -88,9 +86,9 @@ def friction_after_axes(cd):
regions = {"Gulf": {"xlimits": (clawdata.lower[0], clawdata.upper[0]),
"ylimits": (clawdata.lower[1], clawdata.upper[1]),
"figsize": (6.4, 4.8)},
"Louisiana": {"xlimits": (-92, -83),
"ylimits": (27.5, 30.5),
"figsize": (8, 2.7)}}
"Louisiana": {"xlimits": (-92, -83),
"ylimits": (27.5, 30.5),
"figsize": (8, 2.7)}}

for (name, region_dict) in regions.items():

Expand Down Expand Up @@ -175,40 +173,82 @@ def friction_after_axes(cd):
# ========================================================================
# Figures for gauges
# ========================================================================
def plot_observed(current_data):
"""Fetch and plot gauge data for gauges used."""

# Map GeoClaw gauge number to NOAA gauge number and location/name
gauge_mapping = {1: [8761724, "Grand Isle, LA"],
2: [8760922, 'Pilots Station East, SW Pass, LA']}

station_id, station_name = gauge_mapping[current_data.gaugesoln.id]
landfall_time = np.datetime64(datetime.datetime(2012, 8, 29, 0))
begin_date = datetime.datetime(2012, 8, 27)
end_date = datetime.datetime(2012, 8, 31)

# Fetch data if needed
date_time, water_level, tide = geoutil.fetch_noaa_tide_data(station_id,
begin_date,
end_date)
if water_level is None:
print("*** Could not fetch gauge {}.".format(station_id))
else:
# Convert to seconds relative to landfall
t = (date_time - landfall_time) / np.timedelta64(1, 's')
t /= (24 * 60**2)

# Detide
water_level -= tide

# Plot data
ax = plt.gca()
ax.plot(t, water_level, color='lightgray', marker='x')
ax.set_title(station_name)
ax.legend(['Computed', "Observed"])


plotfigure = plotdata.new_plotfigure(name='Gauge Surfaces', figno=300,
type='each_gauge')
plotfigure.show = True
plotfigure.clf_each_gauge = True

# Set up for axes in this figure:
plotaxes = plotfigure.new_plotaxes()
plotaxes.xlimits = [-2, 1]
# plotaxes.xlabel = "Days from landfall"
# plotaxes.ylabel = "Surface (m)"
plotaxes.ylimits = [-1, 5]
plotaxes.title = 'Surface'

def gauge_afteraxes(cd):

axes = plt.gca()
landfall = 0.
surgeplot.plot_landfall_gauge(cd.gaugesoln, axes, landfall=landfall)

# Fix up plot - in particular fix time labels
axes.set_title('Station %s' % cd.gaugeno)
axes.set_xlabel('Days relative to landfall')
axes.set_ylabel('Surface (m)')
axes.set_xlim([-2, 1])
axes.set_ylim([-1, 5])
axes.set_xticks([-2, -1, 0, 1])
axes.set_xticklabels([r"$-2$", r"$-1$", r"$0$", r"$1$"])
axes.grid(True)
plotaxes.afteraxes = gauge_afteraxes

# Plot surface as blue curve:
plotaxes.time_scale = 1 / (24 * 60**2)
plotaxes.grid = True
plotaxes.xlimits = [-2, 1.5]
plotaxes.ylimits = [-0.25, 1]
plotaxes.title = "Surface"
plotaxes.ylabel = "Surface (m)"
plotaxes.time_label = "Days relative to landfall"
plotaxes.afteraxes = plot_observed

plotitem = plotaxes.new_plotitem(plot_type='1d_plot')
plotitem.plot_var = surgeplot.gauge_surface
# Plot red area if gauge is dry
plotitem = plotaxes.new_plotitem(plot_type='1d_plot')
plotitem.plot_var = 3
plotitem.plotstyle = 'b-'
plotitem.plot_var = surgeplot.gauge_dry_regions
plotitem.kwargs = {"color":'lightcoral', "linewidth":5}

# Gauge Location Plot
def gauge_location_afteraxes(cd):
plt.subplots_adjust(left=0.12, bottom=0.06, right=0.97, top=0.97)
surge_afteraxes(cd)
gaugetools.plot_gauge_locations(cd.plotdata, gaugenos='all',
format_string='ko', add_labels=True)

plotfigure = plotdata.new_plotfigure(name="Gauge Locations")
plotfigure.show = True

# Set up for axes in this figure:
plotaxes = plotfigure.new_plotaxes()
plotaxes.title = 'Gauge Locations'
plotaxes.scaled = True
plotaxes.xlimits = regions['Louisiana']['xlimits']
plotaxes.ylimits = regions['Louisiana']['ylimits']
plotaxes.afteraxes = gauge_location_afteraxes
surgeplot.add_surface_elevation(plotaxes, bounds=surface_limits)
surgeplot.add_land(plotaxes, bounds=[0.0, 20.0])
plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0] * 10
plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10

# -----------------------------------------
# Parameters used only when creating html and/or latex hardcopy
Expand All @@ -217,7 +257,7 @@ def gauge_afteraxes(cd):
plotdata.printfigs = True # print figures
plotdata.print_format = 'png' # file format
plotdata.print_framenos = 'all' # list of frames to print
plotdata.print_gaugenos = [1, 2, 3, 4] # list of gauges to print
plotdata.print_gaugenos = 'all' # list of gauges to print
plotdata.print_fignos = 'all' # list of figures to print
plotdata.html = True # create html files of plots?
plotdata.latex = True # create latex file of plots?
Expand Down
17 changes: 8 additions & 9 deletions examples/storm-surge/isaac/setrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,16 @@ def setrun(claw_pkg='geoclaw'):
regions = rundata.regiondata.regions
# to specify regions of refinement append lines of the form
# [minlevel,maxlevel,t1,t2,x1,x2,y1,y2]
# Gauges from Ike AWR paper (2011 Dawson et al)
rundata.gaugedata.gauges.append([1, -95.04, 29.07,
rundata.clawdata.t0,
rundata.clawdata.tfinal])
rundata.gaugedata.gauges.append([2, -94.71, 29.28,
rundata.clawdata.t0,
rundata.clawdata.tfinal])
rundata.gaugedata.gauges.append([3, -94.39, 29.49,

# Pilots Station East, S.W. Pass, LA - 28°55.9429'N, 89°24.4445'W
# https://tidesandcurrents.noaa.gov/stationhome.html?id=8760922
rundata.gaugedata.gauges.append([1, -89.40740833, 28.93238167,
rundata.clawdata.t0,
rundata.clawdata.tfinal])
rundata.gaugedata.gauges.append([4, -94.13, 29.58,

# Grand Isle, LA - 29°15.8761'N 89°57.4960'W
# https://tidesandcurrents.noaa.gov/stationhome.html?id=8761724
rundata.gaugedata.gauges.append([2, -89.95826667, 29.26460167,
rundata.clawdata.t0,
rundata.clawdata.tfinal])

Expand Down
6 changes: 3 additions & 3 deletions src/2d/bouss/Makefile.bouss
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,6 @@ COMMON_SOURCES += \
$(BOUSSLIB)/resetBoussStuff.f \
$(BOUSSLIB)/simpleBound.f90 \
$(BOUSSLIB)/umfpack_support.f \
$(BOUSSLIB)/rpn2_geoclaw.f \
$(BOUSSLIB)/rpt2_geoclaw_sym.f \
$(BOUSSLIB)/geoclaw_riemann_utils.f \
$(CLAW)/riemann/src/rpn2_geoclaw.f \
$(CLAW)/riemann/src/rpt2_geoclaw.f \
$(CLAW)/riemann/src/geoclaw_riemann_utils.f \
Loading
Loading