Summary
Free‐surface flows in rivers, estuaries, and coastal areas are strongly dominated by the geometrical details of the study area. Nowadays, accurate bathymetric data are easily available on raster‐based digital elevation models with an impressive spatial resolution. These data are often accessible as large two‐dimensional arrays containing several millions of pixel values. Recent numerical methods are very efficient and rather accurate but far from being able to solve the governing differential equations on a computational grid with such a fine spatial resolution. In the present investigation, the unaltered pixel values from a digital elevation model are clustered to form subgrids of a coarser computational grid. Artificial cross‐flow between disconnected areas is inhibited by introducing cell clones and edge clones. Each clone consists of directly connected pixels. It is shown how the resulting computational grid is able to resolve geometrical details of complex study areas to pixel resolution and for any grid size. As an example, the performance of the proposed algorithm is tested to simulate a typical tidal flow in the San Francisco Bay and the Sacramento‐San Joaquin Delta area by using an extreme subgrid resolution given by a digital elevation model containing 196 000 000 pixels with 10 m pixel size.