## 1. Introduction

*c*is chosen and discussed as a standard equation for tests of numerical schemes in nearly all textbooks on numerical methods in fluid mechanics (e.g., Durran 1999). In (1.1)

*u*

_{o}is a constant advection velocity,

*t*is time, and

*x*is the spatial coordinate. Given the central importance of advection in fluid dynamics, a numerical scheme must be able to cope with (1.1) before more elaborate systems of equations are considered.

*L*of periodicity. Such an exercise is certainly far from being academic. One may, for example, interpret

*f*as a source or sink term for a trace substance

*c.*Then (1.2) represents a basic situation found in air pollution modeling as well as in transport calculations for chemical reactants (e.g., Hill 1976; Crutzen et al. 1999). We may also interpret

*c*as a meridional or vertical displacement of particles due to a prescribed meridional (vertical) wind

*f*. Such equations must be solved in Lagrangian transport calculations. Despite these obvious applications, (1.2) has been met with relatively little interest. Falcone and Ferreti (1998) investigated the convergence of semi-Lagrangian schemes for a broad family of equations containing (1.2) except that

*f*does not depend on time in their case. Durran (1999) discusses the situation where

*f*= −

*rc*(

*r*constant). Here, we assume

*f*

*x,*

*t*

*f̂*

_{o}

*ikx*

*iωt*

*ω*is a prescribed frequency with period

*T*= 2

*π*/

*ω*and

*k*= 2

*π*/

*L*is a wavenumber with integer

*m.*Oscillatory forcing has been prescribed, for example, by Garcia (1987) and Dunkerton (1989) in idealized models of the stratospheric circulation. A further example is provided by the so-called tape recorder effect, that is, the upward transport of tracers in the Tropics with a tropospheric source that varies periodically in time (e.g., Hall et al. 1999). Quite recently, Gregory and West (2002) investigated the sensitivity of a climate model's transport to the choice of the numerical advection scheme. It must be stressed, however, that (1.2) and (1.3) are highly idealized equations. Nevertheless, progress toward more realistic cases is possible only if we understand the numerics related to (1.2), (1.3).

*c*=

*ĉ*(

*t*) exp(

*ikx*) follows:where

*f̂*

_{o}will be absorbed into

*ĉ*in the remainder. In a slightly more general context, (1.4) is also a discrete equation in space. Depending on the type of discretization,

*ku*

_{o}in (1.4) may be replaced by a “numerical” frequency

*ω*

_{g}with period

*T*

_{g}. For example,

*ω*

_{g}

*u*

_{o}

*kDx*

*Dx,*

*Dx.*Thus, the equation to be analyzed isWith initial condition

*c*=

*c̃*at

*t*= 0 the solution to (1.6) is

*c̃*= 0 because the first term on the right is the solution of the homogeneous unforced problem, which is discussed extensively in the literature. Thus we will consider the solution

*ĉ*

*i*

*iω*

_{g}

*t*

*iωt*

*ω*

*ω*

_{g}

*iωt*) and a “free” part ∼exp(−

*iω*

_{g}

*t*) needed to satisfy the initial condition

*ĉ*= 0. This solution becomes

*ĉ*

*t*

*iωt*

*ω*=

*ω*

_{g}. There is a linear growth of the amplitude in this situation while

*ĉ*

*ω*

_{g}

*ω*

*t*

^{1/2}

*ω*

*ω*

_{g}

^{−1}

In this note, the performance of various numerical schemes with respect to (1.6) will be tested by comparing the related numerical solutions to (1.8) and (1.9).

## 2. Two-level schemes

### a. Exact solution

*Dt*is the time step,

*t*=

*nDt*and

*α*+

*β*= 1. It is reasonable to split the forcing the same way between time levels as

*ĉ*so that

*γ*=

*α,*

*δ*=

*β,*but one may consider as well other coefficients:

*γ,*

*δ*with

*γ*+

*δ*= 1. The eigenvalue

*λ*for (2.1) as defined by

*ĉ*

_{n+1}=

*λĉ*

_{n}is

*λ*

*iαω*

_{g}

*Dt*

*iβω*

_{g}

*Dt*

^{−1}

*λ*it is straightforward to construct a solution to (2.1). Assume

*ĉ*

_{ν}= 0 and let the forcing act just at the moment

*t*=

*νDt.*Then we have

*ĉ*

_{ν+1}

*DtF*

_{ν}

*iβω*

_{g}

*Dt*

^{−1}

*DtF*

_{ν}and thus

*ĉ*

_{n}

*λ*

^{n−ν−1}

*ĉ*

_{ν+1}

*λ*

^{n−ν−1}

*DtF*

_{ν}

*iβω*

_{g}

*Dt*

^{−1}

*t*=

*nDt*for

*n*≥

*ν*+ 1. Forcing at all times 0 ≤

*ν*≤

*n*− 1 induces the responseWith

*x*

*λ*

*iωDt*

^{−1}

*ĉ*

_{n}

*λ*

^{n}

*iωnDt*

*M,*

*n.*The second term ∼exp(−

*iωnDt*) in (2.10) represents the forced part of (1.7) while the first term ∼

*λ*

^{n}stands for the impact of the initial state. The apparent singularity of

*M*for

*λ*= exp(−

*iωDt*) will be discussed below.

### b. Discussion

*λ*| > 1 will be excluded. We consider the trapeze scheme with

*α*=

*β*= 1/2,

*γ*=

*δ*= 1/2 and the backward scheme with

*α*=

*γ*= 0,

*β*=

*δ*= 1. The trapeze scheme is the only two-level scheme with |

*λ*| = 1 (e.g., Durran 1999). The first term in (2.10) will be important in that case even for large

*n.*The damped backward scheme with |

*λ*| < 1 tends toward

*ĉ*

_{n}

*iωnDt*

*M*

*n.*The internal frequency

*ω*

_{g}is wiped out by the damping and the forced part is left.

The factor −*i*(−*ω* + *ω*_{g})^{−1} of the forced part of the analytic solution (1.7) is purely imaginary. This part of the response is out of phase with the forcing. The numerical solution (2.10) captures this situation if the real part *M*_{r} of *M* vanishes. Simple manipulations show that *M*_{r} = 0 for the trapeze scheme if *γ* = *δ* as chosen here. The backward scheme generates a phase error.

*λ*

^{n}| → 0 in (2.10). On the other hand, a resonant solution exists for the trapeze scheme where we may write

*λ*= exp(−

*iθ*)

*Dt.*In the limit

*θ*→

*ω,*the solution (2.10) becomesthat is, the solution has the same form as (1.8) and approaches (1.8) for

*Dt*→ 0. Note, however, that this resonant solution (2.13) does not occur for

*ω*=

*ω*

_{g}if the trapeze scheme is used with a finite time step. Instead (2.2) yields the relation

*ω*

_{g}

*ωDt*

*Dt*

*ωDt*

*ω*

_{g}and

*ω,*which must be satisfied for (2.13) to be the numerical solution. However, (2.14) gives

*ω*

_{g}→

*ω*for

*Dt*→ 0.

*ĉ*

_{n}|/|

*c*(

*nDt*)| =

*R*

_{n}

*S*of the amplitude of the numerical and that of the analytic solution contains a time-dependent part

*R*

_{n}and a constant part

*S*= |

*M*‖

*ω*−

*ω*

_{g}|, wherefor the trapeze scheme. One finds

*R*→ 1/2{1 − cos[(

*ω*−

*ω*

_{g})

*nDt*]}

^{−1}for

*n*→ ∞ for damping schemes in the nonresonant case. Obviously,

*R*

_{n}is periodic and does not contain a permanent bias. We will, therefore, concentrate on

*S*in the remainder. In case of resonance such a splitting is not helpful. We have

*R*

_{n}

*S*→ 0 for

*n*→ ∞ and

*ω*=

*ω*

_{g}while

*R*

_{n}

*S*→ ∞ for

*θ*=

*ω*[see (2.13)]. In the same way, the phase error contains a time-dependent part that depends on time and that is not as interesting as the permanent phase error introduced by the fact that

*M*is complex. Thus the quantity

*d*=

*M*

_{r}/

*M*

_{i}provides a reasonable measure of this phase error. As has been mentioned

*d*= 0 for the trapeze scheme.

The intercomparison will be conducted in terms of numerical resolution as represented by the numbers *m* = *T*/*Dt,* *m*_{g} = *T*_{g}/*Dt* per period. The ratio *S* is displayed in Fig. 1 as a function of *m* and *m*_{g} for the trapeze scheme. This ratio is not a good indicator of the numerical quality along the line *m* = *m*_{g}, where *S* = 0 by definition. It is not reasonable to look only at the second term in (1.7), (2.10) in the case of resonance. The dashed lines restrict the area of the presentation of *S.* Table 1 gives the ratio of the amplitude of the numerical solution to that of the analytic solution for the resonant case *ω* = *ω*_{g} after 100 time steps. A separation of *R*_{n} and *S* does not make sense in this case. A reasonably good approximation is found for *m*_{g} ≥ 12.

It is seen that *S* > 1 for *m* > *m*_{g} and *S* < 1 for *m* < *m*_{g}. The amplitude error is small with 1 ≤ *S* ≤ 1.1 for *m* > *m*_{g} + 2. Amplitude errors are hardly acceptable for *m* ≤ 4. The trapeze scheme cannot cope with such high-frequency forcing. Given *m*_{g} > *m* > 4, *S* decreases first with increasing *m* but increases when the quasi-resonant domain is approached. The errors appear to be tolerable for, say, *m* > 8, *m*_{g} > 12. The agreement of both solutions for *m* = *m*_{g}, *n* = 100 is quite good for, say, *m* > 12. It is clear, however, that the numerical solution will deviate substantially from the analytic one for large *n* in the case of resonance. After all, |*ĉ*| = *t* in (1.8) while |*ĉ*| < 2 |*M*| in (2.10). The crosses mark the noninteger values of *m*_{g} for which the numerical solution is “resonant” for integer values of *m* [see (2.14)]. Clearly, these points are approaching the line *m* = *m*_{g} for increasing *m.* Even so, Fig. 1 suggests avoiding the quasi-resonant domain. This can be achieved by reducing the time step. If, for example, *T* = *T*_{g} + *δT*_{g}(|*δT*_{g}| ≪ *T*_{g}, constant), then *m* = *m*_{g} + *δT*/*Dt.* Thus, a decrease of *Dt* leads to an increase in the difference of *m* and *m*_{g}. There always exists a time step such that the point (*m,* *m*_{g}) is no longer within the quasi-resonant domain, except if *m* = *m*_{g} exactly. In practice, such reductions of *Dt* are not always possible nor is it clear a priori if resonance will be encountered. As has been mentioned, there is no phase error for the forced part.

The results for the backward scheme are presented in Fig. 2. By and large, the performance of the backward scheme is better than that of the trapeze scheme except near the domain of resonance where *S* < 0.5. It is surprising that reasonable values of *S* result even if *m* = 2, at least if *m*_{g} > 5. Of course, the backward scheme fails completely for *m* = *m*_{g}. It does not make sense to insert there values of *S.* The phase errors are larger than 45° (|*d*| > 1) for *m*_{g} > *m,* but are quite small (≤5°) for *m* ≥ *m*_{g} + 5.

## 3. Leapfrog scheme

### a. Solution

*ĉ*

_{n+1}

*ĉ*

_{n−1}

*Dtiω*

_{g}

*ĉ*

_{n}

*Dt*

*iωnDt*

*λ*

_{1,2}

*iω*

_{g}

*Dt*

*ω*

^{2}

_{g}

*Dt*

^{2}

^{1/2}

*Dtω*

_{g}| < 1 is imposed. Assuming as before

*ĉ*

_{ν}= 0 and a forcing at

*t*=

*νDt*it follows that

*ĉ*

_{ν+1}

*DtF*

_{ν}

*F*

_{ν}= exp(−

*iωνDt*) is now the forcing at

*t*=

*νDt*in (3.1). The corresponding general solution is

*ĉ*

_{n}

*Aλ*

^{n−ν}

_{1}

*Bλ*

^{n−ν}

_{2}

*n*≥

*ν,*whereso thatPerforming the same steps as above we obtain the solutionfor forcing at all times 0 ≤

*ν*≤

*n*− 1, where

*x*

_{i}

*λ*

_{i}

*iωDt*

^{−1}

*M*

_{i}

*Dt*

*λ*

_{1}

*λ*

_{2}

^{−1}

*x*

_{i}

^{−1}

### b. Discussion

The first (second) expression on the right of (3.9) represents the contribution of the physical (numerical) mode to the solution. Because |*λ*_{i}| = 1, the impact of the initial state is felt at all times. A satisfactory solution results if *M*_{1} ∼ *i*/(−*ω* + *ω*_{g}), |*M*_{1}| ≫ |*M*_{2}| and if the phase error is small: *λ*^{n}_{1}*i* exp(−*ω*_{g}*nDt*). However, it is obvious that *M*_{1} is not purely imaginary so that the contribution by the physical mode contains a phase error.

*λ*

_{1}= exp(−

*iωDt*), we findThe first term on the right of (3.11) corresponds with (2.13) while the relative importance of the numerical mode as represented by the second term decreases as time proceeds. The relation (2.14) must be replaced by

*ω*

_{g}

*ωDt*

*Dt.*

*S*outside the quasi-resonant domain. The dashed lines are isolines of |

*M*

_{2}|/|

*M*

_{1}|, that is, of the ratio of the amplitude of the numerical term and that of the physical term. In general,

*S*> 1 except for a small region close to the quasi-resonant domain. Errors can be quite large near the quasi-resonant domain even if

*m*> 12, say. The isoline

*S*= 2, for example, does not enter the quasi-resonant area in Fig. 3. After 100 time steps, a reasonably satisfactory solution is obtained for

*m*≥ 12,

*m*=

*m*

_{g}(Table 1). The crosses denote those solutions where the numerical solution is resonant in the same way as in Fig. 1. Again, the crosses approximate the line

*m*=

*m*

_{g}for increasing

*m.*The numerical mode is quite large for

*m*≤ 5 and/or for

*m*

_{g}≤ 7. The relative importance of this mode is reduced near the quasi-resonant domain. All in all, we have to conclude that amplitude errors may be quite large near resonance even for resolutions as good as

*m*= 15. Off resonance, it is preferable to have

*m*

_{g}> 15,

*m*> 6 or

*m*

_{g}≥ 9,

*m*≥ 12. The phase errors of the physical mode are less than 45° nearly throughout Fig. 3 except for

*m*≤ 3. They are quite small near the quasi-resonant domain. For example, the phase error is 14° for

*m*= 10,

*m*

_{g}= 7 and decreases to 0.6° for

*m*= 10,

*m*

_{g}= 11, to increase to 6° for

*m*= 10,

*m*

_{g}= 15.

*λ*

_{1,2}

*iω*

_{g}

*Dt*

^{2}

*ω*

^{2}

_{g}

*Dt*

^{2}

^{1/2}

*λ*

_{1,2}as well. The results are fairly similar to Fig. 3 for a standard choice of ε = 0.06. There is, however, the important difference that |

*λ*

_{i}|

^{n}→ 0 for

*n*→ ∞. Thus

*ĉ*

_{n}

*iωnDt*

*M*

_{2}

*M*

_{1}

*n.*The high-frequency “noise” due to the numerical mode no longer exists. On the other hand, (3.15) is essentially useless near resonance.

## 4. Conclusions

In the foregoing, the advection equation (1.6) with periodic forcing has been solved numerically using two two-level schemes and the leapfrog scheme with an Asselin filter. The numerical solution has been presented in analytic form so that a rather general intercomparison of the numerical solutions to the analytic solution of (1.6) is possible. The intercomparison has been conducted in the (*m,* *m*_{g}) plane. It is found that numerical errors tend to be large near the quasi-resonant domain where *m* ∼ *m*_{g}. Damping schemes like the backward scheme or the leapfrog scheme with an Asselin filter fail to approach the resonant solution. Reversible, undamped schemes like the trapeze and leapfrog scheme generate a resonant solution that approaches the correct one for increasing resolution in time. Off the quasi-resonant domain it is advisable to resolve both the forced and the advective oscillation reasonably well, although both the trapeze and the backward scheme produce small amplitude errors even if *m*_{g} is as small as 2–3. However, the related phase errors of the backward scheme are quite large. By and large, the phase errors of the leapfrog scheme are small. The Asselin filter wipes out the high-frequency oscillations but distorts the quasi-resonant solutions.

The solutions presented above include all possibilities for two-level schemes and can be easily modified to cover other three-level schemes where the forcing is assumed to act not only at time step *n* as in the leapfrog scheme.

## Acknowledgments

The comments by the referees helped to clarify several points and to improve the presentation.

## REFERENCES

Crutzen, P., , M. Lawrence, , and U. Pöschl, 1999: On the background photo chemistry of tropospheric ozone.

,*Tellus***51A****,**123–146.Dunkerton, T., 1989: Body force circulations in a compressible atmosphere: Key concepts.

,*Pure Appl. Geophys.***130****,**243–262.Durran, D., 1999:

*Numerical Methods for Wave Equations in Geophysical Fluid Dynamics*. Springer, 465 pp.Falcone, M., , and R. Ferreti, 1998: Convergence analysis for a class of high-order semi-Lagrangian advection schemes.

,*SIAM J. Numer. Anal.***35****,**909–940.Garcia, R., 1987: On the mean meridional circulation of the middle atmosphere.

,*J. Atmos. Sci.***44****,**3599–3609.Gregory, A., , and V. West, 2002: The sensitivity of a model's stratospheric tape recorder to the choice of advection scheme.

,*Quart. J. Roy. Meteor. Soc.***128****,**1827–1846.Hall, T., , D. Waugh, , K. Boering, , and R. Plumb, 1999: Evaluation of transport in stratospheric models.

,*J. Geophys. Res.***104****,**18815–18839.Hill, J., 1976: Homogeneous turbulent mixing with chemical reaction.

,*Rev. Fluid Mech.***8****,**135–161.Mesinger, F., , and A. Arakawa, 1976: Numerical methods used in atmospheric models. GARP Publ. Series, No. 17, WHO, 65 pp. [Available from World Meteorological organisation. Case postale No. 5 CH-1211 Geneva, Switzerland.].

Ratio of the amplitude of the numerical solution to that of the analytic one after 100 time steps for the resonant case with ω = ω_{g} for the trapeze and leapfrog schemes