One way to reduce the computational cost of a spectral
model using spherical harmonics (SH) is to use double Fourier series (DFS)
instead of SH. The transform method using SH usually requires

Global spectral atmospheric models using the spectral transform method with
spherical harmonics (SH) as basis functions are widely used. They are used
in the Japan Meteorological Agency (JMA, 2019) and the Meteorological
Research Institute (MRI; Yukimoto et al., 2011, 2019) for a range of
applications, including operational weather prediction, operational seasonal
prediction, and global warming projection. The spectral model has the
advantage that the horizontal derivatives are accurate, and the
semi-implicit scheme, which improves numerical stability, can be easily
applied because the Helmholtz equation and the Poisson equation are easily
solved in spectral space. The application of the semi-implicit
semi-Lagrangian scheme allows for time steps longer than the
Courant–Friedrichs–Lewy (CFL) condition, which makes the model
computationally efficient. In the spectral model using SH, the Legendre
transform used in the latitudinal direction significantly increases the
computational cost at high resolutions since the Legendre transform usually
requires

Alternatively, we can use double Fourier series (DFS) as basis functions to
reduce the operation count and the memory usage in the global spectral
model. In the DFS model, the fast Fourier transform (FFT; Cooley and Tukey,
1965; Swarztrauber, 1982) is used in not only the longitudinal (zonal)
direction but also the latitudinal (meridional) direction. The FFT
requires only

In DFS models (and also in SH models), the scalar variable

Orszag (1974) and Boyd (1978) expanded

Yee (1981), Akahori et al. (2001), and Layton and Spotz (2003) expanded

Cheong (2000a, b) proposed expanding

Yoshimura and Matsumura (2005) and Yoshimura (2012) stably ran the
two-time-level semi-implicit semi-Lagrangian hydrostatic and nonhydrostatic
atmospheric models using the DFS basis functions of Cheong in Eq. (6). These
models used the same fourth-order horizontal diffusion as the SH models and
did not require the spherical harmonics filter or the strong high-order
horizontal diffusion for stability. The numerical stability of the models
was improved by adopting the following methods.

The semi-Lagrangian scheme is used, which avoids the numerical instability due to the nonlinear advection term.

The meridional truncation with

High-wavenumber noise appears near the poles.

The meridional truncation wavenumber

A new expansion method to calculate DFS expansion coefficients of scalar and vector variables, which adopts the least-squares method (or the Galerkin method) to minimize the error due to the meridional wavenumber truncation, is used.

New DFS basis functions that automatically satisfy the pole conditions in Eq. (3) are introduced, which guarantees continuity of not only scalar variables but also vector variables at the poles.

Section 2 describes the arrangement of equally spaced latitudinal grid points used in the new DFS method. Section 3 describes the details of the new DFS method using the new DFS expansion method and the new DFS basis functions and also includes the essential summary of the new DFS method. Section 4 examines the error due to the wavenumber truncation in the DFS method of Orszag (1974), the old DFS method (Cheong, 2000a, b; Yoshimura and Matsumura, 2005), and the new DFS method. Section 5 examines the accuracy of the old and new DFS methods and the SH method for the Laplacian operator and the Helmholtz equation. Section 6 compares the results of the shallow-water test cases between the model using the new DFS method, the model using the old DFS method of Yoshimura and Matsumura (2005), and the model using the SH method. Section 7 presents conclusions and perspectives.

In DFS models, equally spaced latitudinal grid points are used. We use the
following three ways of arranging equally spaced latitudinal grid points in
the model using the new DFS method:

Grid [0], Grid[1], and Grid [

In the new DFS method, the wind vector components

In Sect. 3, we describe the new basis functions for scalar and vector variables and the new method to calculate expansion coefficients which minimizes the error due to wavenumber truncation. We compare the new DFS method with the SH method to see the difference between them. We also describe how to calculate the Laplacian operator, the Poisson equation, the Helmholtz equation, and horizontal diffusion in the new DFS method. The essential summary (cookbook) of the new DFS method is in Sect. 3.10.

We propose the following new DFS basis functions that automatically satisfy
the continuity conditions at the poles in Eq. (3). The scalar variable

Using Eqs. (A2a)–(A2c), Eq. (10) can be converted as follows:

When calculating the values of

The truncated variable

The gradient

One way to calculate the coefficients

Here we propose a new method to calculate expansion coefficients using the
least-squares method to minimize the error due to the meridional wavenumber
truncation. This method avoids dividing

Next,

From Eqs. (26), (27), (25), (15), (9), and (A3), we derive

For

Here we compare the new DFS method with the SH method to see the difference
between them. In the SH method,

We compare the method used to calculate the expansion coefficients in the
new DFS method with that in the SH method. The SH expansion coefficients

Equation (37) can be derived using the least-squares method that minimizes
the error

In Eqs. (37) and (38), the latitudinal weight

When calculating the coefficients

The new DFS meridional basis functions

The velocity potential

From Eqs. (52) and (53), it can be seen that

We propose a new method that calculates the expansion coefficients

Next,

For

For

For odd

Equation (63a) is easily solved. From Eq. (63d) and from the same equations as
Eq. (63d), except that

This method to calculate the DFS expansion coefficients of

The calculation of the Laplacian operator and the Poisson equation in the
new DFS method is described here. In the equation

From Eqs. (65) and (68), we obtain

We can also use the least-squares method instead of the Galerkin method so
that the following error

From Eqs. (68)–(71) and (A3) we derive

For

In the Poisson equation,

In Eq. (65), the global mean of

The Helmholtz equation is

Similarly, the Helmholtz-like equation

The horizontal diffusion is calculated in the similar way as in Cheong et al. (2004). Here we describe how to calculate fourth-order diffusion. Higher-order diffusion can be calculated similarly.

The equation for fourth-order hyper-diffusion is

The essential summary for a scalar variable is as follows.

Define DFS expansion for a scalar variable with zonal expansion in Eq. (8) and meridional expansion in Eq. (10).

For the inverse transform from spectral space to grid point space,

calculate the coefficients

calculate

calculate the grid point values

For the forward transform from grid point space to spectral space,

calculate

calculate the coefficients

calculate the coefficients

Represent DFS expansion for a vector variable by Eq. (50).

For the inverse transform from spectral space to grid point space,

calculate the coefficients

calculate

calculate the grid point values

For the forward transform from grid point space to spectral space,

calculate

calculate the coefficients

calculate the coefficients

Here we examine the error due to the meridional wavenumber truncation when
the same continuity conditions at the poles as Eq. (3) are satisfied. In the
DFS method of Orszag (1974) using Eq. (2), only

Figure 2 shows the error due to the wavenumber truncation. The number of
latitudinal grid points is

Change in values at the grid points due to the meridional
wavenumber truncation. We use Grid [0] with the number of latitudinal grid
points

In the DFS method of Orszag, a very large error occurs, especially for odd

In the old DFS method, large high-wavenumber oscillations appear for even

In the new DFS method, the usual small oscillations from the Gibbs
phenomenon appear in Fig. 2. The error is small because the expansion
coefficients are calculated using the least-squares method (or the Galerkin
method) to minimize the error. Because of this, the truncation with
arbitrary

When using the basis functions of Orszag in Eq. (2), we can also obtain results equivalent to the new DFS method by calculating the expansion coefficients using the least-squares method with Lagrange multipliers in order to minimize the error while satisfying the pole conditions in Eq. (4).

Figure 3a is the same as Fig. 2a except that

Normalized

The same as Table 1 except that the global mean values of
calculated

We examine the accuracy of the old and new DFS methods for the Laplacian
operator in Eq. (65) and the Helmholtz equation

To examine the accuracy for the Laplacian operator,

To examine the accuracy of the solution of the Helmholtz equation,

The same as Table 1 except that

We ran the Williamson test cases 1, 2, 5 ,and 6 (Williamson et al., 1992), and the Galewsky test case (Galewsky et al., 2004) in the model using the new DFS method described in Sect. 3, the model using the old DFS method of Yoshimura and Matsumura (2005), and the model using the SH method. By comparing the results of these model, we evaluated the old and new DFS methods.

The prognostic equations of the shallow-water model on a sphere are

We ran the shallow-water test cases in the semi-implicit semi-Lagrangian
shallow-water model or the Eulerian advection model (see Sect. 6.3) using
the new DFS method (hereafter, the new DFS model). We also ran the same test
cases in the model using the old DFS method of Yoshimura and Matsumura
(2005) with the basis functions of Cheong (2000a, b) (hereafter, the old
DFS model), and in the model using the SH method (hereafter, the SH model)
for comparison. The new DFS model was run for Grid [0], [1], and
[

The zonal Fourier transforms in all the models and the meridional Fourier cosine and sine transforms in the DFS models are calculated using the Netlib BIHAR library, which includes a double-precision version of the Netlib FFTPACK library (Swarztrauber, 1982). The meridional Legendre transform in the SH model is calculated using the ISPACK library (Ishioka, 2018), which adopts on-the-fly computation of the associated Legendre functions. We use the ISPACK library's optimization option for Intel AVX512, which is highly optimized by using assembly language together with Fortran.

Williamson test case 1 simulates a cosine bell advection. In the
semi-Lagrangian models, the advection is calculated in the semi-Lagrangian
scheme, and the horizontal derivatives calculated from the expansion
coefficients are not used for the advection calculation. Therefore, we also
use the Eulerian scheme here to simulate the advection in the DFS and SH
models to test the expansion methods. The advection equation is

Figure 4 shows the predicted height after a 12 d integration in
Williamson test case 1 when using the Eulerian advection models at the
resolution

Normalized

Predicted height (m) in the Eulerian models after a
12 d integration in Williamson test case 1:

Table 5 shows the same information as Table 4 but using the semi-Lagrangian
scheme. In the semi-Lagrangian models, the forward transform followed by the
inverse transform are executed at every time step, but the expansion
coefficients are not used for the advection calculation. The time steps are
the same as described in Sect. 6.2. The errors are very close between the
models. At the resolution

The same as Table 4 but using the semi-Lagrangian
models and the truncation wavenumber

The conservation of mass in Williamson test case 1 was also examined, and the results are shown in Sect. S2 in the Supplement.

Williamson test case 2 simulates a steady-state nonlinear zonal
geostrophic flow. In this test case, the angle between the solid body
rotation and the polar axis

The same as Table 5 but for the errors after a 5 d integration in Williamson test case 2.

Time series of prediction error of height

The conservation of mass, energy, and vorticity in the Williamson test cases 2, 5, and 6 was also examined, and the results are shown in Sect. S2 in the Supplement.

Williamson test case 5 simulates zonal flow over an isolated mountain.
Figure 6 shows the predicted height after a 15 d integration in Williamson
test case 5 with

The same as Table 5 but for the errors after a 15 d integration in Williamson test case 5. The result of the high-resolution
SH model with

Predicted height (m) after a
15 d integration in Williamson test case 5:

Longitudinal distributions of meridional wind (m s

Figure 7 shows the longitudinal distributions of meridional wind at the grid
points near the South Pole after a 15 d integration in the old and new DFS
models using Grid [0] at the resolutions

Figure 8 shows the kinetic energy spectra of the horizontal winds (Lambert,
1984) after a 15 d integration in Williamson test case 5. The kinetic
energy spectra in the DFS models are calculated from the SH expansion
coefficients, which are obtained by first calculating the Gaussian grid
point values from the DFS coefficients using Eq. (10) for the new DFS method
and Eq. (6) for the old DFS method and then calculating the SH
expansion coefficients from the Gaussian grid point values by using a
forward Legendre transform. In the old DFS model with

Kinetic energy spectrum of horizontal winds
(m

The same as Fig. 6 but with the truncation wavenumber

Figure 9 shows the predicted height after a 15 d integration in Williamson
test case 5, which is the same as Fig. 6 but using the truncation
wavenumber

The same as Table 7 but with

The same as Fig. 8 but with the truncation wavenumber

Figure 10 shows the kinetic energy spectrum of the horizontal winds after a
15 d integration in Williamson test case 5, which is the same as Fig. 8
except for the truncation wavenumber

Figure 11 shows the predicted height after a 14 d integration in
Williamson test case 6. The error is similar between the old and new DFS
models using Grid [0] and the SH model. The error in the new DFS model using
Grid [1] is the smallest. This is probably because Grid [1] has grid points
at the poles, where the minimum height exists, and on the Equator, where the
maximum height exists. The error in the new DFS model using Grid [

The same as Table 7 but the errors after a 14 d integration in Williamson test case 6.

The same as Fig. 6 but for predicted height (m) after a 14 d integration in Williamson test case 6.

The Galewsky test case simulates a barotropically unstable midlatitude jet.
Figure 12 shows the predicted vorticity after a 6 d integration in the
Galewsky test case for the models at 1.3 km resolution with

Predicted vorticity
(s

The results of the Galewsky-like test case using the north–south symmetric initial conditions are shown in Sect. S3 in the Supplement.

Figure 14 shows the elapsed time for the 15 d integration in
Williamson test case 5 in the SH model and the new DFS model using Grid [0]
at 20 km resolution with

Kinetic energy spectrum of horizontal winds (m

Elapsed time (s) for

We have developed the new DFS method to improve the numerical stability of
the DFS model, which has the following two improvements.

A new expansion method with the least-squares method is used to calculate
the expansion coefficients so that the error due to the meridional
wavenumber truncation is minimized. The method also avoids dividing by

New DFS basis functions are used, which guarantees that not only scalar variables but also vector variables and the gradient of scalar variables are continuous at the poles.

To test the new DFS method, we conducted experiments for Williamson test cases 2, 5, and 6 and the Galewsky test case in the semi-implicit semi-Lagrangian shallow-water models using the new DFS method with three types of equally spaced latitudinal grids with or without the poles. We also ran Williamson test case 1, which simulates a cosine bell advection, in the Eulerian and semi-Lagrangian advection models. We compared the results between the new DFS models using the new DFS method, the old DFS model using the method of Yoshimura and Matsumura (2005) with the basis functions of Cheong (2000a, b), and the SH model.

The high zonal wavenumber noise of the meridional wind appears near the
poles in the old DFS model, but not in the new DFS models in Williamson
test case 5. One possible reason is that the latitudinal derivative at the
grid points can be unrealistically large in the old DFS method even when the
truncation wavenumber

The results of the new DFS model are almost the same as the SH model. However, in
the SH shallow-water model without horizontal diffusion, very small
oscillations appear in the high-wavenumber region of the kinetic energy
spectrum in some cases, unlike in the new DFS model. This seems to be
because the wind components

The elapsed time in the new DFS model is shorter than in the SH model
(especially at high resolution) because the Fourier transform requires only

We developed hydrostatic and nonhydrostatic global atmospheric models using the old DFS method (Yoshimura and Matsumura, 2005; Yoshimura, 2012) and conducted typhoon prediction experiments in the nonhydrostatic global atmospheric model using the old DFS method in the Global 7 km mesh nonhydrostatic Model Intercomparison Project for improving TYphoon forecast (TYMIP-G7; Nakano et al., 2017). We have already developed a nonhydrostatic (or hydrostatic) atmospheric model using the new DFS method where both OpenMP and MPI parallelization are used. We will describe the nonhydrostatic DFS model and the MPI parallelization in another paper after improving the nonhydrostatic dynamical core as needed.

Here we list the trigonometric identities used in transforming the
expressions in this paper. The following identities are satisfied:

Forward discrete Fourier cosine and sine transforms are performed in Eqs. (23) and (57), and inverse discrete Fourier cosine and sine transforms are
performed in Eqs. (13) and (52) in the latitudinal direction. The calculation
of the discrete cosine and sine transforms in Grids [0], [1], and [

When using Grid [0], inverse and forward discrete cosine transforms are
performed as follows:

In the new DFS method, the meridional truncation wavenumber

We can also derive the following equations from Eq. (57) in the similar way
to the derivation of (D3):

Here we derive Eq. (30d) for odd

In a regular longitude–latitude grid, the longitudinal grid spacing becomes narrow at high latitudes. In DFS methods, the zonal Fourier filter (Merilees, 1974; Boer and Steinberg, 1975; Cheong, 2000a), which filters out the high zonal wavenumber components at high latitudes, is usually used to obtain a more uniform resolution. The use of a reduced grid (Hortal and Simmons, 1991; Juang, 2004; Miyamoto, 2006; Malardel, 2016) has a similar effect to the zonal Fourier filter. In our atmospheric model using the old DFS method (Yoshimura, 2012), we use the reduced grid of Miyamoto (2006).

In this study, we use the regular longitude–latitude grid with the zonal
Fourier filter, not the reduced grid, for the simplicity of its source code.
We set the largest zonal wavenumber

The global mean value of

The latitudinal area weight at each colatitude

The latitudinal distribution of

From

The value of

In Grid [0] and Grid[1], the distribution of

Here we describe the derivation of Eq. (63d) for odd

A two-time-level semi-implicit semi-Lagrangian scheme (e.g., Temperton et
al., 2001) and the Stable Extrapolation Two-Time-Level Scheme (SETTLS;
Hortal, 2002) are adopted to discretize the shallow-water equations in Eqs. (98) and (99) in time as follows:

Equations (I1) and (I2) are converted into

We calculate

The scalar variable