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 994 for trunk/DOC/TexFiles/Chapters – NEMO

Ignore:
Timestamp:
2008-05-28T11:01:09+02:00 (16 years ago)
Author:
gm
Message:

trunk - add steven correction + several other things + rename BETA into TexFiles?

Location:
trunk/DOC/TexFiles
Files:
15 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/DOC/TexFiles/Chapters/Abstracts_Foreword.tex

    r817 r994  
    2828 \vspace{0.5cm} 
    2929 
    30 Madec, G., 2008: NEMO ocean engine. \textit{Note du P\^ole de mod\'{e}lisation}, Institut Pierre-Simon Laplace (IPSL), France, \colorbox{yellow}{NXX, 193pp}.\\ 
     30Madec, G., 2008: NEMO ocean engine. \textit{Note du P\^ole de mod\'{e}lisation}, Institut Pierre-Simon Laplace (IPSL), France, No 27, ISSN No 1288-1619.\\ 
     31 
    3132 
    3233 \vspace{0.5cm} 
  • trunk/DOC/TexFiles/Chapters/Annex_C.tex

    r817 r994  
    99I'm writting this appendix. It will be available in a forthcoming release of the documentation 
    1010 
    11 \gmcomment{ 
     11%\gmcomment{ 
    1212 
    1313% ================================================================ 
     
    160160and introducing the horizontal divergence $\chi $, it becomes: 
    161161\begin{align*} 
    162 \equiv& \sum\limits_{i,j,k} - \frac{1} {2} \left(  \frac{\zeta} {e_{3f}} \right)^2 \; \overline{\overline{ e_1T\,e_2T\,e_3T\, \chi}}^{\,i+1/2,j+1/2} \;\;\equiv 0  
     162\equiv& \sum\limits_{i,j,k} - \frac{1} {2} \left(  \frac{\zeta} {e_{3f}} \right)^2 \; \overline{\overline{ e_{1T}\,e_{2T}\,e_{3T}\, \chi}}^{\,i+1/2,j+1/2} \;\;\equiv 0  
    163163\qquad \qquad \qquad \qquad \qquad \qquad \qquad &&&&\\ 
    164164\end{align*} 
     
    169169the two components of the vorticity term is optionally offered (ENE scheme) : 
    170170\begin{equation*} 
    171 \frac{1} {e_3 }\nabla \times  
    172    \left(  
    173    \zeta \;{\textbf{k}}\times {\textbf {U}}_h  
    174    \right) 
     171   - \zeta \;{\textbf{k}}\times {\textbf {U}}_h  
    175172\equiv  
    176173   \left( {{ 
     
    192189enstrophy on the relative vorticity term and energy on the Coriolis term. 
    193190\begin{flalign*} 
    194 &\int\limits_D \textbf{U}_h \times   \left(  \zeta \;\textbf{k} \times \textbf{U}_h  \right)  \;  dv &&  \\ 
     191&\int\limits_D - \textbf{U}_h \cdot   \left(  \zeta \;\textbf{k} \times \textbf{U}_h  \right)  \;  dv &&  \\ 
    195192\equiv& \sum\limits_{i,j,k}   \biggl\{     
    196193      \overline {\left(  \frac{\zeta} {e_{3f}}      \right)  
     
    348345      &&& \\ & \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad 
    349346   + \delta_k         \left[   \overline {e_{1w}\,e_{2w}\,w}^{\,i+12}\;\overline u^{\,k+1/2}  \right] 
    350       \; \biggr\}    &&& \displaybreak[0] \\ 
    351 % 
    352 \equiv& \sum\limits_{i,j,k} 
     347      \; \biggr\} \; u    &&& \displaybreak[0] \\ 
     348% 
     349\equiv& - \sum\limits_{i,j,k} 
    353350   \biggl\{  
    354351      \overline {e_{2u}\,e_{3u}\,u}^{\,i}\;        \overline u^{\,i}       \delta_i  
     
    359356       + \overline {e_{1w}\,e_{2w}\,w}^{\,i+1/2}\; \overline u^{\,k+1/2}   \delta_{k+1/2}    \left[ u \right]     \biggr\}     && \displaybreak[0] \\ 
    360357% 
    361 \equiv& \sum\limits_{i,j,k} 
     358\equiv& - \sum\limits_{i,j,k} 
    362359   \biggl\{  
    363360        \overline {e_{2u}\,e_{3u}\,u}^{\,i}        \delta_i       \left[ u^2 \right]  
     
    12241221constraint of conservation of tracers: 
    12251222\begin{flalign*} 
    1226 &\int\limits_D  T\;\nabla  \cdot \left( A\;\nabla T \right)\;dv  &&&\\  
     1223&\int\limits_D  \nabla  \cdot \left( A\;\nabla T \right)\;dv  &&&\\  
    12271224\\ 
    12281225&\equiv \sum\limits_{i,j,k}  
     
    12481245\end{flalign*} 
    12491246 
     1247In fact, this property is simply resulting from the flux form of the operator.  
    12501248 
    12511249% ------------------------------------------------------------------------------------------------------------- 
     
    12571255constraint of dissipation of tracer variance: 
    12581256\begin{flalign*} 
    1259 \int\limits_D T\;\nabla \cdot \left( A\;\nabla T \right)\;dv   &&&\\  
    1260 \end{flalign*} 
    1261 \begin{flalign*} 
    1262 \equiv \sum\limits_{i,j,k} T 
    1263    \biggl\{    \biggr. 
    1264    \delta_i  
    1265       \left[  
    1266       A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2}  
    1267          \left[ T \right]  
    1268       \right] 
    1269    + \delta_j  
    1270       &\left[  
    1271       A_v^{\,lT} \frac{e_{1v}\,e_{3v}} {e_{2v}} \delta_{j+1/2}  
    1272          \left[ T \right]  
    1273       \right]  
    1274       && \\  
    1275     \biggl.  
    1276     + \delta_k  
    1277       &\left[  
    1278       A_w^{\,vT} \frac{e_{1T}\,e_{2T}} {e_{3T}} \delta_{k+1/2}  
    1279          \left[ T \right]  
    1280       \right] 
    1281    \biggr\}  
    1282    &&\\  
     1257\int\limits_D T\;\nabla & \cdot \left( A\;\nabla T \right)\;dv &&&\\  
     1258&\equiv   \sum\limits_{i,j,k} \; T 
     1259\biggl\{  \biggr. 
     1260     \delta_i \left[ A_u^{\,lT} \frac{e_{2u}\,e_{3u}} {e_{1u}} \delta_{i+1/2} \left[T\right] \right] 
     1261& + \delta_j \left[ A_v^{\,lT} \frac{e_{1v} \,e_{3v}} {e_{2v}} \delta_{j+1/2} \left[T\right] \right]  
     1262      \quad&& \\  
     1263 \biggl.  
     1264&&+ \delta_k \left[A_w^{\,vT}\frac{e_{1T}\,e_{2T}} {e_{3T}}\delta_{k+1/2}\left[T\right]\right] 
     1265\biggr\} &&  
    12831266\end{flalign*} 
    12841267\begin{flalign*} 
     
    13131296 
    13141297%%%%  end of appendix in gm comment 
    1315 } 
     1298%} 
  • trunk/DOC/TexFiles/Chapters/Chap_DOM.tex

    r817 r994  
    819819                                                \; 0&   \text{ if $k\leq mbathy(i,j)$  }    \end{cases}     \\ 
    820820umask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i+1,j,k)   \\ 
    821 umask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i,j+1,k)   \\ 
    822 umask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i+1,j,k)   \\ 
     821vmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i,j+1,k)   \\ 
     822fmask(i,j,k) &=         \; tmask(i,j,k) \ * \ tmask(i+1,j,k)   \\ 
    823823                   & \ \ \, * tmask(i,j,k) \ * \ tmask(i+1,j,k) 
    824824\end{align*} 
  • trunk/DOC/TexFiles/Chapters/Chap_DYN.tex

    r817 r994  
    107107\left\{  
    108108\begin{aligned} 
    109 {-\frac{1}{e_{1u} } } & {\overline {\left( { \frac{\zeta +f}{e_{3f} }} \right)} }^{\,i} & {\overline{\overline {\left( {e_{1v} e_{3v} v} \right)}} }^{\,i, j+1/2}    \\ 
    110 {+\frac{1}{e_{2v} } } & {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)} }^{\,j}  & {\overline{\overline {\left( {e_{2u} e_{3u} u} \right)}} }^{\,i+1/2, j}   
     109{+\frac{1}{e_{1u} } } & {\overline {\left( { \frac{\zeta +f}{e_{3f} }} \right)} }^{\,i} & {\overline{\overline {\left( {e_{1v} e_{3v} v} \right)}} }^{\,i, j+1/2}    \\ 
     110{-\frac{1}{e_{2v} } } & {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right)} }^{\,j}  & {\overline{\overline {\left( {e_{2u} e_{3u} u} \right)}} }^{\,i+1/2, j}   
    111111\end{aligned}  
    112112 \right. 
     
    124124\left\{ { 
    125125\begin{aligned} 
    126 {-\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right) 
     126{+\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right) 
    127127\;\overline {\left( {e_{1v} e_{3v} v} \right)} ^{\,i+1/2}} }^{\,j} }    \\ 
    128 {+\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right) 
     128{-\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta +f}{e_{3f} }} \right) 
    129129\;\overline {\left( {e_{2u} e_{3u} u} \right)} ^{\,j+1/2}} }^{\,i} } 
    130130\end{aligned}  
     
    145145\left\{ { 
    146146\begin{aligned} 
    147  {-\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^{\,i}  
     147 {+\frac{1}{e_{1u} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^{\,i}  
    148148 \; {\overline{\overline {\left( {e_{1v} \; e_{3v} \ v} \right)}} }^{\,i,j+1/2} -\frac{1}{e_{1u} } 
    149149 \; {\overline {\left( {\frac{f}{e_{3f} }} \right)  
    150150 \;\overline {\left( {e_{1v} \; e_{3v} \ v} \right)} ^{\,i+1/2}} }^{\,j} } \\ 
    151 {+\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^j 
     151{-\frac{1}{e_{2v} }\; {\overline {\left( {\frac{\zeta }{e_{3f} }} \right)} }^j 
    152152 \; {\overline{\overline {\left( {e_{2u} \; e_{3u} \ u} \right)}} }^{\,i+1/2,j} +\frac{1}{e_{2v} } 
    153153 \; {\overline {\left( {\frac{f}{e_{3f} }} \right) 
     
    220220-q\,e_3 \,u       &\equiv -\frac{1}{e_{2v} }  \left[  
    221221{{\begin{array}{*{20}c} 
    222    {\,\ \ a_{j-1/2}^{i   }  \left( {e_{2u} e_{3v} \ u} \right)_{j+1}^{i+1/2} }  
    223    {\,+\,b_{j-1/2}^{i+1}  \left( {e_{2u} e_{3v} \ u} \right)_{j+1/2}^{i+1} } \\ 
     222   {\,\ \ a_{j-1/2}^{i   }  \left( {e_{2u} e_{3u} \ u} \right)_{j+1}^{i+1/2} }  
     223   {\,+\,b_{j-1/2}^{i+1}  \left( {e_{2u} e_{3u} \ u} \right)_{j+1/2}^{i+1} } \\ 
    224224 \\ 
    225       {  +\,c_{j+1/2}^{i+1} \left( {e_{2u} e_{3v} \ u} \right)_{j+1/2}^{i+1} }  
    226    {\,+\,d_{j+1/2}^{i   }  \left( {e_{2u} e_{3v} \ u} \right)_{j+1/2}^{i   } } \\ 
     225      {  +\,c_{j+1/2}^{i+1} \left( {e_{2u} e_{3u} \ u} \right)_{j+1/2}^{i+1} }  
     226   {\,+\,d_{j+1/2}^{i   }  \left( {e_{2u} e_{3u} \ u} \right)_{j+1/2}^{i   } } \\ 
    227227\end{array} }} \right] 
    228228\end{aligned}  
     
    670670\right]+\delta _j \left[ {e_{1v} e_{3v} v} \right]} \right)}  
    671671\end{equation} 
    672  
    673 where EMP is the surface freshwater budget, expressed in $Kg.m^{-2}.s^{-1}$,  
    674 and $\rho _w =1,000\,Kg.m^{-3}$ is the volumic mass of pure water. If river  
    675 runoff is expressed as a surface freshwater flux, see \S\ref{SBC}, then EMP  
    676 can be written as the evaporation minus precipitation, minus the river runoff.  
    677 The sea-surface height is evaluated using a leapfrog scheme in combination  
    678 with an Asselin time filter, $i.e.$ the velocity appearing in  
    679 \eqref{Eq_dynspg_ssh} is centred in time (\textit{now} velocity).  
     672where EMP is the surface freshwater budget, expressed in Kg/m$^2$/s  
     673(which is equal to mm/s), and $\rho _w$=1,000~Kg/m$^3$ is the volumic  
     674mass of pure water. If river runoff is expressed as a surface freshwater flux  
     675(see \S\ref{SBC}) then EMP can be written as the evaporation minus  
     676precipitation, minus the river runoff. The sea-surface height is evaluated  
     677using a leapfrog scheme in combination with an Asselin time filter, $i.e.$  
     678the velocity appearing in \eqref{Eq_dynspg_ssh} is centred in time  
     679(\textit{now} velocity).  
    680680 
    681681The surface pressure gradient, also evaluated using a leap-frog scheme, is  
     
    683683\begin{equation} \label{Eq_dynspg_exp} 
    684684\left\{ \begin{aligned} 
    685  - \frac{1}                      {e_{1u}} \; \delta _{i+1/2} \left[  \,\eta\,  \right]    \\ 
    686  \\ 
    687  - \frac{1}                      {e_{2v}} \; \delta _{j+1/2} \left[  \,\eta\,  \right]   
     685 - \frac{1}{e_{1u}} \;  \delta _{i+1/2} \left[  \,\eta\,  \right]    \\ 
     686 - \frac{1}{e_{2v}} \;  \delta _{j+1/2} \left[  \,\eta\,  \right]   
    688687\end{aligned} \right. 
    689688\end{equation}  
     
    704703proposed by \citet{Griffies2004}. The general idea is to solve the free surface  
    705704equation with a small time step \np{rdtbt}, while the three dimensional  
    706 prognostic variables are solved with a longer time step that is a multiple of \np{rdtbt}  
    707 (Fig.\ref {Fig_DYN_dynspg_ts}).  
     705prognostic variables are solved with a longer time step that is a multiple of  
     706\np{rdtbt} (Fig.\ref {Fig_DYN_dynspg_ts}).  
    708707 
    709708%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
     
    711710\begin{center} 
    712711\includegraphics[width=0.90\textwidth]{./Figures/Fig_DYN_dynspg_ts.pdf} 
    713 \caption{Schematic of the split-explicit time stepping scheme for the barotropic  
    714 and baroclinic modes, after \citet{Griffies2004}. Time increases to the right.  
    715 Baroclinic time steps are denoted by $t-\Delta t$, $t, t+\Delta t$, and $t+2\Delta t$.  
    716 The curved line represents a leap-frog time step, and the smaller barotropic time  
    717 steps $N \Delta t=2\Delta t$ are denoted by the zig-zag line. The vertically  
    718 integrated forcing \textbf{M}(t) computed at the baroclinic time step $t$  
    719 represents the interaction between the barotropic and baroclinic motions.  
    720 While keeping the total depth, tracer, and freshwater forcing fields fixed, a  
    721 leap-frog integration carries the surface height and vertically integrated velocity  
    722 from $t$ to $t+2 \Delta t$ using N barotropic time steps of length $\Delta t$.  
    723 Time averaging the barotropic fields over the N+1 time steps (endpoints  
    724 included) centers the vertically integrated velocity at the baroclinic timestep  
    725 $t+\Delta t$. A baroclinic leap-frog time step carries the surface height to  
     712\caption{Schematic of the split-explicit time stepping scheme for the external  
     713and internal modes. Time increases to the right.  
     714Internal mode time steps (which are also the model time steps) are denoted  
     715by $t-\Delta t$, $t, t+\Delta t$, and $t+2\Delta t$.  
     716The curved line represents a leap-frog time step, and the smaller time  
     717steps $N \Delta t_e=\frac{3}{2}\Delta t$ are denoted by the zig-zag line. The vertically  
     718integrated forcing \textbf{M}(t) computed at the model time step $t$  
     719represents the interaction between the external and internal motions.  
     720While keeping \textbf{M} and freshwater forcing field fixed, a  
     721leap-frog integration carries the external mode variables (surface height and vertically integrated velocity) from $t$ to $t+\frac{3}{2} \Delta t$ using N external time steps of length $\Delta t_e$.  
     722Time averaging the external fields over the $\frac{2}{3}N+1$ time steps (endpoints  
     723included) centers the vertically integrated velocity and the sea surface height at the model timestep $t+\Delta t$. These averaged values are used to update \textbf{M}(t) with both the surface pressure gradient and the Coriolis force.  
     724A baroclinic leap-frog time step carries the surface height to The model time stepping scheme can then be achieved by  
    726725$t+\Delta t$ using the convergence of the time averaged vertically integrated  
    727726velocity taken from baroclinic time step t. } 
  • trunk/DOC/TexFiles/Chapters/Chap_LBC.tex

    r817 r994  
    1717%-------------------------------------------------------------------------------------------------------------- 
    1818 
    19 %The lateral ocean boundary condition continuous to coastlines are Neumann conditions for heat and salt (no flux across boundaries) and Dirichlet conditions for momentum (from free-slip to "strong" no-slip). They are handled automatically by the mask system (see \S\ref{DOM_msk}).  
    20  
    21 %OPA works with land and topography grid points in the computational domain due to the presence of continents or islands,and to the use of full or partial step representation of bottom topography. The computation is performed over the whole domain, i.e. we did not try to restrict the computation to ocean point only areas. This choice has two motivations. First, working on ocean only grid point overload the code and harms the code readability. Second,, and more importantly, it drastically reduce the vector portion of the computation, leading to a dramatic increase of CPU time requirement on vector computers. The process of defining which areas are to be masked is described in \S\ref{DOM_msk}, while this section describes how the masking affects the computation of the various terms of the equations with respect to the boundary condition at solid walls. 
    22  
    23 The discrete representation of a domain with complex boundaries (coastlines and bottom topography) leads to arrays that include large portions where a computation is not required as the model variables remain at zero. Nevertheless, vectorial supercomputers are far more efficient when computing over a whole array, and the readability of a code is greatly improved when boundary conditions are applied in an automatic way rather than by a specific computation before or after each do loop. An efficient way to work over the whole domain while specifying the boundary conditions is to use the multiplication by mask arrays in the computation. A mask array is a matrix  
    24 which elements are $1 $in the ocean domain and $0$ elsewhere. A simple multiplication of a variable by its own mask ensures that it will remain zero over land areas. Since most of the boundary conditions consist of a zero flux across the solid boundaries, they can be simply settled by  
    25 multiplying variables by the right mask arrays, i.e. the mask array of the grid point where the flux is evaluated. For example, the heat flux in the \textbf{i}-direction is evaluated at $u$-points. Evaluating this quantity as, 
     19%The lateral ocean boundary conditions contiguous to coastlines are Neumann conditions for heat and salt (no flux across boundaries) and Dirichlet conditions for momentum (ranging from free-slip to "strong" no-slip). They are handled automatically by the mask system (see \S\ref{DOM_msk}).  
     20 
     21%OPA allows land and topography grid points in the computational domain due to the presence of continents or islands, and includes the use of a full or partial step representation of bottom topography. The computation is performed over the whole domain, i.e. we do not try to restrict the computation to ocean-only points. This choice has two motivations. Firstly, working on ocean only grid points overloads the code and harms the code readability. Secondly, and more importantly, it drastically reduces the vector portion of the computation, leading to a dramatic increase of CPU time requirement on vector computers.  The current section describes how the masking affects the computation of the various terms of the equations with respect to the boundary condition at solid walls. The process of defining which areas are to be masked is described in \S\ref{DOM_msk}. 
     22 
     23The discrete representation of a domain with complex boundaries (coastlines and  
     24bottom topography) leads to arrays that include large portions where a computation  
     25is not required as the model variables remain at zero. Nevertheless, vectorial  
     26supercomputers are far more efficient when computing over a whole array, and the  
     27readability of a code is greatly improved when boundary conditions are applied in  
     28an automatic way rather than by a specific computation before or after each  
     29computational loop. An efficient way to work over the whole domain while specifying  
     30the boundary conditions, is to use multiplication by mask arrays in the computation.  
     31A mask array is a matrix whose elements are $1$ in the ocean domain and $0$  
     32elsewhere. A simple multiplication of a variable by its own mask ensures that it will  
     33remain zero over land areas. Since most of the boundary conditions consist of a  
     34zero flux across the solid boundaries, they can be simply applied by multiplying  
     35variables by the correct mask arrays, $i.e.$ the mask array of the grid point where  
     36the flux is evaluated. For example, the heat flux in the \textbf{i}-direction is evaluated  
     37at $u$-points. Evaluating this quantity as, 
    2638 
    2739\begin{equation} \label{Eq_lbc_aaaa} 
    2840\frac{A^{lT} }{e_1 }\frac{\partial T}{\partial i}\equiv \frac{A_u^{lT}  
    29 }{e_{1u} }\delta _{i+1 / 2} \left[ T \right]\;\;mask_u  
     41}{e_{1u} } \; \delta _{i+1 / 2} \left[ T \right]\;\;mask_u  
    3042\end{equation} 
    31 where mask$_{u}$ is the mask array at $u$-point, ensures that the heat flux is  
    32 zero inside land and at the boundaries as mask$_{u}$ is zero at solid  
    33 boundaries defined at $u$-points in this case (normal velocity $u$ remains zero at  
     43(where mask$_{u}$ is the mask array at a $u$-point) ensures that the heat flux is  
     44zero inside land and at the boundaries, since mask$_{u}$ is zero at solid boundaries  
     45which in this case are defined at $u$-points (normal velocity $u$ remains zero at  
    3446the coast) (Fig.~\ref{Fig_LBC_uv}).  
    3547 
     
    3749\begin{figure}[!t] \label{Fig_LBC_uv}  \begin{center} 
    3850\includegraphics[width=0.90\textwidth]{./Figures/Fig_LBC_uv.pdf} 
    39 \caption {Lateral boundary (thick line) at T-level. The velocity normal to the boundary is set to zero.} 
     51\caption {Lateral boundary (thick line) at T-level. The velocity normal to the  
     52       boundary is set to zero.} 
    4053\end{center}   \end{figure} 
    4154%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    4255 
    43 On momentum the situation is a bit more complex as two boundary conditions must be provided along the coast (one on the normal velocity and the other on the tangential velocity). The boundary of the ocean in C-grid is defined by the velocity-faces. For example, at a given $T$-level, the lateral boundary (coastline or intersection with the bottom topography) is made of segments  
    44 joining $f$-points, and normal velocity points are located between two $f-$points (Fig.~\ref{Fig_LBC_uv}). The boundary condition on the normal velocity (no flux through solid boundaries) can thus be easily settled by the mask system. The boundary condition on the tangential velocity requires a more specific treatment. It influences the relative vorticity and momentum diffusive trends, and is only required to compute the vorticity at the coast. Four different type of the lateral boundary condition are available, controlled by the value of \np{shlat} namelist parameter (which is equal to the value of the mask$_{f}$ array along the coastline): 
     56For momentum the situation is a bit more complex as two boundary conditions  
     57must be provided along the coast (one each for the normal and tangential velocities).  
     58The boundary of the ocean in the C-grid is defined by the velocity-faces.  
     59For example, at a given $T$-level, the lateral boundary (a coastline or an intersection  
     60with the bottom topography) is made of segments joining $f$-points, and normal  
     61velocity points are located between two $f-$points (Fig.~\ref{Fig_LBC_uv}).  
     62The boundary condition on the normal velocity (no flux through solid boundaries)  
     63can thus be easily implemented using the mask system. The boundary condition  
     64on the tangential velocity requires a more specific treatment. This boundary  
     65condition influences the relative vorticity and momentum diffusive trends, and is  
     66required in order to compute the vorticity at the coast. Four different types of  
     67lateral boundary condition are available, controlled by the value of the \np{shlat}  
     68namelist parameter. (The value of the mask$_{f}$ array along the coastline is set  
     69equal to this parameter.) These are: 
    4570 
    4671%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    5378\begin{description} 
    5479 
    55 \item[free-slip boundary condition (\np{shlat}=0): ]  the tangential velocity at the coastline is equal to the offshore velocity, $i.e.$ the normal derivative of the tangential velocity is zero at the coast, so the vorticity: mask$_{f}$ array is set to zero inside the land and just at the coast (Fig.~\ref{Fig_LBC_shlat}-a). 
    56  
    57 \item[no-slip boundary condition (\np{shlat}=2): ] the tangential velocity vanishes at the coastline. Assuming that the tangential velocity decreases linearly from the closest ocean velocity grid point to the coastline, the normal derivative is evaluated as if the closest land velocity gridpoint were of the same magnitude as the closest ocean velocity gridpoint but in the opposite direction (Fig.~\ref{Fig_LBC_shlat}-b). Therefore, the vorticity along the coastlines is given by:  
     80\item[free-slip boundary condition (\np{shlat}=0): ]  the tangential velocity at the  
     81coastline is equal to the offshore velocity, $i.e.$ the normal derivative of the  
     82tangential velocity is zero at the coast, so the vorticity: mask$_{f}$ array is set  
     83to zero inside the land and just at the coast (Fig.~\ref{Fig_LBC_shlat}-a). 
     84 
     85\item[no-slip boundary condition (\np{shlat}=2): ] the tangential velocity vanishes  
     86at the coastline. Assuming that the tangential velocity decreases linearly from  
     87the closest ocean velocity grid point to the coastline, the normal derivative is  
     88evaluated as if the velocities at the closest land velocity gridpoint and the closest  
     89ocean velocity gridpoint were of the same magnitude but in the opposite direction  
     90(Fig.~\ref{Fig_LBC_shlat}-b). Therefore, the vorticity along the coastlines is given by:  
     91 
    5892\begin{equation*} 
    5993\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) \ , 
    6094\end{equation*} 
    61 where $u$ and $v$ are masked fields. Setting the mask$_{f}$ array to $2$ along the coastline allows to provide a vorticity field computed with the no-slip boundary condition simply by multiplying it by the mask$_{f}$ : 
     95where $u$ and $v$ are masked fields. Setting the mask$_{f}$ array to $2$ along  
     96the coastline provides a vorticity field computed with the no-slip boundary condition,  
     97simply by multiplying it by the mask$_{f}$ : 
    6298\begin{equation} \label{Eq_lbc_bbbb} 
    6399\zeta \equiv \frac{1}{e_{1f} {\kern 1pt}e_{2f} }\left( {\delta _{i+1/2}  
     
    66102\end{equation} 
    67103 
    68 \item["partial" free-slip boundary condition (0$<$\np{shlat}$<$2): ] the tangential velocity at the coastline is smaller than the offshore velocity, $i.e.$ there is a lateral friction but not strong enough to vanish the tangential velocity at the coast (Fig.~\ref{Fig_LBC_shlat}-c). This can be settled by providing a value of mask$_{f}$ strictly inbetween $0$ and $2$. 
    69  
    70 \item["strong" no-slip boundary condition (2$<$\np{shlat}): ] the viscous boundary layer is assumed to be smaller than half the grid size (Fig.~\ref{Fig_LBC_shlat}-d). The friction is thus larger than in the no-slip case. 
     104\item["partial" free-slip boundary condition (0$<$\np{shlat}$<$2): ] the tangential  
     105velocity at the coastline is smaller than the offshore velocity, $i.e.$ there is a lateral  
     106friction but not strong enough to make the tangential velocity at the coast vanish  
     107(Fig.~\ref{Fig_LBC_shlat}-c). This can be selected by providing a value of mask$_{f}$  
     108strictly inbetween $0$ and $2$. 
     109 
     110\item["strong" no-slip boundary condition (2$<$\np{shlat}): ] the viscous boundary  
     111layer is assumed to be smaller than half the grid size (Fig.~\ref{Fig_LBC_shlat}-d).  
     112The friction is thus larger than in the no-slip case. 
    71113 
    72114\end{description} 
    73115 
    74 Note that when the bottom topography is entirely represented by the $s$-coordinates (pure $s$-coordinate), the lateral boundary condition on momentum tangential velocity is of much  little importance as it is only applied next to the coast where the minimum water depth can be quite shallow. 
    75  
    76 The alternative numerical implementation of the no-slip boundary conditions for an arbitrary coast line of \citet{Shchepetkin1996} is also available through the activation of \key{noslip\_accurate}. It is based on a fourth order evaluation of the shear at the coast which, in turn, allows a true second order scheme in the interior of the domain ($i.e.$ the numerical boundary scheme simulates the truncation error of the numerical scheme used in the interior of the domain). \citet{Shchepetkin1996} found that such a technique considerably improves the quality of the numerical solution. In \NEMO, the improvement have not been found so spectacular in the half-degree global ocean (ORCA05), but significant reduction of numerically induced coast upwellings were found in eddy resolving simulation of the Alboran Sea \citep{OlivierPh2001}. Nevertheless, as no-slip boundary condition is not recommended in eddy permitting or resolving simulation \citep{Penduff2007}, the use of this option is not recommended. 
    77  
    78 In practice, the no-slip accurate option changes the way the curl is evaluated at the coast (see \mdl{divcur} module), and requires to qualify the nature of coastline grid point (convex or concave corners, straight north-south or east-west coast) which is performed in \mdl{domask} module, \rou{dom\_msk\_nsa} routine. 
     116Note that when the bottom topography is entirely represented by the $s$-coor-dinates  
     117(pure $s$-coordinate), the lateral boundary condition on tangential velocity is of much  
     118less importance as it is only applied next to the coast where the minimum water depth  
     119can be quite shallow. 
     120 
     121The alternative numerical implementation of the no-slip boundary conditions for an  
     122arbitrary coast line of \citet{Shchepetkin1996} is also available through the  
     123\key{noslip\_accurate} CPP key. It is based on a fourth order evaluation of the shear at the  
     124coast which, in turn, allows a true second order scheme in the interior of the domain  
     125($i.e.$ the numerical boundary scheme simulates the truncation error of the numerical  
     126scheme used in the interior of the domain). \citet{Shchepetkin1996} found that such a  
     127technique considerably improves the quality of the numerical solution. In \NEMO, such  
     128spectacular improvements have not been found in the half-degree global ocean  
     129(ORCA05), but significant reductions of numerically induced coastal upwellings were  
     130found in an eddy resolving simulation of the Alboran Sea \citep{OlivierPh2001}.  
     131Nevertheless, since a no-slip boundary condition is not recommended in an eddy  
     132permitting or resolving simulation \citep{Penduff2007}, the use of this option is also  
     133not recommended. 
     134 
     135In practice, the no-slip accurate option changes the way the curl is evaluated at the  
     136coast (see \mdl{divcur} module), and requires the nature of each coastline grid point  
     137(convex or concave corners, straight north-south or east-west coast) to be specified.   
     138This is performed in routine \rou{dom\_msk\_nsa} in the \mdl{domask} module. 
    79139 
    80140% ================================================================ 
     
    92152\label{LBC_jperio012} 
    93153 
    94 The choice of closed, cyclic or symmetric model domain boundary condition is made by setting \jp{jperio} to 0, 1 or 2 in \mdl{par\_oce} file. Each time such a boundary condition is needed, it is set by a call to \mdl{lbclnk} routine. The computation of momentum and tracer trends proceed from $i=2$ to $i=jpi-1$ and from $j=2$ to $j=jpj-1$, $i.e.$in the inner model domain. To choose a lateral model boundary condition is to specify the first and last rows and columns of the model variables. 
    95  
    96 - For closed boundary (\textit{jperio=0}), solid walls are imposed at all model boundaries:  
    97 first and last rows and columns are set to zero. 
    98  
    99 - For cyclic east-west boundary (\textit{jperio=1}), first and last rows are set to zero  
    100 (closed) while first column is set to the value of the before last column  
    101 and last column to the value of the second one (Fig.~\ref{Fig_LBC_jperio}-a). Whatever flows  
    102 out of the eastern (western) end of the basin enters the western (eastern)  
    103 end. Note that there is neither option for north-south cyclic nor doubly  
     154The choice of closed, cyclic or symmetric model domain boundary condition is made  
     155by setting \jp{jperio} to 0, 1 or 2 in file \mdl{par\_oce}. Each time such a boundary  
     156condition is needed, it is set by a call to routine \mdl{lbclnk}. The computation of  
     157momentum and tracer trends proceeds from $i=2$ to $i=jpi-1$ and from $j=2$ to  
     158$j=jpj-1$, $i.e.$ in the model interior. To choose a lateral model boundary condition  
     159is to specify the first and last rows and columns of the model variables.  
     160 
     161\begin{description} 
     162 
     163\item[For closed boundary (\textit{jperio=0})], solid walls are imposed at all model  
     164boundaries: first and last rows and columns are set to zero. 
     165 
     166\item[For cyclic east-west boundary (\textit{jperio=1})], first and last rows are set  
     167to zero (closed) whilst the first column is set to the value of the last-but-one column  
     168and the last column to the value of the second one (Fig.~\ref{Fig_LBC_jperio}-a).  
     169Whatever flows out of the eastern (western) end of the basin enters the western  
     170(eastern) end. Note that there is no option for north-south cyclic or for doubly  
    104171cyclic cases. 
    105172 
    106 - For symmetric boundary condition across the equator (\textit{jperio=2}), last rows, and  
    107 first and last columns are set to zero (closed). The row of symmetry is  
    108 chosen to be the $u$- and $T-$points equator line ($j=2$, i.e. at the southern end  
    109 of the domain). For arrays defined at $u-$ or $T-$points, the first row is set to  
    110 the value of the third row while for most of $v$- and $f$-points arrays (v, $\zeta$,  
    111 $j\psi$, but scalar arrays such as eddy coefficients) the first row is set to  
    112 minus the value of the second row (Fig.~\ref{Fig_LBC_jperio}-b). Note that this boundary  
    113 condition is not yet available on massively parallel computer  
    114 (\textbf{key{\_}mpp} defined). 
     173\item[For symmetric boundary condition across the equator (\textit{jperio=2})],  
     174last rows, and first and last columns are set to zero (closed). The row of symmetry  
     175is chosen to be the $u$- and $T-$points equator line ($j=2$, i.e. at the southern  
     176end of the domain). For arrays defined at $u-$ or $T-$points, the first row is set  
     177to the value of the third row while for most of $v$- and $f$-point arrays ($v$, $\zeta$,  
     178$j\psi$, but \gmcomment{not sure why this is "but"} scalar arrays such as eddy coefficients)  
     179the first row is set to minus the value of the second row (Fig.~\ref{Fig_LBC_jperio}-b).  
     180Note that this boundary condition is not yet available for the case of a massively  
     181parallel computer (\textbf{key{\_}mpp} defined). 
     182 
     183\end{description} 
    115184 
    116185%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    143212\label{LBC_mpp} 
    144213 
    145 For massively parallel processing (mpp), a domain decomposition method is used. The basis of the method consists in splitting the large computation domain of a numerical experiment into several smaller domains and solving the set of equations by addressing independent local problems. Each processor has its own local memory and computes the model equation over a subdomain of the whole model domain. The subdomain boundary conditions are specified through communications between processors which are explicitly organized by specific statements (message passing method).  
    146  
    147 A big advantage is that the method does not need many modifications of the initial FORTRAN code. For the modeller's point of view, each sub domain running on a processor is identical to the "mono-domain" code. In addition, the programmer manages the communications between subdomains, and the code presents more scalability when the number of processors is increased. The porting of OPA code on a iPSC860 was achieved during Guyon's PhD [Guyon et al. 1994, 1995] in collaboration with CETIIS and ONERA. The implementation in the operational context and the studies of performances on a T3D and T3E Cray computers have been made in collaboration with IDRIS and CNRS. The present implementation is largely inspired from Guyon's work  [Guyon 1995]. 
    148  
    149    The parallelization strategy is defined by the physical characteristics of the ocean model. Second order finite difference schemes leads to local discrete operators that depend at the very most on one neighbouring point. The only non-local computations concerne the vertical physics (implicit diffusion, 1.5 turbulent closure scheme, ...) (delocalization over the whole water column), and the solving of the elliptic equation associated with the surface pressure gradient computation (delocalization over the whole horizontal domain). Therefore, a pencil strategy is used for the data sub-structuration: the 3D initial domain is laid out on local processor memories following a 2D horizontal topological splitting. Each sub-domain computes its own surface and bottom boundary conditions and has a side wall overlapping interface which stocks lateral boundary conditions for computations in the inner sub-domain. The overlapping area is reduced to one row. After a computation, a communication phase starts: each processor sends to its neighbouring processors the update values of the point corresponding to the overlapping area of its neighbouring sub-domain. The communication is done through message passing. Usually the parallel virtual language, PVM, is used as it is a standard language available on  nearly  all MPP cumputers. More specific languages (i.e. computer dependant languages) can be easily used to speed up the communication, such as SHEM on T3E computer. The data exchanges between processors are required at the very place where lateral domain boundary conditions are set in the mono-domain computation (\S III.10-c): the lbc\_lnk routine which manages such conditions is substituted by mpplnk.F or mpplnk2.F routine when running on MPP computer (\key{mpp\_mpi} defined). It has to be noticed that when using MPP version of the model, the east-west cyclic boundary condition is implicitly done, while the south-symmetric boundary condition option is not available. 
    150   
     214For massively parallel processing (mpp), a domain decomposition method is used.  
     215The basic idea of the method is to split the large computation domain of a numerical  
     216experiment into several smaller domains and solve the set of equations by addressing  
     217independent local problems. Each processor has its own local memory and computes  
     218the model equation over a subdomain of the whole model domain. The subdomain  
     219boundary conditions are specified through communications between processors  
     220which are organized by explicit statements (message passing method).  
     221 
     222A big advantage is that the method does not need many modifications of the initial  
     223FORTRAN code. From the modeller's point of view, each sub domain running on  
     224a processor is identical to the "mono-domain" code. In addition, the programmer  
     225manages the communications between subdomains, and the code is faster when  
     226the number of processors is increased. The porting of OPA code on an iPSC860  
     227was achieved during Guyon's PhD [Guyon et al. 1994, 1995] in collaboration with  
     228CETIIS and ONERA. The implementation in the operational context and the studies  
     229of performance on a T3D and T3E Cray computers have been made in collaboration  
     230with IDRIS and CNRS. The present implementation is largely inspired by Guyon's  
     231work  [Guyon 1995]. 
     232 
     233The parallelization strategy is defined by the physical characteristics of the  
     234ocean model. Second order finite difference schemes lead to local discrete  
     235operators that depend at the very most on one neighbouring point. The only  
     236non-local computations concern the vertical physics (implicit diffusion, 1.5  
     237turbulent closure scheme, ...) (delocalization over the whole water column),  
     238and the solving of the elliptic equation associated with the surface pressure  
     239gradient computation (delocalization over the whole horizontal domain).  
     240Therefore, a pencil strategy is used for the data sub-structuration \gmcomment{no  
     241idea what this means!}: the 3D initial domain is laid out on local processor  
     242memories following a 2D horizontal topological splitting. Each sub-domain  
     243computes its own surface and bottom boundary conditions and has a side  
     244wall overlapping interface which defines the lateral boundary conditions for  
     245computations in the inner sub-domain. The overlapping area consists of the  
     246two rows at each edge of the sub-domain. After a computation, a communication  
     247phase starts: each processor sends to its neighbouring processors the update  
     248values of the points corresponding to the interior overlapping area to its  
     249neighbouring sub-domain (i.e. the innermost of the two overlapping rows). The communication is done through message passing. Usually the parallel virtual  
     250language, PVM, is used as it is a standard language available on  nearly  all  
     251MPP computers. More specific languages (i.e. computer dependant languages)  
     252can be easily used to speed up the communication, such as SHEM on a T3E  
     253computer. The data exchanges between processors are required at the very  
     254place where lateral domain boundary conditions are set in the mono-domain  
     255computation (\S III.10-c): the lbc\_lnk routine which manages such conditions  
     256is substituted by mpplnk.F or mpplnk2.F routine when running on an MPP  
     257computer (\key{mpp\_mpi} defined). It has to be pointed out that when using  
     258the MPP version of the model, the east-west cyclic boundary condition is done  
     259implicitly, whilst the south-symmetric boundary condition option is not available. 
     260 
    151261%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    152262\begin{figure}[!t] \label{Fig_mpp}  \begin{center} 
     
    156266%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    157267 
    158    In the standard version of the OPA model, the splitting is regular and arithmetic. the i-axis is divided by \jp{jpni} and the j-axis by \jp{jpnj} for a number of processors \jp{jpnij} most often equal to $jpni \times jpnj$ (model parameters set in \mdl{par\_oce}). Each processor is independent and without message passing or synchronous process, programs run alone and access just at its own local memory. For this reason, the main model dimensions are now the local dimensions of the subdomain (pencil) that are noted \jp{jpi}, \jp{jpj}, \jp{jpk}. These dimensions include the internal domain and the overlapping rows. The number of overlapping rows is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). The whole domain dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}. The relationship between the whole domain and a sub-domain is: 
     268In the standard version of the OPA model, the splitting is regular and arithmetic. 
     269 the i-axis is divided by \jp{jpni} and the j-axis by \jp{jpnj} for a number of processors  
     270 \jp{jpnij} most often equal to $jpni \times jpnj$ (model parameters set in  
     271 \mdl{par\_oce}). Each processor is independent and without message passing  
     272 or synchronous process \gmcomment{how does a synchronous process relate to this?},  
     273 programs run alone and access just its own local memory. For this reason, the  
     274 main model dimensions are now the local dimensions of the subdomain (pencil)  
     275 that are named \jp{jpi}, \jp{jpj}, \jp{jpk}. These dimensions include the internal  
     276 domain and the overlapping rows. The number of rows to exchange (known as  
     277 the halo) is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). The whole domain  
     278 dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}. The relationship between  
     279 the whole domain and a sub-domain is: 
    159280\begin{eqnarray}  
    160281      jpi & = & ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci  \nonumber \\ 
     
    165286\colorbox{yellow}{Figure IV.3: example of a domain splitting with 9 processors and no east-west cyclic boundary conditions.} 
    166287 
    167    One defines also variables nldi and nlei which correspond to the internal domain bounds, and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain. An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$, a global array (whole domain) by the relationship:  
     288One also defines variables nldi and nlei which correspond to the internal  
     289domain bounds, and the variables nimpp and njmpp which are the position  
     290of the (1,1) grid-point in the global domain. An element of $T_{l}$, a local array  
     291(subdomain) corresponds to an element of $T_{g}$, a global array  
     292(whole domain) by the relationship:  
    168293\begin{equation} \label{Eq_lbc_nimpp} 
    169294T_{g} (i+nimpp-1,j+njmpp-1,k) = T_{l} (i,j,k), 
     
    171296with  $1 \leq i \leq jpi$, $1  \leq j \leq jpj $ , and  $1  \leq k \leq jpk$. 
    172297 
    173    Processors are numbered from 0 to $jpnij-1$, the number is saved in the variable nproc. In the standard version, a processor has no more than four neighbouring processors named nono (for north), noea (east), noso (south) and nowe (west) and two variables, nbondi and nbondj, indicate the situation of the processor \colorbox{yellow}{(see Fig.IV.3)}: 
     298Processors are numbered from 0 to $jpnij-1$, the number is saved in the variable  
     299nproc. In the standard version, a processor has no more than four neighbouring  
     300processors named nono (for north), noea (east), noso (south) and nowe (west)  
     301and two variables, nbondi and nbondj, indicate the relative position of the processor  
     302\colorbox{yellow}{(see Fig.IV.3)}: 
    174303\begin{itemize} 
    175304\item       nbondi = -1    an east neighbour, no west processor, 
     
    185314 
    186315 
    187    The OPA model computes equation terms with the help of mask arrays (0 onto land points and 1 onto sea points). It is easily readable and very efficient in the context of the vectorial architecture. Nevertheless, in the case of scalar processor, computations over the land regions becomes more expensive in term of CPU time. It is all the more so when we use a complex configuration with a realistic bathymetry like the global ocean where more than 50 \% of points are land points. For this reason, a pre-processing tool allows to search in the mpp domain decomposition strategy if a splitting can be found with a maximum number of only land points processors which could be eliminated: the mpp\_optimiz tools (available from the DRAKKAR web site). This optimisation is made with the knowledge of the specific bathymetry. The user chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with $jpnij < jpni \times jpnj$, leading to the elimination of $jpni \times jpnj - jpnij$ land processors. When those parameters are specified in module \mdl{par\_oce}, the algorithm in the \rou{inimpp2} routine set each processor name and neighbour parameters (nbound, nono, noea,...) so that the land processors are not taken into account.  
     316The OPA model computes equation terms with the help of mask arrays (0 on land  
     317points and 1 on sea points). It is easily readable and very efficient in the context of  
     318a computer with vectorial architecture. However, in the case of a scalar processor,  
     319computations over the land regions become more expensive in terms of CPU time.  
     320It is worse when we use a complex configuration with a realistic bathymetry like the  
     321global ocean where more than 50 \% of points are land points. For this reason, a  
     322pre-processing tool can be used to choose the mpp domain decomposition with a  
     323maximum number of only land points processors, which can then be eliminated.  
     324(For example, the mpp\_optimiz tools, available from the DRAKKAR web site.)  
     325This optimisation is dependent on the specific bathymetry employed. The user  
     326then chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with  
     327$jpnij < jpni \times jpnj$, leading to the elimination of $jpni \times jpnj - jpnij$  
     328land processors. When those parameters are specified in module \mdl{par\_oce},  
     329the algorithm in the \rou{inimpp2} routine sets each processor's parameters (nbound,  
     330nono, noea,...) so that the land-only processors are not taken into account.  
    188331 
    189332\colorbox{yellow}{Note that the inimpp2 routine is general so that the original inimpp routine should be suppressed from the code.} 
    190333 
    191334When land processors are eliminated, the value corresponding to these locations in the model output files is zero. Note that this is a problem for a mesh output file written by such a model configuration, because model users often divide by the scale factors ($e1t$, $e2t$, etc) and do not expect the grid size to be zero, even on land. It may be best not to eliminate land processors when running the model especially to write the mesh files as outputs (when \np{nmsh} namelist parameter differs from 0). 
     335\gmcomment{Steven : dont understand this, no land processor means no output file covering this part of globe; its only when files are stitched together into one that you can leave a hole} 
    192336 
    193337%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    194338\begin{figure}[!ht] \label{Fig_mppini2}  \begin{center} 
    195339\includegraphics[width=0.90\textwidth]{./Figures/Fig_mppini2.pdf} 
    196 \caption {Example of Atlantic domain defined for the CLIPPER projet. Initial grid is composed by 773 x 1236 horizontal points. (a) the domain is splitting onto 9 \time 20 subdomains (jpni=9, jpnj=20). 52 subdomains are land areas. (b) 52 subdomains are eliminated (white rectangles) and the resulting number of processors really used during the computation is jpnij=128.} 
     340\caption {Example of Atlantic domain defined for the CLIPPER projet. Initial grid is  
     341composed of 773 x 1236 horizontal points. (a) the domain is split onto 9 \time 20  
     342subdomains (jpni=9, jpnj=20). 52 subdomains are land areas. (b) 52 subdomains  
     343are eliminated (white rectangles) and the resulting number of processors really  
     344used during the computation is jpnij=128.} 
    197345\end{center}   \end{figure} 
    198346%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    222370\namdisplay{namobc}  
    223371 
    224 It is often necessary to implement a model configuration limited to an oceanic region or a basin, which communicates with the rest of the global ocean through  ``open boundaries''. As stated by \citet{Roed1986}, an open boundary is a computational border where the aim of the calculations is to allow the perturbations generated inside the computational domain to leave it without deterioration of the inner model solution. However, an open boundary also has to let information from the outer oceans enter the model and should support inflow and outflow conditions.  
    225  
    226 The open boundary package OBC is the first open boundary option developed in NEMO (originally in OPA8.2). It allows the user to  
     372It is often necessary to implement a model configuration limited to an oceanic  
     373region or a basin, which communicates with the rest of the global ocean through  
     374''open boundaries''. As stated by \citet{Roed1986}, an open boundary is a  
     375computational border where the aim of the calculations is to allow the perturbations  
     376generated inside the computational domain to leave it without deterioration of the  
     377inner model solution. However, an open boundary also has to let information from  
     378the outer ocean enter the model and should support inflow and outflow conditions.  
     379 
     380The open boundary package OBC is the first open boundary option developed in  
     381NEMO (originally in OPA8.2). It allows the user to  
    227382\begin{itemize} 
    228 \item tell the model that a boundary is ``open'' and not closed by a wall, for example by modifying the calculation of the divergence of velocity there, and other necessary modifications; 
     383\item tell the model that a boundary is ''open'' and not closed by a wall, for example by modifying the calculation of the divergence of velocity there; 
    229384\item impose values of tracers and velocities at that boundary (values which may be taken from a climatology): this is the``fixed OBC'' option.  
    230385\item calculate boundary values by a sophisticated algorithm combining radiation and relaxation (``radiative OBC'' option) 
    231386\end{itemize} 
    232387 
    233 The package resides in the OBC directory. It is described here in four parts: the boundary geometry (parameters to be set in \mdl{obc\_par}), the forcing data at the boundaries (module \mdl{obcdta}),  the radiation algorithm involving the namelist and module \mdl{obcrad}, and a brief presentation of boundary update and restart files. 
     388The package resides in the OBC directory. It is described here in four parts: the  
     389boundary geometry (parameters to be set in \mdl{obc\_par}), the forcing data at  
     390the boundaries (module \mdl{obcdta}),  the radiation algorithm involving the  
     391namelist and module \mdl{obcrad}, and a brief presentation of boundary update  
     392and restart files. 
    234393 
    235394%---------------------------------------------- 
     
    237396\label{OBC_geom} 
    238397% 
    239 First one has to realize that open boundaries may not necessarily be located at the extremities of the computational domain. They may exist in the middle of the domain, for example at Gibraltar Straits if one wants to avoid including the Mediterranean in an Atlantic domain. This flexibility has been found necessary for the CLIPPER project \citep{Treguier2001}. Because of the complexity of the geometry of ocean basins, it may even be necessary to have more than one ``west'' open boundary, more than one ``north'', etc. This is not possible with the OBC option: only one open boundary of each kind, west, east, south and north is allowed; those names refer to the grid geometry (not to the direction of the geographical ``west'', ``east'', etc). 
    240  
    241 The open boundary geometry is set by a series of parameters in the module \mdl{obc\_par}. For an eastern open boundary, parameters are \jp{lp\_obc\_east} (true if an east open boundary exists), \jp{jpieob} the $i$-index along which the eastern open boundary (eob) is located, \jp{jpjed} the $j$-index at which it starts, and \jp{jpjef} the $j$-index where it ends (note $d$ is for ``d\'{e}but'' and $f$ for ``fin'' in French). Similar parameters exist for the west, south and north cases (Table~\ref{Tab_obc_param}). 
     398First one has to realize that open boundaries may not necessarily be located  
     399at the extremities of the computational domain. They may exist in the middle  
     400of the domain, for example at Gibraltar Straits if one wants to avoid including  
     401the Mediterranean in an Atlantic domain. This flexibility has been found necessary  
     402for the CLIPPER project \citep{Treguier2001}. Because of the complexity of the  
     403geometry of ocean basins, it may even be necessary to have more than one  
     404''west'' open boundary, more than one ''north'', etc. This is not possible with  
     405the OBC option: only one open boundary of each kind, west, east, south and  
     406north is allowed; these names refer to the grid geometry (not to the direction  
     407of the geographical ''west'', ''east'', etc). 
     408 
     409The open boundary geometry is set by a series of parameters in the module  
     410\mdl{obc\_par}. For an eastern open boundary, parameters are \jp{lp\_obc\_east}  
     411(true if an east open boundary exists), \jp{jpieob} the $i$-index along which  
     412the eastern open boundary (eob) is located, \jp{jpjed} the $j$-index at which  
     413it starts, and \jp{jpjef} the $j$-index where it ends (note $d$ is for ''d\'{e}but''  
     414and $f$ for ''fin'' in French). Similar parameters exist for the west, south and  
     415north cases (Table~\ref{Tab_obc_param}). 
    242416 
    243417 
     
    265439\end{tabular} 
    266440\end{center} 
    267 \caption{Names of different indices concerning the open boundaries. In the case of a completely open ocean domain with four ocean boundaries, the parameters take exactly the values indicated.} 
     441\caption{Names of different indices relating to the open boundaries. In the case  
     442of a completely open ocean domain with four ocean boundaries, the parameters  
     443take exactly the values indicated.} 
    268444\end{table} 
    269445 
    270 The open boundaries must be along coordinate lines. On the C-grid, the boundary itself is along a line of normal velocity points: $v$ points for a zonal open boundary (the south or north one), and $u$ points for a meridional open boundary (the west or east one). Another constraint is that there still must be a row of masked points all around the domain, as if the domain were a closed basin (unless periodic conditions are used together with open boundary conditions). Therefore, an open boundary cannot be located at the first/last index, namely, 1 or \jp{jpiglo}, \jp{jpjglo}. Also, the open boundary algorithm involves calculating the normal velocity points situated just on the boundary, as well as the tangential velocity and temperature, salinity just outside the boundary. This means that for a west/south boundary, normal velocities and temperature are calculated at the same index \jp{jpiwob} and \jp{jpjsob}, respectively. For an east/north boundary, the normal velocity is calculated at index \jp{jpieob} and \jp{jpjnob}, but the ``outside'' temperature is at index \jp{jpieob}+1 and \jp{jpjnob}+1. This means that \jp{jpieob}, \jp{jpjnob} cannot be bigger than \jp{jpiglo}-2, \jp{jpjglo}-2.  
    271  
    272  
    273 The starting and ending indices are to be thought as $T$ point indices: in many cases they indicate the first land $T$-point, at the extremity of an open boundary (the coast line follows the $f$ grid points, see Fig.~\ref{Fig_obc_north} for the example for a northern open boundary. All indices are relative to the global domain. In the free surface case it is possible to have ``ocean corners'', that is, an open boundary starting and ending in the ocean. 
     446The open boundaries must be along coordinate lines. On the C-grid, the boundary  
     447itself is along a line of normal velocity points: $v$ points for a zonal open boundary  
     448(the south or north one), and $u$ points for a meridional open boundary (the west  
     449or east one). Another constraint is that there still must be a row of masked points  
     450all around the domain, as if the domain were a closed basin (unless periodic conditions  
     451are used together with open boundary conditions). Therefore, an open boundary  
     452cannot be located at the first/last index, namely, 1, \jp{jpiglo} or \jp{jpjglo}. Also,  
     453the open boundary algorithm involves calculating the normal velocity points situated  
     454just on the boundary, as well as the tangential velocity and temperature and salinity  
     455just outside the boundary. This means that for a west/south boundary, normal  
     456velocities and temperature are calculated at the same index \jp{jpiwob} and  
     457\jp{jpjsob}, respectively. For an east/north boundary, the normal velocity is  
     458calculated at index \jp{jpieob} and \jp{jpjnob}, but the ``outside'' temperature is  
     459at index \jp{jpieob}+1 and \jp{jpjnob}+1. This means that \jp{jpieob}, \jp{jpjnob}  
     460cannot be bigger than \jp{jpiglo}-2, \jp{jpjglo}-2.  
     461 
     462 
     463The starting and ending indices are to be thought of as $T$ point indices: in many  
     464cases they indicate the first land $T$-point, at the extremity of an open boundary  
     465(the coast line follows the $f$ grid points, see Fig.~\ref{Fig_obc_north} for an example  
     466of a northern open boundary). All indices are relative to the global domain. In the  
     467free surface case it is possible to have ``ocean corners'', that is, an open boundary  
     468starting and ending in the ocean. 
    274469 
    275470%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    281476%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    282477 
    283 Although not absolutely compulsory, it is highly recommended that the bathymetry in the vicinity of an open boundary follows the following rule: in the direction perpendicular to the open line, the water depth should be constant for 4 grid points. This is in order to ensure that the radiation condition, which involves mdoel variables next to the boundary, is calculated in a consistent way. On Fig.\ref{Fig_obc_north} we indicate by a $=$ symbol, the points which should have the same depth. It means that in the 4 points near the boundary, the bathymetry is cylindrical. The line behind the open T-line must be 0 in the bathymetry file (as shown on Fig.\ref{Fig_obc_north} for example). 
     478Although not compulsory, it is highly recommended that the bathymetry in the  
     479vicinity of an open boundary follows the following rule: in the direction perpendicular  
     480to the open line, the water depth should be constant for 4 grid points. This is in  
     481order to ensure that the radiation condition, which involves model variables next  
     482to the boundary, is calculated in a consistent way. On Fig.\ref{Fig_obc_north} we  
     483indicate by an $=$ symbol, the points which should have the same depth. It means  
     484that at the 4 points near the boundary, the bathymetry is cylindrical \gmcomment{not sure  
     485why cylindrical}. The line behind the open $T$-line must be 0 in the bathymetry file  
     486(as shown on Fig.\ref{Fig_obc_north} for example). 
    284487 
    285488%---------------------------------------------- 
     
    287490\label{OBC_data} 
    288491 
    289 It is necessary to provide information at the boundaries. The simple case happens when this information does not change in time and is equal to the initial conditions (namelist variable \np{nobc\_dta}=0). This is the case of the standard configuration EEL5 with open boundaries. When (\np{nobc\_dta}=1), open boundary information is read from netcdf files. For convenience the input files are supposed to be similar to the ''history'' NEMO output files, for dimension names and variable names.  
    290 Open boundary arrays must be dimensioned according to the parameters of table~\ref{Tab_obc_param}: for example, at the western boundary arrays have a dimension of \jp{jpwf}-\jp{jpwd}+1 on the horizontal and \jp{jpk} on the vertical.  
    291  
    292 When ocean observations are used to generate the boundary data (a hydrographic section for example, as in \citet{Treguier2001}) it happens often that only the velocity normal to the boundary is known, which is the reason why the initial OBC code assumes that only $T$, $S$, and the normal velocity ($u$ or $v$) needs to be specified. As more and more global model solutions and ocean analysis products are available, it is possible to provide information about all the variables (including the tangential velocity) so that the specification of four variables at each boundaries will soon become standard. Regarding the sea surface height, one must distinguish the filtered free surface case from the time-splitting or explicit treatment of the free surface. 
    293  In the first case, it is assumed that the user does not wish to represent high frequency motions such as tides. The boundary condition is thus one of zero normal gradient of sea surface height at the open boundaries, following \citet{Marchesiello2001}.  
    294 No information other than the total velocity needs to be provided at the open boundaries in that case. In the other two cases (time stplitting or explicit free surface), the user must provides barotropic information (sea surface height and barotropic velocities) and the use of the Flather algorithm for barotropic variables is recommanded. However, this algorithm has not yet been fully tested and bugs remain in NEMO v2.3. Users should read the code carefully before using it. Finally, in the case of the rigid lid approximation the barotropic streamfunction must be provided, as documented in \citet{Treguier2001}). This option is no longer used but remains in NEMO V2.3. 
    295  
    296 One frequently encountered case is when an open boundary domain is constructed from a global or larger scale NEMO configuration. Assuming the domain corresponds to indices $ib:ie$, $jb:je$ of the global domain, the bathymetry and forcing of the small domain can be created by using the following command on the global files: ncks -F $-d\;x,ib,ie$ $-d\;y,jb,je$.  
    297 The open boundary files can be constructed using ncks commands, following table~\ref{Tab_obc_ind}.  
     492It is necessary to provide information at the boundaries. The simplest case is  
     493when this information does not change in time and is equal to the initial conditions  
     494(namelist variable \np{nobc\_dta}=0). This is the case for the standard configuration  
     495EEL5 with open boundaries. When (\np{nobc\_dta}=1), open boundary information  
     496is read from netcdf files. For convenience the input files are supposed to be similar  
     497to the ''history'' NEMO output files, for dimension names and variable names.  
     498Open boundary arrays must be dimensioned according to the parameters of table~ 
     499\ref{Tab_obc_param}: for example, at the western boundary, arrays have a  
     500dimension of \jp{jpwf}-\jp{jpwd}+1 in the horizontal and \jp{jpk} in the vertical.  
     501 
     502When ocean observations are used to generate the boundary data (a hydrographic  
     503section for example, as in \citet{Treguier2001}) it happens often that only the velocity  
     504normal to the boundary is known, which is the reason why the initial OBC code  
     505assumes that only $T$, $S$, and the normal velocity ($u$ or $v$) needs to be  
     506specified. As more and more global model solutions and ocean analysis products  
     507become available, it will be possible to provide information about all the variables  
     508(including the tangential velocity) so that the specification of four variables at each  
     509boundaries will become standard. For the sea surface height, one must distinguish  
     510between the filtered free surface case and the time-splitting or explicit treatment of  
     511the free surface. 
     512 In the first case, it is assumed that the user does not wish to represent high  
     513 frequency motions such as tides. The boundary condition is thus one of zero  
     514 normal gradient of sea surface height at the open boundaries, following \citet{Marchesiello2001}.  
     515No information other than the total velocity needs to be provided at the open  
     516boundaries in that case. In the other two cases (time splitting or explicit free surface),  
     517the user must provide barotropic information (sea surface height and barotropic  
     518velocities) and the use of the Flather algorithm for barotropic variables is  
     519recommanded. However, this algorithm has not yet been fully tested and bugs  
     520remain in NEMO v2.3. Users should read the code carefully before using it. Finally,  
     521in the case of the rigid lid approximation the barotropic streamfunction must be  
     522provided, as documented in \citet{Treguier2001}). This option is no longer  
     523recommended but remains in NEMO V2.3. 
     524 
     525One frequently encountered case is when an open boundary domain is constructed  
     526from a global or larger scale NEMO configuration. Assuming the domain corresponds  
     527to indices $ib:ie$, $jb:je$ of the global domain, the bathymetry and forcing of the  
     528small domain can be created by using the following netcdf utility on the global files:  
     529ncks -F $-d\;x,ib,ie$ $-d\;y,jb,je$ (part of the nco series of utilities, see http://nco.sourceforge.net). The open boundary files can be constructed using ncks  
     530commands, following table~\ref{Tab_obc_ind}.  
    298531 
    299532%--------------------------------------------------TABLE-------------------------------------------------- 
     
    322555\end{tabular} 
    323556\end{center} 
    324 \caption{Indications for creating open boundary files from a global configuration, appropriate for the subdomain of indices $ib:ie$, $jb:je$. ``Index'' designates the $i$ or $j$ index along which the $u$ of $v$ boundary point is situated in the global configuration, starting and ending with the $j$ or $i$ indices indicated. For example, to generate file obcnorth\_V.nc, use the command ncks $-F$ $-d\;y,je-2$  $-d\;x,ib+1,ie-1$ }  
     557\caption{Requirements for creating open boundary files from a global configuration,  
     558appropriate for the subdomain of indices $ib:ie$, $jb:je$. ``Index'' designates the  
     559$i$ or $j$ index along which the $u$ of $v$ boundary point is situated in the global  
     560configuration, starting and ending with the $j$ or $i$ indices indicated.  
     561For example, to generate file obcnorth\_V.nc, use the command ncks  
     562$-F$ $-d\;y,je-2$  $-d\;x,ib+1,ie-1$ }  
    325563\end{table} 
    326564 
    327 It is assumed that the open boundary files contain the variables for the period of the model integration. If the boundary files contain one time frame, the boundary data is held fixed in time. If the files contain 12 values, it is assumed that the input is a climatology for a repeated annual cycle (corresponding to the case \np{ln\_obc\_clim} = .T.). The case of an arbitrary number of time frames is not yet implemented correctly; the user is supposed to write his own code in the module \mdl{obc\_dta} to deal with this situation.  
     565It is assumed that the open boundary files contain the variables for the period of  
     566the model integration. If the boundary files contain one time frame, the boundary  
     567data is held fixed in time. If the files contain 12 values, it is assumed that the input  
     568is a climatology for a repeated annual cycle (corresponding to the case \np{ln\_obc\_clim}  
     569= .True.). The case of an arbitrary number of time frames is not yet implemented  
     570correctly; the user is required to write his own code in the module \mdl{obc\_dta}  
     571to deal with this situation.  
    328572 
    329573\subsection{Radiation algorithm} 
    330574\label{OBC_rad} 
    331575 
    332 The art of open boundary management consists in applying a constraint strong enough so that the inner domain "feels" the rest of the ocean, but not too strong  
    333 in order to allow perturbations to leave the domain with minimum false reflexions of energy. The cosntraint to the specified boundary data is set by time scales  
    334 specified separately for each boundary and for ``inflow'' and `outflow'' conditions as defined below. These time scales are set (in days) by namelist parameters such as \np{rdpein}, \np{rdpeob} for the eastern open boundary, for example. When both time scales are zero for a given boundary, for example  
    335 \jp{lp\_obc\_west}=.T., \np{rdpwob}=0, \np{rdpwin}=0, this means that the boundary in question (western boundary here) is a ``fixed '' boundary where the solution is set exactly by the boundary data. This is not recommanded, excepted in compination with increased viscosity in a ``sponge'' layer next to the boundary in order to avois spurious reflexions.   
    336  
    337  
    338 The radiation\/relaxation algorithm is applied when either relxation time (for ``inflow'' or `outflow'') is nonzero. It has been developed and tested in the SPEM model and its successor ROMS \citep{Barnier1996, Marchesiello2001}, a $s$-coordinate model on an Arakawa C-grid. Although the algorithm has been numerically successful in the CLIPPER Atlantic models, the physics do not work as expected \citep{Treguier2001}. Users are invited to consider open boundary conditions (OBC hereafter) with some skepticism \citep{Durran2001, Blayo2005}. 
    339  
    340 The first part of the algorithm consists in calculating a phase 
    341 velocity to determine whether perturbations tend to propagate toward, 
    342 or away from, the boundary.  
    343 Let us consider a model variable $\phi$.  
    344 The phase velocity ($C_{\phi x}$,$C_{\phi y}$) for the variable  
    345 $\phi$, in the directions normal and tangential to 
    346 the boundary is 
     576The art of open boundary management consists in applying a constraint strong  
     577enough that the inner domain "feels" the rest of the ocean, but weak enough 
     578that perturbations are allowed to leave the domain with minimum false reflections  
     579of energy. The constraints are specified separately at each boundary as time  
     580scales for ''inflow'' and ''outflow'' as defined below. The time scales are set (in days)  
     581by namelist parameters such as \np{rdpein}, \np{rdpeob} for the eastern open  
     582boundary for example. When both time scales are zero for a given boundary  
     583($e.g.$ for the western boundary, \jp{lp\_obc\_west}=.True., \np{rdpwob}=0 and  
     584\np{rdpwin}=0) this means that the boundary in question is a ''fixed '' boundary  
     585where the solution is set exactly by the boundary data. This is not recommended,  
     586except in combination with increased viscosity in a ''sponge'' layer next to the  
     587boundary in order to avoid spurious reflections.   
     588 
     589 
     590The radiation\/relaxation \gmcomment{the / doesnt seem to appear in the output}  
     591algorithm is applied when either relaxation time (for ''inflow'' or ''outflow'') is  
     592non-zero. It has been developed and tested in the SPEM model and its  
     593successor ROMS \citep{Barnier1996, Marchesiello2001}, which is an  
     594$s$-coordinate model on an Arakawa C-grid. Although the algorithm has  
     595been numerically successful in the CLIPPER Atlantic models, the physics  
     596do not work as expected \citep{Treguier2001}. Users are invited to consider  
     597open boundary conditions (OBC hereafter) with some scepticism  
     598\citep{Durran2001, Blayo2005}. 
     599 
     600The first part of the algorithm calculates a phase velocity to determine  
     601whether perturbations tend to propagate toward, or away from, the  
     602boundary. Let us consider a model variable $\phi$.  
     603The phase velocities ($C_{\phi x}$,$C_{\phi y}$) for the variable $\phi$,  
     604in the directions normal and tangential to the boundary are 
    347605\begin{equation} \label{Eq_obc_cphi} 
    348606C_{\phi x} = \frac{ -\phi_{t} }{ ( \phi_{x}^{2} + \phi_{y}^{2}) } \phi_{x}  
     
    350608C_{\phi y} = \frac{ -\phi_{t} }{ ( \phi_{x}^{2} + \phi_{y}^{2}) } \phi_{y}.  
    351609\end{equation} 
    352 Following \citet{Treguier2001} and \citet{Marchesiello2001} retain only the normal 
    353 projection of the total velocity, $C_{\phi x}$, setting 
    354 $C_{\phi y} =0$ (but unlike the original Orlanski radiation algorithm we retain $\phi_{y}$ in the expression 
    355 for $C_{\phi x}$).   
     610Following \citet{Treguier2001} and \citet{Marchesiello2001} we retain only  
     611the normal component of the velocity, $C_{\phi x}$, setting $C_{\phi y} =0$  
     612(but unlike the original Orlanski radiation algorithm we retain $\phi_{y}$ in  
     613the expression for $C_{\phi x}$).   
    356614 
    357615The discrete form of (\ref{Eq_obc_cphi}), described by \citet{Barnier1998}, 
    358616takes into account the two rows of grid points situated inside the domain  
    359617next to the boundary, and the three previous time steps ($n$, $n-1$, 
    360 and $n-2$).  
    361 The same equation can then be discretized at the boundary at 
    362 time steps $n$ and $n+1$ in order to extrapolate the new boundary 
    363 value $\phi^{n+1}$.  
    364  
    365 In the present open boundary algorithm, the new boundary values are  
    366 updated differently according to the sign of $C_{\phi x}$. 
    367 Let us take an East boundary as an example. The solution for variable $\phi$ at the boundary is given from a generalized wave equation  
    368 with phase velocity $C_{\phi}$, with the addition of  a relaxation term: 
     618and $n-2$). The same equation can then be discretized at the boundary at 
     619time steps $n-1$, $n$ and $n+1$ \gmcomment{since the original was three time-level}  
     620in order to extrapolate for the new boundary value $\phi^{n+1}$.  
     621 
     622In the open boundary algorithm as implemented in NEMO v2.3, the new boundary  
     623values are updated differently depending on the sign of $C_{\phi x}$. Let us take  
     624an eastern boundary as an example. The solution for variable $\phi$ at the  
     625boundary is given by a generalized wave equation with phase velocity $C_{\phi}$,  
     626with the addition of a relaxation term, as: 
    369627\begin{eqnarray} 
    370628\phi_{t} &  =  & -C_{\phi x} \phi_{x} + \frac{1}{\tau_{o}} (\phi_{c}-\phi)  
     
    373631\;\;\; \;\;\; \;\;\;\;\;\; (C_{\phi x} < 0), \label{Eq_obc_radi} 
    374632\end{eqnarray} 
    375 where $\phi_{c}$ is the estimate of $\phi$ at the boundary, provided as boundary data.  
    376 Note that in (\ref{Eq_obc_rado}), $C_{\phi x}$ 
    377 is bounded by the ratio $\delta x/\delta t$ for stability reasons.  
    378 When $C_{\phi x}$ is eastward (outward propagation),  
    379 the radiation condition (\ref{Eq_obc_rado}) is used.  
    380 When  $C_{\phi x}$ is westward (inward propagation), (\ref{Eq_obc_radi}) is used with 
    381 a strong relaxation to climatology (usually $\tau_{i}=\np{rdpein}=$1~day). 
    382 The time derivative in (\ref{Eq_obc_radi}) is calculated with a Euler time-stepping 
    383 scheme. It results from this choice that setting 
    384 $\tau_{i}$ smaller than, or equal to the time step is in fact equivalent to a fixed boundary condition; 
    385 a time scale of one day is usually a good compromise which guarantees that the inflow conditions remain close to  
    386 climatology while ensuring numerical stability.  
    387  
    388 In  the case of a west boundary located in the Eastern Atlantic, \citet{Penduff2000} have been able to implement the radiation algorithm  
    389 without any boundary data, using persistence from the previous time step instead. This solution did not work in other cases \citep{Treguier2001} so that the use of boundary data is recommended.   
    390 Even in the outflow condition (\ref{Eq_obc_rado}), we have found desireable to maintain a weak relaxation to climatology.  
    391 The time step is usually chosen so as to be larger than typical turbulent scales (of order 1000~days). 
    392  
    393 The radiation condition is applied to the different model variables: temperature, salinity, tangential and normal velocities.  
    394 For normal and tangential velocities $u$ and $v$ radiation is applied with phase velocities calculated from $u$ and $v$ respectively.  
    395 For the radiation of tracers, we use the phase velocity calculated from the tangential velocity, to avoid calculating too many independent  
    396 radiation velocities and because tangential velocities and tracers have the same position along the boundary on a C grid.   
     633where $\phi_{c}$ is the estimate of $\phi$ at the boundary, provided as boundary  
     634data. Note that in (\ref{Eq_obc_rado}), $C_{\phi x}$ is bounded by the ratio  
     635$\delta x/\delta t$ for stability reasons. When $C_{\phi x}$ is eastward (outward  
     636propagation), the radiation condition (\ref{Eq_obc_rado}) is used.  
     637When  $C_{\phi x}$ is westward (inward propagation), (\ref{Eq_obc_radi}) is  
     638used with a strong relaxation to climatology (usually $\tau_{i}=\np{rdpein}=$1~day). 
     639Equation (\ref{Eq_obc_radi}) is solved with a Euler time-stepping scheme. As a  
     640consequence, setting $\tau_{i}$ smaller than, or equal to the time step is equivalent  
     641to a fixed boundary condition. A time scale of one day is usually a good compromise  
     642which guarantees that the inflow conditions remain close to climatology while ensuring  
     643numerical stability.  
     644 
     645In  the case of a western boundary located in the Eastern Atlantic, \citet{Penduff2000}  
     646have been able to implement the radiation algorithm without any boundary data,  
     647using persistence from the previous time step instead. This solution has not worked  
     648in other cases \citep{Treguier2001}, so that the use of boundary data is recommended.  
     649Even in the outflow condition (\ref{Eq_obc_rado}), we have found it desirable to  
     650maintain a weak relaxation to climatology. The time step is usually chosen so as to  
     651be larger than typical turbulent scales (of order 1000~days \gmcomment{or maybe seconds?}). 
     652 
     653The radiation condition is applied to the model variables: temperature, salinity,  
     654tangential and normal velocities. For normal and tangential velocities, $u$ and $v$,  
     655radiation is applied with phase velocities calculated from $u$ and $v$ respectively.   
     656For the radiation of tracers, we use the phase velocity calculated from the tangential  
     657velocity in order to avoid calculating too many independent radiation velocities and  
     658because tangential velocities and tracers have the same position along the boundary  
     659on a C-grid.   
    397660 
    398661\subsection{Domain decomposition (\key{mpp\_mpi})} 
    399662\label{OBC_mpp} 
    400 When \key{mpp\_mpi} is active in the code, the computational domain is divided into rectangles that are attributed each to a different processor. The open boundary code is ``mpp-compatible'' up to a certain point. The radiation algorithm will not work if there is a mpp subdomain boundary parallel to the open boundary at the index of the boundary, or the grid point after (outside), or three grid points before (inside). On the other hand, there is no problem if a mpp subdomain boundary cuts the open boundary perpendicularly. Those geometry constraints must be checked by the user (there is no safeguard in the code).   
    401 The general principle for the open boundary mpp code is that loops over the open boundaries are performed on local indices (nie0, nie1, nje0, nje1 for the eastern boundary for instance) that are initialized in module \mdl{obc\_ini}. Those indices have relevant values on the processors that contain a segment of an open boundary. For processors that do not include an open boundary segment, the indices are such that the calculations within the loops are not performed. 
     663When \key{mpp\_mpi} is active in the code, the computational domain is divided  
     664into rectangles that are attributed each to a different processor. The open boundary  
     665code is ``mpp-compatible'' up to a certain point. The radiation algorithm will not  
     666work if there is an mpp subdomain boundary parallel to the open boundary at the  
     667index of the boundary, or the grid point after (outside), or three grid points before  
     668(inside). On the other hand, there is no problem if an mpp subdomain boundary  
     669cuts the open boundary perpendicularly. These geometrical limitations must be  
     670checked for by the user (there is no safeguard in the code).   
     671The general principle for the open boundary mpp code is that loops over the open  
     672boundaries {not sure what this means} are performed on local indices (nie0,  
     673nie1, nje0, nje1 for an eastern boundary for instance) that are initialized in module  
     674\mdl{obc\_ini}. Those indices have relevant values on the processors that contain  
     675a segment of an open boundary. For processors that do not include an open  
     676boundary segment, the indices are such that the calculations within the loops are  
     677not performed. 
     678\gmcomment{I dont understand most of the last few sentences} 
    402679  
    403 Arrays of climatological data that are read in files are seen by all processors and have the same dimensions for all (for instance, for the eastern boundary, uedta(jpjglo,jpk,2)). On the other hand, the arrays for the calculation of radiation are local to each processor (uebnd(jpj,jpk,3,3) for instance).  This allowed to spare memory in the CLIPPER model, where the eastern boundary crossed 8 processors so that \jp{jpj} was must smaller than (\jp{jpjef}-\jp{jpjed}+1).  
     680Arrays of climatological data that are read from files are seen by all processors  
     681and have the same dimensions for all (for instance, for the eastern boundary,  
     682uedta(jpjglo,jpk,2)). On the other hand, the arrays for the calculation of radiation  
     683are local to each processor (uebnd(jpj,jpk,3,3) for instance).  This allowed the  
     684CLIPPER model for example, to save on memory where the eastern boundary  
     685crossed 8 processors so that \jp{jpj} was much smaller than (\jp{jpjef}-\jp{jpjed}+1).  
    404686 
    405687\subsection{Volume conservation} 
    406688\label{OBC_vol} 
    407689 
    408 It is necessary to control the volume inside a domain with open boundaries. With fixed boundaries, it is enough to ensure that the total inflow/outflow has reasonable values (either zero or a value compatible with an observed volume balance). When using radiative boundary conditions it is necessary to have a volume constraint because each open boundary works independently from the others. The methodology used to control this volume is identical to the one coded in the ROMS model \citep{Marchesiello2001}. 
     690It is necessary to control the volume inside a domain when using open boundaries.  
     691With fixed boundaries, it is enough to ensure that the total inflow/outflow has  
     692reasonable values (either zero or a value compatible with an observed volume  
     693balance). When using radiative boundary conditions it is necessary to have a  
     694volume constraint because each open boundary works independently from the  
     695others. The methodology used to control this volume is identical to the one  
     696coded in the ROMS model \citep{Marchesiello2001}. 
    409697 
    410698 
  • trunk/DOC/TexFiles/Chapters/Chap_MISC.tex

    r817 r994  
    1313 
    1414% In climate modeling, it is often necessary to allow water masses that are separated by land to exchange properties. This situation arises in models when the grid mesh is too coarse to resolve narrow passageways that in reality provide crucial connections between water masses. For example, coarse grid spacing typically closes off the Mediterranean from the Atlantic at the Straits of Gibraltar. In this case, it is important for climate models to include the effects of salty water entering the Atlantic from the Mediterranean. Likewise, it is important for the Mediterranean to replenish its supply of water from the Atlantic to balance the net evaporation occurring over the Mediterranean region.  
    15 % also same problem as soon as important straits are not properly resolve by the mesh. For example in ORCA 1/4\r{}, this occors in several straits of the Indonesian archipelagos (Ombai, Lombok...). 
    16 % We describe here the three methods that can be used in NEMO to handle such unproperly resolved straits.  
    17 %The communication consists of mixing tracers and mass/volume between non-adjacent water columns. Momentum is not mixed. The scheme conserves total tracer content, and total volume (the latter in $z*$- or $s*$-coordinate), and maintains compatibility between the tracer and mass/volume budgets.   
    18  
    19 % Note: such changes are so specific to a given configuration that no attempt have been made to set them in a generic way. Nevertheless, example of how they can be set up is given in the ORCA2 configuration (\key{ORCA_R2}). 
     15% Same problem occurs as soon as important straits are not properly resolved by the mesh. For example it arises in ORCA 1/4\r{} in several straits of the Indonesian archipelago (Ombai, Lombok...). 
     16% We describe here the three methods that can be used in \NEMO to handle such improperly resolved straits.  
     17%The problem is resolved here by allowing the mixing of tracers and mass/volume between non-adjacent water columns at nominated regions within the model. Momentum is not mixed. The scheme conserves total tracer content, and total volume (the latter in $z*$- or $s*$-coordinate), and maintains compatibility between the tracer and mass/volume budgets.   
     18 
     19% Note: such changes are so specific to a given configuration that no attempt has been made to set them in a generic way. Nevertheless, an example of how they can be set up is given in the ORCA2 configuration (\key{ORCA_R2}). 
    2020 
    2121% ------------------------------------------------------------------------------------------------------------- 
     
    2727$\bullet$ reduced scale factor, also called partially open face (Hallberg, personnal communication 2006) 
    2828%also called partially open cell  or partial closed cells 
    29 $\bullet$ increase of the viscous boundary layer by local increase of the fmask value at the coast 
     29 
     30$\bullet$ increase of the viscous boundary layer thickness by local increase of the fmask value at the coast 
    3031 
    3132\colorbox{yellow}{Add a short description of scale factor changes staff and fmask increase} 
     
    3637\includegraphics[width=0.80\textwidth]{./Figures/Fig_Gibraltar.pdf} 
    3738\includegraphics[width=0.80\textwidth]{./Figures/Fig_Gibraltar2.pdf} 
    38 \caption {Example of the Gibraltar strait defined in a 1\r{} x 1\r{} mesh. \textit{Top}: using partially open cells. The meridional scale factor at $V$-point is reduced on both sides of the strait to account for the real width of the strait (about 20 km). Note that the scale factors of the strait $T$-point remains unchanged. \textit{Bottom}: using viscous boundary layers. The four fmask along the strait coastlines are set to a value larger than 4, $i.e.$ "strong" no-slip case (see Fig.\ref{Fig_LBC_shlat}) creating a large viscous boundary layer that allows a reduced transport through the strait.} 
     39\caption {Example of the Gibraltar strait defined in a 1\r{} x 1\r{} mesh.  
     40\textit{Top}: using partially open cells. The meridional scale factor at $v$-point  
     41is reduced on both sides of the strait to account for the real width of the strait  
     42(about 20 km). Note that the scale factors of the strait $T$-point remains unchanged. \textit{Bottom}: using viscous boundary layers. The four fmask parameters  
     43along the strait coastlines are set to a value larger than 4, $i.e.$ "strong" no-slip  
     44case (see Fig.\ref{Fig_LBC_shlat}) creating a large viscous boundary layer  
     45that allows a reduced transport through the strait.} 
    3946\end{center}   \end{figure} 
    4047%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    6572\label{MISC_zoom} 
    6673 
    67 The sub-domain functionality, also improperly called zoom option (improperly because it is not associated with a change in model resolution) is a quite simple function that allows to  
    68 perform a simulation over a sub-domain of an already defined configuration  
    69 (i.e. without defining a new set of mesh, initial state and forcings). This  
    70 option can be useful for testing the user setting of surface boundary  
    71 conditions, or the initial ocean state of a huge ocean model configuration  
    72 while having a small central memory requirement. It can also be used to  
    73 easily test specific physics in a sub-domain (for example, test of the  
    74 coupling between sea-ice and ocean model over the Arctic or Antarctic ocean  
    75 as they are set in the global ocean version of OPA \citep{Madec1996}.  
    76 In standard, this option does not include any specific treatment for ocean  
    77 boundaries of the sub-domain: they are considered as artificial vertical  
    78 walls. Nevertheless, it is quite easy to add a restoring term toward a  
    79 climatology in the vicinity of those boundaries (see \S\ref{TRA_dmp}). 
     74The sub-domain functionality, also improperly called the zoom option  
     75(improperly because it is not associated with a change in model resolution)  
     76is a quite simple function that allows a simulation over a sub-domain of an  
     77already defined configuration ($i.e.$ without defining a new mesh, initial  
     78state and forcings). This option can be useful for testing the user settings  
     79of surface boundary conditions, or the initial ocean state of a huge ocean  
     80model configuration while having a small computer memory requirement.  
     81It can also be used to easily test specific physics in a sub-domain (for example,  
     82see \citep{Madec1996} for a test of the coupling used in the global ocean  
     83version of OPA between sea-ice and ocean model over the Arctic or Antarctic  
     84ocean, using a sub-domain). In the standard model, this option does not  
     85include any specific treatment for the ocean boundaries of the sub-domain:  
     86they are considered as artificial vertical walls. Nevertheless, it is quite easy  
     87to add a restoring term toward a climatology in the vicinity of such boundaries  
     88(see \S\ref{TRA_dmp}). 
    8089 
    8190In order to easily define a sub-domain over which the computation can be  
    8291performed, the dimension of all input arrays (ocean mesh, bathymetry,  
    83 forcing, initial state, ...) are defined as \jp{jpidta}, \jp{jpjdta} and \jp{jpkdta} (\mdl{par\_oce} module), while the  
    84 computational domain is defined through \jp{jpiglo}, \jp{jpjglo} and \jp{jpk} (\mdl{par\_oce} module). When running the model  
    85 over the whole configuration, the user set \jp{jpiglo}=\jp{jpidta} \jp{jpjglo}=\jp{jpjdta }and \jp{jpk}=\jp{jpkdta}. When running the model  
    86 over a sub-domain, the user have to provide the size of the sub-domain,  
    87 (\jp{jpiglo}, \jp{jpjglo}, \jp{jpkglo}), and the indices of the south western corner as \jp{jpizoom} and \jp{jpjzoom} in the \mdl{par\_oce} module (Fig.~\ref{Fig_LBC_zoom}).  
    88  
    89 Note that a third set of dimension exist, \jp{jpi}, \jp{jpj} and \jp{jpk} which is actually used to  
    90 perform the computation. It is set by default to \jp{jpi}=\jp{jpjglo} and \jp{jpj}=\jp{jpjglo}, except for massively  
    91 parallel computing where the computational domain is laid out on local  
    92 processor memories following a 2D horizontal splitting (see {\S}IV.2-c) 
     92forcing, initial state, ...) are defined as \jp{jpidta}, \jp{jpjdta} and \jp{jpkdta}  
     93(\mdl{par\_oce} module), while the computational domain is defined through  
     94\jp{jpiglo}, \jp{jpjglo} and \jp{jpk} (\mdl{par\_oce} module). When running the  
     95model over the whole domain, the user sets \jp{jpiglo}=\jp{jpidta} \jp{jpjglo}=\jp{jpjdta}  
     96and \jp{jpk}=\jp{jpkdta}. When running the model over a sub-domain, the user  
     97has to provide the size of the sub-domain, (\jp{jpiglo}, \jp{jpjglo}, \jp{jpkglo}),  
     98and the indices of the south western corner as \jp{jpizoom} and \jp{jpjzoom} in  
     99the \mdl{par\_oce} module (Fig.~\ref{Fig_LBC_zoom}).  
     100 
     101Note that a third set of dimensions exist, \jp{jpi}, \jp{jpj} and \jp{jpk} which is  
     102actually used to perform the computation. It is set by default to \jp{jpi}=\jp{jpjglo}  
     103and \jp{jpj}=\jp{jpjglo}, except for massively parallel computing where the  
     104computational domain is laid out on local processor memories following a 2D  
     105horizontal splitting. % (see {\S}IV.2-c) ref to the section to be updated 
    93106 
    94107%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    95108\begin{figure}[!ht] \label{Fig_LBC_zoom}  \begin{center} 
    96109\includegraphics[width=0.90\textwidth]{./Figures/Fig_LBC_zoom.pdf} 
    97 \caption {position of a model domain compared to the data input domain when the zoom functionality is used.} 
     110\caption {Position of a model domain compared to the data input domain when the zoom functionality is used.} 
    98111\end{center}   \end{figure} 
    99112%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    106119\label{MISC_1D} 
    107120 
    108 The 1D model is a stand alone water column based on the 3D NEMO system. It can be applied to the ocean alone or to the ocean-ice system and can include passive tracers or a biogeochemical model. It is set up by defining the \key{cfg\_1d} CPP key. This 1D model is a very useful tool  \textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes ; \textit{(b)} to investigate suitable parameterizations of unresolved turbulence (wind steering, langmuir circulation, skin layers) ; \textit{(c)} to compare the behaviour of different mixing vertical scheme  ; \textit{(d)} to perform sensitivity study to the vertical diffusion on a particular point of the ocean global domain ; \textit{(d)} to access to specific diagnostics, aside from the standard model variables,  because of having small in core memory requirement. 
    109  
    110 The methodology is based on the use of the zoom functionality (see \S\ref{MISC_zoom}), and the addition of some specific routines. There is no need of defining a new set of mesh, bathymetry, initial state and forcing, as the 1D model will use those of the configuration it is a zoom of.  
    111  
    112   
     121The 1D model option simulates a stand alone water column within the 3D \NEMO  
     122system. It can be applied to the ocean alone or to the ocean-ice system and can  
     123include passive tracers or a biogeochemical model. It is set up by defining the  
     124\key{cfg\_1d} CPP key. This 1D model is a very useful tool  \textit{(a)} to learn  
     125about the physics and numerical treatment of vertical mixing processes ; \textit{(b)}  
     126to investigate suitable parameterizations of unresolved turbulence (wind steering,  
     127langmuir circulation, skin layers) ; \textit{(c)} to compare the behaviour of different  
     128vertical mixing schemes  ; \textit{(d)} to perform sensitivity studies on the vertical  
     129diffusion at a particular point of the ocean global domain ; \textit{(d)} to produce  
     130extra diagnostics, without the large memory requirement of the full 3D model. 
     131 
     132The methodology is based on the use of the zoom functionality (see  
     133\S\ref{MISC_zoom}), with some extra routines. There is no need to define a new  
     134mesh, bathymetry, initial state or forcing, since the 1D model will use those of the  
     135configuration it is a zoom of.  
    113136 
    114137% ================================================================ 
     
    121144%-------------------------------------------------------------------------------------------------------------- 
    122145 
     146% Steven update just bellow...   not sure it  is what I vant to say 
     147%Searching an equilibrium state with an ocean model requires repeated very long time  
     148%integrations (each of a few thousand years for a global model). Due to the size of  
    123149Searching an equilibrium state with an ocean model requires very long time  
    124150integration (a few thousand years for a global model). Due to the size of  
    125 the time step required for numerical stability consideration (less than a  
    126 few hours), this is usually requires a large elapse time. In order overcome  
    127 this problem, \citet{Bryan1984} introduces a technique that allows to accelerate  
    128 the spin up to the equilibrium. It consists in using a larger time step in  
     151the time step required for numerical stability (less than a  
     152few hours), this usually requires a large elapsed time. In order to overcome  
     153this problem, \citet{Bryan1984} introduces a technique that is intended to accelerate  
     154the spin up to equilibrium. It uses a larger time step in  
    129155the thermodynamic evolution equations than in the dynamic evolution  
    130156equations. It does not affect the equilibrium solution but modifies the  
    131157trajectory to reach it. 
    132158 
    133 The acceleration of convergence is used when \np{nn\_acc}=1. In that case, $\Delta t=rdt$ is  
    134 the time step of dynamics while $\widetilde{\Delta t}=rdttra$ is the tracer time-step. Both are settled from \np{rdt} and \np{rdttra}  namelist parameters. The set of prognostic equations to solve becomes: 
     159The acceleration of convergence option is used when \np{nn\_acc}=1. In that case,  
     160$\Delta t=rdt$ is the time step of dynamics while $\widetilde{\Delta t}=rdttra$ is the  
     161tracer time-step. Their values are set from the \np{rdt} and \np{rdttra}  namelist  
     162parameters. The set of prognostic equations to solve becomes: 
    135163\begin{equation} \label{Eq_acc} 
    136164\begin{split} 
     
    142170\end{equation} 
    143171 
    144 \citet{Bryan1984} has analysed the consequences of this distorted physics. Free  
    145 waves have a slower phase speed, their meridional structure is slightly  
     172\citet{Bryan1984} has examined the consequences of this distorted physics.  
     173Free waves have a slower phase speed, their meridional structure is slightly  
    146174modified, and the growth rate of baroclinically unstable waves is reduced  
    147 but there is a wider range of instability. This technique is efficient for  
    148 searching an equilibrium state in coarse resolution models. However its  
     175but with a wider range of instability. This technique is efficient for  
     176searching for an equilibrium state in coarse resolution models. However its  
    149177application is not suitable for many oceanic problems: it cannot be used for  
    150178transient or time evolving problems (in particular, it is very questionable  
    151 to keep this technique when using a seasonal cycle in the forcing fields),  
     179to use this technique when there is a seasonal cycle in the forcing fields),  
    152180and it cannot be used in high-resolution models where baroclinically  
    153181unstable processes are important. Moreover, the vertical variation of  
    154 $\Delta \tilde {t}$ implies that the heat and salt contents are no more  
     182$\widetilde{ \Delta t}$ implies that the heat and salt contents are no longer  
    155183conserved due to the vertical coupling of the ocean level through both  
    156184advection and diffusion. 
     185% first mention of depth varying tilda-delta-t!   and namelist parameter associated to that are to be described 
    157186 
    158187 
     
    160189% Model optimisation, Control Print and Benchmark 
    161190% ================================================================ 
    162 \section{Model optimisation, Control Print and Benchmark} 
     191\section{Model Optimisation, Control Print and Benchmark} 
    163192\label{MISC_opt} 
    164193%--------------------------------------------namdom------------------------------------------------------- 
     
    166195%-------------------------------------------------------------------------------------------------------------- 
    167196 
    168 Three points to be described here: 
     197% \gmcomment{why not make these bullets into subsections?} 
     198 
     199Three issues to be described here: 
    169200 
    170201$\bullet$ Vector and memory optimisation: 
    171202 
    172  \key{vectopt\_loop} enable the internal loop collapse, a very efficient way to increase the length of vector and thus speed up the model on vector computers. 
     203\key{vectopt\_loop} enables internal loop collapse, a very efficient way to increase  
     204the length of vector calculations and thus speed up the model on vector computers. 
    173205  
    174  Add here also one word on NPROMA technique that has been found useless, since compiler have made significant progress during the last decade. 
     206% Add here also one word on NPROMA technique that has been found useless, since compiler have made significant progress during the last decade. 
    175207  
    176  Add also one word on NEC specific optimisation (Novercheck option for example) 
    177  
    178  \key{vectopt\_memory} has been introduced in order to reduce the memory requirement of the model. This is obviously done by incresing the CPU time requirement, as it suppress intermediate computation saved in in-core memory. This possibility have not been intensively used. In fact up to now, it only concern the TKE physics, in which,  when \key{vectopt\_memory} is defined, the coefficient used for horizontal smoothing of $A_v^T$ and $A_v^m$ are no more computed once for all. This reduces the memory requirement by three 2D arrays. 
     208% Add also one word on NEC specific optimisation (Novercheck option for example) 
     209 
     210\key{vectopt\_memory} has been introduced in order to reduce the memory  
     211requirement of the model. This is obviously done at the cost of increasing the  
     212CPU time requirement, since it suppress intermediate computations which would  
     213have been saved in in-core memory. This feature has not been intensively used.  
     214In fact, currently it is only implemented for the TKE physics, in which,  when  
     215\key{vectopt\_memory} is defined, the coefficients used for horizontal smoothing  
     216of $A_v^T$ and $A_v^m$ are no longer computed once and for all. This reduces  
     217the memory requirement by three 2D arrays. 
     218 
    179219  
    180 $\bullet$ Control print: describe here 4 things: 
    181  
    182 1- \np{ln\_ctl} : compute and print the inner domain averaged trends in all TRA, DYN LDF and ZDF modules. Very useful to detect the origin of an undesired change in model results.  
    183  
    184 2- also \np{ln\_ctl} but using the nictl. njctl. namelist parameters to check the origin of differences between mono and multi processor 
    185  
    186 3- \key{esopa} (to be rename key\_nemo) : also a option of model management. When defined, this key force the activation of all options and CPP keys. For example, all the tracer and momentum advection scheme are called ! There is therefore no physical meaning associated with model results. In fact, this option allows both the compilator and the model run to go through all the Fortran lines of the model. This allows to check is there is obvious compilation or running bugs for CPP options, and running bugs for namelist options. 
    187  
    188 5- last digit comparison (\np{nbit\_cmp}). In MPP simulation, the computation of sum of the whole domain is performed as the sum over all processors of the sum of the inner domain of each processor. This double sum nevr give exactly the same result as a single sum over the whole domain, due to truncature differences. The "bit comparison" option has been introduced in order to be able to check that mono-processor and multi-processor give exactly the same results.  
    189  
    190  
    191 $\bullet$  Benchmark (\np{nbench}). This option, defines a benchmark run based on GYRE configuration in which the resolution remains the same whatever the domain size is. This allows to run very large model domain by just changing the domain size (\jp{jpiglo}, \jp{jpjglo}) without adjusting neither the time-step nor the physical parametrisations.  
     220$\bullet$ Control print %: describe here 4 things: 
     221 
     2221- \np{ln\_ctl} : compute and print the trends averaged over the interior domain  
     223in all TRA, DYN, LDF and ZDF modules. This option is very helpful when  
     224diagnosing the origin of an undesired change in model results.  
     225 
     2262- also \np{ln\_ctl} but using the nictl and njctl namelist parameters to check  
     227the source of differences between mono and multi processor runs. 
     228 
     2293- \key{esopa} (to be rename key\_nemo) : which is another option for model  
     230management. When defined, this key forces the activation of all options and  
     231CPP keys. For example, all tracer and momentum advection schemes are called!  
     232There is therefore no physical meaning associated with the model results.  
     233However, this option forces both the compiler and the model to run through  
     234all the \textsc{Fortran} lines of the model. This allows the user to check for obvious  
     235compilation or execution errors with all CPP options, and errors in namelist options. 
     236 
     2373- \key{esopa} (to be rename key\_nemo) : which is another option for model  
     238management. When defined, this key forces the activation of all options and CPP keys.  
     239For example, all tracer and momentum advection schemes are called! There is  
     240therefore no physical meaning associated with the model results. However, this option  
     241forces both the compiler and the model to run through all the Fortran lines of the model.  
     242This allows the user to check for obvious compilation or execution errors with all CPP  
     243options, and errors in namelist options. 
     244 
     2454- last digit comparison (\np{nbit\_cmp}). In an MPP simulation, the computation of  
     246a sum over the whole domain is performed as the summation over all processors of  
     247each of their sums over their interior domains. This double sum never gives exactly  
     248the same result as a single sum over the whole domain, due to truncation differences.  
     249The "bit comparison" option has been introduced in order to be able to check that  
     250mono-processor and multi-processor runs give exactly the same results.  
     251 
     252$\bullet$  Benchmark (\np{nbench}). This option defines a benchmark run based on  
     253a GYRE configuration in which the resolution remains the same whatever the domain  
     254size. This allows a very large model domain to be used, just by changing the domain  
     255size (\jp{jpiglo}, \jp{jpjglo}) and without adjusting either the time-step or the physical  
     256parameterizations.  
    192257 
    193258 
     
    202267 
    203268The computation of the surface pressure gradient with a rigid lid assumption  
    204 requires to compute $\partial_t \psi$, the time evolution of the  
    205 barotropic streamfunction. $\partial_t \psi$ is solution of an elliptic  
    206 equation (I.2.4) for which two solvers are available, a  
    207 Successive-Over-Relaxation (SOR) or a preconditioned conjugate gradient  
    208 (PCG) \citep{Madec1988, Madec1990}. The PCG is a very efficient  
    209 method for solving elliptic equations on vector computers. It is a fast and  
    210 rather easy to use method, which is an attractive feature for a large number  
    211 of ocean situations (variable bottom topography, complex coastal geometry,  
    212 variable grid spacing, islands, open or cyclic boundaries, etc ...). It does  
    213 not require the search of an optimal parameter as in the SOR method.  
    214 Nevertheless, the SOR has been kept because it is a linear solver, a very  
    215 useful property when using the adjoint model of OPA. 
    216  
    217 The surface pressure gradient is computed in \mdl{dynspg}. The  
    218 default option is the use of PCG or SOR  
    219 depending on \np{nsolv} (namelist parameter).  
     269requires the computation of $\partial_t \psi$, the time evolution of the  
     270barotropic streamfunction. $\partial_t \psi$ is the solution of an elliptic  
     271equation \eqref{Eq_PE_psi} for which three solvers are available: a  
     272Successive-Over-Relaxation scheme (SOR), a preconditioned conjugate gradient  
     273scheme(PCG) \citep{Madec1988, Madec1990} and a Finite Elements Tearing and  
     274Interconnecting scheme (FETI) \citep{Guyon_al_EP99, Guyon_al_CalPar99}.  
     275The PCG is a very efficient method for solving elliptic equations on vector computers.  
     276It is a fast and rather easy method to use; which are attractive features for a large  
     277number of ocean situations (variable bottom topography, complex coastal geometry,  
     278variable grid spacing, islands, open or cyclic boundaries, etc ...). It does not require  
     279a search for an optimal parameter as in the SOR method. However, the SOR has  
     280been retained because it is a linear solver, which is a very useful property when  
     281using the adjoint model of \NEMO. The FETI solver is a very efficient method on  
     282massively parallel computers. However, it has never been used since OPA 8.0.  
     283The current version in \NEMO should not even successfully go through the  
     284compilation phase.  
     285 
     286The surface pressure gradient is computed in \mdl{dynspg}. The solver used  
     287(PCG or SOR) depending on the value of \np{nsolv} (namelist parameter).  
    220288At each time step the time derivative of the barotropic streamfunction is  
    221 the solution of (II.2.3). Introducing the following coefficients: 
     289the solution of \eqref{Eq_psi_total}. Introducing the following coefficients: 
    222290 
    223291\begin{equation}  
     
    229297\end{equation} 
    230298 
    231 the five-point finite difference equivalent equation (II.2.3) can be rewritten as: 
     299the five-point finite difference equation \eqref{Eq_psi_total} can be rewritten as: 
    232300 
    233301\begin{multline} \label{Eq_solmat} 
     
    257325\textbf{A}). (VII.5.1) can be rewritten as: 
    258326 
    259 \begin{multline}  
     327\begin{multline} \label{Eq_solmat_p} 
    260328    A_{i,j}^{N}  {   \left(  \frac{\partial \psi}{\partial t } \right)    }_{i+1,j   }  
    261329+\,A_{i,j}^{E}  {   \left(  \frac{\partial \psi}{\partial t } \right)    }_{i    ,j+1}       \\ 
     
    266334 
    267335The SOR method used is an iterative method. Its algorithm can be summarised  
    268 as follows [see \citet{Haltiner1980} for further discussion]: 
    269  
    270 initialisation (evaluate a first guess from former time step computations) 
     336as follows [see \citet{Haltiner1980} for a further discussion]: 
     337 
     338initialisation (evaluate a first guess from previous time step computations) 
    271339\begin{equation} 
    272340\left(  \frac{\partial \psi}{\partial t } \right)_{i,j}^0 = 2{\left(  \frac{\partial \psi}{\partial t } \right)_{i,j}^t} - {\left(  \frac{\partial \psi}{\partial t } \right)_{i,j}^{t-1}} 
    273341\end{equation} 
    274 iteration $n,$ from $n=0 $until convergence, do : 
     342iteration $n$, from $n=0$ until convergence, do : 
    275343\begin{multline}  
    276344R_{i,j}^n 
     
    286354  + \omega \;R_{i,j}^n 
    287355\end{equation} 
    288 where \textit{$\omega $ }satisfies $1\leq \omega \leq 2$. An optimal value exists for \textit{$\omega $ }which  
    289 accelerates significantly the convergence, but it has to be adjusted  
    290 empirically for each model domain, except for an uniform grid where an  
    291 analytical expression for \textit{$\omega $ }can be found \citep{Richtmyer1967}. This  
    292 parameter is defined as \textit{sor}, a \textbf{namelist} parameter. The convergence test is of the form: 
     356where \textit{$\omega $ }satisfies $1\leq \omega \leq 2$. An optimal value exists for  
     357\textit{$\omega$} which significantly accelerates the convergence, but it has to be  
     358adjusted empirically for each model domain (except for a uniform grid where an  
     359analytical expression for \textit{$\omega$} can be found \citep{Richtmyer1967}).  
     360The value of $\omega$ is set using \textit{sor}, a \textbf{namelist} parameter.  
     361The convergence test is of the form: 
    293362\begin{equation} 
    294363\delta = \frac{\sum\limits_{i,j}{R_{i,j}^n}{R_{i,j}^n}}{\sum\limits_{i,j}{ \tilde B_{i,j}^n}{\tilde B_{i,j}^n}} \leq \epsilon 
    295364\end{equation} 
    296 where $\epsilon $ is the absolute precision that is required. It is highly recommended  
    297 to use a $\epsilon $ smaller or equal to $10^{-2}$ as larger values may leads  
    298 to numerically induced basin scale barotropic oscillations, and to use a two  
    299 or three order of magnitude smaller value in eddy resolving configuration.  
    300 The precision of the solver is not only a numerical parameter, but  
    301 influences the physics. Indeed, the zero change of kinetic energy due to the  
    302 work of surface pressure forces in rigid-lid approximation is only achieved  
    303 at the precision demanded on the solver ({\S}~C.1-e). The precision is  
    304 specified by setting \textit{eps} (\textbf{namelist parameter}). In addition, two other tests are used to stop the iterative  
    305 algorithm. They concern the number of iterations and the module of the right  
    306 hand side. If the former exceeds a specified value, \textit{nmax} (\textbf{namelist parameter}), or the latter is greater than  
    307 $10^{15}$, the whole model computation is stopped while the last  
    308 computed time step fields are saved in the standard output file. In both  
    309 cases, this usually indicates that there is something wrong in the model  
    310 configuration (error in the mesh, the initial state, the input forcing, or  
    311 the magnitude of the time step or of the mixing coefficients). A typical  
    312 value of $nmax$ is a few hundred for $\epsilon = 10^{-2}$, increasing to a few  
    313 thousand for $\epsilon = 10^{-12}$. 
    314  
    315 The vectorization of the SOR algorithm is not straightforward. (VII.5.4)  
    316 contains two linear recurrences on $i$ and $j$. This inhibits the vectorisation  
    317 ({\S}~IV.2-a). Therefore (VII.5.4a) has been rewritten as: 
     365where $\epsilon$ is the absolute precision that is required. It is recommended  
     366that a value smaller or equal to $10^{-3}$ is used for $\epsilon$ since larger  
     367values may lead to numerically induced basin scale barotropic oscillations. In fact,  
     368for an eddy resolving configuration or in a filtered free surface case, a value three  
     369orders of magnitude smaller than this should be used. The precision is specified by  
     370setting \textit{eps} (\textbf{namelist parameter}). In addition, two other tests are  
     371used to halt the iterative algorithm. They involve the number of iterations and the  
     372modulus of the right hand side. If the former exceeds a specified value, \textit{nmax}  
     373(\textbf{namelist parameter}), or the latter is greater than $10^{15}$, the whole  
     374model computation is stopped and the last computed time step fields are saved  
     375in the standard output file. In both cases, this usually indicates that there is something  
     376wrong in the model configuration (an error in the mesh, the initial state, the input forcing,  
     377or the magnitude of the time step or of the mixing coefficients). A typical value of  
     378$nmax$ is a few hundred when $\epsilon = 10^{-6}$, increasing to a few  
     379thousand when $\epsilon = 10^{-12}$. 
     380The vectorization of the SOR algorithm is not straightforward. The scheme 
     381contains two linear recurrences on $i$ and $j$. This inhibits the vectorisation.  
     382Therefore it has been rewritten as: 
    318383 
    319384\begin{multline}  
     
    334399\end{equation} 
    335400 
    336 If the three equations in (VII.5.6) are solved inside the same do-loop,  
    337 (VII.5.4a) and (VII.5.6) are strictly equivalent. In the model they are  
    338 solved successively over the whole domain. The convergence is slower but  
    339 (VII.5.6a) and (VII.5.6b) are vector loops on $i$-index (the inner loop) and  
    340 (VII.5.6c) is adapted to Cray vector computers by using a routine from the  
    341 Cray library (namely the FOLR routine) to solve the first-order linear  
    342 recurrence. The SOR method is very flexible and can be used under a wide  
     401The SOR method is very flexible and can be used under a wide  
    343402range of conditions, including irregular boundaries, interior boundary  
    344403points, etc. Proofs of convergence, etc. may be found in the standard  
    345 numerical methods texts for partial equations. 
     404numerical methods texts for partial differential equations. 
    346405 
    347406% ------------------------------------------------------------------------------------------------------------- 
     
    356415 
    357416\textbf{A} is a definite positive symmetric matrix, thus solving the linear  
    358 system (VII.5.1) is equivalent to the minimisation of a quadratic  
     417system \eqref{Eq_solmat} is equivalent to the minimisation of a quadratic  
    359418functional: 
    360419\begin{equation*} 
     
    364423\end{equation*} 
    365424where $\langle , \rangle$ is the canonical dot product. The idea of the  
    366 conjugate gradient method is to search the solution in the following  
    367 iterative way: assuming that $\textbf{x}^n$ is obtained, $\textbf{x}^{n+1}$ is searched under the form $\textbf {x}^{n+1}={\textbf {x}}^n+\alpha^n{\textbf {d}}^n$ which satisfies: 
     425conjugate gradient method is to search for the solution in the following  
     426iterative way: assuming that $\textbf{x}^n$ has been obtained, $\textbf{x}^{n+1}$  
     427is found from $\textbf {x}^{n+1}={\textbf {x}}^n+\alpha^n{\textbf {d}}^n$ which satisfies: 
    368428\begin{equation*} 
    369 {\textbf{ x}}^{n+1}=\text{inf} _{{\textbf{ y}}={\textbf{ x}}^n+\alpha \,{\textbf{ d}}^n} \,\phi ({\textbf{ y}})\;\;\Leftrightarrow \;\;\frac{d\phi }{d\alpha}=0 
     429{\textbf{ x}}^{n+1}=\text{inf} _{{\textbf{ y}}={\textbf{ x}}^n+\alpha^n \,{\textbf{ d}}^n} \,\phi ({\textbf{ y}})\;\;\Leftrightarrow \;\;\frac{d\phi }{d\alpha}=0 
    370430\end{equation*} 
    371431and expressing $\phi (\textbf{y})$ as a function of \textit{$\alpha $}, we obtain the value that minimises the functional:  
     
    373433\alpha ^n = \langle{ \textbf{r}^n , \textbf{r}^n} \rangle  / \langle {\textbf{ A d}^n, \textbf{d}^n} \rangle 
    374434\end{equation*} 
    375 where $\textbf{r}^n = \textbf{b}-\textbf{A x}^n = \textbf{A} (\textbf{x}-\textbf{x}^n)$ is the error at rank $n$. The choice of the descent vector $\textbf{d}^n$ depends on the error: $\textbf{d}^n = \textbf{r}^n + \beta^n \,\textbf{d}^{n-1}$. $\beta ^n$ is searched such that the descent vectors form an orthogonal base for the dot product linked to \textbf{A}. Expressing the condition  
     435where $\textbf{r}^n = \textbf{b}-\textbf{A x}^n = \textbf{A} (\textbf{x}-\textbf{x}^n)$  
     436is the error at rank $n$. The descent vector $\textbf{d}^n$ s chosen to be dependent  
     437on the error: $\textbf{d}^n = \textbf{r}^n + \beta^n \,\textbf{d}^{n-1}$. $\beta ^n$  
     438is searched such that the descent vectors form an orthogonal basis for the dot  
     439product linked to \textbf{A}. Expressing the condition  
    376440$\langle \textbf{A d}^n, \textbf{d}^{n-1} \rangle = 0$ the value of $\beta ^n$ is found: 
    377  $\beta ^n = \langle{ \textbf{r}^n , \textbf{r}^n} \rangle  / \langle {\textbf{r}^{n-1}, \textbf{r}^{n-1}} \rangle$. As a result, the errors $ \textbf{r}^n$ form an orthogonal base  
    378 for the canonic dot product while the descent vectors $\textbf{d}^n$ form  
     441 $\beta ^n = \langle{ \textbf{r}^n , \textbf{r}^n} \rangle  / \langle {\textbf{r}^{n-1}, \textbf{r}^{n-1}} \rangle$. As a result, the errors $ \textbf{r}^n$ form an orthogonal  
     442base for the canonic dot product while the descent vectors $\textbf{d}^n$ form  
    379443an orthogonal base for the dot product linked to \textbf{A}. The resulting  
    380444algorithm is thus the following one: 
    381445 
    382446initialisation : 
    383  
    384447 
    385448\begin{equation*}  
     
    415478\end{equation} 
    416479where $\epsilon $ is the absolute precision that is required. As for the SOR algorithm,  
    417 both the PCG algorithm and the whole model computation are stopped when the  
    418 number of iteration, $nmax$, or the module of the right hand side exceeds a  
    419 specified value (see {\S}~VII.5-a for further discussion). The precision and  
    420 the maximum number of iteration are specified by setting $eps$ and $nmax$ (\textbf{namelist parameters}). 
    421  
    422 It can be demonstrated that the algorithm is optimal, provides the exact  
     480the whole model computation is stopped when the number of iterations, $nmax$, or  
     481the modulus of the right hand side of the convergence equation exceeds a  
     482specified value (see \S\ref{MISC_solsor} for a further discussion). The required  
     483precision and the maximum number of iterations allowed are specified by setting  
     484$eps$ and $nmax$ (\textbf{namelist parameters}). 
     485 
     486It can be demonstrated that the above algorithm is optimal, provides the exact  
    423487solution in a number of iterations equal to the size of the matrix, and that  
    424 the convergence rate is all the more fast as the matrix is closed to  
    425 identity (i.e. the eigen values are closed to 1). Therefore, it is more  
    426 efficient to solve a better conditioned system which has the same solution.  
    427 For that purpose, we introduce a preconditioning matrix \textbf{Q  
    428 }which is an approximation of \textbf{A} but much easier to invert  
    429 than \textbf{A} and solve the system: 
    430 \begin{equation}  
     488the convergence rate is faster as the matrix is closer to the identity matrix, 
     489$i.e.$ its eigenvalues are closer to 1. Therefore, it is more efficient to solve a  
     490better conditioned system which has the same solution. For that purpose, we  
     491introduce a preconditioning matrix \textbf{Q} which is an approximation of  
     492\textbf{A} but much easier to invert than \textbf{A}, and solve the system: 
     493\begin{equation} \label{Eq_pmat} 
    431494\textbf{Q}^{-1} \textbf{A x} = \textbf{Q}^{-1} \textbf{b} 
    432495\end{equation} 
    433496 
    434 The same algorithm can be used to solve (VII.5.7) if instead of the  
    435 canonical dot product the following one is used: ${\langle{ \textbf{a} , \textbf{b}} \rangle}_Q = \langle{ \textbf{a} , \textbf{Q b}} \rangle$, and if $\textbf{\~{b}} = \textbf{Q}^{-1}\;\textbf{b}$ and $\textbf{\~{A}} = \textbf{Q}^{-1}\;\textbf{A}$ are substituted to \textbf{b} and \textbf{A} \citep{Madec1988}. In OPA, \textbf{Q} is chosen as the diagonal  
    436 of\textbf{ A}, i.e. the simplest form for \textbf{Q} so that it can be  
    437 easily inverted. In this case, the discrete formulation of (VII.5.8) is in  
    438 fact given by (VII.5.2) and thus the matrix and right hand side are computed  
    439 independently from the solver used. 
     497The same algorithm can be used to solve \eqref{Eq_pmat} if instead of the  
     498canonical dot product the following one is used:  
     499${\langle{ \textbf{a} , \textbf{b}} \rangle}_Q = \langle{ \textbf{a} , \textbf{Q b}} \rangle$,  
     500and if $\textbf{\~{b}} = \textbf{Q}^{-1}\;\textbf{b}$ and $\textbf{\~{A}} = \textbf{Q}^{-1}\;\textbf{A}$ are substituted to \textbf{b} and \textbf{A} \citep{Madec1988}.  
     501In \NEMO, \textbf{Q} is chosen as the diagonal of \textbf{ A}, i.e. the simplest form for \textbf{Q} so that it can be easily inverted. In this case, the discrete formulation of  
     502\eqref{Eq_pmat} is in fact given by \eqref{Eq_solmat_p} and thus the matrix and  
     503right hand side are computed independently from the solver used. 
    440504 
    441505% ------------------------------------------------------------------------------------------------------------- 
     
    445509\label{MISC_solfeti} 
    446510 
    447 FETI is a powerfull solver that was developed by Marc Guyon (ref !!!).  It as been just converted from Fortan 77 to 90, but never successfully tested after that. Since then, nobody has found enough time to further investigate the implmenntationof FETI and debug it. 
    448  
    449 Its main advantaged is to save a lot of CPU time compared to SOR or PCG algorithm. Nevertheless, its main drawbacks is that the solution is depends on the domain decomposition chosen. Using a different number of processors, the solution is the same at the precision required, but not the same at the computer precision. This make it hard to debug.   
     511FETI is a powerful solver that was developed by Marc Guyon  \citep{Guyon_al_EP99,  
     512Guyon_al_CalPar99}. It has been converted from Fortan 77 to 90, but never  
     513successfully tested after that.  
     514 
     515Its main advantage is to save a lot of CPU time when compared to the SOR or PCG  
     516algorithms. However, its main drawback is that the solution is dependent on the  
     517domain decomposition chosen. Using a different number of processors, the solution  
     518is the same at the precision required, but not the same at the computer precision.  
     519This make it hard to debug.   
    450520 
    451521% ------------------------------------------------------------------------------------------------------------- 
     
    455525\label{MISC_solisl} 
    456526 
    457 The boundary condition used for both solvers is that the time derivative of  
    458 the barotropic streamfunction is zero along all the coastlines. When islands  
    459 are present in the model domain, additional computations must be done to  
    460 determine the barotropic streamfunction with the correct boundary  
     527The boundary condition used for both recommended solvers is that the time  
     528derivative of the barotropic streamfunction is zero along all the coastlines.  
     529When islands are present in the model domain, additional computations must  
     530be performed to determine the barotropic streamfunction with the correct boundary  
    461531conditions. This is detailed below. 
    462532 
    463 The model does not recognise itself the islands which must be defined using  
    464 bathymetry information, i.e. $mbathy$ array, equals $-1$ over the first island, $-2$ over  
    465 the second, ... , $-N$ over the $N^{th}$ island (see {\S}~VII.2-b). The model  
    466 determines the position of island grid-points and defines a closed contour  
    467 around each island which will be used to compute the circulation around each  
    468 island. The closed contour is formed of the ocean grid-points which are the  
    469 closest to the island. 
    470  
    471 First, the island barotropic streamfunctions $\psi_n$ are computed  
    472 using the PCG (they are solutions of (VII.5.1) with the right-hand side  
    473 equals to zero and with $\psi_n = 1$ along the island $n$ and $\psi_n = 0$ along the other coastlines) (Note that specifying $1$ as boundary  
    474 condition on an island for $\psi$ is equivalent to define a  
    475 specific right hand side for (VII.5.1)~). The precision of this computation  
    476 can be very high since it is done once. The absolute precision, $epsisl$, and the  
    477 maximum number of iteration, $nmisl$, are the \textbf{namelist parameters} used for that  
    478 computation. Their typical values are $epsisl = 10^{-10}$ and $nmisl = 4000$. Then the island matrix A is computed from (I.2.8) and reversed. At  
    479 each time step, $\psi_0$, the solution of (I.2.4) with $\psi_0 = 0$ along all coastlines, is computed using either SOR or PCG. It has to  
    480 be noted that the first guess of this computation is defined as in (VII.5.3)  
    481 except that $\partial_t \psi_0$ is used, not $\partial_t \psi$. Indeed we are  
    482 computing $\partial_t \psi_0$ which is usually far different from $\partial_t \psi$. Then, it is easy to find the time evolution of the barotropic  
    483 streamfunction on each island and to deduce $\partial_t \psi$ using (I.2.9)  
    484 in order to compute the surface pressure gradient. Note that the value of  
    485 the barotropic streamfunction itself is also computed as the time  
    486 integration of $\partial_t \psi$ for further diagnostics. 
     533The model does not have specialised code for islands. They must instead be  
     534identified to the solvers by the user via bathymetry information, i.e. the $mbathy$  
     535array should equal $-1$ over the first island, $-2$ over the second, ... , $-N$ over  
     536the $N^{th}$ island. The model determines the position of island grid-points and  
     537defines a closed contour around each island which is used to compute the circulation  
     538around each one. The closed contour is formed from the ocean grid-points which  
     539are the closest to the island. 
     540 
     541First, the island barotropic streamfunctions $\psi_n$ are computed using the SOR  
     542or PCG scheme (they are solutions of \eqref{Eq_solmat} with the right-hand side  
     543equal to zero and with $\psi_n = 1$ along the island $n$ and $\psi_n = 0$ along  
     544the other coastlines) (Note that specifying $1$ as boundary condition on an island  
     545for $\psi$ is equivalent to defining a specific right hand side for \eqref{Eq_solmat}).  
     546The requested precision of this computation can be very high since it is only  
     547performed once. The absolute precision, $epsisl$, and the maximum number of  
     548iterations allowed, $nmisl$, are the \textbf{namelist parameters} used for this  
     549computation. Their typical values are $epsisl = 10^{-10}$ and $nmisl = 4000$.  
     550Then the island matrix A is computed from \eqref{Eq_PE_psi_isl_matrix} and  
     551inverted. At each time step, $\psi_0$, the solution of \eqref{Eq_solmat} with $\psi = 0$  
     552along all coastlines, is computed using either SOR or PCG. (It should 
     553be noted that the first guess of this computation remains as usual except that  
     554$\partial_t \psi_0$ is used, instead of $\partial_t \psi$. Indeed we are  
     555computing $\partial_t \psi_0$ which is usually very different from $\partial_t \psi$.) 
     556Then, it is easy to find the time evolution of the barotropic streamfunction on each  
     557island and to deduce $\partial_t \psi$, and to use it to compute the surface pressure  
     558gradient. Note that the value of the barotropic streamfunction itself is also computed  
     559as the time integration of $\partial_t \psi$ for further diagnostics. 
    487560 
    488561% ================================================================ 
     
    503576and the output file(s). The restart file is used internally by the code when  
    504577the user wants to start the model with initial conditions defined by a  
    505 previous simulation. It contains all the information that is necessary not  
    506 to introduce changes in the model results (even at the computer precision)  
    507 between a run performed with several restarts and the same run performed in  
    508 one time. It has to be noticed that this requires that the restart file  
    509 contains two consecutive time steps for all the prognostic variables, and  
    510 that it is save in the same binary format as the one used by the computer to  
    511 calculate (in particular, 32 bits binary IEEE format for this file must not  
    512 be used). The output listing and file(s) are defined but should be checked  
     578previous simulation. It contains all the information that is necessary in  
     579order for there to be no changes in the model results (even at the computer  
     580precision) between a run performed with several restarts and the same run  
     581performed in one step. It should be noted that this requires that the restart file  
     582contain two consecutive time steps for all the prognostic variables, and  
     583that it is saved in the same binary format as the one used by the computer  
     584that is to read it (in particular, 32 bits binary IEEE format must not be used for  
     585this file). The output listing and file(s) are predefined but should be checked  
    513586and eventually adapted to the user's needs. The output listing is stored in  
    514 the $ocean.output$ file. The information are printed all the way through the code on the  
    515 logical unit $numout$. To locate these prints, use the UNIX command "$grep -i numout^*$" in the source code directory. 
     587the $ocean.output$ file. The information is printed from within the code on the  
     588logical unit $numout$. To locate these prints, use the UNIX command  
     589"$grep -i numout^*$" in the source code directory. 
    516590 
    517591In the standard configuration, the user will find the model results in two  
    518 output files for every time-step where output is demanded: a \textbf{VO}  
    519 file containing all the three dimensional fields in logical unit $numwvo$, and a  
    520 \textbf{SO} file containing all the two dimensional (horizontal) fields in  
    521 logical unit $numwso$. These outputs are defined in the $diawri.F$ routine. The standard and available on-line diagnostics are described in {\S}III-12-c. 
    522  
    523 The default output is 32 bits binary IEEE format, compatible with the  
    524 Vairmer software (see the Climate Modelling and global Change team WEB  
    525 server at CERFACS: http://www.cerfacs.fr). The model's reference directory  
    526 also contains a visualisation tool based on \textbf{NCAR Graphics  
    527 }(http://ngwww.ucar.edu). If a user has access to the NCAR software, he or  
    528 she can copy the \textbf{LODMODEL/UTILS/OPADRA} directory from the reference  
    529 and, following the \textbf{README}, create the graphic outputs from the  
    530 model's results. 
     592output files containing values for every time-step where output is demanded:  
     593a \textbf{VO} file containing all the three dimensional fields in logical unit  
     594$numwvo$, and a \textbf{SO} file containing all the two dimensional (horizontal)  
     595fields in logical unit $numwso$. These outputs are defined in the $diawri.F$  
     596routine. The default and user-selectable diagnostics are described in {\S}III-12-c. 
     597 
     598The default output (for all output files apart from the restart file) is 32 bits binary  
     599IEEE format, compatible with the Vairmer software (see the Climate Modelling  
     600and global Change team WEB server at CERFACS: http://www.cerfacs.fr).  
     601The model's reference directory also contains a visualisation tool based on  
     602\textbf{NCAR Graphics} (http://ngwww.ucar.edu). If a user has access to the  
     603NCAR software, he or she can copy the \textbf{LODMODEL/UTILS/OPADRA}  
     604directory from the reference and, following the \textbf{README}, create  
     605graphical outputs from the model's results. 
    531606} 
    532607 
     
    534609%       Tracer/Dynamics Trends 
    535610% ------------------------------------------------------------------------------------------------------------- 
    536 \subsection{Tracer/Dynamics Trends (\key{trdlmd}, \key{diatrdtra})} 
     611\subsection{Tracer/Dynamics Trends (\key{trdlmd}, \key{diatrdtra}, \key{diatrddyn})} 
    537612\label{MISC_tratrd} 
    538613 
    539614%to be udated this corresponds to OPA8 
    540 When \key{diatrddyn} and/or \key{diatrddyn} cpp  
    541 variables are defined, each trends of the dynamics and/or temperature and  
    542 salinity time evolution equations are stored in three-dimensional arrays  
    543 just after their computation (i.e. at the end of each $dyn\cdots .F$  
    544 and/or $tra\cdots .F$ routines). These trends are then used in diagnostic  
    545 routines $diadyn.F$ and $diatra.F$ respectively. In standard, these routines check the basin averaged properties of the momentum and tracer equations every \textit{ntrd } time-steps (\textbf{namelist parameter}). These routines  
    546 are given as an example; they must be adapted by the user to his/her  
    547 desiderata. 
    548  
    549 These two options imply the definition of several arrays in the in core  
    550 memory, increasing quite sensitively the code memory requirements (search  
    551 for \key{diatrddyn} or  
    552 \key{diatrdtra}in \textit{common.h} file) 
     615When \key{diatrddyn} and/or \key{diatrddyn} cpp variables are defined, each  
     616trend of the dynamics and/or temperature and salinity time evolution equations  
     617is stored in three-dimensional arrays just after their computation ($i.e.$ at the end  
     618of each $dyn\cdots .F90$ and/or $tra\cdots .F90$ routine). These trends are then  
     619used in diagnostic routines $diadyn.F90$ and $diatra.F90$ respectively.  
     620In the standard model, these routines check the basin averaged properties of  
     621the momentum and tracer equations every \textit{ntrd } time-steps (\textbf{namelist  
     622parameter}). These routines are supplied as an example; they must be adapted by  
     623the user to his/her requirements. 
     624 
     625These two options imply the creation of several extra arrays in the in-core  
     626memory, increasing quite seriously the code memory requirements. 
    553627 
    554628% ------------------------------------------------------------------------------------------------------------- 
     
    561635%-------------------------------------------------------------------------------------------------------------- 
    562636 
    563 \colorbox{yellow}{a description is to be added here} 
     637The on-line computation of floats adevected either by the three dimensional velocity  
     638field or constraint to remain at a given depth ($w = 0$ in the computation) have been introduced in the system during the CLIPPER project. The algorithm used is based on  
     639the work of \cite{Blanke_Raynaud_JPO97}. (see also the web site describing the off-line  
     640use of this marvellous diagnostic tool (http://stockage.univ-brest.fr/~grima/Ariane/). 
    564641 
    565642% ------------------------------------------------------------------------------------------------------------- 
     
    569646\label{MISC_diag_others} 
    570647 
    571 %To be updated  this corresponds to OPA 8 
    572  
    573 Aside from the standard model variables, some other diagnostics are computed  
    574 on-line or can be added in the model. The available ready-to-add diagnostics  
    575 can be found in DIA. Among the available diagnostics one can  
    576 quote: 
     648%To be updated  this mainly corresponds to OPA 8 
     649 
     650Aside from the standard model variables, other diagnostics can be computed  
     651on-line or can be added to the model. The available ready-to-add diagnostics  
     652routines can be found in directory DIA. Among the available diagnostics are:  
    577653 
    578654- the mixed layer depth (based on a density criterion) (\mdl{diamxl}) 
  • trunk/DOC/TexFiles/Chapters/Chap_Model_Basics.tex

    r817 r994  
    525525               \frac{\partial \left( {e_2 \,u\,u} \right)}{\partial i} 
    526526      +        \frac{\partial \left( {e_1 \,v\,u} \right)}{\partial j}  \right) 
    527 - \frac{1}{e_3 }     \frac{\partial \left( {w\,u       } \right)}{\partial k}    \\ 
     527                 - \frac{1}{e_3 }\frac{\partial \left( {         w\,u} \right)}{\partial k}    \\ 
    528528-   \frac{1}{e_1 }\frac{\partial}{\partial i}\left( \frac{p_s+p_h }{\rho _o}   \right) 
    529529+   D_u^{\vect{U}} +   F_u^{\vect{U}} 
     
    536536 \frac{1}{e_1 \; e_2}   \left(  
    537537               \frac{\partial \left( {e_2 \,u\,v} \right)}{\partial i} 
    538       +        \frac{\partial \left( {e_1 \,u\,v} \right)}{\partial j}  \right) 
    539 - \frac{1}{e_3 }     \frac{\partial \left( {w\,v       } \right)}{\partial k}    \\ 
     538      +        \frac{\partial \left( {e_1 \,v\,v} \right)}{\partial j}  \right) 
     539                 - \frac{1}{e_3 } \frac{\partial \left( {        w\,v} \right)}{\partial k}    \\ 
    540540-   \frac{1}{e_2 }\frac{\partial }{\partial j}\left( \frac{p_s+p_h }{\rho _o}    \right) 
    541541+  D_v^{\vect{U}} +  F_v^{\vect{U}}  
  • trunk/DOC/TexFiles/Chapters/Chap_SBC.tex

    r817 r994  
    66\minitoc 
    77 
    8 \begin{verbatim} 
    9 At the time of this writing, the new surface module  
    10 that is described in this chapter (SBC) is not yet part 
    11 of the current distribution. The current way to specify  
    12 the surface boundary condition is such a mess that we  
    13 did not attempt to describe it. Nevertheless, apart from  
    14 the way the surface forcing is implemented, the infor- 
    15 mation given here are relevant for a NEMO v2.3 user. 
    16 \end{verbatim} 
    17  
    18 The ocean needs 7 fields as surface boundary condition: 
    19  
    20 The two components of the surface ocean stress $\left( {\tau _u \;,\;\tau _v} \right)$ 
    21  
    22 The incoming solar and non solar heat fluxes $\left( {Q_{ns} \;,\;Q_{sr} } \right)$ 
    23  
    24 The surface freshwater budget $\left( {\text{EMP}\;,\;\text{EMP}_S } \right)$ 
    25  
    26 \colorbox {yellow}{ The river runoffs (RUNOFF)} 
    27  
    28 Four different ways are offered to provide those 7 fields to the ocean: an  
    29 analytical formulation, a flux formulation, a bulk formulae formulation  
    30 (CORE or CLIO bulk formulae) and a coupled formulation (exchanges with a  
    31 atmospheric model via OASIS coupler). In addition, the resulting fields can  
    32 be further modified on used demand via several namelist options. These options  
    33 control the addition of a surface restoring term to observed SST and/or SSS,  
    34 the modification of fluxes below ice-covered area (using observed ice-cover  
    35 or a sea-ice model), the addition of river runoffs as surface freshwater  
    36 fluxes, and the addition of a freshwater flux adjustment on order to avoid a  
    37 mean sea-level drift. 
     8\newpage 
     9$\ $\newline    % force a new ligne 
     10%---------------------------------------namsbc-------------------------------------------------- 
     11\namdisplay{namsbc} 
     12%-------------------------------------------------------------------------------------------------------------- 
     13$\ $\newline    % force a new ligne 
     14 
     15The ocean needs six fields as surface boundary condition: 
     16\begin{itemize} 
     17\item the two components of the surface ocean stress $\left( {\tau _u \;,\;\tau _v} \right)$ 
     18\item the incoming solar and non solar heat fluxes $\left( {Q_{ns} \;,\;Q_{sr} } \right)$ 
     19\item the surface freshwater budget $\left( {\text{EMP},\;\text{EMP}_S } \right)$ 
     20\end{itemize} 
     21 
     22Four different ways to provide those six fields to the ocean are available which  
     23are controlled by namelist variables: an analytical formulation (\np{ln\_ana}=true),  
     24a flux formulation (\np{ln\_flx}=true), a bulk formulae formulation (CORE  
     25(\np{ln\_core}=true) or CLIO (\np{ln\_clio}=true) bulk formulae) and a coupled  
     26formulation (exchanges with a atmospheric model via the OASIS coupler)  
     27(\np{ln\_cpl}=true). The frequency at which the six fields have to be updated is 
     28the  \np{nf\_sbc} namelist parameter.  
     29In addition, the resulting fields can be further modified using  
     30several namelist options. These options control the addition of a surface restoring  
     31term to observed SST and/or SSS (\np{ln\_ssr}=true), the modification of fluxes  
     32below ice-covered areas (using observed ice-cover or a sea-ice model)  
     33(\np{nn\_ice}=0,1, 2 or 3), the addition of river runoffs as surface freshwater  
     34fluxes (\np{ln\_rnf}=true), the addition of a freshwater flux adjustment in  
     35order to avoid a mean sea-level drift (\np{nn\_fwb}= 0, 1 or 2), and the  
     36transformation of the solar radiation (if provided as daily mean) into a diurnal  
     37cycle (\np{ln\_dm2dc}=true). 
    3838 
    3939In this chapter, we first discuss where the surface boundary condition  
    4040appears in the model equations. Then we present the four ways of providing  
    41 the surface boundary condition. Finally, the different options that modify  
    42 the fluxes inside the ocean are discussed. 
    43  
    44  
    45  
    46  
    47  
    48  
    49  
    50  
    51  
     41the surface boundary condition. Finally, the different options that further modify  
     42the fluxes applied to the ocean are discussed. 
    5243 
    5344 
     
    6051 
    6152The surface ocean stress is the stress exerted by the wind and the sea-ice  
    62 on the ocean. Their two components are assumed to be interpolated on the  
    63 ocean mesh, i.e. provided at U- and V-points and projected onto the  
    64 (\textbf{i},\textbf{j}) referential. They are applied as a surface boundary  
    65 condition of the computation of the momentum vertical mixing trend  
    66 (\textbf{dynzdf} module) : 
     53on the ocean. The two components of stress are assumed to be interpolated  
     54onto the ocean mesh, $i.e.$ resolved onto the model (\textbf{i},\textbf{j}) direction  
     55at $u$- and $v$-points They are applied as a surface boundary condition of the  
     56computation of the momentum vertical mixing trend (\mdl{dynzdf} module) : 
    6757\begin{equation} \label{Eq_sbc_dynzdf} 
    6858\left.{\left( {\frac{A^{vm} }{e_3 }\ \frac{\partial \textbf{U}_h}{\partial k}} \right)} \right|_{z=1} 
     
    7262stress vector in the $(\textbf{i},\textbf{j})$ coordinate system. 
    7363 
    74 The surface heat flux is decomposed in two parts, a non solar and solar heat  
    75 fluxes. The former is the non penetrative part of the heat flux (i.e.  
    76 sensible plus latent plus long wave heat fluxes). It is applied as a surface  
    77 boundary condition trend of the first level temperature time evolution  
    78 equation (\mdl{trasbc} module).  
     64The surface heat flux is decomposed into two parts, a non solar and a solar heat  
     65flux, $Q_{ns}$ and $Q_{sr}$, respectively. The former is the non penetrative part  
     66of the heat flux ($i.e.$ the sum of sensible, latent and long wave heat fluxes).  
     67It is applied as a surface boundary condition trend of the first level temperature  
     68time evolution equation (\mdl{trasbc} module).  
    7969\begin{equation} \label{Eq_sbc_trasbc_q} 
    8070\frac{\partial T}{\partial t}\equiv \cdots \;+\;\left. {\frac{Q_{ns} }{\rho  
    8171_o \;C_p \;e_{3T} }} \right|_{k=1} \quad 
    8272\end{equation} 
    83  
    84 The latter is the penetrative part of the heat flux. It is applied as a 3D  
    85 trends of the temperature equation (\mdl{traqsr} module) when \np{ln\_traqsr}=T. 
     73$Q_{sr}$ is the penetrative part of the heat flux. It is applied as a 3D  
     74trends of the temperature equation (\mdl{traqsr} module) when \np{ln\_traqsr}=True. 
    8675 
    8776\begin{equation} \label{Eq_sbc_traqsr} 
     
    8978\,e_{3T} }\delta _k \left[ {I_w } \right] 
    9079\end{equation} 
    91  
    92 where $I_w$ is an adimensional function that describes the way the light  
     80where $I_w$ is a non-dimensional function that describes the way the light  
    9381penetrates inside the water column. It is generally a sum of decreasing  
    94 exponential (see \S\ref{TRA_qsr}). 
    95  
    96 The surface freshwater budget is provided through two non-necessary  
    97 identical fields EMP and EMP$_S $. Indeed, a surface freshwater  
    98 flux has two effects: it changes the volume of the ocean and it changes the  
    99 surface concentration of salt (an others tracers). Therefore it appears in  
    100 the sea surface height and salinity time evolution equations as a volume  
    101 flux, EMP (\textit{dynspg\_xxx} modules), and concentration/dilution effect,  
    102 EMP$_{S}$ (\mdl{trasbc} module), respectively.  
     82exponentials (see \S\ref{TRA_qsr}). 
     83 
     84The surface freshwater budget is provided by fields: EMP and EMP$_S$ which  
     85may or may not be identical. Indeed, a surface freshwater flux has two effects:  
     86it changes the volume of the ocean and it changes the surface concentration of  
     87salt (and other tracers). Therefore it appears in the sea surface height as a volume  
     88flux, EMP (\textit{dynspg\_xxx} modules), and in the salinity time evolution equations  
     89as a concentration/dilution effect,  
     90EMP$_{S}$ (\mdl{trasbc} module).  
    10391\begin{equation} \label{Eq_trasbc_emp} 
    10492\begin{aligned} 
     
    10997\end{equation}  
    11098 
    111 In the real ocean, EMP=EMP$_S$ and the ocean salt content is conserved,  
     99In the real ocean, EMP$=$EMP$_S$ and the ocean salt content is conserved,  
    112100but it exist several numerical reasons why this equality should be broken.  
    113101For example: 
    114102 
    115103When rigid-lid assumption is made, the ocean volume becomes constant and  
    116 thus, EMP=0, not EMP$_{S }$. 
    117  
    118 When a sea-ice model is considered, the water exchanged between ice and  
    119 ocean is very lightly salty (mean sea-ice salinity is $\sim $\textit{4 psu}). In this case,  
     104thus, EMP$=$0, not EMP$_{S }$. 
     105 
     106When the ocean is coupled to a sea-ice model, the water exchanged between ice and  
     107ocean is slightly salty (mean sea-ice salinity is $\sim $\textit{4 psu}). In this case,  
    120108EMP$_{S}$ take into account both concentration/dilution effect associated with  
    121 freezing/melting together with salt flux between ice and ocean, while EMP is  
     109freezing/melting and the salt flux between ice and ocean, while EMP is  
    122110only the volume flux. In addition, in the current version of \NEMO, the  
    123111sea-ice is assumed to be above the ocean. Freezing/melting does not change  
    124 the ocean volume (not impact on EMP) while it modifies the SSS  
    125 \colorbox{yellow}{(see {\S} on LIM sea-ice model)}. 
    126  
    127 Note that SST can also be modified by a freshwater flux. Precipitations (in  
    128 particular solid one) may have a temperature significantly different from  
     112the ocean volume (not impact on EMP) but it modifies the SSS. 
     113%gm  \colorbox{yellow}{(see {\S} on LIM sea-ice model)}. 
     114 
     115Note that SST can also be modified by a freshwater flux. Precipitation (in  
     116particular solid precipitation) may have a temperature significantly different from  
    129117the SST. Due to the lack of information about the temperature of  
    130 precipitations, we assume it is equal to the SST. Therefore, no  
     118precipitation, we assume it is equal to the SST. Therefore, no  
    131119concentration/dilution term appears in the temperature equation. It has to  
    132 be emphasised that this absence does not mean that there is not heat flux  
    133 associated with precipitation! An excess of precipitation will change the  
    134 ocean heat content and is therefore associated with a heat flux (not  
     120be emphasised that this absence does not mean that there is no heat flux  
     121associated with precipitation! Precipitation can change the ocean volume and thus the 
     122ocean heat content. It is therefore associated with a heat flux (not yet  
    135123diagnosed in the model) \citep{Roullet2000}). 
    136124 
    137 \colorbox{yellow}{Miss: } 
    138  
    139 A extensive description of all namsbc namelist (parameter that have to be  
    140 created!) 
    141  
    142 Especially the \np{nf\_sbc}, the \mdl{sbc\_oce} module (fluxes + mean sst sss ssu  
    143 ssv) i.e. information required by flux computation or sea-ice 
    144  
    145 \colorbox{red}{Add nqsr = 0 / 1 replace key{\_}traqsr} 
    146  
    147 \mdl{sbc\_oce} containt the definition in memory of the 7 fields (6+runoff), add  
    148 a word on runoff: included in surface bc or add as lateral obc{\ldots}. 
    149  
    150 Sbcmod manage the ``providing'' (fourniture) to the ocean the 7 fields 
    151  
    152 Fluxes update only each nf{\_}sbc time step (namsbc) explain relation  
    153 between nf{\_}sbc and nf{\_}ice, do we define nf{\_}blk??? ? only one  
    154 nf{\_}sbc 
    155  
    156 Explain here all the namlist namsbc variable{\ldots}. 
    157  
    158 \colorbox{yellow}{End Miss } 
    159  
    160 The ocean model provides the following variables averaged over nf{\_}sbc  
    161 time-step: 
     125%\colorbox{yellow}{Miss: } 
     126% 
     127%A extensive description of all namsbc namelist (parameter that have to be  
     128%created!) 
     129% 
     130%Especially the \np{nf\_sbc}, the \mdl{sbc\_oce} module (fluxes + mean sst sss ssu  
     131%ssv) i.e. information required by flux computation or sea-ice 
     132% 
     133%\mdl{sbc\_oce} containt the definition in memory of the 7 fields (6+runoff), add  
     134%a word on runoff: included in surface bc or add as lateral obc{\ldots}. 
     135% 
     136%Sbcmod manage the ``providing'' (fourniture) to the ocean the 7 fields 
     137% 
     138%Fluxes update only each nf{\_}sbc time step (namsbc) explain relation  
     139%between nf{\_}sbc and nf{\_}ice, do we define nf{\_}blk??? ? only one  
     140%nf{\_}sbc 
     141% 
     142%Explain here all the namlist namsbc variable{\ldots}. 
     143% 
     144%\colorbox{yellow}{End Miss } 
     145 
     146The ocean model provides the surface currents, temperature and salinity  
     147averaged over \np{nf\_sbc} time-step (\ref{Tab_ssm}).The computation of the  
     148mean is done in \mdl{sbcmod} module. 
    162149 
    163150%-------------------------------------------------TABLE--------------------------------------------------- 
    164 \begin{table}[htbp]  \label{Tab_ssm} 
     151\begin{table}[tb]  \label{Tab_ssm} 
    165152\begin{center} 
    166153\begin{tabular}{|l|l|l|l|} 
    167154\hline 
    168 Variable desciption              & Computer name   & Units  & point \\  \hline 
    169 i-component of the surface current  & ssu\_u & $m.s^{-1}$   & U \\   \hline 
     155Variable description             & Model variable  & Units  & point \\  \hline 
     156i-component of the surface current  & ssu\_m & $m.s^{-1}$   & U \\   \hline 
    170157j-component of the surface current  & ssv\_m & $m.s^{-1}$   & V \\   \hline 
    171158Sea surface temperature          & sst\_m & \r{}$K$      & T \\   \hline 
    172159Sea surface salinty              & sss\_m & $psu$        & T \\   \hline 
    173160\end{tabular} 
     161\caption{Ocean variables provided by the ocean to the surface module (SBC).  
     162The variable are averaged over nf{\_}sbc time step, $i.e.$ the frequency of  
     163computation of surface fluxes.} 
    174164\end{center} 
    175165\end{table} 
    176166%-------------------------------------------------------------------------------------------------------------- 
    177167 
    178 The mean computation is done in sbcmod ( 
    179  
    180 \colorbox{yellow}{Penser a} mettre dans le restant l'info nf{\_}sbc ET nf{\_}sbc*rdt de sorte de  
    181 reinitialiser la moyenne si on change la frequence ou le pdt 
    182  
    183 NB: creer cn{\_}sbc{\_}ice (cn{\_} = character in the namelist) with 3  
    184 cases: 
    185  
    186 = `noice' no specific call 
    187  
    188 = `iceif ` ``ice-if'' sea ice, i.e. read observed ice-cover and modified sbc  
    189 bellow those area. 
    190  
    191 = `lim' LIM sea-ice model is called which update the sbc fields in ice  
    192 covered area 
    193  
    194 ? modify the nsbc{\_}ice variable depending of this parameter (from --1, 0  
    195 to 1) 
    196 \colorbox{yellow}{End Penser a} 
     168 
     169 
     170%\colorbox{yellow}{Penser a} mettre dans le restant l'info nf{\_}sbc ET nf{\_}sbc*rdt de sorte de reinitialiser la moyenne si on change la frequence ou le pdt 
     171 
    197172 
    198173% ================================================================ 
     
    203178\label{SBC_ana} 
    204179 
    205 %---------------------------------------namtau - namflx-------------------------------------------------- 
    206 \namdisplay{namtau} 
    207 \namdisplay{namflx} 
     180%---------------------------------------namsbc_ana-------------------------------------------------- 
     181\namdisplay{namsbc_ana} 
    208182%-------------------------------------------------------------------------------------------------------------- 
    209183 
    210184 
    211 The analytical formulation of the surface boundary condition is set by  
    212 default. In this case, all the 6 fluxes needed by the ocean are assumed to  
    213 be uniform in space. They take constant values given in the namlist  
    214 namsbc{\_}ana : \textit{utau0}, \textit{vtau0}, \textit{qns0}, \textit{qsr0}, \textit{emp0} and \textit{emps0}. while the runoff is set to zero. In addition,  
    215 the wind is allowed to reach its nominal value within a given number of time  
    216 step (\textit{ntau000}). 
    217  
    218 If a user wants to applied a different analytical forcing, \mdl{sbcana}  
    219 module is the very place to do that. As an example, one can have a look to  
    220 the \mdl{sbc\_ana\_gyre} routine which provides the analytical forcing of the  
     185The analytical formulation of the surface boundary condition is the default scheme. 
     186In this case, all the six fluxes needed by the ocean are assumed to  
     187be uniform in space. They take constant values given in the namelist  
     188namsbc{\_}ana by the variables \np{rn\_utau0}, \np{rn\_vtau0}, \np{rn\_qns0},  
     189\np{rn\_qsr0}, and \np{rn\_emp0} (EMP$=$EMP$_S$). The runoff is set to zero.  
     190In addition, the wind is allowed to reach its nominal value within a given number  
     191of time steps (\np{nn\_tau000}). 
     192 
     193If a user wants to apply a different analytical forcing, the \mdl{sbcana}  
     194module can be modified to use another scheme. As an example,  
     195the \mdl{sbc\_ana\_gyre} routine provides the analytical forcing for the  
    221196GYRE configuration (see GYRE configuration manual, in preparation). 
    222197 
     
    228203      {Flux formulation (\mdl{sbcflx} module) } 
    229204\label{SBC_flx} 
    230  
    231 In the flux formulation (\key{sbcflx} defined), the surface boundary  
     205%------------------------------------------namsbc_flx---------------------------------------------------- 
     206\namdisplay{namsbc_flx}  
     207%------------------------------------------------------------------------------------------------------------- 
     208 
     209In the flux formulation (\np{ln\_flx}=true), the surface boundary  
    232210condition fields are directly read from input files. The user has to define  
    233211in the namelist namsbc{\_}flx the name of the file, the name of the variable  
    234 read in the file, the time frequency at which it is given, and a logical  
    235 setting whether a time interpolation to the model time step is asked are not  
     212read in the file, the time frequency at which it is given (in hours), and a logical  
     213setting whether a time interpolation to the model time step is required  
    236214for this field). (fld\_i namelist structure). 
    237215 
    238 \colorbox{yellow}{ Describe the information given?  } 
    239  
    240 \colorbox{yellow}{  Add an info about on-line interpolation or not ? at with which scale{\ldots} } 
    241  
    242  
    243216\textbf{Caution}: when the frequency is set to --12, the data are monthly  
    244 values. There are assumed to be climatological values, so time interpolation  
     217values. These are assumed to be climatological values, so time interpolation  
    245218between December the 15$^{th}$ and January the 15$^{th}$ is done using  
    246 record 12 and 1 
     219records 12 and 1 
    247220 
    248221When higher frequency is set and time interpolation is demanded, the model  
    249222will try to read the last (first) record of previous (next) year in a file  
    250 having the same name but a suffix {\_}prev{\_}year (next{\_}year) being  
    251 added. These file must only content a single record. If they don't exist,  
    252 the will assume that the previous year last record is equal to the first  
    253 record of the previous year, and similarly, that the first record of the  
     223having the same name but a suffix {\_}prev{\_}year ({\_}next{\_}year) being  
     224added (e.g. "{\_}1989"). These files must only contain a single record. If they don't exist,  
     225the model assumes that the last record of the previous year is equal to the first  
     226record of the current year, and similarly, that the first record of the  
    254227next year is equal to the last record of the current year. This will cause  
    255 the forcing to remain constant over the first and last half fld\_frequ  
    256 hours. 
     228the forcing to remain constant over the first and last half fld\_frequ hours. 
    257229 
    258230Note that in general, a flux formulation is used in associated with a  
    259 damping term to observed SST and/or SSS. See \S\ref{SBC_ssr} for its  
     231restoring term to observed SST and/or SSS. See \S\ref{SBC_ssr} for its  
    260232specification. 
    261233 
     
    271243using bulk formulae and atmospheric fields and ocean (and ice) variables.  
    272244 
    273 The atmospheric fields used depends on the bulk formulae used. Two of them  
    274 are available : the CORE and CLIO bulk formulea. The choice is made by  
    275 activating the CPP key \key{sbcblk\_core} or  
    276 \key{sbcblk\_clio}, respectively. 
    277  
    278 \colorbox{yellow}{Note : if a sea-ice model is used then blah blah blah{\ldots}} 
    279  
    280 CORE bulk formulea 
    281  
    282 The CORE bulk formulae have been developed by \citet{LargeYeager2004}. They  
    283 have been design to handle the CORE forcing, a mixture of NCEP reanalysis  
    284 and satellite data. They use an inertial dissipative method to compute the  
    285 turbulent transfer coefficients (momentum, sensible heat and evaporation)  
    286 from the 10 meter wind speed, air temperature and specific humidity). 
     245The atmospheric fields used depend on the bulk formulae used. Two bulk formulations  
     246are available : the CORE and CLIO bulk formulea. The choice is made by setting to true 
     247one of the following namelist variable : \np{ln\_core} and \np{ln\_clio}. 
     248 
     249Note : in forced mode, when a sea-ice model is used, a bulk formulation have to be used.  
     250Therefore the two bulk formulea provided include the computation of the fluxes over both  
     251an ocean and an ice surface.  
     252 
     253% ------------------------------------------------------------------------------------------------------------- 
     254%        CORE Bulk formulea 
     255% ------------------------------------------------------------------------------------------------------------- 
     256\subsection    [CORE Bulk formulea (\np{ln\_core}=true)] 
     257            {CORE Bulk formulea (\np{ln\_core}=true, \mdl{sbcblk\_core})} 
     258\label{SBC_blk_core} 
     259%------------------------------------------namsbc_core---------------------------------------------------- 
     260\namdisplay{namsbc_core}  
     261%------------------------------------------------------------------------------------------------------------- 
     262 
     263The CORE bulk formulae have been developed by \citet{LargeYeager2004}.  
     264They have been designed to handle the CORE forcing, a mixture of NCEP  
     265reanalysis and satellite data. They use an inertial dissipative method to compute  
     266the turbulent transfer coefficients (momentum, sensible heat and evaporation)  
     267from the 10 metre wind speed, air temperature and specific humidity. 
     268 
     269Note that substituting ERA40 to NCEP reanalysis fields  
     270does not require changes in the bulk formulea themself.  
    287271 
    288272The required 8 input fields are: 
     
    293277\begin{tabular}{|l|l|l|l|} 
    294278\hline 
    295 Variable desciption              & Computer name   & Units        & point \\     \hline 
    296 i-component of the 10m air velocity & utau      & $m.s^{-1}$         & T or U \\    \hline 
    297 j-component of the 10m air velocity & vtau      & $m.s^{-1}$         & T or V \\ \hline 
     279Variable desciption              & Model variable  & Units   & point \\    \hline 
     280i-component of the 10m air velocity & utau      & $m.s^{-1}$         & T \\  \hline 
     281j-component of the 10m air velocity & vtau      & $m.s^{-1}$         & T \\  \hline 
    29828210m air temperature              & tair      & \r{}$K$            & T   \\ \hline 
    299283Specific humidity             & humi      & \%              & T \\      \hline 
     
    307291%-------------------------------------------------------------------------------------------------------------- 
    308292 
    309 Note that the air velocity can be provided at either tracer ocean point or  
    310 velocity ocean point.  
    311  
    312 \colorbox{yellow}{Explain low resolution, better to provide it at U-V, high resolution better} 
    313  
    314 \colorbox{yellow}{at T-point{\ldots} Explain why, scheme?} 
    315  
    316 \colorbox{yellow}{Add a namelist parameter to provide a switch from U/V or T (or I??) point} 
    317  
    318 \colorbox{yellow}{ for utau/vtau} 
    319  
    320 CLIO bulk formulea 
    321  
    322 The CLIO bulk formulae have been developed several years ago for the  
    323 Louvain-la-neuve coupled ice-ocean model (CLIO, Goosse et al. 1997). It is a  
    324 simpler bulk formulae that assumed the stress to be known and computes the  
    325 radiative fluxes from a climatological cloud cover.  
     293Note that the air velocity is provided at a tracer ocean point, not at a velocity ocean point ($u$- and $v$-points). It is simpler and faster (less fields to be read), but it is not the recommended method when the ocean grid 
     294size is the same or larger than the one of the input atmospheric fields. 
     295 
     296% ------------------------------------------------------------------------------------------------------------- 
     297%        CLIO Bulk formulea 
     298% ------------------------------------------------------------------------------------------------------------- 
     299\subsection    [CLIO Bulk formulea (\np{ln\_clio}=true)] 
     300            {CLIO Bulk formulea (\np{ln\_clio}=true, \mdl{sbcblk\_clio})} 
     301\label{SBC_blk_clio} 
     302%------------------------------------------namsbc_clio---------------------------------------------------- 
     303\namdisplay{namsbc_clio}  
     304%------------------------------------------------------------------------------------------------------------- 
     305 
     306The CLIO bulk formulae were developed several years ago for the  
     307Louvain-la-neuve coupled ice-ocean model (CLIO, \cite{Goosse_al_JGR99}).  
     308They are simpler bulk formulae. They assume the stress to be known and  
     309compute the radiative fluxes from a climatological cloud cover.  
    326310 
    327311The required 7 input fields are: 
     
    332316\begin{tabular}{|l|l|l|l|} 
    333317\hline 
    334 Variable desciption           & Computer name   & Units              & point \\  \hline 
     318Variable desciption           & Model variable  & Units           & point \\  \hline 
    335319i-component of the ocean stress     & utau         & $N.m^{-2}$         & U \\   \hline 
    336320j-component of the ocean stress     & vtau         & $N.m^{-2}$         & V \\   \hline 
    337321Wind speed module             & vatm         & $m.s^{-1}$         & T \\   \hline 
    33832210m air temperature              & tair         & \r{}$K$            & T \\   \hline 
    339 Secific humidity                 & humi         & \%              & T \\   \hline 
     323Specific humidity                & humi         & \%              & T \\   \hline 
    340324Cloud cover                   &           & \%              & T \\   \hline 
    341325Total precipitation (liquid + solid)   & precip    & $Kg.m^{-2}.s^{-1}$ & T \\   \hline 
     
    346330%-------------------------------------------------------------------------------------------------------------- 
    347331 
    348 As for the flux formulation, the input data information required by the  
     332As for the flux formulation, information about the input data required by the  
    349333model is provided in the namsbc\_blk\_core or namsbc\_blk\_clio  
    350 namelist (via the structure fld\_i). The same assumption is made about the  
    351 value of the first and last record in each file. 
    352  
     334namelist (via the structure fld\_i). The first and last record assumption is also made  
     335(see \S\ref{SBC_flx}) 
    353336 
    354337% ================================================================ 
     
    358341      {Coupled formulation (\mdl{sbccpl} module)} 
    359342\label{SBC_cpl} 
     343%------------------------------------------namsbc_cpl---------------------------------------------------- 
     344\namdisplay{namsbc_cpl}  
     345%------------------------------------------------------------------------------------------------------------- 
    360346 
    361347In the coupled formulation of the surface boundary condition, the fluxes are  
     
    364350the atmospheric component. 
    365351 
     352The generalised coupled interface is under development. It should be available 
     353in summer 2008. It will include the ocean interface for most of the European  
     354atmospheric GCM (ARPEGE, ECHAM, ECMWF, HadAM, LMDz). 
     355 
    366356 
    367357% ================================================================ 
    368358% Miscellanea options 
    369359% ================================================================ 
    370 \section{Miscellanea options} 
     360\section{Miscellaneous options} 
    371361\label{SBC_misc} 
    372362 
     
    377367         {Surface restoring to observed SST and/or SSS (\mdl{sbcssr})} 
    378368\label{SBC_ssr} 
    379  
    380 In forced mode using flux formulation (default option or \key{flx} defined), a  
    381 feedback term \emph{must} be added to the specified surface heat flux $Q_{ns}^o$: 
     369%------------------------------------------namsbc_ssr---------------------------------------------------- 
     370\namdisplay{namsbc_ssr}  
     371%------------------------------------------------------------------------------------------------------------- 
     372 
     373In forced mode using a flux formulation (default option or \key{flx} defined), a  
     374feedback term \emph{must} be added to the surface heat flux $Q_{ns}^o$: 
    382375\begin{equation} \label{Eq_sbc_dmp_q} 
    383376Q_{ns} = Q_{ns}^o + \frac{dQ}{dT} \left( \left. T \right|_{k=1} - SST_{Obs} \right) 
     
    385378where SST is a sea surface temperature field (observed or climatological), $T$ is  
    386379the model surface layer temperature and $\frac{dQ}{dT}$ is a negative feedback  
    387 coefficient usually taken equal to $-40~W.m^{-2}.$\r{}K$^{-1}$. For a $50~m$ mixed-layer depth,  
    388 this value corresponds to a relaxation time scale of two months. This term  
    389 ensures that if $T$ perfectly fits SST then $Q$ is equal to $Q_o$.  
    390  
    391 In the fresh water budget, a feedback term can also be added: 
     380coefficient usually taken equal to $-40~W/m^2/K$. For a $50~m$  
     381mixed-layer depth, this value corresponds to a relaxation time scale of two months.  
     382This term ensures that if $T$ perfectly matches the supplied SST, then $Q$ is  
     383equal to $Q_o$.  
     384 
     385In the fresh water budget, a feedback term can also be added. Converted into an  
     386equivalent freshwater flux, it takes the following expression : 
    392387 
    393388\begin{equation} \label{Eq_sbc_dmp_emp} 
    394 EMP = EMP_o +\gamma_s^{-1} \left(S-SSS_{Obs}\right)\left|S\right. 
     389EMP = EMP_o + \gamma_s^{-1} e_{3t}  \frac{  \left(\left.S\right|_{k=1}-SSS_{Obs}\right)} 
     390                                             {\left.S\right|_{k=1}} 
    395391\end{equation} 
    396392 
    397 where EMP$_{o }$ is a net surface fresh water flux (observed, climatological or  
    398 atmospheric model product), \textit{SSS}$_{Obs}$is a sea surface salinity (usually a time  
    399 interpolation of the monthly mean PHC climatology \citep{Steele2001}, $S$ is the model  
    400 surface layer salinity and $\gamma_s$ is a negative feedback coefficient  
    401 which is provided as a namelist parameter. Unlike heat flux, there is no  
    402 physical justification for the feedback term in (III.4.4) as the atmosphere  
    403 does not care about ocean surface salinity \citep{Madec1997}. The  
    404 SSS restoring term can only be view as a flux correction on freshwater  
    405 fluxes to reduce the uncertainties we have on the observed freshwater  
    406 budget. 
     393where EMP$_{o }$ is a net surface fresh water flux (observed, climatological or an 
     394atmospheric model product), \textit{SSS}$_{Obs}$ is a sea surface salinity (usually a time  
     395interpolation of the monthly mean Polar Hydrographic Climatology \citep{Steele2001}),  
     396$\left.S\right|_{k=1}$ is the model surface layer salinity and $\gamma_s$ is a negative  
     397feedback coefficient which is provided as a namelist parameter. Unlike heat flux, there is no  
     398physical justification for the feedback term in \ref{Eq_sbc_dmp_emp} as the atmosphere  
     399does not care about ocean surface salinity \citep{Madec1997}. The SSS restoring  
     400term should be viewed as a flux correction on freshwater fluxes to reduce the  
     401uncertainties we have on the observed freshwater budget. 
    407402 
    408403% ------------------------------------------------------------------------------------------------------------- 
     
    411406\subsection{Handling of ice-covered area} 
    412407\label{SBC_ice-cover} 
    413 The presence of sea-ice at the top of the ocean  
    414 strongly modify the surface fluxes 
    415  
    416 The presence at the sea surface of an ice cover area modified all the fluxes  
    417 transmitted to the ocean. There is two cases whereas a sea-ice model is used  
    418 or not.  
    419  
    420 Without sea ice model, the information of ice-cover / open ocean is read in  
    421 a file (either the directly the ice-cover or the observed SST from which  
    422 ice-cover is deduced using a criteria on freezing point temperature).  
     408 
     409The presence at the sea surface of an ice covered area modifies all the fluxes  
     410transmitted to the ocean. There are several way to handle sea-ice in the system depending on the value of the \np{nn{\_}ice} namelist parameter.   
     411\begin{description} 
     412\item[nn{\_}ice = 0]  there will never be sea-ice in the computational domain. This is a typical namelist value used for tropical ocean domain. The surface fluxes are simply specified for an ice-free ocean. No specific things are done for sea-ice. 
     413\item[nn{\_}ice = 1]  sea-ice can exist in the computational domain, but no sea-ice model is used. An observed ice covered area is read in a file. Below this area, the SST is restored to the freezing point and the heat fluxes are set to $-4~W/m^2$ ($-2~W/m^2$) in the northern (southern) hemisphere. The associated modification of the freshwater fluxes are done in such a way that the change in buoyancy fluxes remains zero. This prevents deep convection to occur when trying to reach the freezing point (and so ice covered area condition) while the SSS is too large. This manner of managing sea-ice area, just by using si IF case, is usually referred as the \textit{ice-if} model. It can be found in the \mdl{sbcice{\_}if} module. 
     414\item[nn{\_}ice = 2 or more]  A full sea ice model is used. This model computes the ice-ocean fluxes, that are combined with the air-sea fluxes using the ice fraction of each model cell to provide the surface ocean fluxes. Note that the activation of a sea-ice model is is done by defining a CPP key (\key{lim2} or \key{lim3}). The activation automatically ovewrite the read value of nn{\_}ice to its appropriate value ($i.e.$ $2$ for LIM-2 and $3$ for LIM-3). 
     415\end{description} 
     416 
     417% {Description of Ice-ocean interface to be added here or in LIM 2 and 3 doc ?} 
    423418 
    424419% ------------------------------------------------------------------------------------------------------------- 
     
    428423         {Addition of river runoffs (\mdl{sbcrnf})} 
    429424\label{SBC_rnf} 
     425%------------------------------------------namsbc_rnf---------------------------------------------------- 
     426\namdisplay{namsbc_rnf}  
     427%------------------------------------------------------------------------------------------------------------- 
    430428 
    431429It is convenient to introduce the river runoff in the model as a surface  
    432 fresh water fluxes. \colorbox{yellow}{{\ldots} blah blah{\ldots}.} 
     430fresh water flux.  
    433431 
    434432\colorbox{yellow}{Nevertheless, Pb of vertical resolution and increase of Kz in vicinity of } 
     
    444442         {Freshwater budget control (\mdl{sbcfwb})} 
    445443\label{SBC_fwb} 
    446 %--------------------------------------------namfwb-------------------------------------------------------- 
    447 \namdisplay{namfwb} 
    448 %-------------------------------------------------------------------------------------------------------------- 
    449  
    450 To be written latter... 
     444 
     445To be written later... 
    451446 
    452447\gmcomment{The descrition of the technique used to control the freshwater budget has to be added here} 
  • trunk/DOC/TexFiles/Chapters/Chap_TRA.tex

    r817 r994  
    202202% ------------------------------------------------------------------------------------------------------------- 
    203203\subsection   [$4^{nd}$ order centred scheme (cen4) (\np{ln\_traadv\_cen4})] 
    204          {$4^{nd}$ order centred scheme (cen4) (\np{ln\_traadv\_cen4}=.true.)} 
     204           {$4^{nd}$ order centred scheme (cen4) (\np{ln\_traadv\_cen4}=.true.)} 
    205205\label{TRA_adv_cen4} 
    206206 
  • trunk/DOC/TexFiles/Chapters/Chap_ZDF.tex

    r817 r994  
    77 
    88%gm% Add here a small introduction to ZDF and naming of the different physics (similar to what have been written for TRA and DYN. 
     9\gmcomment{Steven remark : problem here with turbulent vs turbulence.  I've changed "turbulent closure" to "turbulence closure", "turbulent mixing length" to "turbulence mixing length", but I've left "turbulent kinetic energy" alone - though I think it is an historical abberation! 
     10Gurvan :  I kept "turbulent closure"...} 
     11\gmcomment{Steven bis : parameterization is the american spelling, parameterisation is the british} 
     12 
    913 
    1014% ================================================================ 
     
    1418\label{ZDF_zdf} 
    1519 
    16 The discrete form of the ocean subgrid scale physics has been presented in \S\ref{TRA_zdf} and \S\ref{DYN_zdf}. At the surface and bottom boundaries, the turbulent fluxes of momentum, heat and salt have to be defined. At the surface they are prescribed from the surface forcing (see Chap.~\ref{SBC}), while at the bottom they are set to zero for heat and salt, unless a geothermal flux forcing is prescribed as a bottom boundary condition ($i.e.$ \key{trabbl} defined, see \S\ref{TRA_bbc}), and specified through a bottom friction parameterization for momentum (see \S\ref{ZDF_bfr}). 
     20The discrete form of the ocean subgrid scale physics has been presented in  
     21\S\ref{TRA_zdf} and \S\ref{DYN_zdf}. At the surface and bottom boundaries,  
     22the turbulent fluxes of momentum, heat and salt have to be defined. At the  
     23surface they are prescribed from the surface forcing (see Chap.~\ref{SBC}),  
     24while at the bottom they are set to zero for heat and salt, unless a geothermal  
     25flux forcing is prescribed as a bottom boundary condition ($i.e.$ \key{trabbl}  
     26defined, see \S\ref{TRA_bbc}), and specified through a bottom friction  
     27parameterization for momentum (see \S\ref{ZDF_bfr}). 
    1728 
    1829In this section we briefly discuss the various choices offered to compute  
    19 the vertical eddy viscosity and diffusivity coefficients, $A_u^{vm}$ , $A_v^{vm}$ and $A^{vT}$ ($A^{vS}$), defined at $uw$-, $vw$- and $w$-points, respectively (see \S\ref{TRA_zdf} and \S\ref{DYN_zdf}). These coefficients can be assumed to be either constant, or a function of the local Richardson number, or computed from a turbulent closure model (either TKE or KPP formulation). The computation of these coefficients is initialized in \mdl{zdfini} module and performed in \mdl{zdfric}, \mdl{zdftke} or \mdl{zdfkpp} modules. The trends due to the vertical momentum and tracer diffusion, including the surface forcing,  
    20 are computed and added to the general trend in \mdl{dynzdf} and \mdl{trazdf} modules, respectively. These trends can be computed using either a forward time scheme (cpp variable  
    21 \np{np\_zdfexp} or a backward time scheme (default option) depending on the magnitude of the mixing coefficients used, and thus of the formulation used (see \S\ref{DOM_nxt}). 
     30the vertical eddy viscosity and diffusivity coefficients, $A_u^{vm}$ ,  
     31$A_v^{vm}$ and $A^{vT}$ ($A^{vS}$), defined at $uw$-, $vw$- and $w$-  
     32points, respectively (see \S\ref{TRA_zdf} and \S\ref{DYN_zdf}). These  
     33coefficients can be assumed to be either constant, or a function of the local  
     34Richardson number, or computed from a turbulent closure model (either  
     35TKE or KPP formulation). The computation of these coefficients is initialized  
     36in the \mdl{zdfini} module and performed in the \mdl{zdfric}, \mdl{zdftke} or  
     37\mdl{zdfkpp} modules. The trends due to the vertical momentum and tracer  
     38diffusion, including the surface forcing, are computed and added to the  
     39general trend in the \mdl{dynzdf} and \mdl{trazdf} modules, respectively.  
     40These trends can be computed using either a forward time stepping scheme  
     41(namelist parameter \np{np\_zdfexp}=true) or a backward time stepping  
     42scheme (\np{np\_zdfexp}=false) depending on the magnitude of the mixing  
     43coefficients, and thus of the formulation used (see \S\ref{DOM_nxt}). 
    2244 
    2345% ------------------------------------------------------------------------------------------------------------- 
     
    3052%-------------------------------------------------------------------------------------------------------------- 
    3153 
    32 When the \key{zdfcst} is defined, the momentum and tracer vertical eddy coefficients are set to  
    33 constant values over the whole ocean. This is the crudest way to define the  
    34 vertical ocean physics. It is recommended to use this option only in process  
    35 studies, not in basin scale simulation. Typical values used in this case  
    36 are: 
     54When \key{zdfcst} is defined, the momentum and tracer vertical eddy coefficients  
     55are set to constant values over the whole ocean. This is the crudest way to define  
     56the vertical ocean physics. It is recommended that this option is only used in  
     57process studies, not in basin scale simulations. Typical values used in this case are: 
    3758\begin{align*}  
    3859A_u^{vm} = A_v^{vm} &= 1.2\ 10^{-4}~m^2.s^{-1}  \\ 
     
    4162\end{align*} 
    4263 
    43 These values are set through \np{avm0} and \np{avt0} namelist parameters. In any case, do not use  
    44 values smaller that those associated to the molecular viscosity and diffusivity, that is $\sim10^{-6}~m^2.s^{-1}$ for momentum, $\sim10^{-7}~m^2.s^{-1}$ for temperature and $\sim10^{-9}~m^2.s^{-1}$ for salinity. 
     64These values are set through the \np{avm0} and \np{avt0} namelist parameters.  
     65In all cases, do not use values smaller that those associated with the molecular  
     66viscosity and diffusivity, that is $\sim10^{-6}~m^2.s^{-1}$ for momentum,  
     67$\sim10^{-7}~m^2.s^{-1}$ for temperature and $\sim10^{-9}~m^2.s^{-1}$ for salinity. 
    4568 
    4669 
     
    5578%-------------------------------------------------------------------------------------------------------------- 
    5679 
    57 When \key{zdfric} is defined, a local Richardson number dependent formulation of the vertical momentum and tracer eddy coefficients is set. The vertical mixing coefficients are diagnosed from the large scale variables computed by the model (order 0.5 closure scheme). \textit{In situ} measurements allow to link vertical turbulent activity to large scale ocean structures. The hypothesis of a mixing mainly maintained by the growth of Kelvin-Helmholtz like instabilities leads to a dependency between the vertical turbulent eddy coefficients and the local Richardson number ($i.e.$ ratio of stratification over vertical shear). Following \citet{PacPhil1981}, the following formulation has been implemented: 
     80When \key{zdfric} is defined, a local Richardson number dependent formulation  
     81for the vertical momentum and tracer eddy coefficients is set. The vertical mixing  
     82coefficients are diagnosed from the large scale variables computed by the model.  
     83\textit{In situ} measurements have been used to link vertical turbulent activity to  
     84large scale ocean structures. The hypothesis of a mixing mainly maintained by the  
     85growth of Kelvin-Helmholtz like instabilities leads to a dependency between the  
     86vertical turbulence eddy coefficients and the local Richardson number ($i.e.$ the  
     87ratio of stratification to vertical shear). Following \citet{PacPhil1981}, the following  
     88formulation has been implemented: 
    5889\begin{equation} \label{Eq_zdfric} 
    5990   \left\{      \begin{aligned} 
     
    6394   \end{aligned}    \right. 
    6495\end{equation} 
    65 where $Ri = N^2 / \left(\partial_z \textbf{U}_h \right)^2$ is the local Richardson number, $N$ is the local brunt-Vais\"{a}l\"{a} frequency (see \S\ref{TRA_bn2}), $A_b^{vT} $ and $A_b^{vm}$ are the constant background values set as in constant case (see \S\ref{ZDF_cst}), and $A_{ric}^{vT} = 10^{-4}~m^2.s^{-1} $ is the maximum value that can be reached by the coefficient when $Ri\leq 0$, $a=5$ and $n=2$. The last three coefficients can be modified by setting \np{avmri}, \np{alp} and \np{nric} namelist parameter, respectively. 
     96where $Ri = N^2 / \left(\partial_z \textbf{U}_h \right)^2$ is the local Richardson  
     97number, $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \S\ref{TRA_bn2}),  
     98$A_b^{vT} $ and $A_b^{vm}$ are the constant background values set as in the  
     99constant case (see \S\ref{ZDF_cst}), and $A_{ric}^{vT} = 10^{-4}~m^2.s^{-1}$  
     100is the maximum value that can be reached by the coefficient when $Ri\leq 0$,  
     101$a=5$ and $n=2$. The last three values can be modified by setting the  
     102\np{avmri}, \np{alp} and \np{nric} namelist parameters, respectively. 
    66103 
    67104% ------------------------------------------------------------------------------------------------------------- 
     
    75112%-------------------------------------------------------------------------------------------------------------- 
    76113 
    77 The vertical eddy viscosity and diffusivity coefficients are computed from a TKE turbulent closure model based on a prognostic equation for $\bar {e}$, the turbulent kinetic energy, and a closure assumption for the turbulent length scales. This turbulent closure model has been developed by \citet{Bougeault1989} in atmospheric cases, adapted by \citet{Gaspar1990} for oceanic cases, and embedded in OPA by \citet{Blanke1993} for equatorial Atlantic simulations. Since then, significant modifications have been introduced by \citet{Madec1998} in both the implementation and the formulation of the mixing length scale. The time evolution of $\bar{e}$ is the result of the production of $\bar{e}$ through vertical shear, its destruction through stratification, its vertical diffusion and its dissipation of \citet{Kolmogorov1942} type: 
     114The vertical eddy viscosity and diffusivity coefficients are computed from a TKE  
     115turbulent closure model based on a prognostic equation for $\bar {e}$, the turbulent  
     116kinetic energy, and a closure assumption for the turbulence length scales. This  
     117turbulent closure model has been developed by \citet{Bougeault1989} in the  
     118atmospheric case, adapted by \citet{Gaspar1990} for the oceanic case, and  
     119embedded in OPA by \citet{Blanke1993} for equatorial Atlantic simulations. Since  
     120then, significant modifications have been introduced by \citet{Madec1998} in both  
     121the implementation and the formulation of the mixing length scale. The time  
     122evolution of $\bar{e}$ is the result of the production of $\bar{e}$ through vertical  
     123shear, its destruction through stratification, its vertical diffusion, and its dissipation  
     124of \citet{Kolmogorov1942} type: 
    78125\begin{equation} \label{Eq_zdftke_e} 
    79126\frac{\partial \bar{e}}{\partial t} =  
     
    87134\begin{equation} \label{Eq_zdftke_kz} 
    88135   \begin{split} 
    89          A^{vm} &= C_k\  l_k\  \sqrt {\bar{e}} 
    90     \\ 
     136         A^{vm} &= C_k\  l_k\  \sqrt {\bar{e}}     \\ 
    91137         A^{vT} &= A^{vm} / P_{rt} 
    92138   \end{split} 
    93139\end{equation} 
    94 where $N$ designates the local Brunt-Vais\"{a}l\"{a} frequency (see \S\ref{TRA_bn2}),  
    95 $l_{\epsilon }$ and $l_{\kappa }$ are the dissipation and mixing turbulent  
    96 length scales, $P_{rt} $ is the Prandtl number. The constants $C_k = \sqrt {2} /2$ and  
    97 $C_\epsilon = 0.1$ are designed to deal with vertical mixing at any depth \citep{Gaspar1990}. They are set through namelist parameter \np{ediff} and \np{ediss}. $P_{rt} $ can be  
    98 set to unity or, following \citet{Blanke1993}, be a function of the  
    99 local Richardson number, $R_i $: 
     140where $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \S\ref{TRA_bn2}),  
     141$l_{\epsilon }$ and $l_{\kappa }$ are the dissipation and mixing length scales,  
     142$P_{rt} $ is the Prandtl number. The constants $C_k = \sqrt {2} /2$ and  
     143$C_\epsilon = 0.1$ are designed to deal with vertical mixing at any depth  
     144\citep{Gaspar1990}. They are set through namelist parameters \np{ediff}  
     145and \np{ediss}. $P_{rt} $ can be set to unity or, following \citet{Blanke1993},  
     146be a function of the local Richardson number, $R_i $: 
    100147\begin{align*} \label{Eq_prt} 
    101148P_{rt} = \begin{cases} 
     
    105152            \end{cases} 
    106153\end{align*} 
    107 Note that a horizontal Shapiro filter can be optionally applied to $R_i$. Nevertheless it is an obsolescent option that is notrecommanded.  The choice of $P_{rt} $ is controlled by \np{npdl} namelist parameter. 
    108  
    109 For computational efficiency, the original formulation of the turbulent length scales proposed by \citet{Gaspar1990} has been simplified. Four formulations are proposed, the choice of which is controlled by \np{nmxl} namelist parameter. The first two are based on the following first order approximation \citep{Blanke1993}: 
     154Note that a horizontal Shapiro filter can optionally be applied to $R_i$.  
     155However it is an obsolescent option that is not recommended.   
     156The choice of $P_{rt} $ is controlled by the \np{npdl} namelist parameter. 
     157 
     158For computational efficiency, the original formulation of the turbulence length  
     159scales proposed by \citet{Gaspar1990} has been simplified. Four formulations  
     160are proposed, the choice of which is controlled by the \np{nmxl} namelist  
     161parameter. The first two are based on the following first order approximation  
     162\citep{Blanke1993}: 
    110163\begin{equation} \label{Eq_tke_mxl0_1} 
    111164l_k = l_\epsilon = \sqrt {2 \bar e} / N 
    112165\end{equation} 
    113 which is obtained in a stable stratified region with constant values of the brunt-Vais\"{a}l\"{a} frequency. The resulting turbulent length scale is bounded by the distance to the surface or to the bottom (\np{nmxl}=0) or by the local vertical scale factor (\np{nmxl}=1). \citet{Blanke1993} notice that this simplification has two major drawbacks: it has no sense for local unstable  
    114 stratification and the computation no longer uses the whole information contained in the vertical density profile. To overcome this drawbacks, \citet{Madec1998} introduces the \np{nmxl}=2 or 3 cases, which add of an hypothesis on the vertical gradient of the computed length scale. So, the length scales are first evaluated as in \eqref{Eq_tke_mxl0_1} and then bounded such that: 
     166which is valid in a stable stratified region with constant values of the brunt- 
     167Vais\"{a}l\"{a} frequency. The resulting length scale is bounded by the distance  
     168to the surface or to the bottom (\np{nmxl}=0) or by the local vertical scale factor (\np{nmxl}=1). \citet{Blanke1993} notice that this simplification has two major  
     169drawbacks: it makes no sense for locally unstable stratification and the  
     170computation no longer uses all the information contained in the vertical density  
     171profile. To overcome these drawbacks, \citet{Madec1998} introduces the  
     172\np{nmxl}=2 or 3 cases, which add an extra assumption concerning the vertical  
     173gradient of the computed length scale. So, the length scales are first evaluated  
     174as in \eqref{Eq_tke_mxl0_1} and then bounded such that: 
    115175\begin{equation} \label{Eq_tke_mxl_constraint} 
    116176\frac{1}{e_3 }\left| {\frac{\partial l}{\partial k}} \right| \leq 1 
    117177\qquad \text{with }\  l =  l_k = l_\epsilon 
    118178\end{equation} 
    119  
    120 \eqref{Eq_tke_mxl_constraint} means that the vertical variations of the length scale cannot be  
    121 larger than the variations of depth. It provides a better approximation of the \citet{Gaspar1990} formulation while being much less time consuming. In particular, it allows the length scale to be limited not only by the distance to the surface or to the ocean bottom but also by the distance to a  
    122 strongly stratified portion of the water column such as the thermocline (Fig.~\ref{Fig_mixing_length}). In order to imposed \eqref{Eq_tke_mxl_constraint} constraint, we introduce two additonnal length scal: $l_{up}$ and $l_{dwn}$, the upward and downward length scale, and evaluate the dissipation and mixing turbulent length scales as (caution here we use the numerical indexation): 
     179\eqref{Eq_tke_mxl_constraint} means that the vertical variations of the length  
     180scale cannot be larger than the variations of depth. It provides a better  
     181approximation of the \citet{Gaspar1990} formulation while being much less  
     182time consuming. In particular, it allows the length scale to be limited not only  
     183by the distance to the surface or to the ocean bottom but also by the distance  
     184to a strongly stratified portion of the water column such as the thermocline  
     185(Fig.~\ref{Fig_mixing_length}). In order to impose the \eqref{Eq_tke_mxl_constraint}  
     186constraint, we introduce two additional length scales: $l_{up}$ and $l_{dwn}$,  
     187the upward and downward length scales, and evaluate the dissipation and  
     188mixing turbulence length scales as (and note that here we use numerical  
     189indexing): 
    123190%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    124191\begin{figure}[!t] \label{Fig_mixing_length}  \begin{center} 
     
    130197\begin{equation} \label{Eq_tke_mxl2} 
    131198\begin{aligned} 
    132  l_{up  }^{(k)} &= \min \left(  l^{(k)} \ , \ l_{up}^{(k+1)} + e_{3T}^{(k)} \right) 
     199 l_{up\ \ }^{(k)} &= \min \left(  l^{(k)} \ , \ l_{up}^{(k+1)} + e_{3T}^{(k)}\ \ \ \; \right) 
    133200    \quad &\text{ from $k=1$ to $jpk$ }\ \\ 
    134201 l_{dwn}^{(k)} &= \min \left(  l^{(k)} \ , \ l_{dwn}^{(k-1)} + e_{3T}^{(k-1)}  \right)    
     
    136203\end{aligned} 
    137204\end{equation} 
    138 where $l^{(k)}$ is compute using \eqref{Eq_tke_mxl0_1}, $i.e.$ $l^{(k)} = \sqrt {2 \bar e^{(k)} / N^{(k)} }$. 
    139  
    140 In the \np{nmxl}=2 case, the dissipation and mixing turbulent length scales take a same value: $ l_k=  l_\epsilon = \min \left(\ l_{up} \;,\;  l_{dwn}\ \right)$, while in the \np{nmxl}=2 case, the dissipation and mixing turbulent length scales are give as in \citet{Gaspar1990}: 
     205where $l^{(k)}$ is computed using \eqref{Eq_tke_mxl0_1},  
     206$i.e.$ $l^{(k)} = \sqrt {2 \bar e^{(k)} / N^{(k)} }$. 
     207 
     208In the \np{nmxl}=2 case, the dissipation and mixing length scales take the same  
     209value: $ l_k=  l_\epsilon = \min \left(\ l_{up} \;,\;  l_{dwn}\ \right)$, while in the  
     210\np{nmxl}=2 case, the dissipation and mixing turbulence length scales are give  
     211as in \citet{Gaspar1990}: 
    141212\begin{equation} \label{Eq_tke_mxl_gaspar} 
    142213\begin{aligned} 
     
    149220stress field: $\bar{e}=ebb\;\left| \tau \right|$ ($ebb=60$ by default)  
    150221with a minimal threshold of $emin0=10^{-4}~m^2.s^{-2}$ (namelist 
    151 parameters). Its bottom value is assumed to be equal to the value of the level just above. The time  
    152 integration of the $\bar{e}$ equation may formally lead to negative values  
    153 because the numerical scheme does not ensure the positivity. To overcome  
    154 this problem, a cut-off in the minimum value of $\bar{e}$ is used. Following  
    155 \citet{Gaspar1990}, the cut-off value is set to $\sqrt{2}/2~10^{-6}~m^2.s^{-2}$. This allows the subsequent formulations to match  
    156 \citet{Gargett1984} one for the diffusion in the thermocline and deep ocean  
    157 $(A^{vT} = 10^{-3} / N)$. In addition, a  
    158 cut-off is applied on $A^{vm}$ and $A^{vT}$ to avoid numerical  
     222parameters). Its value at the bottom of the ocean is assumed to be  
     223equal to the value of the level just above. The time integration of the  
     224$\bar{e}$ equation may formally lead to negative values because the  
     225numerical scheme does not ensure its positivity. To overcome this  
     226problem, a cut-off in the minimum value of $\bar{e}$ is used. Following  
     227\citet{Gaspar1990}, the cut-off value is set to $\sqrt{2}/2~10^{-6}~m^2.s^{-2}$.  
     228This allows the subsequent formulations to match that of\citet{Gargett1984}  
     229for the diffusion in the thermocline and deep ocean :  $(A^{vT} = 10^{-3} / N)$.  
     230In addition, a cut-off is applied on $A^{vm}$ and $A^{vT}$ to avoid numerical  
    159231instabilities associated with too weak vertical diffusion. They must be  
    160232specified at least larger than the molecular values, and are set through  
     
    172244 
    173245The KKP scheme has been implemented by J. Chanut ... 
     246 
    174247\colorbox{yellow}{Add a description of KPP here.} 
    175248 
     
    188261occur at particular ocean grid points. In nature, convective processes  
    189262quickly re-establish the static stability of the water column. These  
    190 processes have been removed from the model via the hydrostatic assumption:  
    191 they must be parameterized. Three parameterisations are available to deal  
    192 with convective processes: either a non-penetrative convective adjustment or  
    193 an enhanced vertical diffusion, or/and the use of a turbulent closure  
    194 scheme. 
     263processes have been removed from the model via the hydrostatic  
     264assumption so they must be parameterized. Three parameterizations  
     265are available to deal with convective processes: a non-penetrative  
     266convective adjustment or an enhanced vertical diffusion, or/and the  
     267use of a turbulent closure scheme. 
    195268 
    196269% ------------------------------------------------------------------------------------------------------------- 
     
    207280 
    208281%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    209 \begin{figure}[!ht] \label{Fig_npc}    \begin{center} 
     282\begin{figure}[!htb] \label{Fig_npc}   \begin{center} 
    210283\includegraphics[width=0.90\textwidth]{./Figures/Fig_npc.pdf} 
    211 \caption {Example of an unstable density profile treated by the non penetrative convective adjustment algorithm. $1^{st}$ step: the initial profile is checked from the surface to the bottom. It is found to be unstable between levels 3 and 4. They are mixed. The resulting $\rho$ is still larger than $\rho$(5): levels 3 to 5 are mixed. The resulting $\rho$ is still larger than $\rho$(6): levels 3 to 6 are mixed. The $1^{st}$ step ends since the density profile is then stable below the level 3. $2^{nd}$ step: the new $\rho$ profile is checked following the same procedure as in $1^{st}$ step: levels 2 to 5 are mixed. The new density profile is checked. It is found stable: end of algorithm.} 
     284\caption {Example of an unstable density profile treated by the non penetrative  
     285convective adjustment algorithm. $1^{st}$ step: the initial profile is checked from  
     286the surface to the bottom. It is found to be unstable between levels 3 and 4.  
     287They are mixed. The resulting $\rho$ is still larger than $\rho$(5): levels 3 to 5  
     288are mixed. The resulting $\rho$ is still larger than $\rho$(6): levels 3 to 6 are  
     289mixed. The $1^{st}$ step ends since the density profile is then stable below  
     290the level 3. $2^{nd}$ step: the new $\rho$ profile is checked following the same  
     291procedure as in $1^{st}$ step: levels 2 to 5 are mixed. The new density profile  
     292is checked. It is found stable: end of algorithm.} 
    212293\end{center}   \end{figure} 
    213294%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    214295 
    215 The non-penetrative convective adjustment algorithm is used when \np{ln\_zdfnpc}=T. It is applied at each \np{nnpc1} time step and mixes downwards instantaneously the statically unstable portion of the water column, but only until the density structure becomes neutrally stable ($i.e.$ until the mixed portion of the water column has \textit{exactly} the density of the water just below) \citep{Madec1991a}. This algorithm is an iterative process used in the following way  
    216 (Fig. \ref{Fig_npc}): going from the top of the ocean towards the bottom, the first  
    217 instability is searched. Assume in the following that the instability is  
    218 located between levels $k$ and $k+1$. The two levels are vertically mixed, for  
    219 potential temperature and salinity, conserving the heat and salt contents of  
    220 the water column. The new density is then computed by a linear  
    221 approximation. If the new density profile is still unstable between levels  
    222 $k+1$ and $k+2$, levels $k$, $k+1$ and $k+2$ are then mixed. This process is repeated until  
    223 stability is established below the level $k$ (the mixing process can go down to  
    224 the ocean bottom). The algorithm is repeated to check if the density profile  
     296The non-penetrative convective adjustment is used when \np{ln\_zdfnpc}=true.  
     297It is applied at each \np{nnpc1} time step and mixes downwards instantaneously  
     298the statically unstable portion of the water column, but only until the density  
     299structure becomes neutrally stable ($i.e.$ until the mixed portion of the water  
     300column has \textit{exactly} the density of the water just below) \citep{Madec1991a}.  
     301The associated algorithm is an iterative process used in the following way  
     302(Fig. \ref{Fig_npc}): starting from the top of the ocean, the first instability is  
     303found. Assume in the following that the instability is located between levels  
     304$k$ and $k+1$. The potential temperature and salinity in the two levels are  
     305vertically mixed, conserving the heat and salt contents of the water column.  
     306The new density is then computed by a linear approximation. If the new  
     307density profile is still unstable between levels $k+1$ and $k+2$, levels $k$,  
     308$k+1$ and $k+2$ are then mixed. This process is repeated until stability is  
     309established below the level $k$ (the mixing process can go down to the  
     310ocean bottom). The algorithm is repeated to check if the density profile  
    225311between level $k-1$ and $k$ is unstable and/or if there is no deeper instability. 
    226312 
    227 This algorithm is significantly different from mixing two by two statically unstable levels. The latter procedure cannot converge with a finite number  
    228 of iterations for some vertical profiles while the algorithm used in OPA  
    229 converges for any profile in a number of iterations less than the number of  
    230 vertical levels. This property is of paramount importance as pointed out by  
    231 \citet{Killworth1989}: it avoids the existence of permanent and unrealistic  
    232 static instabilities at the sea surface. This non-penetrative convective  
    233 algorithm has been proved successful in studying the deep water formation in  
    234 the north-western Mediterranean Sea \citep{Madec1991a, Madec1991b, Madec1991c}. 
    235  
    236 Note that in this algorithm the potential density referenced to the sea  
    237 surface is used to check whether the density profile is stable or not.  
    238 Moreover, the mixing in potential density is assumed to be linear. This  
    239 assures the convergence of the algorithm even when the equation of state is  
    240 non-linear. Small static instabilities can thus persist due to cabbeling:  
    241 they will be treated at the next time step. Moreover, temperature and  
    242 salinity, and thus density, are mixed, but the corresponding velocity fields  
    243 remain unchanged. When using a Richardson dependent eddy viscosity, the  
    244 mixing of momentum is done through the vertical diffusion: after a static  
    245 adjustment, the Richardson number is zero and thus the eddy viscosity  
    246 coefficient is at a maximum. When this algorithm is used with constant  
    247 vertical eddy viscosity, spurious solution can occur as the vertical  
    248 momentum diffusion remains small even after a static adjustment. In that  
    249 latter case, we recommend to add momentum mixing in a manner that mimics the  
    250 mixing in temperature and salinity \citep{Speich1992, Speich1996}. 
    251  
    252 %AMT This presentation fails to mention the big drawback of this scheme: many water masses of the world ocean, especially AABW, are unstable when represented in surface-referenced potential density sigma_0. The scheme erroneously mixes them up. 
     313This algorithm is significantly different from mixing statically unstable levels  
     314two by two. The latter procedure cannot converge with a finite number  
     315of iterations for some vertical profiles while the algorithm used in \NEMO  
     316converges for any profile in a number of iterations which is less than the  
     317number of vertical levels. This property is of paramount importance as  
     318pointed out by \citet{Killworth1989}: it avoids the existence of permanent  
     319and unrealistic static instabilities at the sea surface. This non-penetrative  
     320convective algorithm has been proved successful in studies of the deep  
     321water formation in the north-western Mediterranean Sea  
     322\citep{Madec1991a, Madec1991b, Madec1991c}. 
     323 
     324Note that in the current implementation of this algorithm presents several  
     325limitations. First, potential density referenced to the sea surface is used to  
     326check whether the density profile is stable or not. This is a strong  
     327simplification which leads to large errors for realistic ocean simulations.  
     328Indeed, many water masses of the world ocean, especially Antarctic Bottom 
     329Water, are unstable when represented in surface-referenced potential density.  
     330The scheme will erroneously mix them up. Second, the mixing of potential  
     331density is assumed to be linear. This assures the convergence of the algorithm  
     332even when the equation of state is non-linear. Small static instabilities can thus  
     333persist due to cabbeling: they will be treated at the next time step.  
     334Third, temperature and salinity, and thus density, are mixed, but the  
     335corresponding velocity fields remain unchanged. When using a Richardson  
     336Number dependent eddy viscosity, the mixing of momentum is done through  
     337the vertical diffusion: after a static adjustment, the Richardson Number is zero  
     338and thus the eddy viscosity coefficient is at a maximum. When this convective  
     339adjustment algorithm is used with constant vertical eddy viscosity, spurious  
     340solutions can occur since the vertical momentum diffusion remains small even  
     341after a static adjustment. In that case, we recommend the addition of momentum  
     342mixing in a manner that mimics the mixing in temperature and salinity  
     343\citep{Speich1992, Speich1996}. 
    253344 
    254345% ------------------------------------------------------------------------------------------------------------- 
     
    263354%-------------------------------------------------------------------------------------------------------------- 
    264355 
    265 The enhanced vertical diffusion parameterization is used when \np{ln\_zdfevd} is  
    266 defined. In this case, the vertical eddy mixing coefficients are assigned to be very large (a typical value is $1\;m^2s^{-1})$ in regions where the stratification is unstable (i.e. when the Brunt-Vais\"{a}l\"{a} frequency is negative) \citep{Lazar1997, Lazar1999}. This is done either on tracers only (\np{n\_evdm}=0) or on both momentum and  
    267 tracers (\np{n\_evdm}=1) mixing coefficients. 
    268  
    269 In practice, when $N^2\leq 10^{-12}$, $A_T^{vT}$ and $A_T^{vS}$ are set to a large value,  
    270 \np{avevd}, and  if \np{n\_evdm}=1, the four neighbouring $A_u^{vm} \;\mbox{and}\;A_v^{vm} $ . Typical value for $avevd$ is in-between 1 and $100~m^2.s^{-1}$. This parameterisation of convective processes is less time consuming than the convective adjustment algorithm presented above when mixing both tracers and momentum in case of static instabilities. It requires the use of an implicit time stepping on vertical diffusion terms (i.e. \np{ln\_zdfexp}=F).  
     356The enhanced vertical diffusion parameterization is used when \np{ln\_zdfevd}=true.  
     357In this case, the vertical eddy mixing coefficients are assigned very large values  
     358(a typical value is $10\;m^2s^{-1})$ in regions where the stratification is unstable  
     359($i.e.$ when the Brunt-Vais\"{a}l\"{a} frequency is negative) \citep{Lazar1997, Lazar1999}.  
     360This is done either on tracers only (\np{n\_evdm}=0) or on both momentum and  
     361tracers (\np{n\_evdm}=1). 
     362 
     363In practice, where $N^2\leq 10^{-12}$, $A_T^{vT}$ and $A_T^{vS}$, and  
     364if \np{n\_evdm}=1, the four neighbouring $A_u^{vm} \;\mbox{and}\;A_v^{vm}$  
     365values also, are set equal to the namelist parameter \np{avevd}. A typical value  
     366for $avevd$ is between 1 and $100~m^2.s^{-1}$. This parameterization of  
     367convective processes is less time consuming than the convective adjustment  
     368algorithm presented above when mixing both tracers and momentum in the  
     369case of static instabilities. It requires the use of an implicit time stepping on  
     370vertical diffusion terms (i.e. \np{ln\_zdfexp}=false).  
    271371 
    272372% ------------------------------------------------------------------------------------------------------------- 
     
    276376\label{ZDF_tcs} 
    277377 
    278 The turbulent closure scheme presented in \S\ref{ZDF_tke} and used when the  
    279 \key{zdftke} is defined allows, in theory, to deal with  
    280 statically unstable density profiles. In such a  
    281 case, the term of destruction of turbulent kinetic energy through  
    282 stratification in \eqref{Eq_zdftke_e} becomes a source term as $N^2$ is negative. It  
    283 results large values of both $A_T^{vT}$ and the four neighbouring$A_u^{vm}  
    284 {and}\;A_v^{vm} $ (up to $1\;m^2s^{-1})$ that are able to restore the  
    285 static stability of the water column in a way similar to that of the  
    286 enhanced vertical diffusion parameterization (\S\ref{ZDF_evd}). Nevertheless, the  
    287 eddy coefficients computed by the turbulent scheme do usually not exceed 
    288 $10^{-2}m.s^{-1}$ in the vicinity of the sea surface (first ocean layer) due to  
    289 the bound of the turbulent length scale by the distance to the sea surface  
    290 (see {\S}VI.7-c). It can thus be useful to combine the enhanced vertical  
    291 diffusion with the turbulent closure, i.e. defining \np{np\_zdfevd} and  
    292 \key{zdftke} CPP variables all together. 
    293  
    294 The KPP scheme includes enhanced vertical diffusion in the case of convection, as governed by the variables $bvsqcon$ and $difcon$ found in \mdl{zdfkpp}, therefore \np{np\_zdfevd} should not be used with the KPP scheme. %gm%  + one word on non local flux with KPP scheme 
    295  
     378The TKE turbulent closure scheme presented in \S\ref{ZDF_tke} and used  
     379when the \key{zdftke} is defined, in theory solves the problem of statically  
     380unstable density profiles. In such a case, the term corresponding to the  
     381destruction of turbulent kinetic energy through stratification in \eqref{Eq_zdftke_e}  
     382becomes a source term, since $N^2$ is negative. It results in large values of  
     383$A_T^{vT}$ and  $A_T^{vT}$, and also the four neighbouring  
     384$A_u^{vm} {and}\;A_v^{vm}$ (up to $1\;m^2s^{-1})$. These large values  
     385restore the static stability of the water column in a way similar to that of the  
     386enhanced vertical diffusion parameterization (\S\ref{ZDF_evd}). However,  
     387in the vicinity of the sea surface (first ocean layer), the eddy coefficients  
     388computed by the turbulence scheme do not usually exceed $10^{-2}m.s^{-1}$,  
     389because the mixing length scale is bounded by the distance to the sea surface  
     390(see \S\ref{ZDF_tke}). It can thus be useful to combine the enhanced vertical  
     391diffusion with the turbulent closure scheme, $i.e.$ setting the \np{ln\_zdfnpc}  
     392namelist parameter to true and defining the \key{zdftke} CPP key all together. 
     393 
     394The KPP turbulent closure scheme already includes enhanced vertical diffusion  
     395in the case of convection, as governed by the variables $bvsqcon$ and $difcon$  
     396found in \mdl{zdfkpp}, therefore \np{np\_zdfevd} should not be used with the KPP  
     397scheme. %gm%  + one word on non local flux with KPP scheme trakpp.F90 module... 
    296398 
    297399% ================================================================ 
     
    306408%-------------------------------------------------------------------------------------------------------------- 
    307409 
    308 Double diffusion occurs when relatively warm, salty water overlies cooler, fresher water, or vice versa. The former condition leads to salt fingering and the latter to diffusive convection. Double-diffusive phenomena contribute to diapycnal mixing in extensive regions of the oceans.  \citet{Merryfield1999} include a parameterization of such phenomena in a global ocean model and show that it leads to relatively minor changes in circulation but exerts significant regional influences on temperature and salinity.  
     410Double diffusion occurs when relatively warm, salty water overlies cooler, fresher  
     411water, or vice versa. The former condition leads to salt fingering and the latter  
     412to diffusive convection. Double-diffusive phenomena contribute to diapycnal  
     413mixing in extensive regions of the ocean.  \citet{Merryfield1999} include a  
     414parameterization of such phenomena in a global ocean model and show that  
     415it leads to relatively minor changes in circulation but exerts significant regional  
     416influences on temperature and salinity.  
    309417 
    310418Diapycnal mixing of S and T are described by diapycnal diffusion coefficients  
     
    313421    &A^{vS} = A_o^{vS}+A_f^{vS}+A_d^{vS} 
    314422\end{align*} 
    315 where subscript $f$ represents mixing by salt fingering,  
    316 $d$ by diffusive convection, and $o$ by processes other than  
    317 double diffusion. The rates of double-diffusive mixing depend on buoyancy ratio $R_\rho = \alpha \partial_z T / \partial_z S$, where $\alpha$ and $\beta$ are coefficients of thermal expansion and saline contraction (see \S\ref{TRA_eos}. To represent mixing of $S$ and $T$ by salt fingering, we adopt the diapycnal diffusivities suggested by Schmitt (1981): 
     423where subscript $f$ represents mixing by salt fingering, $d$ by diffusive convection,  
     424and $o$ by processes other than double diffusion. The rates of double-diffusive mixing depend on the buoyancy ratio $R_\rho = \alpha \partial_z T / \beta \partial_z S$,  
     425where $\alpha$ and $\beta$ are coefficients of thermal expansion and saline  
     426contraction (see \S\ref{TRA_eos}). To represent mixing of $S$ and $T$ by salt  
     427fingering, we adopt the diapycnal diffusivities suggested by Schmitt (1981): 
    318428\begin{align} \label{Eq_zdfddm_f} 
    319429A_f^{vS} &=    \begin{cases} 
     
    321431   0                              &\text{otherwise}  
    322432            \end{cases}    
    323 \\ 
     433\\           \label{Eq_zdfddm_f_T} 
    324434A_f^{vT} &= 0.7 \ A_f^{vS} / R_\rho  
    325435\end{align} 
     
    328438\begin{figure}[!t] \label{Fig_zdfddm}  \begin{center} 
    329439\includegraphics[width=0.99\textwidth]{./Figures/Fig_zdfddm.pdf} 
    330 \caption {From \citet{Merryfield1999} : (a) Diapycnal diffusivities $A_f^{vT}$ and $A_f^{vS}$ for temperature and salt in regions of salt fingering. Heavy curves denote $A^{\ast v} = 10^{-3}~m^2.s^{-1}$ and thin curves $A^{\ast v} = 10^{-4}~m^2.s^{-1}$ ; (b) diapycnal diffusivities $A_d^{vT}$ and $A_d^{vT}$ for temperature and salt in regions of diffusive convection. Heavy curves denote the Federov parameterization and thin curves the Kelley parameterization. The latter is not implemented in \NEMO } 
     440\caption {From \citet{Merryfield1999} : (a) Diapycnal diffusivities $A_f^{vT}$  
     441and $A_f^{vS}$ for temperature and salt in regions of salt fingering. Heavy  
     442curves denote $A^{\ast v} = 10^{-3}~m^2.s^{-1}$ and thin curves  
     443$A^{\ast v} = 10^{-4}~m^2.s^{-1}$ ; (b) diapycnal diffusivities $A_d^{vT}$ and  
     444$A_d^{vS}$ for temperature and salt in regions of diffusive convection. Heavy  
     445curves denote the Federov parameterization and thin curves the Kelley  
     446parameterization. The latter is not implemented in \NEMO. } 
    331447\end{center}    \end{figure} 
    332448%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    333449 
    334 The factor 0.7 in \eqref{Eq_zdfddm_f} reflects the measured ratio $\alpha F_T /\beta F_S \approx  0.7$ of buoyancy fluxes due to transport of heat and salt (e.g., McDougall and Taylor 1984). Following  \citet{Merryfield1999}, we adopt $R_c = 1.6$, $n = 6$, and $A^{\ast v} = 10^{-4}~m^2.s^{-1}$. 
     450The factor 0.7 in \eqref{Eq_zdfddm_f_T} reflects the measured ratio  
     451$\alpha F_T /\beta F_S \approx  0.7$ of buoyancy flux of heat to buoyancy  
     452flux of salt ($e.g.$, \citet{McDougall_Taylor_JMR84}). Following  \citet{Merryfield1999},  
     453we adopt $R_c = 1.6$, $n = 6$, and $A^{\ast v} = 10^{-4}~m^2.s^{-1}$. 
    335454 
    336455To represent mixing of S and T by diffusive layering,  the diapycnal diffusivities suggested by Federov (1988) is used:  
    337 \begin{align} \label{Eq_zdfddm_d} 
     456\begin{align}  \label{Eq_zdfddm_d} 
    338457A_d^{vT} &=    \begin{cases} 
    339458   1.3635 \, \exp{\left( 4.6\, \exp{ \left[  -0.54\,( R_{\rho}^{-1} - 1 )  \right] }    \right)} 
     
    341460   0                       &\text{otherwise}  
    342461            \end{cases}    
    343 \\ 
     462\\          \label{Eq_zdfddm_d_S} 
    344463A_d^{vS} &=    \begin{cases} 
    345464   A_d^{vT}\ \left( 1.85\,R_{\rho} - 0.85 \right) 
     
    351470\end{align} 
    352471 
    353 The dependences of \eqref{Eq_zdfddm_f} to \eqref{Eq_zdfddm_d} on $R_\rho$ are illustrated in Fig.~\ref{Fig_zdfddm}. Implementing this requires computing $R_\rho$ at each  
    354 grid point and time step. This is done in \mdl{eosbn2} at the same time as $N^2$ is computed. This avoids duplication in the computation of $\alpha$ and $\beta$ (which is usually quite expensive). 
    355  
     472The dependencies of \eqref{Eq_zdfddm_f} to \eqref{Eq_zdfddm_d_S} on $R_\rho$  
     473are illustrated in Fig.~\ref{Fig_zdfddm}. Implementing this requires computing  
     474$R_\rho$ at each grid point on every time step. This is done in \mdl{eosbn2} at the  
     475same time as $N^2$ is computed. This avoids duplication in the computation of  
     476$\alpha$ and $\beta$ (which is usually quite expensive). 
    356477 
    357478% ================================================================ 
     
    366487%-------------------------------------------------------------------------------------------------------------- 
    367488 
    368 Both surface momentum flux (wind stress) and the bottom momentum flux  
    369 (bottom friction) enter the equations as a condition on the vertical  
     489Both the surface momentum flux (wind stress) and the bottom momentum  
     490flux (bottom friction) enter the equations as a condition on the vertical  
    370491diffusive flux. For the bottom boundary layer, one has: 
    371492\begin{equation} \label{Eq_zdfbfr_flux} 
     
    3764971~m in the ocean). How $\textbf{F}_h$ influences the interior depends on the  
    377498vertical resolution of the model near the bottom relative to the Ekman layer  
    378 depth. For example, in order to obtain an Ekman layer depth $d = \sqrt{2\;A^{vm}} / f = 50$~m, one needs a vertical diffusion coefficient $A^{vm} = 0.125$~m$^2$s$^{-1}$ (for a Coriolis  
    379 frequency $f = 10^{-4}$~m$^2$s$^{-1}$). With a background diffusion coefficient  
    380 $A^{vm} = 10^{-4}$~m$^2$s$^{-1}$, the Ekman layer depth is only 1.4~m. When the vertical mixing coefficient is this small, using a flux condition is equivalent to entering the  
    381 viscous forces (either wind stress or bottom friction) as a body force over  
    382 the depth of the top or bottom model layer. To illustrate this, consider the  
    383 equation for $u$ at $k$, the last ocean level: 
     499depth. For example, in order to obtain an Ekman layer depth  
     500$d = \sqrt{2\;A^{vm}} / f = 50$~m, one needs a vertical diffusion coefficient  
     501$A^{vm} = 0.125$~m$^2$s$^{-1}$ (for a Coriolis frequency  
     502$f = 10^{-4}$~m$^2$s$^{-1}$). With a background diffusion coefficient  
     503$A^{vm} = 10^{-4}$~m$^2$s$^{-1}$, the Ekman layer depth is only 1.4~m.  
     504When the vertical mixing coefficient is this small, using a flux condition is  
     505equivalent to entering the viscous forces (either wind stress or bottom friction)  
     506as a body force over the depth of the top or bottom model layer. To illustrate  
     507this, consider the equation for $u$ at $k$, the last ocean level: 
    384508\begin{equation} \label{Eq_zdfbfr_flux2} 
    385509\frac{\partial u \; (k)}{\partial t} = \frac{1}{e_{3u}} \left[ A^{vm} \; (k) \frac{U \; (k-1) - U \; (k)}{e_{3uw} \; (k-1)} - F_u \right] \approx - \frac{F_u}{e_{3u}} 
    386510\end{equation} 
    387 For example, if the bottom layer thickness is 200~m, the Ekman transport will be  
    388 distributed over that depth. On the other hand, if the vertical resolution  
     511For example, if the bottom layer thickness is 200~m, the Ekman transport will  
     512be distributed over that depth. On the other hand, if the vertical resolution  
    389513is high (1~m or less) and a turbulent closure model is used, the turbulent  
    390514Ekman layer will be represented explicitly by the model. However, the  
    391515logarithmic layer is never represented in current primitive equation model  
    392 applications: it is \emph{necessary} to parameterize the flux $\textbf{F}_h $. Two  
    393 choices are available in OPA: a linear and a quadratic bottom friction. Note  
    394 that in both cases, the rotation between the interior velocity and the  
    395 bottom friction is neglected in the present release of OPA. 
     516applications: it is \emph{necessary} to parameterize the flux $\textbf{F}_h $.  
     517Two choices are available in \NEMO: a linear and a quadratic bottom friction.  
     518Note that in both cases, the rotation between the interior velocity and the  
     519bottom friction is neglected in the present release of \NEMO. 
    396520 
    397521% ------------------------------------------------------------------------------------------------------------- 
    398522%       Linear Bottom Friction 
    399523% ------------------------------------------------------------------------------------------------------------- 
    400 \subsection{Linear Bottom Friction} 
     524\subsection{Linear Bottom Friction (\np{nbotfr} = 1) } 
    401525\label{ZDF_bfr_linear} 
    402526 
    403 %-------------------------------------------nambfr-------------------------------------------------------- 
    404 \begin{flushright} 
    405 (\textbf{namelist} !nbotfr :\textit{ nbotfr = 0, = 1 or = 3}) 
    406 \end{flushright} 
    407  
    408 The linear bottom friction parameterization assumes that the bottom friction is proportional to the interior velocity (i.e. the velocity of the last model level): 
     527The linear bottom friction parameterization assumes that the bottom friction  
     528is proportional to the interior velocity (i.e. the velocity of the last model level): 
    409529\begin{equation} \label{Eq_zdfbfr_linear} 
    410 \textbf{F}_h = \frac{A^{vm}}{e_3} \; \frac{\partial \textbf{U}_h}{\partial k} = r \textbf{U}_h^b 
    411 \end{equation} 
    412 where $\textbf{U}_h^b$ is the horizontal velocity vector of the bottom  
    413 ocean layer and $r$ a friction coefficient expressed in m.s$^{-1}$. This  
    414 coefficient is generally estimated by setting a typical decay time $\tau $ in the  
    415 deep ocean, $r = H / \tau$. Commonly accepted values of $\tau$ are of the  
    416 order of 100 to 200 days \citep{Weatherly1984}. A value $\tau^{-1} = 10^{-7}$~s$^{-1}$  
    417 corresponding to 115 days is usually used in quasi-geostrophic models. One may  
    418 consider the linear friction as an approximation of quadratic friction,  
    419 $r \approx 2\;C_D\;U_{av}$ (\citet{Gill1982}, Eq. 9.6.6). With a drag coefficient $C_D = 0.002$, a typical value of tidal currents $U_{av} =0.1$~m.s$^{-1}$,  
    420 and assuming an ocean depth $H = 4000$~m, the resulting friction  
    421 coefficient is $r = 4\;10^{-4}$~m.s$^{-1}$. This is the default value used in  
    422 OPA. It corresponds to a decay time scale of 115~days. It can be changed by  
    423 specifying \np{bfric1} (namelist parameter). 
    424  
    425 In the code, the bottom friction is specified by updating the value of the  
    426 vertical eddy coefficient at the bottom level. Indeed, the discrete  
    427 formulation of (\ref{Eq_zdfbfr_linear}) at the last ocean $T-$level, using the fact that  
    428 $\textbf {U}_h =0$ inside the bottom, leads to 
     530\textbf{F}_h = \frac{A^{vm}}{e_3} \; \frac{\partial \textbf{U}_h}{\partial k} = r \; \textbf{U}_h^b 
     531\end{equation} 
     532where $\textbf{U}_h^b$ is the horizontal velocity vector of the bottom ocean  
     533layer and $r$ is a friction coefficient expressed in m.s$^{-1}$. This coefficient  
     534is generally estimated by setting a typical decay time $\tau$ in the deep ocean,  
     535and setting $r = H / \tau$, where $H$ is the ocean depth. Commonly accepted  
     536values of $\tau$ are of the order of 100 to 200 days \citep{Weatherly1984}.  
     537A value $\tau^{-1} = 10^{-7}$~s$^{-1}$ equivalent to 115 days, is usually used  
     538in quasi-geostrophic models. One may consider the linear friction as an  
     539approximation of quadratic friction, $r \approx 2\;C_D\;U_{av}$ (\citet{Gill1982},  
     540Eq. 9.6.6). For example, with a drag coefficient $C_D = 0.002$, a typical speed  
     541of tidal currents of $U_{av} =0.1$~m.s$^{-1}$, and assuming an ocean depth  
     542$H = 4000$~m, the resulting friction coefficient is $r = 4\;10^{-4}$~m.s$^{-1}$.  
     543This is the default value used in \NEMO. It corresponds to a decay time scale  
     544of 115~days. It can be changed by specifying \np{bfric1} (namelist parameter). 
     545 
     546In the code, the bottom friction is imposed by updating the value of the  
     547vertical eddy coefficient at the bottom level. Indeed, the discrete formulation  
     548of (\ref{Eq_zdfbfr_linear}) at the last ocean $T-$level, using the fact that  
     549$\textbf {U}_h =0$ below the ocean floor, leads to 
    429550\begin{equation} \label{Eq_zdfbfr_linKz} 
    430551\begin{split} 
    431552A_u^{vm} &= r\;e_{3uw}\\ 
    432 A_v^{vm} &= r\;e_{3uw}\\ 
     553A_v^{vm} &= r\;e_{3vw}\\ 
    433554\end{split} 
    434555\end{equation} 
    435556 
    436 Such an update is done in \mdl{zdfbfr} when \np{nbotfr}=1 and the value of $r$ used is  
    437 \np{bfric1}. Setting \np{nbotfr}=3 is equivalent to set $r=0$ and leads to a free-slip bottom boundary condition,  
    438 while setting \np{nbotfr}=0 imposes $r=2\;A_{vb}^{\rm {\bf U}} $, where $A_{vb}^{\rm {\bf U}} $ is the  
    439 background vertical eddy coefficient: a no-slip boundary condition is used.  
     557This update is done in \mdl{zdfbfr} when \np{nbotfr}=1. The value of $r$  
     558used is \np{bfric1}. Setting \np{nbotfr}=3 is equivalent to setting $r=0$ and  
     559leads to a free-slip bottom boundary condition. Setting \np{nbotfr}=0 sets  
     560$r=2\;A_{vb}^{\rm {\bf U}} $, where $A_{vb}^{\rm {\bf U}} $ is the background  
     561vertical eddy coefficient, and a no-slip boundary condition is imposed.  
    440562Note that this latter choice generally leads to an underestimation of the  
    441 bottom friction: for a deepest level thickness of $200~m$ and $A_{vb}^{\rm {\bf U}}  
    442 =10^{-4}$m$^2$.s$^{-1}$, the friction coefficient is only $r=10^{-6}$m.s$^{-1}$. 
    443  
     563bottom friction: for example with a deepest level thickness of $200~m$  
     564and $A_{vb}^{\rm {\bf U}} =10^{-4}$m$^2$.s$^{-1}$, the friction coefficient  
     565is only $r=10^{-6}$m.s$^{-1}$. 
    444566 
    445567% ------------------------------------------------------------------------------------------------------------- 
    446568%       Non-Linear Bottom Friction 
    447569% ------------------------------------------------------------------------------------------------------------- 
    448 \subsection{Non-Linear Bottom Friction} 
     570\subsection{Non-Linear Bottom Friction (\np{nbotfr} = 2)} 
    449571\label{ZDF_bfr_nonlinear} 
    450  
    451 \begin{center} 
    452 (\textbf{namelist} !nbotfr : \textit{nbotfr = 2}) 
    453 \end{center} 
    454572 
    455573The non-linear bottom friction parameterization assumes that the bottom  
     
    460578\end{equation} 
    461579 
    462 with $\textbf{U}_h^b = (u_b\;,\;v_b)$ the horizontal interior velocity (i.e. the horizontal velocity of the bottom ocean layer), $C_D$ a drag coefficient, and $e_b $ a bottom turbulent kinetic energy due to tides, internal waves breaking and other short time scale currents. A typical value of the drag coefficient is $C_D = 10^{-3} $. As an example, the CME experiment \citep{Treguier1992} uses $C_D = 10^{-3}$ and $e_b = 2.5\;10^{-3}$m$^2$.s$^{-2}$, while the FRAM experiment \citep{Killworth1992} uses $e_b =0$  
    463 and $e_b =2.5\;\;10^{-3}$m$^2$.s$^{-2}$. The FRAM choices have been set as  
    464 default value (\np{bfric2} and \np{bfeb2} namelist parameters). 
    465  
    466 As for the linear case, the bottom friction is specified in the code by  
     580with $\textbf{U}_h^b = (u_b\;,\;v_b)$ the horizontal interior velocity ($i.e.$  
     581the horizontal velocity of the bottom ocean layer), $C_D$ a drag coefficient,  
     582and $e_b $ a bottom turbulent kinetic energy due to tides, internal waves  
     583breaking and other short time scale currents. A typical value of the drag  
     584coefficient is $C_D = 10^{-3} $. As an example, the CME experiment  
     585\citep{Treguier1992} uses $C_D = 10^{-3}$ and $e_b = 2.5\;10^{-3}$m$^2$.s$^{-2}$,  
     586while the FRAM experiment \citep{Killworth1992} uses $e_b =0$  
     587and $e_b =2.5\;\;10^{-3}$m$^2$.s$^{-2}$. The FRAM choices have been  
     588set as default values (\np{bfric2} and \np{bfeb2} namelist parameters). 
     589 
     590As for the linear case, the bottom friction is imposed in the code by  
    467591updating the value of the vertical eddy coefficient at the bottom level: 
    468  
    469592\begin{equation} \label{Eq_zdfbfr_nonlinKz} 
    470593\begin{split} 
    471594A_u^{vm} &=C_D\; e_{3uw} \left[ u^2 + \left(\bar{\bar{v}}^{i+1,j}\right)^2 + e_b \right]^ 
    472595{1/2}\\ 
    473 A_v^{vm} &=C_D\; e_{3uw} \left[  \left(\bar{\bar{u}}^{i+1,j}\right)^2 + v^2 + e_b \right]^{1/2}\\ 
     596A_v^{vm} &=C_D\; e_{3uw} \left[  \left(\bar{\bar{u}}^{i,j+1}\right)^2 + v^2 + e_b \right]^{1/2}\\ 
    474597\end{split} 
    475598\end{equation} 
    476599 
    477600This update is done in \mdl{zdfbfr}. The coefficients that control the strength of the  
    478 non-linear bottom friction are initialized as namelist parameters: ($C_D$= \np{bfri2}, and $e_b$ =\np{bfeb2}). 
    479  
    480 % ================================================================ 
     601non-linear bottom friction are initialized as namelist parameters: $C_D$= \np{bfri2}, and $e_b$ =\np{bfeb2}. 
     602 
     603% ================================================================ 
Note: See TracChangeset for help on using the changeset viewer.