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 10368 for NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex – NEMO

Ignore:
Timestamp:
2018-12-03T12:45:01+01:00 (5 years ago)
Author:
smasson
Message:

dev_r10164_HPC09_ESIWACE_PREP_MERGE: merge with trunk@10365, see #2133

Location:
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/abstract_foreword.tex

    r9393 r10368  
    1111 
    1212{\small 
    13 The ocean engine of NEMO (Nucleus for European Modelling of the Ocean) is a primitive  
    14 equation model adapted to regional and global ocean circulation problems. It is intended to  
    15 be a flexible tool for studying the ocean and its interactions with the others components of  
    16 the earth climate system over a wide range of space and time scales.  
    17 Prognostic variables are the three-dimensional velocity field, a non-linear sea surface height,  
    18 the \textit{Conservative} Temperature and the \textit{Absolute} Salinity.  
    19 In the horizontal direction, the model uses a curvilinear orthogonal grid and in the vertical direction,  
    20 a full or partial step $z$-coordinate, or $s$-coordinate, or a mixture of the two.  
    21 The distribution of variables is a three-dimensional Arakawa C-type grid.  
    22 Various physical choices are available to describe ocean physics, including TKE, and GLS vertical physics.  
    23 Within NEMO, the ocean is interfaced with a sea-ice model (LIM or CICE), passive tracer and  
    24 biogeochemical models (TOP) and, via the OASIS coupler, with several atmospheric general circulation models.  
    25 It also support two-way grid embedding via the AGRIF software. 
     13  The ocean engine of NEMO (Nucleus for European Modelling of the Ocean) is a primitive equation model adapted to 
     14  regional and global ocean circulation problems. 
     15  It is intended to be a flexible tool for studying the ocean and its interactions with 
     16  the others components of the earth climate system over a wide range of space and time scales. 
     17  Prognostic variables are the three-dimensional velocity field, a non-linear sea surface height, 
     18  the \textit{Conservative} Temperature and the \textit{Absolute} Salinity. 
     19  In the horizontal direction, the model uses a curvilinear orthogonal grid and in the vertical direction, 
     20  a full or partial step $z$-coordinate, or $s$-coordinate, or a mixture of the two. 
     21  The distribution of variables is a three-dimensional Arakawa C-type grid. 
     22  Various physical choices are available to describe ocean physics, including TKE, and GLS vertical physics. 
     23  Within NEMO, the ocean is interfaced with a sea-ice model (LIM or CICE), 
     24  passive tracer and biogeochemical models (TOP) and, 
     25  via the OASIS coupler, with several atmospheric general circulation models. 
     26  It also support two-way grid embedding via the AGRIF software. 
    2627}  
    2728 
     
    3132\chapter*{Disclaimer} 
    3233 
    33 Like all components of NEMO, the ocean component is developed under the \href{http://www.cecill.info/}{CECILL license},  
    34 which is a French adaptation of the GNU GPL (General Public License). Anyone may use it  
    35 freely for research purposes, and is encouraged to communicate back to the NEMO team  
    36 its own developments and improvements. The model and the present document have been  
    37 made available as a service to the community. We cannot certify that the code and its manual  
    38 are free of errors. Bugs are inevitable and some have undoubtedly survived the testing phase.  
    39 Users are encouraged to bring them to our attention. The author assumes no responsibility  
    40 for problems, errors, or incorrect usage of NEMO. 
     34Like all components of NEMO, 
     35the ocean component is developed under the \href{http://www.cecill.info/}{CECILL license}, 
     36which is a French adaptation of the GNU GPL (General Public License). 
     37Anyone may use it freely for research purposes, 
     38and is encouraged to communicate back to the NEMO team its own developments and improvements. 
     39The model and the present document have been made available as a service to the community. 
     40We cannot certify that the code and its manual are free of errors. 
     41Bugs are inevitable and some have undoubtedly survived the testing phase. 
     42Users are encouraged to bring them to our attention. 
     43The author assumes no responsibility for problems, errors, or incorrect usage of NEMO. 
    4144 
    4245\vspace{1cm} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/annex_A.tex

    r9414 r10368  
    1919 
    2020In order to establish the set of Primitive Equation in curvilinear $s$-coordinates 
    21 ($i.e.$ an orthogonal curvilinear coordinate in the horizontal and an Arbitrary Lagrangian  
    22 Eulerian (ALE) coordinate in the vertical), we start from the set of equations established  
    23 in \autoref{subsec:PE_zco_Eq} for the special case $k = z$ and thus $e_3 = 1$, and we introduce  
    24 an arbitrary vertical coordinate $a = a(i,j,z,t)$. Let us define a new vertical scale factor by  
    25 $e_3 = \partial z / \partial s$ (which now depends on $(i,j,z,t)$) and the horizontal  
    26 slope of $s-$surfaces by : 
     21($i.e.$ an orthogonal curvilinear coordinate in the horizontal and 
     22an Arbitrary Lagrangian Eulerian (ALE) coordinate in the vertical), 
     23we start from the set of equations established in \autoref{subsec:PE_zco_Eq} for 
     24the special case $k = z$ and thus $e_3 = 1$, 
     25and we introduce an arbitrary vertical coordinate $a = a(i,j,z,t)$. 
     26Let us define a new vertical scale factor by $e_3 = \partial z / \partial s$ (which now depends on $(i,j,z,t)$) and 
     27the horizontal slope of $s-$surfaces by: 
    2728\begin{equation} \label{apdx:A_s_slope} 
    2829\sigma _1 =\frac{1}{e_1 }\;\left. {\frac{\partial z}{\partial i}} \right|_s  
     
    3132\end{equation} 
    3233 
    33 The chain rule to establish the model equations in the curvilinear $s-$coordinate  
    34 system is: 
     34The chain rule to establish the model equations in the curvilinear $s-$coordinate system is: 
    3535\begin{equation} \label{apdx:A_s_chain_rule} 
    3636\begin{aligned} 
     
    5252\end{equation} 
    5353 
    54 In particular applying the time derivative chain rule to $z$ provides the expression  
    55 for $w_s$,  the vertical velocity of the $s-$surfaces referenced to a fix z-coordinate: 
     54In particular applying the time derivative chain rule to $z$ provides the expression for $w_s$, 
     55the vertical velocity of the $s-$surfaces referenced to a fix z-coordinate: 
    5656\begin{equation} \label{apdx:A_w_in_s} 
    5757w_s   =  \left.   \frac{\partial z }{\partial t}   \right|_s  
     
    6767\label{sec:A_continuity} 
    6868 
    69 Using (\autoref{apdx:A_s_chain_rule}) and the fact that the horizontal scale factors  
    70 $e_1$ and $e_2$ do not depend on the vertical coordinate, the divergence of  
    71 the velocity relative to the ($i$,$j$,$z$) coordinate system is transformed as follows 
    72 in order to obtain its expression in the curvilinear $s-$coordinate system: 
     69Using (\autoref{apdx:A_s_chain_rule}) and 
     70the fact that the horizontal scale factors $e_1$ and $e_2$ do not depend on the vertical coordinate, 
     71the divergence of the velocity relative to the ($i$,$j$,$z$) coordinate system is transformed as follows in order to 
     72obtain its expression in the curvilinear $s-$coordinate system: 
    7373 
    7474\begin{subequations}  
     
    128128\end{subequations} 
    129129 
    130 Here, $w$ is the vertical velocity relative to the $z-$coordinate system.  
    131 Introducing the dia-surface velocity component, $\omega $, defined as  
    132 the volume flux across the moving $s$-surfaces per unit horizontal area: 
     130Here, $w$ is the vertical velocity relative to the $z-$coordinate system. 
     131Introducing the dia-surface velocity component, 
     132$\omega $, defined as the volume flux across the moving $s$-surfaces per unit horizontal area: 
    133133\begin{equation} \label{apdx:A_w_s} 
    134134\omega  = w - w_s - \sigma _1 \,u - \sigma _2 \,v    \\ 
    135135\end{equation} 
    136 with $w_s$ given by \autoref{apdx:A_w_in_s}, we obtain the expression for  
    137 the divergence of the velocity in the curvilinear $s-$coordinate system: 
     136with $w_s$ given by \autoref{apdx:A_w_in_s}, 
     137we obtain the expression for the divergence of the velocity in the curvilinear $s-$coordinate system: 
    138138\begin{subequations}  
    139139\begin{align*} {\begin{array}{*{20}l}  
     
    167167\end{subequations} 
    168168 
    169 As a result, the continuity equation \autoref{eq:PE_continuity} in the  
    170 $s-$coordinates is: 
     169As a result, the continuity equation \autoref{eq:PE_continuity} in the $s-$coordinates is: 
    171170\begin{equation} \label{apdx:A_sco_Continuity} 
    172171\frac{1}{e_3 } \frac{\partial e_3}{\partial t}  
     
    176175 +\frac{1}{e_3 }\frac{\partial \omega }{\partial s} = 0    
    177176\end{equation} 
    178 A additional term has appeared that take into account the contribution of the time variation  
    179 of the vertical coordinate to the volume budget. 
     177A additional term has appeared that take into account 
     178the contribution of the time variation of the vertical coordinate to the volume budget. 
    180179 
    181180 
     
    186185\label{sec:A_momentum} 
    187186 
    188 Here we only consider the first component of the momentum equation,  
     187Here we only consider the first component of the momentum equation, 
    189188the generalization to the second one being straightforward. 
    190189 
     
    193192$\bullet$ \textbf{Total derivative in vector invariant form} 
    194193 
    195 Let us consider \autoref{eq:PE_dyn_vect}, the first component of the momentum  
    196 equation in the vector invariant form. Its total $z-$coordinate time derivative,  
    197 $\left. \frac{D u}{D t} \right|_z$ can be transformed as follows in order to obtain  
     194Let us consider \autoref{eq:PE_dyn_vect}, the first component of the momentum equation in the vector invariant form. 
     195Its total $z-$coordinate time derivative, 
     196$\left. \frac{D u}{D t} \right|_z$ can be transformed as follows in order to obtain 
    198197its expression in the curvilinear $s-$coordinate system: 
    199198 
     
    258257\end{subequations} 
    259258% 
    260 Applying the time derivative chain rule (first equation of (\autoref{apdx:A_s_chain_rule})) 
    261 to $u$ and using (\autoref{apdx:A_w_in_s}) provides the expression of the last term  
    262 of the right hand side, 
     259Applying the time derivative chain rule (first equation of (\autoref{apdx:A_s_chain_rule})) to $u$ and 
     260using (\autoref{apdx:A_w_in_s}) provides the expression of the last term of the right hand side, 
    263261\begin{equation*} {\begin{array}{*{20}l}  
    264262w_s  \;\frac{\partial u}{\partial s}  
     
    267265\end{array} }      
    268266\end{equation*} 
    269 leads to the $s-$coordinate formulation of the total $z-$coordinate time derivative,  
     267leads to the $s-$coordinate formulation of the total $z-$coordinate time derivative, 
    270268$i.e.$ the total $s-$coordinate time derivative : 
    271269\begin{align} \label{apdx:A_sco_Dt_vect} 
     
    276274  + \frac{1}{e_3 } \omega \;\frac{\partial u}{\partial s}    
    277275\end{align} 
    278 Therefore, the vector invariant form of the total time derivative has exactly the same  
    279 mathematical form in $z-$ and $s-$coordinates. This is not the case for the flux form 
    280 as shown in next paragraph. 
     276Therefore, the vector invariant form of the total time derivative has exactly the same mathematical form in 
     277$z-$ and $s-$coordinates. 
     278This is not the case for the flux form as shown in next paragraph. 
    281279 
    282280$\ $\newline    % force a new ligne 
     
    284282$\bullet$ \textbf{Total derivative in flux form} 
    285283 
    286 Let us start from the total time derivative in the curvilinear $s-$coordinate system  
    287 we have just establish. Following the procedure used to establish (\autoref{eq:PE_flux_form}),  
    288 it can be transformed into : 
     284Let us start from the total time derivative in the curvilinear $s-$coordinate system we have just establish. 
     285Following the procedure used to establish (\autoref{eq:PE_flux_form}), it can be transformed into : 
    289286%\begin{subequations}  
    290287\begin{align*} {\begin{array}{*{20}l}  
     
    355352\end{subequations} 
    356353which leads to the $s-$coordinate flux formulation of the total $s-$coordinate time derivative,  
    357 $i.e.$ the total $s-$coordinate time derivative in flux form : 
     354$i.e.$ the total $s-$coordinate time derivative in flux form: 
    358355\begin{flalign}\label{apdx:A_sco_Dt_flux} 
    359356\left. \frac{D u}{D t} \right|_s   = \frac{1}{e_3}  \left. \frac{\partial ( e_3\,u)}{\partial t} \right|_s   
     
    363360\end{flalign} 
    364361which is the total time derivative expressed in the curvilinear $s-$coordinate system. 
    365 It has the same form as in the $z-$coordinate but for the vertical scale factor  
    366 that has appeared inside the time derivative which comes from the modification  
    367 of (\autoref{apdx:A_sco_Continuity}), the continuity equation. 
     362It has the same form as in the $z-$coordinate but for 
     363the vertical scale factor that has appeared inside the time derivative which 
     364comes from the modification of (\autoref{apdx:A_sco_Continuity}), 
     365the continuity equation. 
    368366 
    369367$\ $\newline    % force a new ligne 
     
    380378\end{split} 
    381379\end{equation*} 
    382 Applying similar manipulation to the second component and replacing  
    383 $\sigma _1$ and $\sigma _2$ by their expression \autoref{apdx:A_s_slope}, it comes: 
     380Applying similar manipulation to the second component and 
     381replacing $\sigma _1$ and $\sigma _2$ by their expression \autoref{apdx:A_s_slope}, it comes: 
    384382\begin{equation} \label{apdx:A_grad_p_1} 
    385383\begin{split} 
     
    394392\end{equation} 
    395393 
    396 An additional term appears in (\autoref{apdx:A_grad_p_1}) which accounts for the  
    397 tilt of $s-$surfaces with respect to geopotential $z-$surfaces. 
    398  
    399 As in $z$-coordinate, the horizontal pressure gradient can be split in two parts 
    400 following \citet{Marsaleix_al_OM08}. Let defined a density anomaly, $d$, by $d=(\rho - \rho_o)/ \rho_o$, 
    401 and a hydrostatic pressure anomaly, $p_h'$, by $p_h'= g \; \int_z^\eta d \; e_3 \; dk$.  
     394An additional term appears in (\autoref{apdx:A_grad_p_1}) which accounts for 
     395the tilt of $s-$surfaces with respect to geopotential $z-$surfaces. 
     396 
     397As in $z$-coordinate, 
     398the horizontal pressure gradient can be split in two parts following \citet{Marsaleix_al_OM08}. 
     399Let defined a density anomaly, $d$, by $d=(\rho - \rho_o)/ \rho_o$, 
     400and a hydrostatic pressure anomaly, $p_h'$, by $p_h'= g \; \int_z^\eta d \; e_3 \; dk$. 
    402401The pressure is then given by: 
    403402\begin{equation*}  
     
    416415\end{equation*} 
    417416 
    418 Substituing \autoref{apdx:A_pressure} in \autoref{apdx:A_grad_p_1} and using the definition of  
    419 the density anomaly it comes the expression in two parts: 
     417Substituing \autoref{apdx:A_pressure} in \autoref{apdx:A_grad_p_1} and 
     418using the definition of the density anomaly it comes the expression in two parts: 
    420419\begin{equation} \label{apdx:A_grad_p_2} 
    421420\begin{split} 
     
    429428\end{split} 
    430429\end{equation} 
    431 This formulation of the pressure gradient is characterised by the appearance of a term depending on the  
    432 the sea surface height only (last term on the right hand side of expression \autoref{apdx:A_grad_p_2}). 
    433 This term will be loosely termed \textit{surface pressure gradient} 
    434 whereas the first term will be termed the  
    435 \textit{hydrostatic pressure gradient} by analogy to the $z$-coordinate formulation.  
    436 In fact, the the true surface pressure gradient is $1/\rho_o \nabla (\rho \eta)$, and  
    437 $\eta$ is implicitly included in the computation of $p_h'$ through the upper bound of  
    438 the vertical integration. 
    439   
     430This formulation of the pressure gradient is characterised by the appearance of 
     431a term depending on the sea surface height only 
     432(last term on the right hand side of expression \autoref{apdx:A_grad_p_2}). 
     433This term will be loosely termed \textit{surface pressure gradient} whereas 
     434the first term will be termed the \textit{hydrostatic pressure gradient} by analogy to 
     435the $z$-coordinate formulation. 
     436In fact, the true surface pressure gradient is $1/\rho_o \nabla (\rho \eta)$, 
     437and $\eta$ is implicitly included in the computation of $p_h'$ through the upper bound of the vertical integration. 
     438 
    440439 
    441440$\ $\newline    % force a new ligne 
     
    443442$\bullet$ \textbf{The other terms of the momentum equation} 
    444443 
    445 The coriolis and forcing terms as well as the the vertical physics remain unchanged  
    446 as they involve neither time nor space derivatives. The form of the lateral physics is  
    447 discussed in \autoref{apdx:B}. 
     444The coriolis and forcing terms as well as the the vertical physics remain unchanged as 
     445they involve neither time nor space derivatives. 
     446The form of the lateral physics is discussed in \autoref{apdx:B}. 
    448447 
    449448 
     
    452451$\bullet$ \textbf{Full momentum equation} 
    453452 
    454 To sum up, in a curvilinear $s$-coordinate system, the vector invariant momentum equation  
    455 solved by the model has the same mathematical expression as the one in a curvilinear  
    456 $z-$coordinate, except for the pressure gradient term : 
     453To sum up, in a curvilinear $s$-coordinate system, 
     454the vector invariant momentum equation solved by the model has the same mathematical expression as 
     455the one in a curvilinear $z-$coordinate, except for the pressure gradient term: 
    457456\begin{subequations} \label{apdx:A_dyn_vect} 
    458457\begin{multline} \label{apdx:A_PE_dyn_vect_u} 
     
    475474\end{multline} 
    476475\end{subequations} 
    477 whereas the flux form momentum equation differ from it by the formulation of both 
    478 the time derivative and the pressure gradient term  : 
     476whereas the flux form momentum equation differs from it by 
     477the formulation of both the time derivative and the pressure gradient term: 
    479478\begin{subequations} \label{apdx:A_dyn_flux} 
    480479\begin{multline} \label{apdx:A_PE_dyn_flux_u} 
     
    503502\end{equation} 
    504503 
    505 It is important to realize that the change in coordinate system has only concerned 
    506 the position on the vertical. It has not affected (\textbf{i},\textbf{j},\textbf{k}), the  
    507 orthogonal curvilinear set of unit vectors. ($u$,$v$) are always horizontal velocities 
    508 so that their evolution is driven by \emph{horizontal} forces, in particular  
    509 the pressure gradient. By contrast, $\omega$ is not $w$, the third component of the velocity, 
    510 but the dia-surface velocity component, $i.e.$ the volume flux across the moving  
    511 $s$-surfaces per unit horizontal area.  
     504It is important to realize that the change in coordinate system has only concerned the position on the vertical. 
     505It has not affected (\textbf{i},\textbf{j},\textbf{k}), the orthogonal curvilinear set of unit vectors. 
     506($u$,$v$) are always horizontal velocities so that their evolution is driven by \emph{horizontal} forces, 
     507in particular the pressure gradient. 
     508By contrast, $\omega$ is not $w$, the third component of the velocity, but the dia-surface velocity component, 
     509$i.e.$ the volume flux across the moving $s$-surfaces per unit horizontal area.  
    512510 
    513511 
     
    518516\label{sec:A_tracer} 
    519517 
    520 The tracer equation is obtained using the same calculation as for the continuity  
    521 equation and then regrouping the time derivative terms in the left hand side : 
     518The tracer equation is obtained using the same calculation as for the continuity equation and then 
     519regrouping the time derivative terms in the left hand side : 
    522520 
    523521\begin{multline} \label{apdx:A_tracer} 
     
    531529 
    532530 
    533 The expression for the advection term is a straight consequence of (A.4), the  
    534 expression of the 3D divergence in the $s-$coordinates established above.  
     531The expression for the advection term is a straight consequence of (A.4), 
     532the expression of the 3D divergence in the $s-$coordinates established above.  
    535533 
    536534\end{document} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/annex_B.tex

    r9407 r10368  
    1919 
    2020\subsubsection*{In z-coordinates} 
    21 In $z$-coordinates, the horizontal/vertical second order tracer diffusion operator 
    22 is given by: 
     21In $z$-coordinates, the horizontal/vertical second order tracer diffusion operator is given by: 
    2322\begin{eqnarray} \label{apdx:B1} 
    2423 &D^T = \frac{1}{e_1 \, e_2}      \left[ 
     
    3029 
    3130\subsubsection*{In generalized vertical coordinates} 
    32 In $s$-coordinates, we defined the slopes of $s$-surfaces, $\sigma_1$ and 
    33 $\sigma_2$ by \autoref{apdx:A_s_slope} and the vertical/horizontal ratio of diffusion 
    34 coefficient by $\epsilon = A^{vT} / A^{lT}$. The diffusion operator is given by: 
     31In $s$-coordinates, we defined the slopes of $s$-surfaces, $\sigma_1$ and $\sigma_2$ by \autoref{apdx:A_s_slope} and 
     32the vertical/horizontal ratio of diffusion coefficient by $\epsilon = A^{vT} / A^{lT}$. 
     33The diffusion operator is given by: 
    3534 
    3635\begin{equation} \label{apdx:B2} 
     
    5655\end{subequations} 
    5756 
    58 Equation \autoref{apdx:B2} is obtained from \autoref{apdx:B1} without any 
    59 additional assumption. Indeed, for the special case $k=z$ and thus $e_3 =1$, 
    60 we introduce an arbitrary vertical coordinate $s = s (i,j,z)$ as in \autoref{apdx:A} 
    61 and use \autoref{apdx:A_s_slope} and \autoref{apdx:A_s_chain_rule}. 
    62 Since no cross horizontal derivative $\partial _i \partial _j $ appears in 
    63 \autoref{apdx:B1}, the ($i$,$z$) and ($j$,$z$) planes are independent. 
    64 The derivation can then be demonstrated for the ($i$,$z$)~$\to$~($j$,$s$) 
    65 transformation without any loss of generality: 
     57Equation \autoref{apdx:B2} is obtained from \autoref{apdx:B1} without any additional assumption. 
     58Indeed, for the special case $k=z$ and thus $e_3 =1$, 
     59we introduce an arbitrary vertical coordinate $s = s (i,j,z)$ as in \autoref{apdx:A} and 
     60use \autoref{apdx:A_s_slope} and \autoref{apdx:A_s_chain_rule}. 
     61Since no cross horizontal derivative $\partial _i \partial _j $ appears in \autoref{apdx:B1}, 
     62the ($i$,$z$) and ($j$,$z$) planes are independent. 
     63The derivation can then be demonstrated for the ($i$,$z$)~$\to$~($j$,$s$) transformation without 
     64any loss of generality: 
    6665 
    6766\begin{subequations} 
     
    143142\subsubsection*{In z-coordinates} 
    144143 
    145 The iso/diapycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in the ($i$,$j$,$k$) 
    146 curvilinear coordinate system in which the equations of the ocean circulation model are 
    147 formulated, takes the following form \citep{Redi_JPO82}: 
     144The iso/diapycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in 
     145the ($i$,$j$,$k$) curvilinear coordinate system in which 
     146the equations of the ocean circulation model are formulated, 
     147takes the following form \citep{Redi_JPO82}: 
    148148 
    149149\begin{equation} \label{apdx:B3} 
     
    155155\end{array} }} \right] 
    156156\end{equation} 
    157 where ($a_1$, $a_2$) are the isopycnal slopes in ($\textbf{i}$, 
    158 $\textbf{j}$) directions, relative to geopotentials: 
     157where ($a_1$, $a_2$) are the isopycnal slopes in ($\textbf{i}$, $\textbf{j}$) directions, relative to geopotentials: 
    159158\begin{equation*} 
    160159a_1 =\frac{e_3 }{e_1 }\left( {\frac{\partial \rho }{\partial i}} \right)\left( {\frac{\partial \rho }{\partial k}} \right)^{-1} 
     
    164163\end{equation*} 
    165164 
    166 In practice, isopycnal slopes are generally less than $10^{-2}$ in the ocean, so 
    167 $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{Cox1987}: 
     165In practice, isopycnal slopes are generally less than $10^{-2}$ in the ocean, 
     166so $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{Cox1987}: 
    168167\begin{subequations} \label{apdx:B4} 
    169168\begin{equation} \label{apdx:B4a} 
     
    183182 
    184183 
    185 Physically, the full tensor \autoref{apdx:B3} 
    186 represents strong isoneutral diffusion on a plane parallel to the isoneutral 
    187 surface and weak dianeutral diffusion perpendicular to this plane. 
    188 However, the approximate `weak-slope' tensor \autoref{apdx:B4a} represents strong 
    189 diffusion along the isoneutral surface, with weak 
    190 \emph{vertical}  diffusion -- the principal axes of the tensor are no 
    191 longer orthogonal. This simplification also decouples 
    192 the ($i$,$z$) and ($j$,$z$) planes of the tensor. The weak-slope operator therefore takes the same 
    193 form, \autoref{apdx:B4}, as \autoref{apdx:B2}, the diffusion operator for geopotential 
    194 diffusion written in non-orthogonal $i,j,s$-coordinates. Written out 
    195 explicitly, 
     184Physically, the full tensor \autoref{apdx:B3} represents strong isoneutral diffusion on a plane parallel to 
     185the isoneutral surface and weak dianeutral diffusion perpendicular to this plane. 
     186However, 
     187the approximate `weak-slope' tensor \autoref{apdx:B4a} represents strong diffusion along the isoneutral surface, 
     188with weak \emph{vertical} diffusion -- the principal axes of the tensor are no longer orthogonal. 
     189This simplification also decouples the ($i$,$z$) and ($j$,$z$) planes of the tensor. 
     190The weak-slope operator therefore takes the same form, \autoref{apdx:B4}, as \autoref{apdx:B2}, 
     191the diffusion operator for geopotential diffusion written in non-orthogonal $i,j,s$-coordinates. 
     192Written out explicitly, 
    196193 
    197194\begin{multline} \label{apdx:B_ldfiso} 
     
    204201 
    205202The isopycnal diffusion operator \autoref{apdx:B4}, 
    206 \autoref{apdx:B_ldfiso} conserves tracer quantity and dissipates its 
    207 square. The demonstration of the first property is trivial as \autoref{apdx:B4} is the divergence 
    208 of fluxes. Let us demonstrate the second one: 
     203\autoref{apdx:B_ldfiso} conserves tracer quantity and dissipates its square. 
     204The demonstration of the first property is trivial as \autoref{apdx:B4} is the divergence of fluxes. 
     205Let us demonstrate the second one: 
    209206\begin{equation*} 
    210207\iiint\limits_D T\;\nabla .\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv 
     
    229226\end{subequations} 
    230227\addtocounter{equation}{-1} 
    231  the property becomes obvious. 
     228the property becomes obvious. 
    232229 
    233230\subsubsection*{In generalized vertical coordinates} 
    234231 
    235 Because the weak-slope operator \autoref{apdx:B4}, \autoref{apdx:B_ldfiso} is decoupled 
    236 in the ($i$,$z$) and ($j$,$z$) planes, it may be transformed into 
    237 generalized $s$-coordinates in the same way as \autoref{sec:B_1} was transformed into 
    238 \autoref{sec:B_2}. The resulting operator then takes the simple form 
     232Because the weak-slope operator \autoref{apdx:B4}, 
     233\autoref{apdx:B_ldfiso} is decoupled in the ($i$,$z$) and ($j$,$z$) planes, 
     234it may be transformed into generalized $s$-coordinates in the same way as 
     235\autoref{sec:B_1} was transformed into \autoref{sec:B_2}. 
     236The resulting operator then takes the simple form 
    239237 
    240238\begin{equation} \label{apdx:B_ldfiso_s} 
     
    249247\end{equation} 
    250248 
    251 where ($r_1$, $r_2$) are the isopycnal slopes in ($\textbf{i}$, 
    252 $\textbf{j}$) directions, relative to $s$-coordinate surfaces: 
     249where ($r_1$, $r_2$) are the isopycnal slopes in ($\textbf{i}$, $\textbf{j}$) directions, 
     250relative to $s$-coordinate surfaces: 
    253251\begin{equation*} 
    254252r_1 =\frac{e_3 }{e_1 }\left( {\frac{\partial \rho }{\partial i}} \right)\left( {\frac{\partial \rho }{\partial s}} \right)^{-1} 
     
    258256\end{equation*} 
    259257 
    260 To prove  \autoref{apdx:B5}  by direct re-expression of \autoref{apdx:B_ldfiso} is 
    261 straightforward, but laborious. An easier way is first to note (by reversing the 
    262 derivation of \autoref{sec:B_2} from \autoref{sec:B_1} ) that the 
    263 weak-slope operator may be \emph{exactly} reexpressed in  
    264 non-orthogonal $i,j,\rho$-coordinates as 
     258To prove \autoref{apdx:B5} by direct re-expression of \autoref{apdx:B_ldfiso} is straightforward, but laborious. 
     259An easier way is first to note (by reversing the derivation of \autoref{sec:B_2} from \autoref{sec:B_1} ) that 
     260the weak-slope operator may be \emph{exactly} reexpressed in non-orthogonal $i,j,\rho$-coordinates as 
    265261 
    266262\begin{equation} \label{apdx:B5} 
     
    273269\end{array} }} \right). 
    274270\end{equation} 
    275 Then direct transformation from $i,j,\rho$-coordinates to 
    276 $i,j,s$-coordinates gives \autoref{apdx:B_ldfiso_s} immediately. 
    277  
    278 Note that the weak-slope approximation is only made in 
    279 transforming from the (rotated,orthogonal) isoneutral axes to the 
    280 non-orthogonal $i,j,\rho$-coordinates. The further transformation 
    281 into $i,j,s$-coordinates is exact, whatever the steepness of 
    282 the  $s$-surfaces, in the same way as the transformation of 
    283 horizontal/vertical Laplacian diffusion in $z$-coordinates, 
     271Then direct transformation from $i,j,\rho$-coordinates to $i,j,s$-coordinates gives 
     272\autoref{apdx:B_ldfiso_s} immediately. 
     273 
     274Note that the weak-slope approximation is only made in transforming from 
     275the (rotated,orthogonal) isoneutral axes to the non-orthogonal $i,j,\rho$-coordinates. 
     276The further transformation into $i,j,s$-coordinates is exact, whatever the steepness of the $s$-surfaces, 
     277in the same way as the transformation of horizontal/vertical Laplacian diffusion in $z$-coordinates, 
    284278\autoref{sec:B_1} onto $s$-coordinates is exact, however steep the $s$-surfaces. 
    285279 
     
    291285\label{sec:B_3} 
    292286 
    293 The second order momentum diffusion operator (Laplacian) in the $z$-coordinate 
    294 is found by applying \autoref{eq:PE_lap_vector}, the expression for the Laplacian 
    295 of a vector,  to the horizontal velocity vector : 
     287The second order momentum diffusion operator (Laplacian) in the $z$-coordinate is found by 
     288applying \autoref{eq:PE_lap_vector}, the expression for the Laplacian of a vector, 
     289to the horizontal velocity vector: 
    296290\begin{align*} 
    297291\Delta {\textbf{U}}_h 
     
    329323\end{array} }} \right) 
    330324\end{align*} 
    331 Using \autoref{eq:PE_div}, the definition of the horizontal divergence, the third 
    332 componant of the second vector is obviously zero and thus : 
     325Using \autoref{eq:PE_div}, the definition of the horizontal divergence, 
     326the third componant of the second vector is obviously zero and thus : 
    333327\begin{equation*} 
    334328\Delta {\textbf{U}}_h = \nabla _h \left( \chi \right) - \nabla _h \times \left( \zeta \right) + \frac {1}{e_3 } \frac {\partial }{\partial k} \left( {\frac {1}{e_3 } \frac{\partial {\textbf{ U}}_h }{\partial k}} \right) 
    335329\end{equation*} 
    336330 
    337 Note that this operator ensures a full separation between the vorticity and horizontal 
    338 divergence fields (see \autoref{apdx:C}). It is only equal to a Laplacian 
    339 applied to each component in Cartesian coordinates, not on the sphere. 
    340  
    341 The horizontal/vertical second order (Laplacian type) operator used to diffuse 
    342 horizontal momentum in the $z$-coordinate therefore takes the following form : 
     331Note that this operator ensures a full separation between 
     332the vorticity and horizontal divergence fields (see \autoref{apdx:C}). 
     333It is only equal to a Laplacian applied to each component in Cartesian coordinates, not on the sphere. 
     334 
     335The horizontal/vertical second order (Laplacian type) operator used to diffuse horizontal momentum in 
     336the $z$-coordinate therefore takes the following form: 
    343337\begin{equation} \label{apdx:B_Lap_U} 
    344338 {\textbf{D}}^{\textbf{U}} = 
     
    360354\end{align*} 
    361355 
    362 Note Bene: introducing a rotation in \autoref{apdx:B_Lap_U} does not lead to a 
    363 useful expression for the iso/diapycnal Laplacian operator in the $z$-coordinate. 
    364 Similarly, we did not found an expression of practical use for the geopotential 
    365 horizontal/vertical Laplacian operator in the $s$-coordinate. Generally, 
    366 \autoref{apdx:B_Lap_U} is used in both $z$- and $s$-coordinate systems, that is 
    367 a Laplacian diffusion is applied on momentum along the coordinate directions. 
     356Note Bene: introducing a rotation in \autoref{apdx:B_Lap_U} does not lead to 
     357a useful expression for the iso/diapycnal Laplacian operator in the $z$-coordinate. 
     358Similarly, we did not found an expression of practical use for 
     359the geopotential horizontal/vertical Laplacian operator in the $s$-coordinate. 
     360Generally, \autoref{apdx:B_Lap_U} is used in both $z$- and $s$-coordinate systems, 
     361that is a Laplacian diffusion is applied on momentum along the coordinate directions. 
    368362\end{document} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/annex_C.tex

    r9414 r10368  
    2222\label{sec:C.0} 
    2323 
    24 Notation used in this appendix in the demonstations : 
     24Notation used in this appendix in the demonstations: 
    2525 
    2626fluxes at the faces of a $T$-box: 
     
    3737 
    3838$dv=e_1\,e_2\,e_3 \,di\,dj\,dk$  is the volume element, with only $e_3$ that depends on time. 
    39 $D$ and $S$ are the ocean domain volume and surface, respectively.  
    40 No wetting/drying is allow ($i.e.$ $\frac{\partial S}{\partial t} = 0$)  
    41 Let $k_s$ and $k_b$ be the ocean surface and bottom, resp.  
     39$D$ and $S$ are the ocean domain volume and surface, respectively. 
     40No wetting/drying is allow ($i.e.$ $\frac{\partial S}{\partial t} = 0$). 
     41Let $k_s$ and $k_b$ be the ocean surface and bottom, resp. 
    4242($i.e.$ $s(k_s) = \eta$ and $s(k_b)=-H$, where $H$ is the bottom depth). 
    4343\begin{flalign*} 
     
    6060                                                       =  \int_D { \frac{1}{e_3} \partial_t \left( e_3 \, Q \right) dv } =0 
    6161\end{equation*} 
    62 equation of evolution of $Q$ written as the time evolution of the vertical content of $Q$ 
    63 like for tracers, or momentum in flux form, the quadratic quantity $\frac{1}{2}Q^2$ is conserved when : 
     62equation of evolution of $Q$ written as 
     63the time evolution of the vertical content of $Q$ like for tracers, or momentum in flux form, 
     64the quadratic quantity $\frac{1}{2}Q^2$ is conserved when: 
    6465\begin{flalign*} 
    6566\partial_t \left(   \int_D{ \frac{1}{2} \,Q^2\;dv }   \right) 
     
    7475  -   \frac{1}{2} \int_D {  \frac{Q^2}{e_3} \partial_t (e_3) \;dv } 
    7576\end{flalign} 
    76 equation of evolution of $Q$ written as the time evolution of $Q$ 
    77 like for momentum in vector invariant form, the quadratic quantity $\frac{1}{2}Q^2$ is conserved when : 
     77equation of evolution of $Q$ written as the time evolution of $Q$ like for momentum in vector invariant form, 
     78the quadratic quantity $\frac{1}{2}Q^2$ is conserved when: 
    7879\begin{flalign*} 
    7980\partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) 
     
    8283+  \int_D { \frac{1}{2} Q^2 \, \partial_t e_3  \;e_1e_2\;di\,dj\,dk } \\ 
    8384\end{flalign*} 
    84 that is in a more compact form : 
     85that is in a more compact form: 
    8586\begin{flalign} \label{eq:Q2_vect} 
    8687\partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) 
     
    9798 
    9899 
    99 The discretization of pimitive equation in $s$-coordinate ($i.e.$ time and space varying  
    100 vertical coordinate) must be chosen so that the discrete equation of the model satisfy  
    101 integral constrains on energy and enstrophy.  
     100The discretization of pimitive equation in $s$-coordinate ($i.e.$ time and space varying vertical coordinate) 
     101must be chosen so that the discrete equation of the model satisfy integral constrains on energy and enstrophy.  
    102102 
    103103 
    104104Let us first establish those constraint in the continuous world. 
    105 The total energy ($i.e.$ kinetic plus potential energies) is conserved : 
     105The total energy ($i.e.$ kinetic plus potential energies) is conserved: 
    106106\begin{flalign} \label{eq:Tot_Energy} 
    107107  \partial_t \left( \int_D \left( \frac{1}{2} {\textbf{U}_h}^2 +  \rho \, g \, z \right) \;dv \right)  = & 0 
    108108\end{flalign} 
    109 under the following assumptions: no dissipation, no forcing  
    110 (wind, buoyancy flux, atmospheric pressure variations), mass  
    111 conservation, and closed domain.  
    112  
    113 This equation can be transformed to obtain several sub-equalities.  
    114 The transformation for the advection term depends on whether  
    115 the vector invariant form or the flux form is used for the momentum equation. 
    116 Using \autoref{eq:Q2_vect} and introducing \autoref{apdx:A_dyn_vect} in \autoref{eq:Tot_Energy}  
    117 for the former form and 
    118 Using \autoref{eq:Q2_flux} and introducing \autoref{apdx:A_dyn_flux} in \autoref{eq:Tot_Energy}  
    119 for the latter form  leads to: 
     109under the following assumptions: no dissipation, no forcing (wind, buoyancy flux, atmospheric pressure variations), 
     110mass conservation, and closed domain.  
     111 
     112This equation can be transformed to obtain several sub-equalities. 
     113The transformation for the advection term depends on whether the vector invariant form or 
     114the flux form is used for the momentum equation. 
     115Using \autoref{eq:Q2_vect} and introducing \autoref{apdx:A_dyn_vect} in 
     116\autoref{eq:Tot_Energy} for the former form and 
     117using \autoref{eq:Q2_flux} and introducing \autoref{apdx:A_dyn_flux} in 
     118\autoref{eq:Tot_Energy} for the latter form leads to: 
    120119 
    121120\begin{subequations} \label{eq:E_tot} 
     
    348347 
    349348Substituting the discrete expression of the time derivative of the velocity either in vector invariant, 
    350 leads to the discrete equivalent of the four equations \autoref{eq:E_tot_flux}.  
     349leads to the discrete equivalent of the four equations \autoref{eq:E_tot_flux}. 
    351350 
    352351% ------------------------------------------------------------------------------------------------------------- 
     
    356355\label{subsec:C_vor} 
    357356 
    358 Let $q$, located at $f$-points, be either the relative ($q=\zeta / e_{3f}$), or   
    359 the planetary ($q=f/e_{3f}$), or the total potential vorticity ($q=(\zeta +f) /e_{3f}$).  
    360 Two discretisation of the vorticity term (ENE and EEN) allows the conservation of  
    361 the kinetic energy. 
     357Let $q$, located at $f$-points, be either the relative ($q=\zeta / e_{3f}$), 
     358or the planetary ($q=f/e_{3f}$), or the total potential vorticity ($q=(\zeta +f) /e_{3f}$). 
     359Two discretisation of the vorticity term (ENE and EEN) allows the conservation of the kinetic energy. 
    362360% ------------------------------------------------------------------------------------------------------------- 
    363361%       Vorticity Term with ENE scheme 
     
    366364\label{subsec:C_vorENE}  
    367365 
    368 For the ENE scheme, the two components of the vorticity term are given by : 
     366For the ENE scheme, the two components of the vorticity term are given by: 
    369367\begin{equation*} 
    370368- e_3 \, q \;{\textbf{k}}\times {\textbf {U}}_h    \equiv  
     
    377375\end{equation*} 
    378376 
    379 This formulation does not conserve the enstrophy but it does conserve the  
    380 total kinetic energy. Indeed, the kinetic energy tendency associated to the  
    381 vorticity term and averaged over the ocean domain can be transformed as 
    382 follows: 
     377This formulation does not conserve the enstrophy but it does conserve the total kinetic energy. 
     378Indeed, the kinetic energy tendency associated to the vorticity term and 
     379averaged over the ocean domain can be transformed as follows: 
    383380\begin{flalign*} 
    384381&\int\limits_D -  \left(  e_3 \, q \;\textbf{k} \times \textbf{U}_h  \right) \cdot \textbf{U}_h  \;  dv &&  \\ 
     
    412409\end{aligned}   } \right. 
    413410\end{equation}  
    414 where the indices $i_p$ and $j_p$ take the following value:  
    415 $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$, 
     411where the indices $i_p$ and $j_p$ take the following value: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$, 
    416412and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by:  
    417413\begin{equation} \tag{\ref{eq:Q_triads}} 
     
    420416\end{equation} 
    421417 
    422 This formulation does conserve the total kinetic energy. Indeed, 
     418This formulation does conserve the total kinetic energy. 
     419Indeed, 
    423420\begin{flalign*} 
    424421&\int\limits_D - \textbf{U}_h \cdot   \left(  \zeta \;\textbf{k} \times \textbf{U}_h  \right)  \;  dv &&  \\ 
     
    473470\label{subsec:C_zad}  
    474471 
    475 The change of Kinetic Energy (KE) due to the vertical advection is exactly  
    476 balanced by the change of KE due to the horizontal gradient of KE~: 
     472The change of Kinetic Energy (KE) due to the vertical advection is exactly balanced by the change of KE due to the horizontal gradient of KE~: 
    477473\begin{equation*} 
    478474    \int_D \textbf{U}_h \cdot \frac{1}{e_3 } \omega \partial_k \textbf{U}_h \;dv 
     
    480476   +   \frac{1}{2} \int_D {  \frac{{\textbf{U}_h}^2}{e_3} \partial_t ( e_3) \;dv }  \\ 
    481477\end{equation*} 
    482 Indeed, using successively \autoref{eq:DOM_di_adj} ($i.e.$ the skew symmetry  
    483 property of the $\delta$ operator) and the continuity equation, then  
    484 \autoref{eq:DOM_di_adj} again, then the commutativity of operators  
    485 $\overline {\,\cdot \,}$ and $\delta$, and finally \autoref{eq:DOM_mi_adj}  
    486 ($i.e.$ the symmetry property of the $\overline {\,\cdot \,}$ operator)  
     478Indeed, using successively \autoref{eq:DOM_di_adj} ($i.e.$ the skew symmetry property of the $\delta$ operator) 
     479and the continuity equation, then \autoref{eq:DOM_di_adj} again, 
     480then the commutativity of operators $\overline {\,\cdot \,}$ and $\delta$, and finally \autoref{eq:DOM_mi_adj} 
     481($i.e.$ the symmetry property of the $\overline {\,\cdot \,}$ operator) 
    487482applied in the horizontal and vertical directions, it becomes: 
    488483\begin{flalign*} 
     
    543538\end{flalign*} 
    544539 
    545 There is two main points here. First, the satisfaction of this property links the choice of  
    546 the discrete formulation of the vertical advection and of the horizontal gradient  
    547 of KE. Choosing one imposes the other. For example KE can also be discretized  
    548 as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$. This leads to the following  
    549 expression for the vertical advection: 
     540There is two main points here. 
     541First, the satisfaction of this property links the choice of the discrete formulation of the vertical advection and 
     542of the horizontal gradient of KE. 
     543Choosing one imposes the other. 
     544For example KE can also be discretized as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$. 
     545This leads to the following expression for the vertical advection: 
    550546\begin{equation*} 
    551547\frac{1} {e_3 }\; \omega\; \partial_k \textbf{U}_h 
     
    557553\end{array}} } \right) 
    558554\end{equation*} 
    559 a formulation that requires an additional horizontal mean in contrast with  
    560 the one used in NEMO. Nine velocity points have to be used instead of 3.  
     555a formulation that requires an additional horizontal mean in contrast with the one used in NEMO. 
     556Nine velocity points have to be used instead of 3. 
    561557This is the reason why it has not been chosen. 
    562558 
    563 Second, as soon as the chosen $s$-coordinate depends on time, an extra constraint 
    564 arises on the time derivative of the volume at $u$- and $v$-points: 
     559Second, as soon as the chosen $s$-coordinate depends on time, 
     560an extra constraint arises on the time derivative of the volume at $u$- and $v$-points: 
    565561\begin{flalign*} 
    566562e_{1u}\,e_{2u}\,\partial_t (e_{3u}) =\overline{ e_{1t}\,e_{2t}\;\partial_t (e_{3t}) }^{\,i+1/2}    \\ 
     
    583579 
    584580\gmcomment{ 
    585 A pressure gradient has no contribution to the evolution of the vorticity as the  
    586 curl of a gradient is zero. In the $z$-coordinate, this property is satisfied locally  
    587 on a C-grid with 2nd order finite differences (property \autoref{eq:DOM_curl_grad}).  
     581  A pressure gradient has no contribution to the evolution of the vorticity as the curl of a gradient is zero. 
     582  In the $z$-coordinate, this property is satisfied locally on a C-grid with 2nd order finite differences 
     583  (property \autoref{eq:DOM_curl_grad}).  
    588584} 
    589585 
    590 When the equation of state is linear ($i.e.$ when an advection-diffusion equation  
    591 for density can be derived from those of temperature and salinity) the change of  
    592 KE due to the work of pressure forces is balanced by the change of potential  
    593 energy due to buoyancy forces:  
     586When the equation of state is linear 
     587($i.e.$ when an advection-diffusion equation for density can be derived from those of temperature and salinity) 
     588the change of KE due to the work of pressure forces is balanced by 
     589the change of potential energy due to buoyancy forces:  
    594590\begin{equation*} 
    595591- \int_D  \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv  
     
    598594\end{equation*} 
    599595 
    600 This property can be satisfied in a discrete sense for both $z$- and $s$-coordinates.  
    601 Indeed, defining the depth of a $T$-point, $z_t$, as the sum of the vertical scale  
    602 factors at $w$-points starting from the surface, the work of pressure forces can be  
    603 written as: 
     596This property can be satisfied in a discrete sense for both $z$- and $s$-coordinates. 
     597Indeed, defining the depth of a $T$-point, $z_t$, 
     598as the sum of the vertical scale factors at $w$-points starting from the surface, 
     599the work of pressure forces can be written as: 
    604600\begin{flalign*} 
    605601&- \int_D  \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv    
     
    658654\end{flalign*} 
    659655The first term is exactly the first term of the right-hand-side of \autoref{eq:KE+PE_vect_discrete}. 
    660 It remains to demonstrate that the last term, which is obviously a discrete analogue of  
    661 $\int_D \frac{p}{e_3} \partial_t (e_3)\;dv$ is equal to the last term of \autoref{eq:KE+PE_vect_discrete}. 
     656It remains to demonstrate that the last term, 
     657which is obviously a discrete analogue of $\int_D \frac{p}{e_3} \partial_t (e_3)\;dv$ is equal to 
     658the last term of \autoref{eq:KE+PE_vect_discrete}. 
    662659In other words, the following property must be satisfied: 
    663660\begin{flalign*} 
     
    666663\end{flalign*} 
    667664 
    668 Let introduce $p_w$ the pressure at $w$-point such that $\delta_k [p_w] = - \rho \,g\,e_{3t}$.  
     665Let introduce $p_w$ the pressure at $w$-point such that $\delta_k [p_w] = - \rho \,g\,e_{3t}$. 
    669666The right-hand-side of the above equation can be transformed as follows: 
    670667 
     
    718715 
    719716 
    720 Note that this property strongly constrains the discrete expression of both  
    721 the depth of $T-$points and of the term added to the pressure gradient in the 
    722 $s$-coordinate. Nevertheless, it is almost never satisfied since a linear equation  
    723 of state is rarely used. 
     717Note that this property strongly constrains the discrete expression of both the depth of $T-$points and 
     718of the term added to the pressure gradient in the $s$-coordinate. 
     719Nevertheless, it is almost never satisfied since a linear equation of state is rarely used. 
    724720 
    725721 
     
    755751\end{flalign*} 
    756752 
    757 Substituting the discrete expression of the time derivative of the velocity either in vector invariant or in flux form, 
    758 leads to the discrete equivalent of the  
     753Substituting the discrete expression of the time derivative of the velocity either in 
     754vector invariant or in flux form, leads to the discrete equivalent of the ???? 
    759755 
    760756 
     
    771767\label{subsec:C.3.3}  
    772768 
    773 In flux from the vorticity term reduces to a Coriolis term in which the Coriolis  
    774 parameter has been modified to account for the ``metric'' term. This altered  
    775 Coriolis parameter is discretised at an f-point. It is given by:  
     769In flux from the vorticity term reduces to a Coriolis term in which 
     770the Coriolis parameter has been modified to account for the ``metric'' term. 
     771This altered Coriolis parameter is discretised at an f-point. 
     772It is given by: 
    776773\begin{equation*} 
    777774f+\frac{1} {e_1 e_2 } \left( v \frac{\partial e_2 } {\partial i} - u \frac{\partial e_1 } {\partial j}\right)\; 
     
    781778\end{equation*} 
    782779 
    783 Either the ENE or EEN scheme is then applied to obtain the vorticity term in flux form.  
    784 It therefore conserves the total KE. The derivation is the same as for the  
    785 vorticity term in the vector invariant form (\autoref{subsec:C_vor}). 
     780Either the ENE or EEN scheme is then applied to obtain the vorticity term in flux form. 
     781It therefore conserves the total KE. 
     782The derivation is the same as for the vorticity term in the vector invariant form (\autoref{subsec:C_vor}). 
    786783 
    787784% ------------------------------------------------------------------------------------------------------------- 
     
    791788\label{subsec:C.3.4}  
    792789 
    793 The flux form operator of the momentum advection is evaluated using a  
    794 centered second order finite difference scheme. Because of the flux form,  
    795 the discrete operator does not contribute to the global budget of linear  
    796 momentum. Because of the centered second order scheme, it conserves  
    797 the horizontal kinetic energy, that is : 
     790The flux form operator of the momentum advection is evaluated using 
     791a centered second order finite difference scheme. 
     792Because of the flux form, the discrete operator does not contribute to the global budget of linear momentum. 
     793Because of the centered second order scheme, it conserves the horizontal kinetic energy, that is: 
    798794 
    799795\begin{equation} \label{eq:C_ADV_KE_flux} 
     
    804800\end{equation} 
    805801 
    806 Let us first consider the first term of the scalar product ($i.e.$ just the the terms  
    807 associated with the i-component of the advection) : 
     802Let us first consider the first term of the scalar product 
     803($i.e.$ just the the terms associated with the i-component of the advection): 
    808804\begin{flalign*} 
    809805&  - \int_D u \cdot \nabla \cdot \left(   \textbf{U}\,u   \right) \; dv   \\ 
     
    845841   \biggl\{     \left(   \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t}   \right) \; b_t     \biggr\}    &&& \\ 
    846842\end{flalign*} 
    847 Applying similar manipulation applied to the second term of the scalar product  
    848 leads to : 
     843Applying similar manipulation applied to the second term of the scalar product leads to: 
    849844\begin{equation*} 
    850845 -  \int_D \textbf{U}_h \cdot     \left(                 {{\begin{array} {*{20}c} 
     
    854849   \biggl\{     \left(   \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t}   \right) \; b_t     \biggr\}     
    855850\end{equation*} 
    856 which is the discrete form of  
    857 $ \frac{1}{2} \int_D u \cdot \nabla \cdot \left(   \textbf{U}\,u   \right) \; dv $.  
     851which is the discrete form of $ \frac{1}{2} \int_D u \cdot \nabla \cdot \left(   \textbf{U}\,u   \right) \; dv $. 
    858852\autoref{eq:C_ADV_KE_flux} is thus satisfied. 
    859853 
    860854 
    861 When the UBS scheme is used to evaluate the flux form momentum advection,  
    862 the discrete operator does not contribute to the global budget of linear momentum  
    863 (flux form). The horizontal kinetic energy is not conserved, but forced to decay  
    864 ($i.e.$ the scheme is diffusive).  
     855When the UBS scheme is used to evaluate the flux form momentum advection, 
     856the discrete operator does not contribute to the global budget of linear momentum (flux form). 
     857The horizontal kinetic energy is not conserved, but forced to decay ($i.e.$ the scheme is diffusive).  
    865858 
    866859 
     
    894887\end{equation}  
    895888 
    896 The scheme does not allow but the conservation of the total kinetic energy but the conservation  
    897 of $q^2$, the potential enstrophy for a horizontally non-divergent flow ($i.e.$ when $\chi$=$0$).  
    898 Indeed, using the symmetry or skew symmetry properties of the operators ( \autoref{eq:DOM_mi_adj}  
    899 and \autoref{eq:DOM_di_adj}), it can be shown that: 
     889The scheme does not allow but the conservation of the total kinetic energy but the conservation of $q^2$, 
     890the potential enstrophy for a horizontally non-divergent flow ($i.e.$ when $\chi$=$0$). 
     891Indeed, using the symmetry or skew symmetry properties of the operators 
     892( \autoref{eq:DOM_mi_adj} and \autoref{eq:DOM_di_adj}), 
     893it can be shown that: 
    900894\begin{equation} \label{eq:C_1.1} 
    901895\int_D {q\,\;{\textbf{k}}\cdot \frac{1} {e_3} \nabla \times \left( {e_3 \, q \;{\textbf{k}}\times {\textbf{U}}_h } \right)\;dv} \equiv 0 
    902896\end{equation} 
    903 where $dv=e_1\,e_2\,e_3 \; di\,dj\,dk$ is the volume element. Indeed, using  
    904 \autoref{eq:dynvor_ens}, the discrete form of the right hand side of \autoref{eq:C_1.1}  
    905 can be transformed as follow: 
     897where $dv=e_1\,e_2\,e_3 \; di\,dj\,dk$ is the volume element. 
     898Indeed, using \autoref{eq:dynvor_ens}, 
     899the discrete form of the right hand side of \autoref{eq:C_1.1} can be transformed as follow: 
    906900\begin{flalign*}  
    907901&\int_D q \,\; \textbf{k} \cdot \frac{1} {e_3 } \nabla \times  
     
    955949\end{aligned}   } \right. 
    956950\end{equation}  
    957 where the indices $i_p$ and $k_p$ take the following value:  
     951where the indices $i_p$ and $k_p$ take the following values:  
    958952$i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$, 
    959953and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by:  
     
    966960This formulation does conserve the potential enstrophy for a horizontally non-divergent flow ($i.e.$ $\chi=0$).  
    967961 
    968 Let consider one of the vorticity triad, for example ${^{i}_j}\mathbb{Q}^{+1/2}_{+1/2} $,  
    969 similar manipulation can be done for the 3 others. The discrete form of the right hand  
    970 side of \autoref{eq:C_1.1} applied to this triad only can be transformed as follow: 
     962Let consider one of the vorticity triad, for example ${^{i}_j}\mathbb{Q}^{+1/2}_{+1/2} $, 
     963similar manipulation can be done for the 3 others. 
     964The discrete form of the right hand side of \autoref{eq:C_1.1} applied to 
     965this triad only can be transformed as follow: 
    971966 
    972967\begin{flalign*}  
     
    10201015 
    10211016 
    1022 All the numerical schemes used in NEMO are written such that the tracer content  
    1023 is conserved by the internal dynamics and physics (equations in flux form).  
    1024 For advection, only the CEN2 scheme ($i.e.$ $2^{nd}$ order finite different scheme)  
    1025 conserves the global variance of tracer. Nevertheless the other schemes ensure  
    1026 that the global variance decreases ($i.e.$ they are at least slightly diffusive).  
    1027 For diffusion, all the schemes ensure the decrease of the total tracer variance,  
    1028 except the iso-neutral operator. There is generally no strict conservation of mass,  
    1029 as the equation of state is non linear with respect to $T$ and $S$. In practice,  
    1030 the mass is conserved to a very high accuracy.  
     1017All the numerical schemes used in NEMO are written such that the tracer content is conserved by 
     1018the internal dynamics and physics (equations in flux form). 
     1019For advection, 
     1020only the CEN2 scheme ($i.e.$ $2^{nd}$ order finite different scheme) conserves the global variance of tracer. 
     1021Nevertheless the other schemes ensure that the global variance decreases 
     1022($i.e.$ they are at least slightly diffusive). 
     1023For diffusion, all the schemes ensure the decrease of the total tracer variance, except the iso-neutral operator. 
     1024There is generally no strict conservation of mass, 
     1025as the equation of state is non linear with respect to $T$ and $S$. 
     1026In practice, the mass is conserved to a very high accuracy.  
    10311027% ------------------------------------------------------------------------------------------------------------- 
    10321028%       Advection Term 
     
    10491045 
    10501046 
    1051 Whatever the advection scheme considered it conserves of the tracer content as all  
    1052 the scheme are written in flux form. Indeed,  let $T$ be the tracer and $\tau_u$, $\tau_v$,  
    1053 and $\tau_w$ its interpolated values at velocity point (whatever the interpolation is),  
     1047Whatever the advection scheme considered it conserves of the tracer content as 
     1048all the scheme are written in flux form. 
     1049Indeed, let $T$ be the tracer and its $\tau_u$, $\tau_v$, and $\tau_w$ interpolated values at velocity point 
     1050(whatever the interpolation is), 
    10541051the conservation of the tracer content due to the advection tendency is obtained as follows:  
    10551052\begin{flalign*} 
     
    10671064\end{flalign*} 
    10681065 
    1069 The conservation of the variance of tracer due to the advection tendency  
    1070 can be achieved only with the CEN2 scheme, $i.e.$ when  
    1071 $\tau_u= \overline T^{\,i+1/2}$, $\tau_v= \overline T^{\,j+1/2}$, and $\tau_w= \overline T^{\,k+1/2}$.  
     1066The conservation of the variance of tracer due to the advection tendency can be achieved only with the CEN2 scheme, 
     1067$i.e.$ when $\tau_u= \overline T^{\,i+1/2}$, $\tau_v= \overline T^{\,j+1/2}$, and $\tau_w= \overline T^{\,k+1/2}$.  
    10721068It can be demonstarted as follows: 
    10731069\begin{flalign*} 
     
    11031099 
    11041100 
    1105 The discrete formulation of the horizontal diffusion of momentum ensures the  
    1106 conservation of potential vorticity and the horizontal divergence, and the  
    1107 dissipation of the square of these quantities ($i.e.$ enstrophy and the  
    1108 variance of the horizontal divergence) as well as the dissipation of the  
    1109 horizontal kinetic energy. In particular, when the eddy coefficients are  
    1110 horizontally uniform, it ensures a complete separation of vorticity and  
    1111 horizontal divergence fields, so that diffusion (dissipation) of vorticity  
    1112 (enstrophy) does not generate horizontal divergence (variance of the  
    1113 horizontal divergence) and \textit{vice versa}.  
    1114  
    1115 These properties of the horizontal diffusion operator are a direct consequence  
    1116 of properties \autoref{eq:DOM_curl_grad} and \autoref{eq:DOM_div_curl}.  
    1117 When the vertical curl of the horizontal diffusion of momentum (discrete sense)  
    1118 is taken, the term associated with the horizontal gradient of the divergence is  
    1119 locally zero.  
     1101The discrete formulation of the horizontal diffusion of momentum ensures 
     1102the conservation of potential vorticity and the horizontal divergence, 
     1103and the dissipation of the square of these quantities 
     1104($i.e.$ enstrophy and the variance of the horizontal divergence) as well as 
     1105the dissipation of the horizontal kinetic energy. 
     1106In particular, when the eddy coefficients are horizontally uniform, 
     1107it ensures a complete separation of vorticity and horizontal divergence fields, 
     1108so that diffusion (dissipation) of vorticity (enstrophy) does not generate horizontal divergence 
     1109(variance of the horizontal divergence) and \textit{vice versa}.  
     1110 
     1111These properties of the horizontal diffusion operator are a direct consequence of 
     1112properties \autoref{eq:DOM_curl_grad} and \autoref{eq:DOM_div_curl}. 
     1113When the vertical curl of the horizontal diffusion of momentum (discrete sense) is taken, 
     1114the term associated with the horizontal gradient of the divergence is locally zero.  
    11201115 
    11211116% ------------------------------------------------------------------------------------------------------------- 
     
    11251120\label{subsec:C.6.1} 
    11261121 
    1127 The lateral momentum diffusion term conserves the potential vorticity : 
     1122The lateral momentum diffusion term conserves the potential vorticity: 
    11281123\begin{flalign*} 
    11291124&\int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times  
     
    12111206\label{subsec:C.6.3} 
    12121207 
    1213 The lateral momentum diffusion term dissipates the enstrophy when the eddy  
    1214 coefficients are horizontally uniform: 
     1208The lateral momentum diffusion term dissipates the enstrophy when the eddy coefficients are horizontally uniform: 
    12151209\begin{flalign*} 
    12161210&\int\limits_D  \zeta \; \textbf{k} \cdot \nabla \times  
     
    12361230\label{subsec:C.6.4} 
    12371231 
    1238 When the horizontal divergence of the horizontal diffusion of momentum  
    1239 (discrete sense) is taken, the term associated with the vertical curl of the  
    1240 vorticity is zero locally, due to \autoref{eq:DOM_div_curl}.  
    1241 The resulting term conserves the $\chi$ and dissipates $\chi^2$  
    1242 when the eddy coefficients are horizontally uniform. 
     1232When the horizontal divergence of the horizontal diffusion of momentum (discrete sense) is taken, 
     1233the term associated with the vertical curl of the vorticity is zero locally, due to \autoref{eq:DOM_div_curl}.  
     1234The resulting term conserves the $\chi$ and dissipates $\chi^2$ when the eddy coefficients are horizontally uniform. 
    12431235\begin{flalign*} 
    12441236& \int\limits_D  \nabla_h \cdot  
     
    12911283\label{sec:C.7} 
    12921284 
    1293 As for the lateral momentum physics, the continuous form of the vertical diffusion  
    1294 of momentum satisfies several integral constraints. The first two are associated  
    1295 with the conservation of momentum and the dissipation of horizontal kinetic energy: 
     1285As for the lateral momentum physics, 
     1286the continuous form of the vertical diffusion of momentum satisfies several integral constraints. 
     1287The first two are associated with the conservation of momentum and the dissipation of horizontal kinetic energy: 
    12961288\begin{align*} 
    12971289 \int\limits_D   \frac{1} {e_3 }\; \frac{\partial } {\partial k}  
     
    13061298\end{align*} 
    13071299 
    1308 The first property is obvious. The second results from: 
     1300The first property is obvious. 
     1301The second results from: 
    13091302\begin{flalign*} 
    13101303\int\limits_D  
     
    13261319\end{flalign*} 
    13271320 
    1328 The vorticity is also conserved. Indeed: 
     1321The vorticity is also conserved. 
     1322Indeed: 
    13291323\begin{flalign*} 
    13301324\int \limits_D  
     
    13461340\end{flalign*} 
    13471341 
    1348 If the vertical diffusion coefficient is uniform over the whole domain, the  
    1349 enstrophy is dissipated, $i.e.$ 
     1342If the vertical diffusion coefficient is uniform over the whole domain, the enstrophy is dissipated, $i.e.$ 
    13501343\begin{flalign*} 
    13511344\int\limits_D \zeta \, \textbf{k} \cdot \nabla \times  
     
    13781371      &\left[  \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} \left[ \delta_{j+1/2} \left[ e_{1u}\,u \right] \right]  \right]  \biggr\}  &&\\  
    13791372\end{flalign*} 
    1380 Using the fact that the vertical diffusion coefficients are uniform, and that in  
    1381 $z$-coordinate, the vertical scale factors do not depend on $i$ and $j$ so  
    1382 that: $e_{3f} =e_{3u} =e_{3v} =e_{3t} $ and $e_{3w} =e_{3uw} =e_{3vw} $,  
    1383 it follows: 
     1373Using the fact that the vertical diffusion coefficients are uniform, 
     1374and that in $z$-coordinate, the vertical scale factors do not depend on $i$ and $j$ so that: 
     1375$e_{3f} =e_{3u} =e_{3v} =e_{3t} $ and $e_{3w} =e_{3uw} =e_{3vw} $, it follows: 
    13841376\begin{flalign*} 
    13851377\equiv A^{\,vm} \sum\limits_{i,j,k} \zeta \;\delta_k  
     
    13981390      \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k} \right) \right)\; dv = 0    &&&\\ 
    13991391\end{flalign*} 
    1400 and the square of the horizontal divergence decreases ($i.e.$ the horizontal  
    1401 divergence is dissipated) if the vertical diffusion coefficient is uniform over the  
    1402 whole domain: 
     1392and the square of the horizontal divergence decreases ($i.e.$ the horizontal divergence is dissipated) if 
     1393the vertical diffusion coefficient is uniform over the whole domain: 
    14031394 
    14041395\begin{flalign*} 
     
    14631454\label{sec:C.8} 
    14641455 
    1465 The numerical schemes used for tracer subgridscale physics are written such  
    1466 that the heat and salt contents are conserved (equations in flux form).  
    1467 Since a flux form is used to compute the temperature and salinity,  
    1468 the quadratic form of these quantities ($i.e.$ their variance) globally tends to diminish.  
     1456The numerical schemes used for tracer subgridscale physics are written such that 
     1457the heat and salt contents are conserved (equations in flux form). 
     1458Since a flux form is used to compute the temperature and salinity, 
     1459the quadratic form of these quantities ($i.e.$ their variance) globally tends to diminish. 
    14691460As for the advection term, there is conservation of mass only if the Equation Of Seawater is linear.  
    14701461 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/annex_D.tex

    r9407 r10368  
    1313 
    1414 
    15 A "model life" is more than ten years. Its software, composed of a few  
    16 hundred modules, is used by many people who are scientists or students  
    17 and do not necessarily know every aspect of computing very well.  
    18 Moreover, a well thought-out program is easier to read and understand,  
    19 less difficult to modify, produces fewer bugs and is easier to maintain.  
    20 Therefore, it is essential that the model development follows some rules : 
     15A "model life" is more than ten years. 
     16Its software, composed of a few hundred modules, is used by many people who are scientists or students and 
     17do not necessarily know every aspect of computing very well. 
     18Moreover, a well thought-out program is easier to read and understand, less difficult to modify, 
     19produces fewer bugs and is easier to maintain. 
     20Therefore, it is essential that the model development follows some rules: 
    2121 
    2222- well planned and designed 
     
    3232- flexible. 
    3333 
    34 To satisfy part of these aims, \NEMO is written with a coding standard which  
    35 is close to the ECMWF rules, named DOCTOR \citep{Gibson_TR86}.  
    36 These rules present some advantages like : 
     34To satisfy part of these aims, \NEMO is written with a coding standard which is close to the ECMWF rules, 
     35named DOCTOR \citep{Gibson_TR86}.  
     36These rules present some advantages like: 
    3737 
    3838- to provide a well presented program 
    3939 
    40 - to use rules for variable names which allow recognition of their type  
     40- to use rules for variable names which allow recognition of their type 
    4141(integer, real, parameter, local or shared variables, etc. ).  
    4242 
     
    4949\label{sec:D_structure} 
    5050 
    51 Each program begins with a set of headline comments containing : 
     51Each program begins with a set of headline comments containing: 
    5252 
    5353- the program title 
     
    6565- the author name(s), the date of creation and any updates. 
    6666 
    67 - Each program is split into several well separated sections and  
     67- Each program is split into several well separated sections and 
    6868sub-sections with an underlined title and specific labelled statements. 
    6969 
    7070- A program has not more than 200 to 300 lines. 
    7171 
    72 A template of a module style can be found on the NEMO depository  
    73 in the following file : NEMO/OPA\_SRC/module\_example. 
     72A template of a module style can be found on the NEMO depository in the following file: 
     73NEMO/OPA\_SRC/module\_example. 
    7474% ================================================================ 
    7575% Coding conventions 
     
    7878\label{sec:D_coding} 
    7979 
    80 - Use of the universal language \textsc{Fortran} 90, and try to avoid obsolescent 
    81 features like statement functions, do not use GO TO and EQUIVALENCE statements. 
    82  
    83 - A continuation line begins with the character {\&} indented by three spaces  
    84 compared to the previous line, while the previous line ended with the character {\&}. 
    85  
    86 - All the variables must be declared. The code is usually compiled with implicit none. 
     80- Use of the universal language \textsc{Fortran} 90, and try to avoid obsolescent features like statement functions, 
     81do not use GO TO and EQUIVALENCE statements. 
     82 
     83- A continuation line begins with the character {\&} indented by three spaces compared to the previous line, 
     84while the previous line ended with the character {\&}. 
     85 
     86- All the variables must be declared. 
     87The code is usually compiled with implicit none. 
    8788  
    88 - Never use continuation lines in the declaration of a variable. When searching a  
    89 variable in the code through a \textit{grep} command, the declaration line will be found. 
    90  
    91 - In the declaration of a PUBLIC variable, the comment part at the end of the line  
    92 should start with the two characters "\verb?!:?". the following UNIX command, \\ 
     89- Never use continuation lines in the declaration of a variable. 
     90When searching a variable in the code through a \textit{grep} command, the declaration line will be found. 
     91 
     92- In the declaration of a PUBLIC variable, the comment part at the end of the line should start with 
     93the two characters "\verb?!:?". 
     94The following UNIX command, \\ 
    9395\verb?grep var_name *90 \ grep \!: ? \\ 
    9496will display the module name and the line where the var\_name declaration is. 
    9597 
    96 - Always use a three spaces indentation in DO loop, CASE, or IF-ELSEIF-ELSE-ENDIF  
    97 statements. 
     98- Always use a three spaces indentation in DO loop, CASE, or IF-ELSEIF-ELSE-ENDIF statements. 
    9899 
    99100- use a space after a comma, except when it appears to separate the indices of an array. 
     
    109110\label{sec:D_naming} 
    110111 
    111 The purpose of the naming conventions is to use prefix letters to classify  
    112 model variables. These conventions allow the variable type to be easily  
    113 known and rapidly identified. The naming conventions are summarised  
    114 in the Table below: 
     112The purpose of the naming conventions is to use prefix letters to classify model variables. 
     113These conventions allow the variable type to be easily known and rapidly identified. 
     114The naming conventions are summarised in the Table below: 
    115115 
    116116 
     
    192192%-------------------------------------------------------------------------------------------------------------- 
    193193 
    194 N.B.   Parameter here, in not only parameter in the \textsc{Fortran} acceptation, it is also used for code variables  
    195 that are read in namelist and should never been modified during a simulation.  
     194N.B. Parameter here, in not only parameter in the \textsc{Fortran} acceptation, 
     195it is also used for code variables that are read in namelist and should never been modified during a simulation.  
    196196It is the case, for example, for the size of a domain (jpi,jpj,jpk). 
    197197 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/annex_E.tex

    r9407 r10368  
    1010\newpage 
    1111$\ $\newline    % force a new ligne 
    12   
    13  This appendix some on going consideration on algorithms used or planned to be used 
    14 in \NEMO.  
     12 
     13This appendix some on going consideration on algorithms used or planned to be used in \NEMO.  
    1514 
    1615$\ $\newline    % force a new ligne 
     
    2221\label{sec:TRA_adv_ubs} 
    2322 
    24 The UBS advection scheme is an upstream biased third order scheme based on  
    25 an upstream-biased parabolic interpolation. It is also known as Cell Averaged  
    26 QUICK scheme (Quadratic Upstream Interpolation for Convective  
    27 Kinematics). For example, in the $i$-direction : 
     23The UBS advection scheme is an upstream biased third order scheme based on 
     24an upstream-biased parabolic interpolation. 
     25It is also known as Cell Averaged QUICK scheme (Quadratic Upstream Interpolation for Convective Kinematics). 
     26For example, in the $i$-direction: 
    2827\begin{equation} \label{eq:tra_adv_ubs2} 
    2928\tau _u^{ubs} = \left\{  \begin{aligned} 
     
    3837- \frac{1}{2}\, |U|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i] 
    3938\end{equation} 
    40 where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and  
    41 $\tau "_i =\delta _i \left[ {\delta _{i+1/2} \left[ \tau \right]} \right]$.  
    42 By choosing this expression for $\tau "$ we consider a fourth order approximation  
    43 of $\partial_i^2$ with a constant i-grid spacing ($\Delta i=1$).  
     39where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and 
     40$\tau "_i =\delta _i \left[ {\delta _{i+1/2} \left[ \tau \right]} \right]$. 
     41By choosing this expression for $\tau "$ we consider a fourth order approximation of $\partial_i^2$ with 
     42a constant i-grid spacing ($\Delta i=1$). 
    4443 
    4544Alternative choice: introduce the scale factors:   
     
    4746 
    4847 
    49 This results in a dissipatively dominant (i.e. hyper-diffusive) truncation  
    50 error \citep{Shchepetkin_McWilliams_OM05}. The overall performance of the  
    51 advection scheme is similar to that reported in \cite{Farrow1995}.  
    52 It is a relatively good compromise between accuracy and smoothness. It is  
    53 not a \emph{positive} scheme meaning false extrema are permitted but the  
    54 amplitude of such are significantly reduced over the centred second order  
    55 method. Nevertheless it is not recommended to apply it to a passive tracer  
    56 that requires positivity.  
    57  
    58 The intrinsic diffusion of UBS makes its use risky in the vertical direction  
    59 where the control of artificial diapycnal fluxes is of paramount importance.  
    60 It has therefore been preferred to evaluate the vertical flux using the TVD  
    61 scheme when \np{ln\_traadv\_ubs}\forcode{ = .true.}. 
    62  
    63 For stability reasons, in \autoref{eq:tra_adv_ubs}, the first term which corresponds  
    64 to a second order centred scheme is evaluated using the \textit{now} velocity  
    65 (centred in time) while the second term which is the diffusive part of the scheme,  
    66 is evaluated using the \textit{before} velocity (forward in time. This is discussed  
    67 by \citet{Webb_al_JAOT98} in the context of the Quick advection scheme. UBS and QUICK  
    68 schemes only differ by one coefficient. Substituting 1/6 with 1/8 in  
    69 (\autoref{eq:tra_adv_ubs}) leads to the QUICK advection scheme \citep{Webb_al_JAOT98}.  
    70 This option is not available through a namelist parameter, since the 1/6  
    71 coefficient is hard coded. Nevertheless it is quite easy to make the  
    72 substitution in \mdl{traadv\_ubs} module and obtain a QUICK scheme 
    73  
    74 NB 1: When a high vertical resolution $O(1m)$ is used, the model stability can  
    75 be controlled by vertical advection (not vertical diffusion which is usually  
    76 solved using an implicit scheme). Computer time can be saved by using a  
    77 time-splitting technique on vertical advection. This possibility have been  
    78 implemented and validated in ORCA05-L301. It is not currently offered in the  
    79 current reference version.  
    80  
    81 NB 2 : In a forthcoming release four options will be proposed for the  
    82 vertical component used in the UBS scheme. $\tau _w^{ubs}$ will be  
    83 evaluated using either \textit{(a)} a centred $2^{nd}$ order scheme ,  
    84 or  \textit{(b)} a TVD scheme, or  \textit{(c)} an interpolation based on conservative  
    85 parabolic splines following \citet{Shchepetkin_McWilliams_OM05} implementation of UBS in ROMS,  
    86 or  \textit{(d)} an UBS. The $3^{rd}$ case has dispersion properties similar to an  
    87 eight-order accurate conventional scheme. 
    88  
    89 NB 3 : It is straight forward to rewrite \autoref{eq:tra_adv_ubs} as follows: 
     48This results in a dissipatively dominant (i.e. hyper-diffusive) truncation error 
     49\citep{Shchepetkin_McWilliams_OM05}. 
     50The overall performance of the advection scheme is similar to that reported in \cite{Farrow1995}. 
     51It is a relatively good compromise between accuracy and smoothness. 
     52It is not a \emph{positive} scheme meaning false extrema are permitted but 
     53the amplitude of such are significantly reduced over the centred second order method. 
     54Nevertheless it is not recommended to apply it to a passive tracer that requires positivity.  
     55 
     56The intrinsic diffusion of UBS makes its use risky in the vertical direction where 
     57the control of artificial diapycnal fluxes is of paramount importance. 
     58It has therefore been preferred to evaluate the vertical flux using the TVD scheme when 
     59\np{ln\_traadv\_ubs}\forcode{ = .true.}. 
     60 
     61For stability reasons, in \autoref{eq:tra_adv_ubs}, the first term which corresponds to 
     62a second order centred scheme is evaluated using the \textit{now} velocity (centred in time) while 
     63the second term which is the diffusive part of the scheme, is evaluated using the \textit{before} velocity 
     64(forward in time). 
     65This is discussed by \citet{Webb_al_JAOT98} in the context of the Quick advection scheme. 
     66UBS and QUICK schemes only differ by one coefficient. 
     67Substituting 1/6 with 1/8 in (\autoref{eq:tra_adv_ubs}) leads to the QUICK advection scheme \citep{Webb_al_JAOT98}. 
     68This option is not available through a namelist parameter, since the 1/6 coefficient is hard coded. 
     69Nevertheless it is quite easy to make the substitution in \mdl{traadv\_ubs} module and obtain a QUICK scheme. 
     70 
     71NB 1: When a high vertical resolution $O(1m)$ is used, the model stability can be controlled by vertical advection 
     72(not vertical diffusion which is usually solved using an implicit scheme). 
     73Computer time can be saved by using a time-splitting technique on vertical advection. 
     74This possibility have been implemented and validated in ORCA05-L301. 
     75It is not currently offered in the current reference version.  
     76 
     77NB 2: In a forthcoming release four options will be proposed for the vertical component used in the UBS scheme. 
     78$\tau _w^{ubs}$ will be evaluated using either \textit{(a)} a centered $2^{nd}$ order scheme, 
     79or \textit{(b)} a TVD scheme, or \textit{(c)} an interpolation based on conservative parabolic splines following 
     80\citet{Shchepetkin_McWilliams_OM05} implementation of UBS in ROMS, or \textit{(d)} an UBS. 
     81The $3^{rd}$ case has dispersion properties similar to an eight-order accurate conventional scheme. 
     82 
     83NB 3: It is straight forward to rewrite \autoref{eq:tra_adv_ubs} as follows: 
    9084\begin{equation} \label{eq:tra_adv_ubs2} 
    9185\tau _u^{ubs} = \left\{  \begin{aligned} 
     
    10296\end{split} 
    10397\end{equation} 
    104 \autoref{eq:tra_adv_ubs2} has several advantages. First it clearly evidence that  
    105 the UBS scheme is based on the fourth order scheme to which is added an  
    106 upstream biased diffusive term. Second, this emphasises that the $4^{th}$ order  
    107 part have to be evaluated at \emph{now} time step, not only the $2^{th}$ order  
    108 part as stated above using \autoref{eq:tra_adv_ubs}. Third, the diffusive term is  
    109 in fact a biharmonic operator with a eddy coefficient with is simply proportional  
    110 to the velocity. 
     98\autoref{eq:tra_adv_ubs2} has several advantages. 
     99First it clearly evidences that the UBS scheme is based on the fourth order scheme to which 
     100is added an upstream biased diffusive term. 
     101Second, this emphasises that the $4^{th}$ order part have to be evaluated at \emph{now} time step, 
     102not only the $2^{th}$ order part as stated above using \autoref{eq:tra_adv_ubs}. 
     103Third, the diffusive term is in fact a biharmonic operator with a eddy coefficient which 
     104is simply proportional to the velocity. 
    111105 
    112106laplacian diffusion: 
     
    135129with ${A_u^{lT}}^2 = \frac{1}{12} {e_{1u}}^3\ |u|$,  
    136130$i.e.$ $A_u^{lT} = \frac{1}{\sqrt{12}} \,e_{1u}\ \sqrt{ e_{1u}\,|u|\,}$ 
    137 it comes : 
     131it comes: 
    138132\begin{equation} \label{eq:tra_ldf_lap} 
    139133\begin{split} 
     
    163157\end{split} 
    164158\end{equation} 
    165 if the velocity is uniform ($i.e.$ $|u|=cst$) and choosing $\tau "_i =\frac{e_{1T}}{e_{2T}\,e_{3T}}\delta _i \left[ \frac{e_{2u} e_{3u} }{e_{1u} } \delta _{i+1/2}[\tau] \right]$ 
     159if the velocity is uniform ($i.e.$ $|u|=cst$) and 
     160choosing $\tau "_i =\frac{e_{1T}}{e_{2T}\,e_{3T}}\delta _i \left[ \frac{e_{2u} e_{3u} }{e_{1u} } \delta _{i+1/2}[\tau] \right]$ 
    166161 
    167162sol 1 coefficient at T-point ( add $e_{1u}$ and $e_{1T}$ on both side of first $\delta$): 
     
    191186\label{sec:LF} 
    192187 
    193 We adopt the following semi-discrete notation for time derivative. Given the values of a variable $q$ at successive time step, the time derivation and averaging operators at the mid time step are: 
     188We adopt the following semi-discrete notation for time derivative. 
     189Given the values of a variable $q$ at successive time step, 
     190the time derivation and averaging operators at the mid time step are: 
    194191\begin{subequations} \label{eq:dt_mt} 
    195192\begin{align} 
     
    198195\end{align} 
    199196\end{subequations} 
    200 As for space operator, the adjoint of the derivation and averaging time operators are  
    201 $\delta_t^*=\delta_{t+\rdt/2}$ and $\overline{\cdot}^{\,t\,*}= \overline{\cdot}^{\,t+\Delta/2}$ 
    202 , respectively.  
     197As for space operator, 
     198the adjoint of the derivation and averaging time operators are $\delta_t^*=\delta_{t+\rdt/2}$ and 
     199$\overline{\cdot}^{\,t\,*}= \overline{\cdot}^{\,t+\Delta/2}$, respectively. 
    203200 
    204201The Leap-frog time stepping given by \autoref{eq:DOM_nxt} can be defined as: 
     
    208205      =         \frac{q^{t+\rdt}-q^{t-\rdt}}{2\rdt} 
    209206\end{equation}  
    210 Note that \autoref{chap:LF} shows that the leapfrog time step is $\rdt$, not $2\rdt$  
    211 as it can be found sometime in literature.  
    212 The leap-Frog time stepping is a second order centered scheme. As such it respects  
    213 the quadratic invariant in integral forms, $i.e.$ the following continuous property, 
     207Note that \autoref{chap:LF} shows that the leapfrog time step is $\rdt$, 
     208not $2\rdt$ as it can be found sometimes in literature. 
     209The leap-Frog time stepping is a second order centered scheme. 
     210As such it respects the quadratic invariant in integral forms, $i.e.$ the following continuous property, 
    214211\begin{equation} \label{eq:Energy} 
    215212\int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt}  
     
    217214   =  \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) , 
    218215\end{equation} 
    219 is satisfied in discrete form. Indeed,  
     216is satisfied in discrete form. 
     217Indeed,  
    220218\begin{equation} \begin{split} 
    221219\int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt}  
     
    228226      \equiv \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) 
    229227\end{split} \end{equation} 
    230 NB here pb of boundary condition when applying the adjoin! In space, setting to 0  
    231 the quantity in land area is sufficient to get rid of the boundary condition  
    232 (equivalently of the boundary value of the integration by part). In time this boundary  
    233 condition is not physical and \textbf{add something here!!!} 
     228NB here pb of boundary condition when applying the adjoint! 
     229In space, setting to 0 the quantity in land area is sufficient to get rid of the boundary condition  
     230(equivalently of the boundary value of the integration by part). 
     231In time this boundary condition is not physical and \textbf{add something here!!!} 
    234232 
    235233 
     
    249247\subsection{Griffies iso-neutral diffusion operator} 
    250248 
    251 Let try to define a scheme that get its inspiration from the \citet{Griffies_al_JPO98} 
    252 scheme, but is formulated within the \NEMO framework ($i.e.$ using scale  
    253 factors rather than grid-size and having a position of $T$-points that is not  
    254 necessary in the middle of vertical velocity points, see \autoref{fig:zgr_e3}). 
    255  
    256 In the formulation \autoref{eq:tra_ldf_iso} introduced in 1995 in OPA, the ancestor of \NEMO,  
    257 the off-diagonal terms of the small angle diffusion tensor contain several double  
    258 spatial averages of a gradient, for example $\overline{\overline{\delta_k \cdot}}^{\,i,k}$.  
    259 It is apparent that the combination of a $k$ average and a $k$ derivative of the tracer  
    260 allows for the presence of grid point oscillation structures that will be invisible  
    261 to the operator. These structures are \textit{computational modes}. They 
    262 will not be damped by the iso-neutral operator, and even possibly amplified by it.  
    263 In other word, the operator applied to a tracer does not warranties the decrease of  
    264 its global average variance. To circumvent this, we have introduced a smoothing of  
    265 the slopes of the iso-neutral surfaces (see \autoref{chap:LDF}). Nevertheless, this technique  
    266 works fine for $T$ and $S$ as they are active tracers ($i.e.$ they enter the computation  
    267 of density), but it does not work for a passive tracer.   \citep{Griffies_al_JPO98} introduce  
    268 a different way to discretise the off-diagonal terms that nicely solve the problem.  
    269 The idea is to get rid of combinations of an averaged in one direction combined  
    270 with a derivative in the same direction by considering triads. For example in the  
    271 (\textbf{i},\textbf{k}) plane, the four triads are defined at the $(i,k)$ $T$-point as follows: 
     249Let try to define a scheme that get its inspiration from the \citet{Griffies_al_JPO98} scheme, 
     250but is formulated within the \NEMO framework 
     251($i.e.$ using scale factors rather than grid-size and having a position of $T$-points that 
     252is not necessary in the middle of vertical velocity points, see \autoref{fig:zgr_e3}). 
     253 
     254In the formulation \autoref{eq:tra_ldf_iso} introduced in 1995 in OPA, the ancestor of \NEMO, 
     255the off-diagonal terms of the small angle diffusion tensor contain several double spatial averages of a gradient, 
     256for example $\overline{\overline{\delta_k \cdot}}^{\,i,k}$. 
     257It is apparent that the combination of a $k$ average and a $k$ derivative of the tracer allows for 
     258the presence of grid point oscillation structures that will be invisible to the operator. 
     259These structures are \textit{computational modes}. 
     260They will not be damped by the iso-neutral operator, and even possibly amplified by it. 
     261In other word, the operator applied to a tracer does not warranties the decrease of its global average variance. 
     262To circumvent this, we have introduced a smoothing of the slopes of the iso-neutral surfaces 
     263(see \autoref{chap:LDF}). 
     264Nevertheless, this technique works fine for $T$ and $S$ as they are active tracers 
     265($i.e.$ they enter the computation of density), but it does not work for a passive tracer. 
     266\citep{Griffies_al_JPO98} introduce a different way to discretise the off-diagonal terms that 
     267nicely solve the problem. 
     268The idea is to get rid of combinations of an averaged in one direction combined with 
     269a derivative in the same direction by considering triads. 
     270For example in the (\textbf{i},\textbf{k}) plane, the four triads are defined at the $(i,k)$ $T$-point as follows: 
    272271\begin{equation} \label{eq:Gf_triads} 
    273272_i^k \mathbb{T}_{i_p}^{k_p} (T) 
     
    277276                             \right) 
    278277\end{equation} 
    279 where the indices $i_p$ and $k_p$ define the four triads and take the following value:  
    280 $i_p = -1/2$ or $1/2$ and $k_p = -1/2$ or $1/2$,  
    281 $b_u= e_{1u}\,e_{2u}\,e_{3u}$ is the volume of $u$-cells,  
     278where the indices $i_p$ and $k_p$ define the four triads and take the following value: 
     279$i_p = -1/2$ or $1/2$ and $k_p = -1/2$ or $1/2$, 
     280$b_u= e_{1u}\,e_{2u}\,e_{3u}$ is the volume of $u$-cells, 
    282281$A_i^k$ is the lateral eddy diffusivity coefficient defined at $T$-point, 
    283 and $_i^k \mathbb{R}_{i_p}^{k_p}$ is the slope associated with each triad : 
     282and $_i^k \mathbb{R}_{i_p}^{k_p}$ is the slope associated with each triad: 
    284283\begin{equation} \label{eq:Gf_slopes} 
    285284_i^k \mathbb{R}_{i_p}^{k_p}  
     
    288287{\left(\alpha / \beta \right)_i^k  \ \delta_{k+k_p}[T^i ] - \delta_{k+k_p}[S^i ] } 
    289288\end{equation} 
    290 Note that in \autoref{eq:Gf_slopes} we use the ratio $\alpha / \beta$ instead of  
    291 multiplying the temperature derivative by $\alpha$ and the salinity derivative  
    292 by $\beta$. This is more efficient as the ratio $\alpha / \beta$ can to be  
    293 evaluated directly. 
    294  
    295 Note that in \autoref{eq:Gf_triads}, we chose to use ${b_u}_{\,i+i_p}^{\,k}$ instead of  
    296 ${b_{uw}}_{\,i+i_p}^{\,k+k_p}$. This choice has been motivated by the decrease  
    297 of tracer variance and the presence of partial cell at the ocean bottom  
    298 (see \autoref{apdx:Gf_operator}). 
     289Note that in \autoref{eq:Gf_slopes} we use the ratio $\alpha / \beta$ instead of 
     290multiplying the temperature derivative by $\alpha$ and the salinity derivative by $\beta$. 
     291This is more efficient as the ratio $\alpha / \beta$ can to be evaluated directly. 
     292 
     293Note that in \autoref{eq:Gf_triads}, we chose to use ${b_u}_{\,i+i_p}^{\,k}$ instead of ${b_{uw}}_{\,i+i_p}^{\,k+k_p}$. 
     294This choice has been motivated by the decrease of tracer variance and 
     295the presence of partial cell at the ocean bottom (see \autoref{apdx:Gf_operator}). 
    299296 
    300297%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    301298\begin{figure}[!ht] \begin{center} 
    302299\includegraphics[width=0.70\textwidth]{Fig_ISO_triad} 
    303 \caption{  \protect\label{fig:ISO_triad}    
    304 Triads used in the Griffies's like iso-neutral diffision scheme for  
    305 $u$-component (upper panel) and $w$-component (lower panel).} 
     300\caption{  \protect\label{fig:ISO_triad} 
     301  Triads used in the Griffies's like iso-neutral diffision scheme for 
     302  $u$-component (upper panel) and $w$-component (lower panel).} 
    306303\end{center} 
    307304\end{figure} 
     
    309306 
    310307The four iso-neutral fluxes associated with the triads are defined at $T$-point.  
    311 They take the following expression : 
     308They take the following expression: 
    312309\begin{flalign} \label{eq:Gf_fluxes} 
    313310\begin{split} 
     
    320317\end{flalign} 
    321318 
    322 The resulting iso-neutral fluxes at $u$- and $w$-points are then given by the  
    323 sum of the fluxes that cross the $u$- and $w$-face (\autoref{fig:ISO_triad}): 
     319The resulting iso-neutral fluxes at $u$- and $w$-points are then given by 
     320the sum of the fluxes that cross the $u$- and $w$-face (\autoref{fig:ISO_triad}): 
    324321\begin{flalign} \label{eq:iso_flux}  
    325322\textbf{F}_{iso}(T)  
     
    350347%    \end{pmatrix}       
    351348\end{flalign} 
    352 resulting in a iso-neutral diffusion tendency on temperature given by the divergence  
    353 of the sum of all the four triad fluxes : 
     349resulting in a iso-neutral diffusion tendency on temperature given by 
     350the divergence of the sum of all the four triad fluxes: 
    354351\begin{equation} \label{eq:Gf_operator} 
    355352D_l^T = \frac{1}{b_T}  \sum_{\substack{i_p,\,k_p}} \left\{   
     
    359356where $b_T= e_{1T}\,e_{2T}\,e_{3T}$ is the volume of $T$-cells.  
    360357 
    361 This expression of the iso-neutral diffusion has been chosen in order to satisfy  
    362 the following six properties: 
     358This expression of the iso-neutral diffusion has been chosen in order to satisfy the following six properties: 
    363359\begin{description} 
    364 \item[$\bullet$ horizontal diffusion] The discretization of the diffusion operator  
    365 recovers the traditional five-point Laplacian in the limit of flat iso-neutral direction : 
     360\item[$\bullet$ horizontal diffusion] 
     361  The discretization of the diffusion operator recovers the traditional five-point Laplacian in 
     362  the limit of flat iso-neutral direction: 
    366363\begin{equation} \label{eq:Gf_property1a} 
    367364D_l^T = \frac{1}{b_T}  \ \delta_{i}  
     
    371368\end{equation} 
    372369 
    373 \item[$\bullet$ implicit treatment in the vertical]  In the diagonal term associated  
    374 with the vertical divergence of the iso-neutral fluxes (i.e. the term associated  
    375 with a second order vertical derivative) appears only tracer values associated  
    376 with a single water column. This is of paramount importance since it means 
    377 that the implicit in time algorithm for solving the vertical diffusion equation can  
    378 be used to evaluate this term. It is a necessity since the vertical eddy diffusivity  
    379 associated with this term,   
     370\item[$\bullet$ implicit treatment in the vertical] 
     371  In the diagonal term associated with the vertical divergence of the iso-neutral fluxes 
     372  (i.e. the term associated with a second order vertical derivative) 
     373  appears only tracer values associated with a single water column. 
     374  This is of paramount importance since it means that 
     375  the implicit in time algorithm for solving the vertical diffusion equation can be used to evaluate this term. 
     376  It is a necessity since the vertical eddy diffusivity associated with this term,   
    380377\begin{equation} 
    381378    \sum_{\substack{i_p, \,k_p}} \left\{   
     
    385382can be quite large. 
    386383 
    387 \item[$\bullet$ pure iso-neutral operator]  The iso-neutral flux of locally referenced  
    388 potential density is zero, $i.e.$ 
     384\item[$\bullet$ pure iso-neutral operator] 
     385  The iso-neutral flux of locally referenced potential density is zero, $i.e.$ 
    389386\begin{align} \label{eq:Gf_property2} 
    390387\begin{matrix} 
     
    397394\end{matrix} 
    398395\end{align} 
    399 This result is trivially obtained using the \autoref{eq:Gf_triads} applied to $T$ and $S$  
    400 and the definition of the triads' slopes \autoref{eq:Gf_slopes}. 
    401  
    402 \item[$\bullet$ conservation of tracer] The iso-neutral diffusion term conserve the  
    403 total tracer content, $i.e.$ 
     396This result is trivially obtained using the \autoref{eq:Gf_triads} applied to $T$ and $S$ and 
     397the definition of the triads' slopes \autoref{eq:Gf_slopes}. 
     398 
     399\item[$\bullet$ conservation of tracer] 
     400  The iso-neutral diffusion term conserve the total tracer content, $i.e.$ 
    404401\begin{equation} \label{eq:Gf_property1} 
    405402\sum_{i,j,k} \left\{ D_l^T \ b_T \right\} = 0 
    406403\end{equation} 
    407 This property is trivially satisfied since the iso-neutral diffusive operator  
    408 is written in flux form. 
    409  
    410 \item[$\bullet$ decrease of tracer variance] The iso-neutral diffusion term does  
    411 not increase the total tracer variance, $i.e.$ 
     404This property is trivially satisfied since the iso-neutral diffusive operator is written in flux form. 
     405 
     406\item[$\bullet$ decrease of tracer variance] 
     407  The iso-neutral diffusion term does not increase the total tracer variance, $i.e.$ 
    412408\begin{equation} \label{eq:Gf_property1} 
    413409\sum_{i,j,k} \left\{ T \ D_l^T \ b_T \right\} \leq 0 
    414410\end{equation} 
    415 The property is demonstrated in the \autoref{apdx:Gf_operator}. It is a  
    416 key property for a diffusion term. It means that the operator is also a dissipation  
    417 term, $i.e.$ it is a sink term for the square of the quantity on which it is applied.  
    418 It therfore ensure that, when the diffusivity coefficient is large enough, the field  
    419 on which it is applied become free of grid-point noise. 
    420  
    421 \item[$\bullet$ self-adjoint operator] The iso-neutral diffusion operator is self-adjoint,  
    422 $i.e.$ 
     411The property is demonstrated in the \autoref{apdx:Gf_operator}. 
     412It is a key property for a diffusion term. 
     413It means that the operator is also a dissipation term, 
     414$i.e.$ it is a sink term for the square of the quantity on which it is applied. 
     415It therfore ensures that, when the diffusivity coefficient is large enough, 
     416the field on which it is applied become free of grid-point noise. 
     417 
     418\item[$\bullet$ self-adjoint operator] 
     419  The iso-neutral diffusion operator is self-adjoint, $i.e.$ 
    423420\begin{equation} \label{eq:Gf_property1} 
    424421\sum_{i,j,k} \left\{ S \ D_l^T \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\}  
    425422\end{equation} 
    426 In other word, there is no needs to develop a specific routine from the adjoint of this  
    427 operator. We just have to apply the same routine. This properties can be demonstrated  
    428 quite easily in a similar way the "non increase of tracer variance" property has been  
    429 proved (see \autoref{apdx:Gf_operator}). 
     423In other word, there is no needs to develop a specific routine from the adjoint of this operator. 
     424We just have to apply the same routine. 
     425This properties can be demonstrated quite easily in a similar way the "non increase of tracer variance" property 
     426has been proved (see \autoref{apdx:Gf_operator}). 
    430427\end{description} 
    431428 
     
    437434\subsection{Eddy induced velocity and skew flux formulation} 
    438435 
    439 When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined),  
    440 an additional advection term is added. The associated velocity is the so called  
    441 eddy induced velocity, the formulation of which depends on the slopes of iso- 
    442 neutral surfaces. Contrary to the case of iso-neutral mixing, the slopes used  
    443 here are referenced to the geopotential surfaces, $i.e.$ \autoref{eq:ldfslp_geo}  
    444 is used in $z$-coordinate, and the sum \autoref{eq:ldfslp_geo} 
    445 + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates.  
     436When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined), 
     437an additional advection term is added. 
     438The associated velocity is the so called eddy induced velocity, 
     439the formulation of which depends on the slopes of iso-neutral surfaces. 
     440Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces, 
     441$i.e.$ \autoref{eq:ldfslp_geo} is used in $z$-coordinate, 
     442and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates.  
    446443 
    447444The eddy induced velocity is given by:  
     
    456453\end{split} 
    457454\end{equation} 
    458 where $A_{e}$ is the eddy induced velocity coefficient, and $r_i$ and $r_j$ the  
    459 slopes between the iso-neutral and the geopotential surfaces. 
     455where $A_{e}$ is the eddy induced velocity coefficient, 
     456and $r_i$ and $r_j$ the slopes between the iso-neutral and the geopotential surfaces. 
    460457%%gm wrong: to be modified with 2 2D streamfunctions 
    461  In other words, 
    462 the eddy induced velocity can be derived from a vector streamfuntion, $\phi$, which 
    463 is given by $\phi = A_e\,\textbf{r}$ as $\textbf{U}^*  = \textbf{k} \times \nabla \phi$ 
     458In other words, the eddy induced velocity can be derived from a vector streamfuntion, $\phi$, 
     459which is given by $\phi = A_e\,\textbf{r}$ as $\textbf{U}^*  = \textbf{k} \times \nabla \phi$. 
    464460%%end gm 
    465461 
    466 A traditional way to implement this additional advection is to add it to the eulerian  
    467 velocity prior to compute the tracer advection. This allows us to take advantage of  
    468 all the advection schemes offered for the tracers (see \autoref{sec:TRA_adv}) and not just  
    469 a $2^{nd}$ order advection scheme. This is particularly useful for passive tracers  
    470 where \emph{positivity} of the advection scheme is of paramount importance.  
     462A traditional way to implement this additional advection is to add it to the eulerian velocity prior to 
     463compute the tracer advection. 
     464This allows us to take advantage of all the advection schemes offered for the tracers 
     465(see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ order advection scheme. 
     466This is particularly useful for passive tracers where 
     467\emph{positivity} of the advection scheme is of paramount importance.  
    471468% give here the expression using the triads. It is different from the one given in \autoref{eq:ldfeiv} 
    472469% see just below a copy of this equation: 
     
    490487\end{equation} 
    491488 
    492 \citep{Griffies_JPO98} introduces another way to implement the eddy induced advection,  
    493 the so-called skew form. It is based on a transformation of the advective fluxes  
    494 using the non-divergent nature of the eddy induced velocity.  
    495 For example in the (\textbf{i},\textbf{k}) plane, the tracer advective fluxes can be  
    496 transformed as follows: 
     489\citep{Griffies_JPO98} introduces another way to implement the eddy induced advection, the so-called skew form. 
     490It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity. 
     491For example in the (\textbf{i},\textbf{k}) plane, the tracer advective fluxes can be transformed as follows: 
    497492\begin{flalign*} 
    498493\begin{split} 
     
    519514\end{split} 
    520515\end{flalign*} 
    521 and since the eddy induces velocity field is no-divergent, we end up with the skew  
    522 form of the eddy induced advective fluxes: 
     516and since the eddy induces velocity field is no-divergent, 
     517we end up with the skew form of the eddy induced advective fluxes: 
    523518\begin{equation} \label{eq:eiv_skew_continuous} 
    524519\textbf{F}_{eiv}^T = \begin{pmatrix}  
     
    527522                                 \end{pmatrix} 
    528523\end{equation} 
    529 The tendency associated with eddy induced velocity is then simply the divergence  
    530 of the \autoref{eq:eiv_skew_continuous} fluxes. It naturally conserves the tracer  
    531 content, as it is expressed in flux form and, as the advective form, it preserve the  
    532 tracer variance. Another interesting property of \autoref{eq:eiv_skew_continuous}  
    533 form is that when $A=A_e$, a simplification occurs in the sum of the iso-neutral  
    534 diffusion and eddy induced velocity terms: 
     524The tendency associated with eddy induced velocity is then simply the divergence of 
     525the \autoref{eq:eiv_skew_continuous} fluxes. 
     526It naturally conserves the tracer content, as it is expressed in flux form and, 
     527as the advective form, it preserves the tracer variance. 
     528Another interesting property of \autoref{eq:eiv_skew_continuous} form is that when $A=A_e$, 
     529a simplification occurs in the sum of the iso-neutral diffusion and eddy induced velocity terms: 
    535530\begin{flalign} \label{eq:eiv_skew+eiv_continuous} 
    536531\textbf{F}_{iso}^T + \textbf{F}_{eiv}^T &=  
     
    549544\end{pmatrix} 
    550545\end{flalign} 
    551 The horizontal component reduces to the one use for an horizontal laplacian  
    552 operator and the vertical one keep the same complexity, but not more. This property 
    553 has been used to reduce the computational time \citep{Griffies_JPO98}, but it is  
    554 not of practical use as usually $A \neq A_e$. Nevertheless this property can be used to  
    555 choose a discret form of  \autoref{eq:eiv_skew_continuous} which is consistent with the  
    556 iso-neutral operator \autoref{eq:Gf_operator}. Using the slopes \autoref{eq:Gf_slopes}  
    557 and defining $A_e$ at $T$-point($i.e.$ as $A$, the eddy diffusivity coefficient), 
    558 the resulting discret form is given by: 
     546The horizontal component reduces to the one use for an horizontal laplacian operator and 
     547the vertical one keeps the same complexity, but not more. 
     548This property has been used to reduce the computational time \citep{Griffies_JPO98}, 
     549but it is not of practical use as usually $A \neq A_e$. 
     550Nevertheless this property can be used to choose a discret form of \autoref{eq:eiv_skew_continuous} which 
     551is consistent with the iso-neutral operator \autoref{eq:Gf_operator}. 
     552Using the slopes \autoref{eq:Gf_slopes} and defining $A_e$ at $T$-point($i.e.$ as $A$, 
     553the eddy diffusivity coefficient), the resulting discret form is given by: 
    559554\begin{equation} \label{eq:eiv_skew}   
    560555\textbf{F}_{eiv}^T   \equiv   \frac{1}{4} \left( \begin{aligned}                                 
     
    569564\end{equation} 
    570565Note that \autoref{eq:eiv_skew} is valid in $z$-coordinate with or without partial cells.  
    571 In $z^*$ or $s$-coordinate, the slope between the level and the geopotential surfaces  
    572 must be added to $\mathbb{R}$ for the discret form to be exact.  
    573  
    574 Such a choice of discretisation is consistent with the iso-neutral operator as it uses the  
    575 same definition for the slopes. It also ensures the conservation of the tracer variance  
    576 (see Appendix \autoref{apdx:eiv_skew}), $i.e.$ it does not include a diffusive component  
    577 but is a "pure" advection term. 
     566In $z^*$ or $s$-coordinate, the slope between the level and the geopotential surfaces must be added to 
     567$\mathbb{R}$ for the discret form to be exact.  
     568 
     569Such a choice of discretisation is consistent with the iso-neutral operator as 
     570it uses the same definition for the slopes. 
     571It also ensures the conservation of the tracer variance (see Appendix \autoref{apdx:eiv_skew}), 
     572$i.e.$ it does not include a diffusive component but is a "pure" advection term. 
    578573 
    579574 
     
    591586This part will be moved in an Appendix. 
    592587 
    593 The continuous property to be demonstrated is : 
     588The continuous property to be demonstrated is: 
    594589\begin{align*} 
    595590\int_D  D_l^T \; T \;dv   \leq 0 
     
    642637% 
    643638\allowdisplaybreaks 
    644 \intertext{The summation is done over all $i$ and $k$ indices, it is therefore possible to introduce a shift of $-1$ either in $i$ or $k$ direction in order to regroup all the terms of the summation by triad at a ($i$,$k$) point. In other words, we regroup all the terms in the neighbourhood  that contain a triad at the same ($i$,$k$) indices. It becomes: } 
     639  \intertext{The summation is done over all $i$ and $k$ indices, 
     640  it is therefore possible to introduce a shift of $-1$ either in $i$ or $k$ direction in order to 
     641  regroup all the terms of the summation by triad at a ($i$,$k$) point. 
     642  In other words, we regroup all the terms in the neighbourhood that contain a triad at the same ($i$,$k$) indices. 
     643  It becomes: } 
    645644% 
    646645&\equiv -\sum_{i,k} 
     
    672671% 
    673672\allowdisplaybreaks 
    674 \intertext{Then outing in factor the triad in each of the four terms of the summation and substituting the triads by their expression given in \autoref{eq:Gf_triads}. It becomes: } 
     673  \intertext{Then outing in factor the triad in each of the four terms of the summation and 
     674  substituting the triads by their expression given in \autoref{eq:Gf_triads}. 
     675  It becomes: } 
    675676% 
    676677&\equiv -\sum_{i,k} 
     
    710711The last inequality is obviously obtained as we succeed in obtaining a negative summation of square quantities. 
    711712 
    712 Note that, if instead of multiplying $D_l^T$ by $T$, we were using another tracer field, let say $S$, then the previous demonstration would have let to: 
     713Note that, if instead of multiplying $D_l^T$ by $T$, we were using another tracer field, let say $S$, 
     714then the previous demonstration would have let to: 
    713715\begin{align*} 
    714716\int_D  S \; D_l^T  \;dv &\equiv  \sum_{i,k} \left\{ S \ D_l^T \ b_T \right\}    \\ 
     
    729731&\equiv  \sum_{i,k} \left\{ D_l^S \ T \ b_T \right\}    
    730732\end{align*}  
    731 This means that the iso-neutral operator is self-adjoint. There is no need to develop a specific to obtain it. 
     733This means that the iso-neutral operator is self-adjoint. 
     734There is no need to develop a specific to obtain it. 
    732735 
    733736 
     
    745748This have to be moved in an Appendix. 
    746749 
    747 The continuous property to be demonstrated is : 
     750The continuous property to be demonstrated is: 
    748751\begin{align*} 
    749752\int_D \nabla \cdot \textbf{F}_{eiv}(T) \; T \;dv  \equiv 0 
     
    797800\end{matrix}    
    798801\end{align*} 
    799 The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{+1/2}}$ are the  
    800 same but of opposite signs, they cancel out.  
    801 Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{-1/2}}$.  
    802 The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{-1/2}}$ are the  
    803 same but both of opposite signs and shifted by 1 in $k$ direction. When summing over $k$  
    804 they cancel out with the neighbouring grid points.  
    805 Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{+1/2}}$ in the  
    806 $i$ direction. Therefore the sum over the domain is zero, $i.e.$ the variance of the  
    807 tracer is preserved by the discretisation of the skew fluxes. 
     802The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{+1/2}}$ are the same but of opposite signs, 
     803they cancel out.  
     804Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{-1/2}}$. 
     805The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{-1/2}}$ are the same but both of opposite signs and 
     806shifted by 1 in $k$ direction. 
     807When summing over $k$ they cancel out with the neighbouring grid points. 
     808Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{+1/2}}$ in the $i$ direction. 
     809Therefore the sum over the domain is zero, 
     810$i.e.$ the variance of the tracer is preserved by the discretisation of the skew fluxes. 
    808811 
    809812\end{document} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/annex_iso.tex

    r10146 r10368  
    1515%--------------------------------------------------------------------------------------------------------- 
    1616 
    17 Two scheme are available to perform the iso-neutral diffusion.  
    18 If the namelist logical \np{ln\_traldf\_triad} is set true,  
    19 \NEMO updates both active and passive tracers using the Griffies triad representation  
    20 of iso-neutral diffusion and the eddy-induced advective skew (GM) fluxes.  
    21 If the namelist logical \np{ln\_traldf\_iso} is set true,  
    22 the filtered version of Cox's original scheme (the Standard scheme) is employed (\autoref{sec:LDF_slp}).  
    23 In the present implementation of the Griffies scheme,  
     17Two scheme are available to perform the iso-neutral diffusion. 
     18If the namelist logical \np{ln\_traldf\_triad} is set true, 
     19\NEMO updates both active and passive tracers using the Griffies triad representation of iso-neutral diffusion and 
     20the eddy-induced advective skew (GM) fluxes. 
     21If the namelist logical \np{ln\_traldf\_iso} is set true, 
     22the filtered version of Cox's original scheme (the Standard scheme) is employed (\autoref{sec:LDF_slp}). 
     23In the present implementation of the Griffies scheme, 
    2424the advective skew fluxes are implemented even if \np{ln\_traldf\_eiv} is false. 
    2525 
    26 Values of iso-neutral diffusivity and GM coefficient are set as 
    27 described in \autoref{sec:LDF_coef}. Note that when GM fluxes are used,  
    28 the eddy-advective (GM) velocities are output for diagnostic purposes using xIOS,  
     26Values of iso-neutral diffusivity and GM coefficient are set as described in \autoref{sec:LDF_coef}. 
     27Note that when GM fluxes are used, the eddy-advective (GM) velocities are output for diagnostic purposes using xIOS, 
    2928even though the eddy advection is accomplished by means of the skew fluxes. 
    3029 
     
    3231The options specific to the Griffies scheme include: 
    3332\begin{description}[font=\normalfont] 
    34 \item[\np{ln\_triad\_iso}] See \autoref{sec:taper}. If this is set false (the default), then 
    35   `iso-neutral' mixing is accomplished within the surface mixed-layer 
    36   along slopes linearly decreasing with depth from the value immediately below 
    37   the mixed-layer to zero (flat) at the surface (\autoref{sec:lintaper}).  
    38   This is the same treatment as used in the default implementation \autoref{subsec:LDF_slp_iso}; \autoref{fig:eiv_slp}.   
    39   Where \np{ln\_triad\_iso} is set true, the vertical skew flux is further reduced  
    40   to ensure no vertical buoyancy flux, giving an almost pure 
    41   horizontal diffusive tracer flux within the mixed layer. This is similar to 
    42   the tapering suggested by \citet{Gerdes1991}. See \autoref{subsec:Gerdes-taper} 
    43 \item[\np{ln\_botmix\_triad}] See \autoref{sec:iso_bdry}.  
     33\item[\np{ln\_triad\_iso}] 
     34  See \autoref{sec:taper}. 
     35  If this is set false (the default), 
     36  then `iso-neutral' mixing is accomplished within the surface mixed-layer along slopes linearly decreasing with 
     37  depth from the value immediately below the mixed-layer to zero (flat) at the surface (\autoref{sec:lintaper}). 
     38  This is the same treatment as used in the default implementation 
     39  \autoref{subsec:LDF_slp_iso}; \autoref{fig:eiv_slp}. 
     40  Where \np{ln\_triad\_iso} is set true, 
     41  the vertical skew flux is further reduced to ensure no vertical buoyancy flux, 
     42  giving an almost pure horizontal diffusive tracer flux within the mixed layer. 
     43  This is similar to the tapering suggested by \citet{Gerdes1991}. See \autoref{subsec:Gerdes-taper} 
     44\item[\np{ln\_botmix\_triad}] 
     45  See \autoref{sec:iso_bdry}.  
    4446  If this is set false (the default) then the lateral diffusive fluxes 
    4547  associated with triads partly masked by topography are neglected.  
    4648  If it is set true, however, then these lateral diffusive fluxes are applied,  
    4749  giving smoother bottom tracer fields at the cost of introducing diapycnal mixing. 
    48 \item[\np{rn\_sw\_triad}]  blah blah to be added.... 
     50\item[\np{rn\_sw\_triad}] 
     51  blah blah to be added.... 
    4952\end{description} 
    5053The options shared with the Standard scheme include: 
     
    5659\section{Triad formulation of iso-neutral diffusion} 
    5760\label{sec:iso} 
    58 We have implemented into \NEMO a scheme inspired by \citet{Griffies_al_JPO98},  
     61We have implemented into \NEMO a scheme inspired by \citet{Griffies_al_JPO98}, 
    5962but formulated within the \NEMO framework, using scale factors rather than grid-sizes. 
    6063 
    6164\subsection{Iso-neutral diffusion operator} 
    62 The iso-neutral second order tracer diffusive operator for small 
    63 angles between iso-neutral surfaces and geopotentials is given by 
    64 \autoref{eq:iso_tensor_1}: 
     65The iso-neutral second order tracer diffusive operator for small angles between 
     66iso-neutral surfaces and geopotentials is given by \autoref{eq:iso_tensor_1}: 
    6567\begin{subequations} \label{eq:iso_tensor_1} 
    6668  \begin{equation} 
     
    9496%  {-r_1 } \hfill & {-r_2 } \hfill & {r_1 ^2+r_2 ^2} \hfill \\ 
    9597% \end{array} }} \right) 
    96  Here \autoref{eq:PE_iso_slopes}  
     98Here \autoref{eq:PE_iso_slopes}  
    9799\begin{align*} 
    98100  r_1 &=-\frac{e_3 }{e_1 } \left( \frac{\partial \rho }{\partial i} 
     
    104106    }{\partial k} \right)^{-1} 
    105107\end{align*} 
    106 is the $i$-component of the slope of the iso-neutral surface relative to the computational 
    107 surface, and $r_2$ is the $j$-component. 
    108  
    109 We will find it useful to consider the fluxes per unit area in $i,j,k$ 
    110 space; we write 
     108is the $i$-component of the slope of the iso-neutral surface relative to the computational surface, 
     109and $r_2$ is the $j$-component. 
     110 
     111We will find it useful to consider the fluxes per unit area in $i,j,k$ space; we write 
    111112\begin{equation} 
    112113  \label{eq:Fijk} 
    113114  \vect{F}_{\mathrm{iso}}=\left(f_1^{lT}e_2e_3, f_2^{lT}e_1e_3, f_3^{lT}e_1e_2\right). 
    114115\end{equation} 
    115 Additionally, we will sometimes write the contributions towards the 
    116 fluxes $\vect{f}$ and $\vect{F}_{\mathrm{iso}}$ from the component 
    117 $R_{ij}$ of $\Re$ as $f_{ij}$, $F_{\mathrm{iso}\: ij}$, with 
    118 $f_{ij}=R_{ij}e_i^{-1}\partial T/\partial x_i$ (no summation) etc. 
     116Additionally, we will sometimes write the contributions towards the fluxes $\vect{f}$ and 
     117$\vect{F}_{\mathrm{iso}}$ from the component $R_{ij}$ of $\Re$ as $f_{ij}$, $F_{\mathrm{iso}\: ij}$, 
     118with $f_{ij}=R_{ij}e_i^{-1}\partial T/\partial x_i$ (no summation) etc. 
    119119 
    120120The off-diagonal terms of the small angle diffusion tensor 
    121 \autoref{eq:iso_tensor_1}, \autoref{eq:iso_tensor_2} produce skew-fluxes along the 
    122 $i$- and $j$-directions resulting from the vertical tracer gradient: 
     121\autoref{eq:iso_tensor_1}, \autoref{eq:iso_tensor_2} produce skew-fluxes along 
     122the $i$- and $j$-directions resulting from the vertical tracer gradient: 
    123123\begin{align} 
    124124  \label{eq:i13c} 
     
    129129\end{align} 
    130130 
    131 The vertical diffusive flux associated with the $_{33}$ 
    132 component of the small angle diffusion tensor is 
     131The vertical diffusive flux associated with the $_{33}$ component of the small angle diffusion tensor is 
    133132\begin{equation} 
    134133  \label{eq:i33c} 
     
    136135\end{equation} 
    137136 
    138 Since there are no cross terms involving $r_1$ and $r_2$ in the above, we can 
    139 consider the iso-neutral diffusive fluxes separately in the $i$-$k$ and $j$-$k$ 
    140 planes, just adding together the vertical components from each 
    141 plane. The following description will describe the fluxes on the $i$-$k$ 
    142 plane. 
    143  
    144 There is no natural discretization for the $i$-component of the 
    145 skew-flux, \autoref{eq:i13c}, as 
    146 although it must be evaluated at $u$-points, it involves vertical 
    147 gradients (both for the tracer and the slope $r_1$), defined at 
    148 $w$-points. Similarly, the vertical skew flux, \autoref{eq:i31c}, is evaluated at 
    149 $w$-points but involves horizontal gradients defined at $u$-points. 
     137Since there are no cross terms involving $r_1$ and $r_2$ in the above, 
     138we can consider the iso-neutral diffusive fluxes separately in the $i$-$k$ and $j$-$k$ planes, 
     139just adding together the vertical components from each plane. 
     140The following description will describe the fluxes on the $i$-$k$ plane. 
     141 
     142There is no natural discretization for the $i$-component of the skew-flux, \autoref{eq:i13c}, 
     143as although it must be evaluated at $u$-points, 
     144it involves vertical gradients (both for the tracer and the slope $r_1$), defined at $w$-points. 
     145Similarly, the vertical skew flux, \autoref{eq:i31c}, 
     146is evaluated at $w$-points but involves horizontal gradients defined at $u$-points. 
    150147 
    151148\subsection{Standard discretization} 
    152149The straightforward approach to discretize the lateral skew flux 
    153 \autoref{eq:i13c} from tracer cell $i,k$ to $i+1,k$, introduced in 1995 
    154 into OPA, \autoref{eq:tra_ldf_iso}, is to calculate a mean vertical 
    155 gradient at the $u$-point from the average of the four surrounding 
    156 vertical tracer gradients, and multiply this by a mean slope at the 
    157 $u$-point, calculated from the averaged surrounding vertical density 
    158 gradients. The total area-integrated skew-flux (flux per unit area in 
    159 $ijk$ space) from tracer cell $i,k$ 
    160 to $i+1,k$, noting that the $e_{{3}_{i+1/2}^k}$ in the area 
    161 $e{_{3}}_{i+1/2}^k{e_{2}}_{i+1/2}i^k$ at the $u$-point cancels out with 
    162 the $1/{e_{3}}_{i+1/2}^k$ associated with the vertical tracer 
    163 gradient, is then \autoref{eq:tra_ldf_iso} 
     150\autoref{eq:i13c} from tracer cell $i,k$ to $i+1,k$, introduced in 1995 into OPA, 
     151\autoref{eq:tra_ldf_iso}, is to calculate a mean vertical gradient at the $u$-point from 
     152the average of the four surrounding vertical tracer gradients, and multiply this by a mean slope at the $u$-point, 
     153calculated from the averaged surrounding vertical density gradients. 
     154The total area-integrated skew-flux (flux per unit area in $ijk$ space) from tracer cell $i,k$ to $i+1,k$, 
     155noting that the $e_{{3}_{i+1/2}^k}$ in the area $e{_{3}}_{i+1/2}^k{e_{2}}_{i+1/2}i^k$ at the $u$-point cancels out with 
     156the $1/{e_{3}}_{i+1/2}^k$ associated with the vertical tracer gradient, is then \autoref{eq:tra_ldf_iso} 
    164157\begin{equation*} 
    165158  \left(F_u^{13} \right)_{i+\hhalf}^k = \Alts_{i+\hhalf}^k 
     
    173166  \frac{\delta_{i+1/2} [\rho]}{\overline{\overline{\delta_k \rho}}^{\,i,k}}, 
    174167\end{equation*} 
    175 and here and in the following we drop the $^{lT}$ superscript from 
    176 $\Alt$ for simplicity. 
    177 Unfortunately the resulting combination $\overline{\overline{\delta_k 
    178     \bullet}}^{\,i,k}$ of a $k$ average and a $k$ difference %of the tracer 
    179 reduces to $\bullet_{k+1}-\bullet_{k-1}$, so two-grid-point oscillations are 
    180 invisible to this discretization of the iso-neutral operator. These 
    181 \emph{computational modes} will not be damped by this operator, and 
    182 may even possibly be amplified by it.  Consequently, applying this 
    183 operator to a tracer does not guarantee the decrease of its 
    184 global-average variance. To correct this, we introduced a smoothing of 
    185 the slopes of the iso-neutral surfaces (see \autoref{chap:LDF}). This 
    186 technique works for $T$ and $S$ in so far as they are active tracers 
    187 ($i.e.$ they enter the computation of density), but it does not work 
    188 for a passive tracer. 
     168and here and in the following we drop the $^{lT}$ superscript from $\Alt$ for simplicity. 
     169Unfortunately the resulting combination $\overline{\overline{\delta_k\bullet}}^{\,i,k}$ of a $k$ average and 
     170a $k$ difference of the tracer reduces to $\bullet_{k+1}-\bullet_{k-1}$, 
     171so two-grid-point oscillations are invisible to this discretization of the iso-neutral operator. 
     172These \emph{computational modes} will not be damped by this operator, and may even possibly be amplified by it. 
     173Consequently, applying this operator to a tracer does not guarantee the decrease of its global-average variance. 
     174To correct this, we introduced a smoothing of the slopes of the iso-neutral surfaces (see \autoref{chap:LDF}). 
     175This technique works for $T$ and $S$ in so far as they are active tracers 
     176($i.e.$ they enter the computation of density), but it does not work for a passive tracer. 
    189177 
    190178\subsection{Expression of the skew-flux in terms of triad slopes} 
    191 \citep{Griffies_al_JPO98} introduce a different discretization of the 
    192 off-diagonal terms that nicely solves the problem. 
     179\citep{Griffies_al_JPO98} introduce a different discretization of the off-diagonal terms that 
     180nicely solves the problem. 
    193181% Instead of multiplying the mean slope calculated at the $u$-point by 
    194182% the mean vertical gradient at the $u$-point, 
     
    203191 \end{center} \end{figure} 
    204192% >>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    205 They get the skew flux from the products of the vertical gradients at 
    206 each $w$-point surrounding the $u$-point with the corresponding `triad' 
    207 slope calculated from the lateral density gradient across the $u$-point 
    208 divided by the vertical density gradient at the same $w$-point as the 
    209 tracer gradient. See \autoref{fig:ISO_triad}a, where the thick lines 
    210 denote the tracer gradients, and the thin lines the corresponding 
    211 triads, with slopes $s_1, \dotsc s_4$. The total area-integrated 
    212 skew-flux from tracer cell $i,k$ to $i+1,k$ 
     193They get the skew flux from the products of the vertical gradients at each $w$-point surrounding the $u$-point with 
     194the corresponding `triad' slope calculated from the lateral density gradient across the $u$-point divided by 
     195the vertical density gradient at the same $w$-point as the tracer gradient. 
     196See \autoref{fig:ISO_triad}a, where the thick lines denote the tracer gradients, 
     197and the thin lines the corresponding triads, with slopes $s_1, \dotsc s_4$. 
     198The total area-integrated skew-flux from tracer cell $i,k$ to $i+1,k$ 
    213199\begin{multline} 
    214200  \label{eq:i13} 
     
    222208  _{k-\frac{1}{2}} \left[ T^i \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}}, 
    223209\end{multline} 
    224 where the contributions of the triad fluxes are weighted by areas 
    225 $a_1, \dotsc a_4$, and $\Alts$ is now defined at the tracer points 
    226 rather than the $u$-points. This discretization gives a much closer 
    227 stencil, and disallows the two-point computational modes. 
    228  
    229  The vertical skew flux \autoref{eq:i31c} from tracer cell $i,k$ to $i,k+1$ at the 
    230 $w$-point $i,k+\hhalf$ is constructed similarly (\autoref{fig:ISO_triad}b) 
    231 by multiplying lateral tracer gradients from each of the four 
    232 surrounding $u$-points by the appropriate triad slope: 
     210where the contributions of the triad fluxes are weighted by areas $a_1, \dotsc a_4$, 
     211and $\Alts$ is now defined at the tracer points rather than the $u$-points. 
     212This discretization gives a much closer stencil, and disallows the two-point computational modes. 
     213 
     214The vertical skew flux \autoref{eq:i31c} from tracer cell $i,k$ to $i,k+1$ at 
     215the $w$-point $i,k+\hhalf$ is constructed similarly (\autoref{fig:ISO_triad}b) by 
     216multiplying lateral tracer gradients from each of the four surrounding $u$-points by the appropriate triad slope: 
    233217\begin{multline} 
    234218  \label{eq:i31} 
     
    241225 
    242226We notate the triad slopes $s_i$ and $s'_i$ in terms of the `anchor point' $i,k$ 
    243 (appearing in both the vertical and lateral gradient), and the $u$- and 
    244 $w$-points $(i+i_p,k)$, $(i,k+k_p)$ at the centres of the `arms' of the 
    245 triad as follows (see also \autoref{fig:ISO_triad}): 
     227(appearing in both the vertical and lateral gradient), 
     228and the $u$- and $w$-points $(i+i_p,k)$, $(i,k+k_p)$ at the centres of the `arms' of the triad as follows 
     229(see also \autoref{fig:ISO_triad}): 
    246230\begin{equation} 
    247231  \label{eq:R} 
     
    253237  { \alpha_i^k  \ \delta_{k+k_p}[T^i] - \beta_i^k \ \delta_{k+k_p}[S^i] }. 
    254238\end{equation} 
    255 In calculating the slopes of the local neutral surfaces,  
    256 the expansion coefficients $\alpha$ and $\beta$ are evaluated at the anchor points of the triad,  
     239In calculating the slopes of the local neutral surfaces, 
     240the expansion coefficients $\alpha$ and $\beta$ are evaluated at the anchor points of the triad, 
    257241while the metrics are calculated at the $u$- and $w$-points on the arms. 
    258242 
     
    261245    \includegraphics[width=0.80\textwidth]{Fig_GRIFF_qcells} 
    262246    \caption{   \protect\label{fig:qcells} 
    263     Triad notation for quarter cells. $T$-cells are inside 
    264       boxes, while the  $i+\half,k$ $u$-cell is shaded in green and the 
    265       $i,k+\half$ $w$-cell is shaded in pink.} 
     247      Triad notation for quarter cells. $T$-cells are inside boxes, 
     248      while the  $i+\half,k$ $u$-cell is shaded in green and 
     249      the $i,k+\half$ $w$-cell is shaded in pink.} 
    266250  \end{center} \end{figure} 
    267251% >>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    268252 
    269 Each triad $\{_i^{k}\:_{i_p}^{k_p}\}$ is associated (\autoref{fig:qcells}) with the quarter 
    270 cell that is the intersection of the $i,k$ $T$-cell, the $i+i_p,k$ $u$-cell and the $i,k+k_p$ $w$-cell.  
    271 Expressing the slopes $s_i$ and $s'_i$ in \autoref{eq:i13} and \autoref{eq:i31} in this notation,  
    272 we have $e.g.$ \ $s_1=s'_1={\:}_i^k \mathbb{R}_{1/2}^{1/2}$.  
    273 Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ is used once (as an $s$)  
    274 to calculate the lateral flux along its $u$-arm, at $(i+i_p,k)$,  
    275 and then again as an $s'$ to calculate the vertical flux along its $w$-arm at $(i,k+k_p)$.  
    276 Each vertical area $a_i$ used to calculate the lateral flux and horizontal area $a'_i$ used  
    277 to calculate the vertical flux can also be identified as the area across the $u$- and $w$-arms  
    278 of a unique triad, and we notate these areas, similarly to the triad slopes,  
    279 as $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$, $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$,  
    280 where $e.g.$ in \autoref{eq:i13} $a_{1}={\:}_i^k{\mathbb{A}_u}_{1/2}^{1/2}$,  
     253Each triad $\{_i^{k}\:_{i_p}^{k_p}\}$ is associated (\autoref{fig:qcells}) with the quarter cell that is 
     254the intersection of the $i,k$ $T$-cell, the $i+i_p,k$ $u$-cell and the $i,k+k_p$ $w$-cell. 
     255Expressing the slopes $s_i$ and $s'_i$ in \autoref{eq:i13} and \autoref{eq:i31} in this notation, 
     256we have $e.g.$ \ $s_1=s'_1={\:}_i^k \mathbb{R}_{1/2}^{1/2}$. 
     257Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ is used once (as an $s$) to 
     258calculate the lateral flux along its $u$-arm, at $(i+i_p,k)$, 
     259and then again as an $s'$ to calculate the vertical flux along its $w$-arm at $(i,k+k_p)$. 
     260Each vertical area $a_i$ used to calculate the lateral flux and horizontal area $a'_i$ used to 
     261calculate the vertical flux can also be identified as the area across the $u$- and $w$-arms of a unique triad, 
     262and we notate these areas, similarly to the triad slopes, 
     263as $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$, $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$, 
     264where $e.g.$ in \autoref{eq:i13} $a_{1}={\:}_i^k{\mathbb{A}_u}_{1/2}^{1/2}$, 
    281265and in \autoref{eq:i31} $a'_{1}={\:}_i^k{\mathbb{A}_w}_{1/2}^{1/2}$. 
    282266 
    283267\subsection{Full triad fluxes} 
    284 A key property of iso-neutral diffusion is that it should not affect 
    285 the (locally referenced) density. In particular there should be no 
    286 lateral or vertical density flux. The lateral density flux disappears so long as the 
    287 area-integrated lateral diffusive flux from tracer cell $i,k$ to 
    288 $i+1,k$ coming from the $_{11}$ term of the diffusion tensor takes the 
    289 form 
     268A key property of iso-neutral diffusion is that it should not affect the (locally referenced) density. 
     269In particular there should be no lateral or vertical density flux. 
     270The lateral density flux disappears so long as the area-integrated lateral diffusive flux from 
     271tracer cell $i,k$ to $i+1,k$ coming from the $_{11}$ term of the diffusion tensor takes the form 
    290272\begin{equation} 
    291273  \label{eq:i11} 
     
    295277  \frac{\delta _{i+1/2} \left[ T^k\right]}{{e_{1u}}_{\,i+1/2}^{\,k}}, 
    296278\end{equation} 
    297 where the areas $a_i$ are as in \autoref{eq:i13}. In this case, 
    298 separating the total lateral flux, the sum of \autoref{eq:i13} and 
    299 \autoref{eq:i11}, into triad components, a lateral tracer 
    300 flux 
     279where the areas $a_i$ are as in \autoref{eq:i13}. 
     280In this case, separating the total lateral flux, the sum of \autoref{eq:i13} and \autoref{eq:i11}, 
     281into triad components, a lateral tracer flux 
    301282\begin{equation} 
    302283  \label{eq:latflux-triad} 
     
    308289  \right) 
    309290\end{equation} 
    310 can be identified with each triad. Then, because the 
    311 same metric factors ${e_{3w}}_{\,i}^{\,k+k_p}$ and 
    312 ${e_{1u}}_{\,i+i_p}^{\,k}$ are employed for both the density gradients 
    313 in $ _i^k \mathbb{R}_{i_p}^{k_p}$ and the tracer gradients, the lateral 
    314 density flux associated with each triad separately disappears. 
     291can be identified with each triad. 
     292Then, because the same metric factors ${e_{3w}}_{\,i}^{\,k+k_p}$ and ${e_{1u}}_{\,i+i_p}^{\,k}$ are employed for both 
     293the density gradients in $ _i^k \mathbb{R}_{i_p}^{k_p}$ and the tracer gradients, 
     294the lateral density flux associated with each triad separately disappears. 
    315295\begin{equation} 
    316296  \label{eq:latflux-rho} 
    317297  {\mathbb{F}_u}_{i_p}^{k_p} (\rho)=-\alpha _i^k {\:}_i^k {\mathbb{F}_u}_{i_p}^{k_p} (T) + \beta_i^k {\:}_i^k {\mathbb{F}_u}_{i_p}^{k_p} (S)=0 
    318298\end{equation} 
    319 Thus the total flux $\left( F_u^{31} \right) ^i _{i,k+\frac{1}{2}} + 
    320 \left( F_u^{11} \right) ^i _{i,k+\frac{1}{2}}$ from tracer cell $i,k$ 
    321 to $i+1,k$ must also vanish since it is a sum of four such triad fluxes. 
    322  
    323 The squared slope $r_1^2$ in the expression \autoref{eq:i33c} for the 
    324 $_{33}$ component is also expressed in terms of area-weighted 
    325 squared triad slopes, so the area-integrated vertical flux from tracer 
    326 cell $i,k$ to $i,k+1$ resulting from the $r_1^2$ term is 
     299Thus the total flux $\left( F_u^{31} \right) ^i _{i,k+\frac{1}{2}} + \left( F_u^{11} \right) ^i _{i,k+\frac{1}{2}}$ from 
     300tracer cell $i,k$ to $i+1,k$ must also vanish since it is a sum of four such triad fluxes. 
     301 
     302The squared slope $r_1^2$ in the expression \autoref{eq:i33c} for the $_{33}$ component is also expressed in 
     303terms of area-weighted squared triad slopes, 
     304so the area-integrated vertical flux from tracer cell $i,k$ to $i,k+1$ resulting from the $r_1^2$ term is 
    327305\begin{equation} 
    328306  \label{eq:i33} 
     
    333311    + \Alts_i^k a_{4}' s_{4}'^2 \right)\delta_{k+\frac{1}{2}} \left[ T^{i+1} \right], 
    334312\end{equation} 
    335 where the areas $a'$ and slopes $s'$ are the same as in 
    336 \autoref{eq:i31}. 
    337 Then, separating the total vertical flux, the sum of \autoref{eq:i31} and 
    338 \autoref{eq:i33}, into triad components,  a vertical flux 
     313where the areas $a'$ and slopes $s'$ are the same as in \autoref{eq:i31}. 
     314Then, separating the total vertical flux, the sum of \autoref{eq:i31} and \autoref{eq:i33}, 
     315into triad components, a vertical flux 
    339316\begin{align} 
    340317  \label{eq:vertflux-triad} 
     
    349326   {_i^k\mathbb{R}_{i_p}^{k_p}}{\: }_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \label{eq:vertflux-triad2} 
    350327\end{align} 
    351 may be associated with each triad. Each vertical density flux $_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)$ 
    352 associated with a triad then separately disappears (because the 
    353 lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (\rho)$ 
    354 disappears). Consequently the total vertical density flux $\left( F_w^{31} \right)_i ^{k+\frac{1}{2}} + 
    355 \left( F_w^{33} \right)_i^{k+\frac{1}{2}}$ from tracer cell $i,k$ 
    356 to $i,k+1$ must also vanish since it is a sum of four such triad 
    357 fluxes. 
    358  
    359 We can explicitly identify (\autoref{fig:qcells}) the triads associated with the $s_i$, $a_i$, and $s'_i$, $a'_i$ used in the definition of 
    360 the $u$-fluxes and $w$-fluxes in 
    361 \autoref{eq:i31}, \autoref{eq:i13}, \autoref{eq:i11} \autoref{eq:i33} and 
    362 \autoref{fig:ISO_triad} to  write out the iso-neutral fluxes at $u$- and 
    363 $w$-points as sums of the triad fluxes that cross the $u$- and $w$-faces: 
     328may be associated with each triad. 
     329Each vertical density flux $_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)$ associated with a triad then 
     330separately disappears (because the lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (\rho)$ disappears). 
     331Consequently the total vertical density flux 
     332$\left( F_w^{31} \right)_i ^{k+\frac{1}{2}} + \left( F_w^{33} \right)_i^{k+\frac{1}{2}}$ from 
     333tracer cell $i,k$ to $i,k+1$ must also vanish since it is a sum of four such triad fluxes. 
     334 
     335We can explicitly identify (\autoref{fig:qcells}) the triads associated with the $s_i$, $a_i$, 
     336and $s'_i$, $a'_i$ used in the definition of the $u$-fluxes and $w$-fluxes in \autoref{eq:i31}, 
     337\autoref{eq:i13}, \autoref{eq:i11} \autoref{eq:i33} and \autoref{fig:ISO_triad} to write out 
     338the iso-neutral fluxes at $u$- and $w$-points as sums of the triad fluxes that cross the $u$- and $w$-faces: 
    364339%(\autoref{fig:ISO_triad}): 
    365340\begin{flalign} \label{eq:iso_flux} \vect{F}_{\mathrm{iso}}(T) &\equiv 
     
    375350\label{subsec:variance} 
    376351 
    377 We now require that this operator should not increase the 
    378 globally-integrated tracer variance. 
     352We now require that this operator should not increase the globally-integrated tracer variance. 
    379353%This changes according to 
    380354% \begin{align*} 
     
    387361%              + {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}}  \ \delta_{k+1/2} [T]   \right\}      \\ 
    388362% \end{align*} 
    389 Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ drives a lateral flux 
    390 $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ across the $u$-point $i+i_p,k$ and 
    391 a vertical flux $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ across the 
    392 $w$-point $i,k+k_p$.  The lateral flux drives a net rate of change of 
    393 variance, summed over the two $T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of 
     363Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ drives a lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ across 
     364the $u$-point $i+i_p,k$ and a vertical flux $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ across the $w$-point $i,k+k_p$. 
     365The lateral flux drives a net rate of change of variance, 
     366summed over the two $T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of 
    394367\begin{multline} 
    395368  {b_T}_{i+i_p-1/2}^k\left(\frac{\partial T}{\partial t}T\right)_{i+i_p-1/2}^k+ 
     
    402375 \end{aligned} 
    403376\end{multline} 
    404 while the vertical flux similarly drives a net rate of change of 
    405 variance summed over the $T$-points $i,k+k_p-\half$ (above) and 
    406 $i,k+k_p+\half$ (below) of 
     377while the vertical flux similarly drives a net rate of change of variance summed over 
     378the $T$-points $i,k+k_p-\half$ (above) and $i,k+k_p+\half$ (below) of 
    407379\begin{equation} 
    408380\label{eq:dvar_iso_k} 
    409381  _i^k{\mathbb{F}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i]. 
    410382\end{equation} 
    411 The total variance tendency driven by the triad is the sum of these 
    412 two. Expanding $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ and 
    413 $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ with \autoref{eq:latflux-triad} and 
    414 \autoref{eq:vertflux-triad}, it is 
     383The total variance tendency driven by the triad is the sum of these two. 
     384Expanding $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ and $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ with 
     385\autoref{eq:latflux-triad} and \autoref{eq:vertflux-triad}, it is 
    415386\begin{multline*} 
    416387-\Alts_i^k\left \{ 
     
    428399\right \}. 
    429400\end{multline*} 
    430 The key point is then that if we require 
    431 $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$ and $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$ 
    432 to be related to a triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$ by 
     401The key point is then that if we require $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$ and $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$ to 
     402be related to a triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$ by 
    433403\begin{equation} 
    434404  \label{eq:V-A} 
     
    447417  \right)^2\leq 0. 
    448418\end{equation} 
    449 Thus, the constraint \autoref{eq:V-A} ensures that the fluxes (\autoref{eq:latflux-triad}, \autoref{eq:vertflux-triad}) associated 
    450 with a given slope triad $_i^k\mathbb{R}_{i_p}^{k_p}$ do not increase 
    451 the net variance. Since the total fluxes are sums of such fluxes from 
    452 the various triads, this constraint, applied to all triads, is 
    453 sufficient to ensure that the globally integrated variance does not 
    454 increase. 
    455  
    456 The expression \autoref{eq:V-A} can be interpreted as a discretization 
    457 of the global integral 
     419Thus, the constraint \autoref{eq:V-A} ensures that the fluxes 
     420(\autoref{eq:latflux-triad}, \autoref{eq:vertflux-triad}) associated with 
     421a given slope triad $_i^k\mathbb{R}_{i_p}^{k_p}$ do not increase the net variance. 
     422Since the total fluxes are sums of such fluxes from the various triads, this constraint, applied to all triads, 
     423is sufficient to ensure that the globally integrated variance does not increase. 
     424 
     425The expression \autoref{eq:V-A} can be interpreted as a discretization of the global integral 
    458426\begin{equation} 
    459427  \label{eq:cts-var} 
     
    461429  \int\!\mathbf{F}\cdot\nabla T\, dV, 
    462430\end{equation} 
    463 where, within each triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$, the 
    464 lateral and vertical fluxes/unit area 
     431where, within each triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$, the lateral and vertical fluxes/unit area 
    465432\[ 
    466433\mathbf{F}=\left( 
     
    477444 
    478445\subsection{Triad volumes in Griffes's scheme and in \NEMO} 
    479 To complete the discretization we now need only specify the triad 
    480 volumes $_i^k\mathbb{V}_{i_p}^{k_p}$. \citet{Griffies_al_JPO98} identify 
    481 these $_i^k\mathbb{V}_{i_p}^{k_p}$ as the volumes of the quarter 
    482 cells, defined in terms of the distances between $T$, $u$,$f$ and 
    483 $w$-points. This is the natural discretization of 
    484 \autoref{eq:cts-var}. The \NEMO model, however, operates with scale 
    485 factors instead of grid sizes, and scale factors for the quarter 
    486 cells are not defined. Instead, therefore we simply choose 
     446To complete the discretization we now need only specify the triad volumes $_i^k\mathbb{V}_{i_p}^{k_p}$. 
     447\citet{Griffies_al_JPO98} identifies these $_i^k\mathbb{V}_{i_p}^{k_p}$ as the volumes of the quarter cells, 
     448defined in terms of the distances between $T$, $u$,$f$ and $w$-points. 
     449This is the natural discretization of \autoref{eq:cts-var}. 
     450The \NEMO model, however, operates with scale factors instead of grid sizes, 
     451and scale factors for the quarter cells are not defined. 
     452Instead, therefore we simply choose 
    487453\begin{equation} 
    488454  \label{eq:V-NEMO} 
    489455  _i^k\mathbb{V}_{i_p}^{k_p}=\quarter {b_u}_{i+i_p}^k, 
    490456\end{equation} 
    491 as a quarter of the volume of the $u$-cell inside which the triad 
    492 quarter-cell lies. This has the nice property that when the slopes 
    493 $\mathbb{R}$ vanish, the lateral flux from tracer cell $i,k$ to 
    494 $i+1,k$ reduces to the classical form 
     457as a quarter of the volume of the $u$-cell inside which the triad quarter-cell lies. 
     458This has the nice property that when the slopes $\mathbb{R}$ vanish, 
     459the lateral flux from tracer cell $i,k$ to $i+1,k$ reduces to the classical form 
    495460\begin{equation} 
    496461  \label{eq:lat-normal} 
     
    500465 = -\overline\Alts_{\,i+1/2}^k\;\frac{{e_{1w}}_{\,i + 1/2}^{\,k}\:{e_{1v}}_{\,i + 1/2}^{\,k}\;\delta_{i+ 1/2}[T^k]}{{e_{1u}}_{\,i + 1/2}^{\,k}}. 
    501466\end{equation} 
    502 In fact if the diffusive coefficient is defined at $u$-points, so that 
    503 we employ $\Alts_{i+i_p}^k$ instead of  $\Alts_i^k$ in the definitions of the 
    504 triad fluxes \autoref{eq:latflux-triad} and \autoref{eq:vertflux-triad}, 
     467In fact if the diffusive coefficient is defined at $u$-points, 
     468so that we employ $\Alts_{i+i_p}^k$ instead of  $\Alts_i^k$ in the definitions of the triad fluxes 
     469\autoref{eq:latflux-triad} and \autoref{eq:vertflux-triad}, 
    505470we can replace $\overline{A}_{\,i+1/2}^k$ by $A_{i+1/2}^k$ in the above. 
    506471 
    507472\subsection{Summary of the scheme} 
    508 The iso-neutral fluxes at $u$- and 
    509 $w$-points are the sums of the triad fluxes that cross the $u$- and 
    510 $w$-faces \autoref{eq:iso_flux}: 
     473The iso-neutral fluxes at $u$- and $w$-points are the sums of the triad fluxes that 
     474cross the $u$- and $w$-faces \autoref{eq:iso_flux}: 
    511475\begin{subequations}\label{eq:alltriadflux} 
    512476  \begin{flalign}\label{eq:vect_isoflux} 
     
    545509\end{subequations} 
    546510 
    547  The divergence of the expression \autoref{eq:iso_flux} for the fluxes gives the iso-neutral diffusion tendency at 
     511The divergence of the expression \autoref{eq:iso_flux} for the fluxes gives the iso-neutral diffusion tendency at 
    548512each tracer point: 
    549513\begin{equation} \label{eq:iso_operator} D_l^T = \frac{1}{b_T} 
     
    555519The diffusion scheme satisfies the following six properties: 
    556520\begin{description} 
    557 \item[$\bullet$ horizontal diffusion] The discretization of the 
    558   diffusion operator recovers \autoref{eq:lat-normal} the traditional five-point Laplacian in 
    559   the limit of flat iso-neutral direction : 
     521\item[$\bullet$ horizontal diffusion] 
     522  The discretization of the diffusion operator recovers the traditional five-point Laplacian 
     523  \autoref{eq:lat-normal} in the limit of flat iso-neutral direction: 
    560524  \begin{equation} \label{eq:iso_property0} D_l^T = \frac{1}{b_T} \ 
    561525    \delta_{i} \left[ \frac{e_{2u}\,e_{3u}}{e_{1u}} \; 
     
    564528  \end{equation} 
    565529 
    566 \item[$\bullet$ implicit treatment in the vertical] Only tracer values 
    567   associated with a single water column appear in the expression 
    568   \autoref{eq:i33} for the $_{33}$ fluxes, vertical fluxes driven by 
    569   vertical gradients. This is of paramount importance since it means 
    570   that a time-implicit algorithm can be used to solve the vertical 
    571   diffusion equation. This is necessary 
    572  since the vertical eddy 
    573   diffusivity associated with this term, 
     530\item[$\bullet$ implicit treatment in the vertical] 
     531  Only tracer values associated with a single water column appear in the expression \autoref{eq:i33} for 
     532  the $_{33}$ fluxes, vertical fluxes driven by vertical gradients. 
     533  This is of paramount importance since it means that a time-implicit algorithm can be used to 
     534  solve the vertical diffusion equation. 
     535  This is necessary since the vertical eddy diffusivity associated with this term, 
    574536  \begin{equation} 
    575537    \frac{1}{b_w}\sum_{\substack{i_p, \,k_p}} \left\{ 
     
    579541      {b_u}_{i+i_p}^k\: \Alts_i^k \: \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2 
    580542    \right\}, 
    581  \end{equation} 
     543  \end{equation} 
    582544  (where $b_w= e_{1w}\,e_{2w}\,e_{3w}$ is the volume of $w$-cells) can be quite large. 
    583545 
    584 \item[$\bullet$ pure iso-neutral operator] The iso-neutral flux of 
    585   locally referenced potential density is zero. See 
    586   \autoref{eq:latflux-rho} and \autoref{eq:vertflux-triad2}. 
    587  
    588 \item[$\bullet$ conservation of tracer] The iso-neutral diffusion 
    589   conserves tracer content, $i.e.$ 
     546\item[$\bullet$ pure iso-neutral operator] 
     547  The iso-neutral flux of locally referenced potential density is zero. 
     548  See \autoref{eq:latflux-rho} and \autoref{eq:vertflux-triad2}. 
     549 
     550\item[$\bullet$ conservation of tracer] 
     551  The iso-neutral diffusion conserves tracer content, $i.e.$ 
    590552  \begin{equation} \label{eq:iso_property1} \sum_{i,j,k} \left\{ D_l^T \ 
    591553      b_T \right\} = 0 
    592554  \end{equation} 
    593   This property is trivially satisfied since the iso-neutral diffusive 
    594   operator is written in flux form. 
    595  
    596 \item[$\bullet$ no increase of tracer variance] The iso-neutral diffusion 
    597   does not increase the tracer variance, $i.e.$ 
     555  This property is trivially satisfied since the iso-neutral diffusive operator is written in flux form. 
     556 
     557\item[$\bullet$ no increase of tracer variance] 
     558  The iso-neutral diffusion does not increase the tracer variance, $i.e.$ 
    598559  \begin{equation} \label{eq:iso_property2} \sum_{i,j,k} \left\{ T \ D_l^T 
    599560      \ b_T \right\} \leq 0 
    600561  \end{equation} 
    601   The property is demonstrated in 
    602   \autoref{subsec:variance} above. It is a key property for a diffusion 
    603   term. It means that it is also a dissipation term, $i.e.$ it 
    604   dissipates the square of the quantity on which it is applied.  It 
    605   therefore ensures that, when the diffusivity coefficient is large 
    606   enough, the field on which it is applied becomes free of grid-point 
    607   noise. 
    608  
    609 \item[$\bullet$ self-adjoint operator] The iso-neutral diffusion 
    610   operator is self-adjoint, $i.e.$ 
     562  The property is demonstrated in \autoref{subsec:variance} above. 
     563  It is a key property for a diffusion term. 
     564  It means that it is also a dissipation term, 
     565  $i.e.$ it dissipates the square of the quantity on which it is applied. 
     566  It therefore ensures that, when the diffusivity coefficient is large enough, 
     567  the field on which it is applied becomes free of grid-point noise. 
     568 
     569\item[$\bullet$ self-adjoint operator] 
     570  The iso-neutral diffusion operator is self-adjoint, $i.e.$ 
    611571  \begin{equation} \label{eq:iso_property3} \sum_{i,j,k} \left\{ S \ D_l^T 
    612572      \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\} 
    613573  \end{equation} 
    614   In other word, there is no need to develop a specific routine from 
    615   the adjoint of this operator. We just have to apply the same 
    616   routine. This property can be demonstrated similarly to the proof of 
    617   the `no increase of tracer variance' property. The contribution by a 
    618   single triad towards the left hand side of \autoref{eq:iso_property3}, can 
    619   be found by replacing $\delta[T]$ by $\delta[S]$ in \autoref{eq:dvar_iso_i} 
    620   and \autoref{eq:dvar_iso_k}. This results in a term similar to 
    621   \autoref{eq:perfect-square}, 
     574  In other word, there is no need to develop a specific routine from the adjoint of this operator. 
     575  We just have to apply the same routine. 
     576  This property can be demonstrated similarly to the proof of the `no increase of tracer variance' property. 
     577  The contribution by a single triad towards the left hand side of \autoref{eq:iso_property3}, 
     578  can be found by replacing $\delta[T]$ by $\delta[S]$ in \autoref{eq:dvar_iso_i} and \autoref{eq:dvar_iso_k}. 
     579  This results in a term similar to \autoref{eq:perfect-square}, 
    622580\begin{equation} 
    623581  \label{eq:TScovar} 
     
    634592  \right). 
    635593\end{equation} 
    636 This is symmetrical in $T $ and $S$, so exactly the same term arises 
    637 from the discretization of this triad's contribution towards the 
    638 RHS of \autoref{eq:iso_property3}. 
     594This is symmetrical in $T $ and $S$, so exactly the same term arises from 
     595the discretization of this triad's contribution towards the RHS of \autoref{eq:iso_property3}. 
    639596\end{description} 
    640597 
    641598\subsection{Treatment of the triads at the boundaries}\label{sec:iso_bdry} 
    642 The triad slope can only be defined where both the grid boxes centred at 
    643 the end of the arms exist. Triads that would poke up 
    644 through the upper ocean surface into the atmosphere, or down into the 
    645 ocean floor, must be masked out. See \autoref{fig:bdry_triads}. Surface layer triads 
    646 $\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and 
    647 $\triad{i+1}{1}{R}{-1/2}{-1/2}$ (blue) that require density to be 
    648 specified above the ocean surface are masked (\autoref{fig:bdry_triads}a): this ensures that lateral 
    649 tracer gradients produce no flux through the ocean surface. However, 
    650 to prevent surface noise, it is customary to retain the $_{11}$ contributions towards 
    651 the lateral triad fluxes $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and 
    652 $\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$; this drives diapycnal tracer 
    653 fluxes. Similar comments apply to triads that would intersect the 
    654 ocean floor (\autoref{fig:bdry_triads}b). Note that both near bottom 
    655 triad slopes $\triad{i}{k}{R}{1/2}{1/2}$ and 
    656 $\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$ 
    657 or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ $u$-point is 
    658 masked. The associated lateral fluxes (grey-black dashed line) are 
    659 masked if \np{ln\_botmix\_triad}\forcode{ = .false.}, but left unmasked, 
    660 giving bottom mixing, if \np{ln\_botmix\_triad}\forcode{ = .true.}. 
    661  
    662 The default option \np{ln\_botmix\_triad}\forcode{ = .false.} is suitable when the 
    663 bbl mixing option is enabled (\key{trabbl}, with \np{nn\_bbl\_ldf}\forcode{ = 1}), 
    664 or  for simple idealized  problems. For setups with topography without 
    665 bbl mixing, \np{ln\_botmix\_triad}\forcode{ = .true.} may be necessary. 
     599The triad slope can only be defined where both the grid boxes centred at the end of the arms exist. 
     600Triads that would poke up through the upper ocean surface into the atmosphere, 
     601or down into the ocean floor, must be masked out. 
     602See \autoref{fig:bdry_triads}. 
     603Surface layer triads $\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and $\triad{i+1}{1}{R}{-1/2}{-1/2}$ (blue) that 
     604require density to be specified above the ocean surface are masked (\autoref{fig:bdry_triads}a): 
     605this ensures that lateral tracer gradients produce no flux through the ocean surface. 
     606However, to prevent surface noise, it is customary to retain the $_{11}$ contributions towards 
     607the lateral triad fluxes $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and $\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$; 
     608this drives diapycnal tracer fluxes. 
     609Similar comments apply to triads that would intersect the ocean floor (\autoref{fig:bdry_triads}b). 
     610Note that both near bottom triad slopes $\triad{i}{k}{R}{1/2}{1/2}$ and 
     611$\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, 
     612i.e.\ the $i,k+1$ $u$-point is masked. 
     613The associated lateral fluxes (grey-black dashed line) are masked if \np{ln\_botmix\_triad}\forcode{ = .false.}, 
     614but left unmasked, giving bottom mixing, if \np{ln\_botmix\_triad}\forcode{ = .true.}. 
     615 
     616The default option \np{ln\_botmix\_triad}\forcode{ = .false.} is suitable when the bbl mixing option is enabled 
     617(\key{trabbl}, with \np{nn\_bbl\_ldf}\forcode{ = 1}), or for simple idealized problems. 
     618For setups with topography without bbl mixing, \np{ln\_botmix\_triad}\forcode{ = .true.} may be necessary. 
    666619% >>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    667620\begin{figure}[h] \begin{center} 
    668621    \includegraphics[width=0.60\textwidth]{Fig_GRIFF_bdry_triads} 
    669622    \caption{  \protect\label{fig:bdry_triads} 
    670       (a) Uppermost model layer $k=1$ with $i,1$ and $i+1,1$ tracer 
    671       points (black dots), and $i+1/2,1$ $u$-point (blue square). Triad 
    672       slopes $\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and $\triad{i+1}{1}{R}{-1/2}{-1/2}$ 
    673       (blue) poking through the ocean surface are masked (faded in 
    674       figure). However, the lateral $_{11}$ contributions towards 
    675       $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and $\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$ 
    676       (yellow line) are still applied, giving diapycnal diffusive 
    677       fluxes.\newline 
     623      (a) Uppermost model layer $k=1$ with $i,1$ and $i+1,1$ tracer points (black dots), 
     624      and $i+1/2,1$ $u$-point (blue square). 
     625      Triad slopes $\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and $\triad{i+1}{1}{R}{-1/2}{-1/2}$ (blue) poking through 
     626      the ocean surface are masked (faded in figure). 
     627      However, the lateral $_{11}$ contributions towards $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and 
     628      $\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$ (yellow line) are still applied, 
     629      giving diapycnal diffusive fluxes.\newline 
    678630      (b) Both near bottom triad slopes $\triad{i}{k}{R}{1/2}{1/2}$ and 
    679       $\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$ 
    680       or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ $u$-point 
    681       is masked. The associated lateral fluxes (grey-black dashed 
    682       line) are masked if \protect\np{botmix\_triad}\forcode{ = .false.}, but left 
    683       unmasked, giving bottom mixing, if \protect\np{botmix\_triad}\forcode{ = .true.}} 
     631      $\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, 
     632      i.e.\ the $i,k+1$ $u$-point is masked. 
     633      The associated lateral fluxes (grey-black dashed line) are masked if 
     634      \protect\np{botmix\_triad}\forcode{ = .false.}, but left unmasked, 
     635      giving bottom mixing, if \protect\np{botmix\_triad}\forcode{ = .true.}} 
    684636 \end{center} \end{figure} 
    685637% >>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    686638 
    687639\subsection{ Limiting of the slopes within the interior}\label{sec:limit} 
    688 As discussed in \autoref{subsec:LDF_slp_iso}, iso-neutral slopes relative to 
    689 geopotentials must be bounded everywhere, both for consistency with the small-slope 
    690 approximation and for numerical stability \citep{Cox1987, 
    691   Griffies_Bk04}. The bound chosen in \NEMO is applied to each 
    692 component of the slope separately and has a value of $1/100$ in the ocean interior. 
     640As discussed in \autoref{subsec:LDF_slp_iso}, 
     641iso-neutral slopes relative to geopotentials must be bounded everywhere, 
     642both for consistency with the small-slope approximation and for numerical stability \citep{Cox1987, Griffies_Bk04}. 
     643The bound chosen in \NEMO is applied to each component of the slope separately and 
     644has a value of $1/100$ in the ocean interior. 
    693645%, ramping linearly down above 70~m depth to zero at the surface 
    694 It is of course relevant to the iso-neutral slopes $\tilde{r}_i=r_i+\sigma_i$ relative to 
    695 geopotentials (here the $\sigma_i$ are the slopes of the coordinate surfaces relative to 
    696 geopotentials) \autoref{eq:PE_slopes_eiv} rather than the slope $r_i$ relative to coordinate 
    697 surfaces, so we require 
     646It is of course relevant to the iso-neutral slopes $\tilde{r}_i=r_i+\sigma_i$ relative to geopotentials 
     647(here the $\sigma_i$ are the slopes of the coordinate surfaces relative to geopotentials) 
     648\autoref{eq:PE_slopes_eiv} rather than the slope $r_i$ relative to coordinate surfaces, so we require 
    698649\begin{equation*} 
    699650  |\tilde{r}_i|\leq \tilde{r}_\mathrm{max}=0.01. 
     
    701652and then recalculate the slopes $r_i$ relative to coordinates. 
    702653Each individual triad slope 
    703  \begin{equation} 
    704    \label{eq:Rtilde} 
    705 _i^k\tilde{\mathbb{R}}_{i_p}^{k_p} = {}_i^k\mathbb{R}_{i_p}^{k_p}  + \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}} 
    706  \end{equation} 
    707 is limited like this and then the corresponding 
    708 $_i^k\mathbb{R}_{i_p}^{k_p} $ are recalculated and combined to form the fluxes. 
    709 Note that where the slopes have been limited, there is now a non-zero 
    710 iso-neutral density flux that drives dianeutral mixing.  In particular this iso-neutral density flux 
    711 is always downwards, and so acts to reduce gravitational potential energy. 
     654\begin{equation} 
     655  \label{eq:Rtilde} 
     656  _i^k\tilde{\mathbb{R}}_{i_p}^{k_p} = {}_i^k\mathbb{R}_{i_p}^{k_p}  + \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}} 
     657\end{equation} 
     658is limited like this and then the corresponding $_i^k\mathbb{R}_{i_p}^{k_p} $ are recalculated and 
     659combined to form the fluxes. 
     660Note that where the slopes have been limited, there is now a non-zero iso-neutral density flux that 
     661drives dianeutral mixing. 
     662In particular this iso-neutral density flux is always downwards, 
     663and so acts to reduce gravitational potential energy. 
    712664 
    713665\subsection{Tapering within the surface mixed layer}\label{sec:taper} 
    714 Additional tapering of the iso-neutral fluxes is necessary within the 
    715 surface mixed layer. When the Griffies triads are used, we offer two 
    716 options for this. 
     666Additional tapering of the iso-neutral fluxes is necessary within the surface mixed layer. 
     667When the Griffies triads are used, we offer two options for this. 
    717668 
    718669\subsubsection{Linear slope tapering within the surface mixed layer}\label{sec:lintaper} 
    719 This is the option activated by the default choice 
    720 \np{ln\_triad\_iso}\forcode{ = .false.}. Slopes $\tilde{r}_i$ relative to 
    721 geopotentials are tapered linearly from their value immediately below the mixed layer to zero at the 
    722 surface, as described in option (c) of \autoref{fig:eiv_slp}, to values 
     670This is the option activated by the default choice \np{ln\_triad\_iso}\forcode{ = .false.}. 
     671Slopes $\tilde{r}_i$ relative to geopotentials are tapered linearly from their value immediately below 
     672the mixed layer to zero at the surface, as described in option (c) of \autoref{fig:eiv_slp}, to values 
    723673\begin{subequations} 
    724674  \begin{equation} 
    725    \label{eq:rmtilde} 
    726      \rMLt = 
    727   -\frac{z}{h}\left.\tilde{r}_i\right|_{z=-h}\quad \text{ for  } z>-h, 
     675    \label{eq:rmtilde} 
     676    \rMLt = 
     677    -\frac{z}{h}\left.\tilde{r}_i\right|_{z=-h}\quad \text{ for  } z>-h, 
    728678  \end{equation} 
    729 and then the $r_i$ relative to vertical coordinate surfaces are appropriately 
    730 adjusted to 
     679  and then the $r_i$ relative to vertical coordinate surfaces are appropriately adjusted to 
    731680  \begin{equation} 
    732    \label{eq:rm} 
    733  \rML =\rMLt -\sigma_i \quad \text{ for  } z>-h. 
     681    \label{eq:rm} 
     682    \rML =\rMLt -\sigma_i \quad \text{ for  } z>-h. 
    734683  \end{equation} 
    735684\end{subequations} 
     
    744693\end{equation} 
    745694 
    746 This slope tapering gives a natural connection between tracer in the 
    747 mixed-layer and in isopycnal layers immediately below, in the 
    748 thermocline. It is consistent with the way the $\tilde{r}_i$ are 
    749 tapered within the mixed layer (see \autoref{sec:taperskew} below) 
    750 so as to ensure a uniform GM eddy-induced velocity throughout the 
    751 mixed layer. However, it gives a downwards density flux and so acts so 
    752 as to reduce potential energy in the same way as does the slope 
    753 limiting discussed above in \autoref{sec:limit}. 
     695This slope tapering gives a natural connection between tracer in the mixed-layer and 
     696in isopycnal layers immediately below, in the thermocline. 
     697It is consistent with the way the $\tilde{r}_i$ are tapered within the mixed layer 
     698(see \autoref{sec:taperskew} below) so as to ensure a uniform GM eddy-induced velocity throughout the mixed layer. 
     699However, it gives a downwards density flux and so acts so as to reduce potential energy in the same way as 
     700does the slope limiting discussed above in \autoref{sec:limit}. 
    754701  
    755 As in \autoref{sec:limit} above, the tapering 
    756 \autoref{eq:rmtilde} is applied separately to each triad 
    757 $_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}$, and the 
    758 $_i^k\mathbb{R}_{i_p}^{k_p}$ adjusted. For clarity, we assume 
    759 $z$-coordinates in the following; the conversion from 
    760 $\mathbb{R}$ to $\tilde{\mathbb{R}}$ and back to $\mathbb{R}$ follows exactly as described 
    761 above by \autoref{eq:Rtilde}. 
     702As in \autoref{sec:limit} above, the tapering \autoref{eq:rmtilde} is applied separately to 
     703each triad $_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}$, and the $_i^k\mathbb{R}_{i_p}^{k_p}$ adjusted. 
     704For clarity, we assume $z$-coordinates in the following; 
     705the conversion from $\mathbb{R}$ to $\tilde{\mathbb{R}}$ and back to $\mathbb{R}$ follows exactly as 
     706described above by \autoref{eq:Rtilde}. 
    762707\begin{enumerate} 
    763 \item Mixed-layer depth is defined so as to avoid including regions of weak 
    764 vertical stratification in the slope definition. 
    765  At each $i,j$ (simplified to $i$ in 
    766 \autoref{fig:MLB_triad}), we define the mixed-layer by setting 
    767 the vertical index of the tracer point immediately below the mixed 
    768 layer, $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) 
    769 such that the potential density 
    770 ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$, where $i,k_{10}$ is 
    771 the tracer gridbox within which the depth reaches 10~m. See the left 
    772 side of \autoref{fig:MLB_triad}. We use the $k_{10}$-gridbox 
    773 instead of the surface gridbox to avoid problems e.g.\ with thin 
    774 daytime mixed-layers. Currently we use the same 
    775 $\Delta\rho_c=0.01\;\mathrm{kg\:m^{-3}}$ for ML triad tapering as is 
    776 used to output the diagnosed mixed-layer depth 
    777 $h_{\mathrm{ML}}=|z_{W}|_{k_{\mathrm{ML}}+1/2}$, the depth of the $w$-point 
    778 above the $i,k_{\mathrm{ML}}$ tracer point. 
    779  
    780 \item We define `basal' triad slopes 
    781 ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ as the slopes 
    782 of those triads whose vertical `arms' go down from the 
    783 $i,k_{\mathrm{ML}}$ tracer point to the $i,k_{\mathrm{ML}}-1$ tracer point 
    784 below. This is to ensure that the vertical density gradients 
    785 associated with these basal triad slopes 
    786 ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ are 
    787 representative of the thermocline. The four basal triads defined in the bottom part 
    788 of \autoref{fig:MLB_triad} are then 
     708\item 
     709  Mixed-layer depth is defined so as to avoid including regions of weak vertical stratification in 
     710  the slope definition. 
     711  At each $i,j$ (simplified to $i$ in \autoref{fig:MLB_triad}), 
     712  we define the mixed-layer by setting the vertical index of the tracer point immediately below the mixed layer, 
     713  $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) such that 
     714  the potential density ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$, 
     715  where $i,k_{10}$ is the tracer gridbox within which the depth reaches 10~m. 
     716  See the left side of \autoref{fig:MLB_triad}. 
     717  We use the $k_{10}$-gridbox instead of the surface gridbox to avoid problems e.g.\ with thin daytime mixed-layers. 
     718  Currently we use the same $\Delta\rho_c=0.01\;\mathrm{kg\:m^{-3}}$ for ML triad tapering as is used to 
     719  output the diagnosed mixed-layer depth $h_{\mathrm{ML}}=|z_{W}|_{k_{\mathrm{ML}}+1/2}$, 
     720  the depth of the $w$-point above the $i,k_{\mathrm{ML}}$ tracer point. 
     721\item 
     722  We define `basal' triad slopes ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ as 
     723  the slopes of those triads whose vertical `arms' go down from the $i,k_{\mathrm{ML}}$ tracer point to 
     724  the $i,k_{\mathrm{ML}}-1$ tracer point below. 
     725  This is to ensure that the vertical density gradients associated with 
     726  these basal triad slopes ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ are representative of the thermocline. 
     727  The four basal triads defined in the bottom part of \autoref{fig:MLB_triad} are then 
    789728\begin{align} 
    790729  {\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p} &= 
     
    795734{\:}^{k_{\mathrm{ML}}}_i{\mathbb{R}_{\mathrm{base}}}_{\,1/2}^{-1/2}. \notag 
    796735\end{align} 
    797 The vertical flux associated with each of these triads passes through the $w$-point 
    798 $i,k_{\mathrm{ML}}-1/2$ lying \emph{below} the $i,k_{\mathrm{ML}}$ tracer point, 
    799 so it is this depth 
     736The vertical flux associated with each of these triads passes through 
     737the $w$-point $i,k_{\mathrm{ML}}-1/2$ lying \emph{below} the $i,k_{\mathrm{ML}}$ tracer point, so it is this depth 
    800738\begin{equation} 
    801739  \label{eq:zbase} 
    802740  {z_\mathrm{base}}_{\,i}={z_{w}}_{k_\mathrm{ML}-1/2} 
    803741\end{equation} 
    804 (one gridbox deeper than the 
    805 diagnosed ML depth $z_{\mathrm{ML}})$ that sets the $h$ used to taper 
    806 the slopes in \autoref{eq:rmtilde}. 
    807 \item Finally, we calculate the adjusted triads 
    808 ${\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,i_p}^{k_p}$ within the mixed 
    809 layer, by multiplying the appropriate 
    810 ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ by the ratio of 
    811 the depth of the $w$-point ${z_w}_{k+k_p}$ to ${z_{\mathrm{base}}}_{\,i}$. For 
    812 instance the green triad centred on $i,k$ 
     742one gridbox deeper than the diagnosed ML depth $z_{\mathrm{ML}})$ that sets the $h$ used to taper the slopes in 
     743\autoref{eq:rmtilde}. 
     744\item 
     745  Finally, we calculate the adjusted triads ${\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,i_p}^{k_p}$ within 
     746  the mixed layer, by multiplying the appropriate ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ by 
     747  the ratio of the depth of the $w$-point ${z_w}_{k+k_p}$ to ${z_{\mathrm{base}}}_{\,i}$. 
     748  For instance the green triad centred on $i,k$ 
    813749\begin{align} 
    814750  {\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,1/2}^{-1/2} &= 
     
    824760\begin{figure}[h] 
    825761%  \fcapside { 
    826     \caption{\protect\label{fig:MLB_triad} Definition of 
    827       mixed-layer depth and calculation of linearly tapered 
    828       triads. The figure shows a water column at a given $i,j$ 
    829       (simplified to $i$), with the ocean surface at the top. Tracer points are denoted by 
    830       bullets, and black lines the edges of the tracer cells; $k$ 
    831       increases upwards. \newline 
    832       \hspace{5 em}We define the mixed-layer by setting the vertical index 
    833       of the tracer point immediately below the mixed layer, 
    834       $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) 
    835       such that ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$, 
    836       where $i,k_{10}$ is the tracer gridbox within which the depth 
    837       reaches 10~m. We calculate the triad slopes within the mixed 
    838       layer by linearly tapering them from zero (at the surface) to 
    839       the `basal' slopes, the slopes of the four triads passing through the 
    840       $w$-point $i,k_{\mathrm{ML}}-1/2$ (blue square), 
    841       ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$. Triads with 
    842     different $i_p,k_p$, denoted by different colours, (e.g. the green 
    843     triad $i_p=1/2,k_p=-1/2$) are tapered to the appropriate basal triad.} 
     762  \caption{\protect\label{fig:MLB_triad} 
     763    Definition of mixed-layer depth and calculation of linearly tapered triads. 
     764    The figure shows a water column at a given $i,j$ (simplified to $i$), with the ocean surface at the top. 
     765    Tracer points are denoted by bullets, and black lines the edges of the tracer cells; 
     766    $k$ increases upwards. \newline 
     767    \hspace{5 em} 
     768    We define the mixed-layer by setting the vertical index of the tracer point immediately below the mixed layer, 
     769    $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) such that 
     770    ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$, 
     771    where $i,k_{10}$ is the tracer gridbox within which the depth reaches 10~m. 
     772    We calculate the triad slopes within the mixed layer by linearly tapering them from zero 
     773    (at the surface) to the `basal' slopes, 
     774    the slopes of the four triads passing through the $w$-point $i,k_{\mathrm{ML}}-1/2$ (blue square), 
     775    ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$. 
     776    Triads with different $i_p,k_p$, denoted by different colours, 
     777    (e.g. the green triad $i_p=1/2,k_p=-1/2$) are tapered to the appropriate basal triad.} 
    844778%} 
    845779  {\includegraphics[width=0.60\textwidth]{Fig_GRIFF_MLB_triads}} 
     
    849783\subsubsection{Additional truncation of skew iso-neutral flux components} 
    850784\label{subsec:Gerdes-taper} 
    851 The alternative option is activated by setting \np{ln\_triad\_iso} = 
    852   true. This retains the same tapered slope $\rML$  described above for the 
    853 calculation of the $_{33}$ term of the iso-neutral diffusion tensor (the 
    854 vertical tracer flux driven by vertical tracer gradients), but 
    855 replaces the $\rML$ in the skew term by 
     785The alternative option is activated by setting \np{ln\_triad\_iso} = true. 
     786This retains the same tapered slope $\rML$  described above for the calculation of the $_{33}$ term of 
     787the iso-neutral diffusion tensor (the vertical tracer flux driven by vertical tracer gradients), 
     788but replaces the $\rML$ in the skew term by 
    856789\begin{equation} 
    857790  \label{eq:rm*} 
     
    868801\end{equation} 
    869802This operator 
    870 \footnote{To ensure good behaviour where horizontal density 
    871   gradients are weak, we in fact follow \citet{Gerdes1991} and set 
    872 $\rML^*=\mathrm{sgn}(\tilde{r}_i)\min(|\rMLt^2/\tilde{r}_i|,|\tilde{r}_i|)-\sigma_i$.} 
    873 then has the property it gives no vertical density flux, and so does 
    874 not change the potential energy. 
    875 This approach is similar to multiplying the iso-neutral  diffusion 
    876 coefficient by $\tilde{r}_{\mathrm{max}}^{-2}\tilde{r}_i^{-2}$ for steep 
    877 slopes, as suggested by \citet{Gerdes1991} (see also \citet{Griffies_Bk04}). 
     803\footnote{ 
     804  To ensure good behaviour where horizontal density gradients are weak, 
     805  we in fact follow \citet{Gerdes1991} and 
     806  set $\rML^*=\mathrm{sgn}(\tilde{r}_i)\min(|\rMLt^2/\tilde{r}_i|,|\tilde{r}_i|)-\sigma_i$.} 
     807then has the property it gives no vertical density flux, and so does not change the potential energy. 
     808This approach is similar to multiplying the iso-neutral diffusion coefficient by 
     809$\tilde{r}_{\mathrm{max}}^{-2}\tilde{r}_i^{-2}$ for steep slopes, 
     810as suggested by \citet{Gerdes1991} (see also \citet{Griffies_Bk04}). 
    878811Again it is applied separately to each triad $_i^k\mathbb{R}_{i_p}^{k_p}$ 
    879812 
    880 In practice, this approach gives weak vertical tracer fluxes through 
    881 the mixed-layer, as well as vanishing density fluxes. While it is 
    882 theoretically advantageous that it does not change the potential 
    883 energy, it may give a discontinuity between the 
    884 fluxes within the mixed-layer (purely horizontal) and just below (along 
    885 iso-neutral surfaces). 
     813In practice, this approach gives weak vertical tracer fluxes through the mixed-layer, 
     814as well as vanishing density fluxes. 
     815While it is theoretically advantageous that it does not change the potential energy, 
     816it may give a discontinuity between the fluxes within the mixed-layer (purely horizontal) and 
     817just below (along iso-neutral surfaces). 
    886818% This may give strange looking results, 
    887819% particularly where the mixed-layer depth varies strongly laterally. 
     
    893825\subsection{Continuous skew flux formulation}\label{sec:continuous-skew-flux} 
    894826 
    895  When Gent and McWilliams's [1990] diffusion is used, 
    896 an additional advection term is added. The associated velocity is the so called 
    897 eddy induced velocity, the formulation of which depends on the slopes of iso- 
    898 neutral surfaces. Contrary to the case of iso-neutral mixing, the slopes used 
    899 here are referenced to the geopotential surfaces, $i.e.$ \autoref{eq:ldfslp_geo} 
    900 is used in $z$-coordinate, and the sum \autoref{eq:ldfslp_geo} 
    901 + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates. 
     827When Gent and McWilliams's [1990] diffusion is used, an additional advection term is added. 
     828The associated velocity is the so called eddy induced velocity, 
     829the formulation of which depends on the slopes of iso-neutral surfaces. 
     830Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces, 
     831$i.e.$ \autoref{eq:ldfslp_geo} is used in $z$-coordinate, 
     832and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates. 
    902833 
    903834The eddy induced velocity is given by: 
     
    919850\end{equation} 
    920851\end{subequations} 
    921 with $A_{e}$ the eddy induced velocity coefficient, and $\tilde{r}_1$ and $\tilde{r}_2$ the slopes between the iso-neutral and the geopotential surfaces. 
    922  
    923 The traditional way to implement this additional advection is to add 
    924 it to the Eulerian velocity prior to computing the tracer 
    925 advection. This is implemented if \key{traldf\_eiv} is set in the 
    926 default implementation, where \np{ln\_traldf\_triad} is set 
    927 false. This allows us to take advantage of all the advection schemes 
    928 offered for the tracers (see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ 
    929 order advection scheme. This is particularly useful for passive 
    930 tracers where \emph{positivity} of the advection scheme is of 
    931 paramount importance. 
    932  
    933 However, when \np{ln\_traldf\_triad} is set true, \NEMO instead 
    934 implements eddy induced advection according to the so-called skew form 
    935 \citep{Griffies_JPO98}. It is based on a transformation of the advective fluxes 
    936 using the non-divergent nature of the eddy induced velocity. 
    937 For example in the (\textbf{i},\textbf{k}) plane, the tracer advective 
    938 fluxes per unit area in $ijk$ space can be 
    939 transformed as follows: 
     852with $A_{e}$ the eddy induced velocity coefficient, 
     853and $\tilde{r}_1$ and $\tilde{r}_2$ the slopes between the iso-neutral and the geopotential surfaces. 
     854 
     855The traditional way to implement this additional advection is to add it to the Eulerian velocity prior to 
     856computing the tracer advection. 
     857This is implemented if \key{traldf\_eiv} is set in the default implementation, 
     858where \np{ln\_traldf\_triad} is set false. 
     859This allows us to take advantage of all the advection schemes offered for the tracers 
     860(see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ order advection scheme. 
     861This is particularly useful for passive tracers where 
     862\emph{positivity} of the advection scheme is of paramount importance. 
     863 
     864However, when \np{ln\_traldf\_triad} is set true, 
     865\NEMO instead implements eddy induced advection according to the so-called skew form \citep{Griffies_JPO98}. 
     866It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity. 
     867For example in the (\textbf{i},\textbf{k}) plane, 
     868the tracer advective fluxes per unit area in $ijk$ space can be transformed as follows: 
    940869\begin{flalign*} 
    941870\begin{split} 
     
    962891\end{split} 
    963892\end{flalign*} 
    964 and since the eddy induced velocity field is non-divergent, we end up with the skew 
    965 form of the eddy induced advective fluxes per unit area in $ijk$ space: 
     893and since the eddy induced velocity field is non-divergent, 
     894we end up with the skew form of the eddy induced advective fluxes per unit area in $ijk$ space: 
    966895\begin{equation} \label{eq:eiv_skew_ijk} 
    967896\textbf{F}_\mathrm{eiv}^T = \begin{pmatrix} 
     
    979908\end{split} 
    980909\end{equation} 
    981 Note that  \autoref{eq:eiv_skew_physical} takes the same form whatever the 
    982 vertical coordinate, though of course the slopes 
    983 $\tilde{r}_i$ which define the $\psi_i$ in \autoref{eq:eiv_psi} are relative to geopotentials. 
    984 The tendency associated with eddy induced velocity is then simply the convergence 
    985 of the fluxes (\autoref{eq:eiv_skew_ijk}, \autoref{eq:eiv_skew_physical}), so 
     910Note that \autoref{eq:eiv_skew_physical} takes the same form whatever the vertical coordinate, 
     911though of course the slopes $\tilde{r}_i$ which define the $\psi_i$ in \autoref{eq:eiv_psi} are relative to 
     912geopotentials. 
     913The tendency associated with eddy induced velocity is then simply the convergence of the fluxes 
     914(\autoref{eq:eiv_skew_ijk}, \autoref{eq:eiv_skew_physical}), so 
    986915\begin{equation} \label{eq:skew_eiv_conv} 
    987916\frac{\partial T}{\partial t}= -\frac{1}{e_1 \, e_2 \, e_3 }      \left[ 
     
    992921   + e_{1} \psi_2 \partial_j T \right)  \right] 
    993922\end{equation} 
    994  It naturally conserves the tracer content, as it is expressed in flux 
    995  form. Since it has the same divergence as the advective form it also 
    996  preserves the tracer variance. 
     923It naturally conserves the tracer content, as it is expressed in flux form. 
     924Since it has the same divergence as the advective form it also preserves the tracer variance. 
    997925 
    998926\subsection{Discrete skew flux formulation} 
    999 The skew fluxes in (\autoref{eq:eiv_skew_physical}, \autoref{eq:eiv_skew_ijk}), like the off-diagonal terms 
    1000 (\autoref{eq:i13c}, \autoref{eq:i31c}) of the small angle diffusion tensor, are best 
    1001 expressed in terms of the triad slopes, as in \autoref{fig:ISO_triad} 
    1002 and (\autoref{eq:i13}, \autoref{eq:i31}); but now in terms of the triad slopes 
    1003 $\tilde{\mathbb{R}}$ relative to geopotentials instead of the 
    1004 $\mathbb{R}$ relative to coordinate surfaces. The discrete form of 
    1005 \autoref{eq:eiv_skew_ijk} using the slopes \autoref{eq:R} and 
     927The skew fluxes in (\autoref{eq:eiv_skew_physical}, \autoref{eq:eiv_skew_ijk}), 
     928like the off-diagonal terms (\autoref{eq:i13c}, \autoref{eq:i31c}) of the small angle diffusion tensor, 
     929are best expressed in terms of the triad slopes, as in \autoref{fig:ISO_triad} and 
     930(\autoref{eq:i13}, \autoref{eq:i31}); 
     931but now in terms of the triad slopes $\tilde{\mathbb{R}}$ relative to geopotentials instead of 
     932the $\mathbb{R}$ relative to coordinate surfaces. 
     933The discrete form of \autoref{eq:eiv_skew_ijk} using the slopes \autoref{eq:R} and 
    1006934defining $A_e$ at $T$-points is then given by: 
    1007935 
     
    1017945    \end{pmatrix}, 
    1018946  \end{flalign} 
    1019   where the skew flux in the $i$-direction associated with a given 
    1020   triad is (\autoref{eq:latflux-triad}, \autoref{eq:triadfluxu}): 
     947  where the skew flux in the $i$-direction associated with a given triad is (\autoref{eq:latflux-triad}, 
     948  \autoref{eq:triadfluxu}): 
    1021949  \begin{align} 
    1022950    \label{eq:skewfluxu} 
     
    1034962\end{subequations} 
    1035963 
    1036 Such a discretisation is consistent with the iso-neutral 
    1037 operator as it uses the same definition for the slopes.  It also 
    1038 ensures the following two key properties. 
     964Such a discretisation is consistent with the iso-neutral operator as it uses the same definition for the slopes. 
     965It also ensures the following two key properties. 
    1039966 
    1040967\subsubsection{No change in tracer variance} 
    1041 The discretization conserves tracer variance, $i.e.$ it does not 
    1042 include a diffusive component but is a `pure' advection term. This can 
    1043 be seen 
    1044 %either from Appendix \autoref{apdx:eiv_skew} or 
    1045 by considering the 
    1046 fluxes associated with a given triad slope 
    1047 $_i^k{\mathbb{R}}_{i_p}^{k_p} (T)$. For, following 
    1048 \autoref{subsec:variance} and \autoref{eq:dvar_iso_i}, the 
    1049 associated horizontal skew-flux $_i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)$ 
    1050 drives a net rate of change of variance, summed over the two 
    1051 $T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of 
     968The discretization conserves tracer variance, $i.e.$ it does not include a diffusive component but is a `pure' advection term. 
     969This can be seen %either from Appendix \autoref{apdx:eiv_skew} or 
     970by considering the fluxes associated with a given triad slope $_i^k{\mathbb{R}}_{i_p}^{k_p} (T)$. 
     971For, following \autoref{subsec:variance} and \autoref{eq:dvar_iso_i}, 
     972the associated horizontal skew-flux $_i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)$ drives a net rate of change of variance, 
     973summed over the two $T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of 
    1052974\begin{equation} 
    1053975\label{eq:dvar_eiv_i} 
    1054976  _i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)\,\delta_{i+ i_p}[T^k], 
    1055977\end{equation} 
    1056 while the associated vertical skew-flux gives a variance change summed over the 
    1057 $T$-points $i,k+k_p-\half$ (above) and $i,k+k_p+\half$ (below) of 
     978while the associated vertical skew-flux gives a variance change summed over 
     979the $T$-points $i,k+k_p-\half$ (above) and $i,k+k_p+\half$ (below) of 
    1058980\begin{equation} 
    1059981\label{eq:dvar_eiv_k} 
    1060982  _i^k{\mathbb{S}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i]. 
    1061983\end{equation} 
    1062 Inspection of the definitions (\autoref{eq:skewfluxu}, \autoref{eq:skewfluxw}) 
    1063 shows that these two variance changes (\autoref{eq:dvar_eiv_i}, \autoref{eq:dvar_eiv_k}) 
    1064 sum to zero. Hence the two fluxes associated with each triad make no 
    1065 net contribution to the variance budget. 
     984Inspection of the definitions (\autoref{eq:skewfluxu}, \autoref{eq:skewfluxw}) shows that 
     985these two variance changes (\autoref{eq:dvar_eiv_i}, \autoref{eq:dvar_eiv_k}) sum to zero. 
     986Hence the two fluxes associated with each triad make no net contribution to the variance budget. 
    1066987 
    1067988\subsubsection{Reduction in gravitational PE} 
    1068 The vertical density flux associated with the vertical skew-flux 
    1069 always has the same sign as the vertical density gradient; thus, so 
    1070 long as the fluid is stable (the vertical density gradient is 
    1071 negative) the vertical density flux is negative (downward) and hence 
    1072 reduces the gravitational PE. 
     989The vertical density flux associated with the vertical skew-flux always has the same sign as 
     990the vertical density gradient; 
     991thus, so long as the fluid is stable (the vertical density gradient is negative) 
     992the vertical density flux is negative (downward) and hence reduces the gravitational PE. 
    1073993 
    1074994For the change in gravitational PE driven by the $k$-flux is 
     
    10911011\frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}}, 
    10921012\end{align} 
    1093 using the definition of the triad slope $\rtriad{R}$, 
    1094 \autoref{eq:R} to express $-\alpha _i^k\delta_{i+ i_p}[T^k]+ 
    1095 \beta_i^k\delta_{i+ i_p}[S^k]$ in terms of  $-\alpha_i^k \delta_{k+ 
    1096   k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]$. 
     1013using the definition of the triad slope $\rtriad{R}$, \autoref{eq:R} to 
     1014express $-\alpha _i^k\delta_{i+ i_p}[T^k]+\beta_i^k\delta_{i+ i_p}[S^k]$ in terms of 
     1015$-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]$. 
    10971016 
    10981017Where the coordinates slope, the $i$-flux gives a PE change 
     
    11081027\frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}}, 
    11091028\end{multline} 
    1110 (using \autoref{eq:skewfluxu}) and so the total PE change 
    1111 \autoref{eq:vert_densityPE} + \autoref{eq:lat_densityPE} associated with the triad fluxes is 
     1029(using \autoref{eq:skewfluxu}) and so the total PE change \autoref{eq:vert_densityPE} + 
     1030\autoref{eq:lat_densityPE} associated with the triad fluxes is 
    11121031\begin{multline} 
    11131032  \label{eq:tot_densityPE} 
     
    11221041 
    11231042\subsection{Treatment of the triads at the boundaries}\label{sec:skew_bdry} 
    1124 Triad slopes \rtriadt{R} used for the calculation of the eddy-induced skew-fluxes 
    1125 are masked at the boundaries in exactly the same way as are the triad 
    1126 slopes \rtriad{R} used for the iso-neutral diffusive fluxes, as 
    1127 described in \autoref{sec:iso_bdry} and 
    1128 \autoref{fig:bdry_triads}. Thus surface layer triads 
    1129 $\triadt{i}{1}{R}{1/2}{-1/2}$ and $\triadt{i+1}{1}{R}{-1/2}{-1/2}$ are 
    1130 masked, and both near bottom triad slopes $\triadt{i}{k}{R}{1/2}{1/2}$ 
    1131 and $\triadt{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the 
    1132 $i,k+1$ or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ 
    1133 $u$-point is masked. The namelist parameter \np{ln\_botmix\_triad} has 
    1134 no effect on the eddy-induced skew-fluxes. 
     1043Triad slopes \rtriadt{R} used for the calculation of the eddy-induced skew-fluxes are masked at the boundaries  
     1044in exactly the same way as are the triad slopes \rtriad{R} used for the iso-neutral diffusive fluxes,  
     1045as described in \autoref{sec:iso_bdry} and \autoref{fig:bdry_triads}.  
     1046Thus surface layer triads $\triadt{i}{1}{R}{1/2}{-1/2}$ and $\triadt{i+1}{1}{R}{-1/2}{-1/2}$ are masked,  
     1047and both near bottom triad slopes $\triadt{i}{k}{R}{1/2}{1/2}$ and $\triadt{i+1}{k}{R}{-1/2}{1/2}$ are masked when  
     1048either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ $u$-point is masked.  
     1049The namelist parameter \np{ln\_botmix\_triad} has no effect on the eddy-induced skew-fluxes. 
    11351050 
    11361051\subsection{Limiting of the slopes within the interior}\label{sec:limitskew} 
    1137 Presently, the iso-neutral slopes $\tilde{r}_i$ relative 
    1138 to geopotentials are limited to be less than $1/100$, exactly as in 
    1139 calculating the iso-neutral diffusion, \S \autoref{sec:limit}. Each 
    1140 individual triad \rtriadt{R} is so limited. 
     1052Presently, the iso-neutral slopes $\tilde{r}_i$ relative to geopotentials are limited to be less than $1/100$,  
     1053exactly as in calculating the iso-neutral diffusion, \S \autoref{sec:limit}.  
     1054Each individual triad \rtriadt{R} is so limited. 
    11411055 
    11421056\subsection{Tapering within the surface mixed layer}\label{sec:taperskew} 
    1143 The slopes $\tilde{r}_i$ relative to 
    1144 geopotentials (and thus the individual triads \rtriadt{R}) are always tapered linearly from their value immediately below the mixed layer to zero at the 
    1145 surface \autoref{eq:rmtilde}, as described in \autoref{sec:lintaper}. This is 
    1146 option (c) of \autoref{fig:eiv_slp}. This linear tapering for the 
    1147 slopes used to calculate the eddy-induced fluxes is 
    1148 unaffected by the value of \np{ln\_triad\_iso}. 
    1149  
    1150 The justification for this linear slope tapering is that, for $A_e$ 
    1151 that is constant or varies only in the horizontal (the most commonly 
    1152 used options in \NEMO: see \autoref{sec:LDF_coef}), it is 
    1153 equivalent to a horizontal eiv (eddy-induced velocity) that is uniform 
    1154 within the mixed layer \autoref{eq:eiv_v}. This ensures that the 
    1155 eiv velocities do not restratify the mixed layer \citep{Treguier1997, 
    1156   Danabasoglu_al_2008}. Equivantly, in terms 
    1157 of the skew-flux formulation we use here, the 
    1158 linear slope tapering within the mixed-layer gives a linearly varying 
    1159 vertical flux, and so a tracer convergence uniform in depth (the 
    1160 horizontal flux convergence is relatively insignificant within the mixed-layer). 
     1057The slopes $\tilde{r}_i$ relative to geopotentials (and thus the individual triads \rtriadt{R})  
     1058are always tapered linearly from their value immediately below the mixed layer to zero at the surface  
     1059\autoref{eq:rmtilde}, as described in \autoref{sec:lintaper}.  
     1060This is option (c) of \autoref{fig:eiv_slp}.  
     1061This linear tapering for the slopes used to calculate the eddy-induced fluxes is unaffected by  
     1062the value of \np{ln\_triad\_iso}. 
     1063 
     1064The justification for this linear slope tapering is that, for $A_e$ that is constant or varies only in 
     1065the horizontal (the most commonly used options in \NEMO: see \autoref{sec:LDF_coef}), 
     1066it is equivalent to a horizontal eiv (eddy-induced velocity) that is uniform within the mixed layer 
     1067\autoref{eq:eiv_v}. 
     1068This ensures that the eiv velocities do not restratify the mixed layer \citep{Treguier1997,Danabasoglu_al_2008}. 
     1069Equivantly, in terms of the skew-flux formulation we use here, 
     1070the linear slope tapering within the mixed-layer gives a linearly varying vertical flux, 
     1071and so a tracer convergence uniform in depth 
     1072(the horizontal flux convergence is relatively insignificant within the mixed-layer). 
    11611073 
    11621074\subsection{Streamfunction diagnostics}\label{sec:sfdiag} 
    1163 Where the namelist parameter \np{ln\_traldf\_gdia}\forcode{ = .true.}, diagnosed 
    1164 mean eddy-induced velocities are output. Each time step, 
    1165 streamfunctions are calculated in the $i$-$k$ and $j$-$k$ planes at 
    1166 $uw$ (integer +1/2 $i$, integer $j$, integer +1/2 $k$) and $vw$ 
    1167 (integer $i$, integer +1/2 $j$, integer +1/2 $k$) points (see Table 
    1168 \autoref{tab:cell}) respectively. We follow \citep{Griffies_Bk04} and 
    1169 calculate the streamfunction at a given $uw$-point from the 
    1170 surrounding four triads according to: 
     1075Where the namelist parameter \np{ln\_traldf\_gdia}\forcode{ = .true.}, 
     1076diagnosed mean eddy-induced velocities are output. 
     1077Each time step, streamfunctions are calculated in the $i$-$k$ and $j$-$k$ planes at 
     1078$uw$ (integer +1/2 $i$, integer $j$, integer +1/2 $k$) and $vw$ (integer $i$, integer +1/2 $j$, integer +1/2 $k$) 
     1079points (see Table \autoref{tab:cell}) respectively. 
     1080We follow \citep{Griffies_Bk04} and calculate the streamfunction at a given $uw$-point from 
     1081the surrounding four triads according to: 
    11711082\begin{equation} 
    11721083  \label{eq:sfdiagi} 
     
    11751086\end{equation} 
    11761087The streamfunction $\psi_1$ is calculated similarly at $vw$ points. 
    1177 The eddy-induced velocities are then calculated from the 
    1178 straightforward discretisation of \autoref{eq:eiv_v}: 
     1088The eddy-induced velocities are then calculated from the straightforward discretisation of \autoref{eq:eiv_v}: 
    11791089\begin{equation}\label{eq:eiv_v_discrete} 
    11801090\begin{split} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_ASM.tex

    r10146 r10368  
    1515$\ $\newline    % force a new line 
    1616 
    17 The ASM code adds the functionality to apply increments to the model variables:  
    18 temperature, salinity, sea surface height, velocity and sea ice concentration.  
    19 These are read into the model from a NetCDF file which may be produced by separate data 
    20 assimilation code.  The code can also output model background fields which are used 
    21 as an input to data assimilation code. This is all controlled by the namelist 
    22 \textit{\ngn{nam\_asminc} }.  There is a brief description of all the namelist options 
    23 provided.  To build the ASM code \key{asminc} must be set. 
     17The ASM code adds the functionality to apply increments to the model variables: temperature, salinity, 
     18sea surface height, velocity and sea ice concentration.  
     19These are read into the model from a NetCDF file which may be produced by separate data assimilation code. 
     20The code can also output model background fields which are used as an input to data assimilation code. 
     21This is all controlled by the namelist \textit{\ngn{nam\_asminc} }. 
     22There is a brief description of all the namelist options provided. 
     23To build the ASM code \key{asminc} must be set. 
    2424 
    2525%=============================================================== 
     
    2828\label{sec:ASM_DI} 
    2929 
    30 Direct initialization (DI) refers to the instantaneous correction 
    31 of the model background state using the analysis increment. 
     30Direct initialization (DI) refers to the instantaneous correction of the model background state using 
     31the analysis increment. 
    3232DI is used when \np{ln\_asmdin} is set to true. 
    3333 
     
    3636 
    3737Rather than updating the model state directly with the analysis increment, 
    38 it may be preferable to introduce the increment gradually into the ocean 
    39 model in order to minimize spurious adjustment processes. This technique 
    40 is referred to as Incremental Analysis Updates (IAU) \citep{Bloom_al_MWR96}. 
     38it may be preferable to introduce the increment gradually into the ocean model in order to 
     39minimize spurious adjustment processes. 
     40This technique is referred to as Incremental Analysis Updates (IAU) \citep{Bloom_al_MWR96}. 
    4141IAU is a common technique used with 3D assimilation methods such as 3D-Var or OI. 
    4242IAU is used when \np{ln\_asmiau} is set to true. 
    4343 
    44 With IAU, the model state trajectory ${\bf x}$ in the assimilation window  
    45 ($t_{0} \leq t_{i} \leq t_{N}$) 
    46 is corrected by adding the analysis increments for temperature, salinity, horizontal velocity and SSH 
    47 as additional tendency terms to the prognostic equations: 
     44With IAU, the model state trajectory ${\bf x}$ in the assimilation window ($t_{0} \leq t_{i} \leq t_{N}$) 
     45is corrected by adding the analysis increments for temperature, salinity, horizontal velocity and SSH as 
     46additional tendency terms to the prognostic equations: 
    4847\begin{eqnarray}     \label{eq:wa_traj_iau} 
    4948{\bf x}^{a}(t_{i}) = M(t_{i}, t_{0})[{\bf x}^{b}(t_{0})]  
    5049\; + \; F_{i} \delta \tilde{\bf x}^{a}  
    5150\end{eqnarray} 
    52 where $F_{i}$ is a weighting function for applying the increments $\delta 
    53 \tilde{\bf x}^{a}$ defined such that $\sum_{i=1}^{N} F_{i}=1$. 
    54 ${\bf x}^b$ denotes the model initial state and ${\bf x}^a$ is the model state 
    55 after the increments are applied.  
     51where $F_{i}$ is a weighting function for applying the increments $\delta\tilde{\bf x}^{a}$ defined such that 
     52$\sum_{i=1}^{N} F_{i}=1$. 
     53${\bf x}^b$ denotes the model initial state and ${\bf x}^a$ is the model state after the increments are applied. 
    5654To control the adjustment time of the model to the increment, 
    57 the increment can be applied over an arbitrary sub-window, 
    58 $t_{m} \leq t_{i} \leq t_{n}$, of the main assimilation window, 
    59 where $t_{0} \leq t_{m} \leq t_{i}$ and $t_{i} \leq t_{n} \leq t_{N}$, 
     55the increment can be applied over an arbitrary sub-window, $t_{m} \leq t_{i} \leq t_{n}$, 
     56of the main assimilation window, where $t_{0} \leq t_{m} \leq t_{i}$ and $t_{i} \leq t_{n} \leq t_{N}$. 
    6057Typically the increments are spread evenly over the full window. 
    6158In addition, two different weighting functions have been implemented. 
     
    7067\end{eqnarray} 
    7168where $M = m-n$. 
    72 The second function employs peaked hat-like weights in order to give maximum  
    73 weight in the centre of the sub-window, with the weighting reduced  
    74 linearly to a small value at the window end-points: 
     69The second function employs peaked hat-like weights in order to give maximum weight in the centre of the sub-window, 
     70with the weighting reduced linearly to a small value at the window end-points: 
    7571\begin{eqnarray}     \label{eq:F2_i} 
    7672F^{(2)}_{i} 
     
    8379\end{eqnarray} 
    8480where $\alpha^{-1} = \sum_{i=1}^{M/2} 2i$ and $M$ is assumed to be even.  
    85 The weights described by \autoref{eq:F2_i} provide a  
    86 smoother transition of the analysis trajectory from one assimilation cycle  
    87 to the next than that described by \autoref{eq:F1_i}. 
     81The weights described by \autoref{eq:F2_i} provide a smoother transition of the analysis trajectory from 
     82one assimilation cycle to the next than that described by \autoref{eq:F1_i}. 
    8883 
    8984%========================================================================== 
     
    9287\label{sec:ASM_div_dmp} 
    9388 
    94 The velocity increments may be initialized by the iterative application of  
    95 a divergence damping operator. In iteration step $n$ new estimates of  
    96 velocity increments $u^{n}_I$ and $v^{n}_I$ are updated by: 
     89The velocity increments may be initialized by the iterative application of a divergence damping operator. 
     90In iteration step $n$ new estimates of velocity increments $u^{n}_I$ and $v^{n}_I$ are updated by: 
    9791\begin{equation} \label{eq:asm_dmp} 
    9892\left\{ \begin{aligned} 
     
    110104                       +\delta _j \left[ {e_{1v}\,e_{3v}\,v^{n-1}_I} \right]} \right). 
    111105\end{equation} 
    112 By the application of \autoref{eq:asm_dmp} and \autoref{eq:asm_dmp} the divergence is filtered 
    113 in each iteration, and the vorticity is left unchanged. In the presence of coastal boundaries 
    114 with zero velocity increments perpendicular to the coast the divergence is strongly damped. 
    115 This type of the initialisation reduces the vertical velocity magnitude  and alleviates the 
    116 problem of the excessive unphysical vertical mixing in the first steps of the model  
    117 integration \citep{Talagrand_JAS72, Dobricic_al_OS07}. Diffusion coefficients are defined as  
    118 $A_D = \alpha e_{1t} e_{2t}$, where $\alpha = 0.2$. The divergence damping is activated by 
    119 assigning to \np{nn\_divdmp} in the \textit{nam\_asminc} namelist a value greater than zero.  
    120 By choosing this value to be of the order of 100 the increments in the vertical velocity will  
    121 be significantly reduced. 
     106By the application of \autoref{eq:asm_dmp} and \autoref{eq:asm_dmp} the divergence is filtered in each iteration, 
     107and the vorticity is left unchanged. 
     108In the presence of coastal boundaries with zero velocity increments perpendicular to the coast 
     109the divergence is strongly damped. 
     110This type of the initialisation reduces the vertical velocity magnitude and 
     111alleviates the problem of the excessive unphysical vertical mixing in the first steps of the model integration 
     112\citep{Talagrand_JAS72, Dobricic_al_OS07}. 
     113Diffusion coefficients are defined as $A_D = \alpha e_{1t} e_{2t}$, where $\alpha = 0.2$. 
     114The divergence damping is activated by assigning to \np{nn\_divdmp} in the \textit{nam\_asminc} namelist 
     115a value greater than zero. 
     116By choosing this value to be of the order of 100 the increments in 
     117the vertical velocity will be significantly reduced. 
    122118 
    123119 
     
    127123\label{sec:ASM_details} 
    128124 
    129 Here we show an example \ngn{namasm} namelist and the header of an example assimilation  
    130 increments file on the ORCA2 grid. 
     125Here we show an example \ngn{namasm} namelist and the header of an example assimilation increments file on 
     126the ORCA2 grid. 
    131127 
    132128%------------------------------------------namasm----------------------------------------------------- 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_CONFIG.tex

    r10146 r10368  
    1818 
    1919 
    20 The purpose of this part of the manual is to introduce the \NEMO reference configurations.  
    21 These configurations are offered as means to explore various numerical and physical options,  
    22 thus allowing the user to verify that the code is performing in a manner consistent with that  
    23 we are running. This form of verification is critical as one adopts the code for his or her particular  
    24 research purposes. The reference configurations also provide a sense for some of the options available  
    25 in the code, though by no means are all options exercised in the reference configurations. 
     20The purpose of this part of the manual is to introduce the \NEMO reference configurations. 
     21These configurations are offered as means to explore various numerical and physical options, 
     22thus allowing the user to verify that the code is performing in a manner consistent with that we are running. 
     23This form of verification is critical as one adopts the code for his or her particular research purposes. 
     24The reference configurations also provide a sense for some of the options available in the code, 
     25though by no means are all options exercised in the reference configurations. 
    2626 
    2727%------------------------------------------namcfg---------------------------------------------------- 
     
    4040$\ $\newline 
    4141 
    42 The 1D model option simulates a stand alone water column within the 3D \NEMO system.  
    43 It can be applied to the ocean alone or to the ocean-ice system and can include passive tracers  
    44 or a biogeochemical model. It is set up by defining the position of the 1D water column in the grid  
     42The 1D model option simulates a stand alone water column within the 3D \NEMO system. 
     43It can be applied to the ocean alone or to the ocean-ice system and can include passive tracers or a biogeochemical model. 
     44It is set up by defining the position of the 1D water column in the grid 
    4545(see \textit{CONFIG/SHARED/namelist\_ref} ).  
    46 The 1D model is a very useful tool   
    47 \textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes ;  
    48 \textit{(b)} to investigate suitable parameterisations of unresolved turbulence (surface wave 
    49 breaking, Langmuir circulation, ...) ;  
    50 \textit{(c)} to compare the behaviour of different vertical mixing schemes  ;  
    51 \textit{(d)} to perform sensitivity studies on the vertical diffusion at a particular point of an ocean domain ;  
     46The 1D model is a very useful tool 
     47\textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes; 
     48\textit{(b)} to investigate suitable parameterisations of unresolved turbulence 
     49(surface wave breaking, Langmuir circulation, ...); 
     50\textit{(c)} to compare the behaviour of different vertical mixing schemes; 
     51\textit{(d)} to perform sensitivity studies on the vertical diffusion at a particular point of an ocean domain; 
    5252\textit{(d)} to produce extra diagnostics, without the large memory requirement of the full 3D model. 
    5353 
    54 The methodology is based on the use of the zoom functionality over the smallest possible  
    55 domain : a 3x3 domain centered on the grid point of interest,  
    56 with some extra routines. There is no need to define a new mesh, bathymetry,  
    57 initial state or forcing, since the 1D model will use those of the configuration it is a zoom of.  
    58 The chosen grid point is set in \textit{\ngn{namcfg}} namelist by setting the \np{jpizoom} and \np{jpjzoom}  
    59 parameters to the indices of the location of the chosen grid point. 
    60  
    61 The 1D model has some specifies. First, all the horizontal derivatives are assumed to be zero, and 
    62 second, the two components of the velocity are moved on a $T$-point.  
     54The methodology is based on the use of the zoom functionality over the smallest possible domain: 
     55a 3x3 domain centered on the grid point of interest, with some extra routines. 
     56There is no need to define a new mesh, bathymetry, initial state or forcing, 
     57since the 1D model will use those of the configuration it is a zoom of. 
     58The chosen grid point is set in \textit{\ngn{namcfg}} namelist by 
     59setting the \np{jpizoom} and \np{jpjzoom} parameters to the indices of the location of the chosen grid point. 
     60 
     61The 1D model has some specifies. First, all the horizontal derivatives are assumed to be zero, 
     62and second, the two components of the velocity are moved on a $T$-point.  
    6363Therefore, defining \key{c1d} changes five main things in the code behaviour:  
    6464\begin{description} 
    65 \item[(1)] the lateral boundary condition routine (\rou{lbc\_lnk}) set the value of the central column  
    66 of the 3x3 domain is imposed over the whole domain ;  
    67 \item[(3)] a call to \rou{lbc\_lnk} is systematically done when reading input data ($i.e.$ in \mdl{iom}) ;  
    68 \item[(3)] a simplified \rou{stp} routine is used (\rou{stp\_c1d}, see \mdl{step\_c1d} module) in which  
    69 both lateral tendancy terms and lateral physics are not called ;  
    70 \item[(4)] the vertical velocity is zero (so far, no attempt at introducing a Ekman pumping velocity  
    71 has been made) ;  
    72 \item[(5)] a simplified treatment of the Coriolis term is performed as $U$- and $V$-points are the same  
    73 (see \mdl{dyncor\_c1d}). 
     65\item[(1)] 
     66  the lateral boundary condition routine (\rou{lbc\_lnk}) set the value of the central column of 
     67  the 3x3 domain is imposed over the whole domain; 
     68\item[(3)] 
     69  a call to \rou{lbc\_lnk} is systematically done when reading input data ($i.e.$ in \mdl{iom}); 
     70\item[(3)] 
     71  a simplified \rou{stp} routine is used (\rou{stp\_c1d}, see \mdl{step\_c1d} module) in which 
     72  both lateral tendancy terms and lateral physics are not called; 
     73\item[(4)] 
     74  the vertical velocity is zero 
     75  (so far, no attempt at introducing a Ekman pumping velocity has been made); 
     76\item[(5)] 
     77  a simplified treatment of the Coriolis term is performed as $U$- and $V$-points are the same 
     78  (see \mdl{dyncor\_c1d}). 
    7479\end{description} 
    75 All the relevant \textit{\_c1d} modules can be found in the NEMOGCM/NEMO/OPA\_SRC/C1D directory of  
     80All the relevant \textit{\_c1d} modules can be found in the NEMOGCM/NEMO/OPA\_SRC/C1D directory of 
    7681the \NEMO distribution. 
    7782 
     
    8489\label{sec:CFG_orca} 
    8590 
    86 The ORCA family is a series of global ocean configurations that are run together with  
    87 the LIM sea-ice model (ORCA-LIM) and possibly with PISCES biogeochemical model  
    88 (ORCA-LIM-PISCES), using various resolutions. 
    89 An appropriate namelist is available in \path{CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg}  
    90 for ORCA2. 
    91 The domain of ORCA2 configuration is defined in \ifile{ORCA\_R2\_zps\_domcfg} file, this file is available in tar file in the wiki of NEMO : \\ 
     91The ORCA family is a series of global ocean configurations that are run together with 
     92the LIM sea-ice model (ORCA-LIM) and possibly with PISCES biogeochemical model (ORCA-LIM-PISCES), 
     93using various resolutions. 
     94An appropriate namelist is available in \path{CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg} for ORCA2. 
     95The domain of ORCA2 configuration is defined in \ifile{ORCA\_R2\_zps\_domcfg} file, 
     96this file is available in tar file in the wiki of NEMO: \\ 
    9297https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ReferenceConfigurations/ORCA2\_LIM3\_PISCES \\ 
    9398In this namelist\_cfg the name of domain input file is set in \ngn{namcfg} block of namelist.  
    9499 
    95100%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    96 \begin{figure}[!t]   \begin{center} 
    97 \includegraphics[width=0.98\textwidth]{Fig_ORCA_NH_mesh} 
    98 \caption{  \protect\label{fig:MISC_ORCA_msh}      
    99 ORCA mesh conception. The departure from an isotropic Mercator grid start poleward of 20\degN. 
    100 The two "north pole" are the foci of a series of embedded ellipses (blue curves)  
    101 which are determined analytically and form the i-lines of the ORCA mesh (pseudo latitudes).  
    102 Then, following \citet{Madec_Imbard_CD96}, the normal to the series of ellipses (red curves) is computed  
    103 which provide the j-lines of the mesh (pseudo longitudes).  } 
    104 \end{center}   \end{figure} 
     101\begin{figure}[!t] 
     102  \begin{center} 
     103    \includegraphics[width=0.98\textwidth]{Fig_ORCA_NH_mesh} 
     104    \caption{  \protect\label{fig:MISC_ORCA_msh} 
     105      ORCA mesh conception. 
     106      The departure from an isotropic Mercator grid start poleward of 20\degN. 
     107      The two "north pole" are the foci of a series of embedded ellipses (blue curves) which 
     108      are determined analytically and form the i-lines of the ORCA mesh (pseudo latitudes). 
     109      Then, following \citet{Madec_Imbard_CD96}, the normal to the series of ellipses (red curves) is computed which 
     110      provides the j-lines of the mesh (pseudo longitudes).  } 
     111  \end{center} 
     112\end{figure} 
    105113%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    106114 
     
    111119\label{subsec:CFG_orca_grid} 
    112120 
    113 The ORCA grid is a tripolar is based on the semi-analytical method of \citet{Madec_Imbard_CD96}.  
    114 It allows to construct a global orthogonal curvilinear ocean mesh which has no singularity point inside  
     121The ORCA grid is a tripolar is based on the semi-analytical method of \citet{Madec_Imbard_CD96}. 
     122It allows to construct a global orthogonal curvilinear ocean mesh which has no singularity point inside 
    115123the computational domain since two north mesh poles are introduced and placed on lands. 
    116 The method involves defining an analytical set of mesh parallels in the stereographic polar plan,  
    117 computing the associated set of mesh meridians, and projecting the resulting mesh onto the sphere.  
    118 The set of mesh parallels used is a series of embedded ellipses which foci are the two mesh north  
    119 poles (\autoref{fig:MISC_ORCA_msh}). The resulting mesh presents no loss of continuity in  
    120 either the mesh lines or the scale factors, or even the scale factor derivatives over the whole  
    121 ocean domain, as the mesh is not a composite mesh.  
    122 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    123 \begin{figure}[!tbp]  \begin{center} 
    124 \includegraphics[width=1.0\textwidth]{Fig_ORCA_NH_msh05_e1_e2} 
    125 \includegraphics[width=0.80\textwidth]{Fig_ORCA_aniso} 
    126 \caption {  \protect\label{fig:MISC_ORCA_e1e2} 
    127 \textit{Top}: Horizontal scale factors ($e_1$, $e_2$) and  
    128 \textit{Bottom}: ratio of anisotropy ($e_1 / e_2$) 
    129 for ORCA 0.5\deg ~mesh. South of 20\degN a Mercator grid is used ($e_1 = e_2$)  
    130 so that the anisotropy ratio is 1. Poleward of 20\degN, the two "north pole"  
    131 introduce a weak anisotropy over the ocean areas ($< 1.2$) except in vicinity of Victoria Island  
    132 (Canadian Arctic Archipelago). } 
     124The method involves defining an analytical set of mesh parallels in the stereographic polar plan, 
     125computing the associated set of mesh meridians, and projecting the resulting mesh onto the sphere. 
     126The set of mesh parallels used is a series of embedded ellipses which foci are the two mesh north poles 
     127(\autoref{fig:MISC_ORCA_msh}). 
     128The resulting mesh presents no loss of continuity in either the mesh lines or the scale factors, 
     129or even the scale factor derivatives over the whole ocean domain, as the mesh is not a composite mesh.  
     130%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     131\begin{figure}[!tbp] 
     132  \begin{center} 
     133    \includegraphics[width=1.0\textwidth]{Fig_ORCA_NH_msh05_e1_e2} 
     134    \includegraphics[width=0.80\textwidth]{Fig_ORCA_aniso} 
     135    \caption {  \protect\label{fig:MISC_ORCA_e1e2} 
     136      \textit{Top}: Horizontal scale factors ($e_1$, $e_2$) and 
     137      \textit{Bottom}: ratio of anisotropy ($e_1 / e_2$) 
     138      for ORCA 0.5\deg ~mesh. 
     139      South of 20\degN a Mercator grid is used ($e_1 = e_2$) so that the anisotropy ratio is 1. 
     140      Poleward of 20\degN, the two "north pole" introduce a weak anisotropy over the ocean areas ($< 1.2$) except in 
     141      vicinity of Victoria Island (Canadian Arctic Archipelago). } 
    133142\end{center}   \end{figure} 
    134143%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    135144 
    136145 
    137 The method is applied to Mercator grid ($i.e.$ same zonal and meridional grid spacing) poleward  
    138 of 20\degN, so that the Equator is a mesh line, which provides a better numerical solution  
    139 for equatorial dynamics. The choice of the series of embedded ellipses (position of the foci and  
    140 variation of the ellipses) is a compromise between maintaining  the ratio of mesh anisotropy  
    141 ($e_1 / e_2$) close to one in the ocean (especially in area of strong eddy activities such as  
    142 the Gulf Stream) and keeping the smallest scale factor in the northern hemisphere larger  
    143 than the smallest one in the southern hemisphere. 
    144 The resulting mesh is shown in \autoref{fig:MISC_ORCA_msh} and \autoref{fig:MISC_ORCA_e1e2}  
    145 for a half a degree grid (ORCA\_R05). 
    146 The smallest ocean scale factor is found in along  Antarctica, while the ratio of anisotropy remains close to one except near the Victoria Island  
    147 in the Canadian Archipelago.  
     146The method is applied to Mercator grid ($i.e.$ same zonal and meridional grid spacing) poleward of 20\degN, 
     147so that the Equator is a mesh line, which provides a better numerical solution for equatorial dynamics. 
     148The choice of the series of embedded ellipses (position of the foci and variation of the ellipses) 
     149is a compromise between maintaining the ratio of mesh anisotropy ($e_1 / e_2$) close to one in the ocean 
     150(especially in area of strong eddy activities such as the Gulf Stream) and keeping the smallest scale factor in 
     151the northern hemisphere larger than the smallest one in the southern hemisphere. 
     152The resulting mesh is shown in \autoref{fig:MISC_ORCA_msh} and \autoref{fig:MISC_ORCA_e1e2} for 
     153a half a degree grid (ORCA\_R05). 
     154The smallest ocean scale factor is found in along Antarctica, 
     155while the ratio of anisotropy remains close to one except near the Victoria Island in the Canadian Archipelago.  
    148156 
    149157% ------------------------------------------------------------------------------------------------------------- 
     
    154162 
    155163 
    156 The NEMO system is provided with five built-in ORCA configurations which differ in the  
    157 horizontal resolution. The value of the resolution is given by the resolution at the Equator  
    158 expressed in degrees. Each of configuration is set through the \textit{domain\_cfg} domain configuration file,  
    159 which sets the grid size and configuration name parameters. The NEMO System Team provides only ORCA2 domain input file "\ifile{ORCA\_R2\_zps\_domcfg}" file  (Tab. \autoref{tab:ORCA}). 
     164The NEMO system is provided with five built-in ORCA configurations which differ in the horizontal resolution. 
     165The value of the resolution is given by the resolution at the Equator expressed in degrees. 
     166Each of configuration is set through the \textit{domain\_cfg} domain configuration file, 
     167which sets the grid size and configuration name parameters. 
     168The NEMO System Team provides only ORCA2 domain input file "\ifile{ORCA\_R2\_zps\_domcfg}" file 
     169(Tab. \autoref{tab:ORCA}). 
    160170 
    161171 
     
    176186\hline   \hline 
    177187\end{tabular} 
    178 \caption{ \protect\label{tab:ORCA}    
    179 Domain size of ORCA family configurations. 
    180 The flag for configurations of ORCA family need to be set in \textit{domain\_cfg} file. } 
     188\caption{ \protect\label{tab:ORCA} 
     189  Domain size of ORCA family configurations. 
     190  The flag for configurations of ORCA family need to be set in \textit{domain\_cfg} file. } 
    181191\end{center} 
    182192\end{table} 
     
    184194 
    185195 
    186 The ORCA\_R2 configuration has the following specificity : starting from a 2\deg~ORCA mesh,  
    187 local mesh refinements were applied to the Mediterranean, Red, Black and Caspian Seas,  
    188 so that the resolution is 1\deg \time 1\deg there. A local transformation were also applied  
    189 with in the Tropics in order to refine the meridional resolution up to 0.5\deg at the Equator. 
    190  
    191 The ORCA\_R1 configuration has only a local tropical transformation  to refine the meridional  
    192 resolution up to 1/3\deg~at the Equator. Note that the tropical mesh refinements in ORCA\_R2  
    193 and R1 strongly increases the mesh anisotropy there. 
     196The ORCA\_R2 configuration has the following specificity: starting from a 2\deg~ORCA mesh, 
     197local mesh refinements were applied to the Mediterranean, Red, Black and Caspian Seas, 
     198so that the resolution is 1\deg \time 1\deg there. 
     199A local transformation were also applied with in the Tropics in order to refine the meridional resolution up to 
     2000.5\deg at the Equator. 
     201 
     202The ORCA\_R1 configuration has only a local tropical transformation to refine the meridional resolution up to 
     2031/3\deg~at the Equator. 
     204Note that the tropical mesh refinements in ORCA\_R2 and R1 strongly increases the mesh anisotropy there. 
    194205 
    195206The ORCA\_R05 and higher global configurations do not incorporate any regional refinements.   
    196207 
    197 For ORCA\_R1 and R025, setting the configuration key to 75 allows to use 75 vertical levels,  
    198 otherwise 46 are used. In the other ORCA configurations, 31 levels are used  
     208For ORCA\_R1 and R025, setting the configuration key to 75 allows to use 75 vertical levels, otherwise 46 are used. 
     209In the other ORCA configurations, 31 levels are used 
    199210(see \autoref{tab:orca_zgr} \sfcomment{HERE I need to put new table for ORCA2 values} and \autoref{fig:zgr}). 
    200211 
    201 Only the ORCA\_R2 is provided with all its input files in the \NEMO distribution.  
    202 It is very similar to that used as part of the climate model developed at IPSL for the 4th IPCC  
    203 assessment of climate change (Marti et al., 2009). It is also the basis for the \NEMO contribution  
    204 to the Coordinate Ocean-ice Reference Experiments (COREs) documented in \citet{Griffies_al_OM09}.  
    205  
    206 This version of ORCA\_R2 has 31 levels in the vertical, with the highest resolution (10m)  
    207 in the upper 150m (see \autoref{tab:orca_zgr} and \autoref{fig:zgr}).  
     212Only the ORCA\_R2 is provided with all its input files in the \NEMO distribution. 
     213It is very similar to that used as part of the climate model developed at IPSL for the 4th IPCC assessment of 
     214climate change (Marti et al., 2009). 
     215It is also the basis for the \NEMO contribution to the Coordinate Ocean-ice Reference Experiments (COREs) 
     216documented in \citet{Griffies_al_OM09}.  
     217 
     218This version of ORCA\_R2 has 31 levels in the vertical, with the highest resolution (10m) in the upper 150m 
     219(see \autoref{tab:orca_zgr} and \autoref{fig:zgr}).  
    208220The bottom topography and the coastlines are derived from the global atlas of Smith and Sandwell (1997).  
    209221The default forcing uses the boundary forcing from \citet{Large_Yeager_Rep04} (see \autoref{subsec:SBC_blk_core}),  
    210 which was developed for the purpose of running global coupled ocean-ice simulations  
    211 without an interactive atmosphere. This \citet{Large_Yeager_Rep04} dataset is available  
    212 through the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}{GFDL web site}.  
    213 The "normal year" of \citet{Large_Yeager_Rep04} has been chosen of the \NEMO distribution  
    214 since release v3.3.  
    215  
    216 ORCA\_R2 pre-defined configuration can also be run with an AGRIF zoom over the Agulhas  
    217 current area ( \key{agrif}  defined) and, by setting the appropriate variables, see \path{CONFIG/SHARED/namelist_ref} 
    218 a regional Arctic or peri-Antarctic configuration is extracted from an ORCA\_R2 or R05 configurations 
    219 using sponge layers at open boundaries.  
     222which was developed for the purpose of running global coupled ocean-ice simulations without 
     223an interactive atmosphere. 
     224This \citet{Large_Yeager_Rep04} dataset is available through 
     225the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}{GFDL web site}. 
     226The "normal year" of \citet{Large_Yeager_Rep04} has been chosen of the \NEMO distribution since release v3.3.  
     227 
     228ORCA\_R2 pre-defined configuration can also be run with an AGRIF zoom over the Agulhas current area 
     229(\key{agrif} defined) and, by setting the appropriate variables, see \path{CONFIG/SHARED/namelist_ref}. 
     230A regional Arctic or peri-Antarctic configuration is extracted from an ORCA\_R2 or R05 configurations using 
     231sponge layers at open boundaries.  
    220232 
    221233% ------------------------------------------------------------------------------------------------------------- 
     
    225237\label{sec:CFG_gyre} 
    226238 
    227 The GYRE configuration \citep{Levy_al_OM10} has been built to simulate 
    228 the seasonal cycle of a double-gyre box model. It consists in an idealized domain  
    229 similar to that used in the studies of \citet{Drijfhout_JPO94} and \citet{Hazeleger_Drijfhout_JPO98,  
    230 Hazeleger_Drijfhout_JPO99, Hazeleger_Drijfhout_JGR00, Hazeleger_Drijfhout_JPO00},  
    231 over which an analytical seasonal forcing is applied. This allows to investigate the  
    232 spontaneous generation of a large number of interacting, transient mesoscale eddies  
     239The GYRE configuration \citep{Levy_al_OM10} has been built to 
     240simulate the seasonal cycle of a double-gyre box model. 
     241It consists in an idealized domain similar to that used in the studies of \citet{Drijfhout_JPO94} and 
     242\citet{Hazeleger_Drijfhout_JPO98, Hazeleger_Drijfhout_JPO99, Hazeleger_Drijfhout_JGR00, Hazeleger_Drijfhout_JPO00}, 
     243over which an analytical seasonal forcing is applied. 
     244This allows to investigate the spontaneous generation of a large number of interacting, transient mesoscale eddies  
    233245and their contribution to the large scale circulation.  
    234246 
    235 The domain geometry is a closed rectangular basin on the $\beta$-plane centred  
    236 at $\sim$ 30\degN and rotated by 45\deg, 3180~km long, 2120~km wide  
    237 and 4~km deep (\autoref{fig:MISC_strait_hand}).  
    238 The domain is bounded by vertical walls and by a flat bottom. The configuration is  
    239 meant to represent an idealized North Atlantic or North Pacific basin.  
    240 The circulation is forced by analytical profiles of wind and buoyancy fluxes.  
    241 The applied forcings vary seasonally in a sinusoidal manner between winter  
    242 and summer extrema \citep{Levy_al_OM10}.  
    243 The wind stress is zonal and its curl changes sign at 22\degN and 36\degN.  
    244 It forces a subpolar gyre in the north, a subtropical gyre in the wider part of the domain  
    245 and a small recirculation gyre in the southern corner.  
    246 The net heat flux takes the form of a restoring toward a zonal apparent air  
    247 temperature profile. A portion of the net heat flux which comes from the solar radiation 
    248 is allowed to penetrate within the water column.  
    249 The fresh water flux is also prescribed and varies zonally.  
    250 It is determined such as, at each time step, the basin-integrated flux is zero.  
    251 The basin is initialised at rest with vertical profiles of temperature and salinity  
    252 uniformly applied to the whole domain. 
    253  
    254 The GYRE configuration is set like an analytical configuration. Through \np{ln\_read\_cfg}\forcode{ = .false.} in \textit{namcfg} namelist defined in the reference configuration \path{CONFIG/GYRE/EXP00/namelist_cfg} anaylitical definition of grid in GYRE is done in usrdef\_hrg, usrdef\_zgr routines. Its horizontal resolution  
    255 (and thus the size of the domain) is determined by setting \np{nn\_GYRE} in  \ngn{namusr\_def}: \\ 
     247The domain geometry is a closed rectangular basin on the $\beta$-plane centred at $\sim$ 30\degN and 
     248rotated by 45\deg, 3180~km long, 2120~km wide and 4~km deep (\autoref{fig:MISC_strait_hand}). 
     249The domain is bounded by vertical walls and by a flat bottom. 
     250The configuration is meant to represent an idealized North Atlantic or North Pacific basin. 
     251The circulation is forced by analytical profiles of wind and buoyancy fluxes. 
     252The applied forcings vary seasonally in a sinusoidal manner between winter and summer extrema \citep{Levy_al_OM10}.  
     253The wind stress is zonal and its curl changes sign at 22\degN and 36\degN. 
     254It forces a subpolar gyre in the north, a subtropical gyre in the wider part of the domain and 
     255a small recirculation gyre in the southern corner. 
     256The net heat flux takes the form of a restoring toward a zonal apparent air temperature profile. 
     257A portion of the net heat flux which comes from the solar radiation is allowed to penetrate within the water column. 
     258The fresh water flux is also prescribed and varies zonally. 
     259It is determined such as, at each time step, the basin-integrated flux is zero. 
     260The basin is initialised at rest with vertical profiles of temperature and salinity uniformly applied to 
     261the whole domain. 
     262 
     263The GYRE configuration is set like an analytical configuration. 
     264Through \np{ln\_read\_cfg}\forcode{ = .false.} in \textit{namcfg} namelist defined in 
     265the reference configuration \path{CONFIG/GYRE/EXP00/namelist_cfg} 
     266analytical definition of grid in GYRE is done in usrdef\_hrg, usrdef\_zgr routines. 
     267Its horizontal resolution (and thus the size of the domain) is determined by 
     268setting \np{nn\_GYRE} in \ngn{namusr\_def}: \\ 
    256269\np{jpiglo} $= 30 \times$ \np{nn\_GYRE} + 2   \\ 
    257270\np{jpjglo} $= 20 \times$ \np{nn\_GYRE} + 2   \\ 
    258 Obviously, the namelist parameters have to be adjusted to the chosen resolution, see the Configurations  
    259 pages on the NEMO web site (Using NEMO\/Configurations) . 
     271Obviously, the namelist parameters have to be adjusted to the chosen resolution, 
     272see the Configurations pages on the NEMO web site (Using NEMO\/Configurations). 
    260273In the vertical, GYRE uses the default 30 ocean levels (\jp{jpk}\forcode{ = 31}) (\autoref{fig:zgr}). 
    261274 
    262 The GYRE configuration is also used in benchmark test as it is very simple to increase  
    263 its resolution and as it does not requires any input file. For example, keeping a same model size  
    264 on each processor while increasing the number of processor used is very easy, even though the  
    265 physical integrity of the solution can be compromised. Benchmark is activate via \np{ln\_bench}\forcode{ = .true.} in \ngn{namusr\_def} in namelist \path{CONFIG/GYRE/EXP00/namelist_cfg}. 
    266  
    267 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    268 \begin{figure}[!t]   \begin{center} 
    269 \includegraphics[width=1.0\textwidth]{Fig_GYRE} 
    270 \caption{  \protect\label{fig:GYRE}    
    271 Snapshot of relative vorticity at the surface of the model domain  
    272 in GYRE R9, R27 and R54. From \citet{Levy_al_OM10}.} 
    273 \end{center}   \end{figure} 
     275The GYRE configuration is also used in benchmark test as it is very simple to increase its resolution and 
     276as it does not requires any input file. 
     277For example, keeping a same model size on each processor while increasing the number of processor used is very easy, 
     278even though the physical integrity of the solution can be compromised. 
     279Benchmark is activate via \np{ln\_bench}\forcode{ = .true.} in \ngn{namusr\_def} in 
     280namelist \path{CONFIG/GYRE/EXP00/namelist_cfg}. 
     281 
     282%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     283\begin{figure}[!t] 
     284  \begin{center} 
     285    \includegraphics[width=1.0\textwidth]{Fig_GYRE} 
     286    \caption{  \protect\label{fig:GYRE} 
     287      Snapshot of relative vorticity at the surface of the model domain in GYRE R9, R27 and R54. 
     288      From \citet{Levy_al_OM10}.} 
     289  \end{center} 
     290\end{figure} 
    274291%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    275292 
     
    280297\label{sec:MISC_config_AMM} 
    281298 
    282 The AMM, Atlantic Margins Model, is a regional model covering the 
    283 Northwest European Shelf domain on a regular lat-lon grid at 
    284 approximately 12km horizontal resolution. The appropriate  
    285 \textit{\&namcfg} namelist  is available in \textit{CONFIG/AMM12/EXP00/namelist\_cfg}. 
     299The AMM, Atlantic Margins Model, is a regional model covering the Northwest European Shelf domain on 
     300a regular lat-lon grid at approximately 12km horizontal resolution. 
     301The appropriate \textit{\&namcfg} namelist  is available in \textit{CONFIG/AMM12/EXP00/namelist\_cfg}. 
    286302It is used to build the correct dimensions of the AMM domain. 
    287303 
    288 This configuration tests several features of NEMO functionality specific 
    289 to the shelf seas. 
    290 In particular, the AMM uses $S$-coordinates in the vertical rather than 
    291 $z$-coordinates and is forced with tidal lateral boundary conditions 
    292 using a flather boundary condition from the BDY module. 
    293 The AMM configuration  uses the GLS (\key{zdfgls}) turbulence scheme, the 
    294 VVL non-linear free surface(\key{vvl}) and time-splitting 
    295 (\key{dynspg\_ts}). 
    296  
    297 In addition to the tidal boundary condition the model may also take 
    298 open boundary conditions from a North Atlantic model. Boundaries may be 
    299 completely omitted by setting \np{ln\_bdy} to false. 
    300 Sample surface fluxes, river forcing and a sample initial restart file 
    301 are included to test a realistic model run. The Baltic boundary is 
    302 included within the river input file and is specified as a river source. 
    303 Unlike ordinary river points the Baltic inputs also include salinity and 
    304 temperature data. 
     304This configuration tests several features of NEMO functionality specific to the shelf seas. 
     305In particular, the AMM uses $S$-coordinates in the vertical rather than $z$-coordinates and 
     306is forced with tidal lateral boundary conditions using a flather boundary condition from the BDY module. 
     307The AMM configuration uses the GLS (\key{zdfgls}) turbulence scheme, 
     308the VVL non-linear free surface(\key{vvl}) and time-splitting (\key{dynspg\_ts}). 
     309 
     310In addition to the tidal boundary condition the model may also take open boundary conditions from 
     311a North Atlantic model. 
     312Boundaries may be completely omitted by setting \np{ln\_bdy} to false. 
     313Sample surface fluxes, river forcing and a sample initial restart file are included to test a realistic model run. 
     314The Baltic boundary is included within the river input file and is specified as a river source. 
     315Unlike ordinary river points the Baltic inputs also include salinity and temperature data. 
    305316 
    306317\end{document} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_DIA.tex

    r10146 r10368  
    1717\label{sec:DIA_io_old} 
    1818 
    19 The model outputs are of three types: the restart file, the output listing, and  
    20 the diagnostic output file(s). 
    21 The restart file is used internally by the code when the user wants to start the model with  
     19The model outputs are of three types: the restart file, the output listing, and the diagnostic output file(s). 
     20The restart file is used internally by the code when the user wants to start the model with 
    2221initial conditions defined by a previous simulation. 
    23 It contains all the information that is necessary in order for there to be no changes in  
    24 the model results (even at the computer precision) between a run performed with several restarts and  
     22It contains all the information that is necessary in order for there to be no changes in the model results 
     23(even at the computer precision) between a run performed with several restarts and 
    2524the same run performed in one step. 
    26 It should be noted that this requires that the restart file contains two consecutive time steps for  
    27 all the prognostic variables, and that it is saved in the same binary format as the one used by  
    28 the computer that is to read it (in particular, 32 bits binary IEEE format must not be used for this file). 
    29  
    30 The output listing and file(s) are predefined but should be checked and eventually adapted to  
    31 the user's needs. 
     25It should be noted that this requires that the restart file contains two consecutive time steps for 
     26all the prognostic variables, and that it is saved in the same binary format as the one used by the computer that 
     27is to read it (in particular, 32 bits binary IEEE format must not be used for this file). 
     28 
     29The output listing and file(s) are predefined but should be checked and eventually adapted to the user's needs. 
    3230The output listing is stored in the $ocean.output$ file. 
    3331The information is printed from within the code on the logical unit $numout$. 
     
    3533 
    3634By default, diagnostic output files are written in NetCDF format. 
    37 Since version 3.2, when defining \key{iomput}, an I/O server has been added which  
    38 provides more flexibility in the choice of the fields to be written as well as  
    39 how the writing work is distributed over the processors in massively parallel computing.  
    40 A complete description of the use of this I/O server is presented in the next section.  
    41  
    42 By default, \key{iomput} is not defined, NEMO produces NetCDF with the old IOIPSL library which  
    43 has been kept for compatibility and its easy installation. 
    44 However, the IOIPSL library is quite inefficient on parallel machines and, since version 3.2,  
    45 many diagnostic options have been added presuming the use of \key{iomput}.  
    46 The usefulness of the default IOIPSL-based option is expected to reduce with each new release.  
    47 If \key{iomput} is not defined, output files and content are defined in the \mdl{diawri} module and  
    48 contain mean (or instantaneous if \key{diainstant} is defined) values over a regular period of  
     35Since version 3.2, when defining \key{iomput}, an I/O server has been added which 
     36provides more flexibility in the choice of the fields to be written as well as how 
     37the writing work is distributed over the processors in massively parallel computing. 
     38A complete description of the use of this I/O server is presented in the next section. 
     39 
     40By default, \key{iomput} is not defined, 
     41NEMO produces NetCDF with the old IOIPSL library which has been kept for compatibility and its easy installation. 
     42However, the IOIPSL library is quite inefficient on parallel machines and, since version 3.2, 
     43many diagnostic options have been added presuming the use of \key{iomput}. 
     44The usefulness of the default IOIPSL-based option is expected to reduce with each new release. 
     45If \key{iomput} is not defined, output files and content are defined in the \mdl{diawri} module and 
     46contain mean (or instantaneous if \key{diainstant} is defined) values over a regular period of 
    4947nn\_write time-steps (namelist parameter).  
    5048 
     
    5755\label{sec:DIA_iom} 
    5856 
    59 Since version 3.2, iomput is the NEMO output interface of choice.  
    60 It has been designed to be simple to use, flexible and efficient.  
     57Since version 3.2, iomput is the NEMO output interface of choice. 
     58It has been designed to be simple to use, flexible and efficient. 
    6159The two main purposes of iomput are:  
    6260 
    6361\begin{enumerate} 
    64    \item The complete and flexible control of the output files through external XML files adapted by  
    65          the user from standard templates. 
    66    \item To achieve high performance and scalable output through the optional distribution of  
    67          all diagnostic output related tasks to dedicated processes. 
     62\item 
     63  The complete and flexible control of the output files through external XML files adapted by 
     64  the user from standard templates. 
     65\item 
     66  To achieve high performance and scalable output through the optional distribution of 
     67  all diagnostic output related tasks to dedicated processes. 
    6868\end{enumerate} 
    6969 
     
    7272 
    7373\begin{itemize} 
    74    \item The choice of output frequencies that can be different for each file  
    75          (including real months and years). 
    76    \item The choice of file contents; includes complete flexibility over which data are written in  
    77          which files (the same data can be written in different files). 
    78    \item The possibility to split output files at a chosen frequency. 
    79    \item The possibility to extract a vertical or an horizontal subdomain. 
    80    \item The choice of the temporal operation to perform,  
    81          e.g.: average, accumulate, instantaneous, min, max and once. 
    82    \item Control over metadata via a large XML "database" of possible output fields. 
     74\item 
     75  The choice of output frequencies that can be different for each file (including real months and years). 
     76\item 
     77  The choice of file contents; includes complete flexibility over which data are written in which files 
     78  (the same data can be written in different files). 
     79\item 
     80  The possibility to split output files at a chosen frequency. 
     81\item 
     82  The possibility to extract a vertical or an horizontal subdomain. 
     83\item 
     84  The choice of the temporal operation to perform, $e.g.$: average, accumulate, instantaneous, min, max and once. 
     85\item 
     86  Control over metadata via a large XML "database" of possible output fields. 
    8387\end{itemize} 
    8488 
    85 In addition, iomput allows the user to add in the code the output of any new variable (scalar, 2D or  
    86 3D) in a very easy way. 
     89In addition, iomput allows the user to add in the code the output of any new variable (scalar, 2D or 3D) 
     90in a very easy way. 
    8791All details of iomput functionalities are listed in the following subsections. 
    88 Examples of the XML files that control the outputs can be found in:  
    89 \path{NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml}, \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and  
    90 \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}. \\ 
     92Examples of the XML files that control the outputs can be found in: \path{NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml}, 
     93\path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}. \\ 
    9194 
    9295The second functionality targets output performance when running in parallel (\key{mpp\_mpi}). 
    93 Iomput provides the possibility to specify N dedicated I/O processes (in addition to  
    94 the NEMO processes) to collect and write the outputs. 
    95 With an appropriate choice of N by the user, the bottleneck associated with the writing of  
     96Iomput provides the possibility to specify N dedicated I/O processes (in addition to the NEMO processes) 
     97to collect and write the outputs. 
     98With an appropriate choice of N by the user, the bottleneck associated with the writing of 
    9699the output files can be greatly reduced. 
    97100 
    98 In version 3.6, the iom\_put interface depends on an external code called  
    99 \href{https://forge.ipsl.jussieu.fr/ioserver/browser/XIOS/branchs/xios-1.0}{XIOS-1.0}  
     101In version 3.6, the iom\_put interface depends on 
     102an external code called \href{https://forge.ipsl.jussieu.fr/ioserver/browser/XIOS/branchs/xios-1.0}{XIOS-1.0}  
    100103(use of revision 618 or higher is required). 
    101 This new IO server can take advantage of the parallel I/O functionality of NetCDF4 to  
     104This new IO server can take advantage of the parallel I/O functionality of NetCDF4 to 
    102105create a single output file and therefore to bypass the rebuilding phase. 
    103 Note that writing in parallel into the same NetCDF files requires that  
    104 your NetCDF4 library is linked to an HDF5 library that has been correctly compiled ($i.e.$ with  
    105 the configure option $--$enable-parallel). 
     106Note that writing in parallel into the same NetCDF files requires that your NetCDF4 library is linked to 
     107an HDF5 library that has been correctly compiled ($i.e.$ with the configure option $--$enable-parallel). 
    106108Note that the files created by iomput through XIOS are incompatible with NetCDF3. 
    107 All post-processsing and visualization tools must therefore be compatible with  
    108 NetCDF4 and not only NetCDF3. 
    109  
    110 Even if not using the parallel I/O functionality of NetCDF4, using N dedicated I/O servers,  
    111 where N is typically much less than the number of NEMO processors,  
    112 will reduce the number of output files created. 
    113 This can greatly reduce the post-processing burden usually associated with using  
    114 large numbers of NEMO processors. 
    115 Note that for smaller configurations, the rebuilding phase can be avoided, even without  
    116 a parallel-enabled NetCDF4 library, simply by employing only one dedicated I/O server. 
     109All post-processsing and visualization tools must therefore be compatible with NetCDF4 and not only NetCDF3. 
     110 
     111Even if not using the parallel I/O functionality of NetCDF4, using N dedicated I/O servers, 
     112where N is typically much less than the number of NEMO processors, will reduce the number of output files created. 
     113This can greatly reduce the post-processing burden usually associated with using large numbers of NEMO processors. 
     114Note that for smaller configurations, the rebuilding phase can be avoided, 
     115even without a parallel-enabled NetCDF4 library, simply by employing only one dedicated I/O server. 
    117116 
    118117\subsection{XIOS: XML Inputs-Outputs Server} 
     
    120119\subsubsection{Attached or detached mode?} 
    121120 
    122 Iomput is based on \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS},  
     121Iomput is based on \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS}, 
    123122the io\_server developed by Yann Meurdesoif from IPSL. 
    124123The behaviour of the I/O subsystem is controlled by settings in the external XML files listed above. 
     
    127126\xmlline|<variable id="using_server" type="bool"></variable>| 
    128127 
    129 The {\tt using\_server} setting determines whether or not the server will be used in  
    130 \textit{attached mode} (as a library) [{\tt> false <}] or in \textit{detached mode} (as  
    131 an external executable on N additional, dedicated cpus) [{\tt > true <}]. 
     128The {\tt using\_server} setting determines whether or not the server will be used in \textit{attached mode} 
     129(as a library) [{\tt> false <}] or in \textit{detached mode} 
     130(as an external executable on N additional, dedicated cpus) [{\tt > true <}]. 
    132131The \textit{attached mode} is simpler to use but much less efficient for massively parallel applications. 
    133132The type of each file can be either ''multiple\_file'' or ''one\_file''. 
    134133 
    135 In \textit{attached mode} and if the type of file is ''multiple\_file'',  
     134In \textit{attached mode} and if the type of file is ''multiple\_file'', 
    136135then each NEMO process will also act as an IO server and produce its own set of output files. 
    137136Superficially, this emulates the standard behaviour in previous versions. 
    138 However, the subdomain written out by each process does not correspond to  
     137However, the subdomain written out by each process does not correspond to 
    139138the \forcode{jpi x jpj x jpk} domain actually computed by the process (although it may if \forcode{jpni=1}). 
    140139Instead each process will have collected and written out a number of complete longitudinal strips. 
    141 If the ''one\_file'' option is chosen then all processes will collect their longitudinal strips and  
     140If the ''one\_file'' option is chosen then all processes will collect their longitudinal strips and 
    142141write (in parallel) to a single output file. 
    143142 
    144 In \textit{detached mode} and if the type of file is ''multiple\_file'', then  
    145 each stand-alone XIOS process will collect data for a range of complete longitudinal strips and  
     143In \textit{detached mode} and if the type of file is ''multiple\_file'', 
     144then each stand-alone XIOS process will collect data for a range of complete longitudinal strips and 
    146145write to its own set of output files. 
    147 If the ''one\_file'' option is chosen then all XIOS processes will collect their longitudinal strips and  
     146If the ''one\_file'' option is chosen then all XIOS processes will collect their longitudinal strips and 
    148147write (in parallel) to a single output file.  
    149148Note running in detached mode requires launching a Multiple Process Multiple Data (MPMD) parallel job. 
    150 The following subsection provides a typical example but the syntax will vary in  
    151 different MPP environments. 
     149The following subsection provides a typical example but the syntax will vary in different MPP environments. 
    152150 
    153151\subsubsection{Number of cpu used by XIOS in detached mode} 
     
    156154The number of cores dedicated to XIOS should be from \texttildelow1/10 to \texttildelow1/50 of the number of  
    157155cores dedicated to NEMO. 
    158 Some manufacturers suggest using O($\sqrt{N}$) dedicated IO processors for N processors but  
     156Some manufacturers suggest using O($\sqrt{N}$) dedicated IO processors for N processors but 
    159157this is a general recommendation and not specific to NEMO. 
    160 It is difficult to provide precise recommendations because the optimal choice will depend on  
     158It is difficult to provide precise recommendations because the optimal choice will depend on 
    161159the particular hardware properties of the target system  
    162 (parallel filesystem performance, available memory, memory bandwidth etc.) and  
    163 the volume and frequency of data to be created. 
     160(parallel filesystem performance, available memory, memory bandwidth etc.) 
     161and the volume and frequency of data to be created. 
    164162Here is an example of 2 cpus for the io\_server and 62 cpu for nemo using mpirun: 
    165163\cmd|mpirun -np 62 ./nemo.exe : -np 2 ./xios_server.exe| 
     
    167165\subsubsection{Control of XIOS: the context in iodef.xml} 
    168166 
    169 As well as the {\tt using\_server} flag, other controls on the use of XIOS are set in  
    170 the XIOS context in iodef.xml. 
     167As well as the {\tt using\_server} flag, other controls on the use of XIOS are set in the XIOS context in iodef.xml. 
    171168See the XML basics section below for more details on XML syntax and rules. 
    172169 
     
    205202\subsubsection{Installation} 
    206203 
    207 As mentioned, XIOS is supported separately and must be downloaded and compiled before  
    208 it can be used with NEMO. 
    209 See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for  
    210 help and guidance. 
     204As mentioned, XIOS is supported separately and must be downloaded and compiled before it can be used with NEMO. 
     205See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for help and guidance. 
    211206NEMO will need to link to the compiled XIOS library. 
    212 The  
    213 \href{https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#Inputs-OutputsusingXIOS} 
    214 {XIOS with NEMO} 
    215 guide provides an example illustration of how this can be achieved. 
     207The \href{https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#Inputs-OutputsusingXIOS} 
     208{XIOS with NEMO} guide provides an example illustration of how this can be achieved. 
    216209 
    217210\subsubsection{Add your own outputs} 
    218211 
    219212It is very easy to add your own outputs with iomput. 
    220 Many standard fields and diagnostics are already prepared ($i.e.$, steps 1 to 3 below have been done) and  
     213Many standard fields and diagnostics are already prepared ($i.e.$, steps 1 to 3 below have been done) and 
    221214simply need to be activated by including the required output in a file definition in iodef.xml (step 4). 
    222215To add new output variables, all 4 of the following steps must be taken. 
    223216 
    224217\begin{enumerate} 
    225    \item[1.] in NEMO code, add a \forcode{CALL iom\_put( 'identifier', array )} where you want to  
    226                output a 2D or 3D array. 
    227    \item[2.] If necessary, add \forcode{USE iom ! I/O manager library} to the list of used modules in  
    228                the upper part of your module. 
    229    \item[3.] in the field\_def.xml file, add the definition of your variable using  
    230                the same identifier you used in the f90 code (see subsequent sections for  
    231                a details of the XML syntax and rules). 
    232 For example: 
     218\item[1.] 
     219  in NEMO code, add a \forcode{CALL iom\_put( 'identifier', array )} where you want to output a 2D or 3D array. 
     220\item[2.] 
     221  If necessary, add \forcode{USE iom ! I/O manager library} to the list of used modules in 
     222  the upper part of your module. 
     223\item[3.] 
     224  in the field\_def.xml file, add the definition of your variable using the same identifier you used in the f90 code 
     225  (see subsequent sections for a details of the XML syntax and rules). 
     226  For example: 
    233227 
    234228\begin{xmllines} 
     
    241235\end{xmllines} 
    242236 
    243 Note your definition must be added to the field\_group whose reference grid is consistent with  
    244 the size of the array passed to iomput. 
    245 The grid\_ref attribute refers to definitions set in iodef.xml which, in turn, reference grids and  
    246 axes either defined in the code (iom\_set\_domain\_attr and iom\_set\_axis\_attr in \mdl{iom}) or  
    247 defined in the domain\_def.xml file. 
     237Note your definition must be added to the field\_group whose reference grid is consistent with the size of 
     238the array passed to iomput. 
     239The grid\_ref attribute refers to definitions set in iodef.xml which, in turn, 
     240reference grids and axes either defined in the code 
     241(iom\_set\_domain\_attr and iom\_set\_axis\_attr in \mdl{iom}) or defined in the domain\_def.xml file. 
    248242$e.g.$: 
    249243 
     
    252246\end{xmllines} 
    253247 
    254 Note, if your array is computed within the surface module each \np{nn\_fsbc} time\_step,  
     248Note, if your array is computed within the surface module each \np{nn\_fsbc} time\_step, 
    255249add the field definition within the field\_group defined with the id "SBC": 
    256 \xmlcode{<field_group id="SBC" ...>} which has been defined with the correct frequency of  
    257 operations (iom\_set\_field\_attr in \mdl{iom}) 
    258    \item[4.] add your field in one of the output files defined in iodef.xml  
    259 (again see subsequent sections for syntax and rules) 
     250\xmlcode{<field_group id="SBC" ...>} which has been defined with the correct frequency of operations 
     251(iom\_set\_field\_attr in \mdl{iom}) 
     252\item[4.] 
     253  add your field in one of the output files defined in iodef.xml 
     254  (again see subsequent sections for syntax and rules) 
    260255 
    261256\begin{xmllines} 
     
    274269 
    275270XML tags begin with the less-than character ("$<$") and end with the greater-than character ("$>$"). 
    276 You use tags to mark the start and end of elements, which are the logical units of information in  
    277 an XML document. 
    278 In addition to marking the beginning of an element, XML start tags also provide a place to  
    279 specify attributes. 
    280 An attribute specifies a single property for an element, using a name/value pair, for example:  
     271You use tags to mark the start and end of elements, which are the logical units of information in an XML document. 
     272In addition to marking the beginning of an element, XML start tags also provide a place to specify attributes. 
     273An attribute specifies a single property for an element, using a name/value pair, for example: 
    281274\xmlcode{<a b="x" c="y" d="z"> ... </a>}. 
    282275See \href{http://www.xmlnews.org/docs/xml-basics.html}{here} for more details. 
     
    284277\subsubsection{Structure of the XML file used in NEMO} 
    285278 
    286 The XML file used in XIOS is structured by 7 families of tags:  
     279The XML file used in XIOS is structured by 7 families of tags: 
    287280context, axis, domain, grid, field, file and variable. 
    288281Each tag family has hierarchy of three flavors (except for context): 
     
    302295 
    303296Each element may have several attributes. 
    304 Some attributes are mandatory, other are optional but have a default value and  
    305 other are completely optional. 
     297Some attributes are mandatory, other are optional but have a default value and other are completely optional. 
    306298Id is a special attribute used to identify an element or a group of elements. 
    307299It must be unique for a kind of element. 
    308300It is optional, but no reference to the corresponding element can be done if it is not defined. 
    309301 
    310 The XML file is split into context tags that are used to isolate IO definition from different codes or  
    311 different parts of a code. 
     302The XML file is split into context tags that are used to isolate IO definition from 
     303different codes or different parts of a code. 
    312304No interference is possible between 2 different contexts. 
    313305Each context has its own calendar and an associated timestep. 
     
    370362  
    371363\noindent In NEMO, by default, the field and domain definition is done in 2 separate files: 
    372 \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}  
    373 that are included in the main iodef.xml file through the following commands: 
     364\path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml} that 
     365are included in the main iodef.xml file through the following commands: 
    374366\begin{xmllines} 
    375367<field_definition src="./field_def.xml" /> 
     
    380372 
    381373XML extensively uses the concept of inheritance. 
    382 XML has a tree based structure with a parent-child oriented relation:  
    383 all children inherit attributes from parent, but an attribute defined in a child replace  
    384 the inherited attribute value.  
    385 Note that the special attribute ''id'' is never inherited. \\ \\ 
     374XML has a tree based structure with a parent-child oriented relation: all children inherit attributes from parent, 
     375but an attribute defined in a child replace the inherited attribute value. 
     376Note that the special attribute ''id'' is never inherited. 
     377\\ 
     378\\ 
    386379example 1: Direct inheritance. 
    387380 
     
    393386\end{xmllines} 
    394387 
    395 The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''average''  
    396 of the attribute ''operation'' from its parent. 
     388The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''average'' of 
     389the attribute ''operation'' from its parent. 
    397390Note that a child can overwrite the attribute definition inherited from its parents. 
    398 In the example above, the field ''sss'' will for example output instantaneous values instead of  
    399 average values. \\ \\ 
     391In the example above, the field ''sss'' will for example output instantaneous values instead of average values. 
     392\\ 
     393\\ 
    400394example 2: Inheritance by reference. 
    401395 
     
    418412 
    419413Groups can be used for 2 purposes. 
    420 Firstly, the group can be used to define common attributes to be shared by the elements of  
     414Firstly, the group can be used to define common attributes to be shared by the elements of 
    421415the group through inheritance. 
    422416In the following example, we define a group of field that will share a common grid ''grid\_T\_2D''. 
    423 Note that for the field ''toce'', we overwrite the grid definition inherited from the group by  
    424 ''grid\_T\_3D''. 
     417Note that for the field ''toce'', we overwrite the grid definition inherited from the group by ''grid\_T\_3D''. 
    425418 
    426419\begin{xmllines} 
     
    456449\subsection{Detailed functionalities} 
    457450 
    458 The file \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml} provides several examples of the use of  
     451The file \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml} provides several examples of the use of 
    459452the new functionalities offered by the XML interface of XIOS. 
    460453 
    461454\subsubsection{Define horizontal subdomains} 
    462455 
    463 Horizontal subdomains are defined through the attributs zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj of  
     456Horizontal subdomains are defined through the attributs zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj of 
    464457the tag family domain. 
    465458It must therefore be done in the domain part of the XML file.  
     
    472465\end{xmllines} 
    473466 
    474 The use of this subdomain is done through the redefinition of the attribute domain\_ref of  
    475 the tag family field. 
     467The use of this subdomain is done through the redefinition of the attribute domain\_ref of the tag family field. 
    476468For example: 
    477469 
     
    483475 
    484476Moorings are seen as an extrem case corresponding to a 1 by 1 subdomain.  
    485 The Equatorial section, the TAO, RAMA and PIRATA moorings are alredy registered in the code and  
     477The Equatorial section, the TAO, RAMA and PIRATA moorings are already registered in the code and 
    486478can therefore be outputted without taking care of their (i,j) position in the grid. 
    487479These predefined domains can be activated by the use of specific domain\_ref: 
    488 ''EqT'', ''EqU'' or ''EqW'' for the equatorial sections and the mooring position for  
    489 TAO, RAMA and PIRATA followed by ''T'' (for example: ''8s137eT'', ''1.5s80.5eT'' ...) 
     480''EqT'', ''EqU'' or ''EqW'' for the equatorial sections and 
     481the mooring position for TAO, RAMA and PIRATA followed by ''T'' (for example: ''8s137eT'', ''1.5s80.5eT'' ...) 
    490482 
    491483\begin{xmllines} 
     
    503495\subsubsection{Define vertical zooms} 
    504496 
    505 Vertical zooms are defined through the attributs zoom\_begin and zoom\_end of the tag family axis.  
    506 It must therefore be done in the axis part of the XML file.  
     497Vertical zooms are defined through the attributs zoom\_begin and zoom\_end of the tag family axis. 
     498It must therefore be done in the axis part of the XML file. 
    507499For example, in \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml}, we provide the following example: 
    508500 
     
    513505\end{xmllines} 
    514506 
    515 The use of this vertical zoom is done through the redefinition of the attribute axis\_ref of  
    516 the tag family field. 
     507The use of this vertical zoom is done through the redefinition of the attribute axis\_ref of the tag family field. 
    517508For example: 
    518509 
     
    539530\end{xmllines} 
    540531 
    541 However it is often very convienent to define the file name with the name of the experiment,  
    542 the output file frequency and the date of the beginning and the end of the simulation  
     532However it is often very convienent to define the file name with the name of the experiment, 
     533the output file frequency and the date of the beginning and the end of the simulation 
    543534(which are informations stored either in the namelist or in the XML file). 
    544 To do so, we added the following rule: if the id of the tag file is ''fileN'' (where N = 1 to 999 on  
    545 1 to 3 digits) or one of the predefined sections or moorings (see next subsection),  
    546 the following part of the name and the name\_suffix (that can be inherited) will be automatically  
    547 replaced by: 
     535To do so, we added the following rule: 
     536if the id of the tag file is ''fileN'' (where N = 1 to 999 on 1 to 3 digits) or 
     537one of the predefined sections or moorings (see next subsection), 
     538the following part of the name and the name\_suffix (that can be inherited) will be automatically replaced by: 
    548539 
    549540\begin{table} \scriptsize 
     
    580571\end{forlines} 
    581572 
    582 \noindent will give the following file name radical: 
    583 \ifile{myfile\_ORCA2\_19891231\_freq1d} 
     573\noindent will give the following file name radical: \ifile{myfile\_ORCA2\_19891231\_freq1d} 
    584574 
    585575\subsubsection{Other controls of the XML attributes from NEMO} 
    586576 
    587577The values of some attributes are defined by subroutine calls within NEMO  
    588 (calls to iom\_set\_domain\_attr, iom\_set\_axis\_attr and iom\_set\_field\_attr in \mdl{iom}).  
    589 Any definition given in the XML file will be overwritten.  
    590 By convention, these attributes are defined to ''auto'' (for string) or ''0000'' (for integer) in  
    591 the XML file (but this is not necessary). \\ 
    592  
    593 Here is the list of these attributes: \\ 
     578(calls to iom\_set\_domain\_attr, iom\_set\_axis\_attr and iom\_set\_field\_attr in \mdl{iom}). 
     579Any definition given in the XML file will be overwritten. 
     580By convention, these attributes are defined to ''auto'' (for string) or ''0000'' (for integer) in the XML file 
     581(but this is not necessary). 
     582\\ 
     583 
     584Here is the list of these attributes: 
     585\\ 
    594586 
    595587\begin{table} \scriptsize 
     
    631623 
    632624\begin{enumerate} 
    633 \item Simple computation: directly define the computation when refering to the variable in  
    634 the file definition. 
     625\item 
     626  Simple computation: directly define the computation when refering to the variable in the file definition. 
    635627 
    636628\begin{xmllines} 
     
    640632\end{xmllines} 
    641633 
    642 \item Simple computation: define a new variable and use it in the file definition. 
     634\item 
     635  Simple computation: define a new variable and use it in the file definition. 
    643636 
    644637in field\_definition: 
     
    654647\end{xmllines} 
    655648 
    656 Note that in this case, the following syntaxe \xmlcode{<field field_ref="sst2" />} is not working as  
     649Note that in this case, the following syntaxe \xmlcode{<field field_ref="sst2" />} is not working as 
    657650sst2 won't be evaluated. 
    658651 
    659 \item Change of variable precision: 
     652\item 
     653  Change of variable precision: 
    660654 
    661655\begin{xmllines} 
     
    667661 
    668662Note that, then the code is crashing, writting real4 variables forces a numerical convection from  
    669 real8 to real4 which will create an internal error in NetCDF and will avoid the creation of  
    670 the output files. 
    671 Forcing double precision outputs with prec="8" (for example in the field\_definition) will  
    672 avoid this problem. 
    673  
    674 \item add user defined attributes: 
     663real8 to real4 which will create an internal error in NetCDF and will avoid the creation of the output files. 
     664Forcing double precision outputs with prec="8" (for example in the field\_definition) will avoid this problem. 
     665 
     666\item 
     667  add user defined attributes: 
    675668 
    676669\begin{xmllines} 
     
    687680\end{xmllines} 
    688681 
    689 \item use of the ``@'' function: example 1, weighted temporal average 
     682\item 
     683  use of the ``@'' function: example 1, weighted temporal average 
    690684 
    691685 - define a new variable in field\_definition 
     
    706700 
    707701The freq\_op="5d" attribute is used to define the operation frequency of the ``@'' function: here 5 day. 
    708 The temporal operation done by the ``@'' is the one defined in the field definition:  
     702The temporal operation done by the ``@'' is the one defined in the field definition: 
    709703here we use the default, average. 
    710704So, in the above case, @toce\_e3t will do the 5-day mean of toce*e3t. 
    711 Operation="instant" refers to the temporal operation to be performed on the field''@toce\_e3t / @e3t'':  
    712 here the temporal average is alreday done by the ``@'' function so we just use instant to do the ratio of  
     705Operation="instant" refers to the temporal operation to be performed on the field''@toce\_e3t / @e3t'': 
     706here the temporal average is alreday done by the ``@'' function so we just use instant to do the ratio of 
    713707the 2 mean values. 
    714708field\_ref="toce" means that attributes not explicitely defined, are inherited from toce field. 
    715709Note that in this case, freq\_op must be equal to the file output\_freq. 
    716710 
    717 \item use of the ``@'' function: example 2, monthly SSH standard deviation 
     711\item 
     712  use of the ``@'' function: example 2, monthly SSH standard deviation 
    718713 
    719714 - define a new variable in field\_definition 
     
    737732 
    738733The freq\_op="1m" attribute is used to define the operation frequency of the ``@'' function: here 1 month. 
    739 The temporal operation done by the ``@'' is the one defined in the field definition:  
     734The temporal operation done by the ``@'' is the one defined in the field definition: 
    740735here we use the default, average. 
    741736So, in the above case, @ssh2 will do the monthly mean of ssh*ssh. 
    742 Operation="instant" refers to the temporal operation to be performed on  
    743 the field ''sqrt( @ssh2 - @ssh * @ssh )'':  
     737Operation="instant" refers to the temporal operation to be performed on the field ''sqrt( @ssh2 - @ssh * @ssh )'':  
    744738here the temporal average is alreday done by the ``@'' function so we just use instant. 
    745739field\_ref="ssh" means that attributes not explicitely defined, are inherited from ssh field. 
    746740Note that in this case, freq\_op must be equal to the file output\_freq. 
    747741 
    748 \item use of the ``@'' function: example 3, monthly average of SST diurnal cycle 
     742\item 
     743  use of the ``@'' function: example 3, monthly average of SST diurnal cycle 
    749744 
    750745 - define 2 new variables in field\_definition 
     
    770765 
    771766The freq\_op="1d" attribute is used to define the operation frequency of the ``@'' function: here 1 day. 
    772 The temporal operation done by the ``@'' is the one defined in the field definition: here maximum for  
    773 sstmax and minimum for sstmin. 
     767The temporal operation done by the ``@'' is the one defined in the field definition: 
     768here maximum for sstmax and minimum for sstmin. 
    774769So, in the above case, @sstmax will do the daily max and @sstmin the daily min. 
    775 Operation="average" refers to the temporal operation to be performed on the field ``@sstmax - @sstmin'':  
     770Operation="average" refers to the temporal operation to be performed on the field ``@sstmax - @sstmin'': 
    776771here monthly mean (of daily max - daily min of the sst). 
    777772field\_ref="sst" means that attributes not explicitely defined, are inherited from sst field. 
     
    11261121 
    11271122Output from the XIOS-1.0 IO server is compliant with  
    1128 \href{http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html}{version 1.5}  
    1129 of the CF metadata standard.  
    1130 Therefore while a user may wish to add their own metadata to the output files (as demonstrated in  
    1131 example 4 of section \autoref{subsec:IOM_xmlref}) the metadata should, for the most part, comply with  
    1132 the CF-1.5 standard. 
    1133  
    1134 Some metadata that may significantly increase the file size (horizontal cell areas and  
    1135 vertices) are controlled by the namelist parameter \np{ln\_cfmeta} in the \ngn{namrun} namelist. 
     1123\href{http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html}{version 1.5} of 
     1124the CF metadata standard.  
     1125Therefore while a user may wish to add their own metadata to the output files (as demonstrated in example 4 of 
     1126section \autoref{subsec:IOM_xmlref}) the metadata should, for the most part, comply with the CF-1.5 standard. 
     1127 
     1128Some metadata that may significantly increase the file size (horizontal cell areas and vertices) are controlled by 
     1129the namelist parameter \np{ln\_cfmeta} in the \ngn{namrun} namelist. 
    11361130This must be set to true if these metadata are to be included in the output files. 
    11371131 
     
    11441138 
    11451139Since version 3.3, support for NetCDF4 chunking and (loss-less) compression has been included. 
    1146 These options build on the standard NetCDF output and allow the user control over the size of  
    1147 the chunks via namelist settings. 
     1140These options build on the standard NetCDF output and allow the user control over the size of the chunks via 
     1141namelist settings. 
    11481142Chunking and compression can lead to significant reductions in file sizes for a small runtime overhead. 
    1149 For a fuller discussion on chunking and other performance issues the reader is referred to  
    1150 the NetCDF4 documentation found  
    1151 \href{http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html#Chunking}{here}. 
    1152  
    1153 The new features are only available when the code has been linked with a NetCDF4 library  
    1154 (version 4.1 onwards, recommended) which has been built with HDF5 support  
    1155 (version 1.8.4 onwards, recommended). 
    1156 Datasets created with chunking and compression are not backwards compatible with  
    1157 NetCDF3 "classic" format but most analysis codes can be relinked simply with the new libraries and  
    1158 will then read both NetCDF3 and NetCDF4 files. 
    1159 NEMO executables linked with NetCDF4 libraries can be made to produce NetCDF3 files by  
     1143For a fuller discussion on chunking and other performance issues the reader is referred to 
     1144the NetCDF4 documentation found \href{http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html#Chunking}{here}. 
     1145 
     1146The new features are only available when the code has been linked with a NetCDF4 library 
     1147(version 4.1 onwards, recommended) which has been built with HDF5 support (version 1.8.4 onwards, recommended). 
     1148Datasets created with chunking and compression are not backwards compatible with NetCDF3 "classic" format but 
     1149most analysis codes can be relinked simply with the new libraries and will then read both NetCDF3 and NetCDF4 files. 
     1150NEMO executables linked with NetCDF4 libraries can be made to produce NetCDF3 files by 
    11601151setting the \np{ln\_nc4zip} logical to false in the \textit{namnc4} namelist: 
    11611152 
     
    11661157 
    11671158If \key{netcdf4} has not been defined, these namelist parameters are not read. 
    1168 In this case, \np{ln\_nc4zip} is set false and dummy routines for  
    1169 a few NetCDF4-specific functions are defined. 
    1170 These functions will not be used but need to be included so that compilation is possible with  
    1171 NetCDF3 libraries. 
    1172  
    1173 When using NetCDF4 libraries, \key{netcdf4} should be defined even if the intention is to  
     1159In this case, \np{ln\_nc4zip} is set false and dummy routines for a few NetCDF4-specific functions are defined. 
     1160These functions will not be used but need to be included so that compilation is possible with NetCDF3 libraries. 
     1161 
     1162When using NetCDF4 libraries, \key{netcdf4} should be defined even if the intention is to 
    11741163create only NetCDF3-compatible files. 
    1175 This is necessary to avoid duplication between the dummy routines and  
    1176 the actual routines present in the library. 
     1164This is necessary to avoid duplication between the dummy routines and the actual routines present in the library. 
    11771165Most compilers will fail at compile time when faced with such duplication. 
    1178 Thus when linking with NetCDF4 libraries the user must define \key{netcdf4} and  
     1166Thus when linking with NetCDF4 libraries the user must define \key{netcdf4} and 
    11791167control the type of NetCDF file produced via the namelist parameter. 
    11801168 
    1181 Chunking and compression is applied only to 4D fields and there is no advantage in  
    1182 chunking across more than one time dimension since previously written chunks would have to  
    1183 be read back and decompressed before being added to. 
     1169Chunking and compression is applied only to 4D fields and 
     1170there is no advantage in chunking across more than one time dimension since 
     1171previously written chunks would have to be read back and decompressed before being added to. 
    11841172Therefore, user control over chunk sizes is provided only for the three space dimensions. 
    11851173The user sets an approximate number of chunks along each spatial axis. 
    1186 The actual size of the chunks will depend on global domain size for mono-processors or,  
    1187 more likely, the local processor domain size for distributed processing. 
    1188 The derived values are subject to practical minimum values (to avoid wastefully small chunk sizes) and  
     1174The actual size of the chunks will depend on global domain size for mono-processors or, more likely, 
     1175the local processor domain size for distributed processing. 
     1176The derived values are subject to practical minimum values (to avoid wastefully small chunk sizes) and 
    11891177cannot be greater than the domain size in any dimension. 
    11901178The algorithm used is: 
     
    12031191\end{forlines} 
    12041192 
    1205 \noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\tt 46x38x1} respectively in  
     1193\noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\tt 46x38x1} respectively in 
    12061194the mono-processor case (i.e. global domain of {\small\tt 182x149x31}). 
    12071195An illustration of the potential space savings that NetCDF4 chunking and compression provides is given in  
    1208 table \autoref{tab:NC4} which compares the results of two short runs of  
    1209 the ORCA2\_LIM reference configuration with a 4x2 mpi partitioning. 
    1210 Note the variation in the compression ratio achieved which reflects chiefly the dry to  
    1211 wet volume ratio of each processing region. 
     1196table \autoref{tab:NC4} which compares the results of two short runs of the ORCA2\_LIM reference configuration with 
     1197a 4x2 mpi partitioning. 
     1198Note the variation in the compression ratio achieved which reflects chiefly the dry to wet volume ratio of 
     1199each processing region. 
    12121200 
    12131201%------------------------------------------TABLE---------------------------------------------------- 
     
    12491237%---------------------------------------------------------------------------------------------------- 
    12501238 
    1251 When \key{iomput} is activated with \key{netcdf4} chunking and compression parameters for  
    1252 fields produced via \np{iom\_put} calls are set via an equivalent and identically named namelist to  
    1253 \textit{namnc4} in \np{xmlio\_server.def}. 
    1254 Typically this namelist serves the mean files whilst the \ngn{ namnc4} in  
    1255 the main namelist file continues to serve the restart files. 
    1256 This duplication is unfortunate but appropriate since, if using io\_servers, the domain sizes of  
    1257 the individual files produced by the io\_server processes may be different to those produced by  
     1239When \key{iomput} is activated with \key{netcdf4} chunking and compression parameters for fields produced via 
     1240\np{iom\_put} calls are set via an equivalent and identically named namelist to \textit{namnc4} in 
     1241\np{xmlio\_server.def}. 
     1242Typically this namelist serves the mean files whilst the \ngn{ namnc4} in the main namelist file continues to 
     1243serve the restart files. 
     1244This duplication is unfortunate but appropriate since, if using io\_servers, the domain sizes of 
     1245the individual files produced by the io\_server processes may be different to those produced by 
    12581246the invidual processing regions and different chunking choices may be desired. 
    12591247  
     
    12691257%------------------------------------------------------------------------------------------------------------- 
    12701258 
    1271 Each trend of the dynamics and/or temperature and salinity time evolution equations can be send to  
    1272 \mdl{trddyn} and/or \mdl{trdtra} modules (see TRD directory) just after their computation ($i.e.$ at  
    1273 the end of each $dyn\cdots.F90$ and/or $tra\cdots.F90$ routines). 
     1259Each trend of the dynamics and/or temperature and salinity time evolution equations can be send to 
     1260\mdl{trddyn} and/or \mdl{trdtra} modules (see TRD directory) just after their computation 
     1261($i.e.$ at the end of each $dyn\cdots.F90$ and/or $tra\cdots.F90$ routines). 
    12741262This capability is controlled by options offered in \ngn{namtrd} namelist. 
    12751263Note that the output are done with xIOS, and therefore the \key{IOM} is required. 
     
    12781266 
    12791267\begin{description} 
    1280    \item[\np{ln\_glo\_trd}]: at each \np{nn\_trd} time-step a check of the basin averaged properties of  
    1281                               the momentum and tracer equations is performed. 
    1282                               This also includes a check of $T^2$, $S^2$, $\tfrac{1}{2} (u^2+v2)$, and  
    1283                               potential energy time evolution equations properties; 
    1284    \item[\np{ln\_dyn\_trd}]: each 3D trend of the evolution of the two momentum components is output; 
    1285    \item[\np{ln\_dyn\_mxl}]: each 3D trend of the evolution of the two momentum components averaged over  
    1286                               the mixed layer is output; 
    1287    \item[\np{ln\_vor\_trd}]: a vertical summation of the moment tendencies is performed, then  
    1288                               the curl is computed to obtain the barotropic vorticity tendencies which  
    1289                               are output; 
    1290    \item[\np{ln\_KE\_trd}] : each 3D trend of the Kinetic Energy equation is output ; 
    1291    \item[\np{ln\_tra\_trd}]: each 3D trend of the evolution of temperature and salinity is output ; 
    1292    \item[\np{ln\_tra\_mxl}]: each 2D trend of the evolution of temperature and salinity averaged over  
    1293                               the mixed layer is output; 
     1268\item[\np{ln\_glo\_trd}]: 
     1269  at each \np{nn\_trd} time-step a check of the basin averaged properties of 
     1270  the momentum and tracer equations is performed. 
     1271  This also includes a check of $T^2$, $S^2$, $\tfrac{1}{2} (u^2+v2)$, 
     1272  and potential energy time evolution equations properties; 
     1273\item[\np{ln\_dyn\_trd}]: 
     1274  each 3D trend of the evolution of the two momentum components is output; 
     1275\item[\np{ln\_dyn\_mxl}]: 
     1276  each 3D trend of the evolution of the two momentum components averaged over the mixed layer is output; 
     1277\item[\np{ln\_vor\_trd}]: 
     1278  a vertical summation of the moment tendencies is performed, 
     1279  then the curl is computed to obtain the barotropic vorticity tendencies which are output; 
     1280\item[\np{ln\_KE\_trd}] : 
     1281  each 3D trend of the Kinetic Energy equation is output; 
     1282\item[\np{ln\_tra\_trd}]: 
     1283  each 3D trend of the evolution of temperature and salinity is output; 
     1284\item[\np{ln\_tra\_mxl}]: 
     1285  each 2D trend of the evolution of temperature and salinity averaged over the mixed layer is output; 
    12941286\end{description} 
    12951287 
     
    12981290 
    12991291\textbf{Note that} in the current version (v3.6), many changes has been introduced but not fully tested. 
    1300 In particular, options associated with \np{ln\_dyn\_mxl}, \np{ln\_vor\_trd}, and \np{ln\_tra\_mxl} are  
    1301 not working, and none of the options have been tested with variable volume ($i.e.$ \key{vvl} defined). 
     1292In particular, options associated with \np{ln\_dyn\_mxl}, \np{ln\_vor\_trd}, and \np{ln\_tra\_mxl} are not working, 
     1293and none of the options have been tested with variable volume ($i.e.$ \key{vvl} defined). 
    13021294 
    13031295% ------------------------------------------------------------------------------------------------------------- 
     
    13111303%-------------------------------------------------------------------------------------------------------------- 
    13121304 
    1313 The on-line computation of floats advected either by the three dimensional velocity field or  
    1314 constraint to remain at a given depth ($w = 0$ in the computation) have been introduced in  
    1315 the system during the CLIPPER project. 
     1305The on-line computation of floats advected either by the three dimensional velocity field or constraint to 
     1306remain at a given depth ($w = 0$ in the computation) have been introduced in the system during the CLIPPER project. 
    13161307Options are defined by \ngn{namflo} namelis variables. 
    1317 The algorithm used is based either on the work of \cite{Blanke_Raynaud_JPO97} (default option), or  
    1318 on a $4^th$ Runge-Hutta algorithm (\np{ln\_flork4}\forcode{ = .true.}). 
    1319 Note that the \cite{Blanke_Raynaud_JPO97} algorithm have the advantage of providing trajectories which  
     1308The algorithm used is based either on the work of \cite{Blanke_Raynaud_JPO97} (default option), 
     1309or on a $4^th$ Runge-Hutta algorithm (\np{ln\_flork4}\forcode{ = .true.}). 
     1310Note that the \cite{Blanke_Raynaud_JPO97} algorithm have the advantage of providing trajectories which 
    13201311are consistent with the numeric of the code, so that the trajectories never intercept the bathymetry. 
    13211312 
    13221313\subsubsection{Input data: initial coordinates} 
    13231314 
    1324 Initial coordinates can be given with Ariane Tools convention (IJK coordinates, 
    1325 (\np{ln\_ariane}\forcode{ = .true.}) ) or with longitude and latitude. 
     1315Initial coordinates can be given with Ariane Tools convention 
     1316(IJK coordinates, (\np{ln\_ariane}\forcode{ = .true.}) ) or with longitude and latitude. 
    13261317 
    13271318In case of Ariane convention, input filename is \np{init\_float\_ariane}. 
     
    13681359 
    13691360\np{jpnfl} is the total number of floats during the run. 
    1370 When initial positions are read in a restart file (\np{ln\_rstflo}\forcode{ = .true.} ),  
     1361When initial positions are read in a restart file (\np{ln\_rstflo}\forcode{ = .true.} ), 
    13711362\np{jpnflnewflo} can be added in the initialization file. 
    13721363 
    13731364\subsubsection{Output data} 
    13741365 
    1375 \np{nn\_writefl} is the frequency of writing in float output file and \np{nn\_stockfl} is  
    1376 the frequency of creation of the float restart file. 
     1366\np{nn\_writefl} is the frequency of writing in float output file and \np{nn\_stockfl} is the frequency of 
     1367creation of the float restart file. 
    13771368 
    13781369Output data can be written in ascii files (\np{ln\_flo\_ascii}\forcode{ = .true.}). 
     
    13821373There are 2 possibilities: 
    13831374 
    1384  - if (\key{iomput}) is used, outputs are selected in  iodef.xml. 
    1385    Here it is an example of specification to put in files description section: 
     1375- if (\key{iomput}) is used, outputs are selected in  iodef.xml. 
     1376Here it is an example of specification to put in files description section: 
    13861377 
    13871378\begin{xmllines} 
     
    14011392 -  if (\key{iomput}) is not used, a file called \ifile{trajec\_float} will be created by IOIPSL library. 
    14021393 
    1403 See also \href{http://stockage.univ-brest.fr/~grima/Ariane/}{here} the web site describing  
    1404 the off-line use of this marvellous diagnostic tool. 
     1394 See also \href{http://stockage.univ-brest.fr/~grima/Ariane/}{here} the web site describing the off-line use of 
     1395 this marvellous diagnostic tool. 
    14051396 
    14061397% ------------------------------------------------------------------------------------------------------------- 
     
    14181409This on-line Harmonic analysis is actived with \key{diaharm}. 
    14191410 
    1420 Some parameters are available in namelist \ngn{namdia\_harm} : 
     1411Some parameters are available in namelist \ngn{namdia\_harm}: 
    14211412 
    14221413 - \np{nit000\_han} is the first time step used for harmonic analysis 
     
    14301421 - \np{tname}       is an array with names of tidal constituents to analyse 
    14311422 
    1432 \np{nit000\_han} and \np{nitend\_han} must be between \np{nit000} and \np{nitend} of the simulation. 
    1433 The restart capability is not implemented. 
    1434  
    1435 The Harmonic analysis solve the following equation: 
     1423 \np{nit000\_han} and \np{nitend\_han} must be between \np{nit000} and \np{nitend} of the simulation. 
     1424 The restart capability is not implemented. 
     1425 
     1426 The Harmonic analysis solve the following equation: 
    14361427 
    14371428\[h_{i} - A_{0} + \sum^{nb\_ana}_{j=1}[A_{j}cos(\nu_{j}t_{j}-\phi_{j})] = e_{i}\] 
    14381429 
    1439 With $A_{j}$, $\nu_{j}$, $\phi_{j}$, the amplitude, frequency and phase for each wave and  
    1440 $e_{i}$ the error. 
     1430With $A_{j}$, $\nu_{j}$, $\phi_{j}$, the amplitude, frequency and phase for each wave and $e_{i}$ the error. 
    14411431$h_{i}$ is the sea level for the time $t_{i}$ and $A_{0}$ is the mean sea level. \\ 
    14421432We can rewrite this equation: 
     
    14591449%------------------------------------------------------------------------------------------------------------- 
    14601450 
    1461 A module is available to compute the transport of volume, heat and salt through sections.  
     1451A module is available to compute the transport of volume, heat and salt through sections. 
    14621452This diagnostic is actived with \key{diadct}. 
    14631453 
    14641454Each section is defined by the coordinates of its 2 extremities. 
    1465 The pathways between them are contructed using tools which can be found in  
    1466 \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT}  
    1467 and are written in a binary file  
    1468 \texttt{section\_ijglobal.diadct\_ORCA2\_LIM}  
    1469 which is later read in by NEMO to compute on-line transports. 
     1455The pathways between them are contructed using tools which can be found in \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT} 
     1456and are written in a binary file \texttt{section\_ijglobal.diadct\_ORCA2\_LIM} which is later read in by 
     1457NEMO to compute on-line transports. 
    14701458 
    14711459The on-line transports module creates three output ascii files: 
     
    14771465- \texttt{salt\_transport}   for   salt transports (unit: $10^{9}Kg s^{-1}$) \\ 
    14781466 
    1479 Namelist variables in \ngn{namdct} control how frequently the flows are summed and the time scales over  
    1480 which they are averaged, as well as the level of output for debugging: 
     1467Namelist variables in \ngn{namdct} control how frequently the flows are summed and the time scales over which 
     1468they are averaged, as well as the level of output for debugging: 
    14811469\np{nn\_dct}   : frequency of instantaneous transports computing 
    14821470\np{nn\_dctwri}: frequency of writing ( mean of instantaneous transports ) 
     
    14851473\subsubsection{Creating a binary file containing the pathway of each section} 
    14861474 
    1487 In \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT/run},  
    1488 the file \textit{ {list\_sections.ascii\_global}} contains a list of all the sections that are to  
    1489 be computed (this list of sections is based on MERSEA project metrics). 
     1475In \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT/run}, 
     1476the file \textit{ {list\_sections.ascii\_global}} contains a list of all the sections that are to be computed 
     1477(this list of sections is based on MERSEA project metrics). 
    14901478 
    14911479Another file is available for the GYRE configuration (\texttt{ {list\_sections.ascii\_GYRE}}). 
     
    15051493 - \texttt{ice}       to compute surface and volume ice transports, \texttt{noice}     if no. \\ 
    15061494 
    1507 \noindent The results of the computing of transports, and the directions of positive and  
    1508 negative flow do not depend on the order of the 2 extremities in this file. \\ 
    1509  
    1510 \noindent If nclass $\neq$ 0,the next lines contain the class type and the nclass bounds: \\ 
     1495 \noindent The results of the computing of transports, and the directions of positive and 
     1496 negative flow do not depend on the order of the 2 extremities in this file. \\ 
     1497 
     1498\noindent If nclass $\neq$ 0, the next lines contain the class type and the nclass bounds: \\ 
    15111499{\scriptsize \texttt{ 
    15121500long1 lat1 long2 lat2 nclass (ok/no)strpond (no)ice section\_name \\ 
     
    15311519 - \texttt{zsigp} for potential density classes \\ 
    15321520   
    1533 The script \texttt{job.ksh} computes the pathway for each section and  
    1534 creates a binary file \texttt{section\_ijglobal.diadct\_ORCA2\_LIM} which is read by NEMO. \\ 
    1535  
    1536 It is possible to use this tools for new configuations: \texttt{job.ksh} has to be updated with  
    1537 the coordinates file name and path. \\ 
    1538  
    1539 Examples of two sections, the ACC\_Drake\_Passage with no classes, and the ATL\_Cuba\_Florida with  
    1540 4 temperature clases (5 class bounds), are shown: \\ 
     1521 The script \texttt{job.ksh} computes the pathway for each section and creates a binary file 
     1522 \texttt{section\_ijglobal.diadct\_ORCA2\_LIM} which is read by NEMO. \\ 
     1523 
     1524 It is possible to use this tools for new configuations: \texttt{job.ksh} has to be updated with 
     1525 the coordinates file name and path. \\ 
     1526 
     1527 Examples of two sections, the ACC\_Drake\_Passage with no classes, 
     1528 and the ATL\_Cuba\_Florida with 4 temperature clases (5 class bounds), are shown: \\ 
    15411529\noindent {\scriptsize \texttt{ 
    15421530-68.    -54.5   -60.    -64.7  00 okstrpond noice ACC\_Drake\_Passage \\ 
     
    15591547transport\_total}}                                     \\ 
    15601548 
    1561 For sections with classes, the first \texttt{nclass-1} lines correspond to the transport for  
    1562 each class and the last line corresponds to the total transport summed over all classes. 
    1563 For sections with no classes, class number \texttt{1} corresponds to \texttt{total class} and  
     1549For sections with classes, the first \texttt{nclass-1} lines correspond to the transport for each class and 
     1550the last line corresponds to the total transport summed over all classes. 
     1551For sections with no classes, class number \texttt{1} corresponds to \texttt{total class} and 
    15641552this class is called \texttt{N}, meaning \texttt{none}. 
    15651553 
     
    15681556- \texttt{transport\_direction2} is the negative part of the transport ($\leq$ 0). \\ 
    15691557 
    1570 \noindent The \texttt{section slope coefficient} gives information about the significance of  
    1571 transports signs and direction: \\ 
     1558\noindent The \texttt{section slope coefficient} gives information about the significance of transports signs and 
     1559direction: \\ 
    15721560 
    15731561\begin{table} \scriptsize 
     
    15911579 
    15921580 
    1593 Changes in steric sea level are caused when changes in the density of the water column imply an  
    1594 expansion or contraction of the column. 
    1595 It is essentially produced through surface heating/cooling and to a lesser extent through  
    1596 non-linear effects of the equation of state (cabbeling, thermobaricity...). 
     1581Changes in steric sea level are caused when changes in the density of the water column imply an expansion or 
     1582contraction of the column. 
     1583It is essentially produced through surface heating/cooling and to a lesser extent through non-linear effects of 
     1584the equation of state (cabbeling, thermobaricity...). 
    15971585Non-Boussinesq models contain all ocean effects within the ocean acting on the sea level. 
    15981586In particular, they include the steric effect. 
    1599 In contrast, Boussinesq models, such as \NEMO, conserve volume, rather than mass,  
     1587In contrast, Boussinesq models, such as \NEMO, conserve volume, rather than mass, 
    16001588and so do not properly represent expansion or contraction. 
    16011589The steric effect is therefore not explicitely represented. 
    1602 This approximation does not represent a serious error with respect to the flow field calculated by  
    1603 the model \citep{Greatbatch_JGR94}, but extra attention is required when investigating sea level,  
    1604 as steric changes are an important contribution to local changes in sea level on seasonal and  
    1605 climatic time scales. 
    1606 This is especially true for investigation into sea level rise due to global warming.  
    1607  
    1608 Fortunately, the steric contribution to the sea level consists of a spatially uniform component that  
     1590This approximation does not represent a serious error with respect to the flow field calculated by the model 
     1591\citep{Greatbatch_JGR94}, but extra attention is required when investigating sea level, 
     1592as steric changes are an important contribution to local changes in sea level on seasonal and climatic time scales. 
     1593This is especially true for investigation into sea level rise due to global warming. 
     1594 
     1595Fortunately, the steric contribution to the sea level consists of a spatially uniform component that 
    16091596can be diagnosed by considering the mass budget of the world ocean \citep{Greatbatch_JGR94}. 
    1610 In order to better understand how global mean sea level evolves and thus how the steric sea level can  
    1611 be diagnosed, we compare, in the following, the non-Boussinesq and Boussinesq cases. 
     1597In order to better understand how global mean sea level evolves and thus how the steric sea level can be diagnosed, 
     1598we compare, in the following, the non-Boussinesq and Boussinesq cases. 
    16121599 
    16131600Let denote 
     
    16281615\] 
    16291616 
    1630 Temporal changes in total mass is obtained from the density conservation equation : 
     1617Temporal changes in total mass is obtained from the density conservation equation: 
    16311618 
    16321619\[ \frac{1}{e_3} \partial_t ( e_3\,\rho) + \nabla( \rho \, \textbf{U} )  
     
    16341621 \label{eq:Co_nBq} \] 
    16351622 
    1636 where $\rho$ is the \textit{in situ} density, and \textit{emp} the surface mass  
    1637 exchanges with the other media of the Earth system (atmosphere, sea-ice, land).  
     1623where $\rho$ is the \textit{in situ} density, and \textit{emp} the surface mass exchanges with the other media of 
     1624the Earth system (atmosphere, sea-ice, land). 
    16381625Its global averaged leads to the total mass change  
    16391626 
     
    16421629 
    16431630where $\overline{\textit{emp}} = \int_S \textit{emp}\,ds$ is the net mass flux through the ocean surface. 
    1644 Bringing \autoref{eq:Mass_nBq} and the time derivative of \autoref{eq:MV_nBq} together leads to  
     1631Bringing \autoref{eq:Mass_nBq} and the time derivative of \autoref{eq:MV_nBq} together leads to 
    16451632the evolution equation of the mean sea level 
    16461633 
     
    16491636 \label{eq:ssh_nBq} \] 
    16501637 
    1651 The first term in equation \autoref{eq:ssh_nBq} alters sea level by adding or  
    1652 subtracting mass from the ocean.  
    1653 The second term arises from temporal changes in the global mean density; $i.e.$ from steric effects.  
    1654  
    1655 In a Boussinesq fluid, $\rho$ is replaced by $\rho_o$ in all the equation except when  
    1656 $\rho$ appears multiplied by the gravity ($i.e.$ in the hydrostatic balance of the primitive Equations). 
    1657 In particular, the mass conservation equation, \autoref{eq:Co_nBq}, degenerates into  
    1658 the incompressibility equation: 
     1638The first term in equation \autoref{eq:ssh_nBq} alters sea level by adding or subtracting mass from the ocean.  
     1639The second term arises from temporal changes in the global mean density; $i.e.$ from steric effects. 
     1640 
     1641In a Boussinesq fluid, $\rho$ is replaced by $\rho_o$ in all the equation except when $\rho$ appears multiplied by 
     1642the gravity ($i.e.$ in the hydrostatic balance of the primitive Equations). 
     1643In particular, the mass conservation equation, \autoref{eq:Co_nBq}, degenerates into the incompressibility equation: 
    16591644 
    16601645\[ \frac{1}{e_3} \partial_t ( e_3 ) + \nabla( \textbf{U} ) 
     
    16671652 \label{eq:V_Bq} \] 
    16681653 
    1669 Only the volume is conserved, not mass, or, more precisely, the mass which is conserved is  
    1670 the Boussinesq mass, $\mathcal{M}_o = \rho_o \mathcal{V}$. 
    1671 The total volume (or equivalently the global mean sea level) is altered only by net volume fluxes across  
    1672 the ocean surface, not by changes in mean mass of the ocean: the steric effect is missing in  
    1673 a Boussinesq fluid. 
    1674  
    1675 Nevertheless, following \citep{Greatbatch_JGR94}, the steric effect on the volume can be diagnosed by  
     1654Only the volume is conserved, not mass, or, more precisely, the mass which is conserved is the Boussinesq mass, 
     1655$\mathcal{M}_o = \rho_o \mathcal{V}$. 
     1656The total volume (or equivalently the global mean sea level) is altered only by net volume fluxes across 
     1657the ocean surface, not by changes in mean mass of the ocean: the steric effect is missing in a Boussinesq fluid. 
     1658 
     1659Nevertheless, following \citep{Greatbatch_JGR94}, the steric effect on the volume can be diagnosed by 
    16761660considering the mass budget of the ocean.  
    1677 The apparent changes in $\mathcal{M}$, mass of the ocean, which are not induced by  
    1678 surface mass flux must be compensated by a spatially uniform change in the mean sea level due to  
    1679 expansion/contraction of the ocean \citep{Greatbatch_JGR94}. 
    1680 In others words, the Boussinesq mass, $\mathcal{M}_o$, can be related to $\mathcal{M}$,  
    1681 the  total mass of the ocean seen by the Boussinesq model, via the steric contribution to the sea level,  
     1661The apparent changes in $\mathcal{M}$, mass of the ocean, which are not induced by surface mass flux 
     1662must be compensated by a spatially uniform change in the mean sea level due to expansion/contraction of the ocean 
     1663\citep{Greatbatch_JGR94}. 
     1664In others words, the Boussinesq mass, $\mathcal{M}_o$, can be related to $\mathcal{M}$, 
     1665the total mass of the ocean seen by the Boussinesq model, via the steric contribution to the sea level, 
    16821666$\eta_s$, a spatially uniform variable, as follows: 
    16831667 
     
    16851669 \label{eq:M_Bq} \] 
    16861670 
    1687 Any change in $\mathcal{M}$ which cannot be explained by the net mass flux through  
    1688 the ocean surface is converted into a mean change in sea level. 
    1689 Introducing the total density anomaly, $\mathcal{D}= \int_D d_a \,dv$, where  
    1690 $d_a = (\rho -\rho_o ) / \rho_o$ is the density anomaly used in \NEMO (cf. \autoref{subsec:TRA_eos}) in  
    1691 \autoref{eq:M_Bq} leads to a very simple form for the steric height: 
     1671Any change in $\mathcal{M}$ which cannot be explained by the net mass flux through the ocean surface 
     1672is converted into a mean change in sea level. 
     1673Introducing the total density anomaly, $\mathcal{D}= \int_D d_a \,dv$, 
     1674where $d_a = (\rho -\rho_o ) / \rho_o$ is the density anomaly used in \NEMO (cf. \autoref{subsec:TRA_eos}) 
     1675in \autoref{eq:M_Bq} leads to a very simple form for the steric height: 
    16921676 
    16931677\[ \eta_s = - \frac{1}{\mathcal{A}} \mathcal{D} 
     
    16991683We do not recommend that. 
    17001684Indeed, in this case $\rho_o$ depends on the initial state of the ocean. 
    1701 Since $\rho_o$ has a direct effect on the dynamics of the ocean (it appears in  
    1702 the pressure gradient term of the momentum equation) it is definitively not a good idea when  
    1703 inter-comparing experiments. 
     1685Since $\rho_o$ has a direct effect on the dynamics of the ocean 
     1686(it appears in the pressure gradient term of the momentum equation) 
     1687it is definitively not a good idea when inter-comparing experiments. 
    17041688We better recommend to fixe once for all $\rho_o$ to $1035\;Kg\,m^{-3}$. 
    1705 This value is a sensible choice for the reference density used in a Boussinesq ocean climate model since,  
    1706 with the exception of only a small percentage of the ocean, density in the World Ocean varies by  
    1707 no more than 2$\%$ from this value (\cite{Gill1982}, page 47). 
    1708  
    1709 Second, we have assumed here that the total ocean surface, $\mathcal{A}$, does not change when  
    1710 the sea level is changing as it is the case in all global ocean GCMs  
     1689This value is a sensible choice for the reference density used in a Boussinesq ocean climate model since, 
     1690with the exception of only a small percentage of the ocean, density in the World Ocean varies by no more than 
     16912$\%$ from this value (\cite{Gill1982}, page 47). 
     1692 
     1693Second, we have assumed here that the total ocean surface, $\mathcal{A}$, 
     1694does not change when the sea level is changing as it is the case in all global ocean GCMs 
    17111695(wetting and drying of grid point is not allowed). 
    17121696   
    1713 Third, the discretisation of \autoref{eq:steric_Bq} depends on the type of  
    1714 free surface which is considered. 
     1697Third, the discretisation of \autoref{eq:steric_Bq} depends on the type of free surface which is considered. 
    17151698In the non linear free surface case, $i.e.$ \key{vvl} defined, it is given by 
    17161699 
     
    17191702 \label{eq:discrete_steric_Bq_nfs} \] 
    17201703 
    1721 whereas in the linear free surface, the volume above the \textit{z=0} surface must be explicitly  
    1722 taken into account to better approximate the total ocean mass and thus the steric sea level: 
     1704whereas in the linear free surface, 
     1705the volume above the \textit{z=0} surface must be explicitly taken into account to 
     1706better approximate the total ocean mass and thus the steric sea level: 
    17231707 
    17241708\[ \eta_s = - \frac{ \sum_{i,\,j,\,k} d_a\; e_{1t}e_{2t}e_{3t} + \sum_{i,\,j} d_a\; e_{1t}e_{2t} \eta } 
     
    17291713In the real ocean, sea ice (and snow above it)  depresses the liquid seawater through its mass loading. 
    17301714This depression is a result of the mass of sea ice/snow system acting on the liquid ocean. 
    1731 There is, however, no dynamical effect associated with these depressions in the liquid ocean sea level,  
     1715There is, however, no dynamical effect associated with these depressions in the liquid ocean sea level, 
    17321716so that there are no associated ocean currents. 
    1733 Hence, the dynamically relevant sea level is the effective sea level, $i.e.$ the sea level as if  
    1734 sea ice (and snow) were converted to liquid seawater \citep{Campin_al_OM08}. 
    1735 However, in the current version of \NEMO the sea-ice is levitating above the ocean without  
    1736 mass exchanges between ice and ocean. 
    1737 Therefore the model effective sea level is always given by $\eta + \eta_s$,  
    1738 whether or not there is sea ice present. 
     1717Hence, the dynamically relevant sea level is the effective sea level, 
     1718$i.e.$ the sea level as if sea ice (and snow) were converted to liquid seawater \citep{Campin_al_OM08}. 
     1719However, in the current version of \NEMO the sea-ice is levitating above the ocean without mass exchanges between 
     1720ice and ocean. 
     1721Therefore the model effective sea level is always given by $\eta + \eta_s$, whether or not there is sea ice present. 
    17391722 
    17401723In AR5 outputs, the thermosteric sea level is demanded. 
     
    17471730where $S_o$ and $p_o$ are the initial salinity and pressure, respectively. 
    17481731 
    1749 Both steric and thermosteric sea level are computed in \mdl{diaar5} which needs 
    1750 the \key{diaar5} defined to be called. 
     1732Both steric and thermosteric sea level are computed in \mdl{diaar5} which needs the \key{diaar5} defined to 
     1733be called. 
    17511734 
    17521735% ------------------------------------------------------------------------------------------------------------- 
     
    17611744\subsection{Depth of various quantities (\protect\mdl{diahth})} 
    17621745 
    1763 Among the available diagnostics the following ones are obtained when defining the \key{diahth} CPP key:  
     1746Among the available diagnostics the following ones are obtained when defining the \key{diahth} CPP key: 
    17641747 
    17651748- the mixed layer depth (based on a density criterion \citep{de_Boyer_Montegut_al_JGR04}) (\mdl{diahth}) 
     
    17821765%----------------------------------------------------------------------------------------- 
    17831766 
    1784 The poleward heat and salt transports, their advective and diffusive component, and  
    1785 the meriodional stream function can be computed on-line in \mdl{diaptr} \np{ln\_diaptr} to true  
     1767The poleward heat and salt transports, their advective and diffusive component, 
     1768and the meriodional stream function can be computed on-line in \mdl{diaptr} \np{ln\_diaptr} to true 
    17861769(see the \textit{\ngn{namptr} } namelist below). 
    1787 When \np{ln\_subbas}\forcode{ = .true.}, transports and stream function are computed for the Atlantic,  
    1788 Indian, Pacific and Indo-Pacific Oceans (defined north of 30\deg S) as well as for the World Ocean. 
    1789 The sub-basin decomposition requires an input file (\ifile{subbasins}) which contains  
    1790 three 2D mask arrays, the Indo-Pacific mask been deduced from the sum of the Indian and  
    1791 Pacific mask (\autoref{fig:mask_subasins}). 
     1770When \np{ln\_subbas}\forcode{ = .true.}, transports and stream function are computed for the Atlantic, Indian, 
     1771Pacific and Indo-Pacific Oceans (defined north of 30\deg S) as well as for the World Ocean. 
     1772The sub-basin decomposition requires an input file (\ifile{subbasins}) which contains three 2D mask arrays, 
     1773the Indo-Pacific mask been deduced from the sum of the Indian and Pacific mask (\autoref{fig:mask_subasins}). 
    17921774 
    17931775%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    1794 \begin{figure}[!t] \begin{center} 
    1795    \includegraphics[width=1.0\textwidth]{Fig_mask_subasins} 
    1796    \caption{   \protect\label{fig:mask_subasins} 
    1797       Decomposition of the World Ocean (here ORCA2) into sub-basin used in to compute the heat and  
    1798       salt transports as well as the meridional stream-function: Atlantic basin (red),  
    1799       Pacific basin (green), Indian basin (bleue), Indo-Pacific basin (bleue+green). 
    1800       Note that semi-enclosed seas (Red, Med and Baltic seas) as well as Hudson Bay are removed from  
    1801       the sub-basins. Note also that the Arctic Ocean has been split into Atlantic and  
    1802       Pacific basins along the North fold line.} 
     1776\begin{figure}[!t] 
     1777  \begin{center} 
     1778    \includegraphics[width=1.0\textwidth]{Fig_mask_subasins} 
     1779    \caption{  \protect\label{fig:mask_subasins} 
     1780      Decomposition of the World Ocean (here ORCA2) into sub-basin used in to 
     1781      compute the heat and salt transports as well as the meridional stream-function: 
     1782      Atlantic basin (red), Pacific basin (green), Indian basin (bleue), Indo-Pacific basin (bleue+green). 
     1783      Note that semi-enclosed seas (Red, Med and Baltic seas) as well as Hudson Bay are removed from the sub-basins. 
     1784      Note also that the Arctic Ocean has been split into Atlantic and Pacific basins along the North fold line.} 
    18031785\end{center} \end{figure}   
    18041786%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    18271809The 25 hour mean is available for daily runs by summing up the 25 hourly instantananeous hourly values from 
    18281810midnight at the start of the day to midight at the day end. 
    1829 This diagnostic is actived with the logical  $ln\_dia25h$ 
     1811This diagnostic is actived with the logical $ln\_dia25h$. 
    18301812 
    18311813% ----------------------------------------------------------- 
     
    18391821%---------------------------------------------------------------------------------------------------------- 
    18401822 
    1841 A module is available to output the surface (top), mid water and bed diagnostics of a set of  
    1842 standard variables. 
    1843 This can be a useful diagnostic when hourly or sub-hourly output is required in  
    1844 high resolution tidal outputs. 
     1823A module is available to output the surface (top), mid water and bed diagnostics of a set of standard variables. 
     1824This can be a useful diagnostic when hourly or sub-hourly output is required in high resolution tidal outputs. 
    18451825The tidal signal is retained but the overall data usage is cut to just three vertical levels. 
    18461826Also the bottom level is calculated for each cell. 
    1847 This diagnostic is actived with the logical  $ln\_diatmb$ 
     1827This diagnostic is actived with the logical $ln\_diatmb$. 
    18481828 
    18491829% ----------------------------------------------------------- 
     
    18591839 
    18601840in the zonal, meridional and vertical directions respectively. 
    1861 The vertical component is included although it is not strictly valid as the vertical velocity is  
    1862 calculated from the continuity equation rather than as a prognostic variable. 
     1841The vertical component is included although it is not strictly valid as the vertical velocity is calculated from 
     1842the continuity equation rather than as a prognostic variable. 
    18631843Physically this represents the rate at which information is propogated across a grid cell. 
    1864 Values greater than 1 indicate that information is propagated across more than one grid cell in  
    1865 a single time step. 
    1866  
    1867 The variables can be activated by setting the \np{nn\_diacfl} namelist parameter to 1 in  
    1868 the \ngn{namctl} namelist. 
     1844Values greater than 1 indicate that information is propagated across more than one grid cell in a single time step. 
     1845 
     1846The variables can be activated by setting the \np{nn\_diacfl} namelist parameter to 1 in the \ngn{namctl} namelist. 
    18691847The diagnostics will be written out to an ascii file named cfl\_diagnostics.ascii. 
    1870 In this file the maximum value of $C_u$, $C_v$, and $C_w$ are printed at each timestep along with  
    1871 the coordinates of where the maximum value occurs. 
    1872 At the end of the model run the maximum value of $C_u$, $C_v$, and $C_w$ for the whole model run is  
    1873 printed along with the coordinates of each. 
     1848In this file the maximum value of $C_u$, $C_v$, and $C_w$ are printed at each timestep along with the coordinates of 
     1849where the maximum value occurs. 
     1850At the end of the model run the maximum value of $C_u$, $C_v$, and $C_w$ for the whole model run is printed along 
     1851with the coordinates of each. 
    18741852The maximum values from the run are also copied to the ocean.output file.  
    18751853 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_DIU.tex

    r10146 r10368  
    1818The skin temperature can be split into three parts: 
    1919\begin{itemize} 
    20 \item A foundation SST which is free from diurnal warming. 
    21 \item A warm layer, typically ~3\,m thick, where heating from solar radiation can 
    22 cause a warm stably stratified layer during the daytime 
    23 \item A cool skin, a thin layer, approximately ~1\,mm thick, where long wave cooling 
    24 is dominant and cools the immediate ocean surface. 
     20\item 
     21  A foundation SST which is free from diurnal warming. 
     22\item 
     23  A warm layer, typically ~3\,m thick, 
     24  where heating from solar radiation can cause a warm stably stratified layer during the daytime 
     25\item 
     26  A cool skin, a thin layer, approximately ~1\, mm thick, 
     27  where long wave cooling is dominant and cools the immediate ocean surface. 
    2528\end{itemize} 
    2629 
    27 Models are provided for both the warm layer, \mdfl{diurnal_bulk}, and the cool skin, 
    28 \mdl{cool_skin}.  Foundation SST is not considered as it can be obtained 
    29 either from the main NEMO model ($i.e.$ from the temperature of the top few model levels) 
    30 or from some other source.   
    31 It must be noted that both the cool skin and warm layer models produce estimates of  
    32 the change in temperature ($\Delta T_{\rm{cs}}$ and $\Delta T_{\rm{wl}}$)  
    33 and both must be added to a foundation SST to obtain the true skin temperature. 
     30Models are provided for both the warm layer, \mdfl{diurnal_bulk}, and the cool skin, \mdl{cool_skin}. 
     31Foundation SST is not considered as it can be obtained either from the main NEMO model 
     32($i.e.$ from the temperature of the top few model levels) or from some other source.   
     33It must be noted that both the cool skin and warm layer models produce estimates of the change in temperature 
     34($\Delta T_{\rm{cs}}$ and $\Delta T_{\rm{wl}}$) and 
     35both must be added to a foundation SST to obtain the true skin temperature. 
    3436 
    3537Both the cool skin and warm layer models are controlled through the namelist \ngn{namdiu}: 
     
    3840This namelist contains only two variables: 
    3941\begin{description} 
    40 \item[\np{ln\_diurnal}] A logical switch for turning on/off both the cool skin and warm layer. 
    41 \item[\np{ln\_diurnal\_only}] A logical switch which if \forcode{.true.} will run the diurnal model 
    42 without the other dynamical parts of NEMO.   
    43 \np{ln\_diurnal\_only} must be \forcode{.false.} if \np{ln\_diurnal} is \forcode{.false.}. 
     42\item[\np{ln\_diurnal}] 
     43  A logical switch for turning on/off both the cool skin and warm layer. 
     44\item[\np{ln\_diurnal\_only}] 
     45  A logical switch which if \forcode{.true.} will run the diurnal model without the other dynamical parts of NEMO. 
     46  \np{ln\_diurnal\_only} must be \forcode{.false.} if \np{ln\_diurnal} is \forcode{.false.}. 
    4447\end{description} 
    4548 
    46 Output for the diurnal model is through the variables `sst\_wl' (warm\_layer) and 
    47 `sst\_cs' (cool skin).  These are 2-D variables which will be included in the model 
    48 output if they are specified in the iodef.xml file. 
     49Output for the diurnal model is through the variables `sst\_wl' (warm\_layer) and `sst\_cs' (cool skin). 
     50These are 2-D variables which will be included in the model output if they are specified in the iodef.xml file. 
    4951 
    50 Initialisation is through the restart file.  Specifically the code will expect  
    51 the presence of the 2-D variable ``Dsst'' to initialise the warm layer.   
    52 The cool skin model, which is determined purely by the instantaneous fluxes,  
    53 has no initialisation variable.   
     52Initialisation is through the restart file. 
     53Specifically the code will expect the presence of the 2-D variable ``Dsst'' to initialise the warm layer. 
     54The cool skin model, which is determined purely by the instantaneous fluxes, has no initialisation variable.   
    5455 
    5556%=============================================================== 
     
    5859%=============================================================== 
    5960 
    60 The warm layer is calculated using the model of \citet{Takaya_al_JGR10} (TAKAYA10 model 
    61 hereafter).  This is a simple flux based model that is defined by the equations 
     61The warm layer is calculated using the model of \citet{Takaya_al_JGR10} (TAKAYA10 model hereafter). 
     62This is a simple flux based model that is defined by the equations 
    6263\begin{eqnarray} 
    6364\frac{\partial{\Delta T_{\rm{wl}}}}{\partial{t}}&=&\frac{Q(\nu+1)}{D_T\rho_w c_p 
     
    6667L&=&\frac{\rho_w c_p u^{*^3}_{w}}{\kappa g \alpha_w Q }\mbox{,}\label{eq:ecmwf2} 
    6768\end{eqnarray} 
    68 where $\Delta T_{\rm{wl}}$ is the temperature difference between the top of the warm 
    69 layer and the depth $D_T=3$\,m at which there is assumed to be no diurnal signal. In 
    70 equation (\autoref{eq:ecmwf1}) $\alpha_w=2\times10^{-4}$ is the thermal expansion 
    71 coefficient of water, $\kappa=0.4$ is von K\'{a}rm\'{a}n's constant, $c_p$ is the heat 
    72 capacity at constant pressure of sea water, $\rho_w$ is the 
    73 water density, and $L$ is the Monin-Obukhov length. The tunable 
    74 variable $\nu$ is a shape parameter that defines the expected 
    75 subskin temperature profile via $T(z)=T(0)-\left(\frac{z}{D_T}\right)^\nu\Delta 
    76 T_{\rm{wl}}$, 
    77 where $T$ is the absolute temperature and $z\le D_T$ is the depth 
    78 below the top of the warm layer. 
    79 The influence of wind on TAKAYA10 comes through the magnitude of the friction velocity 
    80 of the water 
    81 $u^*_{w}$, which can be related to the 10\,m wind speed $u_{10}$ through the relationship 
    82 $u^*_{w} = u_{10}\sqrt{\frac{C_d\rho_a}{\rho_w}}$, where $C_d$ is 
    83 the drag coefficient, and $\rho_a$ is the density of air.  The symbol $Q$ in equation 
    84 (\autoref{eq:ecmwf1}) is the instantaneous total thermal energy 
    85 flux into 
     69where $\Delta T_{\rm{wl}}$ is the temperature difference between the top of the warm layer and the depth $D_T=3$\,m at which there is assumed to be no diurnal signal. 
     70In equation (\autoref{eq:ecmwf1}) $\alpha_w=2\times10^{-4}$ is the thermal expansion coefficient of water, 
     71$\kappa=0.4$ is von K\'{a}rm\'{a}n's constant, $c_p$ is the heat capacity at constant pressure of sea water, 
     72$\rho_w$ is the water density, and $L$ is the Monin-Obukhov length. 
     73The tunable variable $\nu$ is a shape parameter that defines the expected subskin temperature profile via 
     74$T(z)=T(0)-\left(\frac{z}{D_T}\right)^\nu\DeltaT_{\rm{wl}}$, 
     75where $T$ is the absolute temperature and $z\le D_T$ is the depth below the top of the warm layer. 
     76The influence of wind on TAKAYA10 comes through the magnitude of the friction velocity of the water $u^*_{w}$, 
     77which can be related to the 10\,m wind speed $u_{10}$ through 
     78the relationship $u^*_{w} = u_{10}\sqrt{\frac{C_d\rho_a}{\rho_w}}$, where $C_d$ is the drag coefficient, 
     79and $\rho_a$ is the density of air. 
     80The symbol $Q$ in equation (\autoref{eq:ecmwf1}) is the instantaneous total thermal energy flux into 
    8681the diurnal layer, $i.e.$ 
    8782\begin{equation} 
    8883Q = Q_{\rm{sol}} + Q_{\rm{lw}} + Q_{\rm{h}}\mbox{,} \label{eq:e_flux_eqn} 
    8984\end{equation} 
    90 where $Q_{\rm{h}}$ is the sensible and latent heat flux, $Q_{\rm{lw}}$ is the long 
    91 wave flux, and $Q_{\rm{sol}}$ is the solar flux absorbed 
    92 within the diurnal warm layer. For $Q_{\rm{sol}}$ the 9 term 
    93 representation of \citet{Gentemann_al_JGR09} is used.  In equation \autoref{eq:ecmwf1} 
    94 the function $f(L_a)=\max(1,L_a^{\frac{2}{3}})$, where $L_a=0.3$\footnote{This 
    95 is a global average value, more accurately $L_a$ could be computed as 
    96 $L_a=(u^*_{w}/u_s)^{\frac{1}{2}}$, where $u_s$ is the stokes drift, but this is not 
    97 currently done} is the turbulent Langmuir number and is a 
    98 parametrization of the effect of waves. 
     85where $Q_{\rm{h}}$ is the sensible and latent heat flux, $Q_{\rm{lw}}$ is the long wave flux, 
     86and $Q_{\rm{sol}}$ is the solar flux absorbed within the diurnal warm layer. 
     87For $Q_{\rm{sol}}$ the 9 term representation of \citet{Gentemann_al_JGR09} is used. 
     88In equation \autoref{eq:ecmwf1} the function $f(L_a)=\max(1,L_a^{\frac{2}{3}})$, 
     89where $L_a=0.3$\footnote{ 
     90  This is a global average value, more accurately $L_a$ could be computed as $L_a=(u^*_{w}/u_s)^{\frac{1}{2}}$, 
     91  where $u_s$ is the stokes drift, but this is not currently done 
     92} is the turbulent Langmuir number and is a parametrization of the effect of waves. 
    9993The function $\Phi\!\left(\frac{D_T}{L}\right)$ is the similarity function that 
    100 parametrizes the stability of the water column and 
    101 is given by: 
     94parametrizes the stability of the water column and is given by: 
    10295\begin{equation} 
    10396\Phi(\zeta) = \left\{ \begin{array}{cc} 1 + \frac{5\zeta + 
     
    10699                                    \end{array} \right. \label{eq:stab_func_eqn} 
    107100\end{equation} 
    108 where $\zeta=\frac{D_T}{L}$.  It is clear that the first derivative of 
    109 (\autoref{eq:stab_func_eqn}), and thus of (\autoref{eq:ecmwf1}), 
    110 is discontinuous at $\zeta=0$ ($i.e.$ $Q\rightarrow0$ in equation (\autoref{eq:ecmwf2})). 
     101where $\zeta=\frac{D_T}{L}$.  It is clear that the first derivative of (\autoref{eq:stab_func_eqn}), 
     102and thus of (\autoref{eq:ecmwf1}), is discontinuous at $\zeta=0$ ($i.e.$ $Q\rightarrow0$ in 
     103equation (\autoref{eq:ecmwf2})). 
    111104 
    112105The two terms on the right hand side of (\autoref{eq:ecmwf1}) represent different processes. 
    113 The first term is simply the diabatic heating or cooling of the 
    114 diurnal warm 
    115 layer due to thermal energy 
    116 fluxes into and out of the layer.  The second term 
    117 parametrizes turbulent fluxes of heat out of the diurnal warm layer due to wind 
    118 induced mixing. In practice the second term acts as a relaxation 
    119 on the temperature. 
     106The first term is simply the diabatic heating or cooling of the diurnal warm layer due to 
     107thermal energy fluxes into and out of the layer. 
     108The second term parametrizes turbulent fluxes of heat out of the diurnal warm layer due to wind induced mixing. 
     109In practice the second term acts as a relaxation on the temperature. 
    120110 
    121111%=============================================================== 
     
    126116%=============================================================== 
    127117 
    128 The cool skin is modelled using the framework of \citet{Saunders_JAS82} who used a 
    129 formulation of the near surface temperature difference based upon the heat flux and 
    130 the friction velocity $u^*_{w}$.  As the cool skin 
    131 is so thin (~1\,mm) we ignore the solar flux component to the heat flux and the 
    132 Saunders equation for the cool skin temperature difference $\Delta T_{\rm{cs}}$ becomes 
     118The cool skin is modelled using the framework of \citet{Saunders_JAS82} who used a formulation of the near surface temperature difference based upon the heat flux and the friction velocity $u^*_{w}$. 
     119As the cool skin is so thin (~1\,mm) we ignore the solar flux component to the heat flux and the Saunders equation for the cool skin temperature difference $\Delta T_{\rm{cs}}$ becomes 
    133120\begin{equation} 
    134121\label{eq:sunders_eqn} 
     
    136123\end{equation} 
    137124where $Q_{\rm{ns}}$ is the, usually negative, non-solar heat flux into the ocean and 
    138 $k_t$ is the thermal conductivity of sea water. $\delta$ is the thickness of the 
    139 skin layer and is given by 
     125$k_t$ is the thermal conductivity of sea water. 
     126$\delta$ is the thickness of the skin layer and is given by 
    140127\begin{equation} 
    141128\label{eq:sunders_thick_eqn} 
    142129\delta=\frac{\lambda \mu}{u^*_{w}} \mbox{,} 
    143130\end{equation} 
    144 where $\mu$ is the kinematic viscosity of sea water and $\lambda$ is a constant of 
    145 proportionality which \citet{Saunders_JAS82} suggested varied between 5 and 10. 
     131where $\mu$ is the kinematic viscosity of sea water and $\lambda$ is a constant of proportionality which 
     132\citet{Saunders_JAS82} suggested varied between 5 and 10. 
    146133 
    147 The value of $\lambda$ used in equation (\autoref{eq:sunders_thick_eqn}) is that of 
    148 \citet{Artale_al_JGR02}, 
    149 which is shown in \citet{Tu_Tsuang_GRL05} to outperform a number of other 
    150 parametrisations at both low and high wind speeds. Specifically, 
     134The value of $\lambda$ used in equation (\autoref{eq:sunders_thick_eqn}) is that of \citet{Artale_al_JGR02}, 
     135which is shown in \citet{Tu_Tsuang_GRL05} to outperform a number of other parametrisations at 
     136both low and high wind speeds. 
     137Specifically, 
    151138\begin{equation} 
    152139\label{eq:artale_lambda_eqn} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_DOM.tex

    r10146 r10368  
    2020$\ $\newline    % force a new line 
    2121 
    22 Having defined the continuous equations in \autoref{chap:PE} and chosen a time  
    23 discretization \autoref{chap:STP}, we need to choose a discretization on a grid,  
    24 and numerical algorithms. In the present chapter, we provide a general description  
    25 of the staggered grid used in \NEMO, and other information relevant to the main  
    26 directory routines as well as the DOM (DOMain) directory.  
     22Having defined the continuous equations in \autoref{chap:PE} and chosen a time discretization \autoref{chap:STP}, 
     23we need to choose a discretization on a grid, and numerical algorithms. 
     24In the present chapter, we provide a general description of the staggered grid used in \NEMO, 
     25and other information relevant to the main directory routines as well as the DOM (DOMain) directory. 
    2726 
    2827$\ $\newline    % force a new line 
     
    4342\begin{figure}[!tb]    \begin{center} 
    4443\includegraphics[width=0.90\textwidth]{Fig_cell} 
    45 \caption{ \protect\label{fig:cell}     
    46 Arrangement of variables. $t$ indicates scalar points where temperature,  
    47 salinity, density, pressure and horizontal divergence are defined. ($u$,$v$,$w$)  
    48 indicates vector points, and $f$ indicates vorticity points where both relative and  
    49 planetary vorticities are defined} 
     44\caption{ \protect\label{fig:cell} 
     45  Arrangement of variables. 
     46  $t$ indicates scalar points where temperature, salinity, density, pressure and horizontal divergence are defined. 
     47  ($u$,$v$,$w$) indicates vector points, 
     48  and $f$ indicates vorticity points where both relative and planetary vorticities are defined} 
    5049\end{center}   \end{figure} 
    5150%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    5251 
    53 The numerical techniques used to solve the Primitive Equations in this model are  
    54 based on the traditional, centred second-order finite difference approximation.  
    55 Special attention has been given to the homogeneity of the solution in the three  
    56 space directions. The arrangement of variables is the same in all directions.  
    57 It consists of cells centred on scalar points ($t$, $S$, $p$, $\rho$) with vector  
    58 points $(u, v, w)$ defined in the centre of each face of the cells (\autoref{fig:cell}).  
    59 This is the generalisation to three dimensions of the well-known ``C'' grid in  
    60 Arakawa's classification \citep{Mesinger_Arakawa_Bk76}. The relative and  
    61 planetary vorticity, $\zeta$ and $f$, are defined in the centre of each vertical edge  
    62 and the barotropic stream function $\psi$ is defined at horizontal points overlying  
    63 the $\zeta$ and $f$-points. 
    64  
    65 The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined  
    66 by the transformation that gives ($\lambda$ ,$\varphi$ ,$z$) as a function of $(i,j,k)$.  
    67 The grid-points are located at integer or integer and a half value of $(i,j,k)$ as  
    68 indicated on \autoref{tab:cell}. In all the following, subscripts $u$, $v$, $w$,  
    69 $f$, $uw$, $vw$ or $fw$ indicate the position of the grid-point where the scale  
    70 factors are defined. Each scale factor is defined as the local analytical value  
    71 provided by \autoref{eq:scale_factors}. As a result, the mesh on which partial  
    72 derivatives $\frac{\partial}{\partial \lambda}, \frac{\partial}{\partial \varphi}$, and  
    73 $\frac{\partial}{\partial z} $ are evaluated is a uniform mesh with a grid size of unity.  
    74 Discrete partial derivatives are formulated by the traditional, centred second order  
    75 finite difference approximation while the scale factors are chosen equal to their  
    76 local analytical value. An important point here is that the partial derivative of the  
    77 scale factors must be evaluated by centred finite difference approximation, not  
    78 from their analytical expression. This preserves the symmetry of the discrete set  
    79 of equations and therefore satisfies many of the continuous properties (see  
    80 \autoref{apdx:C}). A similar, related remark can be made about the domain  
    81 size: when needed, an area, volume, or the total ocean depth must be evaluated  
    82 as the sum of the relevant scale factors (see \autoref{eq:DOM_bar}) in the next section).  
     52The numerical techniques used to solve the Primitive Equations in this model are based on the traditional, 
     53centred second-order finite difference approximation. 
     54Special attention has been given to the homogeneity of the solution in the three space directions. 
     55The arrangement of variables is the same in all directions. 
     56It consists of cells centred on scalar points ($t$, $S$, $p$, $\rho$) with vector points $(u, v, w)$ defined in 
     57the centre of each face of the cells (\autoref{fig:cell}). 
     58This is the generalisation to three dimensions of the well-known ``C'' grid in Arakawa's classification 
     59\citep{Mesinger_Arakawa_Bk76}. 
     60The relative and planetary vorticity, $\zeta$ and $f$, are defined in the centre of each vertical edge and 
     61the barotropic stream function $\psi$ is defined at horizontal points overlying the $\zeta$ and $f$-points. 
     62 
     63The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined by 
     64the transformation that gives ($\lambda$ ,$\varphi$ ,$z$) as a function of $(i,j,k)$. 
     65The grid-points are located at integer or integer and a half value of $(i,j,k)$ as indicated on \autoref{tab:cell}. 
     66In all the following, subscripts $u$, $v$, $w$, $f$, $uw$, $vw$ or $fw$ indicate the position of 
     67the grid-point where the scale factors are defined. 
     68Each scale factor is defined as the local analytical value provided by \autoref{eq:scale_factors}. 
     69As a result, 
     70the mesh on which partial derivatives $\frac{\partial}{\partial \lambda}, \frac{\partial}{\partial \varphi}$, 
     71and $\frac{\partial}{\partial z} $ are evaluated is a uniform mesh with a grid size of unity. 
     72Discrete partial derivatives are formulated by the traditional, 
     73centred second order finite difference approximation while 
     74the scale factors are chosen equal to their local analytical value. 
     75An important point here is that the partial derivative of the scale factors must be evaluated by 
     76centred finite difference approximation, not from their analytical expression. 
     77This preserves the symmetry of the discrete set of equations and 
     78therefore satisfies many of the continuous properties (see \autoref{apdx:C}). 
     79A similar, related remark can be made about the domain size: 
     80when needed, an area, volume, or the total ocean depth must be evaluated as the sum of the relevant scale factors 
     81(see \autoref{eq:DOM_bar}) in the next section). 
    8382 
    8483%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    9695\end{tabular} 
    9796\caption{ \protect\label{tab:cell} 
    98 Location of grid-points as a function of integer or integer and a half value of the column,  
    99 line or level. This indexing is only used for the writing of the semi-discrete equation.  
    100 In the code, the indexing uses integer values only and has a reverse direction  
    101 in the vertical (see \autoref{subsec:DOM_Num_Index})} 
     97  Location of grid-points as a function of integer or integer and a half value of the column, line or level. 
     98  This indexing is only used for the writing of the semi-discrete equation. 
     99  In the code, the indexing uses integer values only and has a reverse direction in the vertical 
     100  (see \autoref{subsec:DOM_Num_Index})} 
    102101\end{center} 
    103102\end{table} 
     
    110109\label{subsec:DOM_operators} 
    111110 
    112 Given the values of a variable $q$ at adjacent points, the differencing and  
    113 averaging operators at the midpoint between them are: 
     111Given the values of a variable $q$ at adjacent points, 
     112the differencing and averaging operators at the midpoint between them are: 
    114113\begin{subequations} \label{eq:di_mi} 
    115114\begin{align} 
     
    119118\end{subequations} 
    120119 
    121 Similar operators are defined with respect to $i+1/2$, $j$, $j+1/2$, $k$, and  
    122 $k+1/2$. Following \autoref{eq:PE_grad} and \autoref{eq:PE_lap}, the gradient of a  
    123 variable $q$ defined at a $t$-point has its three components defined at $u$-, $v$-  
    124 and $w$-points while its Laplacien is defined at $t$-point. These operators have  
    125 the following discrete forms in the curvilinear $s$-coordinate system: 
     120Similar operators are defined with respect to $i+1/2$, $j$, $j+1/2$, $k$, and $k+1/2$. 
     121Following \autoref{eq:PE_grad} and \autoref{eq:PE_lap}, the gradient of a variable $q$ defined at 
     122a $t$-point has its three components defined at $u$-, $v$- and $w$-points while 
     123its Laplacien is defined at $t$-point. 
     124These operators have the following discrete forms in the curvilinear $s$-coordinate system: 
    126125\begin{equation} \label{eq:DOM_grad} 
    127126\nabla q\equiv    \frac{1}{e_{1u} } \delta _{i+1/2 } [q] \;\,\mathbf{i} 
     
    136135\end{multline} 
    137136 
    138 Following \autoref{eq:PE_curl} and \autoref{eq:PE_div}, a vector ${\rm {\bf A}}=\left( a_1,a_2,a_3\right)$  
    139 defined at vector points $(u,v,w)$ has its three curl components defined at $vw$-, $uw$,  
    140 and $f$-points, and its divergence defined at $t$-points: 
     137Following \autoref{eq:PE_curl} and \autoref{eq:PE_div}, a vector ${\rm {\bf A}}=\left( a_1,a_2,a_3\right)$ 
     138defined at vector points $(u,v,w)$ has its three curl components defined at $vw$-, $uw$, and $f$-points, 
     139and its divergence defined at $t$-points: 
    141140\begin{eqnarray}  \label{eq:DOM_curl} 
    142141 \nabla \times {\rm{\bf A}}\equiv & 
     
    151150\end{eqnarray} 
    152151 
    153 The vertical average over the whole water column denoted by an overbar becomes  
    154 for a quantity $q$ which is a masked field (i.e. equal to zero inside solid area): 
     152The vertical average over the whole water column denoted by an overbar becomes for a quantity $q$ which 
     153is a masked field (i.e. equal to zero inside solid area): 
    155154\begin{equation} \label{eq:DOM_bar} 
    156155\bar q   =         \frac{1}{H}    \int_{k^b}^{k^o} {q\;e_{3q} \,dk}  
    157156      \equiv \frac{1}{H_q }\sum\limits_k {q\;e_{3q} } 
    158157\end{equation} 
    159 where $H_q$  is the ocean depth, which is the masked sum of the vertical scale  
    160 factors at $q$ points, $k^b$ and $k^o$ are the bottom and surface $k$-indices,  
    161 and the symbol $k^o$ refers to a summation over all grid points of the same type  
    162 in the direction indicated by the subscript (here $k$).  
     158where $H_q$  is the ocean depth, which is the masked sum of the vertical scale factors at $q$ points, 
     159$k^b$ and $k^o$ are the bottom and surface $k$-indices, 
     160and the symbol $k^o$ refers to a summation over all grid points of the same type in the direction indicated by 
     161the subscript (here $k$).  
    163162 
    164163In continuous form, the following properties are satisfied: 
     
    170169\end{equation} 
    171170 
    172 It is straightforward to demonstrate that these properties are verified locally in  
    173 discrete form as soon as the scalar $q$ is taken at $t$-points and the vector  
    174 \textbf{A} has its components defined at vector points $(u,v,w)$. 
    175  
    176 Let $a$ and $b$ be two fields defined on the mesh, with value zero inside  
    177 continental area. Using integration by parts it can be shown that the differencing  
    178 operators ($\delta_i$, $\delta_j$ and $\delta_k$) are skew-symmetric linear operators,  
    179 and further that the averaging operators $\overline{\,\cdot\,}^{\,i}$,  
    180 $\overline{\,\cdot\,}^{\,k}$ and $\overline{\,\cdot\,}^{\,k}$) are symmetric linear  
    181 operators, $i.e.$ 
     171It is straightforward to demonstrate that these properties are verified locally in discrete form as soon as 
     172the scalar $q$ is taken at $t$-points and 
     173the vector \textbf{A} has its components defined at vector points $(u,v,w)$. 
     174 
     175Let $a$ and $b$ be two fields defined on the mesh, with value zero inside continental area. 
     176Using integration by parts it can be shown that 
     177the differencing operators ($\delta_i$, $\delta_j$ and $\delta_k$) are skew-symmetric linear operators, 
     178and further that the averaging operators $\overline{\,\cdot\,}^{\,i}$, $\overline{\,\cdot\,}^{\,k}$ and 
     179$\overline{\,\cdot\,}^{\,k}$) are symmetric linear operators, 
     180$i.e.$ 
    182181\begin{align}  
    183182\label{eq:DOM_di_adj} 
     
    189188\end{align} 
    190189 
    191 In other words, the adjoint of the differencing and averaging operators are  
    192 $\delta_i^*=\delta_{i+1/2}$ and  
     190In other words, the adjoint of the differencing and averaging operators are $\delta_i^*=\delta_{i+1/2}$ and  
    193191${(\overline{\,\cdot \,}^{\,i})}^*= \overline{\,\cdot\,}^{\,i+1/2}$, respectively.  
    194 These two properties will be used extensively in the \autoref{apdx:C} to  
     192These two properties will be used extensively in the \autoref{apdx:C} to 
    195193demonstrate integral conservative properties of the discrete formulation chosen. 
    196194 
     
    204202\begin{figure}[!tb]  \begin{center} 
    205203\includegraphics[width=0.90\textwidth]{Fig_index_hor} 
    206 \caption{   \protect\label{fig:index_hor}     
    207 Horizontal integer indexing used in the \textsc{Fortran} code. The dashed area indicates  
    208 the cell in which variables contained in arrays have the same $i$- and $j$-indices} 
     204\caption{   \protect\label{fig:index_hor} 
     205  Horizontal integer indexing used in the \textsc{Fortran} code. 
     206  The dashed area indicates the cell in which variables contained in arrays have the same $i$- and $j$-indices} 
    209207\end{center}   \end{figure} 
    210208%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    211209 
    212 The array representation used in the \textsc{Fortran} code requires an integer  
    213 indexing while the analytical definition of the mesh (see \autoref{subsec:DOM_cell}) is  
    214 associated with the use of integer values for $t$-points and both integer and  
    215 integer and a half values for all the other points. Therefore a specific integer  
    216 indexing must be defined for points other than $t$-points ($i.e.$ velocity and  
    217 vorticity grid-points). Furthermore, the direction of the vertical indexing has  
    218 been changed so that the surface level is at $k=1$. 
     210The array representation used in the \textsc{Fortran} code requires an integer indexing while 
     211the analytical definition of the mesh (see \autoref{subsec:DOM_cell}) is associated with the use of 
     212integer values for $t$-points and both integer and integer and a half values for all the other points. 
     213Therefore a specific integer indexing must be defined for points other than $t$-points 
     214($i.e.$ velocity and vorticity grid-points). 
     215Furthermore, the direction of the vertical indexing has been changed so that the surface level is at $k=1$. 
    219216 
    220217% ----------------------------------- 
     
    224221\label{subsec:DOM_Num_Index_hor} 
    225222 
    226 The indexing in the horizontal plane has been chosen as shown in \autoref{fig:index_hor}.  
    227 For an increasing $i$ index ($j$ index), the $t$-point and the eastward $u$-point  
    228 (northward $v$-point) have the same index (see the dashed area in \autoref{fig:index_hor}).  
     223The indexing in the horizontal plane has been chosen as shown in \autoref{fig:index_hor}. 
     224For an increasing $i$ index ($j$ index), 
     225the $t$-point and the eastward $u$-point (northward $v$-point) have the same index 
     226(see the dashed area in \autoref{fig:index_hor}). 
    229227A $t$-point and its nearest northeast $f$-point have the same $i$-and $j$-indices. 
    230228 
     
    235233\label{subsec:DOM_Num_Index_vertical} 
    236234 
    237 In the vertical, the chosen indexing requires special attention since the  
    238 $k$-axis is re-orientated downward in the \textsc{Fortran} code compared  
    239 to the indexing used in the semi-discrete equations and given in \autoref{subsec:DOM_cell}.  
    240 The sea surface corresponds to the $w$-level $k=1$ which is the same index  
    241 as $t$-level just below (\autoref{fig:index_vert}). The last $w$-level ($k=jpk$)  
    242 either corresponds to the ocean floor or is inside the bathymetry while the last  
    243 $t$-level is always inside the bathymetry (\autoref{fig:index_vert}). Note that  
    244 for an increasing $k$ index, a $w$-point and the $t$-point just below have the  
    245 same $k$ index, in opposition to what is done in the horizontal plane where  
    246 it is the $t$-point and the nearest velocity points in the direction of the horizontal  
    247 axis that have the same $i$ or $j$ index (compare the dashed area in  
    248 \autoref{fig:index_hor} and \autoref{fig:index_vert}). Since the scale factors are  
    249 chosen to be strictly positive, a \emph{minus sign} appears in the \textsc{Fortran}  
    250 code \emph{before all the vertical derivatives} of the discrete equations given in  
    251 this documentation. 
     235In the vertical, the chosen indexing requires special attention since 
     236the $k$-axis is re-orientated downward in the \textsc{Fortran} code compared to 
     237the indexing used in the semi-discrete equations and given in \autoref{subsec:DOM_cell}. 
     238The sea surface corresponds to the $w$-level $k=1$ which is the same index as $t$-level just below 
     239(\autoref{fig:index_vert}). 
     240The last $w$-level ($k=jpk$) either corresponds to the ocean floor or is inside the bathymetry while 
     241the last $t$-level is always inside the bathymetry (\autoref{fig:index_vert}). 
     242Note that for an increasing $k$ index, a $w$-point and the $t$-point just below have the same $k$ index, 
     243in opposition to what is done in the horizontal plane where 
     244it is the $t$-point and the nearest velocity points in the direction of the horizontal axis that 
     245have the same $i$ or $j$ index 
     246(compare the dashed area in \autoref{fig:index_hor} and \autoref{fig:index_vert}). 
     247Since the scale factors are chosen to be strictly positive, a \emph{minus sign} appears in the \textsc{Fortran}  
     248code \emph{before all the vertical derivatives} of the discrete equations given in this documentation. 
    252249 
    253250%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    254251\begin{figure}[!pt]    \begin{center} 
    255252\includegraphics[width=.90\textwidth]{Fig_index_vert} 
    256 \caption{ \protect\label{fig:index_vert}      
    257 Vertical integer indexing used in the \textsc{Fortran } code. Note that  
    258 the $k$-axis is orientated downward. The dashed area indicates the cell in  
    259 which variables contained in arrays have the same $k$-index.} 
     253\caption{ \protect\label{fig:index_vert} 
     254  Vertical integer indexing used in the \textsc{Fortran } code. 
     255  Note that the $k$-axis is orientated downward. 
     256  The dashed area indicates the cell in which variables contained in arrays have the same $k$-index.} 
    260257\end{center}   \end{figure} 
    261258%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    267264\label{subsec:DOM_size} 
    268265 
    269 The total size of the computational domain is set by the parameters \np{jpiglo},  
    270 \np{jpjglo} and \np{jpkglo} in the $i$, $j$ and $k$ directions respectively.  
     266The total size of the computational domain is set by the parameters \np{jpiglo}, 
     267\np{jpjglo} and \np{jpkglo} in the $i$, $j$ and $k$ directions respectively. 
    271268%%% 
    272269%%% 
    273270%%% 
    274 Parameters $jpi$ and $jpj$ refer to the size of each processor subdomain when the code is  
    275 run in parallel using domain decomposition (\key{mpp\_mpi} defined, see \autoref{sec:LBC_mpp}). 
     271Parameters $jpi$ and $jpj$ refer to the size of each processor subdomain when 
     272the code is run in parallel using domain decomposition (\key{mpp\_mpi} defined, 
     273see \autoref{sec:LBC_mpp}). 
    276274 
    277275 
     
    283281\section{Needed fields} 
    284282\label{sec:DOM_fields} 
    285 The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined  
    286 by the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$.  
    287 The grid-points are located at integer or integer and a half values of as indicated  
    288 in \autoref{tab:cell}. The associated scale factors are defined using the   
    289 analytical first derivative of the transformation \autoref{eq:scale_factors}.  
     283The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined by the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$. 
     284The grid-points are located at integer or integer and a half values of as indicated in \autoref{tab:cell}. 
     285The associated scale factors are defined using the analytical first derivative of the transformation 
     286\autoref{eq:scale_factors}. 
    290287Necessary fields for configuration definition are: \\ 
    291288Geographic position : 
    292289 
    293 longitude : glamt , glamu , glamv and glamf (at T, U, V and F point) 
    294  
    295 latitude : gphit , gphiu , gphiv and gphif (at T, U, V and F point)\\ 
     290longitude: glamt, glamu, glamv and glamf (at T, U, V and F point) 
     291 
     292latitude: gphit, gphiu, gphiv and gphif (at T, U, V and F point)\\ 
    296293Coriolis parameter (if domain not on the sphere):  
    297294 
     
    301298 e1t, e1u, e1v and e1f (on i direction), 
    302299 
    303  e2t, e2u, e2v and e2f (on j direction) 
    304  
    305  and ie1e2u\_v, e1e2u , e1e2v    
     300 e2t, e2u, e2v and e2f (on j direction) and 
     301 
     302 ie1e2u\_v, e1e2u , e1e2v    
    306303  
    307304e1e2u , e1e2v are u and v surfaces (if gridsize reduction in some straits)\\ 
    308305ie1e2u\_v is a flag to flag set u and  v surfaces are neither read nor computed.\\ 
    309306  
    310 These fields can be read in an domain input file which name is setted in \np{cn\_domcfg} parameter specified in \ngn{namcfg}. 
     307These fields can be read in an domain input file which name is setted in 
     308\np{cn\_domcfg} parameter specified in \ngn{namcfg}. 
    311309 
    312310\nlst{namcfg} 
    313311or they can be defined in an analytical way in MY\_SRC directory of the configuration. 
    314 For Reference Configurations of NEMO input domain files are supplied by NEMO System Team. For analytical definition of input fields two routines are supplied: \mdl{userdef\_hgr} and \mdl{userdef\_zgr}. They are an example of GYRE configuration parameters, and they are available in NEMO/OPA\_SRC/USR directory, they provide the horizontal and vertical mesh.  
     312For Reference Configurations of NEMO input domain files are supplied by NEMO System Team. 
     313For analytical definition of input fields two routines are supplied: \mdl{userdef\_hgr} and \mdl{userdef\_zgr}. 
     314They are an example of GYRE configuration parameters, and they are available in NEMO/OPA\_SRC/USR directory, 
     315they provide the horizontal and vertical mesh.  
    315316% ------------------------------------------------------------------------------------------------------------- 
    316317%        Needed fields  
     
    332333\label{subsec:DOM_hgr_coord_e} 
    333334 
    334 The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined  
    335 by the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$.  
    336 The grid-points are located at integer or integer and a half values of as indicated  
    337 in \autoref{tab:cell}. The associated scale factors are defined using the  
    338 analytical first derivative of the transformation \autoref{eq:scale_factors}. These  
    339 definitions are done in two modules, \mdl{domhgr} and \mdl{domzgr}, which  
    340 provide the horizontal and vertical meshes, respectively. This section deals with  
    341 the horizontal mesh parameters. 
    342  
    343 In a horizontal plane, the location of all the model grid points is defined from the  
    344 analytical expressions of the longitude $\lambda$ and  latitude $\varphi$ as a  
    345 function of  $(i,j)$. The horizontal scale factors are calculated using  
    346 \autoref{eq:scale_factors}. For example, when the longitude and latitude are  
    347 function of a single value ($i$ and $j$, respectively) (geographical configuration  
    348 of the mesh), the horizontal mesh definition reduces to define the wanted  
    349 $\lambda(i)$, $\varphi(j)$, and their derivatives $\lambda'(i)$ $\varphi'(j)$ in the  
    350 \mdl{domhgr} module. The model computes the grid-point positions and scale  
    351 factors in the horizontal plane as follows: 
     335The ocean mesh ($i.e.$ the position of all the scalar and vector points) is defined by 
     336the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$. 
     337The grid-points are located at integer or integer and a half values of as indicated in \autoref{tab:cell}. 
     338The associated scale factors are defined using the analytical first derivative of the transformation 
     339\autoref{eq:scale_factors}. 
     340These definitions are done in two modules, \mdl{domhgr} and \mdl{domzgr}, 
     341which provide the horizontal and vertical meshes, respectively. 
     342This section deals with the horizontal mesh parameters. 
     343 
     344In a horizontal plane, the location of all the model grid points is defined from 
     345the analytical expressions of the longitude $\lambda$ and latitude $\varphi$ as a function of $(i,j)$. 
     346The horizontal scale factors are calculated using \autoref{eq:scale_factors}. 
     347For example, when the longitude and latitude are function of a single value 
     348($i$ and $j$, respectively) (geographical configuration of the mesh), 
     349the horizontal mesh definition reduces to define the wanted $\lambda(i)$, $\varphi(j)$, 
     350and their derivatives $\lambda'(i)$ $\varphi'(j)$ in the \mdl{domhgr} module. 
     351The model computes the grid-point positions and scale factors in the horizontal plane as follows: 
    352352\begin{flalign*} 
    353353\lambda_t &\equiv \text{glamt}= \lambda(i)     & \varphi_t &\equiv \text{gphit} = \varphi(j)\\ 
     
    366366e_{2f} &\equiv \text{e2t} = r_a |\varphi'(j+1/2)| 
    367367\end{flalign*} 
    368 where the last letter of each computational name indicates the grid point  
    369 considered and $r_a$ is the earth radius (defined in \mdl{phycst} along with  
    370 all universal constants). Note that the horizontal position of and scale factors  
    371 at $w$-points are exactly equal to those of $t$-points, thus no specific arrays  
    372 are defined at $w$-points.  
    373  
    374 Note that the definition of the scale factors ($i.e.$ as the analytical first derivative  
    375 of the transformation that gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$) is  
    376 specific to the \NEMO model \citep{Marti_al_JGR92}. As an example, $e_{1t}$ is defined  
    377 locally at a $t$-point, whereas many other models on a C grid choose to define  
    378 such a scale factor as the distance between the $U$-points on each side of the  
    379 $t$-point. Relying on an analytical transformation has two advantages: firstly, there  
    380 is no ambiguity in the scale factors appearing in the discrete equations, since they  
    381 are first introduced in the continuous equations; secondly, analytical transformations  
    382 encourage good practice by the definition of smoothly varying grids (rather than  
    383 allowing the user to set arbitrary jumps in thickness between adjacent layers)  
    384 \citep{Treguier1996}. An example of the effect of such a choice is shown in  
    385 \autoref{fig:zgr_e3}. 
     368where the last letter of each computational name indicates the grid point considered and 
     369$r_a$ is the earth radius (defined in \mdl{phycst} along with all universal constants). 
     370Note that the horizontal position of and scale factors at $w$-points are exactly equal to those of $t$-points, 
     371thus no specific arrays are defined at $w$-points.  
     372 
     373Note that the definition of the scale factors 
     374($i.e.$ as the analytical first derivative of the transformation that 
     375gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$) 
     376is specific to the \NEMO model \citep{Marti_al_JGR92}. 
     377As an example, $e_{1t}$ is defined locally at a $t$-point, 
     378whereas many other models on a C grid choose to define such a scale factor as 
     379the distance between the $U$-points on each side of the $t$-point. 
     380Relying on an analytical transformation has two advantages: 
     381firstly, there is no ambiguity in the scale factors appearing in the discrete equations, 
     382since they are first introduced in the continuous equations; 
     383secondly, analytical transformations encourage good practice by the definition of smoothly varying grids 
     384(rather than allowing the user to set arbitrary jumps in thickness between adjacent layers) \citep{Treguier1996}. 
     385An example of the effect of such a choice is shown in \autoref{fig:zgr_e3}. 
    386386%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    387387\begin{figure}[!t]     \begin{center} 
    388388\includegraphics[width=0.90\textwidth]{Fig_zgr_e3} 
    389 \caption{ \protect\label{fig:zgr_e3}     
    390 Comparison of (a) traditional definitions of grid-point position and grid-size in the vertical,  
    391 and (b) analytically derived grid-point position and scale factors.  
    392 For both grids here,  the same $w$-point depth has been chosen but in (a) the  
    393 $t$-points are set half way between $w$-points while in (b) they are defined from  
    394 an analytical function: $z(k)=5\,(k-1/2)^3 - 45\,(k-1/2)^2 + 140\,(k-1/2) - 150$.  
    395 Note the resulting difference between the value of the grid-size $\Delta_k$ and  
    396 those of the scale factor $e_k$. } 
     389\caption{ \protect\label{fig:zgr_e3} 
     390  Comparison of (a) traditional definitions of grid-point position and grid-size in the vertical, 
     391  and (b) analytically derived grid-point position and scale factors. 
     392  For both grids here, 
     393  the same $w$-point depth has been chosen but in (a) the $t$-points are set half way between $w$-points while 
     394  in (b) they are defined from an analytical function: $z(k)=5\,(k-1/2)^3 - 45\,(k-1/2)^2 + 140\,(k-1/2) - 150$. 
     395  Note the resulting difference between the value of the grid-size $\Delta_k$ and those of the scale factor $e_k$. } 
    397396\end{center}   \end{figure} 
    398397%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    411410\label{subsec:DOM_hgr_files} 
    412411 
    413 All the arrays relating to a particular ocean model configuration (grid-point  
    414 position, scale factors, masks) can be saved in files if \np{nn\_msh} $\not= 0$  
    415 (namelist variable in \ngn{namdom}). This can be particularly useful for plots and off-line  
    416 diagnostics. In some cases, the user may choose to make a local modification  
    417 of a scale factor in the code. This is the case in global configurations when  
    418 restricting the width of a specific strait (usually a one-grid-point strait that  
    419 happens to be too wide due to insufficient model resolution). An example  
    420 is Gibraltar Strait in the ORCA2 configuration. When such modifications are done,  
     412All the arrays relating to a particular ocean model configuration (grid-point position, scale factors, masks) 
     413can be saved in files if \np{nn\_msh} $\not= 0$ (namelist variable in \ngn{namdom}). 
     414This can be particularly useful for plots and off-line diagnostics. 
     415In some cases, the user may choose to make a local modification of a scale factor in the code. 
     416This is the case in global configurations when restricting the width of a specific strait 
     417(usually a one-grid-point strait that happens to be too wide due to insufficient model resolution). 
     418An example is Gibraltar Strait in the ORCA2 configuration. 
     419When such modifications are done, 
    421420the output grid written when \np{nn\_msh} $\not= 0$ is no more equal to the input grid. 
    422421 
     
    437436Variables are defined through the \ngn{namzgr} and \ngn{namdom} namelists. 
    438437In the vertical, the model mesh is determined by four things:  
    439 (1) the bathymetry given in meters ;  
    440 (2) the number of levels of the model (\jp{jpk}) ;  
    441 (3) the analytical transformation $z(i,j,k)$ and the vertical scale factors  
    442 (derivatives of the transformation) ;  
    443 and (4) the masking system, $i.e.$ the number of wet model levels at each  
     438(1) the bathymetry given in meters;  
     439(2) the number of levels of the model (\jp{jpk});  
     440(3) the analytical transformation $z(i,j,k)$ and the vertical scale factors (derivatives of the transformation); and 
     441(4) the masking system, $i.e.$ the number of wet model levels at each  
    444442$(i,j)$ column of points. 
    445443 
     
    447445\begin{figure}[!tb]    \begin{center} 
    448446\includegraphics[width=1.0\textwidth]{Fig_z_zps_s_sps} 
    449 \caption{  \protect\label{fig:z_zps_s_sps}    
    450 The ocean bottom as seen by the model:  
    451 (a) $z$-coordinate with full step,  
    452 (b) $z$-coordinate with partial step,  
    453 (c) $s$-coordinate: terrain following representation,  
    454 (d) hybrid $s-z$ coordinate,  
    455 (e) hybrid $s-z$ coordinate with partial step, and  
    456 (f) same as (e) but in the non-linear free surface (\protect\np{ln\_linssh}\forcode{ = .false.}).  
    457 Note that the non-linear free surface can be used with any of the  
    458 5 coordinates (a) to (e).} 
     447\caption{  \protect\label{fig:z_zps_s_sps} 
     448  The ocean bottom as seen by the model: 
     449  (a) $z$-coordinate with full step, 
     450  (b) $z$-coordinate with partial step, 
     451  (c) $s$-coordinate: terrain following representation, 
     452  (d) hybrid $s-z$ coordinate, 
     453  (e) hybrid $s-z$ coordinate with partial step, and 
     454  (f) same as (e) but in the non-linear free surface (\protect\np{ln\_linssh}\forcode{ = .false.}). 
     455  Note that the non-linear free surface can be used with any of the 5 coordinates (a) to (e).} 
    459456\end{center}   \end{figure} 
    460457%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    461458 
    462459The choice of a vertical coordinate, even if it is made through \ngn{namzgr} namelist parameters,  
    463 must be done once of all at the beginning of an experiment. It is not intended as an  
    464 option which can be enabled or disabled in the middle of an experiment. Three main  
    465 choices are offered (\autoref{fig:z_zps_s_sps}a to c): $z$-coordinate with full step  
    466 bathymetry (\np{ln\_zco}\forcode{ = .true.}), $z$-coordinate with partial step bathymetry  
    467 (\np{ln\_zps}\forcode{ = .true.}), or generalized, $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}).  
    468 Hybridation of the three main coordinates are available: $s-z$ or $s-zps$ coordinate  
    469 (\autoref{fig:z_zps_s_sps}d and \autoref{fig:z_zps_s_sps}e). By default a non-linear free surface is used: 
    470 the coordinate follow the time-variation of the free surface so that the transformation is time dependent:  
    471 $z(i,j,k,t)$ (\autoref{fig:z_zps_s_sps}f). When a linear free surface is assumed (\np{ln\_linssh}\forcode{ = .true.}),  
    472 the vertical coordinate are fixed in time, but the seawater can move up and down across the z=0 surface  
     460must be done once of all at the beginning of an experiment. 
     461It is not intended as an option which can be enabled or disabled in the middle of an experiment. 
     462Three main choices are offered (\autoref{fig:z_zps_s_sps}a to c): 
     463$z$-coordinate with full step bathymetry (\np{ln\_zco}\forcode{ = .true.}), 
     464$z$-coordinate with partial step bathymetry (\np{ln\_zps}\forcode{ = .true.}), 
     465or generalized, $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}). 
     466Hybridation of the three main coordinates are available: 
     467$s-z$ or $s-zps$ coordinate (\autoref{fig:z_zps_s_sps} and \autoref{fig:z_zps_s_sps}e). 
     468By default a non-linear free surface is used: the coordinate follow the time-variation of the free surface so that 
     469the transformation is time dependent: $z(i,j,k,t)$ (\autoref{fig:z_zps_s_sps}f). 
     470When a linear free surface is assumed (\np{ln\_linssh}\forcode{ = .true.}), 
     471the vertical coordinate are fixed in time, but the seawater can move up and down across the z=0 surface 
    473472(in other words, the top of the ocean in not a rigid-lid).  
    474 The last choice in terms of vertical coordinate concerns the presence (or not) in the model domain  
    475 of ocean cavities beneath ice shelves. Setting \np{ln\_isfcav} to true allows to manage ocean cavities,  
    476 otherwise they are filled in. This option is currently only available in $z$- or $zps$-coordinate, 
    477 and partial step are also applied at the ocean/ice shelf interface.  
    478  
    479 Contrary to the horizontal grid, the vertical grid is computed in the code and no  
    480 provision is made for reading it from a file. The only input file is the bathymetry  
    481 (in meters) (\ifile{bathy\_meter}).  
    482 \footnote{N.B. in full step $z$-coordinate, a \ifile{bathy\_level} file can replace the  
    483 \ifile{bathy\_meter} file, so that the computation of the number of wet ocean point  
    484 in each water column is by-passed}.  
    485 If \np{ln\_isfcav}\forcode{ = .true.}, an extra file input file describing the ice shelf draft  
    486 (in meters) (\ifile{isf\_draft\_meter}) is needed. 
    487  
    488 After reading the bathymetry, the algorithm for vertical grid definition differs  
    489 between the different options: 
     473The last choice in terms of vertical coordinate concerns the presence (or not) in 
     474the model domain of ocean cavities beneath ice shelves. 
     475Setting \np{ln\_isfcav} to true allows to manage ocean cavities, otherwise they are filled in. 
     476This option is currently only available in $z$- or $zps$-coordinate, 
     477and partial step are also applied at the ocean/ice shelf interface. 
     478 
     479Contrary to the horizontal grid, the vertical grid is computed in the code and 
     480no provision is made for reading it from a file. 
     481The only input file is the bathymetry (in meters) (\ifile{bathy\_meter}) 
     482\footnote{ 
     483  N.B. in full step $z$-coordinate, a \ifile{bathy\_level} file can replace the \ifile{bathy\_meter} file, 
     484  so that the computation of the number of wet ocean point in each water column is by-passed}.  
     485If \np{ln\_isfcav}\forcode{ = .true.}, 
     486an extra file input file describing the ice shelf draft (in meters) (\ifile{isf\_draft\_meter}) is needed. 
     487 
     488After reading the bathymetry, the algorithm for vertical grid definition differs between the different options: 
    490489\begin{description} 
    491 \item[\textit{zco}] set a reference coordinate transformation $z_0 (k)$, and set $z(i,j,k,t)=z_0 (k)$. 
    492 \item[\textit{zps}] set a reference coordinate transformation $z_0 (k)$, and  
    493 calculate the thickness of the deepest level at each $(i,j)$ point using the  
    494 bathymetry, to obtain the final three-dimensional depth and scale factor arrays. 
    495 \item[\textit{sco}] smooth the bathymetry to fulfil the hydrostatic consistency  
    496 criteria and set the three-dimensional transformation. 
    497 \item[\textit{s-z} and \textit{s-zps}] smooth the bathymetry to fulfil the hydrostatic  
    498 consistency criteria and set the three-dimensional transformation $z(i,j,k)$, and  
    499 possibly introduce masking of extra land points to better fit the original bathymetry file 
     490\item[\textit{zco}] 
     491  set a reference coordinate transformation $z_0 (k)$, and set $z(i,j,k,t)=z_0 (k)$. 
     492\item[\textit{zps}] 
     493  set a reference coordinate transformation $z_0 (k)$, 
     494  and calculate the thickness of the deepest level at each $(i,j)$ point using the bathymetry, 
     495  to obtain the final three-dimensional depth and scale factor arrays. 
     496\item[\textit{sco}] 
     497  smooth the bathymetry to fulfil the hydrostatic consistency criteria and 
     498  set the three-dimensional transformation. 
     499\item[\textit{s-z} and \textit{s-zps}] 
     500  smooth the bathymetry to fulfil the hydrostatic consistency criteria and 
     501  set the three-dimensional transformation $z(i,j,k)$, 
     502  and possibly introduce masking of extra land points to better fit the original bathymetry file. 
    500503\end{description} 
    501504%%% 
     
    503506%%% 
    504507 
    505 Unless a linear free surface is used (\np{ln\_linssh}\forcode{ = .false.}), the arrays describing  
    506 the grid point depths and vertical scale factors are three set of three dimensional arrays $(i,j,k)$  
    507 defined at \textit{before}, \textit{now} and \textit{after} time step. The time at which they are 
    508 defined is indicated by a suffix:$\_b$, $\_n$, or $\_a$, respectively. They are updated at each model time step 
    509 using a fixed reference coordinate system which computer names have a $\_0$ suffix.  
    510 When the linear free surface option is used (\np{ln\_linssh}\forcode{ = .true.}), \textit{before}, \textit{now}  
    511 and \textit{after} arrays are simply set one for all to their reference counterpart.  
     508Unless a linear free surface is used (\np{ln\_linssh}\forcode{ = .false.}), 
     509the arrays describing the grid point depths and vertical scale factors are three set of 
     510three dimensional arrays $(i,j,k)$ defined at \textit{before}, \textit{now} and \textit{after} time step. 
     511The time at which they are defined is indicated by a suffix:$\_b$, $\_n$, or $\_a$, respectively. 
     512They are updated at each model time step using a fixed reference coordinate system which 
     513computer names have a $\_0$ suffix. 
     514When the linear free surface option is used (\np{ln\_linssh}\forcode{ = .true.}), 
     515\textit{before}, \textit{now} and \textit{after} arrays are simply set one for all to their reference counterpart.  
    512516 
    513517 
     
    518522\label{subsec:DOM_bathy} 
    519523 
    520 Three options are possible for defining the bathymetry, according to the  
    521 namelist variable \np{nn\_bathy} (found in \ngn{namdom} namelist):  
     524Three options are possible for defining the bathymetry, according to the namelist variable \np{nn\_bathy} 
     525(found in \ngn{namdom} namelist):  
    522526\begin{description} 
    523 \item[\np{nn\_bathy}\forcode{ = 0}]: a flat-bottom domain is defined. The total depth $z_w (jpk)$  
    524 is given by the coordinate transformation. The domain can either be a closed  
    525 basin or a periodic channel depending on the parameter \np{jperio}.  
    526 \item[\np{nn\_bathy}\forcode{ = -1}]: a domain with a bump of topography one third of the  
    527 domain width at the central latitude. This is meant for the "EEL-R5" configuration,  
    528 a periodic or open boundary channel with a seamount.  
    529 \item[\np{nn\_bathy}\forcode{ = 1}]: read a bathymetry and ice shelf draft (if needed). 
    530  The \ifile{bathy\_meter} file (Netcdf format) provides the ocean depth (positive, in meters) 
    531  at each grid point of the model grid. The bathymetry is usually built by interpolating a standard bathymetry product  
    532 ($e.g.$ ETOPO2) onto the horizontal ocean mesh. Defining the bathymetry also  
    533 defines the coastline: where the bathymetry is zero, no model levels are defined  
    534 (all levels are masked). 
    535  
    536 The \ifile{isfdraft\_meter} file (Netcdf format) provides the ice shelf draft (positive, in meters) 
    537  at each grid point of the model grid. This file is only needed if \np{ln\_isfcav}\forcode{ = .true.}.  
    538 Defining the ice shelf draft will also define the ice shelf edge and the grounding line position. 
     527\item[\np{nn\_bathy}\forcode{ = 0}]: 
     528  a flat-bottom domain is defined. 
     529  The total depth $z_w (jpk)$ is given by the coordinate transformation. 
     530  The domain can either be a closed basin or a periodic channel depending on the parameter \np{jperio}.  
     531\item[\np{nn\_bathy}\forcode{ = -1}]: 
     532  a domain with a bump of topography one third of the domain width at the central latitude. 
     533  This is meant for the "EEL-R5" configuration, a periodic or open boundary channel with a seamount.  
     534\item[\np{nn\_bathy}\forcode{ = 1}]: 
     535  read a bathymetry and ice shelf draft (if needed). 
     536  The \ifile{bathy\_meter} file (Netcdf format) provides the ocean depth (positive, in meters) at 
     537  each grid point of the model grid. 
     538  The bathymetry is usually built by interpolating a standard bathymetry product ($e.g.$ ETOPO2) onto 
     539  the horizontal ocean mesh. 
     540  Defining the bathymetry also defines the coastline: where the bathymetry is zero, 
     541  no model levels are defined (all levels are masked). 
     542 
     543  The \ifile{isfdraft\_meter} file (Netcdf format) provides the ice shelf draft (positive, in meters) at 
     544  each grid point of the model grid. 
     545  This file is only needed if \np{ln\_isfcav}\forcode{ = .true.}. 
     546  Defining the ice shelf draft will also define the ice shelf edge and the grounding line position. 
    539547\end{description} 
    540548 
    541 When a global ocean is coupled to an atmospheric model it is better to represent  
    542 all large water bodies (e.g, great lakes, Caspian sea...) even if the model  
    543 resolution does not allow their communication with the rest of the ocean.  
    544 This is unnecessary when the ocean is forced by fixed atmospheric conditions,  
    545 so these seas can be removed from the ocean domain. The user has the option  
    546 to set the bathymetry in closed seas to zero (see \autoref{sec:MISC_closea}), but the  
    547 code has to be adapted to the user's configuration.  
     549When a global ocean is coupled to an atmospheric model it is better to represent all large water bodies 
     550(e.g, great lakes, Caspian sea...) 
     551even if the model resolution does not allow their communication with the rest of the ocean. 
     552This is unnecessary when the ocean is forced by fixed atmospheric conditions, 
     553so these seas can be removed from the ocean domain. 
     554The user has the option to set the bathymetry in closed seas to zero (see \autoref{sec:MISC_closea}), 
     555but the code has to be adapted to the user's configuration.  
    548556 
    549557% ------------------------------------------------------------------------------------------------------------- 
     
    557565\begin{figure}[!tb]    \begin{center} 
    558566\includegraphics[width=0.90\textwidth]{Fig_zgr} 
    559 \caption{ \protect\label{fig:zgr}     
    560 Default vertical mesh for ORCA2: 30 ocean levels (L30). Vertical level functions for  
    561 (a) T-point depth and (b) the associated scale factor as computed  
    562 from \autoref{eq:DOM_zgr_ana_1} using \autoref{eq:DOM_zgr_coef} in $z$-coordinate.} 
     567\caption{ \protect\label{fig:zgr} 
     568  Default vertical mesh for ORCA2: 30 ocean levels (L30). 
     569  Vertical level functions for (a) T-point depth and (b) the associated scale factor as computed from 
     570  \autoref{eq:DOM_zgr_ana_1} using \autoref{eq:DOM_zgr_coef} in $z$-coordinate.} 
    563571\end{center}   \end{figure} 
    564572%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    565573 
    566 The reference coordinate transformation $z_0 (k)$ defines the arrays $gdept_0$  
    567 and $gdepw_0$ for $t$- and $w$-points, respectively. As indicated on  
    568 \autoref{fig:index_vert} \jp{jpk} is the number of $w$-levels. $gdepw_0(1)$ is the  
    569 ocean surface. There are at most \jp{jpk}-1 $t$-points inside the ocean, the  
    570 additional $t$-point at $jk=jpk$ is below the sea floor and is not used.  
    571 The vertical location of $w$- and $t$-levels is defined from the analytic expression  
    572 of the depth $z_0(k)$ whose analytical derivative with respect to $k$ provides the  
    573 vertical scale factors. The user must provide the analytical expression of both  
    574 $z_0$ and its first derivative with respect to $k$. This is done in routine \mdl{domzgr}  
    575 through statement functions, using parameters provided in the \ngn{namcfg} namelist.  
    576  
    577 It is possible to define a simple regular vertical grid by giving zero stretching (\np{ppacr=0}).  
    578 In that case, the parameters \jp{jpk} (number of $w$-levels) and \np{pphmax}  
    579 (total ocean depth in meters) fully define the grid.  
    580  
    581 For climate-related studies it is often desirable to concentrate the vertical resolution  
    582 near the ocean surface. The following function is proposed as a standard for a  
    583 $z$-coordinate (with either full or partial steps):  
     574The reference coordinate transformation $z_0 (k)$ defines the arrays $gdept_0$ and $gdepw_0$ for 
     575$t$- and $w$-points, respectively. 
     576As indicated on \autoref{fig:index_vert} \jp{jpk} is the number of $w$-levels. $gdepw_0(1)$ is the ocean surface. 
     577There are at most \jp{jpk}-1 $t$-points inside the ocean, 
     578the additional $t$-point at $jk=jpk$ is below the sea floor and is not used. 
     579The vertical location of $w$- and $t$-levels is defined from the analytic expression of the depth $z_0(k)$ whose 
     580analytical derivative with respect to $k$ provides the vertical scale factors. 
     581The user must provide the analytical expression of both $z_0$ and its first derivative with respect to $k$. 
     582This is done in routine \mdl{domzgr} through statement functions, 
     583using parameters provided in the \ngn{namcfg} namelist. 
     584 
     585It is possible to define a simple regular vertical grid by giving zero stretching (\np{ppacr=0}). 
     586In that case, 
     587the parameters \jp{jpk} (number of $w$-levels) and \np{pphmax} (total ocean depth in meters) fully define the grid.  
     588 
     589For climate-related studies it is often desirable to concentrate the vertical resolution near the ocean surface. 
     590The following function is proposed as a standard for a $z$-coordinate (with either full or partial steps):  
    584591\begin{equation} \label{eq:DOM_zgr_ana_1} 
    585592\begin{split} 
     
    588595\end{split} 
    589596\end{equation} 
    590 where $k=1$ to \jp{jpk} for $w$-levels and $k=1$ to $k=1$ for $T-$levels. Such an  
    591 expression allows us to define a nearly uniform vertical location of levels at the  
    592 ocean top and bottom with a smooth hyperbolic tangent transition in between  
    593 (\autoref{fig:zgr}). 
    594  
    595 If the ice shelf cavities are opened (\np{ln\_isfcav}\forcode{ = .true.}), the definition of $z_0$ is the same.  
     597where $k=1$ to \jp{jpk} for $w$-levels and $k=1$ to $k=1$ for $T-$levels. 
     598Such an expression allows us to define a nearly uniform vertical location of levels at the ocean top and bottom with 
     599a smooth hyperbolic tangent transition in between (\autoref{fig:zgr}). 
     600 
     601If the ice shelf cavities are opened (\np{ln\_isfcav}\forcode{ = .true.}), the definition of $z_0$ is the same. 
    596602However, definition of $e_3^0$ at $t$- and $w$-points is respectively changed to: 
    597603\begin{equation} \label{eq:DOM_zgr_ana_2} 
     
    605611 
    606612  
    607 The most used vertical grid for ORCA2 has $10~m$ ($500~m)$ resolution in the  
    608 surface (bottom) layers and a depth which varies from 0 at the sea surface to a  
    609 minimum of $-5000~m$. This leads to the following conditions: 
     613The most used vertical grid for ORCA2 has $10~m$ ($500~m)$ resolution in the surface (bottom) layers and 
     614a depth which varies from 0 at the sea surface to a minimum of $-5000~m$. 
     615This leads to the following conditions: 
    610616\begin{equation} \label{eq:DOM_zgr_coef} 
    611617\begin{split} 
     
    617623\end{equation} 
    618624 
    619 With the choice of the stretching $h_{cr} =3$ and the number of levels  
    620 \jp{jpk}=$31$, the four coefficients $h_{sur}$, $h_{0}$, $h_{1}$, and $h_{th}$ in  
    621 \autoref{eq:DOM_zgr_ana_2} have been determined such that \autoref{eq:DOM_zgr_coef} is  
    622 satisfied, through an optimisation procedure using a bisection method. For the first  
    623 standard ORCA2 vertical grid this led to the following values: $h_{sur} =4762.96$,  
    624 $h_0 =255.58, h_1 =245.5813$, and $h_{th} =21.43336$. The resulting depths and  
    625 scale factors as a function of the model levels are shown in \autoref{fig:zgr} and  
    626 given in \autoref{tab:orca_zgr}. Those values correspond to the parameters  
    627 \np{ppsur}, \np{ppa0}, \np{ppa1}, \np{ppkth} in \ngn{namcfg} namelist.  
    628  
    629 Rather than entering parameters $h_{sur}$, $h_{0}$, and $h_{1}$ directly, it is  
    630 possible to recalculate them. In that case the user sets  
    631 \np{ppsur}\forcode{ = }\np{ppa0}\forcode{ = }\np{ppa1}\forcode{ = 999999}., in \ngn{namcfg} namelist,  
    632 and specifies instead the four following parameters: 
     625With the choice of the stretching $h_{cr} =3$ and the number of levels \jp{jpk}=$31$, 
     626the four coefficients $h_{sur}$, $h_{0}$, $h_{1}$, and $h_{th}$ in 
     627\autoref{eq:DOM_zgr_ana_2} have been determined such that 
     628\autoref{eq:DOM_zgr_coef} is satisfied, through an optimisation procedure using a bisection method. 
     629For the first standard ORCA2 vertical grid this led to the following values: 
     630$h_{sur} =4762.96$, $h_0 =255.58, h_1 =245.5813$, and $h_{th} =21.43336$. 
     631The resulting depths and scale factors as a function of the model levels are shown in 
     632\autoref{fig:zgr} and given in \autoref{tab:orca_zgr}. 
     633Those values correspond to the parameters \np{ppsur}, \np{ppa0}, \np{ppa1}, \np{ppkth} in \ngn{namcfg} namelist.  
     634 
     635Rather than entering parameters $h_{sur}$, $h_{0}$, and $h_{1}$ directly, it is possible to recalculate them. 
     636In that case the user sets \np{ppsur}\forcode{ = }\np{ppa0}\forcode{ = }\np{ppa1}\forcode{ = 999999}., 
     637in \ngn{namcfg} namelist, and specifies instead the four following parameters: 
    633638\begin{itemize} 
    634 \item    \np{ppacr}=$h_{cr} $: stretching factor (nondimensional). The larger  
    635 \np{ppacr}, the smaller the stretching. Values from $3$ to $10$ are usual. 
    636 \item    \np{ppkth}=$h_{th} $: is approximately the model level at which maximum  
    637 stretching occurs (nondimensional, usually of order 1/2 or 2/3 of \jp{jpk}) 
    638 \item    \np{ppdzmin}: minimum thickness for the top layer (in meters) 
    639 \item    \np{pphmax}: total depth of the ocean (meters). 
     639\item 
     640  \np{ppacr}=$h_{cr} $: stretching factor (nondimensional). 
     641  The larger \np{ppacr}, the smaller the stretching. 
     642  Values from $3$ to $10$ are usual. 
     643\item 
     644  \np{ppkth}=$h_{th} $: is approximately the model level at which maximum stretching occurs 
     645  (nondimensional, usually of order 1/2 or 2/3 of \jp{jpk}) 
     646\item 
     647  \np{ppdzmin}: minimum thickness for the top layer (in meters). 
     648\item 
     649  \np{pphmax}: total depth of the ocean (meters). 
    640650\end{itemize} 
    641 As an example, for the $45$ layers used in the DRAKKAR configuration those  
    642 parameters are: \jp{jpk}\forcode{ = 46}, \np{ppacr}\forcode{ = 9}, \np{ppkth}\forcode{ = 23.563}, \np{ppdzmin}\forcode{ = 6}m, \np{pphmax}\forcode{ = 5750}m. 
     651As an example, for the $45$ layers used in the DRAKKAR configuration those parameters are: 
     652\jp{jpk}\forcode{ = 46}, \np{ppacr}\forcode{ = 9}, \np{ppkth}\forcode{ = 23.563}, 
     653\np{ppdzmin}\forcode{ = 6}m, \np{pphmax}\forcode{ = 5750}m. 
    643654 
    644655%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    67868931 &  \textbf{5250.23}& 5000.00 &   \textbf{500.56} & 500.33 \\ \hline 
    679690\end{tabular} \end{center}  
    680 \caption{ \protect\label{tab:orca_zgr}    
    681 Default vertical mesh in $z$-coordinate for 30 layers ORCA2 configuration as computed  
    682 from \autoref{eq:DOM_zgr_ana_2} using the coefficients given in \autoref{eq:DOM_zgr_coef}} 
     691\caption{ \protect\label{tab:orca_zgr} 
     692  Default vertical mesh in $z$-coordinate for 30 layers ORCA2 configuration as computed from 
     693  \autoref{eq:DOM_zgr_ana_2} using the coefficients given in \autoref{eq:DOM_zgr_coef}} 
    683694\end{table} 
    684695%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    694705%-------------------------------------------------------------------------------------------------------------- 
    695706 
    696 In $z$-coordinate partial step, the depths of the model levels are defined by the  
    697 reference analytical function $z_0 (k)$ as described in the previous  
    698 section, \emph{except} in the bottom layer. The thickness of the bottom layer is  
    699 allowed to vary as a function of geographical location $(\lambda,\varphi)$ to allow a  
    700 better representation of the bathymetry, especially in the case of small  
    701 slopes (where the bathymetry varies by less than one level thickness from  
    702 one grid point to the next). The reference layer thicknesses $e_{3t}^0$ have been  
    703 defined in the absence of bathymetry. With partial steps, layers from 1 to  
    704 \jp{jpk}-2 can have a thickness smaller than $e_{3t}(jk)$. The model deepest layer (\jp{jpk}-1)  
    705 is allowed to have either a smaller or larger thickness than $e_{3t}(jpk)$: the  
    706 maximum thickness allowed is $2*e_{3t}(jpk-1)$. This has to be kept in mind when  
    707 specifying values in \ngn{namdom} namelist, as the maximum depth \np{pphmax}  
    708 in partial steps: for example, with  
    709 \np{pphmax}$=5750~m$ for the DRAKKAR 45 layer grid, the maximum ocean depth  
    710 allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk-1)$ being $250~m$).  
    711 Two variables in the namdom namelist are used to define the partial step  
    712 vertical grid. The mimimum water thickness (in meters) allowed for a cell  
    713 partially filled with bathymetry at level jk is the minimum of \np{rn\_e3zps\_min}  
    714 (thickness in meters, usually $20~m$) or $e_{3t}(jk)*$\np{rn\_e3zps\_rat} (a fraction,  
    715 usually 10\%, of the default thickness $e_{3t}(jk)$). 
     707In $z$-coordinate partial step, 
     708the depths of the model levels are defined by the reference analytical function $z_0 (k)$ as described in 
     709the previous section, \emph{except} in the bottom layer. 
     710The thickness of the bottom layer is allowed to vary as a function of geographical location $(\lambda,\varphi)$ to 
     711allow a better representation of the bathymetry, especially in the case of small slopes 
     712(where the bathymetry varies by less than one level thickness from one grid point to the next). 
     713The reference layer thicknesses $e_{3t}^0$ have been defined in the absence of bathymetry. 
     714With partial steps, layers from 1 to \jp{jpk}-2 can have a thickness smaller than $e_{3t}(jk)$. 
     715The model deepest layer (\jp{jpk}-1) is allowed to have either a smaller or larger thickness than $e_{3t}(jpk)$: 
     716the maximum thickness allowed is $2*e_{3t}(jpk-1)$. 
     717This has to be kept in mind when specifying values in \ngn{namdom} namelist, 
     718as the maximum depth \np{pphmax} in partial steps: 
     719for example, with \np{pphmax}$=5750~m$ for the DRAKKAR 45 layer grid, 
     720the maximum ocean depth allowed is actually $6000~m$ (the default thickness $e_{3t}(jpk-1)$ being $250~m$). 
     721Two variables in the namdom namelist are used to define the partial step vertical grid. 
     722The mimimum water thickness (in meters) allowed for a cell partially filled with bathymetry at level jk is 
     723the minimum of \np{rn\_e3zps\_min} (thickness in meters, usually $20~m$) or $e_{3t}(jk)*$\np{rn\_e3zps\_rat} 
     724(a fraction, usually 10\%, of the default thickness $e_{3t}(jk)$). 
    716725 
    717726\gmcomment{ \colorbox{yellow}{Add a figure here of pstep especially at last ocean level }  } 
     
    727736%-------------------------------------------------------------------------------------------------------------- 
    728737Options are defined in \ngn{namzgr\_sco}. 
    729 In $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}), the depth and thickness of the model  
    730 levels are defined from the product of a depth field and either a stretching  
    731 function or its derivative, respectively: 
     738In $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}), the depth and thickness of the model levels are defined from 
     739the product of a depth field and either a stretching function or its derivative, respectively: 
    732740 
    733741\begin{equation} \label{eq:DOM_sco_ana} 
     
    738746\end{equation} 
    739747 
    740 where $h$ is the depth of the last $w$-level ($z_0(k)$) defined at the $t$-point  
    741 location in the horizontal and $z_0(k)$ is a function which varies from $0$ at the sea  
    742 surface to $1$ at the ocean bottom. The depth field $h$ is not necessary the ocean  
    743 depth, since a mixed step-like and bottom-following representation of the  
    744 topography can be used (\autoref{fig:z_zps_s_sps}d-e) or an envelop bathymetry can be defined (\autoref{fig:z_zps_s_sps}f). 
    745 The namelist parameter \np{rn\_rmax} determines the slope at which the terrain-following coordinate intersects  
    746 the sea bed and becomes a pseudo z-coordinate.  
    747 The coordinate can also be hybridised by specifying \np{rn\_sbot\_min} and \np{rn\_sbot\_max}  
    748 as the minimum and maximum depths at which the terrain-following vertical coordinate is calculated. 
    749  
    750 Options for stretching the coordinate are provided as examples, but care must be taken to ensure  
    751 that the vertical stretch used is appropriate for the application. 
    752  
    753 The original default NEMO s-coordinate stretching is available if neither of the other options  
    754 are specified as true (\np{ln\_s\_SH94}\forcode{ = .false.} and \np{ln\_s\_SF12}\forcode{ = .false.}).  
     748where $h$ is the depth of the last $w$-level ($z_0(k)$) defined at the $t$-point location in the horizontal and 
     749$z_0(k)$ is a function which varies from $0$ at the sea surface to $1$ at the ocean bottom. 
     750The depth field $h$ is not necessary the ocean depth, 
     751since a mixed step-like and bottom-following representation of the topography can be used 
     752(\autoref{fig:z_zps_s_sps}d-e) or an envelop bathymetry can be defined (\autoref{fig:z_zps_s_sps}f). 
     753The namelist parameter \np{rn\_rmax} determines the slope at which 
     754the terrain-following coordinate intersects the sea bed and becomes a pseudo z-coordinate.  
     755The coordinate can also be hybridised by specifying \np{rn\_sbot\_min} and \np{rn\_sbot\_max} as 
     756the minimum and maximum depths at which the terrain-following vertical coordinate is calculated. 
     757 
     758Options for stretching the coordinate are provided as examples, 
     759but care must be taken to ensure that the vertical stretch used is appropriate for the application. 
     760 
     761The original default NEMO s-coordinate stretching is available if neither of the other options are specified as true 
     762(\np{ln\_s\_SH94}\forcode{ = .false.} and \np{ln\_s\_SF12}\forcode{ = .false.}).  
    755763This uses a depth independent $\tanh$ function for the stretching \citep{Madec_al_JPO96}: 
    756764 
     
    760768\end{equation} 
    761769 
    762 where $s_{min}$ is the depth at which the $s$-coordinate stretching starts and  
    763 allows a $z$-coordinate to placed on top of the stretched coordinate,  
     770where $s_{min}$ is the depth at which the $s$-coordinate stretching starts and 
     771allows a $z$-coordinate to placed on top of the stretched coordinate, 
    764772and $z$ is the depth (negative down from the asea surface). 
    765773 
     
    777785\end{equation} 
    778786 
    779 A stretching function, modified from the commonly used \citet{Song_Haidvogel_JCP94}  
    780 stretching (\np{ln\_s\_SH94}\forcode{ = .true.}), is also available and is more commonly used for shelf seas modelling: 
     787A stretching function, 
     788modified from the commonly used \citet{Song_Haidvogel_JCP94} stretching (\np{ln\_s\_SH94}\forcode{ = .true.}), 
     789is also available and is more commonly used for shelf seas modelling: 
    781790 
    782791\begin{equation} 
     
    789798\begin{figure}[!ht]    \begin{center} 
    790799\includegraphics[width=1.0\textwidth]{Fig_sco_function} 
    791 \caption{  \protect\label{fig:sco_function}    
    792 Examples of the stretching function applied to a seamount; from left to right:  
    793 surface, surface and bottom, and bottom intensified resolutions} 
     800\caption{  \protect\label{fig:sco_function} 
     801  Examples of the stretching function applied to a seamount; 
     802  from left to right: surface, surface and bottom, and bottom intensified resolutions} 
    794803\end{center}   \end{figure} 
    795804%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    796805 
    797 where $H_c$ is the critical depth (\np{rn\_hc}) at which the coordinate transitions from  
    798 pure $\sigma$ to the stretched coordinate,  and $\theta$ (\np{rn\_theta}) and $b$ (\np{rn\_bb})  
    799 are the surface and bottom control parameters such that $0\leqslant \theta \leqslant 20$, and  
    800 $0\leqslant b\leqslant 1$. $b$ has been designed to allow surface and/or bottom  
    801 increase of the vertical resolution (\autoref{fig:sco_function}). 
    802  
    803 Another example has been provided at version 3.5 (\np{ln\_s\_SF12}) that allows  
    804 a fixed surface resolution in an analytical terrain-following stretching \citet{Siddorn_Furner_OM12}.  
     806where $H_c$ is the critical depth (\np{rn\_hc}) at which 
     807the coordinate transitions from pure $\sigma$ to the stretched coordinate, 
     808and $\theta$ (\np{rn\_theta}) and $b$ (\np{rn\_bb}) are the surface and bottom control parameters such that 
     809$0\leqslant \theta \leqslant 20$, and $0\leqslant b\leqslant 1$. 
     810$b$ has been designed to allow surface and/or bottom increase of the vertical resolution 
     811(\autoref{fig:sco_function}). 
     812 
     813Another example has been provided at version 3.5 (\np{ln\_s\_SF12}) that allows a fixed surface resolution in 
     814an analytical terrain-following stretching \citet{Siddorn_Furner_OM12}. 
    805815In this case the a stretching function $\gamma$ is defined such that: 
    806816 
     
    821831\end{equation} 
    822832 
    823 This gives an analytical stretching of $\sigma$ that is solvable in $A$ and $B$ as a function of  
    824 the user prescribed stretching parameter $\alpha$ (\np{rn\_alpha}) that stretches towards  
    825 the surface ($\alpha > 1.0$) or the bottom ($\alpha < 1.0$) and user prescribed surface (\np{rn\_zs})  
    826 and bottom depths. The bottom cell depth in this example is given as a function of water depth: 
     833This gives an analytical stretching of $\sigma$ that is solvable in $A$ and $B$ as a function of 
     834the user prescribed stretching parameter $\alpha$ (\np{rn\_alpha}) that stretches towards 
     835the surface ($\alpha > 1.0$) or the bottom ($\alpha < 1.0$) and 
     836user prescribed surface (\np{rn\_zs}) and bottom depths. 
     837The bottom cell depth in this example is given as a function of water depth: 
    827838 
    828839\begin{equation} \label{eq:DOM_zb} 
     
    834845%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    835846\begin{figure}[!ht] 
    836    \includegraphics[width=1.0\textwidth]{FIG_DOM_compare_coordinates_surface} 
    837         \caption{A comparison of the \citet{Song_Haidvogel_JCP94} $S$-coordinate (solid lines), a 50 level $Z$-coordinate (contoured surfaces) and the \citet{Siddorn_Furner_OM12} $S$-coordinate (dashed lines) in the surface 100m for a idealised bathymetry that goes from 50m to 5500m depth. For clarity every third coordinate surface is shown.} 
     847   \includegraphics[width=1.0\textwidth]{Fig_DOM_compare_coordinates_surface} 
     848   \caption{ 
     849     A comparison of the \citet{Song_Haidvogel_JCP94} $S$-coordinate (solid lines), 
     850     a 50 level $Z$-coordinate (contoured surfaces) and 
     851     the \citet{Siddorn_Furner_OM12} $S$-coordinate (dashed lines) in 
     852     the surface 100m for a idealised bathymetry that goes from 50m to 5500m depth. 
     853     For clarity every third coordinate surface is shown.} 
    838854    \label{fig:fig_compare_coordinates_surface} 
    839855\end{figure} 
    840856%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    841857 
    842 This gives a smooth analytical stretching in computational space that is constrained to given specified surface and bottom grid cell thicknesses in real space. This is not to be confused with the hybrid schemes that superimpose geopotential coordinates on terrain following coordinates thus creating a non-analytical vertical coordinate that therefore may suffer from large gradients in the vertical resolutions. This stretching is less straightforward to implement than the \citet{Song_Haidvogel_JCP94} stretching, but has the advantage of resolving diurnal processes in deep water and has generally flatter slopes. 
    843  
    844 As with the \citet{Song_Haidvogel_JCP94} stretching the stretch is only applied at depths greater than the critical depth $h_c$. In this example two options are available in depths shallower than $h_c$, with pure sigma being applied if the \np{ln\_sigcrit} is true and pure z-coordinates if it is false (the z-coordinate being equal to the depths of the stretched coordinate at $h_c$. 
    845  
    846 Minimising the horizontal slope of the vertical coordinate is important in terrain-following systems as large slopes lead to hydrostatic consistency. A hydrostatic consistency parameter diagnostic following \citet{Haney1991} has been implemented, and is output as part of the model mesh file at the start of the run. 
     858This gives a smooth analytical stretching in computational space that is constrained to 
     859given specified surface and bottom grid cell thicknesses in real space. 
     860This is not to be confused with the hybrid schemes that 
     861superimpose geopotential coordinates on terrain following coordinates thus 
     862creating a non-analytical vertical coordinate that 
     863therefore may suffer from large gradients in the vertical resolutions. 
     864This stretching is less straightforward to implement than the \citet{Song_Haidvogel_JCP94} stretching, 
     865but has the advantage of resolving diurnal processes in deep water and has generally flatter slopes. 
     866 
     867As with the \citet{Song_Haidvogel_JCP94} stretching the stretch is only applied at depths greater than 
     868the critical depth $h_c$. 
     869In this example two options are available in depths shallower than $h_c$, 
     870with pure sigma being applied if the \np{ln\_sigcrit} is true and pure z-coordinates if it is false 
     871(the z-coordinate being equal to the depths of the stretched coordinate at $h_c$). 
     872 
     873Minimising the horizontal slope of the vertical coordinate is important in terrain-following systems as 
     874large slopes lead to hydrostatic consistency. 
     875A hydrostatic consistency parameter diagnostic following \citet{Haney1991} has been implemented, 
     876and is output as part of the model mesh file at the start of the run. 
    847877 
    848878% ------------------------------------------------------------------------------------------------------------- 
     
    862892\label{subsec:DOM_msk} 
    863893 
    864 Whatever the vertical coordinate used, the model offers the possibility of  
    865 representing the bottom topography with steps that follow the face of the  
    866 model cells (step like topography) \citep{Madec_al_JPO96}. The distribution of  
    867 the steps in the horizontal is defined in a 2D integer array, mbathy, which  
    868 gives the number of ocean levels ($i.e.$ those that are not masked) at each  
    869 $t$-point. mbathy is computed from the meter bathymetry using the definiton of  
    870 gdept as the number of $t$-points which gdept $\leq$ bathy. 
    871  
    872 Modifications of the model bathymetry are performed in the \textit{bat\_ctl}  
    873 routine (see \mdl{domzgr} module) after mbathy is computed. Isolated grid points  
    874 that do not communicate with another ocean point at the same level are eliminated. 
    875  
    876 As for the representation of bathymetry, a 2D integer array, misfdep, is created.  
    877 misfdep defines the level of the first wet $t$-point. All the cells between $k=1$ and $misfdep(i,j)-1$ are masked.  
     894Whatever the vertical coordinate used, 
     895the model offers the possibility of representing the bottom topography with steps that 
     896follow the face of the model cells (step like topography) \citep{Madec_al_JPO96}. 
     897The distribution of the steps in the horizontal is defined in a 2D integer array, mbathy, 
     898which gives the number of ocean levels ($i.e.$ those that are not masked) at each $t$-point. 
     899mbathy is computed from the meter bathymetry using the definiton of gdept as 
     900the number of $t$-points which gdept $\leq$ bathy. 
     901 
     902Modifications of the model bathymetry are performed in the \textit{bat\_ctl} routine (see \mdl{domzgr} module) after 
     903mbathy is computed. 
     904Isolated grid points that do not communicate with another ocean point at the same level are eliminated. 
     905 
     906As for the representation of bathymetry, a 2D integer array, misfdep, is created. 
     907misfdep defines the level of the first wet $t$-point. 
     908All the cells between $k=1$ and $misfdep(i,j)-1$ are masked. 
    878909By default, misfdep(:,:)=1 and no cells are masked. 
    879910 
    880911In case of ice shelf cavities, modifications of the model bathymetry and ice shelf draft into  
    881 the cavities are performed in the \textit{zgr\_isf} routine. The compatibility between ice shelf draft and bathymetry is checked.  
     912the cavities are performed in the \textit{zgr\_isf} routine. 
     913The compatibility between ice shelf draft and bathymetry is checked.  
    882914All the locations where the isf cavity is thinnest than \np{rn\_isfhmin} meters are grounded ($i.e.$ masked).  
    883 If only one cell on the water column is opened at $t$-, $u$- or $v$-points, the bathymetry or the ice shelf draft is dug to fit this constrain. 
     915If only one cell on the water column is opened at $t$-, $u$- or $v$-points, 
     916the bathymetry or the ice shelf draft is dug to fit this constrain. 
    884917If the incompatibility is too strong (need to dig more than 1 cell), the cell is masked.\\  
    885918 
     
    896929\end{align*} 
    897930 
    898 Note that, without ice shelves cavities, masks at $t-$ and $w-$points are identical with  
    899 the numerical indexing used (\autoref{subsec:DOM_Num_Index}). Nevertheless, $wmask$ are required  
    900 with oceean cavities to deal with the top boundary (ice shelf/ocean interface)  
     931Note that, without ice shelves cavities, 
     932masks at $t-$ and $w-$points are identical with the numerical indexing used (\autoref{subsec:DOM_Num_Index}). 
     933Nevertheless, $wmask$ are required with ocean cavities to deal with the top boundary (ice shelf/ocean interface)  
    901934exactly in the same way as for the bottom boundary.  
    902935 
    903 The specification of closed lateral boundaries requires that at least the first and last  
    904 rows and columns of the \textit{mbathy} array are set to zero. In the particular  
    905 case of an east-west cyclical boundary condition, \textit{mbathy} has its last  
    906 column equal to the second one and its first column equal to the last but one  
     936The specification of closed lateral boundaries requires that at least 
     937the first and last rows and columns of the \textit{mbathy} array are set to zero. 
     938In the particular case of an east-west cyclical boundary condition, 
     939\textit{mbathy} has its last column equal to the second one and its first column equal to the last but one  
    907940(and so too the mask arrays) (see \autoref{fig:LBC_jperio}). 
    908941 
     
    919952 
    920953Options are defined in \ngn{namtsd}. 
    921 By default, the ocean start from rest (the velocity field is set to zero) and the initialization of  
    922 temperature and salinity fields is controlled through the \np{ln\_tsd\_ini} namelist parameter. 
     954By default, the ocean start from rest (the velocity field is set to zero) and the initialization of temperature and salinity fields is controlled through the \np{ln\_tsd\_ini} namelist parameter. 
    923955\begin{description} 
    924 \item[\np{ln\_tsd\_init}\forcode{ = .true.}] use a T and S input files that can be given on the model grid itself or  
    925 on their native input data grid. In the latter case, the data will be interpolated on-the-fly both in the  
    926 horizontal and the vertical to the model grid (see \autoref{subsec:SBC_iof}). The information relative to the  
    927 input files are given in the \np{sn\_tem} and \np{sn\_sal} structures.  
    928 The computation is done in the \mdl{dtatsd} module. 
    929 \item[\np{ln\_tsd\_init}\forcode{ = .false.}] use constant salinity value of 35.5 psu and an analytical profile of temperature 
    930 (typical of the tropical ocean), see \rou{istate\_t\_s} subroutine called from \mdl{istate} module. 
     956\item[\np{ln\_tsd\_init}\forcode{ = .true.}] 
     957  use a T and S input files that can be given on the model grid itself or on their native input data grid. 
     958  In the latter case, 
     959  the data will be interpolated on-the-fly both in the horizontal and the vertical to the model grid 
     960  (see \autoref{subsec:SBC_iof}). 
     961  The information relative to the input files are given in the \np{sn\_tem} and \np{sn\_sal} structures. 
     962  The computation is done in the \mdl{dtatsd} module. 
     963\item[\np{ln\_tsd\_init}\forcode{ = .false.}] 
     964  use constant salinity value of 35.5 psu and an analytical profile of temperature (typical of the tropical ocean), 
     965  see \rou{istate\_t\_s} subroutine called from \mdl{istate} module. 
    931966\end{description} 
    932967\end{document} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_DYN.tex

    r10146 r10368  
    1111$\ $\newline      %force an empty line 
    1212 
    13 Using the representation described in \autoref{chap:DOM}, several semi-discrete  
    14 space forms of the dynamical equations are available depending on the vertical  
    15 coordinate used and on the conservation properties of the vorticity term. In all  
    16 the equations presented here, the masking has been omitted for simplicity.  
    17 One must be aware that all the quantities are masked fields and that each time an 
    18 average or difference operator is used, the resulting field is multiplied by a mask. 
     13Using the representation described in \autoref{chap:DOM}, 
     14several semi-discrete space forms of the dynamical equations are available depending on 
     15the vertical coordinate used and on the conservation properties of the vorticity term. 
     16In all the equations presented here, the masking has been omitted for simplicity. 
     17One must be aware that all the quantities are masked fields and 
     18that each time an average or difference operator is used, the resulting field is multiplied by a mask. 
    1919 
    2020The prognostic ocean dynamics equation can be summarized as follows: 
     
    2424         + \text{HPG} + \text{SPG} + \text{LDF} + \text{ZDF} 
    2525\end{equation*} 
    26 NXT stands for next, referring to the time-stepping. The first group of terms on  
    27 the rhs of this equation corresponds to the Coriolis and advection  
    28 terms that are decomposed into either a vorticity part (VOR), a kinetic energy part (KEG)  
    29 and a vertical advection part (ZAD) in the vector invariant formulation, or a Coriolis  
    30 and advection part (COR+ADV) in the flux formulation. The terms following these  
    31 are the pressure gradient contributions (HPG, Hydrostatic Pressure Gradient,  
    32 and SPG, Surface Pressure Gradient); and contributions from lateral diffusion  
    33 (LDF) and vertical diffusion (ZDF), which are added to the rhs in the \mdl{dynldf}  
    34 and \mdl{dynzdf} modules. The vertical diffusion term includes the surface and  
    35 bottom stresses. The external forcings and parameterisations require complex  
    36 inputs (surface wind stress calculation using bulk formulae, estimation of mixing  
    37 coefficients) that are carried out in modules SBC, LDF and ZDF and are described  
    38 in \autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively.  
    39  
    40 In the present chapter we also describe the diagnostic equations used to compute  
    41 the horizontal divergence, curl of the velocities (\emph{divcur} module) and  
    42 the vertical velocity (\emph{wzvmod} module). 
     26NXT stands for next, referring to the time-stepping. 
     27The first group of terms on the rhs of this equation corresponds to the Coriolis and advection terms that 
     28are decomposed into either a vorticity part (VOR), a kinetic energy part (KEG) and 
     29a vertical advection part (ZAD) in the vector invariant formulation, 
     30or a Coriolis and advection part (COR+ADV) in the flux formulation. 
     31The terms following these are the pressure gradient contributions 
     32(HPG, Hydrostatic Pressure Gradient, and SPG, Surface Pressure Gradient); 
     33and contributions from lateral diffusion (LDF) and vertical diffusion (ZDF), 
     34which are added to the rhs in the \mdl{dynldf} and \mdl{dynzdf} modules. 
     35The vertical diffusion term includes the surface and bottom stresses. 
     36The external forcings and parameterisations require complex inputs 
     37(surface wind stress calculation using bulk formulae, estimation of mixing coefficients) 
     38that are carried out in modules SBC, LDF and ZDF and are described in 
     39\autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively.  
     40 
     41In the present chapter we also describe the diagnostic equations used to compute the horizontal divergence, 
     42curl of the velocities (\emph{divcur} module) and the vertical velocity (\emph{wzvmod} module). 
    4343 
    4444The different options available to the user are managed by namelist variables.  
    4545For term \textit{ttt} in the momentum equations, the logical namelist variables are \textit{ln\_dynttt\_xxx},  
    46 where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme.  
    47 If a CPP key is used for this term its name is \key{ttt}. The corresponding  
    48 code can be found in the \textit{dynttt\_xxx} module in the DYN directory, and it is  
    49 usually computed in the \textit{dyn\_ttt\_xxx} subroutine. 
    50  
    51 The user has the option of extracting and outputting each tendency term from the 
    52 3D momentum equations (\key{trddyn} defined), as described in  
    53 \autoref{chap:MISC}.  Furthermore, the tendency terms associated with the 2D  
    54 barotropic vorticity balance (when \key{trdvor} is defined) can be derived from the  
    55 3D terms. 
     46where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme. 
     47If a CPP key is used for this term its name is \key{ttt}. 
     48The corresponding code can be found in the \textit{dynttt\_xxx} module in the DYN directory, 
     49and it is usually computed in the \textit{dyn\_ttt\_xxx} subroutine. 
     50 
     51The user has the option of extracting and outputting each tendency term from the 3D momentum equations 
     52(\key{trddyn} defined), as described in \autoref{chap:MISC}. 
     53Furthermore, the tendency terms associated with the 2D barotropic vorticity balance (when \key{trdvor} is defined) 
     54can be derived from the 3D terms. 
    5655%%% 
    5756\gmcomment{STEVEN: not quite sure I've got the sense of the last sentence. does  
     
    7877\end{equation}  
    7978 
    80 The horizontal divergence is defined at a $T$-point. It is given by: 
     79The horizontal divergence is defined at a $T$-point. 
     80It is given by: 
    8181\begin{equation} \label{eq:divcur_div} 
    8282\chi =\frac{1}{e_{1t}\,e_{2t}\,e_{3t} } 
     
    8585\end{equation}  
    8686 
    87 Note that although the vorticity has the same discrete expression in $z$-  
    88 and $s$-coordinates, its physical meaning is not identical. $\zeta$ is a pseudo  
    89 vorticity along $s$-surfaces (only pseudo because $(u,v)$ are still defined along  
    90 geopotential surfaces, but are not necessarily defined at the same depth). 
    91  
    92 The vorticity and divergence at the \textit{before} step are used in the computation  
    93 of the horizontal diffusion of momentum. Note that because they have been  
    94 calculated prior to the Asselin filtering of the \textit{before} velocities, the  
    95 \textit{before} vorticity and divergence arrays must be included in the restart file  
    96 to ensure perfect restartability. The vorticity and divergence at the \textit{now}  
    97 time step are used for the computation of the nonlinear advection and of the  
    98 vertical velocity respectively.  
     87Note that although the vorticity has the same discrete expression in $z$- and $s$-coordinates, 
     88its physical meaning is not identical. 
     89$\zeta$ is a pseudo vorticity along $s$-surfaces 
     90(only pseudo because $(u,v)$ are still defined along geopotential surfaces, 
     91but are not necessarily defined at the same depth). 
     92 
     93The vorticity and divergence at the \textit{before} step are used in the computation of 
     94the horizontal diffusion of momentum. 
     95Note that because they have been calculated prior to the Asselin filtering of the \textit{before} velocities, 
     96the \textit{before} vorticity and divergence arrays must be included in the restart file to 
     97ensure perfect restartability. 
     98The vorticity and divergence at the \textit{now} time step are used for the computation of 
     99the nonlinear advection and of the vertical velocity respectively.  
    99100 
    100101%-------------------------------------------------------------------------------------------------------------- 
     
    104105\label{subsec:DYN_sshwzv} 
    105106 
    106 The sea surface height is given by : 
     107The sea surface height is given by: 
    107108\begin{equation} \label{eq:dynspg_ssh} 
    108109\begin{aligned} 
     
    115116\end{equation} 
    116117where \textit{emp} is the surface freshwater budget (evaporation minus precipitation),  
    117 expressed in Kg/m$^2$/s (which is equal to mm/s), and $\rho _w$=1,035~Kg/m$^3$  
    118 is the reference density of sea water (Boussinesq approximation). If river runoff is  
    119 expressed as a surface freshwater flux (see \autoref{chap:SBC}) then \textit{emp} can be  
    120 written as the evaporation minus precipitation, minus the river runoff.  
    121 The sea-surface height is evaluated using exactly the same time stepping scheme  
    122 as the tracer equation \autoref{eq:tra_nxt}:  
    123 a leapfrog scheme in combination with an Asselin time filter, $i.e.$ the velocity appearing  
    124 in \autoref{eq:dynspg_ssh} is centred in time (\textit{now} velocity).  
    125 This is of paramount importance. Replacing $T$ by the number $1$ in the tracer equation and summing 
    126 over the water column must lead to the sea surface height equation otherwise tracer content 
    127 will not be conserved \citep{Griffies_al_MWR01, Leclair_Madec_OM09}. 
    128  
    129 The vertical velocity is computed by an upward integration of the horizontal  
    130 divergence starting at the bottom, taking into account the change of the thickness of the levels : 
     118expressed in Kg/m$^2$/s (which is equal to mm/s), 
     119and $\rho _w$=1,035~Kg/m$^3$ is the reference density of sea water (Boussinesq approximation). 
     120If 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.  
     122The sea-surface height is evaluated using exactly the same time stepping scheme as 
     123the tracer equation \autoref{eq:tra_nxt}: 
     124a leapfrog scheme in combination with an Asselin time filter, 
     125$i.e.$ the velocity appearing in \autoref{eq:dynspg_ssh} is centred in time (\textit{now} velocity). 
     126This is of paramount importance. 
     127Replacing $T$ by the number $1$ in the tracer equation and summing over the water column must lead to 
     128the sea surface height equation otherwise tracer content will not be conserved 
     129\citep{Griffies_al_MWR01, Leclair_Madec_OM09}. 
     130 
     131The vertical velocity is computed by an upward integration of the horizontal divergence starting at the bottom, 
     132taking into account the change of the thickness of the levels: 
    131133\begin{equation} \label{eq:wzv} 
    132134\left\{   \begin{aligned} 
     
    138140 
    139141In the case of a non-linear free surface (\key{vvl}), the top vertical velocity is $-\textit{emp}/\rho_w$,  
    140 as changes in the divergence of the barotropic transport are absorbed into the change  
    141 of the level thicknesses, re-orientated downward. 
     142as changes in the divergence of the barotropic transport are absorbed into the change of the level thicknesses, 
     143re-orientated downward. 
    142144\gmcomment{not sure of this...  to be modified with the change in emp setting} 
    143145In the case of a linear free surface, the time derivative in \autoref{eq:wzv} disappears. 
    144 The upper boundary condition applies at a fixed level $z=0$. The top vertical velocity  
    145 is thus equal to the divergence of the barotropic transport ($i.e.$ the first term in the 
    146 right-hand-side of \autoref{eq:dynspg_ssh}). 
    147  
    148 Note also that whereas the vertical velocity has the same discrete  
    149 expression in $z$- and $s$-coordinates, its physical meaning is not the same:  
    150 in the second case, $w$ is the velocity normal to the $s$-surfaces.  
    151 Note also that the $k$-axis is re-orientated downwards in the \textsc{fortran} code compared  
    152 to the indexing used in the semi-discrete equations such as \autoref{eq:wzv}  
     146The upper boundary condition applies at a fixed level $z=0$. 
     147The top vertical velocity is thus equal to the divergence of the barotropic transport 
     148($i.e.$ the first term in the right-hand-side of \autoref{eq:dynspg_ssh}). 
     149 
     150Note also that whereas the vertical velocity has the same discrete expression in $z$- and $s$-coordinates, 
     151its physical meaning is not the same: 
     152in the second case, $w$ is the velocity normal to the $s$-surfaces. 
     153Note also that the $k$-axis is re-orientated downwards in the \textsc{fortran} code compared to 
     154the indexing used in the semi-discrete equations such as \autoref{eq:wzv} 
    153155(see \autoref{subsec:DOM_Num_Index_vertical}).  
    154156 
     
    164166%------------------------------------------------------------------------------------------------------------- 
    165167 
    166 The vector invariant form of the momentum equations is the one most  
    167 often used in applications of the \NEMO ocean model. The flux form option  
    168 (see next section) has been present since version $2$. Options are defined 
    169 through the \ngn{namdyn\_adv} namelist variables 
    170 Coriolis and momentum advection terms are evaluated using a leapfrog  
    171 scheme, $i.e.$ the velocity appearing in these expressions is centred in  
    172 time (\textit{now} velocity).  
    173 At the lateral boundaries either free slip, no slip or partial slip boundary  
    174 conditions are applied following \autoref{chap:LBC}. 
     168The vector invariant form of the momentum equations is the one most often used in 
     169applications of the \NEMO ocean model. 
     170The flux form option (see next section) has been present since version $2$. 
     171Options are defined through the \ngn{namdyn\_adv} namelist variables Coriolis and 
     172momentum advection terms are evaluated using a leapfrog scheme, 
     173$i.e.$ the velocity appearing in these expressions is centred in time (\textit{now} velocity).  
     174At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied following 
     175\autoref{chap:LBC}. 
    175176 
    176177% ------------------------------------------------------------------------------------------------------------- 
     
    185186 
    186187Options are defined through the \ngn{namdyn\_vor} namelist variables. 
    187 Four discretisations of the vorticity term (\np{ln\_dynvor\_xxx}\forcode{ = .true.}) are available:  
    188 conserving potential enstrophy of horizontally non-divergent flow (ENS scheme) ;  
    189 conserving horizontal kinetic energy (ENE scheme) ; conserving potential enstrophy for  
    190 the relative vorticity term and horizontal kinetic energy for the planetary vorticity  
    191 term (MIX scheme) ; or conserving both the potential enstrophy of horizontally non-divergent  
    192 flow and horizontal kinetic energy (EEN scheme) (see \autoref{subsec:C_vorEEN}). In the  
    193 case of ENS, ENE or MIX schemes the land sea mask may be slightly modified to ensure the  
    194 consistency of vorticity term with analytical equations (\np{ln\_dynvor\_con}\forcode{ = .true.}). 
    195 The vorticity terms are all computed in dedicated routines that can be found in  
    196 the \mdl{dynvor} module. 
     188Four discretisations of the vorticity term (\np{ln\_dynvor\_xxx}\forcode{ = .true.}) are available: 
     189conserving potential enstrophy of horizontally non-divergent flow (ENS scheme); 
     190conserving horizontal kinetic energy (ENE scheme); 
     191conserving potential enstrophy for the relative vorticity term and 
     192horizontal kinetic energy for the planetary vorticity term (MIX scheme); 
     193or conserving both the potential enstrophy of horizontally non-divergent flow and horizontal kinetic energy 
     194(EEN scheme) (see \autoref{subsec:C_vorEEN}). 
     195In the case of ENS, ENE or MIX schemes the land sea mask may be slightly modified to ensure the consistency of 
     196vorticity term with analytical equations (\np{ln\_dynvor\_con}\forcode{ = .true.}). 
     197The vorticity terms are all computed in dedicated routines that can be found in the \mdl{dynvor} module. 
    197198 
    198199%------------------------------------------------------------- 
     
    202203\label{subsec:DYN_vor_ens} 
    203204 
    204 In the enstrophy conserving case (ENS scheme), the discrete formulation of the  
    205 vorticity term provides a global conservation of the enstrophy  
    206 ($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$-coordinates) for a horizontally non-divergent  
    207 flow ($i.e.$ $\chi$=$0$), but does not conserve the total kinetic energy. It is given by: 
     205In the enstrophy conserving case (ENS scheme), 
     206the discrete formulation of the vorticity term provides a global conservation of the enstrophy 
     207($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$-coordinates) for a horizontally non-divergent flow ($i.e.$ $\chi$=$0$), 
     208but does not conserve the total kinetic energy. 
     209It is given by: 
    208210\begin{equation} \label{eq:dynvor_ens} 
    209211\left\{  
     
    223225\label{subsec:DYN_vor_ene} 
    224226 
    225 The kinetic energy conserving scheme (ENE scheme) conserves the global  
    226 kinetic energy but not the global enstrophy. It is given by: 
     227The kinetic energy conserving scheme (ENE scheme) conserves the global kinetic energy but not the global enstrophy. 
     228It is given by: 
    227229\begin{equation} \label{eq:dynvor_ene} 
    228230\left\{   \begin{aligned} 
     
    240242\label{subsec:DYN_vor_mix} 
    241243 
    242 For the mixed energy/enstrophy conserving scheme (MIX scheme), a mixture of the  
    243 two previous schemes is used. It consists of the ENS scheme (\autoref{eq:dynvor_ens})  
    244 for the relative vorticity term, and of the ENE scheme (\autoref{eq:dynvor_ene}) applied  
    245 to the planetary vorticity term. 
     244For the mixed energy/enstrophy conserving scheme (MIX scheme), a mixture of the two previous schemes is used. 
     245It consists of the ENS scheme (\autoref{eq:dynvor_ens}) for the relative vorticity term, 
     246and of the ENE scheme (\autoref{eq:dynvor_ene}) applied to the planetary vorticity term. 
    246247\begin{equation} \label{eq:dynvor_mix} 
    247248\left\{ {     \begin{aligned} 
     
    263264\label{subsec:DYN_vor_een} 
    264265 
    265 In both the ENS and ENE schemes, it is apparent that the combination of $i$ and $j$  
    266 averages of the velocity allows for the presence of grid point oscillation structures  
    267 that will be invisible to the operator. These structures are \textit{computational modes}  
    268 that will be at least partly damped by the momentum diffusion operator ($i.e.$ the  
    269 subgrid-scale advection), but not by the resolved advection term. The ENS and ENE schemes 
    270 therefore do not contribute to dump any grid point noise in the horizontal velocity field. 
    271 Such noise would result in more noise in the vertical velocity field, an undesirable feature.  
    272 This is a well-known characteristic of $C$-grid discretization where $u$ and $v$ are located  
    273 at different grid points, a price worth paying to avoid a double averaging in the pressure  
    274 gradient term as in the $B$-grid.  
     266In both the ENS and ENE schemes, 
     267it is apparent that the combination of $i$ and $j$ averages of the velocity allows for 
     268the presence of grid point oscillation structures that will be invisible to the operator. 
     269These structures are \textit{computational modes} that will be at least partly damped by 
     270the momentum diffusion operator ($i.e.$ the subgrid-scale advection), but not by the resolved advection term. 
     271The ENS and ENE schemes therefore do not contribute to dump any grid point noise in the horizontal velocity field. 
     272Such noise would result in more noise in the vertical velocity field, an undesirable feature. 
     273This is a well-known characteristic of $C$-grid discretization where 
     274$u$ and $v$ are located at different grid points, 
     275a price worth paying to avoid a double averaging in the pressure gradient term as in the $B$-grid. 
    275276\gmcomment{ To circumvent this, Adcroft (ADD REF HERE)  
    276277Nevertheless, this technique strongly distort the phase and group velocity of Rossby waves....} 
    277278 
    278 A very nice solution to the problem of double averaging was proposed by \citet{Arakawa_Hsu_MWR90}.  
    279 The idea is to get rid of the double averaging by considering triad combinations of vorticity.  
     279A very nice solution to the problem of double averaging was proposed by \citet{Arakawa_Hsu_MWR90}. 
     280The idea is to get rid of the double averaging by considering triad combinations of vorticity. 
    280281It is noteworthy that this solution is conceptually quite similar to the one proposed by 
    281282\citep{Griffies_al_JPO98} for the discretization of the iso-neutral diffusion operator (see \autoref{apdx:C}). 
     
    287288q  = \frac{\zeta +f} {e_{3f} } 
    288289\end{equation} 
    289 where the relative vorticity is defined by (\autoref{eq:divcur_cur}), the Coriolis parameter  
    290 is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is:  
     290where the relative vorticity is defined by (\autoref{eq:divcur_cur}), 
     291the Coriolis parameter is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is:  
    291292\begin{equation} \label{eq:een_e3f} 
    292293e_{3f} = \overline{\overline {e_{3t} }} ^{\,i+1/2,j+1/2} 
     
    296297\begin{figure}[!ht]    \begin{center} 
    297298\includegraphics[width=0.70\textwidth]{Fig_DYN_een_triad} 
    298 \caption{ \protect\label{fig:DYN_een_triad}   
    299 Triads used in the energy and enstrophy conserving scheme (een) for  
    300 $u$-component (upper panel) and $v$-component (lower panel).} 
     299\caption{ \protect\label{fig:DYN_een_triad} 
     300  Triads used in the energy and enstrophy conserving scheme (een) for 
     301  $u$-component (upper panel) and $v$-component (lower panel).} 
    301302\end{center}   \end{figure} 
    302303%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    303304 
    304305A key point in \autoref{eq:een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made.  
    305 It uses the sum of masked t-point vertical scale factor divided either  
    306 by the sum of the four t-point masks (\np{nn\_een\_e3f}\forcode{ = 1}),  
    307 or  just by $4$ (\np{nn\_een\_e3f}\forcode{ = .true.}). 
    308 The latter case preserves the continuity of $e_{3f}$ when one or more of the neighbouring $e_{3t}$  
    309 tends to zero and extends by continuity the value of $e_{3f}$ into the land areas.  
    310 This case introduces a sub-grid-scale topography at f-points (with a systematic reduction of $e_{3f}$  
    311 when a model level intercept the bathymetry) that tends to reinforce the topostrophy of the flow  
     306It uses the sum of masked t-point vertical scale factor divided either by the sum of the four t-point masks 
     307(\np{nn\_een\_e3f}\forcode{ = 1}), or just by $4$ (\np{nn\_een\_e3f}\forcode{ = .true.}). 
     308The latter case preserves the continuity of $e_{3f}$ when one or more of the neighbouring $e_{3t}$ tends to zero and 
     309extends by continuity the value of $e_{3f}$ into the land areas. 
     310This case introduces a sub-grid-scale topography at f-points 
     311(with a systematic reduction of $e_{3f}$ when a model level intercept the bathymetry) 
     312that tends to reinforce the topostrophy of the flow 
    312313($i.e.$ the tendency of the flow to follow the isobaths) \citep{Penduff_al_OS07}.  
    313314 
    314 Next, the vorticity triads, $ {^i_j}\mathbb{Q}^{i_p}_{j_p}$ can be defined at a $T$-point as  
    315 the following triad combinations of the neighbouring potential vorticities defined at f-points  
     315Next, the vorticity triads, $ {^i_j}\mathbb{Q}^{i_p}_{j_p}$ can be defined at a $T$-point as 
     316the following triad combinations of the neighbouring potential vorticities defined at f-points 
    316317(\autoref{fig:DYN_een_triad}):  
    317318\begin{equation} \label{eq:Q_triads} 
     
    333334\end{equation}  
    334335 
    335 This EEN scheme in fact combines the conservation properties of the ENS and ENE schemes.  
    336 It conserves both total energy and potential enstrophy in the limit of horizontally  
    337 nondivergent flow ($i.e.$ $\chi$=$0$) (see \autoref{subsec:C_vorEEN}).  
    338 Applied to a realistic ocean configuration, it has been shown that it leads to a significant  
    339 reduction of the noise in the vertical velocity field \citep{Le_Sommer_al_OM09}.  
     336This EEN scheme in fact combines the conservation properties of the ENS and ENE schemes. 
     337It conserves both total energy and potential enstrophy in the limit of horizontally nondivergent flow 
     338($i.e.$ $\chi$=$0$) (see \autoref{subsec:C_vorEEN}).  
     339Applied to a realistic ocean configuration, it has been shown that it leads to a significant reduction of 
     340the noise in the vertical velocity field \citep{Le_Sommer_al_OM09}. 
    340341Furthermore, used in combination with a partial steps representation of bottom topography, 
    341 it improves the interaction between current and topography, leading to a larger 
    342 topostrophy of the flow \citep{Barnier_al_OD06, Penduff_al_OS07}.  
     342it improves the interaction between current and topography, 
     343leading to a larger topostrophy of the flow \citep{Barnier_al_OD06, Penduff_al_OS07}.  
    343344 
    344345%-------------------------------------------------------------------------------------------------------------- 
     
    348349\label{subsec:DYN_keg} 
    349350 
    350 As demonstrated in \autoref{apdx:C}, there is a single discrete formulation  
    351 of the kinetic energy gradient term that, together with the formulation chosen for  
    352 the vertical advection (see below), conserves the total kinetic energy: 
     351As demonstrated in \autoref{apdx:C}, 
     352there is a single discrete formulation of the kinetic energy gradient term that, 
     353together with the formulation chosen for the vertical advection (see below), 
     354conserves the total kinetic energy: 
    353355\begin{equation} \label{eq:dynkeg} 
    354356\left\{ \begin{aligned} 
     
    364366\label{subsec:DYN_zad} 
    365367 
    366 The discrete formulation of the vertical advection, together with the formulation  
    367 chosen for the gradient of kinetic energy (KE) term, conserves the total kinetic  
    368 energy. Indeed, the change of KE due to the vertical advection is exactly  
    369 balanced by the change of KE due to the gradient of KE (see \autoref{apdx:C}). 
     368The discrete formulation of the vertical advection, t 
     369ogether with the formulation chosen for the gradient of kinetic energy (KE) term, 
     370conserves the total kinetic energy. 
     371Indeed, the change of KE due to the vertical advection is exactly balanced by 
     372the change of KE due to the gradient of KE (see \autoref{apdx:C}). 
    370373\begin{equation} \label{eq:dynzad} 
    371374\left\{     \begin{aligned} 
     
    374377\end{aligned}         \right. 
    375378\end{equation}  
    376 When \np{ln\_dynzad\_zts}\forcode{ = .true.}, a split-explicit time stepping with 5 sub-timesteps is used  
    377 on the vertical advection term. 
     379When \np{ln\_dynzad\_zts}\forcode{ = .true.}, 
     380a split-explicit time stepping with 5 sub-timesteps is used on the vertical advection term. 
    378381This option can be useful when the value of the timestep is limited by vertical advection \citep{Lemarie_OM2015}.  
    379 Note that in this case, a similar split-explicit time stepping should be used on  
    380 vertical advection of tracer to ensure a better stability,  
     382Note that in this case, 
     383a similar split-explicit time stepping should be used on vertical advection of tracer to ensure a better stability, 
    381384an option which is only available with a TVD scheme (see \np{ln\_traadv\_tvd\_zts} in \autoref{subsec:TRA_adv_tvd}). 
    382385 
     
    393396 
    394397Options are defined through the \ngn{namdyn\_adv} namelist variables. 
    395 In the flux form (as in the vector invariant form), the Coriolis and momentum  
    396 advection terms are evaluated using a leapfrog scheme, $i.e.$ the velocity  
    397 appearing in their expressions is centred in time (\textit{now} velocity). At the  
    398 lateral boundaries either free slip, no slip or partial slip boundary conditions  
    399 are applied following \autoref{chap:LBC}. 
     398In the flux form (as in the vector invariant form), 
     399the Coriolis and momentum advection terms are evaluated using a leapfrog scheme, 
     400$i.e.$ the velocity appearing in their expressions is centred in time (\textit{now} velocity). 
     401At the lateral boundaries either free slip, 
     402no slip or partial slip boundary conditions are applied following \autoref{chap:LBC}. 
    400403 
    401404 
     
    406409\label{subsec:DYN_cor_flux} 
    407410 
    408 In flux form, the vorticity term reduces to a Coriolis term in which the Coriolis  
    409 parameter has been modified to account for the "metric" term. This altered  
    410 Coriolis parameter is thus discretised at $f$-points. It is given by:  
     411In flux form, the vorticity term reduces to a Coriolis term in which the Coriolis parameter has been modified to account for the "metric" term. 
     412This altered Coriolis parameter is thus discretised at $f$-points. 
     413It is given by:  
    411414\begin{multline} \label{eq:dyncor_metric} 
    412415f+\frac{1}{e_1 e_2 }\left( {v\frac{\partial e_2 }{\partial i}  -  u\frac{\partial e_1 }{\partial j}} \right)  \\ 
     
    415418\end{multline}  
    416419 
    417 Any of the (\autoref{eq:dynvor_ens}), (\autoref{eq:dynvor_ene}) and (\autoref{eq:dynvor_een})  
    418 schemes can be used to compute the product of the Coriolis parameter and the  
    419 vorticity. However, the energy-conserving scheme (\autoref{eq:dynvor_een}) has  
    420 exclusively been used to date. This term is evaluated using a leapfrog scheme,  
    421 $i.e.$ the velocity is centred in time (\textit{now} velocity). 
     420Any of the (\autoref{eq:dynvor_ens}), (\autoref{eq:dynvor_ene}) and (\autoref{eq:dynvor_een}) schemes can be used to 
     421compute the product of the Coriolis parameter and the vorticity. 
     422However, the energy-conserving scheme (\autoref{eq:dynvor_een}) has exclusively been used to date. 
     423This term is evaluated using a leapfrog scheme, $i.e.$ the velocity is centred in time (\textit{now} velocity). 
    422424 
    423425%-------------------------------------------------------------------------------------------------------------- 
     
    427429\label{subsec:DYN_adv_flux} 
    428430 
    429 The discrete expression of the advection term is given by : 
     431The discrete expression of the advection term is given by: 
    430432\begin{equation} \label{eq:dynadv} 
    431433\left\{  
     
    444446\end{equation} 
    445447 
    446 Two advection schemes are available: a $2^{nd}$ order centered finite  
    447 difference scheme, CEN2, or a $3^{rd}$ order upstream biased scheme, UBS.  
    448 The latter is described in \citet{Shchepetkin_McWilliams_OM05}. The schemes are  
    449 selected using the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}.  
    450 In flux form, the schemes differ by the choice of a space and time interpolation to  
    451 define the value of $u$ and $v$ at the centre of each face of $u$- and $v$-cells,  
    452 $i.e.$ at the $T$-, $f$-, and $uw$-points for $u$ and at the $f$-, $T$- and  
    453 $vw$-points for $v$.  
     448Two advection schemes are available: 
     449a $2^{nd}$ order centered finite difference scheme, CEN2, 
     450or a $3^{rd}$ order upstream biased scheme, UBS. 
     451The latter is described in \citet{Shchepetkin_McWilliams_OM05}. 
     452The schemes are selected using the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}.  
     453In flux form, the schemes differ by the choice of a space and time interpolation to define the value of 
     454$u$ and $v$ at the centre of each face of $u$- and $v$-cells, $i.e.$ at the $T$-, $f$-, 
     455and $uw$-points for $u$ and at the $f$-, $T$- and $vw$-points for $v$.  
    454456 
    455457%------------------------------------------------------------- 
     
    459461\label{subsec:DYN_adv_cen2} 
    460462 
    461 In the centered $2^{nd}$ order formulation, the velocity is evaluated as the  
    462 mean of the two neighbouring points : 
     463In the centered $2^{nd}$ order formulation, the velocity is evaluated as the mean of the two neighbouring points: 
    463464\begin{equation} \label{eq:dynadv_cen2} 
    464465\left\{     \begin{aligned} 
     
    468469\end{equation}  
    469470 
    470 The scheme is non diffusive (i.e. conserves the kinetic energy) but dispersive  
    471 ($i.e.$ it may create false extrema). It is therefore notoriously noisy and must be  
    472 used in conjunction with an explicit diffusion operator to produce a sensible solution.  
    473 The associated time-stepping is performed using a leapfrog scheme in conjunction  
    474 with an Asselin time-filter, so $u$ and $v$ are the \emph{now} velocities. 
     471The scheme is non diffusive (i.e. conserves the kinetic energy) but dispersive ($i.e.$ it may create false extrema). 
     472It is therefore notoriously noisy and must be used in conjunction with an explicit diffusion operator to 
     473produce a sensible solution. 
     474The associated time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter, 
     475so $u$ and $v$ are the \emph{now} velocities. 
    475476 
    476477%------------------------------------------------------------- 
     
    480481\label{subsec:DYN_adv_ubs} 
    481482 
    482 The UBS advection scheme is an upstream biased third order scheme based on  
    483 an upstream-biased parabolic interpolation. For example, the evaluation of  
    484 $u_T^{ubs} $ is done as follows: 
     483The UBS advection scheme is an upstream biased third order scheme based on 
     484an upstream-biased parabolic interpolation. 
     485For example, the evaluation of $u_T^{ubs} $ is done as follows: 
    485486\begin{equation} \label{eq:dynadv_ubs} 
    486487u_T^{ubs} =\overline u ^i-\;\frac{1}{6}   \begin{cases} 
     
    489490\end{cases} 
    490491\end{equation} 
    491 where $u"_{i+1/2} =\delta _{i+1/2} \left[ {\delta _i \left[ u \right]} \right]$. This results  
    492 in a dissipatively dominant ($i.e.$ hyper-diffusive) truncation error \citep{Shchepetkin_McWilliams_OM05}.  
    493 The overall performance of the advection scheme is similar to that reported in  
    494 \citet{Farrow1995}. It is a relatively good compromise between accuracy and  
    495 smoothness. It is not a \emph{positive} scheme, meaning that false extrema are  
    496 permitted. But the amplitudes of the false extrema are significantly reduced over  
    497 those in the centred second order method. As the scheme already includes  
    498 a diffusion component, it can be used without explicit lateral diffusion on momentum  
    499 ($i.e.$ \np{ln\_dynldf\_lap}\forcode{ = }\np{ln\_dynldf\_bilap}\forcode{ = .false.}), and it is recommended to do so. 
    500  
    501 The UBS scheme is not used in all directions. In the vertical, the centred $2^{nd}$  
    502 order evaluation of the advection is preferred, $i.e.$ $u_{uw}^{ubs}$ and  
    503 $u_{vw}^{ubs}$ in \autoref{eq:dynadv_cen2} are used. UBS is diffusive and is  
    504 associated with vertical mixing of momentum. \gmcomment{ gm  pursue the  
     492where $u"_{i+1/2} =\delta _{i+1/2} \left[ {\delta _i \left[ u \right]} \right]$. 
     493This results in a dissipatively dominant ($i.e.$ hyper-diffusive) truncation error 
     494\citep{Shchepetkin_McWilliams_OM05}. 
     495The overall performance of the advection scheme is similar to that reported in \citet{Farrow1995}. 
     496It is a relatively good compromise between accuracy and smoothness. 
     497It is not a \emph{positive} scheme, meaning that false extrema are permitted. 
     498But the amplitudes of the false extrema are significantly reduced over those in the centred second order method. 
     499As the scheme already includes a diffusion component, it can be used without explicit lateral diffusion on momentum  
     500($i.e.$ \np{ln\_dynldf\_lap}\forcode{ = }\np{ln\_dynldf\_bilap}\forcode{ = .false.}), 
     501and it is recommended to do so. 
     502 
     503The UBS scheme is not used in all directions. 
     504In the vertical, the centred $2^{nd}$ order evaluation of the advection is preferred, $i.e.$ $u_{uw}^{ubs}$ and 
     505$u_{vw}^{ubs}$ in \autoref{eq:dynadv_cen2} are used. 
     506UBS is diffusive and is associated with vertical mixing of momentum. \gmcomment{ gm  pursue the  
    505507sentence:Since vertical mixing of momentum is a source term of the TKE equation...  } 
    506508 
    507 For stability reasons, the first term in (\autoref{eq:dynadv_ubs}), which corresponds  
    508 to a second order centred scheme, is evaluated using the \textit{now} velocity  
    509 (centred in time), while the second term, which is the diffusion part of the scheme,  
    510 is evaluated using the \textit{before} velocity (forward in time). This is discussed  
    511 by \citet{Webb_al_JAOT98} in the context of the Quick advection scheme. 
    512  
    513 Note that the UBS and QUICK (Quadratic Upstream Interpolation for Convective Kinematics)  
    514 schemes only differ by one coefficient. Replacing $1/6$ by $1/8$ in  
    515 (\autoref{eq:dynadv_ubs}) leads to the QUICK advection scheme \citep{Webb_al_JAOT98}.  
    516 This option is not available through a namelist parameter, since the $1/6$ coefficient  
    517 is hard coded. Nevertheless it is quite easy to make the substitution in the 
    518 \mdl{dynadv\_ubs} module and obtain a QUICK scheme. 
    519  
    520 Note also that in the current version of \mdl{dynadv\_ubs}, there is also the  
    521 possibility of using a $4^{th}$ order evaluation of the advective velocity as in  
    522 ROMS. This is an error and should be suppressed soon. 
     509For stability reasons, the first term in (\autoref{eq:dynadv_ubs}), 
     510which corresponds to a second order centred scheme, is evaluated using the \textit{now} velocity (centred in time), 
     511while the second term, which is the diffusion part of the scheme, 
     512is evaluated using the \textit{before} velocity (forward in time). 
     513This is discussed by \citet{Webb_al_JAOT98} in the context of the Quick advection scheme. 
     514 
     515Note that the UBS and QUICK (Quadratic Upstream Interpolation for Convective Kinematics) schemes only differ by 
     516one coefficient. 
     517Replacing $1/6$ by $1/8$ in (\autoref{eq:dynadv_ubs}) leads to the QUICK advection scheme \citep{Webb_al_JAOT98}. 
     518This option is not available through a namelist parameter, since the $1/6$ coefficient is hard coded. 
     519Nevertheless it is quite easy to make the substitution in the \mdl{dynadv\_ubs} module and obtain a QUICK scheme. 
     520 
     521Note also that in the current version of \mdl{dynadv\_ubs}, 
     522there is also the possibility of using a $4^{th}$ order evaluation of the advective velocity as in ROMS. 
     523This is an error and should be suppressed soon. 
    523524%%% 
    524525\gmcomment{action :  this have to be done} 
     
    536537 
    537538Options are defined through the \ngn{namdyn\_hpg} namelist variables. 
    538 The key distinction between the different algorithms used for the hydrostatic  
    539 pressure gradient is the vertical coordinate used, since HPG is a \emph{horizontal}  
    540 pressure gradient, $i.e.$ computed along geopotential surfaces. As a result, any  
    541 tilt of the surface of the computational levels will require a specific treatment to  
     539The key distinction between the different algorithms used for 
     540the hydrostatic pressure gradient is the vertical coordinate used, 
     541since HPG is a \emph{horizontal} pressure gradient, $i.e.$ computed along geopotential surfaces. 
     542As a result, any tilt of the surface of the computational levels will require a specific treatment to 
    542543compute the hydrostatic pressure gradient. 
    543544 
    544 The hydrostatic pressure gradient term is evaluated either using a leapfrog scheme,  
    545 $i.e.$ the density appearing in its expression is centred in time (\emph{now} $\rho$), or  
    546 a semi-implcit scheme. At the lateral boundaries either free slip, no slip or partial slip  
    547 boundary conditions are applied. 
     545The hydrostatic pressure gradient term is evaluated either using a leapfrog scheme, 
     546$i.e.$ the density appearing in its expression is centred in time (\emph{now} $\rho$), 
     547or a semi-implcit scheme. 
     548At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied. 
    548549 
    549550%-------------------------------------------------------------------------------------------------------------- 
     
    553554\label{subsec:DYN_hpg_zco} 
    554555 
    555 The hydrostatic pressure can be obtained by integrating the hydrostatic equation  
    556 vertically from the surface. However, the pressure is large at great depth while its  
    557 horizontal gradient is several orders of magnitude smaller. This may lead to large  
    558 truncation errors in the pressure gradient terms. Thus, the two horizontal components  
    559 of the hydrostatic pressure gradient are computed directly as follows: 
     556The hydrostatic pressure can be obtained by integrating the hydrostatic equation vertically from the surface. 
     557However, the pressure is large at great depth while its horizontal gradient is several orders of magnitude smaller. 
     558This may lead to large truncation errors in the pressure gradient terms. 
     559Thus, the two horizontal components of the hydrostatic pressure gradient are computed directly as follows: 
    560560 
    561561for $k=km$ (surface layer, $jk=1$ in the code) 
     
    581581\end{equation}  
    582582 
    583 Note that the $1/2$ factor in (\autoref{eq:dynhpg_zco_surf}) is adequate because of  
    584 the definition of $e_{3w}$ as the vertical derivative of the scale factor at the surface  
    585 level ($z=0$). Note also that in case of variable volume level (\key{vvl} defined), the  
    586 surface pressure gradient is included in \autoref{eq:dynhpg_zco_surf} and \autoref{eq:dynhpg_zco}  
    587 through the space and time variations of the vertical scale factor $e_{3w}$. 
     583Note that the $1/2$ factor in (\autoref{eq:dynhpg_zco_surf}) is adequate because of the definition of $e_{3w}$ as 
     584the vertical derivative of the scale factor at the surface level ($z=0$). 
     585Note also that in case of variable volume level (\key{vvl} defined), 
     586the surface pressure gradient is included in \autoref{eq:dynhpg_zco_surf} and 
     587\autoref{eq:dynhpg_zco} through the space and time variations of the vertical scale factor $e_{3w}$. 
    588588 
    589589%-------------------------------------------------------------------------------------------------------------- 
     
    593593\label{subsec:DYN_hpg_zps} 
    594594 
    595 With partial bottom cells, tracers in horizontally adjacent cells generally live at  
    596 different depths. Before taking horizontal gradients between these tracer points,  
    597 a linear interpolation is used to approximate the deeper tracer as if it actually lived  
    598 at the depth of the shallower tracer point.  
    599  
    600 Apart from this modification, the horizontal hydrostatic pressure gradient evaluated  
    601 in the $z$-coordinate with partial step is exactly as in the pure $z$-coordinate case.  
    602 As explained in detail in section \autoref{sec:TRA_zpshde}, the nonlinearity of pressure  
    603 effects in the equation of state is such that it is better to interpolate temperature and  
    604 salinity vertically before computing the density. Horizontal gradients of temperature  
    605 and salinity are needed for the TRA modules, which is the reason why the horizontal  
    606 gradients of density at the deepest model level are computed in module \mdl{zpsdhe}  
    607 located in the TRA directory and described in \autoref{sec:TRA_zpshde}. 
     595With partial bottom cells, tracers in horizontally adjacent cells generally live at different depths. 
     596Before taking horizontal gradients between these tracer points, 
     597a linear interpolation is used to approximate the deeper tracer as if 
     598it actually lived at the depth of the shallower tracer point.  
     599 
     600Apart from this modification, 
     601the horizontal hydrostatic pressure gradient evaluated in the $z$-coordinate with partial step is exactly as in 
     602the pure $z$-coordinate case. 
     603As explained in detail in section \autoref{sec:TRA_zpshde}, 
     604the nonlinearity of pressure effects in the equation of state is such that 
     605it is better to interpolate temperature and salinity vertically before computing the density. 
     606Horizontal gradients of temperature and salinity are needed for the TRA modules, 
     607which is the reason why the horizontal gradients of density at the deepest model level are computed in 
     608module \mdl{zpsdhe} located in the TRA directory and described in \autoref{sec:TRA_zpshde}. 
    608609 
    609610%-------------------------------------------------------------------------------------------------------------- 
     
    613614\label{subsec:DYN_hpg_sco} 
    614615 
    615 Pressure gradient formulations in an $s$-coordinate have been the subject of a vast  
    616 number of papers ($e.g.$, \citet{Song1998, Shchepetkin_McWilliams_OM05}).  
    617 A number of different pressure gradient options are coded but the ROMS-like, density Jacobian with  
    618 cubic polynomial method is currently disabled whilst known bugs are under investigation. 
     616Pressure gradient formulations in an $s$-coordinate have been the subject of a vast number of papers 
     617($e.g.$, \citet{Song1998, Shchepetkin_McWilliams_OM05}).  
     618A number of different pressure gradient options are coded but the ROMS-like, 
     619density Jacobian with cubic polynomial method is currently disabled whilst known bugs are under investigation. 
    619620 
    620621$\bullet$ Traditional coding (see for example \citet{Madec_al_JPO96}: (\np{ln\_dynhpg\_sco}\forcode{ = .true.}) 
     
    628629\end{equation}  
    629630 
    630 Where the first term is the pressure gradient along coordinates, computed as in  
    631 \autoref{eq:dynhpg_zco_surf} - \autoref{eq:dynhpg_zco}, and $z_T$ is the depth of  
    632 the $T$-point evaluated from the sum of the vertical scale factors at the $w$-point  
     631Where the first term is the pressure gradient along coordinates, 
     632computed as in \autoref{eq:dynhpg_zco_surf} - \autoref{eq:dynhpg_zco}, 
     633and $z_T$ is the depth of the $T$-point evaluated from the sum of the vertical scale factors at the $w$-point  
    633634($e_{3w}$). 
    634635  
     
    641642(\np{ln\_dynhpg\_djc}\forcode{ = .true.}) (currently disabled; under development) 
    642643 
    643 Note that expression \autoref{eq:dynhpg_sco} is commonly used when the variable volume formulation is 
    644 activated (\key{vvl}) because in that case, even with a flat bottom, the coordinate surfaces are not 
    645 horizontal but follow the free surface \citep{Levier2007}. The pressure jacobian scheme 
    646 (\np{ln\_dynhpg\_prj}\forcode{ = .true.}) is available as an improved option to \np{ln\_dynhpg\_sco}\forcode{ = .true.} when 
    647 \key{vvl} is active.  The pressure Jacobian scheme uses a constrained cubic spline to reconstruct 
    648 the density profile across the water column. This method maintains the monotonicity between the 
    649 density nodes  The pressure can be calculated by analytical integration of the density profile and a 
    650 pressure Jacobian method is used to solve the horizontal pressure gradient. This method can provide 
    651 a more accurate calculation of the horizontal pressure gradient than the standard scheme. 
     644Note that expression \autoref{eq:dynhpg_sco} is commonly used when the variable volume formulation is activated 
     645(\key{vvl}) because in that case, even with a flat bottom, 
     646the coordinate surfaces are not horizontal but follow the free surface \citep{Levier2007}. 
     647The pressure jacobian scheme (\np{ln\_dynhpg\_prj}\forcode{ = .true.}) is available as 
     648an improved option to \np{ln\_dynhpg\_sco}\forcode{ = .true.} when \key{vvl} is active. 
     649The pressure Jacobian scheme uses a constrained cubic spline to 
     650reconstruct the density profile across the water column. 
     651This method maintains the monotonicity between the density nodes. 
     652The pressure can be calculated by analytical integration of the density profile and 
     653a pressure Jacobian method is used to solve the horizontal pressure gradient. 
     654This method can provide a more accurate calculation of the horizontal pressure gradient than the standard scheme. 
    652655 
    653656\subsection{Ice shelf cavity} 
    654657\label{subsec:DYN_hpg_isf} 
    655658Beneath an ice shelf, the total pressure gradient is the sum of the pressure gradient due to the ice shelf load and 
    656  the pressure gradient due to the ocean load. If cavity opened (\np{ln\_isfcav}\forcode{ = .true.}) these 2 terms can be 
    657  calculated by setting \np{ln\_dynhpg\_isf}\forcode{ = .true.}. No other scheme are working with the ice shelf.\\ 
     659the pressure gradient due to the ocean load. 
     660If cavity opened (\np{ln\_isfcav}\forcode{ = .true.}) these 2 terms can be calculated by 
     661setting \np{ln\_dynhpg\_isf}\forcode{ = .true.}. 
     662No other scheme are working with the ice shelf.\\ 
    658663 
    659664$\bullet$ The main hypothesis to compute the ice shelf load is that the ice shelf is in an isostatic equilibrium. 
    660  The top pressure is computed integrating from surface to the base of the ice shelf a reference density profile  
    661 (prescribed as density of a water at 34.4 PSU and -1.9\degC) and corresponds to the water replaced by the ice shelf.  
    662 This top pressure is constant over time. A detailed description of this method is described in \citet{Losch2008}.\\ 
    663  
    664 $\bullet$ The ocean load is computed using the expression \autoref{eq:dynhpg_sco} described in \autoref{subsec:DYN_hpg_sco}.  
     665The top pressure is computed integrating from surface to the base of the ice shelf a reference density profile 
     666(prescribed as density of a water at 34.4 PSU and -1.9\degC) and 
     667corresponds to the water replaced by the ice shelf. 
     668This top pressure is constant over time. 
     669A detailed description of this method is described in \citet{Losch2008}.\\ 
     670 
     671$\bullet$ The ocean load is computed using the expression \autoref{eq:dynhpg_sco} described in 
     672\autoref{subsec:DYN_hpg_sco}.  
    665673 
    666674%-------------------------------------------------------------------------------------------------------------- 
     
    670678\label{subsec:DYN_hpg_imp} 
    671679 
    672 The default time differencing scheme used for the horizontal pressure gradient is  
    673 a leapfrog scheme and therefore the density used in all discrete expressions given  
    674 above is the  \textit{now} density, computed from the \textit{now} temperature and  
    675 salinity. In some specific cases (usually high resolution simulations over an ocean  
    676 domain which includes weakly stratified regions) the physical phenomenon that  
    677 controls the time-step is internal gravity waves (IGWs). A semi-implicit scheme for  
    678 doubling the stability limit associated with IGWs can be used \citep{Brown_Campana_MWR78,  
    679 Maltrud1998}. It involves the evaluation of the hydrostatic pressure gradient as an  
    680 average over the three time levels $t-\rdt$, $t$, and $t+\rdt$ ($i.e.$   
    681 \textit{before},  \textit{now} and  \textit{after} time-steps), rather than at the central  
    682 time level $t$ only, as in the standard leapfrog scheme.  
     680The default time differencing scheme used for the horizontal pressure gradient is a leapfrog scheme and 
     681therefore the density used in all discrete expressions given above is the  \textit{now} density, 
     682computed from the \textit{now} temperature and salinity. 
     683In some specific cases 
     684(usually high resolution simulations over an ocean domain which includes weakly stratified regions) 
     685the physical phenomenon that controls the time-step is internal gravity waves (IGWs). 
     686A semi-implicit scheme for doubling the stability limit associated with IGWs can be used 
     687\citep{Brown_Campana_MWR78, Maltrud1998}. 
     688It involves the evaluation of the hydrostatic pressure gradient as 
     689an average over the three time levels $t-\rdt$, $t$, and $t+\rdt$ 
     690($i.e.$  \textit{before},  \textit{now} and  \textit{after} time-steps), 
     691rather than at the central time level $t$ only, as in the standard leapfrog scheme.  
    683692 
    684693$\bullet$ leapfrog scheme (\np{ln\_dynhpg\_imp}\forcode{ = .true.}): 
     
    695704\end{equation} 
    696705 
    697 The semi-implicit time scheme \autoref{eq:dynhpg_imp} is made possible without  
    698 significant additional computation since the density can be updated to time level  
    699 $t+\rdt$ before computing the horizontal hydrostatic pressure gradient. It can  
    700 be easily shown that the stability limit associated with the hydrostatic pressure  
    701 gradient doubles using \autoref{eq:dynhpg_imp} compared to that using the  
    702 standard leapfrog scheme \autoref{eq:dynhpg_lf}. Note that \autoref{eq:dynhpg_imp}  
    703 is equivalent to applying a time filter to the pressure gradient to eliminate high  
    704 frequency IGWs. Obviously, when using \autoref{eq:dynhpg_imp}, the doubling of  
    705 the time-step is achievable only if no other factors control the time-step, such as  
    706 the stability limits associated with advection or diffusion. 
    707  
    708 In practice, the semi-implicit scheme is used when \np{ln\_dynhpg\_imp}\forcode{ = .true.}.  
    709 In this case, we choose to apply the time filter to temperature and salinity used in  
    710 the equation of state, instead of applying it to the hydrostatic pressure or to the  
    711 density, so that no additional storage array has to be defined. The density used to  
    712 compute the hydrostatic pressure gradient (whatever the formulation) is evaluated  
    713 as follows: 
     706The semi-implicit time scheme \autoref{eq:dynhpg_imp} is made possible without 
     707significant additional computation since the density can be updated to time level $t+\rdt$ before 
     708computing the horizontal hydrostatic pressure gradient. 
     709It can be easily shown that the stability limit associated with the hydrostatic pressure gradient doubles using 
     710\autoref{eq:dynhpg_imp} compared to that using the standard leapfrog scheme \autoref{eq:dynhpg_lf}. 
     711Note that \autoref{eq:dynhpg_imp} is equivalent to applying a time filter to the pressure gradient to 
     712eliminate high frequency IGWs. 
     713Obviously, when using \autoref{eq:dynhpg_imp}, 
     714the doubling of the time-step is achievable only if no other factors control the time-step, 
     715such as the stability limits associated with advection or diffusion. 
     716 
     717In practice, the semi-implicit scheme is used when \np{ln\_dynhpg\_imp}\forcode{ = .true.}. 
     718In this case, we choose to apply the time filter to temperature and salinity used in the equation of state, 
     719instead of applying it to the hydrostatic pressure or to the density, 
     720so that no additional storage array has to be defined. 
     721The density used to compute the hydrostatic pressure gradient (whatever the formulation) is evaluated as follows: 
    714722\begin{equation} \label{eq:rho_flt} 
    715723   \rho^t = \rho( \widetilde{T},\widetilde {S},z_t) 
     
    718726\end{equation} 
    719727 
    720 Note that in the semi-implicit case, it is necessary to save the filtered density, an  
    721 extra three-dimensional field, in the restart file to restart the model with exact  
    722 reproducibility. This option is controlled by  \np{nn\_dynhpg\_rst}, a namelist parameter. 
     728Note that in the semi-implicit case, it is necessary to save the filtered density, 
     729an extra three-dimensional field, in the restart file to restart the model with exact reproducibility. 
     730This option is controlled by  \np{nn\_dynhpg\_rst}, a namelist parameter. 
    723731 
    724732% ================================================================ 
     
    735743 
    736744Options are defined through the \ngn{namdyn\_spg} namelist variables. 
    737 The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}).  
    738 The main distinction is between the fixed volume case (linear free surface) and the variable volume case  
    739 (nonlinear free surface, \key{vvl} is defined). In the linear free surface case (\autoref{subsec:PE_free_surface})  
    740 the vertical scale factors $e_{3}$ are fixed in time, while they are time-dependent in the nonlinear case  
    741 (\autoref{subsec:PE_free_surface}).  
     745The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}). 
     746The main distinction is between the fixed volume case (linear free surface) and 
     747the variable volume case (nonlinear free surface, \key{vvl} is defined). 
     748In the linear free surface case (\autoref{subsec:PE_free_surface}) 
     749the vertical scale factors $e_{3}$ are fixed in time, 
     750while they are time-dependent in the nonlinear case (\autoref{subsec:PE_free_surface}). 
    742751With both linear and nonlinear free surface, external gravity waves are allowed in the equations,  
    743 which imposes a very small time step when an explicit time stepping is used.  
     752which imposes a very small time step when an explicit time stepping is used. 
    744753Two methods are proposed to allow a longer time step for the three-dimensional equations:  
    745754the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:PE_flt}),  
    746 and the split-explicit free surface described below.  
     755and the split-explicit free surface described below. 
    747756The extra term introduced in the filtered method is calculated implicitly,  
    748757so that the update of the next velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}. 
    749758 
    750759 
    751 The form of the surface pressure gradient term depends on how the user wants to handle  
    752 the fast external gravity waves that are a solution of the analytical equation (\autoref{sec:PE_hor_pg}).  
     760The form of the surface pressure gradient term depends on how the user wants to 
     761handle the fast external gravity waves that are a solution of the analytical equation (\autoref{sec:PE_hor_pg}). 
    753762Three formulations are available, all controlled by a CPP key (ln\_dynspg\_xxx): 
    754 an explicit formulation which requires a small time step ; 
    755 a filtered free surface formulation which allows a larger time step by adding a filtering  
    756 term into the momentum equation ;  
     763an explicit formulation which requires a small time step; 
     764a filtered free surface formulation which allows a larger time step by 
     765adding a filtering term into the momentum equation;  
    757766and a split-explicit free surface formulation, described below, which also allows a larger time step. 
    758767 
    759 The extra term introduced in the filtered method is calculated  
    760 implicitly, so that a solver is used to compute it. As a consequence the update of the $next$  
    761 velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}. 
     768The extra term introduced in the filtered method is calculated implicitly, so that a solver is used to compute it. 
     769As a consequence the update of the $next$ velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}. 
    762770 
    763771 
     
    768776\label{subsec:DYN_spg_exp} 
    769777 
    770 In the explicit free surface formulation (\key{dynspg\_exp} defined), the model time step  
    771 is chosen to be small enough to resolve the external gravity waves (typically a few tens of seconds).  
     778In the explicit free surface formulation (\key{dynspg\_exp} defined), 
     779the model time step is chosen to be small enough to resolve the external gravity waves 
     780(typically a few tens of seconds). 
    772781The surface pressure gradient, evaluated using a leap-frog scheme ($i.e.$ centered in time), 
    773782is thus simply given by : 
     
    779788\end{equation}  
    780789 
    781 Note that in the non-linear free surface case ($i.e.$ \key{vvl} defined), the surface pressure  
    782 gradient is already included in the momentum tendency  through the level thickness variation  
    783 allowed in the computation of the hydrostatic pressure gradient. Thus, nothing is done in the \mdl{dynspg\_exp} module. 
     790Note that in the non-linear free surface case ($i.e.$ \key{vvl} defined), 
     791the surface pressure gradient is already included in the momentum tendency through 
     792the level thickness variation allowed in the computation of the hydrostatic pressure gradient. 
     793Thus, nothing is done in the \mdl{dynspg\_exp} module. 
    784794 
    785795%-------------------------------------------------------------------------------------------------------------- 
     
    794804 
    795805The split-explicit free surface formulation used in \NEMO (\key{dynspg\_ts} defined), 
    796 also called the time-splitting formulation, follows the one  
    797 proposed by \citet{Shchepetkin_McWilliams_OM05}. The general idea is to solve the free surface  
    798 equation and the associated barotropic velocity equations with a smaller time  
    799 step than $\rdt$, the time step used for the three dimensional prognostic  
    800 variables (\autoref{fig:DYN_dynspg_ts}).  
    801 The size of the small time step, $\rdt_e$ (the external mode or barotropic time step) 
    802  is provided through the \np{nn\_baro} namelist parameter as:  
    803 $\rdt_e = \rdt / nn\_baro$. This parameter can be optionally defined automatically (\np{ln\_bt\_nn\_auto}\forcode{ = .true.})  
    804 considering that the stability of the barotropic system is essentially controled by external waves propagation.  
     806also called the time-splitting formulation, follows the one proposed by \citet{Shchepetkin_McWilliams_OM05}. 
     807The general idea is to solve the free surface equation and the associated barotropic velocity equations with 
     808a smaller time step than $\rdt$, the time step used for the three dimensional prognostic variables 
     809(\autoref{fig:DYN_dynspg_ts}). 
     810The size of the small time step, $\rdt_e$ (the external mode or barotropic time step) is provided through 
     811the \np{nn\_baro} namelist parameter as: $\rdt_e = \rdt / nn\_baro$. 
     812This parameter can be optionally defined automatically (\np{ln\_bt\_nn\_auto}\forcode{ = .true.}) considering that 
     813the stability of the barotropic system is essentially controled by external waves propagation. 
    805814Maximum Courant number is in that case time independent, and easily computed online from the input bathymetry. 
    806815Therefore, $\rdt_e$ is adjusted so that the Maximum allowed Courant number is smaller than \np{rn\_bt\_cmax}. 
     
    819828  \end{equation} 
    820829\end{subequations} 
    821 where $\rm {\overline{\bf G}}$ is a forcing term held constant, containing coupling term between modes, surface atmospheric forcing as well as slowly varying barotropic terms not explicitly computed to gain efficiency. The third term on the right hand side of \autoref{eq:BT_dyn} represents the bottom stress (see section \autoref{sec:ZDF_bfr}), explicitly accounted for at each barotropic iteration. Temporal discretization of the system above follows a three-time step Generalized Forward Backward algorithm detailed in \citet{Shchepetkin_McWilliams_OM05}. AB3-AM4 coefficients used in \NEMO follow the second-order accurate, "multi-purpose" stability compromise as defined in \citet{Shchepetkin_McWilliams_Bk08} (see their figure 12, lower left).  
     830where $\rm {\overline{\bf G}}$ is a forcing term held constant, containing coupling term between modes, 
     831surface atmospheric forcing as well as slowly varying barotropic terms not explicitly computed to gain efficiency. 
     832The third term on the right hand side of \autoref{eq:BT_dyn} represents the bottom stress 
     833(see section \autoref{sec:ZDF_bfr}), explicitly accounted for at each barotropic iteration. 
     834Temporal discretization of the system above follows a three-time step Generalized Forward Backward algorithm 
     835detailed in \citet{Shchepetkin_McWilliams_OM05}. 
     836AB3-AM4 coefficients used in \NEMO follow the second-order accurate, 
     837"multi-purpose" stability compromise as defined in \citet{Shchepetkin_McWilliams_Bk08} 
     838(see their figure 12, lower left).  
    822839 
    823840%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
     
    825842\includegraphics[width=0.7\textwidth]{Fig_DYN_dynspg_ts} 
    826843\caption{  \protect\label{fig:DYN_dynspg_ts} 
    827 Schematic of the split-explicit time stepping scheme for the external  
    828 and internal modes. Time increases to the right. In this particular exemple,  
    829 a boxcar averaging window over $nn\_baro$ barotropic time steps is used ($nn\_bt\_flt=1$) and $nn\_baro=5$. 
    830 Internal mode time steps (which are also the model time steps) are denoted  
    831 by $t-\rdt$, $t$ and $t+\rdt$. Variables with $k$ superscript refer to instantaneous barotropic variables,  
    832 $< >$ and $<< >>$ operator refer to time filtered variables using respectively primary (red vertical bars) and secondary weights (blue vertical bars).  
    833 The former are used to obtain time filtered quantities at $t+\rdt$ while the latter are used to obtain time averaged  
    834 transports to advect tracers. 
    835 a) Forward time integration: \protect\np{ln\_bt\_fw}\forcode{ = .true.},  \protect\np{ln\_bt\_av}\forcode{ = .true.}. 
    836 b) Centred time integration: \protect\np{ln\_bt\_fw}\forcode{ = .false.}, \protect\np{ln\_bt\_av}\forcode{ = .true.}. 
    837 c) Forward time integration with no time filtering (POM-like scheme): \protect\np{ln\_bt\_fw}\forcode{ = .true.}, \protect\np{ln\_bt\_av}\forcode{ = .false.}. } 
     844  Schematic of the split-explicit time stepping scheme for the external and internal modes. 
     845  Time increases to the right. In this particular exemple, 
     846  a boxcar averaging window over $nn\_baro$ barotropic time steps is used ($nn\_bt\_flt=1$) and $nn\_baro=5$. 
     847  Internal mode time steps (which are also the model time steps) are denoted by $t-\rdt$, $t$ and $t+\rdt$. 
     848  Variables with $k$ superscript refer to instantaneous barotropic variables, 
     849  $< >$ and $<< >>$ operator refer to time filtered variables using respectively primary (red vertical bars) and 
     850  secondary weights (blue vertical bars). 
     851  The former are used to obtain time filtered quantities at $t+\rdt$ while 
     852  the latter are used to obtain time averaged transports to advect tracers. 
     853  a) Forward time integration: \protect\np{ln\_bt\_fw}\forcode{ = .true.}, 
     854  \protect\np{ln\_bt\_av}\forcode{ = .true.}. 
     855  b) Centred time integration: \protect\np{ln\_bt\_fw}\forcode{ = .false.}, 
     856  \protect\np{ln\_bt\_av}\forcode{ = .true.}. 
     857  c) Forward time integration with no time filtering (POM-like scheme): 
     858  \protect\np{ln\_bt\_fw}\forcode{ = .true.}, \protect\np{ln\_bt\_av}\forcode{ = .false.}. } 
    838859\end{center}    \end{figure} 
    839860%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
    840861 
    841 In the default case (\np{ln\_bt\_fw}\forcode{ = .true.}), the external mode is integrated  
    842 between \textit{now} and  \textit{after} baroclinic time-steps (\autoref{fig:DYN_dynspg_ts}a). To avoid aliasing of fast barotropic motions into three dimensional equations, time filtering is eventually applied on barotropic  
    843 quantities (\np{ln\_bt\_av}\forcode{ = .true.}). In that case, the integration is extended slightly beyond  \textit{after} time step to provide time filtered quantities.  
    844 These are used for the subsequent initialization of the barotropic mode in the following baroclinic step.  
     862In the default case (\np{ln\_bt\_fw}\forcode{ = .true.}), 
     863the external mode is integrated between \textit{now} and \textit{after} baroclinic time-steps 
     864(\autoref{fig:DYN_dynspg_ts}a). 
     865To avoid aliasing of fast barotropic motions into three dimensional equations, 
     866time filtering is eventually applied on barotropic quantities (\np{ln\_bt\_av}\forcode{ = .true.}). 
     867In that case, the integration is extended slightly beyond \textit{after} time step to 
     868provide time filtered quantities. 
     869These are used for the subsequent initialization of the barotropic mode in the following baroclinic step. 
    845870Since external mode equations written at baroclinic time steps finally follow a forward time stepping scheme,  
    846 asselin filtering is not applied to barotropic quantities. \\ 
    847 Alternatively, one can choose to integrate barotropic equations starting  
    848 from \textit{before} time step (\np{ln\_bt\_fw}\forcode{ = .false.}). Although more computationaly expensive ( \np{nn\_baro} additional iterations are indeed necessary), the baroclinic to barotropic forcing term given at \textit{now} time step  
    849 become centred in the middle of the integration window. It can easily be shown that this property  
    850 removes part of splitting errors between modes, which increases the overall numerical robustness. 
     871asselin filtering is not applied to barotropic quantities.\\ 
     872Alternatively, one can choose to integrate barotropic equations starting from \textit{before} time step 
     873(\np{ln\_bt\_fw}\forcode{ = .false.}). 
     874Although more computationaly expensive ( \np{nn\_baro} additional iterations are indeed necessary), 
     875the baroclinic to barotropic forcing term given at \textit{now} time step become centred in 
     876the middle of the integration window. 
     877It can easily be shown that this property removes part of splitting errors between modes, 
     878which increases the overall numerical robustness. 
    851879%references to Patrick Marsaleix' work here. Also work done by SHOM group. 
    852880 
    853881%%% 
    854882 
    855 As far as tracer conservation is concerned, barotropic velocities used to advect tracers must also be updated  
    856 at \textit{now} time step. This implies to change the traditional order of computations in \NEMO: most of momentum   
    857 trends (including the barotropic mode calculation) updated first, tracers' after. This \textit{de facto} makes semi-implicit hydrostatic  
    858 pressure gradient (see section \autoref{subsec:DYN_hpg_imp}) and time splitting not compatible.  
    859 Advective barotropic velocities are obtained by using a secondary set of filtering weights, uniquely defined from the filter  
    860 coefficients used for the time averaging (\citet{Shchepetkin_McWilliams_OM05}). Consistency between the time averaged continuity equation and the time stepping of tracers is here the key to obtain exact conservation. 
     883As far as tracer conservation is concerned, 
     884barotropic velocities used to advect tracers must also be updated at \textit{now} time step. 
     885This implies to change the traditional order of computations in \NEMO: 
     886most of momentum trends (including the barotropic mode calculation) updated first, tracers' after. 
     887This \textit{de facto} makes semi-implicit hydrostatic pressure gradient 
     888(see section \autoref{subsec:DYN_hpg_imp}) 
     889and time splitting not compatible. 
     890Advective barotropic velocities are obtained by using a secondary set of filtering weights, 
     891uniquely defined from the filter coefficients used for the time averaging (\citet{Shchepetkin_McWilliams_OM05}). 
     892Consistency between the time averaged continuity equation and the time stepping of tracers is here the key to 
     893obtain exact conservation. 
    861894 
    862895%%% 
    863896 
    864 One can eventually choose to feedback instantaneous values by not using any time filter (\np{ln\_bt\_av}\forcode{ = .false.}).  
    865 In that case, external mode equations are continuous in time, ie they are not re-initialized when starting a new  
    866 sub-stepping sequence. This is the method used so far in the POM model, the stability being maintained by refreshing at (almost)  
    867 each barotropic time step advection and horizontal diffusion terms. Since the latter terms have not been added in \NEMO for  
    868 computational efficiency, removing time filtering is not recommended except for debugging purposes.  
    869 This may be used for instance to appreciate the damping effect of the standard formulation on external gravity waves in idealized or weakly non-linear cases. Although the damping is lower than for the filtered free surface, it is still significant as shown by \citet{Levier2007} in the case of an analytical barotropic Kelvin wave. 
     897One can eventually choose to feedback instantaneous values by not using any time filter 
     898(\np{ln\_bt\_av}\forcode{ = .false.}).  
     899In that case, external mode equations are continuous in time, 
     900$i.e.$ they are not re-initialized when starting a new sub-stepping sequence. 
     901This is the method used so far in the POM model, the stability being maintained by 
     902refreshing at (almost) each barotropic time step advection and horizontal diffusion terms. 
     903Since the latter terms have not been added in \NEMO for computational efficiency, 
     904removing time filtering is not recommended except for debugging purposes. 
     905This may be used for instance to appreciate the damping effect of the standard formulation on 
     906external gravity waves in idealized or weakly non-linear cases. 
     907Although the damping is lower than for the filtered free surface, 
     908it is still significant as shown by \citet{Levier2007} in the case of an analytical barotropic Kelvin wave. 
    870909 
    871910%>>>>>=============== 
     
    874913\textbf{title: Time stepping the barotropic system } 
    875914 
    876 Assume knowledge of the full velocity and tracer fields at baroclinic time $\tau$. Hence,  
    877 we can update the surface height and vertically integrated velocity with a leap-frog  
    878 scheme using the small barotropic time step $\rdt$. We have  
     915Assume knowledge of the full velocity and tracer fields at baroclinic time $\tau$. 
     916Hence, we can update the surface height and vertically integrated velocity with a leap-frog scheme using 
     917the small barotropic time step $\rdt$. 
     918We have  
    879919 
    880920\begin{equation} \label{eq:DYN_spg_ts_eta} 
     
    889929\ 
    890930 
    891 In these equations, araised (b) denotes values of surface height and vertically integrated velocity updated with the barotropic time steps. The $\tau$ time label on $\eta^{(b)}$  
    892 and $U^{(b)}$ denotes the baroclinic time at which the vertically integrated forcing $\textbf{M}(\tau)$ (note that this forcing includes the surface freshwater forcing), the tracer fields, the freshwater flux $\text{EMP}_w(\tau)$, and total depth of the ocean $H(\tau)$ are held for the duration of the barotropic time stepping over a single cycle. This is also the time  
    893 that sets the barotropic time steps via  
     931In these equations, araised (b) denotes values of surface height and vertically integrated velocity updated with 
     932the barotropic time steps. 
     933The $\tau$ time label on $\eta^{(b)}$ and $U^{(b)}$ denotes the baroclinic time at which 
     934the vertically integrated forcing $\textbf{M}(\tau)$ 
     935(note that this forcing includes the surface freshwater forcing), 
     936the tracer fields, the freshwater flux $\text{EMP}_w(\tau)$, 
     937and total depth of the ocean $H(\tau)$ are held for the duration of the barotropic time stepping over 
     938a single cycle. 
     939This is also the time that sets the barotropic time steps via  
    894940\begin{equation} \label{eq:DYN_spg_ts_t} 
    895941t_n=\tau+n\rdt    
    896942\end{equation} 
    897 with $n$ an integer. The density scaled surface pressure is evaluated via  
     943with $n$ an integer. 
     944The density scaled surface pressure is evaluated via  
    898945\begin{equation} \label{eq:DYN_spg_ts_ps} 
    899946p_s^{(b)}(\tau,t_{n}) = \begin{cases} 
     
    914961 \overline{\eta^{(b)}(\tau)} = \frac{1}{N+1} \sum\limits_{n=0}^N \eta^{(b)}(\tau-\rdt,t_{n}) 
    915962\end{equation} 
    916 the time averaged surface height taken from the previous barotropic cycle. Likewise,  
     963the time averaged surface height taken from the previous barotropic cycle. 
     964Likewise,  
    917965\begin{equation} \label{eq:DYN_spg_ts_u} 
    918966\textbf{U}^{(b)}(\tau,t_{n=0}) = \overline{\textbf{U}^{(b)}(\tau)}   \\ 
     
    925973   = \frac{1}{N+1} \sum\limits_{n=0}^N\textbf{U}^{(b)}(\tau-\rdt,t_{n}) 
    926974\end{equation} 
    927 the time averaged vertically integrated transport. Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration.  
    928  
    929 Upon reaching $t_{n=N} = \tau + 2\rdt \tau$ , the vertically integrated velocity is time averaged to produce the updated vertically integrated velocity at baroclinic time $\tau + \rdt \tau$  
     975the time averaged vertically integrated transport. 
     976Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration.  
     977 
     978Upon reaching $t_{n=N} = \tau + 2\rdt \tau$ , 
     979the vertically integrated velocity is time averaged to produce the updated vertically integrated velocity at 
     980baroclinic time $\tau + \rdt \tau$  
    930981\begin{equation} \label{eq:DYN_spg_ts_u} 
    931982\textbf{U}(\tau+\rdt) = \overline{\textbf{U}^{(b)}(\tau+\rdt)}  
    932983   = \frac{1}{N+1} \sum\limits_{n=0}^N\textbf{U}^{(b)}(\tau,t_{n}) 
    933984\end{equation} 
    934 The surface height on the new baroclinic time step is then determined via a baroclinic leap-frog using the following form  
     985The surface height on the new baroclinic time step is then determined via a baroclinic leap-frog using 
     986the following form  
    935987 
    936988\begin{equation} \label{eq:DYN_spg_ts_ssh} 
     
    938990\end{equation} 
    939991 
    940  The use of this "big-leap-frog" scheme for the surface height ensures compatibility between the mass/volume budgets and the tracer budgets. More discussion of this point is provided in Chapter 10 (see in particular Section 10.2).  
     992The use of this "big-leap-frog" scheme for the surface height ensures compatibility between 
     993the mass/volume budgets and the tracer budgets. 
     994More discussion of this point is provided in Chapter 10 (see in particular Section 10.2).  
    941995  
    942 In general, some form of time filter is needed to maintain integrity of the surface  
    943 height field due to the leap-frog splitting mode in equation \autoref{eq:DYN_spg_ts_ssh}. We  
    944 have tried various forms of such filtering, with the following method discussed in  
    945 \cite{Griffies_al_MWR01} chosen due to its stability and reasonably good maintenance of  
    946 tracer conservation properties (see ??)  
     996In general, some form of time filter is needed to maintain integrity of the surface height field due to 
     997the leap-frog splitting mode in equation \autoref{eq:DYN_spg_ts_ssh}. 
     998We have tried various forms of such filtering, 
     999with the following method discussed in \cite{Griffies_al_MWR01} chosen due to 
     1000its stability and reasonably good maintenance of tracer conservation properties (see ??). 
    9471001 
    9481002\begin{equation} \label{eq:DYN_spg_ts_sshf} 
     
    9571011\end{equation} 
    9581012 
    959 which is useful since it isolates all the time filtering aspects into the term multiplied  
    960 by $\alpha$. This isolation allows for an easy check that tracer conservation is exact when  
    961 eliminating tracer and surface height time filtering (see ?? for more complete discussion). However, in the general case with a non-zero $\alpha$, the filter \autoref{eq:DYN_spg_ts_sshf} was found to be more conservative, and so is recommended.  
     1013which is useful since it isolates all the time filtering aspects into the term multiplied by $\alpha$. 
     1014This isolation allows for an easy check that tracer conservation is exact when 
     1015eliminating tracer and surface height time filtering (see ?? for more complete discussion). 
     1016However, in the general case with a non-zero $\alpha$, 
     1017the filter \autoref{eq:DYN_spg_ts_sshf} was found to be more conservative, and so is recommended.  
    9621018 
    9631019}            %%end gm comment (copy of griffies book) 
     
    9841040\end{equation} 
    9851041where $T_c$, is a parameter with dimensions of time which characterizes the force,  
    986 $\widetilde{\rho} = \rho / \rho_o$ is the dimensionless density, and $\rm {\bf M}$  
    987 represents the collected contributions of the Coriolis, hydrostatic pressure gradient,  
     1042$\widetilde{\rho} = \rho / \rho_o$ is the dimensionless density, 
     1043and $\rm {\bf M}$ represents the collected contributions of the Coriolis, hydrostatic pressure gradient,  
    9881044non-linear and viscous terms in \autoref{eq:PE_dyn}. 
    9891045}   %end gmcomment 
    9901046 
    991 Note that in the linear free surface formulation (\key{vvl} not defined), the ocean depth  
    992 is time-independent and so is the matrix to be inverted. It is computed once and for all and applies to all ocean time steps.  
     1047Note that in the linear free surface formulation (\key{vvl} not defined), 
     1048the ocean depth is time-independent and so is the matrix to be inverted. 
     1049It is computed once and for all and applies to all ocean time steps.  
    9931050 
    9941051% ================================================================ 
     
    10031060 
    10041061Options are defined through the \ngn{namdyn\_ldf} namelist variables. 
    1005 The options available for lateral diffusion are to use either laplacian  
    1006 (rotated or not) or biharmonic operators. The coefficients may be constant  
    1007 or spatially variable; the description of the coefficients is found in the chapter  
    1008 on lateral physics (\autoref{chap:LDF}). The lateral diffusion of momentum is  
    1009 evaluated using a forward scheme, $i.e.$ the velocity appearing in its expression  
    1010 is the \textit{before} velocity in time, except for the pure vertical component  
    1011 that appears when a tensor of rotation is used. This latter term is solved  
    1012 implicitly together with the vertical diffusion term (see \autoref{chap:STP})  
    1013  
    1014 At the lateral boundaries either free slip, no slip or partial slip boundary  
    1015 conditions are applied according to the user's choice (see \autoref{chap:LBC}). 
     1062The options available for lateral diffusion are to use either laplacian (rotated or not) or biharmonic operators. 
     1063The coefficients may be constant or spatially variable; 
     1064the description of the coefficients is found in the chapter on lateral physics (\autoref{chap:LDF}). 
     1065The lateral diffusion of momentum is evaluated using a forward scheme, 
     1066$i.e.$ the velocity appearing in its expression is the \textit{before} velocity in time, 
     1067except for the pure vertical component that appears when a tensor of rotation is used. 
     1068This latter term is solved implicitly together with the vertical diffusion term (see \autoref{chap:STP}). 
     1069 
     1070At the lateral boundaries either free slip, 
     1071no slip or partial slip boundary conditions are applied according to the user's choice (see \autoref{chap:LBC}). 
    10161072 
    10171073\gmcomment{ 
    1018 Hyperviscous operators are frequently used in the simulation of turbulent flows to control  
    1019 the dissipation of unresolved small scale features.  
    1020 Their primary role is to provide strong dissipation at the smallest scale supported by the grid  
    1021 while minimizing the impact on the larger scale features.  
    1022 Hyperviscous operators are thus designed to be more scale selective than the traditional,  
    1023 physically motivated Laplace operator.  
    1024 In finite difference methods, the biharmonic operator is frequently the method of choice to achieve  
    1025 this scale selective dissipation since its damping time ($i.e.$ its spin down time)  
    1026 scale like $\lambda^{-4}$ for disturbances of wavelength $\lambda$  
    1027 (so that short waves damped more rapidelly than long ones),  
    1028 whereas the Laplace operator damping time scales only like $\lambda^{-2}$. 
     1074  Hyperviscous operators are frequently used in the simulation of turbulent flows to 
     1075  control the dissipation of unresolved small scale features. 
     1076  Their primary role is to provide strong dissipation at the smallest scale supported by 
     1077  the grid while minimizing the impact on the larger scale features. 
     1078  Hyperviscous operators are thus designed to be more scale selective than the traditional, 
     1079  physically motivated Laplace operator. 
     1080  In finite difference methods, 
     1081  the biharmonic operator is frequently the method of choice to achieve this scale selective dissipation since 
     1082  its damping time ($i.e.$ its spin down time) scale like $\lambda^{-4}$ for disturbances of wavelength $\lambda$ 
     1083  (so that short waves damped more rapidelly than long ones), 
     1084  whereas the Laplace operator damping time scales only like $\lambda^{-2}$. 
    10291085} 
    10301086 
     
    10471103\end{equation}  
    10481104 
    1049 As explained in \autoref{subsec:PE_ldf}, this formulation (as the gradient of a divergence  
    1050 and curl of the vorticity) preserves symmetry and ensures a complete  
    1051 separation between the vorticity and divergence parts of the momentum diffusion.  
     1105As explained in \autoref{subsec:PE_ldf}, 
     1106this formulation (as the gradient of a divergence and curl of the vorticity) preserves symmetry and 
     1107ensures a complete separation between the vorticity and divergence parts of the momentum diffusion.  
    10521108 
    10531109%-------------------------------------------------------------------------------------------------------------- 
     
    10581114\label{subsec:DYN_ldf_iso} 
    10591115 
    1060 A rotation of the lateral momentum diffusion operator is needed in several cases:  
    1061 for iso-neutral diffusion in the $z$-coordinate (\np{ln\_dynldf\_iso}\forcode{ = .true.}) and for  
    1062 either iso-neutral (\np{ln\_dynldf\_iso}\forcode{ = .true.}) or geopotential  
    1063 (\np{ln\_dynldf\_hor}\forcode{ = .true.}) diffusion in the $s$-coordinate. In the partial step  
    1064 case, coordinates are horizontal except at the deepest level and no  
    1065 rotation is performed when \np{ln\_dynldf\_hor}\forcode{ = .true.}. The diffusion operator  
    1066 is defined simply as the divergence of down gradient momentum fluxes on each  
    1067 momentum component. It must be emphasized that this formulation ignores  
    1068 constraints on the stress tensor such as symmetry. The resulting discrete  
    1069 representation is: 
     1116A rotation of the lateral momentum diffusion operator is needed in several cases: 
     1117for iso-neutral diffusion in the $z$-coordinate (\np{ln\_dynldf\_iso}\forcode{ = .true.}) and 
     1118for either iso-neutral (\np{ln\_dynldf\_iso}\forcode{ = .true.}) or 
     1119geopotential (\np{ln\_dynldf\_hor}\forcode{ = .true.}) diffusion in the $s$-coordinate. 
     1120In the partial step case, coordinates are horizontal except at the deepest level and 
     1121no rotation is performed when \np{ln\_dynldf\_hor}\forcode{ = .true.}. 
     1122The diffusion operator is defined simply as the divergence of down gradient momentum fluxes on 
     1123each momentum component. 
     1124It must be emphasized that this formulation ignores constraints on the stress tensor such as symmetry. 
     1125The resulting discrete representation is: 
    10701126\begin{equation} \label{eq:dyn_ldf_iso} 
    10711127\begin{split} 
     
    11151171 \end{split} 
    11161172\end{equation} 
    1117 where $r_1$ and $r_2$ are the slopes between the surface along which the  
    1118 diffusion operator acts and the surface of computation ($z$- or $s$-surfaces).  
    1119 The way these slopes are evaluated is given in the lateral physics chapter  
    1120 (\autoref{chap:LDF}). 
     1173where $r_1$ and $r_2$ are the slopes between the surface along which the diffusion operator acts and 
     1174the surface of computation ($z$- or $s$-surfaces).  
     1175The way these slopes are evaluated is given in the lateral physics chapter (\autoref{chap:LDF}). 
    11211176 
    11221177%-------------------------------------------------------------------------------------------------------------- 
     
    11271182\label{subsec:DYN_ldf_bilap} 
    11281183 
    1129 The lateral fourth order operator formulation on momentum is obtained by  
    1130 applying \autoref{eq:dynldf_lap} twice. It requires an additional assumption on  
    1131 boundary conditions: the first derivative term normal to the coast depends on  
    1132 the free or no-slip lateral boundary conditions chosen, while the third  
    1133 derivative terms normal to the coast are set to zero (see \autoref{chap:LBC}). 
     1184The lateral fourth order operator formulation on momentum is obtained by applying \autoref{eq:dynldf_lap} twice. 
     1185It requires an additional assumption on boundary conditions: 
     1186the first derivative term normal to the coast depends on the free or no-slip lateral boundary conditions chosen, 
     1187while the third derivative terms normal to the coast are set to zero (see \autoref{chap:LBC}). 
    11341188%%% 
    11351189\gmcomment{add a remark on the the change in the position of the coefficient} 
     
    11471201 
    11481202Options are defined through the \ngn{namzdf} namelist variables. 
    1149 The large vertical diffusion coefficient found in the surface mixed layer together  
    1150 with high vertical resolution implies that in the case of explicit time stepping there  
    1151 would be too restrictive a constraint on the time step. Two time stepping schemes  
    1152 can be used for the vertical diffusion term : $(a)$ a forward time differencing  
    1153 scheme (\np{ln\_zdfexp}\forcode{ = .true.}) using a time splitting technique  
    1154 (\np{nn\_zdfexp} $>$ 1) or $(b)$ a backward (or implicit) time differencing scheme  
    1155 (\np{ln\_zdfexp}\forcode{ = .false.}) (see \autoref{chap:STP}). Note that namelist variables  
    1156 \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics.  
    1157  
    1158 The formulation of the vertical subgrid scale physics is the same whatever  
    1159 the vertical coordinate is. The vertical diffusion operators given by  
    1160 \autoref{eq:PE_zdf} take the following semi-discrete space form: 
     1203The 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. 
     1204Two time stepping schemes can be used for the vertical diffusion term: 
     1205$(a)$ a forward time differencing scheme 
     1206(\np{ln\_zdfexp}\forcode{ = .true.}) using a time splitting technique (\np{nn\_zdfexp} $>$ 1) or 
     1207$(b)$ a backward (or implicit) time differencing scheme (\np{ln\_zdfexp}\forcode{ = .false.}) 
     1208(see \autoref{chap:STP}). 
     1209Note that namelist variables \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics.  
     1210 
     1211The formulation of the vertical subgrid scale physics is the same whatever the vertical coordinate is. 
     1212The vertical diffusion operators given by \autoref{eq:PE_zdf} take the following semi-discrete space form: 
    11611213\begin{equation} \label{eq:dynzdf} 
    11621214\left\{   \begin{aligned} 
     
    11681220\end{aligned}   \right. 
    11691221\end{equation}  
    1170 where $A_{uw}^{vm} $ and $A_{vw}^{vm} $ are the vertical eddy viscosity and  
    1171 diffusivity coefficients. The way these coefficients are evaluated  
    1172 depends on the vertical physics used (see \autoref{chap:ZDF}). 
    1173  
    1174 The surface boundary condition on momentum is the stress exerted by  
    1175 the wind. At the surface, the momentum fluxes are prescribed as the boundary  
    1176 condition on the vertical turbulent momentum fluxes, 
     1222where $A_{uw}^{vm} $ and $A_{vw}^{vm} $ are the vertical eddy viscosity and diffusivity coefficients. 
     1223The way these coefficients are evaluated depends on the vertical physics used (see \autoref{chap:ZDF}). 
     1224 
     1225The surface boundary condition on momentum is the stress exerted by the wind. 
     1226At the surface, the momentum fluxes are prescribed as the boundary condition on 
     1227the vertical turbulent momentum fluxes, 
    11771228\begin{equation} \label{eq:dynzdf_sbc} 
    11781229\left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{z=1} 
    11791230    = \frac{1}{\rho _o} \binom{\tau _u}{\tau _v } 
    11801231\end{equation} 
    1181 where $\left( \tau _u ,\tau _v \right)$ are the two components of the wind stress  
    1182 vector in the (\textbf{i},\textbf{j}) coordinate system. The high mixing coefficients  
    1183 in the surface mixed layer ensure that the surface wind stress is distributed in  
    1184 the vertical over the mixed layer depth. If the vertical mixing coefficient  
    1185 is small (when no mixed layer scheme is used) the surface stress enters only  
    1186 the top model level, as a body force. The surface wind stress is calculated  
    1187 in the surface module routines (SBC, see \autoref{chap:SBC}) 
    1188  
    1189 The turbulent flux of momentum at the bottom of the ocean is specified through  
    1190 a bottom friction parameterisation (see \autoref{sec:ZDF_bfr}) 
     1232where $\left( \tau _u ,\tau _v \right)$ are the two components of the wind stress vector in 
     1233the (\textbf{i},\textbf{j}) coordinate system. 
     1234The high mixing coefficients in the surface mixed layer ensure that the surface wind stress is distributed in  
     1235the vertical over the mixed layer depth. 
     1236If the vertical mixing coefficient is small (when no mixed layer scheme is used) 
     1237the surface stress enters only the top model level, as a body force. 
     1238The surface wind stress is calculated in the surface module routines (SBC, see \autoref{chap:SBC}). 
     1239 
     1240The turbulent flux of momentum at the bottom of the ocean is specified through a bottom friction parameterisation 
     1241(see \autoref{sec:ZDF_bfr}) 
    11911242 
    11921243% ================================================================ 
     
    11961247\label{sec:DYN_forcing} 
    11971248 
    1198 Besides the surface and bottom stresses (see the above section) which are  
    1199 introduced as boundary conditions on the vertical mixing, three other forcings  
    1200 may enter the dynamical equations by affecting the surface pressure gradient.  
    1201  
    1202 (1) When \np{ln\_apr\_dyn}\forcode{ = .true.} (see \autoref{sec:SBC_apr}), the atmospheric pressure is taken  
    1203 into account when computing the surface pressure gradient. 
    1204  
    1205 (2) When \np{ln\_tide\_pot}\forcode{ = .true.} and \np{ln\_tide}\forcode{ = .true.} (see \autoref{sec:SBC_tide}),  
     1249Besides the surface and bottom stresses (see the above section) 
     1250which are introduced as boundary conditions on the vertical mixing, 
     1251three other forcings may enter the dynamical equations by affecting the surface pressure gradient.  
     1252 
     1253(1) When \np{ln\_apr\_dyn}\forcode{ = .true.} (see \autoref{sec:SBC_apr}), 
     1254the atmospheric pressure is taken into account when computing the surface pressure gradient. 
     1255 
     1256(2) When \np{ln\_tide\_pot}\forcode{ = .true.} and \np{ln\_tide}\forcode{ = .true.} (see \autoref{sec:SBC_tide}), 
    12061257the tidal potential is taken into account when computing the surface pressure gradient. 
    12071258 
    1208 (3) When \np{nn\_ice\_embd}\forcode{ = 2} and LIM or CICE is used ($i.e.$ when the sea-ice is embedded in the ocean),  
     1259(3) When \np{nn\_ice\_embd}\forcode{ = 2} and LIM or CICE is used 
     1260($i.e.$ when the sea-ice is embedded in the ocean), 
    12091261the snow-ice mass is taken into account when computing the surface pressure gradient. 
    12101262 
     
    12251277 
    12261278Options are defined through the \ngn{namdom} namelist variables. 
    1227 The general framework for dynamics time stepping is a leap-frog scheme,  
    1228 $i.e.$ a three level centred time scheme associated with an Asselin time filter  
    1229 (cf. \autoref{chap:STP}). The scheme is applied to the velocity, except when using  
    1230 the flux form of momentum advection (cf. \autoref{sec:DYN_adv_cor_flux}) in the variable  
    1231 volume case (\key{vvl} defined), where it has to be applied to the thickness  
    1232 weighted velocity (see \autoref{sec:A_momentum})   
    1233  
    1234 $\bullet$ vector invariant form or linear free surface (\np{ln\_dynhpg\_vec}\forcode{ = .true.} ; \key{vvl} not defined): 
     1279The general framework for dynamics time stepping is a leap-frog scheme, 
     1280$i.e.$ a three level centred time scheme associated with an Asselin time filter (cf. \autoref{chap:STP}). 
     1281The scheme is applied to the velocity, except when 
     1282using the flux form of momentum advection (cf. \autoref{sec:DYN_adv_cor_flux}) 
     1283in the variable volume case (\key{vvl} defined), 
     1284where it has to be applied to the thickness weighted velocity (see \autoref{sec:A_momentum})   
     1285 
     1286$\bullet$ vector invariant form or linear free surface 
     1287(\np{ln\_dynhpg\_vec}\forcode{ = .true.} ; \key{vvl} not defined): 
    12351288\begin{equation} \label{eq:dynnxt_vec} 
    12361289\left\{   \begin{aligned} 
     
    12401293\end{equation}  
    12411294 
    1242 $\bullet$ flux form and nonlinear free surface (\np{ln\_dynhpg\_vec}\forcode{ = .false.} ; \key{vvl} defined): 
     1295$\bullet$ flux form and nonlinear free surface 
     1296(\np{ln\_dynhpg\_vec}\forcode{ = .false.} ; \key{vvl} defined): 
    12431297\begin{equation} \label{eq:dynnxt_flux} 
    12441298\left\{   \begin{aligned} 
     
    12481302\end{aligned}   \right. 
    12491303\end{equation}  
    1250 where RHS is the right hand side of the momentum equation, the subscript $f$  
    1251 denotes filtered values and $\gamma$ is the Asselin coefficient. $\gamma$ is  
    1252 initialized as \np{nn\_atfp} (namelist parameter). Its default value is \np{nn\_atfp}\forcode{ = 10.e-3}. 
    1253 In both cases, the modified Asselin filter is not applied since perfect conservation  
    1254 is not an issue for the momentum equations. 
    1255  
    1256 Note that with the filtered free surface, the update of the \textit{after} velocities  
    1257 is done in the \mdl{dynsp\_flt} module, and only array swapping 
    1258 and Asselin filtering is done in \mdl{dynnxt}. 
     1304where RHS is the right hand side of the momentum equation, 
     1305the subscript $f$ denotes filtered values and $\gamma$ is the Asselin coefficient. 
     1306$\gamma$ is initialized as \np{nn\_atfp} (namelist parameter). 
     1307Its default value is \np{nn\_atfp}\forcode{ = 10.e-3}. 
     1308In both cases, the modified Asselin filter is not applied since perfect conservation is not an issue for 
     1309the momentum equations. 
     1310 
     1311Note that with the filtered free surface, 
     1312the update of the \textit{after} velocities is done in the \mdl{dynsp\_flt} module, 
     1313and only array swapping and Asselin filtering is done in \mdl{dynnxt}. 
    12591314 
    12601315% ================================================================ 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_LBC.tex

    r10146 r10368  
    2929 
    3030Options are defined through the \ngn{namlbc} namelist variables. 
    31 The discrete representation of a domain with complex boundaries (coastlines and  
    32 bottom topography) leads to arrays that include large portions where a computation  
    33 is not required as the model variables remain at zero. Nevertheless, vectorial  
    34 supercomputers are far more efficient when computing over a whole array, and the  
    35 readability of a code is greatly improved when boundary conditions are applied in  
    36 an automatic way rather than by a specific computation before or after each  
    37 computational loop. An efficient way to work over the whole domain while specifying  
    38 the boundary conditions, is to use multiplication by mask arrays in the computation.  
    39 A mask array is a matrix whose elements are $1$ in the ocean domain and $0$  
    40 elsewhere. A simple multiplication of a variable by its own mask ensures that it will  
    41 remain zero over land areas. Since most of the boundary conditions consist of a  
    42 zero flux across the solid boundaries, they can be simply applied by multiplying  
    43 variables by the correct mask arrays, $i.e.$ the mask array of the grid point where  
    44 the flux is evaluated. For example, the heat flux in the \textbf{i}-direction is evaluated  
    45 at $u$-points. Evaluating this quantity as, 
     31The discrete representation of a domain with complex boundaries (coastlines and bottom topography) leads to 
     32arrays that include large portions where a computation is not required as the model variables remain at zero. 
     33Nevertheless, vectorial supercomputers are far more efficient when computing over a whole array, 
     34and the readability of a code is greatly improved when boundary conditions are applied in 
     35an automatic way rather than by a specific computation before or after each computational loop. 
     36An efficient way to work over the whole domain while specifying the boundary conditions, 
     37is to use multiplication by mask arrays in the computation. 
     38A mask array is a matrix whose elements are $1$ in the ocean domain and $0$ elsewhere. 
     39A simple multiplication of a variable by its own mask ensures that it will remain zero over land areas. 
     40Since most of the boundary conditions consist of a zero flux across the solid boundaries, 
     41they can be simply applied by multiplying variables by the correct mask arrays, 
     42$i.e.$ the mask array of the grid point where the flux is evaluated. 
     43For example, the heat flux in the \textbf{i}-direction is evaluated at $u$-points. 
     44Evaluating this quantity as, 
    4645 
    4746\begin{equation} \label{eq:lbc_aaaa} 
     
    4948}{e_{1u} } \; \delta _{i+1 / 2} \left[ T \right]\;\;mask_u  
    5049\end{equation} 
    51 (where mask$_{u}$ is the mask array at a $u$-point) ensures that the heat flux is  
    52 zero inside land and at the boundaries, since mask$_{u}$ is zero at solid boundaries  
    53 which in this case are defined at $u$-points (normal velocity $u$ remains zero at  
    54 the coast) (\autoref{fig:LBC_uv}).  
     50(where mask$_{u}$ is the mask array at a $u$-point) ensures that the heat flux is zero inside land and 
     51at the boundaries, since mask$_{u}$ is zero at solid boundaries which in this case are defined at $u$-points 
     52(normal velocity $u$ remains zero at the coast) (\autoref{fig:LBC_uv}).  
    5553 
    5654%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    5856\includegraphics[width=0.90\textwidth]{Fig_LBC_uv} 
    5957\caption{  \protect\label{fig:LBC_uv} 
    60 Lateral boundary (thick line) at T-level. The velocity normal to the boundary is set to zero.} 
     58  Lateral boundary (thick line) at T-level. 
     59  The velocity normal to the boundary is set to zero.} 
    6160\end{center}   \end{figure} 
    6261%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    6362 
    64 For momentum the situation is a bit more complex as two boundary conditions  
    65 must be provided along the coast (one each for the normal and tangential velocities).  
    66 The boundary of the ocean in the C-grid is defined by the velocity-faces.  
    67 For example, at a given $T$-level, the lateral boundary (a coastline or an intersection  
    68 with the bottom topography) is made of segments joining $f$-points, and normal  
    69 velocity points are located between two $f-$points (\autoref{fig:LBC_uv}).  
    70 The boundary condition on the normal velocity (no flux through solid boundaries)  
    71 can thus be easily implemented using the mask system. The boundary condition  
    72 on the tangential velocity requires a more specific treatment. This boundary  
    73 condition influences the relative vorticity and momentum diffusive trends, and is  
    74 required in order to compute the vorticity at the coast. Four different types of  
    75 lateral boundary condition are available, controlled by the value of the \np{rn\_shlat}  
    76 namelist parameter. (The value of the mask$_{f}$ array along the coastline is set  
    77 equal to this parameter.) These are: 
     63For momentum the situation is a bit more complex as two boundary conditions must be provided along the coast 
     64(one each for the normal and tangential velocities). 
     65The boundary of the ocean in the C-grid is defined by the velocity-faces. 
     66For example, at a given $T$-level, 
     67the lateral boundary (a coastline or an intersection with the bottom topography) is made of 
     68segments joining $f$-points, and normal velocity points are located between two $f-$points (\autoref{fig:LBC_uv}). 
     69The boundary condition on the normal velocity (no flux through solid boundaries) 
     70can thus be easily implemented using the mask system. 
     71The boundary condition on the tangential velocity requires a more specific treatment. 
     72This boundary condition influences the relative vorticity and momentum diffusive trends, 
     73and is required in order to compute the vorticity at the coast. 
     74Four different types of lateral boundary condition are available, 
     75controlled by the value of the \np{rn\_shlat} namelist parameter 
     76(The value of the mask$_{f}$ array along the coastline is set equal to this parameter). 
     77These are: 
    7878 
    7979%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    8181\includegraphics[width=0.90\textwidth]{Fig_LBC_shlat} 
    8282\caption{     \protect\label{fig:LBC_shlat}  
    83 lateral boundary condition (a) free-slip ($rn\_shlat=0$) ; (b) no-slip ($rn\_shlat=2$)  
    84 ; (c) "partial" free-slip ($0<rn\_shlat<2$) and (d) "strong" no-slip ($2<rn\_shlat$).  
    85 Implied "ghost" velocity inside land area is display in grey. } 
     83  lateral boundary condition 
     84  (a) free-slip ($rn\_shlat=0$); 
     85  (b) no-slip ($rn\_shlat=2$); 
     86  (c) "partial" free-slip ($0<rn\_shlat<2$) and 
     87  (d) "strong" no-slip ($2<rn\_shlat$). 
     88  Implied "ghost" velocity inside land area is display in grey. } 
    8689\end{center}    \end{figure} 
    8790%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    8992\begin{description} 
    9093 
    91 \item[free-slip boundary condition (\np{rn\_shlat}\forcode{ = 0}): ]  the tangential velocity at the  
    92 coastline is equal to the offshore velocity, $i.e.$ the normal derivative of the  
    93 tangential velocity is zero at the coast, so the vorticity: mask$_{f}$ array is set  
    94 to zero inside the land and just at the coast (\autoref{fig:LBC_shlat}-a). 
    95  
    96 \item[no-slip boundary condition (\np{rn\_shlat}\forcode{ = 2}): ] the tangential velocity vanishes  
    97 at the coastline. Assuming that the tangential velocity decreases linearly from  
    98 the closest ocean velocity grid point to the coastline, the normal derivative is  
    99 evaluated as if the velocities at the closest land velocity gridpoint and the closest  
    100 ocean velocity gridpoint were of the same magnitude but in the opposite direction  
    101 (\autoref{fig:LBC_shlat}-b). Therefore, the vorticity along the coastlines is given by:  
     94\item[free-slip boundary condition (\np{rn\_shlat}\forcode{ = 0}):] the tangential velocity at 
     95  the coastline is equal to the offshore velocity, 
     96  $i.e.$ the normal derivative of the tangential velocity is zero at the coast, 
     97  so the vorticity: mask$_{f}$ array is set to zero inside the land and just at the coast 
     98  (\autoref{fig:LBC_shlat}-a). 
     99 
     100\item[no-slip boundary condition (\np{rn\_shlat}\forcode{ = 2}):] the tangential velocity vanishes at the coastline. 
     101  Assuming that the tangential velocity decreases linearly from 
     102  the closest ocean velocity grid point to the coastline, 
     103  the normal derivative is evaluated as if the velocities at the closest land velocity gridpoint and 
     104  the closest ocean velocity gridpoint were of the same magnitude but in the opposite direction 
     105  (\autoref{fig:LBC_shlat}-b). 
     106  Therefore, the vorticity along the coastlines is given by:  
    102107 
    103108\begin{equation*} 
    104109\zeta \equiv 2 \left(\delta_{i+1/2} \left[e_{2v} v \right] - \delta_{j+1/2} \left[e_{1u} u \right] \right) / \left(e_{1f} e_{2f} \right) \ , 
    105110\end{equation*} 
    106 where $u$ and $v$ are masked fields. Setting the mask$_{f}$ array to $2$ along  
    107 the coastline provides a vorticity field computed with the no-slip boundary condition,  
    108 simply by multiplying it by the mask$_{f}$ : 
     111where $u$ and $v$ are masked fields. 
     112Setting the mask$_{f}$ array to $2$ along the coastline provides a vorticity field computed with 
     113the no-slip boundary condition, simply by multiplying it by the mask$_{f}$ : 
    109114\begin{equation} \label{eq:lbc_bbbb} 
    110115\zeta \equiv \frac{1}{e_{1f} {\kern 1pt}e_{2f} }\left( {\delta _{i+1/2}  
     
    113118\end{equation} 
    114119 
    115 \item["partial" free-slip boundary condition (0$<$\np{rn\_shlat}$<$2): ] the tangential  
    116 velocity at the coastline is smaller than the offshore velocity, $i.e.$ there is a lateral  
    117 friction but not strong enough to make the tangential velocity at the coast vanish  
    118 (\autoref{fig:LBC_shlat}-c). This can be selected by providing a value of mask$_{f}$  
    119 strictly inbetween $0$ and $2$. 
    120  
    121 \item["strong" no-slip boundary condition (2$<$\np{rn\_shlat}): ] the viscous boundary  
    122 layer is assumed to be smaller than half the grid size (\autoref{fig:LBC_shlat}-d).  
    123 The friction is thus larger than in the no-slip case. 
     120\item["partial" free-slip boundary condition (0$<$\np{rn\_shlat}$<$2):] the tangential velocity at 
     121  the coastline is smaller than the offshore velocity, $i.e.$ there is a lateral friction but 
     122  not strong enough to make the tangential velocity at the coast vanish (\autoref{fig:LBC_shlat}-c). 
     123  This can be selected by providing a value of mask$_{f}$ strictly inbetween $0$ and $2$. 
     124 
     125\item["strong" no-slip boundary condition (2$<$\np{rn\_shlat}):] the viscous boundary layer is assumed to 
     126  be smaller than half the grid size (\autoref{fig:LBC_shlat}-d). 
     127  The friction is thus larger than in the no-slip case. 
    124128 
    125129\end{description} 
    126130 
    127 Note that when the bottom topography is entirely represented by the $s$-coor-dinates  
    128 (pure $s$-coordinate), the lateral boundary condition on tangential velocity is of much  
    129 less importance as it is only applied next to the coast where the minimum water depth  
    130 can be quite shallow. 
     131Note that when the bottom topography is entirely represented by the $s$-coor-dinates (pure $s$-coordinate), 
     132the lateral boundary condition on tangential velocity is of much less importance as 
     133it is only applied next to the coast where the minimum water depth can be quite shallow. 
    131134 
    132135 
     
    137140\label{sec:LBC_jperio} 
    138141 
    139 At the model domain boundaries several choices are offered: closed, cyclic east-west,  
    140 cyclic north-south, a north-fold, and combination closed-north fold  
    141 or bi-cyclic east-west and north-fold. The north-fold boundary condition is associated with the 3-pole ORCA mesh.  
     142At the model domain boundaries several choices are offered: 
     143closed, cyclic east-west, cyclic north-south, a north-fold, and combination closed-north fold or 
     144bi-cyclic east-west and north-fold. 
     145The north-fold boundary condition is associated with the 3-pole ORCA mesh.  
    142146 
    143147% ------------------------------------------------------------------------------------------------------------- 
     
    147151\label{subsec:LBC_jperio012} 
    148152 
    149 The choice of closed or cyclic model domain boundary condition is made  
    150 by setting \np{jperio} to 0, 1, 2 or 7 in namelist \ngn{namcfg}. Each time such a boundary  
    151 condition is needed, it is set by a call to routine \mdl{lbclnk}. The computation of  
    152 momentum and tracer trends proceeds from $i=2$ to $i=jpi-1$ and from $j=2$ to  
    153 $j=jpj-1$, $i.e.$ in the model interior. To choose a lateral model boundary condition  
    154 is to specify the first and last rows and columns of the model variables.  
     153The choice of closed or cyclic model domain boundary condition is made by 
     154setting \np{jperio} to 0, 1, 2 or 7 in namelist \ngn{namcfg}. 
     155Each time such a boundary condition is needed, it is set by a call to routine \mdl{lbclnk}. 
     156The computation of momentum and tracer trends proceeds from $i=2$ to $i=jpi-1$ and from $j=2$ to $j=jpj-1$, 
     157$i.e.$ in the model interior. 
     158To choose a lateral model boundary condition is to specify the first and last rows and columns of 
     159the model variables.  
    155160 
    156161\begin{description} 
    157162 
    158 \item[For closed boundary (\np{jperio}\forcode{ = 0})], solid walls are imposed at all model  
    159 boundaries: first and last rows and columns are set to zero. 
    160  
    161 \item[For cyclic east-west boundary (\np{jperio}\forcode{ = 1})], first and last rows are set  
    162 to zero (closed) whilst the first column is set to the value of the last-but-one column  
    163 and the last column to the value of the second one (\autoref{fig:LBC_jperio}-a).  
    164 Whatever flows out of the eastern (western) end of the basin enters the western  
    165 (eastern) end. 
    166  
    167 \item[For cyclic north-south boundary (\np{jperio}\forcode{ = 2})], first and last columns are set  
    168 to zero (closed) whilst the first row is set to the value of the last-but-one row  
    169 and the last row to the value of the second one (\autoref{fig:LBC_jperio}-a).  
    170 Whatever flows out of the northern (southern) end of the basin enters the southern   
    171 (northern) end. 
     163\item[For closed boundary (\np{jperio}\forcode{ = 0})], 
     164  solid walls are imposed at all model boundaries: 
     165  first and last rows and columns are set to zero. 
     166 
     167\item[For cyclic east-west boundary (\np{jperio}\forcode{ = 1})], 
     168  first and last rows are set to zero (closed) whilst the first column is set to 
     169  the value of the last-but-one column and the last column to the value of the second one 
     170  (\autoref{fig:LBC_jperio}-a). 
     171  Whatever flows out of the eastern (western) end of the basin enters the western (eastern) end. 
     172 
     173\item[For cyclic north-south boundary (\np{jperio}\forcode{ = 2})], 
     174  first and last columns are set to zero (closed) whilst the first row is set to 
     175  the value of the last-but-one row and the last row to the value of the second one 
     176  (\autoref{fig:LBC_jperio}-a). 
     177  Whatever flows out of the northern (southern) end of the basin enters the southern (northern) end. 
    172178 
    173179\item[Bi-cyclic east-west and north-south boundary (\np{jperio}\forcode{ = 7})] combines cases 1 and 2. 
     
    179185\includegraphics[width=1.0\textwidth]{Fig_LBC_jperio} 
    180186\caption{    \protect\label{fig:LBC_jperio} 
    181 setting of (a) east-west cyclic  (b) symmetric across the equator boundary conditions.} 
     187  setting of (a) east-west cyclic  (b) symmetric across the equator boundary conditions.} 
    182188\end{center}   \end{figure} 
    183189%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    189195\label{subsec:LBC_north_fold} 
    190196 
    191 The north fold boundary condition has been introduced in order to handle the north  
    192 boundary of a three-polar ORCA grid. Such a grid has two poles in the northern hemisphere  
    193 (\autoref{fig:MISC_ORCA_msh}, and thus requires a specific treatment illustrated in \autoref{fig:North_Fold_T}.  
     197The north fold boundary condition has been introduced in order to handle the north boundary of 
     198a three-polar ORCA grid. 
     199Such a grid has two poles in the northern hemisphere (\autoref{fig:MISC_ORCA_msh}, 
     200and thus requires a specific treatment illustrated in \autoref{fig:North_Fold_T}.  
    194201Further information can be found in \mdl{lbcnfd} module which applies the north fold boundary condition. 
    195202 
     
    197204\begin{figure}[!t]    \begin{center} 
    198205\includegraphics[width=0.90\textwidth]{Fig_North_Fold_T} 
    199 \caption{    \protect\label{fig:North_Fold_T}  
    200 North fold boundary with a $T$-point pivot and cyclic east-west boundary condition  
    201 ($jperio=4$), as used in ORCA 2, 1/4, and 1/12. Pink shaded area corresponds  
    202 to the inner domain mask (see text). } 
     206\caption{    \protect\label{fig:North_Fold_T} 
     207  North fold boundary with a $T$-point pivot and cyclic east-west boundary condition ($jperio=4$), 
     208  as used in ORCA 2, 1/4, and 1/12. 
     209  Pink shaded area corresponds to the inner domain mask (see text). } 
    203210\end{center}   \end{figure} 
    204211%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    210217\label{sec:LBC_mpp} 
    211218 
    212 For massively parallel processing (mpp), a domain decomposition method is used.  
    213 The basic idea of the method is to split the large computation domain of a numerical  
    214 experiment into several smaller domains and solve the set of equations by addressing  
    215 independent local problems. Each processor has its own local memory and computes  
    216 the model equation over a subdomain of the whole model domain. The subdomain  
    217 boundary conditions are specified through communications between processors  
    218 which are organized by explicit statements (message passing method).  
    219  
    220 A big advantage is that the method does not need many modifications of the initial  
    221 FORTRAN code. From the modeller's point of view, each sub domain running on  
    222 a processor is identical to the "mono-domain" code. In addition, the programmer  
    223 manages the communications between subdomains, and the code is faster when  
    224 the number of processors is increased. The porting of OPA code on an iPSC860  
    225 was achieved during Guyon's PhD [Guyon et al. 1994, 1995] in collaboration with  
    226 CETIIS and ONERA. The implementation in the operational context and the studies  
    227 of performance on a T3D and T3E Cray computers have been made in collaboration  
    228 with IDRIS and CNRS. The present implementation is largely inspired by Guyon's  
    229 work  [Guyon 1995]. 
    230  
    231 The parallelization strategy is defined by the physical characteristics of the  
    232 ocean model. Second order finite difference schemes lead to local discrete  
    233 operators that depend at the very most on one neighbouring point. The only  
    234 non-local computations concern the vertical physics (implicit diffusion,  
    235 turbulent closure scheme, ...) (delocalization over the whole water column),  
    236 and the solving of the elliptic equation associated with the surface pressure  
    237 gradient computation (delocalization over the whole horizontal domain).  
    238 Therefore, a pencil strategy is used for the data sub-structuration  
    239 : the 3D initial domain is laid out on local processor  
    240 memories following a 2D horizontal topological splitting. Each sub-domain  
    241 computes its own surface and bottom boundary conditions and has a side  
    242 wall overlapping interface which defines the lateral boundary conditions for  
    243 computations in the inner sub-domain. The overlapping area consists of the  
    244 two rows at each edge of the sub-domain. After a computation, a communication  
    245 phase starts: each processor sends to its neighbouring processors the update  
    246 values of the points corresponding to the interior overlapping area to its  
    247 neighbouring sub-domain ($i.e.$ the innermost of the two overlapping rows).  
    248 The communication is done through the Message Passing Interface (MPI).  
    249 The data exchanges between processors are required at the very  
    250 place where lateral domain boundary conditions are set in the mono-domain  
    251 computation : the \rou{lbc\_lnk} routine (found in \mdl{lbclnk} module)  
    252 which manages such conditions is interfaced with routines found in \mdl{lib\_mpp} module  
    253 when running on an MPP computer ($i.e.$ when \key{mpp\_mpi} defined).  
    254 It has to be pointed out that when using the MPP version of the model,  
    255 the east-west cyclic boundary condition is done implicitly,  
     219For massively parallel processing (mpp), a domain decomposition method is used. 
     220The basic idea of the method is to split the large computation domain of a numerical experiment into 
     221several smaller domains and solve the set of equations by addressing independent local problems. 
     222Each processor has its own local memory and computes the model equation over a subdomain of the whole model domain. 
     223The subdomain boundary conditions are specified through communications between processors which 
     224are organized by explicit statements (message passing method). 
     225 
     226A big advantage is that the method does not need many modifications of the initial FORTRAN code. 
     227From the modeller's point of view, each sub domain running on a processor is identical to the "mono-domain" code. 
     228In addition, the programmer manages the communications between subdomains, 
     229and the code is faster when the number of processors is increased. 
     230The porting of OPA code on an iPSC860 was achieved during Guyon's PhD [Guyon et al. 1994, 1995] 
     231in collaboration with CETIIS and ONERA. 
     232The implementation in the operational context and the studies of performance on 
     233a T3D and T3E Cray computers have been made in collaboration with IDRIS and CNRS. 
     234The present implementation is largely inspired by Guyon's work [Guyon 1995]. 
     235 
     236The parallelization strategy is defined by the physical characteristics of the ocean model. 
     237Second order finite difference schemes lead to local discrete operators that 
     238depend at the very most on one neighbouring point. 
     239The only non-local computations concern the vertical physics 
     240(implicit diffusion, turbulent closure scheme, ...) (delocalization over the whole water column), 
     241and the solving of the elliptic equation associated with the surface pressure gradient computation 
     242(delocalization over the whole horizontal domain). 
     243Therefore, a pencil strategy is used for the data sub-structuration: 
     244the 3D initial domain is laid out on local processor memories following a 2D horizontal topological splitting. 
     245Each sub-domain computes its own surface and bottom boundary conditions and 
     246has a side wall overlapping interface which defines the lateral boundary conditions for 
     247computations in the inner sub-domain. 
     248The overlapping area consists of the two rows at each edge of the sub-domain. 
     249After a computation, a communication phase starts: 
     250each processor sends to its neighbouring processors the update values of the points corresponding to 
     251the interior overlapping area to its neighbouring sub-domain ($i.e.$ the innermost of the two overlapping rows). 
     252The communication is done through the Message Passing Interface (MPI). 
     253The data exchanges between processors are required at the very place where 
     254lateral domain boundary conditions are set in the mono-domain computation: 
     255the \rou{lbc\_lnk} routine (found in \mdl{lbclnk} module) which manages such conditions is interfaced with 
     256routines found in \mdl{lib\_mpp} module when running on an MPP computer ($i.e.$ when \key{mpp\_mpi} defined). 
     257It has to be pointed out that when using the MPP version of the model, 
     258the east-west cyclic boundary condition is done implicitly, 
    256259whilst the south-symmetric boundary condition option is not available. 
    257260 
     
    259262\begin{figure}[!t]    \begin{center} 
    260263\includegraphics[width=0.90\textwidth]{Fig_mpp} 
    261 \caption{   \protect\label{fig:mpp}  
    262 Positioning of a sub-domain when massively parallel processing is used. } 
     264\caption{   \protect\label{fig:mpp} 
     265  Positioning of a sub-domain when massively parallel processing is used. } 
    263266\end{center}   \end{figure} 
    264267%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    265268 
    266269In the standard version of \NEMO, the splitting is regular and arithmetic. 
    267 The i-axis is divided by \jp{jpni} and the j-axis by \jp{jpnj} for a number of processors  
    268 \jp{jpnij} most often equal to $jpni \times jpnj$ (parameters set in  
    269  \ngn{nammpp} namelist). Each processor is independent and without message passing  
    270  or synchronous process, programs run alone and access just its own local memory.  
    271  For this reason, the main model dimensions are now the local dimensions of the subdomain (pencil)  
    272  that are named \jp{jpi}, \jp{jpj}, \jp{jpk}. These dimensions include the internal  
    273  domain and the overlapping rows. The number of rows to exchange (known as  
    274  the halo) is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). The whole domain  
    275  dimensions are named \np{jpiglo}, \np{jpjglo} and \jp{jpk}. The relationship between  
    276  the whole domain and a sub-domain is: 
     270The i-axis is divided by \jp{jpni} and 
     271the j-axis by \jp{jpnj} for a number of processors \jp{jpnij} most often equal to $jpni \times jpnj$ 
     272(parameters set in  \ngn{nammpp} namelist). 
     273Each processor is independent and without message passing or synchronous process, 
     274programs run alone and access just its own local memory. 
     275For this reason, the main model dimensions are now the local dimensions of the subdomain (pencil) that 
     276are named \jp{jpi}, \jp{jpj}, \jp{jpk}. 
     277These dimensions include the internal domain and the overlapping rows. 
     278The number of rows to exchange (known as the halo) is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). 
     279The whole domain dimensions are named \np{jpiglo}, \np{jpjglo} and \jp{jpk}. 
     280The relationship between the whole domain and a sub-domain is: 
    277281\begin{eqnarray}  
    278282      jpi & = & ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci  \nonumber \\ 
     
    283287One also defines variables nldi and nlei which correspond to the internal domain bounds,  
    284288and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain.  
    285 An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$,  
     289An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$, 
    286290a global array (whole domain) by the relationship:  
    287291\begin{equation} \label{eq:lbc_nimpp} 
     
    290294with  $1 \leq i \leq jpi$, $1  \leq j \leq jpj $ , and  $1  \leq k \leq jpk$. 
    291295 
    292 Processors are numbered from 0 to $jpnij-1$, the number is saved in the variable  
    293 nproc. In the standard version, a processor has no more than four neighbouring  
    294 processors named nono (for north), noea (east), noso (south) and nowe (west)  
    295 and two variables, nbondi and nbondj, indicate the relative position of the processor : 
     296Processors are numbered from 0 to $jpnij-1$, the number is saved in the variable nproc. 
     297In the standard version, a processor has no more than 
     298four neighbouring processors named nono (for north), noea (east), noso (south) and nowe (west) and 
     299two variables, nbondi and nbondj, indicate the relative position of the processor: 
    296300\begin{itemize} 
    297301\item       nbondi = -1    an east neighbour, no west processor, 
     
    300304\item       nbondi =  2    no splitting following the i-axis. 
    301305\end{itemize} 
    302 During the simulation, processors exchange data with their neighbours.  
    303 If there is effectively a neighbour, the processor receives variables from this  
    304 processor on its overlapping row, and sends the data issued from internal  
    305 domain corresponding to the overlapping row of the other processor. 
    306  
    307  
    308 The \NEMO model computes equation terms with the help of mask arrays (0 on land  
    309 points and 1 on sea points). It is easily readable and very efficient in the context of  
    310 a computer with vectorial architecture. However, in the case of a scalar processor,  
    311 computations over the land regions become more expensive in terms of CPU time.  
    312 It is worse when we use a complex configuration with a realistic bathymetry like the  
    313 global ocean where more than 50 \% of points are land points. For this reason, a  
    314 pre-processing tool can be used to choose the mpp domain decomposition with a  
    315 maximum number of only land points processors, which can then be eliminated (\autoref{fig:mppini2}) 
    316 (For example, the mpp\_optimiz tools, available from the DRAKKAR web site).  
    317 This optimisation is dependent on the specific bathymetry employed. The user  
    318 then chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with  
    319 $jpnij < jpni \times jpnj$, leading to the elimination of $jpni \times jpnj - jpnij$  
    320 land processors. When those parameters are specified in \ngn{nammpp} namelist,  
    321 the algorithm in the \rou{inimpp2} routine sets each processor's parameters (nbound,  
    322 nono, noea,...) so that the land-only processors are not taken into account.  
     306During the simulation, processors exchange data with their neighbours. 
     307If there is effectively a neighbour, the processor receives variables from this processor on its overlapping row, 
     308and sends the data issued from internal domain corresponding to the overlapping row of the other processor. 
     309 
     310 
     311The \NEMO model computes equation terms with the help of mask arrays (0 on land points and 1 on sea points). 
     312It is easily readable and very efficient in the context of a computer with vectorial architecture. 
     313However, in the case of a scalar processor, computations over the land regions become more expensive in 
     314terms of CPU time.  
     315It is worse when we use a complex configuration with a realistic bathymetry like the global ocean where 
     316more than 50 \% of points are land points. 
     317For this reason, a pre-processing tool can be used to choose the mpp domain decomposition with a maximum number of 
     318only land points processors, which can then be eliminated (\autoref{fig:mppini2}) 
     319(For example, the mpp\_optimiz tools, available from the DRAKKAR web site). 
     320This optimisation is dependent on the specific bathymetry employed. 
     321The user then chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with $jpnij < jpni \times jpnj$, 
     322leading to the elimination of $jpni \times jpnj - jpnij$ land processors. 
     323When those parameters are specified in \ngn{nammpp} namelist, 
     324the algorithm in the \rou{inimpp2} routine sets each processor's parameters (nbound, nono, noea,...) so that 
     325the land-only processors are not taken into account. 
    323326 
    324327\gmcomment{Note that the inimpp2 routine is general so that the original inimpp  
    325328routine should be suppressed from the code.} 
    326329 
    327 When land processors are eliminated, the value corresponding to these locations in  
    328 the model output files is undefined. Note that this is a problem for the meshmask file  
    329 which requires to be defined over the whole domain. Therefore, user should not eliminate  
    330 land processors when creating a meshmask file ($i.e.$ when setting a non-zero value to \np{nn\_msh}). 
     330When land processors are eliminated, 
     331the value corresponding to these locations in the model output files is undefined. 
     332Note that this is a problem for the meshmask file which requires to be defined over the whole domain. 
     333Therefore, user should not eliminate land processors when creating a meshmask file 
     334($i.e.$ when setting a non-zero value to \np{nn\_msh}). 
    331335 
    332336%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    334338\includegraphics[width=0.90\textwidth]{Fig_mppini2} 
    335339\caption {    \protect\label{fig:mppini2} 
    336 Example of Atlantic domain defined for the CLIPPER projet. Initial grid is  
    337 composed of 773 x 1236 horizontal points.  
    338 (a) the domain is split onto 9 \time 20 subdomains (jpni=9, jpnj=20).  
    339 52 subdomains are land areas.  
    340 (b) 52 subdomains are eliminated (white rectangles) and the resulting number  
    341 of processors really used during the computation is jpnij=128.} 
     340  Example of Atlantic domain defined for the CLIPPER projet. 
     341  Initial grid is composed of 773 x 1236 horizontal points. 
     342  (a) the domain is split onto 9 \time 20 subdomains (jpni=9, jpnj=20). 
     343  52 subdomains are land areas. 
     344  (b) 52 subdomains are eliminated (white rectangles) and 
     345  the resulting number of processors really used during the computation is jpnij=128.} 
    342346\end{center}   \end{figure} 
    343347%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    354358\nlst{nambdy}  
    355359%----------------------------------------------------------------------------------------------- 
    356 %-----------------------------------------nambdy_index-------------------------------------------- 
    357 % 
    358 %\nlst{nambdy_index} 
    359 %----------------------------------------------------------------------------------------------- 
    360360%-----------------------------------------nambdy_dta-------------------------------------------- 
    361361 
    362362\nlst{nambdy_dta}  
    363363%----------------------------------------------------------------------------------------------- 
    364 %-----------------------------------------nambdy_dta-------------------------------------------- 
    365 % 
    366 %\nlst{nambdy_dta2}  
    367 %----------------------------------------------------------------------------------------------- 
    368  
    369 Options are defined through the \ngn{nambdy} \ngn{nambdy\_index}  
    370 \ngn{nambdy\_dta} \ngn{nambdy\_dta2} namelist variables. 
    371 The BDY module is the core implementation of open boundary 
    372 conditions for regional configurations. It implements the Flow 
    373 Relaxation Scheme algorithm for temperature, salinity, velocities and 
    374 ice fields, and the Flather radiation condition for the depth-mean 
    375 transports. The specification of the location of the open boundary is 
    376 completely flexible and allows for example the open boundary to follow 
    377 an isobath or other irregular contour.  
    378  
    379 The BDY module was modelled on the OBC module (see NEMO 3.4) and shares many 
    380 features and a similar coding structure \citep{Chanut2005}. 
    381  
    382 Boundary data files used with earlier versions of NEMO may need 
    383 to be re-ordered to work with this version. See the 
    384 section on the Input Boundary Data Files for details. 
     364 
     365Options are defined through the \ngn{nambdy} \ngn{nambdy\_dta} namelist variables. 
     366The BDY module is the core implementation of open boundary conditions for regional configurations. 
     367It implements the Flow Relaxation Scheme algorithm for temperature, salinity, velocities and ice fields, and 
     368the Flather radiation condition for the depth-mean transports. 
     369The specification of the location of the open boundary is completely flexible and 
     370allows for example the open boundary to follow an isobath or other irregular contour.  
     371 
     372The BDY module was modelled on the OBC module (see NEMO 3.4) and shares many features and 
     373a similar coding structure \citep{Chanut2005}. 
     374 
     375Boundary data files used with earlier versions of NEMO may need to be re-ordered to work with this version. 
     376See the section on the Input Boundary Data Files for details. 
    385377 
    386378%---------------------------------------------- 
     
    389381 
    390382The BDY module is activated by setting \np{ln\_bdy} to true. 
    391 It is possible to define more than one boundary ``set'' and apply 
    392 different boundary conditions to each set. The number of boundary 
    393 sets is defined by \np{nb\_bdy}.  Each boundary set may be defined 
    394 as a set of straight line segments in a namelist 
    395 (\np{ln\_coords\_file}\forcode{ = .false.}) or read in from a file 
    396 (\np{ln\_coords\_file}\forcode{ = .true.}). If the set is defined in a namelist, 
    397 then the namelists nambdy\_index must be included separately, one for 
    398 each set. If the set is defined by a file, then a 
    399 ``\ifile{coordinates.bdy}'' file must be provided. The coordinates.bdy file 
    400 is analagous to the usual NEMO ``\ifile{coordinates}'' file. In the example 
    401 above, there are two boundary sets, the first of which is defined via 
    402 a file and the second is defined in a namelist. For more details of 
    403 the definition of the boundary geometry see section 
    404 \autoref{subsec:BDY_geometry}. 
    405  
    406 For each boundary set a boundary 
    407 condition has to be chosen for the barotropic solution (``u2d'': 
    408 sea-surface height and barotropic velocities), for the baroclinic 
    409 velocities (``u3d''), and for the active tracers\footnote{The BDY 
    410   module does not deal with passive tracers at this version} 
    411 (``tra''). For each set of variables there is a choice of algorithm 
    412 and a choice for the data, eg. for the active tracers the algorithm is 
    413 set by \np{nn\_tra} and the choice of data is set by 
    414 \np{nn\_tra\_dta}.  
     383It is possible to define more than one boundary ``set'' and apply different boundary conditions to each set. 
     384The number of boundary sets is defined by \np{nb\_bdy}. 
     385Each boundary set may be defined as a set of straight line segments in a namelist 
     386(\np{ln\_coords\_file}\forcode{ = .false.}) or read in from a file (\np{ln\_coords\_file}\forcode{ = .true.}). 
     387If the set is defined in a namelist, then the namelists nambdy\_index must be included separately, one for each set. 
     388If the set is defined by a file, then a ``\ifile{coordinates.bdy}'' file must be provided. 
     389The coordinates.bdy file is analagous to the usual NEMO ``\ifile{coordinates}'' file. 
     390In the example above, there are two boundary sets, the first of which is defined via a file and 
     391the second is defined in a namelist. 
     392For more details of the definition of the boundary geometry see section \autoref{subsec:BDY_geometry}. 
     393 
     394For each boundary set a boundary condition has to be chosen for the barotropic solution 
     395(``u2d'':sea-surface height and barotropic velocities), for the baroclinic velocities (``u3d''), and 
     396for the active tracers \footnote{The BDY module does not deal with passive tracers at this version} (``tra''). 
     397For each set of variables there is a choice of algorithm and a choice for the data, 
     398eg. for the active tracers the algorithm is set by \np{nn\_tra} and the choice of data is set by \np{nn\_tra\_dta}.  
    415399 
    416400The choice of algorithm is currently as follows: 
     
    419403 
    420404\begin{itemize} 
    421 \item[0.] No boundary condition applied. So the solution will ``see'' 
    422   the land points around the edge of the edge of the domain. 
    423 \item[1.] Flow Relaxation Scheme (FRS) available for all variables.  
    424 \item[2.] Flather radiation scheme for the barotropic variables. The 
    425   Flather scheme is not compatible with the filtered free surface 
     405\item[0.] No boundary condition applied. 
     406  So the solution will ``see'' the land points around the edge of the edge of the domain. 
     407\item[1.] Flow Relaxation Scheme (FRS) available for all variables. 
     408\item[2.] Flather radiation scheme for the barotropic variables. 
     409  The Flather scheme is not compatible with the filtered free surface 
    426410  ({\it dynspg\_ts}).  
    427411\end{itemize} 
     
    429413\mbox{} 
    430414 
    431 The main choice for the boundary data is 
    432 to use initial conditions as boundary data (\np{nn\_tra\_dta}\forcode{ = 0}) or to 
    433 use external data from a file (\np{nn\_tra\_dta}\forcode{ = 1}). For the 
    434 barotropic solution there is also the option to use tidal 
    435 harmonic forcing either by itself or in addition to other external 
    436 data.  
    437  
    438 If external boundary data is required then the nambdy\_dta namelist 
    439 must be defined. One nambdy\_dta namelist is required for each boundary 
    440 set in the order in which the boundary sets are defined in nambdy. In 
    441 the example given, two boundary sets have been defined and so there 
    442 are two nambdy\_dta namelists. The boundary data is read in using the 
    443 fldread module, so the nambdy\_dta namelist is in the format required 
    444 for fldread. For each variable required, the filename, the frequency 
    445 of the files and the frequency of the data in the files is given. Also 
    446 whether or not time-interpolation is required and whether the data is 
    447 climatological (time-cyclic) data. Note that on-the-fly spatial 
    448 interpolation of boundary data is not available at this version.  
    449  
    450 In the example namelists given, two boundary sets are defined. The 
    451 first set is defined via a file and applies FRS conditions to 
    452 temperature and salinity and Flather conditions to the barotropic 
    453 variables. External data is provided in daily files (from a 
    454 large-scale model). Tidal harmonic forcing is also used. The second 
    455 set is defined in a namelist. FRS conditions are applied on 
    456 temperature and salinity and climatological data is read from external 
    457 files.  
     415The main choice for the boundary data is to use initial conditions as boundary data 
     416(\np{nn\_tra\_dta}\forcode{ = 0}) or to use external data from a file (\np{nn\_tra\_dta}\forcode{ = 1}). 
     417For the barotropic solution there is also the option to use tidal harmonic forcing either by 
     418itself or in addition to other external data.  
     419 
     420If external boundary data is required then the nambdy\_dta namelist must be defined. 
     421One nambdy\_dta namelist is required for each boundary set in the order in which 
     422the boundary sets are defined in nambdy. 
     423In the example given, two boundary sets have been defined and so there are two nambdy\_dta namelists. 
     424The boundary data is read in using the fldread module, 
     425so the nambdy\_dta namelist is in the format required for fldread. 
     426For each variable required, the filename, the frequency of the files and 
     427the frequency of the data in the files is given. 
     428Also whether or not time-interpolation is required and whether the data is climatological (time-cyclic) data. 
     429Note that on-the-fly spatial interpolation of boundary data is not available at this version.  
     430 
     431In the example namelists given, two boundary sets are defined. 
     432The first set is defined via a file and applies FRS conditions to temperature and salinity and 
     433Flather conditions to the barotropic variables. 
     434External data is provided in daily files (from a large-scale model). 
     435Tidal harmonic forcing is also used. 
     436The second set is defined in a namelist. 
     437FRS conditions are applied on temperature and salinity and climatological data is read from external files.  
    458438 
    459439%---------------------------------------------- 
     
    462442 
    463443The Flow Relaxation Scheme (FRS) \citep{Davies_QJRMS76,Engerdahl_Tel95}, 
    464 applies a simple relaxation of the model fields to 
    465 externally-specified values over a zone next to the edge of the model 
    466 domain. Given a model prognostic variable $\Phi$  
     444applies a simple relaxation of the model fields to externally-specified values over 
     445a zone next to the edge of the model domain. 
     446Given a model prognostic variable $\Phi$ 
    467447\begin{equation}  \label{eq:bdy_frs1} 
    468448\Phi(d) = \alpha(d)\Phi_{e}(d) + (1-\alpha(d))\Phi_{m}(d)\;\;\;\;\; d=1,N 
    469449\end{equation} 
    470 where $\Phi_{m}$ is the model solution and $\Phi_{e}$ is the specified 
    471 external field, $d$ gives the discrete distance from the model 
    472 boundary  and $\alpha$ is a parameter that varies from $1$ at $d=1$ to 
    473 a small value at $d=N$. It can be shown that this scheme is equivalent 
    474 to adding a relaxation term to the prognostic equation for $\Phi$ of 
    475 the form: 
     450where $\Phi_{m}$ is the model solution and $\Phi_{e}$ is the specified external field, 
     451$d$ gives the discrete distance from the model boundary and 
     452$\alpha$ is a parameter that varies from $1$ at $d=1$ to a small value at $d=N$. 
     453It can be shown that this scheme is equivalent to adding a relaxation term to 
     454the prognostic equation for $\Phi$ of the form: 
    476455\begin{equation}  \label{eq:bdy_frs2} 
    477456-\frac{1}{\tau}\left(\Phi - \Phi_{e}\right) 
    478457\end{equation} 
    479 where the relaxation time scale $\tau$ is given by a function of 
    480 $\alpha$ and the model time step $\Delta t$: 
     458where the relaxation time scale $\tau$ is given by a function of $\alpha$ and the model time step $\Delta t$: 
    481459\begin{equation}  \label{eq:bdy_frs3} 
    482460\tau = \frac{1-\alpha}{\alpha}  \,\rdt 
    483461\end{equation} 
    484 Thus the model solution is completely prescribed by the external 
    485 conditions at the edge of the model domain and is relaxed towards the 
    486 external conditions over the rest of the FRS zone. The application of 
    487 a relaxation zone helps to prevent spurious reflection of outgoing 
    488 signals from the model boundary.  
     462Thus the model solution is completely prescribed by the external conditions at the edge of the model domain and 
     463is relaxed towards the external conditions over the rest of the FRS zone. 
     464The application of a relaxation zone helps to prevent spurious reflection of 
     465outgoing signals from the model boundary.  
    489466 
    490467The function $\alpha$ is specified as a $tanh$ function: 
     
    492469\alpha(d) = 1 - \tanh\left(\frac{d-1}{2}\right),       \quad d=1,N 
    493470\end{equation} 
    494 The width of the FRS zone is specified in the namelist as  
    495 \np{nn\_rimwidth}. This is typically set to a value between 8 and 10.  
     471The width of the FRS zone is specified in the namelist as \np{nn\_rimwidth}. 
     472This is typically set to a value between 8 and 10. 
    496473 
    497474%---------------------------------------------- 
     
    499476\label{subsec:BDY_flather_scheme} 
    500477 
    501 The \citet{Flather_JPO94} scheme is a radiation condition on the normal, depth-mean 
    502 transport across the open boundary. It takes the form 
     478The \citet{Flather_JPO94} scheme is a radiation condition on the normal, 
     479depth-mean transport across the open boundary. 
     480It takes the form 
    503481\begin{equation}  \label{eq:bdy_fla1} 
    504482U = U_{e} + \frac{c}{h}\left(\eta - \eta_{e}\right), 
    505483\end{equation} 
    506 where $U$ is the depth-mean velocity normal to the boundary and $\eta$ 
    507 is the sea surface height, both from the model. The subscript $e$ 
    508 indicates the same fields from external sources. The speed of external 
    509 gravity waves is given by $c = \sqrt{gh}$, and $h$ is the depth of the 
    510 water column. The depth-mean normal velocity along the edge of the 
    511 model domain is set equal to the 
    512 external depth-mean normal velocity, plus a correction term that 
    513 allows gravity waves generated internally to exit the model boundary. 
    514 Note that the sea-surface height gradient in \autoref{eq:bdy_fla1} 
    515 is a spatial gradient across the model boundary, so that $\eta_{e}$ is 
    516 defined on the $T$ points with $nbr=1$ and $\eta$ is defined on the 
    517 $T$ points with $nbr=2$. $U$ and $U_{e}$ are defined on the $U$ or 
    518 $V$ points with $nbr=1$, $i.e.$ between the two $T$ grid points. 
     484where $U$ is the depth-mean velocity normal to the boundary and $\eta$ is the sea surface height, 
     485both from the model. 
     486The subscript $e$ indicates the same fields from external sources. 
     487The speed of external gravity waves is given by $c = \sqrt{gh}$, and $h$ is the depth of the water column. 
     488The depth-mean normal velocity along the edge of the model domain is set equal to 
     489the external depth-mean normal velocity, 
     490plus a correction term that allows gravity waves generated internally to exit the model boundary. 
     491Note that the sea-surface height gradient in \autoref{eq:bdy_fla1} is a spatial gradient across the model boundary, 
     492so that $\eta_{e}$ is defined on the $T$ points with $nbr=1$ and $\eta$ is defined on the $T$ points with $nbr=2$. 
     493$U$ and $U_{e}$ are defined on the $U$ or $V$ points with $nbr=1$, $i.e.$ between the two $T$ grid points. 
    519494 
    520495%---------------------------------------------- 
     
    522497\label{subsec:BDY_geometry} 
    523498 
    524 Each open boundary set is defined as a list of points. The information 
    525 is stored in the arrays $nbi$, $nbj$, and $nbr$ in the $idx\_bdy$ 
    526 structure.  The $nbi$ and $nbj$ arrays 
    527 define the local $(i,j)$ indices of each point in the boundary zone 
    528 and the $nbr$ array defines the discrete distance from the boundary 
    529 with $nbr=1$ meaning that the point is next to the edge of the 
    530 model domain and $nbr>1$ showing that the point is increasingly 
    531 further away from the edge of the model domain. A set of $nbi$, $nbj$, 
    532 and $nbr$ arrays is defined for each of the $T$, $U$ and $V$ 
    533 grids. Figure \autoref{fig:LBC_bdy_geom} shows an example of an irregular 
    534 boundary.  
    535  
    536 The boundary geometry for each set may be defined in a namelist 
    537 nambdy\_index or by reading in a ``\ifile{coordinates.bdy}'' file. The 
    538 nambdy\_index namelist defines a series of straight-line segments for 
    539 north, east, south and west boundaries. For the northern boundary, 
    540 \np{nbdysegn} gives the number of segments, \np{jpjnob} gives the $j$ 
    541 index for each segment and \np{jpindt} and \np{jpinft} give the start 
    542 and end $i$ indices for each segment with similar for the other 
    543 boundaries. These segments define a list of $T$ grid points along the 
    544 outermost row of the boundary ($nbr\,=\, 1$). The code deduces the $U$ and 
    545 $V$ points and also the points for $nbr\,>\, 1$ if 
    546 $nn\_rimwidth\,>\,1$. 
    547  
    548 The boundary geometry may also be defined from a 
    549 ``\ifile{coordinates.bdy}'' file. Figure \autoref{fig:LBC_nc_header} 
    550 gives an example of the header information from such a file. The file 
    551 should contain the index arrays for each of the $T$, $U$ and $V$ 
    552 grids. The arrays must be in order of increasing $nbr$. Note that the 
    553 $nbi$, $nbj$ values in the file are global values and are converted to 
    554 local values in the code. Typically this file will be used to generate 
    555 external boundary data via interpolation and so will also contain the 
    556 latitudes and longitudes of each point as shown. However, this is not 
    557 necessary to run the model.  
    558  
    559 For some choices of irregular boundary the model domain may contain 
    560 areas of ocean which are not part of the computational domain. For 
    561 example if an open boundary is defined along an isobath, say at the 
    562 shelf break, then the areas of ocean outside of this boundary will 
    563 need to be masked out. This can be done by reading a mask file defined 
    564 as \np{cn\_mask\_file} in the nam\_bdy namelist. Only one mask file is 
    565 used even if multiple boundary sets are defined. 
     499Each open boundary set is defined as a list of points. 
     500The information is stored in the arrays $nbi$, $nbj$, and $nbr$ in the $idx\_bdy$ structure. 
     501The $nbi$ and $nbj$ arrays define the local $(i,j)$ indices of each point in the boundary zone and 
     502the $nbr$ array defines the discrete distance from the boundary with $nbr=1$ meaning that 
     503the point is next to the edge of the model domain and $nbr>1$ showing that 
     504the point is increasingly further away from the edge of the model domain. 
     505A set of $nbi$, $nbj$, and $nbr$ arrays is defined for each of the $T$, $U$ and $V$ grids. 
     506Figure \autoref{fig:LBC_bdy_geom} shows an example of an irregular boundary.  
     507 
     508The boundary geometry for each set may be defined in a namelist nambdy\_index or 
     509by reading in a ``\ifile{coordinates.bdy}'' file. 
     510The nambdy\_index namelist defines a series of straight-line segments for north, east, south and west boundaries. 
     511For the northern boundary, \np{nbdysegn} gives the number of segments, 
     512\np{jpjnob} gives the $j$ index for each segment and \np{jpindt} and 
     513\np{jpinft} give the start and end $i$ indices for each segment with similar for the other boundaries. 
     514These segments define a list of $T$ grid points along the outermost row of the boundary ($nbr\,=\, 1$). 
     515The code deduces the $U$ and $V$ points and also the points for $nbr\,>\, 1$ if $nn\_rimwidth\,>\,1$. 
     516 
     517The boundary geometry may also be defined from a ``\ifile{coordinates.bdy}'' file. 
     518Figure \autoref{fig:LBC_nc_header} gives an example of the header information from such a file. 
     519The file should contain the index arrays for each of the $T$, $U$ and $V$ grids. 
     520The arrays must be in order of increasing $nbr$. 
     521Note that the $nbi$, $nbj$ values in the file are global values and are converted to local values in the code. 
     522Typically this file will be used to generate external boundary data via interpolation and so 
     523will also contain the latitudes and longitudes of each point as shown. 
     524However, this is not necessary to run the model.  
     525 
     526For some choices of irregular boundary the model domain may contain areas of ocean which 
     527are not part of the computational domain. 
     528For example if an open boundary is defined along an isobath, say at the shelf break, 
     529then the areas of ocean outside of this boundary will need to be masked out. 
     530This can be done by reading a mask file defined as \np{cn\_mask\_file} in the nam\_bdy namelist. 
     531Only one mask file is used even if multiple boundary sets are defined. 
    566532 
    567533%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    569535\includegraphics[width=1.0\textwidth]{Fig_LBC_bdy_geom} 
    570536\caption {      \protect\label{fig:LBC_bdy_geom} 
    571 Example of geometry of unstructured open boundary} 
     537  Example of geometry of unstructured open boundary} 
    572538\end{center}   \end{figure} 
    573539%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    577543\label{subsec:BDY_data} 
    578544 
    579 The data files contain the data arrays 
    580 in the order in which the points are defined in the $nbi$ and $nbj$ 
    581 arrays. The data arrays are dimensioned on: a time dimension; 
     545The data files contain the data arrays in the order in which the points are defined in the $nbi$ and $nbj$ arrays. 
     546The data arrays are dimensioned on: 
     547a time dimension; 
    582548$xb$ which is the index of the boundary data point in the horizontal; 
    583 and $yb$ which is a degenerate dimension of 1 to enable the file to be 
    584 read by the standard NEMO I/O routines. The 3D fields also have a 
    585 depth dimension.  
    586  
    587 At Version 3.4 there are new restrictions on the order in which the 
    588 boundary points are defined (and therefore restrictions on the order 
    589 of the data in the file). In particular: 
     549and $yb$ which is a degenerate dimension of 1 to enable the file to be read by the standard NEMO I/O routines. 
     550The 3D fields also have a depth dimension.  
     551 
     552At Version 3.4 there are new restrictions on the order in which the boundary points are defined 
     553(and therefore restrictions on the order of the data in the file). 
     554In particular: 
    590555 
    591556\mbox{} 
    592557 
    593558\begin{enumerate} 
    594 \item The data points must be in order of increasing $nbr$, ie. all 
    595   the $nbr=1$ points, then all the $nbr=2$ points etc. 
    596 \item All the data for a particular boundary set must be in the same 
    597   order. (Prior to 3.4 it was possible to define barotropic data in a 
    598   different order to the data for tracers and baroclinic velocities).  
     559\item The data points must be in order of increasing $nbr$, 
     560  ie. all the $nbr=1$ points, then all the $nbr=2$ points etc. 
     561\item All the data for a particular boundary set must be in the same order. 
     562  (Prior to 3.4 it was possible to define barotropic data in a different order to 
     563  the data for tracers and baroclinic velocities).  
    599564\end{enumerate} 
    600565 
    601566\mbox{} 
    602567 
    603 These restrictions mean that data files used with previous versions of 
    604 the model may not work with version 3.4. A fortran utility 
    605 {\it bdy\_reorder} exists in the TOOLS directory which will re-order the 
    606 data in old BDY data files.  
     568These restrictions mean that data files used with previous versions of the model may not work with version 3.4. 
     569A fortran utility {\it bdy\_reorder} exists in the TOOLS directory which 
     570will re-order the data in old BDY data files.  
    607571 
    608572%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    609573\begin{figure}[!t]     \begin{center} 
    610574\includegraphics[width=1.0\textwidth]{Fig_LBC_nc_header} 
    611 \caption {     \protect\label{fig:LBC_nc_header}  
    612 Example of the header for a \protect\ifile{coordinates.bdy} file} 
     575\caption {     \protect\label{fig:LBC_nc_header} 
     576  Example of the header for a \protect\ifile{coordinates.bdy} file} 
    613577\end{center}   \end{figure} 
    614578%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    618582\label{subsec:BDY_vol_corr} 
    619583 
    620 There is an option to force the total volume in the regional model to be constant,  
    621 similar to the option in the OBC module. This is controlled  by the \np{nn\_volctl}  
    622 parameter in the namelist. A value of \np{nn\_volctl}\forcode{ = 0} indicates that this option is not used.  
    623 If  \np{nn\_volctl}\forcode{ = 1} then a correction is applied to the normal velocities  
    624 around the boundary at each timestep to ensure that the integrated volume flow  
    625 through the boundary is zero. If \np{nn\_volctl}\forcode{ = 2} then the calculation of  
    626 the volume change on the timestep includes the change due to the freshwater  
    627 flux across the surface and the correction velocity corrects for this as well. 
     584There is an option to force the total volume in the regional model to be constant, 
     585similar to the option in the OBC module. 
     586This is controlled  by the \np{nn\_volctl} parameter in the namelist. 
     587A value of \np{nn\_volctl}\forcode{ = 0} indicates that this option is not used. 
     588If \np{nn\_volctl}\forcode{ = 1} then a correction is applied to the normal velocities around the boundary at 
     589each timestep to ensure that the integrated volume flow through the boundary is zero. 
     590If \np{nn\_volctl}\forcode{ = 2} then the calculation of the volume change on 
     591the timestep includes the change due to the freshwater flux across the surface and 
     592the correction velocity corrects for this as well. 
    628593 
    629594If more than one boundary set is used then volume correction is 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_LDF.tex

    r10146 r10368  
    1414 
    1515 
    16 The lateral physics terms in the momentum and tracer equations have been  
    17 described in \autoref{eq:PE_zdf} and their discrete formulation in \autoref{sec:TRA_ldf}  
    18 and \autoref{sec:DYN_ldf}). In this section we further discuss each lateral physics option.  
    19 Choosing one lateral physics scheme means for the user defining,  
    20 (1) the type of operator used (laplacian or bilaplacian operators, or no lateral mixing term) ;  
    21 (2) the direction along which the lateral diffusive fluxes are evaluated (model level, geopotential or isopycnal surfaces) ; and  
    22 (3) the space and time variations of the eddy coefficients.  
    23 These three aspects of the lateral diffusion are set through namelist parameters  
    24 (see the \textit{\ngn{nam\_traldf}} and \textit{\ngn{nam\_dynldf}} below).  
    25 Note that this chapter describes the standard implementation of iso-neutral 
    26 tracer mixing, and Griffies's implementation, which is used if 
    27 \np{traldf\_grif}\forcode{ = .true.}, is described in Appdx\autoref{apdx:triad} 
     16The lateral physics terms in the momentum and tracer equations have been described in \autoref{eq:PE_zdf} and 
     17their discrete formulation in \autoref{sec:TRA_ldf} and \autoref{sec:DYN_ldf}). 
     18In this section we further discuss each lateral physics option. 
     19Choosing one lateral physics scheme means for the user defining, 
     20(1) the type of operator used (laplacian or bilaplacian operators, or no lateral mixing term); 
     21(2) the direction along which the lateral diffusive fluxes are evaluated 
     22(model level, geopotential or isopycnal surfaces); and 
     23(3) the space and time variations of the eddy coefficients. 
     24These three aspects of the lateral diffusion are set through namelist parameters 
     25(see the \textit{\ngn{nam\_traldf}} and \textit{\ngn{nam\_dynldf}} below). 
     26Note that this chapter describes the standard implementation of iso-neutral tracer mixing, 
     27and Griffies's implementation, which is used if \np{traldf\_grif}\forcode{ = .true.}, 
     28is described in Appdx\autoref{apdx:triad} 
    2829 
    2930%-----------------------------------nam_traldf - nam_dynldf-------------------------------------------- 
     
    4546Better work can be achieved by using \citet{Griffies_al_JPO98, Griffies_Bk04} iso-neutral scheme. } 
    4647 
    47 A direction for lateral mixing has to be defined when the desired operator does  
    48 not act along the model levels. This occurs when $(a)$ horizontal mixing is  
    49 required on tracer or momentum (\np{ln\_traldf\_hor} or \np{ln\_dynldf\_hor})  
    50 in $s$- or mixed $s$-$z$- coordinates, and $(b)$ isoneutral mixing is required  
    51 whatever the vertical coordinate is. This direction of mixing is defined by its  
    52 slopes in the \textbf{i}- and \textbf{j}-directions at the face of the cell of the  
    53 quantity to be diffused. For a tracer, this leads to the following four slopes :  
    54 $r_{1u}$, $r_{1w}$, $r_{2v}$, $r_{2w}$ (see \autoref{eq:tra_ldf_iso}), while  
    55 for momentum the slopes are  $r_{1t}$, $r_{1uw}$, $r_{2f}$, $r_{2uw}$ for  
    56 $u$ and  $r_{1f}$, $r_{1vw}$, $r_{2t}$, $r_{2vw}$ for $v$.  
     48A direction for lateral mixing has to be defined when the desired operator does not act along the model levels. 
     49This occurs when $(a)$ horizontal mixing is required on tracer or momentum 
     50(\np{ln\_traldf\_hor} or \np{ln\_dynldf\_hor}) in $s$- or mixed $s$-$z$- coordinates, 
     51and $(b)$ isoneutral mixing is required whatever the vertical coordinate is. 
     52This direction of mixing is defined by its slopes in the \textbf{i}- and \textbf{j}-directions at the face of 
     53the cell of the quantity to be diffused. 
     54For a tracer, this leads to the following four slopes: 
     55$r_{1u}$, $r_{1w}$, $r_{2v}$, $r_{2w}$ (see \autoref{eq:tra_ldf_iso}), 
     56while for momentum the slopes are  $r_{1t}$, $r_{1uw}$, $r_{2f}$, $r_{2uw}$ for $u$ and 
     57$r_{1f}$, $r_{1vw}$, $r_{2t}$, $r_{2vw}$ for $v$.  
    5758 
    5859%gm% add here afigure of the slope in i-direction 
     
    6061\subsection{Slopes for tracer geopotential mixing in the $s$-coordinate} 
    6162 
    62 In $s$-coordinates, geopotential mixing ($i.e.$ horizontal mixing) $r_1$ and  
    63 $r_2$ are the slopes between the geopotential and computational surfaces.  
    64 Their discrete formulation is found by locally solving \autoref{eq:tra_ldf_iso}  
    65 when the diffusive fluxes in the three directions are set to zero and $T$ is  
    66 assumed to be horizontally uniform, $i.e.$ a linear function of $z_T$, the  
    67 depth of a $T$-point.  
     63In $s$-coordinates, geopotential mixing ($i.e.$ horizontal mixing) $r_1$ and $r_2$ are the slopes between 
     64the geopotential and computational surfaces. 
     65Their discrete formulation is found by locally solving \autoref{eq:tra_ldf_iso} when 
     66the diffusive fluxes in the three directions are set to zero and $T$ is assumed to be horizontally uniform, 
     67$i.e.$ a linear function of $z_T$, the depth of a $T$-point.  
    6868%gm { Steven : My version is obviously wrong since I'm left with an arbitrary constant which is the local vertical temperature gradient} 
    6969 
     
    8989%gm%  caution I'm not sure the simplification was a good idea!  
    9090 
    91 These slopes are computed once in \rou{ldfslp\_init} when \np{ln\_sco}\forcode{ = .true.}rue,  
    92 and either \np{ln\_traldf\_hor}\forcode{ = .true.}rue or \np{ln\_dynldf\_hor}\forcode{ = .true.}rue.  
     91These slopes are computed once in \rou{ldfslp\_init} when \np{ln\_sco}\forcode{ = .true.}rue, 
     92and either \np{ln\_traldf\_hor}\forcode{ = .true.} or \np{ln\_dynldf\_hor}\forcode{ = .true.}.  
    9393 
    9494\subsection{Slopes for tracer iso-neutral mixing} 
    9595\label{subsec:LDF_slp_iso} 
    96 In iso-neutral mixing  $r_1$ and $r_2$ are the slopes between the iso-neutral  
    97 and computational surfaces. Their formulation does not depend on the vertical  
    98 coordinate used. Their discrete formulation is found using the fact that the  
    99 diffusive fluxes of locally referenced potential density ($i.e.$ $in situ$ density)  
    100 vanish. So, substituting $T$ by $\rho$ in \autoref{eq:tra_ldf_iso} and setting the  
    101 diffusive fluxes in the three directions to zero leads to the following definition for  
    102 the neutral slopes: 
     96In iso-neutral mixing  $r_1$ and $r_2$ are the slopes between the iso-neutral and computational surfaces. 
     97Their formulation does not depend on the vertical coordinate used. 
     98Their discrete formulation is found using the fact that the diffusive fluxes of 
     99locally referenced potential density ($i.e.$ $in situ$ density) vanish. 
     100So, substituting $T$ by $\rho$ in \autoref{eq:tra_ldf_iso} and setting the diffusive fluxes in 
     101the three directions to zero leads to the following definition for the neutral slopes: 
    103102 
    104103\begin{equation} \label{eq:ldfslp_iso} 
     
    128127%In the $z$-coordinate, the derivative of the  \autoref{eq:ldfslp_iso} numerator is evaluated at the same depth \nocite{as what?} ($T$-level, which is the same as the $u$- and $v$-levels), so  the $in situ$ density can be used for its evaluation.  
    129128 
    130 As the mixing is performed along neutral surfaces, the gradient of $\rho$ in  
    131 \autoref{eq:ldfslp_iso} has to be evaluated at the same local pressure (which,  
    132 in decibars, is approximated by the depth in meters in the model). Therefore  
    133 \autoref{eq:ldfslp_iso} cannot be used as such, but further transformation is  
    134 needed depending on the vertical coordinate used: 
     129As the mixing is performed along neutral surfaces, the gradient of $\rho$ in \autoref{eq:ldfslp_iso} has to 
     130be evaluated at the same local pressure 
     131(which, in decibars, is approximated by the depth in meters in the model). 
     132Therefore \autoref{eq:ldfslp_iso} cannot be used as such, 
     133but further transformation is needed depending on the vertical coordinate used: 
    135134 
    136135\begin{description} 
    137136 
    138 \item[$z$-coordinate with full step : ] in \autoref{eq:ldfslp_iso} the densities  
    139 appearing in the $i$ and $j$ derivatives  are taken at the same depth, thus  
    140 the $in situ$ density can be used. This is not the case for the vertical  
    141 derivatives: $\delta_{k+1/2}[\rho]$ is replaced by $-\rho N^2/g$, where $N^2$  
    142 is the local Brunt-Vais\"{a}l\"{a} frequency evaluated following  
    143 \citet{McDougall1987} (see \autoref{subsec:TRA_bn2}).  
    144  
    145 \item[$z$-coordinate with partial step : ] this case is identical to the full step  
    146 case except that at partial step level, the \emph{horizontal} density gradient  
    147 is evaluated as described in \autoref{sec:TRA_zpshde}. 
    148  
    149 \item[$s$- or hybrid $s$-$z$- coordinate : ] in the current release of \NEMO,  
    150 iso-neutral mixing is only employed for $s$-coordinates if the 
    151 Griffies scheme is used (\np{traldf\_grif}\forcode{ = .true.}; see Appdx \autoref{apdx:triad}).  
    152 In other words, iso-neutral mixing will only be accurately represented with a  
    153 linear equation of state (\np{nn\_eos}\forcode{ = 1..2}). In the case of a "true" equation  
    154 of state, the evaluation of $i$ and $j$ derivatives in \autoref{eq:ldfslp_iso}  
    155 will include a pressure dependent part, leading to the wrong evaluation of  
    156 the neutral slopes. 
     137\item[$z$-coordinate with full step: ] 
     138  in \autoref{eq:ldfslp_iso} the densities appearing in the $i$ and $j$ derivatives  are taken at the same depth, 
     139  thus the $in situ$ density can be used. 
     140  This is not the case for the vertical derivatives: $\delta_{k+1/2}[\rho]$ is replaced by $-\rho N^2/g$, 
     141  where $N^2$ is the local Brunt-Vais\"{a}l\"{a} frequency evaluated following \citet{McDougall1987} 
     142  (see \autoref{subsec:TRA_bn2}).  
     143 
     144\item[$z$-coordinate with partial step: ] 
     145  this case is identical to the full step case except that at partial step level, 
     146  the \emph{horizontal} density gradient is evaluated as described in \autoref{sec:TRA_zpshde}. 
     147 
     148\item[$s$- or hybrid $s$-$z$- coordinate: ] 
     149  in the current release of \NEMO, iso-neutral mixing is only employed for $s$-coordinates if 
     150  the Griffies scheme is used (\np{traldf\_grif}\forcode{ = .true.}; 
     151  see Appdx \autoref{apdx:triad}). 
     152  In other words, iso-neutral mixing will only be accurately represented with a linear equation of state 
     153  (\np{nn\_eos}\forcode{ = 1..2}). 
     154  In the case of a "true" equation of state, the evaluation of $i$ and $j$ derivatives in \autoref{eq:ldfslp_iso} 
     155  will include a pressure dependent part, leading to the wrong evaluation of the neutral slopes. 
    157156 
    158157%gm%  
    159 Note: The solution for $s$-coordinate passes trough the use of different  
    160 (and better) expression for the constraint on iso-neutral fluxes. Following  
    161 \citet{Griffies_Bk04}, instead of specifying directly that there is a zero neutral  
    162 diffusive flux of locally referenced potential density, we stay in the $T$-$S$  
    163 plane and consider the balance between the neutral direction diffusive fluxes  
    164 of potential temperature and salinity: 
     158  Note: The solution for $s$-coordinate passes trough the use of different (and better) expression for 
     159  the constraint on iso-neutral fluxes. 
     160  Following \citet{Griffies_Bk04}, instead of specifying directly that there is a zero neutral diffusive flux of 
     161  locally referenced potential density, we stay in the $T$-$S$ plane and consider the balance between 
     162  the neutral direction diffusive fluxes of potential temperature and salinity: 
    165163\begin{equation} 
    166164\alpha \ \textbf{F}(T) = \beta \ \textbf{F}(S) 
     
    194192\end{split} 
    195193\end{equation} 
    196 where $\alpha$ and $\beta$, the thermal expansion and saline contraction  
    197 coefficients introduced in \autoref{subsec:TRA_bn2}, have to be evaluated at the three  
    198 velocity points. In order to save computation time, they should be approximated  
    199 by the mean of their values at $T$-points (for example in the case of $\alpha$:   
    200 $\alpha_u=\overline{\alpha_T}^{i+1/2}$,  $\alpha_v=\overline{\alpha_T}^{j+1/2}$  
    201 and $\alpha_w=\overline{\alpha_T}^{k+1/2}$). 
    202  
    203 Note that such a formulation could be also used in the $z$-coordinate and  
    204 $z$-coordinate with partial steps cases. 
     194where $\alpha$ and $\beta$, the thermal expansion and saline contraction coefficients introduced in 
     195\autoref{subsec:TRA_bn2}, have to be evaluated at the three velocity points. 
     196In order to save computation time, they should be approximated by the mean of their values at $T$-points 
     197(for example in the case of $\alpha$: 
     198$\alpha_u=\overline{\alpha_T}^{i+1/2}$,  $\alpha_v=\overline{\alpha_T}^{j+1/2}$ and 
     199$\alpha_w=\overline{\alpha_T}^{k+1/2}$). 
     200 
     201Note that such a formulation could be also used in the $z$-coordinate and $z$-coordinate with partial steps cases. 
    205202 
    206203\end{description} 
    207204 
    208 This implementation is a rather old one. It is similar to the one 
    209 proposed by Cox [1987], except for the background horizontal 
    210 diffusion. Indeed, the Cox implementation of isopycnal diffusion in 
    211 GFDL-type models requires a minimum background horizontal diffusion 
    212 for numerical stability reasons.  To overcome this problem, several 
    213 techniques have been proposed in which the numerical schemes of the 
    214 ocean model are modified \citep{Weaver_Eby_JPO97, 
    215   Griffies_al_JPO98}. Griffies's scheme is now available in \NEMO if 
    216 \np{traldf\_grif\_iso} is set true; see Appdx \autoref{apdx:triad}. Here, 
    217 another strategy is presented \citep{Lazar_PhD97}: a local 
    218 filtering of the iso-neutral slopes (made on 9 grid-points) prevents 
    219 the development of grid point noise generated by the iso-neutral 
    220 diffusion operator (\autoref{fig:LDF_ZDF1}). This allows an 
    221 iso-neutral diffusion scheme without additional background horizontal 
    222 mixing. This technique can be viewed as a diffusion operator that acts 
    223 along large-scale (2~$\Delta$x) \gmcomment{2deltax doesnt seem very 
    224   large scale} iso-neutral surfaces. The diapycnal diffusion required 
    225 for numerical stability is thus minimized and its net effect on the 
    226 flow is quite small when compared to the effect of an horizontal 
    227 background mixing. 
    228  
    229 Nevertheless, this iso-neutral operator does not ensure that variance cannot increase,  
     205This implementation is a rather old one. 
     206It is similar to the one proposed by Cox [1987], except for the background horizontal diffusion. 
     207Indeed, the Cox implementation of isopycnal diffusion in GFDL-type models requires 
     208a minimum background horizontal diffusion for numerical stability reasons. 
     209To overcome this problem, several techniques have been proposed in which the numerical schemes of 
     210the ocean model are modified \citep{Weaver_Eby_JPO97, Griffies_al_JPO98}. 
     211Griffies's scheme is now available in \NEMO if \np{traldf\_grif\_iso} is set true; see Appdx \autoref{apdx:triad}. 
     212Here, another strategy is presented \citep{Lazar_PhD97}: 
     213a local filtering of the iso-neutral slopes (made on 9 grid-points) prevents the development of 
     214grid point noise generated by the iso-neutral diffusion operator (\autoref{fig:LDF_ZDF1}). 
     215This allows an iso-neutral diffusion scheme without additional background horizontal mixing. 
     216This technique can be viewed as a diffusion operator that acts along large-scale 
     217(2~$\Delta$x) \gmcomment{2deltax doesnt seem very large scale} iso-neutral surfaces. 
     218The diapycnal diffusion required for numerical stability is thus minimized and its net effect on the flow is quite small when compared to the effect of an horizontal background mixing. 
     219 
     220Nevertheless, this iso-neutral operator does not ensure that variance cannot increase, 
    230221contrary to the \citet{Griffies_al_JPO98} operator which has that property.  
    231222 
     
    234225\includegraphics[width=0.70\textwidth]{Fig_LDF_ZDF1} 
    235226\caption {    \protect\label{fig:LDF_ZDF1} 
    236 averaging procedure for isopycnal slope computation.} 
     227  averaging procedure for isopycnal slope computation.} 
    237228\end{center}    \end{figure} 
    238229%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    252243% surface motivates this flattening of isopycnals near the surface). 
    253244 
    254 For numerical stability reasons \citep{Cox1987, Griffies_Bk04}, the slopes must also  
    255 be bounded by $1/100$ everywhere. This constraint is applied in a piecewise linear  
    256 fashion, increasing from zero at the surface to $1/100$ at $70$ metres and thereafter  
    257 decreasing to zero at the bottom of the ocean. (the fact that the eddies "feel" the  
    258 surface motivates this flattening of isopycnals near the surface). 
     245For numerical stability reasons \citep{Cox1987, Griffies_Bk04}, the slopes must also be bounded by 
     246$1/100$ everywhere. 
     247This constraint is applied in a piecewise linear fashion, increasing from zero at the surface to 
     248$1/100$ at $70$ metres and thereafter decreasing to zero at the bottom of the ocean 
     249(the fact that the eddies "feel" the surface motivates this flattening of isopycnals near the surface). 
    259250 
    260251%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    261 \begin{figure}[!ht]     \begin{center} 
    262 \includegraphics[width=0.70\textwidth]{Fig_eiv_slp} 
    263 \caption {     \protect\label{fig:eiv_slp} 
    264 Vertical profile of the slope used for lateral mixing in the mixed layer :  
    265 \textit{(a)} in the real ocean the slope is the iso-neutral slope in the ocean interior,  
    266 which has to be adjusted at the surface boundary (i.e. it must tend to zero at the  
    267 surface since there is no mixing across the air-sea interface: wall boundary  
    268 condition). Nevertheless, the profile between the surface zero value and the interior  
    269 iso-neutral one is unknown, and especially the value at the base of the mixed layer ;  
    270 \textit{(b)} profile of slope using a linear tapering of the slope near the surface and  
    271 imposing a maximum slope of 1/100 ; \textit{(c)} profile of slope actually used in  
    272 \NEMO: a linear decrease of the slope from zero at the surface to its ocean interior  
    273 value computed just below the mixed layer. Note the huge change in the slope at the  
    274 base of the mixed layer between  \textit{(b)}  and \textit{(c)}.} 
    275 \end{center}   \end{figure} 
     252\begin{figure}[!ht] 
     253  \begin{center} 
     254    \includegraphics[width=0.70\textwidth]{Fig_eiv_slp} 
     255    \caption {     \protect\label{fig:eiv_slp} 
     256      Vertical profile of the slope used for lateral mixing in the mixed layer: 
     257      \textit{(a)} in the real ocean the slope is the iso-neutral slope in the ocean interior, 
     258      which has to be adjusted at the surface boundary 
     259      (i.e. it must tend to zero at the surface since there is no mixing across the air-sea interface: 
     260      wall boundary condition). 
     261      Nevertheless, the profile between the surface zero value and the interior iso-neutral one is unknown, 
     262      and especially the value at the base of the mixed layer; 
     263      \textit{(b)} profile of slope using a linear tapering of the slope near the surface and 
     264      imposing a maximum slope of 1/100; 
     265      \textit{(c)} profile of slope actually used in \NEMO: a linear decrease of the slope from 
     266      zero at the surface to its ocean interior value computed just below the mixed layer. 
     267      Note the huge change in the slope at the base of the mixed layer between \textit{(b)} and \textit{(c)}.} 
     268  \end{center} 
     269\end{figure} 
    276270%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    277271 
    278 \colorbox{yellow}{add here a discussion about the flattening of the slopes, vs  tapering the coefficient.} 
     272\colorbox{yellow}{add here a discussion about the flattening of the slopes, vs tapering the coefficient.} 
    279273 
    280274\subsection{Slopes for momentum iso-neutral mixing} 
    281275 
    282 The iso-neutral diffusion operator on momentum is the same as the one used on  
    283 tracers but applied to each component of the velocity separately (see  
    284 \autoref{eq:dyn_ldf_iso} in section~\autoref{subsec:DYN_ldf_iso}). The slopes between the  
    285 surface along which the diffusion operator acts and the surface of computation  
    286 ($z$- or $s$-surfaces) are defined at $T$-, $f$-, and \textit{uw}- points for the  
    287 $u$-component, and $T$-, $f$- and \textit{vw}- points for the $v$-component.  
    288 They are computed from the slopes used for tracer diffusion, $i.e.$  
    289 \autoref{eq:ldfslp_geo} and \autoref{eq:ldfslp_iso} : 
     276The iso-neutral diffusion operator on momentum is the same as the one used on tracers but 
     277applied to each component of the velocity separately 
     278(see \autoref{eq:dyn_ldf_iso} in section~\autoref{subsec:DYN_ldf_iso}). 
     279The slopes between the surface along which the diffusion operator acts and the surface of computation 
     280($z$- or $s$-surfaces) are defined at $T$-, $f$-, and \textit{uw}- points for the $u$-component, and $T$-, $f$- and 
     281\textit{vw}- points for the $v$-component. 
     282They are computed from the slopes used for tracer diffusion, 
     283$i.e.$ \autoref{eq:ldfslp_geo} and \autoref{eq:ldfslp_iso} : 
    290284 
    291285\begin{equation} \label{eq:ldfslp_dyn} 
     
    298292\end{equation} 
    299293 
    300 The major issue remaining is in the specification of the boundary conditions.  
    301 The same boundary conditions are chosen as those used for lateral  
    302 diffusion along model level surfaces, i.e. using the shear computed along  
    303 the model levels and with no additional friction at the ocean bottom (see  
    304 \autoref{sec:LBC_coast}). 
     294The major issue remaining is in the specification of the boundary conditions. 
     295The same boundary conditions are chosen as those used for lateral diffusion along model level surfaces, 
     296$i.e.$ using the shear computed along the model levels and with no additional friction at the ocean bottom 
     297(see \autoref{sec:LBC_coast}). 
    305298 
    306299 
     
    319312\label{sec:LDF_coef} 
    320313 
    321 Introducing a space variation in the lateral eddy mixing coefficients changes  
    322 the model core memory requirement, adding up to four extra three-dimensional  
    323 arrays for the geopotential or isopycnal second order operator applied to  
    324 momentum. Six CPP keys control the space variation of eddy coefficients:  
    325 three for momentum and three for tracer. The three choices allow:  
    326 a space variation in the three space directions (\key{traldf\_c3d},  \key{dynldf\_c3d}),  
    327 in the horizontal plane (\key{traldf\_c2d},  \key{dynldf\_c2d}),  
    328 or in the vertical only (\key{traldf\_c1d},  \key{dynldf\_c1d}).  
     314Introducing a space variation in the lateral eddy mixing coefficients changes the model core memory requirement, 
     315adding up to four extra three-dimensional arrays for the geopotential or isopycnal second order operator applied to  
     316momentum. 
     317Six CPP keys control the space variation of eddy coefficients: three for momentum and three for tracer. 
     318The three choices allow: 
     319a space variation in the three space directions (\key{traldf\_c3d},  \key{dynldf\_c3d}), 
     320in the horizontal plane (\key{traldf\_c2d},  \key{dynldf\_c2d}), 
     321or in the vertical only (\key{traldf\_c1d},  \key{dynldf\_c1d}). 
    329322The default option is a constant value over the whole ocean on both momentum and tracers.  
    330323    
    331 The number of additional arrays that have to be defined and the gridpoint  
    332 position at which they are defined depend on both the space variation chosen  
    333 and the type of operator used. The resulting eddy viscosity and diffusivity  
    334 coefficients can be a function of more than one variable. Changes in the  
    335 computer code when switching from one option to another have been  
    336 minimized by introducing the eddy coefficients as statement functions 
    337 (include file \hf{ldftra\_substitute} and \hf{ldfdyn\_substitute}). The functions  
    338 are replaced by their actual meaning during the preprocessing step (CPP).  
    339 The specification of the space variation of the coefficient is made in  
    340 \mdl{ldftra} and \mdl{ldfdyn}, or more precisely in include files  
    341 \hf{traldf\_cNd} and \hf{dynldf\_cNd}, with N=1, 2 or 3.  
    342 The user can modify these include files as he/she wishes. The way the  
    343 mixing coefficient are set in the reference version can be briefly described  
    344 as follows: 
     324The number of additional arrays that have to be defined and the gridpoint position at which 
     325they are defined depend on both the space variation chosen and the type of operator used. 
     326The resulting eddy viscosity and diffusivity coefficients can be a function of more than one variable. 
     327Changes in the computer code when switching from one option to another have been minimized by 
     328introducing the eddy coefficients as statement functions 
     329(include file \hf{ldftra\_substitute} and \hf{ldfdyn\_substitute}). 
     330The functions are replaced by their actual meaning during the preprocessing step (CPP). 
     331The specification of the space variation of the coefficient is made in \mdl{ldftra} and \mdl{ldfdyn}, 
     332or more precisely in include files \hf{traldf\_cNd} and \hf{dynldf\_cNd}, with N=1, 2 or 3. 
     333The user can modify these include files as he/she wishes. 
     334The way the mixing coefficient are set in the reference version can be briefly described as follows: 
    345335 
    346336\subsubsection{Constant mixing coefficients (default option)} 
    347 When none of the \key{dynldf\_...} and \key{traldf\_...} keys are  
    348 defined, a constant value is used over the whole ocean for momentum and  
    349 tracers, which is specified through the \np{rn\_ahm0} and \np{rn\_aht0} namelist  
    350 parameters. 
     337When none of the \key{dynldf\_...} and \key{traldf\_...} keys are defined, 
     338a constant value is used over the whole ocean for momentum and tracers, 
     339which is specified through the \np{rn\_ahm0} and \np{rn\_aht0} namelist parameters. 
    351340 
    352341\subsubsection{Vertically varying mixing coefficients (\protect\key{traldf\_c1d} and \key{dynldf\_c1d})}  
    353 The 1D option is only available when using the $z$-coordinate with full step.  
    354 Indeed in all the other types of vertical coordinate, the depth is a 3D function  
    355 of (\textbf{i},\textbf{j},\textbf{k}) and therefore, introducing depth-dependent  
    356 mixing coefficients will require 3D arrays. In the 1D option, a hyperbolic variation  
    357 of the lateral mixing coefficient is introduced in which the surface value is  
    358 \np{rn\_aht0} (\np{rn\_ahm0}), the bottom value is 1/4 of the surface value,  
    359 and the transition takes place around z=300~m with a width of 300~m  
    360 ($i.e.$ both the depth and the width of the inflection point are set to 300~m).  
     342The 1D option is only available when using the $z$-coordinate with full step. 
     343Indeed in all the other types of vertical coordinate, 
     344the depth is a 3D function of (\textbf{i},\textbf{j},\textbf{k}) and therefore, 
     345introducing depth-dependent mixing coefficients will require 3D arrays. 
     346In the 1D option, a hyperbolic variation of the lateral mixing coefficient is introduced in which 
     347the surface value is \np{rn\_aht0} (\np{rn\_ahm0}), the bottom value is 1/4 of the surface value, 
     348and the transition takes place around z=300~m with a width of 300~m 
     349($i.e.$ both the depth and the width of the inflection point are set to 300~m). 
    361350This profile is hard coded in file \hf{traldf\_c1d}, but can be easily modified by users. 
    362351 
    363352\subsubsection{Horizontally varying mixing coefficients (\protect\key{traldf\_c2d} and \protect\key{dynldf\_c2d})} 
    364 By default the horizontal variation of the eddy coefficient depends on the local mesh  
    365 size and the type of operator used: 
     353By default the horizontal variation of the eddy coefficient depends on the local mesh size and 
     354the type of operator used: 
    366355\begin{equation} \label{eq:title} 
    367356  A_l = \left\{      
     
    371360   \end{aligned}    \right. 
    372361\end{equation} 
    373 where $e_{max}$ is the maximum of $e_1$ and $e_2$ taken over the whole masked  
    374 ocean domain, and $A_o^l$ is the \np{rn\_ahm0} (momentum) or \np{rn\_aht0} (tracer)  
    375 namelist parameter. This variation is intended to reflect the lesser need for subgrid  
    376 scale eddy mixing where the grid size is smaller in the domain. It was introduced in  
    377 the context of the DYNAMO modelling project \citep{Willebrand_al_PO01}.  
    378 Note that such a grid scale dependance of mixing coefficients significantly increase  
    379 the range of stability of model configurations presenting large changes in grid pacing  
    380 such as global ocean models. Indeed, in such a case, a constant mixing coefficient  
    381 can lead to a blow up of the model due to large coefficient compare to the smallest  
    382 grid size (see \autoref{sec:STP_forward_imp}), especially when using a bilaplacian operator. 
    383  
    384 Other formulations can be introduced by the user for a given configuration.  
    385 For example, in the ORCA2 global ocean model (see Configurations), the laplacian  
    386 viscosity operator uses \np{rn\_ahm0}~= 4.10$^4$ m$^2$/s poleward of 20$^{\circ}$  
    387 north and south and decreases linearly to \np{rn\_aht0}~= 2.10$^3$ m$^2$/s  
    388 at the equator \citep{Madec_al_JPO96, Delecluse_Madec_Bk00}. This modification  
    389 can be found in routine \rou{ldf\_dyn\_c2d\_orca} defined in \mdl{ldfdyn\_c2d}.  
    390 Similar modified horizontal variations can be found with the Antarctic or Arctic  
    391 sub-domain options of ORCA2 and ORCA05 (see \&namcfg namelist). 
     362where $e_{max}$ is the maximum of $e_1$ and $e_2$ taken over the whole masked ocean domain, 
     363and $A_o^l$ is the \np{rn\_ahm0} (momentum) or \np{rn\_aht0} (tracer) namelist parameter. 
     364This variation is intended to reflect the lesser need for subgrid scale eddy mixing where 
     365the grid size is smaller in the domain. 
     366It was introduced in the context of the DYNAMO modelling project \citep{Willebrand_al_PO01}. 
     367Note that such a grid scale dependance of mixing coefficients significantly increase the range of stability of 
     368model configurations presenting large changes in grid pacing such as global ocean models. 
     369Indeed, in such a case, a constant mixing coefficient can lead to a blow up of the model due to 
     370large coefficient compare to the smallest grid size (see \autoref{sec:STP_forward_imp}), 
     371especially when using a bilaplacian operator. 
     372 
     373Other formulations can be introduced by the user for a given configuration. 
     374For example, in the ORCA2 global ocean model (see Configurations), 
     375the laplacian viscosity operator uses \np{rn\_ahm0}~= 4.10$^4$ m$^2$/s poleward of 20$^{\circ}$ north and south and 
     376decreases linearly to \np{rn\_aht0}~= 2.10$^3$ m$^2$/s at the equator \citep{Madec_al_JPO96, Delecluse_Madec_Bk00}. 
     377This modification can be found in routine \rou{ldf\_dyn\_c2d\_orca} defined in \mdl{ldfdyn\_c2d}. 
     378Similar modified horizontal variations can be found with the Antarctic or Arctic sub-domain options of 
     379ORCA2 and ORCA05 (see \&namcfg namelist). 
    392380 
    393381\subsubsection{Space varying mixing coefficients (\protect\key{traldf\_c3d} and \key{dynldf\_c3d})} 
    394382 
    395 The 3D space variation of the mixing coefficient is simply the combination of the  
    396 1D and 2D cases, $i.e.$ a hyperbolic tangent variation with depth associated with  
    397 a grid size dependence of the magnitude of the coefficient.  
     383The 3D space variation of the mixing coefficient is simply the combination of the 1D and 2D cases, 
     384$i.e.$ a hyperbolic tangent variation with depth associated with a grid size dependence of 
     385the magnitude of the coefficient.  
    398386 
    399387\subsubsection{Space and time varying mixing coefficients} 
    400388 
    401389There is no default specification of space and time varying mixing coefficient.  
    402 The only case available is specific to the ORCA2 and ORCA05 global ocean  
    403 configurations. It provides only a tracer  
    404 mixing coefficient for eddy induced velocity (ORCA2) or both iso-neutral and  
    405 eddy induced velocity (ORCA05) that depends on the local growth rate of  
    406 baroclinic instability. This specification is actually used when an ORCA key  
    407 and both \key{traldf\_eiv} and \key{traldf\_c2d} are defined. 
     390The only case available is specific to the ORCA2 and ORCA05 global ocean configurations. 
     391It provides only a tracer mixing coefficient for eddy induced velocity (ORCA2) or both iso-neutral and 
     392eddy induced velocity (ORCA05) that depends on the local growth rate of baroclinic instability. 
     393This specification is actually used when an ORCA key and both \key{traldf\_eiv} and \key{traldf\_c2d} are defined. 
    408394 
    409395$\ $\newline    % force a new ligne 
     
    411397The following points are relevant when the eddy coefficient varies spatially: 
    412398 
    413 (1) the momentum diffusion operator acting along model level surfaces is  
    414 written in terms of curl and divergent components of the horizontal current  
    415 (see \autoref{subsec:PE_ldf}). Although the eddy coefficient could be set to different values  
    416 in these two terms, this option is not currently available.  
    417  
    418 (2) with an horizontally varying viscosity, the quadratic integral constraints  
    419 on enstrophy and on the square of the horizontal divergence for operators  
    420 acting along model-surfaces are no longer satisfied  
     399(1) the momentum diffusion operator acting along model level surfaces is written in terms of curl and 
     400divergent components of the horizontal current (see \autoref{subsec:PE_ldf}). 
     401Although the eddy coefficient could be set to different values in these two terms, 
     402this option is not currently available.  
     403 
     404(2) with an horizontally varying viscosity, the quadratic integral constraints on enstrophy and on the square of 
     405the horizontal divergence for operators acting along model-surfaces are no longer satisfied 
    421406(\autoref{sec:dynldf_properties}). 
    422407 
    423 (3) for isopycnal diffusion on momentum or tracers, an additional purely  
    424 horizontal background diffusion with uniform coefficient can be added by  
    425 setting a non zero value of \np{rn\_ahmb0} or \np{rn\_ahtb0}, a background horizontal  
    426 eddy viscosity or diffusivity coefficient (namelist parameters whose default  
    427 values are $0$). However, the technique used to compute the isopycnal  
    428 slopes is intended to get rid of such a background diffusion, since it introduces  
    429 spurious diapycnal diffusion (see \autoref{sec:LDF_slp}). 
    430  
    431 (4) when an eddy induced advection term is used (\key{traldf\_eiv}), $A^{eiv}$,  
    432 the eddy induced coefficient has to be defined. Its space variations are controlled  
    433 by the same CPP variable as for the eddy diffusivity coefficient ($i.e.$  
    434 \key{traldf\_cNd}).  
     408(3) for isopycnal diffusion on momentum or tracers, an additional purely horizontal background diffusion with 
     409uniform coefficient can be added by setting a non zero value of \np{rn\_ahmb0} or \np{rn\_ahtb0}, 
     410a background horizontal eddy viscosity or diffusivity coefficient 
     411(namelist parameters whose default values are $0$). 
     412However, the technique used to compute the isopycnal slopes is intended to get rid of such a background diffusion, 
     413since it introduces spurious diapycnal diffusion (see \autoref{sec:LDF_slp}). 
     414 
     415(4) when an eddy induced advection term is used (\key{traldf\_eiv}), 
     416$A^{eiv}$, the eddy induced coefficient has to be defined. 
     417Its space variations are controlled by the same CPP variable as for the eddy diffusivity coefficient 
     418($i.e.$ \key{traldf\_cNd}).  
    435419 
    436420(5) the eddy coefficient associated with a biharmonic operator must be set to a \emph{negative} value. 
     
    438422(6) it is possible to use both the laplacian and biharmonic operators concurrently. 
    439423 
    440 (7) it is possible to run without explicit lateral diffusion on momentum (\np{ln\_dynldf\_lap}\forcode{ =  
    441 }\np{ln\_dynldf\_bilap}\forcode{ = .false.}). This is recommended when using the UBS advection  
    442 scheme on momentum (\np{ln\_dynadv\_ubs}\forcode{ = .true.}, see \autoref{subsec:DYN_adv_ubs})  
    443 and can be useful for testing purposes. 
     424(7) it is possible to run without explicit lateral diffusion on momentum 
     425(\np{ln\_dynldf\_lap}\forcode{ = .?.}\np{ln\_dynldf\_bilap}\forcode{ = .false.}). 
     426This is recommended when using the UBS advection scheme on momentum (\np{ln\_dynadv\_ubs}\forcode{ = .true.}, 
     427see \autoref{subsec:DYN_adv_ubs}) and can be useful for testing purposes. 
    444428 
    445429% ================================================================ 
     
    451435%%gm  from Triad appendix  : to be incorporated.... 
    452436\gmcomment{ 
    453 Values of iso-neutral diffusivity and GM coefficient are set as 
    454 described in \autoref{sec:LDF_coef}. If none of the keys \key{traldf\_cNd}, 
    455 N=1,2,3 is set (the default), spatially constant iso-neutral $A_l$ and 
    456 GM diffusivity $A_e$ are directly set by \np{rn\_aeih\_0} and 
    457 \np{rn\_aeiv\_0}. If 2D-varying coefficients are set with 
    458 \key{traldf\_c2d} then $A_l$ is reduced in proportion with horizontal 
    459 scale factor according to \autoref{eq:title} \footnote{Except in global ORCA 
    460   $0.5^{\circ}$ runs with \key{traldf\_eiv}, where 
    461   $A_l$ is set like $A_e$ but with a minimum vale of 
    462   $100\;\mathrm{m}^2\;\mathrm{s}^{-1}$}. In idealised setups with 
    463 \key{traldf\_c2d}, $A_e$ is reduced similarly, but if \key{traldf\_eiv} 
    464 is set in the global configurations with \key{traldf\_c2d}, a horizontally varying $A_e$ is 
    465 instead set from the Held-Larichev parameterisation\footnote{In this 
    466   case, $A_e$ at low latitudes $|\theta|<20^{\circ}$ is further 
    467   reduced by a factor $|f/f_{20}|$, where $f_{20}$ is the value of $f$ 
    468   at $20^{\circ}$~N} (\mdl{ldfeiv}) and \np{rn\_aeiv\_0} is ignored 
    469 unless it is zero. 
     437  Values of iso-neutral diffusivity and GM coefficient are set as described in \autoref{sec:LDF_coef}. 
     438  If none of the keys \key{traldf\_cNd}, N=1,2,3 is set (the default), spatially constant iso-neutral $A_l$ and 
     439  GM diffusivity $A_e$ are directly set by \np{rn\_aeih\_0} and \np{rn\_aeiv\_0}. 
     440  If 2D-varying coefficients are set with \key{traldf\_c2d} then $A_l$ is reduced in proportion with horizontal 
     441  scale factor according to \autoref{eq:title} \footnote{ 
     442    Except in global ORCA  $0.5^{\circ}$ runs with \key{traldf\_eiv}, 
     443    where $A_l$ is set like $A_e$ but with a minimum vale of $100\;\mathrm{m}^2\;\mathrm{s}^{-1}$ 
     444  }. 
     445  In idealised setups with \key{traldf\_c2d}, $A_e$ is reduced similarly, but if \key{traldf\_eiv} is set in 
     446  the global configurations with \key{traldf\_c2d}, a horizontally varying $A_e$ is instead set from 
     447  the Held-Larichev parameterisation \footnote{ 
     448    In this case, $A_e$ at low latitudes $|\theta|<20^{\circ}$ is further reduced by a factor $|f/f_{20}|$, 
     449    where $f_{20}$ is the value of $f$ at $20^{\circ}$~N 
     450  } (\mdl{ldfeiv}) and \np{rn\_aeiv\_0} is ignored unless it is zero. 
    470451} 
    471452 
    472 When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined),  
    473 an eddy induced tracer advection term is added, the formulation of which  
    474 depends on the slopes of iso-neutral surfaces. Contrary to the case of iso-neutral  
    475 mixing, the slopes used here are referenced to the geopotential surfaces, $i.e.$  
    476 \autoref{eq:ldfslp_geo} is used in $z$-coordinates, and the sum \autoref{eq:ldfslp_geo}   
    477 + \autoref{eq:ldfslp_iso} in $s$-coordinates. The eddy induced velocity is given by:  
     453When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined), 
     454an eddy induced tracer advection term is added, 
     455the formulation of which depends on the slopes of iso-neutral surfaces. 
     456Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces, 
     457$i.e.$ \autoref{eq:ldfslp_geo} is used in $z$-coordinates, 
     458and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $s$-coordinates. 
     459The eddy induced velocity is given by:  
    478460\begin{equation} \label{eq:ldfeiv} 
    479461\begin{split} 
     
    483465\end{split} 
    484466\end{equation} 
    485 where $A^{eiv}$ is the eddy induced velocity coefficient whose value is set  
    486 through \np{rn\_aeiv}, a \textit{nam\_traldf} namelist parameter.  
    487 The three components of the eddy induced velocity are computed and add  
    488 to the eulerian velocity in \mdl{traadv\_eiv}. This has been preferred to a  
    489 separate computation of the advective trends associated with the eiv velocity,  
    490 since it allows us to take advantage of all the advection schemes offered for  
    491 the tracers (see \autoref{sec:TRA_adv}) and not just the $2^{nd}$ order advection  
    492 scheme as in previous releases of OPA \citep{Madec1998}. This is particularly  
    493 useful for passive tracers where \emph{positivity} of the advection scheme is  
    494 of paramount importance.  
    495  
    496 At the surface, lateral and bottom boundaries, the eddy induced velocity,  
     467where $A^{eiv}$ is the eddy induced velocity coefficient whose value is set through \np{rn\_aeiv}, 
     468a \textit{nam\_traldf} namelist parameter. 
     469The three components of the eddy induced velocity are computed and 
     470add to the eulerian velocity in \mdl{traadv\_eiv}. 
     471This has been preferred to a separate computation of the advective trends associated with the eiv velocity, 
     472since it allows us to take advantage of all the advection schemes offered for the tracers 
     473(see \autoref{sec:TRA_adv}) and not just the $2^{nd}$ order advection scheme as in 
     474previous releases of OPA \citep{Madec1998}. 
     475This is particularly useful for passive tracers where \emph{positivity} of the advection scheme is of 
     476paramount importance.  
     477 
     478At the surface, lateral and bottom boundaries, the eddy induced velocity, 
    497479and thus the advective eddy fluxes of heat and salt, are set to zero.  
    498480 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_OBS.tex

    r10146 r10368  
    1515$\ $\newline    % force a new line 
    1616 
    17 The observation and model comparison code (OBS) reads in observation files (profile 
    18 temperature and salinity, sea surface temperature, sea level anomaly, sea ice concentration, 
    19 and velocity) and calculates  an interpolated model equivalent value at the observation 
    20 location and nearest model timestep. The resulting data are saved in a ``feedback'' file (or 
    21 files). The code was originally developed for use with the NEMOVAR data assimilation code, but 
    22 can be used for validation or verification of the model or with any other data assimilation system. 
    23  
    24 The OBS code is called from \mdl{nemogcm} for model initialisation and to calculate the model 
    25 equivalent values for observations on the 0th timestep. The code is then called again after 
    26 each timestep from \mdl{step}. The code is only activated if the namelist logical \np{ln\_diaobs} 
    27 is set to true. 
    28  
    29 For all data types a 2D horizontal interpolator or averager is needed to interpolate/average the model fields to 
    30 the observation location. For {\em in situ} profiles, a 1D vertical interpolator is needed in 
    31 addition to provide model fields at the observation depths. This now works in a generalised vertical 
    32 coordinate system.  
     17The observation and model comparison code (OBS) reads in observation files 
     18(profile temperature and salinity, sea surface temperature, sea level anomaly, sea ice concentration, and velocity) and calculates an interpolated model equivalent value at the observation location and nearest model timestep. 
     19The resulting data are saved in a ``feedback'' file (or files). 
     20The code was originally developed for use with the NEMOVAR data assimilation code, 
     21but can be used for validation or verification of the model or with any other data assimilation system. 
     22 
     23The OBS code is called from \mdl{nemogcm} for model initialisation and to calculate the model equivalent values for observations on the 0th timestep. 
     24The code is then called again after each timestep from \mdl{step}. 
     25The code is only activated if the namelist logical \np{ln\_diaobs} is set to true. 
     26 
     27For all data types a 2D horizontal interpolator or averager is needed to 
     28interpolate/average the model fields to the observation location. 
     29For {\em in situ} profiles, a 1D vertical interpolator is needed in addition to 
     30provide model fields at the observation depths. 
     31This now works in a generalised vertical coordinate system.  
    3332 
    3433Some profile observation types (e.g. tropical moored buoys) are made available as daily averaged quantities. 
    35 The observation operator code can be set-up to calculate the equivalent daily average model temperature fields 
    36 using the \np{nn\_profdavtypes} namelist array. Some SST observations are equivalent to a night-time 
    37 average value and the observation operator code can calculate equivalent night-time average model SST fields by 
    38 setting the namelist value \np{ln\_sstnight} to true. Otherwise the model value from the nearest timestep to the 
    39 observation time is used. 
    40  
    41 The code is controlled by the namelist \textit{namobs}. See the following sections for more 
    42 details on setting up the namelist. 
     34The observation operator code can be set-up to calculate the equivalent daily average model temperature fields using 
     35the \np{nn\_profdavtypes} namelist array. 
     36Some SST observations are equivalent to a night-time average value and 
     37the observation operator code can calculate equivalent night-time average model SST fields by 
     38setting the namelist value \np{ln\_sstnight} to true. 
     39Otherwise the model value from the nearest timestep to the observation time is used. 
     40 
     41The code is controlled by the namelist \textit{namobs}. 
     42See the following sections for more details on setting up the namelist. 
    4343 
    4444\autoref{sec:OBS_example} introduces a test example of the observation operator code including 
    45 where to obtain data and how to setup the namelist. \autoref{sec:OBS_details} introduces some 
    46 more technical details of the different observation types used and also shows a more complete 
    47 namelist. \autoref{sec:OBS_theory} introduces some of the theoretical aspects of the observation 
    48 operator including interpolation methods and running on multiple processors. 
     45where to obtain data and how to setup the namelist. 
     46\autoref{sec:OBS_details} introduces some more technical details of the different observation types used and 
     47also shows a more complete namelist. 
     48\autoref{sec:OBS_theory} introduces some of the theoretical aspects of the observation operator including 
     49interpolation methods and running on multiple processors. 
    4950\autoref{sec:OBS_ooo} describes the offline observation operator code. 
    50 \autoref{sec:OBS_obsutils} introduces some utilities to help working with the files 
    51 produced by the OBS code. 
     51\autoref{sec:OBS_obsutils} introduces some utilities to help working with the files produced by the OBS code. 
    5252 
    5353% ================================================================ 
     
    5858 
    5959This section describes an example of running the observation operator code using 
    60 profile data which can be freely downloaded. It shows how to adapt an 
    61 existing run and build of NEMO to run the observation operator. 
     60profile data which can be freely downloaded. 
     61It shows how to adapt an existing run and build of NEMO to run the observation operator. 
    6262 
    6363\begin{enumerate} 
    6464\item Compile NEMO. 
    6565 
    66 \item Download some EN4 data from  
    67 \href{http://www.metoffice.gov.uk/hadobs}{www.metoffice.gov.uk/hadobs}. Choose observations which are 
    68 valid for the period of your test run because the observation operator compares 
    69 the model and observations for a matching date and time.  
     66\item Download some EN4 data from \href{http://www.metoffice.gov.uk/hadobs}{www.metoffice.gov.uk/hadobs}. 
     67  Choose observations which are valid for the period of your test run because 
     68  the observation operator compares the model and observations for a matching date and time.  
    7069 
    7170\item Compile the OBSTOOLS code using:  
     
    7978\end{cmds} 
    8079 
    81 \item Include the following in the NEMO namelist to run the observation 
    82 operator on this data: 
     80\item Include the following in the NEMO namelist to run the observation operator on this data: 
    8381\end{enumerate} 
    8482 
    85 %------------------------------------------namobs_example----------------------------------------------------- 
    86 % 
    87 %\nlst{namobs_example} 
    88 %------------------------------------------------------------------------------------------------------------- 
    89  
    90 Options are defined through the  \ngn{namobs} namelist variables. 
    91 The options \np{ln\_t3d} and \np{ln\_s3d} switch on the temperature and salinity 
    92 profile observation operator code. The filename or array of filenames are 
    93 specified using the \np{cn\_profbfiles} variable. The model grid points for a 
    94 particular  observation latitude and longitude are found using the grid 
    95 searching part of the code. This can be expensive, particularly for large 
    96 numbers of observations, setting \np{ln\_grid\_search\_lookup} allows the use of 
    97 a lookup table which is saved into an ``xypos`` file (or files). This will need 
    98 to be generated the first time if it does not exist in the run directory. 
     83Options are defined through the \ngn{namobs} namelist variables. 
     84The options \np{ln\_t3d} and \np{ln\_s3d} switch on the temperature and salinity profile observation operator code. 
     85The filename or array of filenames are specified using the \np{cn\_profbfiles} variable. 
     86The model grid points for a particular observation latitude and longitude are found using 
     87the grid searching part of the code. 
     88This can be expensive, particularly for large numbers of observations, 
     89setting \np{ln\_grid\_search\_lookup} allows the use of a lookup table which 
     90is saved into an ``xypos`` file (or files). 
     91This will need to be generated the first time if it does not exist in the run directory. 
    9992However, once produced it will significantly speed up future grid searches. 
    100 Setting \np{ln\_grid\_global} means that the code distributes the observations 
    101 evenly between processors. Alternatively each processor will work with 
    102 observations located within the model subdomain (see section~\autoref{subsec:OBS_parallel}). 
    103  
    104 A number of utilities are now provided to plot the feedback files, convert and 
    105 recombine the files. These are explained in more detail in section~\autoref{sec:OBS_obsutils}. 
    106 Utilites to convert other input data formats into the feedback format are also  
    107 described in section~\autoref{sec:OBS_obsutils}. 
     93Setting \np{ln\_grid\_global} means that the code distributes the observations evenly between processors. 
     94Alternatively each processor will work with observations located within the model subdomain 
     95(see section~\autoref{subsec:OBS_parallel}). 
     96 
     97A number of utilities are now provided to plot the feedback files, convert and recombine the files. 
     98These are explained in more detail in section~\autoref{sec:OBS_obsutils}. 
     99Utilites to convert other input data formats into the feedback format are also described in 
     100section~\autoref{sec:OBS_obsutils}. 
    108101 
    109102\section{Technical details (feedback type observation file headers)} 
    110103\label{sec:OBS_details} 
    111104 
    112 Here we show a more complete example namelist  \ngn{namobs} and also show the NetCDF headers 
    113 of the observation 
    114 files that may be used with the observation operator 
     105Here we show a more complete example namelist \ngn{namobs} and also show the NetCDF headers of 
     106the observation files that may be used with the observation operator. 
    115107 
    116108%------------------------------------------namobs-------------------------------------------------------- 
     
    119111%------------------------------------------------------------------------------------------------------------- 
    120112 
    121 The observation operator code uses the "feedback" observation file format for 
    122 all data types. All the 
    123 observation files must be in NetCDF format. Some example headers (produced using 
    124 \mbox{\textit{ncdump~-h}}) for profile 
    125 data, sea level anomaly and sea surface temperature are in the following 
    126 subsections. 
     113The observation operator code uses the "feedback" observation file format for all data types. 
     114All the observation files must be in NetCDF format. 
     115Some example headers (produced using \mbox{\textit{ncdump~-h}}) for profile data, sea level anomaly and 
     116sea surface temperature are in the following subsections. 
    127117 
    128118\subsection{Profile feedback} 
     
    406396\end{clines} 
    407397 
    408 The mean dynamic 
    409 topography (MDT) must be provided in a separate file defined on the model grid 
    410  called \ifile{slaReferenceLevel}. The MDT is required in 
    411 order to produce the model equivalent sea level anomaly from the model sea 
    412 surface height. Below is an example header for this file (on the ORCA025 grid). 
     398The mean dynamic topography (MDT) must be provided in a separate file defined on 
     399the model grid called \ifile{slaReferenceLevel}. 
     400The MDT is required in order to produce the model equivalent sea level anomaly from the model sea surface height. 
     401Below is an example header for this file (on the ORCA025 grid). 
    413402 
    414403\begin{clines} 
     
    551540\subsection{Horizontal interpolation and averaging methods} 
    552541 
    553 For most observation types, the horizontal extent of the observation is small compared to the model grid size 
    554 and so the model equivalent of the observation is calculated by interpolating from the four surrounding grid 
    555 points to the observation location. Some satellite observations (e.g. microwave satellite SST data, or satellite SSS data) 
    556 have a footprint which is similar in size or larger than the model grid size (particularly when the grid size is small).  
    557 In those cases the model counterpart should be calculated by averaging the model grid points over the same size as the footprint. 
    558 NEMO therefore has the capability to specify either an interpolation or an averaging (for surface observation types only).  
    559  
    560 The main namelist option associated with the interpolation/averaging is \np{nn\_2dint}. This default option can be set to values from 0 to 6.  
     542For most observation types, the horizontal extent of the observation is small compared to the model grid size and so 
     543the model equivalent of the observation is calculated by interpolating from 
     544the four surrounding grid points to the observation location. 
     545Some satellite observations (e.g. microwave satellite SST data, or satellite SSS data) have a footprint which 
     546is similar in size or larger than the model grid size (particularly when the grid size is small). 
     547In those cases the model counterpart should be calculated by averaging the model grid points over 
     548the same size as the footprint. 
     549NEMO therefore has the capability to specify either an interpolation or an averaging 
     550(for surface observation types only).  
     551 
     552The main namelist option associated with the interpolation/averaging is \np{nn\_2dint}. 
     553This default option can be set to values from 0 to 6. 
    561554Values between 0 to 4 are associated with interpolation while values 5 or 6 are associated with averaging. 
    562555\begin{itemize} 
     
    566559\item \np{nn\_2dint}\forcode{ = 3}: Bilinear remapping interpolation (general grid) 
    567560\item \np{nn\_2dint}\forcode{ = 4}: Polynomial interpolation 
    568 \item \np{nn\_2dint}\forcode{ = 5}: Radial footprint averaging with diameter specified in the namelist as \np{rn\_???\_avglamscl} in degrees or metres (set using \np{ln\_???\_fp\_indegs}) 
    569 \item \np{nn\_2dint}\forcode{ = 6}: Rectangular footprint averaging with E/W and N/S size specified in the namelist as \np{rn\_???\_avglamscl} and \np{rn\_???\_avgphiscl} in degrees or metres (set using \np{ln\_???\_fp\_indegs}) 
     561\item \np{nn\_2dint}\forcode{ = 5}: Radial footprint averaging with diameter specified in the namelist as 
     562  \np{rn\_???\_avglamscl} in degrees or metres (set using \np{ln\_???\_fp\_indegs}) 
     563\item \np{nn\_2dint}\forcode{ = 6}: Rectangular footprint averaging with E/W and N/S size specified in 
     564  the namelist as \np{rn\_???\_avglamscl} and \np{rn\_???\_avgphiscl} in degrees or metres 
     565  (set using \np{ln\_???\_fp\_indegs}) 
    570566\end{itemize} 
    571 The ??? in the last two options indicate these options should be specified for each observation type for which the averaging is to be performed (see namelist example above). 
    572 The \np{nn\_2dint} default option can be overridden for surface observation types using namelist values \np{nn\_2dint\_???} where ??? is one of sla,sst,sss,sic. 
     567The ??? in the last two options indicate these options should be specified for each observation type for 
     568which the averaging is to be performed (see namelist example above). 
     569The \np{nn\_2dint} default option can be overridden for surface observation types using 
     570namelist values \np{nn\_2dint\_???} where ??? is one of sla,sst,sss,sic. 
    573571 
    574572Below is some more detail on the various options for interpolation and averaging available in NEMO. 
    575573 
    576574\subsubsection{Horizontal interpolation} 
    577 Consider an observation point ${\rm P}$ with  
    578 with longitude and latitude $({\lambda_{}}_{\rm P}, \phi_{\rm P})$ and the  
    579 four nearest neighbouring model grid points ${\rm A}$, ${\rm B}$, ${\rm C}$  
    580 and ${\rm D}$ with longitude and latitude ($\lambda_{\rm A}$, $\phi_{\rm A}$), 
    581 ($\lambda_{\rm B}$, $\phi_{\rm B}$) etc. 
    582 All horizontal interpolation methods implemented in NEMO 
    583 estimate the value of a model variable $x$ at point $P$ as 
    584 a weighted linear combination of the values of the model  
    585 variables at the grid points ${\rm A}$, ${\rm B}$ etc.: 
     575Consider an observation point ${\rm P}$ with with longitude and latitude $({\lambda_{}}_{\rm P}, \phi_{\rm P})$ and 
     576the four nearest neighbouring model grid points ${\rm A}$, ${\rm B}$, ${\rm C}$ and ${\rm D}$ with 
     577longitude and latitude ($\lambda_{\rm A}$, $\phi_{\rm A}$),($\lambda_{\rm B}$, $\phi_{\rm B}$) etc. 
     578All horizontal interpolation methods implemented in NEMO estimate the value of a model variable $x$ at point $P$ as 
     579a weighted linear combination of the values of the model variables at the grid points ${\rm A}$, ${\rm B}$ etc.: 
    586580\begin{eqnarray} 
    587581{x_{}}_{\rm P} & \hspace{-2mm} = \hspace{-2mm} &  
     
    591585                   {w_{}}_{\rm D} {x_{}}_{\rm D} \right) 
    592586\end{eqnarray} 
    593 where ${w_{}}_{\rm A}$, ${w_{}}_{\rm B}$ etc. are the respective weights for the  
    594 model field at points ${\rm A}$, ${\rm B}$ etc., and  
    595 $w = {w_{}}_{\rm A} + {w_{}}_{\rm B} + {w_{}}_{\rm C} + {w_{}}_{\rm D}$. 
     587where ${w_{}}_{\rm A}$, ${w_{}}_{\rm B}$ etc. are the respective weights for the model field at 
     588points ${\rm A}$, ${\rm B}$ etc., and $w = {w_{}}_{\rm A} + {w_{}}_{\rm B} + {w_{}}_{\rm C} + {w_{}}_{\rm D}$. 
    596589 
    597590Four different possibilities are available for computing the weights. 
     
    599592\begin{enumerate} 
    600593 
    601 \item[1.] {\bf Great-Circle distance-weighted interpolation.} The weights 
    602   are computed as a function of the great-circle distance $s(P, \cdot)$  
    603   between $P$ and the model grid points $A$, $B$ etc. For example,  
    604   the weight given to the field ${x_{}}_{\rm A}$ is specified as the  
    605   product of the distances from ${\rm P}$ to the other points: 
     594\item[1.] {\bf Great-Circle distance-weighted interpolation.} 
     595  The weights are computed as a function of the great-circle distance $s(P, \cdot)$ between $P$ and 
     596  the model grid points $A$, $B$ etc. 
     597  For example, the weight given to the field ${x_{}}_{\rm A}$ is specified as the product of the distances 
     598  from ${\rm P}$ to the other points: 
    606599  \begin{eqnarray} 
    607600  {w_{}}_{\rm A} = s({\rm P}, {\rm B}) \, s({\rm P}, {\rm C}) \, s({\rm P}, {\rm D}) 
     
    619612   \end{eqnarray} 
    620613   and $M$ corresponds to $B$, $C$ or $D$. 
    621    A more stable form of the great-circle distance formula for 
    622    small distances ($x$ near 1) involves the arcsine function 
    623    ($e.g.$ see p.~101 of \citet{Daley_Barker_Bk01}: 
     614   A more stable form of the great-circle distance formula for small distances ($x$ near 1) 
     615   involves the arcsine function ($e.g.$ see p.~101 of \citet{Daley_Barker_Bk01}: 
    624616   \begin{eqnarray} 
    625617   s\left( {\rm P}, {\rm M} \right)  
     
    651643  \end{eqnarray} 
    652644 
    653 \item[2.] {\bf Great-Circle distance-weighted interpolation with small angle 
    654   approximation.} Similar to the previous interpolation but with the 
    655   distance $s$ computed as 
     645\item[2.] {\bf Great-Circle distance-weighted interpolation with small angle approximation.} 
     646  Similar to the previous interpolation but with the distance $s$ computed as 
    656647  \begin{eqnarray} 
    657648    s\left( {\rm P}, {\rm M} \right)  
     
    663654  where $M$ corresponds to $A$, $B$, $C$ or $D$. 
    664655 
    665 \item[3.] {\bf Bilinear interpolation for a regular spaced grid.} The 
    666   interpolation is split into two 1D interpolations in the longitude 
    667   and latitude directions, respectively. 
    668  
    669 \item[4.] {\bf Bilinear remapping interpolation for a general grid.} An 
    670   iterative scheme that involves first mapping a quadrilateral cell 
    671   into a cell with coordinates (0,0), (1,0), (0,1) and (1,1). This 
    672   method is based on the SCRIP interpolation package \citep{Jones_1998}. 
     656\item[3.] {\bf Bilinear interpolation for a regular spaced grid.} 
     657  The interpolation is split into two 1D interpolations in the longitude and latitude directions, respectively. 
     658 
     659\item[4.] {\bf Bilinear remapping interpolation for a general grid.} 
     660  An iterative scheme that involves first mapping a quadrilateral cell into 
     661  a cell with coordinates (0,0), (1,0), (0,1) and (1,1). 
     662  This method is based on the SCRIP interpolation package \citep{Jones_1998}. 
    673663   
    674664\end{enumerate} 
     
    678668For each surface observation type: 
    679669\begin{itemize} 
    680 \item The standard grid-searching code is used to find the nearest model grid point to the observation location (see next subsection). 
    681 \item The maximum number of grid points is calculated in the local grid domain for which the averaging is likely need to cover. 
    682 \item The lats/longs of the grid points surrounding the nearest model grid box are extracted using existing mpi routines. 
    683 \item The weights for each grid point associated with each observation are calculated, either for radial or rectangular footprints. For grid points completely within the footprint, the weight is one; for grid points completely outside the footprint, the weight is zero. For grid points which are partly within the footprint the ratio between the area of the footprint within the grid box and the total area of the grid box is used as the weight. 
    684 \item The weighted average of the model grid points associated with each observation is calculated, and this is then given as the model counterpart of the observation. 
     670\item The standard grid-searching code is used to find the nearest model grid point to the observation location 
     671  (see next subsection). 
     672\item The maximum number of grid points is calculated in the local grid domain for which 
     673  the averaging is likely need to cover. 
     674\item The lats/longs of the grid points surrounding the nearest model grid box are extracted using 
     675  existing mpi routines. 
     676\item The weights for each grid point associated with each observation are calculated, 
     677  either for radial or rectangular footprints. 
     678  For grid points completely within the footprint, the weight is one; 
     679  for grid points completely outside the footprint, the weight is zero. 
     680  For grid points which are partly within the footprint the ratio between the area of the footprint within 
     681  the grid box and the total area of the grid box is used as the weight. 
     682\item The weighted average of the model grid points associated with each observation is calculated, 
     683  and this is then given as the model counterpart of the observation. 
    685684\end{itemize} 
    686685 
    687 Examples of the weights calculated for an observation with rectangular and radial footprints are shown in Figs.~\autoref{fig:obsavgrec} and~\autoref{fig:obsavgrad}. 
     686Examples of the weights calculated for an observation with rectangular and radial footprints are shown in 
     687Figs.~\autoref{fig:obsavgrec} and~\autoref{fig:obsavgrad}. 
    688688 
    689689%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    691691\includegraphics[width=0.90\textwidth]{Fig_OBS_avg_rec} 
    692692\caption{      \protect\label{fig:obsavgrec} 
    693 Weights associated with each model grid box (blue lines and numbers) for an observation at -170.5E, 56.0N with a rectangular footprint of 1\deg x 1\deg.} 
     693  Weights associated with each model grid box (blue lines and numbers) 
     694  for an observation at -170.5E, 56.0N with a rectangular footprint of 1\deg x 1\deg.} 
    694695\end{center}      \end{figure} 
    695696%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    699700\includegraphics[width=0.90\textwidth]{Fig_OBS_avg_rad} 
    700701\caption{      \protect\label{fig:obsavgrad} 
    701 Weights associated with each model grid box (blue lines and numbers) for an observation at -170.5E, 56.0N with a radial footprint with diameter 1\deg.}  
     702  Weights associated with each model grid box (blue lines and numbers) 
     703  for an observation at -170.5E, 56.0N with a radial footprint with diameter 1\deg.}  
    702704\end{center}      \end{figure} 
    703705%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    706708\subsection{Grid search} 
    707709 
    708 For many grids used by the NEMO model, such as the ORCA family,  
    709 the horizontal grid coordinates $i$ and $j$ are not simple functions  
    710 of latitude and longitude. Therefore, it is not always straightforward  
    711 to determine the grid points surrounding any given observational position. 
    712 Before the interpolation can be performed, a search  
    713 algorithm is then required to determine the corner points of  
     710For many grids used by the NEMO model, such as the ORCA family, the horizontal grid coordinates $i$ and $j$ are not simple functions of latitude and longitude. 
     711Therefore, it is not always straightforward to determine the grid points surrounding any given observational position. 
     712Before the interpolation can be performed, a search algorithm is then required to determine the corner points of  
    714713the quadrilateral cell in which the observation is located. 
    715 This is the most difficult and time consuming part of the  
    716 2D interpolation procedure.  
    717 A robust test for determining if an observation falls 
    718 within a given quadrilateral cell is as follows. Let  
    719 ${\rm P}({\lambda_{}}_{\rm P} ,{\phi_{}}_{\rm P} )$ denote the observation point, 
    720 and let ${\rm A}({\lambda_{}}_{\rm A} ,{\phi_{}}_{\rm A} )$, 
    721 ${\rm B}({\lambda_{}}_{\rm B} ,{\phi_{}}_{\rm B} )$, 
    722 ${\rm C}({\lambda_{}}_{\rm C} ,{\phi_{}}_{\rm C} )$  
    723 and  
    724 ${\rm D}({\lambda_{}}_{\rm D} ,{\phi_{}}_{\rm D} )$ denote 
    725 the bottom left, bottom right, top left and top right 
    726 corner points of the cell, respectively.  
    727 To determine if P is inside  
    728 the cell, we verify that the cross-products  
     714This is the most difficult and time consuming part of the 2D interpolation procedure.  
     715A robust test for determining if an observation falls within a given quadrilateral cell is as follows. 
     716Let ${\rm P}({\lambda_{}}_{\rm P} ,{\phi_{}}_{\rm P} )$ denote the observation point, 
     717and let ${\rm A}({\lambda_{}}_{\rm A} ,{\phi_{}}_{\rm A} )$, ${\rm B}({\lambda_{}}_{\rm B} ,{\phi_{}}_{\rm B} )$, 
     718${\rm C}({\lambda_{}}_{\rm C} ,{\phi_{}}_{\rm C} )$ and ${\rm D}({\lambda_{}}_{\rm D} ,{\phi_{}}_{\rm D} )$ 
     719denote the bottom left, bottom right, top left and top right corner points of the cell, respectively.  
     720To determine if P is inside the cell, we verify that the cross-products  
    729721\begin{eqnarray} 
    730722\begin{array}{lllll} 
     
    752744\label{eq:cross} 
    753745\end{eqnarray} 
    754 point in the opposite direction to the unit normal  
    755 $\widehat{\bf k}$ (i.e., that the coefficients of  
    756 $\widehat{\bf k}$ are negative), 
    757 where ${{\bf r}_{}}_{\rm PA}$, ${{\bf r}_{}}_{\rm PB}$,  
    758 etc. correspond to the vectors between points P and A,  
    759 P and B, etc.. The method used is 
    760 similar to the method used in 
    761 the SCRIP interpolation package \citep{Jones_1998}. 
    762  
    763 In order to speed up the grid search, there is the possibility to construct  
    764 a lookup table for a user specified resolution. This lookup 
    765 table contains the lower and upper bounds on the $i$ and $j$ indices 
    766 to be searched for on a regular grid. For each observation position, 
    767 the closest point on the regular grid of this position is computed and 
    768 the $i$ and $j$ ranges of this point searched to determine the precise 
    769 four points surrounding the observation.  
     746point in the opposite direction to the unit normal $\widehat{\bf k}$ 
     747(i.e., that the coefficients of $\widehat{\bf k}$ are negative), 
     748where ${{\bf r}_{}}_{\rm PA}$, ${{\bf r}_{}}_{\rm PB}$, etc. correspond to 
     749the vectors between points P and A, P and B, etc.. 
     750The method used is similar to the method used in the SCRIP interpolation package \citep{Jones_1998}. 
     751 
     752In order to speed up the grid search, there is the possibility to construct a lookup table for a user specified resolution. 
     753This lookup table contains the lower and upper bounds on the $i$ and $j$ indices to 
     754be searched for on a regular grid. 
     755For each observation position, the closest point on the regular grid of this position is computed and 
     756the $i$ and $j$ ranges of this point searched to determine the precise four points surrounding the observation.  
    770757 
    771758\subsection{Parallel aspects of horizontal interpolation} 
    772759\label{subsec:OBS_parallel} 
    773760 
    774 For horizontal interpolation, there is the basic problem that the 
    775 observations are unevenly distributed on the globe. In numerical 
    776 models, it is common to divide the model grid into subgrids (or 
    777 domains) where each subgrid is executed on a single processing element 
    778 with explicit message passing for exchange of information along the 
    779 domain boundaries when running on a massively parallel processor (MPP) 
    780 system. This approach is used by \NEMO. 
    781  
    782 For observations there is no natural distribution since the 
    783 observations are not equally distributed on the globe.  
    784 Two options have been made available: 1) geographical distribution; 
     761For horizontal interpolation, there is the basic problem that 
     762the observations are unevenly distributed on the globe. 
     763In numerical models, it is common to divide the model grid into subgrids (or domains) where 
     764each subgrid is executed on a single processing element with explicit message passing for 
     765exchange of information along the domain boundaries when running on a massively parallel processor (MPP) system. 
     766This approach is used by \NEMO. 
     767 
     768For observations there is no natural distribution since the observations are not equally distributed on the globe.  
     769Two options have been made available: 
     7701) geographical distribution; 
    785771and 2) round-robin. 
    786772 
     
    791777\includegraphics[width=10cm,height=12cm,angle=-90.]{Fig_ASM_obsdist_local} 
    792778\caption{      \protect\label{fig:obslocal} 
    793 Example of the distribution of observations with the geographical distribution of observational data.}  
     779  Example of the distribution of observations with the geographical distribution of observational data.}  
    794780\end{center}      \end{figure} 
    795781%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    796782 
    797 This is the simplest option in which the observations are distributed according  
    798 to the domain of the grid-point parallelization. \autoref{fig:obslocal} 
    799 shows an example of the distribution of the {\em in situ} data on processors  
    800 with a different colour for each observation 
    801 on a given processor for a 4 $\times$ 2 decomposition with ORCA2.  
     783This is the simplest option in which the observations are distributed according to 
     784the domain of the grid-point parallelization. 
     785\autoref{fig:obslocal} shows an example of the distribution of the {\em in situ} data on processors with 
     786a different colour for each observation on a given processor for a 4 $\times$ 2 decomposition with ORCA2.  
    802787The grid-point domain decomposition is clearly visible on the plot. 
    803788 
    804 The advantage of this approach is that all 
    805 information needed for horizontal interpolation is available without 
    806 any MPP communication. Of course, this is under the assumption that  
    807 we are only using a $2 \times 2$ grid-point stencil for the interpolation  
    808 (e.g., bilinear interpolation). For higher order interpolation schemes this 
    809 is no longer valid. A disadvantage with the above scheme is that the number of 
    810 observations on each processor can be very different. If the cost of 
    811 the actual interpolation is expensive relative to the communication of 
    812 data needed for interpolation, this could lead to load imbalance. 
     789The advantage of this approach is that all information needed for horizontal interpolation is available without 
     790any MPP communication. 
     791Of course, this is under the assumption that we are only using a $2 \times 2$ grid-point stencil for 
     792the interpolation (e.g., bilinear interpolation). 
     793For higher order interpolation schemes this is no longer valid. 
     794A disadvantage with the above scheme is that the number of observations on each processor can be very different. 
     795If the cost of the actual interpolation is expensive relative to the communication of data needed for interpolation, 
     796this could lead to load imbalance. 
    813797 
    814798\subsubsection{Round-robin distribution of observations among processors} 
     
    818802\includegraphics[width=10cm,height=12cm,angle=-90.]{Fig_ASM_obsdist_global} 
    819803\caption{      \protect\label{fig:obsglobal} 
    820 Example of the distribution of observations with the round-robin distribution of observational data.} 
     804  Example of the distribution of observations with the round-robin distribution of observational data.} 
    821805\end{center}     \end{figure} 
    822806%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    823807 
    824 An alternative approach is to distribute the observations equally 
    825 among processors and use message passing in order to retrieve  
    826 the stencil for interpolation. The simplest distribution of the observations  
    827 is to distribute them using a round-robin scheme. \autoref{fig:obsglobal} 
    828 shows the distribution of the {\em in situ} data on processors for the 
    829 round-robin distribution of observations with a different colour for 
    830 each observation on a given processor for a 4 $\times$ 2 decomposition  
    831 with ORCA2 for the same input data as in \autoref{fig:obslocal}. 
     808An alternative approach is to distribute the observations equally among processors and 
     809use message passing in order to retrieve the stencil for interpolation. 
     810The simplest distribution of the observations is to distribute them using a round-robin scheme. 
     811\autoref{fig:obsglobal} shows the distribution of the {\em in situ} data on processors for 
     812the round-robin distribution of observations with a different colour for each observation on a given processor for 
     813a 4 $\times$ 2 decomposition with ORCA2 for the same input data as in \autoref{fig:obslocal}. 
    832814The observations are now clearly randomly distributed on the globe. 
    833 In order to be able to perform horizontal interpolation in this case,  
    834 a subroutine has been developed that retrieves any grid points in the  
    835 global space. 
     815In order to be able to perform horizontal interpolation in this case, 
     816a subroutine has been developed that retrieves any grid points in the global space. 
    836817 
    837818\subsection{Vertical interpolation operator} 
    838819 
    839 Vertical interpolation is achieved using either a cubic spline or 
    840 linear interpolation. For the cubic spline, the top and 
    841 bottom boundary conditions for the second derivative of the  
    842 interpolating polynomial in the spline are set to zero. 
     820Vertical interpolation is achieved using either a cubic spline or linear interpolation. 
     821For the cubic spline, the top and bottom boundary conditions for the second derivative of 
     822the interpolating polynomial in the spline are set to zero. 
    843823At the bottom boundary, this is done using the land-ocean mask. 
    844824 
     
    856836\subsection{Concept} 
    857837 
    858 The obs oper maps model variables to observation space. It is possible to apply this mapping 
    859 without running the model. The software which performs this functionality is known as the 
    860 \textbf{offline obs oper}. The obs oper is divided into three stages. An initialisation phase, 
    861 an interpolation phase and an output phase. The implementation of which is outlined in the 
    862 previous sections. During the interpolation phase the offline obs oper populates the model 
    863 arrays by reading saved model fields from disk. 
    864  
    865 There are two ways of exploiting this offline capacity. The first is to mimic the behaviour of 
    866 the online system by supplying model fields at regular intervals between the start and the end 
    867 of the run. This approach results in a single model counterpart per observation. This kind of 
    868 usage produces feedback files the same file format as the online obs oper.  
    869 The second is to take advantage of the offline setting in which multiple model counterparts can 
    870 be calculated per observation. In this case it is possible to consider all forecasts verifying 
    871 at the same time. By forecast, I mean any method which produces an estimate of physical reality 
    872 which is not an observed value. In the case of class 4 files this means forecasts, analyses, persisted 
    873 analyses and climatological values verifying at the same time. Although the class 4 file format 
    874 doesn't account for multiple ensemble members or multiple experiments per observation, it is possible 
    875 to include these components in the same or multiple files. 
     838The obs oper maps model variables to observation space. 
     839It is possible to apply this mapping without running the model. 
     840The software which performs this functionality is known as the \textbf{offline obs oper}. 
     841The obs oper is divided into three stages. 
     842An initialisation phase, an interpolation phase and an output phase. 
     843The implementation of which is outlined in the previous sections. 
     844During the interpolation phase the offline obs oper populates the model arrays by 
     845reading saved model fields from disk. 
     846 
     847There are two ways of exploiting this offline capacity. 
     848The first is to mimic the behaviour of the online system by supplying model fields at 
     849regular intervals between the start and the end of the run. 
     850This approach results in a single model counterpart per observation. 
     851This kind of usage produces feedback files the same file format as the online obs oper. 
     852The second is to take advantage of the offline setting in which 
     853multiple model counterparts can be calculated per observation. 
     854In this case it is possible to consider all forecasts verifying at the same time. 
     855By forecast, I mean any method which produces an estimate of physical reality which is not an observed value. 
     856In the case of class 4 files this means forecasts, analyses, persisted analyses and 
     857climatological values verifying at the same time. 
     858Although the class 4 file format doesn't account for multiple ensemble members or 
     859multiple experiments per observation, it is possible to include these components in the same or multiple files. 
    876860 
    877861%-------------------------------------------------------------------------------------------------------- 
     
    883867\subsubsection{Building} 
    884868 
    885 In addition to \emph{OPA\_SRC} the offline obs oper requires the inclusion 
    886 of the \emph{OOO\_SRC} directory. \emph{OOO\_SRC} contains a replacement \mdl{nemo} and 
    887 \mdl{nemogcm} which overwrites the resultant \textbf{nemo.exe}. This is the approach taken 
    888 by \emph{SAS\_SRC} and \emph{OFF\_SRC}. 
     869In addition to \emph{OPA\_SRC} the offline obs oper requires the inclusion of the \emph{OOO\_SRC} directory. 
     870\emph{OOO\_SRC} contains a replacement \mdl{nemo} and \mdl{nemogcm} which 
     871overwrites the resultant \textbf{nemo.exe}. 
     872This is the approach taken by \emph{SAS\_SRC} and \emph{OFF\_SRC}. 
    889873 
    890874%-------------------------------------------------------------------------------------------------------- 
     
    898882\subsubsection{Quick script} 
    899883 
    900 A useful Python utility to control the namelist options can be found in \textbf{OBSTOOLS/OOO}. The 
    901 functions which locate model fields and observation files can be manually specified. The package 
    902 can be installed by appropriate use of the included setup.py script. 
     884A useful Python utility to control the namelist options can be found in \textbf{OBSTOOLS/OOO}. 
     885The functions which locate model fields and observation files can be manually specified. 
     886The package can be installed by appropriate use of the included setup.py script. 
    903887 
    904888Documentation can be auto-generated by Sphinx by running \emph{make html} in the \textbf{doc} directory. 
     
    908892%-------------------------------------------------------------------------------------------------------- 
    909893\subsection{Configuring the offline observation operator} 
    910 The observation files and settings understood by \textbf{namobs} have been outlined in the online 
    911 obs oper section. In addition there are two further namelists wich control the operation of the offline 
    912 obs oper. \textbf{namooo} which controls the input model fields and \textbf{namcl4} which controls the 
    913 production of class 4 files.  
     894The observation files and settings understood by \textbf{namobs} have been outlined in the online obs oper section. 
     895In addition there are two further namelists wich control the operation of the offline obs oper. 
     896\textbf{namooo} which controls the input model fields and \textbf{namcl4} which 
     897controls the production of class 4 files.  
    914898 
    915899\subsubsection{Single field} 
     
    917901In offline mode model arrays are populated at appropriate time steps via input files. 
    918902At present, \textbf{tsn} and \textbf{sshn} are populated by the default read routines.  
    919 These routines will be expanded upon in future versions to allow the specification of any 
    920 model variable. As such, input files must be global versions of the model domain with 
     903These routines will be expanded upon in future versions to allow the specification of any model variable. 
     904As such, input files must be global versions of the model domain with 
    921905\textbf{votemper}, \textbf{vosaline} and optionally \textbf{sshn} present. 
    922906 
    923 For each field read there must be an entry in the \textbf{namooo} namelist specifying the 
    924 name of the file to read and the index along the \emph{time\_counter}. For example, to 
    925 read the second time counter from a single file the namelist would be. 
     907For each field read there must be an entry in the \textbf{namooo} namelist specifying 
     908the name of the file to read and the index along the \emph{time\_counter}. 
     909For example, to read the second time counter from a single file the namelist would be. 
    926910 
    927911\begin{forlines} 
     
    939923\subsubsection{Multiple fields per run} 
    940924 
    941 Model field iteration is controlled via \textbf{nn\_ooo\_freq} which specifies 
    942 the number of model steps at which the next field gets read. For example, if 
    943 12 hourly fields are to be interpolated in a setup where 288 steps equals 24 hours. 
     925Model field iteration is controlled via \textbf{nn\_ooo\_freq} which 
     926specifies the number of model steps at which the next field gets read. 
     927For example, if 12 hourly fields are to be interpolated in a setup where 288 steps equals 24 hours. 
    944928 
    945929\begin{forlines} 
     
    957941\end{forlines} 
    958942 
    959 The above namelist will result in feedback files whose first 12 hours contain 
    960 the first field of foo.nc and the second 12 hours contain the second field. 
     943The above namelist will result in feedback files whose first 12 hours contain the first field of foo.nc and 
     944the second 12 hours contain the second field. 
    961945 
    962946%\begin{framed} 
     
    964948%\end{framed} 
    965949 
    966 It is easy to see how a collection of fields taken fron a number of files  
    967 at different indices can be combined at a particular frequency in time to  
    968 generate a pseudo model evolution. As long as all that is needed is a single 
    969 model counterpart at a regular interval then namooo is all that needs to 
    970 be edited. However, a far more interesting approach can be taken in which 
    971 multiple forecasts, analyses, persisted analyses and climatologies are 
    972 considered against the same set of observations. For this a slightly more 
    973 complicated approach is needed. It is referred to as \emph{Class 4} since 
    974 it is the fourth metric defined by the GODAE intercomparison project. 
     950It is easy to see how a collection of fields taken fron a number of files at different indices can be combined at 
     951a particular frequency in time to generate a pseudo model evolution. 
     952As long as all that is needed is a single model counterpart at a regular interval then 
     953namooo is all that needs to be edited. 
     954However, a far more interesting approach can be taken in which multiple forecasts, analyses, persisted analyses and 
     955climatologies are considered against the same set of observations. 
     956For this a slightly more complicated approach is needed. 
     957It is referred to as \emph{Class 4} since it is the fourth metric defined by the GODAE intercomparison project. 
    975958 
    976959%-------------------------------------------------------------------------------------------------------- 
     
    979962\subsubsection{Multiple model counterparts per observation a.k.a Class 4} 
    980963 
    981 A generalisation of feedback files to allow multiple model components per observation. For a single 
    982 observation, as well as previous forecasts verifying at the same time there are also analyses, persisted 
    983 analyses and climatologies.  
    984  
    985  
    986 The above namelist performs two basic functions. It organises the fields 
    987 given in \textbf{namooo} into groups so that observations can be matched 
    988 up multiple times. It also controls the metadata and the output variable 
    989 of the class 4 file when a write routine is called. 
     964A generalisation of feedback files to allow multiple model components per observation. 
     965For a single observation, as well as previous forecasts verifying at the same time 
     966there are also analyses, persisted analyses and climatologies.  
     967 
     968 
     969The above namelist performs two basic functions. 
     970It organises the fields given in \textbf{namooo} into groups so that observations can be matched up multiple times. 
     971It also controls the metadata and the output variable of the class 4 file when a write routine is called. 
    990972 
    991973%\begin{framed} 
    992 \textbf{Note: ln\_cl4} must be set to \forcode{.true.} in \textbf{namobs}  
    993 to use class 4 outputs. 
     974\textbf{Note: ln\_cl4} must be set to \forcode{.true.} in \textbf{namobs} to use class 4 outputs. 
    994975%\end{framed} 
    995976 
     
    1004985\noindent 
    1005986\linebreak 
    1006 Much of the namelist is devoted to specifying this convention. The 
    1007 following namelist settings control the elements of the output 
    1008 file names. Each should be specified as a single string of character data. 
     987Much of the namelist is devoted to specifying this convention. 
     988The following namelist settings control the elements of the output file names. 
     989Each should be specified as a single string of character data. 
    1009990 
    1010991\begin{description} 
    1011992\item[cl4\_prefix] 
    1012 Prefix for class 4 files e.g. class4 
     993  Prefix for class 4 files e.g. class4 
    1013994\item[cl4\_date] 
    1014 YYYYMMDD validity date 
     995  YYYYMMDD validity date 
    1015996\item[cl4\_sys] 
    1016 The name of the class 4 model system e.g. FOAM 
     997  The name of the class 4 model system e.g. FOAM 
    1017998\item[cl4\_cfg] 
    1018 The name of the class 4 model configuration e.g. orca025 
     999  The name of the class 4 model configuration e.g. orca025 
    10191000\item[cl4\_vn] 
    1020 The name of the class 4 model version e.g. 12.0 
     1001  The name of the class 4 model version e.g. 12.0 
    10211002\end{description} 
    10221003 
    10231004\noindent 
    1024 The kind is specified by the observation type internally to the obs oper. The processor 
    1025 number is specified internally in NEMO.  
     1005The kind is specified by the observation type internally to the obs oper. 
     1006The processor number is specified internally in NEMO.  
    10261007 
    10271008\subsubsection{Class 4 file global attributes} 
    10281009 
    1029 Global attributes necessary to fulfill the class 4 file definition. These 
    1030 are also useful pieces of information when collaborating with external 
    1031 partners. 
     1010Global attributes necessary to fulfill the class 4 file definition. 
     1011These are also useful pieces of information when collaborating with external partners. 
    10321012 
    10331013\begin{description} 
    10341014\item[cl4\_contact] 
    1035 Contact email for class 4 files. 
     1015  Contact email for class 4 files. 
    10361016\item[cl4\_inst] 
    1037 The name of the producers institution. 
     1017  The name of the producers institution. 
    10381018\item[cl4\_cfg] 
    1039 The name of the class 4 model configuration e.g. orca025 
     1019  The name of the class 4 model configuration e.g. orca025 
    10401020\item[cl4\_vn] 
    1041 The name of the class 4 model version e.g. 12.0 
     1021  The name of the class 4 model version e.g. 12.0 
    10421022\end{description} 
    10431023 
    10441024\noindent 
    1045 The obs\_type, 
    1046 creation date and validity time are specified internally to the obs oper. 
     1025The obs\_type, creation date and validity time are specified internally to the obs oper. 
    10471026 
    10481027\subsubsection{Class 4 model counterpart configuration} 
    10491028 
    1050 As seen previously it is possible to perform a single sweep of the 
    1051 obs oper and specify a collection of model fields equally spaced  
    1052 along that sweep. In the class 4 case the single sweep is replaced 
    1053 with multiple sweeps and a certain ammount of book keeping is 
    1054 needed to ensure each model counterpart makes its way to the  
    1055 correct piece of memory in the output files. 
     1029As seen previously it is possible to perform a single sweep of the obs oper and 
     1030specify a collection of model fields equally spaced along that sweep. 
     1031In the class 4 case the single sweep is replaced with multiple sweeps and 
     1032a certain ammount of book keeping is needed to ensure each model counterpart makes its way to 
     1033the correct piece of memory in the output files. 
    10561034 
    10571035\noindent 
    10581036\linebreak 
    1059 In terms of book keeping, the offline obs oper needs to know how many 
    1060 full sweeps need to be performed. This is specified via the  
    1061 \textbf{cl4\_match\_len} variable and is the total number of model 
    1062 counterparts per observation. For example, a 3 forecasts plus 3 persistence 
    1063 fields plus an analysis field would be 7 counterparts per observation. 
     1037In terms of book keeping, the offline obs oper needs to know how many full sweeps need to be performed. 
     1038This is specified via the \textbf{cl4\_match\_len} variable and 
     1039is the total number of model counterparts per observation. 
     1040For example, a 3 forecasts plus 3 persistence fields plus an analysis field would be 7 counterparts per observation. 
    10641041 
    10651042\begin{forlines} 
     
    10671044\end{forlines} 
    10681045 
    1069 Then to correctly allocate a class 4 file the forecast axis must be defined. This 
    1070 is controlled via \textbf{cl4\_fcst\_len}, which in out above example would be 3. 
     1046Then to correctly allocate a class 4 file the forecast axis must be defined. 
     1047This is controlled via \textbf{cl4\_fcst\_len}, which in out above example would be 3. 
    10711048 
    10721049\begin{forlines} 
     
    10741051\end{forlines} 
    10751052 
    1076 Then for each model field it is necessary to designate what class 4 variable and 
    1077 index along the forecast dimension the model counterpart should be stored in the 
    1078 output file. As well as a value for that lead time in hours, this will be useful 
    1079 when interpreting the data afterwards.  
     1053Then for each model field it is necessary to designate what class 4 variable and index along 
     1054the forecast dimension the model counterpart should be stored in the output file. 
     1055As well as a value for that lead time in hours, this will be useful when interpreting the data afterwards.  
    10801056 
    10811057\begin{forlines} 
     
    10861062\end{forlines} 
    10871063 
    1088 In terms of files and indices of fields inside each file the class 4 approach 
    1089 makes use of the \textbf{namooo} namelist. If our fields are in separate files 
    1090 with a single field per file our example inputs will be specified. 
     1064In terms of files and indices of fields inside each file the class 4 approach makes use of 
     1065the \textbf{namooo} namelist. 
     1066If our fields are in separate files with a single field per file our example inputs will be specified. 
    10911067 
    10921068\begin{forlines} 
     
    10951071\end{forlines} 
    10961072 
    1097 When we combine all of the naming conventions, global attributes and i/o instructions 
    1098 the class 4 namelist becomes. 
     1073When we combine all of the naming conventions, global attributes and i/o instructions the class 4 namelist becomes. 
    10991074 
    11001075\begin{forlines} 
     
    11501125\subsubsection{Climatology interpolation} 
    11511126 
    1152 The climatological counterpart is generated at the start of the run by restarting  
    1153 the model from climatology through appropriate use of \textbf{namtsd}. To override 
    1154 the offline observation operator read routine and to take advantage of the restart 
    1155 settings, specify the first entry in \textbf{cl4\_vars} as "climatology". This will then 
    1156 pipe the restart from climatology into the output class 4 file. As in every other 
    1157 class 4 matchup the input file, input index and output index must be specified. 
    1158 These can be replaced with dummy data since they are not used but they must be 
    1159 present to cycle through the matchups correctly.  
     1127The climatological counterpart is generated at the start of the run by 
     1128restarting the model from climatology through appropriate use of \textbf{namtsd}. 
     1129To override the offline observation operator read routine and to take advantage of the restart settings, 
     1130specify the first entry in \textbf{cl4\_vars} as "climatology". 
     1131This will then pipe the restart from climatology into the output class 4 file. 
     1132As in every other class 4 matchup the input file, input index and output index must be specified. 
     1133These can be replaced with dummy data since they are not used but 
     1134they must be present to cycle through the matchups correctly.  
    11601135 
    11611136\subsection{Advanced usage} 
    11621137 
    1163 In certain cases it may be desirable to include both multiple model fields per 
    1164 observation window with multiple match ups per observation. This can be achieved 
    1165 by specifying \textbf{nn\_ooo\_freq} as well as the class 4 settings. Care must 
    1166 be taken in generating the ooo\_files list such that the files are arranged into 
    1167 consecutive blocks of single match ups. For example, 2 forecast fields  
    1168 of 12 hourly data would result in 4 separate read operations but only 2 write 
    1169 operations, 1 per forecast. 
     1138In certain cases it may be desirable to include both multiple model fields per observation window with 
     1139multiple match ups per observation. 
     1140This can be achieved by specifying \textbf{nn\_ooo\_freq} as well as the class 4 settings. 
     1141Care must be taken in generating the ooo\_files list such that the files are arranged into 
     1142consecutive blocks of single match ups. 
     1143For example, 2 forecast fields of 12 hourly data would result in 4 separate read operations but 
     1144only 2 write operations, 1 per forecast. 
    11701145 
    11711146\begin{forlines} 
     
    11751150\end{forlines} 
    11761151 
    1177 The above notation reveals the internal split between match up iterators and file 
    1178 iterators. This technique has not been used before so experimentation is needed 
    1179 before results can be trusted. 
     1152The above notation reveals the internal split between match up iterators and file iterators. 
     1153This technique has not been used before so experimentation is needed before results can be trusted. 
    11801154 
    11811155 
     
    11871161\label{sec:OBS_obsutils} 
    11881162 
    1189 Some tools for viewing and processing of observation and feedback files are provided in the 
    1190 NEMO repository for convenience. These include OBSTOOLS which are a collection of Fortran 
    1191 programs which are helpful to deal with feedback files. They do such tasks as observation file 
    1192 conversion, printing of file contents, some basic statistical analysis of feedback files. The 
    1193 other tool is an IDL program called dataplot which uses a graphical interface to visualise 
    1194 observations and feedback files. OBSTOOLS and dataplot are described in more detail below.   
     1163Some tools for viewing and processing of observation and feedback files are provided in 
     1164the NEMO repository for convenience. 
     1165These include OBSTOOLS which are a collection of Fortran programs which are helpful to deal with feedback files. 
     1166They do such tasks as observation file conversion, printing of file contents, 
     1167some basic statistical analysis of feedback files. 
     1168The other tool is an IDL program called dataplot which uses a graphical interface to 
     1169visualise observations and feedback files. 
     1170OBSTOOLS and dataplot are described in more detail below. 
    11951171 
    11961172\subsection{Obstools} 
    11971173 
    1198 A series of Fortran utilities is provided with NEMO called OBSTOOLS. This are helpful in 
    1199 handling observation files and the feedback file output from the NEMO observation operator. 
     1174A series of Fortran utilities is provided with NEMO called OBSTOOLS. 
     1175This are helpful in handling observation files and the feedback file output from the NEMO observation operator. 
    12001176The utilities are as follows 
    12011177 
    12021178\subsubsection{c4comb} 
    12031179 
    1204 The program c4comb combines multiple class 4 files produced by individual processors in an 
    1205 MPI run of NEMO offline obs\_oper into a single class 4 file. The program is called in the following way: 
     1180The program c4comb combines multiple class 4 files produced by individual processors in 
     1181an MPI run of NEMO offline obs\_oper into a single class 4 file. 
     1182The program is called in the following way: 
    12061183 
    12071184 
     
    12131190\subsubsection{corio2fb} 
    12141191 
    1215 The program corio2fb converts profile observation files from the Coriolis format to the 
    1216 standard feedback format. The program is called in the following way: 
     1192The program corio2fb converts profile observation files from the Coriolis format to the standard feedback format. 
     1193The program is called in the following way: 
    12171194 
    12181195\footnotesize 
     
    12231200\subsubsection{enact2fb} 
    12241201 
    1225 The program enact2fb converts profile observation files from the ENACT format to the standard 
    1226 feedback format. The program is called in the following way: 
     1202The program enact2fb converts profile observation files from the ENACT format to the standard feedback format. 
     1203The program is called in the following way: 
    12271204 
    12281205\footnotesize 
     
    12331210\subsubsection{fbcomb} 
    12341211 
    1235 The program fbcomb combines multiple feedback files produced by individual processors in an 
    1236 MPI run of NEMO into a single feedback file. The program is called in the following way: 
     1212The program fbcomb combines multiple feedback files produced by individual processors in 
     1213an MPI run of NEMO into a single feedback file. 
     1214The program is called in the following way: 
    12371215 
    12381216\footnotesize 
     
    12431221\subsubsection{fbmatchup} 
    12441222 
    1245 The program fbmatchup will match observations from two feedback files. The program is called 
    1246 in the following way: 
     1223The program fbmatchup will match observations from two feedback files. 
     1224The program is called in the following way: 
    12471225 
    12481226\footnotesize 
     
    12541232 
    12551233The program fbprint will print the contents of a feedback file or files to standard output. 
    1256 Selected information can be output using optional arguments. The program is called in the 
    1257 following way: 
     1234Selected information can be output using optional arguments. 
     1235The program is called in the following way: 
    12581236 
    12591237\footnotesize 
     
    12821260\subsubsection{fbsel} 
    12831261 
    1284 The program fbsel will select or subsample observations. The program is called in the 
    1285 following way: 
     1262The program fbsel will select or subsample observations. 
     1263The program is called in the following way: 
    12861264 
    12871265\footnotesize 
     
    12921270\subsubsection{fbstat} 
    12931271 
    1294 The program fbstat will output summary statistics in different global areas into a number of 
    1295 files. The program is called in the following way: 
     1272The program fbstat will output summary statistics in different global areas into a number of files. 
     1273The program is called in the following way: 
    12961274 
    12971275\footnotesize 
     
    13021280\subsubsection{fbthin} 
    13031281 
    1304 The program fbthin will thin the data to 1 degree resolution. The code could easily be 
    1305 modified to thin to a different resolution. The program is called in the following way: 
     1282The program fbthin will thin the data to 1 degree resolution. 
     1283The code could easily be modified to thin to a different resolution. 
     1284The program is called in the following way: 
    13061285 
    13071286\footnotesize 
     
    13121291\subsubsection{sla2fb} 
    13131292 
    1314 The program sla2fb will convert an AVISO SLA format file to feedback format. The program is 
    1315 called in the following way: 
     1293The program sla2fb will convert an AVISO SLA format file to feedback format. 
     1294The program is called in the following way: 
    13161295 
    13171296\footnotesize 
     
    13251304\subsubsection{vel2fb} 
    13261305 
    1327 The program vel2fb will convert TAO/PIRATA/RAMA currents files to feedback format. The program 
    1328 is called in the following way: 
     1306The program vel2fb will convert TAO/PIRATA/RAMA currents files to feedback format. 
     1307The program is called in the following way: 
    13291308 
    13301309\footnotesize 
     
    13391318\subsection{Dataplot} 
    13401319 
    1341 An IDL program called dataplot is included which uses a graphical interface to visualise 
    1342 observations and feedback files. It is possible to zoom in, plot individual profiles and 
    1343 calculate some basic statistics. To plot some data run IDL and then: 
     1320An IDL program called dataplot is included which uses a graphical interface to 
     1321visualise observations and feedback files. 
     1322It is possible to zoom in, plot individual profiles and calculate some basic statistics. 
     1323To plot some data run IDL and then: 
    13441324\footnotesize 
    13451325\begin{minted}{idl} 
     
    13471327\end{minted} 
    13481328 
    1349 To read multiple files into dataplot, for example multiple feedback files from different 
    1350 processors or from different days, the easiest method is to use the spawn command to generate 
    1351 a list of files which can then be passed to dataplot. 
     1329To read multiple files into dataplot, 
     1330for example multiple feedback files from different processors or from different days, 
     1331the easiest method is to use the spawn command to generate a list of files which can then be passed to dataplot. 
    13521332\footnotesize 
    13531333\begin{minted}{idl} 
     
    13571337 
    13581338\autoref{fig:obsdataplotmain} shows the main window which is launched when dataplot starts. 
    1359 This is split into three parts. At the top there is a menu bar which contains a variety of 
    1360 drop down menus. Areas - zooms into prespecified regions; plot - plots the data as a 
    1361 timeseries or a T-S diagram if appropriate; Find - allows data to be searched; Config - sets 
    1362 various configuration options. 
    1363  
    1364 The middle part is a plot of the geographical location of the observations. This will plot the 
    1365 observation value, the model background value or observation minus background value depending 
    1366 on the option selected in the radio button at the bottom of the window. The plotting colour 
    1367 range can be changed by clicking on the colour bar. The title of the plot gives some basic 
    1368 information about the date range and depth range shown, the extreme values, and the mean and 
    1369 rms values. It is possible to zoom in using a drag-box. You may also zoom in or out using the 
    1370 mouse wheel. 
    1371  
    1372 The bottom part of the window controls what is visible in the plot above. There are two bars 
    1373 which select the level range plotted (for profile data). The other bars below select the date 
    1374 range shown. The bottom of the figure allows the option to plot the mean, root mean square, 
    1375 standard deviation or mean square values. As mentioned above you can choose to plot the 
    1376 observation value, the model background value or observation minus background value. The next 
    1377 group of radio buttons selects the map projection. This can either be regular latitude 
    1378 longitude grid, or north or south polar stereographic. The next group of radio buttons will 
    1379 plot bad observations, switch to salinity and plot density for profile observations. The 
    1380 rightmost group of buttons will print the plot window as a postscript, save it as png, or exit 
    1381 from dataplot. 
     1339This is split into three parts. 
     1340At the top there is a menu bar which contains a variety of drop down menus. 
     1341Areas - zooms into prespecified regions; 
     1342plot - plots the data as a timeseries or a T-S diagram if appropriate; 
     1343Find - allows data to be searched; 
     1344Config - sets various configuration options. 
     1345 
     1346The middle part is a plot of the geographical location of the observations. 
     1347This will plot the observation value, the model background value or observation minus background value depending on 
     1348the option selected in the radio button at the bottom of the window. 
     1349The plotting colour range can be changed by clicking on the colour bar. 
     1350The title of the plot gives some basic information about the date range and depth range shown, 
     1351the extreme values, and the mean and rms values. 
     1352It is possible to zoom in using a drag-box. 
     1353You may also zoom in or out using the mouse wheel. 
     1354 
     1355The bottom part of the window controls what is visible in the plot above. 
     1356There are two bars which select the level range plotted (for profile data). 
     1357The other bars below select the date range shown. 
     1358The bottom of the figure allows the option to plot the mean, root mean square, standard deviation or 
     1359mean square values. 
     1360As mentioned above you can choose to plot the observation value, the model background value or 
     1361observation minus background value. 
     1362The next group of radio buttons selects the map projection. 
     1363This can either be regular latitude longitude grid, or north or south polar stereographic. 
     1364The next group of radio buttons will plot bad observations, switch to salinity and 
     1365plot density for profile observations. 
     1366The rightmost group of buttons will print the plot window as a postscript, save it as png, or exit from dataplot. 
    13821367 
    13831368%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    13861371\includegraphics[width=9cm,angle=-90.]{Fig_OBS_dataplot_main} 
    13871372\caption{      \protect\label{fig:obsdataplotmain} 
    1388 Main window of dataplot.} 
     1373  Main window of dataplot.} 
    13891374\end{center}     \end{figure} 
    13901375%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    13911376 
    1392 If a profile point is clicked with the mouse button a plot of the observation and background 
    1393 values as a function of depth (\autoref{fig:obsdataplotprofile}). 
     1377If a profile point is clicked with the mouse button a plot of the observation and background values as 
     1378a function of depth (\autoref{fig:obsdataplotprofile}). 
    13941379 
    13951380%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    13981383\includegraphics[width=7cm,angle=-90.]{Fig_OBS_dataplot_prof} 
    13991384\caption{      \protect\label{fig:obsdataplotprofile} 
    1400 Profile plot from dataplot produced by right clicking on a point in the main window.} 
     1385  Profile plot from dataplot produced by right clicking on a point in the main window.} 
    14011386\end{center}     \end{figure} 
    14021387%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_SBC.tex

    r10146 r10368  
    1818The ocean needs six fields as surface boundary condition: 
    1919\begin{itemize} 
    20    \item the two components of the surface ocean stress $\left( {\tau _u \;,\;\tau _v} \right)$ 
    21    \item the incoming solar and non solar heat fluxes $\left( {Q_{ns} \;,\;Q_{sr} } \right)$ 
    22    \item the surface freshwater budget $\left( {\textit{emp}} \right)$ 
    23    \item the surface salt flux associated with freezing/melting of seawater $\left( {\textit{sfx}} \right)$ 
     20\item 
     21  the two components of the surface ocean stress $\left( {\tau _u \;,\;\tau _v} \right)$ 
     22\item 
     23  the incoming solar and non solar heat fluxes $\left( {Q_{ns} \;,\;Q_{sr} } \right)$ 
     24\item 
     25  the surface freshwater budget $\left( {\textit{emp}} \right)$ 
     26\item 
     27  the surface salt flux associated with freezing/melting of seawater $\left( {\textit{sfx}} \right)$ 
    2428\end{itemize} 
    2529plus an optional field: 
     
    2832\end{itemize} 
    2933 
    30 Five different ways to provide the first six fields to the ocean are available which  
    31 are controlled by namelist \ngn{namsbc} variables: an analytical formulation (\np{ln\_ana}\forcode{ = .true.}),  
    32 a flux formulation (\np{ln\_flx}\forcode{ = .true.}), a bulk formulae formulation (CORE  
    33 (\np{ln\_blk\_core}\forcode{ = .true.}), CLIO (\np{ln\_blk\_clio}\forcode{ = .true.}) or MFS 
    34 \footnote { Note that MFS bulk formulae compute fluxes only for the ocean component} 
    35 (\np{ln\_blk\_mfs}\forcode{ = .true.}) bulk formulae) and a coupled or mixed forced/coupled formulation  
    36 (exchanges with a atmospheric model via the OASIS coupler) (\np{ln\_cpl} or \np{ln\_mixcpl}\forcode{ = .true.}).  
    37 When used ($i.e.$ \np{ln\_apr\_dyn}\forcode{ = .true.}), the atmospheric pressure forces both ocean and ice dynamics. 
    38  
    39 The frequency at which the forcing fields have to be updated is given by the \np{nn\_fsbc} namelist parameter.  
    40 When the fields are supplied from data files (flux and bulk formulations), the input fields  
    41 need not be supplied on the model grid. Instead a file of coordinates and weights can  
    42 be supplied which maps the data from the supplied grid to the model points  
    43 (so called "Interpolation on the Fly", see \autoref{subsec:SBC_iof}). 
     34Five different ways to provide the first six fields to the ocean are available which are controlled by 
     35namelist \ngn{namsbc} variables: 
     36an analytical formulation (\np{ln\_ana}\forcode{ = .true.}), 
     37a flux formulation (\np{ln\_flx}\forcode{ = .true.}), 
     38a bulk formulae formulation (CORE (\np{ln\_blk\_core}\forcode{ = .true.}), 
     39CLIO (\np{ln\_blk\_clio}\forcode{ = .true.}) or 
     40MFS \footnote { Note that MFS bulk formulae compute fluxes only for the ocean component} 
     41(\np{ln\_blk\_mfs}\forcode{ = .true.}) bulk formulae) and 
     42a coupled or mixed forced/coupled formulation (exchanges with a atmospheric model via the OASIS coupler) 
     43(\np{ln\_cpl} or \np{ln\_mixcpl}\forcode{ = .true.}).  
     44When used ($i.e.$ \np{ln\_apr\_dyn}\forcode{ = .true.}), 
     45the atmospheric pressure forces both ocean and ice dynamics. 
     46 
     47The frequency at which the forcing fields have to be updated is given by the \np{nn\_fsbc} namelist parameter. 
     48When the fields are supplied from data files (flux and bulk formulations), 
     49the input fields need not be supplied on the model grid. 
     50Instead a file of coordinates and weights can be supplied which maps the data from the supplied grid to 
     51the model points (so called "Interpolation on the Fly", see \autoref{subsec:SBC_iof}). 
    4452If the Interpolation on the Fly option is used, input data belonging to land points (in the native grid), 
    45 can be masked to avoid spurious results in proximity of the coasts  as large sea-land gradients characterize 
    46 most of the atmospheric variables. 
    47  
    48 In addition, the resulting fields can be further modified using several namelist options.  
     53can be masked to avoid spurious results in proximity of the coasts as 
     54large sea-land gradients characterize most of the atmospheric variables. 
     55 
     56In addition, the resulting fields can be further modified using several namelist options. 
    4957These options control  
    5058\begin{itemize} 
    51 \item the rotation of vector components supplied relative to an east-north  
    52 coordinate system onto the local grid directions in the model ;  
    53 \item the addition of a surface restoring term to observed SST and/or SSS (\np{ln\_ssr}\forcode{ = .true.}) ;  
    54 \item the modification of fluxes below ice-covered areas (using observed ice-cover or a sea-ice model) (\np{nn\_ice}\forcode{ = 0..3}) ;  
    55 \item the addition of river runoffs as surface freshwater fluxes or lateral inflow (\np{ln\_rnf}\forcode{ = .true.}) ;  
    56 \item the addition of isf melting as lateral inflow (parameterisation) or as fluxes applied at the land-ice ocean interface (\np{ln\_isf}) ;  
    57 \item the addition of a freshwater flux adjustment in order to avoid a mean sea-level drift (\np{nn\_fwb}\forcode{ = 0..2}) ;  
    58 \item the transformation of the solar radiation (if provided as daily mean) into a diurnal cycle (\np{ln\_dm2dc}\forcode{ = .true.}) ;  
    59 and a neutral drag coefficient can be read from an external wave model (\np{ln\_cdgw}\forcode{ = .true.}).  
     59\item 
     60  the rotation of vector components supplied relative to an east-north coordinate system onto 
     61  the local grid directions in the model; 
     62\item 
     63  the addition of a surface restoring term to observed SST and/or SSS (\np{ln\_ssr}\forcode{ = .true.}); 
     64\item 
     65  the modification of fluxes below ice-covered areas (using observed ice-cover or a sea-ice model) 
     66  (\np{nn\_ice}\forcode{ = 0..3}); 
     67\item 
     68  the addition of river runoffs as surface freshwater fluxes or lateral inflow (\np{ln\_rnf}\forcode{ = .true.}); 
     69\item 
     70  the addition of isf melting as lateral inflow (parameterisation) or 
     71  as fluxes applied at the land-ice ocean interface (\np{ln\_isf}) ;  
     72\item 
     73  the addition of a freshwater flux adjustment in order to avoid a mean sea-level drift 
     74  (\np{nn\_fwb}\forcode{ = 0..2}); 
     75\item 
     76  the transformation of the solar radiation (if provided as daily mean) into a diurnal cycle 
     77  (\np{ln\_dm2dc}\forcode{ = .true.}); 
     78  and a neutral drag coefficient can be read from an external wave model (\np{ln\_cdgw}\forcode{ = .true.}).  
    6079\end{itemize} 
    6180The latter option is possible only in case core or mfs bulk formulas are selected. 
    6281 
    63 In this chapter, we first discuss where the surface boundary condition appears in the 
    64 model equations. Then we present the five ways of providing the surface boundary condition,  
     82In this chapter, we first discuss where the surface boundary condition appears in the model equations. 
     83Then we present the five ways of providing the surface boundary condition,  
    6584followed by the description of the atmospheric pressure and the river runoff.  
    6685Next the scheme for interpolation on the fly is described. 
    6786Finally, the different options that further modify the fluxes applied to the ocean are discussed. 
    68 One of these is modification by icebergs (see \autoref{sec:ICB_icebergs}), which act as drifting sources of fresh water. 
     87One of these is modification by icebergs (see \autoref{sec:ICB_icebergs}), 
     88which act as drifting sources of fresh water. 
    6989Another example of modification is that due to the ice shelf melting/freezing (see \autoref{sec:SBC_isf}),  
    7090which provides additional sources of fresh water. 
     
    7797\label{sec:SBC_general} 
    7898 
    79 The surface ocean stress is the stress exerted by the wind and the sea-ice  
    80 on the ocean. It is applied in \mdl{dynzdf} module as a surface boundary condition of the  
    81 computation of the momentum vertical mixing trend (see \autoref{eq:dynzdf_sbc} in \autoref{sec:DYN_zdf}). 
    82 As such, it has to be provided as a 2D vector interpolated  
    83 onto the horizontal velocity ocean mesh, $i.e.$ resolved onto the model  
    84 (\textbf{i},\textbf{j}) direction at $u$- and $v$-points. 
    85  
    86 The surface heat flux is decomposed into two parts, a non solar and a solar heat  
    87 flux, $Q_{ns}$ and $Q_{sr}$, respectively. The former is the non penetrative part  
    88 of the heat flux ($i.e.$ the sum of sensible, latent and long wave heat fluxes  
    89 plus the heat content of the mass exchange with the atmosphere and sea-ice).  
    90 It is applied in \mdl{trasbc} module as a surface boundary condition trend of  
    91 the first level temperature time evolution equation (see \autoref{eq:tra_sbc}  
    92 and \autoref{eq:tra_sbc_lin} in \autoref{subsec:TRA_sbc}).  
    93 The latter is the penetrative part of the heat flux. It is applied as a 3D  
    94 trends of the temperature equation (\mdl{traqsr} module) when \np{ln\_traqsr}\forcode{ = .true.}. 
    95 The way the light penetrates inside the water column is generally a sum of decreasing  
    96 exponentials (see \autoref{subsec:TRA_qsr}).  
     99The surface ocean stress is the stress exerted by the wind and the sea-ice on the ocean. 
     100It is applied in \mdl{dynzdf} module as a surface boundary condition of the computation of 
     101the momentum vertical mixing trend (see \autoref{eq:dynzdf_sbc} in \autoref{sec:DYN_zdf}). 
     102As such, it has to be provided as a 2D vector interpolated onto the horizontal velocity ocean mesh, 
     103$i.e.$ resolved onto the model (\textbf{i},\textbf{j}) direction at $u$- and $v$-points. 
     104 
     105The surface heat flux is decomposed into two parts, a non solar and a solar heat flux, 
     106$Q_{ns}$ and $Q_{sr}$, respectively. 
     107The former is the non penetrative part of the heat flux 
     108($i.e.$ the sum of sensible, latent and long wave heat fluxes plus 
     109the heat content of the mass exchange with the atmosphere and sea-ice). 
     110It is applied in \mdl{trasbc} module as a surface boundary condition trend of 
     111the first level temperature time evolution equation 
     112(see \autoref{eq:tra_sbc} and \autoref{eq:tra_sbc_lin} in \autoref{subsec:TRA_sbc}).  
     113The latter is the penetrative part of the heat flux. 
     114It is applied as a 3D trends of the temperature equation (\mdl{traqsr} module) when 
     115\np{ln\_traqsr}\forcode{ = .true.}. 
     116The way the light penetrates inside the water column is generally a sum of decreasing exponentials 
     117(see \autoref{subsec:TRA_qsr}).  
    97118 
    98119The surface freshwater budget is provided by the \textit{emp} field. 
    99 It represents the mass flux exchanged with the atmosphere (evaporation minus precipitation)  
    100 and possibly with the sea-ice and ice shelves (freezing minus melting of ice).  
    101 It affects both the ocean in two different ways:  
    102 $(i)$   it changes the volume of the ocean and therefore appears in the sea surface height  
    103 equation as a volume flux, and  
    104 $(ii)$  it changes the surface temperature and salinity through the heat and salt contents  
    105 of the mass exchanged with the atmosphere, the sea-ice and the ice shelves.  
     120It represents the mass flux exchanged with the atmosphere (evaporation minus precipitation) and 
     121possibly with the sea-ice and ice shelves (freezing minus melting of ice). 
     122It affects both the ocean in two different ways: 
     123$(i)$  it changes the volume of the ocean and therefore appears in the sea surface height equation as 
     124a volume flux, and  
     125$(ii)$ it changes the surface temperature and salinity through the heat and salt contents of 
     126the mass exchanged with the atmosphere, the sea-ice and the ice shelves.  
    106127 
    107128 
     
    129150%\colorbox{yellow}{End Miss } 
    130151 
    131 The ocean model provides, at each time step, to the surface module (\mdl{sbcmod})  
     152The ocean model provides, at each time step, to the surface module (\mdl{sbcmod}) 
    132153the surface currents, temperature and salinity.   
    133 These variables are averaged over \np{nn\_fsbc} time-step (\autoref{tab:ssm}),  
    134 and it is these averaged fields which are used to computes the surface fluxes  
    135 at a frequency of \np{nn\_fsbc} time-step. 
     154These variables are averaged over \np{nn\_fsbc} time-step (\autoref{tab:ssm}), and 
     155it is these averaged fields which are used to computes the surface fluxes at a frequency of \np{nn\_fsbc} time-step. 
    136156 
    137157 
     
    145165Sea surface salinty              & sss\_m & $psu$        & T \\   \hline 
    146166\end{tabular} 
    147 \caption{  \protect\label{tab:ssm}    
    148 Ocean variables provided by the ocean to the surface module (SBC).  
    149 The variable are averaged over nn{\_}fsbc time step,  
    150 $i.e.$ the frequency of computation of surface fluxes.} 
     167\caption{  \protect\label{tab:ssm} 
     168  Ocean variables provided by the ocean to the surface module (SBC). 
     169  The variable are averaged over nn{\_}fsbc time step, 
     170  $i.e.$ the frequency of computation of surface fluxes.} 
    151171\end{center}   \end{table} 
    152172%-------------------------------------------------------------------------------------------------------------- 
     
    161181\label{sec:SBC_input} 
    162182 
    163 A generic interface has been introduced to manage the way input data (2D or 3D fields,  
    164 like surface forcing or ocean T and S) are specify in \NEMO. This task is archieved by \mdl{fldread}.  
     183A generic interface has been introduced to manage the way input data 
     184(2D or 3D fields, like surface forcing or ocean T and S) are specify in \NEMO. 
     185This task is archieved by \mdl{fldread}. 
    165186The module was design with four main objectives in mind:  
    166 \begin{enumerate}   
    167 \item optionally provide a time interpolation of the input data at model time-step,  
    168 whatever their input frequency is, and according to the different calendars available in the model. 
    169 \item optionally provide an on-the-fly space interpolation from the native input data grid to the model grid. 
    170 \item make the run duration independent from the period cover by the input files. 
    171 \item provide a simple user interface and a rather simple developer interface by limiting the  
    172  number of prerequisite information.  
     187\begin{enumerate} 
     188\item 
     189  optionally provide a time interpolation of the input data at model time-step, whatever their input frequency is, 
     190  and according to the different calendars available in the model. 
     191\item 
     192  optionally provide an on-the-fly space interpolation from the native input data grid to the model grid. 
     193\item 
     194  make the run duration independent from the period cover by the input files. 
     195\item 
     196  provide a simple user interface and a rather simple developer interface by 
     197  limiting the number of prerequisite information.  
    173198\end{enumerate}   
    174199 
    175 As a results the user have only to fill in for each variable a structure in the namelist file  
    176 to defined the input data file and variable names, the frequency of the data (in hours or months),  
    177 whether its is climatological data or not, the period covered by the input file (one year, month, week or day),  
    178 and three additional parameters for on-the-fly interpolation. When adding a new input variable,  
    179 the developer has to add the associated structure in the namelist, read this information  
    180 by mirroring the namelist read in \rou{sbc\_blk\_init} for example, and simply call \rou{fld\_read}  
    181 to obtain the desired input field at the model time-step and grid points. 
     200As a results the user have only to fill in for each variable a structure in the namelist file to 
     201define the input data file and variable names, the frequency of the data (in hours or months), 
     202whether its is climatological data or not, the period covered by the input file (one year, month, week or day), 
     203and three additional parameters for on-the-fly interpolation. 
     204When adding a new input variable, the developer has to add the associated structure in the namelist, 
     205read this information by mirroring the namelist read in \rou{sbc\_blk\_init} for example, 
     206and simply call \rou{fld\_read} to obtain the desired input field at the model time-step and grid points. 
    182207 
    183208The only constraints are that the input file is a NetCDF file, the file name follows a nomenclature  
    184 (see \autoref{subsec:SBC_fldread}), the period it cover is one year, month, week or day, and, if on-the-fly  
    185 interpolation is used, a file of weights must be supplied (see \autoref{subsec:SBC_iof}). 
    186  
    187 Note that when an input data is archived on a disc which is accessible directly  
    188 from the workspace where the code is executed, then the use can set the \np{cn\_dir}  
    189 to the pathway leading to the data. By default, the data are assumed to have been  
    190 copied so that cn\_dir='./'. 
     209(see \autoref{subsec:SBC_fldread}), the period it cover is one year, month, week or day, and, 
     210if on-the-fly interpolation is used, a file of weights must be supplied (see \autoref{subsec:SBC_iof}). 
     211 
     212Note that when an input data is archived on a disc which is accessible directly from the workspace where 
     213the code is executed, then the use can set the \np{cn\_dir} to the pathway leading to the data. 
     214By default, the data are assumed to have been copied so that cn\_dir='./'. 
    191215 
    192216% ------------------------------------------------------------------------------------------------------------- 
     
    203227where  
    204228\begin{description}   
    205 \item[File name]: the stem name of the NetCDF file to be open.  
    206 This stem will be completed automatically by the model, with the addition of a '.nc' at its end  
    207 and by date information and possibly a prefix (when using AGRIF).  
    208 Tab.\autoref{tab:fldread} provides the resulting file name in all possible cases according to whether  
    209 it is a climatological file or not, and to the open/close frequency (see below for definition).  
     229\item[File name]: 
     230  the stem name of the NetCDF file to be open. 
     231  This stem will be completed automatically by the model, with the addition of a '.nc' at its end and 
     232  by date information and possibly a prefix (when using AGRIF). 
     233  Tab.\autoref{tab:fldread} provides the resulting file name in all possible cases according to 
     234  whether it is a climatological file or not, and to the open/close frequency (see below for definition). 
    210235 
    211236%--------------------------------------------------TABLE-------------------------------------------------- 
     
    219244\end{tabular} 
    220245\end{center} 
    221 \caption{ \protect\label{tab:fldread}   naming nomenclature for climatological or interannual input file,  
    222 as a function of the Open/close frequency. The stem name is assumed to be 'fn'.  
    223 For weekly files, the 'LLL' corresponds to the first three letters of the first day of the week ($i.e.$ 'sun','sat','fri','thu','wed','tue','mon'). The 'YYYY', 'MM' and 'DD' should be replaced by the  
    224 actual year/month/day, always coded with 4 or 2 digits. Note that (1) in mpp, if the file is split  
    225 over each subdomain, the suffix '.nc' is replaced by '\_PPPP.nc', where 'PPPP' is the  
    226 process number coded with 4 digits; (2) when using AGRIF, the prefix 
    227 '\_N' is added to files,  
    228 where 'N'  is the child grid number.} 
     246\caption{ \protect\label{tab:fldread} 
     247  naming nomenclature for climatological or interannual input file, as a function of the Open/close frequency. 
     248  The stem name is assumed to be 'fn'. 
     249  For weekly files, the 'LLL' corresponds to the first three letters of the first day of the week 
     250  ($i.e.$ 'sun','sat','fri','thu','wed','tue','mon'). 
     251  The 'YYYY', 'MM' and 'DD' should be replaced by the actual year/month/day, always coded with 4 or 2 digits. 
     252  Note that (1) in mpp, if the file is split over each subdomain, the suffix '.nc' is replaced by '\_PPPP.nc', 
     253  where 'PPPP' is the process number coded with 4 digits; 
     254  (2) when using AGRIF, the prefix '\_N' is added to files, where 'N'  is the child grid number.} 
    229255\end{table} 
    230256%-------------------------------------------------------------------------------------------------------------- 
    231257   
    232258 
    233 \item[Record frequency]: the frequency of the records contained in the input file.  
    234 Its unit is in hours if it is positive (for example 24 for daily forcing) or in months if negative  
    235 (for example -1 for monthly forcing or -12 for annual forcing).  
    236 Note that this frequency must really be an integer and not a real.  
    237 On some computers, seting it to '24.' can be interpreted as 240! 
    238  
    239 \item[Variable name]: the name of the variable to be read in the input NetCDF file. 
    240  
    241 \item[Time interpolation]: a logical to activate, or not, the time interpolation. If set to 'false',  
    242 the forcing will have a steplike shape remaining constant during each forcing period.  
    243 For example, when using a daily forcing without time interpolation, the forcing remaining  
    244 constant from 00h00'00'' to 23h59'59". If set to 'true', the forcing will have a broken line shape.  
    245 Records are assumed to be dated the middle of the forcing period.  
    246 For example, when using a daily forcing with time interpolation, linear interpolation will  
    247 be performed between mid-day of two consecutive days.  
    248  
    249 \item[Climatological forcing]: a logical to specify if a input file contains climatological forcing  
    250 which can be cycle in time, or an interannual forcing which will requires additional files  
    251 if the period covered by the simulation exceed the one of the file. See the above the file  
    252 naming strategy which impacts the expected name of the file to be opened.  
    253  
    254 \item[Open/close frequency]: the frequency at which forcing files must be opened/closed.  
    255 Four cases are coded: 'daily', 'weekLLL' (with 'LLL' the first 3 letters of the first day of the week),  
    256 'monthly' and 'yearly' which means the forcing files will contain data for one day, one week,  
    257 one month or one year. Files are assumed to contain data from the beginning of the open/close period.  
    258 For example, the first record of a yearly file containing daily data is Jan 1st even if the experiment  
    259 is not starting at the beginning of the year.  
    260  
    261 \item[Others]: 'weights filename', 'pairing rotation' and 'land/sea mask' are associted with on-the-fly interpolation  
    262 which is described in \autoref{subsec:SBC_iof}. 
     259\item[Record frequency]: 
     260  the frequency of the records contained in the input file. 
     261  Its unit is in hours if it is positive (for example 24 for daily forcing) or in months if negative 
     262  (for example -1 for monthly forcing or -12 for annual forcing). 
     263  Note that this frequency must really be an integer and not a real. 
     264  On some computers, seting it to '24.' can be interpreted as 240! 
     265 
     266\item[Variable name]: 
     267  the name of the variable to be read in the input NetCDF file. 
     268 
     269\item[Time interpolation]: 
     270  a logical to activate, or not, the time interpolation. 
     271  If set to 'false', the forcing will have a steplike shape remaining constant during each forcing period. 
     272  For example, when using a daily forcing without time interpolation, the forcing remaining constant from 
     273  00h00'00'' to 23h59'59". 
     274  If set to 'true', the forcing will have a broken line shape. 
     275  Records are assumed to be dated the middle of the forcing period. 
     276  For example, when using a daily forcing with time interpolation, 
     277  linear interpolation will be performed between mid-day of two consecutive days.  
     278 
     279\item[Climatological forcing]: 
     280  a logical to specify if a input file contains climatological forcing which can be cycle in time, 
     281  or an interannual forcing which will requires additional files if 
     282  the period covered by the simulation exceed the one of the file. 
     283  See the above the file naming strategy which impacts the expected name of the file to be opened.  
     284 
     285\item[Open/close frequency]: 
     286  the frequency at which forcing files must be opened/closed. 
     287  Four cases are coded: 
     288  'daily', 'weekLLL' (with 'LLL' the first 3 letters of the first day of the week), 'monthly' and 'yearly' which 
     289  means the forcing files will contain data for one day, one week, one month or one year. 
     290  Files are assumed to contain data from the beginning of the open/close period. 
     291  For example, the first record of a yearly file containing daily data is Jan 1st even if 
     292  the experiment is not starting at the beginning of the year.  
     293 
     294\item[Others]: 
     295  'weights filename', 'pairing rotation' and 'land/sea mask' are associated with 
     296  on-the-fly interpolation which is described in \autoref{subsec:SBC_iof}. 
    263297 
    264298\end{description} 
    265299 
    266300Additional remarks:\\ 
    267 (1) The time interpolation is a simple linear interpolation between two consecutive records of  
    268 the input data. The only tricky point is therefore to specify the date at which we need to do  
    269 the interpolation and the date of the records read in the input files.  
    270 Following \citet{Leclair_Madec_OM09}, the date of a time step is set at the middle of the  
    271 time step. For example, for an experiment starting at 0h00'00" with a one hour time-step,  
     301(1) The time interpolation is a simple linear interpolation between two consecutive records of the input data. 
     302The only tricky point is therefore to specify the date at which we need to do the interpolation and 
     303the date of the records read in the input files. 
     304Following \citet{Leclair_Madec_OM09}, the date of a time step is set at the middle of the time step. 
     305For example, for an experiment starting at 0h00'00" with a one hour time-step, 
    272306a time interpolation will be performed at the following time: 0h30'00", 1h30'00", 2h30'00", etc. 
    273 However, for forcing data related to the surface module, values are not needed at every  
    274 time-step but at every \np{nn\_fsbc} time-step. For example with \np{nn\_fsbc}\forcode{ = 3},  
    275 the surface module will be called at time-steps 1, 4, 7, etc. The date used for the time interpolation  
    276 is thus redefined to be at the middle of \np{nn\_fsbc} time-step period. In the previous example,  
    277 this leads to: 1h30'00", 4h30'00", 7h30'00", etc. \\  
    278 (2) For code readablility and maintenance issues, we don't take into account the NetCDF input file  
    279 calendar. The calendar associated with the forcing field is build according to the information  
    280 provided by user in the record frequency, the open/close frequency and the type of temporal interpolation.  
    281 For example, the first record of a yearly file containing daily data that will be interpolated in time  
    282 is assumed to be start Jan 1st at 12h00'00" and end Dec 31st at 12h00'00". \\ 
    283 (3) If a time interpolation is requested, the code will pick up the needed data in the previous (next) file  
    284 when interpolating data with the first (last) record of the open/close period.  
     307However, for forcing data related to the surface module, 
     308values are not needed at every time-step but at every \np{nn\_fsbc} time-step. 
     309For example with \np{nn\_fsbc}\forcode{ = 3}, the surface module will be called at time-steps 1, 4, 7, etc. 
     310The date used for the time interpolation is thus redefined to be at the middle of \np{nn\_fsbc} time-step period. 
     311In the previous example, this leads to: 1h30'00", 4h30'00", 7h30'00", etc. \\  
     312(2) For code readablility and maintenance issues, we don't take into account the NetCDF input file calendar. 
     313The calendar associated with the forcing field is build according to the information provided by 
     314user in the record frequency, the open/close frequency and the type of temporal interpolation. 
     315For example, the first record of a yearly file containing daily data that will be interpolated in time is assumed to 
     316be start Jan 1st at 12h00'00" and end Dec 31st at 12h00'00". \\ 
     317(3) If a time interpolation is requested, the code will pick up the needed data in the previous (next) file when 
     318interpolating data with the first (last) record of the open/close period. 
    285319For example, if the input file specifications are ''yearly, containing daily data to be interpolated in time'',  
    286 the values given by the code between 00h00'00" and 11h59'59" on Jan 1st will be interpolated values  
    287 between Dec 31st 12h00'00" and Jan 1st 12h00'00". If the forcing is climatological, Dec and Jan will  
    288 be keep-up from the same year. However, if the forcing is not climatological, at the end of the  
    289 open/close period the code will automatically close the current file and open the next one.  
    290 Note that, if the experiment is starting (ending) at the beginning (end) of an open/close period  
    291 we do accept that the previous (next) file is not existing. In this case, the time interpolation  
    292 will be performed between two identical values. For example, when starting an experiment on  
    293 Jan 1st of year Y with yearly files and daily data to be interpolated, we do accept that the file  
    294 related to year Y-1 is not existing. The value of Jan 1st will be used as the missing one for  
    295 Dec 31st of year Y-1. If the file of year Y-1 exists, the code will read its last record.  
    296 Therefore, this file can contain only one record corresponding to Dec 31st, a useful feature for  
    297 user considering that it is too heavy to manipulate the complete file for year Y-1. 
     320the values given by the code between 00h00'00" and 11h59'59" on Jan 1st will be interpolated values between 
     321Dec 31st 12h00'00" and Jan 1st 12h00'00". 
     322If the forcing is climatological, Dec and Jan will be keep-up from the same year. 
     323However, if the forcing is not climatological, at the end of 
     324the open/close period the code will automatically close the current file and open the next one. 
     325Note that, if the experiment is starting (ending) at the beginning (end) of 
     326an open/close period we do accept that the previous (next) file is not existing. 
     327In this case, the time interpolation will be performed between two identical values. 
     328For example, when starting an experiment on Jan 1st of year Y with yearly files and daily data to be interpolated, 
     329we do accept that the file related to year Y-1 is not existing. 
     330The value of Jan 1st will be used as the missing one for Dec 31st of year Y-1. 
     331If the file of year Y-1 exists, the code will read its last record.  
     332Therefore, this file can contain only one record corresponding to Dec 31st, 
     333a useful feature for user considering that it is too heavy to manipulate the complete file for year Y-1. 
    298334 
    299335 
     
    304340\label{subsec:SBC_iof} 
    305341 
    306 Interpolation on the Fly allows the user to supply input files required 
    307 for the surface forcing on grids other than the model grid. 
    308 To do this he or she must supply, in addition to the source data file, 
    309 a file of weights to be used to interpolate from the data grid to the model grid. 
    310 The original development of this code used the SCRIP package (freely available  
    311 \href{http://climate.lanl.gov/Software/SCRIP}{here} under a copyright agreement). 
    312 In principle, any package can be used to generate the weights, but the 
    313 variables in the input weights file must have the same names and meanings as 
    314 assumed by the model. 
     342Interpolation on the Fly allows the user to supply input files required for the surface forcing on 
     343grids other than the model grid. 
     344To do this he or she must supply, in addition to the source data file, a file of weights to be used to 
     345interpolate from the data grid to the model grid. 
     346The original development of this code used the SCRIP package 
     347(freely available \href{http://climate.lanl.gov/Software/SCRIP}{here} under a copyright agreement). 
     348In principle, any package can be used to generate the weights, but the variables in 
     349the input weights file must have the same names and meanings as assumed by the model. 
    315350Two methods are currently available: bilinear and bicubic interpolation. 
    316 Prior to the interpolation, providing a land/sea mask file, the user can decide to 
    317  remove land points from the input file and substitute the corresponding values  
    318 with the average of the 8 neighbouring points in the native external grid. 
    319  Only "sea points" are considered for the averaging. The land/sea mask file must  
    320 be provided in the structure associated with the input variable. 
    321  The netcdf land/sea mask variable name must be 'LSM' it must have the same  
    322 horizontal and vertical dimensions of the associated variable and should  
    323 be equal to 1 over land and 0 elsewhere. 
    324 The procedure can be recursively applied setting nn\_lsm > 1 in namsbc namelist.  
     351Prior to the interpolation, providing a land/sea mask file, the user can decide to remove land points from 
     352the input file and substitute the corresponding values with the average of the 8 neighbouring points in 
     353the native external grid. 
     354Only "sea points" are considered for the averaging. 
     355The land/sea mask file must be provided in the structure associated with the input variable. 
     356The netcdf land/sea mask variable name must be 'LSM' it must have the same horizontal and vertical dimensions of 
     357the associated variable and should be equal to 1 over land and 0 elsewhere. 
     358The procedure can be recursively applied setting nn\_lsm > 1 in namsbc namelist. 
    325359Note that nn\_lsm=0 forces the code to not apply the procedure even if a file for land/sea mask is supplied. 
    326360 
     
    328362\label{subsec:SBC_iof_bilinear} 
    329363 
    330 The input weights file in this case has two sets of variables: src01, src02, 
    331 src03, src04 and wgt01, wgt02, wgt03, wgt04. 
    332 The "src" variables correspond to the point in the input grid to which the weight 
    333 "wgt" is to be applied. Each src value is an integer corresponding to the index of a  
    334 point in the input grid when written as a one dimensional array.  For example, for an input grid 
    335 of size 5x10, point (3,2) is referenced as point 8, since (2-1)*5+3=8. 
     364The input weights file in this case has two sets of variables: 
     365src01, src02, src03, src04 and wgt01, wgt02, wgt03, wgt04. 
     366The "src" variables correspond to the point in the input grid to which the weight "wgt" is to be applied. 
     367Each src value is an integer corresponding to the index of a point in the input grid when 
     368written as a one dimensional array. 
     369For example, for an input grid of size 5x10, point (3,2) is referenced as point 8, since (2-1)*5+3=8. 
    336370There are four of each variable because bilinear interpolation uses the four points defining 
    337371the grid box containing the point to be interpolated. 
    338 All of these arrays are on the model grid, so that values src01(i,j) and 
    339 wgt01(i,j) are used to generate a value for point (i,j) in the model. 
     372All of these arrays are on the model grid, so that values src01(i,j) and wgt01(i,j) are used to 
     373generate a value for point (i,j) in the model. 
    340374 
    341375Symbolically, the algorithm used is: 
    342  
    343376\begin{equation} 
    344377f_{m}(i,j) = f_{m}(i,j) + \sum_{k=1}^{4} {wgt(k)f(idx(src(k)))} 
     
    361394\end{split} 
    362395\end{equation*} 
    363 The gradients here are taken with respect to the horizontal indices and not distances since the spatial dependency has been absorbed into the weights. 
     396The gradients here are taken with respect to the horizontal indices and not distances since 
     397the spatial dependency has been absorbed into the weights. 
    364398 
    365399\subsubsection{Implementation} 
    366400\label{subsec:SBC_iof_imp} 
    367401 
    368 To activate this option, a non-empty string should be supplied in the weights filename column  
    369 of the relevant namelist; if this is left as an empty string no action is taken. 
    370 In the model, weights files are read in and stored in a structured type (WGT) in the fldread  
    371 module, as and when they are first required. 
    372 This initialisation procedure determines whether the input data grid should be treated  
    373 as cyclical or not by inspecting a global attribute stored in the weights input file. 
     402To activate this option, a non-empty string should be supplied in 
     403the weights filename column of the relevant namelist; 
     404if this is left as an empty string no action is taken. 
     405In the model, weights files are read in and stored in a structured type (WGT) in the fldread module, 
     406as and when they are first required. 
     407This initialisation procedure determines whether the input data grid should be treated as cyclical or not by 
     408inspecting a global attribute stored in the weights input file. 
    374409This attribute must be called "ew\_wrap" and be of integer type. 
    375410If it is negative, the input non-model grid is assumed not to be cyclic. 
     
    378413if longitudes are 0.5, 2.5, .... , 358.5, 360.5, 362.5, ew\_wrap should be 2. 
    379414If the model does not find attribute ew\_wrap, then a value of -999 is assumed. 
    380 In this case the \rou{fld\_read} routine defaults ew\_wrap to value 0 and therefore the grid  
    381 is assumed to be cyclic with no overlapping columns. 
     415In this case the \rou{fld\_read} routine defaults ew\_wrap to value 0 and 
     416therefore the grid is assumed to be cyclic with no overlapping columns. 
    382417(In fact this only matters when bicubic interpolation is required.) 
    383 Note that no testing is done to check the validity in the model, since there is no way  
    384 of knowing the name used for the longitude variable, 
     418Note that no testing is done to check the validity in the model, 
     419since there is no way of knowing the name used for the longitude variable, 
    385420so it is up to the user to make sure his or her data is correctly represented. 
    386421 
    387422Next the routine reads in the weights. 
    388 Bicubic interpolation is assumed if it finds a variable with name "src05", otherwise  
    389 bilinear interpolation is used. The WGT structure includes dynamic arrays both for  
    390 the storage of the weights (on the model grid), and when required, for reading in  
    391 the variable to be interpolated (on the input data grid). 
    392 The size of the input data array is determined by examining the values in the "src"  
    393 arrays to find the minimum and maximum i and j values required. 
    394 Since bicubic interpolation requires the calculation of gradients at each point on the grid,  
     423Bicubic interpolation is assumed if it finds a variable with name "src05", otherwise bilinear interpolation is used. 
     424The WGT structure includes dynamic arrays both for the storage of the weights (on the model grid), 
     425and when required, for reading in the variable to be interpolated (on the input data grid). 
     426The size of the input data array is determined by examining the values in the "src" arrays to 
     427find the minimum and maximum i and j values required. 
     428Since bicubic interpolation requires the calculation of gradients at each point on the grid, 
    395429the corresponding arrays are dimensioned with a halo of width one grid point all the way around. 
    396 When the array of points from the data file is adjacent to an edge of the data grid,  
    397 the halo is either a copy of the row/column next to it (non-cyclical case), or is a copy  
    398 of one from the first few columns on the opposite side of the grid (cyclical case). 
     430When the array of points from the data file is adjacent to an edge of the data grid, 
     431the halo is either a copy of the row/column next to it (non-cyclical case), 
     432or is a copy of one from the first few columns on the opposite side of the grid (cyclical case). 
    399433 
    400434\subsubsection{Limitations} 
     
    402436 
    403437\begin{enumerate}   
    404 \item  The case where input data grids are not logically rectangular has not been tested. 
    405 \item  This code is not guaranteed to produce positive definite answers from positive definite inputs 
    406           when a bicubic interpolation method is used. 
    407 \item  The cyclic condition is only applied on left and right columns, and not to top and bottom rows. 
    408 \item  The gradients across the ends of a cyclical grid assume that the grid spacing between  
    409           the two columns involved are consistent with the weights used. 
    410 \item  Neither interpolation scheme is conservative. (There is a conservative scheme available  
    411           in SCRIP, but this has not been implemented.) 
     438\item 
     439  The case where input data grids are not logically rectangular has not been tested. 
     440\item 
     441  This code is not guaranteed to produce positive definite answers from positive definite inputs when 
     442  a bicubic interpolation method is used. 
     443\item 
     444  The cyclic condition is only applied on left and right columns, and not to top and bottom rows. 
     445\item 
     446  The gradients across the ends of a cyclical grid assume that the grid spacing between 
     447  the two columns involved are consistent with the weights used. 
     448\item 
     449  Neither interpolation scheme is conservative. (There is a conservative scheme available in SCRIP, 
     450  but this has not been implemented.) 
    412451\end{enumerate} 
    413452 
     
    416455 
    417456% to be completed 
    418 A set of utilities to create a weights file for a rectilinear input grid is available  
     457A set of utilities to create a weights file for a rectilinear input grid is available 
    419458(see the directory NEMOGCM/TOOLS/WEIGHTS). 
    420459 
     
    430469%-------------------------------------------------------------------------------------------------------------- 
    431470 
    432 In some circumstances it may be useful to avoid calculating the 3D temperature, salinity and velocity fields  
    433 and simply read them in from a previous run or receive them from OASIS.   
     471In some circumstances it may be useful to avoid calculating the 3D temperature, 
     472salinity and velocity fields and simply read them in from a previous run or receive them from OASIS.   
    434473For example: 
    435474 
    436475\begin{itemize} 
    437 \item  Multiple runs of the model are required in code development to see the effect of different algorithms in 
    438        the bulk formulae. 
    439 \item  The effect of different parameter sets in the ice model is to be examined. 
    440 \item  Development of sea-ice algorithms or parameterizations. 
    441 \item  spinup of the iceberg floats 
    442 \item  ocean/sea-ice simulation with both media running in parallel (\np{ln\_mixcpl}\forcode{ = .true.}) 
     476\item 
     477  Multiple runs of the model are required in code development to 
     478  see the effect of different algorithms in the bulk formulae. 
     479\item 
     480  The effect of different parameter sets in the ice model is to be examined. 
     481\item 
     482  Development of sea-ice algorithms or parameterizations. 
     483\item 
     484  Spinup of the iceberg floats 
     485\item 
     486  Ocean/sea-ice simulation with both media running in parallel (\np{ln\_mixcpl}\forcode{ = .true.}) 
    443487\end{itemize} 
    444488 
     
    446490Its options are defined through the \ngn{namsbc\_sas} namelist variables. 
    447491A new copy of the model has to be compiled with a configuration based on ORCA2\_SAS\_LIM. 
    448 However no namelist parameters need be changed from the settings of the previous run (except perhaps nn{\_}date0) 
     492However no namelist parameters need be changed from the settings of the previous run (except perhaps nn{\_}date0). 
    449493In this configuration, a few routines in the standard model are overriden by new versions. 
    450494Routines replaced are: 
    451495 
    452496\begin{itemize} 
    453 \item \mdl{nemogcm} : This routine initialises the rest of the model and repeatedly calls the stp time stepping routine (\mdl{step}) 
    454        Since the ocean state is not calculated all associated initialisations have been removed. 
    455 \item  \mdl{step} : The main time stepping routine now only needs to call the sbc routine (and a few utility functions). 
    456 \item  \mdl{sbcmod} : This has been cut down and now only calculates surface forcing and the ice model required.  New surface modules 
    457        that can function when only the surface level of the ocean state is defined can also be added (e.g. icebergs). 
    458 \item  \mdl{daymod} : No ocean restarts are read or written (though the ice model restarts are retained), so calls to restart functions 
    459        have been removed.  This also means that the calendar cannot be controlled by time in a restart file, so the user 
    460        must make sure that nn{\_}date0 in the model namelist is correct for his or her purposes. 
    461 \item  \mdl{stpctl} : Since there is no free surface solver, references to it have been removed from \rou{stp\_ctl} module. 
    462 \item  \mdl{diawri} : All 3D data have been removed from the output.  The surface temperature, salinity and velocity components (which 
    463        have been read in) are written along with relevant forcing and ice data. 
     497\item 
     498  \mdl{nemogcm}: 
     499  This routine initialises the rest of the model and repeatedly calls the stp time stepping routine (\mdl{step}). 
     500  Since the ocean state is not calculated all associated initialisations have been removed. 
     501\item 
     502  \mdl{step}: 
     503  The main time stepping routine now only needs to call the sbc routine (and a few utility functions). 
     504\item 
     505  \mdl{sbcmod}: 
     506  This has been cut down and now only calculates surface forcing and the ice model required. 
     507  New surface modules that can function when only the surface level of the ocean state is defined can also be added 
     508  (e.g. icebergs). 
     509\item 
     510  \mdl{daymod}: 
     511  No ocean restarts are read or written (though the ice model restarts are retained), 
     512  so calls to restart functions have been removed. 
     513  This also means that the calendar cannot be controlled by time in a restart file, 
     514  so the user must make sure that nn{\_}date0 in the model namelist is correct for his or her purposes. 
     515\item 
     516  \mdl{stpctl}: 
     517  Since there is no free surface solver, references to it have been removed from \rou{stp\_ctl} module. 
     518\item 
     519  \mdl{diawri}: 
     520  All 3D data have been removed from the output. 
     521  The surface temperature, salinity and velocity components (which have been read in) are written along with 
     522  relevant forcing and ice data. 
    464523\end{itemize} 
    465524 
     
    467526 
    468527\begin{itemize} 
    469 \item  \mdl{sbcsas} : This module initialises the input files needed for reading temperature, salinity and velocity arrays at the surface. 
    470        These filenames are supplied in namelist namsbc{\_}sas.  Unfortunately because of limitations with the \mdl{iom} module, 
    471        the full 3D fields from the mean files have to be read in and interpolated in time, before using just the top level. 
    472        Since fldread is used to read in the data, Interpolation on the Fly may be used to change input data resolution. 
     528\item 
     529  \mdl{sbcsas}: 
     530  This module initialises the input files needed for reading temperature, salinity and 
     531  velocity arrays at the surface. 
     532  These filenames are supplied in namelist namsbc{\_}sas. 
     533  Unfortunately because of limitations with the \mdl{iom} module, 
     534  the full 3D fields from the mean files have to be read in and interpolated in time, 
     535  before using just the top level. 
     536  Since fldread is used to read in the data, Interpolation on the Fly may be used to change input data resolution. 
    473537\end{itemize} 
    474538 
     
    492556 
    493557The analytical formulation of the surface boundary condition is the default scheme. 
    494 In this case, all the six fluxes needed by the ocean are assumed to  
    495 be uniform in space. They take constant values given in the namelist  
    496 \ngn{namsbc{\_}ana} by the variables \np{rn\_utau0}, \np{rn\_vtau0}, \np{rn\_qns0},  
    497 \np{rn\_qsr0}, and \np{rn\_emp0} ($\textit{emp}=\textit{emp}_S$). The runoff is set to zero.  
    498 In addition, the wind is allowed to reach its nominal value within a given number  
    499 of time steps (\np{nn\_tau000}). 
    500  
    501 If a user wants to apply a different analytical forcing, the \mdl{sbcana}  
    502 module can be modified to use another scheme. As an example,  
    503 the \mdl{sbc\_ana\_gyre} routine provides the analytical forcing for the  
    504 GYRE configuration (see GYRE configuration manual, in preparation). 
     558In this case, all the six fluxes needed by the ocean are assumed to be uniform in space. 
     559They take constant values given in the namelist \ngn{namsbc{\_}ana} by 
     560the variables \np{rn\_utau0}, \np{rn\_vtau0}, \np{rn\_qns0}, \np{rn\_qsr0}, and \np{rn\_emp0} 
     561($\textit{emp}=\textit{emp}_S$). 
     562The runoff is set to zero. 
     563In addition, the wind is allowed to reach its nominal value within a given number of time steps (\np{nn\_tau000}). 
     564 
     565If a user wants to apply a different analytical forcing, 
     566the \mdl{sbcana} module can be modified to use another scheme. 
     567As an example, the \mdl{sbc\_ana\_gyre} routine provides the analytical forcing for the GYRE configuration 
     568(see GYRE configuration manual, in preparation). 
    505569 
    506570 
     
    515579%------------------------------------------------------------------------------------------------------------- 
    516580 
    517 In the flux formulation (\np{ln\_flx}\forcode{ = .true.}), the surface boundary  
    518 condition fields are directly read from input files. The user has to define  
    519 in the namelist \ngn{namsbc{\_}flx} the name of the file, the name of the variable  
    520 read in the file, the time frequency at which it is given (in hours), and a logical  
    521 setting whether a time interpolation to the model time step is required  
    522 for this field. See \autoref{subsec:SBC_fldread} for a more detailed description of the parameters. 
    523  
    524 Note that in general, a flux formulation is used in associated with a  
    525 restoring term to observed SST and/or SSS. See \autoref{subsec:SBC_ssr} for its  
    526 specification. 
     581In the flux formulation (\np{ln\_flx}\forcode{ = .true.}), 
     582the surface boundary condition fields are directly read from input files. 
     583The user has to define in the namelist \ngn{namsbc{\_}flx} the name of the file, 
     584the name of the variable read in the file, the time frequency at which it is given (in hours), 
     585and a logical setting whether a time interpolation to the model time step is required for this field. 
     586See \autoref{subsec:SBC_fldread} for a more detailed description of the parameters. 
     587 
     588Note that in general, a flux formulation is used in associated with a restoring term to observed SST and/or SSS. 
     589See \autoref{subsec:SBC_ssr} for its specification. 
    527590 
    528591 
     
    534597\label{sec:SBC_blk} 
    535598 
    536 In the bulk formulation, the surface boundary condition fields are computed  
    537 using bulk formulae and atmospheric fields and ocean (and ice) variables.  
    538  
    539 The atmospheric fields used depend on the bulk formulae used. Three bulk formulations  
    540 are available : the CORE, the CLIO and the MFS bulk formulea. The choice is made by setting to true 
    541 one of the following namelist variable : \np{ln\_core} ; \np{ln\_clio} or  \np{ln\_mfs}. 
    542  
    543 Note : in forced mode, when a sea-ice model is used, a bulk formulation (CLIO or CORE) have to be used.  
    544 Therefore the two bulk (CLIO and CORE) formulea include the computation of the fluxes over both  
    545 an ocean and an ice surface.  
     599In the bulk formulation, the surface boundary condition fields are computed using bulk formulae and atmospheric fields and ocean (and ice) variables. 
     600 
     601The atmospheric fields used depend on the bulk formulae used. 
     602Three bulk formulations are available: 
     603the CORE, the CLIO and the MFS bulk formulea. 
     604The choice is made by setting to true one of the following namelist variable: 
     605\np{ln\_core} ; \np{ln\_clio} or  \np{ln\_mfs}. 
     606 
     607Note: 
     608in forced mode, when a sea-ice model is used, a bulk formulation (CLIO or CORE) have to be used. 
     609Therefore the two bulk (CLIO and CORE) formulea include the computation of the fluxes over 
     610both an ocean and an ice surface.  
    546611 
    547612% ------------------------------------------------------------------------------------------------------------- 
     
    555620%------------------------------------------------------------------------------------------------------------- 
    556621 
    557 The CORE bulk formulae have been developed by \citet{Large_Yeager_Rep04}.  
    558 They have been designed to handle the CORE forcing, a mixture of NCEP  
    559 reanalysis and satellite data. They use an inertial dissipative method to compute  
    560 the turbulent transfer coefficients (momentum, sensible heat and evaporation)  
    561 from the 10 metre wind speed, air temperature and specific humidity. 
    562 This \citet{Large_Yeager_Rep04} dataset is available through the  
    563 \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}{GFDL web site}.  
    564  
    565 Note that substituting ERA40 to NCEP reanalysis fields  
    566 does not require changes in the bulk formulea themself.  
    567 This is the so-called DRAKKAR Forcing Set (DFS) \citep{Brodeau_al_OM09}.  
     622The CORE bulk formulae have been developed by \citet{Large_Yeager_Rep04}. 
     623They have been designed to handle the CORE forcing, a mixture of NCEP reanalysis and satellite data. 
     624They use an inertial dissipative method to compute the turbulent transfer coefficients 
     625(momentum, sensible heat and evaporation) from the 10 metre wind speed, air temperature and specific humidity. 
     626This \citet{Large_Yeager_Rep04} dataset is available through 
     627the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}{GFDL web site}. 
     628 
     629Note that substituting ERA40 to NCEP reanalysis fields does not require changes in the bulk formulea themself. 
     630This is the so-called DRAKKAR Forcing Set (DFS) \citep{Brodeau_al_OM09}. 
    568631 
    569632Options are defined through the  \ngn{namsbc\_core} namelist variables. 
     
    589652%-------------------------------------------------------------------------------------------------------------- 
    590653 
    591 Note that the air velocity is provided at a tracer ocean point, not at a velocity ocean  
    592 point ($u$- and $v$-points). It is simpler and faster (less fields to be read),  
    593 but it is not the recommended method when the ocean grid size is the same  
    594 or larger than the one of the input atmospheric fields. 
    595  
    596 The \np{sn\_wndi}, \np{sn\_wndj}, \np{sn\_qsr}, \np{sn\_qlw}, \np{sn\_tair}, \np{sn\_humi}, 
    597 \np{sn\_prec}, \np{sn\_snow}, \np{sn\_tdif} parameters describe the fields  
    598 and the way they have to be used (spatial and temporal interpolations).  
     654Note that the air velocity is provided at a tracer ocean point, not at a velocity ocean point ($u$- and $v$-points). 
     655It is simpler and faster (less fields to be read), but it is not the recommended method when 
     656the ocean grid size is the same or larger than the one of the input atmospheric fields. 
     657 
     658The \np{sn\_wndi}, \np{sn\_wndj}, \np{sn\_qsr}, \np{sn\_qlw}, \np{sn\_tair}, \np{sn\_humi}, \np{sn\_prec}, 
     659\np{sn\_snow}, \np{sn\_tdif} parameters describe the fields and the way they have to be used 
     660(spatial and temporal interpolations).  
    599661 
    600662\np{cn\_dir} is the directory of location of bulk files 
     
    603665\np{rn\_zu}: is the height of wind measurements (m) 
    604666 
    605 Three multiplicative factors are availables :  
    606 \np{rn\_pfac} and \np{rn\_efac} allows to adjust (if necessary) the global freshwater budget  
    607 by increasing/reducing the precipitations (total and snow) and or evaporation, respectively. 
    608 The third one,\np{rn\_vfac}, control to which extend the ice/ocean velocities are taken into account  
    609 in the calculation of surface wind stress. Its range should be between zero and one,  
    610 and it is recommended to set it to 0. 
     667Three multiplicative factors are availables:  
     668\np{rn\_pfac} and \np{rn\_efac} allows to adjust (if necessary) the global freshwater budget by 
     669increasing/reducing the precipitations (total and snow) and or evaporation, respectively. 
     670The third one,\np{rn\_vfac}, control to which extend the ice/ocean velocities are taken into account in 
     671the calculation of surface wind stress. 
     672Its range should be between zero and one, and it is recommended to set it to 0. 
    611673 
    612674% ------------------------------------------------------------------------------------------------------------- 
     
    620682%------------------------------------------------------------------------------------------------------------- 
    621683 
    622 The CLIO bulk formulae were developed several years ago for the  
    623 Louvain-la-neuve coupled ice-ocean model (CLIO, \cite{Goosse_al_JGR99}).  
    624 They are simpler bulk formulae. They assume the stress to be known and  
    625 compute the radiative fluxes from a climatological cloud cover.  
     684The CLIO bulk formulae were developed several years ago for the Louvain-la-neuve coupled ice-ocean model 
     685(CLIO, \cite{Goosse_al_JGR99}).  
     686They are simpler bulk formulae. 
     687They assume the stress to be known and compute the radiative fluxes from a climatological cloud cover.  
    626688 
    627689Options are defined through the  \ngn{namsbc\_clio} namelist variables. 
     
    647709%-------------------------------------------------------------------------------------------------------------- 
    648710 
    649 As for the flux formulation, information about the input data required by the  
    650 model is provided in the namsbc\_blk\_core or namsbc\_blk\_clio  
    651 namelist (see \autoref{subsec:SBC_fldread}).  
     711As for the flux formulation, information about the input data required by the model is provided in 
     712the namsbc\_blk\_core or namsbc\_blk\_clio namelist (see \autoref{subsec:SBC_fldread}).  
    652713 
    653714% ------------------------------------------------------------------------------------------------------------- 
     
    661722%---------------------------------------------------------------------------------------------------------- 
    662723 
    663 The MFS (Mediterranean Forecasting System) bulk formulae have been developed by 
    664  \citet{Castellari_al_JMS1998}.  
    665 They have been designed to handle the ECMWF operational data and are currently  
    666 in use in the MFS operational system \citep{Tonani_al_OS08}, \citep{Oddo_al_OS09}. 
     724The MFS (Mediterranean Forecasting System) bulk formulae have been developed by \citet{Castellari_al_JMS1998}.  
     725They have been designed to handle the ECMWF operational data and are currently in use in 
     726the MFS operational system \citep{Tonani_al_OS08}, \citep{Oddo_al_OS09}. 
    667727The wind stress computation uses a drag coefficient computed according to \citet{Hellerman_Rosenstein_JPO83}. 
    668 The surface boundary condition for temperature involves the balance between surface solar radiation, 
    669 net long-wave radiation, the latent and sensible heat fluxes. 
    670 Solar radiation is dependent on cloud cover and is computed by means of 
    671 an astronomical formula \citep{Reed_JPO77}. Albedo monthly values are from \citet{Payne_JAS72}  
    672 as means of the values at $40^{o}N$ and $30^{o}N$ for the Atlantic Ocean (hence the same latitudinal 
    673 band of the Mediterranean Sea). The net long-wave radiation flux 
    674 \citep{Bignami_al_JGR95} is a function of 
     728The surface boundary condition for temperature involves the balance between 
     729surface solar radiation, net long-wave radiation, the latent and sensible heat fluxes. 
     730Solar radiation is dependent on cloud cover and is computed by means of an astronomical formula \citep{Reed_JPO77}. 
     731Albedo monthly values are from \citet{Payne_JAS72} as means of the values at $40^{o}N$ and $30^{o}N$ for 
     732the Atlantic Ocean (hence the same latitudinal band of the Mediterranean Sea). 
     733The net long-wave radiation flux \citep{Bignami_al_JGR95} is a function of 
    675734air temperature, sea-surface temperature, cloud cover and relative humidity. 
    676 Sensible heat and latent heat fluxes are computed by classical 
    677 bulk formulae parameterised according to \citet{Kondo1975}. 
     735Sensible heat and latent heat fluxes are computed by classical bulk formulae parameterised according to 
     736\citet{Kondo1975}. 
    678737Details on the bulk formulae used can be found in \citet{Maggiore_al_PCE98} and \citet{Castellari_al_JMS1998}. 
    679738 
    680 Options are defined through the  \ngn{namsbc\_mfs} namelist variables. 
    681 The required 7 input fields must be provided on the model Grid-T and  are: 
     739Options are defined through the \ngn{namsbc\_mfs} namelist variables. 
     740The required 7 input fields must be provided on the model Grid-T and are: 
    682741\begin{itemize} 
    683742\item          Zonal Component of the 10m wind ($ms^{-1}$)  (\np{sn\_windi}) 
     
    700759%------------------------------------------------------------------------------------------------------------- 
    701760 
    702 In the coupled formulation of the surface boundary condition, the fluxes are  
    703 provided by the OASIS coupler at a frequency which is defined in the OASIS coupler,  
    704 while sea and ice surface temperature, ocean and ice albedo, and ocean currents  
    705 are sent to the atmospheric component. 
    706  
    707 A generalised coupled interface has been developed.  
    708 It is currently interfaced with OASIS-3-MCT (\key{oasis3}).  
    709 It has been successfully used to interface \NEMO to most of the European atmospheric  
    710 GCM (ARPEGE, ECHAM, ECMWF, HadAM, HadGAM, LMDz),  
    711 as well as to \href{http://wrf-model.org/}{WRF} (Weather Research and Forecasting Model). 
    712  
    713 Note that in addition to the setting of \np{ln\_cpl} to true, the \key{coupled} have to be defined.  
    714 The CPP key is mainly used in sea-ice to ensure that the atmospheric fluxes are  
    715 actually recieved by the ice-ocean system (no calculation of ice sublimation in coupled mode). 
     761In the coupled formulation of the surface boundary condition, 
     762the fluxes are provided by the OASIS coupler at a frequency which is defined in the OASIS coupler, 
     763while sea and ice surface temperature, ocean and ice albedo, and ocean currents are sent to 
     764the atmospheric component. 
     765 
     766A generalised coupled interface has been developed. 
     767It is currently interfaced with OASIS-3-MCT (\key{oasis3}). 
     768It has been successfully used to interface \NEMO to most of the European atmospheric GCM 
     769(ARPEGE, ECHAM, ECMWF, HadAM, HadGAM, LMDz), as well as to \href{http://wrf-model.org/}{WRF} 
     770(Weather Research and Forecasting Model). 
     771 
     772Note that in addition to the setting of \np{ln\_cpl} to true, the \key{coupled} have to be defined. 
     773The CPP key is mainly used in sea-ice to ensure that the atmospheric fluxes are actually received by 
     774the ice-ocean system (no calculation of ice sublimation in coupled mode). 
    716775When PISCES biogeochemical model (\key{top} and \key{pisces}) is also used in the coupled system,  
    717 the whole carbon cycle is computed by defining \key{cpl\_carbon\_cycle}. In this case,  
    718 CO$_2$ fluxes will be exchanged between the atmosphere and the ice-ocean system (and need to be activated in \ngn{namsbc{\_}cpl} ). 
    719  
    720 The namelist above allows control of various aspects of the coupling fields (particularly for 
    721 vectors) and now allows for any coupling fields to have multiple sea ice categories (as required by LIM3 
    722 and CICE).  When indicating a multi-category coupling field in namsbc{\_}cpl the number of categories will be 
    723 determined by the number used in the sea ice model.  In some limited cases it may be possible to specify  
    724 single category coupling fields even when the sea ice model is running with multiple categories - in this 
    725 case the user should examine the code to be sure the assumptions made are satisfactory.  In cases where 
    726 this is definitely not possible the model should abort with an error message.  The new code has been tested using 
    727 ECHAM with LIM2, and HadGAM3 with CICE but although it will compile with \key{lim3} additional minor code changes 
    728 may be required to run using LIM3. 
     776the whole carbon cycle is computed by defining \key{cpl\_carbon\_cycle}. 
     777In this case, CO$_2$ fluxes will be exchanged between the atmosphere and the ice-ocean system 
     778(and need to be activated in \ngn{namsbc{\_}cpl} ). 
     779 
     780The namelist above allows control of various aspects of the coupling fields (particularly for vectors) and 
     781now allows for any coupling fields to have multiple sea ice categories (as required by LIM3 and CICE). 
     782When indicating a multi-category coupling field in namsbc{\_}cpl the number of categories will be determined by 
     783the number used in the sea ice model. 
     784In some limited cases it may be possible to specify single category coupling fields even when 
     785the sea ice model is running with multiple categories - 
     786in this case the user should examine the code to be sure the assumptions made are satisfactory. 
     787In cases where this is definitely not possible the model should abort with an error message. 
     788The new code has been tested using ECHAM with LIM2, and HadGAM3 with CICE but 
     789although it will compile with \key{lim3} additional minor code changes may be required to run using LIM3. 
    729790 
    730791 
     
    739800%------------------------------------------------------------------------------------------------------------- 
    740801 
    741 The optional atmospheric pressure can be used to force ocean and ice dynamics  
    742 (\np{ln\_apr\_dyn}\forcode{ = .true.}, \textit{\ngn{namsbc}} namelist ). 
    743 The input atmospheric forcing defined via \np{sn\_apr} structure (\textit{namsbc\_apr} namelist)  
    744 can be interpolated in time to the model time step, and even in space when the  
    745 interpolation on-the-fly is used. When used to force the dynamics, the atmospheric  
    746 pressure is further transformed into an equivalent inverse barometer sea surface height,  
    747 $\eta_{ib}$, using: 
     802The optional atmospheric pressure can be used to force ocean and ice dynamics 
     803(\np{ln\_apr\_dyn}\forcode{ = .true.}, \textit{\ngn{namsbc}} namelist). 
     804The input atmospheric forcing defined via \np{sn\_apr} structure (\textit{namsbc\_apr} namelist) 
     805can be interpolated in time to the model time step, and even in space when the interpolation on-the-fly is used. 
     806When used to force the dynamics, the atmospheric pressure is further transformed into 
     807an equivalent inverse barometer sea surface height, $\eta_{ib}$, using: 
    748808\begin{equation} \label{eq:SBC_ssh_ib} 
    749809   \eta_{ib} = -  \frac{1}{g\,\rho_o}  \left( P_{atm} - P_o \right)  
    750810\end{equation} 
    751811where $P_{atm}$ is the atmospheric pressure and $P_o$ a reference atmospheric pressure. 
    752 A value of $101,000~N/m^2$ is used unless \np{ln\_ref\_apr} is set to true. In this case $P_o$  
    753 is set to the value of $P_{atm}$ averaged over the ocean domain, $i.e.$ the mean value of  
    754 $\eta_{ib}$ is kept to zero at all time step. 
    755  
    756 The gradient of $\eta_{ib}$ is added to the RHS of the ocean momentum equation  
    757 (see \mdl{dynspg} for the ocean). For sea-ice, the sea surface height, $\eta_m$,  
    758 which is provided to the sea ice model is set to $\eta - \eta_{ib}$ (see \mdl{sbcssr} module). 
    759 $\eta_{ib}$ can be set in the output. This can simplify altimetry data and model comparison  
    760 as inverse barometer sea surface height is usually removed from these date prior to their distribution. 
    761  
    762 When using time-splitting and BDY package for open boundaries conditions, the equivalent  
    763 inverse barometer sea surface height $\eta_{ib}$ can be added to BDY ssh data:  
     812A value of $101,000~N/m^2$ is used unless \np{ln\_ref\_apr} is set to true. 
     813In this case $P_o$ is set to the value of $P_{atm}$ averaged over the ocean domain, 
     814$i.e.$ the mean value of $\eta_{ib}$ is kept to zero at all time step. 
     815 
     816The gradient of $\eta_{ib}$ is added to the RHS of the ocean momentum equation (see \mdl{dynspg} for the ocean). 
     817For sea-ice, the sea surface height, $\eta_m$, which is provided to the sea ice model is set to $\eta - \eta_{ib}$ 
     818(see \mdl{sbcssr} module). 
     819$\eta_{ib}$ can be set in the output. 
     820This can simplify altimetry data and model comparison as 
     821inverse barometer sea surface height is usually removed from these date prior to their distribution. 
     822 
     823When using time-splitting and BDY package for open boundaries conditions, 
     824the equivalent inverse barometer sea surface height $\eta_{ib}$ can be added to BDY ssh data:  
    764825\np{ln\_apr\_obc}  might be set to true. 
    765826 
     
    775836%----------------------------------------------------------------------------------------- 
    776837 
    777 The tidal forcing, generated by the gravity forces of the Earth-Moon and Earth-Sun sytems, is activated if \np{ln\_tide} and \np{ln\_tide\_pot} are both set to \np{.true.} in \ngn{nam\_tide}. This translates as an additional barotropic force in the momentum equations \ref{eq:PE_dyn} such that: 
     838The tidal forcing, generated by the gravity forces of the Earth-Moon and Earth-Sun sytems, 
     839is activated if \np{ln\_tide} and \np{ln\_tide\_pot} are both set to \np{.true.} in \ngn{nam\_tide}. 
     840This translates as an additional barotropic force in the momentum equations \ref{eq:PE_dyn} such that: 
    778841\begin{equation}     \label{eq:PE_dyn_tides} 
    779842\frac{\partial {\rm {\bf U}}_h }{\partial t}= ... 
     
    782845where $\Pi_{eq}$ stands for the equilibrium tidal forcing and $\Pi_{sal}$ a self-attraction and loading term (SAL).  
    783846  
    784 The equilibrium tidal forcing is expressed as a sum over the chosen constituents $l$ in \ngn{nam\_tide}. The constituents are defined such that \np{clname(1) = 'M2', clname(2)='S2', etc...}. For the three types of tidal frequencies it reads : \\ 
     847The equilibrium tidal forcing is expressed as a sum over the chosen constituents $l$ in \ngn{nam\_tide}. 
     848The constituents are defined such that \np{clname(1) = 'M2', clname(2)='S2', etc...}. 
     849For the three types of tidal frequencies it reads: \\ 
    785850Long period tides : 
    786851\begin{equation} 
     
    795860\Pi_{eq}(l)=A_{l}(1+k-h)(cos^{2}\phi)cos(\omega_{l}t+2\lambda+V_{l}) 
    796861\end{equation} 
    797 Here $A_{l}$ is the amplitude, $\omega_{l}$ is the frequency, $\phi$ the latitude, $\lambda$ the longitude, $V_{0l}$ a phase shift with respect to Greenwich meridian and $t$ the time. The Love number factor $(1+k-h)$ is here taken as a constant (0.7). 
    798  
    799 The SAL term should in principle be computed online as it depends on the model tidal prediction itself (see \citet{Arbic2004} for a discussion about the practical implementation of this term). Nevertheless, the complex calculations involved would make this computationally too expensive. Here, practical solutions are whether to read complex estimates $\Pi_{sal}(l)$ from an external model (\np{ln\_read\_load=.true.}) or use a ``scalar approximation'' (\np{ln\_scal\_load=.true.}). In the latter case, it reads:\\ 
     862Here $A_{l}$ is the amplitude, $\omega_{l}$ is the frequency, $\phi$ the latitude, $\lambda$ the longitude, 
     863$V_{0l}$ a phase shift with respect to Greenwich meridian and $t$ the time. 
     864The Love number factor $(1+k-h)$ is here taken as a constant (0.7). 
     865 
     866The SAL term should in principle be computed online as it depends on the model tidal prediction itself 
     867(see \citet{Arbic2004} for a discussion about the practical implementation of this term). 
     868Nevertheless, the complex calculations involved would make this computationally too expensive. 
     869Here, practical solutions are whether to read complex estimates $\Pi_{sal}(l)$ from an external model 
     870(\np{ln\_read\_load=.true.}) or use a ``scalar approximation'' (\np{ln\_scal\_load=.true.}). 
     871In the latter case, it reads:\\ 
    800872\begin{equation} 
    801873\Pi_{sal} = \beta \eta 
    802874\end{equation} 
    803 where $\beta$ (\np{rn\_scal\_load}, $\approx0.09$) is a spatially constant scalar, often chosen to minimize tidal prediction errors. Setting both \np{ln\_read\_load} and \np{ln\_scal\_load} to false removes the SAL contribution. 
     875where $\beta$ (\np{rn\_scal\_load}, $\approx0.09$) is a spatially constant scalar, 
     876often chosen to minimize tidal prediction errors. 
     877Setting both \np{ln\_read\_load} and \np{ln\_scal\_load} to false removes the SAL contribution. 
    804878 
    805879% ================================================================ 
     
    834908River runoff generally enters the ocean at a nonzero depth rather than through the surface. 
    835909Many models, however, have traditionally inserted river runoff to the top model cell. 
    836 This was the case in \NEMO prior to the version 3.3, and was combined with an option  
    837 to increase vertical mixing near the river mouth. 
    838  
    839 However, with this method numerical and physical problems arise when the top grid cells are  
    840 of the order of one meter. This situation is common in coastal modelling and is becoming  
    841 more common in open ocean and climate modelling  
    842 \footnote{At least a top cells thickness of 1~meter and a 3 hours forcing frequency are 
    843 required to properly represent the diurnal cycle \citep{Bernie_al_JC05}. see also \autoref{fig:SBC_dcy}.}. 
    844  
    845 As such from V~3.3 onwards it is possible to add river runoff through a non-zero depth, and for the  
    846 temperature and salinity of the river to effect the surrounding ocean. 
    847 The user is able to specify, in a NetCDF input file, the temperature and salinity of the river, along with the    
    848 depth (in metres) which the river should be added to. 
    849  
    850 Namelist variables in \ngn{namsbc\_rnf}, \np{ln\_rnf\_depth}, \np{ln\_rnf\_sal} and \np{ln\_rnf\_temp} control whether  
    851 the river attributes (depth, salinity and temperature) are read in and used.  If these are set  
    852 as false the river is added to the surface box only, assumed to be fresh (0~psu), and/or  
    853 taken as surface temperature respectively. 
     910This was the case in \NEMO prior to the version 3.3, 
     911and was combined with an option to increase vertical mixing near the river mouth. 
     912 
     913However, with this method numerical and physical problems arise when the top grid cells are of the order of one meter. 
     914This situation is common in coastal modelling and is becoming more common in open ocean and climate modelling  
     915\footnote{ 
     916  At least a top cells thickness of 1~meter and a 3 hours forcing frequency are required to 
     917  properly represent the diurnal cycle \citep{Bernie_al_JC05}. 
     918  see also \autoref{fig:SBC_dcy}.}. 
     919 
     920As such from V~3.3 onwards it is possible to add river runoff through a non-zero depth, 
     921and for the temperature and salinity of the river to effect the surrounding ocean. 
     922The user is able to specify, in a NetCDF input file, the temperature and salinity of the river, 
     923along with the depth (in metres) which the river should be added to. 
     924 
     925Namelist variables in \ngn{namsbc\_rnf}, \np{ln\_rnf\_depth}, \np{ln\_rnf\_sal} and 
     926\np{ln\_rnf\_temp} control whether the river attributes (depth, salinity and temperature) are read in and used. 
     927If these are set as false the river is added to the surface box only, assumed to be fresh (0~psu), 
     928and/or taken as surface temperature respectively. 
    854929 
    855930The runoff value and attributes are read in in sbcrnf.   
    856 For temperature -999 is taken as missing data and the river temperature is taken to be the  
    857 surface temperatue at the river point. 
     931For temperature -999 is taken as missing data and the river temperature is taken to 
     932be the surface temperatue at the river point. 
    858933For the depth parameter a value of -1 means the river is added to the surface box only,  
    859934and a value of -999 means the river is added through the entire water column.  
    860 After being read in the temperature and salinity variables are multiplied by the amount of runoff (converted into m/s)  
    861 to give the heat and salt content of the river runoff. 
    862 After the user specified depth is read ini, the number of grid boxes this corresponds to is  
    863 calculated and stored in the variable \np{nz\_rnf}. 
    864 The variable \textit{h\_dep} is then calculated to be the depth (in metres) of the bottom of the  
    865 lowest box the river water is being added to (i.e. the total depth that river water is being added to in the model). 
    866  
    867 The mass/volume addition due to the river runoff is, at each relevant depth level, added to the horizontal divergence  
    868 (\textit{hdivn}) in the subroutine \rou{sbc\_rnf\_div} (called from \mdl{divcur}). 
     935After being read in the temperature and salinity variables are multiplied by the amount of runoff 
     936(converted into m/s) to give the heat and salt content of the river runoff. 
     937After the user specified depth is read ini, 
     938the number of grid boxes this corresponds to is calculated and stored in the variable \np{nz\_rnf}. 
     939The variable \textit{h\_dep} is then calculated to be the depth (in metres) of 
     940the bottom of the lowest box the river water is being added to 
     941(i.e. the total depth that river water is being added to in the model). 
     942 
     943The mass/volume addition due to the river runoff is, at each relevant depth level, added to 
     944the horizontal divergence (\textit{hdivn}) in the subroutine \rou{sbc\_rnf\_div} (called from \mdl{divcur}). 
    869945This increases the diffusion term in the vicinity of the river, thereby simulating a momentum flux. 
    870 The sea surface height is calculated using the sum of the horizontal divergence terms, and so the  
    871 river runoff indirectly forces an increase in sea surface height.  
     946The sea surface height is calculated using the sum of the horizontal divergence terms, 
     947and so the river runoff indirectly forces an increase in sea surface height.  
    872948 
    873949The \textit{hdivn} terms are used in the tracer advection modules to force vertical velocities. 
    874 This causes a mass of water, equal to the amount of runoff, to be moved into the box above.  
    875 The heat and salt content of the river runoff is not included in this step, and so the tracer  
    876 concentrations are diluted as water of ocean temperature and salinity is moved upward out of the box  
    877 and replaced by the same volume of river water with no corresponding heat and salt addition. 
    878  
    879 For the linear free surface case, at the surface box the tracer advection causes a flux of water  
    880 (of equal volume to the runoff) through the sea surface out of the domain, which causes a salt and heat flux out of the model. 
     950This causes a mass of water, equal to the amount of runoff, to be moved into the box above. 
     951The heat and salt content of the river runoff is not included in this step, 
     952and so the tracer concentrations are diluted as water of ocean temperature and salinity is moved upward out of 
     953the box and replaced by the same volume of river water with no corresponding heat and salt addition. 
     954 
     955For the linear free surface case, at the surface box the tracer advection causes a flux of water 
     956(of equal volume to the runoff) through the sea surface out of the domain, 
     957which causes a salt and heat flux out of the model. 
    881958As such the volume of water does not change, but the water is diluted. 
    882959 
    883960For the non-linear free surface case (\key{vvl}), no flux is allowed through the surface. 
    884 Instead in the surface box (as well as water moving up from the boxes below) a volume of runoff water  
    885 is added with no corresponding heat and salt addition and so as happens in the lower boxes there is a dilution effect. 
    886 (The runoff addition to the top box along with the water being moved up through boxes below means the surface box has a large  
    887 increase in volume, whilst all other boxes remain the same size) 
     961Instead in the surface box (as well as water moving up from the boxes below) a volume of runoff water is added with 
     962no corresponding heat and salt addition and so as happens in the lower boxes there is a dilution effect. 
     963(The runoff addition to the top box along with the water being moved up through 
     964boxes below means the surface box has a large increase in volume, whilst all other boxes remain the same size) 
    888965 
    889966In trasbc the addition of heat and salt due to the river runoff is added. 
    890967This is done in the same way for both vvl and non-vvl. 
    891 The temperature and salinity are increased through the specified depth according to the heat and salt content of the river.  
    892  
    893 In the non-linear free surface case (vvl), near the end of the time step the change in sea surface height is redistrubuted  
    894 through the grid boxes, so that the original ratios of grid box heights are restored. 
    895 In doing this water is moved into boxes below, throughout the water column, so the large volume addition to the surface box is spread between all the grid boxes. 
    896  
    897 It is also possible for runnoff to be specified as a negative value for modelling flow through straits, i.e. modelling the Baltic flow in and out of the North Sea. 
    898 When the flow is out of the domain there is no change in temperature and salinity, regardless of the namelist options used, as the ocean water leaving the domain removes heat and salt (at the same concentration) with it.  
     968The temperature and salinity are increased through the specified depth according to 
     969the heat and salt content of the river.  
     970 
     971In the non-linear free surface case (vvl), 
     972near the end of the time step the change in sea surface height is redistrubuted through the grid boxes, 
     973so that the original ratios of grid box heights are restored. 
     974In doing this water is moved into boxes below, throughout the water column, 
     975so the large volume addition to the surface box is spread between all the grid boxes. 
     976 
     977It is also possible for runnoff to be specified as a negative value for modelling flow through straits, 
     978i.e. modelling the Baltic flow in and out of the North Sea. 
     979When the flow is out of the domain there is no change in temperature and salinity, 
     980regardless of the namelist options used, 
     981as the ocean water leaving the domain removes heat and salt (at the same concentration) with it.  
    899982 
    900983 
     
    9311014\begin{description} 
    9321015\item[\np{nn\_isf}\forcode{ = 1}] 
    933 The ice shelf cavity is represented (\np{ln\_isfcav}\forcode{ = .true.} needed). The fwf and heat flux are computed.  
    934 Two different bulk formula are available: 
     1016  The ice shelf cavity is represented (\np{ln\_isfcav}\forcode{ = .true.} needed). 
     1017  The fwf and heat flux are computed. 
     1018  Two different bulk formula are available: 
    9351019   \begin{description} 
    9361020   \item[\np{nn\_isfblk}\forcode{ = 1}] 
    937    The bulk formula used to compute the melt is based the one described in \citet{Hunter2006}. 
    938         This formulation is based on a balance between the upward ocean heat flux and the latent heat flux at the ice shelf base. 
    939  
    940    \item[\np{nn\_isfblk}\forcode{ = 2}]  
    941    The bulk formula used to compute the melt is based the one described in \citet{Jenkins1991}. 
    942         This formulation is based on a 3 equations formulation (a heat flux budget, a salt flux budget 
    943          and a linearised freezing point temperature equation). 
     1021     The bulk formula used to compute the melt is based the one described in \citet{Hunter2006}. 
     1022     This formulation is based on a balance between the upward ocean heat flux and 
     1023     the latent heat flux at the ice shelf base. 
     1024   \item[\np{nn\_isfblk}\forcode{ = 2}] 
     1025     The bulk formula used to compute the melt is based the one described in \citet{Jenkins1991}. 
     1026     This formulation is based on a 3 equations formulation 
     1027     (a heat flux budget, a salt flux budget and a linearised freezing point temperature equation). 
    9441028   \end{description} 
    945  
    946 For this 2 bulk formulations, there are 3 different ways to compute the exchange coeficient: 
     1029   For this 2 bulk formulations, there are 3 different ways to compute the exchange coeficient: 
    9471030   \begin{description} 
    948         \item[\np{nn\_gammablk}\forcode{ = 0}] 
    949    The salt and heat exchange coefficients are constant and defined by \np{rn\_gammas0} and \np{rn\_gammat0} 
    950  
     1031   \item[\np{nn\_gammablk}\forcode{ = 0}] 
     1032     The salt and heat exchange coefficients are constant and defined by \np{rn\_gammas0} and \np{rn\_gammat0} 
    9511033   \item[\np{nn\_gammablk}\forcode{ = 1}] 
    952    The salt and heat exchange coefficients are velocity dependent and defined as \np{rn\_gammas0}$ \times u_{*}$ and \np{rn\_gammat0}$ \times u_{*}$ 
    953         where $u_{*}$ is the friction velocity in the top boundary layer (ie first \np{rn\_hisf\_tbl} meters). 
    954         See \citet{Jenkins2010} for all the details on this formulation. 
    955     
     1034     The salt and heat exchange coefficients are velocity dependent and defined as 
     1035     \np{rn\_gammas0}$ \times u_{*}$ and \np{rn\_gammat0}$ \times u_{*}$ where 
     1036     $u_{*}$ is the friction velocity in the top boundary layer (ie first \np{rn\_hisf\_tbl} meters). 
     1037     See \citet{Jenkins2010} for all the details on this formulation. 
    9561038   \item[\np{nn\_gammablk}\forcode{ = 2}] 
    957    The salt and heat exchange coefficients are velocity and stability dependent and defined as  
    958         $\gamma_{T,S} = \frac{u_{*}}{\Gamma_{Turb} + \Gamma^{T,S}_{Mole}}$ 
    959         where $u_{*}$ is the friction velocity in the top boundary layer (ie first \np{rn\_hisf\_tbl} meters),  
    960         $\Gamma_{Turb}$ the contribution of the ocean stability and  
    961         $\Gamma^{T,S}_{Mole}$ the contribution of the molecular diffusion. 
    962         See \citet{Holland1999} for all the details on this formulation. 
    963         \end{description} 
    964  
    965 \item[\np{nn\_isf}\forcode{ = 2}] 
    966 A parameterisation of isf is used. The ice shelf cavity is not represented.  
    967 The fwf is distributed along the ice shelf edge between the depth of the average grounding line (GL) 
    968 (\np{sn\_depmax\_isf}) and the base of the ice shelf along the calving front (\np{sn\_depmin\_isf}) as in (\np{nn\_isf}\forcode{ = 3}).  
    969 Furthermore the fwf and heat flux are computed using the \citet{Beckmann2003} parameterisation of isf melting.  
    970 The effective melting length (\np{sn\_Leff\_isf}) is read from a file. 
    971  
    972 \item[\np{nn\_isf}\forcode{ = 3}] 
    973 A simple parameterisation of isf is used. The ice shelf cavity is not represented.  
    974 The fwf (\np{sn\_rnfisf}) is prescribed and distributed along the ice shelf edge between the depth of the average grounding line (GL) 
    975 (\np{sn\_depmax\_isf}) and the base of the ice shelf along the calving front (\np{sn\_depmin\_isf}).  
    976 The heat flux ($Q_h$) is computed as $Q_h = fwf \times L_f$. 
    977  
    978 \item[\np{nn\_isf}\forcode{ = 4}] 
    979 The ice shelf cavity is opened (\np{ln\_isfcav}\forcode{ = .true.} needed). However, the fwf is not computed but specified from file \np{sn\_fwfisf}).  
    980 The heat flux ($Q_h$) is computed as $Q_h = fwf \times L_f$.\\ 
     1039     The salt and heat exchange coefficients are velocity and stability dependent and defined as 
     1040     $\gamma_{T,S} = \frac{u_{*}}{\Gamma_{Turb} + \Gamma^{T,S}_{Mole}}$ where 
     1041     $u_{*}$ is the friction velocity in the top boundary layer (ie first \np{rn\_hisf\_tbl} meters), 
     1042     $\Gamma_{Turb}$ the contribution of the ocean stability and 
     1043     $\Gamma^{T,S}_{Mole}$ the contribution of the molecular diffusion. 
     1044     See \citet{Holland1999} for all the details on this formulation. 
     1045   \end{description} 
     1046 \item[\np{nn\_isf}\forcode{ = 2}] 
     1047   A parameterisation of isf is used. The ice shelf cavity is not represented. 
     1048   The fwf is distributed along the ice shelf edge between the depth of the average grounding line (GL) 
     1049   (\np{sn\_depmax\_isf}) and the base of the ice shelf along the calving front 
     1050   (\np{sn\_depmin\_isf}) as in (\np{nn\_isf}\forcode{ = 3}). 
     1051   Furthermore the fwf and heat flux are computed using the \citet{Beckmann2003} parameterisation of isf melting. 
     1052   The effective melting length (\np{sn\_Leff\_isf}) is read from a file. 
     1053 \item[\np{nn\_isf}\forcode{ = 3}] 
     1054   A simple parameterisation of isf is used. The ice shelf cavity is not represented. 
     1055   The fwf (\np{sn\_rnfisf}) is prescribed and distributed along the ice shelf edge between 
     1056   the depth of the average grounding line (GL) (\np{sn\_depmax\_isf}) and 
     1057   the base of the ice shelf along the calving front (\np{sn\_depmin\_isf}). 
     1058   The heat flux ($Q_h$) is computed as $Q_h = fwf \times L_f$. 
     1059 \item[\np{nn\_isf}\forcode{ = 4}] 
     1060   The ice shelf cavity is opened (\np{ln\_isfcav}\forcode{ = .true.} needed). 
     1061   However, the fwf is not computed but specified from file \np{sn\_fwfisf}). 
     1062   The heat flux ($Q_h$) is computed as $Q_h = fwf \times L_f$.\\ 
    9811063\end{description} 
    9821064 
    983  
    984 $\bullet$ \np{nn\_isf}\forcode{ = 1} and \np{nn\_isf}\forcode{ = 2} compute a melt rate based on the water mass properties, ocean velocities and depth. 
    985  This flux is thus highly dependent of the model resolution (horizontal and vertical), realism of the water masses onto the shelf ...\\ 
    986  
    987  
    988 $\bullet$ \np{nn\_isf}\forcode{ = 3} and \np{nn\_isf}\forcode{ = 4} read the melt rate from a file. You have total control of the fwf forcing. 
    989 This can be usefull if the water masses on the shelf are not realistic or the resolution (horizontal/vertical) are too  
    990 coarse to have realistic melting or for studies where you need to control your heat and fw input.\\  
    991  
    992 A namelist parameters control over how many meters the heat and fw fluxes are spread.  
    993 \np{rn\_hisf\_tbl}] is the top boundary layer thickness as defined in \citet{Losch2008}.  
    994 This parameter is only used if \np{nn\_isf}\forcode{ = 1} or \np{nn\_isf}\forcode{ = 4} 
     1065$\bullet$ \np{nn\_isf}\forcode{ = 1} and \np{nn\_isf}\forcode{ = 2} compute a melt rate based on 
     1066the water mass properties, ocean velocities and depth. 
     1067This flux is thus highly dependent of the model resolution (horizontal and vertical), 
     1068realism of the water masses onto the shelf ...\\ 
     1069 
     1070$\bullet$ \np{nn\_isf}\forcode{ = 3} and \np{nn\_isf}\forcode{ = 4} read the melt rate from a file. 
     1071You have total control of the fwf forcing. 
     1072This can be useful if the water masses on the shelf are not realistic or 
     1073the resolution (horizontal/vertical) are too coarse to have realistic melting or 
     1074for studies where you need to control your heat and fw input.\\  
     1075 
     1076A namelist parameters control over how many meters the heat and fw fluxes are spread. 
     1077\np{rn\_hisf\_tbl}] is the top boundary layer thickness as defined in \citet{Losch2008}. 
     1078This parameter is only used if \np{nn\_isf}\forcode{ = 1} or \np{nn\_isf}\forcode{ = 4}. 
    9951079 
    9961080If \np{rn\_hisf\_tbl}\forcode{ = 0}., the fluxes are put in the top level whatever is its tickness.  
    9971081 
    998 If \np{rn\_hisf\_tbl} $>$ 0., the fluxes are spread over the first \np{rn\_hisf\_tbl} m (ie over one or several cells).\\ 
     1082If \np{rn\_hisf\_tbl} $>$ 0., the fluxes are spread over the first \np{rn\_hisf\_tbl} m 
     1083(ie over one or several cells).\\ 
    9991084 
    10001085The ice shelf melt is implemented as a volume flux with in the same way as for the runoff. 
    1001 The fw addition due to the ice shelf melting is, at each relevant depth level, added to the horizontal divergence  
    1002 (\textit{hdivn}) in the subroutine \rou{sbc\_isf\_div}, called from \mdl{divcur}.  
    1003 See the runoff section \autoref{sec:SBC_rnf} for all the details about the divergence correction.  
     1086The fw addition due to the ice shelf melting is, at each relevant depth level, added to 
     1087the horizontal divergence (\textit{hdivn}) in the subroutine \rou{sbc\_isf\_div}, called from \mdl{divcur}. 
     1088See the runoff section \autoref{sec:SBC_rnf} for all the details about the divergence correction. 
    10041089 
    10051090 
     
    10101095\nlst{namsbc_iscpl} 
    10111096%-------------------------------------------------------------------------------------------------------- 
    1012 Ice sheet/ocean coupling is done through file exchange at the restart step. NEMO, at each restart step,  
    1013 read the bathymetry and ice shelf draft variable in a netcdf file.  
    1014 If \np{ln\_iscpl}\forcode{ = .true.}, the isf draft is assume to be different at each restart step  
    1015 with potentially some new wet/dry cells due to the ice sheet dynamics/thermodynamics. 
     1097Ice sheet/ocean coupling is done through file exchange at the restart step. 
     1098NEMO, at each restart step, read the bathymetry and ice shelf draft variable in a netcdf file. 
     1099If \np{ln\_iscpl}\forcode{ = .true.}, the isf draft is assume to be different at each restart step with 
     1100potentially some new wet/dry cells due to the ice sheet dynamics/thermodynamics. 
    10161101The wetting and drying scheme applied on the restart is very simple and described below for the 6 different cases: 
    10171102\begin{description} 
    10181103\item[Thin a cell down:] 
    1019    T/S/ssh are unchanged and U/V in the top cell are corrected to keep the barotropic transport (bt) constant ($bt_b=bt_n$). 
     1104  T/S/ssh are unchanged and U/V in the top cell are corrected to keep the barotropic transport (bt) constant 
     1105  ($bt_b=bt_n$). 
    10201106\item[Enlarge  a cell:] 
    1021    See case "Thin a cell down" 
     1107  See case "Thin a cell down" 
    10221108\item[Dry a cell:] 
    1023    mask, T/S, U/V and ssh are set to 0. Furthermore, U/V into the water column are modified to satisfy ($bt_b=bt_n$). 
     1109  mask, T/S, U/V and ssh are set to 0. 
     1110  Furthermore, U/V into the water column are modified to satisfy ($bt_b=bt_n$). 
    10241111\item[Wet a cell:]  
    1025    mask is set to 1, T/S is extrapolated from neighbours, $ssh_n = ssh_b$ and U/V set to 0. If no neighbours along i,j and k, T/S/U/V and mask are set to 0. 
     1112  mask is set to 1, T/S is extrapolated from neighbours, $ssh_n = ssh_b$ and U/V set to 0. 
     1113  If no neighbours along i,j and k, T/S/U/V and mask are set to 0. 
    10261114\item[Dry a column:] 
    10271115   mask, T/S, U/V are set to 0 everywhere in the column and ssh set to 0. 
    10281116\item[Wet a column:] 
    1029    set mask to 1, T/S is extrapolated from neighbours, ssh is extrapolated from neighbours and U/V set to 0. If no neighbour, T/S/U/V and mask set to 0. 
     1117  set mask to 1, T/S is extrapolated from neighbours, ssh is extrapolated from neighbours and U/V set to 0. 
     1118  If no neighbour, T/S/U/V and mask set to 0. 
    10301119\end{description} 
    1031 The extrapolation is call \np{nn\_drown} times. It means that if the grounding line retreat by more than \np{nn\_drown} cells between 2 coupling steps, 
    1032  the code will be unable to fill all the new wet cells properly. The default number is set up for the MISOMIP idealised experiments.\\ 
    1033 This coupling procedure is able to take into account grounding line and calving front migration. However, it is a non-conservative processe.  
    1034 This could lead to a trend in heat/salt content and volume. In order to remove the trend and keep the conservation level as close to 0 as possible, 
    1035  a simple conservation scheme is available with \np{ln\_hsb}\forcode{ = .true.}. The heat/salt/vol. gain/loss is diagnose, as well as the location.  
    1036 Based on what is done on sbcrnf to prescribed a source of heat/salt/vol., the heat/salt/vol. gain/loss is removed/added, 
    1037  over a period of \np{rn\_fiscpl} time step, into the system.  
     1120The extrapolation is call \np{nn\_drown} times. 
     1121It means that if the grounding line retreat by more than \np{nn\_drown} cells between 2 coupling steps, 
     1122the code will be unable to fill all the new wet cells properly. 
     1123The default number is set up for the MISOMIP idealised experiments.\\ 
     1124This coupling procedure is able to take into account grounding line and calving front migration. 
     1125However, it is a non-conservative processe.  
     1126This could lead to a trend in heat/salt content and volume. 
     1127In order to remove the trend and keep the conservation level as close to 0 as possible, 
     1128a simple conservation scheme is available with \np{ln\_hsb}\forcode{ = .true.}. 
     1129The heat/salt/vol. gain/loss is diagnose, as well as the location. 
     1130Based on what is done on sbcrnf to prescribed a source of heat/salt/vol., 
     1131the heat/salt/vol. gain/loss is removed/added, over a period of \np{rn\_fiscpl} time step, into the system.  
    10381132So after \np{rn\_fiscpl} time step, all the heat/salt/vol. gain/loss due to extrapolation process is canceled.\\ 
    10391133 
    1040 As the before and now fields are not compatible (modification of the geometry), the restart time step is prescribed to be an euler time step instead of a leap frog and $fields_b = fields_n$. 
     1134As the before and now fields are not compatible (modification of the geometry), 
     1135the restart time step is prescribed to be an euler time step instead of a leap frog and $fields_b = fields_n$. 
    10411136% 
    10421137% ================================================================ 
     
    10531148Their physical behaviour is controlled by equations as described in \citet{Martin_Adcroft_OM10} ). 
    10541149(Note that the authors kindly provided a copy of their code to act as a basis for implementation in NEMO). 
    1055 Icebergs are initially spawned into one of ten classes which have specific mass and thickness as described  
    1056 in the \ngn{namberg} namelist:  
    1057 \np{rn\_initial\_mass} and \np{rn\_initial\_thickness}. 
    1058 Each class has an associated scaling (\np{rn\_mass\_scaling}), which is an integer representing how many icebergs  
    1059 of this class are being described as one lagrangian point (this reduces the numerical problem of tracking every single iceberg). 
     1150Icebergs are initially spawned into one of ten classes which have specific mass and thickness as 
     1151described in the \ngn{namberg} namelist: \np{rn\_initial\_mass} and \np{rn\_initial\_thickness}. 
     1152Each class has an associated scaling (\np{rn\_mass\_scaling}), 
     1153which is an integer representing how many icebergs of this class are being described as one lagrangian point 
     1154(this reduces the numerical problem of tracking every single iceberg). 
    10601155They are enabled by setting \np{ln\_icebergs}\forcode{ = .true.}. 
    10611156 
     
    10631158\begin{description} 
    10641159\item[\np{nn\_test\_icebergs}~$>$~0] 
    1065 In this scheme, the value of \np{nn\_test\_icebergs} represents the class of iceberg to generate  
    1066 (so between 1 and 10), and \np{nn\_test\_icebergs} provides a lon/lat box in the domain at each  
    1067 grid point of which an iceberg is generated at the beginning of the run.  
    1068 (Note that this happens each time the timestep equals \np{nn\_nit000}.) 
    1069 \np{nn\_test\_icebergs} is defined by four numbers in \np{nn\_test\_box} representing the corners  
    1070 of the geographical box: lonmin,lonmax,latmin,latmax 
     1160  In this scheme, the value of \np{nn\_test\_icebergs} represents the class of iceberg to generate 
     1161  (so between 1 and 10), and \np{nn\_test\_icebergs} provides a lon/lat box in the domain at each grid point of 
     1162  which an iceberg is generated at the beginning of the run. 
     1163  (Note that this happens each time the timestep equals \np{nn\_nit000}.) 
     1164  \np{nn\_test\_icebergs} is defined by four numbers in \np{nn\_test\_box} representing the corners of 
     1165  the geographical box: lonmin,lonmax,latmin,latmax 
    10711166\item[\np{nn\_test\_icebergs}\forcode{ = -1}] 
    1072 In this scheme the model reads a calving file supplied in the \np{sn\_icb} parameter. 
    1073 This should be a file with a field on the configuration grid (typically ORCA) representing ice accumulation rate at each model point.  
    1074 These should be ocean points adjacent to land where icebergs are known to calve. 
    1075 Most points in this input grid are going to have value zero. 
    1076 When the model runs, ice is accumulated at each grid point which has a non-zero source term. 
    1077 At each time step, a test is performed to see if there is enough ice mass to calve an iceberg of each class in order (1 to 10). 
    1078 Note that this is the initial mass multiplied by the number each particle represents ($i.e.$ the scaling). 
    1079 If there is enough ice, a new iceberg is spawned and the total available ice reduced accordingly. 
     1167  In this scheme the model reads a calving file supplied in the \np{sn\_icb} parameter. 
     1168  This should be a file with a field on the configuration grid (typically ORCA) 
     1169  representing ice accumulation rate at each model point. 
     1170  These should be ocean points adjacent to land where icebergs are known to calve. 
     1171  Most points in this input grid are going to have value zero. 
     1172  When the model runs, ice is accumulated at each grid point which has a non-zero source term. 
     1173  At each time step, a test is performed to see if there is enough ice mass to 
     1174  calve an iceberg of each class in order (1 to 10). 
     1175  Note that this is the initial mass multiplied by the number each particle represents ($i.e.$ the scaling). 
     1176  If there is enough ice, a new iceberg is spawned and the total available ice reduced accordingly. 
    10801177\end{description} 
    10811178 
    10821179Icebergs are influenced by wind, waves and currents, bottom melt and erosion. 
    1083 The latter act to disintegrate the iceberg. This is either all melted freshwater, or  
    1084 (if \np{rn\_bits\_erosion\_fraction}~$>$~0) into melt and additionally small ice bits 
     1180The latter act to disintegrate the iceberg. 
     1181This is either all melted freshwater, 
     1182or (if \np{rn\_bits\_erosion\_fraction}~$>$~0) into melt and additionally small ice bits 
    10851183which are assumed to propagate with their larger parent and thus delay fluxing into the ocean. 
    10861184Melt water (and other variables on the configuration grid) are written into the main NEMO model output files. 
     
    10911189The amount of information is controlled by two integer parameters: 
    10921190\begin{description} 
    1093 \item[\np{nn\_verbose\_level}]  takes a value between one and four and represents  
    1094 an increasing number of points in the code at which variables are written, and an  
    1095 increasing level of obscurity. 
     1191\item[\np{nn\_verbose\_level}] takes a value between one and four and 
     1192  represents an increasing number of points in the code at which variables are written, 
     1193  and an increasing level of obscurity. 
    10961194\item[\np{nn\_verbose\_write}] is the number of timesteps between writes 
    10971195\end{description} 
     
    11021200When \key{mpp\_mpi} is defined, each output file contains only those icebergs in the corresponding processor. 
    11031201Trajectory points are written out in the order of their parent iceberg in the model's "linked list" of icebergs. 
    1104 So care is needed to recreate data for individual icebergs, since its trajectory data may be spread across 
    1105 multiple files. 
     1202So care is needed to recreate data for individual icebergs, 
     1203since its trajectory data may be spread across multiple files. 
    11061204 
    11071205 
     
    11251223\begin{figure}[!t]    \begin{center} 
    11261224\includegraphics[width=0.8\textwidth]{Fig_SBC_diurnal} 
    1127 \caption{ \protect\label{fig:SBC_diurnal}     
    1128 Example of recontruction of the diurnal cycle variation of short wave flux   
    1129 from daily mean values. The reconstructed diurnal cycle (black line) is chosen  
    1130 as the mean value of the analytical cycle (blue line) over a time step, not  
    1131 as the mid time step value of the analytically cycle (red square). From \citet{Bernie_al_CD07}.} 
     1225\caption{ \protect\label{fig:SBC_diurnal} 
     1226  Example of recontruction of the diurnal cycle variation of short wave flux from daily mean values. 
     1227  The reconstructed diurnal cycle (black line) is chosen as 
     1228  the mean value of the analytical cycle (blue line) over a time step, 
     1229  not as the mid time step value of the analytically cycle (red square). 
     1230  From \citet{Bernie_al_CD07}.} 
    11321231\end{center}   \end{figure} 
    11331232%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    11341233 
    1135 \cite{Bernie_al_JC05} have shown that to capture 90$\%$ of the diurnal variability of  
    1136 SST requires a vertical resolution in upper ocean of 1~m or better and a temporal resolution  
    1137 of the surface fluxes of 3~h or less. Unfortunately high frequency forcing fields are rare,  
    1138 not to say inexistent. Nevertheless, it is possible to obtain a reasonable diurnal cycle  
    1139 of the SST knowning only short wave flux (SWF) at high frequency \citep{Bernie_al_CD07}. 
    1140 Furthermore, only the knowledge of daily mean value of SWF is needed,  
    1141 as higher frequency variations can be reconstructed from them, assuming that  
    1142 the diurnal cycle of SWF is a scaling of the top of the atmosphere diurnal cycle  
    1143 of incident SWF. The \cite{Bernie_al_CD07} reconstruction algorithm is available 
    1144 in \NEMO by setting \np{ln\_dm2dc}\forcode{ = .true.} (a \textit{\ngn{namsbc}} namelist variable) when using  
    1145 CORE bulk formulea (\np{ln\_blk\_core}\forcode{ = .true.}) or the flux formulation (\np{ln\_flx}\forcode{ = .true.}).  
    1146 The reconstruction is performed in the \mdl{sbcdcy} module. The detail of the algoritm used  
    1147 can be found in the appendix~A of \cite{Bernie_al_CD07}. The algorithm preserve the daily  
    1148 mean incomming SWF as the reconstructed SWF at a given time step is the mean value  
    1149 of the analytical cycle over this time step (\autoref{fig:SBC_diurnal}).  
    1150 The use of diurnal cycle reconstruction requires the input SWF to be daily  
     1234\cite{Bernie_al_JC05} have shown that to capture 90$\%$ of the diurnal variability of SST requires a vertical resolution in upper ocean of 1~m or better and a temporal resolution of the surface fluxes of 3~h or less. 
     1235Unfortunately high frequency forcing fields are rare, not to say inexistent. 
     1236Nevertheless, it is possible to obtain a reasonable diurnal cycle of the SST knowning only short wave flux (SWF) at 
     1237high frequency \citep{Bernie_al_CD07}. 
     1238Furthermore, only the knowledge of daily mean value of SWF is needed, 
     1239as higher frequency variations can be reconstructed from them, 
     1240assuming that the diurnal cycle of SWF is a scaling of the top of the atmosphere diurnal cycle of incident SWF. 
     1241The \cite{Bernie_al_CD07} reconstruction algorithm is available in \NEMO by 
     1242setting \np{ln\_dm2dc}\forcode{ = .true.} (a \textit{\ngn{namsbc}} namelist variable) when 
     1243using CORE bulk formulea (\np{ln\_blk\_core}\forcode{ = .true.}) or 
     1244the flux formulation (\np{ln\_flx}\forcode{ = .true.}). 
     1245The reconstruction is performed in the \mdl{sbcdcy} module. 
     1246The detail of the algoritm used can be found in the appendix~A of \cite{Bernie_al_CD07}. 
     1247The algorithm preserve the daily mean incoming SWF as the reconstructed SWF at 
     1248a given time step is the mean value of the analytical cycle over this time step (\autoref{fig:SBC_diurnal}). 
     1249The use of diurnal cycle reconstruction requires the input SWF to be daily 
    11511250($i.e.$ a frequency of 24 and a time interpolation set to true in \np{sn\_qsr} namelist parameter). 
    11521251Furthermore, it is recommended to have a least 8 surface module time step per day, 
    1153 that is  $\rdt \ nn\_fsbc < 10,800~s = 3~h$. An example of recontructed SWF  
    1154 is given in \autoref{fig:SBC_dcy} for a 12 reconstructed diurnal cycle, one every 2~hours  
    1155 (from 1am to 11pm). 
     1252that is  $\rdt \ nn\_fsbc < 10,800~s = 3~h$. 
     1253An example of recontructed SWF is given in \autoref{fig:SBC_dcy} for a 12 reconstructed diurnal cycle, 
     1254one every 2~hours (from 1am to 11pm). 
    11561255 
    11571256%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    11581257\begin{figure}[!t]  \begin{center} 
    11591258\includegraphics[width=0.7\textwidth]{Fig_SBC_dcy} 
    1160 \caption{ \protect\label{fig:SBC_dcy}    
    1161 Example of recontruction of the diurnal cycle variation of short wave flux   
    1162 from daily mean values on an ORCA2 grid with a time sampling of 2~hours (from 1am to 11pm).  
    1163 The display is on (i,j) plane. } 
     1259\caption{ \protect\label{fig:SBC_dcy} 
     1260  Example of recontruction of the diurnal cycle variation of short wave flux from 
     1261  daily mean values on an ORCA2 grid with a time sampling of 2~hours (from 1am to 11pm). 
     1262  The display is on (i,j) plane. } 
    11641263\end{center}   \end{figure} 
    11651264%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    11661265 
    1167 Note also that the setting a diurnal cycle in SWF is highly recommended  when  
    1168 the top layer thickness approach 1~m or less, otherwise large error in SST can  
    1169 appear due to an inconsistency between the scale of the vertical resolution  
    1170 and the forcing acting on that scale. 
     1266Note also that the setting a diurnal cycle in SWF is highly recommended when 
     1267the top layer thickness approach 1~m or less, otherwise large error in SST can appear due to 
     1268an inconsistency between the scale of the vertical resolution and the forcing acting on that scale. 
    11711269 
    11721270% ------------------------------------------------------------------------------------------------------------- 
     
    11761274\label{subsec:SBC_rotation} 
    11771275 
    1178 When using a flux (\np{ln\_flx}\forcode{ = .true.}) or bulk (\np{ln\_clio}\forcode{ = .true.} or \np{ln\_core}\forcode{ = .true.}) formulation,  
    1179 pairs of vector components can be rotated from east-north directions onto the local grid directions.   
    1180 This is particularly useful when interpolation on the fly is used since here any vectors are likely to be defined  
    1181 relative to a rectilinear grid. 
     1276When using a flux (\np{ln\_flx}\forcode{ = .true.}) or 
     1277bulk (\np{ln\_clio}\forcode{ = .true.} or \np{ln\_core}\forcode{ = .true.}) formulation, 
     1278pairs of vector components can be rotated from east-north directions onto the local grid directions. 
     1279This is particularly useful when interpolation on the fly is used since here any vectors are likely to 
     1280be defined relative to a rectilinear grid. 
    11821281To activate this option a non-empty string is supplied in the rotation pair column of the relevant namelist. 
    11831282The eastward component must start with "U" and the northward component with "V".   
    11841283The remaining characters in the strings are used to identify which pair of components go together. 
    1185 So for example, strings "U1" and "V1" next to "utau" and "vtau" would pair the wind stress components together 
    1186 and rotate them on to the model grid directions; "U2" and "V2" could be used against a second pair of components,  
    1187 and so on. 
     1284So for example, strings "U1" and "V1" next to "utau" and "vtau" would pair the wind stress components together and 
     1285rotate them on to the model grid directions; 
     1286"U2" and "V2" could be used against a second pair of components, and so on. 
    11881287The extra characters used in the strings are arbitrary. 
    11891288The rot\_rep routine from the \mdl{geo2ocean} module is used to perform the rotation. 
     
    11991298%------------------------------------------------------------------------------------------------------------- 
    12001299 
    1201 IOptions are defined through the  \ngn{namsbc\_ssr} namelist variables. 
    1202 n forced mode using a flux formulation (\np{ln\_flx}\forcode{ = .true.}), a  
    1203 feedback term \emph{must} be added to the surface heat flux $Q_{ns}^o$: 
     1300IOptions are defined through the \ngn{namsbc\_ssr} namelist variables. 
     1301On forced mode using a flux formulation (\np{ln\_flx}\forcode{ = .true.}), 
     1302a feedback term \emph{must} be added to the surface heat flux $Q_{ns}^o$: 
    12041303\begin{equation} \label{eq:sbc_dmp_q} 
    12051304Q_{ns} = Q_{ns}^o + \frac{dQ}{dT} \left( \left. T \right|_{k=1} - SST_{Obs} \right) 
    12061305\end{equation} 
    1207 where SST is a sea surface temperature field (observed or climatological), $T$ is  
    1208 the model surface layer temperature and $\frac{dQ}{dT}$ is a negative feedback  
    1209 coefficient usually taken equal to $-40~W/m^2/K$. For a $50~m$  
    1210 mixed-layer depth, this value corresponds to a relaxation time scale of two months.  
    1211 This term ensures that if $T$ perfectly matches the supplied SST, then $Q$ is  
    1212 equal to $Q_o$.  
    1213  
    1214 In the fresh water budget, a feedback term can also be added. Converted into an  
    1215 equivalent freshwater flux, it takes the following expression : 
     1306where SST is a sea surface temperature field (observed or climatological), 
     1307$T$ is the model surface layer temperature and 
     1308$\frac{dQ}{dT}$ is a negative feedback coefficient usually taken equal to $-40~W/m^2/K$. 
     1309For a $50~m$ mixed-layer depth, this value corresponds to a relaxation time scale of two months.  
     1310This term ensures that if $T$ perfectly matches the supplied SST, then $Q$ is equal to $Q_o$.  
     1311 
     1312In the fresh water budget, a feedback term can also be added. 
     1313Converted into an equivalent freshwater flux, it takes the following expression : 
    12161314 
    12171315\begin{equation} \label{eq:sbc_dmp_emp} 
     
    12201318\end{equation} 
    12211319 
    1222 where $\textit{emp}_{o }$ is a net surface fresh water flux (observed, climatological or an 
    1223 atmospheric model product), \textit{SSS}$_{Obs}$ is a sea surface salinity (usually a time  
    1224 interpolation of the monthly mean Polar Hydrographic Climatology \citep{Steele2001}),  
    1225 $\left.S\right|_{k=1}$ is the model surface layer salinity and $\gamma_s$ is a negative  
    1226 feedback coefficient which is provided as a namelist parameter. Unlike heat flux, there is no  
    1227 physical justification for the feedback term in \autoref{eq:sbc_dmp_emp} as the atmosphere  
    1228 does not care about ocean surface salinity \citep{Madec1997}. The SSS restoring  
    1229 term should be viewed as a flux correction on freshwater fluxes to reduce the  
    1230 uncertainties we have on the observed freshwater budget. 
     1320where $\textit{emp}_{o }$ is a net surface fresh water flux 
     1321(observed, climatological or an atmospheric model product), 
     1322\textit{SSS}$_{Obs}$ is a sea surface salinity 
     1323(usually a time interpolation of the monthly mean Polar Hydrographic Climatology \citep{Steele2001}), 
     1324$\left.S\right|_{k=1}$ is the model surface layer salinity and 
     1325$\gamma_s$ is a negative feedback coefficient which is provided as a namelist parameter. 
     1326Unlike heat flux, there is no physical justification for the feedback term in \autoref{eq:sbc_dmp_emp} as 
     1327the atmosphere does not care about ocean surface salinity \citep{Madec1997}. 
     1328The SSS restoring term should be viewed as a flux correction on freshwater fluxes to 
     1329reduce the uncertainties we have on the observed freshwater budget. 
    12311330 
    12321331% ------------------------------------------------------------------------------------------------------------- 
     
    12361335\label{subsec:SBC_ice-cover} 
    12371336 
    1238 The presence at the sea surface of an ice covered area modifies all the fluxes  
    1239 transmitted to the ocean. There are several way to handle sea-ice in the system  
    1240 depending on the value of the \np{nn\_ice} namelist parameter found in \ngn{namsbc} namelist.   
     1337The presence at the sea surface of an ice covered area modifies all the fluxes transmitted to the ocean. 
     1338There are several way to handle sea-ice in the system depending on 
     1339the value of the \np{nn\_ice} namelist parameter found in \ngn{namsbc} namelist. 
    12411340\begin{description} 
    1242 \item[nn{\_}ice = 0]  there will never be sea-ice in the computational domain.  
    1243 This is a typical namelist value used for tropical ocean domain. The surface fluxes  
    1244 are simply specified for an ice-free ocean. No specific things is done for sea-ice. 
    1245 \item[nn{\_}ice = 1]  sea-ice can exist in the computational domain, but no sea-ice model  
    1246 is used. An observed ice covered area is read in a file. Below this area, the SST is  
    1247 restored to the freezing point and the heat fluxes are set to $-4~W/m^2$ ($-2~W/m^2$)  
    1248 in the northern (southern) hemisphere. The associated modification of the freshwater  
    1249 fluxes are done in such a way that the change in buoyancy fluxes remains zero.  
    1250 This prevents deep convection to occur when trying to reach the freezing point  
    1251 (and so ice covered area condition) while the SSS is too large. This manner of  
    1252 managing sea-ice area, just by using si IF case, is usually referred as the \textit{ice-if}  
    1253 model. It can be found in the \mdl{sbcice{\_}if} module. 
    1254 \item[nn{\_}ice = 2 or more]  A full sea ice model is used. This model computes the  
    1255 ice-ocean fluxes, that are combined with the air-sea fluxes using the ice fraction of  
    1256 each model cell to provide the surface ocean fluxes. Note that the activation of a  
    1257 sea-ice model is is done by defining a CPP key (\key{lim3} or \key{cice}).  
    1258 The activation automatically overwrites the read value of nn{\_}ice to its appropriate  
    1259 value ($i.e.$ $2$ for LIM-3 or $3$ for CICE). 
     1341\item[nn{\_}ice = 0] 
     1342  there will never be sea-ice in the computational domain. 
     1343  This is a typical namelist value used for tropical ocean domain. 
     1344  The surface fluxes are simply specified for an ice-free ocean. 
     1345  No specific things is done for sea-ice. 
     1346\item[nn{\_}ice = 1] 
     1347  sea-ice can exist in the computational domain, but no sea-ice model is used. 
     1348  An observed ice covered area is read in a file. 
     1349  Below this area, the SST is restored to the freezing point and 
     1350  the heat fluxes are set to $-4~W/m^2$ ($-2~W/m^2$) in the northern (southern) hemisphere. 
     1351  The associated modification of the freshwater fluxes are done in such a way that 
     1352  the change in buoyancy fluxes remains zero. 
     1353  This prevents deep convection to occur when trying to reach the freezing point 
     1354  (and so ice covered area condition) while the SSS is too large. 
     1355  This manner of managing sea-ice area, just by using si IF case, 
     1356  is usually referred as the \textit{ice-if} model. 
     1357  It can be found in the \mdl{sbcice{\_}if} module. 
     1358\item[nn{\_}ice = 2 or more] 
     1359  A full sea ice model is used. 
     1360  This model computes the ice-ocean fluxes, 
     1361  that are combined with the air-sea fluxes using the ice fraction of each model cell to 
     1362  provide the surface ocean fluxes. 
     1363  Note that the activation of a sea-ice model is is done by defining a CPP key (\key{lim3} or \key{cice}). 
     1364  The activation automatically overwrites the read value of nn{\_}ice to its appropriate value 
     1365  ($i.e.$ $2$ for LIM-3 or $3$ for CICE). 
    12601366\end{description} 
    12611367 
     
    12651371\label{subsec:SBC_cice} 
    12661372 
    1267 It is now possible to couple a regional or global NEMO configuration (without AGRIF) to the CICE sea-ice 
    1268 model by using \key{cice}.  The CICE code can be obtained from  
    1269 \href{http://oceans11.lanl.gov/trac/CICE/}{LANL} and the additional 'hadgem3' drivers will be required,  
    1270 even with the latest code release.  Input grid files consistent with those used in NEMO will also be needed,  
    1271 and CICE CPP keys \textbf{ORCA\_GRID}, \textbf{CICE\_IN\_NEMO} and \textbf{coupled} should be used (seek advice from UKMO  
    1272 if necessary).  Currently the code is only designed to work when using the CORE forcing option for NEMO (with 
    1273 \textit{calc\_strair}\forcode{ = .true.} and \textit{calc\_Tsfc}\forcode{ = .true.} in the CICE name-list), or alternatively when NEMO  
    1274 is coupled to the HadGAM3 atmosphere model (with \textit{calc\_strair}\forcode{ = .false.} and \textit{calc\_Tsfc}\forcode{ = false}). 
    1275 The code is intended to be used with \np{nn\_fsbc} set to 1 (although coupling ocean and ice less frequently  
    1276 should work, it is possible the calculation of some of the ocean-ice fluxes needs to be modified slightly - the 
    1277 user should check that results are not significantly different to the standard case). 
    1278  
    1279 There are two options for the technical coupling between NEMO and CICE.  The standard version allows 
    1280 complete flexibility for the domain decompositions in the individual models, but this is at the expense of global 
    1281 gather and scatter operations in the coupling which become very expensive on larger numbers of processors. The 
    1282 alternative option (using \key{nemocice\_decomp} for both NEMO and CICE) ensures that the domain decomposition is 
    1283 identical in both models (provided domain parameters are set appropriately, and  
    1284 \textit{processor\_shape~=~square-ice} and \textit{distribution\_wght~=~block} in the CICE name-list) and allows 
    1285 much more efficient direct coupling on individual processors.  This solution scales much better although it is at  
    1286 the expense of having more idle CICE processors in areas where there is no sea ice. 
     1373It is now possible to couple a regional or global NEMO configuration (without AGRIF) 
     1374to the CICE sea-ice model by using \key{cice}. 
     1375The CICE code can be obtained from \href{http://oceans11.lanl.gov/trac/CICE/}{LANL} and 
     1376the additional 'hadgem3' drivers will be required, even with the latest code release. 
     1377Input grid files consistent with those used in NEMO will also be needed, 
     1378and CICE CPP keys \textbf{ORCA\_GRID}, \textbf{CICE\_IN\_NEMO} and \textbf{coupled} should be used 
     1379(seek advice from UKMO if necessary). 
     1380Currently the code is only designed to work when using the CORE forcing option for NEMO 
     1381(with \textit{calc\_strair}\forcode{ = .true.} and \textit{calc\_Tsfc}\forcode{ = .true.} in the CICE name-list), 
     1382or alternatively when NEMO is coupled to the HadGAM3 atmosphere model 
     1383(with \textit{calc\_strair}\forcode{ = .false.} and \textit{calc\_Tsfc}\forcode{ = false}). 
     1384The code is intended to be used with \np{nn\_fsbc} set to 1 
     1385(although coupling ocean and ice less frequently should work, 
     1386it is possible the calculation of some of the ocean-ice fluxes needs to be modified slightly - 
     1387the user should check that results are not significantly different to the standard case). 
     1388 
     1389There are two options for the technical coupling between NEMO and CICE. 
     1390The standard version allows complete flexibility for the domain decompositions in the individual models, 
     1391but this is at the expense of global gather and scatter operations in the coupling which 
     1392become very expensive on larger numbers of processors. 
     1393The alternative option (using \key{nemocice\_decomp} for both NEMO and CICE) ensures that 
     1394the domain decomposition is identical in both models (provided domain parameters are set appropriately, 
     1395and \textit{processor\_shape~=~square-ice} and \textit{distribution\_wght~=~block} in the CICE name-list) and 
     1396allows much more efficient direct coupling on individual processors. 
     1397This solution scales much better although it is at the expense of having more idle CICE processors in areas where 
     1398there is no sea ice. 
    12871399 
    12881400% ------------------------------------------------------------------------------------------------------------- 
     
    12921404\label{subsec:SBC_fwb} 
    12931405 
    1294 For global ocean simulation it can be useful to introduce a control of the mean sea  
    1295 level in order to prevent unrealistic drift of the sea surface height due to inaccuracy  
    1296 in the freshwater fluxes. In \NEMO, two way of controlling the the freshwater budget.  
     1406For global ocean simulation it can be useful to introduce a control of the mean sea level in order to 
     1407prevent unrealistic drift of the sea surface height due to inaccuracy in the freshwater fluxes. 
     1408In \NEMO, two way of controlling the the freshwater budget.  
    12971409\begin{description} 
    1298 \item[\np{nn\_fwb}\forcode{ = 0}]  no control at all. The mean sea level is free to drift, and will  
    1299 certainly do so. 
    1300 \item[\np{nn\_fwb}\forcode{ = 1}]  global mean \textit{emp} set to zero at each model time step.  
     1410\item[\np{nn\_fwb}\forcode{ = 0}] 
     1411  no control at all. 
     1412  The mean sea level is free to drift, and will certainly do so. 
     1413\item[\np{nn\_fwb}\forcode{ = 1}] 
     1414  global mean \textit{emp} set to zero at each model time step.  
    13011415%Note that with a sea-ice model, this technique only control the mean sea level with linear free surface (\key{vvl} not defined) and no mass flux between ocean and ice (as it is implemented in the current ice-ocean coupling).  
    1302 \item[\np{nn\_fwb}\forcode{ = 2}]  freshwater budget is adjusted from the previous year annual  
    1303 mean budget which is read in the \textit{EMPave\_old.dat} file. As the model uses the  
    1304 Boussinesq approximation, the annual mean fresh water budget is simply evaluated  
    1305 from the change in the mean sea level at January the first and saved in the  
    1306 \textit{EMPav.dat} file.  
     1416\item[\np{nn\_fwb}\forcode{ = 2}] 
     1417  freshwater budget is adjusted from the previous year annual mean budget which 
     1418  is read in the \textit{EMPave\_old.dat} file. 
     1419  As the model uses the Boussinesq approximation, the annual mean fresh water budget is simply evaluated from 
     1420  the change in the mean sea level at January the first and saved in the \textit{EMPav.dat} file.  
    13071421\end{description} 
    13081422 
     
    13181432%------------------------------------------------------------------------------------------------------------- 
    13191433 
    1320 In order to read a neutral drag coefficient, from an external data source ($i.e.$ a wave model), the  
    1321 logical variable \np{ln\_cdgw} in \ngn{namsbc} namelist must be set to \forcode{.true.}.  
    1322 The \mdl{sbcwave} module containing the routine \np{sbc\_wave} reads the 
    1323 namelist \ngn{namsbc\_wave} (for external data names, locations, frequency, interpolation and all  
    1324 the miscellanous options allowed by Input Data generic Interface see \autoref{sec:SBC_input})  
    1325 and a 2D field of neutral drag coefficient.  
     1434In order to read a neutral drag coefficient, from an external data source ($i.e.$ a wave model), 
     1435the logical variable \np{ln\_cdgw} in \ngn{namsbc} namelist must be set to \forcode{.true.}. 
     1436The \mdl{sbcwave} module containing the routine \np{sbc\_wave} reads the namelist \ngn{namsbc\_wave} 
     1437(for external data names, locations, frequency, interpolation and all the miscellanous options allowed by 
     1438Input Data generic Interface see \autoref{sec:SBC_input}) and 
     1439a 2D field of neutral drag coefficient. 
    13261440Then using the routine TURB\_CORE\_1Z or TURB\_CORE\_2Z, and starting from the neutral drag coefficent provided,  
    1327 the drag coefficient is computed according to stable/unstable conditions of the air-sea interface following \citet{Large_Yeager_Rep04}. 
     1441the drag coefficient is computed according to stable/unstable conditions of the air-sea interface following 
     1442\citet{Large_Yeager_Rep04}. 
    13281443 
    13291444 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_STO.tex

    r10146 r10368  
    1414 
    1515 
    16 The stochastic parametrization module aims to explicitly simulate uncertainties in the model.  
    17 More particularly, \cite{Brankart_OM2013} has shown that,  
    18 because of the nonlinearity of the seawater equation of state, unresolved scales represent  
    19 a major source of uncertainties in the computation of the large scale horizontal density gradient  
    20 (from T/S large scale fields), and that the impact of these uncertainties can be simulated  
    21 by random processes representing unresolved T/S fluctuations. 
     16The stochastic parametrization module aims to explicitly simulate uncertainties in the model. 
     17More particularly, \cite{Brankart_OM2013} has shown that, 
     18because of the nonlinearity of the seawater equation of state, unresolved scales represent a major source of 
     19uncertainties in the computation of the large scale horizontal density gradient (from T/S large scale fields), 
     20and that the impact of these uncertainties can be simulated by 
     21random processes representing unresolved T/S fluctuations. 
    2222 
    2323The stochastic formulation of the equation of state can be written as: 
     
    2626  \rho = \frac{1}{2} \sum_{i=1}^m\{ \rho[T+\Delta T_i,S+\Delta S_i,p_o(z)] + \rho[T-\Delta T_i,S-\Delta S_i,p_o(z)] \} 
    2727\end{equation} 
    28 where $p_o(z)$ is the reference pressure depending on the depth and,  
    29 $\Delta T_i$ and $\Delta S_i$ are a set of T/S perturbations defined as the scalar product  
    30 of the respective local T/S gradients with random walks $\mathbf{\xi}$: 
     28where $p_o(z)$ is the reference pressure depending on the depth and, 
     29$\Delta T_i$ and $\Delta S_i$ are a set of T/S perturbations defined as 
     30the scalar product of the respective local T/S gradients with random walks $\mathbf{\xi}$: 
    3131\begin{equation} 
    3232 \label{eq:sto_pert} 
    3333 \Delta T_i = \mathbf{\xi}_i \cdot \nabla T \qquad \hbox{and} \qquad \Delta S_i = \mathbf{\xi}_i \cdot \nabla S 
    3434\end{equation} 
    35 $\mathbf{\xi}_i$ are produced by a first-order autoregressive processes (AR-1) with  
    36 a parametrized decorrelation time scale, and horizontal and vertical standard deviations $\sigma_s$.  
     35$\mathbf{\xi}_i$ are produced by a first-order autoregressive processes (AR-1) with 
     36a parametrized decorrelation time scale, and horizontal and vertical standard deviations $\sigma_s$. 
    3737$\mathbf{\xi}$ are uncorrelated over the horizontal and fully correlated along the vertical. 
    3838 
     
    4141\label{sec:STO_the_details} 
    4242 
    43 The starting point of our implementation of stochastic parameterizations 
    44 in NEMO is to observe that many existing parameterizations are based 
    45 on autoregressive processes, which are used as a basic source of randomness 
    46 to transform a deterministic model into a probabilistic model. 
     43The starting point of our implementation of stochastic parameterizations in NEMO is to observe that 
     44many existing parameterizations are based on autoregressive processes, 
     45which are used as a basic source of randomness to transform a deterministic model into a probabilistic model. 
    4746A generic approach is thus to add one single new module in NEMO, 
    48 generating processes with appropriate statistics 
    49 to simulate each kind of uncertainty in the model 
     47generating processes with appropriate statistics to simulate each kind of uncertainty in the model 
    5048(see \cite{Brankart_al_GMD2015} for more details). 
    5149 
    52 In practice, at every model grid point, independent Gaussian autoregressive 
    53 processes~$\xi^{(i)},\,i=1,\ldots,m$ are first generated 
    54 using the same basic equation: 
     50In practice, at every model grid point, 
     51independent Gaussian autoregressive processes~$\xi^{(i)},\,i=1,\ldots,m$ are first generated using 
     52the same basic equation: 
    5553 
    5654\begin{equation} 
     
    6058 
    6159\noindent 
    62 where $k$ is the index of the model timestep; and 
    63 $a^{(i)}$, $b^{(i)}$, $c^{(i)}$ are parameters defining 
    64 the mean ($\mu^{(i)}$) standard deviation ($\sigma^{(i)}$) 
    65 and correlation timescale ($\tau^{(i)}$) of each process: 
     60where $k$ is the index of the model timestep and 
     61$a^{(i)}$, $b^{(i)}$, $c^{(i)}$ are parameters defining the mean ($\mu^{(i)}$) standard deviation ($\sigma^{(i)}$) and 
     62correlation timescale ($\tau^{(i)}$) of each process: 
    6663 
    6764\begin{itemize} 
    68 \item for order~1 processes, $w^{(i)}$ is a Gaussian white noise, 
    69 with zero mean and standard deviation equal to~1, and the parameters 
    70 $a^{(i)}$, $b^{(i)}$, $c^{(i)}$ are given by: 
     65\item 
     66  for order~1 processes, $w^{(i)}$ is a Gaussian white noise, with zero mean and standard deviation equal to~1, 
     67  and the parameters $a^{(i)}$, $b^{(i)}$, $c^{(i)}$ are given by: 
    7168 
    7269\begin{equation} 
     
    8380\end{equation} 
    8481 
    85 \item for order~$n>1$ processes, $w^{(i)}$ is an order~$n-1$ autoregressive process, 
    86 with zero mean, standard deviation equal to~$\sigma^{(i)}$; correlation timescale 
    87 equal to~$\tau^{(i)}$; and the parameters $a^{(i)}$, $b^{(i)}$, $c^{(i)}$ are given by: 
     82\item 
     83  for order~$n>1$ processes, $w^{(i)}$ is an order~$n-1$ autoregressive process, with zero mean, 
     84  standard deviation equal to~$\sigma^{(i)}$; 
     85  correlation timescale equal to~$\tau^{(i)}$; 
     86  and the parameters $a^{(i)}$, $b^{(i)}$, $c^{(i)}$ are given by: 
    8887 
    8988\begin{equation} 
     
    103102 
    104103\noindent 
    105 In this way, higher order processes can be easily generated recursively using  
    106 the same piece of code implementing (\autoref{eq:autoreg}),  
    107 and using succesively processes from order $0$ to~$n-1$ as~$w^{(i)}$. 
    108 The parameters in (\autoref{eq:ord2}) are computed so that this recursive application 
    109 of (\autoref{eq:autoreg}) leads to processes with the required standard deviation 
    110 and correlation timescale, with the additional condition that 
    111 the $n-1$ first derivatives of the autocorrelation function 
    112 are equal to zero at~$t=0$, so that the resulting processes 
    113 become smoother and smoother as $n$ is increased. 
     104In this way, higher order processes can be easily generated recursively using the same piece of code implementing 
     105(\autoref{eq:autoreg}), and using succesively processes from order $0$ to~$n-1$ as~$w^{(i)}$. 
     106The parameters in (\autoref{eq:ord2}) are computed so that this recursive application of 
     107(\autoref{eq:autoreg}) leads to processes with the required standard deviation and correlation timescale, 
     108with the additional condition that the $n-1$ first derivatives of the autocorrelation function are equal to 
     109zero at~$t=0$, so that the resulting processes become smoother and smoother as $n$ is increased. 
    114110 
    115 Overall, this method provides quite a simple and generic way of generating  
    116 a wide class of stochastic processes.  
    117 However, this also means that new model parameters are needed to specify each of  
    118 these stochastic processes. As in any parameterization of lacking physics,  
    119 a very important issues then to tune these new parameters using either first principles,  
    120 model simulations, or real-world observations. 
     111Overall, this method provides quite a simple and generic way of generating a wide class of stochastic processes. 
     112However, this also means that new model parameters are needed to specify each of these stochastic processes. 
     113As in any parameterization of lacking physics, a very important issues then to tune these new parameters using 
     114either first principles, model simulations, or real-world observations. 
    121115 
    122116\section{Implementation details} 
     
    131125It involves three modules :  
    132126\begin{description} 
    133 \item[\mdl{stopar}] : define the Stochastic parameters and their time evolution. 
    134 \item[\mdl{storng}] : a random number generator based on (and includes) the 64-bit KISS  
    135                       (Keep It Simple Stupid) random number generator distributed by George Marsaglia  
    136                       (see \href{https://groups.google.com/forum/#!searchin/comp.lang.fortran/64-bit$20KISS$20RNGs}{here}) 
    137 \item[\mdl{stopts}] : stochastic parametrisation associated with the non-linearity of the equation of seawater,  
    138  implementing \autoref{eq:sto_pert} and specific piece of code in the equation of state implementing \autoref{eq:eos_sto}. 
     127\item[\mdl{stopar}:] 
     128  define the Stochastic parameters and their time evolution. 
     129\item[\mdl{storng}:] 
     130  a random number generator based on (and includes) the 64-bit KISS (Keep It Simple Stupid) random number generator 
     131  distributed by George Marsaglia 
     132  (see \href{https://groups.google.com/forum/#!searchin/comp.lang.fortran/64-bit$20KISS$20RNGs}{here}) 
     133\item[\mdl{stopts}:] 
     134  stochastic parametrisation associated with the non-linearity of the equation of seawater, 
     135  implementing \autoref{eq:sto_pert} and specific piece of code in 
     136  the equation of state implementing \autoref{eq:eos_sto}. 
    139137\end{description} 
    140138 
     
    142140 
    143141The first routine (\rou{sto\_par}) is a direct implementation of (\autoref{eq:autoreg}), 
    144 applied at each model grid point (in 2D or 3D),  
    145 and called at each model time step ($k$) to update 
    146 every autoregressive process ($i=1,\ldots,m$). 
     142applied at each model grid point (in 2D or 3D), and called at each model time step ($k$) to 
     143update every autoregressive process ($i=1,\ldots,m$). 
    147144This routine also includes a filtering operator, applied to $w^{(i)}$, 
    148145to introduce a spatial correlation between the stochastic processes. 
    149146 
    150 The second routine (\rou{sto\_par\_init}) is an initialization routine mainly dedicated 
    151 to the computation of parameters $a^{(i)}, b^{(i)}, c^{(i)}$ 
    152 for each autoregressive process, as a function of the statistical properties 
    153 required by the model user (mean, standard deviation, time correlation, 
    154 order of the process,\ldots).  
     147The second routine (\rou{sto\_par\_init}) is an initialization routine mainly dedicated to 
     148the computation of parameters $a^{(i)}, b^{(i)}, c^{(i)}$ for each autoregressive process, 
     149as a function of the statistical properties required by the model user 
     150(mean, standard deviation, time correlation, order of the process,\ldots).  
    155151 
    156152Parameters for the processes can be specified through the following \ngn{namsto} namelist parameters: 
    157153\begin{description} 
    158    \item[\np{nn\_sto\_eos}]   : number of independent random walks  
    159    \item[\np{rn\_eos\_stdxy}] : random walk horz. standard deviation (in grid points) 
    160    \item[\np{rn\_eos\_stdz}]  : random walk vert. standard deviation (in grid points) 
    161    \item[\np{rn\_eos\_tcor}]  : random walk time correlation (in timesteps) 
    162    \item[\np{nn\_eos\_ord}]   : order of autoregressive processes 
    163    \item[\np{nn\_eos\_flt}]   : passes of Laplacian filter 
    164    \item[\np{rn\_eos\_lim}]   : limitation factor (default = 3.0) 
     154\item[\np{nn\_sto\_eos}:]   number of independent random walks 
     155\item[\np{rn\_eos\_stdxy}:] random walk horz. standard deviation (in grid points) 
     156\item[\np{rn\_eos\_stdz}:] random walk vert. standard deviation (in grid points) 
     157\item[\np{rn\_eos\_tcor}:] random walk time correlation (in timesteps) 
     158\item[\np{nn\_eos\_ord}:]  order of autoregressive processes 
     159\item[\np{nn\_eos\_flt}:]  passes of Laplacian filter 
     160\item[\np{rn\_eos\_lim}:]  limitation factor (default = 3.0) 
    165161\end{description} 
    166162This routine also includes the initialization (seeding) of the random number generator. 
    167163 
    168 The third routine (\rou{sto\_rst\_write}) writes a restart file (which suffix name is  
    169 given by \np{cn\_storst\_out} namelist parameter) containing the current value of  
     164The third routine (\rou{sto\_rst\_write}) writes a restart file 
     165(which suffix name is given by \np{cn\_storst\_out} namelist parameter) containing the current value of 
    170166all autoregressive processes to allow restarting a simulation from where it has been interrupted. 
    171167This file also contains the current state of the random number generator. 
    172 When \np{ln\_rststo} is set to \forcode{.true.}), the restart file (which suffix name is  
    173 given by \np{cn\_storst\_in} namelist parameter) is read by the initialization routine  
    174 (\rou{sto\_par\_init}). The simulation will continue exactly as if it was not interrupted 
    175 only  when \np{ln\_rstseed} is set to \forcode{.true.}, $i.e.$ when the state of  
    176 the random number generator is read in the restart file. 
     168When \np{ln\_rststo} is set to \forcode{.true.}), 
     169the restart file (which suffix name is given by \np{cn\_storst\_in} namelist parameter) is read by 
     170the initialization routine (\rou{sto\_par\_init}). 
     171The simulation will continue exactly as if it was not interrupted only 
     172when \np{ln\_rstseed} is set to \forcode{.true.}, 
     173$i.e.$ when the state of the random number generator is read in the restart file. 
    177174 
    178175 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_TRA.tex

    r10146 r10368  
    1717%$\ $\newline    % force a new ligne 
    1818 
    19 Using the representation described in \autoref{chap:DOM}, several semi-discrete  
    20 space forms of the tracer equations are available depending on the vertical  
    21 coordinate used and on the physics used. In all the equations presented  
    22 here, the masking has been omitted for simplicity. One must be aware that  
    23 all the quantities are masked fields and that each time a mean or difference  
    24 operator is used, the resulting field is multiplied by a mask. 
    25  
    26 The two active tracers are potential temperature and salinity. Their prognostic  
    27 equations can be summarized as follows: 
     19Using the representation described in \autoref{chap:DOM}, 
     20several semi-discrete space forms of the tracer equations are available depending on 
     21the vertical coordinate used and on the physics used. 
     22In all the equations presented here, the masking has been omitted for simplicity. 
     23One must be aware that all the quantities are masked fields and 
     24that each time a mean or difference operator is used, 
     25the resulting field is multiplied by a mask. 
     26 
     27The two active tracers are potential temperature and salinity. 
     28Their prognostic equations can be summarized as follows: 
    2829\begin{equation*} 
    2930\text{NXT} = \text{ADV}+\text{LDF}+\text{ZDF}+\text{SBC} 
     
    3132\end{equation*} 
    3233 
    33 NXT stands for next, referring to the time-stepping. From left to right, the terms  
    34 on the rhs of the tracer equations are the advection (ADV), the lateral diffusion  
    35 (LDF), the vertical diffusion (ZDF), the contributions from the external forcings  
    36 (SBC: Surface Boundary Condition, QSR: penetrative Solar Radiation, and BBC:  
    37 Bottom Boundary Condition), the contribution from the bottom boundary Layer  
    38 (BBL) parametrisation, and an internal damping (DMP) term. The terms QSR,  
    39 BBC, BBL and DMP are optional. The external forcings and parameterisations  
    40 require complex inputs and complex calculations ($e.g.$ bulk formulae, estimation  
    41 of mixing coefficients) that are carried out in the SBC, LDF and ZDF modules and  
    42 described in \autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively.  
    43 Note that \mdl{tranpc}, the non-penetrative convection module, although  
    44 located in the NEMO/OPA/TRA directory as it directly modifies the tracer fields,  
    45 is described with the model vertical physics (ZDF) together with other available  
    46 parameterization of convection. 
    47  
    48 In the present chapter we also describe the diagnostic equations used to compute  
    49 the sea-water properties (density, Brunt-V\"{a}is\"{a}l\"{a} frequency, specific heat and  
    50 freezing point with associated modules \mdl{eosbn2} and \mdl{phycst}). 
    51  
    52 The different options available to the user are managed by namelist logicals or CPP keys.  
    53 For each equation term  \textit{TTT}, the namelist logicals are \textit{ln\_traTTT\_xxx},  
    54 where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme.  
    55 The CPP key (when it exists) is \key{traTTT}. The equivalent code can be  
    56 found in the \textit{traTTT} or \textit{traTTT\_xxx} module, in the NEMO/OPA/TRA directory. 
    57  
    58 The user has the option of extracting each tendency term on the RHS of the tracer  
    59 equation for output (\np{ln\_tra\_trd} or \np{ln\_tra\_mxl}\forcode{ = .true.}), as described in \autoref{chap:DIA}. 
     34NXT stands for next, referring to the time-stepping. 
     35From left to right, the terms on the rhs of the tracer equations are the advection (ADV), 
     36the lateral diffusion (LDF), the vertical diffusion (ZDF), the contributions from the external forcings 
     37(SBC: Surface Boundary Condition, QSR: penetrative Solar Radiation, and BBC: Bottom Boundary Condition), 
     38the contribution from the bottom boundary Layer (BBL) parametrisation, and an internal damping (DMP) term. 
     39The terms QSR, BBC, BBL and DMP are optional. 
     40The external forcings and parameterisations require complex inputs and complex calculations 
     41($e.g.$ bulk formulae, estimation of mixing coefficients) that are carried out in the SBC, LDF and ZDF modules and  
     42described in \autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively. 
     43Note that \mdl{tranpc}, the non-penetrative convection module, although located in the NEMO/OPA/TRA directory as 
     44it directly modifies the tracer fields, is described with the model vertical physics (ZDF) together with 
     45other available parameterization of convection. 
     46 
     47In the present chapter we also describe the diagnostic equations used to compute the sea-water properties 
     48(density, Brunt-V\"{a}is\"{a}l\"{a} frequency, specific heat and freezing point with 
     49associated modules \mdl{eosbn2} and \mdl{phycst}). 
     50 
     51The different options available to the user are managed by namelist logicals or CPP keys. 
     52For each equation term  \textit{TTT}, the namelist logicals are \textit{ln\_traTTT\_xxx}, 
     53where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme. 
     54The CPP key (when it exists) is \key{traTTT}. 
     55The equivalent code can be found in the \textit{traTTT} or \textit{traTTT\_xxx} module, 
     56in the NEMO/OPA/TRA directory. 
     57 
     58The user has the option of extracting each tendency term on the RHS of the tracer equation for output 
     59(\np{ln\_tra\_trd} or \np{ln\_tra\_mxl}\forcode{ = .true.}), as described in \autoref{chap:DIA}. 
    6060 
    6161$\ $\newline    % force a new ligne 
     
    7070%------------------------------------------------------------------------------------------------------------- 
    7171 
    72 When considered ($i.e.$ when \np{ln\_traadv\_NONE} is not set to \forcode{.true.}),  
    73 the advection tendency of a tracer is expressed in flux form,  
    74 $i.e.$ as the divergence of the advective fluxes. Its discrete expression is given by : 
     72When considered ($i.e.$ when \np{ln\_traadv\_NONE} is not set to \forcode{.true.}), 
     73the advection tendency of a tracer is expressed in flux form, 
     74$i.e.$ as the divergence of the advective fluxes. 
     75Its discrete expression is given by : 
    7576\begin{equation} \label{eq:tra_adv} 
    7677ADV_\tau =-\frac{1}{b_t} \left(  
     
    7980-\frac{1}{e_{3t}} \;\delta _k \left[ w\; \tau _w \right] 
    8081\end{equation} 
    81 where $\tau$ is either T or S, and $b_t= e_{1t}\,e_{2t}\,e_{3t}$ is the volume of $T$-cells.  
    82 The flux form in \autoref{eq:tra_adv}  
    83 implicitly requires the use of the continuity equation. Indeed, it is obtained 
    84 by using the following equality : $\nabla \cdot \left( \vect{U}\,T \right)=\vect{U} \cdot \nabla T$  
    85 which results from the use of the continuity equation,  $\partial _t e_3 + e_3\;\nabla \cdot \vect{U}=0$  
    86 (which reduces to $\nabla \cdot \vect{U}=0$ in linear free surface, $i.e.$ \np{ln\_linssh}\forcode{ = .true.}).  
    87 Therefore it is of paramount importance to design the discrete analogue of the  
    88 advection tendency so that it is consistent with the continuity equation in order to  
    89 enforce the conservation properties of the continuous equations. In other words,  
    90 by setting $\tau = 1$ in (\autoref{eq:tra_adv}) we recover the discrete form of  
     82where $\tau$ is either T or S, and $b_t= e_{1t}\,e_{2t}\,e_{3t}$ is the volume of $T$-cells. 
     83The flux form in \autoref{eq:tra_adv} implicitly requires the use of the continuity equation. 
     84Indeed, it is obtained by using the following equality: 
     85$\nabla \cdot \left( \vect{U}\,T \right)=\vect{U} \cdot \nabla T$ which 
     86results from the use of the continuity equation,  $\partial _t e_3 + e_3\;\nabla \cdot \vect{U}=0$ 
     87(which reduces to $\nabla \cdot \vect{U}=0$ in linear free surface, $i.e.$ \np{ln\_linssh}\forcode{ = .true.}). 
     88Therefore it is of paramount importance to design the discrete analogue of the advection tendency so that 
     89it is consistent with the continuity equation in order to enforce the conservation properties of 
     90the continuous equations. 
     91In other words, by setting $\tau = 1$ in (\autoref{eq:tra_adv}) we recover the discrete form of 
    9192the continuity equation which is used to calculate the vertical velocity. 
    9293%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    93 \begin{figure}[!t]    \begin{center} 
    94 \includegraphics[width=0.9\textwidth]{Fig_adv_scheme} 
    95 \caption{   \protect\label{fig:adv_scheme}  
    96 Schematic representation of some ways used to evaluate the tracer value  
    97 at $u$-point and the amount of tracer exchanged between two neighbouring grid  
    98 points. Upsteam biased scheme (ups): the upstream value is used and the black  
    99 area is exchanged. Piecewise parabolic method (ppm): a parabolic interpolation  
    100 is used and the black and dark grey areas are exchanged. Monotonic upstream  
    101 scheme for conservative laws (muscl):  a parabolic interpolation is used and black,  
    102 dark grey and grey areas are exchanged. Second order scheme (cen2): the mean  
    103 value is used and black, dark grey, grey and light grey areas are exchanged. Note  
    104 that this illustration does not include the flux limiter used in ppm and muscl schemes.} 
    105 \end{center}   \end{figure} 
     94\begin{figure}[!t] 
     95  \begin{center} 
     96    \includegraphics[width=0.9\textwidth]{Fig_adv_scheme} 
     97    \caption{  \protect\label{fig:adv_scheme} 
     98      Schematic representation of some ways used to evaluate the tracer value at $u$-point and 
     99      the amount of tracer exchanged between two neighbouring grid points. 
     100      Upsteam biased scheme (ups): 
     101      the upstream value is used and the black area is exchanged. 
     102      Piecewise parabolic method (ppm): 
     103      a parabolic interpolation is used and the black and dark grey areas are exchanged. 
     104      Monotonic upstream scheme for conservative laws (muscl): 
     105      a parabolic interpolation is used and black, dark grey and grey areas are exchanged. 
     106      Second order scheme (cen2): 
     107      the mean value is used and black, dark grey, grey and light grey areas are exchanged. 
     108      Note that this illustration does not include the flux limiter used in ppm and muscl schemes. 
     109    } 
     110  \end{center} 
     111\end{figure} 
    106112%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    107113 
    108 The key difference between the advection schemes available in \NEMO is the choice  
    109 made in space and time interpolation to define the value of the tracer at the  
    110 velocity points (\autoref{fig:adv_scheme}).  
    111  
    112 Along solid lateral and bottom boundaries a zero tracer flux is automatically  
    113 specified, since the normal velocity is zero there. At the sea surface the  
    114 boundary condition depends on the type of sea surface chosen:  
     114The key difference between the advection schemes available in \NEMO is the choice made in space and 
     115time interpolation to define the value of the tracer at the velocity points 
     116(\autoref{fig:adv_scheme}). 
     117 
     118Along solid lateral and bottom boundaries a zero tracer flux is automatically specified, 
     119since the normal velocity is zero there. 
     120At the sea surface the boundary condition depends on the type of sea surface chosen: 
    115121\begin{description} 
    116 \item [linear free surface:] (\np{ln\_linssh}\forcode{ = .true.}) the first level thickness is constant in time:  
    117 the vertical boundary condition is applied at the fixed surface $z=0$  
    118 rather than on the moving surface $z=\eta$. There is a non-zero advective  
    119 flux which is set for all advection schemes as  
    120 $\left. {\tau _w } \right|_{k=1/2} =T_{k=1} $, $i.e.$  
    121 the product of surface velocity (at $z=0$) by the first level tracer value. 
    122 \item [non-linear free surface:] (\np{ln\_linssh}\forcode{ = .false.})  
    123 convergence/divergence in the first ocean level moves the free surface  
    124 up/down. There is no tracer advection through it so that the advective  
    125 fluxes through the surface are also zero  
     122\item[linear free surface:] 
     123  (\np{ln\_linssh}\forcode{ = .true.}) 
     124  the first level thickness is constant in time: 
     125  the vertical boundary condition is applied at the fixed surface $z=0$ rather than on the moving surface $z=\eta$. 
     126  There is a non-zero advective flux which is set for all advection schemes as 
     127  $\left. {\tau _w } \right|_{k=1/2} =T_{k=1} $, 
     128  $i.e.$ the product of surface velocity (at $z=0$) by the first level tracer value. 
     129\item[non-linear free surface:] 
     130  (\np{ln\_linssh}\forcode{ = .false.}) 
     131  convergence/divergence in the first ocean level moves the free surface up/down. 
     132  There is no tracer advection through it so that the advective fluxes through the surface are also zero. 
    126133\end{description} 
    127 In all cases, this boundary condition retains local conservation of tracer.  
    128 Global conservation is obtained in non-linear free surface case,  
    129 but \textit{not} in the linear free surface case. Nevertheless, in the latter case,  
    130 it is achieved to a good approximation since the non-conservative  
    131 term is the product of the time derivative of the tracer and the free surface  
    132 height, two quantities that are not correlated \citep{Roullet_Madec_JGR00,Griffies_al_MWR01,Campin2004}. 
    133  
    134 The velocity field that appears in (\autoref{eq:tra_adv}) and (\autoref{eq:tra_adv_zco})  
    135 is the centred (\textit{now}) \textit{effective} ocean velocity, $i.e.$ the \textit{eulerian} velocity 
    136 (see \autoref{chap:DYN}) plus the eddy induced velocity (\textit{eiv})  
    137 and/or the mixed layer eddy induced velocity (\textit{eiv}) 
    138 when those parameterisations are used (see \autoref{chap:LDF}). 
    139  
    140 Several tracer advection scheme are proposed, namely  
    141 a $2^{nd}$ or $4^{th}$ order centred schemes (CEN),  
     134In all cases, this boundary condition retains local conservation of tracer. 
     135Global conservation is obtained in non-linear free surface case, but \textit{not} in the linear free surface case. 
     136Nevertheless, in the latter case, it is achieved to a good approximation since 
     137the non-conservative term is the product of the time derivative of the tracer and the free surface height, 
     138two quantities that are not correlated \citep{Roullet_Madec_JGR00,Griffies_al_MWR01,Campin2004}. 
     139 
     140The velocity field that appears in (\autoref{eq:tra_adv} and \autoref{eq:tra_adv_zco}) 
     141is the centred (\textit{now}) \textit{effective} ocean velocity, 
     142$i.e.$ the \textit{eulerian} velocity (see \autoref{chap:DYN}) plus 
     143the eddy induced velocity (\textit{eiv}) and/or 
     144the mixed layer eddy induced velocity (\textit{eiv}) when 
     145those parameterisations are used (see \autoref{chap:LDF}). 
     146 
     147Several tracer advection scheme are proposed, namely a $2^{nd}$ or $4^{th}$ order centred schemes (CEN), 
    142148a $2^{nd}$ or $4^{th}$ order Flux Corrected Transport scheme (FCT), 
    143149a Monotone Upstream Scheme for Conservative Laws scheme (MUSCL), 
    144 a $3^{rd}$ Upstream Biased Scheme (UBS, also often called UP3), and 
    145 a Quadratic Upstream Interpolation for Convective Kinematics with  
     150a $3^{rd}$ Upstream Biased Scheme (UBS, also often called UP3), 
     151and a Quadratic Upstream Interpolation for Convective Kinematics with 
    146152Estimated Streaming Terms scheme (QUICKEST). 
    147 The choice is made in the \textit{\ngn{namtra\_adv}} namelist, by  
    148 setting to \forcode{.true.} one of the logicals \textit{ln\_traadv\_xxx}.  
    149 The corresponding code can be found in the \mdl{traadv\_xxx} module,  
    150 where \textit{xxx} is a 3 or 4 letter acronym corresponding to each scheme.  
    151 By default ($i.e.$ in the reference namelist, \ngn{namelist\_ref}), all the logicals  
    152 are set to \forcode{.false.}. If the user does not select an advection scheme  
    153 in the configuration namelist (\ngn{namelist\_cfg}), the tracers will \textit{not} be advected ! 
    154  
    155 Details of the advection schemes are given below. The choosing an advection scheme  
    156 is a complex matter which depends on the model physics, model resolution,  
     153The choice is made in the \textit{\ngn{namtra\_adv}} namelist, 
     154by setting to \forcode{.true.} one of the logicals \textit{ln\_traadv\_xxx}. 
     155The corresponding code can be found in the \mdl{traadv\_xxx} module, 
     156where \textit{xxx} is a 3 or 4 letter acronym corresponding to each scheme. 
     157By default ($i.e.$ in the reference namelist, \ngn{namelist\_ref}), all the logicals are set to \forcode{.false.}. 
     158If the user does not select an advection scheme in the configuration namelist (\ngn{namelist\_cfg}), 
     159the tracers will \textit{not} be advected! 
     160 
     161Details of the advection schemes are given below. 
     162The choosing an advection scheme is a complex matter which depends on the model physics, model resolution, 
    157163type of tracer, as well as the issue of numerical cost. In particular, we note that 
    158 (1) CEN and FCT schemes require an explicit diffusion operator  
    159 while the other schemes are diffusive enough so that they do not necessarily need additional diffusion ;  
     164(1) CEN and FCT schemes require an explicit diffusion operator while the other schemes are diffusive enough so that 
     165they do not necessarily need additional diffusion; 
    160166(2) CEN and UBS are not \textit{positive} schemes 
    161 \footnote{negative values can appear in an initially strictly positive tracer field  
    162 which is advected} 
    163 , implying that false extrema are permitted. Their use is not recommended on passive tracers ;  
    164 (3) It is recommended that the same advection-diffusion scheme is  
    165 used on both active and passive tracers. Indeed, if a source or sink of a  
    166 passive tracer depends on an active one, the difference of treatment of  
    167 active and passive tracers can create very nice-looking frontal structures  
    168 that are pure numerical artefacts. Nevertheless, most of our users set a different  
    169 treatment on passive and active tracers, that's the reason why this possibility  
    170 is offered. We strongly suggest them to perform a sensitivity experiment  
    171 using a same treatment to assess the robustness of their results. 
     167\footnote{negative values can appear in an initially strictly positive tracer field which is advected}, 
     168implying that false extrema are permitted. 
     169Their use is not recommended on passive tracers; 
     170(3) It is recommended that the same advection-diffusion scheme is used on both active and passive tracers. 
     171Indeed, if a source or sink of a passive tracer depends on an active one, 
     172the difference of treatment of active and passive tracers can create very nice-looking frontal structures that 
     173are pure numerical artefacts. 
     174Nevertheless, most of our users set a different treatment on passive and active tracers, 
     175that's the reason why this possibility is offered. 
     176We strongly suggest them to perform a sensitivity experiment using a same treatment to 
     177assess the robustness of their results. 
    172178 
    173179% ------------------------------------------------------------------------------------------------------------- 
     
    179185%        2nd order centred scheme   
    180186 
    181 The centred advection scheme (CEN) is used when \np{ln\_traadv\_cen}\forcode{ = .true.}.  
    182 Its order ($2^{nd}$ or $4^{th}$) can be chosen independently on horizontal (iso-level)  
    183 and vertical direction by setting \np{nn\_cen\_h} and \np{nn\_cen\_v} to $2$ or $4$.  
     187The centred advection scheme (CEN) is used when \np{ln\_traadv\_cen}\forcode{ = .true.}. 
     188Its order ($2^{nd}$ or $4^{th}$) can be chosen independently on horizontal (iso-level) and vertical direction by 
     189setting \np{nn\_cen\_h} and \np{nn\_cen\_v} to $2$ or $4$. 
    184190CEN implementation can be found in the \mdl{traadv\_cen} module. 
    185191 
    186 In the $2^{nd}$ order centred formulation (CEN2), the tracer at velocity points  
    187 is evaluated as the mean of the two neighbouring $T$-point values.  
     192In the $2^{nd}$ order centred formulation (CEN2), the tracer at velocity points is evaluated as the mean of 
     193the two neighbouring $T$-point values. 
    188194For example, in the $i$-direction : 
    189195\begin{equation} \label{eq:tra_adv_cen2} 
     
    191197\end{equation} 
    192198 
    193 CEN2 is non diffusive ($i.e.$ it conserves the tracer variance, $\tau^2)$  
    194 but dispersive ($i.e.$ it may create false extrema). It is therefore notoriously  
    195 noisy and must be used in conjunction with an explicit diffusion operator to  
    196 produce a sensible solution. The associated time-stepping is performed using  
    197 a leapfrog scheme in conjunction with an Asselin time-filter, so $T$ in  
    198 (\autoref{eq:tra_adv_cen2}) is the \textit{now} tracer value.  
    199  
    200 Note that using the CEN2, the overall tracer advection is of second  
    201 order accuracy since both (\autoref{eq:tra_adv}) and (\autoref{eq:tra_adv_cen2})  
    202 have this order of accuracy. 
     199CEN2 is non diffusive ($i.e.$ it conserves the tracer variance, $\tau^2)$ but dispersive 
     200($i.e.$ it may create false extrema). 
     201It is therefore notoriously noisy and must be used in conjunction with an explicit diffusion operator to 
     202produce a sensible solution. 
     203The associated time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter, 
     204so $T$ in (\autoref{eq:tra_adv_cen2}) is the \textit{now} tracer value.  
     205 
     206Note that using the CEN2, the overall tracer advection is of second order accuracy since 
     207both (\autoref{eq:tra_adv}) and (\autoref{eq:tra_adv_cen2}) have this order of accuracy. 
    203208 
    204209%        4nd order centred scheme   
    205210 
    206 In the $4^{th}$ order formulation (CEN4), tracer values are evaluated at u- and v-points as  
    207 a $4^{th}$ order interpolation, and thus depend on the four neighbouring $T$-points.  
     211In the $4^{th}$ order formulation (CEN4), tracer values are evaluated at u- and v-points as 
     212a $4^{th}$ order interpolation, and thus depend on the four neighbouring $T$-points. 
    208213For example, in the $i$-direction: 
    209214\begin{equation} \label{eq:tra_adv_cen4} 
     
    211216=\overline{   T - \frac{1}{6}\,\delta _i \left[ \delta_{i+1/2}[T] \,\right]   }^{\,i+1/2} 
    212217\end{equation} 
    213 In the vertical direction (\np{nn\_cen\_v}\forcode{ = 4}), a $4^{th}$ COMPACT interpolation  
    214 has been prefered \citep{Demange_PhD2014}. 
    215 In the COMPACT scheme, both the field and its derivative are interpolated,  
    216 which leads, after a matrix inversion, spectral characteristics  
    217 similar to schemes of higher order \citep{Lele_JCP1992}. 
     218In the vertical direction (\np{nn\_cen\_v}\forcode{ = 4}), 
     219a $4^{th}$ COMPACT interpolation has been prefered \citep{Demange_PhD2014}. 
     220In the COMPACT scheme, both the field and its derivative are interpolated, which leads, after a matrix inversion, 
     221spectral characteristics similar to schemes of higher order \citep{Lele_JCP1992}. 
    218222  
    219223 
    220 Strictly speaking, the CEN4 scheme is not a $4^{th}$ order advection scheme  
    221 but a $4^{th}$ order evaluation of advective fluxes, since the divergence of  
    222 advective fluxes \autoref{eq:tra_adv} is kept at $2^{nd}$ order.  
    223 The expression \textit{$4^{th}$ order scheme} used in oceanographic literature  
    224 is usually associated with the scheme presented here.  
    225 Introducing a \forcode{.true.} $4^{th}$ order advection scheme is feasible but,  
    226 for consistency reasons, it requires changes in the discretisation of the tracer  
    227 advection together with changes in the continuity equation,  
    228 and the momentum advection and pressure terms.   
    229  
    230 A direct consequence of the pseudo-fourth order nature of the scheme is that  
    231 it is not non-diffusive, $i.e.$ the global variance of a tracer is not preserved using CEN4.  
    232 Furthermore, it must be used in conjunction with an explicit diffusion operator  
    233 to produce a sensible solution.  
    234 As in CEN2 case, the time-stepping is performed using a leapfrog scheme in conjunction  
    235 with an Asselin time-filter, so $T$ in (\autoref{eq:tra_adv_cen4}) is the \textit{now} tracer. 
    236  
    237 At a $T$-grid cell adjacent to a boundary (coastline, bottom and surface),  
    238 an additional hypothesis must be made to evaluate $\tau _u^{cen4}$.  
    239 This hypothesis usually reduces the order of the scheme.  
    240 Here we choose to set the gradient of $T$ across the boundary to zero.  
    241 Alternative conditions can be specified, such as a reduction to a second order scheme  
    242 for these near boundary grid points. 
     224Strictly speaking, the CEN4 scheme is not a $4^{th}$ order advection scheme but 
     225a $4^{th}$ order evaluation of advective fluxes, 
     226since the divergence of advective fluxes \autoref{eq:tra_adv} is kept at $2^{nd}$ order. 
     227The expression \textit{$4^{th}$ order scheme} used in oceanographic literature is usually associated with 
     228the scheme presented here. 
     229Introducing a \forcode{.true.} $4^{th}$ order advection scheme is feasible but, for consistency reasons, 
     230it requires changes in the discretisation of the tracer advection together with changes in the continuity equation, 
     231and the momentum advection and pressure terms. 
     232 
     233A direct consequence of the pseudo-fourth order nature of the scheme is that it is not non-diffusive, 
     234$i.e.$ the global variance of a tracer is not preserved using CEN4. 
     235Furthermore, it must be used in conjunction with an explicit diffusion operator to produce a sensible solution. 
     236As in CEN2 case, the time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter, 
     237so $T$ in (\autoref{eq:tra_adv_cen4}) is the \textit{now} tracer. 
     238 
     239At a $T$-grid cell adjacent to a boundary (coastline, bottom and surface), 
     240an additional hypothesis must be made to evaluate $\tau _u^{cen4}$. 
     241This hypothesis usually reduces the order of the scheme. 
     242Here we choose to set the gradient of $T$ across the boundary to zero. 
     243Alternative conditions can be specified, such as a reduction to a second order scheme for 
     244these near boundary grid points. 
    243245 
    244246% ------------------------------------------------------------------------------------------------------------- 
     
    248250\label{subsec:TRA_adv_tvd} 
    249251 
    250 The Flux Corrected Transport schemes (FCT) is used when \np{ln\_traadv\_fct}\forcode{ = .true.}.  
    251 Its order ($2^{nd}$ or $4^{th}$) can be chosen independently on horizontal (iso-level)  
    252 and vertical direction by setting \np{nn\_fct\_h} and \np{nn\_fct\_v} to $2$ or $4$. 
     252The Flux Corrected Transport schemes (FCT) is used when \np{ln\_traadv\_fct}\forcode{ = .true.}. 
     253Its order ($2^{nd}$ or $4^{th}$) can be chosen independently on horizontal (iso-level) and vertical direction by 
     254setting \np{nn\_fct\_h} and \np{nn\_fct\_v} to $2$ or $4$. 
    253255FCT implementation can be found in the \mdl{traadv\_fct} module. 
    254256 
    255 In FCT formulation, the tracer at velocity points is evaluated using a combination of  
    256 an upstream and a centred scheme. For example, in the $i$-direction : 
     257In FCT formulation, the tracer at velocity points is evaluated using a combination of an upstream and 
     258a centred scheme. 
     259For example, in the $i$-direction : 
    257260\begin{equation} \label{eq:tra_adv_fct} 
    258261\begin{split} 
     
    265268\end{split} 
    266269\end{equation} 
    267 where $c_u$ is a flux limiter function taking values between 0 and 1.  
    268 The FCT order is the one of the centred scheme used ($i.e.$ it depends on the setting of 
    269 \np{nn\_fct\_h} and \np{nn\_fct\_v}. 
    270 There exist many ways to define $c_u$, each corresponding to a different  
    271 FCT scheme. The one chosen in \NEMO is described in \citet{Zalesak_JCP79}.  
    272 $c_u$ only departs from $1$ when the advective term produces a local extremum in the tracer field.  
    273 The resulting scheme is quite expensive but \emph{positive}.  
    274 It can be used on both active and passive tracers.  
    275 A comparison of FCT-2 with MUSCL and a MPDATA scheme can be found in \citet{Levy_al_GRL01}.  
    276  
    277 An additional option has been added controlled by \np{nn\_fct\_zts}. By setting this integer to  
    278 a value larger than zero, a $2^{nd}$ order FCT scheme is used on both horizontal and vertical direction,  
    279 but on the latter, a split-explicit time stepping is used, with a number of sub-timestep equals 
    280 to \np{nn\_fct\_zts}. This option can be useful when the size of the timestep is limited  
    281 by vertical advection \citep{Lemarie_OM2015}. Note that in this case, a similar split-explicit  
    282 time stepping should be used on vertical advection of momentum to insure a better stability 
    283 (see \autoref{subsec:DYN_zad}). 
    284  
    285 For stability reasons (see \autoref{chap:STP}), $\tau _u^{cen}$ is evaluated in (\autoref{eq:tra_adv_fct})  
    286 using the \textit{now} tracer while $\tau _u^{ups}$ is evaluated using the \textit{before} tracer. In other words,  
    287 the advective part of the scheme is time stepped with a leap-frog scheme  
     270where $c_u$ is a flux limiter function taking values between 0 and 1. 
     271The FCT order is the one of the centred scheme used 
     272($i.e.$ it depends on the setting of \np{nn\_fct\_h} and \np{nn\_fct\_v}). 
     273There exist many ways to define $c_u$, each corresponding to a different FCT scheme. 
     274The one chosen in \NEMO is described in \citet{Zalesak_JCP79}. 
     275$c_u$ only departs from $1$ when the advective term produces a local extremum in the tracer field. 
     276The resulting scheme is quite expensive but \emph{positive}. 
     277It can be used on both active and passive tracers. 
     278A comparison of FCT-2 with MUSCL and a MPDATA scheme can be found in \citet{Levy_al_GRL01}. 
     279 
     280An additional option has been added controlled by \np{nn\_fct\_zts}. 
     281By setting this integer to a value larger than zero, 
     282a $2^{nd}$ order FCT scheme is used on both horizontal and vertical direction, but on the latter, 
     283a split-explicit time stepping is used, with a number of sub-timestep equals to \np{nn\_fct\_zts}. 
     284This option can be useful when the size of the timestep is limited by vertical advection \citep{Lemarie_OM2015}. 
     285Note that in this case, a similar split-explicit time stepping should be used on vertical advection of momentum to 
     286insure a better stability (see \autoref{subsec:DYN_zad}). 
     287 
     288For stability reasons (see \autoref{chap:STP}), 
     289$\tau _u^{cen}$ is evaluated in (\autoref{eq:tra_adv_fct}) using the \textit{now} tracer while 
     290$\tau _u^{ups}$ is evaluated using the \textit{before} tracer. 
     291In other words, the advective part of the scheme is time stepped with a leap-frog scheme 
    288292while a forward scheme is used for the diffusive part.  
    289293 
     
    294298\label{subsec:TRA_adv_mus} 
    295299 
    296 The Monotone Upstream Scheme for Conservative Laws (MUSCL) is used when \np{ln\_traadv\_mus}\forcode{ = .true.}.  
     300The Monotone Upstream Scheme for Conservative Laws (MUSCL) is used when \np{ln\_traadv\_mus}\forcode{ = .true.}. 
    297301MUSCL implementation can be found in the \mdl{traadv\_mus} module. 
    298302 
    299 MUSCL has been first implemented in \NEMO by \citet{Levy_al_GRL01}. In its formulation, the tracer at velocity points  
    300 is evaluated assuming a linear tracer variation between two $T$-points  
    301 (\autoref{fig:adv_scheme}). For example, in the $i$-direction : 
     303MUSCL has been first implemented in \NEMO by \citet{Levy_al_GRL01}. 
     304In its formulation, the tracer at velocity points is evaluated assuming a linear tracer variation between 
     305two $T$-points (\autoref{fig:adv_scheme}). 
     306For example, in the $i$-direction : 
    302307\begin{equation} \label{eq:tra_adv_mus} 
    303308   \tau _u^{mus} = \left\{      \begin{aligned} 
     
    308313   \end{aligned}    \right. 
    309314\end{equation} 
    310 where $\widetilde{\partial _i \tau}$ is the slope of the tracer on which a limitation  
    311 is imposed to ensure the \textit{positive} character of the scheme. 
    312  
    313 The time stepping is performed using a forward scheme, that is the \textit{before}  
    314 tracer field is used to evaluate $\tau _u^{mus}$. 
    315  
    316 For an ocean grid point adjacent to land and where the ocean velocity is  
    317 directed toward land, an upstream flux is used. This choice ensure  
    318 the \textit{positive} character of the scheme.  
    319 In addition, fluxes round a grid-point where a runoff is applied can optionally be  
    320 computed using upstream fluxes (\np{ln\_mus\_ups}\forcode{ = .true.}). 
     315where $\widetilde{\partial _i \tau}$ is the slope of the tracer on which a limitation is imposed to 
     316ensure the \textit{positive} character of the scheme. 
     317 
     318The time stepping is performed using a forward scheme, 
     319that is the \textit{before} tracer field is used to evaluate $\tau _u^{mus}$. 
     320 
     321For an ocean grid point adjacent to land and where the ocean velocity is directed toward land, 
     322an upstream flux is used. 
     323This choice ensure the \textit{positive} character of the scheme. 
     324In addition, fluxes round a grid-point where a runoff is applied can optionally be computed using upstream fluxes 
     325(\np{ln\_mus\_ups}\forcode{ = .true.}). 
    321326 
    322327% ------------------------------------------------------------------------------------------------------------- 
     
    326331\label{subsec:TRA_adv_ubs} 
    327332 
    328 The Upstream-Biased Scheme (UBS) is used when \np{ln\_traadv\_ubs}\forcode{ = .true.}.  
     333The Upstream-Biased Scheme (UBS) is used when \np{ln\_traadv\_ubs}\forcode{ = .true.}. 
    329334UBS implementation can be found in the \mdl{traadv\_mus} module. 
    330335 
    331 The UBS scheme, often called UP3, is also known as the Cell Averaged QUICK scheme  
    332 (Quadratic Upstream Interpolation for Convective Kinematics). It is an upstream-biased  
    333 third order scheme based on an upstream-biased parabolic interpolation.   
    334 For example, in the $i$-direction : 
     336The UBS scheme, often called UP3, is also known as the Cell Averaged QUICK scheme 
     337(Quadratic Upstream Interpolation for Convective Kinematics). 
     338It is an upstream-biased third order scheme based on an upstream-biased parabolic interpolation. 
     339For example, in the $i$-direction: 
    335340\begin{equation} \label{eq:tra_adv_ubs} 
    336341   \tau _u^{ubs} =\overline T ^{i+1/2}-\;\frac{1}{6} \left\{       
     
    342347where $\tau "_i =\delta _i \left[ {\delta _{i+1/2} \left[ \tau \right]} \right]$. 
    343348 
    344 This results in a dissipatively dominant (i.e. hyper-diffusive) truncation  
    345 error \citep{Shchepetkin_McWilliams_OM05}. The overall performance of 
    346  the advection scheme is similar to that reported in \cite{Farrow1995}.  
    347 It is a relatively good compromise between accuracy and smoothness.  
    348 Nevertheless the scheme is not \emph{positive}, meaning that false extrema are permitted,  
    349 but the amplitude of such are significantly reduced over the centred second  
    350 or fourth order method. therefore it is not recommended that it should be  
    351 applied to a passive tracer that requires positivity.  
    352  
    353 The intrinsic diffusion of UBS makes its use risky in the vertical direction  
    354 where the control of artificial diapycnal fluxes is of paramount importance \citep{Shchepetkin_McWilliams_OM05, Demange_PhD2014}.  
    355 Therefore the vertical flux is evaluated using either a $2^nd$ order FCT scheme  
    356 or a $4^th$ order COMPACT scheme (\np{nn\_cen\_v}\forcode{ = 2 or 4}). 
    357  
    358 For stability reasons  (see \autoref{chap:STP}), 
    359 the first term  in \autoref{eq:tra_adv_ubs} (which corresponds to a second order  
    360 centred scheme) is evaluated using the \textit{now} tracer (centred in time)  
    361 while the second term (which is the diffusive part of the scheme), is  
    362 evaluated using the \textit{before} tracer (forward in time).  
    363 This choice is discussed by \citet{Webb_al_JAOT98} in the context of the  
    364 QUICK advection scheme. UBS and QUICK schemes only differ  
    365 by one coefficient. Replacing 1/6 with 1/8 in \autoref{eq:tra_adv_ubs}  
    366 leads to the QUICK advection scheme \citep{Webb_al_JAOT98}.  
    367 This option is not available through a namelist parameter, since the  
    368 1/6 coefficient is hard coded. Nevertheless it is quite easy to make the  
    369 substitution in the \mdl{traadv\_ubs} module and obtain a QUICK scheme. 
     349This results in a dissipatively dominant (i.e. hyper-diffusive) truncation error 
     350\citep{Shchepetkin_McWilliams_OM05}. 
     351The overall performance of the advection scheme is similar to that reported in \cite{Farrow1995}. 
     352It is a relatively good compromise between accuracy and smoothness. 
     353Nevertheless the scheme is not \emph{positive}, meaning that false extrema are permitted, 
     354but the amplitude of such are significantly reduced over the centred second or fourth order method. 
     355Therefore it is not recommended that it should be applied to a passive tracer that requires positivity. 
     356 
     357The intrinsic diffusion of UBS makes its use risky in the vertical direction where 
     358the control of artificial diapycnal fluxes is of paramount importance 
     359\citep{Shchepetkin_McWilliams_OM05, Demange_PhD2014}. 
     360Therefore the vertical flux is evaluated using either a $2^nd$ order FCT scheme or a $4^th$ order COMPACT scheme 
     361(\np{nn\_cen\_v}\forcode{ = 2 or 4}). 
     362 
     363For stability reasons (see \autoref{chap:STP}), the first term  in \autoref{eq:tra_adv_ubs} 
     364(which corresponds to a second order centred scheme) 
     365is evaluated using the \textit{now} tracer (centred in time) while the second term 
     366(which is the diffusive part of the scheme), 
     367is evaluated using the \textit{before} tracer (forward in time). 
     368This choice is discussed by \citet{Webb_al_JAOT98} in the context of the QUICK advection scheme. 
     369UBS and QUICK schemes only differ by one coefficient. 
     370Replacing 1/6 with 1/8 in \autoref{eq:tra_adv_ubs} leads to the QUICK advection scheme \citep{Webb_al_JAOT98}. 
     371This option is not available through a namelist parameter, since the 1/6 coefficient is hard coded. 
     372Nevertheless it is quite easy to make the substitution in the \mdl{traadv\_ubs} module and obtain a QUICK scheme. 
    370373 
    371374Note that it is straightforward to rewrite \autoref{eq:tra_adv_ubs} as follows: 
     
    384387\end{equation} 
    385388 
    386 \autoref{eq:traadv_ubs2} has several advantages. Firstly, it clearly reveals  
    387 that the UBS scheme is based on the fourth order scheme to which an  
    388 upstream-biased diffusion term is added. Secondly, this emphasises that the  
    389 $4^{th}$ order part (as well as the $2^{nd}$ order part as stated above) has  
    390 to be evaluated at the \emph{now} time step using \autoref{eq:tra_adv_ubs}.  
    391 Thirdly, the diffusion term is in fact a biharmonic operator with an eddy  
    392 coefficient which is simply proportional to the velocity: 
    393  $A_u^{lm}= \frac{1}{12}\,{e_{1u}}^3\,|u|$. Note the current version of NEMO uses  
    394 the computationally more efficient formulation \autoref{eq:tra_adv_ubs}. 
     389\autoref{eq:traadv_ubs2} has several advantages. 
     390Firstly, it clearly reveals that the UBS scheme is based on the fourth order scheme to which 
     391an upstream-biased diffusion term is added. 
     392Secondly, this emphasises that the $4^{th}$ order part (as well as the $2^{nd}$ order part as stated above) has to 
     393be evaluated at the \emph{now} time step using \autoref{eq:tra_adv_ubs}. 
     394Thirdly, the diffusion term is in fact a biharmonic operator with an eddy coefficient which 
     395is simply proportional to the velocity: 
     396$A_u^{lm}= \frac{1}{12}\,{e_{1u}}^3\,|u|$. 
     397Note the current version of NEMO uses the computationally more efficient formulation \autoref{eq:tra_adv_ubs}. 
    395398 
    396399% ------------------------------------------------------------------------------------------------------------- 
     
    400403\label{subsec:TRA_adv_qck} 
    401404 
    402 The Quadratic Upstream Interpolation for Convective Kinematics with  
    403 Estimated Streaming Terms (QUICKEST) scheme proposed by \citet{Leonard1979}  
    404 is used when \np{ln\_traadv\_qck}\forcode{ = .true.}.  
     405The Quadratic Upstream Interpolation for Convective Kinematics with Estimated Streaming Terms (QUICKEST) scheme 
     406proposed by \citet{Leonard1979} is used when \np{ln\_traadv\_qck}\forcode{ = .true.}. 
    405407QUICKEST implementation can be found in the \mdl{traadv\_qck} module. 
    406408 
    407 QUICKEST is the third order Godunov scheme which is associated with the ULTIMATE QUICKEST  
    408 limiter \citep{Leonard1991}. It has been implemented in NEMO by G. Reffray  
    409 (MERCATOR-ocean) and can be found in the \mdl{traadv\_qck} module. 
    410 The resulting scheme is quite expensive but \emph{positive}.  
    411 It can be used on both active and passive tracers.  
    412 However, the intrinsic diffusion of QCK makes its use risky in the vertical  
    413 direction where the control of artificial diapycnal fluxes is of paramount importance.  
    414 Therefore the vertical flux is evaluated using the CEN2 scheme.  
    415 This no longer guarantees the positivity of the scheme.  
    416 The use of FCT in the vertical direction (as for the UBS case) should be implemented  
    417 to restore this property. 
     409QUICKEST is the third order Godunov scheme which is associated with the ULTIMATE QUICKEST limiter 
     410\citep{Leonard1991}. 
     411It has been implemented in NEMO by G. Reffray (MERCATOR-ocean) and can be found in the \mdl{traadv\_qck} module. 
     412The resulting scheme is quite expensive but \emph{positive}. 
     413It can be used on both active and passive tracers. 
     414However, the intrinsic diffusion of QCK makes its use risky in the vertical direction where 
     415the control of artificial diapycnal fluxes is of paramount importance. 
     416Therefore the vertical flux is evaluated using the CEN2 scheme. 
     417This no longer guarantees the positivity of the scheme. 
     418The use of FCT in the vertical direction (as for the UBS case) should be implemented to restore this property. 
    418419 
    419420%%%gmcomment   :  Cross term are missing in the current implementation.... 
     
    432433Options are defined through the \ngn{namtra\_ldf} namelist variables. 
    433434They are regrouped in four items, allowing to specify  
    434 $(i)$   the type of operator used (none, laplacian, bilaplacian),  
    435 $(ii)$  the direction along which the operator acts (iso-level, horizontal, iso-neutral),  
    436 $(iii)$ some specific options related to the rotated operators ($i.e.$ non-iso-level operator), and  
     435$(i)$   the type of operator used (none, laplacian, bilaplacian), 
     436$(ii)$  the direction along which the operator acts (iso-level, horizontal, iso-neutral), 
     437$(iii)$ some specific options related to the rotated operators ($i.e.$ non-iso-level operator), and 
    437438$(iv)$  the specification of eddy diffusivity coefficient (either constant or variable in space and time). 
    438 Item $(iv)$ will be described in \autoref{chap:LDF} . 
    439 The direction along which the operators act is defined through the slope between this direction and the iso-level surfaces. 
    440 The slope is computed in the \mdl{ldfslp} module and will also be described in \autoref{chap:LDF}.  
    441  
    442 The lateral diffusion of tracers is evaluated using a forward scheme,  
    443 $i.e.$ the tracers appearing in its expression are the \textit{before} tracers in time,  
    444 except for the pure vertical component that appears when a rotation tensor is used.  
    445 This latter component is solved implicitly together with the vertical diffusion term (see \autoref{chap:STP}).  
    446 When \np{ln\_traldf\_msc}\forcode{ = .true.}, a Method of Stabilizing Correction is used in which  
     439Item $(iv)$ will be described in \autoref{chap:LDF}. 
     440The direction along which the operators act is defined through the slope between 
     441this direction and the iso-level surfaces. 
     442The slope is computed in the \mdl{ldfslp} module and will also be described in \autoref{chap:LDF}. 
     443 
     444The lateral diffusion of tracers is evaluated using a forward scheme, 
     445$i.e.$ the tracers appearing in its expression are the \textit{before} tracers in time, 
     446except for the pure vertical component that appears when a rotation tensor is used. 
     447This latter component is solved implicitly together with the vertical diffusion term (see \autoref{chap:STP}). 
     448When \np{ln\_traldf\_msc}\forcode{ = .true.}, a Method of Stabilizing Correction is used in which 
    447449the pure vertical component is split into an explicit and an implicit part \citep{Lemarie_OM2012}. 
    448450 
     
    456458Three operator options are proposed and, one and only one of them must be selected: 
    457459\begin{description} 
    458 \item [\np{ln\_traldf\_NONE}\forcode{ = .true.}]: no operator selected, the lateral diffusive tendency will not be  
    459 applied to the tracer equation. This option can be used when the selected advection scheme  
    460 is diffusive enough (MUSCL scheme for example). 
    461 \item [\np{ln\_traldf\_lap}\forcode{ = .true.}]: a laplacian operator is selected. This harmonic operator  
    462 takes the following expression:  $\mathpzc{L}(T)=\nabla \cdot A_{ht}\;\nabla T $,  
    463 where the gradient operates along the selected direction (see \autoref{subsec:TRA_ldf_dir}), 
    464 and $A_{ht}$ is the eddy diffusivity coefficient expressed in $m^2/s$ (see \autoref{chap:LDF}). 
    465 \item [\np{ln\_traldf\_blp}\forcode{ = .true.}]: a bilaplacian operator is selected. This biharmonic operator  
    466 takes the following expression:   
    467 $\mathpzc{B}=- \mathpzc{L}\left(\mathpzc{L}(T) \right) = -\nabla \cdot b\nabla \left( {\nabla \cdot b\nabla T} \right)$  
    468 where the gradient operats along the selected direction, 
    469 and $b^2=B_{ht}$ is the eddy diffusivity coefficient expressed in $m^4/s$  (see \autoref{chap:LDF}). 
    470 In the code, the bilaplacian operator is obtained by calling the laplacian twice. 
     460\item[\np{ln\_traldf\_NONE}\forcode{ = .true.}:] 
     461  no operator selected, the lateral diffusive tendency will not be applied to the tracer equation. 
     462  This option can be used when the selected advection scheme is diffusive enough (MUSCL scheme for example). 
     463\item[\np{ln\_traldf\_lap}\forcode{ = .true.}:] 
     464  a laplacian operator is selected. 
     465  This harmonic operator takes the following expression:  $\mathpzc{L}(T)=\nabla \cdot A_{ht}\;\nabla T $, 
     466  where the gradient operates along the selected direction (see \autoref{subsec:TRA_ldf_dir}), 
     467  and $A_{ht}$ is the eddy diffusivity coefficient expressed in $m^2/s$ (see \autoref{chap:LDF}). 
     468\item[\np{ln\_traldf\_blp}\forcode{ = .true.}]: 
     469  a bilaplacian operator is selected. 
     470  This biharmonic operator takes the following expression: 
     471  $\mathpzc{B}=- \mathpzc{L}\left(\mathpzc{L}(T) \right) = -\nabla \cdot b\nabla \left( {\nabla \cdot b\nabla T} \right)$ 
     472  where the gradient operats along the selected direction, 
     473  and $b^2=B_{ht}$ is the eddy diffusivity coefficient expressed in $m^4/s$  (see \autoref{chap:LDF}). 
     474  In the code, the bilaplacian operator is obtained by calling the laplacian twice. 
    471475\end{description} 
    472476 
    473 Both laplacian and bilaplacian operators ensure the total tracer variance decrease.  
    474 Their primary role is to provide strong dissipation at the smallest scale supported  
    475 by the grid while minimizing the impact on the larger scale features.  
    476 The main difference between the two operators is the scale selectiveness.  
    477 The bilaplacian damping time ($i.e.$ its spin down time) scales like $\lambda^{-4}$  
    478 for disturbances of wavelength $\lambda$ (so that short waves damped more rapidelly than long ones),  
     477Both laplacian and bilaplacian operators ensure the total tracer variance decrease. 
     478Their primary role is to provide strong dissipation at the smallest scale supported by the grid while 
     479minimizing the impact on the larger scale features. 
     480The main difference between the two operators is the scale selectiveness. 
     481The bilaplacian damping time ($i.e.$ its spin down time) scales like $\lambda^{-4}$ for 
     482disturbances of wavelength $\lambda$ (so that short waves damped more rapidelly than long ones), 
    479483whereas the laplacian damping time scales only like $\lambda^{-2}$. 
    480484 
     
    487491\label{subsec:TRA_ldf_dir} 
    488492 
    489 The choice of a direction of action determines the form of operator used.  
    490 The operator is a simple (re-entrant) laplacian acting in the (\textbf{i},\textbf{j}) plane  
    491 when iso-level option is used (\np{ln\_traldf\_lev}\forcode{ = .true.}) 
    492 or when a horizontal ($i.e.$ geopotential) operator is demanded in \textit{z}-coordinate  
    493 (\np{ln\_traldf\_hor} and \np{ln\_zco} equal \forcode{.true.}).  
     493The choice of a direction of action determines the form of operator used. 
     494The operator is a simple (re-entrant) laplacian acting in the (\textbf{i},\textbf{j}) plane when 
     495iso-level option is used (\np{ln\_traldf\_lev}\forcode{ = .true.}) or 
     496when a horizontal ($i.e.$ geopotential) operator is demanded in \textit{z}-coordinate 
     497(\np{ln\_traldf\_hor} and \np{ln\_zco} equal \forcode{.true.}). 
    494498The associated code can be found in the \mdl{traldf\_lap\_blp} module. 
    495 The operator is a rotated (re-entrant) laplacian when the direction along which it acts  
    496 does not coincide with the iso-level surfaces,  
    497 that is when standard or triad iso-neutral option is used (\np{ln\_traldf\_iso} or  
    498  \np{ln\_traldf\_triad} equals \forcode{.true.}, see \mdl{traldf\_iso} or \mdl{traldf\_triad} module, resp.),  
    499 or when a horizontal ($i.e.$ geopotential) operator is demanded in \textit{s}-coordinate  
     499The operator is a rotated (re-entrant) laplacian when 
     500the direction along which it acts does not coincide with the iso-level surfaces, 
     501that is when standard or triad iso-neutral option is used 
     502(\np{ln\_traldf\_iso} or \np{ln\_traldf\_triad} equals \forcode{.true.}, 
     503see \mdl{traldf\_iso} or \mdl{traldf\_triad} module, resp.), or 
     504when a horizontal ($i.e.$ geopotential) operator is demanded in \textit{s}-coordinate 
    500505(\np{ln\_traldf\_hor} and \np{ln\_sco} equal \forcode{.true.}) 
    501 \footnote{In this case, the standard iso-neutral operator will be automatically selected}.  
    502 In that case, a rotation is applied to the gradient(s) that appears in the operator  
    503 so that diffusive fluxes acts on the three spatial direction. 
    504  
    505 The resulting discret form of the three operators (one iso-level and two rotated one)  
    506 is given in the next two sub-sections.  
     506\footnote{In this case, the standard iso-neutral operator will be automatically selected}. 
     507In that case, a rotation is applied to the gradient(s) that appears in the operator so that 
     508diffusive fluxes acts on the three spatial direction. 
     509 
     510The resulting discret form of the three operators (one iso-level and two rotated one) is given in 
     511the next two sub-sections.  
    507512 
    508513 
     
    519524+ \delta _{j}\left[ A_v^{lT} \;  \frac{e_{1v}\,e_{3v}}{e_{2v}} \;\delta _{j+1/2} [T] \right]  \;\right) 
    520525\end{equation} 
    521 where  $b_t$=$e_{1t}\,e_{2t}\,e_{3t}$  is the volume of $T$-cells  
    522 and where zero diffusive fluxes is assumed across solid boundaries,  
    523 first (and third in bilaplacian case) horizontal tracer derivative are masked.  
    524 It is implemented in the \rou{traldf\_lap} subroutine found in the \mdl{traldf\_lap} module.  
    525 The module also contains \rou{traldf\_blp}, the subroutine calling twice \rou{traldf\_lap}  
    526 in order to compute the iso-level bilaplacian operator.  
    527  
    528 It is a \emph{horizontal} operator ($i.e.$ acting along geopotential surfaces) in the $z$-coordinate  
    529 with or without partial steps, but is simply an iso-level operator in the $s$-coordinate.  
    530 It is thus used when, in addition to \np{ln\_traldf\_lap} or \np{ln\_traldf\_blp}\forcode{ = .true.},  
    531 we have \np{ln\_traldf\_lev}\forcode{ = .true.} or \np{ln\_traldf\_hor}~=~\np{ln\_zco}\forcode{ = .true.}.  
    532 In both cases, it significantly contributes to diapycnal mixing.  
     526where  $b_t$=$e_{1t}\,e_{2t}\,e_{3t}$  is the volume of $T$-cells and 
     527where zero diffusive fluxes is assumed across solid boundaries, 
     528first (and third in bilaplacian case) horizontal tracer derivative are masked. 
     529It is implemented in the \rou{traldf\_lap} subroutine found in the \mdl{traldf\_lap} module. 
     530The module also contains \rou{traldf\_blp}, the subroutine calling twice \rou{traldf\_lap} in order to 
     531compute the iso-level bilaplacian operator.  
     532 
     533It is a \emph{horizontal} operator ($i.e.$ acting along geopotential surfaces) in 
     534the $z$-coordinate with or without partial steps, but is simply an iso-level operator in the $s$-coordinate. 
     535It is thus used when, in addition to \np{ln\_traldf\_lap} or \np{ln\_traldf\_blp}\forcode{ = .true.}, 
     536we have \np{ln\_traldf\_lev}\forcode{ = .true.} or \np{ln\_traldf\_hor}~=~\np{ln\_zco}\forcode{ = .true.}. 
     537In both cases, it significantly contributes to diapycnal mixing. 
    533538It is therefore never recommended, even when using it in the bilaplacian case. 
    534539 
    535 Note that in the partial step $z$-coordinate (\np{ln\_zps}\forcode{ = .true.}), tracers in horizontally  
    536 adjacent cells are located at different depths in the vicinity of the bottom.  
    537 In this case, horizontal derivatives in (\autoref{eq:tra_ldf_lap}) at the bottom level  
    538 require a specific treatment. They are calculated in the \mdl{zpshde} module,  
    539 described in \autoref{sec:TRA_zpshde}. 
     540Note that in the partial step $z$-coordinate (\np{ln\_zps}\forcode{ = .true.}), 
     541tracers in horizontally adjacent cells are located at different depths in the vicinity of the bottom. 
     542In this case, horizontal derivatives in (\autoref{eq:tra_ldf_lap}) at the bottom level require a specific treatment. 
     543They are calculated in the \mdl{zpshde} module, described in \autoref{sec:TRA_zpshde}. 
    540544 
    541545 
     
    550554\subsubsection{Standard rotated (bi-)laplacian operator (\protect\mdl{traldf\_iso})} 
    551555\label{subsec:TRA_ldf_iso} 
    552 The general form of the second order lateral tracer subgrid scale physics  
    553 (\autoref{eq:PE_zdf}) takes the following semi-discrete space form in $z$- and $s$-coordinates: 
     556The general form of the second order lateral tracer subgrid scale physics (\autoref{eq:PE_zdf}) 
     557takes the following semi-discrete space form in $z$- and $s$-coordinates: 
    554558\begin{equation} \label{eq:tra_ldf_iso} 
    555559\begin{split} 
     
    569573& \left. {\left. {   \qquad \qquad \ \ \ \left. { 
    570574        +\;\frac{e_{1w}\,e_{2w}}{e_{3w}} \,\left( r_{1w}^2 + r_{2w}^2 \right) 
    571            \,\delta_{k+1/2} [T] } \right) } \right] \quad } \right\}  
    572  \end{split} 
    573  \end{equation} 
    574 where $b_t$=$e_{1t}\,e_{2t}\,e_{3t}$  is the volume of $T$-cells,  
    575 $r_1$ and $r_2$ are the slopes between the surface of computation  
    576 ($z$- or $s$-surfaces) and the surface along which the diffusion operator  
    577 acts ($i.e.$ horizontal or iso-neutral surfaces).  It is thus used when,  
    578 in addition to \np{ln\_traldf\_lap}\forcode{ = .true.}, we have \np{ln\_traldf\_iso}\forcode{ = .true.},  
    579 or both \np{ln\_traldf\_hor}\forcode{ = .true.} and \np{ln\_zco}\forcode{ = .true.}. The way these  
    580 slopes are evaluated is given in \autoref{sec:LDF_slp}. At the surface, bottom  
    581 and lateral boundaries, the turbulent fluxes of heat and salt are set to zero  
    582 using the mask technique (see \autoref{sec:LBC_coast}).  
    583  
    584 The operator in \autoref{eq:tra_ldf_iso} involves both lateral and vertical  
    585 derivatives. For numerical stability, the vertical second derivative must  
    586 be solved using the same implicit time scheme as that used in the vertical  
    587 physics (see \autoref{sec:TRA_zdf}). For computer efficiency reasons, this term  
    588 is not computed in the \mdl{traldf\_iso} module, but in the \mdl{trazdf} module  
    589 where, if iso-neutral mixing is used, the vertical mixing coefficient is simply  
    590 increased by $\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$.  
    591  
    592 This formulation conserves the tracer but does not ensure the decrease  
    593 of the tracer variance. Nevertheless the treatment performed on the slopes  
    594 (see \autoref{chap:LDF}) allows the model to run safely without any additional  
    595 background horizontal diffusion \citep{Guilyardi_al_CD01}.  
    596  
    597 Note that in the partial step $z$-coordinate (\np{ln\_zps}\forcode{ = .true.}), the horizontal derivatives  
    598 at the bottom level in \autoref{eq:tra_ldf_iso} require a specific treatment.  
     575        \,\delta_{k+1/2} [T] } \right) } \right] \quad } \right\} 
     576\end{split} 
     577\end{equation} 
     578where $b_t$=$e_{1t}\,e_{2t}\,e_{3t}$  is the volume of $T$-cells, 
     579$r_1$ and $r_2$ are the slopes between the surface of computation ($z$- or $s$-surfaces) and 
     580the surface along which the diffusion operator acts ($i.e.$ horizontal or iso-neutral surfaces). 
     581It is thus used when, in addition to \np{ln\_traldf\_lap}\forcode{ = .true.}, 
     582we have \np{ln\_traldf\_iso}\forcode{ = .true.}, 
     583or both \np{ln\_traldf\_hor}\forcode{ = .true.} and \np{ln\_zco}\forcode{ = .true.}. 
     584The way these slopes are evaluated is given in \autoref{sec:LDF_slp}. 
     585At the surface, bottom and lateral boundaries, the turbulent fluxes of heat and salt are set to zero using 
     586the mask technique (see \autoref{sec:LBC_coast}).  
     587 
     588The operator in \autoref{eq:tra_ldf_iso} involves both lateral and vertical derivatives. 
     589For numerical stability, the vertical second derivative must be solved using the same implicit time scheme as that 
     590used in the vertical physics (see \autoref{sec:TRA_zdf}). 
     591For computer efficiency reasons, this term is not computed in the \mdl{traldf\_iso} module, 
     592but in the \mdl{trazdf} module where, if iso-neutral mixing is used, 
     593the vertical mixing coefficient is simply increased by 
     594$\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$.  
     595 
     596This formulation conserves the tracer but does not ensure the decrease of the tracer variance. 
     597Nevertheless the treatment performed on the slopes (see \autoref{chap:LDF}) allows the model to run safely without 
     598any additional background horizontal diffusion \citep{Guilyardi_al_CD01}.  
     599 
     600Note that in the partial step $z$-coordinate (\np{ln\_zps}\forcode{ = .true.}), 
     601the horizontal derivatives at the bottom level in \autoref{eq:tra_ldf_iso} require a specific treatment. 
    599602They are calculated in module zpshde, described in \autoref{sec:TRA_zpshde}. 
    600603 
     
    604607\label{subsec:TRA_ldf_triad} 
    605608 
    606 If the Griffies triad scheme is employed (\np{ln\_traldf\_triad}\forcode{ = .true.} ; see \autoref{apdx:triad})  
    607  
    608 An alternative scheme developed by \cite{Griffies_al_JPO98} which ensures tracer variance decreases  
    609 is also available in \NEMO (\np{ln\_traldf\_grif}\forcode{ = .true.}). A complete description of  
    610 the algorithm is given in \autoref{apdx:triad}. 
    611  
    612 The lateral fourth order bilaplacian operator on tracers is obtained by  
    613 applying (\autoref{eq:tra_ldf_lap}) twice. The operator requires an additional assumption  
    614 on boundary conditions: both first and third derivative terms normal to the  
    615 coast are set to zero. 
    616  
    617 The lateral fourth order operator formulation on tracers is obtained by  
    618 applying (\autoref{eq:tra_ldf_iso}) twice. It requires an additional assumption  
    619 on boundary conditions: first and third derivative terms normal to the  
    620 coast, normal to the bottom and normal to the surface are set to zero.  
     609If the Griffies triad scheme is employed (\np{ln\_traldf\_triad}\forcode{ = .true.}; see \autoref{apdx:triad}) 
     610 
     611An alternative scheme developed by \cite{Griffies_al_JPO98} which ensures tracer variance decreases 
     612is also available in \NEMO (\np{ln\_traldf\_grif}\forcode{ = .true.}). 
     613A complete description of the algorithm is given in \autoref{apdx:triad}. 
     614 
     615The lateral fourth order bilaplacian operator on tracers is obtained by applying (\autoref{eq:tra_ldf_lap}) twice. 
     616The operator requires an additional assumption on boundary conditions: 
     617both first and third derivative terms normal to the coast are set to zero. 
     618 
     619The lateral fourth order operator formulation on tracers is obtained by applying (\autoref{eq:tra_ldf_iso}) twice. 
     620It requires an additional assumption on boundary conditions: 
     621first and third derivative terms normal to the coast, 
     622normal to the bottom and normal to the surface are set to zero.  
    621623 
    622624%&&    Option for the rotated operators 
     
    631633\np{ln\_triad\_iso} = pure horizontal mixing in ML (triad only) 
    632634 
    633 \np{rn\_sw\_triad} =1 switching triad ; =0 all 4 triads used (triad only)  
     635\np{rn\_sw\_triad} =1 switching triad; 
     636                   =0 all 4 triads used (triad only)  
    634637 
    635638\np{ln\_botmix\_triad} = lateral mixing on bottom (triad only) 
     
    646649 
    647650Options are defined through the \ngn{namzdf} namelist variables. 
    648 The formulation of the vertical subgrid scale tracer physics is the same  
    649 for all the vertical coordinates, and is based on a laplacian operator.  
    650 The vertical diffusion operator given by (\autoref{eq:PE_zdf}) takes the  
    651 following semi-discrete space form: 
     651The formulation of the vertical subgrid scale tracer physics is the same for all the vertical coordinates, 
     652and is based on a laplacian operator. 
     653The vertical diffusion operator given by (\autoref{eq:PE_zdf}) takes the following semi-discrete space form: 
    652654\begin{equation} \label{eq:tra_zdf} 
    653655\begin{split} 
     
    657659\end{split} 
    658660\end{equation} 
    659 where $A_w^{vT}$ and $A_w^{vS}$ are the vertical eddy diffusivity  
    660 coefficients on temperature and salinity, respectively. Generally,  
    661 $A_w^{vT}=A_w^{vS}$ except when double diffusive mixing is  
    662 parameterised ($i.e.$ \key{zdfddm} is defined). The way these coefficients  
    663 are evaluated is given in \autoref{chap:ZDF} (ZDF). Furthermore, when  
    664 iso-neutral mixing is used, both mixing coefficients are increased  
    665 by $\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$  
    666 to account for the vertical second derivative of \autoref{eq:tra_ldf_iso}.  
    667  
    668 At the surface and bottom boundaries, the turbulent fluxes of  
    669 heat and salt must be specified. At the surface they are prescribed  
    670 from the surface forcing and added in a dedicated routine (see \autoref{subsec:TRA_sbc}),  
    671 whilst at the bottom they are set to zero for heat and salt unless  
    672 a geothermal flux forcing is prescribed as a bottom boundary  
    673 condition (see \autoref{subsec:TRA_bbc}).  
    674  
    675 The large eddy coefficient found in the mixed layer together with high  
    676 vertical resolution implies that in the case of explicit time stepping  
    677 (\np{ln\_zdfexp}\forcode{ = .true.}) there would be too restrictive a constraint on  
    678 the time step. Therefore, the default implicit time stepping is preferred  
    679 for the vertical diffusion since it overcomes the stability constraint.  
    680 A forward time differencing scheme (\np{ln\_zdfexp}\forcode{ = .true.}) using a time  
    681 splitting technique (\np{nn\_zdfexp} $> 1$) is provided as an alternative.  
    682 Namelist variables \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both  
    683 tracers and dynamics.  
     661where $A_w^{vT}$ and $A_w^{vS}$ are the vertical eddy diffusivity coefficients on temperature and salinity, 
     662respectively. 
     663Generally, $A_w^{vT}=A_w^{vS}$ except when double diffusive mixing is parameterised ($i.e.$ \key{zdfddm} is defined). 
     664The way these coefficients are evaluated is given in \autoref{chap:ZDF} (ZDF). 
     665Furthermore, when iso-neutral mixing is used, both mixing coefficients are increased by 
     666$\frac{e_{1w}\,e_{2w} }{e_{3w} }\ \left( {r_{1w} ^2+r_{2w} ^2} \right)$ to account for 
     667the vertical second derivative of \autoref{eq:tra_ldf_iso}. 
     668 
     669At the surface and bottom boundaries, the turbulent fluxes of heat and salt must be specified. 
     670At the surface they are prescribed from the surface forcing and added in a dedicated routine 
     671(see \autoref{subsec:TRA_sbc}), whilst at the bottom they are set to zero for heat and salt unless 
     672a geothermal flux forcing is prescribed as a bottom boundary condition (see \autoref{subsec:TRA_bbc}).  
     673 
     674The large eddy coefficient found in the mixed layer together with high vertical resolution implies that 
     675in the case of explicit time stepping (\np{ln\_zdfexp}\forcode{ = .true.}) 
     676there would be too restrictive a constraint on the time step. 
     677Therefore, the default implicit time stepping is preferred for the vertical diffusion since 
     678it overcomes the stability constraint. 
     679A forward time differencing scheme (\np{ln\_zdfexp}\forcode{ = .true.}) using 
     680a time splitting technique (\np{nn\_zdfexp} $> 1$) is provided as an alternative. 
     681Namelist variables \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics.  
    684682 
    685683% ================================================================ 
     
    695693\label{subsec:TRA_sbc} 
    696694 
    697 The surface boundary condition for tracers is implemented in a separate  
    698 module (\mdl{trasbc}) instead of entering as a boundary condition on the vertical  
    699 diffusion operator (as in the case of momentum). This has been found to  
    700 enhance readability of the code. The two formulations are completely  
    701 equivalent; the forcing terms in trasbc are the surface fluxes divided by  
    702 the thickness of the top model layer.  
    703  
    704 Due to interactions and mass exchange of water ($F_{mass}$) with other Earth system components  
    705 ($i.e.$ atmosphere, sea-ice, land), the change in the heat and salt content of the surface layer  
    706 of the ocean is due both to the heat and salt fluxes crossing the sea surface (not linked with $F_{mass}$)  
    707 and to the heat and salt content of the mass exchange. They are both included directly in $Q_{ns}$,  
    708 the surface heat flux, and $F_{salt}$, the surface salt flux (see \autoref{chap:SBC} for further details). 
     695The surface boundary condition for tracers is implemented in a separate module (\mdl{trasbc}) instead of 
     696entering as a boundary condition on the vertical diffusion operator (as in the case of momentum). 
     697This has been found to enhance readability of the code. 
     698The two formulations are completely equivalent; 
     699the forcing terms in trasbc are the surface fluxes divided by the thickness of the top model layer.  
     700 
     701Due to interactions and mass exchange of water ($F_{mass}$) with other Earth system components 
     702($i.e.$ atmosphere, sea-ice, land), the change in the heat and salt content of the surface layer of the ocean is due 
     703both to the heat and salt fluxes crossing the sea surface (not linked with $F_{mass}$) and 
     704to the heat and salt content of the mass exchange. 
     705They are both included directly in $Q_{ns}$, the surface heat flux, 
     706and $F_{salt}$, the surface salt flux (see \autoref{chap:SBC} for further details). 
    709707By doing this, the forcing formulation is the same for any tracer (including temperature and salinity). 
    710708 
    711 The surface module (\mdl{sbcmod}, see \autoref{chap:SBC}) provides the following  
    712 forcing fields (used on tracers): 
    713  
    714 $\bullet$ $Q_{ns}$, the non-solar part of the net surface heat flux that crosses the sea surface  
     709The surface module (\mdl{sbcmod}, see \autoref{chap:SBC}) provides the following forcing fields (used on tracers): 
     710 
     711$\bullet$ $Q_{ns}$, the non-solar part of the net surface heat flux that crosses the sea surface 
    715712(i.e. the difference between the total surface heat flux and the fraction of the short wave flux that  
    716 penetrates into the water column, see \autoref{subsec:TRA_qsr}) plus the heat content associated with  
    717 of the mass exchange with the atmosphere and lands. 
     713penetrates into the water column, see \autoref{subsec:TRA_qsr}) 
     714plus the heat content associated with of the mass exchange with the atmosphere and lands. 
    718715 
    719716$\bullet$ $\textit{sfx}$, the salt flux resulting from ice-ocean mass exchange (freezing, melting, ridging...) 
    720717 
    721 $\bullet$ \textit{emp}, the mass flux exchanged with the atmosphere (evaporation minus precipitation)  
    722  and possibly with the sea-ice and ice-shelves. 
    723  
    724 $\bullet$ \textit{rnf}, the mass flux associated with runoff  
     718$\bullet$ \textit{emp}, the mass flux exchanged with the atmosphere (evaporation minus precipitation) and 
     719possibly with the sea-ice and ice-shelves. 
     720 
     721$\bullet$ \textit{rnf}, the mass flux associated with runoff 
    725722(see \autoref{sec:SBC_rnf} for further detail of how it acts on temperature and salinity tendencies) 
    726723 
    727 $\bullet$ \textit{fwfisf}, the mass flux associated with ice shelf melt,  
     724$\bullet$ \textit{fwfisf}, the mass flux associated with ice shelf melt, 
    728725(see \autoref{sec:SBC_isf} for further details on how the ice shelf melt is computed and applied). 
    729726 
     
    735732 \end{aligned} 
    736733\end{equation}  
    737 where $\overline{x }^t$ means that $x$ is averaged over two consecutive time steps  
    738 ($t-\rdt/2$ and $t+\rdt/2$). Such time averaging prevents the  
    739 divergence of odd and even time step (see \autoref{chap:STP}). 
    740  
    741 In the linear free surface case (\np{ln\_linssh}\forcode{ = .true.}),  
    742 an additional term has to be added on both temperature and salinity.  
    743 On temperature, this term remove the heat content associated with mass exchange 
    744 that has been added to $Q_{ns}$. On salinity, this term mimics the concentration/dilution effect that 
    745 would have resulted from a change in the volume of the first level. 
     734where $\overline{x }^t$ means that $x$ is averaged over two consecutive time steps ($t-\rdt/2$ and $t+\rdt/2$). 
     735Such time averaging prevents the divergence of odd and even time step (see \autoref{chap:STP}). 
     736 
     737In the linear free surface case (\np{ln\_linssh}\forcode{ = .true.}), an additional term has to be added on 
     738both temperature and salinity. 
     739On temperature, this term remove the heat content associated with mass exchange that has been added to $Q_{ns}$. 
     740On salinity, this term mimics the concentration/dilution effect that would have resulted from a change in 
     741the volume of the first level. 
    746742The resulting surface boundary condition is applied as follows: 
    747743\begin{equation} \label{eq:tra_sbc_lin} 
     
    754750 \end{aligned} 
    755751\end{equation}  
    756 Note that an exact conservation of heat and salt content is only achieved with non-linear free surface.  
    757 In the linear free surface case, there is a small imbalance. The imbalance is larger  
    758 than the imbalance associated with the Asselin time filter \citep{Leclair_Madec_OM09}.  
     752Note that an exact conservation of heat and salt content is only achieved with non-linear free surface. 
     753In the linear free surface case, there is a small imbalance. 
     754The imbalance is larger than the imbalance associated with the Asselin time filter \citep{Leclair_Madec_OM09}. 
    759755This is the reason why the modified filter is not applied in the linear free surface case (see \autoref{chap:STP}). 
    760756 
     
    770766 
    771767Options are defined through the \ngn{namtra\_qsr} namelist variables. 
    772 When the penetrative solar radiation option is used (\np{ln\_flxqsr}\forcode{ = .true.}),  
    773 the solar radiation penetrates the top few tens of meters of the ocean. If it is not used  
    774 (\np{ln\_flxqsr}\forcode{ = .false.}) all the heat flux is absorbed in the first ocean level.  
    775 Thus, in the former case a term is added to the time evolution equation of  
    776 temperature \autoref{eq:PE_tra_T} and the surface boundary condition is  
    777 modified to take into account only the non-penetrative part of the surface  
     768When the penetrative solar radiation option is used (\np{ln\_flxqsr}\forcode{ = .true.}), 
     769the solar radiation penetrates the top few tens of meters of the ocean. 
     770If it is not used (\np{ln\_flxqsr}\forcode{ = .false.}) all the heat flux is absorbed in the first ocean level. 
     771Thus, in the former case a term is added to the time evolution equation of temperature \autoref{eq:PE_tra_T} and 
     772the surface boundary condition is modified to take into account only the non-penetrative part of the surface  
    778773heat flux: 
    779774\begin{equation} \label{eq:PE_qsr} 
     
    783778\end{split} 
    784779\end{equation} 
    785 where $Q_{sr}$ is the penetrative part of the surface heat flux ($i.e.$ the shortwave radiation)  
    786 and $I$ is the downward irradiance ($\left. I \right|_{z=\eta}=Q_{sr}$).  
     780where $Q_{sr}$ is the penetrative part of the surface heat flux ($i.e.$ the shortwave radiation) and 
     781$I$ is the downward irradiance ($\left. I \right|_{z=\eta}=Q_{sr}$). 
    787782The additional term in \autoref{eq:PE_qsr} is discretized as follows: 
    788783\begin{equation} \label{eq:tra_qsr} 
     
    790785\end{equation} 
    791786 
    792 The shortwave radiation, $Q_{sr}$, consists of energy distributed across a wide spectral range.  
    793 The ocean is strongly absorbing for wavelengths longer than 700~nm and these  
    794 wavelengths contribute to heating the upper few tens of centimetres. The fraction of $Q_{sr}$  
    795 that resides in these almost non-penetrative wavebands, $R$, is $\sim 58\%$ (specified  
    796 through namelist parameter \np{rn\_abs}). It is assumed to penetrate the ocean  
    797 with a decreasing exponential profile, with an e-folding depth scale, $\xi_0$,  
     787The shortwave radiation, $Q_{sr}$, consists of energy distributed across a wide spectral range. 
     788The ocean is strongly absorbing for wavelengths longer than 700~nm and these wavelengths contribute to 
     789heating the upper few tens of centimetres. 
     790The fraction of $Q_{sr}$ that resides in these almost non-penetrative wavebands, $R$, is $\sim 58\%$ 
     791(specified through namelist parameter \np{rn\_abs}). 
     792It is assumed to penetrate the ocean with a decreasing exponential profile, with an e-folding depth scale, $\xi_0$, 
    798793of a few tens of centimetres (typically $\xi_0=0.35~m$ set as \np{rn\_si0} in the \ngn{namtra\_qsr} namelist). 
    799 For shorter wavelengths (400-700~nm), the ocean is more transparent, and solar energy  
    800 propagates to larger depths where it contributes to  
    801 local heating.  
    802 The way this second part of the solar energy penetrates into the ocean depends on  
    803 which formulation is chosen. In the simple 2-waveband light penetration scheme (\np{ln\_qsr\_2bd}\forcode{ = .true.})  
    804 a chlorophyll-independent monochromatic formulation is chosen for the shorter wavelengths,  
     794For shorter wavelengths (400-700~nm), the ocean is more transparent, and solar energy propagates to 
     795larger depths where it contributes to local heating. 
     796The way this second part of the solar energy penetrates into the ocean depends on which formulation is chosen. 
     797In the simple 2-waveband light penetration scheme (\np{ln\_qsr\_2bd}\forcode{ = .true.}) 
     798a chlorophyll-independent monochromatic formulation is chosen for the shorter wavelengths, 
    805799leading to the following expression \citep{Paulson1977}: 
    806800\begin{equation} \label{eq:traqsr_iradiance} 
    807801I(z) = Q_{sr} \left[Re^{-z / \xi_0} + \left( 1-R\right) e^{-z / \xi_1} \right] 
    808802\end{equation} 
    809 where $\xi_1$ is the second extinction length scale associated with the shorter wavelengths.   
    810 It is usually chosen to be 23~m by setting the \np{rn\_si0} namelist parameter.  
    811 The set of default values ($\xi_0$, $\xi_1$, $R$) corresponds to a Type I water in  
    812 Jerlov's (1968) classification (oligotrophic waters). 
    813  
    814 Such assumptions have been shown to provide a very crude and simplistic  
    815 representation of observed light penetration profiles (\cite{Morel_JGR88}, see also  
    816 \autoref{fig:traqsr_irradiance}). Light absorption in the ocean depends on  
    817 particle concentration and is spectrally selective. \cite{Morel_JGR88} has shown  
    818 that an accurate representation of light penetration can be provided by a 61 waveband  
    819 formulation. Unfortunately, such a model is very computationally expensive.  
    820 Thus, \cite{Lengaigne_al_CD07} have constructed a simplified version of this  
    821 formulation in which visible light is split into three wavebands: blue (400-500 nm),  
    822 green (500-600 nm) and red (600-700nm). For each wave-band, the chlorophyll-dependent  
    823 attenuation coefficient is fitted to the coefficients computed from the full spectral model  
    824 of \cite{Morel_JGR88} (as modified by \cite{Morel_Maritorena_JGR01}), assuming  
    825 the same power-law relationship. As shown in \autoref{fig:traqsr_irradiance},  
    826 this formulation, called RGB (Red-Green-Blue), reproduces quite closely  
    827 the light penetration profiles predicted by the full spectal model, but with much greater  
    828 computational efficiency. The 2-bands formulation does not reproduce the full model very well.  
    829  
    830 The RGB formulation is used when \np{ln\_qsr\_rgb}\forcode{ = .true.}. The RGB attenuation coefficients 
    831 ($i.e.$ the inverses of the extinction length scales) are tabulated over 61 nonuniform  
    832 chlorophyll classes ranging from 0.01 to 10 g.Chl/L (see the routine \rou{trc\_oce\_rgb}  
    833 in \mdl{trc\_oce} module). Four types of chlorophyll can be chosen in the RGB formulation: 
     803where $\xi_1$ is the second extinction length scale associated with the shorter wavelengths. 
     804It is usually chosen to be 23~m by setting the \np{rn\_si0} namelist parameter. 
     805The set of default values ($\xi_0$, $\xi_1$, $R$) corresponds to a Type I water in Jerlov's (1968) classification 
     806(oligotrophic waters). 
     807 
     808Such assumptions have been shown to provide a very crude and simplistic representation of 
     809observed light penetration profiles (\cite{Morel_JGR88}, see also \autoref{fig:traqsr_irradiance}). 
     810Light absorption in the ocean depends on particle concentration and is spectrally selective. 
     811\cite{Morel_JGR88} has shown that an accurate representation of light penetration can be provided by 
     812a 61 waveband formulation. 
     813Unfortunately, such a model is very computationally expensive. 
     814Thus, \cite{Lengaigne_al_CD07} have constructed a simplified version of this formulation in which 
     815visible light is split into three wavebands: blue (400-500 nm), green (500-600 nm) and red (600-700nm). 
     816For each wave-band, the chlorophyll-dependent attenuation coefficient is fitted to the coefficients computed from 
     817the full spectral model of \cite{Morel_JGR88} (as modified by \cite{Morel_Maritorena_JGR01}), 
     818assuming the same power-law relationship. 
     819As shown in \autoref{fig:traqsr_irradiance}, this formulation, called RGB (Red-Green-Blue), 
     820reproduces quite closely the light penetration profiles predicted by the full spectal model, 
     821but with much greater computational efficiency. 
     822The 2-bands formulation does not reproduce the full model very well.  
     823 
     824The RGB formulation is used when \np{ln\_qsr\_rgb}\forcode{ = .true.}. 
     825The RGB attenuation coefficients ($i.e.$ the inverses of the extinction length scales) are tabulated over 
     82661 nonuniform chlorophyll classes ranging from 0.01 to 10 g.Chl/L 
     827(see the routine \rou{trc\_oce\_rgb} in \mdl{trc\_oce} module). 
     828Four types of chlorophyll can be chosen in the RGB formulation: 
    834829\begin{description}  
    835 \item[\np{nn\_chdta}\forcode{ = 0}]  
    836 a constant 0.05 g.Chl/L value everywhere ;  
    837 \item[\np{nn\_chdta}\forcode{ = 1}]   
    838 an observed time varying chlorophyll deduced from satellite surface ocean color measurement  
    839 spread uniformly in the vertical direction ;  
    840 \item[\np{nn\_chdta}\forcode{ = 2}]   
    841 same as previous case except that a vertical profile of chlorophyl is used.  
    842 Following \cite{Morel_Berthon_LO89}, the profile is computed from the local surface chlorophyll value ; 
    843 \item[\np{ln\_qsr\_bio}\forcode{ = .true.}]   
    844 simulated time varying chlorophyll by TOP biogeochemical model.  
    845 In this case, the RGB formulation is used to calculate both the phytoplankton  
    846 light limitation in PISCES or LOBSTER and the oceanic heating rate.  
     830\item[\np{nn\_chdta}\forcode{ = 0}] 
     831  a constant 0.05 g.Chl/L value everywhere ;  
     832\item[\np{nn\_chdta}\forcode{ = 1}] 
     833  an observed time varying chlorophyll deduced from satellite surface ocean color measurement spread uniformly in 
     834  the vertical direction; 
     835\item[\np{nn\_chdta}\forcode{ = 2}] 
     836  same as previous case except that a vertical profile of chlorophyl is used. 
     837  Following \cite{Morel_Berthon_LO89}, the profile is computed from the local surface chlorophyll value; 
     838\item[\np{ln\_qsr\_bio}\forcode{ = .true.}] 
     839  simulated time varying chlorophyll by TOP biogeochemical model. 
     840  In this case, the RGB formulation is used to calculate both the phytoplankton light limitation in 
     841  PISCES or LOBSTER and the oceanic heating rate.  
    847842\end{description}  
    848 The trend in \autoref{eq:tra_qsr} associated with the penetration of the solar radiation  
    849 is added to the temperature trend, and the surface heat flux is modified in routine \mdl{traqsr}.  
    850  
    851 When the $z$-coordinate is preferred to the $s$-coordinate, the depth of $w-$levels does  
    852 not significantly vary with location. The level at which the light has been totally  
    853 absorbed ($i.e.$ it is less than the computer precision) is computed once,  
    854 and the trend associated with the penetration of the solar radiation is only added down to that level.  
    855 Finally, note that when the ocean is shallow ($<$ 200~m), part of the  
    856 solar radiation can reach the ocean floor. In this case, we have  
    857 chosen that all remaining radiation is absorbed in the last ocean  
    858 level ($i.e.$ $I$ is masked).  
     843The trend in \autoref{eq:tra_qsr} associated with the penetration of the solar radiation is added to 
     844the temperature trend, and the surface heat flux is modified in routine \mdl{traqsr}. 
     845 
     846When the $z$-coordinate is preferred to the $s$-coordinate, 
     847the depth of $w-$levels does not significantly vary with location. 
     848The level at which the light has been totally absorbed 
     849($i.e.$ it is less than the computer precision) is computed once, 
     850and the trend associated with the penetration of the solar radiation is only added down to that level. 
     851Finally, note that when the ocean is shallow ($<$ 200~m), part of the solar radiation can reach the ocean floor. 
     852In this case, we have chosen that all remaining radiation is absorbed in the last ocean level 
     853($i.e.$ $I$ is masked).  
    859854 
    860855%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    861 \begin{figure}[!t]     \begin{center} 
    862 \includegraphics[width=1.0\textwidth]{Fig_TRA_Irradiance} 
    863 \caption{    \protect\label{fig:traqsr_irradiance} 
    864 Penetration profile of the downward solar irradiance calculated by four models.  
    865 Two waveband chlorophyll-independent formulation (blue), a chlorophyll-dependent  
    866 monochromatic formulation (green), 4 waveband RGB formulation (red),  
    867 61 waveband Morel (1988) formulation (black) for a chlorophyll concentration of  
    868 (a) Chl=0.05 mg/m$^3$ and (b) Chl=0.5 mg/m$^3$. From \citet{Lengaigne_al_CD07}.} 
    869 \end{center}   \end{figure} 
     856\begin{figure}[!t] 
     857  \begin{center} 
     858    \includegraphics[width=1.0\textwidth]{Fig_TRA_Irradiance} 
     859    \caption{   \protect\label{fig:traqsr_irradiance} 
     860      Penetration profile of the downward solar irradiance calculated by four models. 
     861      Two waveband chlorophyll-independent formulation (blue), 
     862      a chlorophyll-dependent monochromatic formulation (green), 
     863      4 waveband RGB formulation (red), 
     864      61 waveband Morel (1988) formulation (black) for a chlorophyll concentration of 
     865      (a) Chl=0.05 mg/m$^3$ and (b) Chl=0.5 mg/m$^3$. 
     866      From \citet{Lengaigne_al_CD07}. 
     867    } 
     868  \end{center} 
     869\end{figure} 
    870870%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    871871 
     
    880880%-------------------------------------------------------------------------------------------------------------- 
    881881%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    882 \begin{figure}[!t]     \begin{center} 
    883 \includegraphics[width=1.0\textwidth]{Fig_TRA_geoth} 
    884 \caption{   \protect\label{fig:geothermal} 
    885 Geothermal Heat flux (in $mW.m^{-2}$) used by \cite{Emile-Geay_Madec_OS09}. 
    886 It is inferred from the age of the sea floor and the formulae of \citet{Stein_Stein_Nat92}.} 
    887 \end{center}   \end{figure} 
     882\begin{figure}[!t] 
     883  \begin{center} 
     884    \includegraphics[width=1.0\textwidth]{Fig_TRA_geoth} 
     885    \caption{  \protect\label{fig:geothermal} 
     886      Geothermal Heat flux (in $mW.m^{-2}$) used by \cite{Emile-Geay_Madec_OS09}. 
     887      It is inferred from the age of the sea floor and the formulae of \citet{Stein_Stein_Nat92}. 
     888    } 
     889  \end{center} 
     890\end{figure} 
    888891%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    889892 
    890 Usually it is assumed that there is no exchange of heat or salt through  
    891 the ocean bottom, $i.e.$ a no flux boundary condition is applied on active  
    892 tracers at the bottom. This is the default option in \NEMO, and it is  
    893 implemented using the masking technique. However, there is a  
    894 non-zero heat flux across the seafloor that is associated with solid  
    895 earth cooling. This flux is weak compared to surface fluxes (a mean  
    896 global value of $\sim0.1\;W/m^2$ \citep{Stein_Stein_Nat92}), but it warms  
    897 systematically the ocean and acts on the densest water masses.  
    898 Taking this flux into account in a global ocean model increases 
    899 the deepest overturning cell ($i.e.$ the one associated with the Antarctic  
    900 Bottom Water) by a few Sverdrups  \citep{Emile-Geay_Madec_OS09}.  
     893Usually it is assumed that there is no exchange of heat or salt through the ocean bottom, 
     894$i.e.$ a no flux boundary condition is applied on active tracers at the bottom. 
     895This is the default option in \NEMO, and it is implemented using the masking technique. 
     896However, there is a non-zero heat flux across the seafloor that is associated with solid earth cooling. 
     897This flux is weak compared to surface fluxes (a mean global value of $\sim0.1\;W/m^2$ \citep{Stein_Stein_Nat92}), 
     898but it warms systematically the ocean and acts on the densest water masses. 
     899Taking this flux into account in a global ocean model increases the deepest overturning cell 
     900($i.e.$ the one associated with the Antarctic Bottom Water) by a few Sverdrups  \citep{Emile-Geay_Madec_OS09}.  
    901901 
    902902Options are defined through the  \ngn{namtra\_bbc} namelist variables. 
    903 The presence of geothermal heating is controlled by setting the namelist  
    904 parameter  \np{ln\_trabbc} to true. Then, when \np{nn\_geoflx} is set to 1,  
    905 a constant geothermal heating is introduced whose value is given by the  
    906 \np{nn\_geoflx\_cst}, which is also a namelist parameter.  
    907 When  \np{nn\_geoflx} is set to 2, a spatially varying geothermal heat flux is  
    908 introduced which is provided in the \ifile{geothermal\_heating} NetCDF file  
    909 (\autoref{fig:geothermal}) \citep{Emile-Geay_Madec_OS09}. 
     903The presence of geothermal heating is controlled by setting the namelist parameter \np{ln\_trabbc} to true. 
     904Then, when \np{nn\_geoflx} is set to 1, a constant geothermal heating is introduced whose value is given by 
     905the \np{nn\_geoflx\_cst}, which is also a namelist parameter. 
     906When \np{nn\_geoflx} is set to 2, a spatially varying geothermal heat flux is introduced which is provided in 
     907the \ifile{geothermal\_heating} NetCDF file (\autoref{fig:geothermal}) \citep{Emile-Geay_Madec_OS09}. 
    910908 
    911909% ================================================================ 
     
    920918 
    921919Options are defined through the  \ngn{nambbl} namelist variables. 
    922 In a $z$-coordinate configuration, the bottom topography is represented by a  
    923 series of discrete steps. This is not adequate to represent gravity driven  
    924 downslope flows. Such flows arise either downstream of sills such as the Strait of  
    925 Gibraltar or Denmark Strait, where dense water formed in marginal seas flows  
    926 into a basin filled with less dense water, or along the continental slope when dense  
    927 water masses are formed on a continental shelf. The amount of entrainment  
    928 that occurs in these gravity plumes is critical in determining the density  
    929 and volume flux of the densest waters of the ocean, such as Antarctic Bottom Water,  
    930 or North Atlantic Deep Water. $z$-coordinate models tend to overestimate the  
    931 entrainment, because the gravity flow is mixed vertically by convection  
    932 as it goes ''downstairs'' following the step topography, sometimes over a thickness  
    933 much larger than the thickness of the observed gravity plume. A similar problem  
    934 occurs in the $s$-coordinate when the thickness of the bottom level varies rapidly  
    935 downstream of a sill \citep{Willebrand_al_PO01}, and the thickness  
    936 of the plume is not resolved.  
    937  
    938 The idea of the bottom boundary layer (BBL) parameterisation, first introduced by  
    939 \citet{Beckmann_Doscher1997}, is to allow a direct communication between  
    940 two adjacent bottom cells at different levels, whenever the densest water is  
    941 located above the less dense water. The communication can be by a diffusive flux 
    942 (diffusive BBL), an advective flux (advective BBL), or both. In the current  
    943 implementation of the BBL, only the tracers are modified, not the velocities.  
    944 Furthermore, it only connects ocean bottom cells, and therefore does not include  
    945 all the improvements introduced by \citet{Campin_Goosse_Tel99}. 
     920In a $z$-coordinate configuration, the bottom topography is represented by a series of discrete steps. 
     921This is not adequate to represent gravity driven downslope flows. 
     922Such flows arise either downstream of sills such as the Strait of Gibraltar or Denmark Strait, 
     923where dense water formed in marginal seas flows into a basin filled with less dense water, 
     924or along the continental slope when dense water masses are formed on a continental shelf. 
     925The amount of entrainment that occurs in these gravity plumes is critical in determining the density and 
     926volume flux of the densest waters of the ocean, such as Antarctic Bottom Water, or North Atlantic Deep Water. 
     927$z$-coordinate models tend to overestimate the entrainment, 
     928because the gravity flow is mixed vertically by convection as it goes ''downstairs'' following the step topography, 
     929sometimes over a thickness much larger than the thickness of the observed gravity plume. 
     930A similar problem occurs in the $s$-coordinate when the thickness of the bottom level varies rapidly downstream of 
     931a sill \citep{Willebrand_al_PO01}, and the thickness of the plume is not resolved.  
     932 
     933The idea of the bottom boundary layer (BBL) parameterisation, first introduced by \citet{Beckmann_Doscher1997}, 
     934is to allow a direct communication between two adjacent bottom cells at different levels, 
     935whenever the densest water is located above the less dense water. 
     936The communication can be by a diffusive flux (diffusive BBL), an advective flux (advective BBL), or both. 
     937In the current implementation of the BBL, only the tracers are modified, not the velocities. 
     938Furthermore, it only connects ocean bottom cells, and therefore does not include all the improvements introduced by 
     939\citet{Campin_Goosse_Tel99}. 
    946940 
    947941% ------------------------------------------------------------------------------------------------------------- 
     
    951945\label{subsec:TRA_bbl_diff} 
    952946 
    953 When applying sigma-diffusion (\key{trabbl} defined and \np{nn\_bbl\_ldf} set to 1),  
     947When applying sigma-diffusion (\key{trabbl} defined and \np{nn\_bbl\_ldf} set to 1), 
    954948the diffusive flux between two adjacent cells at the ocean floor is given by  
    955949\begin{equation} \label{eq:tra_bbl_diff} 
    956950{\rm {\bf F}}_\sigma=A_l^\sigma \; \nabla_\sigma T 
    957951\end{equation}  
    958 with $\nabla_\sigma$ the lateral gradient operator taken between bottom cells,  
    959 and  $A_l^\sigma$ the lateral diffusivity in the BBL. Following \citet{Beckmann_Doscher1997},  
    960 the latter is prescribed with a spatial dependence, $i.e.$ in the conditional form 
     952with $\nabla_\sigma$ the lateral gradient operator taken between bottom cells, 
     953and  $A_l^\sigma$ the lateral diffusivity in the BBL. 
     954Following \citet{Beckmann_Doscher1997}, the latter is prescribed with a spatial dependence, 
     955$i.e.$ in the conditional form 
    961956\begin{equation} \label{eq:tra_bbl_coef} 
    962957A_l^\sigma (i,j,t)=\left\{ {\begin{array}{l} 
     
    966961 \end{array}} \right. 
    967962\end{equation}  
    968 where $A_{bbl}$ is the BBL diffusivity coefficient, given by the namelist  
    969 parameter \np{rn\_ahtbbl} and usually set to a value much larger  
    970 than the one used for lateral mixing in the open ocean. The constraint in \autoref{eq:tra_bbl_coef}  
    971 implies that sigma-like diffusion only occurs when the density above the sea floor, at the top of  
    972 the slope, is larger than in the deeper ocean (see green arrow in \autoref{fig:bbl}).  
    973 In practice, this constraint is applied separately in the two horizontal directions,  
     963where $A_{bbl}$ is the BBL diffusivity coefficient, given by the namelist parameter \np{rn\_ahtbbl} and 
     964usually set to a value much larger than the one used for lateral mixing in the open ocean. 
     965The constraint in \autoref{eq:tra_bbl_coef} implies that sigma-like diffusion only occurs when 
     966the density above the sea floor, at the top of the slope, is larger than in the deeper ocean 
     967(see green arrow in \autoref{fig:bbl}). 
     968In practice, this constraint is applied separately in the two horizontal directions, 
    974969and the density gradient in \autoref{eq:tra_bbl_coef} is evaluated with the log gradient formulation:  
    975970\begin{equation} \label{eq:tra_bbl_Drho} 
    976971   \nabla_\sigma \rho / \rho = \alpha \,\nabla_\sigma T + \beta   \,\nabla_\sigma S 
    977972\end{equation}  
    978 where $\rho$, $\alpha$ and $\beta$ are functions of $\overline{T}^\sigma$,  
    979 $\overline{S}^\sigma$ and $\overline{H}^\sigma$, the along bottom mean temperature,  
    980 salinity and depth, respectively. 
     973where $\rho$, $\alpha$ and $\beta$ are functions of $\overline{T}^\sigma$, 
     974$\overline{S}^\sigma$ and $\overline{H}^\sigma$, the along bottom mean temperature, salinity and depth, respectively. 
    981975 
    982976% ------------------------------------------------------------------------------------------------------------- 
     
    990984 
    991985%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    992 \begin{figure}[!t]   \begin{center} 
    993 \includegraphics[width=0.7\textwidth]{Fig_BBL_adv} 
    994 \caption{   \protect\label{fig:bbl}   
    995 Advective/diffusive Bottom Boundary Layer. The BBL parameterisation is  
    996 activated when $\rho^i_{kup}$ is larger than $\rho^{i+1}_{kdnw}$.  
    997 Red arrows indicate the additional overturning circulation due to the advective BBL.  
    998 The transport of the downslope flow is defined either as the transport of the bottom  
    999 ocean cell (black arrow), or as a function of the along slope density gradient.  
    1000 The green arrow indicates the diffusive BBL flux directly connecting $kup$ and $kdwn$ 
    1001 ocean bottom cells. 
    1002 connection} 
    1003 \end{center}   \end{figure} 
     986\begin{figure}[!t] 
     987  \begin{center} 
     988    \includegraphics[width=0.7\textwidth]{Fig_BBL_adv} 
     989    \caption{  \protect\label{fig:bbl} 
     990      Advective/diffusive Bottom Boundary Layer. 
     991      The BBL parameterisation is activated when $\rho^i_{kup}$ is larger than $\rho^{i+1}_{kdnw}$. 
     992      Red arrows indicate the additional overturning circulation due to the advective BBL. 
     993      The transport of the downslope flow is defined either as the transport of the bottom ocean cell (black arrow), 
     994      or as a function of the along slope density gradient. 
     995      The green arrow indicates the diffusive BBL flux directly connecting $kup$ and $kdwn$ ocean bottom cells. 
     996    } 
     997  \end{center} 
     998\end{figure} 
    1004999%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    10051000 
     
    10111006%%%gmcomment   :  this section has to be really written 
    10121007 
    1013 When applying an advective BBL (\np{nn\_bbl\_adv}\forcode{ = 1..2}), an overturning  
    1014 circulation is added which connects two adjacent bottom grid-points only if dense  
    1015 water overlies less dense water on the slope. The density difference causes dense  
    1016 water to move down the slope.  
    1017  
    1018 \np{nn\_bbl\_adv}\forcode{ = 1} : the downslope velocity is chosen to be the Eulerian 
    1019 ocean velocity just above the topographic step (see black arrow in \autoref{fig:bbl})  
    1020 \citep{Beckmann_Doscher1997}. It is a \textit{conditional advection}, that is, advection 
    1021 is allowed only if dense water overlies less dense water on the slope ($i.e.$  
    1022 $\nabla_\sigma \rho  \cdot  \nabla H<0$) and if the velocity is directed towards  
    1023 greater depth ($i.e.$ $\vect{U}  \cdot  \nabla H>0$). 
    1024  
    1025 \np{nn\_bbl\_adv}\forcode{ = 2} : the downslope velocity is chosen to be proportional to $\Delta \rho$, 
     1008When applying an advective BBL (\np{nn\_bbl\_adv}\forcode{ = 1..2}), an overturning circulation is added which 
     1009connects two adjacent bottom grid-points only if dense water overlies less dense water on the slope. 
     1010The density difference causes dense water to move down the slope.  
     1011 
     1012\np{nn\_bbl\_adv}\forcode{ = 1}: 
     1013the downslope velocity is chosen to be the Eulerian ocean velocity just above the topographic step 
     1014(see black arrow in \autoref{fig:bbl}) \citep{Beckmann_Doscher1997}. 
     1015It is a \textit{conditional advection}, that is, advection is allowed only 
     1016if dense water overlies less dense water on the slope ($i.e.$ $\nabla_\sigma \rho  \cdot  \nabla H<0$) and 
     1017if the velocity is directed towards greater depth ($i.e.$ $\vect{U}  \cdot  \nabla H>0$). 
     1018 
     1019\np{nn\_bbl\_adv}\forcode{ = 2}: 
     1020the downslope velocity is chosen to be proportional to $\Delta \rho$, 
    10261021the density difference between the higher cell and lower cell densities \citep{Campin_Goosse_Tel99}. 
    1027 The advection is allowed only  if dense water overlies less dense water on the slope ($i.e.$  
    1028 $\nabla_\sigma \rho  \cdot  \nabla H<0$). For example, the resulting transport of the  
    1029 downslope flow, here in the $i$-direction (\autoref{fig:bbl}), is simply given by the  
    1030 following expression: 
     1022The advection is allowed only  if dense water overlies less dense water on the slope 
     1023($i.e.$ $\nabla_\sigma \rho  \cdot  \nabla H<0$). 
     1024For example, the resulting transport of the downslope flow, here in the $i$-direction (\autoref{fig:bbl}), 
     1025is simply given by the following expression: 
    10311026\begin{equation} \label{eq:bbl_Utr} 
    10321027 u^{tr}_{bbl} = \gamma \, g \frac{\Delta \rho}{\rho_o}  e_{1u} \; min \left( {e_{3u}}_{kup},{e_{3u}}_{kdwn} \right) 
    10331028\end{equation} 
    1034 where $\gamma$, expressed in seconds, is the coefficient of proportionality  
    1035 provided as \np{rn\_gambbl}, a namelist parameter, and \textit{kup} and \textit{kdwn}  
    1036 are the vertical index of the higher and lower cells, respectively. 
    1037 The parameter $\gamma$ should take a different value for each bathymetric  
    1038 step, but for simplicity, and because no direct estimation of this parameter is  
    1039 available, a uniform value has been assumed. The possible values for $\gamma$  
    1040 range between 1 and $10~s$ \citep{Campin_Goosse_Tel99}.   
    1041  
    1042 Scalar properties are advected by this additional transport $( u^{tr}_{bbl}, v^{tr}_{bbl} )$  
    1043 using the upwind scheme. Such a diffusive advective scheme has been chosen  
    1044 to mimic the entrainment between the downslope plume and the surrounding  
    1045 water at intermediate depths. The entrainment is replaced by the vertical mixing  
    1046 implicit in the advection scheme. Let us consider as an example the  
    1047 case displayed in \autoref{fig:bbl} where the density at level $(i,kup)$ is  
    1048 larger than the one at level $(i,kdwn)$. The advective BBL scheme 
    1049 modifies the tracer time tendency of the ocean cells near the  
    1050 topographic step by the downslope flow \autoref{eq:bbl_dw},  
    1051 the horizontal \autoref{eq:bbl_hor} and the upward \autoref{eq:bbl_up}  
    1052 return flows as follows:  
     1029where $\gamma$, expressed in seconds, is the coefficient of proportionality provided as \np{rn\_gambbl}, 
     1030a namelist parameter, and \textit{kup} and \textit{kdwn} are the vertical index of the higher and lower cells, 
     1031respectively. 
     1032The parameter $\gamma$ should take a different value for each bathymetric step, but for simplicity, 
     1033and because no direct estimation of this parameter is available, a uniform value has been assumed. 
     1034The possible values for $\gamma$ range between 1 and $10~s$ \citep{Campin_Goosse_Tel99}. 
     1035 
     1036Scalar properties are advected by this additional transport $( u^{tr}_{bbl}, v^{tr}_{bbl} )$ using the upwind scheme. 
     1037Such a diffusive advective scheme has been chosen to mimic the entrainment between the downslope plume and 
     1038the surrounding water at intermediate depths. 
     1039The entrainment is replaced by the vertical mixing implicit in the advection scheme. 
     1040Let us consider as an example the case displayed in \autoref{fig:bbl} where 
     1041the density at level $(i,kup)$ is larger than the one at level $(i,kdwn)$. 
     1042The advective BBL scheme modifies the tracer time tendency of the ocean cells near the topographic step by 
     1043the downslope flow \autoref{eq:bbl_dw}, the horizontal \autoref{eq:bbl_hor} and 
     1044the upward \autoref{eq:bbl_up} return flows as follows:  
    10531045\begin{align}  
    10541046\partial_t T^{do}_{kdw} &\equiv \partial_t T^{do}_{kdw} 
     
    10651057where $b_t$ is the $T$-cell volume.  
    10661058 
    1067 Note that the BBL transport, $( u^{tr}_{bbl}, v^{tr}_{bbl} )$, is available in  
    1068 the model outputs. It has to be used to compute the effective velocity  
    1069 as well as the effective overturning circulation. 
     1059Note that the BBL transport, $( u^{tr}_{bbl}, v^{tr}_{bbl} )$, is available in the model outputs. 
     1060It has to be used to compute the effective velocity as well as the effective overturning circulation. 
    10701061 
    10711062% ================================================================ 
     
    10791070%-------------------------------------------------------------------------------------------------------------- 
    10801071 
    1081 In some applications it can be useful to add a Newtonian damping term  
    1082 into the temperature and salinity equations: 
     1072In some applications it can be useful to add a Newtonian damping term into the temperature and salinity equations: 
    10831073\begin{equation} \label{eq:tra_dmp} 
    10841074\begin{split} 
    10851075 \frac{\partial T}{\partial t}=\;\cdots \;-\gamma \,\left( {T-T_o } \right)  \\ 
    1086  \frac{\partial S}{\partial t}=\;\cdots \;-\gamma \,\left( {S-S_o } \right)  
    1087  \end{split} 
    1088  \end{equation}  
    1089 where $\gamma$ is the inverse of a time scale, and $T_o$ and $S_o$  
    1090 are given temperature and salinity fields (usually a climatology).  
     1076 \frac{\partial S}{\partial t}=\;\cdots \;-\gamma \,\left( {S-S_o } \right) 
     1077\end{split} 
     1078\end{equation}  
     1079where $\gamma$ is the inverse of a time scale, and $T_o$ and $S_o$ are given temperature and salinity fields 
     1080(usually a climatology). 
    10911081Options are defined through the  \ngn{namtra\_dmp} namelist variables. 
    1092 The restoring term is added when the namelist parameter \np{ln\_tradmp} is set to true.  
    1093 It also requires that both \np{ln\_tsd\_init} and \np{ln\_tsd\_tradmp} are set to true 
    1094 in \textit{namtsd} namelist as well as \np{sn\_tem} and \np{sn\_sal} structures are  
    1095 correctly set  ($i.e.$ that $T_o$ and $S_o$ are provided in input files and read  
    1096 using \mdl{fldread}, see \autoref{subsec:SBC_fldread}).  
    1097 The restoring coefficient $\gamma$ is a three-dimensional array read in during the \rou{tra\_dmp\_init} routine. The file name is specified by the namelist variable \np{cn\_resto}. The DMP\_TOOLS tool is provided to allow users to generate the netcdf file. 
    1098  
    1099 The two main cases in which \autoref{eq:tra_dmp} is used are \textit{(a)}  
    1100 the specification of the boundary conditions along artificial walls of a  
    1101 limited domain basin and \textit{(b)} the computation of the velocity  
    1102 field associated with a given $T$-$S$ field (for example to build the  
    1103 initial state of a prognostic simulation, or to use the resulting velocity  
    1104 field for a passive tracer study). The first case applies to regional  
    1105 models that have artificial walls instead of open boundaries.  
    1106 In the vicinity of these walls, $\gamma$ takes large values (equivalent to  
    1107 a time scale of a few days) whereas it is zero in the interior of the  
    1108 model domain. The second case corresponds to the use of the robust  
    1109 diagnostic method \citep{Sarmiento1982}. It allows us to find the velocity  
    1110 field consistent with the model dynamics whilst having a $T$, $S$ field  
    1111 close to a given climatological field ($T_o$, $S_o$).  
    1112  
    1113 The robust diagnostic method is very efficient in preventing temperature  
    1114 drift in intermediate waters but it produces artificial sources of heat and salt  
    1115 within the ocean. It also has undesirable effects on the ocean convection.  
    1116 It tends to prevent deep convection and subsequent deep-water formation,  
    1117 by stabilising the water column too much. 
    1118  
    1119 The namelist parameter \np{nn\_zdmp} sets whether the damping should be applied in the whole water column or only below the mixed layer (defined either on a density or $S_o$ criterion). It is common to set the damping to zero in the mixed layer as the adjustment time scale is short here \citep{Madec_al_JPO96}. 
     1082The restoring term is added when the namelist parameter \np{ln\_tradmp} is set to true. 
     1083It also requires that both \np{ln\_tsd\_init} and \np{ln\_tsd\_tradmp} are set to true in 
     1084\textit{namtsd} namelist as well as \np{sn\_tem} and \np{sn\_sal} structures are correctly set 
     1085($i.e.$ that $T_o$ and $S_o$ are provided in input files and read using \mdl{fldread}, 
     1086see \autoref{subsec:SBC_fldread}). 
     1087The restoring coefficient $\gamma$ is a three-dimensional array read in during the \rou{tra\_dmp\_init} routine. 
     1088The file name is specified by the namelist variable \np{cn\_resto}. 
     1089The DMP\_TOOLS tool is provided to allow users to generate the netcdf file. 
     1090 
     1091The two main cases in which \autoref{eq:tra_dmp} is used are 
     1092\textit{(a)} the specification of the boundary conditions along artificial walls of a limited domain basin and 
     1093\textit{(b)} the computation of the velocity field associated with a given $T$-$S$ field 
     1094(for example to build the initial state of a prognostic simulation, 
     1095or to use the resulting velocity field for a passive tracer study). 
     1096The first case applies to regional models that have artificial walls instead of open boundaries. 
     1097In the vicinity of these walls, $\gamma$ takes large values (equivalent to a time scale of a few days) whereas 
     1098it is zero in the interior of the model domain. 
     1099The second case corresponds to the use of the robust diagnostic method \citep{Sarmiento1982}. 
     1100It allows us to find the velocity field consistent with the model dynamics whilst 
     1101having a $T$, $S$ field close to a given climatological field ($T_o$, $S_o$).  
     1102 
     1103The robust diagnostic method is very efficient in preventing temperature drift in intermediate waters but 
     1104it produces artificial sources of heat and salt within the ocean. 
     1105It also has undesirable effects on the ocean convection. 
     1106It tends to prevent deep convection and subsequent deep-water formation, by stabilising the water column too much. 
     1107 
     1108The namelist parameter \np{nn\_zdmp} sets whether the damping should be applied in the whole water column or 
     1109only below the mixed layer (defined either on a density or $S_o$ criterion). 
     1110It is common to set the damping to zero in the mixed layer as the adjustment time scale is short here 
     1111\citep{Madec_al_JPO96}. 
    11201112 
    11211113\subsection{Generating \ifile{resto} using DMP\_TOOLS} 
    11221114 
    1123 DMP\_TOOLS can be used to generate a netcdf file containing the restoration coefficient $\gamma$.  
    1124 Note that in order to maintain bit comparison with previous NEMO versions DMP\_TOOLS must be compiled  
    1125 and run on the same machine as the NEMO model. A \ifile{mesh\_mask} file for the model configuration is required as an input.  
    1126 This can be generated by carrying out a short model run with the namelist parameter \np{nn\_msh} set to 1.  
    1127 The namelist parameter \np{ln\_tradmp} will also need to be set to .false. for this to work.  
    1128 The \nl{nam\_dmp\_create} namelist in the DMP\_TOOLS directory is used to specify options for the restoration coefficient. 
     1115DMP\_TOOLS can be used to generate a netcdf file containing the restoration coefficient $\gamma$. 
     1116Note that in order to maintain bit comparison with previous NEMO versions DMP\_TOOLS must be compiled and 
     1117run on the same machine as the NEMO model. 
     1118A \ifile{mesh\_mask} file for the model configuration is required as an input. 
     1119This can be generated by carrying out a short model run with the namelist parameter \np{nn\_msh} set to 1. 
     1120The namelist parameter \np{ln\_tradmp} will also need to be set to .false. for this to work. 
     1121The \nl{nam\_dmp\_create} namelist in the DMP\_TOOLS directory is used to specify options for 
     1122the restoration coefficient. 
    11291123 
    11301124%--------------------------------------------nam_dmp_create------------------------------------------------- 
     
    11321126%------------------------------------------------------------------------------------------------------- 
    11331127 
    1134 \np{cp\_cfg}, \np{cp\_cpz}, \np{jp\_cfg} and \np{jperio} specify the model configuration being used and should be the same as specified in \nl{namcfg}. The variable \nl{lzoom} is used to specify that the damping is being used as in case \textit{a} above to provide boundary conditions to a zoom configuration. In the case of the arctic or antarctic zoom configurations this includes some specific treatment. Otherwise damping is applied to the 6 grid points along the ocean boundaries. The open boundaries are specified by the variables \np{lzoom\_n}, \np{lzoom\_e}, \np{lzoom\_s}, \np{lzoom\_w} in the \nl{nam\_zoom\_dmp} name list. 
    1135  
    1136 The remaining switch namelist variables determine the spatial variation of the restoration coefficient in non-zoom configurations.  
    1137 \np{ln\_full\_field} specifies that newtonian damping should be applied to the whole model domain.  
    1138 \np{ln\_med\_red\_seas} specifies grid specific restoration coefficients in the Mediterranean Sea  
    1139 for the ORCA4, ORCA2 and ORCA05 configurations.  
    1140 If \np{ln\_old\_31\_lev\_code} is set then the depth variation of the coeffients will be specified as  
    1141 a function of the model number. This option is included to allow backwards compatability of the ORCA2 reference  
    1142 configurations with previous model versions.  
    1143 \np{ln\_coast} specifies that the restoration coefficient should be reduced near to coastlines.  
    1144 This option only has an effect if \np{ln\_full\_field} is true.  
    1145 \np{ln\_zero\_top\_layer} specifies that the restoration coefficient should be zero in the surface layer.  
    1146 Finally \np{ln\_custom} specifies that the custom module will be called.  
    1147 This module is contained in the file \mdl{custom} and can be edited by users. For example damping could be applied in a specific region. 
    1148  
    1149 The restoration coefficient can be set to zero in equatorial regions by specifying a positive value of \np{nn\_hdmp}.  
     1128\np{cp\_cfg}, \np{cp\_cpz}, \np{jp\_cfg} and \np{jperio} specify the model configuration being used and 
     1129should be the same as specified in \nl{namcfg}. 
     1130The variable \nl{lzoom} is used to specify that the damping is being used as in case \textit{a} above to 
     1131provide boundary conditions to a zoom configuration. 
     1132In the case of the arctic or antarctic zoom configurations this includes some specific treatment. 
     1133Otherwise damping is applied to the 6 grid points along the ocean boundaries. 
     1134The open boundaries are specified by the variables \np{lzoom\_n}, \np{lzoom\_e}, \np{lzoom\_s}, \np{lzoom\_w} in 
     1135the \nl{nam\_zoom\_dmp} name list. 
     1136 
     1137The remaining switch namelist variables determine the spatial variation of the restoration coefficient in 
     1138non-zoom configurations. 
     1139\np{ln\_full\_field} specifies that newtonian damping should be applied to the whole model domain. 
     1140\np{ln\_med\_red\_seas} specifies grid specific restoration coefficients in the Mediterranean Sea for 
     1141the ORCA4, ORCA2 and ORCA05 configurations. 
     1142If \np{ln\_old\_31\_lev\_code} is set then the depth variation of the coeffients will be specified as 
     1143a function of the model number. 
     1144This option is included to allow backwards compatability of the ORCA2 reference configurations with 
     1145previous model versions. 
     1146\np{ln\_coast} specifies that the restoration coefficient should be reduced near to coastlines. 
     1147This option only has an effect if \np{ln\_full\_field} is true. 
     1148\np{ln\_zero\_top\_layer} specifies that the restoration coefficient should be zero in the surface layer. 
     1149Finally \np{ln\_custom} specifies that the custom module will be called. 
     1150This module is contained in the file \mdl{custom} and can be edited by users. 
     1151For example damping could be applied in a specific region. 
     1152 
     1153The restoration coefficient can be set to zero in equatorial regions by 
     1154specifying a positive value of \np{nn\_hdmp}.  
    11501155Equatorward of this latitude the restoration coefficient will be zero with a smooth transition to  
    11511156the full values of a 10\deg latitud band.  
    1152 This is often used because of the short adjustment time scale in the equatorial region  
    1153 \citep{Reverdin1991, Fujio1991, Marti_PhD92}. The time scale associated with the damping depends on the depth as a  
    1154 hyperbolic tangent, with \np{rn\_surf} as surface value, \np{rn\_bot} as bottom value and a transition depth of \np{rn\_dep}.   
     1157This is often used because of the short adjustment time scale in the equatorial region 
     1158\citep{Reverdin1991, Fujio1991, Marti_PhD92}. 
     1159The time scale associated with the damping depends on the depth as a hyperbolic tangent, 
     1160with \np{rn\_surf} as surface value, \np{rn\_bot} as bottom value and a transition depth of \np{rn\_dep}.   
    11551161 
    11561162% ================================================================ 
     
    11651171 
    11661172Options are defined through the  \ngn{namdom} namelist variables. 
    1167 The general framework for tracer time stepping is a modified leap-frog scheme  
    1168 \citep{Leclair_Madec_OM09}, $i.e.$ a three level centred time scheme associated  
    1169 with a Asselin time filter (cf. \autoref{sec:STP_mLF}): 
     1173The general framework for tracer time stepping is a modified leap-frog scheme \citep{Leclair_Madec_OM09}, 
     1174$i.e.$ a three level centred time scheme associated with a Asselin time filter (cf. \autoref{sec:STP_mLF}): 
    11701175\begin{equation} \label{eq:tra_nxt} 
    11711176\begin{aligned} 
     
    11771182\end{aligned} 
    11781183\end{equation}  
    1179 where RHS is the right hand side of the temperature equation,  
    1180 the subscript $f$ denotes filtered values, $\gamma$ is the Asselin coefficient, 
    1181 and $S$ is the total forcing applied on $T$ ($i.e.$ fluxes plus content in mass exchanges).  
    1182 $\gamma$ is initialized as \np{rn\_atfp} (\textbf{namelist} parameter).  
    1183 Its default value is \np{rn\_atfp}\forcode{ = 10.e-3}. Note that the forcing correction term in the filter 
    1184 is not applied in linear free surface (\jp{lk\_vvl}\forcode{ = .false.}) (see \autoref{subsec:TRA_sbc}. 
    1185 Not also that in constant volume case, the time stepping is performed on $T$,  
    1186 not on its content, $e_{3t}T$. 
    1187  
    1188 When the vertical mixing is solved implicitly, the update of the \textit{next} tracer  
    1189 fields is done in module \mdl{trazdf}. In this case only the swapping of arrays  
    1190 and the Asselin filtering is done in the \mdl{tranxt} module. 
    1191  
    1192 In order to prepare for the computation of the \textit{next} time step,  
    1193 a swap of tracer arrays is performed: $T^{t-\rdt} = T^t$ and $T^t = T_f$.  
     1184where RHS is the right hand side of the temperature equation, the subscript $f$ denotes filtered values, 
     1185$\gamma$ is the Asselin coefficient, and $S$ is the total forcing applied on $T$ 
     1186($i.e.$ fluxes plus content in mass exchanges). 
     1187$\gamma$ is initialized as \np{rn\_atfp} (\textbf{namelist} parameter). 
     1188Its default value is \np{rn\_atfp}\forcode{ = 10.e-3}. 
     1189Note that the forcing correction term in the filter is not applied in linear free surface 
     1190(\jp{lk\_vvl}\forcode{ = .false.}) (see \autoref{subsec:TRA_sbc}. 
     1191Not also that in constant volume case, the time stepping is performed on $T$, not on its content, $e_{3t}T$. 
     1192 
     1193When the vertical mixing is solved implicitly, 
     1194the update of the \textit{next} tracer fields is done in module \mdl{trazdf}. 
     1195In this case only the swapping of arrays and the Asselin filtering is done in the \mdl{tranxt} module. 
     1196 
     1197In order to prepare for the computation of the \textit{next} time step, a swap of tracer arrays is performed: 
     1198$T^{t-\rdt} = T^t$ and $T^t = T_f$.  
    11941199 
    11951200% ================================================================ 
     
    12091214\label{subsec:TRA_eos} 
    12101215 
    1211 The Equation Of Seawater (EOS) is an empirical nonlinear thermodynamic relationship  
    1212 linking seawater density, $\rho$, to a number of state variables,  
    1213 most typically temperature, salinity and pressure.  
    1214 Because density gradients control the pressure gradient force through the hydrostatic balance,  
    1215 the equation of state provides a fundamental bridge between the distribution of active tracers  
    1216 and the fluid dynamics. Nonlinearities of the EOS are of major importance, in particular  
    1217 influencing the circulation through determination of the static stability below the mixed layer,  
    1218 thus controlling rates of exchange between the atmosphere  and the ocean interior \citep{Roquet_JPO2015}.  
    1219 Therefore an accurate EOS based on either the 1980 equation of state (EOS-80, \cite{UNESCO1983})  
    1220 or TEOS-10 \citep{TEOS10} standards should be used anytime a simulation of the real  
    1221 ocean circulation is attempted \citep{Roquet_JPO2015}.  
    1222 The use of TEOS-10 is highly recommended because  
    1223 \textit{(i)} it is the new official EOS,  
    1224 \textit{(ii)} it is more accurate, being based on an updated database of laboratory measurements, and  
    1225 \textit{(iii)} it uses Conservative Temperature and Absolute Salinity (instead of potential temperature  
    1226 and practical salinity for EOS-980, both variables being more suitable for use as model variables  
    1227 \citep{TEOS10, Graham_McDougall_JPO13}.  
     1216The Equation Of Seawater (EOS) is an empirical nonlinear thermodynamic relationship linking seawater density, 
     1217$\rho$, to a number of state variables, most typically temperature, salinity and pressure. 
     1218Because density gradients control the pressure gradient force through the hydrostatic balance, 
     1219the equation of state provides a fundamental bridge between the distribution of active tracers and 
     1220the fluid dynamics. 
     1221Nonlinearities of the EOS are of major importance, in particular influencing the circulation through 
     1222determination of the static stability below the mixed layer, 
     1223thus controlling rates of exchange between the atmosphere and the ocean interior \citep{Roquet_JPO2015}. 
     1224Therefore an accurate EOS based on either the 1980 equation of state (EOS-80, \cite{UNESCO1983}) or 
     1225TEOS-10 \citep{TEOS10} standards should be used anytime a simulation of the real ocean circulation is attempted 
     1226\citep{Roquet_JPO2015}. 
     1227The use of TEOS-10 is highly recommended because 
     1228\textit{(i)}   it is the new official EOS, 
     1229\textit{(ii)}  it is more accurate, being based on an updated database of laboratory measurements, and 
     1230\textit{(iii)} it uses Conservative Temperature and Absolute Salinity (instead of potential temperature and 
     1231practical salinity for EOS-980, both variables being more suitable for use as model variables 
     1232\citep{TEOS10, Graham_McDougall_JPO13}. 
    12281233EOS-80 is an obsolescent feature of the NEMO system, kept only for backward compatibility. 
    1229 For process studies, it is often convenient to use an approximation of the EOS. To that purposed,  
    1230 a simplified EOS (S-EOS) inspired by \citet{Vallis06} is also available. 
    1231  
    1232 In the computer code, a density anomaly, $d_a= \rho / \rho_o - 1$,  
    1233 is computed, with $\rho_o$ a reference density. Called \textit{rau0}  
    1234 in the code, $\rho_o$ is set in \mdl{phycst} to a value of $1,026~Kg/m^3$.  
    1235 This is a sensible choice for the reference density used in a Boussinesq ocean  
    1236 climate model, as, with the exception of only a small percentage of the ocean,  
     1234For process studies, it is often convenient to use an approximation of the EOS. 
     1235To that purposed, a simplified EOS (S-EOS) inspired by \citet{Vallis06} is also available. 
     1236 
     1237In the computer code, a density anomaly, $d_a= \rho / \rho_o - 1$, is computed, with $\rho_o$ a reference density. 
     1238Called \textit{rau0} in the code, $\rho_o$ is set in \mdl{phycst} to a value of $1,026~Kg/m^3$. 
     1239This is a sensible choice for the reference density used in a Boussinesq ocean climate model, as, 
     1240with the exception of only a small percentage of the ocean, 
    12371241density in the World Ocean varies by no more than 2$\%$ from that value \citep{Gill1982}. 
    12381242 
    1239 Options are defined through the  \ngn{nameos} namelist variables, and in particular \np{nn\_eos}  
    1240 which controls the EOS used (\forcode{= -1} for TEOS10 ; \forcode{= 0} for EOS-80 ; \forcode{= 1} for S-EOS). 
     1243Options are defined through the  \ngn{nameos} namelist variables, and in particular \np{nn\_eos} which 
     1244controls the EOS used (\forcode{= -1} for TEOS10 ; \forcode{= 0} for EOS-80 ; \forcode{= 1} for S-EOS). 
    12411245\begin{description} 
    1242  
    1243 \item[\np{nn\_eos}\forcode{ = -1}] the polyTEOS10-bsq equation of seawater \citep{Roquet_OM2015} is used.   
    1244 The accuracy of this approximation is comparable to the TEOS-10 rational function approximation,  
    1245 but it is optimized for a boussinesq fluid and the polynomial expressions have simpler  
    1246 and more computationally efficient expressions for their derived quantities  
    1247 which make them more adapted for use in ocean models.  
    1248 Note that a slightly higher precision polynomial form is now used replacement of the TEOS-10  
    1249 rational function approximation for hydrographic data analysis  \citep{TEOS10}.  
    1250 A key point is that conservative state variables are used:  
    1251 Absolute Salinity (unit: g/kg, notation: $S_A$) and Conservative Temperature (unit: \degC, notation: $\Theta$). 
    1252 The pressure in decibars is approximated by the depth in meters.  
    1253 With TEOS10, the specific heat capacity of sea water, $C_p$, is a constant. It is set to  
    1254 $C_p=3991.86795711963~J\,Kg^{-1}\,^{\circ}K^{-1}$, according to \citet{TEOS10}. 
    1255  
    1256 Choosing polyTEOS10-bsq implies that the state variables used by the model are  
    1257 $\Theta$ and $S_A$. In particular, the initial state deined by the user have to be given as  
    1258 \textit{Conservative} Temperature and \textit{Absolute} Salinity.  
    1259 In addition, setting \np{ln\_useCT} to \forcode{.true.} convert the Conservative SST to potential SST  
    1260 prior to either computing the air-sea and ice-sea fluxes (forced mode)  
    1261 or sending the SST field to the atmosphere (coupled mode). 
    1262  
    1263 \item[\np{nn\_eos}\forcode{ = 0}] the polyEOS80-bsq equation of seawater is used. 
    1264 It takes the same polynomial form as the polyTEOS10, but the coefficients have been optimized  
    1265 to accurately fit EOS80 (Roquet, personal comm.). The state variables used in both the EOS80  
    1266 and the ocean model are:  
    1267 the Practical Salinity ((unit: psu, notation: $S_p$)) and Potential Temperature (unit: $^{\circ}C$, notation: $\theta$). 
    1268 The pressure in decibars is approximated by the depth in meters.   
    1269 With thsi EOS, the specific heat capacity of sea water, $C_p$, is a function of temperature,  
    1270 salinity and pressure \citep{UNESCO1983}. Nevertheless, a severe assumption is made in order to  
    1271 have a heat content ($C_p T_p$) which is conserved by the model: $C_p$ is set to a constant  
    1272 value, the TEOS10 value.  
     1246\item[\np{nn\_eos}\forcode{ = -1}] 
     1247  the polyTEOS10-bsq equation of seawater \citep{Roquet_OM2015} is used. 
     1248  The accuracy of this approximation is comparable to the TEOS-10 rational function approximation, 
     1249  but it is optimized for a boussinesq fluid and the polynomial expressions have simpler and 
     1250  more computationally efficient expressions for their derived quantities which make them more adapted for 
     1251  use in ocean models. 
     1252  Note that a slightly higher precision polynomial form is now used replacement of 
     1253  the TEOS-10 rational function approximation for hydrographic data analysis \citep{TEOS10}. 
     1254  A key point is that conservative state variables are used: 
     1255  Absolute Salinity (unit: g/kg, notation: $S_A$) and Conservative Temperature (unit: \degC, notation: $\Theta$). 
     1256  The pressure in decibars is approximated by the depth in meters. 
     1257  With TEOS10, the specific heat capacity of sea water, $C_p$, is a constant. 
     1258  It is set to $C_p=3991.86795711963~J\,Kg^{-1}\,^{\circ}K^{-1}$, according to \citet{TEOS10}. 
     1259 
     1260  Choosing polyTEOS10-bsq implies that the state variables used by the model are $\Theta$ and $S_A$. 
     1261  In particular, the initial state deined by the user have to be given as \textit{Conservative} Temperature and 
     1262  \textit{Absolute} Salinity. 
     1263  In addition, setting \np{ln\_useCT} to \forcode{.true.} convert the Conservative SST to potential SST prior to 
     1264  either computing the air-sea and ice-sea fluxes (forced mode) or 
     1265  sending the SST field to the atmosphere (coupled mode). 
     1266 
     1267\item[\np{nn\_eos}\forcode{ = 0}] 
     1268  the polyEOS80-bsq equation of seawater is used. 
     1269  It takes the same polynomial form as the polyTEOS10, but the coefficients have been optimized to 
     1270  accurately fit EOS80 (Roquet, personal comm.). 
     1271  The state variables used in both the EOS80 and the ocean model are: 
     1272  the Practical Salinity ((unit: psu, notation: $S_p$)) and 
     1273  Potential Temperature (unit: $^{\circ}C$, notation: $\theta$). 
     1274  The pressure in decibars is approximated by the depth in meters. 
     1275  With thsi EOS, the specific heat capacity of sea water, $C_p$, is a function of temperature, salinity and 
     1276  pressure \citep{UNESCO1983}. 
     1277  Nevertheless, a severe assumption is made in order to have a heat content ($C_p T_p$) which 
     1278  is conserved by the model: $C_p$ is set to a constant value, the TEOS10 value.  
    12731279  
    1274 \item[\np{nn\_eos}\forcode{ = 1}] a simplified EOS (S-EOS) inspired by \citet{Vallis06} is chosen,  
    1275 the coefficients of which has been optimized to fit the behavior of TEOS10 (Roquet, personal comm.)  
    1276 (see also \citet{Roquet_JPO2015}). It provides a simplistic linear representation of both  
    1277 cabbeling and thermobaricity effects which is enough for a proper treatment of the EOS  
    1278 in theoretical studies \citep{Roquet_JPO2015}. 
    1279 With such an equation of state there is no longer a distinction between  
    1280 \textit{conservative} and \textit{potential} temperature, as well as between \textit{absolute}  
    1281 and \textit{practical} salinity. 
    1282 S-EOS takes the following expression: 
    1283 \begin{equation} \label{eq:tra_S-EOS} 
    1284 \begin{split} 
    1285   d_a(T,S,z)  =  ( & - a_0 \; ( 1 + 0.5 \; \lambda_1 \; T_a + \mu_1 \; z ) * T_a  \\ 
    1286                                 & + b_0 \; ( 1 - 0.5 \; \lambda_2 \; S_a - \mu_2 \; z ) * S_a  \\ 
    1287                                 & - \nu \; T_a \; S_a \;  ) \; / \; \rho_o                     \\ 
    1288   with \ \  T_a = T-10  \; ;  & \;  S_a = S-35  \; ;\;  \rho_o = 1026~Kg/m^3 
    1289 \end{split} 
    1290 \end{equation}  
    1291 where the computer name of the coefficients as well as their standard value are given in \autoref{tab:SEOS}. 
    1292 In fact, when choosing S-EOS, various approximation of EOS can be specified simply by changing  
    1293 the associated coefficients.  
    1294 Setting to zero the two thermobaric coefficients ($\mu_1$, $\mu_2$) remove thermobaric effect from S-EOS. 
    1295 setting to zero the three cabbeling coefficients ($\lambda_1$, $\lambda_2$, $\nu$) remove cabbeling effect from S-EOS. 
    1296 Keeping non-zero value to $a_0$ and $b_0$ provide a linear EOS function of T and S. 
    1297  
     1280\item[\np{nn\_eos}\forcode{ = 1}] 
     1281  a simplified EOS (S-EOS) inspired by \citet{Vallis06} is chosen, 
     1282  the coefficients of which has been optimized to fit the behavior of TEOS10 
     1283  (Roquet, personal comm.) (see also \citet{Roquet_JPO2015}). 
     1284  It provides a simplistic linear representation of both cabbeling and thermobaricity effects which 
     1285  is enough for a proper treatment of the EOS in theoretical studies \citep{Roquet_JPO2015}. 
     1286  With such an equation of state there is no longer a distinction between 
     1287  \textit{conservative} and \textit{potential} temperature, 
     1288  as well as between \textit{absolute} and \textit{practical} salinity. 
     1289  S-EOS takes the following expression: 
     1290  \begin{equation} \label{eq:tra_S-EOS} 
     1291    \begin{split} 
     1292      d_a(T,S,z)  =  ( & - a_0 \; ( 1 + 0.5 \; \lambda_1 \; T_a + \mu_1 \; z ) * T_a  \\ 
     1293      & + b_0 \; ( 1 - 0.5 \; \lambda_2 \; S_a - \mu_2 \; z ) * S_a  \\ 
     1294      & - \nu \; T_a \; S_a \;  ) \; / \; \rho_o                     \\ 
     1295      with \ \  T_a = T-10  \; ;  & \;  S_a = S-35  \; ;\;  \rho_o = 1026~Kg/m^3 
     1296    \end{split} 
     1297  \end{equation} 
     1298  where the computer name of the coefficients as well as their standard value are given in \autoref{tab:SEOS}. 
     1299  In fact, when choosing S-EOS, various approximation of EOS can be specified simply by changing the associated coefficients. 
     1300  Setting to zero the two thermobaric coefficients ($\mu_1$, $\mu_2$) remove thermobaric effect from S-EOS. 
     1301  setting to zero the three cabbeling coefficients ($\lambda_1$, $\lambda_2$, $\nu$) remove cabbeling effect from S-EOS. 
     1302  Keeping non-zero value to $a_0$ and $b_0$ provide a linear EOS function of T and S. 
    12981303\end{description} 
    12991304 
     
    13131318\end{tabular} 
    13141319\caption{ \protect\label{tab:SEOS} 
    1315 Standard value of S-EOS coefficients. } 
     1320  Standard value of S-EOS coefficients. 
     1321} 
    13161322\end{center} 
    13171323\end{table} 
     
    13251331\label{subsec:TRA_bn2} 
    13261332 
    1327 An accurate computation of the ocean stability (i.e. of $N$, the brunt-V\"{a}is\"{a}l\"{a} 
    1328  frequency) is of paramount importance as determine the ocean stratification and  
    1329  is used in several ocean parameterisations (namely TKE, GLS, Richardson number dependent  
    1330  vertical diffusion, enhanced vertical diffusion, non-penetrative convection, tidal mixing  
    1331  parameterisation, iso-neutral diffusion). In particular, $N^2$ has to be computed at the local pressure  
    1332  (pressure in decibar being approximated by the depth in meters). The expression for $N^2$  
    1333  is given by:  
     1333An accurate computation of the ocean stability (i.e. of $N$, the brunt-V\"{a}is\"{a}l\"{a} frequency) is of 
     1334paramount importance as determine the ocean stratification and is used in several ocean parameterisations 
     1335(namely TKE, GLS, Richardson number dependent vertical diffusion, enhanced vertical diffusion, 
     1336non-penetrative convection, tidal mixing  parameterisation, iso-neutral diffusion). 
     1337In particular, $N^2$ has to be computed at the local pressure 
     1338(pressure in decibar being approximated by the depth in meters). 
     1339The expression for $N^2$ is given by:  
    13341340\begin{equation} \label{eq:tra_bn2} 
    13351341N^2 = \frac{g}{e_{3w}} \left(   \beta \;\delta_{k+1/2}[S] - \alpha \;\delta_{k+1/2}[T]   \right) 
    13361342\end{equation}  
    1337 where $(T,S) = (\Theta, S_A)$ for TEOS10, $= (\theta, S_p)$ for TEOS-80, or $=(T,S)$ for S-EOS,  
    1338 and, $\alpha$ and $\beta$ are the thermal and haline expansion coefficients.  
    1339 The coefficients are a polynomial function of temperature, salinity and depth which expression  
    1340 depends on the chosen EOS. They are computed through \textit{eos\_rab}, a \textsc{Fortran}  
    1341 function that can be found in \mdl{eosbn2}. 
     1343where $(T,S) = (\Theta, S_A)$ for TEOS10, $= (\theta, S_p)$ for TEOS-80, or $=(T,S)$ for S-EOS, 
     1344and, $\alpha$ and $\beta$ are the thermal and haline expansion coefficients. 
     1345The coefficients are a polynomial function of temperature, salinity and depth which 
     1346expression depends on the chosen EOS. 
     1347They are computed through \textit{eos\_rab}, a \textsc{Fortran} function that can be found in \mdl{eosbn2}. 
    13421348 
    13431349% ------------------------------------------------------------------------------------------------------------- 
     
    13561362\end{equation} 
    13571363 
    1358 \autoref{eq:tra_eos_fzp} is only used to compute the potential freezing point of  
    1359 sea water ($i.e.$ referenced to the surface $p=0$), thus the pressure dependent  
    1360 terms in \autoref{eq:tra_eos_fzp} (last term) have been dropped. The freezing 
    1361 point is computed through \textit{eos\_fzp}, a \textsc{Fortran} function that can be found  
    1362 in \mdl{eosbn2}.   
     1364\autoref{eq:tra_eos_fzp} is only used to compute the potential freezing point of sea water 
     1365($i.e.$ referenced to the surface $p=0$), 
     1366thus the pressure dependent terms in \autoref{eq:tra_eos_fzp} (last term) have been dropped. 
     1367The freezing point is computed through \textit{eos\_fzp}, 
     1368a \textsc{Fortran} function that can be found in \mdl{eosbn2}.   
    13631369 
    13641370 
     
    13801386 
    13811387\gmcomment{STEVEN: to be consistent with earlier discussion of differencing and averaging operators,  
    1382                    I've changed "derivative" to "difference" and "mean" to "average"} 
    1383  
    1384 With partial cells (\np{ln\_zps}\forcode{ = .true.}) at bottom and top (\np{ln\_isfcav}\forcode{ = .true.}), in general,  
    1385 tracers in horizontally adjacent cells live at different depths.  
    1386 Horizontal gradients of tracers are needed for horizontal diffusion (\mdl{traldf} module)  
    1387 and the hydrostatic pressure gradient calculations (\mdl{dynhpg} module).  
    1388 The partial cell properties at the top (\np{ln\_isfcav}\forcode{ = .true.}) are computed in the same way as for the bottom.  
     1388I've changed "derivative" to "difference" and "mean" to "average"} 
     1389 
     1390With partial cells (\np{ln\_zps}\forcode{ = .true.}) at bottom and top (\np{ln\_isfcav}\forcode{ = .true.}), 
     1391in general, tracers in horizontally adjacent cells live at different depths. 
     1392Horizontal gradients of tracers are needed for horizontal diffusion (\mdl{traldf} module) and 
     1393the hydrostatic pressure gradient calculations (\mdl{dynhpg} module). 
     1394The partial cell properties at the top (\np{ln\_isfcav}\forcode{ = .true.}) are computed in the same way as 
     1395for the bottom. 
    13891396So, only the bottom interpolation is explained below. 
    13901397 
    1391 Before taking horizontal gradients between the tracers next to the bottom, a linear  
    1392 interpolation in the vertical is used to approximate the deeper tracer as if it actually  
    1393 lived at the depth of the shallower tracer point (\autoref{fig:Partial_step_scheme}).  
    1394 For example, for temperature in the $i$-direction the needed interpolated  
    1395 temperature, $\widetilde{T}$, is: 
     1398Before taking horizontal gradients between the tracers next to the bottom, 
     1399a linear interpolation in the vertical is used to approximate the deeper tracer as if 
     1400it actually lived at the depth of the shallower tracer point (\autoref{fig:Partial_step_scheme}). 
     1401For example, for temperature in the $i$-direction the needed interpolated temperature, $\widetilde{T}$, is: 
    13961402 
    13971403%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    1398 \begin{figure}[!p]    \begin{center} 
    1399 \includegraphics[width=0.9\textwidth]{Partial_step_scheme} 
    1400 \caption{   \protect\label{fig:Partial_step_scheme}  
    1401 Discretisation of the horizontal difference and average of tracers in the $z$-partial  
    1402 step coordinate (\protect\np{ln\_zps}\forcode{ = .true.}) in the case $( e3w_k^{i+1} - e3w_k^i  )>0$.  
    1403 A linear interpolation is used to estimate $\widetilde{T}_k^{i+1}$, the tracer value  
    1404 at the depth of the shallower tracer point of the two adjacent bottom $T$-points.  
    1405 The horizontal difference is then given by: $\delta _{i+1/2} T_k=  \widetilde{T}_k^{\,i+1} -T_k^{\,i}$  
    1406 and the average by: $\overline{T}_k^{\,i+1/2}= ( \widetilde{T}_k^{\,i+1/2} - T_k^{\,i} ) / 2$.  } 
    1407 \end{center}   \end{figure} 
     1404\begin{figure}[!p] 
     1405  \begin{center} 
     1406    \includegraphics[width=0.9\textwidth]{Fig_partial_step_scheme} 
     1407    \caption{  \protect\label{fig:Partial_step_scheme} 
     1408      Discretisation of the horizontal difference and average of tracers in the $z$-partial step coordinate 
     1409      (\protect\np{ln\_zps}\forcode{ = .true.}) in the case $( e3w_k^{i+1} - e3w_k^i  )>0$. 
     1410      A linear interpolation is used to estimate $\widetilde{T}_k^{i+1}$, 
     1411      the tracer value at the depth of the shallower tracer point of the two adjacent bottom $T$-points. 
     1412      The horizontal difference is then given by: $\delta _{i+1/2} T_k=  \widetilde{T}_k^{\,i+1} -T_k^{\,i}$ and 
     1413      the average by: $\overline{T}_k^{\,i+1/2}= ( \widetilde{T}_k^{\,i+1/2} - T_k^{\,i} ) / 2$. 
     1414    } 
     1415  \end{center} 
     1416\end{figure} 
    14081417%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    14091418\begin{equation*} 
     
    14161425            \end{aligned}   \right. 
    14171426\end{equation*} 
    1418 and the resulting forms for the horizontal difference and the horizontal average  
    1419 value of $T$ at a $U$-point are:  
     1427and the resulting forms for the horizontal difference and the horizontal average value of $T$ at a $U$-point are:  
    14201428\begin{equation} \label{eq:zps_hde} 
    14211429\begin{aligned} 
     
    14341442\end{equation} 
    14351443 
    1436 The computation of horizontal derivative of tracers as well as of density is  
    1437 performed once for all at each time step in \mdl{zpshde} module and stored  
    1438 in shared arrays to be used when needed. It has to be emphasized that the  
    1439 procedure used to compute the interpolated density, $\widetilde{\rho}$, is not  
    1440 the same as that used for $T$ and $S$. Instead of forming a linear approximation  
    1441 of density, we compute $\widetilde{\rho }$ from the interpolated values of $T$  
    1442 and $S$, and the pressure at a $u$-point (in the equation of state pressure is  
    1443 approximated by depth, see \autoref{subsec:TRA_eos} ) :  
     1444The computation of horizontal derivative of tracers as well as of density is performed once for all at 
     1445each time step in \mdl{zpshde} module and stored in shared arrays to be used when needed. 
     1446It has to be emphasized that the procedure used to compute the interpolated density, $\widetilde{\rho}$, 
     1447is not the same as that used for $T$ and $S$. 
     1448Instead of forming a linear approximation of density, we compute $\widetilde{\rho }$ from the interpolated values of 
     1449$T$ and $S$, and the pressure at a $u$-point 
     1450(in the equation of state pressure is approximated by depth, see \autoref{subsec:TRA_eos} ):  
    14441451\begin{equation} \label{eq:zps_hde_rho} 
    14451452\widetilde{\rho } = \rho ( {\widetilde{T},\widetilde {S},z_u })  
     
    14471454\end{equation}  
    14481455 
    1449 This is a much better approximation as the variation of $\rho$ with depth (and  
    1450 thus pressure) is highly non-linear with a true equation of state and thus is badly  
    1451 approximated with a linear interpolation. This approximation is used to compute  
    1452 both the horizontal pressure gradient (\autoref{sec:DYN_hpg}) and the slopes of neutral  
    1453 surfaces (\autoref{sec:LDF_slp}) 
    1454  
    1455 Note that in almost all the advection schemes presented in this Chapter, both  
    1456 averaging and differencing operators appear. Yet \autoref{eq:zps_hde} has not  
    1457 been used in these schemes: in contrast to diffusion and pressure gradient  
    1458 computations, no correction for partial steps is applied for advection. The main  
    1459 motivation is to preserve the domain averaged mean variance of the advected  
    1460 field when using the $2^{nd}$ order centred scheme. Sensitivity of the advection  
    1461 schemes to the way horizontal averages are performed in the vicinity of partial  
    1462 cells should be further investigated in the near future. 
     1456This is a much better approximation as the variation of $\rho$ with depth (and thus pressure) 
     1457is highly non-linear with a true equation of state and thus is badly approximated with a linear interpolation. 
     1458This approximation is used to compute both the horizontal pressure gradient (\autoref{sec:DYN_hpg}) and 
     1459the slopes of neutral surfaces (\autoref{sec:LDF_slp}). 
     1460 
     1461Note that in almost all the advection schemes presented in this Chapter, 
     1462both averaging and differencing operators appear. 
     1463Yet \autoref{eq:zps_hde} has not been used in these schemes: 
     1464in contrast to diffusion and pressure gradient computations, 
     1465no correction for partial steps is applied for advection. 
     1466The main motivation is to preserve the domain averaged mean variance of the advected field when 
     1467using the $2^{nd}$ order centred scheme. 
     1468Sensitivity of the advection schemes to the way horizontal averages are performed in the vicinity of 
     1469partial cells should be further investigated in the near future. 
    14631470%%% 
    14641471\gmcomment{gm :   this last remark has to be done} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_ZDF.tex

    r10146 r10368  
    2121\label{sec:ZDF_zdf} 
    2222 
    23 The discrete form of the ocean subgrid scale physics has been presented in  
    24 \autoref{sec:TRA_zdf} and \autoref{sec:DYN_zdf}. At the surface and bottom boundaries,  
    25 the turbulent fluxes of momentum, heat and salt have to be defined. At the  
    26 surface they are prescribed from the surface forcing (see \autoref{chap:SBC}),  
    27 while at the bottom they are set to zero for heat and salt, unless a geothermal  
    28 flux forcing is prescribed as a bottom boundary condition ($i.e.$ \key{trabbl}  
    29 defined, see \autoref{subsec:TRA_bbc}), and specified through a bottom friction  
    30 parameterisation for momentum (see \autoref{sec:ZDF_bfr}). 
    31  
    32 In this section we briefly discuss the various choices offered to compute  
    33 the vertical eddy viscosity and diffusivity coefficients, $A_u^{vm}$ ,  
    34 $A_v^{vm}$ and $A^{vT}$ ($A^{vS}$), defined at $uw$-, $vw$- and $w$-  
    35 points, respectively (see \autoref{sec:TRA_zdf} and \autoref{sec:DYN_zdf}). These  
    36 coefficients can be assumed to be either constant, or a function of the local  
    37 Richardson number, or computed from a turbulent closure model (either  
    38 TKE or GLS formulation). The computation of these coefficients is initialized  
    39 in the \mdl{zdfini} module and performed in the \mdl{zdfric}, \mdl{zdftke} or  
    40 \mdl{zdfgls} modules. The trends due to the vertical momentum and tracer  
    41 diffusion, including the surface forcing, are computed and added to the  
    42 general trend in the \mdl{dynzdf} and \mdl{trazdf} modules, respectively.  
    43 These trends can be computed using either a forward time stepping scheme  
    44 (namelist parameter \np{ln\_zdfexp}\forcode{ = .true.}) or a backward time stepping  
    45 scheme (\np{ln\_zdfexp}\forcode{ = .false.}) depending on the magnitude of the mixing  
    46 coefficients, and thus of the formulation used (see \autoref{chap:STP}). 
     23The discrete form of the ocean subgrid scale physics has been presented in 
     24\autoref{sec:TRA_zdf} and \autoref{sec:DYN_zdf}. 
     25At the surface and bottom boundaries, the turbulent fluxes of momentum, heat and salt have to be defined. 
     26At the surface they are prescribed from the surface forcing (see \autoref{chap:SBC}), 
     27while at the bottom they are set to zero for heat and salt, 
     28unless a geothermal flux forcing is prescribed as a bottom boundary condition ($i.e.$ \key{trabbl} defined, 
     29see \autoref{subsec:TRA_bbc}), and specified through a bottom friction parameterisation for momentum 
     30(see \autoref{sec:ZDF_bfr}). 
     31 
     32In this section we briefly discuss the various choices offered to compute the vertical eddy viscosity and 
     33diffusivity coefficients, $A_u^{vm}$ , $A_v^{vm}$ and $A^{vT}$ ($A^{vS}$), defined at $uw$-, $vw$- and $w$- points, 
     34respectively (see \autoref{sec:TRA_zdf} and \autoref{sec:DYN_zdf}). 
     35These coefficients can be assumed to be either constant, or a function of the local Richardson number, 
     36or computed from a turbulent closure model (either TKE or GLS formulation). 
     37The computation of these coefficients is initialized in the \mdl{zdfini} module and performed in 
     38the \mdl{zdfric}, \mdl{zdftke} or \mdl{zdfgls} modules. 
     39The trends due to the vertical momentum and tracer diffusion, including the surface forcing, 
     40are computed and added to the general trend in the \mdl{dynzdf} and \mdl{trazdf} modules, respectively.  
     41These trends can be computed using either a forward time stepping scheme 
     42(namelist parameter \np{ln\_zdfexp}\forcode{ = .true.}) or a backward time stepping scheme 
     43(\np{ln\_zdfexp}\forcode{ = .false.}) depending on the magnitude of the mixing coefficients, 
     44and thus of the formulation used (see \autoref{chap:STP}). 
    4745 
    4846% ------------------------------------------------------------------------------------------------------------- 
     
    5654%-------------------------------------------------------------------------------------------------------------- 
    5755 
    58 Options are defined through the  \ngn{namzdf} namelist variables. 
    59 When \key{zdfcst} is defined, the momentum and tracer vertical eddy coefficients  
    60 are set to constant values over the whole ocean. This is the crudest way to define  
    61 the vertical ocean physics. It is recommended that this option is only used in  
    62 process studies, not in basin scale simulations. Typical values used in this case are: 
     56Options are defined through the \ngn{namzdf} namelist variables. 
     57When \key{zdfcst} is defined, the momentum and tracer vertical eddy coefficients are set to 
     58constant values over the whole ocean. 
     59This is the crudest way to define the vertical ocean physics. 
     60It is recommended that this option is only used in process studies, not in basin scale simulations. 
     61Typical values used in this case are: 
    6362\begin{align*}  
    6463A_u^{vm} = A_v^{vm} &= 1.2\ 10^{-4}~m^2.s^{-1}  \\ 
     
    6766 
    6867These values are set through the \np{rn\_avm0} and \np{rn\_avt0} namelist parameters.  
    69 In all cases, do not use values smaller that those associated with the molecular  
    70 viscosity and diffusivity, that is $\sim10^{-6}~m^2.s^{-1}$ for momentum,  
    71 $\sim10^{-7}~m^2.s^{-1}$ for temperature and $\sim10^{-9}~m^2.s^{-1}$ for salinity. 
     68In all cases, do not use values smaller that those associated with the molecular viscosity and diffusivity, 
     69that is $\sim10^{-6}~m^2.s^{-1}$ for momentum, $\sim10^{-7}~m^2.s^{-1}$ for temperature and 
     70$\sim10^{-9}~m^2.s^{-1}$ for salinity. 
    7271 
    7372 
     
    8382%-------------------------------------------------------------------------------------------------------------- 
    8483 
    85 When \key{zdfric} is defined, a local Richardson number dependent formulation  
    86 for the vertical momentum and tracer eddy coefficients is set through the  \ngn{namzdf\_ric}  
    87 namelist variables.The vertical mixing  
    88 coefficients are diagnosed from the large scale variables computed by the model.  
    89 \textit{In situ} measurements have been used to link vertical turbulent activity to  
    90 large scale ocean structures. The hypothesis of a mixing mainly maintained by the  
    91 growth of Kelvin-Helmholtz like instabilities leads to a dependency between the  
    92 vertical eddy coefficients and the local Richardson number ($i.e.$ the  
    93 ratio of stratification to vertical shear). Following \citet{Pacanowski_Philander_JPO81}, the following  
    94 formulation has been implemented: 
     84When \key{zdfric} is defined, a local Richardson number dependent formulation for the vertical momentum and 
     85tracer eddy coefficients is set through the \ngn{namzdf\_ric} namelist variables. 
     86The vertical mixing coefficients are diagnosed from the large scale variables computed by the model.  
     87\textit{In situ} measurements have been used to link vertical turbulent activity to large scale ocean structures. 
     88The hypothesis of a mixing mainly maintained by the growth of Kelvin-Helmholtz like instabilities leads to 
     89a dependency between the vertical eddy coefficients and the local Richardson number 
     90($i.e.$ the ratio of stratification to vertical shear). 
     91Following \citet{Pacanowski_Philander_JPO81}, the following formulation has been implemented: 
    9592\begin{equation} \label{eq:zdfric} 
    9693   \left\{      \begin{aligned} 
     
    9996   \end{aligned}    \right. 
    10097\end{equation} 
    101 where $Ri = N^2 / \left(\partial_z \textbf{U}_h \right)^2$ is the local Richardson  
    102 number, $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}),  
    103 $A_b^{vT} $ and $A_b^{vm}$ are the constant background values set as in the  
    104 constant case (see \autoref{subsec:ZDF_cst}), and $A_{ric}^{vT} = 10^{-4}~m^2.s^{-1}$  
    105 is the maximum value that can be reached by the coefficient when $Ri\leq 0$,  
    106 $a=5$ and $n=2$. The last three values can be modified by setting the  
    107 \np{rn\_avmri}, \np{rn\_alp} and \np{nn\_ric} namelist parameters, respectively. 
    108  
    109 A simple mixing-layer model to transfer and dissipate the atmospheric 
    110  forcings (wind-stress and buoyancy fluxes) can be activated setting  
    111 the \np{ln\_mldw}\forcode{ = .true.} in the namelist. 
    112  
    113 In this case, the local depth of turbulent wind-mixing or "Ekman depth" 
    114  $h_{e}(x,y,t)$ is evaluated and the vertical eddy coefficients prescribed within this layer. 
     98where $Ri = N^2 / \left(\partial_z \textbf{U}_h \right)^2$ is the local Richardson number, 
     99$N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}),  
     100$A_b^{vT} $ and $A_b^{vm}$ are the constant background values set as in the constant case 
     101(see \autoref{subsec:ZDF_cst}), and $A_{ric}^{vT} = 10^{-4}~m^2.s^{-1}$ is the maximum value that 
     102can be reached by the coefficient when $Ri\leq 0$, $a=5$ and $n=2$. 
     103The last three values can be modified by setting the \np{rn\_avmri}, \np{rn\_alp} and 
     104\np{nn\_ric} namelist parameters, respectively. 
     105 
     106A simple mixing-layer model to transfer and dissipate the atmospheric forcings 
     107(wind-stress and buoyancy fluxes) can be activated setting the \np{ln\_mldw}\forcode{ = .true.} in the namelist. 
     108 
     109In this case, the local depth of turbulent wind-mixing or "Ekman depth" $h_{e}(x,y,t)$ is evaluated and 
     110the vertical eddy coefficients prescribed within this layer. 
    115111 
    116112This depth is assumed proportional to the "depth of frictional influence" that is limited by rotation: 
    117113\begin{equation} 
    118          h_{e} = Ek \frac {u^{*}} {f_{0}}    \\ 
    119 \end{equation} 
    120 where, $Ek$ is an empirical parameter, $u^{*}$ is the friction velocity and $f_{0}$ is the Coriolis  
    121 parameter. 
     114h_{e} = Ek \frac {u^{*}} {f_{0}} 
     115\end{equation} 
     116where, $Ek$ is an empirical parameter, $u^{*}$ is the friction velocity and $f_{0}$ is the Coriolis parameter. 
    122117 
    123118In this similarity height relationship, the turbulent friction velocity: 
    124119\begin{equation} 
    125          u^{*} = \sqrt \frac {|\tau|} {\rho_o}     \\ 
    126 \end{equation} 
    127  
     120u^{*} = \sqrt \frac {|\tau|} {\rho_o} 
     121\end{equation} 
    128122is computed from the wind stress vector $|\tau|$ and the reference density $ \rho_o$. 
    129123The final $h_{e}$ is further constrained by the adjustable bounds \np{rn\_mldmin} and \np{rn\_mldmax}. 
    130 Once $h_{e}$ is computed, the vertical eddy coefficients within $h_{e}$ are set to  
     124Once $h_{e}$ is computed, the vertical eddy coefficients within $h_{e}$ are set to 
    131125the empirical values \np{rn\_wtmix} and \np{rn\_wvmix} \citep{Lermusiaux2001}. 
    132126 
     
    142136%-------------------------------------------------------------------------------------------------------------- 
    143137 
    144 The vertical eddy viscosity and diffusivity coefficients are computed from a TKE  
    145 turbulent closure model based on a prognostic equation for $\bar{e}$, the turbulent  
    146 kinetic energy, and a closure assumption for the turbulent length scales. This  
    147 turbulent closure model has been developed by \citet{Bougeault1989} in the  
    148 atmospheric case, adapted by \citet{Gaspar1990} for the oceanic case, and  
    149 embedded in OPA, the ancestor of NEMO, by \citet{Blanke1993} for equatorial Atlantic  
    150 simulations. Since then, significant modifications have been introduced by  
    151 \citet{Madec1998} in both the implementation and the formulation of the mixing  
    152 length scale. The time evolution of $\bar{e}$ is the result of the production of  
    153 $\bar{e}$ through vertical shear, its destruction through stratification, its vertical  
    154 diffusion, and its dissipation of \citet{Kolmogorov1942} type: 
     138The vertical eddy viscosity and diffusivity coefficients are computed from a TKE turbulent closure model based on 
     139a prognostic equation for $\bar{e}$, the turbulent kinetic energy, 
     140and a closure assumption for the turbulent length scales. 
     141This turbulent closure model has been developed by \citet{Bougeault1989} in the atmospheric case, 
     142adapted by \citet{Gaspar1990} for the oceanic case, and embedded in OPA, the ancestor of NEMO, 
     143by \citet{Blanke1993} for equatorial Atlantic simulations. 
     144Since then, significant modifications have been introduced by \citet{Madec1998} in both the implementation and 
     145the formulation of the mixing length scale. 
     146The time evolution of $\bar{e}$ is the result of the production of $\bar{e}$ through vertical shear, 
     147its destruction through stratification, its vertical diffusion, and its dissipation of \citet{Kolmogorov1942} type: 
    155148\begin{equation} \label{eq:zdftke_e} 
    156149\frac{\partial \bar{e}}{\partial t} =  
     
    170163where $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}),  
    171164$l_{\epsilon }$ and $l_{\kappa }$ are the dissipation and mixing length scales,  
    172 $P_{rt}$ is the Prandtl number, $K_m$ and $K_\rho$ are the vertical eddy viscosity  
    173 and diffusivity coefficients. The constants $C_k =  0.1$ and $C_\epsilon = \sqrt {2} /2$   
    174 $\approx 0.7$ are designed to deal with vertical mixing at any depth \citep{Gaspar1990}.  
    175 They are set through namelist parameters \np{nn\_ediff} and \np{nn\_ediss}.  
    176 $P_{rt}$ can be set to unity or, following \citet{Blanke1993}, be a function  
    177 of the local Richardson number, $R_i$: 
     165$P_{rt}$ is the Prandtl number, $K_m$ and $K_\rho$ are the vertical eddy viscosity and diffusivity coefficients. 
     166The constants $C_k =  0.1$ and $C_\epsilon = \sqrt {2} /2$ $\approx 0.7$ are designed to deal with 
     167vertical mixing at any depth \citep{Gaspar1990}.  
     168They are set through namelist parameters \np{nn\_ediff} and \np{nn\_ediss}. 
     169$P_{rt}$ can be set to unity or, following \citet{Blanke1993}, be a function of the local Richardson number, $R_i$: 
    178170\begin{align*} \label{eq:prt} 
    179171P_{rt} = \begin{cases} 
     
    186178The choice of $P_{rt}$ is controlled by the \np{nn\_pdl} namelist variable. 
    187179 
    188 At the sea surface, the value of $\bar{e}$ is prescribed from the wind  
    189 stress field as $\bar{e}_o = e_{bb} |\tau| / \rho_o$, with $e_{bb}$ the \np{rn\_ebb}  
    190 namelist parameter. The default value of $e_{bb}$ is 3.75. \citep{Gaspar1990}),  
    191 however a much larger value can be used when taking into account the  
    192 surface wave breaking (see below Eq. \autoref{eq:ZDF_Esbc}).  
    193 The bottom value of TKE is assumed to be equal to the value of the level just above.  
    194 The time integration of the $\bar{e}$ equation may formally lead to negative values  
    195 because the numerical scheme does not ensure its positivity. To overcome this  
    196 problem, a cut-off in the minimum value of $\bar{e}$ is used (\np{rn\_emin}  
    197 namelist parameter). Following \citet{Gaspar1990}, the cut-off value is set  
    198 to $\sqrt{2}/2~10^{-6}~m^2.s^{-2}$. This allows the subsequent formulations  
    199 to match that of \citet{Gargett1984} for the diffusion in the thermocline and  
    200 deep ocean :  $K_\rho = 10^{-3} / N$.  
    201 In addition, a cut-off is applied on $K_m$ and $K_\rho$ to avoid numerical  
    202 instabilities associated with too weak vertical diffusion. They must be  
    203 specified at least larger than the molecular values, and are set through  
    204 \np{rn\_avm0} and \np{rn\_avt0} (namzdf namelist, see \autoref{subsec:ZDF_cst}). 
     180At the sea surface, the value of $\bar{e}$ is prescribed from the wind stress field as 
     181$\bar{e}_o = e_{bb} |\tau| / \rho_o$, with $e_{bb}$ the \np{rn\_ebb} namelist parameter. 
     182The default value of $e_{bb}$ is 3.75. \citep{Gaspar1990}), however a much larger value can be used when 
     183taking into account the surface wave breaking (see below Eq. \autoref{eq:ZDF_Esbc}). 
     184The bottom value of TKE is assumed to be equal to the value of the level just above. 
     185The time integration of the $\bar{e}$ equation may formally lead to negative values because 
     186the numerical scheme does not ensure its positivity. 
     187To overcome this problem, a cut-off in the minimum value of $\bar{e}$ is used (\np{rn\_emin} namelist parameter). 
     188Following \citet{Gaspar1990}, the cut-off value is set to $\sqrt{2}/2~10^{-6}~m^2.s^{-2}$. 
     189This allows the subsequent formulations to match that of \citet{Gargett1984} for the diffusion in 
     190the thermocline and deep ocean :  $K_\rho = 10^{-3} / N$. 
     191In addition, a cut-off is applied on $K_m$ and $K_\rho$ to avoid numerical instabilities associated with 
     192too weak vertical diffusion. 
     193They must be specified at least larger than the molecular values, and are set through \np{rn\_avm0} and 
     194\np{rn\_avt0} (namzdf namelist, see \autoref{subsec:ZDF_cst}). 
    205195 
    206196\subsubsection{Turbulent length scale} 
    207 For computational efficiency, the original formulation of the turbulent length  
    208 scales proposed by \citet{Gaspar1990} has been simplified. Four formulations  
    209 are proposed, the choice of which is controlled by the \np{nn\_mxl} namelist  
    210 parameter. The first two are based on the following first order approximation  
    211 \citep{Blanke1993}: 
     197For computational efficiency, the original formulation of the turbulent length scales proposed by 
     198\citet{Gaspar1990} has been simplified. 
     199Four formulations are proposed, the choice of which is controlled by the \np{nn\_mxl} namelist parameter. 
     200The first two are based on the following first order approximation \citep{Blanke1993}: 
    212201\begin{equation} \label{eq:tke_mxl0_1} 
    213202l_k = l_\epsilon = \sqrt {2 \bar{e}\; } / N 
    214203\end{equation} 
    215 which is valid in a stable stratified region with constant values of the Brunt- 
    216 Vais\"{a}l\"{a} frequency. The resulting length scale is bounded by the distance  
    217 to the surface or to the bottom (\np{nn\_mxl}\forcode{ = 0}) or by the local vertical scale factor  
    218 (\np{nn\_mxl}\forcode{ = 1}). \citet{Blanke1993} notice that this simplification has two major  
    219 drawbacks: it makes no sense for locally unstable stratification and the  
    220 computation no longer uses all the information contained in the vertical density  
    221 profile. To overcome these drawbacks, \citet{Madec1998} introduces the  
    222 \np{nn\_mxl}\forcode{ = 2..3} cases, which add an extra assumption concerning the vertical  
    223 gradient of the computed length scale. So, the length scales are first evaluated  
    224 as in \autoref{eq:tke_mxl0_1} and then bounded such that: 
     204which is valid in a stable stratified region with constant values of the Brunt-Vais\"{a}l\"{a} frequency. 
     205The resulting length scale is bounded by the distance to the surface or to the bottom 
     206(\np{nn\_mxl}\forcode{ = 0}) or by the local vertical scale factor (\np{nn\_mxl}\forcode{ = 1}). 
     207\citet{Blanke1993} notice that this simplification has two major drawbacks: 
     208it makes no sense for locally unstable stratification and the computation no longer uses all 
     209the information contained in the vertical density profile. 
     210To overcome these drawbacks, \citet{Madec1998} introduces the \np{nn\_mxl}\forcode{ = 2..3} cases, 
     211which add an extra assumption concerning the vertical gradient of the computed length scale. 
     212So, the length scales are first evaluated as in \autoref{eq:tke_mxl0_1} and then bounded such that: 
    225213\begin{equation} \label{eq:tke_mxl_constraint} 
    226214\frac{1}{e_3 }\left| {\frac{\partial l}{\partial k}} \right| \leq 1 
    227215\qquad \text{with }\  l =  l_k = l_\epsilon 
    228216\end{equation} 
    229 \autoref{eq:tke_mxl_constraint} means that the vertical variations of the length  
    230 scale cannot be larger than the variations of depth. It provides a better  
    231 approximation of the \citet{Gaspar1990} formulation while being much less  
    232 time consuming. In particular, it allows the length scale to be limited not only  
    233 by the distance to the surface or to the ocean bottom but also by the distance  
    234 to a strongly stratified portion of the water column such as the thermocline  
    235 (\autoref{fig:mixing_length}). In order to impose the \autoref{eq:tke_mxl_constraint}  
    236 constraint, we introduce two additional length scales: $l_{up}$ and $l_{dwn}$,  
    237 the upward and downward length scales, and evaluate the dissipation and  
    238 mixing length scales as (and note that here we use numerical indexing): 
     217\autoref{eq:tke_mxl_constraint} means that the vertical variations of the length scale cannot be larger than 
     218the variations of depth. 
     219It provides a better approximation of the \citet{Gaspar1990} formulation while being much less  
     220time consuming. 
     221In particular, it allows the length scale to be limited not only by the distance to the surface or 
     222to the ocean bottom but also by the distance to a strongly stratified portion of the water column such as 
     223the thermocline (\autoref{fig:mixing_length}). 
     224In order to impose the \autoref{eq:tke_mxl_constraint} constraint, we introduce two additional length scales: 
     225$l_{up}$ and $l_{dwn}$, the upward and downward length scales, and 
     226evaluate the dissipation and mixing length scales as 
     227(and note that here we use numerical indexing): 
    239228%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    240229\begin{figure}[!t] \begin{center} 
     
    253242\end{aligned} 
    254243\end{equation} 
    255 where $l^{(k)}$ is computed using \autoref{eq:tke_mxl0_1},  
    256 $i.e.$ $l^{(k)} = \sqrt {2 {\bar e}^{(k)} / {N^2}^{(k)} }$. 
    257  
    258 In the \np{nn\_mxl}\forcode{ = 2} case, the dissipation and mixing length scales take the same  
    259 value: $ l_k=  l_\epsilon = \min \left(\ l_{up} \;,\;  l_{dwn}\ \right)$, while in the  
    260 \np{nn\_mxl}\forcode{ = 3} case, the dissipation and mixing turbulent length scales are give  
    261 as in \citet{Gaspar1990}: 
     244where $l^{(k)}$ is computed using \autoref{eq:tke_mxl0_1}, $i.e.$ $l^{(k)} = \sqrt {2 {\bar e}^{(k)} / {N^2}^{(k)} }$. 
     245 
     246In the \np{nn\_mxl}\forcode{ = 2} case, the dissipation and mixing length scales take the same value: 
     247$ l_k=  l_\epsilon = \min \left(\ l_{up} \;,\;  l_{dwn}\ \right)$, while in the \np{nn\_mxl}\forcode{ = 3} case, 
     248the dissipation and mixing turbulent length scales are give as in \citet{Gaspar1990}: 
    262249\begin{equation} \label{eq:tke_mxl_gaspar} 
    263250\begin{aligned} 
     
    267254\end{equation} 
    268255 
    269 At the ocean surface, a non zero length scale is set through the  \np{rn\_mxl0} namelist  
    270 parameter. Usually the surface scale is given by $l_o = \kappa \,z_o$  
    271 where $\kappa = 0.4$ is von Karman's constant and $z_o$ the roughness  
    272 parameter of the surface. Assuming $z_o=0.1$~m \citep{Craig_Banner_JPO94}  
    273 leads to a 0.04~m, the default value of \np{rn\_mxl0}. In the ocean interior  
    274 a minimum length scale is set to recover the molecular viscosity when $\bar{e}$  
    275 reach its minimum value ($1.10^{-6}= C_k\, l_{min} \,\sqrt{\bar{e}_{min}}$ ). 
     256At the ocean surface, a non zero length scale is set through the  \np{rn\_mxl0} namelist parameter. 
     257Usually the surface scale is given by $l_o = \kappa \,z_o$ where $\kappa = 0.4$ is von Karman's constant and 
     258$z_o$ the roughness parameter of the surface. 
     259Assuming $z_o=0.1$~m \citep{Craig_Banner_JPO94} leads to a 0.04~m, the default value of \np{rn\_mxl0}. 
     260In the ocean interior a minimum length scale is set to recover the molecular viscosity when 
     261$\bar{e}$ reach its minimum value ($1.10^{-6}= C_k\, l_{min} \,\sqrt{\bar{e}_{min}}$ ). 
    276262 
    277263 
    278264\subsubsection{Surface wave breaking parameterization} 
    279265%-----------------------------------------------------------------------% 
    280 Following \citet{Mellor_Blumberg_JPO04}, the TKE turbulence closure model has been modified  
    281 to include the effect of surface wave breaking energetics. This results in a reduction of summertime  
    282 surface temperature when the mixed layer is relatively shallow. The \citet{Mellor_Blumberg_JPO04}  
    283 modifications acts on surface length scale and TKE values and air-sea drag coefficient.  
     266Following \citet{Mellor_Blumberg_JPO04}, the TKE turbulence closure model has been modified to 
     267include the effect of surface wave breaking energetics. 
     268This results in a reduction of summertime surface temperature when the mixed layer is relatively shallow. 
     269The \citet{Mellor_Blumberg_JPO04} modifications acts on surface length scale and TKE values and 
     270air-sea drag coefficient.  
    284271The latter concerns the bulk formulea and is not discussed here.  
    285272 
     
    288275\bar{e}_o = \frac{1}{2}\,\left(  15.8\,\alpha_{CB} \right)^{2/3} \,\frac{|\tau|}{\rho_o} 
    289276\end{equation} 
    290 where $\alpha_{CB}$ is the \citet{Craig_Banner_JPO94} constant of proportionality  
    291 which depends on the ''wave age'', ranging from 57 for mature waves to 146 for  
    292 younger waves \citep{Mellor_Blumberg_JPO04}.  
     277where $\alpha_{CB}$ is the \citet{Craig_Banner_JPO94} constant of proportionality which depends on the ''wave age'', 
     278ranging from 57 for mature waves to 146 for younger waves \citep{Mellor_Blumberg_JPO04}.  
    293279The boundary condition on the turbulent length scale follows the Charnock's relation: 
    294280\begin{equation} \label{eq:ZDF_Lsbc} 
     
    296282\end{equation} 
    297283where $\kappa=0.40$ is the von Karman constant, and $\beta$ is the Charnock's constant. 
    298 \citet{Mellor_Blumberg_JPO04} suggest $\beta = 2.10^{5}$ the value chosen by \citet{Stacey_JPO99} 
    299 citing observation evidence, and $\alpha_{CB} = 100$ the Craig and Banner's value. 
    300 As the surface boundary condition on TKE is prescribed through $\bar{e}_o = e_{bb} |\tau| / \rho_o$,  
     284\citet{Mellor_Blumberg_JPO04} suggest $\beta = 2.10^{5}$ the value chosen by 
     285\citet{Stacey_JPO99} citing observation evidence, and 
     286$\alpha_{CB} = 100$ the Craig and Banner's value. 
     287As the surface boundary condition on TKE is prescribed through $\bar{e}_o = e_{bb} |\tau| / \rho_o$, 
    301288with $e_{bb}$ the \np{rn\_ebb} namelist parameter, setting \np{rn\_ebb}\forcode{ = 67.83} corresponds  
    302 to $\alpha_{CB} = 100$. Further setting  \np{ln\_mxl0} to true applies \autoref{eq:ZDF_Lsbc}  
    303 as surface boundary condition on length scale, with $\beta$ hard coded to the Stacey's value. 
    304 Note that a minimal threshold of \np{rn\_emin0}$=10^{-4}~m^2.s^{-2}$ (namelist parameters)  
    305 is applied on surface $\bar{e}$ value. 
     289to $\alpha_{CB} = 100$. 
     290Further setting  \np{ln\_mxl0} to true applies \autoref{eq:ZDF_Lsbc} as surface boundary condition on length scale, 
     291with $\beta$ hard coded to the Stacey's value. 
     292Note that a minimal threshold of \np{rn\_emin0}$=10^{-4}~m^2.s^{-2}$ (namelist parameters) is applied on 
     293surface $\bar{e}$ value. 
    306294 
    307295 
    308296\subsubsection{Langmuir cells} 
    309297%--------------------------------------% 
    310 Langmuir circulations (LC) can be described as ordered large-scale vertical motions  
    311 in the surface layer of the oceans. Although LC have nothing to do with convection,  
    312 the circulation pattern is rather similar to so-called convective rolls in the atmospheric  
    313 boundary layer. The detailed physics behind LC is described in, for example,  
    314 \citet{Craik_Leibovich_JFM76}. The prevailing explanation is that LC arise from  
    315 a nonlinear interaction between the Stokes drift and wind drift currents.  
    316  
    317 Here we introduced in the TKE turbulent closure the simple parameterization of  
    318 Langmuir circulations proposed by \citep{Axell_JGR02} for a $k-\epsilon$ turbulent closure.  
    319 The parameterization, tuned against large-eddy simulation, includes the whole effect 
    320 of LC in an extra source terms of TKE, $P_{LC}$. 
    321 The presence of $P_{LC}$ in \autoref{eq:zdftke_e}, the TKE equation, is controlled  
    322 by setting \np{ln\_lc} to \forcode{.true.} in the namtke namelist. 
     298Langmuir circulations (LC) can be described as ordered large-scale vertical motions in 
     299the surface layer of the oceans. 
     300Although LC have nothing to do with convection, the circulation pattern is rather similar to 
     301so-called convective rolls in the atmospheric boundary layer. 
     302The detailed physics behind LC is described in, for example, \citet{Craik_Leibovich_JFM76}. 
     303The prevailing explanation is that LC arise from a nonlinear interaction between the Stokes drift and 
     304wind drift currents.  
     305 
     306Here we introduced in the TKE turbulent closure the simple parameterization of Langmuir circulations proposed by 
     307\citep{Axell_JGR02} for a $k-\epsilon$ turbulent closure. 
     308The parameterization, tuned against large-eddy simulation, includes the whole effect of LC in 
     309an extra source terms of TKE, $P_{LC}$. 
     310The presence of $P_{LC}$ in \autoref{eq:zdftke_e}, the TKE equation, is controlled by setting \np{ln\_lc} to 
     311\forcode{.true.} in the namtke namelist. 
    323312  
    324 By making an analogy with the characteristic convective velocity scale  
    325 ($e.g.$, \citet{D'Alessio_al_JPO98}), $P_{LC}$ is assumed to be :  
     313By making an analogy with the characteristic convective velocity scale ($e.g.$, \citet{D'Alessio_al_JPO98}), 
     314$P_{LC}$ is assumed to be :  
    326315\begin{equation} 
    327316P_{LC}(z) = \frac{w_{LC}^3(z)}{H_{LC}} 
     
    330319With no information about the wave field, $w_{LC}$ is assumed to be proportional to  
    331320the Stokes drift $u_s = 0.377\,\,|\tau|^{1/2}$, where $|\tau|$ is the surface wind stress module  
    332 \footnote{Following \citet{Li_Garrett_JMR93}, the surface Stoke drift velocity 
    333 may be expressed as $u_s =  0.016 \,|U_{10m}|$. Assuming an air density of  
    334 $\rho_a=1.22 \,Kg/m^3$ and a drag coefficient of $1.5~10^{-3}$ give the expression  
    335 used of $u_s$ as a function of the module of surface stress}.  
    336 For the vertical variation, $w_{LC}$ is assumed to be zero at the surface as well as  
    337 at a finite depth $H_{LC}$ (which is often close to the mixed layer depth), and simply  
    338 varies as a sine function in between (a first-order profile for the Langmuir cell structures).  
     321\footnote{Following \citet{Li_Garrett_JMR93}, the surface Stoke drift velocity may be expressed as 
     322  $u_s =  0.016 \,|U_{10m}|$. 
     323  Assuming an air density of $\rho_a=1.22 \,Kg/m^3$ and a drag coefficient of 
     324  $1.5~10^{-3}$ give the expression used of $u_s$ as a function of the module of surface stress}. 
     325For the vertical variation, $w_{LC}$ is assumed to be zero at the surface as well as at 
     326a finite depth $H_{LC}$ (which is often close to the mixed layer depth), 
     327and simply varies as a sine function in between (a first-order profile for the Langmuir cell structures).  
    339328The resulting expression for $w_{LC}$ is : 
    340329\begin{equation} 
     
    344333                 \end{cases} 
    345334\end{equation} 
    346 where $c_{LC} = 0.15$ has been chosen by \citep{Axell_JGR02} as a good compromise  
    347 to fit LES data. The chosen value yields maximum vertical velocities $w_{LC}$ of the order  
    348 of a few centimeters per second. The value of $c_{LC}$ is set through the \np{rn\_lc}  
    349 namelist parameter, having in mind that it should stay between 0.15 and 0.54 \citep{Axell_JGR02}.  
     335where $c_{LC} = 0.15$ has been chosen by \citep{Axell_JGR02} as a good compromise to fit LES data. 
     336The chosen value yields maximum vertical velocities $w_{LC}$ of the order of a few centimeters per second. 
     337The value of $c_{LC}$ is set through the \np{rn\_lc} namelist parameter, 
     338having in mind that it should stay between 0.15 and 0.54 \citep{Axell_JGR02}.  
    350339 
    351340The $H_{LC}$ is estimated in a similar way as the turbulent length scale of TKE equations: 
    352 $H_{LC}$ is depth to which a water parcel with kinetic energy due to Stoke drift 
    353 can reach on its own by converting its kinetic energy to potential energy, according to  
     341$H_{LC}$ is depth to which a water parcel with kinetic energy due to Stoke drift can reach on its own by 
     342converting its kinetic energy to potential energy, according to  
    354343\begin{equation} 
    355344- \int_{-H_{LC}}^0 { N^2\;z  \;dz} = \frac{1}{2} u_s^2 
     
    360349%--------------------------------------------------------------% 
    361350 
    362 Vertical mixing parameterizations commonly used in ocean general circulation models  
    363 tend to produce mixed-layer depths that are too shallow during summer months and windy conditions. 
    364 This bias is particularly acute over the Southern Ocean.  
    365 To overcome this systematic bias, an ad hoc parameterization is introduced into the TKE scheme  \cite{Rodgers_2014}.  
    366 The parameterization is an empirical one, $i.e.$ not derived from theoretical considerations,  
     351Vertical mixing parameterizations commonly used in ocean general circulation models tend to 
     352produce mixed-layer depths that are too shallow during summer months and windy conditions. 
     353This bias is particularly acute over the Southern Ocean. 
     354To overcome this systematic bias, an ad hoc parameterization is introduced into the TKE scheme \cite{Rodgers_2014}.  
     355The parameterization is an empirical one, $i.e.$ not derived from theoretical considerations, 
    367356but rather is meant to account for observed processes that affect the density structure of  
    368357the ocean’s planetary boundary layer that are not explicitly captured by default in the TKE scheme  
    369358($i.e.$ near-inertial oscillations and ocean swells and waves). 
    370359 
    371 When using this parameterization ($i.e.$ when \np{nn\_etau}\forcode{ = 1}), the TKE input to the ocean ($S$)  
    372 imposed by the winds in the form of near-inertial oscillations, swell and waves is parameterized  
    373 by \autoref{eq:ZDF_Esbc} the standard TKE surface boundary condition, plus a depth depend one given by: 
     360When using this parameterization ($i.e.$ when \np{nn\_etau}\forcode{ = 1}), 
     361the TKE input to the ocean ($S$) imposed by the winds in the form of near-inertial oscillations, 
     362swell and waves is parameterized by \autoref{eq:ZDF_Esbc} the standard TKE surface boundary condition, 
     363plus a depth depend one given by: 
    374364\begin{equation}  \label{eq:ZDF_Ehtau} 
    375365S = (1-f_i) \; f_r \; e_s \; e^{-z / h_\tau}  
    376366\end{equation} 
    377 where  
    378 $z$ is the depth,   
    379 $e_s$ is TKE surface boundary condition,  
    380 $f_r$ is the fraction of the surface TKE that penetrate in the ocean,  
    381 $h_\tau$ is a vertical mixing length scale that controls exponential shape of the penetration,  
    382 and $f_i$ is the ice concentration (no penetration if $f_i=1$, that is if the ocean is entirely  
    383 covered by sea-ice). 
    384 The value of $f_r$, usually a few percents, is specified through \np{rn\_efr} namelist parameter.  
    385 The vertical mixing length scale, $h_\tau$, can be set as a 10~m uniform value (\np{nn\_etau}\forcode{ = 0})  
    386 or a latitude dependent value (varying from 0.5~m at the Equator to a maximum value of 30~m  
    387 at high latitudes (\np{nn\_etau}\forcode{ = 1}).  
    388  
    389 Note that two other option existe, \np{nn\_etau}\forcode{ = 2..3}. They correspond to applying  
    390 \autoref{eq:ZDF_Ehtau} only at the base of the mixed layer, or to using the high frequency part  
    391 of the stress to evaluate the fraction of TKE that penetrate the ocean.  
     367where $z$ is the depth, $e_s$ is TKE surface boundary condition, $f_r$ is the fraction of the surface TKE that 
     368penetrate in the ocean, $h_\tau$ is a vertical mixing length scale that controls exponential shape of 
     369the penetration, and $f_i$ is the ice concentration 
     370(no penetration if $f_i=1$, that is if the ocean is entirely covered by sea-ice). 
     371The value of $f_r$, usually a few percents, is specified through \np{rn\_efr} namelist parameter. 
     372The vertical mixing length scale, $h_\tau$, can be set as a 10~m uniform value (\np{nn\_etau}\forcode{ = 0}) or 
     373a latitude dependent value (varying from 0.5~m at the Equator to a maximum value of 30~m at high latitudes 
     374(\np{nn\_etau}\forcode{ = 1}).  
     375 
     376Note that two other option existe, \np{nn\_etau}\forcode{ = 2..3}. 
     377They correspond to applying \autoref{eq:ZDF_Ehtau} only at the base of the mixed layer, 
     378or to using the high frequency part of the stress to evaluate the fraction of TKE that penetrate the ocean.  
    392379Those two options are obsolescent features introduced for test purposes. 
    393380They will be removed in the next release.  
     
    420407%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    421408 
    422 The production of turbulence by vertical shear (the first term of the right hand side  
    423 of \autoref{eq:zdftke_e}) should balance the loss of kinetic energy associated with 
    424 the vertical momentum diffusion (first line in \autoref{eq:PE_zdf}). To do so a special care  
    425 have to be taken for both the time and space discretization of the TKE equation  
    426 \citep{Burchard_OM02,Marsaleix_al_OM08}. 
    427  
    428 Let us first address the time stepping issue. \autoref{fig:TKE_time_scheme} shows  
    429 how the two-level Leap-Frog time stepping of the momentum and tracer equations interplays  
    430 with the one-level forward time stepping of TKE equation. With this framework, the total loss  
    431 of kinetic energy (in 1D for the demonstration) due to the vertical momentum diffusion is  
    432 obtained by multiplying this quantity by $u^t$ and summing the result vertically:    
     409The production of turbulence by vertical shear (the first term of the right hand side of 
     410\autoref{eq:zdftke_e}) should balance the loss of kinetic energy associated with the vertical momentum diffusion 
     411(first line in \autoref{eq:PE_zdf}). 
     412To do so a special care have to be taken for both the time and space discretization of 
     413the TKE equation \citep{Burchard_OM02,Marsaleix_al_OM08}. 
     414 
     415Let us first address the time stepping issue. \autoref{fig:TKE_time_scheme} shows how 
     416the two-level Leap-Frog time stepping of the momentum and tracer equations interplays with 
     417the one-level forward time stepping of TKE equation. 
     418With this framework, the total loss of kinetic energy (in 1D for the demonstration) due to 
     419the vertical momentum diffusion is obtained by multiplying this quantity by $u^t$ and 
     420summing the result vertically:    
    433421\begin{equation} \label{eq:energ1} 
    434422\begin{split} 
     
    438426\end{split} 
    439427\end{equation} 
    440 Here, the vertical diffusion of momentum is discretized backward in time  
    441 with a coefficient, $K_m$, known at time $t$ (\autoref{fig:TKE_time_scheme}),  
    442 as it is required when using the TKE scheme (see \autoref{sec:STP_forward_imp}).  
    443 The first term of the right hand side of \autoref{eq:energ1} represents the kinetic energy  
    444 transfer at the surface (atmospheric forcing) and at the bottom (friction effect).  
    445 The second term is always negative. It is the dissipation rate of kinetic energy,  
    446 and thus minus the shear production rate of $\bar{e}$. \autoref{eq:energ1}  
    447 implies that, to be energetically consistent, the production rate of $\bar{e}$  
    448 used to compute $(\bar{e})^t$ (and thus ${K_m}^t$) should be expressed as  
    449 ${K_m}^{t-\rdt}\,(\partial_z u)^{t-\rdt} \,(\partial_z u)^t$ (and not by the more straightforward  
    450 $K_m \left( \partial_z u \right)^2$ expression taken at time $t$ or $t-\rdt$). 
    451  
    452 A similar consideration applies on the destruction rate of $\bar{e}$ due to stratification  
    453 (second term of the right hand side of \autoref{eq:zdftke_e}). This term  
    454 must balance the input of potential energy resulting from vertical mixing.  
    455 The rate of change of potential energy (in 1D for the demonstration) due vertical  
    456 mixing is obtained by multiplying vertical density diffusion  
    457 tendency by $g\,z$ and and summing the result vertically: 
     428Here, the vertical diffusion of momentum is discretized backward in time with a coefficient, $K_m$, 
     429known at time $t$ (\autoref{fig:TKE_time_scheme}), as it is required when using the TKE scheme 
     430(see \autoref{sec:STP_forward_imp}). 
     431The first term of the right hand side of \autoref{eq:energ1} represents the kinetic energy transfer at 
     432the surface (atmospheric forcing) and at the bottom (friction effect). 
     433The second term is always negative. 
     434It is the dissipation rate of kinetic energy, and thus minus the shear production rate of $\bar{e}$. 
     435\autoref{eq:energ1} implies that, to be energetically consistent, 
     436the production rate of $\bar{e}$ used to compute $(\bar{e})^t$ (and thus ${K_m}^t$) should be expressed as 
     437${K_m}^{t-\rdt}\,(\partial_z u)^{t-\rdt} \,(\partial_z u)^t$ 
     438(and not by the more straightforward $K_m \left( \partial_z u \right)^2$ expression taken at time $t$ or $t-\rdt$). 
     439 
     440A similar consideration applies on the destruction rate of $\bar{e}$ due to stratification 
     441(second term of the right hand side of \autoref{eq:zdftke_e}). 
     442This term must balance the input of potential energy resulting from vertical mixing. 
     443The rate of change of potential energy (in 1D for the demonstration) due vertical mixing is obtained by 
     444multiplying vertical density diffusion tendency by $g\,z$ and and summing the result vertically: 
    458445\begin{equation} \label{eq:energ2} 
    459446\begin{split} 
     
    466453\end{equation} 
    467454where we use $N^2 = -g \,\partial_k \rho / (e_3 \rho)$.  
    468 The first term of the right hand side of \autoref{eq:energ2}  is always zero  
    469 because there is no diffusive flux through the ocean surface and bottom).  
    470 The second term is minus the destruction rate of  $\bar{e}$ due to stratification.  
    471 Therefore \autoref{eq:energ1} implies that, to be energetically consistent, the product  
    472 ${K_\rho}^{t-\rdt}\,(N^2)^t$ should be used in \autoref{eq:zdftke_e}, the TKE equation. 
    473  
    474 Let us now address the space discretization issue.  
    475 The vertical eddy coefficients are defined at $w$-point whereas the horizontal velocity  
    476 components are in the centre of the side faces of a $t$-box in staggered C-grid  
    477 (\autoref{fig:cell}). A space averaging is thus required to obtain the shear TKE production term. 
    478 By redoing the \autoref{eq:energ1} in the 3D case, it can be shown that the product of  
    479 eddy coefficient by the shear at $t$ and $t-\rdt$ must be performed prior to the averaging. 
    480 Furthermore, the possible time variation of $e_3$ (\key{vvl} case) have to be taken into  
    481 account. 
    482  
    483 The above energetic considerations leads to  
    484 the following final discrete form for the TKE equation: 
     455The first term of the right hand side of \autoref{eq:energ2} is always zero because 
     456there is no diffusive flux through the ocean surface and bottom). 
     457The second term is minus the destruction rate of  $\bar{e}$ due to stratification. 
     458Therefore \autoref{eq:energ1} implies that, to be energetically consistent, 
     459the product ${K_\rho}^{t-\rdt}\,(N^2)^t$ should be used in \autoref{eq:zdftke_e}, the TKE equation. 
     460 
     461Let us now address the space discretization issue. 
     462The vertical eddy coefficients are defined at $w$-point whereas the horizontal velocity components are in 
     463the centre of the side faces of a $t$-box in staggered C-grid (\autoref{fig:cell}). 
     464A space averaging is thus required to obtain the shear TKE production term. 
     465By redoing the \autoref{eq:energ1} in the 3D case, it can be shown that the product of eddy coefficient by 
     466the shear at $t$ and $t-\rdt$ must be performed prior to the averaging. 
     467Furthermore, the possible time variation of $e_3$ (\key{vvl} case) have to be taken into account. 
     468 
     469The above energetic considerations leads to the following final discrete form for the TKE equation: 
    485470\begin{equation} \label{eq:zdftke_ene} 
    486471\begin{split} 
     
    500485\end{split} 
    501486\end{equation} 
    502 where the last two terms in \autoref{eq:zdftke_ene} (vertical diffusion and Kolmogorov dissipation)  
    503 are time stepped using a backward scheme (see\autoref{sec:STP_forward_imp}).  
    504 Note that the Kolmogorov term has been linearized in time in order to render  
    505 the implicit computation possible. The restart of the TKE scheme  
    506 requires the storage of $\bar {e}$, $K_m$, $K_\rho$ and $l_\epsilon$ as they all appear in  
    507 the right hand side of \autoref{eq:zdftke_ene}. For the latter, it is in fact  
    508 the ratio $\sqrt{\bar{e}}/l_\epsilon$ which is stored.  
     487where the last two terms in \autoref{eq:zdftke_ene} (vertical diffusion and Kolmogorov dissipation) 
     488are time stepped using a backward scheme (see\autoref{sec:STP_forward_imp}). 
     489Note that the Kolmogorov term has been linearized in time in order to render the implicit computation possible. 
     490The restart of the TKE scheme requires the storage of $\bar {e}$, $K_m$, $K_\rho$ and $l_\epsilon$ as 
     491they all appear in the right hand side of \autoref{eq:zdftke_ene}. 
     492For the latter, it is in fact the ratio $\sqrt{\bar{e}}/l_\epsilon$ which is stored.  
    509493 
    510494% ------------------------------------------------------------------------------------------------------------- 
     
    519503%-------------------------------------------------------------------------------------------------------------- 
    520504 
    521 The Generic Length Scale (GLS) scheme is a turbulent closure scheme based on  
    522 two prognostic equations: one for the turbulent kinetic energy $\bar {e}$, and another  
    523 for the generic length scale, $\psi$ \citep{Umlauf_Burchard_JMS03, Umlauf_Burchard_CSR05}.  
    524 This later variable is defined as : $\psi = {C_{0\mu}}^{p} \ {\bar{e}}^{m} \ l^{n}$,  
    525 where the triplet $(p, m, n)$ value given in Tab.\autoref{tab:GLS} allows to recover  
    526 a number of well-known turbulent closures ($k$-$kl$ \citep{Mellor_Yamada_1982},  
    527 $k$-$\epsilon$ \citep{Rodi_1987}, $k$-$\omega$ \citep{Wilcox_1988}  
    528 among others \citep{Umlauf_Burchard_JMS03,Kantha_Carniel_CSR05}).  
     505The Generic Length Scale (GLS) scheme is a turbulent closure scheme based on two prognostic equations: 
     506one for the turbulent kinetic energy $\bar {e}$, and another for the generic length scale, 
     507$\psi$ \citep{Umlauf_Burchard_JMS03, Umlauf_Burchard_CSR05}. 
     508This later variable is defined as: $\psi = {C_{0\mu}}^{p} \ {\bar{e}}^{m} \ l^{n}$,  
     509where the triplet $(p, m, n)$ value given in Tab.\autoref{tab:GLS} allows to recover a number of 
     510well-known turbulent closures ($k$-$kl$ \citep{Mellor_Yamada_1982}, $k$-$\epsilon$ \citep{Rodi_1987}, 
     511$k$-$\omega$ \citep{Wilcox_1988} among others \citep{Umlauf_Burchard_JMS03,Kantha_Carniel_CSR05}).  
    529512The GLS scheme is given by the following set of equations: 
    530513\begin{equation} \label{eq:zdfgls_e} 
     
    558541{\epsilon} = C_{0\mu} \,\frac{\bar {e}^{3/2}}{l} \; 
    559542\end{equation} 
    560 where $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2})  
    561 and $\epsilon$ the dissipation rate.  
    562 The constants $C_1$, $C_2$, $C_3$, ${\sigma_e}$, ${\sigma_{\psi}}$ and the wall function ($Fw$)  
    563 depends of the choice of the turbulence model. Four different turbulent models are pre-defined  
    564 (Tab.\autoref{tab:GLS}). They are made available through the \np{nn\_clo} namelist parameter.  
     543where $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}) and 
     544$\epsilon$ the dissipation rate.  
     545The constants $C_1$, $C_2$, $C_3$, ${\sigma_e}$, ${\sigma_{\psi}}$ and the wall function ($Fw$) depends of 
     546the choice of the turbulence model. 
     547Four different turbulent models are pre-defined (Tab.\autoref{tab:GLS}). 
     548They are made available through the \np{nn\_clo} namelist parameter.  
    565549 
    566550%--------------------------------------------------TABLE-------------------------------------------------- 
     
    584568\end{tabular} 
    585569\caption{   \protect\label{tab:GLS}  
    586 Set of predefined GLS parameters, or equivalently predefined turbulence models available  
    587 with \protect\key{zdfgls} and controlled by the \protect\np{nn\_clos} namelist variable in \protect\ngn{namzdf\_gls} .} 
     570  Set of predefined GLS parameters, or equivalently predefined turbulence models available with 
     571  \protect\key{zdfgls} and controlled by the \protect\np{nn\_clos} namelist variable in \protect\ngn{namzdf\_gls}.} 
    588572\end{center}   \end{table} 
    589573%-------------------------------------------------------------------------------------------------------------- 
    590574 
    591 In the Mellor-Yamada model, the negativity of $n$ allows to use a wall function to force 
    592 the convergence of the mixing length towards $K z_b$ ($K$: Kappa and $z_b$: rugosity length)  
    593 value near physical boundaries (logarithmic boundary layer law). $C_{\mu}$ and $C_{\mu'}$  
    594 are calculated from stability function proposed by \citet{Galperin_al_JAS88}, or by \citet{Kantha_Clayson_1994}  
    595 or one of the two functions suggested by \citet{Canuto_2001}  (\np{nn\_stab\_func}\forcode{ = 0..3}, resp.).  
     575In the Mellor-Yamada model, the negativity of $n$ allows to use a wall function to force the convergence of 
     576the mixing length towards $K z_b$ ($K$: Kappa and $z_b$: rugosity length) value near physical boundaries 
     577(logarithmic boundary layer law). 
     578$C_{\mu}$ and $C_{\mu'}$ are calculated from stability function proposed by \citet{Galperin_al_JAS88}, 
     579or by \citet{Kantha_Clayson_1994} or one of the two functions suggested by \citet{Canuto_2001} 
     580(\np{nn\_stab\_func}\forcode{ = 0..3}, resp.).  
    596581The value of $C_{0\mu}$ depends of the choice of the stability function. 
    597582 
    598 The surface and bottom boundary condition on both $\bar{e}$ and $\psi$ can be calculated  
    599 thanks to Dirichlet or Neumann condition through \np{nn\_tkebc\_surf} and \np{nn\_tkebc\_bot}, resp.  
    600 As for TKE closure , the wave effect on the mixing is considered when \np{ln\_crban}\forcode{ = .true.} 
    601 \citep{Craig_Banner_JPO94, Mellor_Blumberg_JPO04}. The \np{rn\_crban} namelist parameter  
    602 is $\alpha_{CB}$ in \autoref{eq:ZDF_Esbc} and \np{rn\_charn} provides the value of $\beta$ in \autoref{eq:ZDF_Lsbc}.  
    603  
    604 The $\psi$ equation is known to fail in stably stratified flows, and for this reason  
    605 almost all authors apply a clipping of the length scale as an \textit{ad hoc} remedy.  
    606 With this clipping, the maximum permissible length scale is determined by  
    607 $l_{max} = c_{lim} \sqrt{2\bar{e}}/ N$. A value of $c_{lim} = 0.53$ is often used  
    608 \citep{Galperin_al_JAS88}. \cite{Umlauf_Burchard_CSR05} show that the value of  
    609 the clipping factor is of crucial importance for the entrainment depth predicted in  
    610 stably stratified situations, and that its value has to be chosen in accordance  
    611 with the algebraic model for the turbulent fluxes. The clipping is only activated  
    612 if \np{ln\_length\_lim}\forcode{ = .true.}, and the $c_{lim}$ is set to the \np{rn\_clim\_galp} value. 
    613  
    614 The time and space discretization of the GLS equations follows the same energetic  
    615 consideration as for the TKE case described in \autoref{subsec:ZDF_tke_ene}  \citep{Burchard_OM02}.  
     583The surface and bottom boundary condition on both $\bar{e}$ and $\psi$ can be calculated thanks to Dirichlet or 
     584Neumann condition through \np{nn\_tkebc\_surf} and \np{nn\_tkebc\_bot}, resp. 
     585As for TKE closure, the wave effect on the mixing is considered when 
     586\np{ln\_crban}\forcode{ = .true.} \citep{Craig_Banner_JPO94, Mellor_Blumberg_JPO04}. 
     587The \np{rn\_crban} namelist parameter is $\alpha_{CB}$ in \autoref{eq:ZDF_Esbc} and 
     588\np{rn\_charn} provides the value of $\beta$ in \autoref{eq:ZDF_Lsbc}.  
     589 
     590The $\psi$ equation is known to fail in stably stratified flows, and for this reason 
     591almost all authors apply a clipping of the length scale as an \textit{ad hoc} remedy. 
     592With this clipping, the maximum permissible length scale is determined by $l_{max} = c_{lim} \sqrt{2\bar{e}}/ N$. 
     593A value of $c_{lim} = 0.53$ is often used \citep{Galperin_al_JAS88}. 
     594\cite{Umlauf_Burchard_CSR05} show that the value of the clipping factor is of crucial importance for 
     595the entrainment depth predicted in stably stratified situations, 
     596and that its value has to be chosen in accordance with the algebraic model for the turbulent fluxes. 
     597The clipping is only activated if \np{ln\_length\_lim}\forcode{ = .true.}, 
     598and the $c_{lim}$ is set to the \np{rn\_clim\_galp} value. 
     599 
     600The time and space discretization of the GLS equations follows the same energetic consideration as for 
     601the TKE case described in \autoref{subsec:ZDF_tke_ene} \citep{Burchard_OM02}. 
    616602Examples of performance of the 4 turbulent closure scheme can be found in \citet{Warner_al_OM05}. 
    617603 
     
    640626%-------------------------------------------------------------------------------------------------------------- 
    641627 
    642 Static instabilities (i.e. light potential densities under heavy ones) may  
    643 occur at particular ocean grid points. In nature, convective processes  
    644 quickly re-establish the static stability of the water column. These  
    645 processes have been removed from the model via the hydrostatic  
    646 assumption so they must be parameterized. Three parameterisations  
    647 are available to deal with convective processes: a non-penetrative  
    648 convective adjustment or an enhanced vertical diffusion, or/and the  
    649 use of a turbulent closure scheme. 
     628Static instabilities (i.e. light potential densities under heavy ones) may occur at particular ocean grid points. 
     629In nature, convective processes quickly re-establish the static stability of the water column. 
     630These processes have been removed from the model via the hydrostatic assumption so they must be parameterized. 
     631Three parameterisations are available to deal with convective processes: 
     632a non-penetrative convective adjustment or an enhanced vertical diffusion, 
     633or/and the use of a turbulent closure scheme. 
    650634 
    651635% ------------------------------------------------------------------------------------------------------------- 
     
    665649\includegraphics[width=0.90\textwidth]{Fig_npc} 
    666650\caption{  \protect\label{fig:npc}  
    667 Example of an unstable density profile treated by the non penetrative  
    668 convective adjustment algorithm. $1^{st}$ step: the initial profile is checked from  
    669 the surface to the bottom. It is found to be unstable between levels 3 and 4.  
    670 They are mixed. The resulting $\rho$ is still larger than $\rho$(5): levels 3 to 5  
    671 are mixed. The resulting $\rho$ is still larger than $\rho$(6): levels 3 to 6 are  
    672 mixed. The $1^{st}$ step ends since the density profile is then stable below  
    673 the level 3. $2^{nd}$ step: the new $\rho$ profile is checked following the same  
    674 procedure as in $1^{st}$ step: levels 2 to 5 are mixed. The new density profile  
    675 is checked. It is found stable: end of algorithm.} 
     651  Example of an unstable density profile treated by the non penetrative convective adjustment algorithm. 
     652  $1^{st}$ step: the initial profile is checked from the surface to the bottom. 
     653  It is found to be unstable between levels 3 and 4. 
     654  They are mixed. 
     655  The resulting $\rho$ is still larger than $\rho$(5): levels 3 to 5 are mixed. 
     656  The resulting $\rho$ is still larger than $\rho$(6): levels 3 to 6 are mixed. 
     657  The $1^{st}$ step ends since the density profile is then stable below the level 3. 
     658  $2^{nd}$ step: the new $\rho$ profile is checked following the same procedure as in $1^{st}$ step: 
     659  levels 2 to 5 are mixed. 
     660  The new density profile is checked. 
     661  It is found stable: end of algorithm.} 
    676662\end{center}   \end{figure} 
    677663%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    678664 
    679 Options are defined through the  \ngn{namzdf} namelist variables. 
    680 The non-penetrative convective adjustment is used when \np{ln\_zdfnpc}\forcode{ = .true.}.  
    681 It is applied at each \np{nn\_npc} time step and mixes downwards instantaneously  
    682 the statically unstable portion of the water column, but only until the density  
    683 structure becomes neutrally stable ($i.e.$ until the mixed portion of the water  
    684 column has \textit{exactly} the density of the water just below) \citep{Madec_al_JPO91}.  
    685 The associated algorithm is an iterative process used in the following way  
    686 (\autoref{fig:npc}): starting from the top of the ocean, the first instability is  
    687 found. Assume in the following that the instability is located between levels  
    688 $k$ and $k+1$. The temperature and salinity in the two levels are  
    689 vertically mixed, conserving the heat and salt contents of the water column.  
    690 The new density is then computed by a linear approximation. If the new  
    691 density profile is still unstable between levels $k+1$ and $k+2$, levels $k$,  
    692 $k+1$ and $k+2$ are then mixed. This process is repeated until stability is  
    693 established below the level $k$ (the mixing process can go down to the  
    694 ocean bottom). The algorithm is repeated to check if the density profile  
    695 between level $k-1$ and $k$ is unstable and/or if there is no deeper instability. 
    696  
    697 This algorithm is significantly different from mixing statically unstable levels  
    698 two by two. The latter procedure cannot converge with a finite number  
    699 of iterations for some vertical profiles while the algorithm used in \NEMO  
    700 converges for any profile in a number of iterations which is less than the  
    701 number of vertical levels. This property is of paramount importance as  
    702 pointed out by \citet{Killworth1989}: it avoids the existence of permanent  
    703 and unrealistic static instabilities at the sea surface. This non-penetrative  
    704 convective algorithm has been proved successful in studies of the deep  
    705 water formation in the north-western Mediterranean Sea  
    706 \citep{Madec_al_JPO91, Madec_al_DAO91, Madec_Crepon_Bk91}. 
    707  
    708 The current implementation has been modified in order to deal with any non linear  
    709 equation of seawater (L. Brodeau, personnal communication).  
    710 Two main differences have been introduced compared to the original algorithm:  
     665Options are defined through the \ngn{namzdf} namelist variables. 
     666The non-penetrative convective adjustment is used when \np{ln\_zdfnpc}\forcode{ = .true.}. 
     667It is applied at each \np{nn\_npc} time step and mixes downwards instantaneously the statically unstable portion of 
     668the water column, but only until the density structure becomes neutrally stable 
     669($i.e.$ until the mixed portion of the water column has \textit{exactly} the density of the water just below) 
     670\citep{Madec_al_JPO91}. 
     671The associated algorithm is an iterative process used in the following way (\autoref{fig:npc}): 
     672starting from the top of the ocean, the first instability is found. 
     673Assume in the following that the instability is located between levels $k$ and $k+1$. 
     674The temperature and salinity in the two levels are vertically mixed, conserving the heat and salt contents of 
     675the water column. 
     676The new density is then computed by a linear approximation. 
     677If the new density profile is still unstable between levels $k+1$ and $k+2$, 
     678levels $k$, $k+1$ and $k+2$ are then mixed. 
     679This process is repeated until stability is established below the level $k$ 
     680(the mixing process can go down to the ocean bottom). 
     681The algorithm is repeated to check if the density profile between level $k-1$ and $k$ is unstable and/or 
     682if there is no deeper instability. 
     683 
     684This algorithm is significantly different from mixing statically unstable levels two by two. 
     685The latter procedure cannot converge with a finite number of iterations for some vertical profiles while 
     686the algorithm used in \NEMO converges for any profile in a number of iterations which is less than 
     687the number of vertical levels. 
     688This property is of paramount importance as pointed out by \citet{Killworth1989}: 
     689it avoids the existence of permanent and unrealistic static instabilities at the sea surface. 
     690This non-penetrative convective algorithm has been proved successful in studies of the deep water formation in 
     691the north-western Mediterranean Sea \citep{Madec_al_JPO91, Madec_al_DAO91, Madec_Crepon_Bk91}. 
     692 
     693The current implementation has been modified in order to deal with any non linear equation of seawater 
     694(L. Brodeau, personnal communication). 
     695Two main differences have been introduced compared to the original algorithm: 
    711696$(i)$ the stability is now checked using the Brunt-V\"{a}is\"{a}l\"{a} frequency  
    712 (not the the difference in potential density) ;  
    713 $(ii)$ when two levels are found unstable, their thermal and haline expansion coefficients  
    714 are vertically mixed in the same way their temperature and salinity has been mixed. 
    715 These two modifications allow the algorithm to perform properly and accurately  
    716 with TEOS10 or EOS-80 without having to recompute the expansion coefficients at each  
    717 mixing iteration. 
     697(not the the difference in potential density);  
     698$(ii)$ when two levels are found unstable, their thermal and haline expansion coefficients are vertically mixed in 
     699the same way their temperature and salinity has been mixed. 
     700These two modifications allow the algorithm to perform properly and accurately with TEOS10 or EOS-80 without 
     701having to recompute the expansion coefficients at each mixing iteration. 
    718702 
    719703% ------------------------------------------------------------------------------------------------------------- 
     
    729713 
    730714Options are defined through the  \ngn{namzdf} namelist variables. 
    731 The enhanced vertical diffusion parameterisation is used when \np{ln\_zdfevd}\forcode{ = .true.}.  
    732 In this case, the vertical eddy mixing coefficients are assigned very large values  
    733 (a typical value is $10\;m^2s^{-1})$ in regions where the stratification is unstable  
    734 ($i.e.$ when $N^2$ the Brunt-Vais\"{a}l\"{a} frequency is negative)  
    735 \citep{Lazar_PhD97, Lazar_al_JPO99}. This is done either on tracers only  
    736 (\np{nn\_evdm}\forcode{ = 0}) or on both momentum and tracers (\np{nn\_evdm}\forcode{ = 1}). 
    737  
    738 In practice, where $N^2\leq 10^{-12}$, $A_T^{vT}$ and $A_T^{vS}$, and  
    739 if \np{nn\_evdm}\forcode{ = 1}, the four neighbouring $A_u^{vm} \;\mbox{and}\;A_v^{vm}$  
    740 values also, are set equal to the namelist parameter \np{rn\_avevd}. A typical value  
    741 for $rn\_avevd$ is between 1 and $100~m^2.s^{-1}$. This parameterisation of  
    742 convective processes is less time consuming than the convective adjustment  
    743 algorithm presented above when mixing both tracers and momentum in the  
    744 case of static instabilities. It requires the use of an implicit time stepping on  
    745 vertical diffusion terms (i.e. \np{ln\_zdfexp}\forcode{ = .false.}).  
    746  
    747 Note that the stability test is performed on both \textit{before} and \textit{now}  
    748 values of $N^2$. This removes a potential source of divergence of odd and 
    749 even time step in a leapfrog environment \citep{Leclair_PhD2010} (see \autoref{sec:STP_mLF}). 
     715The enhanced vertical diffusion parameterisation is used when \np{ln\_zdfevd}\forcode{ = .true.}. 
     716In this case, the vertical eddy mixing coefficients are assigned very large values 
     717(a typical value is $10\;m^2s^{-1})$ in regions where the stratification is unstable 
     718($i.e.$ when $N^2$ the Brunt-Vais\"{a}l\"{a} frequency is negative) \citep{Lazar_PhD97, Lazar_al_JPO99}. 
     719This is done either on tracers only (\np{nn\_evdm}\forcode{ = 0}) or 
     720on both momentum and tracers (\np{nn\_evdm}\forcode{ = 1}). 
     721 
     722In practice, where $N^2\leq 10^{-12}$, $A_T^{vT}$ and $A_T^{vS}$, and if \np{nn\_evdm}\forcode{ = 1}, 
     723the four neighbouring $A_u^{vm} \;\mbox{and}\;A_v^{vm}$ values also, are set equal to 
     724the namelist parameter \np{rn\_avevd}. 
     725A typical value for $rn\_avevd$ is between 1 and $100~m^2.s^{-1}$. 
     726This parameterisation of convective processes is less time consuming than 
     727the convective adjustment algorithm presented above when mixing both tracers and 
     728momentum in the case of static instabilities. 
     729It requires the use of an implicit time stepping on vertical diffusion terms 
     730(i.e. \np{ln\_zdfexp}\forcode{ = .false.}). 
     731 
     732Note that the stability test is performed on both \textit{before} and \textit{now} values of $N^2$. 
     733This removes a potential source of divergence of odd and even time step in 
     734a leapfrog environment \citep{Leclair_PhD2010} (see \autoref{sec:STP_mLF}). 
    750735 
    751736% ------------------------------------------------------------------------------------------------------------- 
     
    755740\label{subsec:ZDF_tcs} 
    756741 
    757 The turbulent closure scheme presented in \autoref{subsec:ZDF_tke} and \autoref{subsec:ZDF_gls}  
    758 (\key{zdftke} or \key{zdftke} is defined) in theory solves the problem of statically  
    759 unstable density profiles. In such a case, the term corresponding to the  
    760 destruction of turbulent kinetic energy through stratification in \autoref{eq:zdftke_e}  
    761 or \autoref{eq:zdfgls_e} becomes a source term, since $N^2$ is negative.  
    762 It results in large values of $A_T^{vT}$ and  $A_T^{vT}$, and also the four neighbouring  
    763 $A_u^{vm} {and}\;A_v^{vm}$ (up to $1\;m^2s^{-1})$. These large values  
    764 restore the static stability of the water column in a way similar to that of the  
    765 enhanced vertical diffusion parameterisation (\autoref{subsec:ZDF_evd}). However,  
    766 in the vicinity of the sea surface (first ocean layer), the eddy coefficients  
    767 computed by the turbulent closure scheme do not usually exceed $10^{-2}m.s^{-1}$,  
    768 because the mixing length scale is bounded by the distance to the sea surface.  
    769 It can thus be useful to combine the enhanced vertical  
    770 diffusion with the turbulent closure scheme, $i.e.$ setting the \np{ln\_zdfnpc}  
    771 namelist parameter to true and defining the turbulent closure CPP key all together. 
    772  
    773 The KPP turbulent closure scheme already includes enhanced vertical diffusion  
    774 in the case of convection, as governed by the variables $bvsqcon$ and $difcon$  
    775 found in \mdl{zdfkpp}, therefore \np{ln\_zdfevd}\forcode{ = .false.} should be used with the KPP  
    776 scheme. %gm%  + one word on non local flux with KPP scheme trakpp.F90 module... 
     742The turbulent closure scheme presented in \autoref{subsec:ZDF_tke} and \autoref{subsec:ZDF_gls} 
     743(\key{zdftke} or \key{zdftke} is defined) in theory solves the problem of statically unstable density profiles. 
     744In such a case, the term corresponding to the destruction of turbulent kinetic energy through stratification in 
     745\autoref{eq:zdftke_e} or \autoref{eq:zdfgls_e} becomes a source term, since $N^2$ is negative.  
     746It results in large values of $A_T^{vT}$ and  $A_T^{vT}$, and also the four neighbouring $A_u^{vm} {and}\;A_v^{vm}$ 
     747(up to $1\;m^2s^{-1}$). 
     748These large values restore the static stability of the water column in a way similar to that of 
     749the enhanced vertical diffusion parameterisation (\autoref{subsec:ZDF_evd}). 
     750However, in the vicinity of the sea surface (first ocean layer), the eddy coefficients computed by 
     751the turbulent closure scheme do not usually exceed $10^{-2}m.s^{-1}$, 
     752because the mixing length scale is bounded by the distance to the sea surface. 
     753It can thus be useful to combine the enhanced vertical diffusion with the turbulent closure scheme, 
     754$i.e.$ setting the \np{ln\_zdfnpc} namelist parameter to true and 
     755defining the turbulent closure CPP key all together. 
     756 
     757The KPP turbulent closure scheme already includes enhanced vertical diffusion in the case of convection, 
     758as governed by the variables $bvsqcon$ and $difcon$ found in \mdl{zdfkpp}, 
     759therefore \np{ln\_zdfevd}\forcode{ = .false.} should be used with the KPP scheme. 
     760% gm%  + one word on non local flux with KPP scheme trakpp.F90 module... 
    777761 
    778762% ================================================================ 
     
    788772 
    789773Options are defined through the  \ngn{namzdf\_ddm} namelist variables. 
    790 Double diffusion occurs when relatively warm, salty water overlies cooler, fresher  
    791 water, or vice versa. The former condition leads to salt fingering and the latter  
    792 to diffusive convection. Double-diffusive phenomena contribute to diapycnal  
    793 mixing in extensive regions of the ocean.  \citet{Merryfield1999} include a  
    794 parameterisation of such phenomena in a global ocean model and show that  
    795 it leads to relatively minor changes in circulation but exerts significant regional  
    796 influences on temperature and salinity. This parameterisation has been  
    797 introduced in \mdl{zdfddm} module and is controlled by the \key{zdfddm} CPP key. 
     774Double diffusion occurs when relatively warm, salty water overlies cooler, fresher water, or vice versa. 
     775The former condition leads to salt fingering and the latter to diffusive convection. 
     776Double-diffusive phenomena contribute to diapycnal mixing in extensive regions of the ocean. 
     777\citet{Merryfield1999} include a parameterisation of such phenomena in a global ocean model and show that  
     778it leads to relatively minor changes in circulation but exerts significant regional influences on 
     779temperature and salinity. 
     780This parameterisation has been introduced in \mdl{zdfddm} module and is controlled by the \key{zdfddm} CPP key. 
    798781 
    799782Diapycnal mixing of S and T are described by diapycnal diffusion coefficients  
     
    802785    &A^{vS} = A_o^{vS}+A_f^{vS}+A_d^{vS} 
    803786\end{align*} 
    804 where subscript $f$ represents mixing by salt fingering, $d$ by diffusive convection,  
    805 and $o$ by processes other than double diffusion. The rates of double-diffusive  
    806 mixing depend on the buoyancy ratio $R_\rho = \alpha \partial_z T / \beta \partial_z S$,  
    807 where $\alpha$ and $\beta$ are coefficients of thermal expansion and saline  
    808 contraction (see \autoref{subsec:TRA_eos}). To represent mixing of $S$ and $T$ by salt  
    809 fingering, we adopt the diapycnal diffusivities suggested by Schmitt (1981): 
     787where subscript $f$ represents mixing by salt fingering, $d$ by diffusive convection, 
     788and $o$ by processes other than double diffusion. 
     789The rates of double-diffusive mixing depend on the buoyancy ratio 
     790$R_\rho = \alpha \partial_z T / \beta \partial_z S$, where $\alpha$ and $\beta$ are coefficients of 
     791thermal expansion and saline contraction (see \autoref{subsec:TRA_eos}). 
     792To represent mixing of $S$ and $T$ by salt fingering, we adopt the diapycnal diffusivities suggested by Schmitt 
     793(1981): 
    810794\begin{align} \label{eq:zdfddm_f} 
    811795A_f^{vS} &=    \begin{cases} 
     
    821805\includegraphics[width=0.99\textwidth]{Fig_zdfddm} 
    822806\caption{  \protect\label{fig:zdfddm} 
    823 From \citet{Merryfield1999} : (a) Diapycnal diffusivities $A_f^{vT}$  
    824 and $A_f^{vS}$ for temperature and salt in regions of salt fingering. Heavy  
    825 curves denote $A^{\ast v} = 10^{-3}~m^2.s^{-1}$ and thin curves  
    826 $A^{\ast v} = 10^{-4}~m^2.s^{-1}$ ; (b) diapycnal diffusivities $A_d^{vT}$ and  
    827 $A_d^{vS}$ for temperature and salt in regions of diffusive convection. Heavy  
    828 curves denote the Federov parameterisation and thin curves the Kelley  
    829 parameterisation. The latter is not implemented in \NEMO. } 
     807  From \citet{Merryfield1999} : 
     808  (a) Diapycnal diffusivities $A_f^{vT}$ and $A_f^{vS}$ for temperature and salt in regions of salt fingering. 
     809  Heavy curves denote $A^{\ast v} = 10^{-3}~m^2.s^{-1}$ and thin curves $A^{\ast v} = 10^{-4}~m^2.s^{-1}$; 
     810  (b) diapycnal diffusivities $A_d^{vT}$ and $A_d^{vS}$ for temperature and salt in regions of diffusive convection. 
     811  Heavy curves denote the Federov parameterisation and thin curves the Kelley parameterisation. 
     812  The latter is not implemented in \NEMO. } 
    830813\end{center}    \end{figure} 
    831814%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    832815 
    833 The factor 0.7 in \autoref{eq:zdfddm_f_T} reflects the measured ratio  
    834 $\alpha F_T /\beta F_S \approx  0.7$ of buoyancy flux of heat to buoyancy  
    835 flux of salt ($e.g.$, \citet{McDougall_Taylor_JMR84}). Following  \citet{Merryfield1999},  
    836 we adopt $R_c = 1.6$, $n = 6$, and $A^{\ast v} = 10^{-4}~m^2.s^{-1}$. 
    837  
    838 To represent mixing of S and T by diffusive layering,  the diapycnal diffusivities suggested by Federov (1988) is used:  
     816The factor 0.7 in \autoref{eq:zdfddm_f_T} reflects the measured ratio $\alpha F_T /\beta F_S \approx  0.7$ of 
     817buoyancy flux of heat to buoyancy flux of salt ($e.g.$, \citet{McDougall_Taylor_JMR84}). 
     818Following  \citet{Merryfield1999}, we adopt $R_c = 1.6$, $n = 6$, and $A^{\ast v} = 10^{-4}~m^2.s^{-1}$. 
     819 
     820To represent mixing of S and T by diffusive layering,  the diapycnal diffusivities suggested by 
     821Federov (1988) is used:  
    839822\begin{align}  \label{eq:zdfddm_d} 
    840823A_d^{vT} &=    \begin{cases} 
     
    853836\end{align} 
    854837 
    855 The dependencies of \autoref{eq:zdfddm_f} to \autoref{eq:zdfddm_d_S} on $R_\rho$  
    856 are illustrated in \autoref{fig:zdfddm}. Implementing this requires computing  
    857 $R_\rho$ at each grid point on every time step. This is done in \mdl{eosbn2} at the  
    858 same time as $N^2$ is computed. This avoids duplication in the computation of  
    859 $\alpha$ and $\beta$ (which is usually quite expensive). 
     838The dependencies of \autoref{eq:zdfddm_f} to \autoref{eq:zdfddm_d_S} on $R_\rho$ are illustrated in 
     839\autoref{fig:zdfddm}. 
     840Implementing this requires computing $R_\rho$ at each grid point on every time step. 
     841This is done in \mdl{eosbn2} at the same time as $N^2$ is computed. 
     842This avoids duplication in the computation of $\alpha$ and $\beta$ (which is usually quite expensive). 
    860843 
    861844% ================================================================ 
     
    870853%-------------------------------------------------------------------------------------------------------------- 
    871854 
    872 Options to define the top and bottom friction are defined through the  \ngn{nambfr} namelist variables. 
    873 The bottom friction represents the friction generated by the bathymetry.  
    874 The top friction represents the friction generated by the ice shelf/ocean interface.  
    875 As the friction processes at the top and bottom are treated in similar way,  
     855Options to define the top and bottom friction are defined through the \ngn{nambfr} namelist variables. 
     856The bottom friction represents the friction generated by the bathymetry. 
     857The top friction represents the friction generated by the ice shelf/ocean interface. 
     858As the friction processes at the top and bottom are treated in similar way, 
    876859only the bottom friction is described in detail below. 
    877860 
    878861 
    879 Both the surface momentum flux (wind stress) and the bottom momentum  
    880 flux (bottom friction) enter the equations as a condition on the vertical  
    881 diffusive flux. For the bottom boundary layer, one has: 
     862Both the surface momentum flux (wind stress) and the bottom momentum flux (bottom friction) enter the equations as 
     863a condition on the vertical diffusive flux. 
     864For the bottom boundary layer, one has: 
    882865\begin{equation} \label{eq:zdfbfr_flux} 
    883866A^{vm} \left( \partial {\textbf U}_h / \partial z \right) = {{\cal F}}_h^{\textbf U} 
    884867\end{equation} 
    885 where ${\cal F}_h^{\textbf U}$ is represents the downward flux of horizontal momentum  
    886 outside the logarithmic turbulent boundary layer (thickness of the order of  
    887 1~m in the ocean). How ${\cal F}_h^{\textbf U}$ influences the interior depends on the  
    888 vertical resolution of the model near the bottom relative to the Ekman layer  
    889 depth. For example, in order to obtain an Ekman layer depth  
    890 $d = \sqrt{2\;A^{vm}} / f = 50$~m, one needs a vertical diffusion coefficient  
    891 $A^{vm} = 0.125$~m$^2$s$^{-1}$ (for a Coriolis frequency  
    892 $f = 10^{-4}$~m$^2$s$^{-1}$). With a background diffusion coefficient  
    893 $A^{vm} = 10^{-4}$~m$^2$s$^{-1}$, the Ekman layer depth is only 1.4~m.  
    894 When the vertical mixing coefficient is this small, using a flux condition is  
    895 equivalent to entering the viscous forces (either wind stress or bottom friction)  
    896 as a body force over the depth of the top or bottom model layer. To illustrate  
    897 this, consider the equation for $u$ at $k$, the last ocean level: 
     868where ${\cal F}_h^{\textbf U}$ is represents the downward flux of horizontal momentum outside 
     869the logarithmic turbulent boundary layer (thickness of the order of 1~m in the ocean). 
     870How ${\cal F}_h^{\textbf U}$ influences the interior depends on the vertical resolution of the model near 
     871the bottom relative to the Ekman layer depth. 
     872For example, in order to obtain an Ekman layer depth $d = \sqrt{2\;A^{vm}} / f = 50$~m, 
     873one needs a vertical diffusion coefficient $A^{vm} = 0.125$~m$^2$s$^{-1}$ 
     874(for a Coriolis frequency $f = 10^{-4}$~m$^2$s$^{-1}$). 
     875With a background diffusion coefficient $A^{vm} = 10^{-4}$~m$^2$s$^{-1}$, the Ekman layer depth is only 1.4~m.  
     876When the vertical mixing coefficient is this small, using a flux condition is equivalent to 
     877entering the viscous forces (either wind stress or bottom friction) as a body force over the depth of the top or 
     878bottom model layer. 
     879To illustrate this, consider the equation for $u$ at $k$, the last ocean level: 
    898880\begin{equation} \label{eq:zdfbfr_flux2} 
    899881\frac{\partial u_k}{\partial t} = \frac{1}{e_{3u}} \left[ \frac{A_{uw}^{vm}}{e_{3uw}} \delta_{k+1/2}\;[u] - {\cal F}^u_h \right] \approx - \frac{{\cal F}^u_{h}}{e_{3u}} 
    900882\end{equation} 
    901 If the bottom layer thickness is 200~m, the Ekman transport will  
    902 be distributed over that depth. On the other hand, if the vertical resolution  
    903 is high (1~m or less) and a turbulent closure model is used, the turbulent  
    904 Ekman layer will be represented explicitly by the model. However, the  
    905 logarithmic layer is never represented in current primitive equation model  
    906 applications: it is \emph{necessary} to parameterize the flux ${\cal F}^u_h $.  
    907 Two choices are available in \NEMO: a linear and a quadratic bottom friction.  
    908 Note that in both cases, the rotation between the interior velocity and the  
    909 bottom friction is neglected in the present release of \NEMO. 
    910  
    911 In the code, the bottom friction is imposed by adding the trend due to the bottom  
    912 friction to the general momentum trend in \mdl{dynbfr}. For the time-split surface  
    913 pressure gradient algorithm, the momentum trend due to the barotropic component  
    914 needs to be handled separately. For this purpose it is convenient to compute and  
    915 store coefficients which can be simply combined with bottom velocities and geometric  
    916 values to provide the momentum trend due to bottom friction.  
    917 These coefficients are computed in \mdl{zdfbfr} and generally take the form  
    918 $c_b^{\textbf U}$ where: 
     883If the bottom layer thickness is 200~m, the Ekman transport will be distributed over that depth. 
     884On the other hand, if the vertical resolution is high (1~m or less) and a turbulent closure model is used, 
     885the turbulent Ekman layer will be represented explicitly by the model. 
     886However, the logarithmic layer is never represented in current primitive equation model applications: 
     887it is \emph{necessary} to parameterize the flux ${\cal F}^u_h $. 
     888Two choices are available in \NEMO: a linear and a quadratic bottom friction. 
     889Note that in both cases, the rotation between the interior velocity and the bottom friction is neglected in 
     890the present release of \NEMO. 
     891 
     892In the code, the bottom friction is imposed by adding the trend due to the bottom friction to 
     893the general momentum trend in \mdl{dynbfr}. 
     894For the time-split surface pressure gradient algorithm, the momentum trend due to 
     895the barotropic component needs to be handled separately. 
     896For this purpose it is convenient to compute and store coefficients which can be simply combined with 
     897bottom velocities and geometric values to provide the momentum trend due to bottom friction. 
     898These coefficients are computed in \mdl{zdfbfr} and generally take the form $c_b^{\textbf U}$ where: 
    919899\begin{equation} \label{eq:zdfbfr_bdef} 
    920900\frac{\partial {\textbf U_h}}{\partial t} =  
     
    929909\label{subsec:ZDF_bfr_linear} 
    930910 
    931 The linear bottom friction parameterisation (including the special case  
    932 of a free-slip condition) assumes that the bottom friction  
    933 is proportional to the interior velocity (i.e. the velocity of the last  
    934 model level): 
     911The linear bottom friction parameterisation (including the special case of a free-slip condition) assumes that 
     912the bottom friction is proportional to the interior velocity (i.e. the velocity of the last model level): 
    935913\begin{equation} \label{eq:zdfbfr_linear} 
    936914{\cal F}_h^\textbf{U} = \frac{A^{vm}}{e_3} \; \frac{\partial \textbf{U}_h}{\partial k} = r \; \textbf{U}_h^b 
    937915\end{equation} 
    938 where $r$ is a friction coefficient expressed in ms$^{-1}$.  
    939 This coefficient is generally estimated by setting a typical decay time  
    940 $\tau$ in the deep ocean,  
    941 and setting $r = H / \tau$, where $H$ is the ocean depth. Commonly accepted  
    942 values of $\tau$ are of the order of 100 to 200 days \citep{Weatherly_JMR84}.  
    943 A value $\tau^{-1} = 10^{-7}$~s$^{-1}$ equivalent to 115 days, is usually used  
    944 in quasi-geostrophic models. One may consider the linear friction as an  
    945 approximation of quadratic friction, $r \approx 2\;C_D\;U_{av}$ (\citet{Gill1982},  
    946 Eq. 9.6.6). For example, with a drag coefficient $C_D = 0.002$, a typical speed  
    947 of tidal currents of $U_{av} =0.1$~m\;s$^{-1}$, and assuming an ocean depth  
    948 $H = 4000$~m, the resulting friction coefficient is $r = 4\;10^{-4}$~m\;s$^{-1}$.  
    949 This is the default value used in \NEMO. It corresponds to a decay time scale  
    950 of 115~days. It can be changed by specifying \np{rn\_bfri1} (namelist parameter). 
    951  
    952 For the linear friction case the coefficients defined in the general  
    953 expression \autoref{eq:zdfbfr_bdef} are:  
     916where $r$ is a friction coefficient expressed in ms$^{-1}$. 
     917This coefficient is generally estimated by setting a typical decay time $\tau$ in the deep ocean,  
     918and setting $r = H / \tau$, where $H$ is the ocean depth. 
     919Commonly accepted values of $\tau$ are of the order of 100 to 200 days \citep{Weatherly_JMR84}. 
     920A value $\tau^{-1} = 10^{-7}$~s$^{-1}$ equivalent to 115 days, is usually used in quasi-geostrophic models. 
     921One may consider the linear friction as an approximation of quadratic friction, $r \approx 2\;C_D\;U_{av}$ 
     922(\citet{Gill1982}, Eq. 9.6.6). 
     923For example, with a drag coefficient $C_D = 0.002$, a typical speed of tidal currents of $U_{av} =0.1$~m\;s$^{-1}$, 
     924and assuming an ocean depth $H = 4000$~m, the resulting friction coefficient is $r = 4\;10^{-4}$~m\;s$^{-1}$. 
     925This is the default value used in \NEMO. It corresponds to a decay time scale of 115~days. 
     926It can be changed by specifying \np{rn\_bfri1} (namelist parameter). 
     927 
     928For the linear friction case the coefficients defined in the general expression \autoref{eq:zdfbfr_bdef} are:  
    954929\begin{equation} \label{eq:zdfbfr_linbfr_b} 
    955930\begin{split} 
     
    958933\end{split} 
    959934\end{equation} 
    960 When \np{nn\_botfr}\forcode{ = 1}, the value of $r$ used is \np{rn\_bfri1}.  
    961 Setting \np{nn\_botfr}\forcode{ = 0} is equivalent to setting $r=0$ and leads to a free-slip  
    962 bottom boundary condition. These values are assigned in \mdl{zdfbfr}.  
    963 From v3.2 onwards there is support for local enhancement of these values  
    964 via an externally defined 2D mask array (\np{ln\_bfr2d}\forcode{ = .true.}) given 
    965 in the \ifile{bfr\_coef} input NetCDF file. The mask values should vary from 0 to 1.  
    966 Locations with a non-zero mask value will have the friction coefficient increased  
    967 by $mask\_value$*\np{rn\_bfrien}*\np{rn\_bfri1}. 
     935When \np{nn\_botfr}\forcode{ = 1}, the value of $r$ used is \np{rn\_bfri1}. 
     936Setting \np{nn\_botfr}\forcode{ = 0} is equivalent to setting $r=0$ and 
     937leads to a free-slip bottom boundary condition. 
     938These values are assigned in \mdl{zdfbfr}. 
     939From v3.2 onwards there is support for local enhancement of these values via an externally defined 2D mask array 
     940(\np{ln\_bfr2d}\forcode{ = .true.}) given in the \ifile{bfr\_coef} input NetCDF file. 
     941The mask values should vary from 0 to 1. 
     942Locations with a non-zero mask value will have the friction coefficient increased by 
     943$mask\_value$*\np{rn\_bfrien}*\np{rn\_bfri1}. 
    968944 
    969945% ------------------------------------------------------------------------------------------------------------- 
     
    973949\label{subsec:ZDF_bfr_nonlinear} 
    974950 
    975 The non-linear bottom friction parameterisation assumes that the bottom  
    976 friction is quadratic:  
     951The non-linear bottom friction parameterisation assumes that the bottom friction is quadratic:  
    977952\begin{equation} \label{eq:zdfbfr_nonlinear} 
    978953{\cal F}_h^\textbf{U} = \frac{A^{vm}}{e_3 }\frac{\partial \textbf {U}_h  
    979954}{\partial k}=C_D \;\sqrt {u_b ^2+v_b ^2+e_b } \;\; \textbf {U}_h^b  
    980955\end{equation} 
    981 where $C_D$ is a drag coefficient, and $e_b $ a bottom turbulent kinetic energy  
    982 due to tides, internal waves breaking and other short time scale currents.  
    983 A typical value of the drag coefficient is $C_D = 10^{-3} $. As an example,  
    984 the CME experiment \citep{Treguier_JGR92} uses $C_D = 10^{-3}$ and  
    985 $e_b = 2.5\;10^{-3}$m$^2$\;s$^{-2}$, while the FRAM experiment \citep{Killworth1992}  
    986 uses $C_D = 1.4\;10^{-3}$ and $e_b =2.5\;\;10^{-3}$m$^2$\;s$^{-2}$.  
    987 The CME choices have been set as default values (\np{rn\_bfri2} and \np{rn\_bfeb2}  
    988 namelist parameters). 
    989  
    990 As for the linear case, the bottom friction is imposed in the code by  
    991 adding the trend due to the bottom friction to the general momentum trend  
    992 in \mdl{dynbfr}. 
    993 For the non-linear friction case the terms 
    994 computed in \mdl{zdfbfr}  are:  
     956where $C_D$ is a drag coefficient, and $e_b $ a bottom turbulent kinetic energy due to tides, 
     957internal waves breaking and other short time scale currents. 
     958A typical value of the drag coefficient is $C_D = 10^{-3} $. 
     959As an example, the CME experiment \citep{Treguier_JGR92} uses $C_D = 10^{-3}$ and 
     960$e_b = 2.5\;10^{-3}$m$^2$\;s$^{-2}$, while the FRAM experiment \citep{Killworth1992} uses $C_D = 1.4\;10^{-3}$ and 
     961$e_b =2.5\;\;10^{-3}$m$^2$\;s$^{-2}$. 
     962The CME choices have been set as default values (\np{rn\_bfri2} and \np{rn\_bfeb2} namelist parameters). 
     963 
     964As for the linear case, the bottom friction is imposed in the code by adding the trend due to 
     965the bottom friction to the general momentum trend in \mdl{dynbfr}. 
     966For the non-linear friction case the terms computed in \mdl{zdfbfr} are: 
    995967\begin{equation} \label{eq:zdfbfr_nonlinbfr} 
    996968\begin{split} 
     
    1000972\end{equation} 
    1001973 
    1002 The coefficients that control the strength of the non-linear bottom friction are 
    1003 initialised as namelist parameters: $C_D$= \np{rn\_bfri2}, and $e_b$ =\np{rn\_bfeb2}. 
    1004 Note for applications which treat tides explicitly a low or even zero value of 
    1005 \np{rn\_bfeb2} is recommended. From v3.2 onwards a local enhancement of $C_D$ is possible 
    1006 via an externally defined 2D mask array (\np{ln\_bfr2d}\forcode{ = .true.}).  This works in the same way 
    1007 as for the linear bottom friction case with non-zero masked locations increased by 
     974The coefficients that control the strength of the non-linear bottom friction are initialised as namelist parameters: 
     975$C_D$= \np{rn\_bfri2}, and $e_b$ =\np{rn\_bfeb2}. 
     976Note for applications which treat tides explicitly a low or even zero value of \np{rn\_bfeb2} is recommended. 
     977From v3.2 onwards a local enhancement of $C_D$ is possible via an externally defined 2D mask array 
     978(\np{ln\_bfr2d}\forcode{ = .true.}). 
     979This works in the same way as for the linear bottom friction case with non-zero masked locations increased by 
    1008980$mask\_value$*\np{rn\_bfrien}*\np{rn\_bfri2}. 
    1009981 
     
    1015987\label{subsec:ZDF_bfr_loglayer} 
    1016988 
    1017 In the non-linear bottom friction case, the drag coefficient, $C_D$, can be optionally 
    1018 enhanced using a "law of the wall" scaling. If  \np{ln\_loglayer} = .true., $C_D$ is no 
    1019 longer constant but is related to the thickness of the last wet layer in each column by: 
    1020  
     989In the non-linear bottom friction case, the drag coefficient, $C_D$, can be optionally enhanced using 
     990a "law of the wall" scaling. 
     991If  \np{ln\_loglayer} = .true., $C_D$ is no longer constant but is related to the thickness of 
     992the last wet layer in each column by: 
    1021993\begin{equation} 
    1022994C_D = \left ( {\kappa \over {\rm log}\left ( 0.5e_{3t}/rn\_bfrz0 \right ) } \right )^2 
    1023995\end{equation} 
    1024996 
    1025 \noindent where $\kappa$ is the von-Karman constant and \np{rn\_bfrz0} is a roughness 
    1026 length provided via the namelist. 
     997\noindent where $\kappa$ is the von-Karman constant and \np{rn\_bfrz0} is a roughness length provided via 
     998the namelist. 
    1027999 
    10281000For stability, the drag coefficient is bounded such that it is kept greater or equal to 
    1029 the base \np{rn\_bfri2} value and it is not allowed to exceed the value of an additional 
    1030 namelist parameter: \np{rn\_bfri2\_max}, i.e.: 
    1031  
     1001the base \np{rn\_bfri2} value and it is not allowed to exceed the value of an additional namelist parameter: 
     1002\np{rn\_bfri2\_max}, i.e.: 
    10321003\begin{equation} 
    10331004rn\_bfri2 \leq C_D \leq rn\_bfri2\_max 
    10341005\end{equation} 
    10351006 
    1036 \noindent Note also that a log-layer enhancement can also be applied to the top boundary 
    1037 friction if under ice-shelf cavities are in use (\np{ln\_isfcav}\forcode{ = .true.}).  In this case, the 
    1038 relevant namelist parameters are \np{rn\_tfrz0}, \np{rn\_tfri2} 
    1039 and \np{rn\_tfri2\_max}. 
     1007\noindent Note also that a log-layer enhancement can also be applied to the top boundary friction if 
     1008under ice-shelf cavities are in use (\np{ln\_isfcav}\forcode{ = .true.}). 
     1009In this case, the relevant namelist parameters are \np{rn\_tfrz0}, \np{rn\_tfri2} and \np{rn\_tfri2\_max}. 
    10401010 
    10411011% ------------------------------------------------------------------------------------------------------------- 
     
    10451015\label{subsec:ZDF_bfr_stability} 
    10461016 
    1047 Some care needs to exercised over the choice of parameters to ensure that the 
    1048 implementation of bottom friction does not induce numerical instability. For  
    1049 the purposes of stability analysis, an approximation to \autoref{eq:zdfbfr_flux2} 
    1050 is: 
     1017Some care needs to exercised over the choice of parameters to ensure that the implementation of 
     1018bottom friction does not induce numerical instability. 
     1019For the purposes of stability analysis, an approximation to \autoref{eq:zdfbfr_flux2} is: 
    10511020\begin{equation} \label{eq:Eqn_bfrstab} 
    10521021\begin{split} 
     
    10551024\end{split} 
    10561025\end{equation} 
    1057 \noindent where linear bottom friction and a leapfrog timestep have been assumed.  
     1026\noindent where linear bottom friction and a leapfrog timestep have been assumed. 
    10581027To ensure that the bottom friction cannot reverse the direction of flow it is necessary to have: 
    10591028\begin{equation} 
     
    10641033r\frac{2\rdt}{e_{3u}} < 1 \qquad  \Rightarrow \qquad r < \frac{e_{3u}}{2\rdt}\\ 
    10651034\end{equation} 
    1066 This same inequality can also be derived in the non-linear bottom friction case  
    1067 if a velocity of 1 m.s$^{-1}$ is assumed. Alternatively, this criterion can be  
    1068 rearranged to suggest a minimum bottom box thickness to ensure stability: 
     1035This same inequality can also be derived in the non-linear bottom friction case if 
     1036a velocity of 1 m.s$^{-1}$ is assumed. 
     1037Alternatively, this criterion can be rearranged to suggest a minimum bottom box thickness to ensure stability: 
    10691038\begin{equation} 
    10701039e_{3u} > 2\;r\;\rdt 
    10711040\end{equation} 
    1072 \noindent which it may be necessary to impose if partial steps are being used.  
    1073 For example, if $|u| = 1$ m.s$^{-1}$, $rdt = 1800$ s, $r = 10^{-3}$ then 
    1074 $e_{3u}$ should be greater than 3.6 m. For most applications, with physically 
    1075 sensible parameters these restrictions should not be of concern. But  
    1076 caution may be necessary if attempts are made to locally enhance the bottom 
    1077 friction parameters.  
    1078 To ensure stability limits are imposed on the bottom friction coefficients both during  
    1079 initialisation and at each time step. Checks at initialisation are made in \mdl{zdfbfr}  
    1080 (assuming a 1 m.s$^{-1}$ velocity in the non-linear case). 
    1081 The number of breaches of the stability criterion are reported as well as the minimum  
    1082 and maximum values that have been set. The criterion is also checked at each time step,  
    1083 using the actual velocity, in \mdl{dynbfr}. Values of the bottom friction coefficient are  
    1084 reduced as necessary to ensure stability; these changes are not reported. 
     1041\noindent which it may be necessary to impose if partial steps are being used. 
     1042For example, if $|u| = 1$ m.s$^{-1}$, $rdt = 1800$ s, $r = 10^{-3}$ then $e_{3u}$ should be greater than 3.6 m. 
     1043For most applications, with physically sensible parameters these restrictions should not be of concern. 
     1044But caution may be necessary if attempts are made to locally enhance the bottom friction parameters.  
     1045To ensure stability limits are imposed on the bottom friction coefficients both 
     1046during initialisation and at each time step. 
     1047Checks at initialisation are made in \mdl{zdfbfr} (assuming a 1 m.s$^{-1}$ velocity in the non-linear case). 
     1048The number of breaches of the stability criterion are reported as well as 
     1049the minimum and maximum values that have been set. 
     1050The criterion is also checked at each time step, using the actual velocity, in \mdl{dynbfr}. 
     1051Values of the bottom friction coefficient are reduced as necessary to ensure stability; 
     1052these changes are not reported. 
    10851053 
    10861054Limits on the bottom friction coefficient are not imposed if the user has elected to 
    1087 handle the bottom friction implicitly (see \autoref{subsec:ZDF_bfr_imp}). The number of potential 
    1088 breaches of the explicit stability criterion are still reported for information purposes. 
     1055handle the bottom friction implicitly (see \autoref{subsec:ZDF_bfr_imp}). 
     1056The number of potential breaches of the explicit stability criterion are still reported for information purposes. 
    10891057 
    10901058% ------------------------------------------------------------------------------------------------------------- 
     
    10941062\label{subsec:ZDF_bfr_imp} 
    10951063 
    1096 An optional implicit form of bottom friction has been implemented to improve 
    1097 model stability. We recommend this option for shelf sea and coastal ocean applications, especially  
    1098 for split-explicit time splitting. This option can be invoked by setting \np{ln\_bfrimp}  
    1099 to \forcode{.true.} in the \textit{nambfr} namelist. This option requires \np{ln\_zdfexp} to be \forcode{.false.}  
    1100 in the \textit{namzdf} namelist.  
    1101  
    1102 This implementation is realised in \mdl{dynzdf\_imp} and \mdl{dynspg\_ts}. In \mdl{dynzdf\_imp}, the  
    1103 bottom boundary condition is implemented implicitly. 
     1064An optional implicit form of bottom friction has been implemented to improve model stability. 
     1065We recommend this option for shelf sea and coastal ocean applications, especially for split-explicit time splitting. 
     1066This option can be invoked by setting \np{ln\_bfrimp} to \forcode{.true.} in the \textit{nambfr} namelist. 
     1067This option requires \np{ln\_zdfexp} to be \forcode{.false.} in the \textit{namzdf} namelist.  
     1068 
     1069This implementation is realised in \mdl{dynzdf\_imp} and \mdl{dynspg\_ts}. In \mdl{dynzdf\_imp}, 
     1070the bottom boundary condition is implemented implicitly. 
    11041071 
    11051072\begin{equation} \label{eq:dynzdf_bfr} 
     
    11081075\end{equation} 
    11091076 
    1110 where $mbk$ is the layer number of the bottom wet layer. superscript $n+1$ means the velocity used in the 
    1111 friction formula is to be calculated, so, it is implicit. 
    1112  
    1113 If split-explicit time splitting is used, care must be taken to avoid the double counting of 
    1114 the bottom friction in the 2-D barotropic momentum equations. As NEMO only updates the barotropic  
    1115 pressure gradient and Coriolis' forcing terms in the 2-D barotropic calculation, we need to remove 
    1116 the bottom friction induced by these two terms which has been included in the 3-D momentum trend  
    1117 and update it with the latest value. On the other hand, the bottom friction contributed by the 
    1118 other terms (e.g. the advection term, viscosity term) has been included in the 3-D momentum equations 
    1119 and should not be added in the 2-D barotropic mode. 
    1120  
    1121 The implementation of the implicit bottom friction in \mdl{dynspg\_ts} is done in two steps as the 
    1122 following: 
     1077where $mbk$ is the layer number of the bottom wet layer. 
     1078Superscript $n+1$ means the velocity used in the friction formula is to be calculated, so, it is implicit. 
     1079 
     1080If split-explicit time splitting is used, care must be taken to avoid the double counting of the bottom friction in 
     1081the 2-D barotropic momentum equations. 
     1082As NEMO only updates the barotropic pressure gradient and Coriolis' forcing terms in the 2-D barotropic calculation, 
     1083we need to remove the bottom friction induced by these two terms which has been included in the 3-D momentum trend  
     1084and update it with the latest value. 
     1085On the other hand, the bottom friction contributed by the other terms 
     1086(e.g. the advection term, viscosity term) has been included in the 3-D momentum equations and 
     1087should not be added in the 2-D barotropic mode. 
     1088 
     1089The implementation of the implicit bottom friction in \mdl{dynspg\_ts} is done in two steps as the following: 
    11231090 
    11241091\begin{equation} \label{eq:dynspg_ts_bfr1} 
     
    11321099\end{equation} 
    11331100 
    1134 where $\textbf{T}$ is the vertical integrated 3-D momentum trend. We assume the leap-frog time-stepping 
    1135 is used here. $\Delta t$ is the barotropic mode time step and $\Delta t_{bc}$ is the baroclinic mode time step. 
    1136  $c_{b}$ is the friction coefficient. $\eta$ is the sea surface level calculated in the barotropic loops 
    1137 while $\eta^{'}$ is the sea surface level used in the 3-D baroclinic mode. $\textbf{u}_{b}$ is the bottom 
    1138 layer horizontal velocity. 
     1101where $\textbf{T}$ is the vertical integrated 3-D momentum trend. 
     1102We assume the leap-frog time-stepping is used here. 
     1103$\Delta t$ is the barotropic mode time step and $\Delta t_{bc}$ is the baroclinic mode time step. 
     1104$c_{b}$ is the friction coefficient. 
     1105$\eta$ is the sea surface level calculated in the barotropic loops while $\eta^{'}$ is the sea surface level used in 
     1106the 3-D baroclinic mode. 
     1107$\textbf{u}_{b}$ is the bottom layer horizontal velocity. 
    11391108 
    11401109 
     
    11481117\label{subsec:ZDF_bfr_ts} 
    11491118 
    1150 When calculating the momentum trend due to bottom friction in \mdl{dynbfr}, the 
    1151 bottom velocity at the before time step is used. This velocity includes both the 
    1152 baroclinic and barotropic components which is appropriate when using either the 
    1153 explicit or filtered surface pressure gradient algorithms (\key{dynspg\_exp} or  
    1154 \key{dynspg\_flt}). Extra attention is required, however, when using  
    1155 split-explicit time stepping (\key{dynspg\_ts}). In this case the free surface  
    1156 equation is solved with a small time step \np{rn\_rdt}/\np{nn\_baro}, while the three  
    1157 dimensional prognostic variables are solved with the longer time step  
    1158 of \np{rn\_rdt} seconds. The trend in the barotropic momentum due to bottom  
    1159 friction appropriate to this method is that given by the selected parameterisation  
    1160 ($i.e.$ linear or non-linear bottom friction) computed with the evolving velocities  
    1161 at each barotropic timestep.  
    1162  
    1163 In the case of non-linear bottom friction, we have elected to partially linearise  
    1164 the problem by keeping the coefficients fixed throughout the barotropic  
    1165 time-stepping to those computed in \mdl{zdfbfr} using the now timestep.  
     1119When calculating the momentum trend due to bottom friction in \mdl{dynbfr}, 
     1120the bottom velocity at the before time step is used. 
     1121This velocity includes both the baroclinic and barotropic components which is appropriate when 
     1122using either the explicit or filtered surface pressure gradient algorithms 
     1123(\key{dynspg\_exp} or \key{dynspg\_flt}). 
     1124Extra attention is required, however, when using split-explicit time stepping (\key{dynspg\_ts}). 
     1125In this case the free surface equation is solved with a small time step \np{rn\_rdt}/\np{nn\_baro}, 
     1126while the three dimensional prognostic variables are solved with the longer time step of \np{rn\_rdt} seconds. 
     1127The trend in the barotropic momentum due to bottom friction appropriate to this method is that given by 
     1128the selected parameterisation ($i.e.$ linear or non-linear bottom friction) computed with 
     1129the evolving velocities at each barotropic timestep.  
     1130 
     1131In the case of non-linear bottom friction, we have elected to partially linearise the problem by 
     1132keeping the coefficients fixed throughout the barotropic time-stepping to those computed in 
     1133\mdl{zdfbfr} using the now timestep. 
    11661134This decision allows an efficient use of the $c_b^{\vect{U}}$ coefficients to: 
    11671135 
    11681136\begin{enumerate} 
    1169 \item On entry to \rou{dyn\_spg\_ts}, remove the contribution of the before 
    1170 barotropic velocity to the bottom friction component of the vertically 
    1171 integrated momentum trend. Note the same stability check that is carried out  
    1172 on the bottom friction coefficient in \mdl{dynbfr} has to be applied here to 
    1173 ensure that the trend removed matches that which was added in \mdl{dynbfr}. 
    1174 \item At each barotropic step, compute the contribution of the current barotropic 
    1175 velocity to the trend due to bottom friction. Add this contribution to the 
    1176 vertically integrated momentum trend. This contribution is handled implicitly which 
    1177 eliminates the need to impose a stability criteria on the values of the bottom friction 
    1178 coefficient within the barotropic loop.  
     1137\item On entry to \rou{dyn\_spg\_ts}, remove the contribution of the before barotropic velocity to 
     1138  the bottom friction component of the vertically integrated momentum trend. 
     1139  Note the same stability check that is carried out on the bottom friction coefficient in \mdl{dynbfr} has to 
     1140  be applied here to ensure that the trend removed matches that which was added in \mdl{dynbfr}. 
     1141\item At each barotropic step, compute the contribution of the current barotropic velocity to 
     1142  the trend due to bottom friction. 
     1143  Add this contribution to the vertically integrated momentum trend. 
     1144  This contribution is handled implicitly which eliminates the need to impose a stability criteria on 
     1145  the values of the bottom friction coefficient within the barotropic loop.  
    11791146\end{enumerate} 
    11801147 
    1181 Note that the use of an implicit formulation within the barotropic loop 
    1182 for the bottom friction trend means that any limiting of the bottom friction coefficient  
    1183 in \mdl{dynbfr} does not adversely affect the solution when using split-explicit time  
    1184 splitting. This is because the major contribution to bottom friction is likely to come from  
    1185 the barotropic component which uses the unrestricted value of the coefficient. However, if the 
    1186 limiting is thought to be having a major effect (a more likely prospect in coastal and shelf seas 
    1187 applications) then the fully implicit form of the bottom friction should be used (see \autoref{subsec:ZDF_bfr_imp} )  
     1148Note that the use of an implicit formulation within the barotropic loop for the bottom friction trend means that 
     1149any limiting of the bottom friction coefficient in \mdl{dynbfr} does not adversely affect the solution when 
     1150using split-explicit time splitting. 
     1151This is because the major contribution to bottom friction is likely to come from the barotropic component which 
     1152uses the unrestricted value of the coefficient. 
     1153However, if the limiting is thought to be having a major effect 
     1154(a more likely prospect in coastal and shelf seas applications) then 
     1155the fully implicit form of the bottom friction should be used (see \autoref{subsec:ZDF_bfr_imp}) 
    11881156which can be selected by setting \np{ln\_bfrimp} $=$ \forcode{.true.}. 
    11891157 
     
    11931161\end{equation} 
    11941162where $\bar U$ is the barotropic velocity, $H_e$ is the full depth (including sea surface height),  
    1195 $c_b^u$ is the bottom friction coefficient as calculated in \rou{zdf\_bfr} and $RHS$ represents  
    1196 all the components to the vertically integrated momentum trend except for that due to bottom friction. 
     1163$c_b^u$ is the bottom friction coefficient as calculated in \rou{zdf\_bfr} and 
     1164$RHS$ represents all the components to the vertically integrated momentum trend except for 
     1165that due to bottom friction. 
    11971166 
    11981167 
     
    12181187 
    12191188Options are defined through the  \ngn{namzdf\_tmx} namelist variables. 
    1220 The parameterization of tidal mixing follows the general formulation for  
    1221 the vertical eddy diffusivity proposed by \citet{St_Laurent_al_GRL02} and  
    1222 first introduced in an OGCM by \citep{Simmons_al_OM04}.  
    1223 In this formulation an additional vertical diffusivity resulting from internal tide breaking,  
    1224 $A^{vT}_{tides}$ is expressed as a function of $E(x,y)$, the energy transfer from barotropic  
    1225 tides to baroclinic tides :  
     1189The parameterization of tidal mixing follows the general formulation for the vertical eddy diffusivity proposed by 
     1190\citet{St_Laurent_al_GRL02} and first introduced in an OGCM by \citep{Simmons_al_OM04}.  
     1191In this formulation an additional vertical diffusivity resulting from internal tide breaking, 
     1192$A^{vT}_{tides}$ is expressed as a function of $E(x,y)$, 
     1193the energy transfer from barotropic tides to baroclinic tides: 
    12261194\begin{equation} \label{eq:Ktides} 
    12271195A^{vT}_{tides} =  q \,\Gamma \,\frac{ E(x,y) \, F(z) }{ \rho \, N^2 } 
    12281196\end{equation} 
    1229 where $\Gamma$ is the mixing efficiency, $N$ the Brunt-Vais\"{a}l\"{a} frequency  
    1230 (see \autoref{subsec:TRA_bn2}), $\rho$ the density, $q$ the tidal dissipation efficiency,  
    1231 and $F(z)$ the vertical structure function.  
    1232  
    1233 The mixing efficiency of turbulence is set by $\Gamma$ (\np{rn\_me} namelist parameter) 
    1234 and is usually taken to be the canonical value of $\Gamma = 0.2$ (Osborn 1980).  
    1235 The tidal dissipation efficiency is given by the parameter $q$ (\np{rn\_tfe} namelist parameter)  
    1236 represents the part of the internal wave energy flux $E(x, y)$ that is dissipated locally,  
    1237 with the remaining $1-q$ radiating away as low mode internal waves and  
    1238 contributing to the background internal wave field. A value of $q=1/3$ is typically used   
    1239 \citet{St_Laurent_al_GRL02}. 
    1240 The vertical structure function $F(z)$ models the distribution of the turbulent mixing in the vertical.  
    1241 It is implemented as a simple exponential decaying upward away from the bottom,  
    1242 with a vertical scale of $h_o$ (\np{rn\_htmx} namelist parameter, with a typical value of $500\,m$) \citep{St_Laurent_Nash_DSR04},  
     1197where $\Gamma$ is the mixing efficiency, $N$ the Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}), 
     1198$\rho$ the density, $q$ the tidal dissipation efficiency, and $F(z)$ the vertical structure function.  
     1199 
     1200The mixing efficiency of turbulence is set by $\Gamma$ (\np{rn\_me} namelist parameter) and 
     1201is usually taken to be the canonical value of $\Gamma = 0.2$ (Osborn 1980).  
     1202The tidal dissipation efficiency is given by the parameter $q$ (\np{rn\_tfe} namelist parameter) 
     1203represents the part of the internal wave energy flux $E(x, y)$ that is dissipated locally, 
     1204with the remaining $1-q$ radiating away as low mode internal waves and 
     1205contributing to the background internal wave field. 
     1206A value of $q=1/3$ is typically used \citet{St_Laurent_al_GRL02}. 
     1207The vertical structure function $F(z)$ models the distribution of the turbulent mixing in the vertical. 
     1208It is implemented as a simple exponential decaying upward away from the bottom, 
     1209with a vertical scale of $h_o$ (\np{rn\_htmx} namelist parameter, 
     1210with a typical value of $500\,m$) \citep{St_Laurent_Nash_DSR04},  
    12431211\begin{equation} \label{eq:Fz} 
    12441212F(i,j,k) = \frac{ e^{ -\frac{H+z}{h_o} } }{ h_o \left( 1- e^{ -\frac{H}{h_o} } \right) } 
     
    12461214and is normalized so that vertical integral over the water column is unity.  
    12471215 
    1248 The associated vertical viscosity is calculated from the vertical  
    1249 diffusivity assuming a Prandtl number of 1, $i.e.$ $A^{vm}_{tides}=A^{vT}_{tides}$.  
    1250 In the limit of $N \rightarrow 0$ (or becoming negative), the vertical diffusivity  
    1251 is capped at $300\,cm^2/s$ and impose a lower limit on $N^2$ of \np{rn\_n2min}  
    1252 usually set to $10^{-8} s^{-2}$. These bounds are usually rarely encountered. 
    1253  
    1254 The internal wave energy map, $E(x, y)$ in \autoref{eq:Ktides}, is derived  
    1255 from a barotropic model of the tides utilizing a parameterization of the  
    1256 conversion of barotropic tidal energy into internal waves.  
    1257 The essential goal of the parameterization is to represent the momentum  
    1258 exchange between the barotropic tides and the unrepresented internal waves  
    1259 induced by the tidal flow over rough topography in a stratified ocean.  
    1260 In the current version of \NEMO, the map is built from the output of  
     1216The associated vertical viscosity is calculated from the vertical diffusivity assuming a Prandtl number of 1, 
     1217$i.e.$ $A^{vm}_{tides}=A^{vT}_{tides}$. 
     1218In the limit of $N \rightarrow 0$ (or becoming negative), the vertical diffusivity is capped at $300\,cm^2/s$ and 
     1219impose a lower limit on $N^2$ of \np{rn\_n2min} usually set to $10^{-8} s^{-2}$. 
     1220These bounds are usually rarely encountered. 
     1221 
     1222The internal wave energy map, $E(x, y)$ in \autoref{eq:Ktides}, is derived from a barotropic model of 
     1223the tides utilizing a parameterization of the conversion of barotropic tidal energy into internal waves. 
     1224The essential goal of the parameterization is to represent the momentum exchange between the barotropic tides and 
     1225the unrepresented internal waves induced by the tidal flow over rough topography in a stratified ocean. 
     1226In the current version of \NEMO, the map is built from the output of 
    12611227the barotropic global ocean tide model MOG2D-G \citep{Carrere_Lyard_GRL03}. 
    1262 This model provides the dissipation associated with internal wave energy for the M2 and K1  
    1263 tides component (\autoref{fig:ZDF_M2_K1_tmx}). The S2 dissipation is simply approximated 
    1264 as being $1/4$ of the M2 one. The internal wave energy is thus : $E(x, y) = 1.25 E_{M2} + E_{K1}$.  
    1265 Its global mean value is $1.1$ TW, in agreement with independent estimates  
    1266 \citep{Egbert_Ray_Nat00, Egbert_Ray_JGR01}.  
     1228This model provides the dissipation associated with internal wave energy for the M2 and K1 tides component 
     1229(\autoref{fig:ZDF_M2_K1_tmx}). 
     1230The S2 dissipation is simply approximated as being $1/4$ of the M2 one. 
     1231The internal wave energy is thus : $E(x, y) = 1.25 E_{M2} + E_{K1}$. 
     1232Its global mean value is $1.1$ TW, 
     1233in agreement with independent estimates \citep{Egbert_Ray_Nat00, Egbert_Ray_JGR01}.  
    12671234 
    12681235%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    12811248 
    12821249When the Indonesian Through Flow (ITF) area is included in the model domain, 
    1283 a specific treatment of tidal induced mixing in this area can be used.  
    1284 It is activated through the namelist logical \np{ln\_tmx\_itf}, and the user must provide 
    1285 an input NetCDF file, \ifile{mask\_itf}, which contains a mask array defining the ITF area 
    1286 where the specific treatment is applied. 
    1287  
    1288 When \np{ln\_tmx\_itf}\forcode{ = .true.}, the two key parameters $q$ and $F(z)$ are adjusted following  
     1250a specific treatment of tidal induced mixing in this area can be used. 
     1251It is activated through the namelist logical \np{ln\_tmx\_itf}, and the user must provide an input NetCDF file, 
     1252\ifile{mask\_itf}, which contains a mask array defining the ITF area where the specific treatment is applied. 
     1253 
     1254When \np{ln\_tmx\_itf}\forcode{ = .true.}, the two key parameters $q$ and $F(z)$ are adjusted following 
    12891255the parameterisation developed by \citet{Koch-Larrouy_al_GRL07}: 
    12901256 
    1291 First, the Indonesian archipelago is a complex geographic region  
    1292 with a series of large, deep, semi-enclosed basins connected via  
    1293 numerous narrow straits. Once generated, internal tides remain  
    1294 confined within this semi-enclosed area and hardly radiate away.  
    1295 Therefore all the internal tides energy is consumed within this area.  
     1257First, the Indonesian archipelago is a complex geographic region with a series of 
     1258large, deep, semi-enclosed basins connected via numerous narrow straits. 
     1259Once generated, internal tides remain confined within this semi-enclosed area and hardly radiate away. 
     1260Therefore all the internal tides energy is consumed within this area. 
    12961261So it is assumed that $q = 1$, $i.e.$ all the energy generated is available for mixing. 
    1297 Note that for test purposed, the ITF tidal dissipation efficiency is a  
    1298 namelist parameter (\np{rn\_tfe\_itf}). A value of $1$ or close to is 
    1299 this recommended for this parameter. 
    1300  
    1301 Second, the vertical structure function, $F(z)$, is no more associated 
    1302 with a bottom intensification of the mixing, but with a maximum of  
    1303 energy available within the thermocline. \citet{Koch-Larrouy_al_GRL07}  
    1304 have suggested that the vertical distribution of the energy dissipation  
    1305 proportional to $N^2$ below the core of the thermocline and to $N$ above.  
     1262Note that for test purposed, the ITF tidal dissipation efficiency is a namelist parameter (\np{rn\_tfe\_itf}). 
     1263A value of $1$ or close to is this recommended for this parameter. 
     1264 
     1265Second, the vertical structure function, $F(z)$, is no more associated with a bottom intensification of the mixing, 
     1266but with a maximum of energy available within the thermocline. 
     1267\citet{Koch-Larrouy_al_GRL07} have suggested that the vertical distribution of 
     1268the energy dissipation proportional to $N^2$ below the core of the thermocline and to $N$ above.  
    13061269The resulting $F(z)$ is: 
    13071270\begin{equation} \label{eq:Fz_itf} 
     
    13131276 
    13141277Averaged over the ITF area, the resulting tidal mixing coefficient is $1.5\,cm^2/s$,  
    1315 which agrees with the independent estimates inferred from observations.  
    1316 Introduced in a regional OGCM, the parameterization improves the water mass  
    1317 characteristics in the different Indonesian seas, suggesting that the horizontal  
    1318 and vertical distributions of the mixing are adequately prescribed  
    1319 \citep{Koch-Larrouy_al_GRL07, Koch-Larrouy_al_OD08a, Koch-Larrouy_al_OD08b}. 
    1320 Note also that such a parameterisation has a significant impact on the behaviour  
    1321 of global coupled GCMs \citep{Koch-Larrouy_al_CD10}. 
     1278which agrees with the independent estimates inferred from observations. 
     1279Introduced in a regional OGCM, the parameterization improves the water mass characteristics in 
     1280the different Indonesian seas, suggesting that the horizontal and vertical distributions of 
     1281the mixing are adequately prescribed \citep{Koch-Larrouy_al_GRL07, Koch-Larrouy_al_OD08a, Koch-Larrouy_al_OD08b}. 
     1282Note also that such a parameterisation has a significant impact on the behaviour of 
     1283global coupled GCMs \citep{Koch-Larrouy_al_CD10}. 
    13221284 
    13231285 
     
    13331295%-------------------------------------------------------------------------------------------------------------- 
    13341296 
    1335 The parameterization of mixing induced by breaking internal waves is a generalization  
    1336 of the approach originally proposed by \citet{St_Laurent_al_GRL02}.  
    1337 A three-dimensional field of internal wave energy dissipation $\epsilon(x,y,z)$ is first constructed,  
     1297The parameterization of mixing induced by breaking internal waves is a generalization of 
     1298the approach originally proposed by \citet{St_Laurent_al_GRL02}. 
     1299A three-dimensional field of internal wave energy dissipation $\epsilon(x,y,z)$ is first constructed, 
    13381300and the resulting diffusivity is obtained as  
    13391301\begin{equation} \label{eq:Kwave} 
    13401302A^{vT}_{wave} =  R_f \,\frac{ \epsilon }{ \rho \, N^2 } 
    13411303\end{equation} 
    1342 where $R_f$ is the mixing efficiency and $\epsilon$ is a specified three dimensional distribution  
    1343 of the energy available for mixing. If the \np{ln\_mevar} namelist parameter is set to false,  
    1344 the mixing efficiency is taken as constant and equal to 1/6 \citep{Osborn_JPO80}.  
    1345 In the opposite (recommended) case, $R_f$ is instead a function of the turbulence intensity parameter  
    1346 $Re_b = \frac{ \epsilon}{\nu \, N^2}$, with $\nu$ the molecular viscosity of seawater,  
    1347 following the model of \cite{Bouffard_Boegman_DAO2013}  
    1348 and the implementation of \cite{de_lavergne_JPO2016_efficiency}. 
    1349 Note that $A^{vT}_{wave}$ is bounded by $10^{-2}\,m^2/s$, a limit that is often reached when the mixing efficiency is constant. 
     1304where $R_f$ is the mixing efficiency and $\epsilon$ is a specified three dimensional distribution of 
     1305the energy available for mixing. 
     1306If the \np{ln\_mevar} namelist parameter is set to false, the mixing efficiency is taken as constant and 
     1307equal to 1/6 \citep{Osborn_JPO80}. 
     1308In the opposite (recommended) case, $R_f$ is instead a function of 
     1309the turbulence intensity parameter $Re_b = \frac{ \epsilon}{\nu \, N^2}$, 
     1310with $\nu$ the molecular viscosity of seawater, following the model of \cite{Bouffard_Boegman_DAO2013} and 
     1311the implementation of \cite{de_lavergne_JPO2016_efficiency}. 
     1312Note that $A^{vT}_{wave}$ is bounded by $10^{-2}\,m^2/s$, a limit that is often reached when 
     1313the mixing efficiency is constant. 
    13501314 
    13511315In addition to the mixing efficiency, the ratio of salt to heat diffusivities can chosen to vary  
    1352 as a function of $Re_b$ by setting the \np{ln\_tsdiff} parameter to true, a recommended choice).  
    1353 This parameterization of differential mixing, due to \cite{Jackson_Rehmann_JPO2014},  
     1316as a function of $Re_b$ by setting the \np{ln\_tsdiff} parameter to true, a recommended choice.  
     1317This parameterization of differential mixing, due to \cite{Jackson_Rehmann_JPO2014}, 
    13541318is implemented as in \cite{de_lavergne_JPO2016_efficiency}. 
    13551319 
    1356 The three-dimensional distribution of the energy available for mixing, $\epsilon(i,j,k)$, is constructed  
    1357 from three static maps of column-integrated internal wave energy dissipation, $E_{cri}(i,j)$,  
    1358 $E_{pyc}(i,j)$, and $E_{bot}(i,j)$, combined to three corresponding vertical structures  
     1320The three-dimensional distribution of the energy available for mixing, $\epsilon(i,j,k)$, 
     1321is constructed from three static maps of column-integrated internal wave energy dissipation, 
     1322$E_{cri}(i,j)$, $E_{pyc}(i,j)$, and $E_{bot}(i,j)$, combined to three corresponding vertical structures 
    13591323(de Lavergne et al., in prep): 
    13601324\begin{align*} 
     
    13631327F_{bot}(i,j,k) &\propto N^2 \, e^{- h_{wkb} / h_{bot} } 
    13641328\end{align*}  
    1365 In the above formula, $h_{ab}$ denotes the height above bottom,  
     1329In the above formula, $h_{ab}$ denotes the height above bottom, 
    13661330$h_{wkb}$ denotes the WKB-stretched height above bottom, defined by 
    13671331\begin{equation*} 
    13681332h_{wkb} = H \, \frac{ \int_{-H}^{z} N \, dz' } { \int_{-H}^{\eta} N \, dz'  } \; , 
    13691333\end{equation*} 
    1370 The $n_p$ parameter (given by \np{nn\_zpyc} in \ngn{namzdf\_tmx\_new} namelist)  controls the stratification-dependence of the pycnocline-intensified dissipation.  
     1334The $n_p$ parameter (given by \np{nn\_zpyc} in \ngn{namzdf\_tmx\_new} namelist) 
     1335controls the stratification-dependence of the pycnocline-intensified dissipation. 
    13711336It can take values of 1 (recommended) or 2. 
    1372 Finally, the vertical structures $F_{cri}$ and $F_{bot}$ require the specification of  
    1373 the decay scales $h_{cri}(i,j)$ and $h_{bot}(i,j)$, which are defined by two additional input maps.  
    1374 $h_{cri}$ is related to the large-scale topography of the ocean (etopo2)  
    1375 and $h_{bot}$ is a function of the energy flux $E_{bot}$, the characteristic horizontal scale of  
     1337Finally, the vertical structures $F_{cri}$ and $F_{bot}$ require the specification of 
     1338the decay scales $h_{cri}(i,j)$ and $h_{bot}(i,j)$, which are defined by two additional input maps. 
     1339$h_{cri}$ is related to the large-scale topography of the ocean (etopo2) and 
     1340$h_{bot}$ is a function of the energy flux $E_{bot}$, the characteristic horizontal scale of 
    13761341the abyssal hill topography \citep{Goff_JGR2010} and the latitude. 
    13771342 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_conservation.tex

    r9407 r10368  
    99\minitoc 
    1010 
    11 The continuous equations of motion have many analytic properties. Many  
    12 quantities (total mass, energy, enstrophy, etc.) are strictly conserved in  
    13 the inviscid and unforced limit, while ocean physics conserve the total  
    14 quantities on which they act (momentum, temperature, salinity) but dissipate  
    15 their total variance (energy, enstrophy, etc.). Unfortunately, the finite  
    16 difference form of these equations is not guaranteed to retain all these  
    17 important properties. In constructing the finite differencing schemes, we  
    18 wish to ensure that certain integral constraints will be maintained. In  
    19 particular, it is desirable to construct the finite difference equations so  
    20 that horizontal kinetic energy and/or potential enstrophy of horizontally  
    21 non-divergent flow, and variance of temperature and salinity will be  
    22 conserved in the absence of dissipative effects and forcing. \citet{Arakawa1966}  
    23 has first pointed out the advantage of this approach. He showed that if  
    24 integral constraints on energy are maintained, the computation will be free  
    25 of the troublesome "non linear" instability originally pointed out by  
    26 \citet{Phillips1959}. A consistent formulation of the energetic properties is  
    27 also extremely important in carrying out long-term numerical simulations for  
    28 an oceanographic model. Such a formulation avoids systematic errors that  
    29 accumulate with time \citep{Bryan1997}. 
    30  
    31 The general philosophy of OPA which has led to the discrete formulation  
    32 presented in {\S}II.2 and II.3 is to choose second order non-diffusive  
    33 scheme for advective terms for both dynamical and tracer equations. At this  
    34 level of complexity, the resulting schemes are dispersive schemes.  
    35 Therefore, they require the addition of a diffusive operator to be stable.  
    36 The alternative is to use diffusive schemes such as upstream or flux  
    37 corrected schemes. This last option was rejected because we prefer a  
    38 complete handling of the model diffusion, i.e. of the model physics rather  
    39 than letting the advective scheme produces its own implicit diffusion  
    40 without controlling the space and time structure of this implicit diffusion.  
    41 Note that in some very specific cases as passive tracer studies, the  
    42 positivity of the advective scheme is required. In that case, and in that  
    43 case only, the advective scheme used for passive tracer is a flux correction  
    44 scheme \citep{Marti1992, Levy1996, Levy1998}. 
     11The continuous equations of motion have many analytic properties. 
     12Many quantities (total mass, energy, enstrophy, etc.) are strictly conserved in the inviscid and unforced limit, 
     13while ocean physics conserve the total quantities on which they act (momentum, temperature, salinity) but 
     14dissipate their total variance (energy, enstrophy, etc.). 
     15Unfortunately, the finite difference form of these equations is not guaranteed to 
     16retain all these important properties. 
     17In constructing the finite differencing schemes, we wish to ensure that 
     18certain integral constraints will be maintained. 
     19In particular, it is desirable to construct the finite difference equations so that 
     20horizontal kinetic energy and/or potential enstrophy of horizontally non-divergent flow, 
     21and variance of temperature and salinity will be conserved in the absence of dissipative effects and forcing. 
     22\citet{Arakawa1966} has first pointed out the advantage of this approach. 
     23He showed that if integral constraints on energy are maintained, 
     24the computation will be free of the troublesome "non linear" instability originally pointed out by 
     25\citet{Phillips1959}. 
     26A consistent formulation of the energetic properties is also extremely important in carrying out 
     27long-term numerical simulations for an oceanographic model. 
     28Such a formulation avoids systematic errors that accumulate with time \citep{Bryan1997}. 
     29 
     30The general philosophy of OPA which has led to the discrete formulation presented in {\S}II.2 and II.3 is to 
     31choose second order non-diffusive scheme for advective terms for both dynamical and tracer equations. 
     32At this level of complexity, the resulting schemes are dispersive schemes. 
     33Therefore, they require the addition of a diffusive operator to be stable. 
     34The alternative is to use diffusive schemes such as upstream or flux corrected schemes. 
     35This last option was rejected because we prefer a complete handling of the model diffusion, 
     36i.e. of the model physics rather than letting the advective scheme produces its own implicit diffusion without 
     37controlling the space and time structure of this implicit diffusion. 
     38Note that in some very specific cases as passive tracer studies, the positivity of the advective scheme is required. 
     39In that case, and in that case only, the advective scheme used for passive tracer is a flux correction scheme 
     40\citep{Marti1992, Levy1996, Levy1998}. 
    4541 
    4642% ------------------------------------------------------------------------------------------------------------- 
     
    5046\label{sec:Invariant_dyn} 
    5147 
    52 The non linear term of the momentum equations has been split into a  
    53 vorticity term, a gradient of horizontal kinetic energy and a vertical  
    54 advection term. Three schemes are available for the former (see {\S}~II.2)  
    55 according to the CPP variable defined (default option\textbf{  
    56 }or \textbf{key{\_}vorenergy } or \textbf{key{\_}vorcombined  
    57 } defined). They differ in their conservative  
    58 properties (energy or enstrophy conserving scheme). The two latter terms  
    59 preserve the total kinetic energy: the large scale kinetic energy is also  
    60 preserved in practice. The remaining non-diffusive terms of the momentum  
    61 equation (namely the hydrostatic and surface pressure gradient terms) also  
    62 preserve the total kinetic energy and have no effect on the vorticity of the  
    63 flow. 
     48The non linear term of the momentum equations has been split into a vorticity term, 
     49a gradient of horizontal kinetic energy and a vertical advection term. 
     50Three schemes are available for the former (see {\S}~II.2) according to the CPP variable defined 
     51(default option\textbf{?}or \textbf{key{\_}vorenergy} or \textbf{key{\_}vorcombined} defined). 
     52They differ in their conservative properties (energy or enstrophy conserving scheme). 
     53The two latter terms preserve the total kinetic energy: 
     54the large scale kinetic energy is also preserved in practice. 
     55The remaining non-diffusive terms of the momentum equation 
     56(namely the hydrostatic and surface pressure gradient terms) also preserve the total kinetic energy and 
     57have no effect on the vorticity of the flow. 
    6458 
    6559\textbf{* relative, planetary and total vorticity term:} 
    6660 
    67 Let us define as either the relative, planetary and total potential  
    68 vorticity, i.e. , , and , respectively. The continuous formulation of the  
    69 vorticity term satisfies following integral constraints: 
     61Let us define as either the relative, planetary and total potential vorticity, i.e. ?, ?, and ?, respectively. 
     62The continuous formulation of the vorticity term satisfies following integral constraints: 
    7063\begin{equation} \label{eq:vor_vorticity} 
    7164\int_D {{\textbf {k}}\cdot \frac{1}{e_3 }\nabla \times \left( {\varsigma  
     
    8275\int_D {{\textbf{U}}_h \times \left( {\varsigma \;{\textbf{k}}\times {\textbf{U}}_h } \right)\;dv} =0 
    8376\end{equation} 
    84 where $dv = e_1\, e_2\, e_3\, di\, dj\, dk$ is the volume element.  
    85 (II.4.1a) means that $\varsigma $ is conserved. (II.4.1b) is obtained by an  
    86 integration by part. It means that $\varsigma^2$ is conserved for a horizontally  
    87 non-divergent flow.  
    88 (II.4.1c) is even satisfied locally since the vorticity term is orthogonal  
    89 to the horizontal velocity. It means that the vorticity term has no  
    90 contribution to the evolution of the total kinetic energy. (II.4.1a) is  
    91 obviously always satisfied, but (II.4.1b) and (II.4.1c) cannot be satisfied  
    92 simultaneously with a second order scheme. Using the symmetry or  
    93 anti-symmetry properties of the operators (Eqs II.1.10 and 11), it can be  
    94 shown that the scheme (II.2.11) satisfies (II.4.1b) but not (II.4.1c), while  
    95 scheme (II.2.12) satisfies (II.4.1c) but not (II.4.1b) (see appendix C).  
    96 Note that the enstrophy conserving scheme on total vorticity has been chosen  
    97 as the standard discrete form of the vorticity term. 
     77where $dv = e_1\, e_2\, e_3\, di\, dj\, dk$ is the volume element. 
     78(II.4.1a) means that $\varsigma $ is conserved. (II.4.1b) is obtained by an integration by part. 
     79It means that $\varsigma^2$ is conserved for a horizontally non-divergent flow. 
     80(II.4.1c) is even satisfied locally since the vorticity term is orthogonal to the horizontal velocity. 
     81It means that the vorticity term has no contribution to the evolution of the total kinetic energy. 
     82(II.4.1a) is obviously always satisfied, but (II.4.1b) and (II.4.1c) cannot be satisfied simultaneously with 
     83a second order scheme. 
     84Using the symmetry or anti-symmetry properties of the operators (Eqs II.1.10 and 11), 
     85it can be shown that the scheme (II.2.11) satisfies (II.4.1b) but not (II.4.1c), 
     86while scheme (II.2.12) satisfies (II.4.1c) but not (II.4.1b) (see appendix C).  
     87Note that the enstrophy conserving scheme on total vorticity has been chosen as the standard discrete form of 
     88the vorticity term. 
    9889 
    9990\textbf{* Gradient of kinetic energy / vertical advection} 
    10091 
    101 In continuous formulation, the gradient of horizontal kinetic energy has no  
    102 contribution to the evolution of the vorticity as the curl of a gradient is  
    103 zero. This property is satisfied locally with the discrete form of both the  
    104 gradient and the curl operator we have made (property (II.1.9)~). Another  
    105 continuous property is that the change of horizontal kinetic energy due to  
    106 vertical advection is exactly balanced by the change of horizontal kinetic  
    107 energy due to the horizontal gradient of horizontal kinetic energy: 
     92In continuous formulation, the gradient of horizontal kinetic energy has no contribution to the evolution of 
     93the vorticity as the curl of a gradient is zero. 
     94This property is satisfied locally with the discrete form of both the gradient and the curl operator we have made 
     95(property (II.1.9)~). 
     96Another continuous property is that the change of horizontal kinetic energy due to 
     97vertical advection is exactly balanced by the change of horizontal kinetic energy due to 
     98the horizontal gradient of horizontal kinetic energy: 
    10899 
    109100\begin{equation} \label{eq:keg_zad} 
     
    112103\end{equation} 
    113104 
    114 Using the discrete form given in {\S}II.2-a and the symmetry or  
    115 anti-symmetry properties of the mean and difference operators, \autoref{eq:keg_zad} is  
    116 demonstrated in the Appendix C. The main point here is that satisfying  
    117 \autoref{eq:keg_zad} links the choice of the discrete forms of the vertical advection  
    118 and of the horizontal gradient of horizontal kinetic energy. Choosing one  
    119 imposes the other. The discrete form of the vertical advection given in  
    120 {\S}II.2-a is a direct consequence of formulating the horizontal kinetic  
    121 energy as $1/2 \left( \overline{u^2}^i + \overline{v^2}^j \right) $ in the gradient term. 
     105Using the discrete form given in {\S}II.2-a and the symmetry or anti-symmetry properties of 
     106the mean and difference operators, \autoref{eq:keg_zad} is demonstrated in the Appendix C. 
     107The main point here is that satisfying \autoref{eq:keg_zad} links the choice of the discrete forms of 
     108the vertical advection and of the horizontal gradient of horizontal kinetic energy. 
     109Choosing one imposes the other. 
     110The discrete form of the vertical advection given in {\S}II.2-a is a direct consequence of 
     111formulating the horizontal kinetic energy as $1/2 \left( \overline{u^2}^i + \overline{v^2}^j \right) $ in 
     112the gradient term. 
    122113 
    123114\textbf{* hydrostatic pressure gradient term} 
    124115 
    125 In continuous formulation, a pressure gradient has no contribution to the  
    126 evolution of the vorticity as the curl of a gradient is zero. This  
    127 properties is satisfied locally with the choice of discretization we have  
    128 made (property (II.1.9)~). In addition, when the equation of state is linear  
    129 (i.e. when an advective-diffusive equation for density can be derived from  
    130 those of temperature and salinity) the change of horizontal kinetic energy  
    131 due to the work of pressure forces is balanced by the change of potential  
    132 energy due to buoyancy forces: 
     116In continuous formulation, a pressure gradient has no contribution to the evolution of the vorticity as 
     117the curl of a gradient is zero. 
     118This properties is satisfied locally with the choice of discretization we have made (property (II.1.9)~). 
     119In addition, when the equation of state is linear 
     120(i.e. when an advective-diffusive equation for density can be derived from those of temperature and salinity) 
     121the change of horizontal kinetic energy due to the work of pressure forces is balanced by the change of 
     122potential energy due to buoyancy forces: 
    133123 
    134124\begin{equation} \label{eq:hpg_pe} 
     
    136126\end{equation} 
    137127 
    138 Using the discrete form given in {\S}~II.2-a and the symmetry or  
    139 anti-symmetry properties of the mean and difference operators, (II.4.3) is  
    140 demonstrated in the Appendix C. The main point here is that satisfying  
    141 (II.4.3) strongly constraints the discrete expression of the depth of  
    142 $T$-points and of the term added to the pressure gradient in $s-$coordinates: the  
    143 depth of a $T$-point, $z_T$, is defined as the sum the vertical scale  
    144 factors at $w$-points starting from the surface. 
     128Using the discrete form given in {\S}~II.2-a and the symmetry or anti-symmetry properties of 
     129the mean and difference operators, (II.4.3) is demonstrated in the Appendix C. 
     130The main point here is that satisfying (II.4.3) strongly constraints the discrete expression of the depth of  
     131$T$-points and of the term added to the pressure gradient in $s-$coordinates: the depth of a $T$-point, $z_T$, 
     132is defined as the sum the vertical scale factors at $w$-points starting from the surface. 
    145133 
    146134\textbf{* surface pressure gradient term} 
    147135 
    148 In continuous formulation, the surface pressure gradient has no contribution  
    149 to the evolution of vorticity. This properties is trivially satisfied  
    150 locally as (II.2.3) (the equation verified by $\psi$ has been  
    151 derived from the discrete formulation of the momentum equations, vertical  
    152 sum and curl. Nevertheless, the $\psi$-equation is solved numerically by an  
    153 iterative solver (see {\S}~III.5), thus the property is only satisfied with  
    154 the accuracy required on the solver. In addition, with the rigid-lid  
    155 approximation, the change of horizontal kinetic energy due to the work of  
     136In continuous formulation, the surface pressure gradient has no contribution to the evolution of vorticity. 
     137This properties is trivially satisfied locally as (II.2.3) 
     138(the equation verified by $\psi$ has been derived from the discrete formulation of the momentum equations, 
     139vertical sum and curl). 
     140Nevertheless, the $\psi$-equation is solved numerically by an iterative solver (see {\S}~III.5), 
     141thus the property is only satisfied with the accuracy required on the solver. 
     142In addition, with the rigid-lid approximation, the change of horizontal kinetic energy due to the work of  
    156143surface pressure forces is exactly zero: 
    157144\begin{equation} \label{eq:spg} 
     
    159146\end{equation} 
    160147 
    161 (II.4.4) is satisfied in discrete form only if the discrete barotropic  
    162 streamfunction time evolution equation is given by (II.2.3) (see appendix  
    163 C). This shows that (II.2.3) is the only way to compute the streamfunction,  
    164 otherwise there is no guarantee that the surface pressure force work  
    165 vanishes. 
     148(II.4.4) is satisfied in discrete form only if 
     149the discrete barotropic streamfunction time evolution equation is given by (II.2.3) (see appendix C). 
     150This shows that (II.2.3) is the only way to compute the streamfunction, 
     151otherwise there is no guarantee that the surface pressure force work vanishes. 
    166152 
    167153% ------------------------------------------------------------------------------------------------------------- 
     
    171157\label{sec:Invariant_tra} 
    172158 
    173 In continuous formulation, the advective terms of the tracer equations  
    174 conserve the tracer content and the quadratic form of the tracer, i.e. 
     159In continuous formulation, the advective terms of the tracer equations conserve the tracer content and 
     160the quadratic form of the tracer, $i.e.$ 
    175161\begin{equation} \label{eq:tra_tra2} 
    176162\int_D {\nabla .\left( {T\;{\textbf{U}}} \right)\;dv} =0 
     
    179165\end{equation} 
    180166 
    181 The numerical scheme used ({\S}II.2-b) (equations in flux form, second order  
    182 centred finite differences) satisfies (II.4.5) (see appendix C). Note that  
    183 in both continuous and discrete formulations, there is generally no strict  
    184 conservation of mass, since the equation of state is non linear with respect  
    185 to $T$ and $S$. In practice, the mass is conserved with a very good accuracy.  
     167The numerical scheme used ({\S}II.2-b) (equations in flux form, second order centred finite differences) satisfies 
     168(II.4.5) (see appendix C). 
     169Note that in both continuous and discrete formulations, there is generally no strict conservation of mass, 
     170since the equation of state is non linear with respect to $T$ and $S$. 
     171In practice, the mass is conserved with a very good accuracy.  
    186172 
    187173% ------------------------------------------------------------------------------------------------------------- 
     
    193179\textbf{* lateral momentum diffusion term} 
    194180 
    195 The continuous formulation of the horizontal diffusion of momentum satisfies  
    196 the following integral constraints~: 
     181The continuous formulation of the horizontal diffusion of momentum satisfies the following integral constraints~: 
    197182\begin{equation} \label{eq:dynldf_dyn} 
    198183\int\limits_D {\frac{1}{e_3 }{\rm {\bf k}}\cdot \nabla \times \left[ {\nabla  
     
    227212 
    228213 
    229 (II.4.6a) and (II.4.6b) means that the horizontal diffusion of momentum  
    230 conserve both the potential vorticity and the divergence of the flow, while  
    231 Eqs (II.4.6c) to (II.4.6e) mean that it dissipates the energy, the enstrophy  
    232 and the square of the divergence. The two latter properties are only  
    233 satisfied when the eddy coefficients are horizontally uniform. 
    234  
    235 Using (II.1.8) and (II.1.9), and the symmetry or anti-symmetry properties of  
    236 the mean and difference operators, it is shown that the discrete form of the  
    237 lateral momentum diffusion given in {\S}II.2-c satisfies all the integral  
    238 constraints (II.4.6) (see appendix C). In particular, when the eddy  
    239 coefficients are horizontally uniform, a complete separation of vorticity  
    240 and horizontal divergence fields is ensured, so that diffusion (dissipation)  
    241 of vorticity (enstrophy) does not generate horizontal divergence (variance  
    242 of the horizontal divergence) and \textit{vice versa}. When the vertical curl of the horizontal  
    243 diffusion of momentum (discrete sense) is taken, the term associated to the  
    244 horizontal gradient of the divergence is zero locally. When the horizontal  
    245 divergence of the horizontal diffusion of momentum (discrete sense) is  
    246 taken, the term associated to the vertical curl of the vorticity is zero  
    247 locally. The resulting term conserves $\chi$ and dissipates  
    248 $\chi^2$ when the  
    249 eddy coefficient is horizontally uniform. 
     214(II.4.6a) and (II.4.6b) means that the horizontal diffusion of momentum conserve both the potential vorticity and 
     215the divergence of the flow, while Eqs (II.4.6c) to (II.4.6e) mean that it dissipates the energy, the enstrophy and 
     216the square of the divergence. 
     217The two latter properties are only satisfied when the eddy coefficients are horizontally uniform. 
     218 
     219Using (II.1.8) and (II.1.9), and the symmetry or anti-symmetry properties of the mean and difference operators, 
     220it is shown that the discrete form of the lateral momentum diffusion given in 
     221{\S}II.2-c satisfies all the integral constraints (II.4.6) (see appendix C). 
     222In particular, when the eddy coefficients are horizontally uniform, 
     223a complete separation of vorticity and horizontal divergence fields is ensured, 
     224so that diffusion (dissipation) of vorticity (enstrophy) does not generate horizontal divergence 
     225(variance of the horizontal divergence) and \textit{vice versa}. 
     226When the vertical curl of the horizontal diffusion of momentum (discrete sense) is taken, 
     227the term associated to the horizontal gradient of the divergence is zero locally. 
     228When the horizontal divergence of the horizontal diffusion of momentum (discrete sense) is taken, 
     229the term associated to the vertical curl of the vorticity is zero locally. 
     230The resulting term conserves $\chi$ and dissipates $\chi^2$ when the eddy coefficient is horizontally uniform. 
    250231 
    251232\textbf{* vertical momentum diffusion term} 
    252233 
    253 As for the lateral momentum physics, the continuous form of the vertical  
    254 diffusion of momentum satisfies following integral constraints~: 
     234As for the lateral momentum physics, the continuous form of the vertical diffusion of 
     235momentum satisfies following integral constraints~: 
    255236 
    256237conservation of momentum, dissipation of horizontal kinetic energy 
     
    273254\end{aligned} 
    274255\end{equation} 
    275 conservation of horizontal divergence, dissipation of square of the  
    276 horizontal divergence 
     256conservation of horizontal divergence, dissipation of square of the horizontal divergence 
    277257\begin{equation} \label{eq:dynzdf_div} 
    278258\begin{aligned} 
     
    286266\end{equation} 
    287267 
    288 In discrete form, all these properties are satisfied in $z$-coordinate (see  
    289 Appendix C). In $s$-coordinates, only first order properties can be  
    290 demonstrated, i.e. the vertical momentum physics conserve momentum,  
    291 potential vorticity, and horizontal divergence. 
     268In discrete form, all these properties are satisfied in $z$-coordinate (see Appendix C). 
     269In $s$-coordinates, only first order properties can be demonstrated, 
     270$i.e.$ the vertical momentum physics conserve momentum, potential vorticity, and horizontal divergence. 
    292271 
    293272% ------------------------------------------------------------------------------------------------------------- 
     
    297276\label{subsec:Invariant_tra_physics} 
    298277 
    299 The numerical schemes used for tracer subgridscale physics are written in  
    300 such a way that the heat and salt contents are conserved (equations in flux  
    301 form, second order centred finite differences). As a form flux is used to  
    302 compute the temperature and salinity, the quadratic form of these quantities  
    303 (i.e. their variance) globally tends to diminish. As for the advective term,  
    304 there is generally no strict conservation of mass even if, in practice, the  
    305 mass is conserved with a very good accuracy.  
     278The numerical schemes used for tracer subgridscale physics are written in such a way that 
     279the heat and salt contents are conserved (equations in flux form, second order centred finite differences). 
     280As a form flux is used to compute the temperature and salinity, 
     281the quadratic form of these quantities (i.e. their variance) globally tends to diminish. 
     282As for the advective term, there is generally no strict conservation of mass even if, 
     283in practice, the mass is conserved with a very good accuracy.  
    306284 
    307285\textbf{* lateral physics: }conservation of tracer, dissipation of tracer  
     
    315293\end{equation} 
    316294 
    317 \textbf{* vertical physics: }conservation of tracer, dissipation of tracer  
    318 variance, i.e. 
     295\textbf{* vertical physics: }conservation of tracer, dissipation of tracer variance, $i.e.$ 
    319296 
    320297\begin{equation} \label{eq:trazdf_t_t2} 
     
    325302\end{equation} 
    326303 
    327 Using the symmetry or anti-symmetry properties of the mean and difference  
    328 operators, it is shown that the discrete form of tracer physics given in  
    329 {\S}~II.2-c satisfies all the integral constraints (II.4.8) and (II.4.9)  
    330 except the dissipation of the square of the tracer when non-geopotential  
    331 diffusion is used (see appendix C). A discrete form of the lateral tracer  
    332 physics can be derived which satisfies these last properties. Nevertheless,  
    333 it requires a horizontal averaging of the vertical component of the lateral  
    334 physics that prevents the use of implicit resolution in the vertical. It has  
    335 not been implemented. 
     304Using the symmetry or anti-symmetry properties of the mean and difference operators, 
     305it is shown that the discrete form of tracer physics given in {\S}~II.2-c satisfies all the integral constraints 
     306(II.4.8) and (II.4.9) except the dissipation of the square of the tracer when non-geopotential diffusion is used 
     307(see appendix C). 
     308A discrete form of the lateral tracer physics can be derived which satisfies these last properties. 
     309Nevertheless, it requires a horizontal averaging of the vertical component of the lateral physics that 
     310prevents the use of implicit resolution in the vertical. 
     311It has not been implemented. 
    336312 
    337313\end{document} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_misc.tex

    r10146 r10368  
    1717\label{sec:MISC_strait} 
    1818 
    19 In climate modeling, it often occurs that a crucial connections between water masses 
    20 is broken as the grid mesh is too coarse to resolve narrow straits. For example, coarse  
    21 grid spacing typically closes off the Mediterranean from the Atlantic at the Strait of  
    22 Gibraltar. In this case, it is important for climate models to include the effects of salty  
    23 water entering the Atlantic from the Mediterranean. Likewise, it is important for the  
    24 Mediterranean to replenish its supply of water from the Atlantic to balance the net  
    25 evaporation occurring over the Mediterranean region. This problem occurs even in  
    26 eddy permitting simulations. For example, in ORCA 1/4\deg several straits of the Indonesian  
    27 archipelago (Ombai, Lombok...) are much narrow than even a single ocean grid-point. 
    28  
    29 We describe briefly here the three methods that can be used in \NEMO to handle  
    30 such improperly resolved straits. The first two consist of opening the strait by hand  
    31 while ensuring that the mass exchanges through the strait are not too large by  
    32 either artificially reducing the surface of the strait grid-cells or, locally increasing  
    33 the lateral friction. In the third one, the strait is closed but exchanges of mass,  
    34 heat and salt across the land are allowed. 
    35 Note that such modifications are so specific to a given configuration that no attempt  
    36 has been made to set them in a generic way. However, examples of how  
    37 they can be set up is given in the ORCA 2\deg and 0.5\deg configurations. For example,  
    38 for details of implementation in ORCA2, search:  
    39 \texttt{ IF( cp\_cfg == "orca" .AND. jp\_cfg == 2 ) } 
     19In climate modeling, it often occurs that a crucial connections between water masses is broken as 
     20the grid mesh is too coarse to resolve narrow straits. 
     21For example, coarse grid spacing typically closes off the Mediterranean from the Atlantic at 
     22the Strait of Gibraltar. 
     23In this case, it is important for climate models to include the effects of salty water entering the Atlantic from 
     24the Mediterranean. 
     25Likewise, it is important for the Mediterranean to replenish its supply of water from the Atlantic to 
     26balance the net evaporation occurring over the Mediterranean region. 
     27This problem occurs even in eddy permitting simulations. 
     28For example, in ORCA 1/4\deg several straits of the Indonesian archipelago (Ombai, Lombok...) 
     29are much narrow than even a single ocean grid-point. 
     30 
     31We describe briefly here the three methods that can be used in \NEMO to handle such improperly resolved straits. 
     32The first two consist of opening the strait by hand while ensuring that the mass exchanges through 
     33the strait are not too large by either artificially reducing the surface of the strait grid-cells or, 
     34locally increasing the lateral friction. 
     35In the third one, the strait is closed but exchanges of mass, heat and salt across the land are allowed. 
     36Note that such modifications are so specific to a given configuration that no attempt has been made to 
     37set them in a generic way. 
     38However, examples of how they can be set up is given in the ORCA 2\deg and 0.5\deg configurations. 
     39For example, for details of implementation in ORCA2, search: \texttt{IF( cp\_cfg == "orca" .AND. jp\_cfg == 2 )} 
    4040 
    4141% ------------------------------------------------------------------------------------------------------------- 
     
    4545\label{subsec:MISC_strait_hand} 
    4646 
    47 $\bullet$ reduced scale factor in the cross-strait direction to a value in better agreement  
    48 with the true mean width of the strait. (\autoref{fig:MISC_strait_hand}). 
     47$\bullet$ reduced scale factor in the cross-strait direction to a value in better agreement with 
     48the true mean width of the strait (\autoref{fig:MISC_strait_hand}). 
    4949This technique is sometime called "partially open face" or "partially closed cells". 
    50 The key issue here is only to reduce the faces of $T$-cell ($i.e.$ change the value  
    51 of the horizontal scale factors at $u$- or $v$-point) but not the volume of the $T$-cell. 
    52 Indeed, reducing the volume of strait $T$-cell can easily produce a numerical  
    53 instability at that grid point that would require a reduction of the model time step. 
    54 The changes associated with strait management are done in \mdl{domhgr},  
     50The key issue here is only to reduce the faces of $T$-cell 
     51($i.e.$ change the value of the horizontal scale factors at $u$- or $v$-point) but not the volume of the $T$-cell. 
     52Indeed, reducing the volume of strait $T$-cell can easily produce a numerical instability at 
     53that grid point that would require a reduction of the model time step. 
     54The changes associated with strait management are done in \mdl{domhgr}, 
    5555just after the definition or reading of the horizontal scale factors.  
    5656 
    57 $\bullet$ increase of the viscous boundary layer thickness by local increase of the  
    58 fmask value at the coast (\autoref{fig:MISC_strait_hand}). This is done in  
    59 \mdl{dommsk} together with the setting of the coastal value of fmask  
    60 (see  \autoref{sec:LBC_coast}) 
    61  
    62 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    63 \begin{figure}[!tbp]     \begin{center} 
    64 \includegraphics[width=0.80\textwidth]{Fig_Gibraltar} 
    65 \includegraphics[width=0.80\textwidth]{Fig_Gibraltar2} 
    66 \caption{   \protect\label{fig:MISC_strait_hand}  
    67 Example of the Gibraltar strait defined in a $1^{\circ} \times 1^{\circ}$ mesh.  
    68 \textit{Top}: using partially open cells. The meridional scale factor at $v$-point  
    69 is reduced on both sides of the strait to account for the real width of the strait  
    70 (about 20 km). Note that the scale factors of the strait $T$-point remains unchanged.  
    71 \textit{Bottom}: using viscous boundary layers. The four fmask parameters  
    72 along the strait coastlines are set to a value larger than 4, $i.e.$ "strong" no-slip  
    73 case (see \autoref{fig:LBC_shlat}) creating a large viscous boundary layer  
    74 that allows a reduced transport through the strait.} 
    75 \end{center}   \end{figure} 
     57$\bullet$ increase of the viscous boundary layer thickness by local increase of the fmask value at the coast 
     58(\autoref{fig:MISC_strait_hand}). 
     59This is done in \mdl{dommsk} together with the setting of the coastal value of fmask (see  \autoref{sec:LBC_coast}). 
     60 
     61%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     62\begin{figure}[!tbp] 
     63  \begin{center} 
     64    \includegraphics[width=0.80\textwidth]{Fig_Gibraltar} 
     65    \includegraphics[width=0.80\textwidth]{Fig_Gibraltar2} 
     66    \caption{  \protect\label{fig:MISC_strait_hand} 
     67      Example of the Gibraltar strait defined in a $1^{\circ} \times 1^{\circ}$ mesh. 
     68      \textit{Top}: using partially open cells. 
     69      The meridional scale factor at $v$-point is reduced on both sides of the strait to account for 
     70      the real width of the strait (about 20 km). 
     71      Note that the scale factors of the strait $T$-point remains unchanged. 
     72      \textit{Bottom}: using viscous boundary layers. 
     73      The four fmask parameters along the strait coastlines are set to a value larger than 4, 
     74      $i.e.$ "strong" no-slip case (see \autoref{fig:LBC_shlat}) creating a large viscous boundary layer that 
     75      allows a reduced transport through the strait.} 
     76  \end{center} 
     77\end{figure} 
    7678%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    7779 
     
    9496\subsection{Simple subsetting of input files via NetCDF attributes} 
    9597 
    96 The extended grids for use with the under-shelf ice cavities will result in redundant rows 
    97 around Antarctica if the ice cavities are not active. A simple mechanism for subsetting 
    98 input files associated with the extended domains has been implemented to avoid the need to 
    99 maintain different sets of input fields for use with or without active ice cavities. The 
    100 existing 'zoom' options are overly complex for this task and marked for deletion anyway. 
    101 This alternative subsetting operates for the j-direction only and works by optionally 
    102 looking for and using a global file attribute (named: \np{open\_ocean\_jstart}) to 
    103 determine the starting j-row for input. The use of this option is best explained with an 
    104 example: Consider an ORCA1 configuration using the extended grid bathymetry and coordinate 
    105 files: 
     98The extended grids for use with the under-shelf ice cavities will result in redundant rows around Antarctica if 
     99the ice cavities are not active. 
     100A simple mechanism for subsetting input files associated with the extended domains has been implemented to 
     101avoid the need to maintain different sets of input fields for use with or without active ice cavities. 
     102The existing 'zoom' options are overly complex for this task and marked for deletion anyway. 
     103This alternative subsetting operates for the j-direction only and works by optionally looking for and 
     104using a global file attribute (named: \np{open\_ocean\_jstart}) to determine the starting j-row for input. 
     105The use of this option is best explained with an example: 
     106consider an ORCA1 configuration using the extended grid bathymetry and coordinate files: 
    106107\vspace{-10pt} 
    107108\ifile{eORCA1\_bathymetry\_v2} 
    108109\ifile{eORCA1\_coordinates} 
    109 \noindent These files define a horizontal domain of 362x332. Assuming the first row with 
    110 open ocean wet points in the non-isf bathymetry for this set is row 42 (Fortran indexing) 
    111 then the formally correct setting for \np{open\_ocean\_jstart} is 41. Using this value as the 
    112 first row to be read will result in a 362x292 domain which is the same size as the original 
    113 ORCA1 domain. Thus the extended coordinates and bathymetry files can be used with all the 
    114 original input files for ORCA1 if the ice cavities are not active (\np{ln\_isfcav = 
    115 .false.}). Full instructions for achieving this are: 
     110\noindent These files define a horizontal domain of 362x332. 
     111Assuming the first row with open ocean wet points in the non-isf bathymetry for this set is row 42 
     112(Fortran indexing) then the formally correct setting for \np{open\_ocean\_jstart} is 41. 
     113Using this value as the first row to be read will result in a 362x292 domain which is the same size as 
     114the original ORCA1 domain. 
     115Thus the extended coordinates and bathymetry files can be used with all the original input files for ORCA1 if 
     116the ice cavities are not active (\np{ln\_isfcav = .false.}). 
     117Full instructions for achieving this are: 
    116118 
    117119\noindent Add the new attribute to any input files requiring a j-row offset, i.e: 
     
    128130%-------------------------------------------------------------------------------------------------------------- 
    129131 
    130 \noindent Note the j-size of the global domain is the (extended j-size minus 
    131 \np{open\_ocean\_jstart} + 1 ) and this must match the size of all datasets other than 
    132 bathymetry and coordinates currently. However the option can be extended to any global, 2D 
    133 and 3D, netcdf, input field by adding the: 
     132\noindent Note the j-size of the global domain is the (extended j-size minus \np{open\_ocean\_jstart} + 1 ) and 
     133this must match the size of all datasets other than bathymetry and coordinates currently. 
     134However the option can be extended to any global, 2D and 3D, netcdf, input field by adding the: 
    134135\vspace{-10pt} 
    135136\begin{forlines} 
    136137lrowattr=ln_use_jattr 
    137138\end{forlines} 
    138 optional argument to the appropriate \np{iom\_get} call and the \np{open\_ocean\_jstart} attribute to the corresponding input files. It remains the users responsibility to set \np{jpjdta} and \np{jpjglo} values in the \np{namelist\_cfg} file according to their needs. 
    139  
    140 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    141 \begin{figure}[!ht]    \begin{center} 
    142 \includegraphics[width=0.90\textwidth]{Fig_LBC_zoom} 
    143 \caption{   \protect\label{fig:LBC_zoom} 
    144 Position of a model domain compared to the data input domain when the zoom functionality is used.} 
    145 \end{center}   \end{figure} 
     139optional argument to the appropriate \np{iom\_get} call and the \np{open\_ocean\_jstart} attribute to 
     140the corresponding input files. 
     141It remains the users responsibility to set \np{jpjdta} and \np{jpjglo} values in 
     142the \np{namelist\_cfg} file according to their needs. 
     143 
     144%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     145\begin{figure}[!ht] 
     146  \begin{center} 
     147    \includegraphics[width=0.90\textwidth]{Fig_LBC_zoom} 
     148    \caption{  \protect\label{fig:LBC_zoom} 
     149      Position of a model domain compared to the data input domain when the zoom functionality is used. 
     150    } 
     151  \end{center} 
     152\end{figure} 
    146153%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    147154 
     
    156163\label{subsec:MISC_sign} 
    157164 
    158 The SIGN(A, B) is the \textsc {Fortran} intrinsic function delivers the magnitude  
    159 of A with the sign of B. For example, SIGN(-3.0,2.0) has the value 3.0. 
    160 The problematic case is when the second argument is zero, because, on platforms  
    161 that support IEEE arithmetic, zero is actually a signed number.  
     165The SIGN(A, B) is the \textsc {Fortran} intrinsic function delivers the magnitude of A with the sign of B. 
     166For example, SIGN(-3.0,2.0) has the value 3.0. 
     167The problematic case is when the second argument is zero, because, on platforms that support IEEE arithmetic, 
     168zero is actually a signed number. 
    162169There is a positive zero and a negative zero. 
    163170 
    164 In \textsc{Fortran}~90, the processor was required always to deliver a positive result for SIGN(A, B)  
    165 if B was zero. Nevertheless, in \textsc{Fortran}~95, the processor is allowed to do the correct thing  
    166 and deliver ABS(A) when B is a positive zero and -ABS(A) when B is a negative zero.  
    167 This change in the specification becomes apparent only when B is of type real, and is zero,  
    168 and the processor is capable of distinguishing between positive and negative zero,  
    169 and B is negative real zero. Then SIGN delivers a negative result where, under \textsc{Fortran}~90  
    170 rules,  it used to return a positive result.  
    171 This change may be especially sensitive for the ice model, so we overwrite the intrinsinc  
    172 function with our own function simply performing :   \\ 
     171In \textsc{Fortran}~90, the processor was required always to deliver a positive result for SIGN(A, B) if B was zero. 
     172Nevertheless, in \textsc{Fortran}~95, the processor is allowed to do the correct thing and deliver ABS(A) when 
     173B is a positive zero and -ABS(A) when B is a negative zero. 
     174This change in the specification becomes apparent only when B is of type real, and is zero, 
     175and the processor is capable of distinguishing between positive and negative zero, 
     176and B is negative real zero. 
     177Then SIGN delivers a negative result where, under \textsc{Fortran}~90 rules, it used to return a positive result. 
     178This change may be especially sensitive for the ice model, 
     179so we overwrite the intrinsinc function with our own function simply performing :   \\ 
    173180\verb?   IF( B >= 0.e0 ) THEN   ;   SIGN(A,B) = ABS(A)  ?    \\ 
    174181\verb?   ELSE                   ;   SIGN(A,B) =-ABS(A)     ?  \\ 
    175182\verb?   ENDIF    ? \\ 
    176 This feature can be found in \mdl{lib\_fortran} module and is effective when \key{nosignedzero} 
    177 is defined. We use a CPP key as the overwritting of a intrinsic function can present  
    178 performance issues with some computers/compilers. 
     183This feature can be found in \mdl{lib\_fortran} module and is effective when \key{nosignedzero} is defined. 
     184We use a CPP key as the overwritting of a intrinsic function can present performance issues with 
     185some computers/compilers. 
    179186 
    180187 
     
    182189\label{subsec:MISC_glosum} 
    183190 
    184 The numerical reproducibility of simulations on distributed memory parallel computers  
    185 is a critical issue. In particular, within NEMO global summation of distributed arrays  
    186 is most susceptible to rounding errors, and their propagation and accumulation cause  
    187 uncertainty in final simulation reproducibility on different numbers of processors. 
    188 To avoid so, based on \citet{He_Ding_JSC01} review of different technics,  
    189 we use a so called self-compensated summation method. The idea is to estimate  
    190 the roundoff error, store it in a buffer, and then add it back in the next addition.  
    191  
    192 Suppose we need to calculate $b = a_1 + a_2 + a_3$. The following algorithm  
    193 will allow to split the sum in two ($sum_1 = a_{1} + a_{2}$ and $b = sum_2 = sum_1 + a_3$)  
    194 with exactly the same rounding errors as the sum performed all at once. 
     191The numerical reproducibility of simulations on distributed memory parallel computers is a critical issue. 
     192In particular, within NEMO global summation of distributed arrays is most susceptible to rounding errors, 
     193and their propagation and accumulation cause uncertainty in final simulation reproducibility on 
     194different numbers of processors. 
     195To avoid so, based on \citet{He_Ding_JSC01} review of different technics, 
     196we use a so called self-compensated summation method. 
     197The idea is to estimate the roundoff error, store it in a buffer, and then add it back in the next addition.  
     198 
     199Suppose we need to calculate $b = a_1 + a_2 + a_3$. 
     200The following algorithm will allow to split the sum in two 
     201($sum_1 = a_{1} + a_{2}$ and $b = sum_2 = sum_1 + a_3$) with exactly the same rounding errors as 
     202the sum performed all at once. 
    195203\begin{align*} 
    196204   sum_1 \ \  &= a_1 + a_2 \\ 
     
    201209\end{align*} 
    202210An example of this feature can be found in \mdl{lib\_fortran} module. 
    203 It is systematicallt used in glob\_sum function (summation over the entire basin excluding  
    204 duplicated rows and columns due to cyclic or north fold boundary condition as well as  
    205 overlap MPP areas). The self-compensated summation method should be used in all summation 
    206 in i- and/or j-direction. See \mdl{closea} module for an example. 
     211It is systematicallt used in glob\_sum function (summation over the entire basin excluding duplicated rows and 
     212columns due to cyclic or north fold boundary condition as well as overlap MPP areas). 
     213The self-compensated summation method should be used in all summation in i- and/or j-direction. 
     214See \mdl{closea} module for an example. 
    207215Note also that this implementation may be sensitive to the optimization level.  
    208216 
     
    210218\label{subsec:MISC_mppsca} 
    211219 
    212 The default method of communicating values across the north-fold in distributed memory applications 
    213 (\key{mpp\_mpi}) uses a \textsc{MPI\_ALLGATHER} function to exchange values from each processing 
    214 region in the northern row with every other processing region in the northern row. This enables a 
    215 global width array containing the top 4 rows to be collated on every northern row processor and then 
    216 folded with a simple algorithm. Although conceptually simple, this "All to All" communication will 
    217 hamper performance scalability for large numbers of northern row processors. From version 3.4 
    218 onwards an alternative method is available which only performs direct "Peer to Peer" communications 
    219 between each processor and its immediate "neighbours" across the fold line. This is achieved by 
    220 using the default \textsc{MPI\_ALLGATHER} method during initialisation to help identify the "active" 
    221 neighbours. Stored lists of these neighbours are then used in all subsequent north-fold exchanges to 
    222 restrict exchanges to those between associated regions. The collated global width array for each 
    223 region is thus only partially filled but is guaranteed to be set at all the locations actually 
    224 required by each individual for the fold operation. This alternative method should give identical 
    225 results to the default \textsc{ALLGATHER} method and is recommended for large values of \np{jpni}. 
    226 The new method is activated by setting \np{ln\_nnogather} to be true ({\bf nammpp}). The 
    227 reproducibility of results using the two methods should be confirmed for each new, non-reference 
    228 configuration. 
     220The default method of communicating values across the north-fold in distributed memory applications (\key{mpp\_mpi}) 
     221uses a \textsc{MPI\_ALLGATHER} function to exchange values from each processing region in 
     222the northern row with every other processing region in the northern row. 
     223This enables a global width array containing the top 4 rows to be collated on every northern row processor and then 
     224folded with a simple algorithm. 
     225Although conceptually simple, this "All to All" communication will hamper performance scalability for 
     226large numbers of northern row processors. 
     227From version 3.4 onwards an alternative method is available which only performs direct "Peer to Peer" communications 
     228between each processor and its immediate "neighbours" across the fold line. 
     229This is achieved by using the default \textsc{MPI\_ALLGATHER} method during initialisation to 
     230help identify the "active" neighbours. 
     231Stored lists of these neighbours are then used in all subsequent north-fold exchanges to 
     232restrict exchanges to those between associated regions. 
     233The collated global width array for each region is thus only partially filled but is guaranteed to 
     234be set at all the locations actually required by each individual for the fold operation. 
     235This alternative method should give identical results to the default \textsc{ALLGATHER} method and 
     236is recommended for large values of \np{jpni}. 
     237The new method is activated by setting \np{ln\_nnogather} to be true ({\bf nammpp}). 
     238The reproducibility of results using the two methods should be confirmed for each new, 
     239non-reference configuration. 
    229240 
    230241% ================================================================ 
     
    243254$\bullet$ Vector optimisation: 
    244255 
    245 \key{vectopt\_loop} enables the internal loops to collapse. This is very  
    246 a very efficient way to increase the length of vector calculations and thus  
     256\key{vectopt\_loop} enables the internal loops to collapse. 
     257This is very a very efficient way to increase the length of vector calculations and thus 
    247258to speed up the model on vector computers. 
    248259  
     
    253264$\bullet$ Control print %: describe here 4 things: 
    254265 
    255 1- \np{ln\_ctl} : compute and print the trends averaged over the interior domain  
    256 in all TRA, DYN, LDF and ZDF modules. This option is very helpful when  
    257 diagnosing the origin of an undesired change in model results.  
    258  
    259 2- also \np{ln\_ctl} but using the nictl and njctl namelist parameters to check  
    260 the source of differences between mono and multi processor runs. 
     2661- \np{ln\_ctl}: compute and print the trends averaged over the interior domain in all TRA, DYN, LDF and 
     267ZDF modules. 
     268This option is very helpful when diagnosing the origin of an undesired change in model results.  
     269 
     2702- also \np{ln\_ctl} but using the nictl and njctl namelist parameters to check the source of differences between 
     271mono and multi processor runs. 
    261272 
    262273%%gm   to be removed both here and in the code 
    263 3- last digit comparison (\np{nn\_bit\_cmp}). In an MPP simulation, the computation of  
    264 a sum over the whole domain is performed as the summation over all processors of  
    265 each of their sums over their interior domains. This double sum never gives exactly  
    266 the same result as a single sum over the whole domain, due to truncation differences.  
    267 The "bit comparison" option has been introduced in order to be able to check that  
    268 mono-processor and multi-processor runs give exactly the same results.  
    269 %THIS is to be updated with the mpp_sum_glo  introduced in v3.3 
     2743- last digit comparison (\np{nn\_bit\_cmp}). 
     275In an MPP simulation, the computation of a sum over the whole domain is performed as the summation over 
     276all processors of each of their sums over their interior domains. 
     277This double sum never gives exactly the same result as a single sum over the whole domain, 
     278due to truncation differences. 
     279The "bit comparison" option has been introduced in order to be able to check that 
     280mono-processor and multi-processor runs give exactly the same results. 
     281% THIS is to be updated with the mpp_sum_glo  introduced in v3.3 
    270282% nn_bit_cmp  today only check that the nn_cla = 0 (no cross land advection) 
    271283%%gm end 
    272284 
    273 $\bullet$  Benchmark (\np{nn\_bench}). This option defines a benchmark run based on  
    274 a GYRE configuration (see \autoref{sec:CFG_gyre}) in which the resolution remains the same  
    275 whatever the domain size. This allows a very large model domain to be used, just by  
    276 changing the domain size (\jp{jpiglo}, \jp{jpjglo}) and without adjusting either the time-step  
    277 or the physical parameterisations.  
     285$\bullet$  Benchmark (\np{nn\_bench}). 
     286This option defines a benchmark run based on a GYRE configuration (see \autoref{sec:CFG_gyre}) in which 
     287the resolution remains the same whatever the domain size. 
     288This allows a very large model domain to be used, just by changing the domain size (\jp{jpiglo}, \jp{jpjglo}) and 
     289without adjusting either the time-step or the physical parameterisations.  
    278290 
    279291% ================================================================ 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_model_basics.tex

    r9414 r10368  
    2626 
    2727 
    28 The ocean is a fluid that can be described to a good approximation by the primitive  
    29 equations, $i.e.$ the Navier-Stokes equations along with a nonlinear equation of  
    30 state which couples the two active tracers (temperature and salinity) to the fluid  
    31 velocity, plus the following additional assumptions made from scale considerations: 
    32  
    33 \textit{(1) spherical earth approximation: }the geopotential surfaces are assumed to  
    34 be spheres so that gravity (local vertical) is parallel to the earth's radius 
    35  
    36 \textit{(2) thin-shell approximation: }the ocean depth is neglected compared to the earth's radius 
    37  
    38 \textit{(3) turbulent closure hypothesis: }the turbulent fluxes (which represent the effect  
    39 of small scale processes on the large-scale) are expressed in terms of large-scale features 
    40  
    41 \textit{(4) Boussinesq hypothesis:} density variations are neglected except in their  
    42 contribution to the buoyancy force 
    43  
    44 \textit{(5) Hydrostatic hypothesis: }the vertical momentum equation is reduced to a  
    45 balance between the vertical pressure gradient and the buoyancy force (this removes  
    46 convective processes from the initial Navier-Stokes equations and so convective processes  
    47 must be parameterized instead) 
    48  
    49 \textit{(6) Incompressibility hypothesis: }the three dimensional divergence of the velocity  
    50 vector is assumed to be zero. 
    51  
    52 Because the gravitational force is so dominant in the equations of large-scale motions,  
    53 it is useful to choose an orthogonal set of unit vectors (\textbf{i},\textbf{j},\textbf{k}) linked  
    54 to the earth such that \textbf{k} is the local upward vector and (\textbf{i},\textbf{j}) are two  
    55 vectors orthogonal to \textbf{k}, $i.e.$ tangent to the geopotential surfaces. Let us define  
    56 the following variables: \textbf{U} the vector velocity, $\textbf{U}=\textbf{U}_h + w\, \textbf{k}$  
     28The ocean is a fluid that can be described to a good approximation by the primitive equations, 
     29$i.e.$ the Navier-Stokes equations along with a nonlinear equation of state which 
     30couples the two active tracers (temperature and salinity) to the fluid velocity, 
     31plus the following additional assumptions made from scale considerations: 
     32 
     33\textit{(1) spherical earth approximation:} the geopotential surfaces are assumed to be spheres so that 
     34gravity (local vertical) is parallel to the earth's radius 
     35 
     36\textit{(2) thin-shell approximation:} the ocean depth is neglected compared to the earth's radius 
     37 
     38\textit{(3) turbulent closure hypothesis:} the turbulent fluxes 
     39(which represent the effect of small scale processes on the large-scale) are expressed in terms of 
     40large-scale features 
     41 
     42\textit{(4) Boussinesq hypothesis:} density variations are neglected except in their contribution to 
     43the buoyancy force 
     44 
     45\textit{(5) Hydrostatic hypothesis:} the vertical momentum equation is reduced to a balance between 
     46the vertical pressure gradient and the buoyancy force 
     47(this removes convective processes from the initial Navier-Stokes equations and so 
     48convective processes must be parameterized instead) 
     49 
     50\textit{(6) Incompressibility hypothesis:} the three dimensional divergence of the velocity vector is assumed to 
     51be zero. 
     52 
     53Because the gravitational force is so dominant in the equations of large-scale motions, 
     54it is useful to choose an orthogonal set of unit vectors (\textbf{i},\textbf{j},\textbf{k}) linked to 
     55the earth such that \textbf{k} is the local upward vector and (\textbf{i},\textbf{j}) are two vectors orthogonal to 
     56\textbf{k}, $i.e.$ tangent to the geopotential surfaces. 
     57Let us define the following variables: \textbf{U} the vector velocity, $\textbf{U}=\textbf{U}_h + w\, \textbf{k}$  
    5758(the subscript $h$ denotes the local horizontal vector, $i.e.$ over the (\textbf{i},\textbf{j}) plane),  
    58 $T$ the potential temperature, $S$ the salinity, \textit{$\rho $} the \textit{in situ} density.  
    59 The vector invariant form of the primitive equations in the (\textbf{i},\textbf{j},\textbf{k})  
    60 vector system provides the following six equations (namely the momentum balance, the  
    61 hydrostatic equilibrium, the incompressibility equation, the heat and salt conservation  
    62 equations and an equation of state): 
     59$T$ the potential temperature, $S$ the salinity, \textit{$\rho $} the \textit{in situ} density. 
     60The vector invariant form of the primitive equations in the (\textbf{i},\textbf{j},\textbf{k}) vector system 
     61provides the following six equations 
     62(namely the momentum balance, the hydrostatic equilibrium, the incompressibility equation, 
     63the heat and salt conservation equations and an equation of state): 
    6364\begin{subequations} \label{eq:PE} 
    6465  \begin{equation}     \label{eq:PE_dyn} 
     
    8586  \end{equation} 
    8687\end{subequations} 
    87 where $\nabla$ is the generalised derivative vector operator in $(\bf i,\bf j, \bf k)$ directions,  
    88 $t$ is the time, $z$ is the vertical coordinate, $\rho $ is the \textit{in situ} density given by  
    89 the equation of state (\autoref{eq:PE_eos}), $\rho_o$ is a reference density, $p$ the pressure,  
    90 $f=2 \bf \Omega \cdot \bf k$ is the Coriolis acceleration (where $\bf \Omega$ is the Earth's  
    91 angular velocity vector), and $g$ is the gravitational acceleration.  
    92 ${\rm {\bf D}}^{\rm {\bf U}}$, $D^T$ and $D^S$ are the parameterisations of small-scale  
    93 physics for momentum, temperature and salinity, and ${\rm {\bf F}}^{\rm {\bf U}}$, $F^T$  
    94 and $F^S$ surface forcing terms. Their nature and formulation are discussed in  
    95 \autoref{sec:PE_zdf_ldf} and \autoref{subsec:PE_boundary_condition}. 
    96  
    97 . 
     88where $\nabla$ is the generalised derivative vector operator in $(\bf i,\bf j, \bf k)$ directions, $t$ is the time, 
     89$z$ is the vertical coordinate, $\rho $ is the \textit{in situ} density given by the equation of state 
     90(\autoref{eq:PE_eos}), $\rho_o$ is a reference density, $p$ the pressure, 
     91$f=2 \bf \Omega \cdot \bf k$ is the Coriolis acceleration 
     92(where $\bf \Omega$ is the Earth's angular velocity vector), and $g$ is the gravitational acceleration. 
     93${\rm {\bf D}}^{\rm {\bf U}}$, $D^T$ and $D^S$ are the parameterisations of small-scale physics for momentum, 
     94temperature and salinity, and ${\rm {\bf F}}^{\rm {\bf U}}$, $F^T$ and $F^S$ surface forcing terms. 
     95Their nature and formulation are discussed in \autoref{sec:PE_zdf_ldf} and \autoref{subsec:PE_boundary_condition}. 
     96 
     97 
    9898 
    9999% ------------------------------------------------------------------------------------------------------------- 
     
    103103\label{subsec:PE_boundary_condition} 
    104104 
    105 An ocean is bounded by complex coastlines, bottom topography at its base and an air-sea  
    106 or ice-sea interface at its top. These boundaries can be defined by two surfaces, $z=-H(i,j)$  
    107 and $z=\eta(i,j,k,t)$, where $H$ is the depth of the ocean bottom and $\eta$ is the height  
    108 of the sea surface. Both $H$ and $\eta$ are usually referenced to a given surface, $z=0$,  
    109 chosen as a mean sea surface (\autoref{fig:ocean_bc}). Through these two boundaries,  
    110 the ocean can exchange fluxes of heat, fresh water, salt, and momentum with the solid earth,  
    111 the continental margins, the sea ice and the atmosphere. However, some of these fluxes are  
    112 so weak that even on climatic time scales of thousands of years they can be neglected.  
    113 In the following, we briefly review the fluxes exchanged at the interfaces between the ocean  
    114 and the other components of the earth system. 
     105An ocean is bounded by complex coastlines, bottom topography at its base and 
     106an air-sea or ice-sea interface at its top. 
     107These boundaries can be defined by two surfaces, $z=-H(i,j)$ and $z=\eta(i,j,k,t)$, 
     108where $H$ is the depth of the ocean bottom and $\eta$ is the height of the sea surface. 
     109Both $H$ and $\eta$ are usually referenced to a given surface, $z=0$, chosen as a mean sea surface 
     110(\autoref{fig:ocean_bc}). 
     111Through these two boundaries, the ocean can exchange fluxes of heat, fresh water, salt, and momentum with 
     112the solid earth, the continental margins, the sea ice and the atmosphere. 
     113However, some of these fluxes are so weak that even on climatic time scales of thousands of years 
     114they can be neglected. 
     115In the following, we briefly review the fluxes exchanged at the interfaces between the ocean and 
     116the other components of the earth system. 
    115117 
    116118%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    117 \begin{figure}[!ht]   \begin{center} 
    118 \includegraphics[width=0.90\textwidth]{Fig_I_ocean_bc} 
    119 \caption{    \protect\label{fig:ocean_bc}  
    120 The ocean is bounded by two surfaces, $z=-H(i,j)$ and $z=\eta(i,j,t)$, where $H$  
    121 is the depth of the sea floor and $\eta$ the height of the sea surface.  
    122 Both $H$ and $\eta$ are referenced to $z=0$.} 
    123 \end{center}   \end{figure} 
     119\begin{figure}[!ht] 
     120  \begin{center} 
     121    \includegraphics[width=0.90\textwidth]{Fig_I_ocean_bc} 
     122    \caption{   \protect\label{fig:ocean_bc} 
     123      The ocean is bounded by two surfaces, $z=-H(i,j)$ and $z=\eta(i,j,t)$, 
     124      where $H$ is the depth of the sea floor and $\eta$ the height of the sea surface. 
     125      Both $H$ and $\eta$ are referenced to $z=0$. 
     126    } 
     127  \end{center} 
     128\end{figure} 
    124129%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    125130 
    126131 
    127132\begin{description} 
    128 \item[Land - ocean interface:] the major flux between continental margins and the ocean is  
    129 a mass exchange of fresh water through river runoff. Such an exchange modifies the sea  
    130 surface salinity especially in the vicinity of major river mouths. It can be neglected for short  
    131 range integrations but has to be taken into account for long term integrations as it influences  
    132 the characteristics of water masses formed (especially at high latitudes). It is required in order  
    133 to close the water cycle of the climate system. It is usually specified as a fresh water flux at  
    134 the air-sea interface in the vicinity of river mouths. 
    135 \item[Solid earth - ocean interface:] heat and salt fluxes through the sea floor are small,  
    136 except in special areas of little extent. They are usually neglected in the model  
    137 \footnote{In fact, it has been shown that the heat flux associated with the solid Earth cooling  
    138 ($i.e.$the geothermal heating) is not negligible for the thermohaline circulation of the world  
    139 ocean (see \autoref{subsec:TRA_bbc}).}.  
    140 The boundary condition is thus set to no flux of heat and salt across solid boundaries.  
    141 For momentum, the situation is different. There is no flow across solid boundaries,  
    142 $i.e.$ the velocity normal to the ocean bottom and coastlines is zero (in other words,  
    143 the bottom velocity is parallel to solid boundaries). This kinematic boundary condition  
    144 can be expressed as: 
    145 \begin{equation} \label{eq:PE_w_bbc} 
    146 w = -{\rm {\bf U}}_h \cdot  \nabla _h \left( H \right) 
    147 \end{equation} 
    148 In addition, the ocean exchanges momentum with the earth through frictional processes.  
    149 Such momentum transfer occurs at small scales in a boundary layer. It must be parameterized  
    150 in terms of turbulent fluxes using bottom and/or lateral boundary conditions. Its specification  
    151 depends on the nature of the physical parameterisation used for ${\rm {\bf D}}^{\rm {\bf U}}$  
    152 in \autoref{eq:PE_dyn}. It is discussed in \autoref{eq:PE_zdf}.% and Chap. III.6 to 9. 
    153 \item[Atmosphere - ocean interface:] the kinematic surface condition plus the mass flux  
    154 of fresh water PE  (the precipitation minus evaporation budget) leads to:  
    155 \begin{equation} \label{eq:PE_w_sbc} 
    156 w = \frac{\partial \eta }{\partial t}  
    157     + \left. {{\rm {\bf U}}_h } \right|_{z=\eta } \cdot  \nabla _h \left( \eta \right)  
     133\item[Land - ocean interface:] 
     134  the major flux between continental margins and the ocean is a mass exchange of fresh water through river runoff. 
     135  Such an exchange modifies the sea surface salinity especially in the vicinity of major river mouths. 
     136  It can be neglected for short range integrations but has to be taken into account for long term integrations as 
     137  it influences the characteristics of water masses formed (especially at high latitudes). 
     138  It is required in order to close the water cycle of the climate system. 
     139  It is usually specified as a fresh water flux at the air-sea interface in the vicinity of river mouths. 
     140\item[Solid earth - ocean interface:] 
     141  heat and salt fluxes through the sea floor are small, except in special areas of little extent. 
     142  They are usually neglected in the model \footnote{ 
     143    In fact, it has been shown that the heat flux associated with the solid Earth cooling 
     144    ($i.e.$the geothermal heating) is not negligible for the thermohaline circulation of the world ocean 
     145    (see \autoref{subsec:TRA_bbc}). 
     146  }. 
     147  The boundary condition is thus set to no flux of heat and salt across solid boundaries. 
     148  For momentum, the situation is different. There is no flow across solid boundaries, 
     149  $i.e.$ the velocity normal to the ocean bottom and coastlines is zero (in other words, 
     150  the bottom velocity is parallel to solid boundaries). This kinematic boundary condition 
     151  can be expressed as: 
     152  \begin{equation} \label{eq:PE_w_bbc} 
     153    w = -{\rm {\bf U}}_h \cdot  \nabla _h \left( H \right) 
     154  \end{equation} 
     155  In addition, the ocean exchanges momentum with the earth through frictional processes. 
     156  Such momentum transfer occurs at small scales in a boundary layer. 
     157  It must be parameterized in terms of turbulent fluxes using bottom and/or lateral boundary conditions. 
     158  Its specification depends on the nature of the physical parameterisation used for 
     159  ${\rm {\bf D}}^{\rm {\bf U}}$ in \autoref{eq:PE_dyn}. 
     160  It is discussed in \autoref{eq:PE_zdf}.% and Chap. III.6 to 9. 
     161\item[Atmosphere - ocean interface:] 
     162  the kinematic surface condition plus the mass flux of fresh water PE (the precipitation minus evaporation budget) 
     163  leads to: 
     164  \begin{equation} \label{eq:PE_w_sbc} 
     165    w = \frac{\partial \eta }{\partial t} 
     166    + \left. {{\rm {\bf U}}_h } \right|_{z=\eta } \cdot  \nabla _h \left( \eta \right) 
    158167    + P-E 
    159 \end{equation} 
    160 The dynamic boundary condition, neglecting the surface tension (which removes capillary  
    161 waves from the system) leads to the continuity of pressure across the interface $z=\eta$.  
    162 The atmosphere and ocean also exchange horizontal momentum (wind stress), and heat. 
    163 \item[Sea ice - ocean interface:] the ocean and sea ice exchange heat, salt, fresh water  
    164 and momentum. The sea surface temperature is constrained to be at the freezing point  
    165 at the interface. Sea ice salinity is very low ($\sim4-6 \,psu$) compared to those of the  
    166 ocean ($\sim34 \,psu$). The cycle of freezing/melting is associated with fresh water and  
    167 salt fluxes that cannot be neglected. 
     168  \end{equation} 
     169  The dynamic boundary condition, neglecting the surface tension (which removes capillary waves from the system) 
     170  leads to the continuity of pressure across the interface $z=\eta$. 
     171  The atmosphere and ocean also exchange horizontal momentum (wind stress), and heat. 
     172\item[Sea ice - ocean interface:] 
     173  the ocean and sea ice exchange heat, salt, fresh water and momentum. 
     174  The sea surface temperature is constrained to be at the freezing point at the interface. 
     175  Sea ice salinity is very low ($\sim4-6 \,psu$) compared to those of the ocean ($\sim34 \,psu$). 
     176  The cycle of freezing/melting is associated with fresh water and salt fluxes that cannot be neglected. 
    168177\end{description} 
    169178 
     
    184193\label{subsec:PE_p_formulation} 
    185194 
    186 The total pressure at a given depth $z$ is composed of a surface pressure $p_s$ at a  
    187 reference geopotential surface ($z=0$) and a hydrostatic pressure $p_h$ such that:  
    188 $p(i,j,k,t)=p_s(i,j,t)+p_h(i,j,k,t)$. The latter is computed by integrating (\autoref{eq:PE_hydrostatic}),  
    189 assuming that pressure in decibars can be approximated by depth in meters in (\autoref{eq:PE_eos}).  
     195The total pressure at a given depth $z$ is composed of a surface pressure $p_s$ at 
     196a reference geopotential surface ($z=0$) and a hydrostatic pressure $p_h$ such that: 
     197$p(i,j,k,t)=p_s(i,j,t)+p_h(i,j,k,t)$. 
     198The latter is computed by integrating (\autoref{eq:PE_hydrostatic}), 
     199assuming that pressure in decibars can be approximated by depth in meters in (\autoref{eq:PE_eos}). 
    190200The hydrostatic pressure is then given by: 
    191201\begin{equation} \label{eq:PE_pressure} 
     
    193203 = \int_{\varsigma =z}^{\varsigma =0} {g\;\rho \left( {T,S,\varsigma} \right)\;d\varsigma }  
    194204\end{equation} 
    195  Two strategies can be considered for the surface pressure term: $(a)$ introduce of a  
    196  new variable $\eta$, the free-surface elevation, for which a prognostic equation can be  
    197  established and solved; $(b)$ assume that the ocean surface is a rigid lid, on which the  
    198  pressure (or its horizontal gradient) can be diagnosed. When the former strategy is used,  
    199  one solution of the free-surface elevation consists of the excitation of external gravity waves.  
    200  The flow is barotropic and the surface moves up and down with gravity as the restoring force.  
    201  The phase speed of such waves is high (some hundreds of metres per second) so that  
    202  the time step would have to be very short if they were present in the model. The latter  
    203  strategy filters out these waves since the rigid lid approximation implies $\eta=0$, $i.e.$  
    204  the sea surface is the surface $z=0$. This well known approximation increases the surface  
    205  wave speed to infinity and modifies certain other longwave dynamics ($e.g.$ barotropic  
    206  Rossby or planetary waves). The rigid-lid hypothesis is an obsolescent feature in modern  
    207  OGCMs. It has been available until the release 3.1 of  \NEMO, and it has been removed 
    208  in release 3.2 and followings. Only the free surface formulation is now described in the 
    209  this document (see the next sub-section). 
     205Two strategies can be considered for the surface pressure term: 
     206$(a)$ introduce of a  new variable $\eta$, the free-surface elevation, 
     207for which a prognostic equation can be established and solved; 
     208$(b)$ assume that the ocean surface is a rigid lid, 
     209on which the pressure (or its horizontal gradient) can be diagnosed. 
     210When the former strategy is used, one solution of the free-surface elevation consists of 
     211the excitation of external gravity waves. 
     212The flow is barotropic and the surface moves up and down with gravity as the restoring force. 
     213The phase speed of such waves is high (some hundreds of metres per second) so that 
     214the time step would have to be very short if they were present in the model. 
     215The latter strategy filters out these waves since the rigid lid approximation implies $\eta=0$, 
     216$i.e.$ the sea surface is the surface $z=0$. 
     217This well known approximation increases the surface wave speed to infinity and 
     218modifies certain other longwave dynamics ($e.g.$ barotropic Rossby or planetary waves). 
     219The rigid-lid hypothesis is an obsolescent feature in modern OGCMs. 
     220It has been available until the release 3.1 of  \NEMO, and it has been removed in release 3.2 and followings. 
     221Only the free surface formulation is now described in the this document (see the next sub-section). 
    210222 
    211223% ------------------------------------------------------------------------------------------------------------- 
     
    215227\label{subsec:PE_free_surface} 
    216228 
    217 In the free surface formulation, a variable $\eta$, the sea-surface height, is introduced  
    218 which describes the shape of the air-sea interface. This variable is solution of a  
    219 prognostic equation which is established by forming the vertical average of the kinematic  
    220 surface condition (\autoref{eq:PE_w_bbc}): 
     229In the free surface formulation, a variable $\eta$, the sea-surface height, 
     230is introduced which describes the shape of the air-sea interface. 
     231This variable is solution of a prognostic equation which is established by forming the vertical average of 
     232the kinematic surface condition (\autoref{eq:PE_w_bbc}): 
    221233\begin{equation} \label{eq:PE_ssh} 
    222234\frac{\partial \eta }{\partial t}=-D+P-E 
     
    226238and using (\autoref{eq:PE_hydrostatic}) the surface pressure is given by: $p_s = \rho \, g \, \eta$. 
    227239 
    228 Allowing the air-sea interface to move introduces the external gravity waves (EGWs)  
    229 as a class of solution of the primitive equations. These waves are barotropic because  
    230 of hydrostatic assumption, and their phase speed is quite high. Their time scale is  
    231 short with respect to the other processes described by the primitive equations. 
    232  
    233 Two choices can be made regarding the implementation of the free surface in the model,  
     240Allowing the air-sea interface to move introduces the external gravity waves (EGWs) as 
     241a class of solution of the primitive equations. 
     242These waves are barotropic because of hydrostatic assumption, and their phase speed is quite high. 
     243Their time scale is short with respect to the other processes described by the primitive equations. 
     244 
     245Two choices can be made regarding the implementation of the free surface in the model, 
    234246depending on the physical processes of interest.  
    235247 
    236 $\bullet$ If one is interested in EGWs, in particular the tides and their interaction  
    237 with the baroclinic structure of the ocean (internal waves) possibly in shallow seas,  
    238 then a non linear free surface is the most appropriate. This means that no  
    239 approximation is made in (\autoref{eq:PE_ssh}) and that the variation of the ocean  
    240 volume is fully taken into account. Note that in order to study the fast time scales  
    241 associated with EGWs it is necessary to minimize time filtering effects (use an  
    242 explicit time scheme with very small time step, or a split-explicit scheme with  
    243 reasonably small time step, see \autoref{subsec:DYN_spg_exp} or \autoref{subsec:DYN_spg_ts}. 
    244  
    245 $\bullet$ If one is not interested in EGW but rather sees them as high frequency  
    246 noise, it is possible to apply an explicit filter to slow down the fastest waves while  
    247 not altering the slow barotropic Rossby waves. If further, an approximative conservation  
    248 of heat and salt contents is sufficient for the problem solved, then it is  
    249 sufficient to solve a linearized version of (\autoref{eq:PE_ssh}), which still allows  
    250 to take into account freshwater fluxes applied at the ocean surface \citep{Roullet_Madec_JGR00}. 
     248$\bullet$ If one is interested in EGWs, in particular the tides and their interaction with 
     249the baroclinic structure of the ocean (internal waves) possibly in shallow seas, 
     250then a non linear free surface is the most appropriate. 
     251This means that no approximation is made in (\autoref{eq:PE_ssh}) and that 
     252the variation of the ocean volume is fully taken into account. 
     253Note that in order to study the fast time scales associated with EGWs it is necessary to 
     254minimize time filtering effects 
     255(use an explicit time scheme with very small time step, or a split-explicit scheme with reasonably small time step, 
     256see \autoref{subsec:DYN_spg_exp} or \autoref{subsec:DYN_spg_ts}). 
     257 
     258$\bullet$ If one is not interested in EGW but rather sees them as high frequency noise, 
     259it is possible to apply an explicit filter to slow down the fastest waves while 
     260not altering the slow barotropic Rossby waves. 
     261If further, an approximative conservation of heat and salt contents is sufficient for the problem solved, 
     262then it is sufficient to solve a linearized version of (\autoref{eq:PE_ssh}), 
     263which still allows to take into account freshwater fluxes applied at the ocean surface \citep{Roullet_Madec_JGR00}. 
    251264Nevertheless, with the linearization, an exact conservation of heat and salt contents is lost. 
    252265 
    253 The filtering of EGWs in models with a free surface is usually a matter of discretisation  
    254 of the temporal derivatives, using a split-explicit method \citep{Killworth_al_JPO91, Zhang_Endoh_JGR92}  
    255 or the implicit scheme \citep{Dukowicz1994} or the addition of a filtering force in the momentum equation  
    256 \citep{Roullet_Madec_JGR00}. With the present release, \NEMO offers the choice between  
    257 an explicit free surface (see \autoref{subsec:DYN_spg_exp}) or a split-explicit scheme strongly  
    258 inspired the one proposed by \citet{Shchepetkin_McWilliams_OM05} (see \autoref{subsec:DYN_spg_ts}). 
     266The filtering of EGWs in models with a free surface is usually a matter of discretisation of 
     267the temporal derivatives, 
     268using a split-explicit method \citep{Killworth_al_JPO91, Zhang_Endoh_JGR92} or 
     269the implicit scheme \citep{Dukowicz1994} or 
     270the addition of a filtering force in the momentum equation \citep{Roullet_Madec_JGR00}. 
     271With the present release, \NEMO offers the choice between 
     272an explicit free surface (see \autoref{subsec:DYN_spg_exp}) or 
     273a split-explicit scheme strongly inspired the one proposed by \citet{Shchepetkin_McWilliams_OM05} 
     274(see \autoref{subsec:DYN_spg_ts}). 
    259275 
    260276%\newpage 
     
    274290\label{subsec:PE_tensorial} 
    275291 
    276 In many ocean circulation problems, the flow field has regions of enhanced dynamics  
    277 ($i.e.$ surface layers, western boundary currents, equatorial currents, or ocean fronts).  
    278 The representation of such dynamical processes can be improved by specifically increasing  
    279 the model resolution in these regions. As well, it may be convenient to use a lateral  
    280 boundary-following coordinate system to better represent coastal dynamics. Moreover,  
    281 the common geographical coordinate system has a singular point at the North Pole that  
    282 cannot be easily treated in a global model without filtering. A solution consists of introducing  
    283 an appropriate coordinate transformation that shifts the singular point onto land  
    284 \citep{Madec_Imbard_CD96, Murray_JCP96}. As a consequence, it is important to solve the primitive  
    285 equations in various curvilinear coordinate systems. An efficient way of introducing an  
    286 appropriate coordinate transform can be found when using a tensorial formalism.  
    287 This formalism is suited to any multidimensional curvilinear coordinate system. Ocean  
    288 modellers mainly use three-dimensional orthogonal grids on the sphere (spherical earth  
    289 approximation), with preservation of the local vertical. Here we give the simplified equations  
    290 for this particular case. The general case is detailed by \citet{Eiseman1980} in their survey  
    291 of the conservation laws of fluid dynamics. 
    292  
    293 Let (\textit{i},\textit{j},\textit{k}) be a set of orthogonal curvilinear coordinates on the sphere  
    294 associated with the positively oriented orthogonal set of unit vectors (\textbf{i},\textbf{j},\textbf{k})  
    295 linked to the earth such that \textbf{k} is the local upward vector and (\textbf{i},\textbf{j}) are  
    296 two vectors orthogonal to \textbf{k}, $i.e.$ along geopotential surfaces (\autoref{fig:referential}).  
    297 Let $(\lambda,\varphi,z)$ be the geographical coordinate system in which a position is defined  
    298 by the latitude $\varphi(i,j)$, the longitude $\lambda(i,j)$ and the distance from the centre of  
    299 the earth $a+z(k)$ where $a$ is the earth's radius and $z$ the altitude above a reference sea  
    300 level (\autoref{fig:referential}). The local deformation of the curvilinear coordinate system is  
    301 given by $e_1$, $e_2$ and $e_3$, the three scale factors: 
     292In many ocean circulation problems, the flow field has regions of enhanced dynamics 
     293($i.e.$ surface layers, western boundary currents, equatorial currents, or ocean fronts). 
     294The representation of such dynamical processes can be improved by 
     295specifically increasing the model resolution in these regions. 
     296As well, it may be convenient to use a lateral boundary-following coordinate system to 
     297better represent coastal dynamics. 
     298Moreover, the common geographical coordinate system has a singular point at the North Pole that 
     299cannot be easily treated in a global model without filtering. 
     300A solution consists of introducing an appropriate coordinate transformation that 
     301shifts the singular point onto land \citep{Madec_Imbard_CD96, Murray_JCP96}. 
     302As a consequence, it is important to solve the primitive equations in various curvilinear coordinate systems. 
     303An efficient way of introducing an appropriate coordinate transform can be found when using a tensorial formalism. 
     304This formalism is suited to any multidimensional curvilinear coordinate system. 
     305Ocean modellers mainly use three-dimensional orthogonal grids on the sphere (spherical earth approximation), 
     306with preservation of the local vertical. Here we give the simplified equations for this particular case. 
     307The general case is detailed by \citet{Eiseman1980} in their survey of the conservation laws of fluid dynamics. 
     308 
     309Let (\textit{i},\textit{j},\textit{k}) be a set of orthogonal curvilinear coordinates on 
     310the sphere associated with the positively oriented orthogonal set of unit vectors 
     311(\textbf{i},\textbf{j},\textbf{k}) linked to the earth such that 
     312\textbf{k} is the local upward vector and (\textbf{i},\textbf{j}) are two vectors orthogonal to \textbf{k}, 
     313$i.e.$ along geopotential surfaces (\autoref{fig:referential}). 
     314Let $(\lambda,\varphi,z)$ be the geographical coordinate system in which a position is defined by 
     315the latitude $\varphi(i,j)$, the longitude $\lambda(i,j)$ and 
     316the distance from the centre of the earth $a+z(k)$ where $a$ is the earth's radius and 
     317$z$ the altitude above a reference sea level (\autoref{fig:referential}). 
     318The local deformation of the curvilinear coordinate system is given by $e_1$, $e_2$ and $e_3$, 
     319the three scale factors: 
    302320\begin{equation} \label{eq:scale_factors} 
    303 \begin{aligned} 
    304  e_1 &=\left( {a+z} \right)\;\left[ {\left( {\frac{\partial \lambda  
    305 }{\partial i}\cos \varphi } \right)^2+\left( {\frac{\partial \varphi  
    306 }{\partial i}} \right)^2} \right]^{1/2} \\  
    307  e_2 &=\left( {a+z} \right)\;\left[ {\left( {\frac{\partial \lambda  
    308 }{\partial j}\cos \varphi } \right)^2+\left( {\frac{\partial \varphi  
    309 }{\partial j}} \right)^2} \right]^{1/2} \\  
    310  e_3 &=\left( {\frac{\partial z}{\partial k}} \right) \\  
    311  \end{aligned} 
    312  \end{equation} 
    313  
     321  \begin{aligned} 
     322    e_1 &=\left( {a+z} \right)\;\left[ {\left( {\frac{\partial \lambda}{\partial i}\cos \varphi } \right)^2 
     323        +\left( {\frac{\partial \varphi }{\partial i}} \right)^2} \right]^{1/2} \\ 
     324    e_2 &=\left( {a+z} \right)\;\left[ {\left( {\frac{\partial \lambda }{\partial j}\cos \varphi } \right)^2+ 
     325        \left( {\frac{\partial \varphi }{\partial j}} \right)^2} \right]^{1/2} \\ 
     326    e_3 &=\left( {\frac{\partial z}{\partial k}} \right) \\ 
     327  \end{aligned} 
     328\end{equation} 
     329 
     330% >>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     331\begin{figure}[!tb] 
     332  \begin{center} 
     333    \includegraphics[width=0.60\textwidth]{Fig_I_earth_referential} 
     334    \caption{  \protect\label{fig:referential} 
     335      the geographical coordinate system $(\lambda,\varphi,z)$ and the curvilinear 
     336      coordinate system (\textbf{i},\textbf{j},\textbf{k}). } 
     337  \end{center} 
     338\end{figure} 
    314339%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    315 \begin{figure}[!tb]   \begin{center} 
    316 \includegraphics[width=0.60\textwidth]{Fig_I_earth_referential} 
    317 \caption{   \protect\label{fig:referential}  
    318 the geographical coordinate system $(\lambda,\varphi,z)$ and the curvilinear  
    319 coordinate system (\textbf{i},\textbf{j},\textbf{k}). } 
    320 \end{center}   \end{figure} 
    321 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    322  
    323 Since the ocean depth is far smaller than the earth's radius, $a+z$, can be replaced by  
    324 $a$ in (\autoref{eq:scale_factors}) (thin-shell approximation). The resulting horizontal scale  
    325 factors $e_1$, $e_2$  are independent of $k$ while the vertical scale factor is a single  
    326 function of $k$ as \textbf{k} is parallel to \textbf{z}. The scalar and vector operators that  
    327 appear in the primitive equations (\autoref{eq:PE_dyn} to \autoref{eq:PE_eos}) can  
    328 be written in the tensorial form, invariant in any orthogonal horizontal curvilinear coordinate  
    329 system transformation: 
     340 
     341Since the ocean depth is far smaller than the earth's radius, $a+z$, can be replaced by $a$ in 
     342(\autoref{eq:scale_factors}) (thin-shell approximation). 
     343The resulting horizontal scale factors $e_1$, $e_2$  are independent of $k$ while 
     344the vertical scale factor is a single function of $k$ as \textbf{k} is parallel to \textbf{z}. 
     345The scalar and vector operators that appear in the primitive equations 
     346(\autoref{eq:PE_dyn} to \autoref{eq:PE_eos}) can be written in the tensorial form, 
     347invariant in any orthogonal horizontal curvilinear coordinate system transformation: 
    330348\begin{subequations} \label{eq:PE_discrete_operators} 
    331349\begin{equation} \label{eq:PE_grad} 
     
    369387\label{subsec:PE_zco_Eq} 
    370388 
    371 In order to express the Primitive Equations in tensorial formalism, it is necessary to compute  
    372 the horizontal component of the non-linear and viscous terms of the equation using  
    373 \autoref{eq:PE_grad}) to \autoref{eq:PE_lap_vector}.  
    374 Let us set $\vect U=(u,v,w)={\vect{U}}_h +w\;\vect{k}$, the velocity in the $(i,j,k)$ coordinate  
    375 system and define the relative vorticity $\zeta$ and the divergence of the horizontal velocity  
    376 field $\chi$, by: 
     389In order to express the Primitive Equations in tensorial formalism, 
     390it is necessary to compute the horizontal component of the non-linear and viscous terms of the equation using 
     391\autoref{eq:PE_grad}) to \autoref{eq:PE_lap_vector}. 
     392Let us set $\vect U=(u,v,w)={\vect{U}}_h +w\;\vect{k}$, the velocity in the $(i,j,k)$ coordinate system and 
     393define the relative vorticity $\zeta$ and the divergence of the horizontal velocity field $\chi$, by: 
    377394\begin{equation} \label{eq:PE_curl_Uh} 
    378395\zeta =\frac{1}{e_1 e_2 }\left[ {\frac{\partial \left( {e_2 \,v}  
     
    386403\end{equation} 
    387404 
    388 Using the fact that the horizontal scale factors $e_1$ and $e_2$ are independent of $k$  
    389 and that $e_3$  is a function of the single variable $k$, the nonlinear term of  
    390 \autoref{eq:PE_dyn} can be transformed as follows: 
     405Using the fact that the horizontal scale factors $e_1$ and $e_2$ are independent of $k$ and that 
     406$e_3$  is a function of the single variable $k$, 
     407the nonlinear term of \autoref{eq:PE_dyn} can be transformed as follows: 
    391408\begin{flalign*} 
    392409&\left[ {\left( { \nabla \times {\rm {\bf U}}    } \right) \times {\rm {\bf U}} 
     
    426443\end{flalign*} 
    427444 
    428 The last term of the right hand side is obviously zero, and thus the nonlinear term of  
     445The last term of the right hand side is obviously zero, and thus the nonlinear term of 
    429446\autoref{eq:PE_dyn} is written in the $(i,j,k)$ coordinate system: 
    430447\begin{equation} \label{eq:PE_vector_form} 
     
    437454\end{equation} 
    438455 
    439 This is the so-called \textit{vector invariant form} of the momentum advection term.  
    440 For some purposes, it can be advantageous to write this term in the so-called flux form,  
    441 $i.e.$ to write it as the divergence of fluxes. For example, the first component of  
    442 \autoref{eq:PE_vector_form} (the $i$-component) is transformed as follows: 
     456This is the so-called \textit{vector invariant form} of the momentum advection term. 
     457For some purposes, it can be advantageous to write this term in the so-called flux form, 
     458$i.e.$ to write it as the divergence of fluxes. 
     459For example, the first component of \autoref{eq:PE_vector_form} (the $i$-component) is transformed as follows: 
    443460\begin{flalign*} 
    444461&{ \begin{array}{*{20}l} 
     
    525542\end{multline} 
    526543 
    527 The flux form has two terms, the first one is expressed as the divergence of momentum  
    528 fluxes (hence the flux form name given to this formulation) and the second one is due to  
    529 the curvilinear nature of the coordinate system used. The latter is called the \emph{metric}  
    530 term and can be viewed as a modification of the Coriolis parameter:  
     544The flux form has two terms, 
     545the first one is expressed as the divergence of momentum fluxes (hence the flux form name given to this formulation) 
     546and the second one is due to the curvilinear nature of the coordinate system used. 
     547The latter is called the \emph{metric} term and can be viewed as a modification of the Coriolis parameter:  
    531548\begin{equation} \label{eq:PE_cor+metric} 
    532549f \to f + \frac{1}{e_1\;e_2}  \left(  v \frac{\partial e_2}{\partial i} 
     
    534551\end{equation} 
    535552 
    536 Note that in the case of geographical coordinate, $i.e.$ when $(i,j) \to (\lambda ,\varphi )$  
    537 and $(e_1 ,e_2) \to (a \,\cos \varphi ,a)$, we recover the commonly used modification of  
    538 the Coriolis parameter $f \to f+(u/a) \tan \varphi$. 
     553Note that in the case of geographical coordinate, 
     554$i.e.$ when $(i,j) \to (\lambda ,\varphi )$ and $(e_1 ,e_2) \to (a \,\cos \varphi ,a)$, 
     555we recover the commonly used modification of the Coriolis parameter $f \to f+(u/a) \tan \varphi$. 
    539556 
    540557 
    541558$\ $\newline    % force a new ligne 
    542559 
    543 To sum up, the curvilinear $z$-coordinate equations solved by the ocean model can be  
    544 written in the following tensorial formalism: 
     560To sum up, the curvilinear $z$-coordinate equations solved by the ocean model can be written in 
     561the following tensorial formalism: 
    545562 
    546563\vspace{+10pt} 
     
    594611\end{multline} 
    595612\end{subequations} 
    596 where $\zeta$, the relative vorticity, is given by \autoref{eq:PE_curl_Uh} and $p_s $,  
    597 the surface pressure, is given by: 
     613where $\zeta$, the relative vorticity, is given by \autoref{eq:PE_curl_Uh} and 
     614$p_s $, the surface pressure, is given by: 
    598615\begin{equation} \label{eq:PE_spg} 
    599616p_s =  \rho \,g \,\eta  
    600617\end{equation} 
    601 with $\eta$ is solution of \autoref{eq:PE_ssh} 
     618with $\eta$ is solution of \autoref{eq:PE_ssh}. 
    602619 
    603620The vertical velocity and the hydrostatic pressure are diagnosed from the following equations: 
     
    628645\end{equation} 
    629646 
    630 The expression of \textbf{D}$^{U}$, $D^{S}$ and $D^{T}$ depends on the subgrid scale  
    631 parameterisation used. It will be defined in \autoref{eq:PE_zdf}. The nature and formulation of  
    632 ${\rm {\bf F}}^{\rm {\bf U}}$, $F^T$ and $F^S$, the surface forcing terms, are discussed  
    633 in \autoref{chap:SBC}. 
     647The expression of \textbf{D}$^{U}$, $D^{S}$ and $D^{T}$ depends on the subgrid scale parameterisation used. 
     648It will be defined in \autoref{eq:PE_zdf}. 
     649The nature and formulation of ${\rm {\bf F}}^{\rm {\bf U}}$, $F^T$ and $F^S$, the surface forcing terms, 
     650are discussed in \autoref{chap:SBC}. 
    634651 
    635652 
     
    642659\label{sec:PE_gco} 
    643660 
    644 The ocean domain presents a huge diversity of situation in the vertical. First the ocean surface is a time dependent surface (moving surface). Second the ocean floor depends on the geographical position, varying from more than 6,000 meters in abyssal trenches to zero at the coast. Last but not least, the ocean stratification exerts a strong barrier to vertical motions and mixing.  
    645 Therefore, in order to represent the ocean with respect to the first point a space and time dependent vertical coordinate that follows the variation of the sea surface height $e.g.$ an $z$*-coordinate; for the second point, a space variation to fit the change of bottom topography $e.g.$ a terrain-following or $\sigma$-coordinate; and for the third point, one will be tempted to use a space and time dependent coordinate that follows the isopycnal surfaces, $e.g.$ an isopycnic coordinate. 
    646  
    647 In order to satisfy two or more constrains one can even be tempted to mixed these coordinate systems, as in HYCOM (mixture of $z$-coordinate at the surface, isopycnic coordinate in the ocean interior and $\sigma$ at the ocean bottom) \citep{Chassignet_al_JPO03}  or OPA (mixture of $z$-coordinate in vicinity the surface and steep topography areas and $\sigma$-coordinate elsewhere) \citep{Madec_al_JPO96} among others. 
    648  
    649 In fact one is totally free to choose any space and time vertical coordinate by introducing an arbitrary vertical coordinate : 
     661The ocean domain presents a huge diversity of situation in the vertical. 
     662First the ocean surface is a time dependent surface (moving surface). 
     663Second the ocean floor depends on the geographical position, 
     664varying from more than 6,000 meters in abyssal trenches to zero at the coast. 
     665Last but not least, the ocean stratification exerts a strong barrier to vertical motions and mixing.  
     666Therefore, in order to represent the ocean with respect to 
     667the first point a space and time dependent vertical coordinate that follows the variation of the sea surface height 
     668$e.g.$ an $z$*-coordinate; 
     669for the second point, a space variation to fit the change of bottom topography 
     670$e.g.$ a terrain-following or $\sigma$-coordinate; 
     671and for the third point, one will be tempted to use a space and time dependent coordinate that 
     672follows the isopycnal surfaces, $e.g.$ an isopycnic coordinate. 
     673 
     674In order to satisfy two or more constrains one can even be tempted to mixed these coordinate systems, as in 
     675HYCOM (mixture of $z$-coordinate at the surface, isopycnic coordinate in the ocean interior and $\sigma$ at 
     676the ocean bottom) \citep{Chassignet_al_JPO03} or 
     677OPA (mixture of $z$-coordinate in vicinity the surface and steep topography areas and $\sigma$-coordinate elsewhere) 
     678\citep{Madec_al_JPO96} among others. 
     679 
     680In fact one is totally free to choose any space and time vertical coordinate by 
     681introducing an arbitrary vertical coordinate : 
    650682\begin{equation} \label{eq:PE_s} 
    651683s=s(i,j,k,t) 
    652684\end{equation} 
    653 with the restriction that the above equation gives a single-valued monotonic relationship between $s$ and $k$, when $i$, $j$ and $t$ are held fixed. \autoref{eq:PE_s} is a transformation from the $(i,j,k,t)$ coordinate system with independent variables into the $(i,j,s,t)$ generalised coordinate system with $s$ depending on the other three variables through \autoref{eq:PE_s}. 
    654 This so-called \textit{generalised vertical coordinate} \citep{Kasahara_MWR74} is in fact an Arbitrary Lagrangian--Eulerian (ALE) coordinate. Indeed, choosing an expression for $s$ is an arbitrary choice that determines which part of the vertical velocity (defined from a fixed referential) will cross the levels (Eulerian part) and which part will be used to move them (Lagrangian part). 
    655 The coordinate is also sometime referenced as an adaptive coordinate \citep{Hofmeister_al_OM09}, since the coordinate system is adapted in the course of the simulation. Its most often used implementation is via an ALE algorithm, in which a pure lagrangian step is followed by regridding and remapping steps, the later step implicitly embedding the vertical advection \citep{Hirt_al_JCP74, Chassignet_al_JPO03, White_al_JCP09}. Here we follow the \citep{Kasahara_MWR74} strategy : a regridding step (an update of the vertical coordinate) followed by an eulerian step with an explicit computation of vertical advection relative to the moving s-surfaces. 
     685with the restriction that the above equation gives a single-valued monotonic relationship between $s$ and $k$, 
     686when $i$, $j$ and $t$ are held fixed. 
     687\autoref{eq:PE_s} is a transformation from the $(i,j,k,t)$ coordinate system with independent variables into 
     688the $(i,j,s,t)$ generalised coordinate system with $s$ depending on the other three variables through 
     689\autoref{eq:PE_s}. 
     690This so-called \textit{generalised vertical coordinate} \citep{Kasahara_MWR74} is in fact 
     691an Arbitrary Lagrangian--Eulerian (ALE) coordinate. 
     692Indeed, choosing an expression for $s$ is an arbitrary choice that determines 
     693which part of the vertical velocity (defined from a fixed referential) will cross the levels (Eulerian part) and 
     694which part will be used to move them (Lagrangian part). 
     695The coordinate is also sometime referenced as an adaptive coordinate \citep{Hofmeister_al_OM09}, 
     696since the coordinate system is adapted in the course of the simulation. 
     697Its most often used implementation is via an ALE algorithm, 
     698in which a pure lagrangian step is followed by regridding and remapping steps, 
     699the later step implicitly embedding the vertical advection 
     700\citep{Hirt_al_JCP74, Chassignet_al_JPO03, White_al_JCP09}. 
     701Here we follow the \citep{Kasahara_MWR74} strategy: 
     702a regridding step (an update of the vertical coordinate) followed by an eulerian step with 
     703an explicit computation of vertical advection relative to the moving s-surfaces. 
    656704 
    657705%\gmcomment{ 
     
    659707%A key point here is that the $s$-coordinate depends on $(i,j)$ ==> horizontal pressure gradient... 
    660708 
    661 the generalized vertical coordinates used in ocean modelling are not orthogonal,  
    662 which contrasts with many other applications in mathematical physics.  
    663 Hence, it is useful to keep in mind the following properties that may seem  
    664 odd on initial encounter. 
    665  
    666 The horizontal velocity in ocean models measures motions in the horizontal plane,  
    667 perpendicular to the local gravitational field. That is, horizontal velocity is mathematically  
    668 the same regardless the vertical coordinate, be it geopotential, isopycnal, pressure,  
    669 or terrain following. The key motivation for maintaining the same horizontal velocity  
    670 component is that the hydrostatic and geostrophic balances are dominant in the large-scale ocean.  
    671 Use of an alternative quasi-horizontal velocity, for example one oriented parallel  
    672 to the generalized surface, would lead to unacceptable numerical errors.  
    673 Correspondingly, the vertical direction is anti-parallel to the gravitational force in all  
    674 of the coordinate systems. We do not choose the alternative of a quasi-vertical  
    675 direction oriented normal to the surface of a constant generalized vertical coordinate.  
    676  
    677 It is the method used to measure transport across the generalized vertical coordinate  
    678 surfaces which differs between the vertical coordinate choices. That is, computation  
    679 of the dia-surface velocity component represents the fundamental distinction between  
    680 the various coordinates. In some models, such as geopotential, pressure, and  
    681 terrain following, this transport is typically diagnosed from volume or mass conservation.  
    682 In other models, such as isopycnal layered models, this transport is prescribed based  
    683 on assumptions about the physical processes producing a flux across the layer interfaces.  
    684  
    685  
    686 In this section we first establish the PE in the generalised vertical $s$-coordinate,  
     709the generalized vertical coordinates used in ocean modelling are not orthogonal, 
     710which contrasts with many other applications in mathematical physics. 
     711Hence, it is useful to keep in mind the following properties that may seem odd on initial encounter. 
     712 
     713The horizontal velocity in ocean models measures motions in the horizontal plane, 
     714perpendicular to the local gravitational field. 
     715That is, horizontal velocity is mathematically the same regardless the vertical coordinate, be it geopotential, 
     716isopycnal, pressure, or terrain following. 
     717The key motivation for maintaining the same horizontal velocity component is that 
     718the hydrostatic and geostrophic balances are dominant in the large-scale ocean. 
     719Use of an alternative quasi-horizontal velocity, for example one oriented parallel to the generalized surface, 
     720would lead to unacceptable numerical errors. 
     721Correspondingly, the vertical direction is anti-parallel to the gravitational force in 
     722all of the coordinate systems. 
     723We do not choose the alternative of a quasi-vertical direction oriented normal to 
     724the surface of a constant generalized vertical coordinate.  
     725 
     726It is the method used to measure transport across the generalized vertical coordinate surfaces which differs between 
     727the vertical coordinate choices. 
     728That is, computation of the dia-surface velocity component represents the fundamental distinction between 
     729the various coordinates. 
     730In some models, such as geopotential, pressure, and terrain following, this transport is typically diagnosed from 
     731volume or mass conservation. 
     732In other models, such as isopycnal layered models, this transport is prescribed based on assumptions about 
     733the physical processes producing a flux across the layer interfaces.  
     734 
     735 
     736In this section we first establish the PE in the generalised vertical $s$-coordinate, 
    687737then we discuss the particular cases available in \NEMO, namely $z$, $z$*, $s$, and $\tilde z$.   
    688738%} 
     
    693743\subsection{\textit{S-}coordinate formulation} 
    694744 
    695 Starting from the set of equations established in \autoref{sec:PE_zco} for the special case $k=z$  
    696 and thus $e_3=1$, we introduce an arbitrary vertical coordinate $s=s(i,j,k,t)$, which includes  
    697 $z$-, \textit{z*}- and $\sigma-$coordinates as special cases ($s=z$, $s=\textit{z*}$, and  
    698 $s=\sigma=z/H$ or $=z/\left(H+\eta \right)$, resp.). A formal derivation of the transformed  
    699 equations is given in \autoref{apdx:A}. Let us define the vertical scale factor by  
    700 $e_3=\partial_s z$  ($e_3$ is now a function of $(i,j,k,t)$ ), and the slopes in the  
    701 (\textbf{i},\textbf{j}) directions between $s-$ and $z-$surfaces by : 
     745Starting from the set of equations established in \autoref{sec:PE_zco} for the special case $k=z$ and thus $e_3=1$, 
     746we introduce an arbitrary vertical coordinate $s=s(i,j,k,t)$, 
     747which includes $z$-, \textit{z*}- and $\sigma-$coordinates as special cases 
     748($s=z$, $s=\textit{z*}$, and $s=\sigma=z/H$ or $=z/\left(H+\eta \right)$, resp.). 
     749A formal derivation of the transformed equations is given in \autoref{apdx:A}. 
     750Let us define the vertical scale factor by $e_3=\partial_s z$  ($e_3$ is now a function of $(i,j,k,t)$ ), 
     751and the slopes in the (\textbf{i},\textbf{j}) directions between $s-$ and $z-$surfaces by: 
    702752\begin{equation} \label{eq:PE_sco_slope} 
    703753\sigma _1 =\frac{1}{e_1 }\;\left. {\frac{\partial z}{\partial i}} \right|_s  
     
    711761\end{equation} 
    712762 
    713 The equations solved by the ocean model \autoref{eq:PE} in $s-$coordinate can be written as follows (see \autoref{sec:A_momentum}): 
     763The equations solved by the ocean model \autoref{eq:PE} in $s-$coordinate can be written as follows 
     764(see \autoref{sec:A_momentum}): 
    714765 
    715766 \vspace{0.5cm} 
     
    763814\end{multline} 
    764815 
    765 where the relative vorticity, \textit{$\zeta $}, the surface pressure gradient, and the hydrostatic  
    766 pressure have the same expressions as in $z$-coordinates although they do not represent  
    767 exactly the same quantities. $\omega$ is provided by the continuity equation  
    768 (see \autoref{apdx:A}): 
     816where the relative vorticity, \textit{$\zeta $}, the surface pressure gradient, 
     817and the hydrostatic pressure have the same expressions as in $z$-coordinates although 
     818they do not represent exactly the same quantities. 
     819$\omega$ is provided by the continuity equation (see \autoref{apdx:A}): 
    769820\begin{equation} \label{eq:PE_sco_continuity} 
    770821\frac{\partial e_3}{\partial t} + e_3 \; \chi + \frac{\partial \omega }{\partial s} = 0    
     
    791842\end{multline} 
    792843 
    793 The equation of state has the same expression as in $z$-coordinate, and similar expressions  
    794 are used for mixing and forcing terms. 
     844The equation of state has the same expression as in $z$-coordinate, 
     845and similar expressions are used for mixing and forcing terms. 
    795846 
    796847\gmcomment{ 
     
    808859 
    809860%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    810 \begin{figure}[!b]    \begin{center} 
    811 \includegraphics[width=1.0\textwidth]{Fig_z_zstar} 
    812 \caption{   \protect\label{fig:z_zstar}  
    813 (a) $z$-coordinate in linear free-surface case ;  
    814 (b) $z-$coordinate in non-linear free surface case ;  
    815 (c) re-scaled height coordinate (become popular as the \textit{z*-}coordinate  
    816 \citep{Adcroft_Campin_OM04} ).} 
    817 \end{center}   \end{figure} 
     861\begin{figure}[!b] 
     862  \begin{center} 
     863    \includegraphics[width=1.0\textwidth]{Fig_z_zstar} 
     864    \caption{  \protect\label{fig:z_zstar} 
     865      (a) $z$-coordinate in linear free-surface case ; 
     866      (b) $z-$coordinate in non-linear free surface case ; 
     867      (c) re-scaled height coordinate (become popular as the \textit{z*-}coordinate 
     868      \citep{Adcroft_Campin_OM04} ). 
     869    } 
     870  \end{center} 
     871\end{figure} 
    818872%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    819873 
    820874 
    821 In that case, the free surface equation is nonlinear, and the variations of volume are fully  
    822 taken into account. These coordinates systems is presented in a report \citep{Levier2007}  
    823 available on the \NEMO web site.  
     875In that case, the free surface equation is nonlinear, and the variations of volume are fully taken into account. 
     876These coordinates systems is presented in a report \citep{Levier2007} available on the \NEMO web site.  
    824877 
    825878%\gmcomment{ 
    826 The \textit{z*} coordinate approach is an unapproximated, non-linear free surface implementation  
    827 which allows one to deal with large amplitude free-surface 
    828 variations relative to the vertical resolution \citep{Adcroft_Campin_OM04}. In 
    829 the  \textit{z*} formulation, the variation of the column thickness due to sea-surface 
    830 undulations is not concentrated in the surface level, as in the $z$-coordinate formulation, 
    831 but is equally distributed over the full water column. Thus vertical 
    832 levels naturally follow sea-surface variations, with a linear attenuation with 
    833 depth, as illustrated by figure fig.1c . Note that with a flat bottom, such as in 
    834 fig.1c, the bottom-following  $z$ coordinate and  \textit{z*} are equivalent. 
    835 The definition and modified oceanic equations for the rescaled vertical coordinate 
    836  \textit{z*}, including the treatment of fresh-water flux at the surface, are 
    837 detailed in Adcroft and Campin (2004). The major points are summarized 
    838 here. The position ( \textit{z*}) and vertical discretization (\textit{z*}) are expressed as: 
     879The \textit{z*} coordinate approach is an unapproximated, non-linear free surface implementation which allows one to 
     880deal with large amplitude free-surface variations relative to the vertical resolution \citep{Adcroft_Campin_OM04}. 
     881In the \textit{z*} formulation, 
     882the variation of the column thickness due to sea-surface undulations is not concentrated in the surface level, 
     883as in the $z$-coordinate formulation, but is equally distributed over the full water column. 
     884Thus vertical levels naturally follow sea-surface variations, with a linear attenuation with depth, 
     885as illustrated by figure fig.1c. 
     886Note that with a flat bottom, such as in fig.1c, the bottom-following $z$ coordinate and \textit{z*} are equivalent. 
     887The definition and modified oceanic equations for the rescaled vertical coordinate  \textit{z*}, 
     888including the treatment of fresh-water flux at the surface, are detailed in Adcroft and Campin (2004). 
     889The major points are summarized here. 
     890The position ( \textit{z*}) and vertical discretization (\textit{z*}) are expressed as: 
    839891\begin{equation} \label{eq:z-star} 
    840892H +  \textit{z*} = (H + z) / r \quad \text{and} \ \delta \textit{z*} = \delta z / r \quad \text{with} \ r = \frac{H+\eta} {H} 
    841893\end{equation}  
    842 Since the vertical displacement of the free surface is incorporated in the vertical 
    843 coordinate  \textit{z*}, the upper and lower boundaries are at fixed  \textit{z*} position,   
    844 $\textit{z*} = 0$ and  $\textit{z*} = -H$ respectively. Also the divergence of the flow field  
    845 is no longer zero as shown by the continuity equation: 
     894Since the vertical displacement of the free surface is incorporated in the vertical coordinate \textit{z*}, 
     895the upper and lower boundaries are at fixed  \textit{z*} position, 
     896$\textit{z*} = 0$ and  $\textit{z*} = -H$ respectively. 
     897Also the divergence of the flow field is no longer zero as shown by the continuity equation: 
    846898\begin{equation*}  
    847899\frac{\partial r}{\partial t} = \nabla_{\textit{z*}} \cdot \left( r \; \rm{\bf U}_h \right) 
     
    853905% from MOM4p1 documentation 
    854906 
    855 To overcome problems with vanishing surface and/or bottom cells, we consider the  
    856 zstar coordinate  
     907To overcome problems with vanishing surface and/or bottom cells, we consider the zstar coordinate  
    857908\begin{equation} \label{eq:PE_} 
    858909   z^\star = H \left( \frac{z-\eta}{H+\eta} \right) 
    859910\end{equation} 
    860911 
    861 This coordinate is closely related to the "eta" coordinate used in many atmospheric  
    862 models (see Black (1994) for a review of eta coordinate atmospheric models). It  
    863 was originally used in ocean models by Stacey et al. (1995) for studies of tides  
    864 next to shelves, and it has been recently promoted by Adcroft and Campin (2004)  
    865 for global climate modelling. 
    866  
    867 The surfaces of constant $z^\star$ are quasi-horizontal. Indeed, the $z^\star$ coordinate reduces to $z$ when $\eta$ is zero. In general, when noting the large differences between  
    868 undulations of the bottom topography versus undulations in the surface height, it  
    869 is clear that surfaces constant $z^\star$ are very similar to the depth surfaces. These properties greatly reduce difficulties of computing the horizontal pressure gradient relative to terrain following sigma models discussed in \autoref{subsec:PE_sco}.  
    870 Additionally, since $z^\star$ when $\eta = 0$, no flow is spontaneously generated in an  
    871 unforced ocean starting from rest, regardless the bottom topography. This behaviour is in contrast to the case with "s"-models, where pressure gradient errors in  
    872 the presence of nontrivial topographic variations can generate nontrivial spontaneous flow from a resting state, depending on the sophistication of the pressure  
    873 gradient solver. The quasi-horizontal nature of the coordinate surfaces also facilitates the implementation of neutral physics parameterizations in $z^\star$ models using  
    874 the same techniques as in $z$-models (see Chapters 13-16 of \cite{Griffies_Bk04}) for a  
    875 discussion of neutral physics in $z$-models, as well as \autoref{sec:LDF_slp}  
    876 in this document for treatment in \NEMO).  
    877  
    878 The range over which $z^\star$ varies is time independent $-H \leq z^\star \leq 0$. Hence, all  
    879 cells remain nonvanishing, so long as the surface height maintains $\eta > ?H$. This  
    880 is a minor constraint relative to that encountered on the surface height when using  
    881 $s = z$ or $s = z - \eta$.  
    882  
    883 Because $z^\star$ has a time independent range, all grid cells have static increments  
    884 ds, and the sum of the ver tical increments yields the time independent ocean  
    885 depth %·k ds = H.  
    886 The $z^\star$ coordinate is therefore invisible to undulations of the  
    887 free surface, since it moves along with the free surface. This proper ty means that  
    888 no spurious ver tical transpor t is induced across surfaces of constant $z^\star$ by the  
    889 motion of external gravity waves. Such spurious transpor t can be a problem in  
    890 z-models, especially those with tidal forcing. Quite generally, the time independent  
    891 range for the $z^\star$ coordinate is a very convenient proper ty that allows for a nearly  
    892 arbitrary ver tical resolution even in the presence of large amplitude fluctuations of  
    893 the surface height, again so long as $\eta > -H$.  
     912This coordinate is closely related to the "eta" coordinate used in many atmospheric models 
     913(see Black (1994) for a review of eta coordinate atmospheric models). 
     914It was originally used in ocean models by Stacey et al. (1995) for studies of tides next to shelves, 
     915and it has been recently promoted by Adcroft and Campin (2004) for global climate modelling. 
     916 
     917The surfaces of constant $z^\star$ are quasi-horizontal. 
     918Indeed, the $z^\star$ coordinate reduces to $z$ when $\eta$ is zero. 
     919In general, when noting the large differences between 
     920undulations of the bottom topography versus undulations in the surface height, 
     921it is clear that surfaces constant $z^\star$ are very similar to the depth surfaces. 
     922These properties greatly reduce difficulties of computing the horizontal pressure gradient relative to 
     923terrain following sigma models discussed in \autoref{subsec:PE_sco}. 
     924Additionally, since $z^\star$ when $\eta = 0$, 
     925no flow is spontaneously generated in an unforced ocean starting from rest, regardless the bottom topography. 
     926This behaviour is in contrast to the case with "s"-models, where pressure gradient errors in the presence of 
     927nontrivial topographic variations can generate nontrivial spontaneous flow from a resting state, 
     928depending on the sophistication of the pressure gradient solver. 
     929The quasi-horizontal nature of the coordinate surfaces also facilitates the implementation of 
     930neutral physics parameterizations in $z^\star$ models using the same techniques as in $z$-models 
     931(see Chapters 13-16 of \cite{Griffies_Bk04}) for a discussion of neutral physics in $z$-models, 
     932as well as \autoref{sec:LDF_slp} in this document for treatment in \NEMO). 
     933 
     934The range over which $z^\star$ varies is time independent $-H \leq z^\star \leq 0$. 
     935Hence, all cells remain nonvanishing, so long as the surface height maintains $\eta > ?H$. 
     936This is a minor constraint relative to that encountered on the surface height when using $s = z$ or $s = z - \eta$.  
     937 
     938Because $z^\star$ has a time independent range, all grid cells have static increments ds, 
     939and the sum of the ver tical increments yields the time independent ocean depth. %·k ds = H.  
     940The $z^\star$ coordinate is therefore invisible to undulations of the free surface, 
     941since it moves along with the free surface. 
     942This proper ty means that no spurious vertical transport is induced across surfaces of constant $z^\star$ by 
     943the motion of external gravity waves. 
     944Such spurious transpor t can be a problem in z-models, especially those with tidal forcing. 
     945Quite generally, the time independent range for the $z^\star$ coordinate is a very convenient property that 
     946allows for a nearly arbitrary ver tical resolution even in the presence of large amplitude fluctuations of 
     947the surface height, again so long as $\eta > -H$. 
    894948 
    895949%end MOM doc %%% 
     
    909963\subsubsection{Introduction} 
    910964 
    911 Several important aspects of the ocean circulation are influenced by bottom topography.  
    912 Of course, the most important is that bottom topography determines deep ocean sub-basins,  
    913 barriers, sills and channels that strongly constrain the path of water masses, but more subtle  
    914 effects exist. For example, the topographic $\beta$-effect is usually larger than the planetary  
    915 one along continental slopes. Topographic Rossby waves can be excited and can interact  
    916 with the mean current. In the $z-$coordinate system presented in the previous section  
    917 (\autoref{sec:PE_zco}), $z-$surfaces are geopotential surfaces. The bottom topography is  
    918 discretised by steps. This often leads to a misrepresentation of a gradually sloping bottom  
    919 and to large localized depth gradients associated with large localized vertical velocities.  
    920 The response to such a velocity field often leads to numerical dispersion effects.  
    921 One solution to strongly reduce this error is to use a partial step representation of bottom  
    922 topography instead of a full step one \cite{Pacanowski_Gnanadesikan_MWR98}.  
    923 Another solution is to introduce a terrain-following coordinate system (hereafter $s-$coordinate)  
    924  
    925 The $s$-coordinate avoids the discretisation error in the depth field since the layers of  
    926 computation are gradually adjusted with depth to the ocean bottom. Relatively small  
    927 topographic features as well as  gentle, large-scale slopes of the sea floor in the deep  
    928 ocean, which would be ignored in typical $z$-model applications with the largest grid  
    929 spacing at greatest depths, can easily be represented (with relatively low vertical resolution).  
    930 A terrain-following model (hereafter $s-$model) also facilitates the modelling of the  
    931 boundary layer flows over a large depth range, which in the framework of the $z$-model  
    932 would require high vertical resolution over the whole depth range. Moreover, with a  
    933 $s$-coordinate it is possible, at least in principle, to have the bottom and the sea surface  
    934 as the only boundaries of the domain (nomore lateral boundary condition to specify).  
    935 Nevertheless, a $s$-coordinate also has its drawbacks. Perfectly adapted to a  
    936 homogeneous ocean, it has strong limitations as soon as stratification is introduced.  
    937 The main two problems come from the truncation error in the horizontal pressure  
    938 gradient and a possibly increased diapycnal diffusion. The horizontal pressure force  
    939 in $s$-coordinate consists of two terms (see \autoref{apdx:A}), 
     965Several important aspects of the ocean circulation are influenced by bottom topography. 
     966Of course, the most important is that bottom topography determines deep ocean sub-basins, barriers, sills and 
     967channels that strongly constrain the path of water masses, but more subtle effects exist. 
     968For example, the topographic $\beta$-effect is usually larger than the planetary one along continental slopes. 
     969Topographic Rossby waves can be excited and can interact with the mean current. 
     970In the $z-$coordinate system presented in the previous section (\autoref{sec:PE_zco}), 
     971$z-$surfaces are geopotential surfaces. 
     972The bottom topography is discretised by steps. 
     973This often leads to a misrepresentation of a gradually sloping bottom and to 
     974large localized depth gradients associated with large localized vertical velocities. 
     975The response to such a velocity field often leads to numerical dispersion effects. 
     976One solution to strongly reduce this error is to use a partial step representation of bottom topography instead of 
     977a full step one \cite{Pacanowski_Gnanadesikan_MWR98}. 
     978Another solution is to introduce a terrain-following coordinate system (hereafter $s-$coordinate). 
     979 
     980The $s$-coordinate avoids the discretisation error in the depth field since the layers of 
     981computation are gradually adjusted with depth to the ocean bottom. 
     982Relatively small topographic features as well as  gentle, large-scale slopes of the sea floor in the deep ocean, 
     983which would be ignored in typical $z$-model applications with the largest grid spacing at greatest depths, 
     984can easily be represented (with relatively low vertical resolution). 
     985A terrain-following model (hereafter $s-$model) also facilitates the modelling of the boundary layer flows over 
     986a large depth range, which in the framework of the $z$-model would require high vertical resolution over 
     987the whole depth range. 
     988Moreover, with a $s$-coordinate it is possible, at least in principle, to have the bottom and the sea surface as 
     989the only boundaries of the domain (no more lateral boundary condition to specify). 
     990Nevertheless, a $s$-coordinate also has its drawbacks. Perfectly adapted to a homogeneous ocean, 
     991it has strong limitations as soon as stratification is introduced. 
     992The main two problems come from the truncation error in the horizontal pressure gradient and 
     993a possibly increased diapycnal diffusion. 
     994The horizontal pressure force in $s$-coordinate consists of two terms (see \autoref{apdx:A}), 
    940995 
    941996\begin{equation} \label{eq:PE_p_sco} 
     
    944999\end{equation} 
    9451000 
    946 The second term in \autoref{eq:PE_p_sco} depends on the tilt of the coordinate surface  
    947 and introduces a truncation error that is not present in a $z$-model. In the special case  
    948 of a $\sigma-$coordinate (i.e. a depth-normalised coordinate system $\sigma = z/H$),  
    949 \citet{Haney1991} and \citet{Beckmann1993} have given estimates of the magnitude  
    950 of this truncation error. It depends on topographic slope, stratification, horizontal and  
    951 vertical resolution, the equation of state, and the finite difference scheme. This error  
    952 limits the possible topographic slopes that a model can handle at a given horizontal  
    953 and vertical resolution. This is a severe restriction for large-scale applications using  
    954 realistic bottom topography. The large-scale slopes require high horizontal resolution,  
    955 and the computational cost becomes prohibitive. This problem can be at least partially  
    956 overcome by mixing $s$-coordinate and step-like representation of bottom topography \citep{Gerdes1993a,Gerdes1993b,Madec_al_JPO96}. However, the definition of the model  
    957 domain vertical coordinate becomes then a non-trivial thing for a realistic bottom  
    958 topography: a envelope topography is defined in $s$-coordinate on which a full or  
    959 partial step bottom topography is then applied in order to adjust the model depth to  
    960 the observed one (see \autoref{sec:DOM_zgr}. 
    961  
    962 For numerical reasons a minimum of diffusion is required along the coordinate surfaces  
    963 of any finite difference model. It causes spurious diapycnal mixing when coordinate  
    964 surfaces do not coincide with isoneutral surfaces. This is the case for a $z$-model as  
    965 well as for a $s$-model. However, density varies more strongly on $s-$surfaces than  
    966 on horizontal surfaces in regions of large topographic slopes, implying larger diapycnal  
    967 diffusion in a $s$-model than in a $z$-model. Whereas such a diapycnal diffusion in a  
    968 $z$-model tends to weaken horizontal density (pressure) gradients and thus the horizontal  
    969 circulation, it usually reinforces these gradients in a $s$-model, creating spurious circulation.  
    970 For example, imagine an isolated bump of topography in an ocean at rest with a horizontally  
    971 uniform stratification. Spurious diffusion along $s$-surfaces will induce a bump of isoneutral  
    972 surfaces over the topography, and thus will generate there a baroclinic eddy. In contrast,  
    973 the ocean will stay at rest in a $z$-model. As for the truncation error, the problem can be reduced by introducing the terrain-following coordinate below the strongly stratified portion of the water column  
    974 ($i.e.$ the main thermocline) \citep{Madec_al_JPO96}. An alternate solution consists of rotating  
    975 the lateral diffusive tensor to geopotential or to isoneutral surfaces (see \autoref{subsec:PE_ldf}.  
    976 Unfortunately, the slope of isoneutral surfaces relative to the $s$-surfaces can very large,  
     1001The second term in \autoref{eq:PE_p_sco} depends on the tilt of the coordinate surface and 
     1002introduces a truncation error that is not present in a $z$-model. 
     1003In the special case of a $\sigma-$coordinate (i.e. a depth-normalised coordinate system $\sigma = z/H$), 
     1004\citet{Haney1991} and \citet{Beckmann1993} have given estimates of the magnitude of this truncation error. 
     1005It depends on topographic slope, stratification, horizontal and vertical resolution, the equation of state, 
     1006and the finite difference scheme. 
     1007This error limits the possible topographic slopes that a model can handle at 
     1008a given horizontal and vertical resolution. 
     1009This is a severe restriction for large-scale applications using realistic bottom topography. 
     1010The large-scale slopes require high horizontal resolution, and the computational cost becomes prohibitive. 
     1011This problem can be at least partially overcome by mixing $s$-coordinate and 
     1012step-like representation of bottom topography \citep{Gerdes1993a,Gerdes1993b,Madec_al_JPO96}. 
     1013However, the definition of the model domain vertical coordinate becomes then a non-trivial thing for 
     1014a realistic bottom topography: 
     1015a envelope topography is defined in $s$-coordinate on which a full or 
     1016partial step bottom topography is then applied in order to adjust the model depth to the observed one 
     1017(see \autoref{sec:DOM_zgr}. 
     1018 
     1019For numerical reasons a minimum of diffusion is required along the coordinate surfaces of any finite difference model. 
     1020It causes spurious diapycnal mixing when coordinate surfaces do not coincide with isoneutral surfaces. 
     1021This is the case for a $z$-model as well as for a $s$-model. 
     1022However, density varies more strongly on $s-$surfaces than on horizontal surfaces in regions of 
     1023large topographic slopes, implying larger diapycnal diffusion in a $s$-model than in a $z$-model. 
     1024Whereas such a diapycnal diffusion in a $z$-model tends to weaken horizontal density (pressure) gradients and thus 
     1025the horizontal circulation, it usually reinforces these gradients in a $s$-model, creating spurious circulation. 
     1026For example, imagine an isolated bump of topography in an ocean at rest with a horizontally uniform stratification. 
     1027Spurious diffusion along $s$-surfaces will induce a bump of isoneutral surfaces over the topography, 
     1028and thus will generate there a baroclinic eddy. 
     1029In contrast, the ocean will stay at rest in a $z$-model. 
     1030As for the truncation error, the problem can be reduced by introducing the terrain-following coordinate below 
     1031the strongly stratified portion of the water column ($i.e.$ the main thermocline) \citep{Madec_al_JPO96}. 
     1032An alternate solution consists of rotating the lateral diffusive tensor to geopotential or to isoneutral surfaces 
     1033(see \autoref{subsec:PE_ldf}). 
     1034Unfortunately, the slope of isoneutral surfaces relative to the $s$-surfaces can very large, 
    9771035strongly exceeding the stability limit of such a operator when it is discretized (see \autoref{chap:LDF}).  
    9781036 
    979 The $s-$coordinates introduced here \citep{Lott_al_OM90,Madec_al_JPO96} differ mainly in two  
    980 aspects from similar models:  it allows  a representation of bottom topography with mixed  
    981 full or partial step-like/terrain following topography ; It also offers a completely general  
    982 transformation, $s=s(i,j,z)$ for the vertical coordinate. 
     1037The $s-$coordinates introduced here \citep{Lott_al_OM90,Madec_al_JPO96} differ mainly in two aspects from 
     1038similar models: 
     1039it allows a representation of bottom topography with mixed full or partial step-like/terrain following topography; 
     1040It also offers a completely general transformation, $s=s(i,j,z)$ for the vertical coordinate. 
    9831041 
    9841042 
     
    9911049 
    9921050The $\tilde{z}$-coordinate has been developed by \citet{Leclair_Madec_OM11}. 
    993 It is available in \NEMO since the version 3.4. Nevertheless, it is currently not robust enough  
    994 to be used in all possible configurations. Its use is therefore not recommended. 
     1051It is available in \NEMO since the version 3.4. 
     1052Nevertheless, it is currently not robust enough to be used in all possible configurations. 
     1053Its use is therefore not recommended. 
    9951054 
    9961055 
     
    10021061\label{sec:PE_zdf_ldf} 
    10031062 
    1004 The primitive equations describe the behaviour of a geophysical fluid at  
    1005 space and time scales larger than a few kilometres in the horizontal, a few  
    1006 meters in the vertical and a few minutes. They are usually solved at larger  
    1007 scales: the specified grid spacing and time step of the numerical model. The  
    1008 effects of smaller scale motions (coming from the advective terms in the  
    1009 Navier-Stokes equations) must be represented entirely in terms of  
    1010 large-scale patterns to close the equations. These effects appear in the  
    1011 equations as the divergence of turbulent fluxes ($i.e.$ fluxes associated with  
    1012 the mean correlation of small scale perturbations). Assuming a turbulent  
    1013 closure hypothesis is equivalent to choose a formulation for these fluxes.  
    1014 It is usually called the subgrid scale physics. It must be emphasized that  
    1015 this is the weakest part of the primitive equations, but also one of the  
    1016 most important for long-term simulations as small scale processes \textit{in fine}  
    1017 balance the surface input of kinetic energy and heat. 
    1018  
    1019 The control exerted by gravity on the flow induces a strong anisotropy  
    1020 between the lateral and vertical motions. Therefore subgrid-scale physics   
    1021 \textbf{D}$^{\vect{U}}$, $D^{S}$ and $D^{T}$  in \autoref{eq:PE_dyn},  
    1022 \autoref{eq:PE_tra_T} and \autoref{eq:PE_tra_S} are divided into a lateral part   
    1023 \textbf{D}$^{l \vect{U}}$, $D^{lS}$ and $D^{lT}$ and a vertical part   
    1024 \textbf{D}$^{vU}$, $D^{vS}$ and $D^{vT}$. The formulation of these terms  
    1025 and their underlying physics are briefly discussed in the next two subsections. 
     1063The primitive equations describe the behaviour of a geophysical fluid at space and time scales larger than 
     1064a few kilometres in the horizontal, a few meters in the vertical and a few minutes. 
     1065They are usually solved at larger scales: the specified grid spacing and time step of the numerical model. 
     1066The effects of smaller scale motions (coming from the advective terms in the Navier-Stokes equations) must be represented entirely in terms of large-scale patterns to close the equations. 
     1067These effects appear in the equations as the divergence of turbulent fluxes 
     1068($i.e.$ fluxes associated with the mean correlation of small scale perturbations). 
     1069Assuming a turbulent closure hypothesis is equivalent to choose a formulation for these fluxes. 
     1070It is usually called the subgrid scale physics. 
     1071It must be emphasized that this is the weakest part of the primitive equations, 
     1072but also one of the most important for long-term simulations as 
     1073small scale processes \textit{in fine} balance the surface input of kinetic energy and heat. 
     1074 
     1075The control exerted by gravity on the flow induces a strong anisotropy between the lateral and vertical motions. 
     1076Therefore subgrid-scale physics \textbf{D}$^{\vect{U}}$, $D^{S}$ and $D^{T}$  in 
     1077\autoref{eq:PE_dyn}, \autoref{eq:PE_tra_T} and \autoref{eq:PE_tra_S} are divided into 
     1078a lateral part  \textbf{D}$^{l \vect{U}}$, $D^{lS}$ and $D^{lT}$ and 
     1079a vertical part  \textbf{D}$^{vU}$, $D^{vS}$ and $D^{vT}$. 
     1080The formulation of these terms and their underlying physics are briefly discussed in the next two subsections. 
    10261081 
    10271082% ------------------------------------------------------------------------------------------------------------- 
     
    10311086\label{subsec:PE_zdf} 
    10321087 
    1033 The model resolution is always larger than the scale at which the major  
    1034 sources of vertical turbulence occur (shear instability, internal wave  
    1035 breaking...). Turbulent motions are thus never explicitly solved, even  
    1036 partially, but always parameterized. The vertical turbulent fluxes are  
    1037 assumed to depend linearly on the gradients of large-scale quantities (for  
    1038 example, the turbulent heat flux is given by $\overline{T'w'}=-A^{vT} \partial_z \overline T$,  
    1039 where $A^{vT}$ is an eddy coefficient). This formulation is  
    1040 analogous to that of molecular diffusion and dissipation. This is quite  
    1041 clearly a necessary compromise: considering only the molecular viscosity  
    1042 acting on large scale severely underestimates the role of turbulent  
    1043 diffusion and dissipation, while an accurate consideration of the details of  
    1044 turbulent motions is simply impractical. The resulting vertical momentum and  
    1045 tracer diffusive operators are of second order: 
     1088The model resolution is always larger than the scale at which the major sources of vertical turbulence occur 
     1089(shear instability, internal wave breaking...). 
     1090Turbulent motions are thus never explicitly solved, even partially, but always parameterized. 
     1091The vertical turbulent fluxes are assumed to depend linearly on the gradients of large-scale quantities 
     1092(for example, the turbulent heat flux is given by $\overline{T'w'}=-A^{vT} \partial_z \overline T$, 
     1093where $A^{vT}$ is an eddy coefficient). 
     1094This formulation is analogous to that of molecular diffusion and dissipation. 
     1095This is quite clearly a necessary compromise: considering only the molecular viscosity acting on 
     1096large scale severely underestimates the role of turbulent diffusion and dissipation, 
     1097while an accurate consideration of the details of turbulent motions is simply impractical. 
     1098The resulting vertical momentum and tracer diffusive operators are of second order: 
    10461099\begin{equation} \label{eq:PE_zdf} 
    10471100   \begin{split} 
     
    10521105   \end{split} 
    10531106\end{equation} 
    1054 where $A^{vm}$ and $A^{vT}$ are the vertical eddy viscosity and diffusivity coefficients,  
    1055 respectively. At the sea surface and at the bottom, turbulent fluxes of momentum, heat  
    1056 and salt must be specified (see \autoref{chap:SBC} and \autoref{chap:ZDF} and \autoref{sec:TRA_bbl}).  
    1057 All the vertical physics is embedded in the specification of the eddy coefficients.  
    1058 They can be assumed to be either constant, or function of the local fluid properties  
    1059 ($e.g.$ Richardson number, Brunt-Vais\"{a}l\"{a} frequency...), or computed from a  
    1060 turbulent closure model. The choices available in \NEMO are discussed in \autoref{chap:ZDF}). 
     1107where $A^{vm}$ and $A^{vT}$ are the vertical eddy viscosity and diffusivity coefficients, respectively. 
     1108At the sea surface and at the bottom, turbulent fluxes of momentum, heat and salt must be specified 
     1109(see \autoref{chap:SBC} and \autoref{chap:ZDF} and \autoref{sec:TRA_bbl}). 
     1110All the vertical physics is embedded in the specification of the eddy coefficients. 
     1111They can be assumed to be either constant, or function of the local fluid properties 
     1112($e.g.$ Richardson number, Brunt-Vais\"{a}l\"{a} frequency...), 
     1113or computed from a turbulent closure model. 
     1114The choices available in \NEMO are discussed in \autoref{chap:ZDF}). 
    10611115 
    10621116% ------------------------------------------------------------------------------------------------------------- 
     
    10661120\label{subsec:PE_ldf} 
    10671121 
    1068 Lateral turbulence can be roughly divided into a mesoscale turbulence  
    1069 associated with eddies (which can be solved explicitly if the resolution is  
    1070 sufficient since their underlying physics are included in the primitive  
    1071 equations), and a sub mesoscale turbulence which is never explicitly solved  
    1072 even partially, but always parameterized. The formulation of lateral eddy  
    1073 fluxes depends on whether the mesoscale is below or above the grid-spacing  
     1122Lateral turbulence can be roughly divided into a mesoscale turbulence associated with eddies 
     1123(which can be solved explicitly if the resolution is sufficient since 
     1124their underlying physics are included in the primitive equations), 
     1125and a sub mesoscale turbulence which is never explicitly solved even partially, but always parameterized. 
     1126The formulation of lateral eddy fluxes depends on whether the mesoscale is below or above the grid-spacing 
    10741127($i.e.$ the model is eddy-resolving or not). 
    10751128 
    1076 In non-eddy-resolving configurations, the closure is similar to that used  
    1077 for the vertical physics. The lateral turbulent fluxes are assumed to depend  
    1078 linearly on the lateral gradients of large-scale quantities. The resulting  
    1079 lateral diffusive and dissipative operators are of second order.  
    1080 Observations show that lateral mixing induced by mesoscale turbulence tends  
    1081 to be along isopycnal surfaces (or more precisely neutral surfaces \cite{McDougall1987})  
    1082 rather than across them.  
    1083 As the slope of neutral surfaces is small in the ocean, a common  
    1084 approximation is to assume that the `lateral' direction is the horizontal,  
    1085 $i.e.$ the lateral mixing is performed along geopotential surfaces. This leads  
    1086 to a geopotential second order operator for lateral subgrid scale physics.  
    1087 This assumption can be relaxed: the eddy-induced turbulent fluxes can be  
    1088 better approached by assuming that they depend linearly on the gradients of  
    1089 large-scale quantities computed along neutral surfaces. In such a case,  
    1090 the diffusive operator is an isoneutral second order operator and it has  
    1091 components in the three space directions. However, both horizontal and  
    1092 isoneutral operators have no effect on mean ($i.e.$ large scale) potential  
    1093 energy whereas potential energy is a main source of turbulence (through  
    1094 baroclinic instabilities). \citet{Gent1990} have proposed a  
    1095 parameterisation of mesoscale eddy-induced turbulence which associates an  
    1096 eddy-induced velocity to the isoneutral diffusion. Its mean effect is to  
    1097 reduce the mean potential energy of the ocean. This leads to a formulation  
    1098 of lateral subgrid-scale physics made up of an isoneutral second order  
    1099 operator and an eddy induced advective part. In all these lateral diffusive  
    1100 formulations, the specification of the lateral eddy coefficients remains the  
    1101 problematic point as there is no really satisfactory formulation of these  
    1102 coefficients as a function of large-scale features. 
    1103  
    1104 In eddy-resolving configurations, a second order operator can be used, but  
    1105 usually the more scale selective biharmonic operator is preferred as the  
    1106 grid-spacing is usually not small enough compared to the scale of the  
    1107 eddies. The role devoted to the subgrid-scale physics is to dissipate the  
    1108 energy that cascades toward the grid scale and thus to ensure the stability of  
    1109 the model while not interfering with the resolved mesoscale activity. Another approach  
    1110 is becoming more and more popular: instead of specifying explicitly a sub-grid scale  
    1111 term in the momentum and tracer time evolution equations, one uses a advective  
    1112 scheme which is diffusive enough to maintain the model stability. It must be emphasised 
    1113 that then, all the sub-grid scale physics is included in the formulation of the 
    1114 advection scheme.  
    1115  
    1116 All these parameterisations of subgrid scale physics have advantages and  
    1117 drawbacks. There are not all available in \NEMO. For active tracers (temperature and  
    1118 salinity) the main ones are: Laplacian and bilaplacian operators acting along  
    1119 geopotential or iso-neutral surfaces, \citet{Gent1990} parameterisation,  
    1120 and various slightly diffusive advection schemes.  
    1121 For momentum, the main ones are: Laplacian and bilaplacian operators acting along  
    1122 geopotential surfaces, and UBS advection schemes when flux form is chosen for the momentum advection. 
     1129In non-eddy-resolving configurations, the closure is similar to that used for the vertical physics. 
     1130The lateral turbulent fluxes are assumed to depend linearly on the lateral gradients of large-scale quantities. 
     1131The resulting lateral diffusive and dissipative operators are of second order. 
     1132Observations show that lateral mixing induced by mesoscale turbulence tends to be along isopycnal surfaces 
     1133(or more precisely neutral surfaces \cite{McDougall1987}) rather than across them. 
     1134As the slope of neutral surfaces is small in the ocean, a common approximation is to assume that 
     1135the `lateral' direction is the horizontal, $i.e.$ the lateral mixing is performed along geopotential surfaces. 
     1136This leads to a geopotential second order operator for lateral subgrid scale physics. 
     1137This assumption can be relaxed: the eddy-induced turbulent fluxes can be better approached by assuming that 
     1138they depend linearly on the gradients of large-scale quantities computed along neutral surfaces. 
     1139In such a case, the diffusive operator is an isoneutral second order operator and 
     1140it has components in the three space directions. 
     1141However, 
     1142both horizontal and isoneutral operators have no effect on mean ($i.e.$ large scale) potential energy whereas 
     1143potential energy is a main source of turbulence (through baroclinic instabilities). 
     1144\citet{Gent1990} have proposed a parameterisation of mesoscale eddy-induced turbulence which 
     1145associates an eddy-induced velocity to the isoneutral diffusion. 
     1146Its mean effect is to reduce the mean potential energy of the ocean. 
     1147This leads to a formulation of lateral subgrid-scale physics made up of an isoneutral second order operator and 
     1148an eddy induced advective part. 
     1149In all these lateral diffusive formulations, 
     1150the specification of the lateral eddy coefficients remains the problematic point as 
     1151there is no really satisfactory formulation of these coefficients as a function of large-scale features. 
     1152 
     1153In eddy-resolving configurations, a second order operator can be used, 
     1154but usually the more scale selective biharmonic operator is preferred as 
     1155the grid-spacing is usually not small enough compared to the scale of the eddies. 
     1156The role devoted to the subgrid-scale physics is to dissipate the energy that 
     1157cascades toward the grid scale and thus to ensure the stability of the model while 
     1158not interfering with the resolved mesoscale activity. 
     1159Another approach is becoming more and more popular: 
     1160instead of specifying explicitly a sub-grid scale term in the momentum and tracer time evolution equations, 
     1161one uses a advective scheme which is diffusive enough to maintain the model stability. 
     1162It must be emphasised that then, all the sub-grid scale physics is included in the formulation of 
     1163the advection scheme.  
     1164 
     1165All these parameterisations of subgrid scale physics have advantages and drawbacks. 
     1166There are not all available in \NEMO. For active tracers (temperature and salinity) the main ones are: 
     1167Laplacian and bilaplacian operators acting along geopotential or iso-neutral surfaces, 
     1168\citet{Gent1990} parameterisation, and various slightly diffusive advection schemes. 
     1169For momentum, the main ones are: Laplacian and bilaplacian operators acting along geopotential surfaces, 
     1170and UBS advection schemes when flux form is chosen for the momentum advection. 
    11231171 
    11241172\subsubsection{Lateral laplacian tracer diffusive operator} 
     
    11331181\end{array} }} \right) 
    11341182\end{equation} 
    1135 where $r_1 \;\mbox{and}\;r_2 $ are the slopes between the surface along  
    1136 which the diffusive operator acts and the model level ($e. g.$ $z$- or  
    1137 $s$-surfaces). Note that the formulation \autoref{eq:PE_iso_tensor} is exact for the  
    1138 rotation between geopotential and $s$-surfaces, while it is only an approximation  
    1139 for the rotation between isoneutral and $z$- or $s$-surfaces. Indeed, in the latter  
    1140 case, two assumptions are made to simplify \autoref{eq:PE_iso_tensor} \citep{Cox1987}.  
    1141 First, the horizontal contribution of the dianeutral mixing is neglected since the ratio  
    1142 between iso and dia-neutral diffusive coefficients is known to be several orders of  
    1143 magnitude smaller than unity. Second, the two isoneutral directions of diffusion are  
    1144 assumed to be independent since the slopes are generally less than $10^{-2}$ in the  
    1145 ocean (see \autoref{apdx:B}). 
    1146  
    1147 For \textit{iso-level} diffusion, $r_1$ and $r_2 $ are zero. $\Re $ reduces to the identity  
    1148 in the horizontal direction, no rotation is applied.  
    1149  
    1150 For \textit{geopotential} diffusion, $r_1$ and $r_2 $ are the slopes between the  
    1151 geopotential and computational surfaces: they are equal to $\sigma _1$ and $\sigma _2$,  
    1152 respectively (see \autoref{eq:PE_sco_slope}). 
    1153  
    1154 For \textit{isoneutral} diffusion $r_1$ and $r_2$ are the slopes between the isoneutral  
    1155 and computational surfaces. Therefore, they are different quantities, 
    1156 but have similar expressions in $z$- and $s$-coordinates. In $z$-coordinates: 
     1183where $r_1 \;\mbox{and}\;r_2 $ are the slopes between the surface along which the diffusive operator acts and 
     1184the model level ($e. g.$ $z$- or $s$-surfaces). 
     1185Note that the formulation \autoref{eq:PE_iso_tensor} is exact for 
     1186the rotation between geopotential and $s$-surfaces, 
     1187while it is only an approximation for the rotation between isoneutral and $z$- or $s$-surfaces. 
     1188Indeed, in the latter case, two assumptions are made to simplify \autoref{eq:PE_iso_tensor} \citep{Cox1987}. 
     1189First, the horizontal contribution of the dianeutral mixing is neglected since the ratio between iso and 
     1190dia-neutral diffusive coefficients is known to be several orders of magnitude smaller than unity. 
     1191Second, the two isoneutral directions of diffusion are assumed to be independent since 
     1192the slopes are generally less than $10^{-2}$ in the ocean (see \autoref{apdx:B}). 
     1193 
     1194For \textit{iso-level} diffusion, $r_1$ and $r_2 $ are zero. 
     1195$\Re $ reduces to the identity in the horizontal direction, no rotation is applied.  
     1196 
     1197For \textit{geopotential} diffusion, 
     1198$r_1$ and $r_2 $ are the slopes between the geopotential and computational surfaces: 
     1199they are equal to $\sigma _1$ and $\sigma _2$, respectively (see \autoref{eq:PE_sco_slope}). 
     1200 
     1201For \textit{isoneutral} diffusion $r_1$ and $r_2$ are the slopes between the isoneutral and computational surfaces. 
     1202Therefore, they are different quantities, but have similar expressions in $z$- and $s$-coordinates. 
     1203In $z$-coordinates: 
    11571204\begin{equation} \label{eq:PE_iso_slopes} 
    11581205r_1 =\frac{e_3 }{e_1 }  \left( \pd[\rho]{i} \right) \left( \pd[\rho]{k} \right)^{-1} \, \quad 
     
    11621209 
    11631210\subsubsection{Eddy induced velocity} 
    1164  When the \textit{eddy induced velocity} parametrisation (eiv) \citep{Gent1990} is used,  
     1211When the \textit{eddy induced velocity} parametrisation (eiv) \citep{Gent1990} is used, 
    11651212an additional tracer advection is introduced in combination with the isoneutral diffusion of tracers: 
    11661213\begin{equation} \label{eq:PE_iso+eiv} 
     
    11681215           +\nabla \cdot \left( {{\vect{U}}^\ast \,T} \right) 
    11691216\end{equation} 
    1170 where ${\vect{U}}^\ast =\left( {u^\ast ,v^\ast ,w^\ast } \right)$ is a non-divergent,  
     1217where ${\vect{U}}^\ast =\left( {u^\ast ,v^\ast ,w^\ast } \right)$ is a non-divergent, 
    11711218eddy-induced transport velocity. This velocity field is defined by: 
    11721219\begin{equation} \label{eq:PE_eiv} 
     
    11791226   \end{split} 
    11801227\end{equation} 
    1181 where $A^{eiv}$ is the eddy induced velocity coefficient (or equivalently the isoneutral  
    1182 thickness diffusivity coefficient), and $\tilde{r}_1$ and $\tilde{r}_2$ are the slopes  
    1183 between isoneutral and \emph{geopotential} surfaces. Their values are 
    1184 thus independent of the vertical coordinate, but their expression depends on the coordinate:  
     1228where $A^{eiv}$ is the eddy induced velocity coefficient 
     1229(or equivalently the isoneutral thickness diffusivity coefficient), 
     1230and $\tilde{r}_1$ and $\tilde{r}_2$ are the slopes between isoneutral and \emph{geopotential} surfaces. 
     1231Their values are thus independent of the vertical coordinate, but their expression depends on the coordinate:  
    11851232\begin{align} \label{eq:PE_slopes_eiv} 
    11861233\tilde{r}_n = \begin{cases} 
     
    11911238\end{align} 
    11921239 
    1193 The normal component of the eddy induced velocity is zero at all the boundaries.  
    1194 This can be achieved in a model by tapering either the eddy coefficient or the slopes  
    1195 to zero in the vicinity of the boundaries. The latter strategy is used in \NEMO (cf. \autoref{chap:LDF}). 
     1240The normal component of the eddy induced velocity is zero at all the boundaries. 
     1241This can be achieved in a model by tapering either the eddy coefficient or 
     1242the slopes to zero in the vicinity of the boundaries. 
     1243The latter strategy is used in \NEMO (cf. \autoref{chap:LDF}). 
    11961244 
    11971245\subsubsection{Lateral bilaplacian tracer diffusive operator} 
     
    12011249D^{lT}= - \Delta \left( \;\Delta T \right)  
    12021250\qquad \text{where} \;\; \Delta \bullet = \nabla \left( {\sqrt{B^{lT}\,}\;\Re \;\nabla \bullet} \right) 
    1203  \end{equation} 
    1204 It is the Laplacian operator given by \autoref{eq:PE_iso_tensor} applied twice with  
     1251\end{equation} 
     1252It is the Laplacian operator given by \autoref{eq:PE_iso_tensor} applied twice with 
    12051253the harmonic eddy diffusion coefficient set to the square root of the biharmonic one.  
    12061254 
     
    12081256\subsubsection{Lateral Laplacian momentum diffusive operator} 
    12091257 
    1210 The Laplacian momentum diffusive operator along $z$- or $s$-surfaces is found by  
     1258The Laplacian momentum diffusive operator along $z$- or $s$-surfaces is found by 
    12111259applying \autoref{eq:PE_lap_vector} to the horizontal velocity vector (see \autoref{apdx:B}): 
    12121260\begin{equation} \label{eq:PE_lapU} 
     
    12241272\end{equation} 
    12251273 
    1226 Such a formulation ensures a complete separation between the vorticity and  
    1227 horizontal divergence fields (see \autoref{apdx:C}).  
    1228 Unfortunately, it is only available in \textit{iso-level} direction.  
    1229 When a rotation is required ($i.e.$ geopotential diffusion in $s-$coordinates  
    1230 or isoneutral diffusion in both $z$- and $s$-coordinates), the $u$ and $v-$fields  
    1231 are considered as independent scalar fields, so that the diffusive operator is given by: 
     1274Such a formulation ensures a complete separation between the vorticity and horizontal divergence fields 
     1275(see \autoref{apdx:C}). 
     1276Unfortunately, it is only available in \textit{iso-level} direction. 
     1277When a rotation is required 
     1278($i.e.$ geopotential diffusion in $s-$coordinates or isoneutral diffusion in both $z$- and $s$-coordinates), 
     1279the $u$ and $v-$fields are considered as independent scalar fields, so that the diffusive operator is given by: 
    12321280\begin{equation} \label{eq:PE_lapU_iso} 
    12331281\begin{split} 
    12341282 D_u^{l{\rm {\bf U}}} &= \nabla .\left( {A^{lm} \;\Re \;\nabla u} \right) \\  
    12351283 D_v^{l{\rm {\bf U}}} &= \nabla .\left( {A^{lm} \;\Re \;\nabla v} \right) 
    1236  \end{split} 
    1237  \end{equation} 
    1238 where $\Re$ is given by \autoref{eq:PE_iso_tensor}. It is the same expression as  
    1239 those used for diffusive operator on tracers. It must be emphasised that such a  
    1240 formulation is only exact in a Cartesian coordinate system, $i.e.$ on a $f-$ or  
    1241 $\beta-$plane, not on the sphere. It is also a very good approximation in vicinity  
    1242 of the Equator in a geographical coordinate system \citep{Lengaigne_al_JGR03}. 
     1284\end{split} 
     1285\end{equation} 
     1286where $\Re$ is given by \autoref{eq:PE_iso_tensor}. 
     1287It is the same expression as those used for diffusive operator on tracers. 
     1288It must be emphasised that such a formulation is only exact in a Cartesian coordinate system, 
     1289$i.e.$ on a $f-$ or $\beta-$plane, not on the sphere. 
     1290It is also a very good approximation in vicinity of the Equator in 
     1291a geographical coordinate system \citep{Lengaigne_al_JGR03}. 
    12431292 
    12441293\subsubsection{lateral bilaplacian momentum diffusive operator} 
    12451294 
    1246 As for tracers, the bilaplacian order momentum diffusive operator is a  
    1247 re-entering Laplacian operator with the harmonic eddy diffusion coefficient  
    1248 set to the square root of the biharmonic one. Nevertheless it is currently  
    1249 not available in the iso-neutral case. 
     1295As for tracers, the bilaplacian order momentum diffusive operator is a re-entering Laplacian operator with 
     1296the harmonic eddy diffusion coefficient set to the square root of the biharmonic one. 
     1297Nevertheless it is currently not available in the iso-neutral case. 
    12501298 
    12511299\end{document} 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_model_basics_zstar.tex

    r10146 r10368  
    1616\colorbox{yellow}{ to be updated } 
    1717 
    18 In that case, the free surface equation is nonlinear, and the variations of  
    19 volume are fully taken into account. These coordinates systems is presented in  
    20 a report \citep{Levier2007} available on the \NEMO web site.  
     18In that case, the free surface equation is nonlinear, and the variations of volume are fully taken into account. 
     19These coordinates systems is presented in a report \citep{Levier2007} available on the \NEMO web site.  
    2120 
    2221\colorbox{yellow}{  end of to be updated} 
     
    2524% from MOM4p1 documentation 
    2625 
    27 To overcome problems with vanishing surface and/or bottom cells, we consider the  
    28 zstar coordinate  
     26To overcome problems with vanishing surface and/or bottom cells, we consider the zstar coordinate  
    2927\begin{equation} \label{eq:PE_} 
    3028   z^\star = H \left( \frac{z-\eta}{H+\eta} \right) 
    3129\end{equation} 
    3230 
    33 This coordinate is closely related to the "eta" coordinate used in many atmospheric  
    34 models (see Black (1994) for a review of eta coordinate atmospheric models). It  
    35 was originally used in ocean models by Stacey et al. (1995) for studies of tides  
    36 next to shelves, and it has been recently promoted by Adcroft and Campin (2004)  
    37 for global climate modelling. 
    38  
    39 The surfaces of constant $z^\star$ are quasi-horizontal. Indeed, the $z^\star$ coordinate reduces to $z$ when $\eta$ is zero. In general, when noting the large differences between  
    40 undulations of the bottom topography versus undulations in the surface height, it  
    41 is clear that surfaces constant $z^\star$ are very similar to the depth surfaces. These properties greatly reduce difficulties of computing the horizontal pressure gradient relative to terrain following sigma models discussed in \autoref{subsec:PE_sco}.  
    42 Additionally, since $z^\star$ when $\eta = 0$, no flow is spontaneously generated in an  
    43 unforced ocean starting from rest, regardless the bottom topography. This behaviour is in contrast to the case with "s"-models, where pressure gradient errors in  
    44 the presence of nontrivial topographic variations can generate nontrivial spontaneous flow from a resting state, depending on the sophistication of the pressure  
    45 gradient solver. The quasi-horizontal nature of the coordinate surfaces also facilitates the implementation of neutral physics parameterizations in $z^\star$ models using  
    46 the same techniques as in $z$-models (see Chapters 13-16 of Griffies (2004) for a  
    47 discussion of neutral physics in $z$-models, as well as  \autoref{sec:LDF_slp}  
    48 in this document for treatment in \NEMO).  
    49  
    50 The range over which $z^\star$ varies is time independent $-H \leq z^\star \leq 0$. Hence, all  
    51 cells remain nonvanishing, so long as the surface height maintains $\eta > ?H$. This  
    52 is a minor constraint relative to that encountered on the surface height when using  
    53 $s = z$ or $s = z - \eta$.  
    54  
    55 Because $z^\star$ has a time independent range, all grid cells have static increments  
    56 ds, and the sum of the ver tical increments yields the time independent ocean  
    57 depth %�k ds = H.  
    58 The $z^\star$ coordinate is therefore invisible to undulations of the  
    59 free surface, since it moves along with the free surface. This proper ty means that  
    60 no spurious ver tical transpor t is induced across surfaces of constant $z^\star$ by the  
    61 motion of external gravity waves. Such spurious transpor t can be a problem in  
    62 z-models, especially those with tidal forcing. Quite generally, the time independent  
    63 range for the $z^\star$ coordinate is a very convenient proper ty that allows for a nearly  
    64 arbitrary ver tical resolution even in the presence of large amplitude fluctuations of  
     31This coordinate is closely related to the "eta" coordinate used in many atmospheric models 
     32(see Black (1994) for a review of eta coordinate atmospheric models). 
     33It was originally used in ocean models by Stacey et al. (1995) for studies of tides next to shelves, 
     34and it has been recently promoted by Adcroft and Campin (2004) for global climate modelling. 
     35 
     36The surfaces of constant $z^\star$ are quasi-horizontal. 
     37Indeed, the $z^\star$ coordinate reduces to $z$ when $\eta$ is zero. 
     38In general, when noting the large differences between undulations of the bottom topography versus undulations in 
     39the surface height, it is clear that surfaces constant $z^\star$ are very similar to the depth surfaces. 
     40These properties greatly reduce difficulties of computing the horizontal pressure gradient relative to 
     41terrain following sigma models discussed in \autoref{subsec:PE_sco}.  
     42Additionally, since $z^\star$ when $\eta = 0$, no flow is spontaneously generated in 
     43an unforced ocean starting from rest, regardless the bottom topography. 
     44This behaviour is in contrast to the case with "s"-models, where pressure gradient errors in the presence of 
     45nontrivial topographic variations can generate nontrivial spontaneous flow from a resting state, 
     46depending on the sophistication of the pressure gradient solver. 
     47The quasi-horizontal nature of the coordinate surfaces also facilitates the implementation of 
     48neutral physics parameterizations in $z^\star$ models using the same techniques as in $z$-models 
     49(see Chapters 13-16 of Griffies (2004) for a discussion of neutral physics in $z$-models, 
     50as well as  \autoref{sec:LDF_slp} in this document for treatment in \NEMO).  
     51 
     52The range over which $z^\star$ varies is time independent $-H \leq z^\star \leq 0$. 
     53Hence, all cells remain nonvanishing, so long as the surface height maintains $\eta > ?H$. 
     54This is a minor constraint relative to that encountered on the surface height when using $s = z$ or $s = z - \eta$.  
     55 
     56Because $z^\star$ has a time independent range, all grid cells have static increments ds, 
     57and the sum of the ver tical increments yields the time independent ocean depth %�k ds = H.  
     58The $z^\star$ coordinate is therefore invisible to undulations of the free surface, 
     59since it moves along with the free surface. 
     60This proper ty means that no spurious ver tical transpor t is induced across surfaces of 
     61constant $z^\star$ by the motion of external gravity waves. 
     62Such spurious transpor t can be a problem in z-models, especially those with tidal forcing. 
     63Quite generally, the time independent range for the $z^\star$ coordinate is a very convenient property that 
     64allows for a nearly arbitrary vertical resolution even in the presence of large amplitude fluctuations of 
    6565the surface height, again so long as $\eta > -H$.  
    6666 
     
    8181\nlst{nam_dynspg}  
    8282%------------------------------------------------------------------------------------------------------------ 
    83 Options are defined through the  \ngn{nam\_dynspg} namelist variables. 
    84 The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}). The main distinction is between the fixed volume case (linear free surface or rigid lid) and the variable volume case (nonlinear free surface, \key{vvl} is active). In the linear free surface case (\autoref{subsec:PE_free_surface}) and rigid lid (\autoref{PE_rigid_lid}), the vertical scale factors $e_{3}$ are fixed in time, while in the nonlinear case (\autoref{subsec:PE_free_surface}) they are time-dependent. With both linear and nonlinear free surface, external gravity waves are allowed in the equations, which imposes a very small time step when an explicit time stepping is used. Two methods are proposed to allow a longer time step for the three-dimensional equations: the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:PE_flt}), and the split-explicit free surface described below. The extra term introduced in the filtered method is calculated implicitly, so that the update of the next velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}. 
     83Options are defined through the \ngn{nam\_dynspg} namelist variables. 
     84The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}). 
     85The main distinction is between the fixed volume case (linear free surface or rigid lid) and 
     86the variable volume case (nonlinear free surface, \key{vvl} is active). 
     87In the linear free surface case (\autoref{subsec:PE_free_surface}) and rigid lid (\autoref{PE_rigid_lid}), 
     88the vertical scale factors $e_{3}$ are fixed in time, 
     89while in the nonlinear case (\autoref{subsec:PE_free_surface}) they are time-dependent. 
     90With both linear and nonlinear free surface, external gravity waves are allowed in the equations, 
     91which imposes a very small time step when an explicit time stepping is used. 
     92Two methods are proposed to allow a longer time step for the three-dimensional equations: 
     93the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:PE_flt}), 
     94and the split-explicit free surface described below. 
     95The extra term introduced in the filtered method is calculated implicitly, 
     96so that the update of the next velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}. 
    8597 
    8698%------------------------------------------------------------- 
     
    90102\label{subsec:DYN_spg_exp} 
    91103 
    92 In the explicit free surface formulation, the model time step is chosen small enough to describe the external gravity waves (typically a few ten seconds). The sea surface height is given by : 
     104In the explicit free surface formulation, the model time step is chosen small enough to 
     105describe the external gravity waves (typically a few ten seconds). 
     106The sea surface height is given by: 
    93107\begin{equation} \label{eq:dynspg_ssh} 
    94108\frac{\partial \eta }{\partial t}\equiv \frac{\text{EMP}}{\rho _w }+\frac{1}{e_{1T}  
     
    97111\end{equation} 
    98112 
    99 where EMP is the surface freshwater budget (evaporation minus precipitation, and minus river runoffs (if the later are introduced as a surface freshwater flux, see \autoref{chap:SBC}) expressed in $Kg.m^{-2}.s^{-1}$, and $\rho _w =1,000\,Kg.m^{-3}$ is the volumic mass of pure water. The sea-surface height is evaluated using a leapfrog scheme in combination with an Asselin time filter, i.e. the velocity appearing in (\autoref{eq:dynspg_ssh}) is centred in time (\textit{now} velocity).  
    100  
    101 The surface pressure gradient, also evaluated using a leap-frog scheme, is then simply given by : 
     113where EMP is the surface freshwater budget (evaporation minus precipitation, and minus river runoffs 
     114(if the later are introduced as a surface freshwater flux, see \autoref{chap:SBC}) expressed in $Kg.m^{-2}.s^{-1}$, 
     115and $\rho _w =1,000\,Kg.m^{-3}$ is the volumic mass of pure water. 
     116The sea-surface height is evaluated using a leapfrog scheme in combination with an Asselin time filter, 
     117i.e. the velocity appearing in (\autoref{eq:dynspg_ssh}) is centred in time (\textit{now} velocity).  
     118 
     119The surface pressure gradient, also evaluated using a leap-frog scheme, is then simply given by: 
    102120\begin{equation} \label{eq:dynspg_exp} 
    103121\left\{ \begin{aligned} 
     
    108126\end{equation}  
    109127 
    110 Consistent with the linearization, a $\left. \rho \right|_{k=1} / \rho _o$ factor is omitted in (\autoref{eq:dynspg_exp}).  
     128Consistent with the linearization, a $\left. \rho \right|_{k=1} / \rho _o$ factor is omitted in 
     129(\autoref{eq:dynspg_exp}).  
    111130 
    112131%------------------------------------------------------------- 
     
    119138\nlst{namdom}  
    120139%-------------------------------------------------------------------------------------------------------------- 
    121 The split-explicit free surface formulation used in OPA follows the one proposed by \citet{Griffies2004}. The general idea is to solve the free surface equation with a small time step, while the three dimensional prognostic variables are solved with a longer time step that is a multiple of \np{rdtbt} 
    122 in the  \ngn{namdom} namelist.  
    123 (Figure III.3).  
     140The split-explicit free surface formulation used in OPA follows the one proposed by \citet{Griffies2004}. 
     141The general idea is to solve the free surface equation with a small time step, 
     142while the three dimensional prognostic variables are solved with a longer time step that 
     143is a multiple of \np{rdtbt} in the \ngn{namdom} namelist (Figure III.3).  
    124144 
    125145%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
     
    127147\includegraphics[width=0.90\textwidth]{Fig_DYN_dynspg_ts} 
    128148\caption{    \protect\label{fig:DYN_dynspg_ts} 
    129 Schematic of the split-explicit time stepping scheme for the barotropic and baroclinic modes,  
    130 after \citet{Griffies2004}. Time increases to the right. Baroclinic time steps are denoted by  
    131 $t-\Delta t$, $t, t+\Delta t$, and $t+2\Delta t$. The curved line represents a leap-frog time step,  
    132 and the smaller barotropic time steps $N \Delta t=2\Delta t$ are denoted by the zig-zag line.  
    133 The vertically integrated forcing \textbf{M}(t) computed at baroclinic time step t represents  
    134 the interaction between the barotropic and baroclinic motions. While keeping the total depth,  
    135 tracer, and freshwater forcing fields fixed, a leap-frog integration carries the surface height  
    136 and vertically integrated velocity from t to $t+2 \Delta t$ using N barotropic time steps of length  
    137 $\Delta t$. Time averaging the barotropic fields over the N+1 time steps (endpoints included)  
    138 centers the vertically integrated velocity at the baroclinic timestep $t+\Delta t$.  
    139 A baroclinic leap-frog time step carries the surface height to $t+\Delta t$ using the convergence  
    140 of the time averaged vertically integrated velocity taken from baroclinic time step t. } 
     149  Schematic of the split-explicit time stepping scheme for the barotropic and baroclinic modes, 
     150  after \citet{Griffies2004}. 
     151  Time increases to the right. 
     152  Baroclinic time steps are denoted by $t-\Delta t$, $t, t+\Delta t$, and $t+2\Delta t$. 
     153  The curved line represents a leap-frog time step, 
     154  and the smaller barotropic time steps $N \Delta t=2\Delta t$ are denoted by the zig-zag line. 
     155  The vertically integrated forcing \textbf{M}(t) computed at 
     156  baroclinic time step t represents the interaction between the barotropic and baroclinic motions. 
     157  While keeping the total depth, tracer, and freshwater forcing fields fixed, 
     158  a leap-frog integration carries the surface height and vertically integrated velocity from 
     159  t to $t+2 \Delta t$ using N barotropic time steps of length $\Delta t$. 
     160  Time averaging the barotropic fields over the N+1 time steps (endpoints included) 
     161  centers the vertically integrated velocity at the baroclinic timestep $t+\Delta t$. 
     162  A baroclinic leap-frog time step carries the surface height to $t+\Delta t$ using the convergence of 
     163  the time averaged vertically integrated velocity taken from baroclinic time step t. } 
    141164\end{center} 
    142165\end{figure} 
    143166%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
    144167 
    145 The split-explicit formulation has a damping effect on external gravity waves, which is weaker than the filtered free surface but still significant as shown by \citet{Levier2007} in the case of an analytical barotropic Kelvin wave.  
     168The split-explicit formulation has a damping effect on external gravity waves, 
     169which is weaker than the filtered free surface but still significant as shown by \citet{Levier2007} in 
     170the case of an analytical barotropic Kelvin wave.  
    146171 
    147172%from griffies book: .....   copy past ! 
     
    149174\textbf{title: Time stepping the barotropic system } 
    150175 
    151 Assume knowledge of the full velocity and tracer fields at baroclinic time $\tau$. Hence,  
    152 we can update the surface height and vertically integrated velocity with a leap-frog  
    153 scheme using the small barotropic time step $\Delta t$. We have  
    154  
     176Assume knowledge of the full velocity and tracer fields at baroclinic time $\tau$. 
     177Hence, we can update the surface height and vertically integrated velocity with a leap-frog scheme using 
     178the small barotropic time step $\Delta t$. 
     179We have 
    155180\begin{equation} \label{eq:DYN_spg_ts_eta} 
    156181\eta^{(b)}(\tau,t_{n+1}) - \eta^{(b)}(\tau,t_{n+1}) (\tau,t_{n-1}) 
     
    164189\ 
    165190 
    166 In these equations, araised (b) denotes values of surface height and vertically integrated velocity updated with the barotropic time steps. The $\tau$ time label on $\eta^{(b)}$  
    167 and $U^{(b)}$ denotes the baroclinic time at which the vertically integrated forcing $\textbf{M}(\tau)$ (note that this forcing includes the surface freshwater forcing), the tracer fields, the freshwater flux $\text{EMP}_w(\tau)$, and total depth of the ocean $H(\tau)$ are held for the duration of the barotropic time stepping over a single cycle. This is also the time  
    168 that sets the barotropic time steps via  
     191In these equations, araised (b) denotes values of surface height and 
     192vertically integrated velocity updated with the barotropic time steps. 
     193The $\tau$ time label on $\eta^{(b)}$ and $U^{(b)}$ denotes the baroclinic time at which 
     194the vertically integrated forcing $\textbf{M}(\tau)$ 
     195(note that this forcing includes the surface freshwater forcing), the tracer fields, 
     196the freshwater flux $\text{EMP}_w(\tau)$, and total depth of the ocean $H(\tau)$ are held for 
     197the duration of the barotropic time stepping over a single cycle. 
     198This is also the time that sets the barotropic time steps via  
    169199\begin{equation} \label{eq:DYN_spg_ts_t} 
    170200t_n=\tau+n\Delta t    
    171201\end{equation} 
    172 with $n$ an integer. The density scaled surface pressure is evaluated via  
     202with $n$ an integer. 
     203The density scaled surface pressure is evaluated via  
    173204\begin{equation} \label{eq:DYN_spg_ts_ps} 
    174205p_s^{(b)}(\tau,t_{n}) = \begin{cases} 
     
    189220 \overline{\eta^{(b)}(\tau)} = \frac{1}{N+1} \sum\limits_{n=0}^N \eta^{(b)}(\tau-\Delta t,t_{n}) 
    190221\end{equation} 
    191 the time averaged surface height taken from the previous barotropic cycle. Likewise,  
     222the time averaged surface height taken from the previous barotropic cycle. 
     223Likewise, 
    192224\begin{equation} \label{eq:DYN_spg_ts_u} 
    193225\textbf{U}^{(b)}(\tau,t_{n=0}) = \overline{\textbf{U}^{(b)}(\tau)}   \\ 
     
    200232   = \frac{1}{N+1} \sum\limits_{n=0}^N\textbf{U}^{(b)}(\tau-\Delta t,t_{n}) 
    201233\end{equation} 
    202 the time averaged vertically integrated transport. Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration.  
    203  
    204 Upon reaching $t_{n=N} = \tau + 2\Delta \tau$ , the vertically integrated velocity is time averaged to produce the updated vertically integrated velocity at baroclinic time $\tau + \Delta \tau$  
     234the time averaged vertically integrated transport. 
     235Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration.  
     236 
     237Upon reaching $t_{n=N} = \tau + 2\Delta \tau$ , the vertically integrated velocity is time averaged to 
     238produce the updated vertically integrated velocity at baroclinic time $\tau + \Delta \tau$  
    205239\begin{equation} \label{eq:DYN_spg_ts_u} 
    206240\textbf{U}(\tau+\Delta t) = \overline{\textbf{U}^{(b)}(\tau+\Delta t)}  
    207241   = \frac{1}{N+1} \sum\limits_{n=0}^N\textbf{U}^{(b)}(\tau,t_{n}) 
    208242\end{equation} 
    209 The surface height on the new baroclinic time step is then determined via a baroclinic leap-frog using the following form  
    210  
     243The surface height on the new baroclinic time step is then determined via 
     244a baroclinic leap-frog using the following form  
    211245\begin{equation} \label{eq:DYN_spg_ts_ssh} 
    212246\eta(\tau+\Delta) - \eta^{F}(\tau-\Delta) = 2\Delta t \ \left[ - \nabla \cdot \textbf{U}(\tau) + \text{EMP}_w \right]   
    213247\end{equation} 
    214248 
    215  The use of this "big-leap-frog" scheme for the surface height ensures compatibility between the mass/volume budgets and the tracer budgets. More discussion of this point is provided in Chapter 10 (see in particular Section 10.2).  
     249The use of this "big-leap-frog" scheme for the surface height ensures compatibility between 
     250the mass/volume budgets and the tracer budgets. 
     251More discussion of this point is provided in Chapter 10 (see in particular Section 10.2).  
    216252  
    217 In general, some form of time filter is needed to maintain integrity of the surface  
    218 height field due to the leap-frog splitting mode in equation \autoref{eq:DYN_spg_ts_ssh}. We  
    219 have tried various forms of such filtering, with the following method discussed in  
    220 Griffies et al. (2001) chosen due to its stability and reasonably good maintenance of  
    221 tracer conservation properties (see ??)  
     253In general, some form of time filter is needed to maintain integrity of the surface height field due to 
     254the leap-frog splitting mode in equation \autoref{eq:DYN_spg_ts_ssh}. 
     255We have tried various forms of such filtering, 
     256with the following method discussed in Griffies et al. (2001) chosen due to its stability and 
     257reasonably good maintenance of tracer conservation properties (see ??)  
    222258 
    223259\begin{equation} \label{eq:DYN_spg_ts_sshf} 
     
    232268\end{equation} 
    233269 
    234 which is useful since it isolates all the time filtering aspects into the term multiplied  
    235 by $\alpha$. This isolation allows for an easy check that tracer conservation is exact when  
    236 eliminating tracer and surface height time filtering (see ?? for more complete discussion). However, in the general case with a non-zero $\alpha$, the filter \autoref{eq:DYN_spg_ts_sshf} was found to be more conservative, and so is recommended.  
     270which is useful since it isolates all the time filtering aspects into the term multiplied by $\alpha$. 
     271This isolation allows for an easy check that tracer conservation is exact when eliminating tracer and 
     272surface height time filtering (see ?? for more complete discussion). 
     273However, in the general case with a non-zero $\alpha$, the filter \autoref{eq:DYN_spg_ts_sshf} was found to 
     274be more conservative, and so is recommended.  
    237275 
    238276 
     
    246284\label{subsec:DYN_spg_flt} 
    247285 
    248 The filtered formulation follows the \citet{Roullet2000} implementation. The extra term introduced in the equations (see {\S}I.2.2) is solved implicitly. The elliptic solvers available in the code are  
    249 documented in \autoref{chap:MISC}. The amplitude of the extra term is given by the namelist variable \np{rnu}. The default value is 1, as recommended by \citet{Roullet2000} 
     286The filtered formulation follows the \citet{Roullet2000} implementation. 
     287The extra term introduced in the equations (see {\S}I.2.2) is solved implicitly. 
     288The elliptic solvers available in the code are documented in \autoref{chap:MISC}. 
     289The amplitude of the extra term is given by the namelist variable \np{rnu}. 
     290The default value is 1, as recommended by \citet{Roullet2000} 
    250291 
    251292\colorbox{red}{\np{rnu}\forcode{ = 1} to be suppressed from namelist !} 
     
    257298\label{subsec:DYN_spg_vvl} 
    258299 
    259 In the non-linear free surface formulation, the variations of volume are fully taken into account. This option is presented in a report \citep{Levier2007} available on the NEMO web site. The three time-stepping methods (explicit, split-explicit and filtered) are the same as in \autoref{DYN_spg_linear} except that the ocean depth is now time-dependent. In particular, this means that in filtered case, the matrix to be inverted has to be recomputed at each time-step. 
     300In the non-linear free surface formulation, the variations of volume are fully taken into account. 
     301This option is presented in a report \citep{Levier2007} available on the NEMO web site. 
     302The three time-stepping methods (explicit, split-explicit and filtered) are the same as in 
     303\autoref{DYN_spg_linear} except that the ocean depth is now time-dependent. 
     304In particular, this means that in filtered case, the matrix to be inverted has to be recomputed at each time-step. 
    260305 
    261306 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/chap_time_domain.tex

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

    r9407 r10368  
    88\chapter{Introduction} 
    99 
    10 The Nucleus for European Modelling of the Ocean (\NEMO) is a framework of ocean  
    11 related engines, namely OPA\footnote{OPA = Oc\'{e}an PArall\'{e}lis\'{e}} for the  
    12 ocean dynamics and thermodynamics, LIM\footnote{LIM = Louvain la-neuve Ice  
    13 Model} for the sea-ice dynamics and thermodynamics, TOP\footnote{TOP = Tracer  
    14 in the Ocean Paradigm} for the biogeochemistry (both transport (TRP) and sources  
    15 minus sinks (LOBSTER\footnote{LOBSTER = Lodyc Ocean Biogeochemical SysTem for  
    16 Ecosystem and Resources}, PISCES\footnote{PISCES = Pelagic Interactions Scheme for  
    17 Carbon and Ecosystem Studies}). It is intended to be a flexible tool for studying  
    18 the ocean and its interactions with the other components of the earth climate system  
    19 (atmosphere, sea-ice, biogeochemical tracers, ...) over a wide range of space and time scales.  
    20 This documentation provides information about the physics represented by the ocean  
    21 component of \NEMO and the rationale for the choice of numerical schemes and  
    22 the model design. More specific information about running the model on different  
    23 computers, or how to set up a configuration, are found on the \NEMO web site  
    24 (www.nemo-ocean.eu).  
    25  
    26 The ocean component of \NEMO has been developed from the OPA model,  
    27 release 8.2, described in \citet{Madec1998}. This model has been used for a wide  
    28 range of applications, both regional or global, as a forced ocean model and as a  
    29 model coupled with the sea-ice and/or the atmosphere.   
    30  
    31 This manual is organised in as follows. \autoref{chap:PE} presents the model basics,  
    32 $i.e.$ the equations and their assumptions, the vertical coordinates used, and the  
    33 subgrid scale physics. This part deals with the continuous equations of the model  
    34 (primitive equations, with temperature, salinity and an equation of seawater).  
    35 The equations are written in a curvilinear coordinate system, with a choice of vertical  
    36 coordinates ($z$, $s$, \textit{z*}, \textit{s*}, $\tilde{z}$, $\tilde{s}$, and a mixture of them).  
    37 Momentum equations are formulated in vector invariant or flux form.  
    38 Dimensional units in the meter, kilogram, second (MKS) international system  
    39 are used throughout. 
    40  
    41 The following chapters deal with the discrete equations. \autoref{chap:STP} presents the  
    42 time domain. The model time stepping environment is a three level scheme in which  
    43 the tendency terms of the equations are evaluated either centered  in time, or forward,  
    44 or backward depending of the nature of the term. 
    45 \autoref{chap:DOM} presents the space domain. The model is discretised on a staggered  
    46 grid (Arakawa C grid) with masking of land areas. Vertical discretisation used depends  
    47 on both how the bottom topography is represented and whether the free surface is linear or not.  
    48 Full step or partial step $z$-coordinate or $s$- (terrain-following) coordinate is used  
    49 with linear free surface (level position are then fixed in time). In non-linear free surface,  
    50 the corresponding rescaled height coordinate formulation (\textit{z*} or \textit{s*}) is used  
    51 (the level position then vary in time as a function of the sea surface heigh).  
    52 The following two chapters (\autoref{chap:TRA} and \autoref{chap:DYN}) describe the discretisation of the  
    53 prognostic equations for the active tracers and the momentum. Explicit, split-explicit  
    54 and filtered free surface formulations are implemented.  
    55 A number of numerical schemes are available for momentum advection, for the computation  
    56 of the pressure gradients, as well as for the advection of tracers (second or higher  
    57 order advection schemes, including positive ones). 
    58  
    59 Surface boundary conditions (\autoref{chap:SBC}) can be implemented as prescribed 
    60 fluxes, or bulk formulations for the surface fluxes (wind stress, heat, freshwater). The  
    61 model allows penetration of solar radiation  There is an optional geothermal heating at  
    62 the ocean bottom. Within the \NEMO system the ocean model is interactively coupled  
    63 with a sea ice model (LIM) and with biogeochemistry models (PISCES, LOBSTER).  
    64 Interactive coupling to Atmospheric models is possible via the OASIS coupler  
    65 \citep{OASIS2006}. Two-way nesting is also available through an interface to the 
    66 AGRIF package (Adaptative Grid Refinement in \textsc{Fortran}) \citep{Debreu_al_CG2008}. 
    67 The interface code for coupling to an alternative sea ice model (CICE, \citet{Hunke2008}) 
    68 has now been upgraded so that it works for both global and regional domains, although AGRIF  
    69 is still not available. 
    70  
    71 Other model characteristics are the lateral boundary conditions (\autoref{chap:LBC}).   
    72 Global configurations of the model make use of the ORCA tripolar grid, with special north  
    73 fold boundary condition. Free-slip or no-slip boundary conditions are allowed at land  
    74 boundaries. Closed basin geometries as well as periodic domains and open boundary  
    75 conditions are possible.  
    76  
    77 Physical parameterisations are described in \autoref{chap:LDF} and \autoref{chap:ZDF}. The  
    78 model includes an implicit treatment of vertical viscosity and diffusivity. The lateral  
    79 Laplacian and biharmonic viscosity and diffusion can be rotated following a geopotential  
    80 or neutral direction. There is an optional eddy induced velocity \citep{Gent1990} with a  
    81 space and time variable coefficient \citet{Treguier1997}. The model has vertical harmonic  
    82 viscosity and diffusion with a space and time variable coefficient, with options to compute  
    83 the coefficients with \citet{Blanke1993}, \citet{Pacanowski_Philander_JPO81},  
     10The Nucleus for European Modelling of the Ocean (\NEMO) is a framework of ocean related engines, 
     11namely OPA\footnote{OPA = Oc\'{e}an PArall\'{e}lis\'{e}} for the ocean dynamics and thermodynamics, 
     12LIM\footnote{LIM = Louvain la-neuve Ice Model} for the sea-ice dynamics and thermodynamics, 
     13TOP\footnote{TOP = Tracer in the Ocean Paradigm} for the biogeochemistry (both transport (TRP) and sources  
     14minus sinks (LOBSTER\footnote{LOBSTER = Lodyc Ocean Biogeochemical SysTem for Ecosystem and Resources}, 
     15PISCES\footnote{PISCES = Pelagic Interactions Scheme for Carbon and Ecosystem Studies})). 
     16It is intended to be a flexible tool for studying the ocean and its interactions with the other components of 
     17the earth climate system (atmosphere, sea-ice, biogeochemical tracers, ...) over 
     18a wide range of space and time scales.  
     19This documentation provides information about the physics represented by the ocean component of \NEMO and 
     20the rationale for the choice of numerical schemes and the model design. 
     21More specific information about running the model on different computers, or how to set up a configuration, 
     22are found on the \NEMO web site (www.nemo-ocean.eu).  
     23 
     24The ocean component of \NEMO has been developed from the OPA model, release 8.2, described in \citet{Madec1998}. 
     25This model has been used for a wide range of applications, both regional or global, 
     26as a forced ocean model and as a model coupled with the sea-ice and/or the atmosphere.   
     27 
     28This manual is organised in as follows. 
     29\autoref{chap:PE} presents the model basics, $i.e.$ the equations and their assumptions, 
     30the vertical coordinates used, and the subgrid scale physics. 
     31This part deals with the continuous equations of the model 
     32(primitive equations, with temperature, salinity and an equation of seawater). 
     33The equations are written in a curvilinear coordinate system, with a choice of vertical coordinates 
     34($z$, $s$, \textit{z*}, \textit{s*}, $\tilde{z}$, $\tilde{s}$, and a mixture of them). 
     35Momentum equations are formulated in vector invariant or flux form. 
     36Dimensional units in the meter, kilogram, second (MKS) international system are used throughout. 
     37 
     38The following chapters deal with the discrete equations. 
     39\autoref{chap:STP} presents the time domain. 
     40The model time stepping environment is a three level scheme in which the tendency terms of 
     41the equations are evaluated either centered in time, or forward, or backward depending of the nature of the term. 
     42\autoref{chap:DOM} presents the space domain. 
     43The model is discretised on a staggered grid (Arakawa C grid) with masking of land areas. 
     44Vertical discretisation used depends on both how the bottom topography is represented and 
     45whether the free surface is linear or not. 
     46Full step or partial step $z$-coordinate or $s$- (terrain-following) coordinate is used with 
     47linear free surface (level position are then fixed in time). 
     48In non-linear free surface, 
     49the corresponding rescaled height coordinate formulation (\textit{z*} or \textit{s*}) is used 
     50(the level position then vary in time as a function of the sea surface heigh). 
     51The following two chapters (\autoref{chap:TRA} and \autoref{chap:DYN}) describe the discretisation of 
     52the prognostic equations for the active tracers and the momentum. 
     53Explicit, split-explicit and filtered free surface formulations are implemented. 
     54A number of numerical schemes are available for momentum advection, for the computation of the pressure gradients, 
     55as well as for the advection of tracers (second or higher order advection schemes, including positive ones). 
     56 
     57Surface boundary conditions (\autoref{chap:SBC}) can be implemented as prescribed fluxes, 
     58or bulk formulations for the surface fluxes (wind stress, heat, freshwater). 
     59The model allows penetration of solar radiation. 
     60There is an optional geothermal heating at the ocean bottom. 
     61Within the \NEMO system the ocean model is interactively coupled with a sea ice model (LIM) and 
     62with biogeochemistry models (PISCES, LOBSTER). 
     63Interactive coupling to Atmospheric models is possible via the OASIS coupler \citep{OASIS2006}. 
     64Two-way nesting is also available through an interface to the AGRIF package 
     65(Adaptative Grid Refinement in \textsc{Fortran}) \citep{Debreu_al_CG2008}. 
     66The interface code for coupling to an alternative sea ice model (CICE, \citet{Hunke2008}) has now been upgraded so 
     67that it works for both global and regional domains, although AGRIF is still not available. 
     68 
     69Other model characteristics are the lateral boundary conditions (\autoref{chap:LBC}). 
     70Global configurations of the model make use of the ORCA tripolar grid, with special north fold boundary condition. 
     71Free-slip or no-slip boundary conditions are allowed at land boundaries. 
     72Closed basin geometries as well as periodic domains and open boundary conditions are possible.  
     73 
     74Physical parameterisations are described in \autoref{chap:LDF} and \autoref{chap:ZDF}. 
     75The model includes an implicit treatment of vertical viscosity and diffusivity. 
     76The lateral Laplacian and biharmonic viscosity and diffusion can be rotated following 
     77a geopotential or neutral direction. 
     78There is an optional eddy induced velocity \citep{Gent1990} with a space and time variable coefficient 
     79\citet{Treguier1997}. 
     80The model has vertical harmonic viscosity and diffusion with a space and time variable coefficient, 
     81with options to compute the coefficients with \citet{Blanke1993}, \citet{Pacanowski_Philander_JPO81}, 
    8482or \citet{Umlauf_Burchard_JMS03} mixing schemes. 
    8583 \vspace{1cm} 
     
    9088 
    9189\noindent \index{CPP keys} CPP keys \newline 
    92 Some CPP keys are implemented in the FORTRAN code to allow code selection at compiling step. This selection of code at compilation time reduces the reliability of the whole platform since it changes the code from one set of CPP keys to the other. It is used only when the addition/suppression of the part of code highly changes the amount of memory at run time. 
     90Some CPP keys are implemented in the FORTRAN code to allow code selection at compiling step. 
     91This selection of code at compilation time reduces the reliability of the whole platform since 
     92it changes the code from one set of CPP keys to the other. 
     93It is used only when the addition/suppression of the part of code highly changes the amount of memory at run time. 
    9394Usual coding looks like :  
    9495\begin{forlines} 
     
    101102\noindent \index{Namelist} Namelists 
    102103 
    103 The namelist allows to input variables (character, logical, real and integer) into the code. There is one namelist file for each component of NEMO (dynamics, sea-ice, biogeochemistry...) containing all the FOTRAN namelists needed. The implementation in NEMO uses a two step process. For each FORTRAN namelist, two files are read: 
    104 \begin{enumerate} 
    105 \item A reference namelist (in \path{CONFIG/SHARED/namelist_ref}) is read first. This file contains all the namelist variables which are initialised to default values   
    106 \item A configuration namelist (in \path{CONFIG/CFG_NAME/EXP00/namelist_cfg}) is read aferwards. This file contains only the namelist variables which are changed from default values, and overwrites those. 
     104The namelist allows to input variables (character, logical, real and integer) into the code. 
     105There is one namelist file for each component of NEMO (dynamics, sea-ice, biogeochemistry...) 
     106containing all the FOTRAN namelists needed. 
     107The implementation in NEMO uses a two step process. For each FORTRAN namelist, two files are read: 
     108\begin{enumerate} 
     109\item 
     110  A reference namelist (in \path{CONFIG/SHARED/namelist_ref}) is read first. 
     111  This file contains all the namelist variables which are initialised to default values 
     112\item 
     113  A configuration namelist (in \path{CONFIG/CFG_NAME/EXP00/namelist_cfg}) is read aferwards. 
     114  This file contains only the namelist variables which are changed from default values, and overwrites those. 
    107115\end{enumerate} 
    108116A template can be found in \path{NEMO/OPA_SRC/module.example}. 
    109 The effective namelist, taken in account during the run, is stored at execution time in an output\_namelist\_dyn (or \_ice or \_top) file. 
    110  \vspace{1cm} 
     117The effective namelist, taken in account during the run, is stored at execution time in 
     118an output\_namelist\_dyn (or \_ice or \_top) file. 
     119\vspace{1cm} 
    111120 
    112121%%gm  end 
    113122 
    114123Model outputs management and specific online diagnostics are described in \autoref{chap:DIA}. 
    115 The diagnostics includes the output of all the tendencies of the momentum and tracers equations,  
    116 the output of tracers tendencies averaged over the time evolving mixed layer, the output of  
    117 the tendencies of the barotropic vorticity equation, the computation of on-line floats trajectories...  
    118 \autoref{chap:OBS} describes a tool which reads in observation files (profile temperature  
    119 and salinity, sea surface temperature, sea level anomaly and sea ice concentration)  
    120 and calculates an interpolated model equivalent value at the observation location  
    121 and nearest model timestep. Originally developed of data assimilation, it is a fantastic  
    122 tool for model and data comparison. \autoref{chap:ASM} describes how increments  
    123 produced by data assimilation may be applied to the model equations. 
    124 Finally, \autoref{chap:CFG} provides a brief introduction to the pre-defined model  
    125 configurations (water column model, ORCA and GYRE families of configurations). 
    126  
    127 The model is implemented in \textsc{Fortran 90}, with preprocessing (C-pre-processor).  
    128 It runs under UNIX. It is optimized for vector computers and parallelised by domain   
    129 decomposition with MPI. All input and output is done in NetCDF (Network Common Data  
    130 Format) with a optional direct access format for output. To ensure the clarity and  
    131 readability of the code it is necessary to follow coding rules. The coding rules for OPA  
    132 include conventions for naming variables, with different starting letters for different types  
    133 of variables (real, integer, parameter\ldots). Those rules are briefly presented in  
    134 \autoref{apdx:D} and a more complete document is available on the \NEMO web site. 
    135  
    136 The model is organized with a high internal modularity based on physics. For example,  
    137 each trend ($i.e.$, a term in the RHS of the prognostic equation) for momentum and  
    138 tracers is computed in a dedicated module.  To make it easier for the user to find his way  
    139 around the code, the module names follow a three-letter rule. For example, \mdl{traldf}  
    140 is a module related to the TRAcers equation, computing the Lateral DiFfussion.  
     124The diagnostics includes the output of all the tendencies of the momentum and tracers equations, 
     125the output of tracers tendencies averaged over the time evolving mixed layer, 
     126the output of the tendencies of the barotropic vorticity equation, 
     127the computation of on-line floats trajectories... 
     128\autoref{chap:OBS} describes a tool which reads in observation files 
     129(profile temperature and salinity, sea surface temperature, sea level anomaly and sea ice concentration)  
     130and calculates an interpolated model equivalent value at the observation location and nearest model timestep. 
     131Originally developed of data assimilation, it is a fantastic tool for model and data comparison. 
     132\autoref{chap:ASM} describes how increments produced by data assimilation may be applied to the model equations. 
     133Finally, \autoref{chap:CFG} provides a brief introduction to the pre-defined model configurations 
     134(water column model, ORCA and GYRE families of configurations). 
     135 
     136The model is implemented in \textsc{Fortran 90}, with preprocessing (C-pre-processor). 
     137It runs under UNIX. 
     138It is optimized for vector computers and parallelised by domain decomposition with MPI. 
     139All input and output is done in NetCDF (Network Common Data Format) with a optional direct access format for output. 
     140To ensure the clarity and readability of the code it is necessary to follow coding rules. 
     141The coding rules for OPA include conventions for naming variables, 
     142with different starting letters for different types of variables (real, integer, parameter\ldots). 
     143Those rules are briefly presented in \autoref{apdx:D} and a more complete document is available on 
     144the \NEMO web site. 
     145 
     146The model is organized with a high internal modularity based on physics. 
     147For example, each trend ($i.e.$, a term in the RHS of the prognostic equation) for momentum and tracers 
     148is computed in a dedicated module. 
     149To make it easier for the user to find his way around the code, the module names follow a three-letter rule. 
     150For example, \mdl{traldf} is a module related to the TRAcers equation, computing the Lateral DiFfussion.  
    141151%The complete list of module names is presented in \autoref{apdx:D}.      %====>>>> to be done ! 
    142 Furthermore, modules are organized in a few directories that correspond to their category,  
     152Furthermore, modules are organized in a few directories that correspond to their category, 
    143153as indicated by the first three letters of their name (\autoref{tab:chap}). 
    144154 
    145 The manual mirrors the organization of the model.  
    146 After the presentation of the continuous equations (\autoref{chap:PE}), the following chapters  
    147 refer to specific terms of the equations each associated with a group of modules (\autoref{tab:chap}). 
     155The manual mirrors the organization of the model. 
     156After the presentation of the continuous equations (\autoref{chap:PE}), 
     157the following chapters refer to specific terms of the equations each associated with 
     158a group of modules (\autoref{tab:chap}). 
    148159 
    149160 
    150161%--------------------------------------------------TABLE-------------------------------------------------- 
    151162\begin{table}[!t]  
    152 %\begin{center} \begin{tabular}{|p{143pt}|l|l|} \hline 
    153 \caption{ \protect\label{tab:chap}   Organization of Chapters mimicking the one of the model directories. } 
    154 \begin{center}    \begin{tabular}{|l|l|l|}   \hline 
    155 \autoref{chap:STP}   & -                 & model time STePping environment \\    \hline 
    156 \autoref{chap:DOM}   & DOM    & model DOMain \\    \hline 
    157 \autoref{chap:TRA}   & TRA    & TRAcer equations (potential temperature and salinity) \\   \hline 
    158 \autoref{chap:DYN}   & DYN    & DYNamic equations (momentum) \\      \hline 
    159 \autoref{chap:SBC}   & SBC    & Surface Boundary Conditions \\       \hline 
    160 \autoref{chap:LBC}   & LBC    & Lateral Boundary Conditions (also OBC and BDY)  \\     \hline 
    161 \autoref{chap:LDF}   & LDF    & Lateral DiFfusion (parameterisations) \\   \hline 
    162 \autoref{chap:ZDF}   & ZDF    & vertical (Z) DiFfusion (parameterisations)  \\      \hline 
    163 \autoref{chap:DIA}   & DIA    & I/O and DIAgnostics (also IOM, FLO and TRD) \\      \hline 
    164 \autoref{chap:OBS}   & OBS    & OBServation and model comparison  \\    \hline 
    165 \autoref{chap:ASM}   & ASM    & ASsiMilation increment  \\     \hline 
    166 \autoref{chap:MISC}  & SOL    & Miscellaneous  topics (including solvers)  \\       \hline 
    167 \autoref{chap:CFG}   &  -        & predefined configurations (including C1D) \\     \hline 
    168 \end{tabular}   
    169 \end{center}   \end{table} 
     163  % \begin{center} \begin{tabular}{|p{143pt}|l|l|} \hline 
     164  \caption{ \protect\label{tab:chap}   Organization of Chapters mimicking the one of the model directories. } 
     165  \begin{center} 
     166    \begin{tabular}{|l|l|l|}  \hline 
     167      \autoref{chap:STP}   & -                 & model time STePping environment \\    \hline 
     168      \autoref{chap:DOM}   & DOM    & model DOMain \\    \hline 
     169      \autoref{chap:TRA}   & TRA    & TRAcer equations (potential temperature and salinity) \\   \hline 
     170      \autoref{chap:DYN}   & DYN    & DYNamic equations (momentum) \\      \hline 
     171      \autoref{chap:SBC}   & SBC    & Surface Boundary Conditions \\       \hline 
     172      \autoref{chap:LBC}   & LBC    & Lateral Boundary Conditions (also OBC and BDY)  \\     \hline 
     173      \autoref{chap:LDF}   & LDF    & Lateral DiFfusion (parameterisations) \\   \hline 
     174      \autoref{chap:ZDF}   & ZDF    & vertical (Z) DiFfusion (parameterisations)  \\      \hline 
     175      \autoref{chap:DIA}   & DIA    & I/O and DIAgnostics (also IOM, FLO and TRD) \\      \hline 
     176      \autoref{chap:OBS}   & OBS    & OBServation and model comparison  \\    \hline 
     177      \autoref{chap:ASM}   & ASM    & ASsiMilation increment  \\     \hline 
     178      \autoref{chap:MISC}  & SOL    & Miscellaneous  topics (including solvers)  \\       \hline 
     179      \autoref{chap:CFG}   &  -        & predefined configurations (including C1D) \\     \hline 
     180    \end{tabular} 
     181  \end{center} 
     182\end{table} 
    170183%-------------------------------------------------------------------------------------------------------------- 
    171184 
    172185 
    173186\subsubsection{Changes between releases} 
    174 NEMO/OPA, like all research tools, is in perpetual evolution. The present document describes  
    175 the OPA version include in the release 3.4 of NEMO.  This release differs significantly 
    176 from version 8, documented in \citet{Madec1998}.\\ 
     187NEMO/OPA, like all research tools, is in perpetual evolution. 
     188The present document describes the OPA version include in the release 3.4 of NEMO. 
     189This release differs significantly from version 8, documented in \citet{Madec1998}.\\ 
    177190 
    178191$\bullet$ The main modifications from OPA v8 and NEMO/OPA v3.2 are :\\ 
    179192\begin{enumerate} 
    180 \item transition to full native \textsc{Fortran} 90, deep code restructuring and drastic  
    181 reduction of CPP keys;  
    182 \item introduction of partial step representation of bottom topography \citep{Barnier_al_OD06, Le_Sommer_al_OM09, Penduff_al_OS07};  
    183 \item partial reactivation of a terrain-following vertical coordinate ($s$- and hybrid $s$-$z$)  
    184 with the addition of several options for pressure gradient computation \footnote{Partial  
    185 support of $s$-coordinate: there is presently no support for neutral physics in $s$- 
    186 coordinate and for the new options for horizontal pressure gradient computation with  
    187 a non-linear equation of state.};  
    188 \item more choices for the treatment of the free surface: full explicit, split-explicit or filtered  
    189 schemes, and suppression of the rigid-lid option; 
    190 \item non linear free surface associated with the rescaled height coordinate   
    191 \textit{z*} or  \textit{s};  
    192 \item additional schemes for vector and flux forms of the momentum  advection;  
    193 \item additional advection schemes for tracers;  
    194 \item implementation of the AGRIF package (Adaptative Grid Refinement in \textsc{Fortran}) \citep{Debreu_al_CG2008};  
    195 \item online diagnostics : tracers trend in the mixed layer and vorticity balance; 
    196 \item rewriting of the I/O management with the use of an I/O server;  
    197 \item generalized ocean-ice-atmosphere-CO2 coupling interface, interfaced with OASIS 3 coupler ; 
    198 \item surface module (SBC) that simplify the way the ocean is forced and include two 
    199 bulk formulea (CLIO and CORE) and which includes an on-the-fly interpolation of input forcing fields ; 
    200 \item RGB light penetration and optional use of ocean color  
    201 \item major changes in the TKE schemes: it now includes a Langmuir cell parameterization  \citep{Axell_JGR02},  
    202 the \citet{Mellor_Blumberg_JPO04} surface wave breaking parameterization, and has a time discretization  
    203 which is energetically consistent with the ocean model equations \citep{Burchard_OM02, Marsaleix_al_OM08};  
    204 \item tidal mixing parametrisation (bottom intensification) + Indonesian specific tidal mixing \citep{Koch-Larrouy_al_GRL07};  
    205 \item introduction of LIM-3, the new Louvain-la-Neuve sea-ice model (C-grid rheology and 
    206 new thermodynamics including bulk ice salinity) \citep{Vancoppenolle_al_OM09a, Vancoppenolle_al_OM09b} 
     193\item 
     194  transition to full native \textsc{Fortran} 90, deep code restructuring and drastic reduction of CPP keys;  
     195\item 
     196  introduction of partial step representation of bottom topography 
     197  \citep{Barnier_al_OD06, Le_Sommer_al_OM09, Penduff_al_OS07}; 
     198\item 
     199  partial reactivation of a terrain-following vertical coordinate ($s$- and hybrid $s$-$z$) with 
     200  the addition of several options for pressure gradient computation 
     201  \footnote{Partial support of $s$-coordinate: there is presently no support for neutral physics in 
     202    $s$-coordinate and for the new options for horizontal pressure gradient computation with 
     203    a non-linear equation of state. 
     204  }; 
     205\item 
     206  more choices for the treatment of the free surface: full explicit, split-explicit or filtered schemes, 
     207  and suppression of the rigid-lid option; 
     208\item 
     209  non linear free surface associated with the rescaled height coordinate \textit{z*} or \textit{s}; 
     210\item 
     211  additional schemes for vector and flux forms of the momentum advection; 
     212\item 
     213  additional advection schemes for tracers; 
     214\item 
     215  implementation of the AGRIF package (Adaptative Grid Refinement in \textsc{Fortran}) \citep{Debreu_al_CG2008}; 
     216\item 
     217  online diagnostics : tracers trend in the mixed layer and vorticity balance; 
     218\item 
     219  rewriting of the I/O management with the use of an I/O server; 
     220\item 
     221  generalized ocean-ice-atmosphere-CO2 coupling interface, interfaced with OASIS 3 coupler; 
     222\item 
     223  surface module (SBC) that simplify the way the ocean is forced and include two bulk formulea (CLIO and CORE) and 
     224  which includes an on-the-fly interpolation of input forcing fields; 
     225\item 
     226  RGB light penetration and optional use of ocean color  
     227\item 
     228  major changes in the TKE schemes: it now includes a Langmuir cell parameterization \citep{Axell_JGR02}, 
     229  the \citet{Mellor_Blumberg_JPO04} surface wave breaking parameterization, and has a time discretization which 
     230  is energetically consistent with the ocean model equations \citep{Burchard_OM02, Marsaleix_al_OM08}; 
     231\item 
     232  tidal mixing parametrisation (bottom intensification) + Indonesian specific tidal mixing 
     233  \citep{Koch-Larrouy_al_GRL07}; 
     234\item 
     235  introduction of LIM-3, the new Louvain-la-Neuve sea-ice model 
     236  (C-grid rheology and new thermodynamics including bulk ice salinity) 
     237  \citep{Vancoppenolle_al_OM09a, Vancoppenolle_al_OM09b} 
    207238\end{enumerate} 
    208239 
    209240 \vspace{1cm} 
    210 $\bullet$ The main modifications from NEMO/OPA v3.2 and  v3.3 are :\\ 
    211 \begin{enumerate} 
    212 \item introduction of a modified leapfrog-Asselin filter time stepping scheme \citep{Leclair_Madec_OM09};  
    213 \item additional scheme for iso-neutral mixing \citep{Griffies_al_JPO98}, although it is still a "work in progress";  
    214 \item a rewriting of the bottom boundary layer scheme, following \citet{Campin_Goosse_Tel99};  
    215 \item addition of a Generic Length Scale vertical mixing scheme, following \citet{Umlauf_Burchard_JMS03};  
    216 \item addition of the atmospheric pressure as an external forcing on both ocean and sea-ice dynamics;  
    217 \item addition of a diurnal cycle on solar radiation \citep{Bernie_al_CD07};  
    218 \item river runoffs added through a non-zero depth, and having its own temperature and salinity;  
    219 \item CORE II normal year forcing set as the default forcing of ORCA2-LIM configuration ;  
    220 \item generalisation of the use of \mdl{fldread} for all input fields (ocean climatology, sea-ice damping...) ;  
    221 \item addition of an on-line observation and model comparison (thanks to NEMOVAR project);  
    222 \item optional application of an assimilation increment (thanks to NEMOVAR project);  
    223 \item coupling interface adjusted for WRF atmospheric model;  
    224 \item C-grid ice rheology now available fro both LIM-2 and LIM-3 \citep{Bouillon_al_OM09};  
    225 \item LIM-3 ice-ocean momentum coupling applied to LIM-2 ;  
    226 \item a deep re-writting and simplification of the off-line tracer component (OFF\_SRC) ;  
    227 \item the merge of passive and active advection and diffusion modules ; 
    228 \item  Use of the Flexible Configuration Manager (FCM) to build configurations, generate the Makefile and produce the executable ; 
    229 \item Linear-tangent and Adjoint component (TAM) added, phased with v3.0 
    230 \end{enumerate} 
    231  \vspace{1cm} 
    232 In addition, several minor modifications in the coding have been introduced with the constant  
    233 concern of improving the model performance.  
    234  
    235  \vspace{1cm} 
     241$\bullet$ The main modifications from NEMO/OPA v3.2 and v3.3 are :\\ 
     242\begin{enumerate} 
     243\item 
     244  introduction of a modified leapfrog-Asselin filter time stepping scheme 
     245  \citep{Leclair_Madec_OM09};  
     246\item 
     247  additional scheme for iso-neutral mixing \citep{Griffies_al_JPO98}, although it is still a "work in progress"; 
     248\item 
     249  a rewriting of the bottom boundary layer scheme, following \citet{Campin_Goosse_Tel99}; 
     250\item 
     251  addition of a Generic Length Scale vertical mixing scheme, following \citet{Umlauf_Burchard_JMS03}; 
     252\item 
     253  addition of the atmospheric pressure as an external forcing on both ocean and sea-ice dynamics; 
     254\item 
     255  addition of a diurnal cycle on solar radiation \citep{Bernie_al_CD07}; 
     256\item 
     257  river runoffs added through a non-zero depth, and having its own temperature and salinity; 
     258\item 
     259  CORE II normal year forcing set as the default forcing of ORCA2-LIM configuration; 
     260\item 
     261  generalisation of the use of \mdl{fldread} for all input fields (ocean climatology, sea-ice damping...); 
     262\item 
     263  addition of an on-line observation and model comparison (thanks to NEMOVAR project); 
     264\item 
     265  optional application of an assimilation increment (thanks to NEMOVAR project); 
     266\item 
     267  coupling interface adjusted for WRF atmospheric model; 
     268\item 
     269  C-grid ice rheology now available fro both LIM-2 and LIM-3 \citep{Bouillon_al_OM09}; 
     270\item 
     271  LIM-3 ice-ocean momentum coupling applied to LIM-2; 
     272\item 
     273  a deep re-writting and simplification of the off-line tracer component (OFF\_SRC); 
     274\item 
     275  the merge of passive and active advection and diffusion modules; 
     276\item 
     277  Use of the Flexible Configuration Manager (FCM) to build configurations, 
     278  generate the Makefile and produce the executable; 
     279\item 
     280  Linear-tangent and Adjoint component (TAM) added, phased with v3.0 
     281\end{enumerate} 
     282\vspace{1cm} 
     283In addition, several minor modifications in the coding have been introduced with the constant concern of 
     284improving the model performance.  
     285 
     286\vspace{1cm} 
    236287$\bullet$ The main modifications from NEMO/OPA v3.3 and  v3.4 are :\\ 
    237288\begin{enumerate} 
    238 \item finalisation of above iso-neutral mixing \citep{Griffies_al_JPO98}";  
     289\item finalisation of above iso-neutral mixing \citep{Griffies_al_JPO98}"; 
    239290\item "Neptune effect" parametrisation; 
    240 \item horizontal pressure gradient suitable for s-coordinate;  
     291\item horizontal pressure gradient suitable for s-coordinate; 
    241292\item semi-implicit bottom friction; 
    242 \item finalisation of the merge of passive and active tracers advection-diffusion modules;  
     293\item finalisation of the merge of passive and active tracers advection-diffusion modules; 
    243294\item a new bulk formulae (so-called MFS); 
    244 \item use fldread for the off-line tracer component (OFF\_SRC) ;  
     295\item use fldread for the off-line tracer component (OFF\_SRC); 
    245296\item use MPI point to point communications  for north fold; 
    246 \item diagnostic of transport ;  
     297\item diagnostic of transport; 
    247298\end{enumerate} 
    248299 
Note: See TracChangeset for help on using the changeset viewer.