the Creative Commons Attribution 4.0 License.
the Creative Commons Attribution 4.0 License.
Implementation of implicit filter for spatial spectra extraction
Abstract. Scale analysis based on coarse-graining has been proposed recently as an alternative to Fourier analysis. It is now broadly used to analyze energy spectra and energy transfers in eddy-resolving ocean simulations. However, for data from unstructured-mesh models it requires interpolation to a regular grid. We present a high-performance Python implementation of an alternative coarse-graining method which relies on implicit filters using discrete Laplacians. This method can work on arbitrary (structured or unstructured) meshes and is applicable to the direct output of unstructured-mesh ocean circulation atmosphere models. The computation is split into two phases: preparation and solving. The first one is specific only to the mesh. This allows for auxiliary arrays that are then computed to be reused, significantly reducing the computation time. The second part consists of sparse matrix algebra and solving linear system. Our implementation is accelerated by GPUs to achieve unmatched performance and scalability. This results in processing data based on meshes with more than 10M surface vertices in a matter of seconds. As an illustration, the method is applied to compute spatial spectra of ocean currents from high-resolution FESOM2 simulations.
- Preprint
(6042 KB) - Metadata XML
- BibTeX
- EndNote
Status: final response (author comments only)
-
RC1: 'Comment on egusphere-2024-1119', Anonymous Referee #1, 10 Oct 2024
This article describes an efficient Python implementation of a smoothing filter that can be applied on unstructured meshes. The mathematical method and sample results were described in a previous paper. This paper describes the new implementation and addresses some additional questions about higher-order filtering. A few parts are unclear and some of the language is overblown, but mostly it is a great article.
1. Some of the language is overblown and sounds more like a sales pitch than a scientific paper. Some examples:
"unmatched performance and scalability". This would require a huge comparison study to demonstrate unequivocally. Perhaps say "excellent" instead of "unmatched" unless you have good evidence for "unmatched"
The second sentence of the introduction is too long and convoluted. Removing the clauses leaves:
"Which scales contribute most to the kinetic and available potential energy, ... are among questions frequently asked". Consider rephrasing to something like this, using a bulleted list?
"Decomposing the motions into a spectrum of scales is useful for calculating:
* which scales contribute most to kinetic and available potential energy
* which scales contribute most to energy generation and dissipation
* how energy is transferred between scales.
"Line 285:
"The second phase leverages cutting-edge sparse matrix algebra and GPU acceleration, harnessing the power of modern graphics processing units to achieve unparalleled performance and scalability. This computational prowess enables the processing of high-resolution data from meshes with millions of surface vertices within seconds."On line 217, rather than saying "exclusively utilised", could you simplify your language and just say "used".
Could you make the description of the computer less of a sales pitch. Rather than:
"This high-performance node boasts an impressive configuration, featuring ..."
just say:
"The JUWELS Booster Module has ..."
Rather than:
"To optimise computational efficiency and resource utilisation, only a single GPU was employed for the duration of this study."
say:
"A single GPU was used for this study."Simplify the language:
"The second phase leverages cutting-edge sparse matrix algebra and GPU acceleration, harnessing the power of modern graphics processing units to achieve unparalleled performance and scalability. This computational prowess enables the processing of high-resolution data from meshes with millions of surface vertices within seconds."Please simplify the rest of the language in a similar way.
2. There is a lot of content describing how to solve a Poisson equation on an unstructured mesh. These are established techniques and so perhaps should be moved to an appendix?
3. Please describe more clearly how you calculate the wavenumber spectra for the original data, for the box filter and for the interpolated data.
4. Please define what you mean by "convergence of biharmonic filters". In what way are these iterative and what are you trying to converge towards?
5. Line 277 says:
"Unlike its predecessors, the implicit filter method directly operates on unstructured meshes, such as triangular and quasi-hexagonal meshes, eliminating the need for computationally expensive interpolation to regular grids."
My understanding is that you have smoothed the data on the native grid by solving a Poisson equation. The solution of a Poisson equation on an unstructured grid is established. I thought that you still have to interpolate onto a lat-lon grid to calculate power spectra. You are just interpolating coarser data. Please explain.Citation: https://doi.org/10.5194/egusphere-2024-1119-RC1 -
RC2: 'Comment on egusphere-2024-1119', Ian Grooms, 08 Jan 2025
I agree broadly with the first reviewer comment. This is an interesting article presenting a software implementation of a method developed and described elsewhere. I divide my comments into those of a substantive nature, those related to clarity and completeness, and typos/grammar.
Substance:
- In section 4 the differences in the spectra shown in Figures 4 and 5 as 'small' (l197) and the spectra are described as 'matching' (l199). These differences may appear small on a log-log plot, but when I try to estimate by hand I find that the difference in KE at large scales could be as much as 50%. Please compute the percent change so that we can know how small it actually is.
- The manuscript mentions in a few places convergence problems for the biharmonic filter with large filter scale. Preconditioning is mentioned as a possible way to alleviate this in future versions of the software. The original implementation of gcm-filters (Loose et al., 2022) also suffered from difficulties with large filter scales, as described by Grooms et al. (2021). We originally suggested coarsening before applying the filter with a large filter scale, which might also work here. Ultimately we corrected the numerical stability problem by changing the way the explicit filter is applied to data, with the stable method available in versions 0.3 and later, as described here https://gcm-filters.readthedocs.io/en/latest/theory.html#numerical-stability-and-chebyshev-algorithm.
- The scaling in figures 6 and 7 is described as 'linear.' To my eye the data on the log-log plot are plausibly linear in some range, which implies power-law scaling, but it's not clear to me that the slope is 1, which would imply linear scaling. It would be beneficial to estimate and report the exponent of the power law over the ranges where linear scaling is claimed.
- The filter has two stages, setup and online. While the online performance is impressive, the setup cost is never recorded. Presumably the setup cost is not prohibitive, but it would be beneficial to report setup times.
Clarity/Completeness:
- The term 'box filter' is used here to refer to a convolution-type filter. Elsewhere in the literature the term 'box filter' is sometimes used to refer to a convolution-type filter where the kernel is an indicator function, often on a rectangle. The kernel used here for the 'box filter' is smooth and only approximately has compact support. The authors might consider changing the term 'box' to avoid giving an incorrect impression that their kernel is an indicator function on a rectangle.
- Figure 2 illustrates a regular grid. Although the aspect ratio of the data is one, the aspect ratio of the plot is not one. The authors might consider forcing the aspect ratio of the plot to be one.
- In section 4 some of the filters use data on dry/land cells. Are the values on dry cells are set to zero?
- Lines 195-196: "The implicit filter allows us to compute the spectra of the interpolated data on both the longitude-latitude mesh and on its flat geometry approximation." This sentence is clear, but it's not clear to me which plots use the interpolated data in spherical geometry and which plots use the interpolated data in flat geometry.
- Several places mention meshes with over 11 million nodes, but the high resolution mesh is earlier mentioned to have 10.24 million nodes. Please clarify.
- The paragraph on lines 233-237 says that scaling is linear for filter scales larger than 50 km, and it also says that the results diverge from a linear dependency for filter scales larger than 100 km. This is inconsistent. See also substance comment #3.
- The discussion in section 6 about extracting spectra with slopes steeper than -3 is heavily indebted to previous work on the subject, including Sadek & Aluie (2018). Although this paper is cited in the introduction, it is not cited in section 6; I think it would be appropriate to acknowledge the provenance of these ideas locally in section 6. The authors might also be interested in the preprint recently posted by Zhao & Aluie on the same topic (https://arxiv.org/abs/2412.11891).
Typos:
- L5-6: 'unstructured-mesh ocean circulation atmosphere models'?
- "Solving linear system" should either be "Solving linear systems" or "Solving the linear system" or "Solving a linear system." This occurs in more than one place.
- L109: "discretization for the Laplacian"
- L111: "which works stably in practice"
- L166: "The model data was generated by a [...] simulation"
- L194: "The latter" and "ignoring the Earth's curvature"
References:
Grooms, Ian, et al. "Diffusion‐based smoothers for spatial filtering of gridded geophysical data." Journal of Advances in Modeling Earth Systems 13.9 (2021): e2021MS002552.
Loose, Nora, et al. "GCM-filters: A Python package for diffusion-based spatial filtering of gridded data." Journal of Open Source Software 7.70 (2022).Zhao, Dongxiao, and Hussein Aluie. "Calculating Spectra by Sequential High-Pass Filtering." arXiv preprint arXiv:2412.11891 (2024).Citation: https://doi.org/10.5194/egusphere-2024-1119-RC2
Model code and software
Implicit_filter: v1.0.0 Kacper Nowak and Sergey Danilov https://zenodo.org/records/10907365
Interactive computing environment
Implementation of implicit filter for spatial spectra extraction Kacper Nowak, Sergey Danilov, Vasco Müller, and Caili Liu https://zenodo.org/records/10957614
Viewed
HTML | XML | Total | BibTeX | EndNote | |
---|---|---|---|---|---|
171 | 55 | 92 | 318 | 12 | 13 |
- HTML: 171
- PDF: 55
- XML: 92
- Total: 318
- BibTeX: 12
- EndNote: 13
Viewed (geographical distribution)
Country | # | Views | % |
---|
Total: | 0 |
HTML: | 0 |
PDF: | 0 |
XML: | 0 |
- 1