diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 00000000..216ac662 --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,56 @@ +# name: Storm surge examples testing + +# on: +# push: +# branches: [ "master" ] +# pull_request: +# branches: [ "master" ] + +# permissions: +# contents: read + +# jobs: +# build: + +# runs-on: ubuntu-latest + +# steps: +# - name: Set up Python 3.10 +# uses: actions/setup-python@v5 +# with: +# python-version: "3.10" +# - name: Checkout clawpack +# uses: actions/checkout@v4.1.5 +# with: +# repository: clawpack/clawpack +# - name: Install dependencies +# run: | +# sudo apt-get update +# sudo apt-get install gfortran liblapack-pic liblapack-dev libnetcdf-dev libnetcdff-dev +# python -m pip install --upgrade pip +# pip install flake8 pytest +# - name: Setup clawpack super repository +# run: | +# git submodule init +# git submodule update +# pip install --user -e . +# - name: Checkout surge-examples +# uses: actions/checkout@v4.1.5 +# with: +# repository: mandli/surge-examples +# - name: Checkout branch +# run: | +# cd surge-examples +# git checkout ${{ github.ref }} +# cd .. +# - name: Lint with flake8 +# run: | +# cd surge-examples +# # stop the build if there are Python syntax errors or undefined names +# 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 diff --git a/README.md b/README.md index 6b33f81b..9d492693 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ Storm Surge Examples for GeoClaw ================================ -Storm surge simulation examples for GeoClaw. Most examples need bathymetry +[![Storm surge examples testing](https://github.com/mandli/surge-examples/actions/workflows/testing.yml/badge.svg)](https://github.com/mandli/surge-examples/actions/workflows/testing.yml) + +Storm surge simulation examples for GeoClaw. Most examples need topography files that unfortunately cannot all be hosted easily currently. Please contact -Kyle Mandli (kyle.mandli@columbia.edu) if you would like the bathymetry and any +Kyle Mandli (owner of the repository) if you would like the topography and any other data associated with these simulations. + diff --git a/World_Simulation/setplot.py b/World_Simulation/setplot.py index 217b4d19..6bb7763d 100644 --- a/World_Simulation/setplot.py +++ b/World_Simulation/setplot.py @@ -181,14 +181,7 @@ def gauge_afteraxes(cd): axes.set_xticks([0, 1, 2, 3, 4, 5, 6, 7, 8]) axes.set_xticklabels([r"$0$",r"$1$",r"$2$", r"$3$", r"$4$", r"$5$", r"$6$", r"$7$", r"$8$"]) axes.grid(True) - - - try: - gauge_data=gauges[cd.gaugeno-1] - axes.plot(gauge_data[:,0], gauge_data[:,1], label=data_names[cd.gaugeno-1]) - axes.legend() - except: - print('Gauge Data Unavailable') + plotaxes.afteraxes = gauge_afteraxes diff --git a/barry/README.md b/barry/README.md deleted file mode 100644 index b8f8d7a0..00000000 --- a/barry/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Example of Storm Surge - Hurricane Barry - -This example provides the data and Python code to run a simulation of Hurricane Barry along the coast of Louisiana. On July 13, 2019, Barry made landfall on Marsh Island and second landfall in Intracoastal City, Louisiana, both times as a Category 1 hurricane. - -Executing `$ make all` will compile the Fortran code, run the simulation, and plot the results. - -## Topography Data - -Download `NetCDF` topography data from NOAA at: https://www.ncei.noaa.gov/metadata/geoportal/rest/metadata/item/gov.noaa.ngdc.mgg.dem:728/html - -## Storm Data - -Storm data is automatically downloaded from the NOAA atcf archive at: https://ftp.nhc.noaa.gov/atcf/archive/2019/bal022019.dat.gz - -## Gauges - -Gauges 1-5 in the example correspond to 5 NOAA gauges along the US South Coast in Louisiana. The `fetch_noaa_tide_data()` method is used to compare the simulated gauge data to real data in setplot.py. - - -```python - -``` diff --git a/barry/setplot.py b/barry/setplot.py deleted file mode 100644 index 4dd2c807..00000000 --- a/barry/setplot.py +++ /dev/null @@ -1,361 +0,0 @@ - -from __future__ import absolute_import -from __future__ import print_function - -import os - -import numpy -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 util - -import clawpack.geoclaw.surge.plot as surgeplot - -try: - from setplotfg import setplotfg -except: - setplotfg = None - - -def setplot(plotdata=None): - """""" - - if plotdata is None: - from clawpack.visclaw.data import ClawPlotData - plotdata = ClawPlotData() - - # clear any old figures,axes,items data - plotdata.clearfigures() - plotdata.format = 'ascii' - - # Load data from output - clawdata = clawutil.ClawInputData(2) - clawdata.read(os.path.join(plotdata.outdir, 'claw.data')) - physics = geodata.GeoClawData() - physics.read(os.path.join(plotdata.outdir, 'geoclaw.data')) - surge_data = geodata.SurgeData() - surge_data.read(os.path.join(plotdata.outdir, 'surge.data')) - friction_data = geodata.FrictionData() - friction_data.read(os.path.join(plotdata.outdir, 'friction.data')) - - # Load storm track - track = surgeplot.track_data(os.path.join(plotdata.outdir, 'fort.track')) - - # Set afteraxes function - def surge_afteraxes(cd): - surgeplot.surge_afteraxes(cd, track, plot_direction=False, - kwargs={"markersize": 4}) - - # Color limits - - surface_limits = [-4.0, 4.0] - speed_limits = [0.0, 3.0] - wind_limits = [0, 64] - pressure_limits = [935, 1013] - friction_bounds = [0.01, 0.04] - ''' - surface_limits = [-2.0, 2.0] - speed_limits = [0.0, 3.0] - wind_limits = [0, 70] - pressure_limits = [990, 1010] - friction_bounds = [0.01, 0.04] - ''' - - def friction_after_axes(cd): - plt.title(r"Manning's $n$ Coefficient") - - # ========================================================================== - # Plot specifications - # ========================================================================== - # surface region - regions = {"Gulf": {"xlimits": (clawdata.lower[0], clawdata.upper[0]), - "ylimits": (clawdata.lower[1], clawdata.upper[1]), - "figsize": (6.4, 3.2)}, - "LaTex Shelf": {"xlimits": (-94.5, -86), - "ylimits": (27, 32), - "figsize": (10, 5)}} - - - for (name, region_dict) in regions.items(): - - # Surface Figure - plotfigure = plotdata.new_plotfigure(name="Surface - %s" % name) - plotfigure.kwargs = {"figsize": region_dict['figsize']} - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = "Surface" - plotaxes.xlimits = region_dict["xlimits"] - plotaxes.ylimits = region_dict["ylimits"] - plotaxes.afteraxes = surge_afteraxes - - surgeplot.add_surface_elevation(plotaxes, bounds=surface_limits) - surgeplot.add_land(plotaxes) - plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0] * 10 - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - # Speed Figure - plotfigure = plotdata.new_plotfigure(name="Currents - %s" % name) - plotfigure.kwargs = {"figsize": region_dict['figsize']} - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = "Currents" - plotaxes.xlimits = region_dict["xlimits"] - plotaxes.ylimits = region_dict["ylimits"] - plotaxes.afteraxes = surge_afteraxes - - surgeplot.add_speed(plotaxes, bounds=speed_limits) - surgeplot.add_land(plotaxes) - plotaxes.plotitem_dict['speed'].amr_patchedges_show = [0] * 10 - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - # - # Friction field - # - plotfigure = plotdata.new_plotfigure(name='Friction') - plotfigure.show = friction_data.variable_friction and True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.xlimits = regions['Gulf']['xlimits'] - plotaxes.ylimits = regions['Gulf']['ylimits'] - # plotaxes.title = "Manning's N Coefficient" - plotaxes.afteraxes = friction_after_axes - plotaxes.scaled = True - - surgeplot.add_friction(plotaxes, bounds=friction_bounds, shrink=0.9) - plotaxes.plotitem_dict['friction'].amr_patchedges_show = [0] * 10 - plotaxes.plotitem_dict['friction'].colorbar_label = "$n$" - - # - # Hurricane Forcing fields - # - # Pressure field - plotfigure = plotdata.new_plotfigure(name='Pressure') - plotfigure.show = surge_data.pressure_forcing and True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.xlimits = regions['Gulf']['xlimits'] - plotaxes.ylimits = regions['Gulf']['ylimits'] - plotaxes.title = "Pressure Field" - plotaxes.afteraxes = surge_afteraxes - plotaxes.scaled = True - surgeplot.add_pressure(plotaxes, bounds=pressure_limits) - surgeplot.add_land(plotaxes) - - # Wind field - plotfigure = plotdata.new_plotfigure(name='Wind Speed') - plotfigure.show = surge_data.wind_forcing and True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.xlimits = regions['Gulf']['xlimits'] - plotaxes.ylimits = regions['Gulf']['ylimits'] - plotaxes.title = "Wind Field" - plotaxes.afteraxes = surge_afteraxes - plotaxes.scaled = True - surgeplot.add_wind(plotaxes, bounds=wind_limits) - surgeplot.add_land(plotaxes) - plotaxes.plotitem_dict['wind'].amr_patchedges_show = [0] * 10 # added - - # ======================================================================== - # Figures for gauges - # ======================================================================== - 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.0, 2.5] - plotaxes.title = 'Surface' - - def gauge_afteraxes(cd): - axes = plt.gca() - surgeplot.plot_landfall_gauge(cd.gaugesoln, axes) - gauge_id = ['8770822', '8768094', '8764227', '8761305', '8760922'] - gauge_title = ['Texas Point, Sabine Pass, TX', - 'Calcasieu Pass, LA', - 'LAWMA, Amerada Pass, LA', - 'Shell Beach, LA', - 'Pilots Station East, S.W. Pass, LA'] - if (cd.gaugeno<6): - realData = util.fetch_noaa_tide_data(gauge_id[cd.gaugeno-1], - datetime.datetime(2019, 7, 10, hour=12), - datetime.datetime(2019, 7, 16, hour=12), - datum='MLLW') - values = realData[1]-realData[2] - times = [] - for time in realData[0]: - times.append((time-numpy.datetime64("2019-07-13T15:00")).astype(float)/1440) - plt.plot(times, values, color='orange', label='real') - - axes.set_title('Gauge %s: %s' % (cd.gaugeno, gauge_title[cd.gaugeno-1])) # i for i in gauge_title - axes.set_xlabel('Days relative to landfall') - axes.set_ylabel('Surface (m)') - axes.set_xlim([-2, 1]) - axes.set_ylim([-1.0, 2.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: - plotitem = plotaxes.new_plotitem(plot_type='1d_plot') - # plotitem.plot_var = 3 - # plotitem.plotstyle = 'b-' - - - - # - # Gauge Location Plot - # - - # All gauges - 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 Location") - plotfigure.show = True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Gauge Locations' - plotaxes.scaled = True - plotaxes.xlimits = [-95, -88.5] - plotaxes.ylimits = [28, 31] - plotaxes.afteraxes = gauge_location_afteraxes - surgeplot.add_surface_elevation(plotaxes, bounds=surface_limits) - surgeplot.add_land(plotaxes) - plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0] * 10 - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - # Gauge 01: Texas Point, Sabine Pass, TX [8770822] - def gauge_location_afteraxes1(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=[1], - format_string='ko', add_labels=True) - - plotfigure = plotdata.new_plotfigure(name="Gauge 01") - plotfigure.show = True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Gauge 01 Location' - plotaxes.scaled = True - plotaxes.xlimits = [-93.84-0.2, -93.84+0.2] - plotaxes.ylimits = [29.69-0.2, 29.69+0.2] - plotaxes.afteraxes = gauge_location_afteraxes1 - surgeplot.add_surface_elevation(plotaxes, bounds=surface_limits) - surgeplot.add_land(plotaxes) - plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0] * 10 - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - # Gauge 02: Calcasieu Pass, LA [8768094] - def gauge_location_afteraxes2(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=[2], - format_string='ko', add_labels=True) - - plotfigure = plotdata.new_plotfigure(name="Gauge 02") - plotfigure.show = True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Gauge 02 Location' - plotaxes.scaled = True - plotaxes.xlimits = [-93.34-0.2, -93.34+0.2] - plotaxes.ylimits = [29.77-0.2, 29.77+0.2] - plotaxes.afteraxes = gauge_location_afteraxes2 - surgeplot.add_surface_elevation(plotaxes, bounds=surface_limits) - surgeplot.add_land(plotaxes) - plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0] * 10 - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - # Gauge 03: LAWMA, Amerada Pass, LA [8764227] - def gauge_location_afteraxes3(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=[3], - format_string='ko', add_labels=True) - - plotfigure = plotdata.new_plotfigure(name="Gauge 03") - plotfigure.show = True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Gauge 03 Location' - plotaxes.scaled = True - plotaxes.xlimits = [-91.34-0.2, -91.34+0.2] - plotaxes.ylimits = [29.45-0.2, 29.45+0.2] - plotaxes.afteraxes = gauge_location_afteraxes3 - surgeplot.add_surface_elevation(plotaxes, bounds=surface_limits) - surgeplot.add_land(plotaxes) - plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0] * 10 - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - # Gauge 04: Shell Beach, LA [8761305] - def gauge_location_afteraxes4(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=[4], - format_string='ko', add_labels=True) - - plotfigure = plotdata.new_plotfigure(name="Gauge 04") - plotfigure.show = True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Gauge 04 Location' - plotaxes.scaled = True - plotaxes.xlimits = [-89.67-0.2, -89.67+0.2] - plotaxes.ylimits = [29.87-0.2, 29.87+0.2] - plotaxes.afteraxes = gauge_location_afteraxes4 - surgeplot.add_surface_elevation(plotaxes, bounds=surface_limits) - surgeplot.add_land(plotaxes) - plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0] * 10 - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - # Gauge 05: Pilots Station East, S.W. Pass, LA [8760922] - def gauge_location_afteraxes5(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=[5], - format_string='ko', add_labels=True) - - plotfigure = plotdata.new_plotfigure(name="Gauge 05") - plotfigure.show = True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Gauge 05 Location' - plotaxes.scaled = True - plotaxes.xlimits = [-89.41-0.2, -89.41+0.2] - plotaxes.ylimits = [28.93-0.2, 28.93+0.2] - plotaxes.afteraxes = gauge_location_afteraxes5 - surgeplot.add_surface_elevation(plotaxes, bounds=surface_limits) - surgeplot.add_land(plotaxes) - 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 - # e.g., via pyclaw.plotters.frametools.printframes: - - 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, 5] # 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? - plotdata.latex_figsperline = 2 # layout of plots - plotdata.latex_framesperline = 1 # layout of plots - plotdata.latex_makepdf = False # also run pdflatex? - plotdata.parallel = True # parallel plotting - - return plotdata diff --git a/barry/setrun.py b/barry/setrun.py deleted file mode 100644 index 91555dcb..00000000 --- a/barry/setrun.py +++ /dev/null @@ -1,487 +0,0 @@ -# encoding: utf-8 -""" -Module to set up run time parameters for Clawpack. - -The values set in the function setrun are then written out to data files -that will be read in by the Fortran code. - -""" - -from __future__ import absolute_import -from __future__ import print_function - -import os -import datetime -import shutil -import gzip - -import numpy as np - -from clawpack.geoclaw.surge.storm import Storm -import clawpack.clawutil as clawutil - - -# Time Conversions -def days2seconds(days): - return days * 60.0**2 * 24.0 - - -# Scratch directory for storing topo and dtopo files: -scratch_dir = os.path.join(os.environ["CLAW"], 'geoclaw', 'scratch') - - -# ------------------------------ -def setrun(claw_pkg='geoclaw'): - - """ - Define the parameters used for running Clawpack. - - INPUT: - claw_pkg expected to be "geoclaw" for this setrun. - - OUTPUT: - rundata - object of class ClawRunData - - """ - - from clawpack.clawutil import data - - assert claw_pkg.lower() == 'geoclaw', "Expected claw_pkg = 'geoclaw'" - - num_dim = 2 - rundata = data.ClawRunData(claw_pkg, num_dim) - - # ------------------------------------------------------------------ - # Standard Clawpack parameters to be written to claw.data: - # (or to amr2ez.data for AMR) - # ------------------------------------------------------------------ - clawdata = rundata.clawdata # initialized when rundata instantiated - - # Set single grid parameters first. - # See below for AMR parameters. - - # --------------- - # Spatial domain: - # --------------- - - # Number of space dimensions: - clawdata.num_dim = num_dim - - # Lower and upper edge of computational domain: - clawdata.lower[0] = -99.0 # west longitude - clawdata.upper[0] = -85.0 # east longitude (-70.0) (-80.0) - - clawdata.lower[1] = 24.0 # south latitude (8.0) (25.0) - clawdata.upper[1] = 32.0 # north latitude (32.0) (40.0) - - # Number of grid cells: - degree_factor = 4 # (0.25º,0.25º) ~ (25237.5 m, 27693.2 m) resolution - clawdata.num_cells[0] = int(clawdata.upper[0] - clawdata.lower[0]) \ - * degree_factor - clawdata.num_cells[1] = int(clawdata.upper[1] - clawdata.lower[1]) \ - * degree_factor - - # --------------- - # Size of system: - # --------------- - - # Number of equations in the system: - clawdata.num_eqn = 3 - - # Number of auxiliary variables in the aux array (initialized in setaux) - # First three are from shallow GeoClaw, fourth is friction and last 3 are - # storm fields - clawdata.num_aux = 3 + 1 + 3 - - # Index of aux array corresponding to capacity function, if there is one: - clawdata.capa_index = 2 - - # ------------- - # Initial time: - # ------------- - clawdata.t0 = -days2seconds(3) - - # Restart from checkpoint file of a previous run? - # If restarting, t0 above should be from original run, and the - # restart_file 'fort.chkNNNNN' specified below should be in - # the OUTDIR indicated in Makefile. - - clawdata.restart = False # True to restart from prior results - clawdata.restart_file = 'fort.chk00006' # File to use for restart data - - # ------------- - # Output times: - # -------------- - - # Specify at what times the results should be written to fort.q files. - # Note that the time integration stops after the final output time. - # The solution at initial time t0 is always written in addition. - - clawdata.output_style = 1 - - if clawdata.output_style == 1: - # Output nout frames at equally spaced times up to tfinal: - clawdata.tfinal = days2seconds(1) - recurrence = 24 - clawdata.num_output_times = int((clawdata.tfinal - clawdata.t0) * - recurrence / (60**2 * 24)) - - clawdata.output_t0 = True # output at initial (or restart) time? - - elif clawdata.output_style == 2: - # Specify a list of output times. - clawdata.output_times = [0.5, 1.0] - - elif clawdata.output_style == 3: - # Output every iout timesteps with a total of ntot time steps: - clawdata.output_step_interval = 1 - clawdata.total_steps = 1 - clawdata.output_t0 = True - - clawdata.output_format = 'ascii' # 'ascii' or 'binary' - clawdata.output_q_components = 'all' # could be list such as [True,True] - clawdata.output_aux_components = 'all' - clawdata.output_aux_onlyonce = False # output aux arrays only at t0 - - # --------------------------------------------------- - # Verbosity of messages to screen during integration: - # --------------------------------------------------- - - # The current t, dt, and cfl will be printed every time step - # at AMR levels <= verbosity. Set verbosity = 0 for no printing. - # (E.g. verbosity == 2 means print only on levels 1 and 2.) - clawdata.verbosity = 0 - - # -------------- - # Time stepping: - # -------------- - - # if dt_variable==1: variable time steps used based on cfl_desired, - # if dt_variable==0: fixed time steps dt = dt_initial will always be used. - clawdata.dt_variable = True - - # Initial time step for variable dt. - # If dt_variable==0 then dt=dt_initial for all steps: - clawdata.dt_initial = 0.016 - - # Max time step to be allowed if variable dt used: - clawdata.dt_max = 1e+99 - - # Desired Courant number if variable dt used, and max to allow without - # retaking step with a smaller dt: - clawdata.cfl_desired = 0.75 - clawdata.cfl_max = 1.0 - - # Maximum number of time steps to allow between output times: - clawdata.steps_max = 5000 - - # ------------------ - # Method to be used: - # ------------------ - - # Order of accuracy: 1 => Godunov, 2 => Lax-Wendroff plus limiters - clawdata.order = 1 - - # Use dimensional splitting? (not yet available for AMR) - clawdata.dimensional_split = 'unsplit' - - # For unsplit method, transverse_waves can be - # 0 or 'none' ==> donor cell (only normal solver used) - # 1 or 'increment' ==> corner transport of waves - # 2 or 'all' ==> corner transport of 2nd order corrections too - clawdata.transverse_waves = 1 - - # Number of waves in the Riemann solution: - clawdata.num_waves = 3 - - # List of limiters to use for each wave family: - # Required: len(limiter) == num_waves - # Some options: - # 0 or 'none' ==> no limiter (Lax-Wendroff) - # 1 or 'minmod' ==> minmod - # 2 or 'superbee' ==> superbee - # 3 or 'mc' ==> MC limiter - # 4 or 'vanleer' ==> van Leer - clawdata.limiter = ['mc', 'mc', 'mc'] - - clawdata.use_fwaves = True # True ==> use f-wave version of algorithms - - # Source terms splitting: - # src_split == 0 or 'none' - # ==> no source term (src routine never called) - # src_split == 1 or 'godunov' - # ==> Godunov (1st order) splitting used, - # src_split == 2 or 'strang' - # ==> Strang (2nd order) splitting used, not recommended. - clawdata.source_split = 'godunov' - - # -------------------- - # Boundary conditions: - # -------------------- - - # Number of ghost cells (usually 2) - clawdata.num_ghost = 2 - - # Choice of BCs at xlower and xupper: - # 0 => user specified (must modify bcN.f to use this option) - # 1 => extrapolation (non-reflecting outflow) - # 2 => periodic (must specify this at both boundaries) - # 3 => solid wall for systems where q(2) is normal velocity - - clawdata.bc_lower[0] = 'extrap' - clawdata.bc_upper[0] = 'extrap' - - clawdata.bc_lower[1] = 'extrap' - clawdata.bc_upper[1] = 'extrap' - - # Specify when checkpoint files should be created that can be - # used to restart a computation. - - clawdata.checkpt_style = 0 - - if clawdata.checkpt_style == 0: - # Do not checkpoint at all - pass - - elif np.abs(clawdata.checkpt_style) == 1: - # Checkpoint only at tfinal. - pass - - elif np.abs(clawdata.checkpt_style) == 2: - # Specify a list of checkpoint times. - clawdata.checkpt_times = [0.1, 0.15] - - elif np.abs(clawdata.checkpt_style) == 3: - # Checkpoint every checkpt_interval timesteps (on Level 1) - # and at the final time. - clawdata.checkpt_interval = 5 - - # --------------- - # AMR parameters: - # --------------- - amrdata = rundata.amrdata - - # max number of refinement levels: - amrdata.amr_levels_max = 5 - - # List of refinement ratios at each level (length at least mxnest-1) - amrdata.refinement_ratios_x = [2, 2, 4, 6, 16] - amrdata.refinement_ratios_y = [2, 2, 4, 6, 16] - amrdata.refinement_ratios_t = [2, 2, 4, 6, 16] - - # Specify type of each aux variable in amrdata.auxtype. - # This must be a list of length maux, each element of which is one of: - # 'center', 'capacity', 'xleft', or 'yleft' (see documentation). - - amrdata.aux_type = ['center', 'capacity', 'yleft', 'center', 'center', - 'center', 'center'] - - # Flag using refinement routine flag2refine rather than richardson error - amrdata.flag_richardson = False # use Richardson? - amrdata.flag2refine = True - - # steps to take on each level L between regriddings of level L+1: - amrdata.regrid_interval = 3 - - # width of buffer zone around flagged points: - # (typically the same as regrid_interval so waves don't escape): - amrdata.regrid_buffer_width = 2 - - # clustering alg. cutoff for (# flagged pts) / (total # of cells refined) - # (closer to 1.0 => more small grids may be needed to cover flagged cells) - amrdata.clustering_cutoff = 0.700000 - - # print info about each regridding up to this level: - amrdata.verbosity_regrid = 0 - - # ----- For developers ----- - # Toggle debugging print statements: - amrdata.dprint = False # print domain flags - amrdata.eprint = False # print err est flags - amrdata.edebug = False # even more err est flags - amrdata.gprint = False # grid bisection/clustering - amrdata.nprint = False # proper nesting output - amrdata.pprint = False # proj. of tagged points - amrdata.rprint = False # print regridding summary - amrdata.sprint = False # space/memory output - amrdata.tprint = False # time step reporting each level - amrdata.uprint = False # update/upbnd reporting - - # More AMR parameters can be set -- see the defaults in pyclaw/data.py - - # == setregions.data values == - regions = rundata.regiondata.regions - # to specify regions of refinement append lines of the form - # [minlevel,maxlevel,t1,t2,x1,x2,y1,y2] - - # Allow only level 1 as default everywhere - regions.append([1, 4, rundata.clawdata.t0, rundata.clawdata.tfinal, -180, 180, -90, 90]) - # force refinement around gauges at any time - regions.append([1, 4, rundata.clawdata.t0, rundata.clawdata.tfinal, -95, -88, 28, 30]) - - # force refinement around all gauges at any time - # Gauge 01: Texas Point, Sabine Pass, TX [8770822] - regions.append([5, 5, rundata.clawdata.t0, rundata.clawdata.tfinal, -93.84-0.2, -93.84+0.2, 29.69-0.2, 29.69+0.2]) - # Gauge 02: Calcasieu Pass, LA [8768094] - regions.append([5, 5, rundata.clawdata.t0, rundata.clawdata.tfinal, -93.34-0.2, -93.34+0.2, 29.77-0.2, 29.77+0.2]) - # Gauge 03: LAWMA, Amerada Pass, LA [8764227] - regions.append([5, 5, rundata.clawdata.t0, rundata.clawdata.tfinal, -91.34-0.2, -91.34+0.2, 29.45-0.2, 29.45+0.2]) - # Gauge 04: Shell Beach, LA [8761305] - regions.append([5, 5, rundata.clawdata.t0, rundata.clawdata.tfinal, -89.67-0.2, -89.67+0.2, 29.87-0.2, 29.87+0.2]) - # Gauge 05: Pilots Station East, S.W. Pass, LA [8760922] - regions.append([5, 5, rundata.clawdata.t0, rundata.clawdata.tfinal, -89.41-0.2, -89.41+0.2, 28.93-0.2, 28.93+0.2]) - - - # Texas Point, Sabine Pass, TX [8770822] - rundata.gaugedata.gauges.append([1, -93.84, 29.69, rundata.clawdata.t0, rundata.clawdata.tfinal]) - # Calcasieu Pass, LA [8768094] - rundata.gaugedata.gauges.append([2, -93.34, 29.77, rundata.clawdata.t0, rundata.clawdata.tfinal]) - # LAWMA, Amerada Pass, LA [8764227] - rundata.gaugedata.gauges.append([3, -91.34, 29.45, rundata.clawdata.t0, rundata.clawdata.tfinal]) - # Shell Beach, LA [8761305] - rundata.gaugedata.gauges.append([4, -89.67, 29.87, rundata.clawdata.t0, rundata.clawdata.tfinal]) - # Pilots Station East, S.W. Pass, LA [8760922] - rundata.gaugedata.gauges.append([5, -89.41, 28.93, rundata.clawdata.t0, rundata.clawdata.tfinal]) - - # Force the gauges to also record the wind and pressure fields - rundata.gaugedata.aux_out_fields = [4, 5, 6] - - # ------------------------------------------------------------------ - # GeoClaw specific parameters: - # ------------------------------------------------------------------ - rundata = setgeo(rundata) - - return rundata - # end of function setrun - # ---------------------- - - -# ------------------- -def setgeo(rundata): - """ - Set GeoClaw specific runtime parameters. - For documentation see .... - """ - - geo_data = rundata.geo_data - - # == Physics == - geo_data.gravity = 9.81 - geo_data.coordinate_system = 2 - geo_data.earth_radius = 6367.5e3 - geo_data.rho = 1025.0 - geo_data.rho_air = 1.15 - geo_data.ambient_pressure = 101.3e3 - - # == Forcing Options - geo_data.coriolis_forcing = True - geo_data.friction_forcing = True - geo_data.friction_depth = 1e10 - - # == Algorithm and Initial Conditions == - # Due to seasonal swelling of gulf we set sea level higher - geo_data.sea_level = 0.28 - geo_data.dry_tolerance = 1.e-2 - - # Refinement Criteria - refine_data = rundata.refinement_data - refine_data.wave_tolerance = 1.0 # 1.0 - refine_data.speed_tolerance = [1.0, 2.0, 3.0, 4.0] - refine_data.deep_depth = 300.0 - refine_data.max_level_deep = 4 - refine_data.variable_dt_refinement_ratios = True - - # == settopo.data values == - topo_data = rundata.topo_data - topo_data.topofiles = [] - # for topography, append lines of the form - # [topotype, minlevel, maxlevel, t1, t2, fname] - # See regions for control over these regions, need better bathy data for - # the smaller domains - clawutil.data.get_remote_file( - "http://www.columbia.edu/~ktm2132/bathy/gulf_caribbean.tt3.tar.bz2") - topo_path = os.path.join(scratch_dir, 'gulf_caribbean.tt3') - topo_data.topofiles.append([3, 1, 5, rundata.clawdata.t0, - rundata.clawdata.tfinal, - topo_path]) - - # == setfixedgrids.data values == - rundata.fixed_grid_data.fixedgrids = [] - # for fixed grids append lines of the form - # [t1,t2,noutput,x1,x2,y1,y2,xpoints,ypoints,\ - # ioutarrivaltimes,ioutsurfacemax] - - # ================ - # Set Surge Data - # ================ - data = rundata.surge_data - - # Source term controls - data.wind_forcing = True - data.drag_law = 1 - data.pressure_forcing = True - - data.display_landfall_time = True - - # AMR parameters, m/s and m respectively - data.wind_refine = [20.0, 40.0, 60.0] - data.R_refine = [60.0e3, 40e3, 20e3] - - # Storm parameters - Parameterized storm (Holland 1980) - data.storm_specification_type = 'holland80' # (type 1) - - data.storm_file = os.path.expandvars(os.path.join(os.getcwd(),'barry.storm')) - - # Convert ATCF data to GeoClaw format - clawutil.data.get_remote_file( - 'http://ftp.nhc.noaa.gov/atcf/archive/2019/bal022019.dat.gz') - atcf_path = os.path.join(scratch_dir, "bal022019.dat") - - # Note that the get_remote_file function does not support gzip files which - # are not also tar files. The following code handles this - with gzip.open(".".join((atcf_path, 'gz')), 'rb') as atcf_file, \ - open(atcf_path, 'w') as atcf_unzipped_file: - atcf_unzipped_file.write(atcf_file.read().decode('ascii')) - - barry = Storm(path=atcf_path, file_format="ATCF") - - # Calculate landfall time - Need to specify as the file above does not - # substitute storm name - barry.time_offset = datetime.datetime(2019, 7, 13, 15, 0) - - barry.write(data.storm_file, file_format='geoclaw') - - # ======================= - # Set Variable Friction - # ======================= - data = rundata.friction_data - - # Variable friction - data.variable_friction = True - - # Region based friction - # Entire domain - data.friction_regions.append([rundata.clawdata.lower, - rundata.clawdata.upper, - [np.infty, 0.0, -np.infty], - [0.030, 0.022]]) - - # La-Tex Shelf - data.friction_regions.append([(-98, 25.25), (-90, 30), - [np.infty, -10.0, -200.0, -np.infty], - [0.030, 0.012, 0.022]]) - - return rundata - # end of function setgeo - # ---------------------- - - -if __name__ == '__main__': - # Set up run-time parameters and write all data files. - import sys - if len(sys.argv) == 2: - rundata = setrun(sys.argv[1]) - else: - rundata = setrun() - - rundata.write() diff --git a/Frederic/Makefile b/barry_2019/Makefile similarity index 100% rename from Frederic/Makefile rename to barry_2019/Makefile diff --git a/barry_update/README.md b/barry_2019/README.md similarity index 100% rename from barry_update/README.md rename to barry_2019/README.md diff --git a/barry_update/setplot.py b/barry_2019/setplot.py similarity index 100% rename from barry_update/setplot.py rename to barry_2019/setplot.py diff --git a/barry_update/setrun.py b/barry_2019/setrun.py similarity index 100% rename from barry_update/setrun.py rename to barry_2019/setrun.py diff --git a/bathy/get_bathy.py b/bathy/get_bathy.py deleted file mode 100755 index 13a6719a..00000000 --- a/bathy/get_bathy.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python - -"""Fetch relevant bathymetry for the storm surge examples""" - -import sys -import os - -import matplotlib.pyplot as plt - -import clawpack.clawutil.data as data -import clawpack.geoclaw.topotools as topotools - -# These are the URLs to the topography needed to run each storm -topo_urls = {"sandy": ["https://www.dropbox.com/s/jkww7jm78azswk5/atlantic_1min.tt3.tar.bz2?dl=0", - "https://www.dropbox.com/s/vafi7k6zqn5cfs1/newyork_3s.tt3.tar.bz2?dl=0"], - "irene": ["https://www.dropbox.com/s/jkww7jm78azswk5/atlantic_1min.tt3.tar.bz2?dl=0", - "https://www.dropbox.com/s/vafi7k6zqn5cfs1/newyork_3s.tt3.tar.bz2?dl=0"], - "isabel": ["https://www.dropbox.com/s/jkww7jm78azswk5/atlantic_1min.tt3.tar.bz2?dl=0", - "chesapeake.nc"], - "florence": ["https://www.dropbox.com/s/jkww7jm78azswk5/atlantic_1min.tt3.tar.bz2?dl=0"] - } - -# Etopo support -def form_etopo_URL(lower, upper, file_name="etopo1.nc", file_format="netcdf"): - - URL = "https://maps.ngdc.noaa.gov/mapviewer-support/wcs-proxy/wcs.groovy" - URL += "?filename=%s" % file_name - URL += "&request=getcoverage" - URL += "&version=1.0.0" - URL += "&service=wcs" - URL += "&coverage=etopo1" - URL += "&CRS=EPSG:4326" - URL += "&format=%s" % file_format - URL += "&resx=0.016666666666666667" - URL += "&resy=0.016666666666666667" - URL += "&bbox=%1.4f,%1.4f,%1.4f,%1.4f" % (lower[0], lower[1], - upper[0], upper[1]) - return URL - - -def plot_topo(path, stride=[1, 1], axes=None): - """""" - - if axes is None: - fig, axes = plt.subplots(1, 1) - - topo = topotools.Topography(path=path) - - - for i in range(len(strips)): - topo = topotools.Topography( - path=os.path.join(output_dir, "strip%s.nc" % i)) - topo.read(stride=stride) - topo.plot(axes=axes) - - return axes - - -if __name__ == "__main__": - - # Input: Storm names, location to download to, plot, verbose - # - # - # - - output_dir = os.getcwd() - force = False - verbose = False - - - # Override download location - if len(sys.argv) > 1: - storm_names = sys.argv[1:] - else: - # TODO: Add better failure - sys.exit() - - if name == "global_strip": - strips = [-45.0, -30.0, -15.0, 0.0, 15.0, 30.0] - for (i, lower_bound) in enumerate(strips): - file_name = "strip%s.nc" % i - urls.append(form_etopo_URL([-180, lower_bound], - [180, lower_bound + 15.0])) - # TODO specify file name - - storm_names.pop("global_strip") - - # Construct list of downloads - urls = [] - for name in storm_names: - urls.append(topo_urls[name]) - - for url in urls: - data.get_remote_file(url, output_dir=output_dir, verbose=verbose, force=force) diff --git a/Delta/Makefile b/delta_2020/Makefile similarity index 100% rename from Delta/Makefile rename to delta_2020/Makefile diff --git a/Delta/Readme.md b/delta_2020/README.md similarity index 100% rename from Delta/Readme.md rename to delta_2020/README.md diff --git a/Delta/setplot.py b/delta_2020/setplot.py similarity index 100% rename from Delta/setplot.py rename to delta_2020/setplot.py diff --git a/Delta/setrun.py b/delta_2020/setrun.py similarity index 99% rename from Delta/setrun.py rename to delta_2020/setrun.py index 621fbaf0..e2ad9fa1 100644 --- a/Delta/setrun.py +++ b/delta_2020/setrun.py @@ -443,7 +443,7 @@ def setgeo(rundata): # Convert ATCF data to GeoClaw format clawutil.data.get_remote_file("http://ftp.nhc.noaa.gov/atcf/archive/2020/bal262020.dat.gz") - atcf_path = os.path.join(data_dir, "bal262020.dat") + atcf_path = os.path.join(scratch_dir, "bal262020.dat") # Note that the get_remote_file function does not support gzip files which # are not also tar files. The following code handles this with gzip.open(".".join((atcf_path, 'gz')), 'rb') as atcf_file, \ diff --git a/dennis/Makefile b/dennis_2005/Makefile similarity index 100% rename from dennis/Makefile rename to dennis_2005/Makefile diff --git a/dennis/README.md b/dennis_2005/README.md similarity index 100% rename from dennis/README.md rename to dennis_2005/README.md diff --git a/dennis/setplot.py b/dennis_2005/setplot.py similarity index 100% rename from dennis/setplot.py rename to dennis_2005/setplot.py diff --git a/dennis/setrun.py b/dennis_2005/setrun.py similarity index 99% rename from dennis/setrun.py rename to dennis_2005/setrun.py index 4475a94c..43a28438 100755 --- a/dennis/setrun.py +++ b/dennis_2005/setrun.py @@ -399,7 +399,7 @@ def setgeo(rundata): topo_path = os.path.join(scratch_dir, 'gulf_caribbean.tt3') topo_data.topofiles.append([3, topo_path]) -clawutil.data.get_remote_file( + clawutil.data.get_remote_file( "https://www.jumbomail.me/l/en/gallery/6C697261515A333163756E464B3342347436653838673D3D/715049578") topo_path = os.path.join(scratch_dir, 'gulf_caribbean.tt3') topo_data.topofiles.append([3, topo_path]) diff --git a/dorian/Makefile b/dorian_2019/Makefile similarity index 100% rename from dorian/Makefile rename to dorian_2019/Makefile diff --git a/dorian/README.md b/dorian_2019/README.md similarity index 100% rename from dorian/README.md rename to dorian_2019/README.md diff --git a/dorian/setplot.py b/dorian_2019/setplot.py similarity index 100% rename from dorian/setplot.py rename to dorian_2019/setplot.py diff --git a/dorian/setrun.py b/dorian_2019/setrun.py similarity index 100% rename from dorian/setrun.py rename to dorian_2019/setrun.py diff --git a/elsa/Makefile b/elsa_2021/Makefile similarity index 100% rename from elsa/Makefile rename to elsa_2021/Makefile diff --git a/elsa/readme.md b/elsa_2021/README.md similarity index 100% rename from elsa/readme.md rename to elsa_2021/README.md diff --git a/elsa/images/station1_cedarkey.png b/elsa_2021/images/station1_cedarkey.png similarity index 100% rename from elsa/images/station1_cedarkey.png rename to elsa_2021/images/station1_cedarkey.png diff --git a/elsa/images/station2_clearwaterbeach.png b/elsa_2021/images/station2_clearwaterbeach.png similarity index 100% rename from elsa/images/station2_clearwaterbeach.png rename to elsa_2021/images/station2_clearwaterbeach.png diff --git a/elsa/images/station3_oldporttampa.png b/elsa_2021/images/station3_oldporttampa.png similarity index 100% rename from elsa/images/station3_oldporttampa.png rename to elsa_2021/images/station3_oldporttampa.png diff --git a/elsa/images/station4_portmanatee.png b/elsa_2021/images/station4_portmanatee.png similarity index 100% rename from elsa/images/station4_portmanatee.png rename to elsa_2021/images/station4_portmanatee.png diff --git a/elsa/images/station5_naples.png b/elsa_2021/images/station5_naples.png similarity index 100% rename from elsa/images/station5_naples.png rename to elsa_2021/images/station5_naples.png diff --git a/elsa/images/station6_keywest.png b/elsa_2021/images/station6_keywest.png similarity index 100% rename from elsa/images/station6_keywest.png rename to elsa_2021/images/station6_keywest.png diff --git a/elsa/setplot.py b/elsa_2021/setplot.py similarity index 100% rename from elsa/setplot.py rename to elsa_2021/setplot.py diff --git a/elsa/setrun.py b/elsa_2021/setrun.py similarity index 100% rename from elsa/setrun.py rename to elsa_2021/setrun.py diff --git a/florence/Makefile b/florence_2018/Makefile similarity index 100% rename from florence/Makefile rename to florence_2018/Makefile diff --git a/florence/readme.md b/florence_2018/README.md similarity index 100% rename from florence/readme.md rename to florence_2018/README.md diff --git a/florence/setplot.py b/florence_2018/setplot.py similarity index 98% rename from florence/setplot.py rename to florence_2018/setplot.py index e5ccf8f5..a6f0d1c5 100644 --- a/florence/setplot.py +++ b/florence_2018/setplot.py @@ -6,6 +6,8 @@ """ import os +import io +import urllib.request import numpy as np import matplotlib @@ -43,7 +45,7 @@ def setplot(plotdata): # Load data from output clawdata = clawpack.clawutil.data.ClawInputData(2) - clawdata.read('claw.data') + clawdata.read(os.path.join(plotdata.outdir,'claw.data')) physics = clawpack.geoclaw.data.GeoClawData() physics.read(os.path.join(plotdata.outdir,'geoclaw.data')) surge_data = clawpack.geoclaw.data.SurgeData() @@ -388,8 +390,8 @@ def fetch(product, expected_header, col_idx, col_types): if verbose: print('Fetching {} data from NOAA for station {}'.format( product, station)) - full_url = '{}?{}'.format(NOAA_API_URL, urlencode(noaa_params)) - with urlopen(full_url) as response: + full_url = '{}?{}'.format(NOAA_API_URL, urllib.request.urlencode(noaa_params)) + with urllib.request.urlopen(full_url) as response: text = response.read().decode('utf-8') with io.StringIO(text) as data: # ensure that received header is correct @@ -633,7 +635,7 @@ def gauge_afteraxes(cd): # Set up for axes in this figure: plotaxes = plotfigure.new_plotaxes() try: - plotaxes.xlimits = [amrdata.t0,amrdata.tfinal] + plotaxes.xlimits = [clawdata.t0, clawdata.tfinal] except: pass plotaxes.ylimits = surface_limits diff --git a/florence/setrun.py b/florence_2018/setrun.py similarity index 100% rename from florence/setrun.py rename to florence_2018/setrun.py diff --git a/Lili/Makefile b/frederic_1979/Makefile similarity index 100% rename from Lili/Makefile rename to frederic_1979/Makefile diff --git a/Frederic/README.md b/frederic_1979/README.md similarity index 100% rename from Frederic/README.md rename to frederic_1979/README.md diff --git a/Frederic/mobile_bay.asc b/frederic_1979/mobile_bay.asc similarity index 100% rename from Frederic/mobile_bay.asc rename to frederic_1979/mobile_bay.asc diff --git a/Frederic/setplot.py b/frederic_1979/setplot.py similarity index 100% rename from Frederic/setplot.py rename to frederic_1979/setplot.py diff --git a/Frederic/setrun.py b/frederic_1979/setrun.py similarity index 100% rename from Frederic/setrun.py rename to frederic_1979/setrun.py diff --git a/barry/Makefile b/gordon_2018/Makefile similarity index 100% rename from barry/Makefile rename to gordon_2018/Makefile diff --git a/gordon/README.md b/gordon_2018/README.md similarity index 100% rename from gordon/README.md rename to gordon_2018/README.md diff --git a/gordon/setplot.py b/gordon_2018/setplot.py similarity index 100% rename from gordon/setplot.py rename to gordon_2018/setplot.py diff --git a/gordon/setrun.py b/gordon_2018/setrun.py similarity index 100% rename from gordon/setrun.py rename to gordon_2018/setrun.py diff --git a/grace/Makefile b/grace_2021/Makefile similarity index 100% rename from grace/Makefile rename to grace_2021/Makefile diff --git a/grace/readme.md b/grace_2021/README.md similarity index 100% rename from grace/readme.md rename to grace_2021/README.md diff --git a/grace/images/pic1.png b/grace_2021/images/pic1.png similarity index 100% rename from grace/images/pic1.png rename to grace_2021/images/pic1.png diff --git a/grace/images/station1.png b/grace_2021/images/station1.png similarity index 100% rename from grace/images/station1.png rename to grace_2021/images/station1.png diff --git a/grace/images/station2.png b/grace_2021/images/station2.png similarity index 100% rename from grace/images/station2.png rename to grace_2021/images/station2.png diff --git a/grace/images/station3.png b/grace_2021/images/station3.png similarity index 100% rename from grace/images/station3.png rename to grace_2021/images/station3.png diff --git a/grace/setplot.py b/grace_2021/setplot.py similarity index 100% rename from grace/setplot.py rename to grace_2021/setplot.py diff --git a/grace/setrun.py b/grace_2021/setrun.py similarity index 100% rename from grace/setrun.py rename to grace_2021/setrun.py diff --git a/Gustav/Makefile b/gustav_2008/Makefile similarity index 100% rename from Gustav/Makefile rename to gustav_2008/Makefile diff --git a/Gustav/Readme.md b/gustav_2008/README.md similarity index 100% rename from Gustav/Readme.md rename to gustav_2008/README.md diff --git a/Gustav/setplot.py b/gustav_2008/setplot.py similarity index 100% rename from Gustav/setplot.py rename to gustav_2008/setplot.py diff --git a/Gustav/setrun.py b/gustav_2008/setrun.py similarity index 100% rename from Gustav/setrun.py rename to gustav_2008/setrun.py diff --git a/barry_update/Makefile b/harvey_2017/Makefile similarity index 100% rename from barry_update/Makefile rename to harvey_2017/Makefile diff --git a/harvey/readme.md b/harvey_2017/README.md similarity index 100% rename from harvey/readme.md rename to harvey_2017/README.md diff --git a/harvey/setplot.py b/harvey_2017/setplot.py similarity index 100% rename from harvey/setplot.py rename to harvey_2017/setplot.py diff --git a/harvey/setrun.py b/harvey_2017/setrun.py similarity index 100% rename from harvey/setrun.py rename to harvey_2017/setrun.py diff --git a/ida/Makefile b/ida_2021/Makefile similarity index 100% rename from ida/Makefile rename to ida_2021/Makefile diff --git a/ida/readme.md b/ida_2021/README.md similarity index 100% rename from ida/readme.md rename to ida_2021/README.md diff --git a/ida/images/station1.png b/ida_2021/images/station1.png similarity index 100% rename from ida/images/station1.png rename to ida_2021/images/station1.png diff --git a/ida/images/station2.png b/ida_2021/images/station2.png similarity index 100% rename from ida/images/station2.png rename to ida_2021/images/station2.png diff --git a/ida/images/station3.png b/ida_2021/images/station3.png similarity index 100% rename from ida/images/station3.png rename to ida_2021/images/station3.png diff --git a/ida/images/station4.png b/ida_2021/images/station4.png similarity index 100% rename from ida/images/station4.png rename to ida_2021/images/station4.png diff --git a/ida/images/station5.png b/ida_2021/images/station5.png similarity index 100% rename from ida/images/station5.png rename to ida_2021/images/station5.png diff --git a/ida/setplot.py b/ida_2021/setplot.py similarity index 100% rename from ida/setplot.py rename to ida_2021/setplot.py diff --git a/ida/setrun.py b/ida_2021/setrun.py similarity index 100% rename from ida/setrun.py rename to ida_2021/setrun.py diff --git a/ike/Makefile b/ike_2008/Makefile similarity index 100% rename from ike/Makefile rename to ike_2008/Makefile diff --git a/ike/setplot.py b/ike_2008/setplot.py similarity index 99% rename from ike/setplot.py rename to ike_2008/setplot.py index 93dda901..764dc648 100644 --- a/ike/setplot.py +++ b/ike_2008/setplot.py @@ -71,7 +71,7 @@ def read_tide_gauge_data(base_path, skiprows=5, verbose=False): station_info_file = open(os.path.join(base_path,'Ike_Gauges_web.txt'),'r') # Skip past header - for i in xrange(skiprows): + for i in range(skiprows): station_info_file.readline() # Read in each station @@ -88,7 +88,7 @@ def read_tide_gauge_data(base_path, skiprows=5, verbose=False): else: stations[data_line[0]]['gauge_no'] = int(data_line[1]) if verbose: - print "Station %s: %s" % (data_line[0],stations[data_line[0]]) + print("Station %s: %s" % (data_line[0],stations[data_line[0]])) # Load and extract real station data data = scipy.io.loadmat(os.path.join(base_path,'result_%s.mat' % data_line[0])) @@ -116,7 +116,7 @@ def read_adcirc_gauge_data(only_gauges=None, base_path="", verbose=False): data = numpy.loadtxt(gauge_file) stations[i+1] = data if verbose: - print "Read in ADCIRC gauge file %s" % gauge_file + print("Read in ADCIRC gauge file %s" % gauge_file) return stations @@ -144,7 +144,7 @@ def read_adcirc_gauge_data(only_gauges=None, base_path="", verbose=False): adcirc_path = "./gauge_data" ADCIRC_gauges = read_adcirc_gauge_data(base_path=os.path.join(adcirc_path,'new_data')) except: - print "Could not load external gauge files, ignoring." + print("Could not load external gauge files, ignoring.") pass diff --git a/ike/setrun.py b/ike_2008/setrun.py similarity index 99% rename from ike/setrun.py rename to ike_2008/setrun.py index 3a977992..95350cf1 100644 --- a/ike/setrun.py +++ b/ike_2008/setrun.py @@ -7,13 +7,14 @@ """ -from __future__ import print_function - import os import datetime import numpy as np +import clawpack.clawutil.data +import clawpack.geoclaw.topotools as topotools + # Need to adjust the date a bit due to weirdness with leap year (I think) ike_landfall = datetime.datetime(2008,9,13 - 1,7) - datetime.datetime(2008,1,1,0) @@ -579,7 +580,7 @@ def get_topo(plot=False): os.path.join(base_url, "NOAA_Galveston_Houston.tt3.tar.bz2"), os.path.join(base_url, "galveston_tx.asc.tar.bz2")] for url in urls: - data.get_remote_file(url, verbose=True) + clawpack.clawutil.data.get_remote_file(url, verbose=True) # Plot if requested if plot: diff --git a/gordon/Makefile b/irene_2011/Makefile similarity index 100% rename from gordon/Makefile rename to irene_2011/Makefile diff --git a/irene/README.md b/irene_2011/README.md similarity index 100% rename from irene/README.md rename to irene_2011/README.md diff --git a/irene/irene.storm b/irene_2011/irene.storm similarity index 100% rename from irene/irene.storm rename to irene_2011/irene.storm diff --git a/irene/setplot.py b/irene_2011/setplot.py similarity index 97% rename from irene/setplot.py rename to irene_2011/setplot.py index 5ef79fc2..3945c38c 100644 --- a/irene/setplot.py +++ b/irene_2011/setplot.py @@ -215,12 +215,12 @@ def gauge_afteraxes(cd): axes.grid(True) - try: - gauge_data=gauges[cd.gaugeno-1] - axes.plot(gauge_data[:,0], gauge_data[:,1], label=data_names[cd.gaugeno-1]) - axes.legend() - except: - print('Gauge Data Unavailable') + # try: + # gauge_data=gauges[cd.gaugeno-1] + # axes.plot(gauge_data[:,0], gauge_data[:,1], label=data_names[cd.gaugeno-1]) + # axes.legend() + # except: + # print('Gauge Data Unavailable') plotaxes.afteraxes = gauge_afteraxes diff --git a/irene/setrun.py b/irene_2011/setrun.py similarity index 100% rename from irene/setrun.py rename to irene_2011/setrun.py diff --git a/irma/Makefile b/irma_2017/Makefile similarity index 100% rename from irma/Makefile rename to irma_2017/Makefile diff --git a/irma/README.md b/irma_2017/README.md similarity index 100% rename from irma/README.md rename to irma_2017/README.md diff --git a/irma/setplot.py b/irma_2017/setplot.py similarity index 100% rename from irma/setplot.py rename to irma_2017/setplot.py diff --git a/irma/setrun.py b/irma_2017/setrun.py similarity index 100% rename from irma/setrun.py rename to irma_2017/setrun.py diff --git a/isabel/Makefile b/isabel_2003/Makefile similarity index 100% rename from isabel/Makefile rename to isabel_2003/Makefile diff --git a/isabel/setplot.py b/isabel_2003/setplot.py similarity index 100% rename from isabel/setplot.py rename to isabel_2003/setplot.py diff --git a/isabel/setrun.py b/isabel_2003/setrun.py similarity index 100% rename from isabel/setrun.py rename to isabel_2003/setrun.py diff --git a/Laura/Makefile b/isaias_2020/Makefile similarity index 100% rename from Laura/Makefile rename to isaias_2020/Makefile diff --git a/isaias/README.md b/isaias_2020/README.md similarity index 100% rename from isaias/README.md rename to isaias_2020/README.md diff --git a/isaias/setplot.py b/isaias_2020/setplot.py similarity index 100% rename from isaias/setplot.py rename to isaias_2020/setplot.py diff --git a/isaias/setrun.py b/isaias_2020/setrun.py similarity index 100% rename from isaias/setrun.py rename to isaias_2020/setrun.py diff --git a/isaias/Makefile b/joaquin_2015/Makefile similarity index 100% rename from isaias/Makefile rename to joaquin_2015/Makefile diff --git a/joaquin/readme.md b/joaquin_2015/README.md similarity index 100% rename from joaquin/readme.md rename to joaquin_2015/README.md diff --git a/joaquin/setplot.py b/joaquin_2015/setplot.py similarity index 100% rename from joaquin/setplot.py rename to joaquin_2015/setplot.py diff --git a/joaquin/setrun.py b/joaquin_2015/setrun.py similarity index 100% rename from joaquin/setrun.py rename to joaquin_2015/setrun.py diff --git a/karen/Makefile b/karen_2013/Makefile similarity index 100% rename from karen/Makefile rename to karen_2013/Makefile diff --git a/karen/setplot.py b/karen_2013/setplot.py similarity index 100% rename from karen/setplot.py rename to karen_2013/setplot.py diff --git a/karen/setrun.py b/karen_2013/setrun.py similarity index 99% rename from karen/setrun.py rename to karen_2013/setrun.py index 6ea4a675..6b752067 100644 --- a/karen/setrun.py +++ b/karen_2013/setrun.py @@ -431,7 +431,7 @@ def setgeo(rundata): try: geo_data = rundata.geo_data except: - print "*** Error, this rundata has no geo_data attribute" + print("*** Error, this rundata has no geo_data attribute") raise AttributeError("Missing geo_data attribute") # == Physics == diff --git a/katrina/Makefile b/katrina_2005/Makefile similarity index 100% rename from katrina/Makefile rename to katrina_2005/Makefile diff --git a/katrina/setplot.py b/katrina_2005/setplot.py similarity index 100% rename from katrina/setplot.py rename to katrina_2005/setplot.py diff --git a/katrina/setrun.py b/katrina_2005/setrun.py similarity index 100% rename from katrina/setrun.py rename to katrina_2005/setrun.py diff --git a/joaquin/Makefile b/laura_2020/Makefile similarity index 100% rename from joaquin/Makefile rename to laura_2020/Makefile diff --git a/Laura/README.md b/laura_2020/README.md similarity index 100% rename from Laura/README.md rename to laura_2020/README.md diff --git a/Laura/setplot.py b/laura_2020/setplot.py similarity index 100% rename from Laura/setplot.py rename to laura_2020/setplot.py diff --git a/Laura/setrun.py b/laura_2020/setrun.py similarity index 100% rename from Laura/setrun.py rename to laura_2020/setrun.py diff --git a/harvey/Makefile b/lili_2002/Makefile similarity index 100% rename from harvey/Makefile rename to lili_2002/Makefile diff --git a/Lili/README.md b/lili_2002/README.md similarity index 100% rename from Lili/README.md rename to lili_2002/README.md diff --git a/Lili/setplot.py b/lili_2002/setplot.py similarity index 100% rename from Lili/setplot.py rename to lili_2002/setplot.py diff --git a/Lili/setrun.py b/lili_2002/setrun.py similarity index 100% rename from Lili/setrun.py rename to lili_2002/setrun.py diff --git a/mangkhut/Makefile b/mangkhut_2018/Makefile similarity index 100% rename from mangkhut/Makefile rename to mangkhut_2018/Makefile diff --git a/mangkhut/README.rst b/mangkhut_2018/README.rst similarity index 100% rename from mangkhut/README.rst rename to mangkhut_2018/README.rst diff --git a/mangkhut/setplot.py b/mangkhut_2018/setplot.py similarity index 100% rename from mangkhut/setplot.py rename to mangkhut_2018/setplot.py diff --git a/mangkhut/setrun.py b/mangkhut_2018/setrun.py similarity index 100% rename from mangkhut/setrun.py rename to mangkhut_2018/setrun.py diff --git a/Maria/Makefile b/maria_2017/Makefile similarity index 100% rename from Maria/Makefile rename to maria_2017/Makefile diff --git a/Maria/README.md b/maria_2017/README.md similarity index 100% rename from Maria/README.md rename to maria_2017/README.md diff --git a/Maria/bal152017.dat.gz b/maria_2017/bal152017.dat.gz similarity index 100% rename from Maria/bal152017.dat.gz rename to maria_2017/bal152017.dat.gz diff --git a/Maria/setplot.py b/maria_2017/setplot.py similarity index 97% rename from Maria/setplot.py rename to maria_2017/setplot.py index 54dc0b3a..b1dd982b 100644 --- a/Maria/setplot.py +++ b/maria_2017/setplot.py @@ -203,12 +203,12 @@ def gauge_afteraxes(cd): #may or may not keep this? see irene example #credit for below code to author of Irene example - try: - gauge_data=gaugea[cd.gaugeno-1] - axes.plot(gauge_data[:,0], gauge_data[:,1], label=data_names[cd.gaugeno-1]) - axes.legend() - except: - print('Gauge Data Unavailable') + # try: + # gauge_data=gaugea[cd.gaugeno-1] + # axes.plot(gauge_data[:,0], gauge_data[:,1], label=data_names[cd.gaugeno-1]) + # axes.legend() + # except: + # print('Gauge Data Unavailable') #irene code ends here plotaxes.afteraxes = gauge_afteraxes #originally line 209 - KEEP!! diff --git a/Maria/setrun.py b/maria_2017/setrun.py similarity index 100% rename from Maria/setrun.py rename to maria_2017/setrun.py diff --git a/matthew/Makefile b/matthew_2016/Makefile similarity index 100% rename from matthew/Makefile rename to matthew_2016/Makefile diff --git a/matthew/README.md b/matthew_2016/README.md similarity index 100% rename from matthew/README.md rename to matthew_2016/README.md diff --git a/matthew/kml2slu.py b/matthew_2016/kml2slu.py similarity index 100% rename from matthew/kml2slu.py rename to matthew_2016/kml2slu.py diff --git a/matthew/regions.kml b/matthew_2016/regions.kml similarity index 100% rename from matthew/regions.kml rename to matthew_2016/regions.kml diff --git a/matthew/setplot.py b/matthew_2016/setplot.py similarity index 100% rename from matthew/setplot.py rename to matthew_2016/setplot.py diff --git a/matthew/setrun.py b/matthew_2016/setrun.py similarity index 100% rename from matthew/setrun.py rename to matthew_2016/setrun.py diff --git a/michael/Makefile b/michael/Makefile deleted file mode 100644 index 3fde6dd5..00000000 --- a/michael/Makefile +++ /dev/null @@ -1,67 +0,0 @@ - -# Makefile for Clawpack code in this directory. -# This version only sets the local files and frequently changed -# options, and then includes the standard makefile pointed to by CLAWMAKE. -CLAWMAKE = $(CLAW)/clawutil/src/Makefile.common - -# See the above file for details and a list of make options, or type -# make .help -# at the unix prompt. - - -# Adjust these variables if desired: -# ---------------------------------- - -CLAW_PKG = geoclaw # Clawpack package to use -EXE = xgeoclaw # Executable to create -SETRUN_FILE = setrun.py # File containing function to make data -OUTDIR = _output # Directory for output -SETPLOT_FILE = setplot.py # File containing function to set plots -PLOTDIR = _plots # Directory for plots - -# Environment variable FC should be set to fortran compiler, e.g. gfortran -FFLAGS += -DNETCDF -lnetcdff -I$(NETCDF4_DIR)/include -O3 -funroll-loops -finline-functions -fopenmp -LFLAGS += $(FFLAGS) - -# --------------------------------- -# package sources for this program: -# --------------------------------- - -GEOLIB = $(CLAW)/geoclaw/src/2d/shallow -include $(GEOLIB)/Makefile.geoclaw - -# --------------------------------------- -# package sources specifically to exclude -# (i.e. if a custom replacement source -# under a different name is provided) -# --------------------------------------- - -EXCLUDE_MODULES = \ - -EXCLUDE_SOURCES = \ - -# ---------------------------------------- -# List of custom sources for this program: -# ---------------------------------------- - -RIEMANN = $(CLAW)/riemann/src - -MODULES = \ - -SOURCES = \ - $(RIEMANN)/rpn2_geoclaw.f \ - $(RIEMANN)/rpt2_geoclaw.f \ - $(RIEMANN)/geoclaw_riemann_utils.f \ - -#------------------------------------------------------------------- -# Include Makefile containing standard definitions and make options: -include $(CLAWMAKE) - -.PHONY: all - --all: - $(MAKE) .plots - - -### DO NOT remove this line - make depends on it ### - diff --git a/michael/setplot.py b/michael/setplot.py deleted file mode 100644 index 852af421..00000000 --- a/michael/setplot.py +++ /dev/null @@ -1,289 +0,0 @@ - -""" -Set up the plot figures, axes, and items to be done for each frame. - -This module is imported by the plotting routines and then the -function setplot is called to set the plot parameters. - -""" - -import os - -import numpy as np -import matplotlib.pyplot as plt -import datetime - -from clawpack.geoclaw.util import fetch_noaa_tide_data -from clawpack.visclaw import colormaps, gaugetools -import clawpack.clawutil.data -import clawpack.amrclaw.data -import clawpack.geoclaw.data - -import clawpack.geoclaw.surge.plot as surge - -try: - from setplotfg import setplotfg -except: - setplotfg = None - -def setplot(plotdata): - r"""Setplot function for surge plotting""" - - - plotdata.clearfigures() # clear any old figures,axes,items data - plotdata.format = 'binary' - - # Load data from output - clawdata = clawpack.clawutil.data.ClawInputData(2) - clawdata.read(os.path.join(plotdata.outdir,'claw.data')) - physics = clawpack.geoclaw.data.GeoClawData() - physics.read(os.path.join(plotdata.outdir,'geoclaw.data')) - surge_data = clawpack.geoclaw.data.SurgeData() - surge_data.read(os.path.join(plotdata.outdir,'surge.data')) - friction_data = clawpack.geoclaw.data.FrictionData() - friction_data.read(os.path.join(plotdata.outdir,'friction.data')) - - # Load storm track32 - track = surge.track_data(os.path.join(plotdata.outdir,'fort.track')) - - # Set afteraxes function - def surge_afteraxes(cd): - return surge.surge_afteraxes(cd, track, plot_direction=False) - - # Limits for plots - dx = 0.5 - dy = 0.5 - regions = [{"name": "Full Domain", - "limits": [[clawdata.lower[0], clawdata.upper[0]], - [clawdata.lower[1], clawdata.upper[1]]]}, - {"name": "New Orleans", - "limits": [[-92.5, -87.5], [27.5, 31.5]]}, - {"name": "Grand Isle", - "limits": [[-89.41 - dx, -89.41 + dx], - [29.26 - dx, 29.26 + dx]]}, - {"name": "Pilots Station East", - "limits": [[-89.41 - dx, -89.41 + dx], - [28.93 - dy, 28.93 + dy]]}, - {"name": "Dauphin Island", - "limits": [[-88.08 - dx, -88.08 + dx], - [30.25 - dy, 30.25 + dy]]}] - - # Color limits - surface_limits = [physics.sea_level - 5.0, physics.sea_level + 5.0] - surface_ticks = [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5] - surface_labels = [str(value) for value in surface_ticks] - speed_limits = [0.0, 3.0] - speed_ticks = [0, 1, 2, 3] - speed_labels = [str(value) for value in speed_ticks] - wind_limits = [15, 40] - pressure_limits = [966,1013] - friction_bounds = [0.01,0.04] - - # ========================================================================== - # ========================================================================== - # Plot specifications - # ========================================================================== - # ========================================================================== - - # Loop over region specifications ploting both surface and speeds - for region in regions: - name = region['name'] - xlimits = region['limits'][0] - ylimits = region['limits'][1] - # ====================================================================== - # Surface Elevations - # ====================================================================== - plotfigure = plotdata.new_plotfigure(name='Surface - %s' % name) - plotfigure.show = True - - # Set up for axes in this figure: - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Surface' - plotaxes.scaled = True - plotaxes.xlimits = xlimits - plotaxes.ylimits = ylimits - plotaxes.afteraxes = surge_afteraxes - - surge.add_surface_elevation(plotaxes, bounds=surface_limits) - plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0] * 10 - surge.add_land(plotaxes) - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - # ====================================================================== - # Water Speed - # ====================================================================== - plotfigure = plotdata.new_plotfigure(name='Currents - %s' % name) - plotfigure.show = True - - # Set up for axes in this figure: - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Currents' - plotaxes.scaled = True - plotaxes.xlimits = xlimits - plotaxes.ylimits = ylimits - plotaxes.afteraxes = surge_afteraxes - - surge.add_speed(plotaxes, bounds=speed_limits) - plotaxes.plotitem_dict['speed'].amr_patchedges_show = [0] * 10 - surge.add_land(plotaxes) - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - # ====================================================================== - # Wind Field - # ====================================================================== - plotfigure = plotdata.new_plotfigure(name='Wind Speed - %s' % name) - plotfigure.show = surge_data.wind_forcing - - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = "Wind Field" - plotaxes.scaled = True - plotaxes.xlimits = xlimits - plotaxes.ylimits = ylimits - plotaxes.afteraxes = surge_afteraxes - - surge.add_wind(plotaxes, bounds=wind_limits) - plotaxes.plotitem_dict['wind'].amr_patchedges_show = [0] * 10 - surge.add_land(plotaxes) - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - - # ======================================================================== - # Hurricane forcing - # ======================================================================== - # Friction field - plotfigure = plotdata.new_plotfigure(name='Friction - %s' % name) - plotfigure.show = friction_data.variable_friction - - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = "Manning's N Coefficients" - plotaxes.scaled = True - plotaxes.xlimits = xlimits - plotaxes.ylimits = ylimits - plotaxes.afteraxes = surge_afteraxes - - surge.add_friction(plotaxes, bounds=friction_bounds) - - # Pressure field - plotfigure = plotdata.new_plotfigure(name='Pressure - %s' % name) - plotfigure.show = surge_data.pressure_forcing - - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = "Pressure Field" - plotaxes.scaled = True - plotaxes.xlimits = xlimits - plotaxes.ylimits = ylimits - plotaxes.afteraxes = surge_afteraxes - - surge.add_pressure(plotaxes, bounds=pressure_limits) - plotaxes.plotitem_dict['pressure'].amr_patchedges_show = [0] * 10 - surge.add_land(plotaxes) - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - - # ======================================================================== - # Figures for gauges - # ======================================================================== - plotfigure = plotdata.new_plotfigure(name='Surface & Topo', figno=300, \ - type='each_gauge') - plotfigure.show = True - plotfigure.clf_each_gauge = True - - stations = [('8761724', 'Grand Isle, LA'), - ('8760922', 'Pilots Station East, SW Pass, LA'), - ('8735180', 'Dauphin Island, AL')] - - landfall_time = np.datetime64('2005-08-29T11:10') - begin_date = datetime.datetime(2005, 8, 26) - end_date = datetime.datetime(2005, 8, 31) - - def get_actual_water_levels(station_id): - # Fetch water levels and tide predictions for given station - date_time, water_level, tide = fetch_noaa_tide_data(station_id, - begin_date, end_date) - - # Calculate times relative to landfall - secs_rel_landfall = (date_time - landfall_time) / np.timedelta64(1, 's') - - # Subtract tide predictions from measured water levels - water_level -= tide - - return secs_rel_landfall, water_level - - def gauge_afteraxes(cd): - station_id, station_name = stations[cd.gaugeno - 1] - secs_rel_landfall, actual_level = get_actual_water_levels(station_id) - - axes = plt.gca() - axes.plot(secs_rel_landfall, actual_level, 'g') - - # Fix up plot - in particular fix time labels - axes.set_title(station_name) - axes.set_xlabel('Days relative to landfall') - axes.set_ylabel('Surface (m)') - axes.set_xlim(np.array([-3, 1]) * 86400) - axes.set_ylim([-0.5, 2.5]) - axes.set_xticks(np.linspace(-3, 1, 5) * 86400) - axes.set_xticklabels([r"$-3$", r"$-2$", r"$-1$", r"$0$", r"$1$"]) - axes.grid(True) - - # Plot wind speed using second scale - wind_speed = np.linalg.norm(cd.gaugesoln.q[8:10, :], axis=0) - axes2 = axes.twinx() - axes2.plot(cd.gaugesoln.t, wind_speed, 'r.', markersize=0.3) - axes2.set_ylabel('Wind Speed (m/s)') - axes2.set_ylim([-2.5, 52.5]) - - # Set up for axes in this figure: - plotaxes = plotfigure.new_plotaxes() - plotaxes.afteraxes = gauge_afteraxes - - # Plot surface as blue curve: - plotitem = plotaxes.new_plotitem(plot_type='1d_plot') - plotitem.plot_var = 3 - plotitem.plotstyle = 'b-' - - # - # 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 = [-91.5, -87.5] - plotaxes.ylimits = [28.0, 31.0] - plotaxes.afteraxes = gauge_location_afteraxes - - surge.add_surface_elevation(plotaxes, bounds=surface_limits) - plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0] * 10 - surge.add_land(plotaxes) - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0] * 10 - - - #----------------------------------------- - - # Parameters used only when creating html and/or latex hardcopy - # e.g., via pyclaw.plotters.frametools.printframes: - - plotdata.printfigs = True # print figures - plotdata.print_format = 'png' # file format - plotdata.print_framenos = 'all' # list of frames 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.html_homelink = '../README.html' # pointer for top of index - plotdata.latex = True # create latex file of plots? - plotdata.latex_figsperline = 2 # layout of plots - plotdata.latex_framesperline = 1 # layout of plots - plotdata.latex_makepdf = False # also run pdflatex? - - return plotdata - diff --git a/michael/setrun.py b/michael/setrun.py deleted file mode 100644 index e7563000..00000000 --- a/michael/setrun.py +++ /dev/null @@ -1,590 +0,0 @@ -# encoding: utf-8 -""" -Module to set up run time parameters for Clawpack. - -The values set in the function setrun are then written out to data files -that will be read in by the Fortran code. - -""" - -from __future__ import print_function -from __future__ import absolute_import - -import os -import sys -import datetime - -from gzip import GzipFile -from six.moves.urllib.request import urlopen -import numpy as np - -import clawpack.clawutil.data as data -import clawpack.geoclaw.topotools as topotools -import clawpack.geoclaw.etopotools as etopotools -from clawpack.geoclaw.surge.storm import Storm - -# days s/hour hours/day -days2seconds = lambda days: days * 60.0**2 * 24.0 -seconds2days = lambda seconds: seconds / (60.0**2 * 24.0) - - -def setrun(claw_pkg='geoclaw'): - """ - Define the parameters used for running Clawpack. - - INPUT: - claw_pkg expected to be "geoclaw" for this setrun. - - OUTPUT: - rundata - object of class ClawRunData - - """ - - assert claw_pkg.lower() == 'geoclaw', "Expected claw_pkg = 'geoclaw'" - - num_dim = 2 - rundata = data.ClawRunData(claw_pkg, num_dim) - - #------------------------------------------------------------------ - # Problem-specific parameters to be written to setprob.data: - #------------------------------------------------------------------ - - #probdata = rundata.new_UserData(name='probdata',fname='setprob.data') - - #------------------------------------------------------------------ - # Standard Clawpack parameters to be written to claw.data: - # (or to amr2ez.data for AMR) - #------------------------------------------------------------------ - - clawdata = rundata.clawdata # initialized when rundata instantiated - - - # Set single grid parameters first. - # See below for AMR parameters. - - - # --------------- - # Spatial domain: - # --------------- - - # Number of space dimensions: - clawdata.num_dim = num_dim - - # Lower and upper edge of computational domain: - clawdata.lower[0] = -99.0 - clawdata.upper[0] = -75.0 - - clawdata.lower[1] = 15.0 - clawdata.upper[1] = 32.0 - - - # Number of grid cells: - degree_factor = 4 # (0.25º,0.25º) ~ (25237.5 m, 27693.2 m) resolution - clawdata.num_cells[0] = int(clawdata.upper[0] - clawdata.lower[0]) * degree_factor - clawdata.num_cells[1] = int(clawdata.upper[1] - clawdata.lower[1]) * degree_factor - - - # --------------- - # Size of system: - # --------------- - - # Number of equations in the system: - clawdata.num_eqn = 3 - - # Number of auxiliary variables in the aux array (initialized in setaux) - clawdata.num_aux = 4 + 3 - - # Index of aux array corresponding to capacity function, if there is one: - clawdata.capa_index = 2 - - - - # ------------- - # Initial time: - # ------------- - - # Katrina 2005082412 20260800.000000000 - clawdata.t0 = days2seconds(-3.0) - - # ------------- - # Output times: - #-------------- - - # Specify at what times the results should be written to fort.q files. - # Note that the time integration stops after the final output time. - # The solution at initial time t0 is always written in addition. - - clawdata.output_style = 1 - - if clawdata.output_style == 1: - # Output nout frames at equally spaced times up to tfinal: - # day s/hour hours/day - # Katrina 2005083012 - clawdata.tfinal = days2seconds(1.0) - - # Output files per day requested - recurrence = 48 - clawdata.num_output_times = int((clawdata.tfinal - clawdata.t0) * - recurrence / (60**2 * 24)) - - clawdata.output_t0 = True # output at initial (or restart) time? - - elif clawdata.output_style == 2: - # Specify a list of output times. - clawdata.output_times = [0.5, 1.0] - - elif clawdata.output_style == 3: - # Output every iout timesteps with a total of ntot time steps: - clawdata.output_step_interval = 1 - clawdata.total_steps = 1 - clawdata.output_t0 = True - - clawdata.output_format = 'binary' # 'ascii' or 'netcdf' - - clawdata.output_q_components = 'all' # could be list such as [True,True] - clawdata.output_aux_components = 'all' # could be list - clawdata.output_aux_onlyonce = False # output aux arrays only at t0 - - - - # --------------------------------------------------- - # Verbosity of messages to screen during integration: - # --------------------------------------------------- - - # The current t, dt, and cfl will be printed every time step - # at AMR levels <= verbosity. Set verbosity = 0 for no printing. - # (E.g. verbosity == 2 means print only on levels 1 and 2.) - clawdata.verbosity = 1 - - - - # -------------- - # Time stepping: - # -------------- - - # if dt_variable==1: variable time steps used based on cfl_desired, - # if dt_variable==0: fixed time steps dt = dt_initial will always be used. - clawdata.dt_variable = True - - # Initial time step for variable dt. - # If dt_variable==0 then dt=dt_initial for all steps: - clawdata.dt_initial = 0.016 - - # Max time step to be allowed if variable dt used: - clawdata.dt_max = 1e+99 - - # Desired Courant number if variable dt used, and max to allow without - # retaking step with a smaller dt: - clawdata.cfl_desired = 0.75 - clawdata.cfl_max = 1.0 - - # Maximum number of time steps to allow between output times: - clawdata.steps_max = 2**16 - - - - - # ------------------ - # Method to be used: - # ------------------ - - # Order of accuracy: 1 => Godunov, 2 => Lax-Wendroff plus limiters - clawdata.order = 2 - - # Use dimensional splitting? (not yet available for AMR) - clawdata.dimensional_split = 'unsplit' - - # For unsplit method, transverse_waves can be - # 0 or 'none' ==> donor cell (only normal solver used) - # 1 or 'increment' ==> corner transport of waves - # 2 or 'all' ==> corner transport of 2nd order corrections too - clawdata.transverse_waves = 2 - - # Number of waves in the Riemann solution: - clawdata.num_waves = 3 - - # List of limiters to use for each wave family: - # Required: len(limiter) == num_waves - # Some options: - # 0 or 'none' ==> no limiter (Lax-Wendroff) - # 1 or 'minmod' ==> minmod - # 2 or 'superbee' ==> superbee - # 3 or 'mc' ==> MC limiter - # 4 or 'vanleer' ==> van Leer - clawdata.limiter = ['mc', 'mc', 'mc'] - - clawdata.use_fwaves = True # True ==> use f-wave version of algorithms - - # Source terms splitting: - # src_split == 0 or 'none' ==> no source term (src routine never called) - # src_split == 1 or 'godunov' ==> Godunov (1st order) splitting used, - # src_split == 2 or 'strang' ==> Strang (2nd order) splitting used, not recommended. - clawdata.source_split = 'godunov' - # clawdata.source_split = 'strang' - - # -------------------- - # Boundary conditions: - # -------------------- - - # Number of ghost cells (usually 2) - clawdata.num_ghost = 2 - - # Choice of BCs at xlower and xupper: - # 0 => user specified (must modify bcN.f to use this option) - # 1 => extrapolation (non-reflecting outflow) - # 2 => periodic (must specify this at both boundaries) - # 3 => solid wall for systems where q(2) is normal velocity - - clawdata.bc_lower[0] = 'extrap' - clawdata.bc_upper[0] = 'extrap' - - clawdata.bc_lower[1] = 'extrap' - clawdata.bc_upper[1] = 'extrap' - - # Specify when checkpoint files should be created that can be - # used to restart a computation. - - clawdata.checkpt_style = 0 - - if clawdata.checkpt_style == 0: - # Do not checkpoint at all - pass - - elif clawdata.checkpt_style == 1: - # Checkpoint only at tfinal. - pass - - elif clawdata.checkpt_style == 2: - # Specify a list of checkpoint times. - clawdata.checkpt_times = [0.1, 0.15] - - elif clawdata.checkpt_style == 3: - # Checkpoint every checkpt_interval timesteps (on Level 1) - # and at the final time. - clawdata.checkpt_interval = 5 - - - # --------------- - # AMR parameters: - # --------------- - amrdata = rundata.amrdata - - - # max number of refinement levels: - amrdata.amr_levels_max = 6 - - # List of refinement ratios at each level (length at least mxnest-1) - # Resolution in degrees 0.25, 0.125, 0.0625, 0.015625, 0.00390625 - # Resolution in ~meters 27.5e3, 13.75e3, 6.875e3, 1.71875e3, 429.6875 - amrdata.refinement_ratios_x = [2, 2, 4, 4, 4, 4] - amrdata.refinement_ratios_y = [2, 2, 4, 4, 4, 4] - amrdata.refinement_ratios_t = [2, 2, 4, 4, 4, 4] - - - # Specify type of each aux variable in amrdata.auxtype. - # This must be a list of length maux, each element of which is one of: - # 'center', 'capacity', 'xleft', or 'yleft' (see documentation). - - amrdata.aux_type = ['center', 'capacity', 'yleft', 'center', 'center', - 'center', 'center', 'center', 'center'] - - # Flag using refinement routine flag2refine rather than richardson error - amrdata.flag_richardson = False # use Richardson? - amrdata.flag2refine = True - - # steps to take on each level L between regriddings of level L+1: - amrdata.regrid_interval = 3 - - # width of buffer zone around flagged points: - # (typically the same as regrid_interval so waves don't escape): - amrdata.regrid_buffer_width = 2 - - # clustering alg. cutoff for (# flagged pts) / (total # of cells refined) - # (closer to 1.0 => more small grids may be needed to cover flagged cells) - amrdata.clustering_cutoff = 0.700000 - - # print info about each regridding up to this level: - amrdata.verbosity_regrid = 0 - - # ----- For developers ----- - # Toggle debugging print statements: - amrdata.dprint = False # print domain flags - amrdata.eprint = False # print err est flags - amrdata.edebug = False # even more err est flags - amrdata.gprint = False # grid bisection/clustering - amrdata.nprint = False # proper nesting output - amrdata.pprint = False # proj. of tagged points - amrdata.rprint = False # print regridding summary - amrdata.sprint = False # space/memory output - amrdata.tprint = False # time step reporting each level - amrdata.uprint = False # update/upbnd reporting - - # More AMR parameters can be set -- see the defaults in pyclaw/data.py - - # == setgauges.data values == - gauges = rundata.gaugedata.gauges - # for gauges append lines of the form [gaugeno, x, y, t1, t2] - - # Grand Isle, LA (Station ID: 8761724) - gauges.append([1, -89.96, 29.26, rundata.clawdata.t0, rundata.clawdata.tfinal]) - - # Pilots Station East, SW Pass, LA (Station ID: 8760922) - gauges.append([2, -89.41, 28.93, rundata.clawdata.t0, rundata.clawdata.tfinal]) - - # Dauphin Island, AL (Station ID: 8735180) - gauges.append([3, -88.08, 30.25, rundata.clawdata.t0, rundata.clawdata.tfinal]) - - # == setregions.data values == - regions = rundata.regiondata.regions - # to specify regions of refinement append lines of the form - # [minlevel,maxlevel,t1,t2,x1,x2,y1,y2] - - rundata.gaugedata.aux_out_fields = 'all' - - dx = 0.1 - dy = 0.1 - - for gauge in gauges: - regions.append([amrdata.amr_levels_max, amrdata.amr_levels_max, - rundata.clawdata.t0, rundata.clawdata.tfinal, - gauge[1] - dx, gauge[1] + dx, - gauge[2] - dy, gauge[2] + dy]) - - #------------------------------------------------------------------ - # GeoClaw specific parameters: - #------------------------------------------------------------------ - - rundata = setgeo(rundata) # Defined below - - # Set storm - set_storm(rundata) - - # Set variable friction - set_friction(rundata) - - return rundata - # end of function setrun - # ---------------------- - - -def setgeo(rundata): - """ - Set GeoClaw specific runtime parameters. - For documentation see .... - """ - - try: - geo_data = rundata.geo_data - except: - print("*** Error, this rundata has no geodata attribute") - raise AttributeError("Missing geodata attribute") - - # == Physics == - geo_data.gravity = 9.81 - geo_data.coordinate_system = 2 - geo_data.earth_radius = 6367.5e3 - geo_data.rho = 1025.0 - geo_data.rho_air = 1.15 - geo_data.ambient_pressure = 101.3e3 - - # == Forcing Options - geo_data.coriolis_forcing = True - geo_data.friction_forcing = True - geo_data.manning_coefficient = 0.025 # Overridden below - geo_data.friction_depth = 1e10 - - # == Algorithm and Initial Conditions == - geo_data.sea_level = 0.125 # Due to seasonal swelling of gulf - geo_data.dry_tolerance = 1.e-2 - - # Refinement Criteria - refine_data = rundata.refinement_data - refine_data.wave_tolerance = 1.0 - # refine_data.wave_tolerance = 0.5 - # refine_data.speed_tolerance = [0.25,0.5,1.0,2.0,3.0,4.0] - # refine_data.speed_tolerance = [0.5,1.0,1.5,2.0,2.5,3.0] - refine_data.speed_tolerance = [1.0,2.0,3.0,4.0] - refine_data.deep_depth = 1e6 - refine_data.max_level_deep = 5 - refine_data.variable_dt_refinement_ratios = True - - # == settopo.data values == - topo_data = rundata.topo_data - # for topography, append lines of the form - # [topotype, minlevel, maxlevel, t1, t2, fname] - - # Fetch topography if needed - topo_files = get_topo() - - for topo_file in topo_files: - topo_data.topofiles.append([4, 1, 5, - rundata.clawdata.t0, rundata.clawdata.tfinal, - topo_file]) - topo_data.topofiles.append([3, 1, 5, - rundata.clawdata.t0, rundata.clawdata.tfinal, - os.path.join(os.environ['CLAW'], 'geoclaw', 'scratch', 'NewOrleans_3s.tt3')]) - - # == setqinit.data values == - rundata.qinit_data.qinit_type = 0 - rundata.qinit_data.qinitfiles = [] - # for qinit perturbations, append lines of the form: (<= 1 allowed for now!) - # [minlev, maxlev, fname] - # geodata.qinitfiles.append([1, 5, 'hump.xyz']) - - # == setfixedgrids.data values == - rundata.fixed_grid_data.fixedgrids = [] - # for fixed grids append lines of the form - # [t1,t2,noutput,x1,x2,y1,y2,xpoints,ypoints,\ - # ioutarrivaltimes,ioutsurfacemax] - # geodata.fixedgrids.append([1e3,3.24e4,10,-90,-80,-30,-15,100,100,0,1]) - - return rundata - # end of function setgeo - # ---------------------- - - -def set_storm(rundata): - - data = rundata.surge_data - - # Source term controls - These are currently not respected - data.wind_forcing = True - data.pressure_forcing = True - data.drag_law = 2 - - # AMR parameters - m/s for wind refinement and (m) for radius - data.wind_refine = [20.0, 40.0, 60.0] - data.R_refine = [60.0e3, 40e3, 20e3] - - # Storm parameters - Storm Type 1 is Holland parameterized - data.storm_type = 1 - data.display_landfall_time = True - - # Fetch storm track if needed - storm_file = get_storm_track() - - # Storm type 1 - Idealized storm track - data.storm_specification_type = "holland80" # Set type of storm field - data.storm_file = storm_file - - return data - - -def set_friction(rundata): - - data = rundata.friction_data - - # Variable friction - data.variable_friction = True - - # Region based friction - # Entire domain - data.friction_regions.append([rundata.clawdata.lower, - rundata.clawdata.upper, - [np.infty, 0.0, -np.infty], - [0.030, 0.022]]) - - # # La-Tex Shelf - # data.friction_regions.append([(-98, 25.25), (-90, 30), - # [np.infty, -10.0, -200.0, -np.infty], - # [0.030, 0.012, 0.022]]) - - return data - - -def get_topo(): - """ - Retrieve the topo files from NOAA. - """ - base_url = 'https://gis.ngdc.noaa.gov/mapviewer-support/wcs-proxy/wcs.groovy' - - claw_dir = os.environ['CLAW'] - scratch_dir = os.path.join(claw_dir, 'geoclaw', 'scratch') - - # Specify topo parameters as tuples of the form - # (res_mins, lat_min, lat_max, lon_min, lon_max) - topo_params = [(10, 5, 35, -100, -70), # Gulf - (1, 28, 31, -92.5, -87.5)] # New Orleans - - topo_files = [] - - for (res_mins, lat_min, lat_max, lon_min, lon_max) in topo_params: - # Construct output file name - lat_lon = '{}{}_{}{}_{}{}_{}{}'.format(abs(lat_min), - 'N' if lat_min >= 0 else 'S', - abs(lat_max), - 'N' if lat_max >= 0 else 'S', - abs(lon_min), - 'E' if lon_min >= 0 else 'W', - abs(lon_max), - 'E' if lon_max >= 0 else 'W') - topo_fname = 'etopo1_{}m_{}.nc'.format(res_mins, lat_lon) - topo_files.append(os.path.join(scratch_dir, topo_fname)) - - # Fetch topography - # Note: We manually create the query string because using 'urlencode' - # causes an internal server error. - res_hrs = res_mins / 60.0 - url_params = { - 'filename': 'etopo1.nc', - 'request': 'getcoverage', - 'version': '1.0.0', - 'service': 'wcs', - 'coverage': 'etopo1', - 'CRS': 'EPSG:4326', - 'format': 'netcdf', - 'resx': '{:.18f}'.format(res_hrs), - 'resy': '{:.18f}'.format(res_hrs), - 'bbox': '{:.14f},{:.14f},{:.14f},{:.14f}'.format(lon_min, lat_min, - lon_max, lat_max) - } - query_str = '&'.join('{}={}'.format(k, v) for k, v in url_params.items()) - full_url = '{}?{}'.format(base_url, query_str) - data.get_remote_file(full_url, file_name=topo_fname, verbose=True) - - return topo_files - - -def get_storm_track(verbose=True): - """ - Retrieve the storm track file from NOAA. - """ - url = 'http://ftp.nhc.noaa.gov/atcf/archive/2005/bal122005.dat.gz' - - claw_dir = os.environ['CLAW'] - scratch_dir = os.path.join(claw_dir, 'geoclaw', 'scratch') - atcf_path = os.path.join(scratch_dir, 'bal122005.dat') - - # Download and decompress storm track file if it does not already exist - if not os.path.exists(atcf_path): - if verbose: - print('Downloading storm track file') - with urlopen(url) as response: - with GzipFile(fileobj=response) as fin: - with open(atcf_path, 'wb') as fout: - fout.write(fin.read()) - elif verbose: - print('Using previously downloaded storm track file') - - return convert_storm_track(atcf_path) - - -def convert_storm_track(atcf_path): - output_path = os.path.join(os.getcwd(), 'katrina.storm') - katrina = Storm(path=atcf_path, file_format='ATCF') - # Landfall of hurricane 1110 UTC (6:10 a.m. CDT) on Monday, August 29, 2005 - katrina.time_offset = datetime.datetime(2005, 8, 29, 11, 10) - katrina.write(output_path, file_format='geoclaw') - return output_path - - -if __name__ == '__main__': - # Set up run-time parameters and write all data files. - - rundata = data.ClawRunData("geoclaw", 2) - if len(sys.argv) == 2: - rundata = setrun(sys.argv[1]) - else: - rundata = setrun() - - rundata.write() diff --git a/Michael2018/Makefile b/michael_2018/Makefile similarity index 100% rename from Michael2018/Makefile rename to michael_2018/Makefile diff --git a/Michael2018/Readme.md b/michael_2018/README.md similarity index 100% rename from Michael2018/Readme.md rename to michael_2018/README.md diff --git a/Michael2018/setplot.py b/michael_2018/setplot.py similarity index 100% rename from Michael2018/setplot.py rename to michael_2018/setplot.py diff --git a/Michael2018/setrun.py b/michael_2018/setrun.py similarity index 100% rename from Michael2018/setrun.py rename to michael_2018/setrun.py diff --git a/mumbai/extract_track_data.py b/mumbai/extract_track_data.py index aa02184f..c73ab39a 100755 --- a/mumbai/extract_track_data.py +++ b/mumbai/extract_track_data.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from __future__ import print_function + import sys import os @@ -50,7 +50,7 @@ def create_storm_file(storm, output_path="mumbai.storm"): # "(8x i4 i2i2i26x a4 2x,i3,1x,i4,a1,2x,i4,a1,2x,i3,2x,i4,47x,i3,2x,i3)" # "(8x i4 i2i2i26x a4 2xi3 xi4 a i4 a i3 2x,i4,47x,i3,2x,i3)" # "( YYYYMMDDHH BEST FOR lat_D long_D max cpre rrp rad" - for n in xrange(len(storm['track'][0])): + for n in range(len(storm['track'][0])): # AL, 00, HHHHMMDDHH, , BEST, 0, LATN, LONW, XX, CPRE, TS, , 0, 0, 0, 0, date = "%s%s%s%s" % ( storm['time'][n].year, str(storm['time'][n].month).zfill(2), @@ -94,7 +94,7 @@ def plot_tracks(storms, plot_cat=True): # print(storm['track']) # print(longitude, latitude) # import pdb; pdb.set_trace() - for i in xrange(len(longitude)): + for i in range(len(longitude)): if plot_cat: color = category_color[storm['category'][i]] else: @@ -146,7 +146,7 @@ def extract_data(path, mask_dist=numpy.infty, mask_category=0): # Convert into storms and truncate zeros storms = [] - for n in xrange(lon.shape[0]): + for n in range(lon.shape[0]): m = len(lon[n].nonzero()[0]) distance = numpy.sqrt( (lon[n, :m] - mumbai[0])**2 @@ -156,7 +156,7 @@ def extract_data(path, mask_dist=numpy.infty, mask_category=0): 'time': [datetime.datetime(year[0, n], month[n, i], day[n, i], - hour[n, i]) for i in xrange(m)], + hour[n, i]) for i in range(m)], 'max_winds': max_winds[n, :m], 'radius_max_winds': radius_max_winds[n, :m], 'central_pressure': central_pressure[n, :m], diff --git a/mumbai/setplot.py b/mumbai/setplot.py index b1971784..f06d7426 100644 --- a/mumbai/setplot.py +++ b/mumbai/setplot.py @@ -64,7 +64,7 @@ # Gauge name translation gauge_landfall = [] -for i in xrange(3): +for i in range(3): if storm_num == 1: # Storm 1 gauge_landfall.append(datetime.datetime(1997, 11, 15, 3) - datetime.datetime(1997, 1, 1, 0)) @@ -163,7 +163,7 @@ def add_custom_colorbar_ticks_to_axes(axes, item_name, ticks, tick_labels=None): full_xlimits = regions['Full Domain (Grids)'][0] full_ylimits = regions['Full Domain (Grids)'][1] - for (name, region_data) in regions.iteritems(): + for (name, region_data) in regions.items(): # # Surface @@ -251,7 +251,7 @@ def friction_after_axes(cd): # ========================== grids = [[0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1]] label = ["(No Grids)", "(Grids)"] - for i in xrange(2): + for i in range(2): # Pressure field plotfigure = plotdata.new_plotfigure(name='Pressure %s' % label[i], figno=fig_num_counter.get_counter()) diff --git a/mumbai/setrun.py b/mumbai/setrun.py index 09ce4226..d9e6305a 100644 --- a/mumbai/setrun.py +++ b/mumbai/setrun.py @@ -381,7 +381,7 @@ def setgeo(rundata): try: geo_data = rundata.geo_data except: - print "*** Error, this rundata has no geo_data attribute" + print("*** Error, this rundata has no geo_data attribute") raise AttributeError("Missing geo_data attribute") # == Physics == diff --git a/nicholas/Makefile b/nicholas_2021/Makefile similarity index 100% rename from nicholas/Makefile rename to nicholas_2021/Makefile diff --git a/nicholas/readme.md b/nicholas_2021/README.md similarity index 100% rename from nicholas/readme.md rename to nicholas_2021/README.md diff --git a/nicholas/images/station1.png b/nicholas_2021/images/station1.png similarity index 100% rename from nicholas/images/station1.png rename to nicholas_2021/images/station1.png diff --git a/nicholas/images/station2.png b/nicholas_2021/images/station2.png similarity index 100% rename from nicholas/images/station2.png rename to nicholas_2021/images/station2.png diff --git a/nicholas/images/station3.png b/nicholas_2021/images/station3.png similarity index 100% rename from nicholas/images/station3.png rename to nicholas_2021/images/station3.png diff --git a/nicholas/images/station4.png b/nicholas_2021/images/station4.png similarity index 100% rename from nicholas/images/station4.png rename to nicholas_2021/images/station4.png diff --git a/nicholas/images/station5.png b/nicholas_2021/images/station5.png similarity index 100% rename from nicholas/images/station5.png rename to nicholas_2021/images/station5.png diff --git a/nicholas/images/station6.png b/nicholas_2021/images/station6.png similarity index 100% rename from nicholas/images/station6.png rename to nicholas_2021/images/station6.png diff --git a/nicholas/setplot.py b/nicholas_2021/setplot.py similarity index 100% rename from nicholas/setplot.py rename to nicholas_2021/setplot.py diff --git a/nicholas/setrun.py b/nicholas_2021/setrun.py similarity index 100% rename from nicholas/setrun.py rename to nicholas_2021/setrun.py diff --git a/nicole/Makefile b/nicole_2022/Makefile similarity index 100% rename from nicole/Makefile rename to nicole_2022/Makefile diff --git a/nicole/readme.md b/nicole_2022/README.md similarity index 100% rename from nicole/readme.md rename to nicole_2022/README.md diff --git a/nicole/setplot.py b/nicole_2022/setplot.py similarity index 100% rename from nicole/setplot.py rename to nicole_2022/setplot.py diff --git a/nicole/setrun.py b/nicole_2022/setrun.py similarity index 100% rename from nicole/setrun.py rename to nicole_2022/setrun.py diff --git a/noel/Makefile b/noel_2007/Makefile similarity index 100% rename from noel/Makefile rename to noel_2007/Makefile diff --git a/noel/README.md b/noel_2007/README.md similarity index 100% rename from noel/README.md rename to noel_2007/README.md diff --git a/noel/comparison_gauge_data.py b/noel_2007/comparison_gauge_data.py similarity index 100% rename from noel/comparison_gauge_data.py rename to noel_2007/comparison_gauge_data.py diff --git a/noel/setplot.py b/noel_2007/setplot.py similarity index 100% rename from noel/setplot.py rename to noel_2007/setplot.py diff --git a/noel/setrun.py b/noel_2007/setrun.py similarity index 100% rename from noel/setrun.py rename to noel_2007/setrun.py diff --git a/ophelia/Makefile b/ophelia_2017/Makefile similarity index 100% rename from ophelia/Makefile rename to ophelia_2017/Makefile diff --git a/ophelia/README.md b/ophelia_2017/README.md similarity index 100% rename from ophelia/README.md rename to ophelia_2017/README.md diff --git a/ophelia/setplot.py b/ophelia_2017/setplot.py similarity index 100% rename from ophelia/setplot.py rename to ophelia_2017/setplot.py diff --git a/ophelia/setrun.py b/ophelia_2017/setrun.py similarity index 100% rename from ophelia/setrun.py rename to ophelia_2017/setrun.py diff --git a/sally/Makefile b/sally_2020/Makefile similarity index 100% rename from sally/Makefile rename to sally_2020/Makefile diff --git a/sally/README.md b/sally_2020/README.md similarity index 100% rename from sally/README.md rename to sally_2020/README.md diff --git a/sally/gauges.csv b/sally_2020/gauges.csv similarity index 100% rename from sally/gauges.csv rename to sally_2020/gauges.csv diff --git a/sally/images/map.png b/sally_2020/images/map.png similarity index 100% rename from sally/images/map.png rename to sally_2020/images/map.png diff --git a/sally/images/path.png b/sally_2020/images/path.png similarity index 100% rename from sally/images/path.png rename to sally_2020/images/path.png diff --git a/sally/images/station1.png b/sally_2020/images/station1.png similarity index 100% rename from sally/images/station1.png rename to sally_2020/images/station1.png diff --git a/sally/images/station10.png b/sally_2020/images/station10.png similarity index 100% rename from sally/images/station10.png rename to sally_2020/images/station10.png diff --git a/sally/images/station2.png b/sally_2020/images/station2.png similarity index 100% rename from sally/images/station2.png rename to sally_2020/images/station2.png diff --git a/sally/images/station3.png b/sally_2020/images/station3.png similarity index 100% rename from sally/images/station3.png rename to sally_2020/images/station3.png diff --git a/sally/images/station4.png b/sally_2020/images/station4.png similarity index 100% rename from sally/images/station4.png rename to sally_2020/images/station4.png diff --git a/sally/images/station5.png b/sally_2020/images/station5.png similarity index 100% rename from sally/images/station5.png rename to sally_2020/images/station5.png diff --git a/sally/images/station6.png b/sally_2020/images/station6.png similarity index 100% rename from sally/images/station6.png rename to sally_2020/images/station6.png diff --git a/sally/images/station7.png b/sally_2020/images/station7.png similarity index 100% rename from sally/images/station7.png rename to sally_2020/images/station7.png diff --git a/sally/images/station8.png b/sally_2020/images/station8.png similarity index 100% rename from sally/images/station8.png rename to sally_2020/images/station8.png diff --git a/sally/images/station9.png b/sally_2020/images/station9.png similarity index 100% rename from sally/images/station9.png rename to sally_2020/images/station9.png diff --git a/sally/setplot.py b/sally_2020/setplot.py similarity index 100% rename from sally/setplot.py rename to sally_2020/setplot.py diff --git a/sally/setrun.py b/sally_2020/setrun.py similarity index 100% rename from sally/setrun.py rename to sally_2020/setrun.py diff --git a/sandy/Makefile b/sandy/Makefile deleted file mode 100644 index 8df1ec64..00000000 --- a/sandy/Makefile +++ /dev/null @@ -1,76 +0,0 @@ - -# Makefile for Clawpack code in this directory. -# This version only sets the local files and frequently changed -# options, and then includes the standard makefile pointed to by CLAWMAKE. -CLAWMAKE = $(CLAW)/clawutil/src/Makefile.common - -# See the above file for details and a list of make options, or type -# make .help -# at the unix prompt. - - -# Adjust these variables if desired: -# ---------------------------------- - -CLAW_PKG = geoclaw # Clawpack package to use -EXE = xgeoclaw # Executable to create -SETRUN_FILE = setrun.py # File containing function to make data -OUTDIR = _output # Directory for output -SETPLOT_FILE = setplot.py # File containing function to set plots -PLOTDIR = _plots # Directory for plots - -# Environment variable FC should be set to fortran compiler, e.g. gfortran -FFLAGS += -DNETCDF -lnetcdff -I$(NETCDF4_DIR)/include -L$(NETCDF4_DIR)$ - - -# Need to add LFLAGS here explicitly otherwise will not be linked -LFLAGS += -lnetcdff -L$(NETCDF4_DIR)/lib - - -# --------------------------------- -# package sources for this program: -# --------------------------------- - -GEOLIB = $(CLAW)/geoclaw/src/2d/shallow -include $(GEOLIB)/Makefile.geoclaw - -# --------------------------------------- -# package sources specifically to exclude -# (i.e. if a custom replacement source -# under a different name is provided) -# --------------------------------------- - -EXCLUDE_MODULES = \ - -EXCLUDE_SOURCES = \ - -# ---------------------------------------- -# List of custom sources for this program: -# ---------------------------------------- - -RIEMANN = $(CLAW)/riemann/src - -MODULES = \ - -SOURCES = \ - $(RIEMANN)/rpn2_geoclaw.f \ - $(RIEMANN)/rpt2_geoclaw.f \ - $(RIEMANN)/geoclaw_riemann_utils.f \ - -#------------------------------------------------------------------- -# Include Makefile containing standard definitions and make options: -include $(CLAWMAKE) - -.PHONY: topo all - -# Construct the topography data -topo: - ../bathy/get_bathy.py ../bathy/ - --all: - $(MAKE) topo - $(MAKE) .plots - - -### DO NOT remove this line - make depends on it ### - diff --git a/sandy/setplot.py b/sandy/setplot.py deleted file mode 100644 index 4ac2a5dd..00000000 --- a/sandy/setplot.py +++ /dev/null @@ -1,281 +0,0 @@ -from __future__ import absolute_import -from __future__ import print_function - -import os - -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 clawdata -import clawpack.amrclaw.data as amrclaw -import clawpack.geoclaw.data as geodata -import clawpack.geoclaw.topotools as topotools - -import clawpack.geoclaw.util as geoutil -import clawpack.geoclaw.surge.plot as surgeplot -# to compare actual gauge data plot: -import csv -from clawpack.geoclaw.util import fetch_noaa_tide_data - -try: - from setplotfg import setplotfg -except: - setplotfg = None - -def days2seconds(days): - return days * 60.0**2 * 24.0 - -def setplot(plotdata): - r"""Setplot function for surge plotting""" - - - plotdata.clearfigures() # clear any old figures,axes,items data - plotdata.format = 'ascii' - - # Load data from output - claw_data = clawdata.ClawInputData(2) - claw_data.read(os.path.join(plotdata.outdir, 'claw.data')) - physics = geodata.GeoClawData() - physics.read(os.path.join(plotdata.outdir, 'geoclaw.data')) - surge_data = geodata.SurgeData() - surge_data.read(os.path.join(plotdata.outdir, 'surge.data')) - friction_data = geodata.FrictionData() - friction_data.read(os.path.join(plotdata.outdir, 'friction.data')) - - # Load storm track - track = surgeplot.track_data(os.path.join(plotdata.outdir,'fort.track')) - - # Set afteraxes function - surge_afteraxes = lambda cd: surgeplot.surge_afteraxes(cd, track, - plot_direction=False) - - def plot_coastline(cd): - """Load fine coastline for plotting around NYC""" - try: - # Assumes that at path theres a fine topography file in NetCDF file format - path = "/Users/mandli/Dropbox/research/data/topography/atlantic/sandy_bathy/ny_area.nc" - topo_file = topotools.Topography(path, topo_type=4) - topo_file.read(nc_params={"x_var":"lon", - "y_var":"lat", - "z_var": "Band1"}) - - axes = plt.gca() - axes.contour(topo_file.X, topo_file.Y, topo_file.Z, - levels=[-0.001, 0.001], - colors='k', linestyles='-') - except: - pass - - surge_afteraxes(cd) - - # Color limits - surface_range = 4.5 - speed_range = 1.0 - # speed_range = 1.e-2 - - eta = physics.sea_level - if not isinstance(eta,list): - eta = [eta] - surface_limits = [eta[0]-surface_range,eta[0]+surface_range] - speed_limits = [0.0,speed_range] - - wind_limits = [0, 55] - pressure_limits = [966, 1013] - friction_bounds = [0.01, 0.04] - vorticity_limits = [-1.e-2, 1.e-2] - land_bounds = [-10, 50] - - - # ========================================================================== - # Plot specifications - # ========================================================================== - # Limits for plots - regions = {'Full Domain': {"xlimits": [claw_data.lower[0], claw_data.upper[0]], - "ylimits": [claw_data.lower[1], claw_data.upper[1]], - "shrink": 1.0, - "figsize": [6.4, 4.8]}, - 'Tri-State Region': {"xlimits": [-74.5,-71.0], - "ylimits": [40.0,41.5], - "shrink": 1.0, - "figsize": [6.4, 4.8]}, - 'NYC': {"xlimits": [-74.2,-73.7], - "ylimits": [40.4,40.85], - "shrink": 1.0, - "figsize": [6.4, 4.8]} - } - 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) - - for (name, region_dict) in regions.items(): - # ======================================================================== - # Surface Elevations - # ======================================================================== - plotfigure = plotdata.new_plotfigure(name='Surface - %s' % name) - plotfigure.show = True - - # Set up for axes in this figure: - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Surface' - plotaxes.scaled = True - plotaxes.xlimits = region_dict['xlimits'] - plotaxes.ylimits = region_dict['ylimits'] - plotaxes.afteraxes = plot_coastline - # plotaxes.afteraxes = surge_afteraxes - # plotaxes.afteraxes = gauge_location_afteraxes - - surgeplot.add_surface_elevation(plotaxes, bounds=surface_limits, - shrink=region_dict['shrink']) - surgeplot.add_land(plotaxes, bounds=land_bounds) - - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0,0,0] - plotaxes.plotitem_dict['surface'].amr_patchedges_show = [0,0,0] - - - # ======================================================================== - # Water Speed - # ======================================================================== - plotfigure = plotdata.new_plotfigure(name='Currents - %s' % name) - plotfigure.show = True - - # Set up for axes in this figure: - plotaxes = plotfigure.new_plotaxes() - plotaxes.title = 'Currents' - plotaxes.scaled = True - plotaxes.xlimits = region_dict['xlimits'] - plotaxes.ylimits = region_dict['ylimits'] - plotaxes.afteraxes = plot_coastline - - surgeplot.add_speed(plotaxes, bounds=speed_limits, - shrink=region_dict['shrink']) - surgeplot.add_land(plotaxes, bounds=land_bounds) - - plotaxes.plotitem_dict['land'].amr_patchedges_show = [0,0,0] - plotaxes.plotitem_dict['speed'].amr_patchedges_show = [0,0,0] - - - - # ======================================================================== - # Hurricane forcing - Entire Atlantic - # ======================================================================== - # Friction field - plotfigure = plotdata.new_plotfigure(name='Friction') - plotfigure.show = False - - plotaxes = plotfigure.new_plotaxes() - plotaxes.xlimits = regions['Full Domain']['xlimits'] - plotaxes.ylimits = regions['Full Domain']['ylimits'] - plotaxes.title = "Manning's N Coefficients" - plotaxes.afteraxes = surge_afteraxes - plotaxes.scaled = True - - surgeplot.add_friction(plotaxes,bounds=friction_bounds) - - # Pressure field - plotfigure = plotdata.new_plotfigure(name='Pressure') - plotfigure.show = True - - plotaxes = plotfigure.new_plotaxes() - plotaxes.xlimits = regions['Full Domain']['xlimits'] - plotaxes.ylimits = regions['Full Domain']['ylimits'] - plotaxes.title = "Pressure Field" - plotaxes.afteraxes = surge_afteraxes - plotaxes.scaled = True - - surgeplot.add_pressure(plotaxes,bounds=pressure_limits) - surgeplot.add_land(plotaxes, bounds=[-10, 500]) - - # Wind field - plotfigure = plotdata.new_plotfigure(name='Wind Speed') - plotfigure.show = True - - plotaxes = plotfigure.new_plotaxes() - - plotaxes.xlimits = regions['Full Domain']['xlimits'] - plotaxes.ylimits = regions['Full Domain']['ylimits'] - plotaxes.title = "Wind Field" - plotaxes.afteraxes = surge_afteraxes - plotaxes.scaled = True - - surgeplot.add_wind(plotaxes,bounds=wind_limits,plot_type='imshow') - surgeplot.add_land(plotaxes, bounds=[-10, 500]) - # ======================================================================== - # Figures for gauges - # ======================================================================== - plotfigure = plotdata.new_plotfigure(name='Surface & topo', figno=300, \ - type='each_gauge') - plotfigure.show = True - plotfigure.clf_each_gauge = True - - stations = [('8518750', 'The Battery, NY'), - ('8516945', 'Kings Point, NY'), - ('8519483', 'Bergen Point West Reach, NY')] - #('8531680','Sandy Hook, NY'), - #('n03020','Narrows,NY')] - - landfall_time = np.datetime64('2012-10-29T23:30') - begin_date = datetime.datetime(2012, 10, 28) - end_date = datetime.datetime(2012, 10, 31,) - - def get_actual_water_levels(station_id): - # Fetch water levels and tide predictions for given station - date_time, water_level, tide = fetch_noaa_tide_data(station_id, - begin_date, end_date) - - # Calculate times relative to landfall - seconds_rel_landfall = (date_time - landfall_time) / np.timedelta64(1, 's') - # Subtract tide predictions from measured water levels - water_level -= tide - - return seconds_rel_landfall, water_level - - def gauge_afteraxes(cd): - station_id, station_name = stations[cd.gaugeno-1] - seconds_rel_landfall, actual_level = get_actual_water_levels(station_id) - - axes = plt.gca() - #surgeplot.plot_landfall_gauge(cd.gaugesoln, axes, landfall=landfall) - axes.plot(seconds_rel_landfall, actual_level, 'g') - - # Fix up plot - in particular fix time labels - axes.set_title(station_name) - axes.set_xlabel('Seconds relative to landfall') - axes.set_ylabel('Surface (m)') - axes.set_xlim([days2seconds(-2), days2seconds(1)]) - axes.set_ylim([0, 4]) - axes.set_xticks([ days2seconds(-2), days2seconds(-1), 0, days2seconds(1)]) - #axes.set_xticklabels([r"$-3$", r"$-2$", r"$-1$", r"$0$", r"$1$"]) - #axes.grid(True) - - # Set up for axes in this figure: - plotaxes = plotfigure.new_plotaxes() - plotaxes.afteraxes = gauge_afteraxes - - # Plot surface as blue curve: - plotitem = plotaxes.new_plotitem(plot_type='1d_plot') - plotitem.plot_var = 3 - plotitem.plotstyle = 'b-' - - #----------------------------------------- - - # Parameters used only when creating html and/or latex hardcopy - # e.g., via pyclaw.plotters.frametools.printframes: - - plotdata.printfigs = True # print figures - plotdata.print_format = 'png' # file format - plotdata.print_framenos = 'all' # list of frames 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.html_homelink = '../README.html' # pointer for top of index - plotdata.latex = True # create latex file of plots? - plotdata.latex_figsperline = 2 # layout of plots - plotdata.latex_framesperline = 1 # layout of plots - plotdata.latex_makepdf = False # also run pdflatex? - - return plotdata diff --git a/sandy/setrun.py b/sandy/setrun.py deleted file mode 100644 index ab3a5688..00000000 --- a/sandy/setrun.py +++ /dev/null @@ -1,513 +0,0 @@ -#!/usr/bin/python3 -from __future__ import absolute_import -from __future__ import print_function - -#ensure# encoding: utf-8 -""" -Module to set up run time parameters for Clawpack. - -The values set in the function setrun are then written out to data files -that will be read in by the Fortran code. - -""" - -import os -# to exract all the fine grid topography data from /bathy -import glob -import sys -import datetime -import shutil -import gzip - -import numpy as np - -from clawpack.geoclaw.surge.storm import Storm -import clawpack.clawutil as clawutil - - -# Time Conversions -def days2seconds(days): - return days * 60.0**2 * 24.0 - - -#------------------------------ -def setrun(claw_pkg='geoclaw'): -#------------------------------ - """ - Define the parameters used for running Clawpack. - - INPUT: - claw_pkg expected to be "geoclaw" for this setrun. - - OUTPUT: - rundata - object of class ClawRunData - - """ - - from clawpack.clawutil import data as clawdata - - assert claw_pkg.lower() == 'geoclaw', "Expected claw_pkg = 'geoclaw'" - - num_dim = 2 - rundata = clawdata.ClawRunData(claw_pkg, num_dim) - - #------------------------------------------------------------------ - # Problem-specific parameters to be written to setprob.data: - #------------------------------------------------------------------ - - #probdata = rundata.new_UserData(name='probdata',fname='setprob.data') - - #------------------------------------------------------------------ - # Standard Clawpack parameters to be written to claw.data: - # (or to amr2ez.data for AMR) - #------------------------------------------------------------------ - clawdata = rundata.clawdata # initialized when rundata instantiated - - - # Set single grid parameters first. - # See below for AMR parameters. - - - # --------------- - # Spatial domain: - # --------------- - - # Number of space dimensions: - clawdata.num_dim = num_dim - - # Lower and upper edge of computational domain: - # clawdata.lower[0] = -85.0 # west longitude - # clawdata.upper[0] = -55.0 # east longitude - - # clawdata.lower[1] = 13.0 # south latitude - # clawdata.upper[1] = 45.0 # north latitude - - clawdata.lower[0] = -88.0 # west longitude - clawdata.upper[0] = -55.0 # east longitude - - clawdata.lower[1] = 15.0 # south latitude - clawdata.upper[1] = 45.0 # north latitude - - - # Number of grid cells: - degree_factor = 4 - clawdata.num_cells[0] = int(clawdata.upper[0] - clawdata.lower[0]) * degree_factor - clawdata.num_cells[1] = int(clawdata.upper[1] - clawdata.lower[1]) * degree_factor - - # --------------- - # Size of system: - # --------------- - - # Number of equations in the system: - clawdata.num_eqn = 3 - - # Number of auxiliary variables in the aux array (initialized in setaux) - clawdata.num_aux = 3 + 1 + 3 - - # Index of aux array corresponding to capacity function, if there is one: - clawdata.capa_index = 2 - - - - # ------------- - # Initial time: - # ------------- - - clawdata.t0 = days2seconds(-2.0) - - - # Restart from checkpoint file of a previous run? - # Note: If restarting, you must also change the Makefile to set: - # RESTART = False - # If restarting, t0 above should be from original run, and the - # restart_file 'fort.chkNNNNN' specified below should be in - # the OUTDIR indicated in Makefile. - - clawdata.restart = False # True to restart from prior results - clawdata.restart_file = 'fort.chk00043' # File to use for restart data - - # ------------- - # Output times: - #-------------- - - # Specify at what times the results should be written to fort.q files. - # Note that the time integration stops after the final output time. - # The solution at initial time t0 is always written in addition. - - clawdata.output_style = 1 - - if clawdata.output_style==1: - # Output nout frames at equally spaced times up to tfinal: - # day s/hour hours/day - - clawdata.tfinal = days2seconds(1.0) - - # Output occurrence per day, 24 = every hour, 4 = every 6 hours - recurrence = 24 - clawdata.num_output_times = int((clawdata.tfinal - clawdata.t0) - * recurrence / (60**2 * 24)) - - clawdata.output_t0 = True # output at initial (or restart) time? - - - elif clawdata.output_style == 2: - # Specify a list of output times. - clawdata.output_times = [0.5, 1.0] - - elif clawdata.output_style == 3: - # Output every iout timesteps with a total of ntot time steps: - clawdata.output_step_interval = 1 - clawdata.total_steps = 1 - clawdata.output_t0 = True - - - clawdata.output_format = 'ascii' # 'ascii' or 'netcdf' - - clawdata.output_q_components = 'all' # could be list such as [True,True] - clawdata.output_aux_components = 'all' - clawdata.output_aux_onlyonce = False # output aux arrays only at t0 - - - - # --------------------------------------------------- - # Verbosity of messages to screen during integration: - # --------------------------------------------------- - - # The current t, dt, and cfl will be printed every time step - # at AMR levels <= verbosity. Set verbosity = 0 for no printing. - # (E.g. verbosity == 2 means print only on levels 1 and 2.) - clawdata.verbosity = 4 - - - - # -------------- - # Time stepping: - # -------------- - - # if dt_variable==1: variable time steps used based on cfl_desired, - # if dt_variable==0: fixed time steps dt = dt_initial will always be used. - clawdata.dt_variable = True - - # Initial time step for variable dt. - # If dt_variable==0 then dt=dt_initial for all steps: - clawdata.dt_initial = 0.016 - - # Max time step to be allowed if variable dt used: - clawdata.dt_max = 1e+99 - - # Desired Courant number if variable dt used, and max to allow without - # retaking step with a smaller dt: - # clawdata.cfl_desired = 0.75 - clawdata.cfl_desired = 0.75 - clawdata.cfl_max = 1.0 - - # Maximum number of time steps to allow between output times: - clawdata.steps_max = 2**16 - - - - - # ------------------ - # Method to be used: - # ------------------ - - # Order of accuracy: 1 => Godunov, 2 => Lax-Wendroff plus limiters - clawdata.order = 2 - - # Use dimensional splitting? (not yet available for AMR) - clawdata.dimensional_split = 'unsplit' - - # For unsplit method, transverse_waves can be - # 0 or 'none' ==> donor cell (only normal solver used) - # 1 or 'increment' ==> corner transport of waves - # 2 or 'all' ==> corner transport of 2nd order corrections too - clawdata.transverse_waves = 2 - - # Number of waves in the Riemann solution: - clawdata.num_waves = 3 - - # List of limiters to use for each wave family: - # Required: len(limiter) == num_waves - # Some options: - # 0 or 'none' ==> no limiter (Lax-Wendroff) - # 1 or 'minmod' ==> minmod - # 2 or 'superbee' ==> superbee - # 3 or 'mc' ==> MC limiter - # 4 or 'vanleer' ==> van Leer - clawdata.limiter = ['mc', 'mc', 'mc'] - - clawdata.use_fwaves = True # True ==> use f-wave version of algorithms - - # Source terms splitting: - # src_split == 0 or 'none' ==> no source term (src routine never called) - # src_split == 1 or 'godunov' ==> Godunov (1st order) splitting used, - # src_split == 2 or 'strang' ==> Strang (2nd order) splitting used, not recommended. - clawdata.source_split = 'godunov' - - - # -------------------- - # Boundary conditions: - # -------------------- - - # Number of ghost cells (usually 2) - clawdata.num_ghost = 2 - - # Choice of BCs at xlower and xupper: - # 0 => user specified (must modify bcN.f to use this option) - # 1 => extrapolation (non-reflecting outflow) - # 2 => periodic (must specify this at both boundaries) - # 3 => solid wall for systems where q(2) is normal velocity - - clawdata.bc_lower[0] = 'extrap' - clawdata.bc_upper[0] = 'extrap' - - clawdata.bc_lower[1] = 'extrap' - clawdata.bc_upper[1] = 'extrap' - - # Specify when checkpoint files should be created that can be - # used to restart a computation. - - clawdata.checkpt_style = 0 - - if clawdata.checkpt_style == 0: - # Do not checkpoint at all - pass - - elif clawdata.checkpt_style == 1: - # Checkpoint only at tfinal. - pass - - elif clawdata.checkpt_style == 2: - # Specify a list of checkpoint times. - clawdata.checkpt_times = [0.1,0.15] - - elif clawdata.checkpt_style == 3: - # Checkpoint every checkpt_interval timesteps (on Level 1) - # and at the final time. - clawdata.checkpt_interval = 5 - - - # --------------- - # AMR parameters: - # --------------- - amrdata = rundata.amrdata - - - # max number of refinement levels: - amrdata.amr_levels_max = 7 - - # List of refinement ratios at each level (length at least mxnest-1) - # amrdata.refinement_ratios_x = [2, 2, 2, 6, 16] - # amrdata.refinement_ratios_y = [2, 2, 2, 6, 16] - # amrdata.refinement_ratios_t = [2, 2, 2, 6, 16] <- ~ 9 meters - - amrdata.refinement_ratios_x = [2, 2, 2, 6, 8, 8] - amrdata.refinement_ratios_y = [2, 2, 2, 6, 8, 8] - amrdata.refinement_ratios_t = [2, 2, 2, 6, 8, 8] - - - # Specify type of each aux variable in amrdata.auxtype. - # This must be a list of length maux, each element of which is one of: - # 'center', 'capacity', 'xleft', or 'yleft' (see documentation). - - amrdata.aux_type = ['center','capacity','yleft','center','center','center', - 'center', 'center', 'center'] - - - - # Flag using refinement routine flag2refine rather than richardson error - amrdata.flag_richardson = False # use Richardson? - amrdata.flag2refine = True - - # steps to take on each level L between regriddings of level L+1: - amrdata.regrid_interval = 4 - - # width of buffer zone around flagged points: - # (typically the same as regrid_interval so waves don't escape): - amrdata.regrid_buffer_width = 2 - - # clustering alg. cutoff for (# flagged pts) / (total # of cells refined) - # (closer to 1.0 => more small grids may be needed to cover flagged cells) - amrdata.clustering_cutoff = 0.700000 - - # print info about each regridding up to this level: - amrdata.verbosity_regrid = 0 - - - # ----- For developers ----- - # Toggle debugging print statements: - amrdata.dprint = False # print domain flags - amrdata.eprint = False # print err est flags - amrdata.edebug = False # even more err est flags - amrdata.gprint = False # grid bisection/clustering - amrdata.nprint = False # proper nesting output - amrdata.pprint = False # proj. of tagged points - amrdata.rprint = False # print regridding summary - amrdata.sprint = False # space/memory output - amrdata.tprint = False # time step reporting each level - amrdata.uprint = False # update/upbnd reporting - - # More AMR parameters can be set -- see the defaults in pyclaw/data.py - - # == setregions.data values == - regions = rundata.regiondata.regions - # to specify regions of refinement append lines of the form - # [minlevel,maxlevel,t1,t2,x1,x2,y1,y2] - # regions.append([1,6,days2seconds(-0.45),days2seconds(0.10),-74.1,-73.7,40.55,48.5]) - # regions.append([1,5,days2seconds(0.10),days2seconds(1),-74.2,-73.7,40.55,48.5]) - - - # == setgauges.data values == - # for gauges append lines of the form [gaugeno, x, y, t1, t2] - # battery gauge - rundata.gaugedata.gauges.append([1,-74.013,40.7,clawdata.t0,clawdata.tfinal]) - # Kings point gauge - rundata.gaugedata.gauges.append([2,-73.77,40.81,clawdata.t0,clawdata.tfinal]) - # Sandy Hook gauge - # rundata.gaugedata.gauges.append([3,-74.01,40.47,clawdata.t0,clawdata.tfinal]) - # Bergen Point West Reach - rundata.gaugedata.gauges.append([3,-74.14166,40.6367,clawdata.t0,clawdata.tfinal]) - # Narrows - # rundata.gaugedata.gauges.append([4,-74.038,40.605,clawdata.t0,clawdata.tfinal]) - - #------------------------------------------------------------------ - # GeoClaw specific parameters: - #------------------------------------------------------------------ - rundata = setgeo(rundata) - - return rundata - # end of function setrun - # ---------------------- - - -#------------------- -def setgeo(rundata): -#------------------- - """ - Set GeoClaw specific runtime parameters. - For documentation see .... - """ - - try: - geo_data = rundata.geo_data - except: - print("*** Error, this rundata has no geodata attribute") - raise AttributeError("Missing geodata attribute") - - # == Physics == - geo_data.gravity = 9.81 - geo_data.coordinate_system = 2 - geo_data.earth_radius = 6367.5e3 - geo_data.rho = 1025.0 - geo_data.rho_air = 1.15 - geo_data.ambient_pressure = 101.3e3 - - # == Forcing Options - geo_data.coriolis_forcing = True - geo_data.friction_forcing = True - geo_data.friction_depth = 1e10 - - # == Algorithm and Initial Conditions == - geo_data.sea_level = 0.0 - geo_data.dry_tolerance = 1.e-2 - - # Refinement Criteria - refine_data = rundata.refinement_data - refine_data.wave_tolerance = 1.0 - refine_data.speed_tolerance = [1.0, 2.0, 3.0, 4.0] - refine_data.deep_depth = 300.0 - refine_data.max_level_deep = 4 - refine_data.variable_dt_refinement_ratios = True - - # == settopo.data values == - topo_data = rundata.topo_data - topo_data.topofiles = [] - # for topography, append lines of the form - # [topotype, minlevel, maxlevel, t1, t2, fname] - topo_path = os.path.join('..', 'bathy') - - topo_data.topofiles.append([3, 1, 3, days2seconds(-2), days2seconds(1), os.path.join(topo_path,'atlantic_1min.tt3')]) - topo_data.topofiles.append([3, 1, 7, days2seconds(-2), days2seconds(1), os.path.join(topo_path,'newyork_3s.tt3')]) # 90 meter accuracy - - # == setqinit.data values == - rundata.qinit_data.qinit_type = 0 - rundata.qinit_data.qinitfiles = [] - # for qinit perturbations, append lines of the form: (<= 1 allowed for now!) - # [minlev, maxlev, fname] - - # == setfixedgrids.data values == - rundata.fixed_grid_data.fixedgrids = [] - # for fixed grids append lines of the form - # [t1,t2,noutput,x1,x2,y1,y2,xpoints,ypoints,\ - # ioutarrivaltimes,ioutsurfacemax] - - # ================ - # Set Surge Data - # ================ - data = rundata.surge_data - - # Source term controls - data.wind_forcing = True - data.drag_law = 1 - data.pressure_forcing = True - - data.display_landfall_time = True - - # AMR parameters - data.wind_refine = [20.0,40.0,60.0] # m/s - data.R_refine = [60.0e3,40e3,20e3] # m - - # Storm parameters - data.storm_specification_type = "holland80" # Set type of storm field - data.storm_file = os.path.expandvars(os.path.join(os.getcwd(), - 'sandy.storm')) - - # Convert ATCF data to GeoClaw format - clawutil.data.get_remote_file( - "http://ftp.nhc.noaa.gov/atcf/archive/2012/bal182012.dat.gz", - output_dir=os.getcwd()) - atcf_path = os.path.join(os.getcwd(), "bal182012.dat") - # Note that the get_remote_file function does not support gzip files which - # are not also tar files. The following code handles this - with gzip.open(".".join((atcf_path, 'gz')), 'rb') as atcf_file: - with open(atcf_path, 'w') as atcf_unzipped_file: - atcf_unzipped_file.write(atcf_file.read().decode('ascii')) - - sandy = Storm(path=atcf_path, file_format="ATCF") - - # Calculate landfall time - Need to specify as the file above does not - # include this info (9/13/2008 ~ 7 UTC) - sandy.time_offset = datetime.datetime(2012,10,30,0,0) - - sandy.write(data.storm_file, file_format='geoclaw') - - # ======================= - # Set Variable Friction - # ======================= - data = rundata.friction_data - - # Variable friction - data.variable_friction = True - - # Region based friction - # Entire domain - seems high on land... - data.friction_regions.append([rundata.clawdata.lower, - rundata.clawdata.upper, - [np.infty,0.0,-np.infty], - [0.050, 0.025]]) - - - return rundata - # end of function setgeo - # ---------------------- - - -if __name__ == '__main__': - # Set up run-time parameters and write all data files. - import sys - if len(sys.argv) == 2: - rundata = setrun(sys.argv[1]) - else: - rundata = setrun() - - rundata.write() diff --git a/sandy_new/Makefile b/sandy_2012/Makefile similarity index 100% rename from sandy_new/Makefile rename to sandy_2012/Makefile diff --git a/sandy_new/readme.md b/sandy_2012/README.md similarity index 100% rename from sandy_new/readme.md rename to sandy_2012/README.md diff --git a/sandy_new/gauge_plots/gauge0001fig300.png b/sandy_2012/gauge_plots/gauge0001fig300.png similarity index 100% rename from sandy_new/gauge_plots/gauge0001fig300.png rename to sandy_2012/gauge_plots/gauge0001fig300.png diff --git a/sandy_new/gauge_plots/gauge0002fig300.png b/sandy_2012/gauge_plots/gauge0002fig300.png similarity index 100% rename from sandy_new/gauge_plots/gauge0002fig300.png rename to sandy_2012/gauge_plots/gauge0002fig300.png diff --git a/sandy_new/gauge_plots/gauge0003fig300.png b/sandy_2012/gauge_plots/gauge0003fig300.png similarity index 100% rename from sandy_new/gauge_plots/gauge0003fig300.png rename to sandy_2012/gauge_plots/gauge0003fig300.png diff --git a/sandy_new/gauge_plots/gauge0004fig300.png b/sandy_2012/gauge_plots/gauge0004fig300.png similarity index 100% rename from sandy_new/gauge_plots/gauge0004fig300.png rename to sandy_2012/gauge_plots/gauge0004fig300.png diff --git a/sandy_new/gauge_plots/gauge0005fig300.png b/sandy_2012/gauge_plots/gauge0005fig300.png similarity index 100% rename from sandy_new/gauge_plots/gauge0005fig300.png rename to sandy_2012/gauge_plots/gauge0005fig300.png diff --git a/sandy_new/gauge_plots/gauge0006fig300.png b/sandy_2012/gauge_plots/gauge0006fig300.png similarity index 100% rename from sandy_new/gauge_plots/gauge0006fig300.png rename to sandy_2012/gauge_plots/gauge0006fig300.png diff --git a/sandy_new/setplot.py b/sandy_2012/setplot.py similarity index 99% rename from sandy_new/setplot.py rename to sandy_2012/setplot.py index 4b0660af..c813a58f 100644 --- a/sandy_new/setplot.py +++ b/sandy_2012/setplot.py @@ -14,6 +14,7 @@ import clawpack.amrclaw.data as amrclaw import clawpack.geoclaw.data as geodata import clawpack.geoclaw.surge.plot as surgeplot +import clawpack.geoclaw.topotools as topotools import csv from clawpack.geoclaw.util import fetch_noaa_tide_data diff --git a/sandy_new/setrun.py b/sandy_2012/setrun.py similarity index 100% rename from sandy_new/setrun.py rename to sandy_2012/setrun.py diff --git a/scripts/gauge_comparison.py b/scripts/gauge_comparison.py index e83bbde5..c6a7e0f3 100755 --- a/scripts/gauge_comparison.py +++ b/scripts/gauge_comparison.py @@ -49,7 +49,7 @@ def read_tide_gauge_data(base_path, skiprows=5, verbose=True): station_info_file = open(os.path.join(base_path,'Ike_Gauges_web.txt'),'r') # Skip past header - for i in xrange(skiprows): + for i in range(skiprows): station_info_file.readline() # Read in each station @@ -66,7 +66,7 @@ def read_tide_gauge_data(base_path, skiprows=5, verbose=True): else: stations[data_line[0]]['gauge_no'] = int(data_line[1]) if verbose: - print "Station %s: %s" % (data_line[0],stations[data_line[0]]) + print("Station %s: %s" % (data_line[0],stations[data_line[0]])) # Load and extract real station data data = scipy.io.loadmat(os.path.join(base_path,'result_%s.mat' % data_line[0])) @@ -94,7 +94,7 @@ def read_adcirc_gauge_data(only_gauges=None, base_path="", verbose=True): data = np.loadtxt(gauge_file) stations[i+1] = data if verbose: - print "Read in ADCIRC gauge file %s" % gauge_file + print("Read in ADCIRC gauge file %s" % gauge_file) return stations @@ -129,10 +129,10 @@ def load_geoclaw_gauge_data(only_gauges=None, base_path="_output", verbose=True) try: file_path = os.path.join(base_path,'fort.gauge') if not os.path.exists(file_path): - print '*** Warning: cannot find gauge data file %s'%file_path + print('*** Warning: cannot find gauge data file %s'%file_path) pass else: - print "Reading gauge data from %s" % file_path + print("Reading gauge data from %s" % file_path) raw_data = np.loadtxt(file_path) gauge_read_string = "" @@ -151,11 +151,11 @@ def load_geoclaw_gauge_data(only_gauges=None, base_path="_output", verbose=True) gauges[n] = gauge if verbose: - print "Read in GeoClaw gauge [%s]" % gauge_read_string[1:] + print("Read in GeoClaw gauge [%s]" % gauge_read_string[1:]) except Exception as e: - print '*** Error reading gauges in ClawPlotData.getgauge' - print '*** outdir = ', base_path + print('*** Error reading gauges in ClawPlotData.getgauge') + print('*** outdir = ', base_path) raise e # for (i,gauge_no) in enumerate(gauge_list): @@ -165,7 +165,7 @@ def load_geoclaw_gauge_data(only_gauges=None, base_path="_output", verbose=True) elapsed = (time.clock() - start) - print "Single gauge reading elapsed time = %s" % elapsed + print("Single gauge reading elapsed time = %s" % elapsed) start = time.clock() raw_data = np.loadtxt(os.path.join(base_path,'fort.gauge')) @@ -183,7 +183,7 @@ def load_geoclaw_gauge_data(only_gauges=None, base_path="_output", verbose=True) # self.gaugesoln_dict[(n, outdir)] = gauge elapsed = (time.clock() - start) - print "All gauges reading elapsed time = %s" % elapsed + print("All gauges reading elapsed time = %s" % elapsed) return gauges diff --git a/bathy/.gitignore b/topo/.gitignore similarity index 100% rename from bathy/.gitignore rename to topo/.gitignore diff --git a/bathy/readme.md b/topo/README.md similarity index 100% rename from bathy/readme.md rename to topo/README.md diff --git a/topo/get_bathy.py b/topo/get_bathy.py new file mode 100755 index 00000000..183f393e --- /dev/null +++ b/topo/get_bathy.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python + +"""Fetch relevant bathymetry for the storm surge examples""" + +import argparse +import sys +import os + +# Only import matplotlib if needed +# import matplotlib.pyplot as plt + +# import clawpack.clawutil.data as data +# import clawpack.geoclaw.topotools as topotools + +# Dictionary containing storm mappings to topography data files +storm_topo = {"global": None, + "ike": ["carribean", "houston"], + "katrina": ["carribean", "nola"] + } + + +def plot_topo(): + pass + + +if __name__ == "__main__": + + # get_bathy.py [STORM_NAME(s)] --verbose --force --plot --output + + # Find unique set of topography files + # Prompt whether to get the requested files (force option to just go do that) + + parser = argparse.ArgumentParser(prog="get_bathy", description="Fetch topography for each of the storms requested.", epilog="The dude abides.") + parser.add_argument("storms", type=str, nargs="+", help="list of storms to fetch topography for") + parser.add_argument("-v", "--verbose", default=False, action="store_true", help="verbose command output") + parser.add_argument("-f", "--force", default=False, action="store_true", help="force command to proceed without asking") + parser.add_argument("-p", "--plot", default=False, action="store_true", help="plot topography files that have been requested") + parser.add_argument("-o", "--output", type=str, default=os.getcwd(), action="store", dest="output_dir", help="path to directory to place topography") + args = parser.parse_args() + + # Handle request for all storms + if 'all' in [value.lower() for value in args.storms]: + args.storms = set(storm_topo.keys()) + + # Reduce topography list to unique list + topo_list = [] + for storm_name in args.storms: + if storm_name not in storm_topo.keys(): + # Probably should just move on and ignore + # raise ValueError() + print("*** Warning: {} was not a known storm.".format(storm_name)) + else: + if storm_name.lower() == "global": + # Handle this special case + topo_list.append("global_strips") + else: + for topo_file in storm_topo[storm_name]: + topo_list.append(topo_file) + topo_list = set(topo_list) + + # Print out helpful message on list of topography files we will fetch + # Probably just describe what we are about to do + print("{} -> {}".format(args.storms, topo_list)) + + # Query user to continue + if not args.force: + value = input("Continue ([yes]/no): ") + if len(value) == 0: + value = 'y' + if not value[0].lower() == "y": + sys.exit(0) + + for topo_file in topo_list: + # Fetch file + if topo_file == "global": + print("Fetching strips for global topography.") + else: + print("Fetching {}".format(topo_file)) + + if args.plot: + print("Plotting topography...") diff --git a/bathy/thredds.py b/topo/thredds.py similarity index 100% rename from bathy/thredds.py rename to topo/thredds.py diff --git a/wilma/Makefile b/wilma/Makefile deleted file mode 100644 index 110c8f7a..00000000 --- a/wilma/Makefile +++ /dev/null @@ -1,59 +0,0 @@ - -# Makefile for Clawpack code in this directory. -# This version only sets the local files and frequently changed -# options, and then includes the standard makefile pointed to by CLAWMAKE. -CLAWMAKE = $(CLAW)/clawutil/src/Makefile.common - -# See the above file for details and a list of make options, or type -# make .help -# at the unix prompt. - - -# Adjust these variables if desired: -# ---------------------------------- - -CLAW_PKG = geoclaw # Clawpack package to use -EXE = xgeoclaw # Executable to create -SETRUN_FILE = setrun.py # File containing function to make data -OUTDIR = _output # Directory for output -SETPLOT_FILE = setplot.py # File containing function to set plots -PLOTDIR = _plots # Directory for plots - -# Environment variable FC should be set to fortran compiler, e.g. gfortran -FFLAGS ?= - -# --------------------------------- -# package sources for this program: -# --------------------------------- - -GEOLIB = $(CLAW)/geoclaw/src/2d/shallow -include $(GEOLIB)/Makefile.geoclaw - -# --------------------------------------- -# package sources specifically to exclude -# (i.e. if a custom replacement source -# under a different name is provided) -# --------------------------------------- - -EXCLUDE_MODULES = \ - -EXCLUDE_SOURCES = \ - -# ---------------------------------------- -# List of custom sources for this program: -# ---------------------------------------- - -RIEMANN = $(CLAW)/riemann/src - -MODULES = \ - -SOURCES = \ - $(RIEMANN)/rpn2_geoclaw.f \ - $(RIEMANN)/rpt2_geoclaw.f \ - $(RIEMANN)/geoclaw_riemann_utils.f \ - -#------------------------------------------------------------------- -# Include Makefile containing standard definitions and make options: -include $(CLAWMAKE) - -### DO NOT remove this line - make depends on it ### diff --git a/irene/Makefile b/wilma_2005/Makefile similarity index 100% rename from irene/Makefile rename to wilma_2005/Makefile diff --git a/wilma/README.md b/wilma_2005/README.md similarity index 100% rename from wilma/README.md rename to wilma_2005/README.md diff --git a/wilma/setplot.py b/wilma_2005/setplot.py similarity index 99% rename from wilma/setplot.py rename to wilma_2005/setplot.py index 64958f55..e47fd176 100644 --- a/wilma/setplot.py +++ b/wilma_2005/setplot.py @@ -13,7 +13,7 @@ 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 diff --git a/wilma/setrun.py b/wilma_2005/setrun.py similarity index 99% rename from wilma/setrun.py rename to wilma_2005/setrun.py index 9f362156..71bee925 100644 --- a/wilma/setrun.py +++ b/wilma_2005/setrun.py @@ -343,7 +343,7 @@ def setrun(claw_pkg='geoclaw'): #Specification of the Ruled Rectangle from clawpack.amrclaw import region_tools - slu = vstack(([26.4225, 26.5222, 26.5322, 26.6744], [-82.2194, -82.1958, -82.1033, -81.8778], [-81.9767, -81.9127, -81.9833, -81.8283])).T + slu = np.vstack(([26.4225, 26.5222, 26.5322, 26.6744], [-82.2194, -82.1958, -82.1033, -81.8778], [-81.9767, -81.9127, -81.9833, -81.8283])).T rr = region_tools.RuledRectangle(slu=slu) rr.method = 1 rr.ixy = 'y' diff --git a/zeta/Makefile b/zeta_2020/Makefile similarity index 100% rename from zeta/Makefile rename to zeta_2020/Makefile diff --git a/zeta/README.md b/zeta_2020/README.md similarity index 100% rename from zeta/README.md rename to zeta_2020/README.md diff --git a/zeta/gauges_final.csv b/zeta_2020/gauges_final.csv similarity index 100% rename from zeta/gauges_final.csv rename to zeta_2020/gauges_final.csv diff --git a/zeta/images/map.png b/zeta_2020/images/map.png similarity index 100% rename from zeta/images/map.png rename to zeta_2020/images/map.png diff --git a/zeta/images/path.png b/zeta_2020/images/path.png similarity index 100% rename from zeta/images/path.png rename to zeta_2020/images/path.png diff --git a/zeta/images/station1.png b/zeta_2020/images/station1.png similarity index 100% rename from zeta/images/station1.png rename to zeta_2020/images/station1.png diff --git a/zeta/images/station10.png b/zeta_2020/images/station10.png similarity index 100% rename from zeta/images/station10.png rename to zeta_2020/images/station10.png diff --git a/zeta/images/station11.png b/zeta_2020/images/station11.png similarity index 100% rename from zeta/images/station11.png rename to zeta_2020/images/station11.png diff --git a/zeta/images/station2.png b/zeta_2020/images/station2.png similarity index 100% rename from zeta/images/station2.png rename to zeta_2020/images/station2.png diff --git a/zeta/images/station3.png b/zeta_2020/images/station3.png similarity index 100% rename from zeta/images/station3.png rename to zeta_2020/images/station3.png diff --git a/zeta/images/station4.png b/zeta_2020/images/station4.png similarity index 100% rename from zeta/images/station4.png rename to zeta_2020/images/station4.png diff --git a/zeta/images/station5.png b/zeta_2020/images/station5.png similarity index 100% rename from zeta/images/station5.png rename to zeta_2020/images/station5.png diff --git a/zeta/images/station6.png b/zeta_2020/images/station6.png similarity index 100% rename from zeta/images/station6.png rename to zeta_2020/images/station6.png diff --git a/zeta/images/station7.png b/zeta_2020/images/station7.png similarity index 100% rename from zeta/images/station7.png rename to zeta_2020/images/station7.png diff --git a/zeta/images/station8.png b/zeta_2020/images/station8.png similarity index 100% rename from zeta/images/station8.png rename to zeta_2020/images/station8.png diff --git a/zeta/images/station9.png b/zeta_2020/images/station9.png similarity index 100% rename from zeta/images/station9.png rename to zeta_2020/images/station9.png diff --git a/zeta/setplot.py b/zeta_2020/setplot.py similarity index 100% rename from zeta/setplot.py rename to zeta_2020/setplot.py diff --git a/zeta/setrun.py b/zeta_2020/setrun.py similarity index 100% rename from zeta/setrun.py rename to zeta_2020/setrun.py