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 11564 for NEMO/branches/2019/dev_r10973_AGRIF-01_jchanut_small_jpi_jpj/doc/latex/NEMO/subfiles/chap_DYN.tex – NEMO

Ignore:
Timestamp:
2019-09-18T16:11:52+02:00 (5 years ago)
Author:
jchanut
Message:

#2199, merged with trunk

Location:
NEMO/branches/2019/dev_r10973_AGRIF-01_jchanut_small_jpi_jpj/doc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10973_AGRIF-01_jchanut_small_jpi_jpj/doc

    • Property svn:ignore deleted
  • NEMO/branches/2019/dev_r10973_AGRIF-01_jchanut_small_jpi_jpj/doc/latex

    • Property svn:ignore
      •  

        old new  
        1 *.aux 
        2 *.bbl 
        3 *.blg 
        4 *.dvi 
        5 *.fdb* 
        6 *.fls 
        7 *.idx 
        8 *.ilg 
        9 *.ind 
        10 *.log 
        11 *.maf 
        12 *.mtc* 
        13 *.out 
        14 *.pdf 
        15 *.toc 
        16 _minted-* 
         1figures 
  • NEMO/branches/2019/dev_r10973_AGRIF-01_jchanut_small_jpi_jpj/doc/latex/NEMO

    • Property svn:ignore deleted
  • NEMO/branches/2019/dev_r10973_AGRIF-01_jchanut_small_jpi_jpj/doc/latex/NEMO/subfiles/chap_DYN.tex

    r10499 r11564  
    88\label{chap:DYN} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212Using the representation described in \autoref{chap:DOM}, 
     
    3636(surface wind stress calculation using bulk formulae, estimation of mixing coefficients) 
    3737that are carried out in modules SBC, LDF and ZDF and are described in 
    38 \autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively.  
     38\autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively. 
    3939 
    4040In the present chapter we also describe the diagnostic equations used to compute the horizontal divergence, 
    4141curl of the velocities (\emph{divcur} module) and the vertical velocity (\emph{wzvmod} module). 
    4242 
    43 The different options available to the user are managed by namelist variables.  
    44 For term \textit{ttt} in the momentum equations, the logical namelist variables are \textit{ln\_dynttt\_xxx},  
     43The different options available to the user are managed by namelist variables. 
     44For term \textit{ttt} in the momentum equations, the logical namelist variables are \textit{ln\_dynttt\_xxx}, 
    4545where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme. 
    46 If a CPP key is used for this term its name is \key{ttt}. 
     46%If a CPP key is used for this term its name is \key{ttt}. 
    4747The corresponding code can be found in the \textit{dynttt\_xxx} module in the DYN directory, 
    4848and it is usually computed in the \textit{dyn\_ttt\_xxx} subroutine. 
    4949 
    5050The user has the option of extracting and outputting each tendency term from the 3D momentum equations 
    51 (\key{trddyn} defined), as described in \autoref{chap:MISC}. 
    52 Furthermore, the tendency terms associated with the 2D barotropic vorticity balance (when \key{trdvor} is defined) 
     51(\texttt{trddyn?} defined), as described in \autoref{chap:MISC}. 
     52Furthermore, the tendency terms associated with the 2D barotropic vorticity balance (when \texttt{trdvor?} is defined) 
    5353can be derived from the 3D terms. 
    5454%%% 
    55 \gmcomment{STEVEN: not quite sure I've got the sense of the last sentence. does  
     55\gmcomment{STEVEN: not quite sure I've got the sense of the last sentence. does 
    5656MISC correspond to "extracting tendency terms" or "vorticity balance"?} 
    5757 
     
    6565%           Horizontal divergence and relative vorticity 
    6666%-------------------------------------------------------------------------------------------------------------- 
    67 \subsection{Horizontal divergence and relative vorticity (\protect\mdl{divcur})} 
     67\subsection[Horizontal divergence and relative vorticity (\textit{divcur.F90})]{Horizontal divergence and relative vorticity (\protect\mdl{divcur})} 
    6868\label{subsec:DYN_divcur} 
    6969 
    70 The vorticity is defined at an $f$-point (\ie corner point) as follows: 
    71 \begin{equation} 
    72   \label{eq:divcur_cur} 
     70The vorticity is defined at an $f$-point (\ie\ corner point) as follows: 
     71\begin{equation} 
     72  \label{eq:DYN_divcur_cur} 
    7373  \zeta =\frac{1}{e_{1f}\,e_{2f} }\left( {\;\delta_{i+1/2} \left[ {e_{2v}\;v} \right] 
    7474      -\delta_{j+1/2} \left[ {e_{1u}\;u} \right]\;} \right) 
    75 \end{equation}  
     75\end{equation} 
    7676 
    7777The horizontal divergence is defined at a $T$-point. 
    7878It is given by: 
    7979\[ 
    80   % \label{eq:divcur_div} 
     80  % \label{eq:DYN_divcur_div} 
    8181  \chi =\frac{1}{e_{1t}\,e_{2t}\,e_{3t} } 
    8282  \left( {\delta_i \left[ {e_{2u}\,e_{3u}\,u} \right] 
     
    9696ensure perfect restartability. 
    9797The vorticity and divergence at the \textit{now} time step are used for the computation of 
    98 the nonlinear advection and of the vertical velocity respectively.  
     98the nonlinear advection and of the vertical velocity respectively. 
    9999 
    100100%-------------------------------------------------------------------------------------------------------------- 
    101101%           Sea Surface Height evolution 
    102102%-------------------------------------------------------------------------------------------------------------- 
    103 \subsection{Horizontal divergence and relative vorticity (\protect\mdl{sshwzv})} 
     103\subsection[Horizontal divergence and relative vorticity (\textit{sshwzv.F90})]{Horizontal divergence and relative vorticity (\protect\mdl{sshwzv})} 
    104104\label{subsec:DYN_sshwzv} 
    105105 
    106106The sea surface height is given by: 
    107107\begin{equation} 
    108   \label{eq:dynspg_ssh} 
     108  \label{eq:DYN_spg_ssh} 
    109109  \begin{aligned} 
    110110    \frac{\partial \eta }{\partial t} 
     
    115115  \end{aligned} 
    116116\end{equation} 
    117 where \textit{emp} is the surface freshwater budget (evaporation minus precipitation),  
     117where \textit{emp} is the surface freshwater budget (evaporation minus precipitation), 
    118118expressed in Kg/m$^2$/s (which is equal to mm/s), 
    119119and $\rho_w$=1,035~Kg/m$^3$ is the reference density of sea water (Boussinesq approximation). 
    120120If river runoff is expressed as a surface freshwater flux (see \autoref{chap:SBC}) then 
    121 \textit{emp} can be written as the evaporation minus precipitation, minus the river runoff.  
     121\textit{emp} can be written as the evaporation minus precipitation, minus the river runoff. 
    122122The sea-surface height is evaluated using exactly the same time stepping scheme as 
    123 the tracer equation \autoref{eq:tra_nxt}: 
     123the tracer equation \autoref{eq:TRA_nxt}: 
    124124a leapfrog scheme in combination with an Asselin time filter, 
    125 \ie the velocity appearing in \autoref{eq:dynspg_ssh} is centred in time (\textit{now} velocity). 
     125\ie\ the velocity appearing in \autoref{eq:DYN_spg_ssh} is centred in time (\textit{now} velocity). 
    126126This is of paramount importance. 
    127127Replacing $T$ by the number $1$ in the tracer equation and summing over the water column must lead to 
    128128the sea surface height equation otherwise tracer content will not be conserved 
    129 \citep{Griffies_al_MWR01, Leclair_Madec_OM09}. 
     129\citep{griffies.pacanowski.ea_MWR01, leclair.madec_OM09}. 
    130130 
    131131The vertical velocity is computed by an upward integration of the horizontal divergence starting at the bottom, 
    132132taking into account the change of the thickness of the levels: 
    133133\begin{equation} 
    134   \label{eq:wzv} 
     134  \label{eq:DYN_wzv} 
    135135  \left\{ 
    136136    \begin{aligned} 
     
    142142\end{equation} 
    143143 
    144 In the case of a non-linear free surface (\key{vvl}), the top vertical velocity is $-\textit{emp}/\rho_w$,  
     144In the case of a non-linear free surface (\texttt{vvl?}), the top vertical velocity is $-\textit{emp}/\rho_w$, 
    145145as changes in the divergence of the barotropic transport are absorbed into the change of the level thicknesses, 
    146146re-orientated downward. 
    147147\gmcomment{not sure of this...  to be modified with the change in emp setting} 
    148 In the case of a linear free surface, the time derivative in \autoref{eq:wzv} disappears. 
     148In the case of a linear free surface, the time derivative in \autoref{eq:DYN_wzv} disappears. 
    149149The upper boundary condition applies at a fixed level $z=0$. 
    150150The top vertical velocity is thus equal to the divergence of the barotropic transport 
    151 (\ie the first term in the right-hand-side of \autoref{eq:dynspg_ssh}). 
     151(\ie\ the first term in the right-hand-side of \autoref{eq:DYN_spg_ssh}). 
    152152 
    153153Note also that whereas the vertical velocity has the same discrete expression in $z$- and $s$-coordinates, 
    154154its physical meaning is not the same: 
    155155in the second case, $w$ is the velocity normal to the $s$-surfaces. 
    156 Note also that the $k$-axis is re-orientated downwards in the \fortran code compared to 
    157 the indexing used in the semi-discrete equations such as \autoref{eq:wzv} 
    158 (see \autoref{subsec:DOM_Num_Index_vertical}).  
     156Note also that the $k$-axis is re-orientated downwards in the \fortran\ code compared to 
     157the indexing used in the semi-discrete equations such as \autoref{eq:DYN_wzv} 
     158(see \autoref{subsec:DOM_Num_Index_vertical}). 
    159159 
    160160 
     
    166166%-----------------------------------------nam_dynadv---------------------------------------------------- 
    167167 
    168 \nlst{namdyn_adv}  
     168\begin{listing} 
     169  \nlst{namdyn_adv} 
     170  \caption{\texttt{namdyn\_adv}} 
     171  \label{lst:namdyn_adv} 
     172\end{listing} 
    169173%------------------------------------------------------------------------------------------------------------- 
    170174 
    171175The vector invariant form of the momentum equations is the one most often used in 
    172 applications of the \NEMO ocean model. 
     176applications of the \NEMO\ ocean model. 
    173177The flux form option (see next section) has been present since version $2$. 
    174 Options are defined through the \ngn{namdyn\_adv} namelist variables Coriolis and 
     178Options are defined through the \nam{dyn\_adv} namelist variables Coriolis and 
    175179momentum advection terms are evaluated using a leapfrog scheme, 
    176 \ie the velocity appearing in these expressions is centred in time (\textit{now} velocity).  
     180\ie\ the velocity appearing in these expressions is centred in time (\textit{now} velocity). 
    177181At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied following 
    178182\autoref{chap:LBC}. 
    179183 
    180184% ------------------------------------------------------------------------------------------------------------- 
    181 %        Vorticity term  
     185%        Vorticity term 
    182186% ------------------------------------------------------------------------------------------------------------- 
    183 \subsection{Vorticity term (\protect\mdl{dynvor})} 
     187\subsection[Vorticity term (\textit{dynvor.F90})]{Vorticity term (\protect\mdl{dynvor})} 
    184188\label{subsec:DYN_vor} 
    185189%------------------------------------------nam_dynvor---------------------------------------------------- 
    186190 
    187 \nlst{namdyn_vor}  
     191\begin{listing} 
     192  \nlst{namdyn_vor} 
     193  \caption{\texttt{namdyn\_vor}} 
     194  \label{lst:namdyn_vor} 
     195\end{listing} 
    188196%------------------------------------------------------------------------------------------------------------- 
    189197 
    190 Options are defined through the \ngn{namdyn\_vor} namelist variables. 
    191 Four discretisations of the vorticity term (\np{ln\_dynvor\_xxx}\forcode{ = .true.}) are available: 
     198Options are defined through the \nam{dyn\_vor} namelist variables. 
     199Four discretisations of the vorticity term (\texttt{ln\_dynvor\_xxx}\forcode{=.true.}) are available: 
    192200conserving potential enstrophy of horizontally non-divergent flow (ENS scheme); 
    193201conserving horizontal kinetic energy (ENE scheme); 
     
    195203horizontal kinetic energy for the planetary vorticity term (MIX scheme); 
    196204or conserving both the potential enstrophy of horizontally non-divergent flow and horizontal kinetic energy 
    197 (EEN scheme) (see \autoref{subsec:C_vorEEN}). 
     205(EEN scheme) (see \autoref{subsec:INVARIANTS_vorEEN}). 
    198206In the case of ENS, ENE or MIX schemes the land sea mask may be slightly modified to ensure the consistency of 
    199 vorticity term with analytical equations (\np{ln\_dynvor\_con}\forcode{ = .true.}). 
     207vorticity term with analytical equations (\np{ln\_dynvor\_con}\forcode{=.true.}). 
    200208The vorticity terms are all computed in dedicated routines that can be found in the \mdl{dynvor} module. 
    201209 
     
    203211%                 enstrophy conserving scheme 
    204212%------------------------------------------------------------- 
    205 \subsubsection{Enstrophy conserving scheme (\protect\np{ln\_dynvor\_ens}\forcode{ = .true.})} 
     213\subsubsection[Enstrophy conserving scheme (\forcode{ln_dynvor_ens = .true.})]{Enstrophy conserving scheme (\protect\np{ln\_dynvor\_ens}\forcode{ = .true.})} 
    206214\label{subsec:DYN_vor_ens} 
    207215 
    208216In the enstrophy conserving case (ENS scheme), 
    209217the discrete formulation of the vorticity term provides a global conservation of the enstrophy 
    210 ($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$-coordinates) for a horizontally non-divergent flow (\ie $\chi$=$0$), 
     218($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$-coordinates) for a horizontally non-divergent flow (\ie\ $\chi$=$0$), 
    211219but does not conserve the total kinetic energy. 
    212220It is given by: 
    213221\begin{equation} 
    214   \label{eq:dynvor_ens} 
     222  \label{eq:DYN_vor_ens} 
    215223  \left\{ 
    216224    \begin{aligned} 
     
    221229    \end{aligned} 
    222230  \right. 
    223 \end{equation}  
     231\end{equation} 
    224232 
    225233%------------------------------------------------------------- 
    226234%                 energy conserving scheme 
    227235%------------------------------------------------------------- 
    228 \subsubsection{Energy conserving scheme (\protect\np{ln\_dynvor\_ene}\forcode{ = .true.})} 
     236\subsubsection[Energy conserving scheme (\forcode{ln_dynvor_ene = .true.})]{Energy conserving scheme (\protect\np{ln\_dynvor\_ene}\forcode{ = .true.})} 
    229237\label{subsec:DYN_vor_ene} 
    230238 
     
    232240It is given by: 
    233241\begin{equation} 
    234   \label{eq:dynvor_ene} 
     242  \label{eq:DYN_vor_ene} 
    235243  \left\{ 
    236244    \begin{aligned} 
     
    241249    \end{aligned} 
    242250  \right. 
    243 \end{equation}  
     251\end{equation} 
    244252 
    245253%------------------------------------------------------------- 
    246254%                 mix energy/enstrophy conserving scheme 
    247255%------------------------------------------------------------- 
    248 \subsubsection{Mixed energy/enstrophy conserving scheme (\protect\np{ln\_dynvor\_mix}\forcode{ = .true.}) } 
     256\subsubsection[Mixed energy/enstrophy conserving scheme (\forcode{ln_dynvor_mix = .true.})]{Mixed energy/enstrophy conserving scheme (\protect\np{ln\_dynvor\_mix}\forcode{ = .true.})} 
    249257\label{subsec:DYN_vor_mix} 
    250258 
    251259For the mixed energy/enstrophy conserving scheme (MIX scheme), a mixture of the two previous schemes is used. 
    252 It consists of the ENS scheme (\autoref{eq:dynvor_ens}) for the relative vorticity term, 
    253 and of the ENE scheme (\autoref{eq:dynvor_ene}) applied to the planetary vorticity term. 
    254 \[ 
    255   % \label{eq:dynvor_mix} 
     260It consists of the ENS scheme (\autoref{eq:DYN_vor_ens}) for the relative vorticity term, 
     261and of the ENE scheme (\autoref{eq:DYN_vor_ene}) applied to the planetary vorticity term. 
     262\[ 
     263  % \label{eq:DYN_vor_mix} 
    256264  \left\{ { 
    257265      \begin{aligned} 
     
    271279%                 energy and enstrophy conserving scheme 
    272280%------------------------------------------------------------- 
    273 \subsubsection{Energy and enstrophy conserving scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.}) } 
     281\subsubsection[Energy and enstrophy conserving scheme (\forcode{ln_dynvor_een = .true.})]{Energy and enstrophy conserving scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.})} 
    274282\label{subsec:DYN_vor_een} 
    275283 
     
    278286the presence of grid point oscillation structures that will be invisible to the operator. 
    279287These structures are \textit{computational modes} that will be at least partly damped by 
    280 the momentum diffusion operator (\ie the subgrid-scale advection), but not by the resolved advection term. 
     288the momentum diffusion operator (\ie\ the subgrid-scale advection), but not by the resolved advection term. 
    281289The ENS and ENE schemes therefore do not contribute to dump any grid point noise in the horizontal velocity field. 
    282290Such noise would result in more noise in the vertical velocity field, an undesirable feature. 
     
    284292$u$ and $v$ are located at different grid points, 
    285293a price worth paying to avoid a double averaging in the pressure gradient term as in the $B$-grid. 
    286 \gmcomment{ To circumvent this, Adcroft (ADD REF HERE)  
     294\gmcomment{ To circumvent this, Adcroft (ADD REF HERE) 
    287295Nevertheless, this technique strongly distort the phase and group velocity of Rossby waves....} 
    288296 
    289 A very nice solution to the problem of double averaging was proposed by \citet{Arakawa_Hsu_MWR90}. 
     297A very nice solution to the problem of double averaging was proposed by \citet{arakawa.hsu_MWR90}. 
    290298The idea is to get rid of the double averaging by considering triad combinations of vorticity. 
    291299It is noteworthy that this solution is conceptually quite similar to the one proposed by 
    292 \citep{Griffies_al_JPO98} for the discretization of the iso-neutral diffusion operator (see \autoref{apdx:C}). 
    293  
    294 The \citet{Arakawa_Hsu_MWR90} vorticity advection scheme for a single layer is modified  
    295 for spherical coordinates as described by \citet{Arakawa_Lamb_MWR81} to obtain the EEN scheme.  
    296 First consider the discrete expression of the potential vorticity, $q$, defined at an $f$-point:  
    297 \[ 
    298   % \label{eq:pot_vor} 
     300\citep{griffies.gnanadesikan.ea_JPO98} for the discretization of the iso-neutral diffusion operator (see \autoref{apdx:INVARIANTS}). 
     301 
     302The \citet{arakawa.hsu_MWR90} vorticity advection scheme for a single layer is modified 
     303for spherical coordinates as described by \citet{arakawa.lamb_MWR81} to obtain the EEN scheme. 
     304First consider the discrete expression of the potential vorticity, $q$, defined at an $f$-point: 
     305\[ 
     306  % \label{eq:DYN_pot_vor} 
    299307  q  = \frac{\zeta +f} {e_{3f} } 
    300308\] 
    301 where the relative vorticity is defined by (\autoref{eq:divcur_cur}), 
    302 the Coriolis parameter is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is:  
    303 \begin{equation} 
    304   \label{eq:een_e3f} 
     309where the relative vorticity is defined by (\autoref{eq:DYN_divcur_cur}), 
     310the Coriolis parameter is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is: 
     311\begin{equation} 
     312  \label{eq:DYN_een_e3f} 
    305313  e_{3f} = \overline{\overline {e_{3t} }} ^{\,i+1/2,j+1/2} 
    306314\end{equation} 
     
    308316%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    309317\begin{figure}[!ht] 
    310   \begin{center} 
    311     \includegraphics[width=0.70\textwidth]{Fig_DYN_een_triad} 
    312     \caption{ 
    313       \protect\label{fig:DYN_een_triad} 
    314       Triads used in the energy and enstrophy conserving scheme (een) for 
    315       $u$-component (upper panel) and $v$-component (lower panel). 
    316     } 
    317   \end{center} 
     318  \centering 
     319  \includegraphics[width=\textwidth]{Fig_DYN_een_triad} 
     320  \caption[Triads used in the energy and enstrophy conserving scheme (EEN)]{ 
     321    Triads used in the energy and enstrophy conserving scheme (EEN) for 
     322    $u$-component (upper panel) and $v$-component (lower panel).} 
     323  \label{fig:DYN_een_triad} 
    318324\end{figure} 
    319325% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    320326 
    321 A key point in \autoref{eq:een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made.  
     327A key point in \autoref{eq:DYN_een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made. 
    322328It uses the sum of masked t-point vertical scale factor divided either by the sum of the four t-point masks 
    323 (\np{nn\_een\_e3f}\forcode{ = 1}), or just by $4$ (\np{nn\_een\_e3f}\forcode{ = .true.}). 
     329(\np{nn\_een\_e3f}\forcode{=1}), or just by $4$ (\np{nn\_een\_e3f}\forcode{=.true.}). 
    324330The latter case preserves the continuity of $e_{3f}$ when one or more of the neighbouring $e_{3t}$ tends to zero and 
    325331extends by continuity the value of $e_{3f}$ into the land areas. 
     
    327333(with a systematic reduction of $e_{3f}$ when a model level intercept the bathymetry) 
    328334that tends to reinforce the topostrophy of the flow 
    329 (\ie the tendency of the flow to follow the isobaths) \citep{Penduff_al_OS07}.  
     335(\ie\ the tendency of the flow to follow the isobaths) \citep{penduff.le-sommer.ea_OS07}. 
    330336 
    331337Next, the vorticity triads, $ {^i_j}\mathbb{Q}^{i_p}_{j_p}$ can be defined at a $T$-point as 
    332338the following triad combinations of the neighbouring potential vorticities defined at f-points 
    333 (\autoref{fig:DYN_een_triad}):  
    334 \begin{equation} 
    335   \label{eq:Q_triads} 
     339(\autoref{fig:DYN_een_triad}): 
     340\begin{equation} 
     341  \label{eq:DYN_Q_triads} 
    336342  _i^j \mathbb{Q}^{i_p}_{j_p} 
    337343  = \frac{1}{12} \ \left(   q^{i-i_p}_{j+j_p} + q^{i+j_p}_{j+i_p} + q^{i+i_p}_{j-j_p}  \right) 
    338344\end{equation} 
    339 where the indices $i_p$ and $k_p$ take the values: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$.  
    340  
    341 Finally, the vorticity terms are represented as:  
    342 \begin{equation} 
    343   \label{eq:dynvor_een} 
     345where the indices $i_p$ and $k_p$ take the values: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$. 
     346 
     347Finally, the vorticity terms are represented as: 
     348\begin{equation} 
     349  \label{eq:DYN_vor_een} 
    344350  \left\{ { 
    345351      \begin{aligned} 
     
    350356      \end{aligned} 
    351357    } \right. 
    352 \end{equation}  
     358\end{equation} 
    353359 
    354360This EEN scheme in fact combines the conservation properties of the ENS and ENE schemes. 
    355361It conserves both total energy and potential enstrophy in the limit of horizontally nondivergent flow 
    356 (\ie $\chi$=$0$) (see \autoref{subsec:C_vorEEN}).  
     362(\ie\ $\chi$=$0$) (see \autoref{subsec:INVARIANTS_vorEEN}). 
    357363Applied to a realistic ocean configuration, it has been shown that it leads to a significant reduction of 
    358 the noise in the vertical velocity field \citep{Le_Sommer_al_OM09}. 
     364the noise in the vertical velocity field \citep{le-sommer.penduff.ea_OM09}. 
    359365Furthermore, used in combination with a partial steps representation of bottom topography, 
    360366it improves the interaction between current and topography, 
    361 leading to a larger topostrophy of the flow \citep{Barnier_al_OD06, Penduff_al_OS07}.  
     367leading to a larger topostrophy of the flow \citep{barnier.madec.ea_OD06, penduff.le-sommer.ea_OS07}. 
    362368 
    363369%-------------------------------------------------------------------------------------------------------------- 
    364370%           Kinetic Energy Gradient term 
    365371%-------------------------------------------------------------------------------------------------------------- 
    366 \subsection{Kinetic energy gradient term (\protect\mdl{dynkeg})} 
     372\subsection[Kinetic energy gradient term (\textit{dynkeg.F90})]{Kinetic energy gradient term (\protect\mdl{dynkeg})} 
    367373\label{subsec:DYN_keg} 
    368374 
    369 As demonstrated in \autoref{apdx:C}, 
     375As demonstrated in \autoref{apdx:INVARIANTS}, 
    370376there is a single discrete formulation of the kinetic energy gradient term that, 
    371377together with the formulation chosen for the vertical advection (see below), 
    372378conserves the total kinetic energy: 
    373379\[ 
    374   % \label{eq:dynkeg} 
     380  % \label{eq:DYN_keg} 
    375381  \left\{ 
    376382    \begin{aligned} 
     
    384390%           Vertical advection term 
    385391%-------------------------------------------------------------------------------------------------------------- 
    386 \subsection{Vertical advection term (\protect\mdl{dynzad}) } 
     392\subsection[Vertical advection term (\textit{dynzad.F90})]{Vertical advection term (\protect\mdl{dynzad})} 
    387393\label{subsec:DYN_zad} 
    388394 
     
    391397conserves the total kinetic energy. 
    392398Indeed, the change of KE due to the vertical advection is exactly balanced by 
    393 the change of KE due to the gradient of KE (see \autoref{apdx:C}). 
    394 \[ 
    395   % \label{eq:dynzad} 
     399the change of KE due to the gradient of KE (see \autoref{apdx:INVARIANTS}). 
     400\[ 
     401  % \label{eq:DYN_zad} 
    396402  \left\{ 
    397403    \begin{aligned} 
     
    401407  \right. 
    402408\] 
    403 When \np{ln\_dynzad\_zts}\forcode{ = .true.}, 
     409When \np{ln\_dynzad\_zts}\forcode{=.true.}, 
    404410a split-explicit time stepping with 5 sub-timesteps is used on the vertical advection term. 
    405 This option can be useful when the value of the timestep is limited by vertical advection \citep{Lemarie_OM2015}.  
     411This option can be useful when the value of the timestep is limited by vertical advection \citep{lemarie.debreu.ea_OM15}. 
    406412Note that in this case, 
    407413a similar split-explicit time stepping should be used on vertical advection of tracer to ensure a better stability, 
     
    416422%------------------------------------------nam_dynadv---------------------------------------------------- 
    417423 
    418 \nlst{namdyn_adv}  
    419424%------------------------------------------------------------------------------------------------------------- 
    420425 
    421 Options are defined through the \ngn{namdyn\_adv} namelist variables. 
     426Options are defined through the \nam{dyn\_adv} namelist variables. 
    422427In the flux form (as in the vector invariant form), 
    423428the Coriolis and momentum advection terms are evaluated using a leapfrog scheme, 
    424 \ie the velocity appearing in their expressions is centred in time (\textit{now} velocity). 
     429\ie\ the velocity appearing in their expressions is centred in time (\textit{now} velocity). 
    425430At the lateral boundaries either free slip, 
    426431no slip or partial slip boundary conditions are applied following \autoref{chap:LBC}. 
     
    430435%           Coriolis plus curvature metric terms 
    431436%-------------------------------------------------------------------------------------------------------------- 
    432 \subsection{Coriolis plus curvature metric terms (\protect\mdl{dynvor}) } 
     437\subsection[Coriolis plus curvature metric terms (\textit{dynvor.F90})]{Coriolis plus curvature metric terms (\protect\mdl{dynvor})} 
    433438\label{subsec:DYN_cor_flux} 
    434439 
    435440In flux form, the vorticity term reduces to a Coriolis term in which the Coriolis parameter has been modified to account for the "metric" term. 
    436441This altered Coriolis parameter is thus discretised at $f$-points. 
    437 It is given by:  
     442It is given by: 
    438443\begin{multline*} 
    439   % \label{eq:dyncor_metric} 
     444  % \label{eq:DYN_cor_metric} 
    440445  f+\frac{1}{e_1 e_2 }\left( {v\frac{\partial e_2 }{\partial i}  -  u\frac{\partial e_1 }{\partial j}} \right)  \\ 
    441446  \equiv   f + \frac{1}{e_{1f} e_{2f} } \left( { \ \overline v ^{i+1/2}\delta_{i+1/2} \left[ {e_{2u} } \right] 
    442447      -  \overline u ^{j+1/2}\delta_{j+1/2} \left[ {e_{1u} } \right]  }  \ \right) 
    443 \end{multline*}  
    444  
    445 Any of the (\autoref{eq:dynvor_ens}), (\autoref{eq:dynvor_ene}) and (\autoref{eq:dynvor_een}) schemes can be used to 
     448\end{multline*} 
     449 
     450Any of the (\autoref{eq:DYN_vor_ens}), (\autoref{eq:DYN_vor_ene}) and (\autoref{eq:DYN_vor_een}) schemes can be used to 
    446451compute the product of the Coriolis parameter and the vorticity. 
    447 However, the energy-conserving scheme (\autoref{eq:dynvor_een}) has exclusively been used to date. 
    448 This term is evaluated using a leapfrog scheme, \ie the velocity is centred in time (\textit{now} velocity). 
     452However, the energy-conserving scheme (\autoref{eq:DYN_vor_een}) has exclusively been used to date. 
     453This term is evaluated using a leapfrog scheme, \ie\ the velocity is centred in time (\textit{now} velocity). 
    449454 
    450455%-------------------------------------------------------------------------------------------------------------- 
    451456%           Flux form Advection term 
    452457%-------------------------------------------------------------------------------------------------------------- 
    453 \subsection{Flux form advection term (\protect\mdl{dynadv}) } 
     458\subsection[Flux form advection term (\textit{dynadv.F90})]{Flux form advection term (\protect\mdl{dynadv})} 
    454459\label{subsec:DYN_adv_flux} 
    455460 
    456461The discrete expression of the advection term is given by: 
    457462\[ 
    458   % \label{eq:dynadv} 
     463  % \label{eq:DYN_adv} 
    459464  \left\{ 
    460465    \begin{aligned} 
     
    475480a $2^{nd}$ order centered finite difference scheme, CEN2, 
    476481or a $3^{rd}$ order upstream biased scheme, UBS. 
    477 The latter is described in \citet{Shchepetkin_McWilliams_OM05}. 
    478 The schemes are selected using the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}.  
     482The latter is described in \citet{shchepetkin.mcwilliams_OM05}. 
     483The schemes are selected using the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}. 
    479484In flux form, the schemes differ by the choice of a space and time interpolation to define the value of 
    480 $u$ and $v$ at the centre of each face of $u$- and $v$-cells, \ie at the $T$-, $f$-, 
    481 and $uw$-points for $u$ and at the $f$-, $T$- and $vw$-points for $v$.  
     485$u$ and $v$ at the centre of each face of $u$- and $v$-cells, \ie\ at the $T$-, $f$-, 
     486and $uw$-points for $u$ and at the $f$-, $T$- and $vw$-points for $v$. 
    482487 
    483488%------------------------------------------------------------- 
    484489%                 2nd order centred scheme 
    485490%------------------------------------------------------------- 
    486 \subsubsection{CEN2: $2^{nd}$ order centred scheme (\protect\np{ln\_dynadv\_cen2}\forcode{ = .true.})} 
     491\subsubsection[CEN2: $2^{nd}$ order centred scheme (\forcode{ln_dynadv_cen2 = .true.})]{CEN2: $2^{nd}$ order centred scheme (\protect\np{ln\_dynadv\_cen2}\forcode{ = .true.})} 
    487492\label{subsec:DYN_adv_cen2} 
    488493 
    489494In the centered $2^{nd}$ order formulation, the velocity is evaluated as the mean of the two neighbouring points: 
    490495\begin{equation} 
    491   \label{eq:dynadv_cen2} 
     496  \label{eq:DYN_adv_cen2} 
    492497  \left\{ 
    493498    \begin{aligned} 
     
    496501    \end{aligned} 
    497502  \right. 
    498 \end{equation}  
    499  
    500 The scheme is non diffusive (\ie conserves the kinetic energy) but dispersive (\ie it may create false extrema). 
     503\end{equation} 
     504 
     505The scheme is non diffusive (\ie\ conserves the kinetic energy) but dispersive (\ie\ it may create false extrema). 
    501506It is therefore notoriously noisy and must be used in conjunction with an explicit diffusion operator to 
    502507produce a sensible solution. 
     
    507512%                 UBS scheme 
    508513%------------------------------------------------------------- 
    509 \subsubsection{UBS: Upstream Biased Scheme (\protect\np{ln\_dynadv\_ubs}\forcode{ = .true.})} 
     514\subsubsection[UBS: Upstream Biased Scheme (\forcode{ln_dynadv_ubs = .true.})]{UBS: Upstream Biased Scheme (\protect\np{ln\_dynadv\_ubs}\forcode{ = .true.})} 
    510515\label{subsec:DYN_adv_ubs} 
    511516 
     
    514519For example, the evaluation of $u_T^{ubs} $ is done as follows: 
    515520\begin{equation} 
    516   \label{eq:dynadv_ubs} 
     521  \label{eq:DYN_adv_ubs} 
    517522  u_T^{ubs} =\overline u ^i-\;\frac{1}{6} 
    518523  \begin{cases} 
     
    522527\end{equation} 
    523528where $u"_{i+1/2} =\delta_{i+1/2} \left[ {\delta_i \left[ u \right]} \right]$. 
    524 This results in a dissipatively dominant (\ie hyper-diffusive) truncation error 
    525 \citep{Shchepetkin_McWilliams_OM05}. 
    526 The overall performance of the advection scheme is similar to that reported in \citet{Farrow1995}. 
     529This results in a dissipatively dominant (\ie\ hyper-diffusive) truncation error 
     530\citep{shchepetkin.mcwilliams_OM05}. 
     531The overall performance of the advection scheme is similar to that reported in \citet{farrow.stevens_JPO95}. 
    527532It is a relatively good compromise between accuracy and smoothness. 
    528533It is not a \emph{positive} scheme, meaning that false extrema are permitted. 
    529534But the amplitudes of the false extrema are significantly reduced over those in the centred second order method. 
    530 As the scheme already includes a diffusion component, it can be used without explicit lateral diffusion on momentum  
    531 (\ie \np{ln\_dynldf\_lap}\forcode{ = }\np{ln\_dynldf\_bilap}\forcode{ = .false.}), 
     535As the scheme already includes a diffusion component, it can be used without explicit lateral diffusion on momentum 
     536(\ie\ \np{ln\_dynldf\_lap}\forcode{=}\np{ln\_dynldf\_bilap}\forcode{=.false.}), 
    532537and it is recommended to do so. 
    533538 
    534539The UBS scheme is not used in all directions. 
    535 In the vertical, the centred $2^{nd}$ order evaluation of the advection is preferred, \ie $u_{uw}^{ubs}$ and 
    536 $u_{vw}^{ubs}$ in \autoref{eq:dynadv_cen2} are used. 
    537 UBS is diffusive and is associated with vertical mixing of momentum. \gmcomment{ gm  pursue the  
     540In the vertical, the centred $2^{nd}$ order evaluation of the advection is preferred, \ie\ $u_{uw}^{ubs}$ and 
     541$u_{vw}^{ubs}$ in \autoref{eq:DYN_adv_cen2} are used. 
     542UBS is diffusive and is associated with vertical mixing of momentum. \gmcomment{ gm  pursue the 
    538543sentence:Since vertical mixing of momentum is a source term of the TKE equation...  } 
    539544 
    540 For stability reasons, the first term in (\autoref{eq:dynadv_ubs}), 
     545For stability reasons, the first term in (\autoref{eq:DYN_adv_ubs}), 
    541546which corresponds to a second order centred scheme, is evaluated using the \textit{now} velocity (centred in time), 
    542547while the second term, which is the diffusion part of the scheme, 
    543548is evaluated using the \textit{before} velocity (forward in time). 
    544 This is discussed by \citet{Webb_al_JAOT98} in the context of the Quick advection scheme. 
     549This is discussed by \citet{webb.de-cuevas.ea_JAOT98} in the context of the Quick advection scheme. 
    545550 
    546551Note that the UBS and QUICK (Quadratic Upstream Interpolation for Convective Kinematics) schemes only differ by 
    547552one coefficient. 
    548 Replacing $1/6$ by $1/8$ in (\autoref{eq:dynadv_ubs}) leads to the QUICK advection scheme \citep{Webb_al_JAOT98}. 
     553Replacing $1/6$ by $1/8$ in (\autoref{eq:DYN_adv_ubs}) leads to the QUICK advection scheme \citep{webb.de-cuevas.ea_JAOT98}. 
    549554This option is not available through a namelist parameter, since the $1/6$ coefficient is hard coded. 
    550555Nevertheless it is quite easy to make the substitution in the \mdl{dynadv\_ubs} module and obtain a QUICK scheme. 
     
    560565%           Hydrostatic pressure gradient term 
    561566% ================================================================ 
    562 \section{Hydrostatic pressure gradient (\protect\mdl{dynhpg})} 
     567\section[Hydrostatic pressure gradient (\textit{dynhpg.F90})]{Hydrostatic pressure gradient (\protect\mdl{dynhpg})} 
    563568\label{sec:DYN_hpg} 
    564569%------------------------------------------nam_dynhpg--------------------------------------------------- 
    565570 
    566 \nlst{namdyn_hpg}  
     571\begin{listing} 
     572  \nlst{namdyn_hpg} 
     573  \caption{\texttt{namdyn\_hpg}} 
     574  \label{lst:namdyn_hpg} 
     575\end{listing} 
    567576%------------------------------------------------------------------------------------------------------------- 
    568577 
    569 Options are defined through the \ngn{namdyn\_hpg} namelist variables. 
     578Options are defined through the \nam{dyn\_hpg} namelist variables. 
    570579The key distinction between the different algorithms used for 
    571580the hydrostatic pressure gradient is the vertical coordinate used, 
    572 since HPG is a \emph{horizontal} pressure gradient, \ie computed along geopotential surfaces. 
     581since HPG is a \emph{horizontal} pressure gradient, \ie\ computed along geopotential surfaces. 
    573582As a result, any tilt of the surface of the computational levels will require a specific treatment to 
    574583compute the hydrostatic pressure gradient. 
    575584 
    576585The hydrostatic pressure gradient term is evaluated either using a leapfrog scheme, 
    577 \ie the density appearing in its expression is centred in time (\emph{now} $\rho$), 
     586\ie\ the density appearing in its expression is centred in time (\emph{now} $\rho$), 
    578587or a semi-implcit scheme. 
    579588At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied. 
     
    582591%           z-coordinate with full step 
    583592%-------------------------------------------------------------------------------------------------------------- 
    584 \subsection{Full step $Z$-coordinate (\protect\np{ln\_dynhpg\_zco}\forcode{ = .true.})} 
     593\subsection[Full step $Z$-coordinate (\forcode{ln_dynhpg_zco = .true.})]{Full step $Z$-coordinate (\protect\np{ln\_dynhpg\_zco}\forcode{ = .true.})} 
    585594\label{subsec:DYN_hpg_zco} 
    586595 
     
    592601for $k=km$ (surface layer, $jk=1$ in the code) 
    593602\begin{equation} 
    594   \label{eq:dynhpg_zco_surf} 
     603  \label{eq:DYN_hpg_zco_surf} 
    595604  \left\{ 
    596605    \begin{aligned} 
     
    601610    \end{aligned} 
    602611  \right. 
    603 \end{equation}  
     612\end{equation} 
    604613 
    605614for $1<k<km$ (interior layer) 
    606615\begin{equation} 
    607   \label{eq:dynhpg_zco} 
     616  \label{eq:DYN_hpg_zco} 
    608617  \left\{ 
    609618    \begin{aligned} 
     
    616625    \end{aligned} 
    617626  \right. 
    618 \end{equation}  
    619  
    620 Note that the $1/2$ factor in (\autoref{eq:dynhpg_zco_surf}) is adequate because of the definition of $e_{3w}$ as 
     627\end{equation} 
     628 
     629Note that the $1/2$ factor in (\autoref{eq:DYN_hpg_zco_surf}) is adequate because of the definition of $e_{3w}$ as 
    621630the vertical derivative of the scale factor at the surface level ($z=0$). 
    622 Note also that in case of variable volume level (\key{vvl} defined), 
    623 the surface pressure gradient is included in \autoref{eq:dynhpg_zco_surf} and 
    624 \autoref{eq:dynhpg_zco} through the space and time variations of the vertical scale factor $e_{3w}$. 
     631Note also that in case of variable volume level (\texttt{vvl?} defined), 
     632the surface pressure gradient is included in \autoref{eq:DYN_hpg_zco_surf} and 
     633\autoref{eq:DYN_hpg_zco} through the space and time variations of the vertical scale factor $e_{3w}$. 
    625634 
    626635%-------------------------------------------------------------------------------------------------------------- 
    627636%           z-coordinate with partial step 
    628637%-------------------------------------------------------------------------------------------------------------- 
    629 \subsection{Partial step $Z$-coordinate (\protect\np{ln\_dynhpg\_zps}\forcode{ = .true.})} 
     638\subsection[Partial step $Z$-coordinate (\forcode{ln_dynhpg_zps = .true.})]{Partial step $Z$-coordinate (\protect\np{ln\_dynhpg\_zps}\forcode{ = .true.})} 
    630639\label{subsec:DYN_hpg_zps} 
    631640 
     
    633642Before taking horizontal gradients between these tracer points, 
    634643a linear interpolation is used to approximate the deeper tracer as if 
    635 it actually lived at the depth of the shallower tracer point.  
     644it actually lived at the depth of the shallower tracer point. 
    636645 
    637646Apart from this modification, 
     
    652661 
    653662Pressure gradient formulations in an $s$-coordinate have been the subject of a vast number of papers 
    654 (\eg, \citet{Song1998, Shchepetkin_McWilliams_OM05}).  
     663(\eg, \citet{song_MWR98, shchepetkin.mcwilliams_OM05}). 
    655664A number of different pressure gradient options are coded but the ROMS-like, 
    656665density Jacobian with cubic polynomial method is currently disabled whilst known bugs are under investigation. 
    657666 
    658 $\bullet$ Traditional coding (see for example \citet{Madec_al_JPO96}: (\np{ln\_dynhpg\_sco}\forcode{ = .true.}) 
    659 \begin{equation} 
    660   \label{eq:dynhpg_sco} 
     667$\bullet$ Traditional coding (see for example \citet{madec.delecluse.ea_JPO96}: (\np{ln\_dynhpg\_sco}\forcode{=.true.}) 
     668\begin{equation} 
     669  \label{eq:DYN_hpg_sco} 
    661670  \left\{ 
    662671    \begin{aligned} 
     
    667676    \end{aligned} 
    668677  \right. 
    669 \end{equation}  
     678\end{equation} 
    670679 
    671680Where the first term is the pressure gradient along coordinates, 
    672 computed as in \autoref{eq:dynhpg_zco_surf} - \autoref{eq:dynhpg_zco}, 
    673 and $z_T$ is the depth of the $T$-point evaluated from the sum of the vertical scale factors at the $w$-point  
     681computed as in \autoref{eq:DYN_hpg_zco_surf} - \autoref{eq:DYN_hpg_zco}, 
     682and $z_T$ is the depth of the $T$-point evaluated from the sum of the vertical scale factors at the $w$-point 
    674683($e_{3w}$). 
    675   
    676 $\bullet$ Traditional coding with adaptation for ice shelf cavities (\np{ln\_dynhpg\_isf}\forcode{ = .true.}). 
    677 This scheme need the activation of ice shelf cavities (\np{ln\_isfcav}\forcode{ = .true.}). 
    678  
    679 $\bullet$ Pressure Jacobian scheme (prj) (a research paper in preparation) (\np{ln\_dynhpg\_prj}\forcode{ = .true.}) 
    680  
    681 $\bullet$ Density Jacobian with cubic polynomial scheme (DJC) \citep{Shchepetkin_McWilliams_OM05}  
    682 (\np{ln\_dynhpg\_djc}\forcode{ = .true.}) (currently disabled; under development) 
    683  
    684 Note that expression \autoref{eq:dynhpg_sco} is commonly used when the variable volume formulation is activated 
    685 (\key{vvl}) because in that case, even with a flat bottom, 
    686 the coordinate surfaces are not horizontal but follow the free surface \citep{Levier2007}. 
    687 The pressure jacobian scheme (\np{ln\_dynhpg\_prj}\forcode{ = .true.}) is available as 
    688 an improved option to \np{ln\_dynhpg\_sco}\forcode{ = .true.} when \key{vvl} is active. 
     684 
     685$\bullet$ Traditional coding with adaptation for ice shelf cavities (\np{ln\_dynhpg\_isf}\forcode{=.true.}). 
     686This scheme need the activation of ice shelf cavities (\np{ln\_isfcav}\forcode{=.true.}). 
     687 
     688$\bullet$ Pressure Jacobian scheme (prj) (a research paper in preparation) (\np{ln\_dynhpg\_prj}\forcode{=.true.}) 
     689 
     690$\bullet$ Density Jacobian with cubic polynomial scheme (DJC) \citep{shchepetkin.mcwilliams_OM05} 
     691(\np{ln\_dynhpg\_djc}\forcode{=.true.}) (currently disabled; under development) 
     692 
     693Note that expression \autoref{eq:DYN_hpg_sco} is commonly used when the variable volume formulation is activated 
     694(\texttt{vvl?}) because in that case, even with a flat bottom, 
     695the coordinate surfaces are not horizontal but follow the free surface \citep{levier.treguier.ea_rpt07}. 
     696The pressure jacobian scheme (\np{ln\_dynhpg\_prj}\forcode{=.true.}) is available as 
     697an improved option to \np{ln\_dynhpg\_sco}\forcode{=.true.} when \texttt{vvl?} is active. 
    689698The pressure Jacobian scheme uses a constrained cubic spline to 
    690699reconstruct the density profile across the water column. 
     
    696705\subsection{Ice shelf cavity} 
    697706\label{subsec:DYN_hpg_isf} 
     707 
    698708Beneath an ice shelf, the total pressure gradient is the sum of the pressure gradient due to the ice shelf load and 
    699 the pressure gradient due to the ocean load (\np{ln\_dynhpg\_isf}\forcode{ = .true.}).\\ 
     709the pressure gradient due to the ocean load (\np{ln\_dynhpg\_isf}\forcode{=.true.}).\\ 
    700710 
    701711The main hypothesis to compute the ice shelf load is that the ice shelf is in an isostatic equilibrium. 
     
    704714corresponds to the water replaced by the ice shelf. 
    705715This top pressure is constant over time. 
    706 A detailed description of this method is described in \citet{Losch2008}.\\ 
    707  
    708 The pressure gradient due to ocean load is computed using the expression \autoref{eq:dynhpg_sco} described in 
    709 \autoref{subsec:DYN_hpg_sco}.  
     716A detailed description of this method is described in \citet{losch_JGR08}.\\ 
     717 
     718The pressure gradient due to ocean load is computed using the expression \autoref{eq:DYN_hpg_sco} described in 
     719\autoref{subsec:DYN_hpg_sco}. 
    710720 
    711721%-------------------------------------------------------------------------------------------------------------- 
    712722%           Time-scheme 
    713723%-------------------------------------------------------------------------------------------------------------- 
    714 \subsection{Time-scheme (\protect\np{ln\_dynhpg\_imp}\forcode{ = .true./.false.})} 
     724\subsection[Time-scheme (\forcode{ln_dynhpg_imp = .{true,false}.})]{Time-scheme (\protect\np{ln\_dynhpg\_imp}\forcode{ = .\{true,false\}}.)} 
    715725\label{subsec:DYN_hpg_imp} 
    716726 
     
    722732the physical phenomenon that controls the time-step is internal gravity waves (IGWs). 
    723733A semi-implicit scheme for doubling the stability limit associated with IGWs can be used 
    724 \citep{Brown_Campana_MWR78, Maltrud1998}. 
     734\citep{brown.campana_MWR78, maltrud.smith.ea_JGR98}. 
    725735It involves the evaluation of the hydrostatic pressure gradient as 
    726736an average over the three time levels $t-\rdt$, $t$, and $t+\rdt$ 
    727 (\ie \textit{before}, \textit{now} and  \textit{after} time-steps), 
    728 rather than at the central time level $t$ only, as in the standard leapfrog scheme.  
    729  
    730 $\bullet$ leapfrog scheme (\np{ln\_dynhpg\_imp}\forcode{ = .true.}): 
    731  
    732 \begin{equation} 
    733   \label{eq:dynhpg_lf} 
     737(\ie\ \textit{before}, \textit{now} and  \textit{after} time-steps), 
     738rather than at the central time level $t$ only, as in the standard leapfrog scheme. 
     739 
     740$\bullet$ leapfrog scheme (\np{ln\_dynhpg\_imp}\forcode{=.true.}): 
     741 
     742\begin{equation} 
     743  \label{eq:DYN_hpg_lf} 
    734744  \frac{u^{t+\rdt}-u^{t-\rdt}}{2\rdt} = \;\cdots \; 
    735745  -\frac{1}{\rho_o \,e_{1u} }\delta_{i+1/2} \left[ {p_h^t } \right] 
    736746\end{equation} 
    737747 
    738 $\bullet$ semi-implicit scheme (\np{ln\_dynhpg\_imp}\forcode{ = .true.}): 
    739 \begin{equation} 
    740   \label{eq:dynhpg_imp} 
     748$\bullet$ semi-implicit scheme (\np{ln\_dynhpg\_imp}\forcode{=.true.}): 
     749\begin{equation} 
     750  \label{eq:DYN_hpg_imp} 
    741751  \frac{u^{t+\rdt}-u^{t-\rdt}}{2\rdt} = \;\cdots \; 
    742752  -\frac{1}{4\,\rho_o \,e_{1u} } \delta_{i+1/2} \left[ p_h^{t+\rdt} +2\,p_h^t +p_h^{t-\rdt}  \right] 
    743753\end{equation} 
    744754 
    745 The semi-implicit time scheme \autoref{eq:dynhpg_imp} is made possible without 
     755The semi-implicit time scheme \autoref{eq:DYN_hpg_imp} is made possible without 
    746756significant additional computation since the density can be updated to time level $t+\rdt$ before 
    747757computing the horizontal hydrostatic pressure gradient. 
    748758It can be easily shown that the stability limit associated with the hydrostatic pressure gradient doubles using 
    749 \autoref{eq:dynhpg_imp} compared to that using the standard leapfrog scheme \autoref{eq:dynhpg_lf}. 
    750 Note that \autoref{eq:dynhpg_imp} is equivalent to applying a time filter to the pressure gradient to 
     759\autoref{eq:DYN_hpg_imp} compared to that using the standard leapfrog scheme \autoref{eq:DYN_hpg_lf}. 
     760Note that \autoref{eq:DYN_hpg_imp} is equivalent to applying a time filter to the pressure gradient to 
    751761eliminate high frequency IGWs. 
    752 Obviously, when using \autoref{eq:dynhpg_imp}, 
     762Obviously, when using \autoref{eq:DYN_hpg_imp}, 
    753763the doubling of the time-step is achievable only if no other factors control the time-step, 
    754764such as the stability limits associated with advection or diffusion. 
    755765 
    756 In practice, the semi-implicit scheme is used when \np{ln\_dynhpg\_imp}\forcode{ = .true.}. 
     766In practice, the semi-implicit scheme is used when \np{ln\_dynhpg\_imp}\forcode{=.true.}. 
    757767In this case, we choose to apply the time filter to temperature and salinity used in the equation of state, 
    758768instead of applying it to the hydrostatic pressure or to the density, 
     
    760770The density used to compute the hydrostatic pressure gradient (whatever the formulation) is evaluated as follows: 
    761771\[ 
    762   % \label{eq:rho_flt} 
     772  % \label{eq:DYN_rho_flt} 
    763773  \rho^t = \rho( \widetilde{T},\widetilde {S},z_t) 
    764774  \quad    \text{with}  \quad 
     
    773783% Surface Pressure Gradient 
    774784% ================================================================ 
    775 \section{Surface pressure gradient (\protect\mdl{dynspg})} 
     785\section[Surface pressure gradient (\textit{dynspg.F90})]{Surface pressure gradient (\protect\mdl{dynspg})} 
    776786\label{sec:DYN_spg} 
    777787%-----------------------------------------nam_dynspg---------------------------------------------------- 
    778788 
    779 \nlst{namdyn_spg}  
     789\begin{listing} 
     790  \nlst{namdyn_spg} 
     791  \caption{\texttt{namdyn\_spg}} 
     792  \label{lst:namdyn_spg} 
     793\end{listing} 
    780794%------------------------------------------------------------------------------------------------------------ 
    781795 
    782 Options are defined through the \ngn{namdyn\_spg} namelist variables. 
    783 The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}). 
     796Options are defined through the \nam{dyn\_spg} namelist variables. 
     797The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:MB_hor_pg}). 
    784798The main distinction is between the fixed volume case (linear free surface) and 
    785 the variable volume case (nonlinear free surface, \key{vvl} is defined). 
    786 In the linear free surface case (\autoref{subsec:PE_free_surface}) 
     799the variable volume case (nonlinear free surface, \texttt{vvl?} is defined). 
     800In the linear free surface case (\autoref{subsec:MB_free_surface}) 
    787801the vertical scale factors $e_{3}$ are fixed in time, 
    788 while they are time-dependent in the nonlinear case (\autoref{subsec:PE_free_surface}). 
    789 With both linear and nonlinear free surface, external gravity waves are allowed in the equations,  
     802while they are time-dependent in the nonlinear case (\autoref{subsec:MB_free_surface}). 
     803With both linear and nonlinear free surface, external gravity waves are allowed in the equations, 
    790804which imposes a very small time step when an explicit time stepping is used. 
    791 Two methods are proposed to allow a longer time step for the three-dimensional equations:  
    792 the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:PE_flt}),  
     805Two methods are proposed to allow a longer time step for the three-dimensional equations: 
     806the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:MB_flt?}), 
    793807and the split-explicit free surface described below. 
    794 The extra term introduced in the filtered method is calculated implicitly,  
     808The extra term introduced in the filtered method is calculated implicitly, 
    795809so that the update of the next velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}. 
    796810 
    797811 
    798812The form of the surface pressure gradient term depends on how the user wants to 
    799 handle the fast external gravity waves that are a solution of the analytical equation (\autoref{sec:PE_hor_pg}). 
     813handle the fast external gravity waves that are a solution of the analytical equation (\autoref{sec:MB_hor_pg}). 
    800814Three formulations are available, all controlled by a CPP key (ln\_dynspg\_xxx): 
    801815an explicit formulation which requires a small time step; 
    802816a filtered free surface formulation which allows a larger time step by 
    803 adding a filtering term into the momentum equation;  
     817adding a filtering term into the momentum equation; 
    804818and a split-explicit free surface formulation, described below, which also allows a larger time step. 
    805819 
     
    811825% Explicit free surface formulation 
    812826%-------------------------------------------------------------------------------------------------------------- 
    813 \subsection{Explicit free surface (\protect\key{dynspg\_exp})} 
     827\subsection[Explicit free surface (\texttt{ln\_dynspg\_exp}\forcode{ = .true.})]{Explicit free surface (\protect\np{ln\_dynspg\_exp}\forcode{ = .true.})} 
    814828\label{subsec:DYN_spg_exp} 
    815829 
    816 In the explicit free surface formulation (\key{dynspg\_exp} defined), 
     830In the explicit free surface formulation (\np{ln\_dynspg\_exp} set to true), 
    817831the model time step is chosen to be small enough to resolve the external gravity waves 
    818832(typically a few tens of seconds). 
    819 The surface pressure gradient, evaluated using a leap-frog scheme (\ie centered in time), 
     833The surface pressure gradient, evaluated using a leap-frog scheme (\ie\ centered in time), 
    820834is thus simply given by : 
    821835\begin{equation} 
    822   \label{eq:dynspg_exp} 
     836  \label{eq:DYN_spg_exp} 
    823837  \left\{ 
    824838    \begin{aligned} 
     
    827841    \end{aligned} 
    828842  \right. 
    829 \end{equation}  
    830  
    831 Note that in the non-linear free surface case (\ie \key{vvl} defined), 
     843\end{equation} 
     844 
     845Note that in the non-linear free surface case (\ie\ \texttt{vvl?} defined), 
    832846the surface pressure gradient is already included in the momentum tendency through 
    833847the level thickness variation allowed in the computation of the hydrostatic pressure gradient. 
     
    837851% Split-explict free surface formulation 
    838852%-------------------------------------------------------------------------------------------------------------- 
    839 \subsection{Split-explicit free surface (\protect\key{dynspg\_ts})} 
     853\subsection[Split-explicit free surface (\texttt{ln\_dynspg\_ts}\forcode{ = .true.})]{Split-explicit free surface (\protect\np{ln\_dynspg\_ts}\forcode{ = .true.})} 
    840854\label{subsec:DYN_spg_ts} 
    841855%------------------------------------------namsplit----------------------------------------------------------- 
     
    844858%------------------------------------------------------------------------------------------------------------- 
    845859 
    846 The split-explicit free surface formulation used in \NEMO (\key{dynspg\_ts} defined), 
    847 also called the time-splitting formulation, follows the one proposed by \citet{Shchepetkin_McWilliams_OM05}. 
     860The split-explicit free surface formulation used in \NEMO\ (\np{ln\_dynspg\_ts} set to true), 
     861also called the time-splitting formulation, follows the one proposed by \citet{shchepetkin.mcwilliams_OM05}. 
    848862The general idea is to solve the free surface equation and the associated barotropic velocity equations with 
    849863a smaller time step than $\rdt$, the time step used for the three dimensional prognostic variables 
    850 (\autoref{fig:DYN_dynspg_ts}). 
     864(\autoref{fig:DYN_spg_ts}). 
    851865The size of the small time step, $\rdt_e$ (the external mode or barotropic time step) is provided through 
    852866the \np{nn\_baro} namelist parameter as: $\rdt_e = \rdt / nn\_baro$. 
    853 This parameter can be optionally defined automatically (\np{ln\_bt\_nn\_auto}\forcode{ = .true.}) considering that 
     867This parameter can be optionally defined automatically (\np{ln\_bt\_nn\_auto}\forcode{=.true.}) considering that 
    854868the stability of the barotropic system is essentially controled by external waves propagation. 
    855869Maximum Courant number is in that case time independent, and easily computed online from the input bathymetry. 
     
    859873The barotropic mode solves the following equations: 
    860874% \begin{subequations} 
    861 %  \label{eq:BT} 
    862 \begin{equation} 
    863   \label{eq:BT_dyn} 
    864   \frac{\partial {\rm \overline{{\bf U}}_h} }{\partial t}= 
    865   -f\;{\rm {\bf k}}\times {\rm \overline{{\bf U}}_h} 
    866   -g\nabla _h \eta -\frac{c_b^{\textbf U}}{H+\eta} \rm {\overline{{\bf U}}_h} + \rm {\overline{\bf G}} 
    867 \end{equation} 
    868 \[ 
    869   % \label{eq:BT_ssh} 
    870   \frac{\partial \eta }{\partial t}=-\nabla \cdot \left[ {\left( {H+\eta } \right) \; {\rm{\bf \overline{U}}}_h \,} \right]+P-E 
     875%  \label{eq:DYN_BT} 
     876\begin{equation} 
     877  \label{eq:DYN_BT_dyn} 
     878  \frac{\partial {\mathrm \overline{{\mathbf U}}_h} }{\partial t}= 
     879  -f\;{\mathrm {\mathbf k}}\times {\mathrm \overline{{\mathbf U}}_h} 
     880  -g\nabla _h \eta -\frac{c_b^{\textbf U}}{H+\eta} \mathrm {\overline{{\mathbf U}}_h} + \mathrm {\overline{\mathbf G}} 
     881\end{equation} 
     882\[ 
     883  % \label{eq:DYN_BT_ssh} 
     884  \frac{\partial \eta }{\partial t}=-\nabla \cdot \left[ {\left( {H+\eta } \right) \; {\mathrm{\mathbf \overline{U}}}_h \,} \right]+P-E 
    871885\] 
    872886% \end{subequations} 
    873 where $\rm {\overline{\bf G}}$ is a forcing term held constant, containing coupling term between modes, 
     887where $\mathrm {\overline{\mathbf G}}$ is a forcing term held constant, containing coupling term between modes, 
    874888surface atmospheric forcing as well as slowly varying barotropic terms not explicitly computed to gain efficiency. 
    875 The third term on the right hand side of \autoref{eq:BT_dyn} represents the bottom stress 
    876 (see section \autoref{sec:ZDF_bfr}), explicitly accounted for at each barotropic iteration. 
     889The third term on the right hand side of \autoref{eq:DYN_BT_dyn} represents the bottom stress 
     890(see section \autoref{sec:ZDF_drg}), explicitly accounted for at each barotropic iteration. 
    877891Temporal discretization of the system above follows a three-time step Generalized Forward Backward algorithm 
    878 detailed in \citet{Shchepetkin_McWilliams_OM05}. 
    879 AB3-AM4 coefficients used in \NEMO follow the second-order accurate, 
    880 "multi-purpose" stability compromise as defined in \citet{Shchepetkin_McWilliams_Bk08} 
    881 (see their figure 12, lower left).  
     892detailed in \citet{shchepetkin.mcwilliams_OM05}. 
     893AB3-AM4 coefficients used in \NEMO\ follow the second-order accurate, 
     894"multi-purpose" stability compromise as defined in \citet{shchepetkin.mcwilliams_ibk09} 
     895(see their figure 12, lower left). 
    882896 
    883897%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
    884898\begin{figure}[!t] 
    885   \begin{center} 
    886     \includegraphics[width=0.7\textwidth]{Fig_DYN_dynspg_ts} 
    887     \caption{ 
    888       \protect\label{fig:DYN_dynspg_ts} 
    889       Schematic of the split-explicit time stepping scheme for the external and internal modes. 
    890       Time increases to the right. In this particular exemple, 
    891       a boxcar averaging window over $nn\_baro$ barotropic time steps is used ($nn\_bt\_flt=1$) and $nn\_baro=5$. 
    892       Internal mode time steps (which are also the model time steps) are denoted by $t-\rdt$, $t$ and $t+\rdt$. 
    893       Variables with $k$ superscript refer to instantaneous barotropic variables, 
    894       $< >$ and $<< >>$ operator refer to time filtered variables using respectively primary (red vertical bars) and 
    895       secondary weights (blue vertical bars). 
    896       The former are used to obtain time filtered quantities at $t+\rdt$ while 
    897       the latter are used to obtain time averaged transports to advect tracers. 
    898       a) Forward time integration: \protect\np{ln\_bt\_fw}\forcode{ = .true.}, 
    899       \protect\np{ln\_bt\_av}\forcode{ = .true.}. 
    900       b) Centred time integration: \protect\np{ln\_bt\_fw}\forcode{ = .false.}, 
    901       \protect\np{ln\_bt\_av}\forcode{ = .true.}. 
    902       c) Forward time integration with no time filtering (POM-like scheme): 
    903       \protect\np{ln\_bt\_fw}\forcode{ = .true.}, \protect\np{ln\_bt\_av}\forcode{ = .false.}. 
    904     } 
    905   \end{center} 
     899  \centering 
     900  \includegraphics[width=\textwidth]{Fig_DYN_dynspg_ts} 
     901  \caption[Split-explicit time stepping scheme for the external and internal modes]{ 
     902    Schematic of the split-explicit time stepping scheme for the external and internal modes. 
     903    Time increases to the right. 
     904    In this particular exemple, 
     905    a boxcar averaging window over \np{nn\_baro} barotropic time steps is used 
     906    (\np{nn\_bt\_flt}\forcode{=1}) and \np{nn\_baro}\forcode{=5}. 
     907    Internal mode time steps (which are also the model time steps) are denoted by 
     908    $t-\rdt$, $t$ and $t+\rdt$. 
     909    Variables with $k$ superscript refer to instantaneous barotropic variables, 
     910    $< >$ and $<< >>$ operator refer to time filtered variables using respectively primary 
     911    (red vertical bars) and secondary weights (blue vertical bars). 
     912    The former are used to obtain time filtered quantities at $t+\rdt$ while 
     913    the latter are used to obtain time averaged transports to advect tracers. 
     914    a) Forward time integration: 
     915    \protect\np{ln\_bt\_fw}\forcode{=.true.},  \protect\np{ln\_bt\_av}\forcode{=.true.}. 
     916    b) Centred time integration: 
     917    \protect\np{ln\_bt\_fw}\forcode{=.false.}, \protect\np{ln\_bt\_av}\forcode{=.true.}. 
     918    c) Forward time integration with no time filtering (POM-like scheme): 
     919    \protect\np{ln\_bt\_fw}\forcode{=.true.},  \protect\np{ln\_bt\_av}\forcode{=.false.}.} 
     920  \label{fig:DYN_spg_ts} 
    906921\end{figure} 
    907922%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
    908923 
    909 In the default case (\np{ln\_bt\_fw}\forcode{ = .true.}), 
     924In the default case (\np{ln\_bt\_fw}\forcode{=.true.}), 
    910925the external mode is integrated between \textit{now} and \textit{after} baroclinic time-steps 
    911 (\autoref{fig:DYN_dynspg_ts}a). 
     926(\autoref{fig:DYN_spg_ts}a). 
    912927To avoid aliasing of fast barotropic motions into three dimensional equations, 
    913 time filtering is eventually applied on barotropic quantities (\np{ln\_bt\_av}\forcode{ = .true.}). 
     928time filtering is eventually applied on barotropic quantities (\np{ln\_bt\_av}\forcode{=.true.}). 
    914929In that case, the integration is extended slightly beyond \textit{after} time step to 
    915930provide time filtered quantities. 
    916931These are used for the subsequent initialization of the barotropic mode in the following baroclinic step. 
    917 Since external mode equations written at baroclinic time steps finally follow a forward time stepping scheme,  
     932Since external mode equations written at baroclinic time steps finally follow a forward time stepping scheme, 
    918933asselin filtering is not applied to barotropic quantities.\\ 
    919934Alternatively, one can choose to integrate barotropic equations starting from \textit{before} time step 
    920 (\np{ln\_bt\_fw}\forcode{ = .false.}). 
     935(\np{ln\_bt\_fw}\forcode{=.false.}). 
    921936Although more computationaly expensive ( \np{nn\_baro} additional iterations are indeed necessary), 
    922937the baroclinic to barotropic forcing term given at \textit{now} time step become centred in 
     
    936951and time splitting not compatible. 
    937952Advective barotropic velocities are obtained by using a secondary set of filtering weights, 
    938 uniquely defined from the filter coefficients used for the time averaging (\citet{Shchepetkin_McWilliams_OM05}). 
     953uniquely defined from the filter coefficients used for the time averaging (\citet{shchepetkin.mcwilliams_OM05}). 
    939954Consistency between the time averaged continuity equation and the time stepping of tracers is here the key to 
    940955obtain exact conservation. 
     
    943958 
    944959One can eventually choose to feedback instantaneous values by not using any time filter 
    945 (\np{ln\_bt\_av}\forcode{ = .false.}).  
     960(\np{ln\_bt\_av}\forcode{=.false.}). 
    946961In that case, external mode equations are continuous in time, 
    947 \ie they are not re-initialized when starting a new sub-stepping sequence. 
     962\ie\ they are not re-initialized when starting a new sub-stepping sequence. 
    948963This is the method used so far in the POM model, the stability being maintained by 
    949964refreshing at (almost) each barotropic time step advection and horizontal diffusion terms. 
    950 Since the latter terms have not been added in \NEMO for computational efficiency, 
     965Since the latter terms have not been added in \NEMO\ for computational efficiency, 
    951966removing time filtering is not recommended except for debugging purposes. 
    952967This may be used for instance to appreciate the damping effect of the standard formulation on 
    953968external gravity waves in idealized or weakly non-linear cases. 
    954969Although the damping is lower than for the filtered free surface, 
    955 it is still significant as shown by \citet{Levier2007} in the case of an analytical barotropic Kelvin wave. 
     970it is still significant as shown by \citet{levier.treguier.ea_rpt07} in the case of an analytical barotropic Kelvin wave. 
    956971 
    957972%>>>>>=============== 
    958 \gmcomment{               %%% copy from griffies Book  
     973\gmcomment{               %%% copy from griffies Book 
    959974 
    960975\textbf{title: Time stepping the barotropic system } 
     
    963978Hence, we can update the surface height and vertically integrated velocity with a leap-frog scheme using 
    964979the small barotropic time step $\rdt$. 
    965 We have  
     980We have 
    966981 
    967982\[ 
     
    9861001and total depth of the ocean $H(\tau)$ are held for the duration of the barotropic time stepping over 
    9871002a single cycle. 
    988 This is also the time that sets the barotropic time steps via  
     1003This is also the time that sets the barotropic time steps via 
    9891004\[ 
    9901005  % \label{eq:DYN_spg_ts_t} 
     
    9921007\] 
    9931008with $n$ an integer. 
    994 The density scaled surface pressure is evaluated via  
     1009The density scaled surface pressure is evaluated via 
    9951010\[ 
    9961011  % \label{eq:DYN_spg_ts_ps} 
     
    10011016  \end{cases} 
    10021017\] 
    1003 To get started, we assume the following initial conditions  
     1018To get started, we assume the following initial conditions 
    10041019\[ 
    10051020  % \label{eq:DYN_spg_ts_eta} 
     
    10091024  \end{split} 
    10101025\] 
    1011 with  
     1026with 
    10121027\[ 
    10131028  % \label{eq:DYN_spg_ts_etaF} 
     
    10151030\] 
    10161031the time averaged surface height taken from the previous barotropic cycle. 
    1017 Likewise,  
     1032Likewise, 
    10181033\[ 
    10191034  % \label{eq:DYN_spg_ts_u} 
     
    10211036  \textbf{U}(\tau,t_{n=1}) = \textbf{U}^{(b)}(\tau,t_{n=0}) + \rdt \ \text{RHS}_{n=0} 
    10221037\] 
    1023 with  
     1038with 
    10241039\[ 
    10251040  % \label{eq:DYN_spg_ts_u} 
     
    10271042\] 
    10281043the time averaged vertically integrated transport. 
    1029 Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration.  
     1044Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration. 
    10301045 
    10311046Upon reaching $t_{n=N} = \tau + 2\rdt \tau$ , 
    10321047the vertically integrated velocity is time averaged to produce the updated vertically integrated velocity at 
    1033 baroclinic time $\tau + \rdt \tau$  
     1048baroclinic time $\tau + \rdt \tau$ 
    10341049\[ 
    10351050  % \label{eq:DYN_spg_ts_u} 
     
    10371052\] 
    10381053The surface height on the new baroclinic time step is then determined via a baroclinic leap-frog using 
    1039 the following form  
     1054the following form 
    10401055 
    10411056\begin{equation} 
    10421057  \label{eq:DYN_spg_ts_ssh} 
    1043   \eta(\tau+\Delta) - \eta^{F}(\tau-\Delta) = 2\rdt \ \left[ - \nabla \cdot \textbf{U}(\tau) + \text{EMP}_w \right]   
     1058  \eta(\tau+\Delta) - \eta^{F}(\tau-\Delta) = 2\rdt \ \left[ - \nabla \cdot \textbf{U}(\tau) + \text{EMP}_w \right] 
    10441059\end{equation} 
    10451060 
    10461061The use of this "big-leap-frog" scheme for the surface height ensures compatibility between 
    10471062the mass/volume budgets and the tracer budgets. 
    1048 More discussion of this point is provided in Chapter 10 (see in particular Section 10.2).  
    1049   
     1063More discussion of this point is provided in Chapter 10 (see in particular Section 10.2). 
     1064 
    10501065In general, some form of time filter is needed to maintain integrity of the surface height field due to 
    10511066the leap-frog splitting mode in equation \autoref{eq:DYN_spg_ts_ssh}. 
    10521067We have tried various forms of such filtering, 
    1053 with the following method discussed in \cite{Griffies_al_MWR01} chosen due to 
     1068with the following method discussed in \cite{griffies.pacanowski.ea_MWR01} chosen due to 
    10541069its stability and reasonably good maintenance of tracer conservation properties (see ??). 
    10551070 
     
    10581073  \eta^{F}(\tau-\Delta) =  \overline{\eta^{(b)}(\tau)} 
    10591074\end{equation} 
    1060 Another approach tried was  
     1075Another approach tried was 
    10611076 
    10621077\[ 
     
    10711086eliminating tracer and surface height time filtering (see ?? for more complete discussion). 
    10721087However, in the general case with a non-zero $\alpha$, 
    1073 the filter \autoref{eq:DYN_spg_ts_sshf} was found to be more conservative, and so is recommended.  
     1088the filter \autoref{eq:DYN_spg_ts_sshf} was found to be more conservative, and so is recommended. 
    10741089 
    10751090}            %%end gm comment (copy of griffies book) 
     
    10811096% Filtered free surface formulation 
    10821097%-------------------------------------------------------------------------------------------------------------- 
    1083 \subsection{Filtered free surface (\protect\key{dynspg\_flt})} 
     1098\subsection[Filtered free surface (\texttt{dynspg\_flt?})]{Filtered free surface (\protect\texttt{dynspg\_flt?})} 
    10841099\label{subsec:DYN_spg_fltp} 
    10851100 
    1086 The filtered formulation follows the \citet{Roullet_Madec_JGR00} implementation.  
    1087 The extra term introduced in the equations (see \autoref{subsec:PE_free_surface}) is solved implicitly.  
     1101The filtered formulation follows the \citet{roullet.madec_JGR00} implementation. 
     1102The extra term introduced in the equations (see \autoref{subsec:MB_free_surface}) is solved implicitly. 
    10881103The elliptic solvers available in the code are documented in \autoref{chap:MISC}. 
    10891104 
    10901105%% gm %%======>>>>   given here the discrete eqs provided to the solver 
    1091 \gmcomment{               %%% copy from chap-model basics  
     1106\gmcomment{               %%% copy from chap-model basics 
    10921107  \[ 
    1093     % \label{eq:spg_flt} 
    1094     \frac{\partial {\rm {\bf U}}_h }{\partial t}= {\rm {\bf M}} 
     1108    % \label{eq:DYN_spg_flt} 
     1109    \frac{\partial {\mathrm {\mathbf U}}_h }{\partial t}= {\mathrm {\mathbf M}} 
    10951110    - g \nabla \left( \tilde{\rho} \ \eta \right) 
    10961111    - g \ T_c \nabla \left( \widetilde{\rho} \ \partial_t \eta \right) 
     
    10981113  where $T_c$, is a parameter with dimensions of time which characterizes the force, 
    10991114  $\widetilde{\rho} = \rho / \rho_o$ is the dimensionless density, 
    1100   and $\rm {\bf M}$ represents the collected contributions of the Coriolis, hydrostatic pressure gradient, 
    1101   non-linear and viscous terms in \autoref{eq:PE_dyn}. 
     1115  and $\mathrm {\mathbf M}$ represents the collected contributions of the Coriolis, hydrostatic pressure gradient, 
     1116  non-linear and viscous terms in \autoref{eq:MB_dyn}. 
    11021117}   %end gmcomment 
    11031118 
    1104 Note that in the linear free surface formulation (\key{vvl} not defined), 
     1119Note that in the linear free surface formulation (\texttt{vvl?} not defined), 
    11051120the ocean depth is time-independent and so is the matrix to be inverted. 
    1106 It is computed once and for all and applies to all ocean time steps.  
     1121It is computed once and for all and applies to all ocean time steps. 
    11071122 
    11081123% ================================================================ 
    11091124% Lateral diffusion term 
    11101125% ================================================================ 
    1111 \section{Lateral diffusion term and operators (\protect\mdl{dynldf})} 
     1126\section[Lateral diffusion term and operators (\textit{dynldf.F90})]{Lateral diffusion term and operators (\protect\mdl{dynldf})} 
    11121127\label{sec:DYN_ldf} 
    11131128%------------------------------------------nam_dynldf---------------------------------------------------- 
    11141129 
    1115 \nlst{namdyn_ldf}  
     1130\begin{listing} 
     1131  \nlst{namdyn_ldf} 
     1132  \caption{\texttt{namdyn\_ldf}} 
     1133  \label{lst:namdyn_ldf} 
     1134\end{listing} 
    11161135%------------------------------------------------------------------------------------------------------------- 
    11171136 
    1118 Options are defined through the \ngn{namdyn\_ldf} namelist variables. 
     1137Options are defined through the \nam{dyn\_ldf} namelist variables. 
    11191138The options available for lateral diffusion are to use either laplacian (rotated or not) or biharmonic operators. 
    11201139The coefficients may be constant or spatially variable; 
    11211140the description of the coefficients is found in the chapter on lateral physics (\autoref{chap:LDF}). 
    11221141The lateral diffusion of momentum is evaluated using a forward scheme, 
    1123 \ie the velocity appearing in its expression is the \textit{before} velocity in time, 
     1142\ie\ the velocity appearing in its expression is the \textit{before} velocity in time, 
    11241143except for the pure vertical component that appears when a tensor of rotation is used. 
    1125 This latter term is solved implicitly together with the vertical diffusion term (see \autoref{chap:STP}). 
     1144This latter term is solved implicitly together with the vertical diffusion term (see \autoref{chap:TD}). 
    11261145 
    11271146At the lateral boundaries either free slip, 
     
    11371156  In finite difference methods, 
    11381157  the biharmonic operator is frequently the method of choice to achieve this scale selective dissipation since 
    1139   its damping time (\ie its spin down time) scale like $\lambda^{-4}$ for disturbances of wavelength $\lambda$ 
     1158  its damping time (\ie\ its spin down time) scale like $\lambda^{-4}$ for disturbances of wavelength $\lambda$ 
    11401159  (so that short waves damped more rapidelly than long ones), 
    11411160  whereas the Laplace operator damping time scales only like $\lambda^{-2}$. 
     
    11431162 
    11441163% ================================================================ 
    1145 \subsection[Iso-level laplacian (\protect\np{ln\_dynldf\_lap}\forcode{ = .true.})] 
    1146             {Iso-level laplacian operator (\protect\np{ln\_dynldf\_lap}\forcode{ = .true.})} 
     1164\subsection[Iso-level laplacian (\forcode{ln_dynldf_lap = .true.})]{Iso-level laplacian operator (\protect\np{ln\_dynldf\_lap}\forcode{ = .true.})} 
    11471165\label{subsec:DYN_ldf_lap} 
    11481166 
    1149 For lateral iso-level diffusion, the discrete operator is:  
    1150 \begin{equation} 
    1151   \label{eq:dynldf_lap} 
     1167For lateral iso-level diffusion, the discrete operator is: 
     1168\begin{equation} 
     1169  \label{eq:DYN_ldf_lap} 
    11521170  \left\{ 
    11531171    \begin{aligned} 
    1154       D_u^{l{\rm {\bf U}}} =\frac{1}{e_{1u} }\delta_{i+1/2} \left[ {A_T^{lm} 
    1155           \;\chi } \right]-\frac{1}{e_{2u} {\kern 1pt}e_{3u} }\delta_j \left[  
     1172      D_u^{l{\mathrm {\mathbf U}}} =\frac{1}{e_{1u} }\delta_{i+1/2} \left[ {A_T^{lm} 
     1173          \;\chi } \right]-\frac{1}{e_{2u} {\kern 1pt}e_{3u} }\delta_j \left[ 
    11561174        {A_f^{lm} \;e_{3f} \zeta } \right] \\ \\ 
    1157       D_v^{l{\rm {\bf U}}} =\frac{1}{e_{2v} }\delta_{j+1/2} \left[ {A_T^{lm} 
    1158           \;\chi } \right]+\frac{1}{e_{1v} {\kern 1pt}e_{3v} }\delta_i \left[  
     1175      D_v^{l{\mathrm {\mathbf U}}} =\frac{1}{e_{2v} }\delta_{j+1/2} \left[ {A_T^{lm} 
     1176          \;\chi } \right]+\frac{1}{e_{1v} {\kern 1pt}e_{3v} }\delta_i \left[ 
    11591177        {A_f^{lm} \;e_{3f} \zeta } \right] 
    11601178    \end{aligned} 
    11611179  \right. 
    1162 \end{equation}  
    1163  
    1164 As explained in \autoref{subsec:PE_ldf}, 
     1180\end{equation} 
     1181 
     1182As explained in \autoref{subsec:MB_ldf}, 
    11651183this formulation (as the gradient of a divergence and curl of the vorticity) preserves symmetry and 
    1166 ensures a complete separation between the vorticity and divergence parts of the momentum diffusion.  
     1184ensures a complete separation between the vorticity and divergence parts of the momentum diffusion. 
    11671185 
    11681186%-------------------------------------------------------------------------------------------------------------- 
    11691187%           Rotated laplacian operator 
    11701188%-------------------------------------------------------------------------------------------------------------- 
    1171 \subsection[Rotated laplacian (\protect\np{ln\_dynldf\_iso}\forcode{ = .true.})] 
    1172             {Rotated laplacian operator (\protect\np{ln\_dynldf\_iso}\forcode{ = .true.})} 
     1189\subsection[Rotated laplacian (\forcode{ln_dynldf_iso = .true.})]{Rotated laplacian operator (\protect\np{ln\_dynldf\_iso}\forcode{ = .true.})} 
    11731190\label{subsec:DYN_ldf_iso} 
    11741191 
    11751192A rotation of the lateral momentum diffusion operator is needed in several cases: 
    1176 for iso-neutral diffusion in the $z$-coordinate (\np{ln\_dynldf\_iso}\forcode{ = .true.}) and 
    1177 for either iso-neutral (\np{ln\_dynldf\_iso}\forcode{ = .true.}) or 
    1178 geopotential (\np{ln\_dynldf\_hor}\forcode{ = .true.}) diffusion in the $s$-coordinate. 
     1193for iso-neutral diffusion in the $z$-coordinate (\np{ln\_dynldf\_iso}\forcode{=.true.}) and 
     1194for either iso-neutral (\np{ln\_dynldf\_iso}\forcode{=.true.}) or 
     1195geopotential (\np{ln\_dynldf\_hor}\forcode{=.true.}) diffusion in the $s$-coordinate. 
    11791196In the partial step case, coordinates are horizontal except at the deepest level and 
    1180 no rotation is performed when \np{ln\_dynldf\_hor}\forcode{ = .true.}. 
     1197no rotation is performed when \np{ln\_dynldf\_hor}\forcode{=.true.}. 
    11811198The diffusion operator is defined simply as the divergence of down gradient momentum fluxes on 
    11821199each momentum component. 
     
    11841201The resulting discrete representation is: 
    11851202\begin{equation} 
    1186   \label{eq:dyn_ldf_iso} 
     1203  \label{eq:DYN_ldf_iso} 
    11871204  \begin{split} 
    11881205    D_u^{l\textbf{U}} &= \frac{1}{e_{1u} \, e_{2u} \, e_{3u} } \\ 
     
    12081225                -e_{2f} \; r_{1f} \,\overline{\overline {\delta_{k+1/2}[v]}}^{\,i+1/2,\,k}} 
    12091226            \right)} \right]}    \right. \\ 
    1210     & \qquad +\ \delta_j \left[ {A_T^{lm} \left( {\frac{e_{1t}\,e_{3t} }{e_{2t}  
     1227    & \qquad +\ \delta_j \left[ {A_T^{lm} \left( {\frac{e_{1t}\,e_{3t} }{e_{2t} 
    12111228            }\,\delta_{j} [v] - e_{1t}\, r_{2t} 
    12121229            \,\overline{\overline {\delta_{k+1/2} [v]}} ^{\,j,\,k}} 
    12131230        \right)} \right] \\ 
    1214     & \qquad +\ \delta_k \left[ {A_{vw}^{lm} \left( {-e_{2v} \, r_{1vw} \,\overline{\overline  
     1231    & \qquad +\ \delta_k \left[ {A_{vw}^{lm} \left( {-e_{2v} \, r_{1vw} \,\overline{\overline 
    12151232              {\delta_{i+1/2} [v]}}^{\,i+1/2,\,k+1/2} }\right.} \right. \\ 
    12161233    &  \ \qquad \qquad \qquad \quad\ 
    12171234    - e_{1v} \, r_{2vw} \,\overline{\overline {\delta_{j+1/2} [v]}} ^{\,j+1/2,\,k+1/2} \\ 
    1218     & \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\  
     1235    & \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\ 
    12191236                +\frac{e_{1v}\, e_{2v} }{e_{3vw} }\,\left( {r_{1vw}^2+r_{2vw}^2} 
    1220                 \right)\,\delta_{k+1/2} [v]} \right)} \right]\;\;\;} \right\}  
     1237                \right)\,\delta_{k+1/2} [v]} \right)} \right]\;\;\;} \right\} 
    12211238  \end{split} 
    12221239\end{equation} 
    12231240where $r_1$ and $r_2$ are the slopes between the surface along which the diffusion operator acts and 
    1224 the surface of computation ($z$- or $s$-surfaces).  
     1241the surface of computation ($z$- or $s$-surfaces). 
    12251242The way these slopes are evaluated is given in the lateral physics chapter (\autoref{chap:LDF}). 
    12261243 
     
    12281245%           Iso-level bilaplacian operator 
    12291246%-------------------------------------------------------------------------------------------------------------- 
    1230 \subsection[Iso-level bilaplacian (\protect\np{ln\_dynldf\_bilap}\forcode{ = .true.})] 
    1231             {Iso-level bilaplacian operator (\protect\np{ln\_dynldf\_bilap}\forcode{ = .true.})} 
     1247\subsection[Iso-level bilaplacian (\forcode{ln_dynldf_bilap = .true.})]{Iso-level bilaplacian operator (\protect\np{ln\_dynldf\_bilap}\forcode{ = .true.})} 
    12321248\label{subsec:DYN_ldf_bilap} 
    12331249 
    1234 The lateral fourth order operator formulation on momentum is obtained by applying \autoref{eq:dynldf_lap} twice. 
     1250The lateral fourth order operator formulation on momentum is obtained by applying \autoref{eq:DYN_ldf_lap} twice. 
    12351251It requires an additional assumption on boundary conditions: 
    12361252the first derivative term normal to the coast depends on the free or no-slip lateral boundary conditions chosen, 
     
    12431259%           Vertical diffusion term 
    12441260% ================================================================ 
    1245 \section{Vertical diffusion term (\protect\mdl{dynzdf})} 
     1261\section[Vertical diffusion term (\textit{dynzdf.F90})]{Vertical diffusion term (\protect\mdl{dynzdf})} 
    12461262\label{sec:DYN_zdf} 
    12471263%----------------------------------------------namzdf------------------------------------------------------ 
    12481264 
    1249 \nlst{namzdf}  
    12501265%------------------------------------------------------------------------------------------------------------- 
    12511266 
    1252 Options are defined through the \ngn{namzdf} namelist variables. 
     1267Options are defined through the \nam{zdf} namelist variables. 
    12531268The large vertical diffusion coefficient found in the surface mixed layer together with high vertical resolution implies that in the case of explicit time stepping there would be too restrictive a constraint on the time step. 
    12541269Two time stepping schemes can be used for the vertical diffusion term: 
    12551270$(a)$ a forward time differencing scheme 
    1256 (\np{ln\_zdfexp}\forcode{ = .true.}) using a time splitting technique (\np{nn\_zdfexp} $>$ 1) or 
    1257 $(b)$ a backward (or implicit) time differencing scheme (\np{ln\_zdfexp}\forcode{ = .false.}) 
    1258 (see \autoref{chap:STP}). 
    1259 Note that namelist variables \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics.  
     1271(\np{ln\_zdfexp}\forcode{=.true.}) using a time splitting technique (\np{nn\_zdfexp} $>$ 1) or 
     1272$(b)$ a backward (or implicit) time differencing scheme (\np{ln\_zdfexp}\forcode{=.false.}) 
     1273(see \autoref{chap:TD}). 
     1274Note that namelist variables \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics. 
    12601275 
    12611276The formulation of the vertical subgrid scale physics is the same whatever the vertical coordinate is. 
    1262 The vertical diffusion operators given by \autoref{eq:PE_zdf} take the following semi-discrete space form: 
    1263 \[ 
    1264   % \label{eq:dynzdf} 
     1277The vertical diffusion operators given by \autoref{eq:MB_zdf} take the following semi-discrete space form: 
     1278\[ 
     1279  % \label{eq:DYN_zdf} 
    12651280  \left\{ 
    12661281    \begin{aligned} 
     
    12801295the vertical turbulent momentum fluxes, 
    12811296\begin{equation} 
    1282   \label{eq:dynzdf_sbc} 
     1297  \label{eq:DYN_zdf_sbc} 
    12831298  \left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{z=1} 
    12841299  = \frac{1}{\rho_o} \binom{\tau_u}{\tau_v } 
     
    12861301where $\left( \tau_u ,\tau_v \right)$ are the two components of the wind stress vector in 
    12871302the (\textbf{i},\textbf{j}) coordinate system. 
    1288 The high mixing coefficients in the surface mixed layer ensure that the surface wind stress is distributed in  
     1303The high mixing coefficients in the surface mixed layer ensure that the surface wind stress is distributed in 
    12891304the vertical over the mixed layer depth. 
    12901305If the vertical mixing coefficient is small (when no mixed layer scheme is used) 
     
    12931308 
    12941309The turbulent flux of momentum at the bottom of the ocean is specified through a bottom friction parameterisation 
    1295 (see \autoref{sec:ZDF_bfr}) 
     1310(see \autoref{sec:ZDF_drg}) 
    12961311 
    12971312% ================================================================ 
     
    13031318Besides the surface and bottom stresses (see the above section) 
    13041319which are introduced as boundary conditions on the vertical mixing, 
    1305 three other forcings may enter the dynamical equations by affecting the surface pressure gradient.  
    1306  
    1307 (1) When \np{ln\_apr\_dyn}\forcode{ = .true.} (see \autoref{sec:SBC_apr}), 
     1320three other forcings may enter the dynamical equations by affecting the surface pressure gradient. 
     1321 
     1322(1) When \np{ln\_apr\_dyn}\forcode{=.true.} (see \autoref{sec:SBC_apr}), 
    13081323the atmospheric pressure is taken into account when computing the surface pressure gradient. 
    13091324 
    1310 (2) When \np{ln\_tide\_pot}\forcode{ = .true.} and \np{ln\_tide}\forcode{ = .true.} (see \autoref{sec:SBC_tide}), 
     1325(2) When \np{ln\_tide\_pot}\forcode{=.true.} and \np{ln\_tide}\forcode{=.true.} (see \autoref{sec:SBC_tide}), 
    13111326the tidal potential is taken into account when computing the surface pressure gradient. 
    13121327 
    1313 (3) When \np{nn\_ice\_embd}\forcode{ = 2} and LIM or CICE is used 
    1314 (\ie when the sea-ice is embedded in the ocean), 
     1328(3) When \np{nn\_ice\_embd}\forcode{=2} and LIM or CICE is used 
     1329(\ie\ when the sea-ice is embedded in the ocean), 
    13151330the snow-ice mass is taken into account when computing the surface pressure gradient. 
    13161331 
     
    13201335 
    13211336% ================================================================ 
    1322 % Wetting and drying  
     1337% Wetting and drying 
    13231338% ================================================================ 
    13241339\section{Wetting and drying } 
    13251340\label{sec:DYN_wetdry} 
     1341 
    13261342There are two main options for wetting and drying code (wd): 
    13271343(a) an iterative limiter (il) and (b) a directional limiter (dl). 
    1328 The directional limiter is based on the scheme developed by \cite{WarnerEtal13} for RO 
     1344The directional limiter is based on the scheme developed by \cite{warner.defne.ea_CG13} for RO 
    13291345MS 
    1330 which was in turn based on ideas developed for POM by \cite{Oey06}. The iterative 
     1346which was in turn based on ideas developed for POM by \cite{oey_OM06}. The iterative 
    13311347limiter is a new scheme.  The iterative limiter is activated by setting $\mathrm{ln\_wd\_il} = \mathrm{.true.}$ 
    13321348and $\mathrm{ln\_wd\_dl} = \mathrm{.false.}$. The directional limiter is activated 
    13331349by setting $\mathrm{ln\_wd\_dl} = \mathrm{.true.}$ and $\mathrm{ln\_wd\_il} = \mathrm{.false.}$. 
    13341350 
    1335 \nlst{namwad} 
     1351\begin{listing} 
     1352  \nlst{namwad} 
     1353  \caption{\texttt{namwad}} 
     1354  \label{lst:namwad} 
     1355\end{listing} 
    13361356 
    13371357The following terminology is used. The depth of the topography (positive downwards) 
    1338 at each $(i,j)$ point is the quantity stored in array $\mathrm{ht\_wd}$ in the NEMO code. 
     1358at each $(i,j)$ point is the quantity stored in array $\mathrm{ht\_wd}$ in the \NEMO\ code. 
    13391359The height of the free surface (positive upwards) is denoted by $ \mathrm{ssh}$. Given the sign 
    13401360conventions used, the water depth, $h$, is the height of the free surface plus the depth of the 
     
    13441364covered by water. They require the topography specified with a model 
    13451365configuration to have negative depths at points where the land is higher than the 
    1346 topography's reference sea-level. The vertical grid in NEMO is normally computed relative to an 
     1366topography's reference sea-level. The vertical grid in \NEMO\ is normally computed relative to an 
    13471367initial state with zero sea surface height elevation. 
    13481368The user can choose to compute the vertical grid and heights in the model relative to 
     
    13631383All these configurations have used pure sigma coordinates. It is expected that 
    13641384the wetting and drying code will work in domains with more general s-coordinates provided 
    1365 the coordinates are pure sigma in the region where wetting and drying actually occurs.  
     1385the coordinates are pure sigma in the region where wetting and drying actually occurs. 
    13661386 
    13671387The next sub-section descrbies the directional limiter and the following sub-section the iterative limiter. 
     
    13721392%   Iterative limiters 
    13731393%----------------------------------------------------------------------------------------- 
    1374 \subsection   [Directional limiter (\textit{wet\_dry})] 
    1375          {Directional limiter (\mdl{wet\_dry})} 
     1394\subsection[Directional limiter (\textit{wet\_dry.F90})]{Directional limiter (\mdl{wet\_dry})} 
    13761395\label{subsec:DYN_wd_directional_limiter} 
     1396 
    13771397The principal idea of the directional limiter is that 
    1378 water should not be allowed to flow out of a dry tracer cell (i.e. one whose water depth is less than rn\_wdmin1). 
     1398water should not be allowed to flow out of a dry tracer cell (i.e. one whose water depth is less than \np{rn\_wdmin1}). 
    13791399 
    13801400All the changes associated with this option are made to the barotropic solver for the non-linear 
     
    13861406 
    13871407The flux across each $u$-face of a tracer cell is multiplied by a factor zuwdmask (an array which depends on ji and jj). 
    1388 If the user sets ln\_wd\_dl\_ramp = .False. then zuwdmask is 1 when the 
    1389 flux is from a cell with water depth greater than rn\_wdmin1 and 0 otherwise. If the user sets 
    1390 ln\_wd\_dl\_ramp = .True. the flux across the face is ramped down as the water depth decreases 
    1391 from 2 * rn\_wdmin1 to rn\_wdmin1. The use of this ramp reduced grid-scale noise in idealised test cases. 
     1408If the user sets \np{ln\_wd\_dl\_ramp}\forcode{=.false.} then zuwdmask is 1 when the 
     1409flux is from a cell with water depth greater than \np{rn\_wdmin1} and 0 otherwise. If the user sets 
     1410\np{ln\_wd\_dl\_ramp}\forcode{=.true.} the flux across the face is ramped down as the water depth decreases 
     1411from 2 * \np{rn\_wdmin1} to \np{rn\_wdmin1}. The use of this ramp reduced grid-scale noise in idealised test cases. 
    13921412 
    13931413At the point where the flux across a $u$-face is multiplied by zuwdmask , we have chosen 
     
    14001420 
    14011421 
    1402 \cite{WarnerEtal13} state that in their scheme the velocity masks at the cell faces for the baroclinic 
     1422\cite{warner.defne.ea_CG13} state that in their scheme the velocity masks at the cell faces for the baroclinic 
    14031423timesteps are set to 0 or 1 depending on whether the average of the masks over the barotropic sub-steps is respectively less than 
    14041424or greater than 0.5. That scheme does not conserve tracers in integrations started from constant tracer 
    14051425fields (tracers independent of $x$, $y$ and $z$). Our scheme conserves constant tracers because 
    14061426the velocities used at the tracer cell faces on the baroclinic timesteps are carefully calculated by dynspg\_ts 
    1407 to equal their mean value during the barotropic steps. If the user sets ln\_wd\_dl\_bc = .True., the 
    1408 baroclinic velocities are also multiplied by a suitably weighted average of zuwdmask.   
     1427to equal their mean value during the barotropic steps. If the user sets \np{ln\_wd\_dl\_bc}\forcode{=.true.}, the 
     1428baroclinic velocities are also multiplied by a suitably weighted average of zuwdmask. 
    14091429 
    14101430%----------------------------------------------------------------------------------------- 
     
    14121432%----------------------------------------------------------------------------------------- 
    14131433 
    1414 \subsection   [Iterative limiter (\textit{wet\_dry})] 
    1415          {Iterative limiter (\mdl{wet\_dry})} 
     1434\subsection[Iterative limiter (\textit{wet\_dry.F90})]{Iterative limiter (\mdl{wet\_dry})} 
    14161435\label{subsec:DYN_wd_iterative_limiter} 
    14171436 
    1418 \subsubsection [Iterative flux limiter (\textit{wet\_dry})] 
    1419          {Iterative flux limiter (\mdl{wet\_dry})} 
    1420 \label{subsubsec:DYN_wd_il_spg_limiter} 
     1437\subsubsection[Iterative flux limiter (\textit{wet\_dry.F90})]{Iterative flux limiter (\mdl{wet\_dry})} 
     1438\label{subsec:DYN_wd_il_spg_limiter} 
    14211439 
    14221440The iterative limiter modifies the fluxes across the faces of cells that are either already ``dry'' 
     
    14261444 
    14271445The continuity equation for the total water depth in a column 
    1428 \begin{equation} \label{dyn_wd_continuity} 
    1429  \frac{\partial h}{\partial t} + \mathbf{\nabla.}(h\mathbf{u}) = 0 . 
     1446\begin{equation} 
     1447  \label{eq:DYN_wd_continuity} 
     1448  \frac{\partial h}{\partial t} + \mathbf{\nabla.}(h\mathbf{u}) = 0 . 
    14301449\end{equation} 
    14311450can be written in discrete form  as 
    14321451 
    1433 \begin{align} \label{dyn_wd_continuity_2} 
    1434 \frac{e_1 e_2}{\Delta t} ( h_{i,j}(t_{n+1}) - h_{i,j}(t_e) )  
    1435 &= - ( \mathrm{flxu}_{i+1,j} - \mathrm{flxu}_{i,j}  + \mathrm{flxv}_{i,j+1} - \mathrm{flxv}_{i,j} ) \\ 
    1436 &= \mathrm{zzflx}_{i,j} . 
     1452\begin{align} 
     1453  \label{eq:DYN_wd_continuity_2} 
     1454  \frac{e_1 e_2}{\Delta t} ( h_{i,j}(t_{n+1}) - h_{i,j}(t_e) ) 
     1455  &= - ( \mathrm{flxu}_{i+1,j} - \mathrm{flxu}_{i,j}  + \mathrm{flxv}_{i,j+1} - \mathrm{flxv}_{i,j} ) \\ 
     1456  &= \mathrm{zzflx}_{i,j} . 
    14371457\end{align} 
    14381458 
     
    14471467(zzflxp) and fluxes that are into the cell (zzflxn).  Clearly 
    14481468 
    1449 \begin{equation} \label{dyn_wd_zzflx_p_n_1} 
    1450 \mathrm{zzflx}_{i,j} = \mathrm{zzflxp}_{i,j} + \mathrm{zzflxn}_{i,j} .   
     1469\begin{equation} 
     1470  \label{eq:DYN_wd_zzflx_p_n_1} 
     1471  \mathrm{zzflx}_{i,j} = \mathrm{zzflxp}_{i,j} + \mathrm{zzflxn}_{i,j} . 
    14511472\end{equation} 
    14521473 
     
    14591480$\mathrm{zcoef}_{i,j}^{(m)}$ such that: 
    14601481 
    1461 \begin{equation} \label{dyn_wd_continuity_coef} 
    1462 \begin{split} 
    1463 \mathrm{zzflxp}^{(m)}_{i,j} =& \mathrm{zcoef}_{i,j}^{(m)} \mathrm{zzflxp}^{(0)}_{i,j} \\ 
    1464 \mathrm{zzflxn}^{(m)}_{i,j} =& \mathrm{zcoef}_{i,j}^{(m)} \mathrm{zzflxn}^{(0)}_{i,j} 
    1465 \end{split} 
     1482\begin{equation} 
     1483  \label{eq:DYN_wd_continuity_coef} 
     1484  \begin{split} 
     1485    \mathrm{zzflxp}^{(m)}_{i,j} =& \mathrm{zcoef}_{i,j}^{(m)} \mathrm{zzflxp}^{(0)}_{i,j} \\ 
     1486    \mathrm{zzflxn}^{(m)}_{i,j} =& \mathrm{zcoef}_{i,j}^{(m)} \mathrm{zzflxn}^{(0)}_{i,j} 
     1487  \end{split} 
    14661488\end{equation} 
    14671489 
     
    14711493The iteration is initialised by setting 
    14721494 
    1473 \begin{equation} \label{dyn_wd_zzflx_initial} 
    1474 \mathrm{zzflxp^{(0)}}_{i,j} = \mathrm{zzflxp}_{i,j} , \quad  \mathrm{zzflxn^{(0)}}_{i,j} = \mathrm{zzflxn}_{i,j} .  
     1495\begin{equation} 
     1496  \label{eq:DYN_wd_zzflx_initial} 
     1497  \mathrm{zzflxp^{(0)}}_{i,j} = \mathrm{zzflxp}_{i,j} , \quad  \mathrm{zzflxn^{(0)}}_{i,j} = \mathrm{zzflxn}_{i,j} . 
    14751498\end{equation} 
    14761499 
    14771500The fluxes out of cell $(i,j)$ are updated at the $m+1$th iteration if the depth of the 
    14781501cell on timestep $t_e$, namely $h_{i,j}(t_e)$, is less than the total flux out of the cell 
    1479 times the timestep divided by the cell area. Using (\ref{dyn_wd_continuity_2}) this 
     1502times the timestep divided by the cell area. Using (\autoref{eq:DYN_wd_continuity_2}) this 
    14801503condition is 
    14811504 
    1482 \begin{equation} \label{dyn_wd_continuity_if} 
    1483 h_{i,j}(t_e)  - \mathrm{rn\_wdmin1} <  \frac{\Delta t}{e_1 e_2} ( \mathrm{zzflxp}^{(m)}_{i,j} + \mathrm{zzflxn}^{(m)}_{i,j} ) . 
    1484 \end{equation} 
    1485  
    1486 Rearranging (\ref{dyn_wd_continuity_if}) we can obtain an expression for the maximum 
     1505\begin{equation} 
     1506  \label{eq:DYN_wd_continuity_if} 
     1507  h_{i,j}(t_e)  - \mathrm{rn\_wdmin1} <  \frac{\Delta t}{e_1 e_2} ( \mathrm{zzflxp}^{(m)}_{i,j} + \mathrm{zzflxn}^{(m)}_{i,j} ) . 
     1508\end{equation} 
     1509 
     1510Rearranging (\autoref{eq:DYN_wd_continuity_if}) we can obtain an expression for the maximum 
    14871511outward flux that can be allowed and still maintain the minimum wet depth: 
    14881512 
    1489 \begin{equation} \label{dyn_wd_max_flux} 
    1490 \begin{split} 
    1491 \mathrm{zzflxp}^{(m+1)}_{i,j} = \Big[ (h_{i,j}(t_e) & - \mathrm{rn\_wdmin1} - \mathrm{rn\_wdmin2})  \frac{e_1 e_2}{\Delta t} \phantom{]} \\ 
    1492 \phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big] 
    1493 \end{split} 
    1494 \end{equation} 
    1495  
    1496 Note a small tolerance ($\mathrm{rn\_wdmin2}$) has been introduced here {\it [Q: Why is 
    1497 this necessary/desirable?]}. Substituting from (\ref{dyn_wd_continuity_coef}) gives an 
     1513\begin{equation} 
     1514  \label{eq:DYN_wd_max_flux} 
     1515  \begin{split} 
     1516    \mathrm{zzflxp}^{(m+1)}_{i,j} = \Big[ (h_{i,j}(t_e) & - \mathrm{rn\_wdmin1} - \mathrm{rn\_wdmin2})  \frac{e_1 e_2}{\Delta t} \phantom{]} \\ 
     1517    \phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big] 
     1518  \end{split} 
     1519\end{equation} 
     1520 
     1521Note a small tolerance ($\mathrm{rn\_wdmin2}$) has been introduced here {\itshape [Q: Why is 
     1522this necessary/desirable?]}. Substituting from (\autoref{eq:DYN_wd_continuity_coef}) gives an 
    14981523expression for the coefficient needed to multiply the outward flux at this cell in order 
    14991524to avoid drying. 
    15001525 
    1501 \begin{equation} \label{dyn_wd_continuity_nxtcoef} 
    1502 \begin{split} 
    1503 \mathrm{zcoef}^{(m+1)}_{i,j} = \Big[ (h_{i,j}(t_e) & - \mathrm{rn\_wdmin1} - \mathrm{rn\_wdmin2})  \frac{e_1 e_2}{\Delta t} \phantom{]} \\ 
    1504 \phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big] \frac{1}{ \mathrm{zzflxp}^{(0)}_{i,j} }  
    1505 \end{split} 
     1526\begin{equation} 
     1527  \label{eq:DYN_wd_continuity_nxtcoef} 
     1528  \begin{split} 
     1529    \mathrm{zcoef}^{(m+1)}_{i,j} = \Big[ (h_{i,j}(t_e) & - \mathrm{rn\_wdmin1} - \mathrm{rn\_wdmin2})  \frac{e_1 e_2}{\Delta t} \phantom{]} \\ 
     1530    \phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big] \frac{1}{ \mathrm{zzflxp}^{(0)}_{i,j} } 
     1531  \end{split} 
    15061532\end{equation} 
    15071533 
     
    15221548%      Surface pressure gradients 
    15231549%---------------------------------------------------------------------------------------- 
    1524 \subsubsection   [Modification of surface pressure gradients (\textit{dynhpg})] 
    1525          {Modification of surface pressure gradients (\mdl{dynhpg})} 
    1526 \label{subsubsec:DYN_wd_il_spg} 
     1550\subsubsection[Modification of surface pressure gradients (\textit{dynhpg.F90})]{Modification of surface pressure gradients (\mdl{dynhpg})} 
     1551\label{subsec:DYN_wd_il_spg} 
    15271552 
    15281553At ``dry'' points the water depth is usually close to $\mathrm{rn\_wdmin1}$. If the 
     
    15371562neighbouring $(i+1,j)$ and $(i,j)$ tracer points.  zcpx is calculated using two logicals 
    15381563variables, $\mathrm{ll\_tmp1}$ and $\mathrm{ll\_tmp2}$ which are evaluated for each grid 
    1539 column.  The three possible combinations are illustrated in figure \ref{Fig_WAD_dynhpg}. 
     1564column.  The three possible combinations are illustrated in \autoref{fig:DYN_WAD_dynhpg}. 
    15401565 
    15411566%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    1542 \begin{figure}[!ht] \begin{center} 
    1543 \includegraphics[width=0.8\textwidth]{Fig_WAD_dynhpg} 
    1544 \caption{ \label{Fig_WAD_dynhpg} 
    1545 Illustrations of the three possible combinations of the logical variables controlling the 
    1546 limiting of the horizontal pressure gradient in wetting and drying regimes} 
    1547 \end{center}\end{figure} 
     1567\begin{figure}[!ht] 
     1568  \centering 
     1569  \includegraphics[width=\textwidth]{Fig_WAD_dynhpg} 
     1570  \caption[Combinations controlling the limiting of the horizontal pressure gradient in 
     1571  wetting and drying regimes]{ 
     1572    Three possible combinations of the logical variables controlling the 
     1573    limiting of the horizontal pressure gradient in wetting and drying regimes} 
     1574  \label{fig:DYN_WAD_dynhpg} 
     1575\end{figure} 
    15481576%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    15491577 
     
    15531581of the topography at the two points: 
    15541582 
    1555 \begin{equation} \label{dyn_ll_tmp1} 
    1556 \begin{split} 
    1557 \mathrm{ll\_tmp1}  = & \mathrm{MIN(sshn(ji,jj), sshn(ji+1,jj))} > \\ 
     1583\begin{equation} 
     1584  \label{eq:DYN_ll_tmp1} 
     1585  \begin{split} 
     1586    \mathrm{ll\_tmp1}  = & \mathrm{MIN(sshn(ji,jj), sshn(ji+1,jj))} > \\ 
    15581587                     & \quad \mathrm{MAX(-ht\_wd(ji,jj), -ht\_wd(ji+1,jj))\  .and.} \\ 
    1559 & \mathrm{MAX(sshn(ji,jj) + ht\_wd(ji,jj),} \\ 
    1560 & \mathrm{\phantom{MAX(}sshn(ji+1,jj) + ht\_wd(ji+1,jj))} >\\ 
    1561 & \quad\quad\mathrm{rn\_wdmin1 + rn\_wdmin2 } 
    1562 \end{split} 
     1588                     & \mathrm{MAX(sshn(ji,jj) + ht\_wd(ji,jj),} \\ 
     1589                     & \mathrm{\phantom{MAX(}sshn(ji+1,jj) + ht\_wd(ji+1,jj))} >\\ 
     1590                     & \quad\quad\mathrm{rn\_wdmin1 + rn\_wdmin2 } 
     1591  \end{split} 
    15631592\end{equation} 
    15641593 
     
    15671596at the two points plus $\mathrm{rn\_wdmin1} + \mathrm{rn\_wdmin2}$ 
    15681597 
    1569 \begin{equation} \label{dyn_ll_tmp2} 
    1570 \begin{split} 
    1571 \mathrm{ ll\_tmp2 } = & \mathrm{( ABS( sshn(ji,jj) - sshn(ji+1,jj) ) > 1.E-12 )\ .AND.}\\ 
    1572 & \mathrm{( MAX(sshn(ji,jj), sshn(ji+1,jj)) > } \\ 
    1573 & \mathrm{\phantom{(} MAX(-ht\_wd(ji,jj), -ht\_wd(ji+1,jj)) + rn\_wdmin1 + rn\_wdmin2}) . 
    1574 \end{split} 
     1598\begin{equation} 
     1599  \label{eq:DYN_ll_tmp2} 
     1600  \begin{split} 
     1601    \mathrm{ ll\_tmp2 } = & \mathrm{( ABS( sshn(ji,jj) - sshn(ji+1,jj) ) > 1.E-12 )\ .AND.}\\ 
     1602    & \mathrm{( MAX(sshn(ji,jj), sshn(ji+1,jj)) > } \\ 
     1603    & \mathrm{\phantom{(} MAX(-ht\_wd(ji,jj), -ht\_wd(ji+1,jj)) + rn\_wdmin1 + rn\_wdmin2}) . 
     1604  \end{split} 
    15751605\end{equation} 
    15761606 
     
    15881618conditions. 
    15891619 
    1590 \subsubsection   [Additional considerations (\textit{usrdef\_zgr})] 
    1591          {Additional considerations (\mdl{usrdef\_zgr})} 
    1592 \label{subsubsec:WAD_additional} 
     1620\subsubsection[Additional considerations (\textit{usrdef\_zgr.F90})]{Additional considerations (\mdl{usrdef\_zgr})} 
     1621\label{subsec:DYN_WAD_additional} 
    15931622 
    15941623In the very shallow water where wetting and drying occurs the parametrisation of 
     
    16031632%      The WAD test cases 
    16041633%---------------------------------------------------------------------------------------- 
    1605 \subsection   [The WAD test cases (\textit{usrdef\_zgr})] 
    1606          {The WAD test cases (\mdl{usrdef\_zgr})} 
    1607 \label{WAD_test_cases} 
     1634\subsection[The WAD test cases (\textit{usrdef\_zgr.F90})]{The WAD test cases (\mdl{usrdef\_zgr})} 
     1635\label{subsec:DYN_WAD_test_cases} 
    16081636 
    16091637See the WAD tests MY\_DOC documention for details of the WAD test cases. 
     
    16121640 
    16131641% ================================================================ 
    1614 % Time evolution term  
    1615 % ================================================================ 
    1616 \section{Time evolution term (\protect\mdl{dynnxt})} 
     1642% Time evolution term 
     1643% ================================================================ 
     1644\section[Time evolution term (\textit{dynnxt.F90})]{Time evolution term (\protect\mdl{dynnxt})} 
    16171645\label{sec:DYN_nxt} 
    16181646 
    16191647%----------------------------------------------namdom---------------------------------------------------- 
    16201648 
    1621 \nlst{namdom}  
    16221649%------------------------------------------------------------------------------------------------------------- 
    16231650 
    1624 Options are defined through the \ngn{namdom} namelist variables. 
     1651Options are defined through the \nam{dom} namelist variables. 
    16251652The general framework for dynamics time stepping is a leap-frog scheme, 
    1626 \ie a three level centred time scheme associated with an Asselin time filter (cf. \autoref{chap:STP}). 
     1653\ie\ a three level centred time scheme associated with an Asselin time filter (cf. \autoref{chap:TD}). 
    16271654The scheme is applied to the velocity, except when 
    16281655using the flux form of momentum advection (cf. \autoref{sec:DYN_adv_cor_flux}) 
    1629 in the variable volume case (\key{vvl} defined), 
    1630 where it has to be applied to the thickness weighted velocity (see \autoref{sec:A_momentum})   
     1656in the variable volume case (\texttt{vvl?} defined), 
     1657where it has to be applied to the thickness weighted velocity (see \autoref{sec:SCOORD_momentum}) 
    16311658 
    16321659$\bullet$ vector invariant form or linear free surface 
    1633 (\np{ln\_dynhpg\_vec}\forcode{ = .true.} ; \key{vvl} not defined): 
    1634 \[ 
    1635   % \label{eq:dynnxt_vec} 
     1660(\np{ln\_dynhpg\_vec}\forcode{=.true.} ; \texttt{vvl?} not defined): 
     1661\[ 
     1662  % \label{eq:DYN_nxt_vec} 
    16361663  \left\{ 
    16371664    \begin{aligned} 
     
    16431670 
    16441671$\bullet$ flux form and nonlinear free surface 
    1645 (\np{ln\_dynhpg\_vec}\forcode{ = .false.} ; \key{vvl} defined): 
    1646 \[ 
    1647   % \label{eq:dynnxt_flux} 
     1672(\np{ln\_dynhpg\_vec}\forcode{=.false.} ; \texttt{vvl?} defined): 
     1673\[ 
     1674  % \label{eq:DYN_nxt_flux} 
    16481675  \left\{ 
    16491676    \begin{aligned} 
     
    16571684the subscript $f$ denotes filtered values and $\gamma$ is the Asselin coefficient. 
    16581685$\gamma$ is initialized as \np{nn\_atfp} (namelist parameter). 
    1659 Its default value is \np{nn\_atfp}\forcode{ = 10.e-3}. 
     1686Its default value is \np{nn\_atfp}\forcode{=10.e-3}. 
    16601687In both cases, the modified Asselin filter is not applied since perfect conservation is not an issue for 
    16611688the momentum equations. 
Note: See TracChangeset for help on using the changeset viewer.