New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 10354 for NEMO/trunk/doc/latex/NEMO/subfiles/chap_time_domain.tex – NEMO

Ignore:
Timestamp:
2018-11-21T17:59:55+01:00 (5 years ago)
Author:
nicolasmartin
Message:

Vast edition of LaTeX subfiles to improve the readability by cutting sentences in a more suitable way
Every sentence begins in a new line and if necessary is splitted around 110 characters lenght for side-by-side visualisation,
this setting may not be adequate for everyone but something has to be set.
The punctuation was the primer trigger for the cutting process, otherwise subordinators and coordinators, in order to mostly keep a meaning for each line

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/latex/NEMO/subfiles/chap_time_domain.tex

    r10146 r10354  
    1313 
    1414 
    15 \gmcomment{STEVEN :maybe a picture of the directory structure in the introduction  
    16 which could be referred to here, would help  ==> to be added} 
     15\gmcomment{STEVEN :maybe a picture of the directory structure in the introduction which could be referred to here, 
     16  would help  ==> to be added} 
    1717%%%% 
    1818 
     
    2222 
    2323 
    24 Having defined the continuous equations in \autoref{chap:PE}, we need now to choose  
    25 a time discretization, a key feature of an ocean model as it exerts a strong influence   
    26 on the structure of the computer code ($i.e.$ on its flowchart).  
    27 In the present chapter, we provide a general description of the \NEMO  
    28 time stepping strategy and the consequences for the order in which the equations are 
    29 solved. 
     24Having defined the continuous equations in \autoref{chap:PE}, we need now to choose a time discretization, 
     25a key feature of an ocean model as it exerts a strong influence on the structure of the computer code 
     26($i.e.$ on its flowchart). 
     27In the present chapter, we provide a general description of the \NEMO time stepping strategy and 
     28the consequences for the order in which the equations are solved. 
    3029 
    3130$\ $\newline    % force a new ligne 
     
    3635\label{sec:STP_environment} 
    3736 
    38 The time stepping used in \NEMO is a three level scheme that can be  
    39 represented as follows: 
     37The time stepping used in \NEMO is a three level scheme that can be represented as follows: 
    4038\begin{equation} \label{eq:STP} 
    4139   x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \  \text{RHS}_x^{t-\rdt,\,t,\,t+\rdt} 
    4240\end{equation}  
    43 where $x$ stands for $u$, $v$, $T$ or $S$; RHS is the Right-Hand-Side of the  
    44 corresponding time evolution equation; $\rdt$ is the time step; and the  
    45 superscripts indicate the time at which a quantity is evaluated. Each term of the  
    46 RHS is evaluated at a specific time step depending on the physics with which  
    47 it is associated.  
    48  
    49 The choice of the time step used for this evaluation is discussed below as  
    50 well as the implications for starting or restarting a model  
    51 simulation. Note that the time stepping calculation is generally performed in a single  
    52 operation. With such a complex and nonlinear system of equations it would be  
    53 dangerous to let a prognostic variable evolve in time for each term separately. 
    54  
    55 The three level scheme requires three arrays for each prognostic variable.  
    56 For each variable $x$ there is $x_b$ (before), $x_n$ (now) and $x_a$. The third array,  
    57 although referred to as $x_a$ (after) in the code, is usually not the variable at  
    58 the after time step; but rather it is used to store the time derivative (RHS in  
    59 \autoref{eq:STP}) prior to time-stepping the equation. Generally, the time  
    60 stepping is performed once at each time step in the \mdl{tranxt} and \mdl{dynnxt}  
    61 modules, except when using implicit vertical diffusion or calculating sea surface height  
    62 in which case time-splitting options are used. 
     41where $x$ stands for $u$, $v$, $T$ or $S$; 
     42RHS is the Right-Hand-Side of the corresponding time evolution equation; 
     43$\rdt$ is the time step; 
     44and the superscripts indicate the time at which a quantity is evaluated. 
     45Each term of the RHS is evaluated at a specific time step depending on the physics with which it is associated. 
     46 
     47The choice of the time step used for this evaluation is discussed below as well as 
     48the implications for starting or restarting a model simulation. 
     49Note that the time stepping calculation is generally performed in a single operation. 
     50With such a complex and nonlinear system of equations it would be dangerous to let a prognostic variable evolve in 
     51time for each term separately. 
     52 
     53The three level scheme requires three arrays for each prognostic variable. 
     54For each variable $x$ there is $x_b$ (before), $x_n$ (now) and $x_a$. 
     55The third array, although referred to as $x_a$ (after) in the code, 
     56is usually not the variable at the after time step; 
     57but rather it is used to store the time derivative (RHS in \autoref{eq:STP}) prior to time-stepping the equation. 
     58Generally, the time stepping is performed once at each time step in the \mdl{tranxt} and \mdl{dynnxt} modules, 
     59except when using implicit vertical diffusion or calculating sea surface height in which 
     60case time-splitting options are used. 
    6361 
    6462% ------------------------------------------------------------------------------------------------------------- 
     
    6866\label{sec:STP_leap_frog} 
    6967 
    70 The time stepping used for processes other than diffusion is the well-known leapfrog 
    71 scheme \citep{Mesinger_Arakawa_Bk76}.  This scheme is widely used for advection  
    72 processes in low-viscosity fluids. It is a time centred scheme, $i.e.$  
    73 the RHS in \autoref{eq:STP} is evaluated at time step $t$, the now time step.  
    74 It may be used for momentum and tracer advection,  
    75 pressure gradient, and Coriolis terms, but not for diffusion terms. 
    76 It is an efficient method that achieves  
    77 second-order accuracy with just one right hand side evaluation per time step.  
    78 Moreover, it does not artificially damp linear oscillatory motion nor does it produce  
    79 instability by amplifying the oscillations. These advantages are somewhat diminished  
    80 by the large phase-speed error of the leapfrog scheme, and the unsuitability  
    81 of leapfrog differencing for the representation of diffusion and Rayleigh  
    82 damping processes. However, the scheme allows the coexistence of a numerical  
    83 and a physical mode due to its leading third order dispersive error. In other words a  
    84 divergence of odd and even time steps may occur. To prevent it, the leapfrog scheme  
    85 is often used in association with a Robert-Asselin time filter (hereafter the LF-RA scheme).  
    86 This filter, first designed by \citet{Robert_JMSJ66} and more comprehensively studied  
    87 by \citet{Asselin_MWR72}, is a kind of laplacian diffusion in time that mixes odd and  
    88 even time steps: 
     68The time stepping used for processes other than diffusion is the well-known leapfrog scheme 
     69\citep{Mesinger_Arakawa_Bk76}. 
     70This scheme is widely used for advection processes in low-viscosity fluids. 
     71It is a time centred scheme, $i.e.$ the RHS in \autoref{eq:STP} is evaluated at time step $t$, the now time step. 
     72It may be used for momentum and tracer advection, pressure gradient, and Coriolis terms, 
     73but not for diffusion terms. 
     74It is an efficient method that achieves second-order accuracy with 
     75just one right hand side evaluation per time step. 
     76Moreover, it does not artificially damp linear oscillatory motion nor does it produce instability by 
     77amplifying the oscillations. 
     78These advantages are somewhat diminished by the large phase-speed error of the leapfrog scheme, 
     79and the unsuitability of leapfrog differencing for the representation of diffusion and Rayleigh damping processes. 
     80However, the scheme allows the coexistence of a numerical and a physical mode due to 
     81its leading third order dispersive error. 
     82In other words a divergence of odd and even time steps may occur. 
     83To prevent it, the leapfrog scheme is often used in association with a Robert-Asselin time filter 
     84(hereafter the LF-RA scheme). 
     85This filter, first designed by \citet{Robert_JMSJ66} and more comprehensively studied by \citet{Asselin_MWR72}, 
     86is a kind of laplacian diffusion in time that mixes odd and even time steps: 
    8987\begin{equation} \label{eq:STP_asselin} 
    9088x_F^t  = x^t + \gamma \, \left[ x_F^{t-\rdt} - 2 x^t + x^{t+\rdt} \right] 
    9189\end{equation}  
    92 where the subscript $F$ denotes filtered values and $\gamma$ is the Asselin  
    93 coefficient. $\gamma$ is initialized as \np{rn\_atfp} (namelist parameter).  
    94 Its default value is \np{rn\_atfp}\forcode{ = 10.e-3} (see \autoref{sec:STP_mLF}),  
    95 causing only a weak dissipation of high frequency motions (\citep{Farge1987}).  
    96 The addition of a time filter degrades the accuracy of the  
    97 calculation from second to first order. However, the second order truncation  
    98 error is proportional to $\gamma$, which is small compared to 1. Therefore,  
    99 the LF-RA is a quasi second order accurate scheme. The LF-RA scheme  
    100 is preferred to other time differencing schemes such as  
    101 predictor corrector or trapezoidal schemes, because the user has an explicit  
    102 and simple control of the magnitude of the time diffusion of the scheme.  
    103 When used with the 2nd order space centred discretisation of the  
    104 advection terms in the momentum and tracer equations, LF-RA avoids implicit  
    105 numerical diffusion: diffusion is set explicitly by the user through the Robert-Asselin  
     90where the subscript $F$ denotes filtered values and $\gamma$ is the Asselin coefficient. 
     91$\gamma$ is initialized as \np{rn\_atfp} (namelist parameter). 
     92Its default value is \np{rn\_atfp}\forcode{ = 10.e-3} (see \autoref{sec:STP_mLF}), 
     93causing only a weak dissipation of high frequency motions (\citep{Farge1987}). 
     94The addition of a time filter degrades the accuracy of the calculation from second to first order. 
     95However, the second order truncation error is proportional to $\gamma$, which is small compared to 1. 
     96Therefore, the LF-RA is a quasi second order accurate scheme. 
     97The LF-RA scheme is preferred to other time differencing schemes such as predictor corrector or trapezoidal schemes, 
     98because the user has an explicit and simple control of the magnitude of the time diffusion of the scheme. 
     99When used with the 2nd order space centred discretisation of the advection terms in 
     100the momentum and tracer equations, LF-RA avoids implicit numerical diffusion: 
     101diffusion is set explicitly by the user through the Robert-Asselin  
    106102filter parameter and the viscosity and diffusion coefficients. 
    107103 
     
    112108\label{sec:STP_forward_imp} 
    113109 
    114 The leapfrog differencing scheme is unsuitable for the representation of  
    115 diffusion and damping processes. For a tendancy $D_x$, representing a  
    116 diffusion term or a restoring term to a tracer climatology  
    117 (when present, see \autoref{sec:TRA_dmp}), a forward time differencing scheme 
    118  is used : 
     110The leapfrog differencing scheme is unsuitable for the representation of diffusion and damping processes. 
     111For a tendancy $D_x$, representing a diffusion term or a restoring term to a tracer climatology 
     112(when present, see \autoref{sec:TRA_dmp}), a forward time differencing scheme is used : 
    119113\begin{equation} \label{eq:STP_euler} 
    120114   x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \ {D_x}^{t-\rdt} 
    121115\end{equation}  
    122116 
    123 This is diffusive in time and conditionally stable. The  
    124 conditions for stability of second and fourth order horizontal diffusion schemes are \citep{Griffies_Bk04}: 
     117This is diffusive in time and conditionally stable. 
     118The conditions for stability of second and fourth order horizontal diffusion schemes are \citep{Griffies_Bk04}: 
    125119\begin{equation} \label{eq:STP_euler_stability} 
    126120A^h < \left\{ 
     
    131125\right. 
    132126\end{equation} 
    133 where $e$ is the smallest grid size in the two horizontal directions and $A^h$ is  
    134 the mixing coefficient. The linear constraint \autoref{eq:STP_euler_stability}  
    135 is a necessary condition, but not sufficient. If it is not satisfied, even mildly,  
    136 then the model soon becomes wildly unstable. The instability can be removed  
    137 by either reducing the length of the time steps or reducing the mixing coefficient. 
    138  
    139 For the vertical diffusion terms, a forward time differencing scheme can be  
    140 used, but usually the numerical stability condition imposes a strong  
    141 constraint on the time step. Two solutions are available in \NEMO to overcome  
    142 the stability constraint: $(a)$ a forward time differencing scheme using a  
    143 time splitting technique (\np{ln\_zdfexp}\forcode{ = .true.}) or $(b)$ a backward (or implicit)  
    144 time differencing scheme (\np{ln\_zdfexp}\forcode{ = .false.}). In $(a)$, the master  
    145 time step $\Delta $t is cut into $N$ fractional time steps so that the  
    146 stability criterion is reduced by a factor of $N$. The computation is performed as  
    147 follows: 
     127where $e$ is the smallest grid size in the two horizontal directions and $A^h$ is the mixing coefficient. 
     128The linear constraint \autoref{eq:STP_euler_stability} is a necessary condition, but not sufficient. 
     129If it is not satisfied, even mildly, then the model soon becomes wildly unstable. 
     130The instability can be removed by either reducing the length of the time steps or reducing the mixing coefficient. 
     131 
     132For the vertical diffusion terms, a forward time differencing scheme can be used, 
     133but usually the numerical stability condition imposes a strong constraint on the time step. 
     134Two solutions are available in \NEMO to overcome the stability constraint: 
     135$(a)$ a forward time differencing scheme using a time splitting technique (\np{ln\_zdfexp}\forcode{ = .true.}) or 
     136$(b)$ a backward (or implicit) time differencing scheme                   (\np{ln\_zdfexp}\forcode{ = .false.}). 
     137In $(a)$, the master time step $\Delta $t is cut into $N$ fractional time steps so that 
     138the stability criterion is reduced by a factor of $N$. 
     139The computation is performed as follows: 
    148140\begin{equation} \label{eq:STP_ts} 
    149141\begin{split} 
     
    155147\end{split} 
    156148\end{equation} 
    157 with DF a vertical diffusion term. The number of fractional time steps, $N$, is given  
    158 by setting \np{nn\_zdfexp}, (namelist parameter). The scheme $(b)$ is unconditionally  
    159 stable but diffusive. It can be written as follows: 
     149with DF a vertical diffusion term. 
     150The number of fractional time steps, $N$, is given by setting \np{nn\_zdfexp}, (namelist parameter). 
     151The scheme $(b)$ is unconditionally stable but diffusive. It can be written as follows: 
    160152\begin{equation} \label{eq:STP_imp} 
    161153   x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \  \text{RHS}_x^{t+\rdt} 
     
    166158%%gm 
    167159 
    168 This scheme is rather time consuming since it requires a matrix inversion,  
    169 but it becomes attractive since a value of 3 or more is needed for N in 
    170 the forward time differencing scheme. For example, the finite difference  
    171 approximation of the temperature equation is: 
     160This scheme is rather time consuming since it requires a matrix inversion, 
     161but it becomes attractive since a value of 3 or more is needed for N in the forward time differencing scheme. 
     162For example, the finite difference approximation of the temperature equation is: 
    172163\begin{equation} \label{eq:STP_imp_zdf} 
    173164\frac{T(k)^{t+1}-T(k)^{t-1}}{2\;\rdt}\equiv \text{RHS}+\frac{1}{e_{3t} }\delta  
     
    175166\right] 
    176167\end{equation} 
    177 where RHS is the right hand side of the equation except for the vertical diffusion term.  
     168where RHS is the right hand side of the equation except for the vertical diffusion term. 
    178169We rewrite \autoref{eq:STP_imp} as: 
    179170\begin{equation} \label{eq:STP_imp_mat} 
     
    187178\end{align*} 
    188179 
    189 \autoref{eq:STP_imp_mat} is a linear system of equations with an associated  
    190 matrix which is tridiagonal. Moreover, $c(k)$ and $d(k)$ are positive and the diagonal  
    191 term is greater than the sum of the two extra-diagonal terms, therefore a special  
    192 adaptation of the Gauss elimination procedure is used to find the solution  
     180\autoref{eq:STP_imp_mat} is a linear system of equations with an associated matrix which is tridiagonal. 
     181Moreover, 
     182$c(k)$ and $d(k)$ are positive and the diagonal term is greater than the sum of the two extra-diagonal terms, 
     183therefore a special adaptation of the Gauss elimination procedure is used to find the solution 
    193184(see for example \citet{Richtmyer1967}). 
    194185 
     
    205196%\gmcomment{  
    206197%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    207 \begin{figure}[!t]     \begin{center} 
    208 \includegraphics[width=0.7\textwidth]{Fig_TimeStepping_flowchart} 
    209 \caption{   \protect\label{fig:TimeStep_flowchart} 
    210 Sketch of the leapfrog time stepping sequence in \NEMO from \citet{Leclair_Madec_OM09}.  
    211 The use of a semi-implicit computation of the hydrostatic pressure gradient requires 
    212 the tracer equation to be stepped forward prior to the momentum equation.  
    213 The need for knowledge of the vertical scale factor (here denoted as $h$) 
    214 requires the sea surface height and the continuity equation to be stepped forward 
    215 prior to the computation of the tracer equation. 
    216 Note that the method for the evaluation of the surface pressure gradient $\nabla p_s$ is not presented here  
    217 (see \autoref{sec:DYN_spg}). } 
     198\begin{figure}[!t] 
     199  \begin{center} 
     200    \includegraphics[width=0.7\textwidth]{Fig_TimeStepping_flowchart} 
     201    \caption{  \protect\label{fig:TimeStep_flowchart} 
     202      Sketch of the leapfrog time stepping sequence in \NEMO from \citet{Leclair_Madec_OM09}. 
     203      The use of a semi-implicit computation of the hydrostatic pressure gradient requires the tracer equation to 
     204      be stepped forward prior to the momentum equation. 
     205      The need for knowledge of the vertical scale factor (here denoted as $h$) requires the sea surface height and 
     206      the continuity equation to be stepped forward prior to the computation of the tracer equation. 
     207      Note that the method for the evaluation of the surface pressure gradient $\nabla p_s$ is not presented here 
     208      (see \autoref{sec:DYN_spg}). 
     209    } 
    218210\end{center}   \end{figure} 
    219211%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    226218\label{sec:STP_mLF} 
    227219 
    228 Significant changes have been introduced by \cite{Leclair_Madec_OM09} in the  
    229 LF-RA scheme in order to ensure tracer conservation and to allow the use of  
    230 a much smaller value of the Asselin filter parameter. The modifications affect  
    231 both the forcing and filtering treatments in the LF-RA scheme. 
    232  
    233 In a classical LF-RA environment, the forcing term is centred in time, $i.e.$  
    234 it is time-stepped over a $2\rdt$ period:  $x^t  = x^t + 2\rdt Q^t $ where $Q$  
    235 is the forcing applied to $x$, and the time filter is given by \autoref{eq:STP_asselin}  
    236 so that $Q$ is redistributed over several time step.  
     220Significant changes have been introduced by \cite{Leclair_Madec_OM09} in the LF-RA scheme in order to ensure tracer conservation and to allow the use of a much smaller value of the Asselin filter parameter. 
     221The modifications affect both the forcing and filtering treatments in the LF-RA scheme. 
     222 
     223In a classical LF-RA environment, the forcing term is centred in time, 
     224$i.e.$ it is time-stepped over a $2\rdt$ period: 
     225$x^t  = x^t + 2\rdt Q^t $ where $Q$ is the forcing applied to $x$, 
     226and the time filter is given by \autoref{eq:STP_asselin} so that $Q$ is redistributed over several time step. 
    237227In the modified LF-RA environment, these two formulations have been replaced by: 
    238228\begin{align}  
     
    242232           - \gamma\,\rdt \, \left[ Q^{t+\rdt/2} -  Q^{t-\rdt/2} \right]                          \label{eq:STP_RA} 
    243233\end{align} 
    244 The change in the forcing formulation given by \autoref{eq:STP_forcing}  
    245 (see \autoref{fig:MLF_forcing}) has a significant effect: the forcing term no  
    246 longer excites the divergence of odd and even time steps \citep{Leclair_Madec_OM09}.  
     234The change in the forcing formulation given by \autoref{eq:STP_forcing} (see \autoref{fig:MLF_forcing}) 
     235has a significant effect: 
     236the forcing term no longer excites the divergence of odd and even time steps \citep{Leclair_Madec_OM09}.  
    247237% forcing seen by the model.... 
    248 This property improves the LF-RA scheme in two respects.  
     238This property improves the LF-RA scheme in two respects. 
    249239First, the LF-RA can now ensure the local and global conservation of tracers. 
    250 Indeed, time filtering is no longer required on the forcing part. The influence of  
    251 the Asselin filter on the forcing is be removed by adding a new term in the filter 
    252 (last term in \autoref{eq:STP_RA} compared to \autoref{eq:STP_asselin}). Since  
    253 the filtering of the forcing was the source of non-conservation in the classical  
    254 LF-RA scheme, the modified formulation becomes conservative  \citep{Leclair_Madec_OM09}. 
    255 Second, the LF-RA becomes a truly quasi-second order scheme. Indeed,  
    256 \autoref{eq:STP_forcing} used in combination with a careful treatment of static  
    257 instability (\autoref{subsec:ZDF_evd}) and of the TKE physics (\autoref{subsec:ZDF_tke_ene}), 
    258 the two other main sources of time step divergence, allows a reduction by  
    259 two orders of magnitude of the Asselin filter parameter.  
    260  
    261 Note that the forcing is now provided at the middle of a time step: $Q^{t+\rdt/2}$  
    262 is the forcing applied over the $[t,t+\rdt]$ time interval. This and the change  
    263 in the time filter, \autoref{eq:STP_RA}, allows an exact evaluation of the  
    264 contribution due to the forcing term between any two time steps,  
    265 even if separated by only $\rdt$ since the time filter is no longer applied to the 
    266 forcing term. 
     240Indeed, time filtering is no longer required on the forcing part. 
     241The influence of the Asselin filter on the forcing is be removed by adding a new term in the filter 
     242(last term in \autoref{eq:STP_RA} compared to \autoref{eq:STP_asselin}). 
     243Since the filtering of the forcing was the source of non-conservation in the classical LF-RA scheme, 
     244the modified formulation becomes conservative \citep{Leclair_Madec_OM09}. 
     245Second, the LF-RA becomes a truly quasi-second order scheme. 
     246Indeed, \autoref{eq:STP_forcing} used in combination with a careful treatment of static instability 
     247(\autoref{subsec:ZDF_evd}) and of the TKE physics (\autoref{subsec:ZDF_tke_ene}), 
     248the two other main sources of time step divergence, 
     249allows a reduction by two orders of magnitude of the Asselin filter parameter.  
     250 
     251Note that the forcing is now provided at the middle of a time step: 
     252$Q^{t+\rdt/2}$ is the forcing applied over the $[t,t+\rdt]$ time interval. 
     253This and the change in the time filter, \autoref{eq:STP_RA}, 
     254allows an exact evaluation of the contribution due to the forcing term between any two time steps, 
     255even if separated by only $\rdt$ since the time filter is no longer applied to the forcing term. 
    267256 
    268257%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    269 \begin{figure}[!t]     \begin{center} 
    270 \includegraphics[width=0.90\textwidth]{Fig_MLF_forcing} 
    271 \caption{   \protect\label{fig:MLF_forcing} 
    272 Illustration of forcing integration methods.  
    273 (top) ''Traditional'' formulation : the forcing is defined at the same time as the variable  
    274 to which it is applied (integer value of the time step index) and it is applied over a $2\rdt$ period.  
    275 (bottom)  modified formulation : the forcing is defined in the middle of the time (integer and a half  
    276 value of the time step index) and the mean of two successive forcing values ($n-1/2$, $n+1/2$). 
    277 is applied over a $2\rdt$ period.} 
    278 \end{center}   \end{figure} 
     258\begin{figure}[!t] 
     259  \begin{center} 
     260    \includegraphics[width=0.90\textwidth]{Fig_MLF_forcing} 
     261    \caption{  \protect\label{fig:MLF_forcing} 
     262      Illustration of forcing integration methods. 
     263      (top) ''Traditional'' formulation: 
     264      the forcing is defined at the same time as the variable to which it is applied 
     265      (integer value of the time step index) and it is applied over a $2\rdt$ period. 
     266      (bottom)  modified formulation: 
     267      the forcing is defined in the middle of the time (integer and a half value of the time step index) and 
     268      the mean of two successive forcing values ($n-1/2$, $n+1/2$) is applied over a $2\rdt$ period. 
     269    } 
     270  \end{center} 
     271\end{figure} 
    279272%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    280273 
     
    289282%-------------------------------------------------------------------------------------------------------------- 
    290283 
    291 The first time step of this three level scheme when starting from initial conditions  
    292 is a forward step (Euler time integration):  
     284The first time step of this three level scheme when starting from initial conditions is a forward step 
     285(Euler time integration): 
    293286\begin{equation} \label{eq:DOM_euler} 
    294287   x^1 = x^0 + \rdt \ \text{RHS}^0 
    295288\end{equation} 
    296 This is done simply by keeping the leapfrog environment ($i.e.$ the \autoref{eq:STP}  
    297 three level time stepping) but setting all $x^0$ (\textit{before}) and $x^{1}$ (\textit{now}) fields  
    298 equal at the first time step and using half the value of $\rdt$. 
    299  
    300 It is also possible to restart from a previous computation, by using a  
    301 restart file. The restart strategy is designed to ensure perfect  
    302 restartability of the code: the user should obtain the same results to  
    303 machine precision either by running the model for $2N$ time steps in one go,  
    304 or by performing two consecutive experiments of $N$ steps with a restart.  
    305 This requires saving two time levels and many auxiliary data in the restart  
    306 files in machine precision.  
    307  
    308 Note that when a semi-implicit scheme is used to evaluate the hydrostatic pressure  
    309 gradient (see \autoref{subsec:DYN_hpg_imp}), an extra three-dimensional field has to be  
    310 added to the restart file to ensure an exact restartability. This is done optionally  
    311 via the  \np{nn\_dynhpg\_rst} namelist parameter, so that the size of the 
    312 restart file can be reduced when restartability is not a key issue (operational  
    313 oceanography or in ensemble simulations for seasonal forecasting). 
    314  
    315 Note the size of the time step used, $\rdt$, is also saved in the restart file.  
    316 When restarting, if the the time step has been changed, a restart using an Euler time  
    317 stepping scheme is imposed.  
     289This is done simply by keeping the leapfrog environment ($i.e.$ the \autoref{eq:STP} three level time stepping) but 
     290setting all $x^0$ (\textit{before}) and $x^{1}$ (\textit{now}) fields equal at the first time step and 
     291using half the value of $\rdt$. 
     292 
     293It is also possible to restart from a previous computation, by using a restart file. 
     294The restart strategy is designed to ensure perfect restartability of the code: 
     295the user should obtain the same results to machine precision either by 
     296running the model for $2N$ time steps in one go, 
     297or by performing two consecutive experiments of $N$ steps with a restart. 
     298This requires saving two time levels and many auxiliary data in the restart files in machine precision.  
     299 
     300Note that when a semi-implicit scheme is used to evaluate the hydrostatic pressure gradient 
     301(see \autoref{subsec:DYN_hpg_imp}), an extra three-dimensional field has to 
     302be added to the restart file to ensure an exact restartability. 
     303This is done optionally via the  \np{nn\_dynhpg\_rst} namelist parameter, 
     304so that the size of the restart file can be reduced when restartability is not a key issue 
     305(operational oceanography or in ensemble simulations for seasonal forecasting). 
     306 
     307Note the size of the time step used, $\rdt$, is also saved in the restart file. 
     308When restarting, if the the time step has been changed, a restart using an Euler time stepping scheme is imposed.  
    318309Options are defined through the  \ngn{namrun} namelist variables. 
    319310%%% 
Note: See TracChangeset for help on using the changeset viewer.