Tsunami-risk mitigation planning has particular importance for communities like those of the Pacific Northwest, where coastlines are extremely dynamic and a seismically active subduction zone looms large. The challenge does not stop here for risk managers: mitigation options have multiplied since communities have realized the viability and benefits of nature-based solutions. To identify suitable mitigation options for their community, risk managers need the ability to rapidly evaluate several different options through fast and accessible tsunami models, but they may lack high-performance computing infrastructure. The goal of this work is to leverage Google's Tensor Processing Unit (TPU), a high-performance hardware device accessible via the Google Cloud framework, to enable the rapid evaluation of different tsunami-risk mitigation strategies available to all communities. We establish a starting point through a numerical solver of the nonlinear shallow-water equations that uses a fifth-order weighted essentially non-oscillatory method with the Lax–Friedrichs flux splitting and a total variation diminishing third-order Runge–Kutta method for time discretization. We verify numerical solutions through several analytical solutions and benchmarks, reproduce several findings about one particular tsunami-risk mitigation strategy, and model tsunami runup at Crescent City, California whose topography comes from a high-resolution digital elevation model. The direct measurements of the simulation's performance, energy usage, and ease of execution show that our code could be a first step towards a community-based, user-friendly virtual laboratory that can be run by a minimally trained user on the cloud thanks to the ease of use of the Google Cloud platform.

The coast of the Pacific Northwest, from Cape Mendocino in California to northern Vancouver Island in Canada, as depicted in
Fig.

Map of the Cascadia subduction zone in the Pacific Northwest of the United States. Relative location of Crescent City with respect to the megathrust fault line, with a more detailed picture of the Crescent City coastline. Esri provided access to the satellite imagery. Crescent City map at high resolution provided by Maxar. Pacific Northwest map provided by Earthstar Geographics.

A magnitude 9+ Cascadia earthquake and tsunami occurring during modern times would devastate many low-lying communities along the Pacific Northwest. A
recent assessment suggests that deaths and injuries could exceed tens of thousands and entails economic damages on the order of several billions of
dollars for Washington and Oregon State

A potentially appealing alternative to seawalls are so-called hybrid approaches. Hybrid risk mitigation combines nature-based elements and
traditional engineering elements to reduce risk while also providing co-benefits to communities and ecosystems. An example of a hybrid approach to
tsunami-risk mitigation is a coastal mitigation park: this is a landscape unit on the shoreline built specifically to protect communities or critical
infrastructure and provide vertical evacuation space, in the styles of Fig.

Map view (top) and side view (bottom) of a proposed tsunami-mitigation berm as designed by Project Safe Haven. The berm provides vertical evacuation space for the adjacent community and could also lower the onshore energy flux that drives the damage created by tsunami impact. We show this design as one example of a hybrid approach to tsunami-risk mitigation as it combines an engineered hill and ramp with natural vegetation. Sketches are adapted from

The goal of this paper is to leverage Google's Tensor Process Units (TPUs) for enabling a fast evaluation of different mitigation park designs and
ultimately advancing evidence-based tsunami-risk mitigation planning rooted in quantitative assessments. TPUs are a new class of hardware accelerators
developed by Google with the primary objective of accelerating machine learning computations. They are accessible via the Google Cloud Platform

Numerical simulations of tsunamis have contributed to our understanding of and ability to mitigate wave impacts for many decades now, starting from
the early work by

The list of existing numerical models is long and was recently reviewed by

We intentionally use a hardware infrastructure that is relatively easy to use and accessible without specific training in high-performance
computing. For the TPU infrastructure that we use here, comprehensive tutorials using Google Colab are available at

We model tsunami propagation and runup with the 2D nonlinear shallow-water equations in the conservative formulation with a source term in a
Cartesian coordinate system. Letting

For ease of future notation, we let

We implement these shallow-water equations using the finite volume method whereby the half-step flux and height values are determined through a
fifth-order WENO scheme

We begin the discretization of the equation in continuous variables

From here, we use the Lax–Friedrichs method to approximate flux values that serve as solutions to the Riemann problem; that is, we approximate

Note that in our case we also choose to formulate the source term

The process outlined by Eq. (

Left: initialization of implementation takes advantage of CPU to allocate initial conditions and topography. Center: regular computation period occurring on each subdomain, run independently on TPU cores with some data sharing coordinated by CPU. Right: CPU gather to write results to output files. Esri provided access to the satellite imagery. Crescent City map at high resolution provided by Maxar.

To leverage the TPU's several cores, we divide the domain into multiple subdomains and independently compute the numerical solution to the governing
equations on each core. While a lot of the computation can take place independently, each subdomain remains dependent on the others via their
boundaries and the Lax–Friedrichs global maximum in characteristic speed. We determine global maximum characteristic speed by sharing and reducing
the Lax–Friedrichs maximum characteristic speed calculated on each core. We transfer subdomain boundary information with further care by using a halo
exchange. The data transfer behavior and computation structure is summarized in Fig.

Our implementation is inspired by

The initial conditions and results are communicated from the remote program, which resides on the CPU, to the TPU workers by means of

We differentiate between model verification and validation in the manner suggested by

To quantify the accuracy of the solutions, we test our numerical solver against some classical analytical solutions to the shallow-water equations. We
assess the model's ability to capture key physical processes relevant to inundation, including steep wave propagation, friction, and topography
dependence. We use relative errors in the

We refer interested readers to the Appendix B for the corresponding grid convergence analysis under these relative error norms for the first three
analytical cases, and we refer readers to Sect.

On the left, several instances in time of the computed (purple) water heights to wet dam break compared with the analytical (orange, dashed) water heights. The rightmost figure plots the

The classical one-dimensional wet dam break scheme

A qualitative comparison of the computed and analytical solutions for times

The classical one-dimensional planar parabolic bowl, originally suggested by

On the left

This leads to the following dynamic analytical solution for the water height:

On the left

We do a short test in order to assess the correctness of the discretized friction source term, focusing on a relatively simple flow down a slope with
finite friction (

Qualitative comparison of the computed solution with resolution 1

To assess the ability of the code to capture tsunami propagation, we start with a popular numerical benchmark from the ISEC

Several snapshots in time of the tsunami's propagation over a modeled ellipsoidal hill on a slope. From left to right, the formulation of the initial Carrier N-wave at

Since we are interested in leveraging TPUs for tsunami-risk mitigation planning, we take a look at the ability of our shallow-water equation code to
reproduce a few particular results by

Past tsunamis impacting the west coast of the United States have caused more damage around the harbor of Crescent City in California than elsewhere
along the Pacific coast

Several snapshots of modeled tsunami propagation over terrain and geological features of Crescent City, CA, where any level of blue indicates water cover and where green depicts a stylized map of the topography above surface level. From left to right, then top to bottom, we have a steady state near shore at

The protective benefit of the mountain range can be further seen in Fig.

The 1

As noted in the Introduction, in communities where users may not have access to high-performance computing facilities, the cloud TPU platform provides
a particularly valuable resource where users can perform large-scale computations rapidly. To quantify the potential speedup enabled by TPUs with
increasing numbers of cores, we observe the average wall-clock time taken in computation for each time step with the exclusion of the first
time step. This first time step includes several preprocessing functions, such as reading DEM files into TPU memory, setting up initial conditions,
and initializing the TensorFlow workflow. Similarly, we calculate runtime based on the amount of time spent in computation with the exception of this
first step, with time which is variable from run to run. As shown in Table

Average TPU runtime per time step (in milliseconds) with varying numbers of TPUv2 cores. The Crescent City configuration at an 8

Average TPU runtimes per time step (black) and relative

Approximate TPU runtimes (in seconds) for a 400

Simulating tsunami runup typically requires large domains and sufficiently high resolution to accurately capture tsunami propagation and inundation
over complex topography. Therefore, we continue analyzing our Crescent City scenario for both convergence and the average runtime spent for each
time step under varying degrees of resolution, shown in Fig.

Average TPU runtimes per time step (in

We perform the same analysis under varying degrees of resolution using the benchmark from the Inundation Science and Engineering Cooperative

TPU solution (top row) at several time instances compared to the GeoClaw solution (bottom row). The arrival of the tsunami front (

GeoClaw relative error norms for a 100

For comparison purposes, we run GeoClaw

Estimates of energy efficiency of computing operations are becoming increasingly popular, especially in response to progressing climate change

Based on Table

When we ran GeoClaw for our CPU comparison on energy utilization, we enforced a fixed time step on the GeoClaw package of equal size to that of our
TPU (i.e.,

While these two simulations accomplish the same thing, they have vastly different associated performances. At times, rapid computation and simulations
are necessary in the context of risk analysis, and the associated energy costs of such a performant computation is worth estimating. To address this,
we push our energy estimate a touch further, providing another order-of-magnitude estimate of what a CPU simulation conducted at TPU performance would
be. We extrapolate our previous assumptions further, assuming proportional scaling of computational speed with increasing CPUs and that the thermal
design power applies to each CPU within a system independently. Because a simulated second of a full-capacity Intel Xeon E5-2650 v4 CPU takes
approximately 34.2

Sustainable tsunami-risk mitigation in the Pacific Northwest is a challenging task. Some challenges come from beneath, because previous large
subduction zone earthquakes at Cascadia led to 0.5–1

The picture that emerges is that of a highly dynamic coastline – maybe too dynamic for an entirely static approach. Nature is not only continuing to
shape the coastline, but it is also a fundamental component of the region's cultural heritage, identity, and local economy. So, it is maybe not surprising
that the Pacific Northwest is a thought-leader when it comes to designing hybrid approaches to sustainable climate adaptation through the Green Shores
program

Project Safe Haven is a grass-roots approach to reducing tsunami risk mostly by providing accessible vertical-evacuation options for communities. Many
proposed designs entail reinforced berm like the one shown in Fig.

This paper aims to be a first step towards a community-based infrastructure that will allow local authorities around the world to readily execute
tsunami simulations for risk mitigation planning. We aim to provide a proof of concept rather than a complete implementation. As such, we used a very
similar base framework used by

Because our code is specifically an implementation of the shallow-water equations, it is currently unable to model tsunami initiation or any fluid structure interactions that may be desired to accompany analysis of nature-based solutions. Instead, it requires an initial condition for wave heights and fluxes, meaning a full tsunami simulation would require coupling the results of a tsunami initiation model as an input. While our implementation is relatively limited in scope, the model is able to provide a starting point for a more complete software package for communities as they evaluate nature-based options for tsunami mitigation.

We argue that cloud TPUs are preferable to large, heavily parallel simulations on CPUs or GPUs for risk managers across all communities, because the
TPU-based simulations we show here do not require access to the large computing clusters hosted by laboratories and universities. These clusters
require huge amounts of power to run and are usually only made available to scientists and engineers by means of competitive grants for computing
time or by use of the cloud offered by private companies. However, an expert user knowledge of these systems from a scientific computing perspective
is necessary to design, run, and interpret model results, and the compute infrastructure itself may not be available to early-warning centers in many
parts of the world. In contrast, our code is available on GitHub and fully implemented in Python; it can be executed through a web browser and
visualized through a simple notebook file using Google Colab without the knowledge otherwise required to run large parallel codes on high-performance
computing systems. By taking advantage of Google Cloud Platform, we also ensure that a user's power demand is met entirely with renewable energy

Finally, though not our focus here, we note our approach may also contribute to early tsunami warning. Once triggered, tsunamis move fast; this fact
makes it necessary to model and assess their potential for damage ahead of time once they have been detected offshore. For a sufficiently fast early
warning and prompt evacuation, the tsunami modeling infrastructure has an important time constraint

We present a first step towards an accessible software package that leverages the powers of cloud-based TPU computing for improving the capabilities
of risk managers and communities to mitigate the destructive onshore impacts of tsunamis. We verify and validate our current implementation to ensure
that it is capable of simulating inundation from a Carrier N-wave over real topography. These simulations are comparable to that ran by the popular
open-source solver GeoClaw

Due to the restrictions of the cloud TPU using Google Cloud Storage, a user must leverage Google's buckets to run the notebooks. At the time of
writing this article, eight TPU cores are readily available in North America on Google Colab for free, but Google Cloud Storage buckets are a paid
subscription service (see

Download the TPU-Tsunami Repository from

Modify the

Navigate to

Navigate to Runtime

Upload your

Specify a function corresponding to an initial condition for your DEM file (or use one example initial condition).

Set initial conditions and boundary conditions as clarified in the bottom of any example notebook run. Set last simulation parameters defining
numerical resolution (

Run the simulation.

Analyze results.

In addition to the convergence analysis for the ISEC benchmark posed in Sect.

Final relative error norms calculated at 10

Grid convergence analysis for wet dam break, with values.

In Fig.

Grid Convergence Analysis for Planar Parabolic Bowl.

Grid Convergence Analysis for Planar Parabolic Bowl.

Finally, in Fig.

Grid convergence analysis using flux as the error metric for slope with Manning friction.

Grid convergence analysis using flux as the error metric for slope with Manning friction.

Our work is available as a GitHub release at

IM: Methodology, Software, Analysis, and Writing. SM, PI: Conceptualization, Methodology, Writing, and Supervision. JS: Conceptualization, Methodology, Writing, and Supervision.

At least one of the (co-)authors is a member of the editorial board of

Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This work was supported by the National Science Foundation's Graduate Research Fellowships Program (GRFP) awarded to Ian Madden.

This research has been supported by the National Science Foundation’s Graduate Research Fellowships Program (GRFP) awarded to Ian Madden (grant no. DGE-2146755).

This paper was edited by Deepak Subramani and reviewed by Ilhan Özgen-Xian and two anonymous referees.