Changeset 10354 for NEMO/trunk/doc/latex/NEMO/subfiles/chap_time_domain.tex
- Timestamp:
- 2018-11-21T17:59:55+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/doc/latex/NEMO/subfiles/chap_time_domain.tex
r10146 r10354 13 13 14 14 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} 17 17 %%%% 18 18 … … 22 22 23 23 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. 24 Having defined the continuous equations in \autoref{chap:PE}, we need now to choose a time discretization, 25 a 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). 27 In the present chapter, we provide a general description of the \NEMO time stepping strategy and 28 the consequences for the order in which the equations are solved. 30 29 31 30 $\ $\newline % force a new ligne … … 36 35 \label{sec:STP_environment} 37 36 38 The time stepping used in \NEMO is a three level scheme that can be 39 represented as follows: 37 The time stepping used in \NEMO is a three level scheme that can be represented as follows: 40 38 \begin{equation} \label{eq:STP} 41 39 x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \ \text{RHS}_x^{t-\rdt,\,t,\,t+\rdt} 42 40 \end{equation} 43 where $x$ stands for $u$, $v$, $T$ or $S$; RHS is the Right-Hand-Side of the44 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 intime 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 whichcase time-splitting options are used.41 where $x$ stands for $u$, $v$, $T$ or $S$; 42 RHS is the Right-Hand-Side of the corresponding time evolution equation; 43 $\rdt$ is the time step; 44 and the superscripts indicate the time at which a quantity is evaluated. 45 Each term of the RHS is evaluated at a specific time step depending on the physics with which it is associated. 46 47 The choice of the time step used for this evaluation is discussed below as well as 48 the implications for starting or restarting a model simulation. 49 Note that the time stepping calculation is generally performed in a single operation. 50 With such a complex and nonlinear system of equations it would be dangerous to let a prognostic variable evolve in 51 time for each term separately. 52 53 The three level scheme requires three arrays for each prognostic variable. 54 For each variable $x$ there is $x_b$ (before), $x_n$ (now) and $x_a$. 55 The third array, although referred to as $x_a$ (after) in the code, 56 is usually not the variable at the after time step; 57 but rather it is used to store the time derivative (RHS in \autoref{eq:STP}) prior to time-stepping the equation. 58 Generally, the time stepping is performed once at each time step in the \mdl{tranxt} and \mdl{dynnxt} modules, 59 except when using implicit vertical diffusion or calculating sea surface height in which 60 case time-splitting options are used. 63 61 64 62 % ------------------------------------------------------------------------------------------------------------- … … 68 66 \label{sec:STP_leap_frog} 69 67 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:68 The time stepping used for processes other than diffusion is the well-known leapfrog scheme 69 \citep{Mesinger_Arakawa_Bk76}. 70 This scheme is widely used for advection processes in low-viscosity fluids. 71 It is a time centred scheme, $i.e.$ the RHS in \autoref{eq:STP} is evaluated at time step $t$, the now time step. 72 It may be used for momentum and tracer advection, pressure gradient, and Coriolis terms, 73 but not for diffusion terms. 74 It is an efficient method that achieves second-order accuracy with 75 just one right hand side evaluation per time step. 76 Moreover, it does not artificially damp linear oscillatory motion nor does it produce instability by 77 amplifying the oscillations. 78 These advantages are somewhat diminished by the large phase-speed error of the leapfrog scheme, 79 and the unsuitability of leapfrog differencing for the representation of diffusion and Rayleigh damping processes. 80 However, the scheme allows the coexistence of a numerical and a physical mode due to 81 its leading third order dispersive error. 82 In other words a divergence of odd and even time steps may occur. 83 To prevent it, the leapfrog scheme is often used in association with a Robert-Asselin time filter 84 (hereafter the LF-RA scheme). 85 This filter, first designed by \citet{Robert_JMSJ66} and more comprehensively studied by \citet{Asselin_MWR72}, 86 is a kind of laplacian diffusion in time that mixes odd and even time steps: 89 87 \begin{equation} \label{eq:STP_asselin} 90 88 x_F^t = x^t + \gamma \, \left[ x_F^{t-\rdt} - 2 x^t + x^{t+\rdt} \right] 91 89 \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 90 where the subscript $F$ denotes filtered values and $\gamma$ is the Asselin coefficient. 91 $\gamma$ is initialized as \np{rn\_atfp} (namelist parameter). 92 Its default value is \np{rn\_atfp}\forcode{ = 10.e-3} (see \autoref{sec:STP_mLF}), 93 causing only a weak dissipation of high frequency motions (\citep{Farge1987}). 94 The addition of a time filter degrades the accuracy of the calculation from second to first order. 95 However, the second order truncation error is proportional to $\gamma$, which is small compared to 1. 96 Therefore, the LF-RA is a quasi second order accurate scheme. 97 The LF-RA scheme is preferred to other time differencing schemes such as predictor corrector or trapezoidal schemes, 98 because the user has an explicit and simple control of the magnitude of the time diffusion of the scheme. 99 When used with the 2nd order space centred discretisation of the advection terms in 100 the momentum and tracer equations, LF-RA avoids implicit numerical diffusion: 101 diffusion is set explicitly by the user through the Robert-Asselin 106 102 filter parameter and the viscosity and diffusion coefficients. 107 103 … … 112 108 \label{sec:STP_forward_imp} 113 109 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 : 110 The leapfrog differencing scheme is unsuitable for the representation of diffusion and damping processes. 111 For 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 : 119 113 \begin{equation} \label{eq:STP_euler} 120 114 x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \ {D_x}^{t-\rdt} 121 115 \end{equation} 122 116 123 This is diffusive in time and conditionally stable. The124 conditions for stability of second and fourth order horizontal diffusion schemes are \citep{Griffies_Bk04}:117 This is diffusive in time and conditionally stable. 118 The conditions for stability of second and fourth order horizontal diffusion schemes are \citep{Griffies_Bk04}: 125 119 \begin{equation} \label{eq:STP_euler_stability} 126 120 A^h < \left\{ … … 131 125 \right. 132 126 \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: 127 where $e$ is the smallest grid size in the two horizontal directions and $A^h$ is the mixing coefficient. 128 The linear constraint \autoref{eq:STP_euler_stability} is a necessary condition, but not sufficient. 129 If it is not satisfied, even mildly, then the model soon becomes wildly unstable. 130 The instability can be removed by either reducing the length of the time steps or reducing the mixing coefficient. 131 132 For the vertical diffusion terms, a forward time differencing scheme can be used, 133 but usually the numerical stability condition imposes a strong constraint on the time step. 134 Two 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.}). 137 In $(a)$, the master time step $\Delta $t is cut into $N$ fractional time steps so that 138 the stability criterion is reduced by a factor of $N$. 139 The computation is performed as follows: 148 140 \begin{equation} \label{eq:STP_ts} 149 141 \begin{split} … … 155 147 \end{split} 156 148 \end{equation} 157 with DF a vertical diffusion term. The number of fractional time steps, $N$, is given158 by setting \np{nn\_zdfexp}, (namelist parameter). The scheme $(b)$ is unconditionally 159 stable but diffusive. It can be written as follows:149 with DF a vertical diffusion term. 150 The number of fractional time steps, $N$, is given by setting \np{nn\_zdfexp}, (namelist parameter). 151 The scheme $(b)$ is unconditionally stable but diffusive. It can be written as follows: 160 152 \begin{equation} \label{eq:STP_imp} 161 153 x^{t+\rdt} = x^{t-\rdt} + 2 \, \rdt \ \text{RHS}_x^{t+\rdt} … … 166 158 %%gm 167 159 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: 160 This scheme is rather time consuming since it requires a matrix inversion, 161 but it becomes attractive since a value of 3 or more is needed for N in the forward time differencing scheme. 162 For example, the finite difference approximation of the temperature equation is: 172 163 \begin{equation} \label{eq:STP_imp_zdf} 173 164 \frac{T(k)^{t+1}-T(k)^{t-1}}{2\;\rdt}\equiv \text{RHS}+\frac{1}{e_{3t} }\delta … … 175 166 \right] 176 167 \end{equation} 177 where RHS is the right hand side of the equation except for the vertical diffusion term. 168 where RHS is the right hand side of the equation except for the vertical diffusion term. 178 169 We rewrite \autoref{eq:STP_imp} as: 179 170 \begin{equation} \label{eq:STP_imp_mat} … … 187 178 \end{align*} 188 179 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. 181 Moreover, 182 $c(k)$ and $d(k)$ are positive and the diagonal term is greater than the sum of the two extra-diagonal terms, 183 therefore a special adaptation of the Gauss elimination procedure is used to find the solution 193 184 (see for example \citet{Richtmyer1967}). 194 185 … … 205 196 %\gmcomment{ 206 197 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 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 } 218 210 \end{center} \end{figure} 219 211 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 226 218 \label{sec:STP_mLF} 227 219 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. 220 Significant 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. 221 The modifications affect both the forcing and filtering treatments in the LF-RA scheme. 222 223 In 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$, 226 and the time filter is given by \autoref{eq:STP_asselin} so that $Q$ is redistributed over several time step. 237 227 In the modified LF-RA environment, these two formulations have been replaced by: 238 228 \begin{align} … … 242 232 - \gamma\,\rdt \, \left[ Q^{t+\rdt/2} - Q^{t-\rdt/2} \right] \label{eq:STP_RA} 243 233 \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}.234 The change in the forcing formulation given by \autoref{eq:STP_forcing} (see \autoref{fig:MLF_forcing}) 235 has a significant effect: 236 the forcing term no longer excites the divergence of odd and even time steps \citep{Leclair_Madec_OM09}. 247 237 % forcing seen by the model.... 248 This property improves the LF-RA scheme in two respects. 238 This property improves the LF-RA scheme in two respects. 249 239 First, 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. 240 Indeed, time filtering is no longer required on the forcing part. 241 The 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}). 243 Since the filtering of the forcing was the source of non-conservation in the classical LF-RA scheme, 244 the modified formulation becomes conservative \citep{Leclair_Madec_OM09}. 245 Second, the LF-RA becomes a truly quasi-second order scheme. 246 Indeed, \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}), 248 the two other main sources of time step divergence, 249 allows a reduction by two orders of magnitude of the Asselin filter parameter. 250 251 Note 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. 253 This and the change in the time filter, \autoref{eq:STP_RA}, 254 allows an exact evaluation of the contribution due to the forcing term between any two time steps, 255 even if separated by only $\rdt$ since the time filter is no longer applied to the forcing term. 267 256 268 257 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 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} 279 272 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 280 273 … … 289 282 %-------------------------------------------------------------------------------------------------------------- 290 283 291 The first time step of this three level scheme when starting from initial conditions 292 is a forward step (Euler time integration): 284 The first time step of this three level scheme when starting from initial conditions is a forward step 285 (Euler time integration): 293 286 \begin{equation} \label{eq:DOM_euler} 294 287 x^1 = x^0 + \rdt \ \text{RHS}^0 295 288 \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. 289 This is done simply by keeping the leapfrog environment ($i.e.$ the \autoref{eq:STP} three level time stepping) but 290 setting all $x^0$ (\textit{before}) and $x^{1}$ (\textit{now}) fields equal at the first time step and 291 using half the value of $\rdt$. 292 293 It is also possible to restart from a previous computation, by using a restart file. 294 The restart strategy is designed to ensure perfect restartability of the code: 295 the user should obtain the same results to machine precision either by 296 running the model for $2N$ time steps in one go, 297 or by performing two consecutive experiments of $N$ steps with a restart. 298 This requires saving two time levels and many auxiliary data in the restart files in machine precision. 299 300 Note 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 302 be added to the restart file to ensure an exact restartability. 303 This is done optionally via the \np{nn\_dynhpg\_rst} namelist parameter, 304 so 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 307 Note the size of the time step used, $\rdt$, is also saved in the restart file. 308 When restarting, if the the time step has been changed, a restart using an Euler time stepping scheme is imposed. 318 309 Options are defined through the \ngn{namrun} namelist variables. 319 310 %%%
Note: See TracChangeset
for help on using the changeset viewer.