# Time-stepping Schemes Review

Time-stepping Schemes Review

Numerical time stepping uses a discrete approximation to:

 $StartFraction normal partial-differential phi left-parenthesis t right-parenthesis Over normal partial-differential t EndFraction equals script upper F left-parenthesis t right-parenthesis$ (1)

where represents one of , , , or and represents all the right-hand-side terms. In ROMS, the goal is to find time-stepping schemes which are accurate where they are valid and damping on unresolved signals ( Shchepetkin and McWilliams (2005) and Shchepetkin and McWilliams (2009)). Also, the preference is for time-stepping schemes requiring only one set of the right-hand-side terms so that different time-stepping schemes can be used for different terms in the equations. Finally, as mentioned in Table Time Step, not all versions of ROMS use the same time-stepping algorithm. We list some time-stepping schemes here which are used or have been used by the ROMS/SCRUM family of models, plus a few to help explain some of the more esoteric ones.

## Euler

The simplest approximation is the Euler time step:

 $StartFraction phi left-parenthesis t plus normal upper Delta t right-parenthesis minus phi left-parenthesis t right-parenthesis Over normal upper Delta t EndFraction equals script upper F left-parenthesis t right-parenthesis$ (2)

where you predict the next value based only on the current fields. This method is accurate to first order in ; however, it is unconditionally unstable with respect to advection.

## Leapfrog

The leapfrog time step is accurate to O():

 $StartFraction phi left-parenthesis t plus normal upper Delta t right-parenthesis minus phi left-parenthesis t minus normal upper Delta t right-parenthesis Over 2 normal upper Delta t EndFraction equals script upper F left-parenthesis t right-parenthesis period$ (3)

This time step is more accurate, but it is unconditionally unstable with respect to diffusion. Also, the even and odd time steps tend to diverge in a computational mode. This computational mode can be damped by taking correction steps. SCRUM's time step on the depth-integrated equations was a leapfrog step with a trapezoidal correction (LF-TR) on every step, which uses a leapfrog step to obtain an initial guess of . We will call the right-hand-side terms calculated from this initial guess :

 $StartFraction phi left-parenthesis t plus normal upper Delta t right-parenthesis minus phi left-parenthesis t right-parenthesis Over normal upper Delta t EndFraction equals one-half left-bracket script upper F left-parenthesis t right-parenthesis plus script upper F Superscript asterisk Baseline left-parenthesis t plus normal upper Delta t right-parenthesis right-bracket period$ (4)

This leapfrog-trapezoidal time step is stable with respect to diffusion and it strongly damps the computational mode. However, the right-hand-side terms are computed twice per time step.

The time step on SCRUM's full 3-D fields is done with a third-order Adams-Bashforth step. It uses three time-levels of the right-hand-side terms:

 $StartFraction phi left-parenthesis t plus normal upper Delta t right-parenthesis minus phi left-parenthesis t right-parenthesis Over normal upper Delta t EndFraction equals alpha script upper F left-parenthesis t right-parenthesis plus beta script upper F left-parenthesis t minus normal upper Delta t right-parenthesis plus gamma script upper F left-parenthesis t minus 2 normal upper Delta t right-parenthesis$ (5)

where the coefficients , and are chosen to obtain a third-order estimate of . We use a Taylor series expansion:

 $StartFraction phi left-parenthesis t plus normal upper Delta t right-parenthesis minus phi left-parenthesis t right-parenthesis Over normal upper Delta t EndFraction equals phi prime plus StartFraction normal upper Delta t Over 2 EndFraction phi Superscript double-prime Baseline plus StartFraction normal upper Delta t squared Over 6 EndFraction phi Superscript triple-prime Baseline plus midline-horizontal-ellipsis right-parenthesis$ (6)

where

We find that the coefficients are:

This requires one time level for the physical fields and three time levels of the right-hand-side information and requires special treatment on startup.

## Forward-Backward

In equation (1) above, we assume that multiple equations for any number of variables are time stepped synchronously. For coupled equations, we can actually do better by time stepping asynchronously. Consider these equations:

 $StartLayout 1st Row 1st Column StartFraction normal partial-differential zeta Over normal partial-differential t EndFraction 2nd Column equals script upper F left-parenthesis u right-parenthesis 2nd Row 1st Column StartFraction normal partial-differential u Over normal partial-differential t EndFraction 2nd Column equals script upper G left-parenthesis zeta right-parenthesis EndLayout$ (7)

If we time step them alternately, we can always be using the newest information:

 $StartLayout 1st Row 1st Column zeta Superscript n plus 1 2nd Column equals zeta Superscript n Baseline plus script upper F left-parenthesis u Superscript n Baseline right-parenthesis normal upper Delta t 2nd Row 1st Column u Superscript n plus 1 2nd Column equals u Superscript n Baseline plus script upper G left-parenthesis zeta Superscript n plus 1 Baseline right-parenthesis normal upper Delta t EndLayout$ (8)

This scheme is second-order accurate and is stable for longer time steps than many other schemes. It is however unstable for advection terms.

## Forward-Backward Feedback (RK2-FB)

One option for solving equation (7) is a predictor-corrector with predictor step:

 $StartLayout 1st Row 1st Column zeta Superscript n plus 1 comma star 2nd Column equals zeta Superscript n Baseline plus script upper F left-parenthesis u Superscript n Baseline right-parenthesis normal upper Delta t 2nd Row 1st Column u Superscript n plus 1 comma star 2nd Column equals u Superscript n Baseline plus left-bracket beta script upper G left-parenthesis zeta Superscript n plus 1 comma star Baseline right-parenthesis plus left-parenthesis 1 minus beta right-parenthesis script upper G left-parenthesis zeta Superscript n Baseline right-parenthesis right-bracket normal upper Delta t EndLayout$ (9)

and corrector step:

 $StartLayout 1st Row 1st Column zeta Superscript n plus 1 2nd Column equals zeta Superscript n Baseline plus one-half left-bracket script upper F left-parenthesis u Superscript n plus 1 comma star Baseline right-parenthesis plus script upper F left-parenthesis u Superscript n Baseline right-parenthesis right-bracket normal upper Delta t 2nd Row 1st Column u Superscript n plus 1 2nd Column equals u Superscript n Baseline plus one-half left-bracket epsilon script upper G left-parenthesis zeta Superscript n plus 1 Baseline right-parenthesis plus left-parenthesis 1 minus epsilon right-parenthesis script upper G left-parenthesis zeta Superscript n plus 1 comma star Baseline right-parenthesis plus script upper G left-parenthesis zeta Superscript n Baseline right-parenthesis right-bracket normal upper Delta t EndLayout$ (10)

Setting in the above, it becomes a standard second order Runge-Kutta scheme, which is unstable for a non-dissipative system. Adding the and terms adds Forward-Backward feedback to this algorithm, and allows us to improve both its accuracy and stability. The choice of and leads to a stable third-order scheme with .

## LF-TR and LF-AM3 with FB Feedback

Another possibility is a leapfrog predictor:

 $StartLayout 1st Row 1st Column zeta Superscript n plus 1 comma star 2nd Column equals zeta Superscript n minus 1 Baseline plus 2 script upper F left-parenthesis u Superscript n Baseline right-parenthesis normal upper Delta t 2nd Row 1st Column u Superscript n plus 1 comma star 2nd Column equals u Superscript n minus 1 Baseline plus 2 StartSet left-parenthesis 1 minus 2 beta right-parenthesis script upper G left-parenthesis zeta Superscript n Baseline right-parenthesis plus beta left-bracket script upper G left-parenthesis zeta Superscript n plus 1 comma star Baseline right-parenthesis plus script upper G left-parenthesis zeta Superscript n minus 1 Baseline right-parenthesis right-bracket EndSet normal upper Delta t EndLayout$ (11)

and either a two-time trapezoidal or a three-time Adams-Moulton corrector:

 $StartLayout 1st Row 1st Column zeta Superscript n plus 1 2nd Column equals zeta Superscript n Baseline plus left-bracket left-parenthesis one-half minus gamma right-parenthesis script upper F left-parenthesis u Superscript n plus 1 comma star Baseline right-parenthesis plus left-parenthesis one-half plus 2 gamma right-parenthesis script upper F left-parenthesis u Superscript n Baseline right-parenthesis minus gamma script upper F left-parenthesis u Superscript n minus 1 Baseline right-parenthesis right-bracket normal upper Delta t 2nd Row 1st Column u Superscript n plus 1 2nd Column equals u Superscript n Baseline plus StartSet left-parenthesis one-half minus gamma right-parenthesis left-bracket epsilon script upper G left-parenthesis zeta Superscript n plus 1 Baseline right-parenthesis plus left-parenthesis 1 minus epsilon right-parenthesis script upper G left-parenthesis zeta Superscript n plus 1 comma star Baseline right-parenthesis right-bracket plus left-parenthesis one-half plus 2 gamma right-parenthesis script upper G left-parenthesis zeta Superscript n Baseline right-parenthesis minus gamma script upper G left-parenthesis zeta Superscript n minus 1 Baseline right-parenthesis EndSet normal upper Delta t EndLayout$ (12)

where the parameters and introduce FB-feedback during both stages, while controls the type of corrector scheme. Without FB-feedback, we have:

Keeping maintains third-order accuracy. The most accurate choices for and are and , which yields a fourth-order scheme with low numerical dispersion and diffusion and .

## Generalized FB with an AB3-AM4 Step

One drawback of the previous two schemes is the need to evaluate the right-hand-side (r.h.s.) terms twice per time step. The original forward-backward scheme manages to achieve while only evaluating each r.h.s. term once. It is possible to contruct a robust scheme using a combination of a three-time AB3-like step for with a four-time AM4-like step for :

 $StartLayout 1st Row 1st Column zeta Superscript n plus 1 2nd Column equals zeta Superscript n Baseline plus left-bracket left-parenthesis three-halves plus beta right-parenthesis script upper F left-parenthesis u Superscript n Baseline right-parenthesis minus left-parenthesis one-half plus 2 beta right-parenthesis script upper F left-parenthesis u Superscript n minus 1 Baseline right-parenthesis plus beta script upper F left-parenthesis u Superscript n minus 2 Baseline right-parenthesis right-bracket normal upper Delta t 2nd Row 1st Column u Superscript n plus 1 2nd Column equals u Superscript n Baseline plus left-bracket left-parenthesis one-half plus gamma plus 2 epsilon right-parenthesis script upper G left-parenthesis zeta Superscript n plus 1 Baseline right-parenthesis plus left-parenthesis one-half minus 2 gamma minus 3 epsilon right-parenthesis script upper G left-parenthesis zeta Superscript n Baseline right-parenthesis plus gamma script upper G left-parenthesis zeta Superscript n minus 1 Baseline right-parenthesis plus epsilon script upper G left-parenthesis zeta Superscript n minus 2 Baseline right-parenthesis right-bracket normal upper Delta t EndLayout$ (13)

This is second-order accurate for any set of values for , , and . It is third-order accurate if . However, it has a wider stability range for . Shchepetkin and McWilliams (2009) choose to use this scheme for the barotropic mode in their model with , , and , to obtain , close to the value of 2 for pure FB, but with better stability properties for the combination of waves, advection, and Coriolis terms.