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 11622 for NEMO/trunk/doc/latex/NEMO/subfiles/chap_time_domain.tex – NEMO

Ignore:
Timestamp:
2019-10-01T13:10:55+02:00 (5 years ago)
Author:
nicolasmartin
Message:

Review of "Time Domain" and DOM chapters

File:
1 edited

Legend:

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

    r11599 r11622  
    1313 
    1414{\footnotesize 
    15   \begin{tabularx}{\textwidth}{l||X|X} 
    16     Release & Author(s) & Modifications \\ 
     15  \begin{tabular}{l||l|l} 
     16    Release          & Author(s)                                  & Modifications      \\ 
    1717    \hline 
    18     {\em   4.0} & {\em ...} & {\em ...} \\ 
    19     {\em   3.6} & {\em ...} & {\em ...} \\ 
    20     {\em   3.4} & {\em ...} & {\em ...} \\ 
    21     {\em <=3.4} & {\em ...} & {\em ...} 
    22   \end{tabularx} 
     18    {\em        4.0} & {\em J\'{e}r\^{o}me Chanut and Tim Graham} & {\em Review       } \\ 
     19    {\em        3.6} & {\em Christian \'{E}th\'{e}              } & {\em Update       } \\ 
     20    {\em $\leq$ 3.4} & {\em Gurvan Madec                        } & {\em First version} \\ 
     21  \end{tabular} 
    2322} 
    2423 
     
    2625 
    2726% Missing things: 
    28 %  - daymod: definition of the time domain (nit000, nitend and the calendar) 
    29  
    30 \gmcomment{STEVEN :maybe a picture of the directory structure in the introduction which could be referred to here, 
    31   would help  ==> to be added} 
    32  
    33 Having defined the continuous equations in \autoref{chap:MB}, we need now to choose a time discretization, 
     27% - daymod: definition of the time domain (nit000, nitend and the calendar) 
     28 
     29\gmcomment{STEVEN :maybe a picture of the directory structure in the introduction which 
     30could be referred to here, would help  ==> to be added} 
     31 
     32Having defined the continuous equations in \autoref{chap:MB}, 
     33we need now to choose a time discretization, 
    3434a key feature of an ocean model as it exerts a strong influence on the structure of the computer code 
    3535(\ie\ on its flowchart). 
    36 In the present chapter, we provide a general description of the \NEMO\  time stepping strategy and 
     36In the present chapter, we provide a general description of the \NEMO\ time stepping strategy and 
    3737the consequences for the order in which the equations are solved. 
    3838 
     
    4747\end{equation} 
    4848where $x$ stands for $u$, $v$, $T$ or $S$; 
    49 RHS is the Right-Hand-Side of the corresponding time evolution equation; 
     49RHS is the \textbf{R}ight-\textbf{H}and-\textbf{S}ide of the corresponding time evolution equation; 
    5050$\rdt$ is the time step; 
    5151and the superscripts indicate the time at which a quantity is evaluated. 
    52 Each term of the RHS is evaluated at a specific time stepping depending on the physics with which it is associated. 
     52Each term of the RHS is evaluated at a specific time stepping depending on 
     53the physics with which it is associated. 
    5354 
    5455The choice of the time stepping used for this evaluation is discussed below as well as 
    5556the implications for starting or restarting a model simulation. 
    5657Note that the time stepping calculation is generally performed in a single operation. 
    57 With such a complex and nonlinear system of equations it would be dangerous to let a prognostic variable evolve in 
    58 time for each term separately. 
     58With such a complex and nonlinear system of equations it would be dangerous to 
     59let a prognostic variable evolve in time for each term separately. 
    5960 
    6061The three level scheme requires three arrays for each prognostic variable. 
     
    6263The third array, although referred to as $x_a$ (after) in the code, 
    6364is usually not the variable at the after time step; 
    64 but rather it is used to store the time derivative (RHS in \autoref{eq:TD}) prior to time-stepping the equation. 
    65 The time stepping itself is performed once at each time step where implicit vertical diffusion is computed, \ie\ in the \mdl{trazdf} and \mdl{dynzdf} modules. 
     65but rather it is used to store the time derivative (RHS in \autoref{eq:TD}) 
     66prior to time-stepping the equation. 
     67The time stepping itself is performed once at each time step where 
     68implicit vertical diffusion is computed, 
     69\ie\ in the \mdl{trazdf} and \mdl{dynzdf} modules. 
    6670 
    6771%% ================================================================================================= 
     
    6973\label{sec:TD_leap_frog} 
    7074 
    71 The time stepping used for processes other than diffusion is the well-known leapfrog scheme 
    72 \citep{mesinger.arakawa_bk76}. 
     75The time stepping used for processes other than diffusion is 
     76the well-known \textbf{L}eap\textbf{F}rog (LF) scheme \citep{mesinger.arakawa_bk76}. 
    7377This scheme is widely used for advection processes in low-viscosity fluids. 
    74 It is a time centred scheme, \ie\ the RHS in \autoref{eq:TD} is evaluated at time step $t$, the now time step. 
     78It is a time centred scheme, \ie\ the RHS in \autoref{eq:TD} is evaluated at 
     79time step $t$, the now time step. 
    7580It may be used for momentum and tracer advection, pressure gradient, and Coriolis terms, 
    7681but not for diffusion terms. 
    7782It is an efficient method that achieves second-order accuracy with 
    7883just one right hand side evaluation per time step. 
    79 Moreover, it does not artificially damp linear oscillatory motion nor does it produce instability by 
    80 amplifying the oscillations. 
     84Moreover, it does not artificially damp linear oscillatory motion 
     85nor does it produce instability by amplifying the oscillations. 
    8186These advantages are somewhat diminished by the large phase-speed error of the leapfrog scheme, 
    82 and the unsuitability of leapfrog differencing for the representation of diffusion and Rayleigh damping processes. 
     87and the unsuitability of leapfrog differencing for the representation of diffusion and 
     88Rayleigh damping processes. 
    8389However, the scheme allows the coexistence of a numerical and a physical mode due to 
    8490its leading third order dispersive error. 
    8591In other words a divergence of odd and even time steps may occur. 
    86 To prevent it, the leapfrog scheme is often used in association with a Robert-Asselin time filter 
    87 (hereafter the LF-RA scheme). 
    88 This filter, first designed by \citet{robert_JMSJ66} and more comprehensively studied by \citet{asselin_MWR72}, 
     92To prevent it, the leapfrog scheme is often used in association with 
     93a \textbf{R}obert-\textbf{A}sselin time filter (hereafter the LF-RA scheme). 
     94This filter, 
     95first designed by \citet{robert_JMSJ66} and more comprehensively studied by \citet{asselin_MWR72}, 
    8996is a kind of laplacian diffusion in time that mixes odd and even time steps: 
    9097\begin{equation} 
     
    99106However, the second order truncation error is proportional to $\gamma$, which is small compared to 1. 
    100107Therefore, the LF-RA is a quasi second order accurate scheme. 
    101 The LF-RA scheme is preferred to other time differencing schemes such as predictor corrector or trapezoidal schemes, 
    102 because the user has an explicit 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 advection terms in 
     108The LF-RA scheme is preferred to other time differencing schemes such as 
     109predictor corrector or trapezoidal schemes, because the user has an explicit and simple control of 
     110the magnitude of the time diffusion of the scheme. 
     111When used with the 2$^nd$ order space centred discretisation of the advection terms in 
    104112the momentum and tracer equations, LF-RA avoids implicit numerical diffusion: 
    105 diffusion is set explicitly by the user through the Robert-Asselin 
    106 filter parameter and the viscosity and diffusion coefficients. 
     113diffusion is set explicitly by the user through the Robert-Asselin filter parameter and 
     114the viscosity and diffusion coefficients. 
    107115 
    108116%% ================================================================================================= 
     
    110118\label{sec:TD_forward_imp} 
    111119 
    112 The leapfrog differencing scheme is unsuitable for the representation of diffusion and damping processes. 
     120The leapfrog differencing scheme is unsuitable for 
     121the representation of diffusion and damping processes. 
    113122For a tendency $D_x$, representing a diffusion term or a restoring term to a tracer climatology 
    114123(when present, see \autoref{sec:TRA_dmp}), a forward time differencing scheme is used : 
     
    119128 
    120129This is diffusive in time and conditionally stable. 
    121 The conditions for stability of second and fourth order horizontal diffusion schemes are \citep{griffies_bk04}: 
     130The conditions for stability of second and fourth order horizontal diffusion schemes are 
     131\citep{griffies_bk04}: 
    122132\begin{equation} 
    123133  \label{eq:TD_euler_stability} 
     
    128138  \end{cases} 
    129139\end{equation} 
    130 where $e$ is the smallest grid size in the two horizontal directions and $A^h$ is the mixing coefficient. 
     140where $e$ is the smallest grid size in the two horizontal directions and 
     141$A^h$ is the mixing coefficient. 
    131142The linear constraint \autoref{eq:TD_euler_stability} is a necessary condition, but not sufficient. 
    132143If it is not satisfied, even mildly, then the model soon becomes wildly unstable. 
    133 The instability can be removed by either reducing the length of the time steps or reducing the mixing coefficient. 
     144The instability can be removed by either reducing the length of the time steps or 
     145reducing the mixing coefficient. 
    134146 
    135147For the vertical diffusion terms, a forward time differencing scheme can be used, 
    136 but usually the numerical stability condition imposes a strong constraint on the time step. To overcome the stability constraint, a 
    137 backward (or implicit) time differencing scheme is used. This scheme is unconditionally stable but diffusive and can be written as follows: 
     148but usually the numerical stability condition imposes a strong constraint on the time step. 
     149To overcome the stability constraint, a backward (or implicit) time differencing scheme is used. 
     150This scheme is unconditionally stable but diffusive and can be written as follows: 
    138151\begin{equation} 
    139152  \label{eq:TD_imp} 
     
    145158%%gm 
    146159 
    147 This scheme is rather time consuming since it requires a matrix inversion. For example, the finite difference approximation of the temperature equation is: 
     160This scheme is rather time consuming since it requires a matrix inversion. 
     161For example, the finite difference approximation of the temperature equation is: 
    148162\[ 
    149163  % \label{eq:TD_imp_zdf} 
     
    165179\end{align*} 
    166180 
    167 \autoref{eq:TD_imp_mat} is a linear system of equations with an associated matrix which is tridiagonal. 
    168 Moreover, 
    169 $c(k)$ and $d(k)$ are positive and the diagonal term is greater than the sum of the two extra-diagonal terms, 
     181\autoref{eq:TD_imp_mat} is a linear system of equations with 
     182an associated matrix which is tridiagonal. 
     183Moreover, $c(k)$ and $d(k)$ are positive and 
     184the diagonal term is greater than the sum of the two extra-diagonal terms, 
    170185therefore a special adaptation of the Gauss elimination procedure is used to find the solution 
    171186(see for example \citet{richtmyer.morton_bk67}). 
     
    175190\label{sec:TD_spg_ts} 
    176191 
    177 The leapfrog environment supports a centred in time computation of the surface pressure, \ie\ evaluated 
    178 at \textit{now} time step. This refers to as the explicit free surface case in the code (\np[=.true.]{ln_dynspg_exp}{ln\_dynspg\_exp}). 
    179 This choice however imposes a strong constraint on the time step which should be small enough to resolve the propagation 
    180 of external gravity waves. As a matter of fact, one rather use in a realistic setup, a split-explicit free surface 
    181 (\np[=.true.]{ln_dynspg_ts}{ln\_dynspg\_ts}) in which barotropic and baroclinic dynamical equations are solved separately with ad-hoc 
    182 time steps. The use of the time-splitting (in combination with non-linear free surface) imposes some constraints on the design of 
    183 the overall flowchart, in particular to ensure exact tracer conservation (see \autoref{fig:TD_TimeStep_flowchart}). 
    184  
    185 Compared to the former use of the filtered free surface in \NEMO\ v3.6 (\citet{roullet.madec_JGR00}), the use of a split-explicit free surface is advantageous 
    186 on massively parallel computers. Indeed, no global computations are anymore required by the elliptic solver which saves a substantial amount of communication 
    187 time. Fast barotropic motions (such as tides) are also simulated with a better accuracy. 
     192The leapfrog environment supports a centred in time computation of the surface pressure, 
     193\ie\ evaluated at \textit{now} time step. 
     194This refers to as the explicit free surface case in the code 
     195(\np[=.true.]{ln_dynspg_exp}{ln\_dynspg\_exp}). 
     196This choice however imposes a strong constraint on the time step which 
     197should be small enough to resolve the propagation of external gravity waves. 
     198As a matter of fact, one rather use in a realistic setup, 
     199a split-explicit free surface (\np[=.true.]{ln_dynspg_ts}{ln\_dynspg\_ts}) in which 
     200barotropic and baroclinic dynamical equations are solved separately with ad-hoc time steps. 
     201The use of the time-splitting (in combination with non-linear free surface) imposes 
     202some constraints on the design of the overall flowchart, 
     203in particular to ensure exact tracer conservation (see \autoref{fig:TD_TimeStep_flowchart}). 
     204 
     205Compared to the former use of the filtered free surface in \NEMO\ v3.6 (\citet{roullet.madec_JGR00}), 
     206the use of a split-explicit free surface is advantageous on massively parallel computers. 
     207Indeed, no global computations are anymore required by the elliptic solver which 
     208saves a substantial amount of communication time. 
     209Fast barotropic motions (such as tides) are also simulated with a better accuracy. 
    188210 
    189211%\gmcomment{ 
    190 \begin{figure}[!t] 
     212\begin{figure} 
    191213  \centering 
    192214  \includegraphics[width=0.66\textwidth]{Fig_TimeStepping_flowchart_v4} 
    193215  \caption[Leapfrog time stepping sequence with split-explicit free surface]{ 
    194216    Sketch of the leapfrog time stepping sequence in \NEMO\ with split-explicit free surface. 
    195     The latter combined with non-linear free surface requires the dynamical tendency being 
    196     updated prior tracers tendency to ensure conservation. 
     217    The latter combined with non-linear free surface requires 
     218    the dynamical tendency being updated prior tracers tendency to ensure conservation. 
    197219    Note the use of time integrated fluxes issued from the barotropic loop in 
    198220    subsequent calculations of tracer advection and in the continuity equation. 
     
    203225 
    204226%% ================================================================================================= 
    205 \section{Modified Leapfrog -- Asselin filter scheme} 
     227\section{Modified LeapFrog -- Robert Asselin filter scheme (LF-RA)} 
    206228\label{sec:TD_mLF} 
    207229 
    208 Significant changes have been introduced by \cite{leclair.madec_OM09} in the LF-RA scheme in order to 
    209 ensure tracer conservation and to allow the use of a much smaller value of the Asselin filter parameter. 
     230Significant changes have been introduced by \cite{leclair.madec_OM09} in 
     231the LF-RA scheme in order to ensure tracer conservation and to 
     232allow the use of a much smaller value of the Asselin filter parameter. 
    210233The modifications affect both the forcing and filtering treatments in the LF-RA scheme. 
    211234 
    212 In a classical LF-RA environment, the forcing term is centred in time, 
    213 \ie\ it is time-stepped over a $2 \rdt$ period: 
     235In a classical LF-RA environment, 
     236the forcing term is centred in time, \ie\ it is time-stepped over a $2 \rdt$ period: 
    214237$x^t = x^t + 2 \rdt Q^t$ where $Q$ is the forcing applied to $x$, 
    215 and the time filter is given by \autoref{eq:TD_asselin} so that $Q$ is redistributed over several time step. 
     238and the time filter is given by \autoref{eq:TD_asselin} so that 
     239$Q$ is redistributed over several time step. 
    216240In the modified LF-RA environment, these two formulations have been replaced by: 
    217241\begin{gather} 
     
    222246                    - \gamma \, \rdt \, \lt( Q^{t + \rdt / 2} - Q^{t - \rdt / 2} \rt) 
    223247\end{gather} 
    224 The change in the forcing formulation given by \autoref{eq:TD_forcing} (see \autoref{fig:TD_MLF_forcing}) 
    225 has a significant effect: 
    226 the forcing term no longer excites the divergence of odd and even time steps \citep{leclair.madec_OM09}. 
     248The change in the forcing formulation given by \autoref{eq:TD_forcing} 
     249(see \autoref{fig:TD_MLF_forcing}) has a significant effect: 
     250the forcing term no longer excites the divergence of odd and even time steps 
     251\citep{leclair.madec_OM09}. 
    227252% forcing seen by the model.... 
    228253This property improves the LF-RA scheme in two aspects. 
    229254First, the LF-RA can now ensure the local and global conservation of tracers. 
    230255Indeed, time filtering is no longer required on the forcing part. 
    231 The influence of the Asselin filter on the forcing is explicitly removed by adding a new term in the filter 
    232 (last term in \autoref{eq:TD_RA} compared to \autoref{eq:TD_asselin}). 
     256The influence of the Asselin filter on the forcing is explicitly removed by 
     257adding a new term in the filter (last term in \autoref{eq:TD_RA} compared to \autoref{eq:TD_asselin}). 
    233258Since the filtering of the forcing was the source of non-conservation in the classical LF-RA scheme, 
    234259the modified formulation becomes conservative \citep{leclair.madec_OM09}. 
    235 Second, the LF-RA becomes a truly quasi -second order scheme. 
     260Second, the LF-RA becomes a truly quasi-second order scheme. 
    236261Indeed, \autoref{eq:TD_forcing} used in combination with a careful treatment of static instability 
    237262(\autoref{subsec:ZDF_evd}) and of the TKE physics (\autoref{subsec:ZDF_tke_ene}) 
     
    245270even if separated by only $\rdt$ since the time filter is no longer applied to the forcing term. 
    246271 
    247 \begin{figure}[!t] 
     272\begin{figure} 
    248273  \centering 
    249274  \includegraphics[width=0.66\textwidth]{Fig_MLF_forcing} 
     
    271296\end{listing} 
    272297 
    273 The first time step of this three level scheme when starting from initial conditions is a forward step 
    274 (Euler time integration): 
     298The first time step of this three level scheme when starting from initial conditions is 
     299a forward step (Euler time integration): 
    275300\[ 
    276301  % \label{eq:TD_DOM_euler} 
    277302  x^1 = x^0 + \rdt \ \text{RHS}^0 
    278303\] 
    279 This is done simply by keeping the leapfrog environment (\ie\ the \autoref{eq:TD} three level time stepping) but 
     304This is done simply by keeping the leapfrog environment 
     305(\ie\ the \autoref{eq:TD} three level time stepping) but 
    280306setting all $x^0$ (\textit{before}) and $x^1$ (\textit{now}) fields equal at the first time step and 
    281307using half the value of a leapfrog time step ($2 \rdt$). 
     
    286312running the model for $2N$ time steps in one go, 
    287313or by performing two consecutive experiments of $N$ steps with a restart. 
    288 This requires saving two time levels and many auxiliary data in the restart files in machine precision. 
     314This requires saving two time levels and many auxiliary data in 
     315the restart files in machine precision. 
    289316 
    290317Note that the time step $\rdt$, is also saved in the restart file. 
    291 When restarting, if the time step has been changed, or one of the prognostic variables at \textit{before} time step 
    292 is missing, an Euler time stepping scheme is imposed. A forward initial step can still be enforced by the user by setting 
    293 the namelist variable \np[=0]{nn_euler}{nn\_euler}. Other options to control the time integration of the model 
    294 are defined through the  \nam{run}{run} namelist variables. 
     318When restarting, if the time step has been changed, or 
     319one of the prognostic variables at \textit{before} time step is missing, 
     320an Euler time stepping scheme is imposed. 
     321A forward initial step can still be enforced by the user by 
     322setting the namelist variable \np[=0]{nn_euler}{nn\_euler}. 
     323Other options to control the time integration of the model are defined through 
     324the \nam{run}{run} namelist variables. 
     325 
    295326\gmcomment{ 
    296327add here how to force the restart to contain only one time step for operational purposes 
     
    298329add also the idea of writing several restart for seasonal forecast : how is it done ? 
    299330 
    300 verify that all namelist pararmeters are truly described 
     331verify that all namelist parameters are truly described 
    301332 
    302333a word on the check of restart  ..... 
     
    309340\label{subsec:TD_time} 
    310341 
    311 Options are defined through the  \nam{dom}{dom} namelist variables. 
     342Options are defined through the\nam{dom}{dom} namelist variables. 
    312343 \colorbox{yellow}{add here a few word on nit000 and nitend} 
    313344 
    314345 \colorbox{yellow}{Write documentation on the calendar and the key variable adatrj} 
    315346 
    316 add a description of daymod, and the model calandar (leap-year and co) 
    317  
    318 }        %% end add 
     347add a description of daymod, and the model calendar (leap-year and co) 
     348 
     349}     %% end add 
    319350 
    320351\gmcomment{       % add implicit in vvl case  and Crant-Nicholson scheme 
Note: See TracChangeset for help on using the changeset viewer.