The shelf/plume simulation requires computing various derivatives, for which a pseudospectral method is used. An introduction to this technique is provided below; for a more thorough explanation, see Trefethen (2000). Spectral methods provide a fast and accurate way to numerically differentiate discrete data. While more computationally expensive than finite difference methods for the same number of grid points, spectral methods give exponential convergence and thus often require significantly fewer grid points to achieve the same level of accuracy. Numerical accuracy is of particular importance here, as the purpose of running simulations is to test the stability of an ice-shelf to potentially small perturbations. Spectral methdos are often used for problems with periodic boundary conditions, where a Fourier series, , can be used to interpolate between grid points. If the grid points are evenly spaced then the coefficients can easily be calculated with a discrete Fourier transform. Typically this would be done using the highly efficient fast Fourier transform (FFT) algorithm (Cooley and Tukey, 1965), which requires operations for N grid-points. The derivative is then and an inverse FFT can be used to convert the new coefficients to the values of at each grid point.
However, the boundary conditions for the ice shelf and plume are not periodic. Instead, say there is an interpolant for data mapped onto using a linear coordinate rescaling. To apply a spectral method, it is necessary to map the interpolant to a function , , where . Regardless of the boundary conditions on , will be periodic and even in and can thus be differentiated as before. The results can then be mapped back onto the grid points in the -domain. By choosing grid points to be Chebyshev collocation points, defined below, the corresponding grid points in will be equally spaced and an FFT can be used to find the Fourier coefficients. This is known as the Chebyshev pseudospectral method (Trefethen, 2000). If Chebyshev collocation points are needed, their positions are given by This approach provides uneven spacing of points in , with a clustering of resolution near the domain boundaries, and hence is also well suited to capture rapid variation near the grounding line.
Following Trefethen (2000), the practical algorithm used to differentiate discrete data , for , corresponding to values at Chebyshev collocation nodes , is as follows:
Discrete sine and cosine transforms are variations of the discrete Fourier transform which take advantage of data being real and either even or odd. The FFTW3 package (Frigo and Johnson, 2005) was used to compute these. A more rigorous and detailed explanation of the above methods for periodic and non-periodic functions is provided by Trefethen (2000) in chapters 3 and 8, respectively.
If a domain other than is desired then the Collocation points can be scaled and offset as necessary, giving a coordinate system . The above differentiation algorithm is applied unchanged, except that the result is scaled by twice the inverse of the domain-width.