# Algorithmic Design of an FPGA-Based Calculator for Fast Evaluation of Tsunami Wave Danger
## 2 Materials and Methods
### HLS-Based Algorithm Porting
By composing PEs into a line, the calculator can be scaled to different FPGAs. Below we present an implementation of the MacCormack algorithm in C using HLS. The design is intended for a ZCU106 board (FPGA xczu7 ev) and 400 MHz. Xczu7 ev has 230,400 LUTs, 460,800 flip-flops, 312 + 512 BRAM blocks (36 K), and 1728 DSP blocks. The final PE has the following parameters, collected in Table 2:

Once again, we would like to stress that all of the algorithms operate on data in single-precision floating points (IEEE 754); no conversions to fixed points or half-precision were made. The entire data array (D, n, u, v) was stored in dynamic RAM (DDR) placed near the FPGA chip on the board. Initial data were transferred to the FPGA from the PC using the PCIe interface, or internal interconnect in the case of an FPGA + CPU solution, such as Xilinx Zynq. The maximum acceptable dataset size depends on the size of the dynamic RAM. For a VC709 accelerator, the maximum dataset is 16,384 \(\times\) 16,384 points of bathymetry. The bathymetry size for our experiments was 3000 \(\times\) 3200, for practical reasons (size of resulting data, computation time on FPGA/CPU, etc.). ## 3 Results

### Numerical Tests at Model Bathymetry

In order to test the developed numerical algorithm in the area of 1000 \(\times\) 1000 calculation grid points, a simple example of bottom topography was used, representing a uniform bottom slope (\(D\)(\(x\),\(y\)) = \(ky\)) and a parabolic bottom profile (\(D\)(\(x\),\(y\)) = \(ky^{2}\)), where the parameter \(y\) represents the distance from the rectilinear coastline. With the spatial steps of the grid in both directions equal to 1000 m, the coefficient \(k\) was chosen so that the depth varied from 0 m at the lower boundary (coastline) to 10,000 m at the upper boundary of the computation domain (see Figure 2). When modeling the tsunami propagation via digital bathymetry measuring 3000 \(\times\) 3200 calculated nodes, approximation of the real bottom topography of the area was conducted off the northeast coast of the Japanese island of Honshu. This area located between 34 and 42 degrees NL (northern latitude), as well as between 140 and 147.46 degrees EL (eastern longitude). The digital depth array for this area was built on the basis of oceanographic data from the JODC [10]. The step length of the calculated grid, linked to geographical coordinates, was 0.0025 arc degrees, which is equal to 278 m in the north-south direction and 219 m in the west-east direction. To assess the reliability and accuracy of the proposed method, numerical calculations were carried out on model topographies of the bottom, for which an exact solution was obtained via ray approximation [6; 7]. In these test calculations, the bottom relief of which is described in the previous subsection, the tsunami propagation was modeled from a circular initial disturbance area with a radius of \(r_{0}\) = 50 km, with the center located at a distance of 300 km from the coastline, and at the same distance from the lateral boundaries of the region. In Figure 2, the area of the initial displacement of the water surface is filled with yellow. The vertical displacement of the water surface in the source was given by the following formula:

\[\eta=\eta_{0}\bigg{(}1+\cos\bigg{(}\frac{\pi\cdot r}{r_{0}}\bigg{)}\bigg{)},\]

where \(r\) represents the distance from the center of the initial water surface elevation (\(r\leq r_{0}\)). In Figure 2a,b, showing the results of testing on model bottom reliefs, the upward