Skip to content

Commit fa17a33

Browse files
committed
update readme
1 parent d986ae8 commit fa17a33

File tree

1 file changed

+83
-28
lines changed

1 file changed

+83
-28
lines changed

README.md

Lines changed: 83 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,138 @@
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)[![Python package](https://github.com/sdat2/worstsurge/actions/workflows/python-package.yml/badge.svg)](https://github.com/sdat2/worstsurge/actions/workflows/python-package.yml)[![Documentation Status](https://readthedocs.org/projects/worstsurge/badge/?version=latest)](https://worstsurge.readthedocs.io/en/latest/?badge=latest)[![Code DOI](https://zenodo.org/badge/718141777.svg)](https://doi.org/10.5281/zenodo.15073504)[![EarthArXiv Preprint](https://img.shields.io/badge/EarthArXiv-doi:10.31223/X57T5R-blue?style=flat)](https://doi.org/10.31223/X57T5R)
44

5-
EarthArxiv preprint now available <https://doi.org/10.31223/X57T5R>!
5+
EarthArXiv preprint available at <https://doi.org/10.31223/X57T5R>.
66

7-
We want to answer the question of what the potential height of a storm surge could be now and in a changing climate. To do this we first calculate the potential intensity and size from CMIP6 (`tcpips` & `w22`), and then use a Bayesian optimization loop (`adbo`) to drive an storm surge model ADCIRC with idealised tropical cyclones (`adforce`). We then show that knowing the upper bound can be useful in the context of an evt fit (`worst`).
7+
We want to answer the question of what the potential height of a storm surge could be now and in a changing climate. To do this we first calculate the potential intensity and size from CMIP6 (`tcpips` & `w22`), and then use a Bayesian optimization loop (`adbo`) to drive a storm surge model ADCIRC with idealised tropical cyclones (`adforce`). We then show that knowing the upper bound can be useful in the context of an EVT fit (`worst`).
88

9-
All (or almost all) of the key experiments are carried out as `slurm` jobs, so go to `slurm/` to see these. `data/` contains some of the key data, and `img/` most of the key figures. `docs/` contains the source for the readthedocs documentation <https://worstsurge.readthedocs.io/en/latest/MAIN_README.html>.
9+
All (or almost all) of the key experiments are carried out as `slurm` jobs — see `slurm/`. `data/` contains some of the key data, and `img/` most of the key figures. `docs/` contains the source for the ReadTheDocs documentation at <https://worstsurge.readthedocs.io/en/latest/MAIN_README.html>.
1010

11-
## tcpips
11+
## Modules
1212

13-
Tropical Cyclone Potential Intensity (PI) and precursors for Potential Size (PS) calculations.
14-
Includes pangeo script to download and process data from CMIP6 for calculations. Currently regrids using `cdo` or `xESMf`.
15-
Uses the `tcpypi` pypi package to calculate potential intensity.
13+
### `tcpips`
1614

17-
## w22
15+
Tropical Cyclone Potential Intensity (PI) and precursors for Potential Size (PS) calculations. Includes a pangeo script to download and process CMIP6 data. Regrids using `cdo` or `xESMF`. Uses the `tcpypi` package to calculate potential intensity. Also includes `tcpips/ibtracs.py` to compare IBTrACS observations with potential sizes and intensities calculated from ERA5 monthly averages (post-1980), with filters for storms undergoing extratropical transition.
1816

19-
Used to calculate tropical cyclone potential size as in Wang et al. (2022). Used to use the Chavas et al. 2015 profile calculation in matlab (using octave instead from `w22/cle5m.py`).
20-
But now we have a new python implementation that is much faster and more stable, see `w22/cle15.py`. The implementation of Potential Size is in `w22/ps.py`.
17+
### `w22`
18+
19+
Calculates tropical cyclone potential size following Wang et al. (2022). The implementation of Potential Size is in `w22/ps.py`, which can now calculate both potential sizes together. `w22/stats2.py` generates tables describing CMIP6 results (for HadGEM3-GC31-MM, MIROC6, and CESM2).
2120

2221
```bash
23-
# to calculate the example potential size
22+
# Calculate example potential sizes
2423
python -m w22.ps
25-
# to calculate the tests against W22
24+
# Run tests against W22
2625
python -m w22.test
2726
```
2827

28+
### `cle15`
29+
30+
A standalone Python re-implementation of the Chavas, Lin & Emanuel (2015) tropical cyclone wind profile model. Three variants are provided:
31+
32+
| Module | Description |
33+
|---|---|
34+
| `cle15.py` | Pure-Python reference implementation |
35+
| `cle15n.py` | Numba-accelerated drop-in replacement (~10× faster) |
36+
| `cle15m.py` | Thin wrapper around the original MATLAB/Octave scripts in `mcle/` |
37+
38+
All three expose the same public API: `run_cle15`, `profile_from_stats`, `process_inputs`. The Numba implementation is now the default in `w22`.
39+
40+
```bash
41+
# Run benchmarks
42+
python -m cle15.bench_cle15
43+
# Run tests
44+
python -m cle15.test_cle15
45+
```
46+
47+
### `adforce`
2948

30-
## adforce
49+
An ADCIRC wrapper for forcing and post-processing. Handles idealised axisymmetric tropical cyclones (NWS=13, ADCIRC ≥ 55.02) with a gradient wind reduction factor of $V_\text{reduc} = 0.8$ for 10 m winds. Uses `hydra` for config management.
3150

32-
An ADCIRC wrapper that does ADCIRC forcing and processing. Some generic mesh processing is also included. Assumes gradient wind reduction factor V_reduc=0.8 for 10m wind. Runs using `hydra` for config management.
51+
Key files:
52+
- `fort22.py` — write wind/pressure `fort.22.nc` input files; supports `lc12` asymmetry and Ide et al. (2022) curved parabolic tracks.
53+
- `fort61.py` / `fort63.py` — read tide gauge and SSH/wind output.
54+
- `mesh.py` — fast mesh reading/processing; converts ADCIRC output to dual-graph format for GNN training.
55+
- `dual_graph.py` — dual-graph construction for ML training datasets.
56+
- `generate_training_data.py` — forces ADCIRC with IBTrACS historical U.S. landfalling storms (1980–2024) to generate SurgeNet training data.
57+
- `wrap.py` — orchestrates parallel ADCIRC runs on Archer2; the main file to edit when porting to a new machine.
58+
59+
Supports `pyproj` and a fast `sphere` approximation for distance calculations (controlled by `geoid` in `adforce/config/grid/grid_fort22.yaml`; defaults to `sphere`).
3360

3461
```bash
3562
python -m adforce.wrap
3663
```
3764

38-
Needs an executatable directory for ADCIRC that includes a `padcirc` and `adcprep` executable stored in `adforce/config/files/`.
65+
Requires `padcirc` and `adcprep` executables placed in `adforce/config/files/`. A repo with compilation settings and minor edits is available at <https://github.com/sdat2/adcirc-v55.02>.
3966

40-
A repo with our compilation settings for ADCIRC, and small edits, is available at <https://github.com/sdat2/adcirc-v55.02>.
67+
### `adbo`
4168

42-
## adbo
69+
Bayesian optimization using `adforce` to drive ADCIRC via a `trieste` optimization loop. Supports multiple GP kernels and acquisition functions. Uses `argparse` for top-level config management, then delegates to `hydra` inside `adbo`.
4370

44-
Bayesian optimization using `adforce` to force ADCIRC with a `trieste` Bayesian optimization loop. Runs using `argparse` for config management, and then calls `adbo` which uses `hydra` (it was not possible to have two layers of hydra configs for the two modules).
71+
Key scripts:
72+
- `exp_1d.py` — 1D Bayesian optimization experiment.
73+
- `exp_2d.py` / `exp_3d.py` — 2D and 3D experiments.
74+
- `gp_exp.py` — exploration of different GP kernels.
75+
- `create_test_set.py` — builds the potential-height test set (best BO run per location) for SurgeNet training.
4576

4677
```bash
4778
python -m adbo.exp_1d --test True --exp_name test
4879
```
4980

50-
## worst
81+
### `worst`
5182

52-
Statistical worst-case GEV fit using `tensorflow`. Varies whether to assume an upper bound ahead of time. Uses `hydra` for the config management.
83+
Statistical worst-case GEV fit with `scipy` (`sci.py`) and `tensorflow` (`tens.py`). Explores the effect of knowing the upper bound ahead of time on sampling uncertainty and bias. Uses `hydra` for config management.
5384

85+
GEV parameterisation used: location $\alpha$, scale $\beta > 0$, shape $\gamma < 0$ (Weibull), giving upper bound $z^\star = \alpha - \beta/\gamma$.
5486

55-
## Getting started
87+
```bash
88+
python -m worst.vary_gamma_beta
89+
python -m worst.vary_samples_ns
90+
```
91+
92+
### `surgenet`
93+
94+
Early-stage work on a graph neural network (GNN) emulator for storm surge, trained on ADCIRC output. Currently contains a toy example (`toy_example.py`) demonstrating pathological extrapolation behaviour of ReLU neural networks compared with the true analytical exceedance probability.
95+
96+
## Repository layout
5697

57-
Developer install:
98+
```
99+
adbo/ Bayesian optimization loop (trieste)
100+
adforce/ ADCIRC wrapper and forcing utilities
101+
cle15/ CLE15 wind profile implementations (pure-Python & Numba)
102+
data/ Key input data (fort.22.nc, IBTrACS, ERA5, CMIP6, etc.)
103+
docs/ ReadTheDocs source
104+
img/ Key figures
105+
slurm/ SLURM job scripts for all major experiments
106+
surgenet/ GNN storm surge emulator (early stage)
107+
tcpips/ Potential intensity & size from CMIP6/ERA5
108+
w22/ Wang et al. (2022) potential size calculation
109+
worst/ EVT upper-bound GEV fitting
110+
```
111+
112+
## Getting started
58113

59-
Use conda to install a python virtual environment:
114+
Use conda to create the environment:
60115

61116
```bash
62117
conda env create -n tcpips -f env.yml
63118
conda activate tcpips
64119
```
65120

66-
Alternatively use micromamba (faster):
121+
Or with micromamba (faster):
67122

68123
```bash
69124
micromamba create -n tcpips -f env.yml
70125
micromamba activate tcpips
71126
```
72127

73-
Install repository in editable version:
128+
Install the repository in editable mode:
74129

75130
```bash
76131
pip install -e .
77132
```
78133

79134
## Citations
80135

81-
If you use this code, please cite the following paper:
136+
If you use this code, please cite the preprint:
82137

83138
```bibtex
84139
@article{potential_height_paper_2025,
@@ -98,13 +153,13 @@ And cite the code as:
98153
doi = {10.5281/zenodo.15073504},
99154
month = {Nov},
100155
title = {{Finding the potential height of tropical cyclone storm surges in a changing climate using Bayesian Optimization}},
101-
url = {https://github.com/sdat2/PotentialHeight},
156+
url = {https://github.com/sdat2/worstsurge},
102157
version = {v0.1.3},
103158
year = {2025}
104159
}
105160
```
106161

107-
We used to use the matlab code from Chavas, Lin, and Emanuel (2015), which should be cited as:
162+
The CLE15 wind profile model (used via `cle15/`) should also be cited as:
108163

109164
```bibtex
110165
@software{cle_2015_code,

0 commit comments

Comments
 (0)