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 11512 for NEMO – NEMO

Changeset 11512 for NEMO


Ignore:
Timestamp:
2019-09-09T12:05:20+02:00 (5 years ago)
Author:
smasson
Message:

dev_r10984_HPC-13 : merge with trunk@11511, see #2285

Location:
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization
Files:
53 edited
1 copied

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/definitions.tex

    r11263 r11512  
    1 %% Engine (folder name) 
     1%% Engine (subfolder name) 
    22\def \engine{NEMO} 
    33 
    4 %% Title (variable name already use by 'titling' pkg) 
     4%% Title and cover page settings 
     5\def \spacetop{  \vspace*{1.85cm} } 
    56\def \heading{NEMO ocean engine} 
     7\def \subheading{} 
     8\def \spacedown{ \vspace*{0.75cm } } 
     9\def \authorswidth{ 0.3\linewidth} 
     10\def \rulelenght{270pt} 
     11\def \abstractwidth{0.6\linewidth} 
    612 
    7 %% Authors (thanks will apply to the second author) 
    8 \def \firstauthor{Gurvan Madec~} 
    9 \def \secondauthor{NEMO System Team} 
     13%% Color for document (frontpage banner, links  and chapter boxes) 
     14\def \setcolor{ \definecolor{manualcolor}{cmyk}{1, .60, 0, .40} } 
    1015 
    1116%% IPSL publication number 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/foreword.tex

    r11263 r11512  
    1 % ================================================================ 
    2 % Foreword 
    3 % ================================================================ 
    4 \chapter*{Foreword} 
     1%% ================================================================ 
     2%% Abstract 
     3%% ================================================================ 
    54 
    6 The ocean engine of NEMO (Nucleus for European Modelling of the Ocean) is a primitive equation model adapted to 
    7 regional and global ocean circulation problems. 
    8 It is intended to be a flexible tool for studying the ocean and its interactions with the others components of 
    9 the earth climate system over a wide range of space and time scales. 
     5%% Common part between NEMO-SI3-TOP 
     6\NEMO\ (``Nucleus for European Modelling of the Ocean'') is a framework of ocean-related engines. 
     7It is intended to be a flexible tool for studying the ocean dynamics and thermodynamics (``blue ocean''), 
     8as well as its interactions with the components of the Earth climate system over 
     9a wide range of space and time scales. 
     10Within \NEMO, the ocean engine is interfaced with a sea-ice model (\SIcube\ or 
     11\href{http://github.com/CICE-Consortium/CICE}{CICE}), 
     12passive tracers and biogeochemical models (\TOP) and, 
     13via the \href{http://portal.enes.org/oasis}{OASIS} coupler, 
     14with several atmospheric general circulation models. 
     15It also supports two-way grid embedding by means of the \href{http://agrif.imag.fr}{AGRIF} software. 
    1016 
     17%% Specific part 
     18The primitive equation model is adapted to regional and global ocean circulation problems down to 
     19kilometric scale. 
    1120Prognostic variables are the three-dimensional velocity field, a non-linear sea surface height, 
    1221the \textit{Conservative} Temperature and the \textit{Absolute} Salinity. 
    13 In the horizontal direction, the model uses a curvilinear orthogonal grid and in the vertical direction, 
    14 a full or partial step $z$-coordinate, or $s$-coordinate, or a mixture of the two. 
     22In the horizontal direction, the model uses a curvilinear orthogonal grid and 
     23in the vertical direction, a full or partial step $z$-coordinate, or $s$-coordinate, or 
     24a mixture of the two. 
    1525The distribution of variables is a three-dimensional Arakawa C-type grid. 
    16 Various physical choices are available to describe ocean physics, including TKE, and GLS vertical physics. 
    17  
    18 Within NEMO, the ocean is interfaced with a sea-ice model (SI$^3$) 
    19  %or \href{https://github.com/CICE-Consortium/CICE}{CICE}), 
    20 passive tracer and biogeochemical models (TOP-PISCES) and, 
    21 via the \href{https://portal.enes.org/oasis}{OASIS} coupler, with several atmospheric general circulation models. 
    22 It also support two-way grid embedding via the \href{http://agrif.imag.fr}{AGRIF} software. 
     26Various physical choices are available to describe ocean physics, 
     27so as various HPC functionalities to improve performances. 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/main/thanks.tex

    r11263 r11512  
    1 J\'{e}r\^{o}me Chanut, 
    2 Silvia Mocavero 
     1%Romain Bourdall\'{e}-Badie 
     2%\orcid{0000-0002-8742-3289} \\ 
     3%Mike Bell                   \\ 
     4%J\'{e}r\^{o}me Chanut       \\ 
     5%Emanuela Clementi 
     6%\orcid{0000-0002-5752-1849} \\ 
     7%Andrew Coward 
     8%\orcid{0000-0002-0456-129X} \\ 
     9%Massimiliano Drudi 
     10%\orcid{0000-0002-9951-740X} \\ 
     11%Christian \'{E}th\'{e}      \\ 
     12%Doroteaciro Iovino 
     13%\orcid{0000-0001-5132-7255} \\ 
     14%Dan Lea                     \\ 
     15%Claire L\'{e}vy 
     16%\orcid{0000-0003-2518-6692} \\ 
     17%Gurvan Madec 
     18%\orcid{0000-0002-6447-4198} \\ 
     19%Nicolas Martin              \\ 
     20%S\'{e}bastien Masson 
     21%\orcid{0000-0002-1694-8117} \\ 
     22%Pierre Mathiot              \\ 
     23%Silvia Mocavero 
     24%\orcid{0000-0002-6309-8282} \\ 
     25%Simon M\"{u}ller            \\ 
     26%George Nurser               \\ 
     27%Guillaume Samson 
     28%\orcid{0000-0001-7481-6369} \\ 
     29%Dave Storkey 
     30 
     31\orcid{0000-0002-8742-3289} Romain Bourdall\'{e}-Badie  \\ 
     32                            Mike Bell                   \\ 
     33                            J\'{e}r\^{o}me Chanut       \\ 
     34\orcid{0000-0002-5752-1849} Emanuela Clementi           \\ 
     35\orcid{0000-0002-0456-129X} Andrew Coward               \\ 
     36\orcid{0000-0002-9951-740X} Massimiliano Drudi          \\ 
     37                            Christian \'{E}th\'{e}      \\ 
     38\orcid{0000-0001-5132-7255} Doroteaciro Iovino          \\ 
     39                            Dan Lea                     \\ 
     40\orcid{0000-0003-2518-6692} Claire L\'{e}vy             \\ 
     41\orcid{0000-0002-6447-4198} Gurvan Madec                \\ 
     42                            Nicolas Martin              \\ 
     43\orcid{0000-0002-1694-8117} S\'{e}bastien Masson        \\ 
     44                            Pierre Mathiot              \\ 
     45\orcid{0000-0002-6309-8282} Silvia Mocavero             \\ 
     46                            Simon M\"{u}ller            \\ 
     47                            George Nurser               \\ 
     48\orcid{0000-0001-7481-6369} Guillaume Samson            \\ 
     49                            Dave Storkey 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/annex_A.tex

    r11353 r11512  
    99\label{apdx:A} 
    1010 
    11 \minitoc 
     11\chaptertoc 
    1212 
    1313\vfill 
     
    3131 
    3232In order to establish the set of Primitive Equation in curvilinear $s$-coordinates 
    33 (\ie an orthogonal curvilinear coordinate in the horizontal and 
     33(\ie\ an orthogonal curvilinear coordinate in the horizontal and 
    3434an Arbitrary Lagrangian Eulerian (ALE) coordinate in the vertical), 
    3535we start from the set of equations established in \autoref{subsec:PE_zco_Eq} for 
     
    329329\] 
    330330This leads to the $s-$coordinate formulation of the total $z-$coordinate time derivative, 
    331 \ie the total $s-$coordinate time derivative : 
     331\ie\ the total $s-$coordinate time derivative : 
    332332\begin{align} 
    333333  \label{apdx:A_sco_Dt_vect} 
     
    368368% 
    369369Introducing the vertical scale factor inside the horizontal derivative of the first two terms  
    370 (\ie the horizontal divergence), it becomes : 
     370(\ie\ the horizontal divergence), it becomes : 
    371371\begin{align*} 
    372372  { 
     
    411411\end{align*} 
    412412which leads to the $s-$coordinate flux formulation of the total $s-$coordinate time derivative,  
    413 \ie the total $s-$coordinate time derivative in flux form: 
     413\ie\ the total $s-$coordinate time derivative in flux form: 
    414414\begin{flalign} 
    415415  \label{apdx:A_sco_Dt_flux} 
     
    569569in particular the pressure gradient. 
    570570By contrast, $\omega$ is not $w$, the third component of the velocity, but the dia-surface velocity component, 
    571 \ie the volume flux across the moving $s$-surfaces per unit horizontal area.  
     571\ie\ the volume flux across the moving $s$-surfaces per unit horizontal area.  
    572572 
    573573 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/annex_B.tex

    r11353 r11512  
    88\label{apdx:B} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212\newpage 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/annex_C.tex

    r10442 r11512  
    88\label{apdx:C} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212%%%  Appendix put in gmcomment as it has not been updated for \zstar and s coordinate 
     
    3939$dv=e_1\,e_2\,e_3 \,di\,dj\,dk$  is the volume element, with only $e_3$ that depends on time. 
    4040$D$ and $S$ are the ocean domain volume and surface, respectively. 
    41 No wetting/drying is allow (\ie $\frac{\partial S}{\partial t} = 0$). 
     41No wetting/drying is allow (\ie\ $\frac{\partial S}{\partial t} = 0$). 
    4242Let $k_s$ and $k_b$ be the ocean surface and bottom, resp. 
    43 (\ie $s(k_s) = \eta$ and $s(k_b)=-H$, where $H$ is the bottom depth). 
     43(\ie\ $s(k_s) = \eta$ and $s(k_b)=-H$, where $H$ is the bottom depth). 
    4444\begin{flalign*} 
    4545  z(k) = \eta - \int\limits_{\tilde{k}=k}^{\tilde{k}=k_s}  e_3(\tilde{k}) \;d\tilde{k} 
     
    9999\label{sec:C.1} 
    100100 
    101 The discretization of pimitive equation in $s$-coordinate (\ie time and space varying vertical coordinate) 
    102 must be chosen so that the discrete equation of the model satisfy integral constrains on energy and enstrophy.  
     101The discretization of pimitive equation in $s$-coordinate (\ie\ time and space varying vertical coordinate) 
     102must be chosen so that the discrete equation of the model satisfy integral constrains on energy and enstrophy. 
    103103 
    104104Let us first establish those constraint in the continuous world. 
    105 The total energy (\ie kinetic plus potential energies) is conserved: 
     105The total energy (\ie\ kinetic plus potential energies) is conserved: 
    106106\begin{flalign} 
    107107  \label{eq:Tot_Energy} 
     
    109109\end{flalign} 
    110110under the following assumptions: no dissipation, no forcing (wind, buoyancy flux, atmospheric pressure variations), 
    111 mass conservation, and closed domain.  
     111mass conservation, and closed domain. 
    112112 
    113113This equation can be transformed to obtain several sub-equalities. 
     
    211211\end{subequations} 
    212212 
    213 \autoref{eq:E_tot_pg_3} is the balance between the conversion KE to PE and PE to KE.  
     213\autoref{eq:E_tot_pg_3} is the balance between the conversion KE to PE and PE to KE. 
    214214Indeed the left hand side of \autoref{eq:E_tot_pg_3} can be transformed as follows: 
    215215\begin{flalign*} 
     
    224224  &=+  \int\limits_D g\, \rho \; w \; dv   &&&\\ 
    225225\end{flalign*} 
    226 where the last equality is obtained by noting that the brackets is exactly the expression of $w$,  
    227 the vertical velocity referenced to the fixe $z$-coordinate system (see \autoref{apdx:A_w_s}).  
    228   
     226where the last equality is obtained by noting that the brackets is exactly the expression of $w$, 
     227the vertical velocity referenced to the fixe $z$-coordinate system (see \autoref{apdx:A_w_s}). 
     228 
    229229The left hand side of \autoref{eq:E_tot_pg_3} can be transformed as follows: 
    230230\begin{flalign*} 
     
    367367% ------------------------------------------------------------------------------------------------------------- 
    368368\subsubsection{Vorticity term with ENE scheme (\protect\np{ln\_dynvor\_ene}\forcode{ = .true.})} 
    369 \label{subsec:C_vorENE}  
     369\label{subsec:C_vorENE} 
    370370 
    371371For the ENE scheme, the two components of the vorticity term are given by: 
     
    399399        - \overline{ U }^{\,j+1/2}\; \overline{ V }^{\,i+1/2}         \biggr\}  \quad  \equiv 0 
    400400    \end{array} 
    401   }       
     401  } 
    402402\end{flalign*} 
    403403In other words, the domain averaged kinetic energy does not change due to the vorticity term. 
     
    407407% ------------------------------------------------------------------------------------------------------------- 
    408408\subsubsection{Vorticity term with EEN scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.})} 
    409 \label{subsec:C_vorEEN_vect}  
    410  
    411 With the EEN scheme, the vorticity terms are represented as:  
     409\label{subsec:C_vorEEN_vect} 
     410 
     411With the EEN scheme, the vorticity terms are represented as: 
    412412\begin{equation} 
    413413  \tag{\ref{eq:dynvor_een}} 
     
    420420      \end{aligned} 
    421421    } \right. 
    422 \end{equation}  
     422\end{equation} 
    423423where the indices $i_p$ and $j_p$ take the following value: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$, 
    424 and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by:  
     424and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by: 
    425425\begin{equation} 
    426426  \tag{\ref{eq:Q_triads}} 
     
    479479% ------------------------------------------------------------------------------------------------------------- 
    480480\subsubsection{Gradient of kinetic energy / Vertical advection} 
    481 \label{subsec:C_zad}  
     481\label{subsec:C_zad} 
    482482 
    483483The change of Kinetic Energy (KE) due to the vertical advection is exactly balanced by the change of KE due to the horizontal gradient of KE~: 
     
    487487  +   \frac{1}{2} \int_D {  \frac{{\textbf{U}_h}^2}{e_3} \partial_t ( e_3) \;dv } 
    488488\] 
    489 Indeed, using successively \autoref{eq:DOM_di_adj} (\ie the skew symmetry property of the $\delta$ operator) 
     489Indeed, using successively \autoref{eq:DOM_di_adj} (\ie\ the skew symmetry property of the $\delta$ operator) 
    490490and the continuity equation, then \autoref{eq:DOM_di_adj} again, 
    491491then the commutativity of operators $\overline {\,\cdot \,}$ and $\delta$, and finally \autoref{eq:DOM_mi_adj} 
    492 (\ie the symmetry property of the $\overline {\,\cdot \,}$ operator) 
     492(\ie\ the symmetry property of the $\overline {\,\cdot \,}$ operator) 
    493493applied in the horizontal and vertical directions, it becomes: 
    494494\begin{flalign*} 
     
    566566      } } \right) 
    567567\] 
    568 a formulation that requires an additional horizontal mean in contrast with the one used in NEMO. 
     568a formulation that requires an additional horizontal mean in contrast with the one used in \NEMO. 
    569569Nine velocity points have to be used instead of 3. 
    570570This is the reason why it has not been chosen. 
     
    595595  A pressure gradient has no contribution to the evolution of the vorticity as the curl of a gradient is zero. 
    596596  In the $z$-coordinate, this property is satisfied locally on a C-grid with 2nd order finite differences 
    597   (property \autoref{eq:DOM_curl_grad}).  
     597  (property \autoref{eq:DOM_curl_grad}). 
    598598} 
    599599 
    600600When the equation of state is linear 
    601 (\ie when an advection-diffusion equation for density can be derived from those of temperature and salinity) 
     601(\ie\ when an advection-diffusion equation for density can be derived from those of temperature and salinity) 
    602602the change of KE due to the work of pressure forces is balanced by 
    603 the change of potential energy due to buoyancy forces:  
     603the change of potential energy due to buoyancy forces: 
    604604\[ 
    605605  - \int_D  \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv 
     
    621621  % 
    622622  \allowdisplaybreaks 
    623   \intertext{Using successively \autoref{eq:DOM_di_adj}, \ie the skew symmetry property of 
     623  \intertext{Using successively \autoref{eq:DOM_di_adj}, \ie\ the skew symmetry property of 
    624624    the $\delta$ operator, \autoref{eq:wzv}, the continuity equation, \autoref{eq:dynhpg_sco}, 
    625625    the hydrostatic equation in the $s$-coordinate, and $\delta_{k+1/2} \left[ z_t \right] \equiv e_{3w} $, 
     
    771771% ------------------------------------------------------------------------------------------------------------- 
    772772\subsubsection{Coriolis plus ``metric'' term} 
    773 \label{subsec:C.3.3}  
     773\label{subsec:C.3.3} 
    774774 
    775775In flux from the vorticity term reduces to a Coriolis term in which 
     
    792792% ------------------------------------------------------------------------------------------------------------- 
    793793\subsubsection{Flux form advection} 
    794 \label{subsec:C.3.4}  
     794\label{subsec:C.3.4} 
    795795 
    796796The flux form operator of the momentum advection is evaluated using 
     
    811811 
    812812Let us first consider the first term of the scalar product 
    813 (\ie just the the terms associated with the i-component of the advection): 
     813(\ie\ just the the terms associated with the i-component of the advection): 
    814814\begin{flalign*} 
    815815  &  - \int_D u \cdot \nabla \cdot \left(   \textbf{U}\,u   \right) \; dv   \\ 
     
    867867When the UBS scheme is used to evaluate the flux form momentum advection, 
    868868the discrete operator does not contribute to the global budget of linear momentum (flux form). 
    869 The horizontal kinetic energy is not conserved, but forced to decay (\ie the scheme is diffusive).  
     869The horizontal kinetic energy is not conserved, but forced to decay (\ie\ the scheme is diffusive). 
    870870 
    871871% ================================================================ 
     
    879879% ------------------------------------------------------------------------------------------------------------- 
    880880\subsubsection{Vorticity term with ENS scheme  (\protect\np{ln\_dynvor\_ens}\forcode{ = .true.})} 
    881 \label{subsec:C_vorENS}  
     881\label{subsec:C_vorENS} 
    882882 
    883883In the ENS scheme, the vorticity term is descretized as follows: 
     
    890890    \end{aligned} 
    891891  \right. 
    892 \end{equation}  
     892\end{equation} 
    893893 
    894894The scheme does not allow but the conservation of the total kinetic energy but the conservation of $q^2$, 
    895 the potential enstrophy for a horizontally non-divergent flow (\ie when $\chi$=$0$). 
     895the potential enstrophy for a horizontally non-divergent flow (\ie\ when $\chi$=$0$). 
    896896Indeed, using the symmetry or skew symmetry properties of the operators 
    897897( \autoref{eq:DOM_mi_adj} and \autoref{eq:DOM_di_adj}), 
     
    942942  } 
    943943\end{flalign*} 
    944 The later equality is obtain only when the flow is horizontally non-divergent, \ie $\chi$=$0$.  
     944The later equality is obtain only when the flow is horizontally non-divergent, \ie\ $\chi$=$0$. 
    945945 
    946946% ------------------------------------------------------------------------------------------------------------- 
     
    948948% ------------------------------------------------------------------------------------------------------------- 
    949949\subsubsection{Vorticity Term with EEN scheme (\protect\np{ln\_dynvor\_een}\forcode{ = .true.})} 
    950 \label{subsec:C_vorEEN}  
    951  
    952 With the EEN scheme, the vorticity terms are represented as:  
     950\label{subsec:C_vorEEN} 
     951 
     952With the EEN scheme, the vorticity terms are represented as: 
    953953\begin{equation} 
    954954  \tag{\ref{eq:dynvor_een}} 
     
    961961      \end{aligned} 
    962962    } \right. 
    963 \end{equation}  
    964 where the indices $i_p$ and $k_p$ take the following values:  
     963\end{equation} 
     964where the indices $i_p$ and $k_p$ take the following values: 
    965965$i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$, 
    966 and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by:  
     966and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by: 
    967967\begin{equation} 
    968968  \tag{\ref{eq:Q_triads}} 
     
    971971\end{equation} 
    972972 
    973 This formulation does conserve the potential enstrophy for a horizontally non-divergent flow (\ie $\chi=0$).  
     973This formulation does conserve the potential enstrophy for a horizontally non-divergent flow (\ie\ $\chi=0$). 
    974974 
    975975Let consider one of the vorticity triad, for example ${^{i}_j}\mathbb{Q}^{+1/2}_{+1/2} $, 
     
    10231023\label{sec:C.5} 
    10241024 
    1025 All the numerical schemes used in NEMO are written such that the tracer content is conserved by 
     1025All the numerical schemes used in \NEMO\ are written such that the tracer content is conserved by 
    10261026the internal dynamics and physics (equations in flux form). 
    10271027For advection, 
    1028 only the CEN2 scheme (\ie $2^{nd}$ order finite different scheme) conserves the global variance of tracer. 
     1028only the CEN2 scheme (\ie\ $2^{nd}$ order finite different scheme) conserves the global variance of tracer. 
    10291029Nevertheless the other schemes ensure that the global variance decreases 
    1030 (\ie they are at least slightly diffusive). 
     1030(\ie\ they are at least slightly diffusive). 
    10311031For diffusion, all the schemes ensure the decrease of the total tracer variance, except the iso-neutral operator. 
    10321032There is generally no strict conservation of mass, 
    10331033as the equation of state is non linear with respect to $T$ and $S$. 
    1034 In practice, the mass is conserved to a very high accuracy.  
     1034In practice, the mass is conserved to a very high accuracy. 
    10351035% ------------------------------------------------------------------------------------------------------------- 
    10361036%       Advection Term 
     
    10561056Indeed, let $T$ be the tracer and its $\tau_u$, $\tau_v$, and $\tau_w$ interpolated values at velocity point 
    10571057(whatever the interpolation is), 
    1058 the conservation of the tracer content due to the advection tendency is obtained as follows:  
     1058the conservation of the tracer content due to the advection tendency is obtained as follows: 
    10591059\begin{flalign*} 
    10601060  &\int_D { \frac{1}{e_3}\frac{\partial \left( e_3 \, T \right)}{\partial t} \;dv } = - \int_D \nabla \cdot \left( T \textbf{U} \right)\;dv    &&&\\ 
     
    10721072 
    10731073The conservation of the variance of tracer due to the advection tendency can be achieved only with the CEN2 scheme, 
    1074 \ie when $\tau_u= \overline T^{\,i+1/2}$, $\tau_v= \overline T^{\,j+1/2}$, and $\tau_w= \overline T^{\,k+1/2}$.  
     1074\ie\ when $\tau_u= \overline T^{\,i+1/2}$, $\tau_v= \overline T^{\,j+1/2}$, and $\tau_w= \overline T^{\,k+1/2}$. 
    10751075It can be demonstarted as follows: 
    10761076\begin{flalign*} 
     
    11081108the conservation of potential vorticity and the horizontal divergence, 
    11091109and the dissipation of the square of these quantities 
    1110 (\ie enstrophy and the variance of the horizontal divergence) as well as 
     1110(\ie\ enstrophy and the variance of the horizontal divergence) as well as 
    11111111the dissipation of the horizontal kinetic energy. 
    11121112In particular, when the eddy coefficients are horizontally uniform, 
    11131113it ensures a complete separation of vorticity and horizontal divergence fields, 
    11141114so that diffusion (dissipation) of vorticity (enstrophy) does not generate horizontal divergence 
    1115 (variance of the horizontal divergence) and \textit{vice versa}.  
     1115(variance of the horizontal divergence) and \textit{vice versa}. 
    11161116 
    11171117These properties of the horizontal diffusion operator are a direct consequence of 
    11181118properties \autoref{eq:DOM_curl_grad} and \autoref{eq:DOM_div_curl}. 
    11191119When the vertical curl of the horizontal diffusion of momentum (discrete sense) is taken, 
    1120 the term associated with the horizontal gradient of the divergence is locally zero.  
     1120the term associated with the horizontal gradient of the divergence is locally zero. 
    11211121 
    11221122% ------------------------------------------------------------------------------------------------------------- 
     
    12371237 
    12381238When the horizontal divergence of the horizontal diffusion of momentum (discrete sense) is taken, 
    1239 the term associated with the vertical curl of the vorticity is zero locally, due to \autoref{eq:DOM_div_curl}.  
     1239the term associated with the vertical curl of the vorticity is zero locally, due to \autoref{eq:DOM_div_curl}. 
    12401240The resulting term conserves the $\chi$ and dissipates $\chi^2$ when the eddy coefficients are horizontally uniform. 
    12411241\begin{flalign*} 
     
    13961396    \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k} \right) \right)\; dv = 0    &&& 
    13971397\end{flalign*} 
    1398 and the square of the horizontal divergence decreases (\ie the horizontal divergence is dissipated) if 
     1398and the square of the horizontal divergence decreases (\ie\ the horizontal divergence is dissipated) if 
    13991399the vertical diffusion coefficient is uniform over the whole domain: 
    14001400 
     
    14631463the heat and salt contents are conserved (equations in flux form). 
    14641464Since a flux form is used to compute the temperature and salinity, 
    1465 the quadratic form of these quantities (\ie their variance) globally tends to diminish. 
    1466 As for the advection term, there is conservation of mass only if the Equation Of Seawater is linear.  
     1465the quadratic form of these quantities (\ie\ their variance) globally tends to diminish. 
     1466As for the advection term, there is conservation of mass only if the Equation Of Seawater is linear. 
    14671467 
    14681468% ------------------------------------------------------------------------------------------------------------- 
     
    14971497\end{flalign*} 
    14981498 
    1499 In fact, this property simply results from the flux form of the operator.  
     1499In fact, this property simply results from the flux form of the operator. 
    15001500 
    15011501% ------------------------------------------------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/annex_DOMAINcfg.tex

    r11353 r11512  
    88\label{apdx:DOMAINcfg} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111\vfill 
    1212\begin{figure}[b] 
     
    2525 
    2626This tool will evolve into an independent utility with its own documentation but its 
    27 current manifestation is mostly a wrapper for \NEMO \forcode{DOM} modules more aligned to 
    28 those in the previous versions of NEMO. These versions allowed the user to define some 
     27current manifestation is mostly a wrapper for \NEMO\ \forcode{DOM} modules more aligned to 
     28those in the previous versions of \NEMO. These versions allowed the user to define some 
    2929horizontal and vertical grids through additional namelist parameters. Explanations of 
    3030these parameters are retained here for reference pending better documentation for 
     
    3232those read by \forcode{DOMAINcfg} via its own \forcode{namelist_ref} and 
    3333\forcode{namelist_cfg} files. Although, due to their origins, these namelists share names 
    34 with those used by NEMO, they are not interchangeable and should be considered independent 
     34with those used by \NEMO, they are not interchangeable and should be considered independent 
    3535of those described elsewhere in this manual. 
    3636 
     
    4343%--------------------------------------------namdom------------------------------------------------------- 
    4444 
    45 \nlst{namdom_domcfg}  
     45\nlst{namdom_domcfg} 
    4646%-------------------------------------------------------------------------------------------------------------- 
    4747 
    4848The user has three options available in defining a horizontal grid, which involve the 
    49 namelist variable \np{jphgr\_mesh} of the \ngn{namdom} (\forcode{DOMAINcfg} variant only) 
     49namelist variable \np{jphgr\_mesh} of the \nam{dom} (\texttt{DOMAINcfg} variant only) 
    5050namelist. 
    5151 
     
    5454  The coordinates and their first derivatives with respect to $i$ and $j$ are provided 
    5555  in a input file (\ifile{coordinates}), read in \rou{hgr\_read} subroutine of the domhgr module. 
    56   This is now the only option available within \NEMO itself from v4.0 onwards. 
    57 \item[\np{jphgr\_mesh}=1 to 5] A few simple analytical grids are provided (see below).  
    58   For other analytical grids, the \textit{domhgr.f90} module (\forcode{DOMAINcfg} variant) must be  
    59   modified by the user. In most cases, modifying the \mdl{usrdef\_hgr} module of \NEMO is 
    60   a better alternative since this is designed to allow simple analytical domains to be  
     56  This is now the only option available within \NEMO\ itself from v4.0 onwards. 
     57\item[\np{jphgr\_mesh}=1 to 5] A few simple analytical grids are provided (see below). 
     58  For other analytical grids, the \mdl{domhgr} module (\texttt{DOMAINcfg} variant) must be 
     59  modified by the user. In most cases, modifying the \mdl{usrdef\_hgr} module of \NEMO\ is 
     60  a better alternative since this is designed to allow simple analytical domains to be 
    6161  configured and used without the need for external data files. 
    6262\end{description} 
    6363 
    64 There are two simple cases of geographical grids on the sphere. With  
    65 \np{jphgr\_mesh}=1, the grid (expressed in degrees) is regular in space,  
    66 with grid sizes specified by parameters \np{ppe1\_deg} and \np{ppe2\_deg},  
    67 respectively. Such a geographical grid can be very anisotropic at high latitudes  
    68 because of the convergence of meridians (the zonal scale factors $e_1$  
    69 become much smaller than the meridional scale factors $e_2$). The Mercator  
    70 grid (\np{jphgr\_mesh}=4) avoids this anisotropy by refining the meridional scale  
    71 factors in the same way as the zonal ones. In this case, meridional scale factors  
    72 and latitudes are calculated analytically using the formulae appropriate for  
    73 a Mercator projection, based on \np{ppe1\_deg} which is a reference grid spacing  
    74 at the equator (this applies even when the geographical equator is situated outside  
    75 the model domain).  
    76  
    77 In these two cases (\np{jphgr\_mesh}=1 or 4), the grid position is defined by the  
    78 longitude and latitude of the south-westernmost point (\np{ppglamt0}  
    79 and \np{ppgphi0}). Note that for the Mercator grid the user need only provide  
    80 an approximate starting latitude: the real latitude will be recalculated analytically,  
    81 in order to ensure that the equator corresponds to line passing through $t$-  
    82 and $u$-points.   
    83  
    84 Rectangular grids ignoring the spherical geometry are defined with  
    85 \np{jphgr\_mesh} = 2, 3, 5. The domain is either an $f$-plane (\np{jphgr\_mesh} = 2,  
    86 Coriolis factor is constant) or a beta-plane (\np{jphgr\_mesh} = 3, the Coriolis factor  
    87 is linear in the $j$-direction). The grid size is uniform in meter in each direction,  
    88 and given by the parameters \np{ppe1\_m} and \np{ppe2\_m} respectively.  
    89 The zonal grid coordinate (\textit{glam} arrays) is in kilometers, starting at zero  
    90 with the first $t$-point. The meridional coordinate (gphi. arrays) is in kilometers,  
    91 and the second $t$-point corresponds to coordinate $gphit=0$. The input  
    92 variable \np{ppglam0} is ignored. \np{ppgphi0} is used to set the reference  
    93 latitude for computation of the Coriolis parameter. In the case of the beta plane,  
    94 \np{ppgphi0} corresponds to the center of the domain. Finally, the special case  
    95 \np{jphgr\_mesh}=5 corresponds to a beta plane in a rotated domain for the  
    96 GYRE configuration, representing a classical mid-latitude double gyre system.  
    97 The rotation allows us to maximize the jet length relative to the gyre areas  
    98 (and the number of grid points).  
     64There are two simple cases of geographical grids on the sphere. With 
     65\np{jphgr\_mesh}=1, the grid (expressed in degrees) is regular in space, 
     66with grid sizes specified by parameters \np{ppe1\_deg} and \np{ppe2\_deg}, 
     67respectively. Such a geographical grid can be very anisotropic at high latitudes 
     68because of the convergence of meridians (the zonal scale factors $e_1$ 
     69become much smaller than the meridional scale factors $e_2$). The Mercator 
     70grid (\np{jphgr\_mesh}=4) avoids this anisotropy by refining the meridional scale 
     71factors in the same way as the zonal ones. In this case, meridional scale factors 
     72and latitudes are calculated analytically using the formulae appropriate for 
     73a Mercator projection, based on \np{ppe1\_deg} which is a reference grid spacing 
     74at the equator (this applies even when the geographical equator is situated outside 
     75the model domain). 
     76 
     77In these two cases (\np{jphgr\_mesh}=1 or 4), the grid position is defined by the 
     78longitude and latitude of the south-westernmost point (\np{ppglamt0} 
     79and \np{ppgphi0}). Note that for the Mercator grid the user need only provide 
     80an approximate starting latitude: the real latitude will be recalculated analytically, 
     81in order to ensure that the equator corresponds to line passing through $t$- 
     82and $u$-points. 
     83 
     84Rectangular grids ignoring the spherical geometry are defined with 
     85\np{jphgr\_mesh} = 2, 3, 5. The domain is either an $f$-plane (\np{jphgr\_mesh} = 2, 
     86Coriolis factor is constant) or a beta-plane (\np{jphgr\_mesh} = 3, the Coriolis factor 
     87is linear in the $j$-direction). The grid size is uniform in meter in each direction, 
     88and given by the parameters \np{ppe1\_m} and \np{ppe2\_m} respectively. 
     89The zonal grid coordinate (\textit{glam} arrays) is in kilometers, starting at zero 
     90with the first $t$-point. The meridional coordinate (gphi. arrays) is in kilometers, 
     91and the second $t$-point corresponds to coordinate $gphit=0$. The input 
     92variable \np{ppglam0} is ignored. \np{ppgphi0} is used to set the reference 
     93latitude for computation of the Coriolis parameter. In the case of the beta plane, 
     94\np{ppgphi0} corresponds to the center of the domain. Finally, the special case 
     95\np{jphgr\_mesh}=5 corresponds to a beta plane in a rotated domain for the 
     96GYRE configuration, representing a classical mid-latitude double gyre system. 
     97The rotation allows us to maximize the jet length relative to the gyre areas 
     98(and the number of grid points). 
    9999 
    100100% ------------------------------------------------------------------------------------------------------------- 
     
    128128the vertical scale factors.  The user must provide the analytical expression of both $z_0$ 
    129129and its first derivative with respect to $k$.  This is done in routine \mdl{domzgr} 
    130 through statement functions, using parameters provided in the \ngn{namdom} namelist 
    131 (\forcode{DOMAINcfg} variant). 
     130through statement functions, using parameters provided in the \nam{dom} namelist 
     131(\texttt{DOMAINcfg} variant). 
    132132 
    133133It is possible to define a simple regular vertical grid by giving zero stretching 
     
    156156    \begin{split} 
    157157    z_0  (k) = h_{sur} - h_0 \; k &- \; h_1 \; \log  \big[ \cosh ((k - h_{th}) / h_{cr}) \big] \\ 
    158                              \;   &- \; h2_1 \; \log  \big[ \cosh ((k - h2_{th}) / h2_{cr}) \big]  
     158                             \;   &- \; h2_1 \; \log  \big[ \cosh ((k - h2_{th}) / h2_{cr}) \big] 
    159159    \end{split} 
    160160\end{gather} 
     
    177177\end{equation} 
    178178 
    179 This formulation decreases the self-generated circulation into the ice shelf cavity  
     179This formulation decreases the self-generated circulation into the ice shelf cavity 
    180180(which can, in extreme case, leads to numerical instability). This is now the recommended formulation for all configurations using v4.0 onwards. The analytical derivation of thicknesses is maintained for backwards compatibility. 
    181181 
     
    200200The resulting depths and scale factors as a function of the model levels are shown in 
    201201\autoref{fig:DOMCFG_zgr} and given in \autoref{tab:DOMCFG_orca_zgr}. 
    202 Those values correspond to the parameters \np{ppsur}, \np{ppa0}, \np{ppa1}, \np{ppkth} in \ngn{namcfg} namelist. 
     202Those values correspond to the parameters \np{ppsur}, \np{ppa0}, \np{ppa1}, \np{ppkth} in \nam{cfg} namelist. 
    203203 
    204204Rather than entering parameters $h_{sur}$, $h_0$, and $h_1$ directly, it is possible to 
    205205recalculate them.  In that case the user sets \np{ppsur}~$=$~\np{ppa0}~$=$~\np{ppa1}~$= 
    206 999999$., in \ngn{namcfg} namelist, and specifies instead the four following parameters: 
     206999999$., in \nam{cfg} namelist, and specifies instead the four following parameters: 
    207207\begin{itemize} 
    208208\item 
     
    309309 
    310310Three options are possible for defining the bathymetry, according to the namelist variable 
    311 \np{nn\_bathy} (found in \ngn{namdom} namelist (\forcode{DOMAINCFG} variant) ): 
     311\np{nn\_bathy} (found in \nam{dom} namelist (\texttt{DOMAINCFG} variant) ): 
    312312\begin{description} 
    313313\item[\np{nn\_bathy}\forcode{ = 0}]: 
     
    322322  The \ifile{bathy\_meter} file (Netcdf format) provides the ocean depth (positive, in meters) at 
    323323  each grid point of the model grid. 
    324   The bathymetry is usually built by interpolating a standard bathymetry product (\eg ETOPO2) onto 
     324  The bathymetry is usually built by interpolating a standard bathymetry product (\eg\ ETOPO2) onto 
    325325  the horizontal ocean mesh. 
    326326  Defining the bathymetry also defines the coastline: where the bathymetry is zero, 
     
    352352\end{description} 
    353353%%% 
    354   
     354 
    355355% ------------------------------------------------------------------------------------------------------------- 
    356356%        z-coordinate with constant thickness 
     
    386386thickness than $e_{3t}(jpk)$: the maximum thickness allowed is $2*e_{3t}(jpk - 1)$. 
    387387 
    388 This has to be kept in mind when specifying values in \ngn{namdom} namelist 
    389 (\forcode{DOMMAINCFG} variant), such as the maximum depth \np{pphmax} in partial steps. 
     388This has to be kept in mind when specifying values in \nam{dom} namelist 
     389(\texttt{DOMAINCFG} variant), such as the maximum depth \np{pphmax} in partial steps. 
    390390 
    391391For example, with \np{pphmax}~$= 5750~m$ for the DRAKKAR 45 layer grid, the maximum ocean 
     
    405405%------------------------------------------nam_zgr_sco--------------------------------------------------- 
    406406% 
    407 \nlst{namzgr_sco_domcfg}  
     407\nlst{namzgr_sco_domcfg} 
    408408%-------------------------------------------------------------------------------------------------------------- 
    409 Options are defined in \ngn{namzgr\_sco} (\forcode{DOMAINcfg} only). 
     409Options are defined in \nam{zgr\_sco} (\texttt{DOMAINcfg} only). 
    410410In $s$-coordinate (\np{ln\_sco}\forcode{ = .true.}), the depth and thickness of the model levels are defined from 
    411411the product of a depth field and either a stretching function or its derivative, respectively: 
     
    430430but care must be taken to ensure that the vertical stretch used is appropriate for the application. 
    431431 
    432 The original default NEMO s-coordinate stretching is available if neither of the other options are specified as true 
     432The original default \NEMO\ s-coordinate stretching is available if neither of the other options are specified as true 
    433433(\np{ln\_s\_SH94}\forcode{ = .false.} and \np{ln\_s\_SF12}\forcode{ = .false.}). 
    434434This uses a depth independent $\tanh$ function for the stretching \citep{madec.delecluse.ea_JPO96}: 
     
    555555\label{subsec:DOMCFG_zgr_star} 
    556556 
    557 This option is described in the Report by Levier \textit{et al.} (2007), available on the \NEMO web site. 
     557This option is described in the Report by Levier \textit{et al.} (2007), available on the \NEMO\ web site. 
    558558 
    559559\biblio 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/annex_E.tex

    r11263 r11512  
    88\label{apdx:E} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212\newpage 
     
    4848$\tau "_i =\frac{e_{1T}}{e_{2T}\,e_{3T}}\delta_i \left[ \frac{e_{2u} e_{3u} }{e_{1u} }\delta_{i+1/2}[\tau] \right]$. 
    4949 
    50 This results in a dissipatively dominant (\ie hyper-diffusive) truncation error 
     50This results in a dissipatively dominant (\ie\ hyper-diffusive) truncation error 
    5151\citep{shchepetkin.mcwilliams_OM05}. 
    5252The overall performance of the advection scheme is similar to that reported in \cite{farrow.stevens_JPO95}. 
     
    135135\end{equation} 
    136136with ${A_u^{lT}}^2 = \frac{1}{12} {e_{1u}}^3\ |u|$,  
    137 \ie $A_u^{lT} = \frac{1}{\sqrt{12}} \,e_{1u}\ \sqrt{ e_{1u}\,|u|\,}$ 
     137\ie\ $A_u^{lT} = \frac{1}{\sqrt{12}} \,e_{1u}\ \sqrt{ e_{1u}\,|u|\,}$ 
    138138it comes: 
    139139\begin{equation} 
     
    147147  \end{split} 
    148148\end{equation} 
    149 if the velocity is uniform (\ie $|u|=cst$) then the diffusive flux is 
     149if the velocity is uniform (\ie\ $|u|=cst$) then the diffusive flux is 
    150150\begin{equation} 
    151151  \label{eq:tra_ldf_lap} 
     
    166166  \end{split} 
    167167\end{equation} 
    168 if the velocity is uniform (\ie $|u|=cst$) and 
     168if the velocity is uniform (\ie\ $|u|=cst$) and 
    169169choosing $\tau "_i =\frac{e_{1T}}{e_{2T}\,e_{3T}}\delta_i \left[ \frac{e_{2u} e_{3u} }{e_{1u} } \delta_{i+1/2}[\tau] \right]$ 
    170170 
     
    218218not $2\rdt$ as it can be found sometimes in literature. 
    219219The leap-Frog time stepping is a second order centered scheme. 
    220 As such it respects the quadratic invariant in integral forms, \ie the following continuous property, 
     220As such it respects the quadratic invariant in integral forms, \ie\ the following continuous property, 
    221221\[ 
    222222  % \label{eq:Energy} 
     
    256256 
    257257Let try to define a scheme that get its inspiration from the \citet{griffies.gnanadesikan.ea_JPO98} scheme, 
    258 but is formulated within the \NEMO framework 
    259 (\ie using scale factors rather than grid-size and having a position of $T$-points that 
     258but is formulated within the \NEMO\ framework 
     259(\ie\ using scale factors rather than grid-size and having a position of $T$-points that 
    260260is not necessary in the middle of vertical velocity points, see \autoref{fig:zgr_e3}). 
    261261 
     
    271271(see \autoref{chap:LDF}). 
    272272Nevertheless, this technique works fine for $T$ and $S$ as they are active tracers 
    273 (\ie they enter the computation of density), but it does not work for a passive tracer. 
     273(\ie\ they enter the computation of density), but it does not work for a passive tracer. 
    274274\citep{griffies.gnanadesikan.ea_JPO98} introduce a different way to discretise the off-diagonal terms that 
    275275nicely solve the problem. 
     
    386386\item[$\bullet$ implicit treatment in the vertical] 
    387387  In the diagonal term associated with the vertical divergence of the iso-neutral fluxes 
    388   \ie the term associated with a second order vertical derivative) 
     388  \ie\ the term associated with a second order vertical derivative) 
    389389  appears only tracer values associated with a single water column. 
    390390  This is of paramount importance since it means that 
     
    431431It is a key property for a diffusion term. 
    432432It means that the operator is also a dissipation term, 
    433 \ie it is a sink term for the square of the quantity on which it is applied. 
     433\ie\ it is a sink term for the square of the quantity on which it is applied. 
    434434It therfore ensures that, when the diffusivity coefficient is large enough, 
    435435the field on which it is applied become free of grid-point noise. 
     
    457457the formulation of which depends on the slopes of iso-neutral surfaces. 
    458458Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces, 
    459 \ie \autoref{eq:ldfslp_geo} is used in $z$-coordinate, 
     459\ie\ \autoref{eq:ldfslp_geo} is used in $z$-coordinate, 
    460460and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates.  
    461461 
     
    578578Nevertheless this property can be used to choose a discret form of \autoref{eq:eiv_skew_continuous} which 
    579579is consistent with the iso-neutral operator \autoref{eq:Gf_operator}. 
    580 Using the slopes \autoref{eq:Gf_slopes} and defining $A_e$ at $T$-point(\ie as $A$, 
     580Using the slopes \autoref{eq:Gf_slopes} and defining $A_e$ at $T$-point(\ie\ as $A$, 
    581581the eddy diffusivity coefficient), the resulting discret form is given by: 
    582582\begin{equation} 
     
    600600it uses the same definition for the slopes. 
    601601It also ensures the conservation of the tracer variance (see Appendix \autoref{apdx:eiv_skew}), 
    602 \ie it does not include a diffusive component but is a "pure" advection term. 
     602\ie\ it does not include a diffusive component but is a "pure" advection term. 
    603603 
    604604$\ $\newpage      %force an empty line 
     
    840840Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{+1/2}}$ in the $i$ direction. 
    841841Therefore the sum over the domain is zero, 
    842 \ie the variance of the tracer is preserved by the discretisation of the skew fluxes. 
     842\ie\ the variance of the tracer is preserved by the discretisation of the skew fluxes. 
    843843 
    844844\biblio 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/annex_iso.tex

    r11263 r11512  
    1818\label{apdx:triad} 
    1919 
    20 \minitoc 
     20\chaptertoc 
    2121 
    2222\newpage 
    2323 
    24 \section{Choice of \protect\ngn{namtra\_ldf} namelist parameters} 
     24\section[Choice of \texttt{namtra\_ldf} namelist parameters] 
     25{Choice of \protect\nam{tra\_ldf} namelist parameters} 
    2526%-----------------------------------------nam_traldf------------------------------------------------------ 
    2627 
     
    3031Two scheme are available to perform the iso-neutral diffusion. 
    3132If the namelist logical \np{ln\_traldf\_triad} is set true, 
    32 \NEMO updates both active and passive tracers using the Griffies triad representation of iso-neutral diffusion and 
     33\NEMO\ updates both active and passive tracers using the Griffies triad representation of iso-neutral diffusion and 
    3334the eddy-induced advective skew (GM) fluxes. 
    3435If the namelist logical \np{ln\_traldf\_iso} is set true, 
     
    3839 
    3940Values of iso-neutral diffusivity and GM coefficient are set as described in \autoref{sec:LDF_coef}. 
    40 Note that when GM fluxes are used, the eddy-advective (GM) velocities are output for diagnostic purposes using xIOS, 
     41Note that when GM fluxes are used, the eddy-advective (GM) velocities are output for diagnostic purposes using XIOS, 
    4142even though the eddy advection is accomplished by means of the skew fluxes. 
    4243 
     
    7273\label{sec:iso} 
    7374 
    74 We have implemented into \NEMO a scheme inspired by \citet{griffies.gnanadesikan.ea_JPO98}, 
    75 but formulated within the \NEMO framework, using scale factors rather than grid-sizes. 
     75We have implemented into \NEMO\ a scheme inspired by \citet{griffies.gnanadesikan.ea_JPO98}, 
     76but formulated within the \NEMO\ framework, using scale factors rather than grid-sizes. 
    7677 
    7778\subsection{Iso-neutral diffusion operator} 
     
    191192To correct this, we introduced a smoothing of the slopes of the iso-neutral surfaces (see \autoref{chap:LDF}). 
    192193This technique works for $T$ and $S$ in so far as they are active tracers 
    193 (\ie they enter the computation of density), but it does not work for a passive tracer. 
     194(\ie\ they enter the computation of density), but it does not work for a passive tracer. 
    194195 
    195196\subsection{Expression of the skew-flux in terms of triad slopes} 
     
    280281the intersection of the $i,k$ $T$-cell, the $i+i_p,k$ $u$-cell and the $i,k+k_p$ $w$-cell. 
    281282Expressing the slopes $s_i$ and $s'_i$ in \autoref{eq:i13} and \autoref{eq:i31} in this notation, 
    282 we have \eg \ $s_1=s'_1={\:}_i^k \mathbb{R}_{1/2}^{1/2}$. 
     283we have \eg\ \ $s_1=s'_1={\:}_i^k \mathbb{R}_{1/2}^{1/2}$. 
    283284Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ is used once (as an $s$) to 
    284285calculate the lateral flux along its $u$-arm, at $(i+i_p,k)$, 
     
    288289and we notate these areas, similarly to the triad slopes, 
    289290as $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$, $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$, 
    290 where \eg in \autoref{eq:i13} $a_{1}={\:}_i^k{\mathbb{A}_u}_{1/2}^{1/2}$, 
     291where \eg\ in \autoref{eq:i13} $a_{1}={\:}_i^k{\mathbb{A}_u}_{1/2}^{1/2}$, 
    291292and in \autoref{eq:i31} $a'_{1}={\:}_i^k{\mathbb{A}_w}_{1/2}^{1/2}$. 
    292293 
     
    477478defined in terms of the distances between $T$, $u$,$f$ and $w$-points. 
    478479This is the natural discretization of \autoref{eq:cts-var}. 
    479 The \NEMO model, however, operates with scale factors instead of grid sizes, 
     480The \NEMO\ model, however, operates with scale factors instead of grid sizes, 
    480481and scale factors for the quarter cells are not defined. 
    481482Instead, therefore we simply choose 
     
    600601  It is a key property for a diffusion term. 
    601602  It means that it is also a dissipation term, 
    602   \ie it dissipates the square of the quantity on which it is applied. 
     603  \ie\ it dissipates the square of the quantity on which it is applied. 
    603604  It therefore ensures that, when the diffusivity coefficient is large enough, 
    604605  the field on which it is applied becomes free of grid-point noise. 
     
    649650Similar comments apply to triads that would intersect the ocean floor (\autoref{fig:bdry_triads}b). 
    650651Note that both near bottom triad slopes \triad{i}{k}{R}{1/2}{1/2} and \triad{i+1}{k}{R}{-1/2}{1/2} are masked when 
    651 either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, \ie the $i,k+1$ $u$-point is masked. 
     652either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, \ie\ the $i,k+1$ $u$-point is masked. 
    652653The associated lateral fluxes (grey-black dashed line) are masked if \np{ln\_botmix\_triad}\forcode{ = .false.}, 
    653654but left unmasked, giving bottom mixing, if \np{ln\_botmix\_triad}\forcode{ = .true.}. 
    654655 
    655656The default option \np{ln\_botmix\_triad}\forcode{ = .false.} is suitable when the bbl mixing option is enabled 
    656 (\key{trabbl}, with \np{nn\_bbl\_ldf}\forcode{ = 1}), or for simple idealized problems. 
     657(\np{ln\_trabbl}\forcode{ = .true.}, with \np{nn\_bbl\_ldf}\forcode{ = 1}), or for simple idealized problems. 
    657658For setups with topography without bbl mixing, \np{ln\_botmix\_triad}\forcode{ = .true.} may be necessary. 
    658659% >>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    672673      (b) Both near bottom triad slopes \triad{i}{k}{R}{1/2}{1/2} and 
    673674      \triad{i+1}{k}{R}{-1/2}{1/2} are masked when either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, 
    674       \ie the $i,k+1$ $u$-point is masked. 
     675      \ie\ the $i,k+1$ $u$-point is masked. 
    675676      The associated lateral fluxes (grey-black dashed line) are masked if 
    676       \protect\np{botmix\_triad}\forcode{ = .false.}, but left unmasked, 
    677       giving bottom mixing, if \protect\np{botmix\_triad}\forcode{ = .true.} 
     677      \protect\np{ln\_botmix\_triad}\forcode{ = .false.}, but left unmasked, 
     678      giving bottom mixing, if \protect\np{ln\_botmix\_triad}\forcode{ = .true.} 
    678679    } 
    679680  \end{center} 
     
    687688iso-neutral slopes relative to geopotentials must be bounded everywhere, 
    688689both for consistency with the small-slope approximation and for numerical stability \citep{cox_OM87, griffies_bk04}. 
    689 The bound chosen in \NEMO is applied to each component of the slope separately and 
     690The bound chosen in \NEMO\ is applied to each component of the slope separately and 
    690691has a value of $1/100$ in the ocean interior. 
    691692%, ramping linearly down above 70~m depth to zero at the surface 
     
    765766  where $i,k_{10}$ is the tracer gridbox within which the depth reaches 10~m. 
    766767  See the left side of \autoref{fig:MLB_triad}. 
    767   We use the $k_{10}$-gridbox instead of the surface gridbox to avoid problems \eg with thin daytime mixed-layers. 
     768  We use the $k_{10}$-gridbox instead of the surface gridbox to avoid problems \eg\ with thin daytime mixed-layers. 
    768769  Currently we use the same $\Delta\rho_c=0.01\;\mathrm{kg\:m^{-3}}$ for ML triad tapering as is used to 
    769770  output the diagnosed mixed-layer depth $h_{\mathrm{ML}}=|z_{W}|_{k_{\mathrm{ML}}+1/2}$, 
     
    781782                                                       % \label{eq:Rbase} 
    782783    \\ 
    783     \intertext{with \eg the green triad} 
     784    \intertext{with \eg\ the green triad} 
    784785    {\:}_i{\mathbb{R}_{\mathrm{base}}}_{1/2}^{-1/2}&= 
    785786                                                     {\:}^{k_{\mathrm{ML}}}_i{\mathbb{R}_{\mathrm{base}}}_{\,1/2}^{-1/2}. 
     
    828829    ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$. 
    829830    Triads with different $i_p,k_p$, denoted by different colours, 
    830     (\eg the green triad $i_p=1/2,k_p=-1/2$) are tapered to the appropriate basal triad.} 
     831    (\eg\ the green triad $i_p=1/2,k_p=-1/2$) are tapered to the appropriate basal triad.} 
    831832  % } 
    832833  \includegraphics[width=\textwidth]{Fig_GRIFF_MLB_triads} 
     
    889890the formulation of which depends on the slopes of iso-neutral surfaces. 
    890891Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces, 
    891 \ie \autoref{eq:ldfslp_geo} is used in $z$-coordinate, 
     892\ie\ \autoref{eq:ldfslp_geo} is used in $z$-coordinate, 
    892893and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates. 
    893894 
     
    918919The traditional way to implement this additional advection is to add it to the Eulerian velocity prior to 
    919920computing the tracer advection. 
    920 This is implemented if \key{traldf\_eiv} is set in the default implementation, 
     921This is implemented if \texttt{traldf\_eiv?} is set in the default implementation, 
    921922where \np{ln\_traldf\_triad} is set false. 
    922923This allows us to take advantage of all the advection schemes offered for the tracers 
     
    926927 
    927928However, when \np{ln\_traldf\_triad} is set true, 
    928 \NEMO instead implements eddy induced advection according to the so-called skew form \citep{griffies_JPO98}. 
     929\NEMO\ instead implements eddy induced advection according to the so-called skew form \citep{griffies_JPO98}. 
    929930It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity. 
    930931For example in the (\textbf{i},\textbf{k}) plane, 
     
    10341035\subsubsection{No change in tracer variance} 
    10351036 
    1036 The discretization conserves tracer variance, \ie it does not include a diffusive component but is a `pure' advection term. 
     1037The discretization conserves tracer variance, \ie\ it does not include a diffusive component but is a `pure' advection term. 
    10371038This can be seen %either from Appendix \autoref{apdx:eiv_skew} or 
    10381039by considering the fluxes associated with a given triad slope $_i^k{\mathbb{R}}_{i_p}^{k_p} (T)$. 
     
    11161117Thus surface layer triads $\triadt{i}{1}{R}{1/2}{-1/2}$ and $\triadt{i+1}{1}{R}{-1/2}{-1/2}$ are masked,  
    11171118and both near bottom triad slopes $\triadt{i}{k}{R}{1/2}{1/2}$ and $\triadt{i+1}{k}{R}{-1/2}{1/2}$ are masked when  
    1118 either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, \ie the $i,k+1$ $u$-point is masked.  
     1119either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, \ie\ the $i,k+1$ $u$-point is masked.  
    11191120The namelist parameter \np{ln\_botmix\_triad} has no effect on the eddy-induced skew-fluxes. 
    11201121 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_ASM.tex

    r11353 r11512  
    88\label{chap:ASM} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212\vfill 
     
    1515\begin{tabular}{l||l|m{0.65\linewidth}} 
    1616    Release   & Author        & Modifications \\ 
    17     {\em 4.0} & {\em D. J. Lea} & {\em \NEMO 4.0 updates}  \\ 
     17    {\em 4.0} & {\em D. J. Lea} & {\em \NEMO\ 4.0 updates}  \\ 
    1818    {\em 3.4} & {\em D. J. Lea, M. Martin, K. Mogensen, A. Weaver} & {\em Initial version}  \\ 
    1919\end{tabular} 
     
    2626These are read into the model from a NetCDF file which may be produced by separate data assimilation code. 
    2727The code can also output model background fields which are used as an input to data assimilation code. 
    28 This is all controlled by the namelist \textit{\ngn{nam\_asminc} }. 
     28This is all controlled by the namelist \nam{\_asminc}. 
    2929There is a brief description of all the namelist options provided. 
    3030To build the ASM code \key{asminc} must be set. 
     
    101101 
    102102It is quite challenging for data assimilation systems to provide non-divergent velocity increments. 
    103 Applying divergent velocity increments will likely cause spurious vertical velocities in the model. This section describes a method to take velocity increments provided to \NEMO ($u^0_I$ and $v^0_I$) and adjust them by the iterative application of a divergence damping operator. The method is also described in \citet{dobricic.pinardi.ea_OS07}. 
     103Applying divergent velocity increments will likely cause spurious vertical velocities in the model. This section describes a method to take velocity increments provided to \NEMO\ ($u^0_I$ and $v^0_I$) and adjust them by the iterative application of a divergence damping operator. The method is also described in \citet{dobricic.pinardi.ea_OS07}. 
    104104 
    105105In iteration step $n$ (starting at $n=1$) new estimates of velocity increments $u^{n}_I$ and $v^{n}_I$ are updated by: 
     
    134134\citep{talagrand_JAS72, dobricic.pinardi.ea_OS07}. 
    135135Diffusion coefficients are defined as $A_D = \alpha e_{1t} e_{2t}$, where $\alpha = 0.2$. 
    136 The divergence damping is activated by assigning to \np{nn\_divdmp} in the \textit{nam\_asminc} namelist 
     136The divergence damping is activated by assigning to \np{nn\_divdmp} in the \nam{\_asminc} namelist 
    137137a value greater than zero. 
    138138This specifies the number of iterations of the divergence damping. Setting a value of the order of 100 will result in a significant reduction in the vertical velocity induced by the increments. 
     
    144144\label{sec:ASM_details} 
    145145 
    146 Here we show an example \ngn{nam\_asminc} namelist and the header of an example assimilation increments file on 
     146Here we show an example \nam{\_asminc} namelist and the header of an example assimilation increments file on 
    147147the ORCA2 grid. 
    148148 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_CONFIG.tex

    r11263 r11512  
    88\label{chap:CFG} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212\newpage 
     
    1818\label{sec:CFG_intro} 
    1919 
    20 The purpose of this part of the manual is to introduce the NEMO reference configurations. 
     20The purpose of this part of the manual is to introduce the \NEMO\ reference configurations. 
    2121These configurations are offered as means to explore various numerical and physical options, 
    2222thus allowing the user to verify that the code is performing in a manner consistent with that we are running. 
     
    2424The reference configurations also provide a sense for some of the options available in the code, 
    2525though by no means are all options exercised in the reference configurations. 
    26 Configuration is defined manually through the \textit{namcfg} namelist variables. 
     26Configuration is defined manually through the \nam{cfg} namelist variables. 
    2727 
    2828%------------------------------------------namcfg---------------------------------------------------- 
     
    3838\label{sec:CFG_c1d} 
    3939 
    40 The 1D model option simulates a stand alone water column within the 3D NEMO system. 
     40The 1D model option simulates a stand alone water column within the 3D \NEMO\ system. 
    4141It can be applied to the ocean alone or to the ocean-ice system and can include passive tracers or a biogeochemical model. 
    4242It is set up by defining the position of the 1D water column in the grid 
    43 (see \textit{cfgs/SHARED/namelist\_ref}).  
     43(see \path{./cfgs/SHARED/namelist\_ref}). 
    4444The 1D model is a very useful tool 
    4545\textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes; 
     
    5454 
    5555The 1D model has some specifies. First, all the horizontal derivatives are assumed to be zero, 
    56 and second, the two components of the velocity are moved on a $T$-point.  
    57 Therefore, defining \key{c1d} changes some things in the code behaviour:  
     56and second, the two components of the velocity are moved on a $T$-point. 
     57Therefore, defining \key{c1d} changes some things in the code behaviour: 
    5858\begin{description} 
    5959\item[(1)] 
     
    6868\end{description} 
    6969All the relevant \textit{\_c1d} modules can be found in the src/OCE/C1D directory of 
    70 the NEMO distribution. 
     70the \NEMO\ distribution. 
    7171 
    7272% to be added:  a test case on the yearlong Ocean Weather Station (OWS) Papa dataset of Martin (1985) 
     
    8080The ORCA family is a series of global ocean configurations that are run together with 
    8181the SI3 model (ORCA-ICE) and possibly with PISCES biogeochemical model (ORCA-ICE-PISCES). 
    82 An appropriate namelist is available in \path{cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg} for ORCA2. 
     82An appropriate namelist is available in \path{./cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg} for ORCA2. 
    8383The domain of ORCA2 configuration is defined in \ifile{ORCA\_R2\_zps\_domcfg} file, 
    84 this file is available in tar file on the NEMO community zenodo platform: \\ 
     84this file is available in tar file on the \NEMO\ community zenodo platform: \\ 
    8585https://doi.org/10.5281/zenodo.2640723 
    8686 
    87 In this namelist\_cfg the name of domain input file is set in \ngn{namcfg} block of namelist.  
     87In this namelist\_cfg the name of domain input file is set in \nam{cfg} block of namelist. 
    8888 
    8989%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    118118(\autoref{fig:MISC_ORCA_msh}). 
    119119The resulting mesh presents no loss of continuity in either the mesh lines or the scale factors, 
    120 or even the scale factor derivatives over the whole ocean domain, as the mesh is not a composite mesh.  
     120or even the scale factor derivatives over the whole ocean domain, as the mesh is not a composite mesh. 
    121121%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    122122\begin{figure}[!tbp] 
     
    137137%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    138138 
    139 The method is applied to Mercator grid (\ie same zonal and meridional grid spacing) poleward of 20\deg{N}, 
     139The method is applied to Mercator grid (\ie\ same zonal and meridional grid spacing) poleward of 20\deg{N}, 
    140140so that the Equator is a mesh line, which provides a better numerical solution for equatorial dynamics. 
    141141The choice of the series of embedded ellipses (position of the foci and variation of the ellipses) 
     
    146146a half a degree grid (ORCA\_R05). 
    147147The smallest ocean scale factor is found in along Antarctica, 
    148 while the ratio of anisotropy remains close to one except near the Victoria Island in the Canadian Archipelago.  
     148while the ratio of anisotropy remains close to one except near the Victoria Island in the Canadian Archipelago. 
    149149 
    150150% ------------------------------------------------------------------------------------------------------------- 
     
    154154\label{subsec:CFG_orca_resolution} 
    155155 
    156 The NEMO system is provided with five built-in ORCA configurations which differ in the horizontal resolution. 
     156The \NEMO\ system is provided with five built-in ORCA configurations which differ in the horizontal resolution. 
    157157The value of the resolution is given by the resolution at the Equator expressed in degrees. 
    158158Each of configuration is set through the \textit{domain\_cfg} domain configuration file, 
    159159which sets the grid size and configuration name parameters. 
    160 The NEMO System Team provides only ORCA2 domain input file "\ifile{ORCA\_R2\_zps\_domcfg}" file 
    161 (Tab. \autoref{tab:ORCA}). 
     160The \NEMO\ System Team provides only ORCA2 domain input file "\ifile{ORCA\_R2\_zps\_domcfg}" file 
     161(\autoref{tab:ORCA}). 
    162162 
    163163%--------------------------------------------------TABLE-------------------------------------------------- 
     
    165165  \begin{center} 
    166166    \begin{tabular}{p{4cm} c c c c} 
    167       Horizontal Grid                         & \np{ORCA\_index} &  \np{jpiglo} & \np{jpjglo} &       \\ 
    168       \hline 
    169       \hline 
    170       \~4\deg     &        4         &         92     &      76      &       \\ 
    171       \~2\deg        &        2         &       182     &    149      &        \\ 
    172       \~1\deg        &        1         &       362     &     292     &        \\ 
    173       \~0.5\deg     &        05       &       722     &     511     &        \\ 
    174       \~0.25\deg   &        025     &      1442    &   1021     &        \\ 
    175       % \key{orca\_r8}       &        8         &      2882    &   2042     &        \\ 
    176       % \key{orca\_r12}     &      12         &      4322    &   3062      &       \\ 
    177       \hline 
    178       \hline 
     167      Horizontal Grid & \jp{ORCA\_index} & \jp{jpiglo} & \jp{jpjglo} \\ 
     168      \hline \hline 
     169%             4   \deg &              4   &          92 &          76 \\ 
     170             2   \deg &              2   &         182 &         149 \\ 
     171             1   \deg &              1   &         362 &         292 \\ 
     172             0.5 \deg &              05  &         722 &         511 \\ 
     173             0.25\deg &              025 &        1442 &        1021 \\ 
     174      \hline \hline 
    179175    \end{tabular} 
    180176    \caption{ 
     
    198194Note that the tropical mesh refinements in ORCA\_R2 and R1 strongly increases the mesh anisotropy there. 
    199195 
    200 The ORCA\_R05 and higher global configurations do not incorporate any regional refinements.   
     196The ORCA\_R05 and higher global configurations do not incorporate any regional refinements. 
    201197 
    202198For ORCA\_R1 and R025, setting the configuration key to 75 allows to use 75 vertical levels, otherwise 46 are used. 
     
    204200(see \autoref{tab:orca_zgr}). %\sfcomment{HERE I need to put new table for ORCA2 values} and \autoref{fig:zgr}). 
    205201 
    206 Only the ORCA\_R2 is provided with all its input files in the NEMO distribution. 
     202Only the ORCA\_R2 is provided with all its input files in the \NEMO\ distribution. 
    207203%It is very similar to that used as part of the climate model developed at IPSL for the 4th IPCC assessment of 
    208204%climate change (Marti et al., 2009). 
    209 %It is also the basis for the \NEMO contribution to the Coordinate Ocean-ice Reference Experiments (COREs) 
    210 %documented in \citet{griffies.biastoch.ea_OM09}.  
     205%It is also the basis for the \NEMO\ contribution to the Coordinate Ocean-ice Reference Experiments (COREs) 
     206%documented in \citet{griffies.biastoch.ea_OM09}. 
    211207 
    212208This version of ORCA\_R2 has 31 levels in the vertical, with the highest resolution (10m) in the upper 150m 
    213 (see \autoref{tab:orca_zgr} and \autoref{fig:zgr}).  
    214 The bottom topography and the coastlines are derived from the global atlas of Smith and Sandwell (1997).  
    215 The default forcing uses the boundary forcing from \citet{large.yeager_rpt04} (see \autoref{subsec:SBC_blk_core}),  
     209(see \autoref{tab:orca_zgr} and \autoref{fig:zgr}). 
     210The bottom topography and the coastlines are derived from the global atlas of Smith and Sandwell (1997). 
     211The default forcing uses the boundary forcing from \citet{large.yeager_rpt04} (see \autoref{subsec:SBC_blk_core}), 
    216212which was developed for the purpose of running global coupled ocean-ice simulations without 
    217213an interactive atmosphere. 
    218214This \citet{large.yeager_rpt04} dataset is available through 
    219215the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}{GFDL web site}. 
    220 The "normal year" of \citet{large.yeager_rpt04} has been chosen of the NEMO distribution since release v3.3.  
    221  
    222 ORCA\_R2 pre-defined configuration can also be run with multiply online nested zooms (\ie with AGRIF, \key{agrif} defined). This is available as the AGRIF\_DEMO configuration that can be found in the \path{cfgs/AGRIF_DEMO/} directory. 
     216The "normal year" of \citet{large.yeager_rpt04} has been chosen of the \NEMO\ distribution since release v3.3. 
     217 
     218ORCA\_R2 pre-defined configuration can also be run with multiply online nested zooms (\ie\ with AGRIF, \key{agrif} defined). 
     219This is available as the AGRIF\_DEMO configuration that can be found in the \path{./cfgs/AGRIF_DEMO/} directory. 
    223220 
    224221A regional Arctic or peri-Antarctic configuration is extracted from an ORCA\_R2 or R05 configurations using 
    225 sponge layers at open boundaries.  
     222sponge layers at open boundaries. 
    226223 
    227224% ------------------------------------------------------------------------------------------------------------- 
     
    236233\citet{hazeleger.drijfhout_JPO98, hazeleger.drijfhout_JPO99, hazeleger.drijfhout_JGR00, hazeleger.drijfhout_JPO00}, 
    237234over which an analytical seasonal forcing is applied. 
    238 This allows to investigate the spontaneous generation of a large number of interacting, transient mesoscale eddies  
    239 and their contribution to the large scale circulation.  
     235This allows to investigate the spontaneous generation of a large number of interacting, transient mesoscale eddies 
     236and their contribution to the large scale circulation. 
    240237 
    241238The GYRE configuration run together with the PISCES biogeochemical model (GYRE-PISCES). 
     
    245242The configuration is meant to represent an idealized North Atlantic or North Pacific basin. 
    246243The circulation is forced by analytical profiles of wind and buoyancy fluxes. 
    247 The applied forcings vary seasonally in a sinusoidal manner between winter and summer extrema \citep{levy.klein.ea_OM10}.  
     244The applied forcings vary seasonally in a sinusoidal manner between winter and summer extrema \citep{levy.klein.ea_OM10}. 
    248245The wind stress is zonal and its curl changes sign at 22\deg{N} and 36\deg{N}. 
    249246It forces a subpolar gyre in the north, a subtropical gyre in the wider part of the domain and 
     
    257254 
    258255The GYRE configuration is set like an analytical configuration. 
    259 Through \np{ln\_read\_cfg}\forcode{ = .false.} in \textit{namcfg} namelist defined in 
    260 the reference configuration \path{cfgs/GYRE_PISCES/EXPREF/namelist_cfg} 
     256Through \np{ln\_read\_cfg}\forcode{ = .false.} in \nam{cfg} namelist defined in 
     257the reference configuration \path{./cfgs/GYRE_PISCES/EXPREF/namelist_cfg} 
    261258analytical definition of grid in GYRE is done in usrdef\_hrg, usrdef\_zgr routines. 
    262259Its horizontal resolution (and thus the size of the domain) is determined by 
    263 setting \np{nn\_GYRE} in \ngn{namusr\_def}: \\ 
    264  
    265 \np{jpiglo} $= 30 \times$ \np{nn\_GYRE} + 2   \\ 
    266  
    267 \np{jpjglo} $= 20 \times$ \np{nn\_GYRE} + 2   \\ 
     260setting \np{nn\_GYRE} in \nam{usr\_def}: \\ 
     261 
     262\jp{jpiglo} $= 30 \times$ \np{nn\_GYRE} + 2   \\ 
     263 
     264\jp{jpjglo} $= 20 \times$ \np{nn\_GYRE} + 2   \\ 
    268265 
    269266Obviously, the namelist parameters have to be adjusted to the chosen resolution, 
    270 see the Configurations pages on the NEMO web site (NEMO Configurations). 
     267see the Configurations pages on the \NEMO\ web site (\NEMO\ Configurations). 
    271268In the vertical, GYRE uses the default 30 ocean levels (\jp{jpk}\forcode{ = 31}) (\autoref{fig:zgr}). 
    272269 
     
    275272For example, keeping a same model size on each processor while increasing the number of processor used is very easy, 
    276273even though the physical integrity of the solution can be compromised. 
    277 Benchmark is activate via \np{ln\_bench}\forcode{ = .true.} in \ngn{namusr\_def} in 
    278 namelist \path{cfgs/GYRE_PISCES/EXPREF/namelist_cfg}. 
     274Benchmark is activate via \np{ln\_bench}\forcode{ = .true.} in \nam{usr\_def} in 
     275namelist \path{./cfgs/GYRE_PISCES/EXPREF/namelist_cfg}. 
    279276 
    280277%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    299296The AMM, Atlantic Margins Model, is a regional model covering the Northwest European Shelf domain on 
    300297a regular lat-lon grid at approximately 12km horizontal resolution. 
    301 The appropriate \textit{\&namcfg} namelist  is available in \textit{cfgs/AMM12/EXPREF/namelist\_cfg}. 
     298The appropriate \textit{\&namcfg} namelist  is available in \path{./cfgs/AMM12/EXPREF/namelist\_cfg}. 
    302299It is used to build the correct dimensions of the AMM domain. 
    303300 
    304 This configuration tests several features of NEMO functionality specific to the shelf seas. 
     301This configuration tests several features of \NEMO\ functionality specific to the shelf seas. 
    305302In particular, the AMM uses $s$-coordinates in the vertical rather than $z$-coordinates and 
    306303is forced with tidal lateral boundary conditions using a Flather boundary condition from the BDY module. 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_DIA.tex

    r11366 r11512  
    88\label{chap:DIA} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212\vfill 
     
    1818    {\em }      & {\em Dorotea Iovino, Nicolas Martin} & {\em }  \\ 
    1919    {\em 3.6} & {\em Gurvan Madec, Sebastien Masson } & {\em }  \\ 
    20     {\em 3.4} & {\em Gurvan Madec, Rachid Benshila, Andrew Coward } & {\em }  \\  
    21     {\em }      & {\em Christian Ethe, Sebastien Masson } & {\em }  \\  
     20    {\em 3.4} & {\em Gurvan Madec, Rachid Benshila, Andrew Coward } & {\em }  \\ 
     21    {\em }      & {\em Christian Ethe, Sebastien Masson } & {\em }  \\ 
    2222\end{tabular} 
    23 \end{figure}  
     23\end{figure} 
    2424 
    2525\newpage 
    2626 
    2727% ================================================================ 
    28 %       Old Model Output  
     28%       Old Model Output 
    2929% ================================================================ 
    3030\section{Model output} 
     
    4141 
    4242The output listing and file(s) are predefined but should be checked and eventually adapted to the user's needs. 
    43 The output listing is stored in the $ocean.output$ file. 
    44 The information is printed from within the code on the logical unit $numout$. 
     43The output listing is stored in the \textit{ocean.output} file. 
     44The information is printed from within the code on the logical unit \texttt{numout}. 
    4545To locate these prints, use the UNIX command "\textit{grep -i numout}" in the source code directory. 
    4646 
     
    5959\label{sec:DIA_iom} 
    6060 
    61 Since version 3.2, iomput is the NEMO output interface of choice. 
     61Since version 3.2, iomput is the \NEMO\ output interface of choice. 
    6262It has been designed to be simple to use, flexible and efficient. 
    63 The two main purposes of iomput are:  
     63The two main purposes of iomput are: 
    6464 
    6565\begin{enumerate} 
     
    7272\end{enumerate} 
    7373 
    74 The first functionality allows the user to specify, without code changes or recompilation,  
     74The first functionality allows the user to specify, without code changes or recompilation, 
    7575aspects of the diagnostic output stream, such as: 
    7676 
     
    9494in a very easy way. 
    9595All details of iomput functionalities are listed in the following subsections. 
    96 Examples of the XML files that control the outputs can be found in:  
     96Examples of the XML files that control the outputs can be found in: 
    9797\path{cfgs/ORCA2_ICE_PISCES/EXPREF/iodef.xml}, 
    9898\path{cfgs/SHARED/field_def_nemo-oce.xml}, 
     
    101101 
    102102The second functionality targets output performance when running in parallel (\key{mpp\_mpi}). 
    103 Iomput provides the possibility to specify N dedicated I/O processes (in addition to the NEMO processes) 
     103Iomput provides the possibility to specify N dedicated I/O processes (in addition to the \NEMO\ processes) 
    104104to collect and write the outputs. 
    105105With an appropriate choice of N by the user, the bottleneck associated with the writing of 
    106106the output files can be greatly reduced. 
    107107 
    108 In version 3.6, the iom\_put interface depends on 
    109 an external code called \href{https://forge.ipsl.jussieu.fr/ioserver/browser/XIOS/branchs/xios-2.5}{XIOS-2.5}  
    110 (use of revision 618 or higher is required). 
     108In version 3.6, the \rou{iom\_put} interface depends on 
     109an external code called \href{https://forge.ipsl.jussieu.fr/ioserver/browser/XIOS/branchs/xios-2.5}{XIOS-2.5} 
     110%(use of revision 618 or higher is required). 
    111111This new IO server can take advantage of the parallel I/O functionality of NetCDF4 to 
    112112create a single output file and therefore to bypass the rebuilding phase. 
    113113Note that writing in parallel into the same NetCDF files requires that your NetCDF4 library is linked to 
    114 an HDF5 library that has been correctly compiled (\ie with the configure option $--$enable-parallel). 
     114an HDF5 library that has been correctly compiled (\ie\ with the configure option $--$enable-parallel). 
    115115Note that the files created by iomput through XIOS are incompatible with NetCDF3. 
    116116All post-processsing and visualization tools must therefore be compatible with NetCDF4 and not only NetCDF3. 
    117117 
    118118Even if not using the parallel I/O functionality of NetCDF4, using N dedicated I/O servers, 
    119 where N is typically much less than the number of NEMO processors, will reduce the number of output files created. 
    120 This can greatly reduce the post-processing burden usually associated with using large numbers of NEMO processors. 
     119where N is typically much less than the number of \NEMO\ processors, will reduce the number of output files created. 
     120This can greatly reduce the post-processing burden usually associated with using large numbers of \NEMO\ processors. 
    121121Note that for smaller configurations, the rebuilding phase can be avoided, 
    122122even without a parallel-enabled NetCDF4 library, simply by employing only one dedicated I/O server. 
     
    124124\subsection{XIOS: Reading and writing restart file} 
    125125 
    126 XIOS may be used to read single file restart produced by NEMO. Currently only the variables written to  
     126XIOS may be used to read single file restart produced by \NEMO. Currently only the variables written to 
    127127file \forcode{numror} can be handled by XIOS. To activate restart reading using XIOS, set \np{ln\_xios\_read}\forcode{ = .true. } 
    128 in \textit{namelist\_cfg}. This setting will be ignored when multiple restart files are present, and default NEMO  
    129 functionality will be used for reading. There is no need to change iodef.xml file to use XIOS to read  
    130 restart, all definitions are done within the NEMO code. For high resolution configuration, however,  
     128in \textit{namelist\_cfg}. This setting will be ignored when multiple restart files are present, and default \NEMO 
     129functionality will be used for reading. There is no need to change iodef.xml file to use XIOS to read 
     130restart, all definitions are done within the \NEMO\ code. For high resolution configuration, however, 
    131131there may be a need to add the following line in iodef.xml (xios context): 
    132132 
     
    135135\end{xmllines} 
    136136 
    137 This variable sets timeout for reading.  
    138  
    139 If XIOS is to be used to read restart from file generated with an earlier NEMO version (3.6 for instance), 
     137This variable sets timeout for reading. 
     138 
     139If XIOS is to be used to read restart from file generated with an earlier \NEMO\ version (3.6 for instance), 
    140140dimension \forcode{z} defined in restart file must be renamed to \forcode{nav_lev}.\\ 
    141141 
    142 XIOS can also be used to write NEMO restart. A namelist parameter \np{nn\_wxios} is used to determine the  
    143 type of restart NEMO will write. If it is set to 0, default NEMO functionality will be used - each  
    144 processor writes its own restart file; if it is set to 1 XIOS will write restart into a single file;  
    145 for \np{nn\_wxios = 2} the restart will be written by XIOS into multiple files, one for each XIOS server.  
    146 Note, however, that \textbf{NEMO will not read restart generated by XIOS when \np{nn\_wxios = 2}}. The restart will  
    147 have to be rebuild before continuing the run. This option aims to reduce number of restart files generated by NEMO only,  
    148 and may be useful when there is a need to change number of processors used to run simulation.  
     142XIOS can also be used to write \NEMO\ restart. A namelist parameter \np{nn\_wxios} is used to determine the 
     143type of restart \NEMO\ will write. If it is set to 0, default \NEMO\ functionality will be used - each 
     144processor writes its own restart file; if it is set to 1 XIOS will write restart into a single file; 
     145for \np{nn\_wxios}\forcode{ = 2} the restart will be written by XIOS into multiple files, one for each XIOS server. 
     146Note, however, that \textbf{\NEMO\ will not read restart generated by XIOS when \np{nn\_wxios}\forcode{ = 2}}. The restart will 
     147have to be rebuild before continuing the run. This option aims to reduce number of restart files generated by \NEMO\ only, 
     148and may be useful when there is a need to change number of processors used to run simulation. 
    149149 
    150150If an additional variable must be written to a restart file, the following steps are needed: 
    151151\begin{description} 
    152    \item[step 1:] add variable name to a list of restart variables (in subroutine \rou{iom\_set\_rst\_vars,} \mdl{iom}) and  
    153 define correct grid for the variable (\forcode{grid_N_3D} - 3D variable, \forcode{grid_N} - 2D variable, \forcode{grid_vector} -  
     152   \item[step 1:] add variable name to a list of restart variables (in subroutine \rou{iom\_set\_rst\_vars,} \mdl{iom}) and 
     153define correct grid for the variable (\forcode{grid_N_3D} - 3D variable, \forcode{grid_N} - 2D variable, \forcode{grid_vector} - 
    1541541D variable, \forcode{grid_scalar} - scalar), 
    155    \item[step 2:] add variable to the list of fields written by restart.  This can be done either in subroutine  
    156 \rou{iom\_set\_rstw\_core} (\mdl{iom}) or by calling  \rou{iom\_set\_rstw\_active} (\mdl{iom}) with the name of a variable  
    157 as an argument. This convention follows approach for writing restart using iom, where variables are  
     155   \item[step 2:] add variable to the list of fields written by restart.  This can be done either in subroutine 
     156\rou{iom\_set\_rstw\_core} (\mdl{iom}) or by calling  \rou{iom\_set\_rstw\_active} (\mdl{iom}) with the name of a variable 
     157as an argument. This convention follows approach for writing restart using iom, where variables are 
    158158written either by \rou{rst\_write} or by calling \rou{iom\_rstput} from individual routines. 
    159159\end{description} 
     
    181181 
    182182In \textit{attached mode} and if the type of file is ''multiple\_file'', 
    183 then each NEMO process will also act as an IO server and produce its own set of output files. 
     183then each \NEMO\ process will also act as an IO server and produce its own set of output files. 
    184184Superficially, this emulates the standard behaviour in previous versions. 
    185185However, the subdomain written out by each process does not correspond to 
     
    193193write to its own set of output files. 
    194194If the ''one\_file'' option is chosen then all XIOS processes will collect their longitudinal strips and 
    195 write (in parallel) to a single output file.  
     195write (in parallel) to a single output file. 
    196196Note running in detached mode requires launching a Multiple Process Multiple Data (MPMD) parallel job. 
    197197The following subsection provides a typical example but the syntax will vary in different MPP environments. 
     
    200200 
    201201The number of cores used by the XIOS is specified when launching the model. 
    202 The number of cores dedicated to XIOS should be from \texttildelow1/10 to \texttildelow1/50 of the number of  
    203 cores dedicated to NEMO. 
     202The number of cores dedicated to XIOS should be from \texttildelow1/10 to \texttildelow1/50 of the number of 
     203cores dedicated to \NEMO. 
    204204Some manufacturers suggest using O($\sqrt{N}$) dedicated IO processors for N processors but 
    205 this is a general recommendation and not specific to NEMO. 
     205this is a general recommendation and not specific to \NEMO. 
    206206It is difficult to provide precise recommendations because the optimal choice will depend on 
    207 the particular hardware properties of the target system  
     207the particular hardware properties of the target system 
    208208(parallel filesystem performance, available memory, memory bandwidth etc.) 
    209209and the volume and frequency of data to be created. 
     
    213213\subsubsection{Control of XIOS: the context in iodef.xml} 
    214214 
    215 As well as the {\ttfamily using\_server} flag, other controls on the use of XIOS are set in the XIOS context in iodef.xml. 
     215As well as the \texttt{using\_server} flag, other controls on the use of XIOS are set in 
     216the XIOS context in \textit{iodef.xml}. 
    216217See the XML basics section below for more details on XML syntax and rules. 
    217218 
     
    226227    \hline 
    227228    buffer\_size                                                            & 
    228     buffer size used by XIOS to send data from NEMO to XIOS. 
     229    buffer size used by XIOS to send data from \NEMO\ to XIOS. 
    229230    Larger is more efficient. 
    230231    Note that needed/used buffer sizes are summarized at the end of the job & 
     
    232233    \hline 
    233234    buffer\_server\_factor\_size                                            & 
    234     ratio between NEMO and XIOS buffer size. 
     235    ratio between \NEMO\ and XIOS buffer size. 
    235236    Should be 2.                                                            & 
    236237    2        \\ 
     
    249250    \hline 
    250251    oasis\_codes\_id                                                        & 
    251     when using oasis, define the identifier of NEMO in the namcouple. 
     252    when using oasis, define the identifier of \NEMO\ in the namcouple. 
    252253    Note that the identifier of XIOS is xios.x                              & 
    253254    oceanx   \\ 
     
    260261\subsubsection{Installation} 
    261262 
    262 As mentioned, XIOS is supported separately and must be downloaded and compiled before it can be used with NEMO. 
     263As mentioned, XIOS is supported separately and must be downloaded and compiled before it can be used with \NEMO. 
    263264See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for help and guidance. 
    264 NEMO will need to link to the compiled XIOS library. 
     265\NEMO\ will need to link to the compiled XIOS library. 
    265266The \href{https://forge.ipsl.jussieu.fr/nemo/chrome/site/doc/NEMO/guide/html/install.html#extract-and-install-xios} 
    266267{Extract and install XIOS} guide provides an example illustration of how this can be achieved. 
     
    275276\begin{enumerate} 
    276277\item[1.] 
    277   in NEMO code, add a \forcode{CALL iom_put( 'identifier', array )} where you want to output a 2D or 3D array. 
     278  in \NEMO\ code, add a \forcode{CALL iom_put( 'identifier', array )} where you want to output a 2D or 3D array. 
    278279\item[2.] 
    279280  If necessary, add \forcode{USE iom ! I/O manager library} to the list of used modules in 
     
    288289   <field_group id="grid_T" grid_ref="grid_T_3D"> <!-- T grid --> 
    289290   ... 
    290       <field id="identifier" long_name="blabla" ... />    
     291      <field id="identifier" long_name="blabla" ... /> 
    291292      ... 
    292 </field_definition>  
     293</field_definition> 
    293294\end{xmllines} 
    294295 
     
    313314 
    314315\begin{xmllines} 
    315 <file id="file1" .../>    
     316<file id="file1" .../> 
    316317... 
    317    <field field_ref="identifier" />    
     318   <field field_ref="identifier" /> 
    318319   ... 
    319 </file>    
     320</file> 
    320321\end{xmllines} 
    321322 
     
    333334See \href{http://www.xmlnews.org/docs/xml-basics.html}{here} for more details. 
    334335 
    335 \subsubsection{Structure of the XML file used in NEMO} 
     336\subsubsection{Structure of the XML file used in \NEMO} 
    336337 
    337338The XML file used in XIOS is structured by 7 families of tags: 
     
    382383                                                                                                     \xmlcode{<context id="xios" ... >}   \\ 
    383384    \hline 
    384     context nemo    &   context containing IO information for NEMO (mother grid when using AGRIF)  &  
     385    context nemo    &   context containing IO information for \NEMO\ (mother grid when using AGRIF)  & 
    385386                                                                                                     \xmlcode{<context id="nemo" ... >}   \\ 
    386387    \hline 
    387     context 1\_nemo &   context containing IO information for NEMO child grid 1 (when using AGRIF) &  
     388    context 1\_nemo &   context containing IO information for \NEMO\ child grid 1 (when using AGRIF) & 
    388389                                                                                                     \xmlcode{<context id="1_nemo" ... >} \\ 
    389390    \hline 
    390     context n\_nemo &   context containing IO information for NEMO child grid n (when using AGRIF) &  
     391    context n\_nemo &   context containing IO information for \NEMO\ child grid n (when using AGRIF) & 
    391392                                                                                                     \xmlcode{<context id="n_nemo" ... >} \\ 
    392393    \hline 
     
    413414\end{table} 
    414415 
    415 \noindent Each context tag related to NEMO (mother or child grids) is divided into 5 parts  
     416\noindent Each context tag related to \NEMO\ (mother or child grids) is divided into 5 parts 
    416417(that can be defined in any order): 
    417418 
     
    447448The inclusion of XML files into the main XML file can be done through the attribute src: 
    448449\xmlline|<context src="./nemo_def.xml" />| 
    449   
    450 \noindent In NEMO, by default, the field definition is done in 3 separate files ( 
     450 
     451\noindent In \NEMO, by default, the field definition is done in 3 separate files ( 
    451452\path{cfgs/SHARED/field_def_nemo-oce.xml}, 
    452453\path{cfgs/SHARED/field_def_nemo-pisces.xml} and 
     
    455456are included in the main iodef.xml file through the following commands: 
    456457\begin{xmllines} 
    457 <context id="nemo" src="./context_nemo.xml"/>  
     458<context id="nemo" src="./context_nemo.xml"/> 
    458459\end{xmllines} 
    459460 
     
    470471\begin{xmllines} 
    471472<field_definition operation="average" > 
    472    <field id="sst"                    />   <!-- averaged      sst -->  
    473    <field id="sss" operation="instant"/>   <!-- instantaneous sss -->  
    474 </field_definition>  
     473   <field id="sst"                    />   <!-- averaged      sst --> 
     474   <field id="sss" operation="instant"/>   <!-- instantaneous sss --> 
     475</field_definition> 
    475476\end{xmllines} 
    476477 
     
    489490</field_definition> 
    490491<file_definition> 
    491    <file id="myfile" output_freq="1d" />    
     492   <file id="myfile" output_freq="1d" /> 
    492493      <field field_ref="sst"                            />  <!-- default def --> 
    493494      <field field_ref="sss" long_name="my description" />  <!-- overwrite   --> 
    494495   </file> 
    495 </file_definition>  
     496</file_definition> 
    496497\end{xmllines} 
    497498 
     
    536537   <field_group group_ref="groupU" /> 
    537538   <field field_ref="uocetr_eff"   />  <!-- add another field --> 
    538 </file>    
     539</file> 
    539540\end{xmllines} 
    540541 
     
    548549Horizontal subdomains are defined through the attributs zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj of 
    549550the tag family domain. 
    550 It must therefore be done in the domain part of the XML file.  
    551 For example, in \path{cfgs/SHARED/domain_def.xml}, we provide the following example of a definition of  
     551It must therefore be done in the domain part of the XML file. 
     552For example, in \path{cfgs/SHARED/domain_def.xml}, we provide the following example of a definition of 
    552553a 5 by 5 box with the bottom left corner at point (10,10). 
    553554 
     
    566567\end{xmllines} 
    567568 
    568 Moorings are seen as an extrem case corresponding to a 1 by 1 subdomain.  
     569Moorings are seen as an extrem case corresponding to a 1 by 1 subdomain. 
    569570The Equatorial section, the TAO, RAMA and PIRATA moorings are already registered in the code and 
    570571can therefore be outputted without taking care of their (i,j) position in the grid. 
     
    579580\end{xmllines} 
    580581 
    581 Note that if the domain decomposition used in XIOS cuts the subdomain in several parts and if  
    582 you use the ''multiple\_file'' type for your output files,  
    583 you will endup with several files you will need to rebuild using unprovided tools (like ncpdq and ncrcat,  
     582Note that if the domain decomposition used in XIOS cuts the subdomain in several parts and if 
     583you use the ''multiple\_file'' type for your output files, 
     584you will endup with several files you will need to rebuild using unprovided tools (like ncpdq and ncrcat, 
    584585\href{http://nco.sourceforge.net/nco.html#Concatenation}{see nco manual}). 
    585586We are therefore advising to use the ''one\_file'' type in this case. 
     
    614615 
    615616\begin{xmllines} 
    616 <file_group id="1d" output_freq="1d" name="myfile_1d" >  
     617<file_group id="1d" output_freq="1d" name="myfile_1d" > 
    617618   <file id="myfileA" name_suffix="_AAA" > <!-- will create file "myfile_1d_AAA"  --> 
    618619      ... 
     
    669670\end{table} 
    670671 
    671 \noindent For example,  
     672\noindent For example, 
    672673\xmlline|<file id="myfile_hzoom" name="myfile_@expname@_@startdate@_freq@freq@" output_freq="1d" >| 
    673674 
     
    681682\noindent will give the following file name radical: \ifile{myfile\_ORCA2\_19891231\_freq1d} 
    682683 
    683 \subsubsection{Other controls of the XML attributes from NEMO} 
    684  
    685 The values of some attributes are defined by subroutine calls within NEMO  
     684\subsubsection{Other controls of the XML attributes from \NEMO} 
     685 
     686The values of some attributes are defined by subroutine calls within \NEMO 
    686687(calls to iom\_set\_domain\_attr, iom\_set\_axis\_attr and iom\_set\_field\_attr in \mdl{iom}). 
    687688Any definition given in the XML file will be overwritten. 
     
    778779\end{xmllines} 
    779780 
    780 Note that, then the code is crashing, writting real4 variables forces a numerical conversion from  
     781Note that, then the code is crashing, writting real4 variables forces a numerical conversion from 
    781782real8 to real4 which will create an internal error in NetCDF and will avoid the creation of the output files. 
    782783Forcing double precision outputs with prec="8" (for example in the field\_definition) will avoid this problem. 
     
    786787 
    787788\begin{xmllines} 
    788 <file_group id="1d" output_freq="1d" output_level="10" enabled=".true."> <!-- 1d files -->  
     789<file_group id="1d" output_freq="1d" output_level="10" enabled=".true."> <!-- 1d files --> 
    789790   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    790791      <field field_ref="sst" name="tos" > 
     
    795796      <variable id="my_global_attribute" type="string" > blabla_global </variable> 
    796797   </file> 
    797 </file_group>  
     798</file_group> 
    798799\end{xmllines} 
    799800 
     
    810811 
    811812\begin{xmllines} 
    812 <file_group id="5d" output_freq="5d"  output_level="10" enabled=".true." >  <!-- 5d files -->   
     813<file_group id="5d" output_freq="5d"  output_level="10" enabled=".true." >  <!-- 5d files --> 
    813814   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    814815      <field field_ref="toce" operation="instant" freq_op="5d" > @toce_e3t / @e3t </field> 
    815816   </file> 
    816 </file_group>  
     817</file_group> 
    817818\end{xmllines} 
    818819 
     
    839840 
    840841\begin{xmllines} 
    841 <file_group id="1m" output_freq="1m"  output_level="10" enabled=".true." >  <!-- 1m files -->   
     842<file_group id="1m" output_freq="1m"  output_level="10" enabled=".true." >  <!-- 1m files --> 
    842843   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    843       <field field_ref="ssh" name="sshstd" long_name="sea_surface_temperature_standard_deviation"  
     844      <field field_ref="ssh" name="sshstd" long_name="sea_surface_temperature_standard_deviation" 
    844845      operation="instant" freq_op="1m" > 
    845846         sqrt( @ssh2 - @ssh * @ssh ) 
    846847      </field> 
    847848   </file> 
    848 </file_group>  
     849</file_group> 
    849850\end{xmllines} 
    850851 
     
    853854here we use the default, average. 
    854855So, in the above case, @ssh2 will do the monthly mean of ssh*ssh. 
    855 Operation="instant" refers to the temporal operation to be performed on the field ''sqrt( @ssh2 - @ssh * @ssh )'':  
     856Operation="instant" refers to the temporal operation to be performed on the field ''sqrt( @ssh2 - @ssh * @ssh )'': 
    856857here the temporal average is alreday done by the ``@'' function so we just use instant. 
    857858field\_ref="ssh" means that attributes not explicitely defined, are inherited from ssh field. 
     
    871872 
    872873\begin{xmllines} 
    873 <file_group id="1m" output_freq="1m"  output_level="10" enabled=".true." >  <!-- 1m files -->   
     874<file_group id="1m" output_freq="1m"  output_level="10" enabled=".true." >  <!-- 1m files --> 
    874875   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
    875876      <field field_ref="sst" name="sstdcy" long_name="amplitude of sst diurnal cycle" operation="average" freq_op="1d" > 
     
    877878      </field> 
    878879   </file> 
    879 </file_group>  
     880</file_group> 
    880881\end{xmllines} 
    881882 
     
    13311332\subsection{CF metadata standard compliance} 
    13321333 
    1333 Output from the XIOS IO server is compliant with  
     1334Output from the XIOS IO server is compliant with 
    13341335\href{http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html}{version 1.5} of 
    1335 the CF metadata standard.  
     1336the CF metadata standard. 
    13361337Therefore while a user may wish to add their own metadata to the output files (as demonstrated in example 4 of 
    13371338section \autoref{subsec:IOM_xmlref}) the metadata should, for the most part, comply with the CF-1.5 standard. 
    13381339 
    13391340Some metadata that may significantly increase the file size (horizontal cell areas and vertices) are controlled by 
    1340 the namelist parameter \np{ln\_cfmeta} in the \ngn{namrun} namelist. 
     1341the namelist parameter \np{ln\_cfmeta} in the \nam{run} namelist. 
    13411342This must be set to true if these metadata are to be included in the output files. 
    13421343 
     
    13601361Datasets created with chunking and compression are not backwards compatible with NetCDF3 "classic" format but 
    13611362most analysis codes can be relinked simply with the new libraries and will then read both NetCDF3 and NetCDF4 files. 
    1362 NEMO executables linked with NetCDF4 libraries can be made to produce NetCDF3 files by 
    1363 setting the \np{ln\_nc4zip} logical to false in the \textit{namnc4} namelist: 
     1363\NEMO\ executables linked with NetCDF4 libraries can be made to produce NetCDF3 files by 
     1364setting the \np{ln\_nc4zip} logical to false in the \nam{nc4} namelist: 
    13641365 
    13651366%------------------------------------------namnc4---------------------------------------------------- 
     
    14041405 
    14051406\noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\ttfamily 46x38x1} respectively in 
    1406 the mono-processor case (\ie global domain of {\small\ttfamily 182x149x31}). 
    1407 An illustration of the potential space savings that NetCDF4 chunking and compression provides is given in  
     1407the mono-processor case (\ie\ global domain of {\small\ttfamily 182x149x31}). 
     1408An illustration of the potential space savings that NetCDF4 chunking and compression provides is given in 
    14081409table \autoref{tab:NC4} which compares the results of two short runs of the ORCA2\_LIM reference configuration with 
    14091410a 4x2 mpi partitioning. 
     
    14531454 
    14541455When \key{iomput} is activated with \key{netcdf4} chunking and compression parameters for fields produced via 
    1455 \np{iom\_put} calls are set via an equivalent and identically named namelist to \textit{namnc4} in 
    1456 \np{xmlio\_server.def}. 
    1457 Typically this namelist serves the mean files whilst the \ngn{ namnc4} in the main namelist file continues to 
     1456\rou{iom\_put} calls are set via an equivalent and identically named namelist to \nam{nc4} in 
     1457\textit{xmlio\_server.def}. 
     1458Typically this namelist serves the mean files whilst the \nam{nc4} in the main namelist file continues to 
    14581459serve the restart files. 
    14591460This duplication is unfortunate but appropriate since, if using io\_servers, the domain sizes of 
    14601461the individual files produced by the io\_server processes may be different to those produced by 
    14611462the invidual processing regions and different chunking choices may be desired. 
    1462   
     1463 
    14631464% ------------------------------------------------------------------------------------------------------------- 
    14641465%       Tracer/Dynamics Trends 
    14651466% ------------------------------------------------------------------------------------------------------------- 
    14661467\section[Tracer/Dynamics trends (\texttt{namtrd})] 
    1467 {Tracer/Dynamics trends (\protect\ngn{namtrd})} 
     1468{Tracer/Dynamics trends (\protect\nam{trd})} 
    14681469\label{sec:DIA_trd} 
    14691470 
    14701471%------------------------------------------namtrd---------------------------------------------------- 
    14711472 
    1472 \nlst{namtrd}  
     1473\nlst{namtrd} 
    14731474%------------------------------------------------------------------------------------------------------------- 
    14741475 
    14751476Each trend of the dynamics and/or temperature and salinity time evolution equations can be send to 
    14761477\mdl{trddyn} and/or \mdl{trdtra} modules (see TRD directory) just after their computation 
    1477 (\ie at the end of each $dyn\cdots.F90$ and/or $tra\cdots.F90$ routines). 
    1478 This capability is controlled by options offered in \ngn{namtrd} namelist. 
     1478(\ie\ at the end of each \textit{dyn....F90} and/or \textit{tra....F90} routines). 
     1479This capability is controlled by options offered in \nam{trd} namelist. 
    14791480Note that the output are done with XIOS, and therefore the \key{iomput} is required. 
    14801481 
    1481 What is done depends on the \ngn{namtrd} logical set to \forcode{.true.}: 
     1482What is done depends on the \nam{trd} logical set to \forcode{.true.}: 
    14821483 
    14831484\begin{description} 
     
    15021503\end{description} 
    15031504 
    1504 Note that the mixed layer tendency diagnostic can also be used on biogeochemical models via  
     1505Note that the mixed layer tendency diagnostic can also be used on biogeochemical models via 
    15051506the \key{trdtrc} and \key{trdmxl\_trc} CPP keys. 
    15061507 
    15071508\textbf{Note that} in the current version (v3.6), many changes has been introduced but not fully tested. 
    15081509In particular, options associated with \np{ln\_dyn\_mxl}, \np{ln\_vor\_trd}, and \np{ln\_tra\_mxl} are not working, 
    1509 and none of the options have been tested with variable volume (\ie \np{ln\_linssh}\forcode{ = .true.}). 
     1510and none of the options have been tested with variable volume (\ie\ \np{ln\_linssh}\forcode{ = .true.}). 
    15101511 
    15111512% ------------------------------------------------------------------------------------------------------------- 
     
    15171518%--------------------------------------------namflo------------------------------------------------------- 
    15181519 
    1519 \nlst{namflo}  
     1520\nlst{namflo} 
    15201521%-------------------------------------------------------------------------------------------------------------- 
    15211522 
    15221523The on-line computation of floats advected either by the three dimensional velocity field or constraint to 
    15231524remain at a given depth ($w = 0$ in the computation) have been introduced in the system during the CLIPPER project. 
    1524 Options are defined by \ngn{namflo} namelist variables. 
     1525Options are defined by \nam{flo} namelist variables. 
    15251526The algorithm used is based either on the work of \cite{blanke.raynaud_JPO97} (default option), 
    15261527or on a $4^th$ Runge-Hutta algorithm (\np{ln\_flork4}\forcode{ = .true.}). 
     
    15331534(IJK coordinates, (\np{ln\_ariane}\forcode{ = .true.}) ) or with longitude and latitude. 
    15341535 
    1535 In case of Ariane convention, input filename is \np{init\_float\_ariane}. 
     1536In case of Ariane convention, input filename is \textit{init\_float\_ariane}. 
    15361537Its format is: \\ 
    15371538{\scriptsize \texttt{I J K nisobfl itrash}} 
     
    15411542 - I,J,K  : indexes of initial position 
    15421543 
    1543  - nisobfl: 0 for an isobar float, 1 for a float following the w velocity   
     1544 - nisobfl: 0 for an isobar float, 1 for a float following the w velocity 
    15441545 
    15451546 - itrash : set to zero; it is a dummy variable to respect Ariane Tools convention 
     
    16271628This on-line Harmonic analysis is actived with \key{diaharm}. 
    16281629 
    1629 Some parameters are available in namelist \ngn{nam\_diaharm}: 
     1630Some parameters are available in namelist \nam{\_diaharm}: 
    16301631 
    16311632 - \np{nit000\_han} is the first time step used for harmonic analysis 
     
    16351636 - \np{nstep\_han}  is the  time step frequency for harmonic analysis 
    16361637 
    1637  - \np{nb\_ana}     is the number of harmonics to analyse 
     1638% - \np{nb\_ana}     is the number of harmonics to analyse 
    16381639 
    16391640 - \np{tname}       is an array with names of tidal constituents to analyse 
     
    16781679The pathways between them are contructed using tools which can be found in \texttt{tools/SECTIONS\_DIADCT} 
    16791680and are written in a binary file \texttt{section\_ijglobal.diadct} which is later read in by 
    1680 NEMO to compute on-line transports. 
     1681\NEMO\ to compute on-line transports. 
    16811682 
    16821683The on-line transports module creates three output ascii files: 
     
    16881689- \texttt{salt\_transport}   for   salt transports (unit: $10^{9}Kg s^{-1}$) \\ 
    16891690 
    1690 Namelist variables in \ngn{nam_diadct} control how frequently the flows are summed and the time scales over which 
     1691Namelist variables in \nam{\_diadct} control how frequently the flows are summed and the time scales over which 
    16911692they are averaged, as well as the level of output for debugging: 
    16921693\np{nn\_dct}   : frequency of instantaneous transports computing 
     
    17101711 - \texttt{long2 lat2}, coordinates of the second extremity of the section; 
    17111712 
    1712  - \texttt{nclass}    the number of bounds of your classes (\eg bounds for 2 classes); 
     1713 - \texttt{nclass}    the number of bounds of your classes (\eg\ bounds for 2 classes); 
    17131714 
    17141715 - \texttt{okstrpond} to compute    heat and       salt transports, \texttt{nostrpond} if no; 
     
    17431744 
    17441745 - \texttt{zsigp} for potential density classes \\ 
    1745    
     1746 
    17461747 The script \texttt{job.ksh} computes the pathway for each section and creates a binary file 
    1747  \texttt{section\_ijglobal.diadct} which is read by NEMO. \\ 
     1748 \texttt{section\_ijglobal.diadct} which is read by \NEMO. \\ 
    17481749 
    17491750 It is possible to use this tools for new configuations: \texttt{job.ksh} has to be updated with 
     
    18311832 
    18321833Let denote 
    1833 $\mathcal{M}$ the total mass    of liquid seawater ($\mathcal{M} = \int_D \rho dv$),  
    1834 $\mathcal{V}$ the total volume  of        seawater      ($\mathcal{V} = \int_D dv$),  
    1835 $\mathcal{A}$ the total surface of       the ocean      ($\mathcal{A} = \int_S ds$),  
    1836 $\bar{\rho}$ the global mean  seawater (\textit{in situ}) density  
     1834$\mathcal{M}$ the total mass    of liquid seawater ($\mathcal{M} = \int_D \rho dv$), 
     1835$\mathcal{V}$ the total volume  of        seawater      ($\mathcal{V} = \int_D dv$), 
     1836$\mathcal{A}$ the total surface of       the ocean      ($\mathcal{A} = \int_S ds$), 
     1837$\bar{\rho}$ the global mean  seawater (\textit{in situ}) density 
    18371838($\bar{\rho} = 1/\mathcal{V} \int_D \rho \,dv$), and 
    1838 $\bar{\eta}$ the global mean sea level  
     1839$\bar{\eta}$ the global mean sea level 
    18391840($\bar{\eta} = 1/\mathcal{A} \int_S \eta \,ds$). 
    18401841 
     
    18591860where $\rho$ is the \textit{in situ} density, and \textit{emp} the surface mass exchanges with the other media of 
    18601861the Earth system (atmosphere, sea-ice, land). 
    1861 Its global averaged leads to the total mass change  
     1862Its global averaged leads to the total mass change 
    18621863 
    18631864\begin{equation} 
     
    18761877\end{equation} 
    18771878 
    1878 The first term in equation \autoref{eq:ssh_nBq} alters sea level by adding or subtracting mass from the ocean.  
    1879 The second term arises from temporal changes in the global mean density; \ie from steric effects. 
     1879The first term in equation \autoref{eq:ssh_nBq} alters sea level by adding or subtracting mass from the ocean. 
     1880The second term arises from temporal changes in the global mean density; \ie\ from steric effects. 
    18801881 
    18811882In a Boussinesq fluid, $\rho$ is replaced by $\rho_o$ in all the equation except when $\rho$ appears multiplied by 
    1882 the gravity (\ie in the hydrostatic balance of the primitive Equations). 
     1883the gravity (\ie\ in the hydrostatic balance of the primitive Equations). 
    18831884In particular, the mass conservation equation, \autoref{eq:Co_nBq}, degenerates into the incompressibility equation: 
    18841885 
     
    19011902 
    19021903Nevertheless, following \citep{greatbatch_JGR94}, the steric effect on the volume can be diagnosed by 
    1903 considering the mass budget of the ocean.  
     1904considering the mass budget of the ocean. 
    19041905The apparent changes in $\mathcal{M}$, mass of the ocean, which are not induced by surface mass flux 
    19051906must be compensated by a spatially uniform change in the mean sea level due to expansion/contraction of the ocean 
     
    19171918is converted into a mean change in sea level. 
    19181919Introducing the total density anomaly, $\mathcal{D}= \int_D d_a \,dv$, 
    1919 where $d_a = (\rho -\rho_o ) / \rho_o$ is the density anomaly used in \NEMO (cf. \autoref{subsec:TRA_eos}) 
     1920where $d_a = (\rho -\rho_o ) / \rho_o$ is the density anomaly used in \NEMO\ (cf. \autoref{subsec:TRA_eos}) 
    19201921in \autoref{eq:M_Bq} leads to a very simple form for the steric height: 
    19211922 
     
    19271928The above formulation of the steric height of a Boussinesq ocean requires four remarks. 
    19281929First, one can be tempted to define $\rho_o$ as the initial value of $\mathcal{M}/\mathcal{V}$, 
    1929 \ie set $\mathcal{D}_{t=0}=0$, so that the initial steric height is zero. 
     1930\ie\ set $\mathcal{D}_{t=0}=0$, so that the initial steric height is zero. 
    19301931We do not recommend that. 
    19311932Indeed, in this case $\rho_o$ depends on the initial state of the ocean. 
     
    19411942does not change when the sea level is changing as it is the case in all global ocean GCMs 
    19421943(wetting and drying of grid point is not allowed). 
    1943    
     1944 
    19441945Third, the discretisation of \autoref{eq:steric_Bq} depends on the type of free surface which is considered. 
    1945 In the non linear free surface case, \ie \np{ln\_linssh}\forcode{ = .true.}, it is given by 
     1946In the non linear free surface case, \ie\ \np{ln\_linssh}\forcode{ = .true.}, it is given by 
    19461947 
    19471948\[ 
     
    19661967so that there are no associated ocean currents. 
    19671968Hence, the dynamically relevant sea level is the effective sea level, 
    1968 \ie the sea level as if sea ice (and snow) were converted to liquid seawater \citep{campin.marshall.ea_OM08}. 
    1969 However, in the current version of \NEMO the sea-ice is levitating above the ocean without mass exchanges between 
     1969\ie\ the sea level as if sea ice (and snow) were converted to liquid seawater \citep{campin.marshall.ea_OM08}. 
     1970However, in the current version of \NEMO\ the sea-ice is levitating above the ocean without mass exchanges between 
    19701971ice and ocean. 
    19711972Therefore the model effective sea level is always given by $\eta + \eta_s$, whether or not there is sea ice present. 
     
    20212022    } 
    20222023  \end{center} 
    2023 \end{figure}   
     2024\end{figure} 
    20242025%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    20252026 
    20262027% ----------------------------------------------------------- 
    2027 %       CMIP specific diagnostics  
     2028%       CMIP specific diagnostics 
    20282029% ----------------------------------------------------------- 
    20292030\subsection[CMIP specific diagnostics (\textit{diaar5.F90}, \textit{diaptr.F90})] 
     
    20332034In \mdl{diaar5} they correspond to outputs that are required for AR5 simulations (CMIP5) 
    20342035(see also \autoref{sec:DIA_steric} for one of them). 
    2035 The module \mdl{diaar5} is active when one of the following outputs is required : global total volume (voltot), global mean ssh (sshtot), global total mass (masstot), global mean temperature (temptot), global mean ssh steric (sshsteric), global mean ssh thermosteric (sshthster), global mean salinity (saltot), sea water pressure at sea floor (botpres), dynamic sea surface height (sshdyn). 
    2036  
    2037 In \mdl{diaptr} when \np{ln\_diaptr}\forcode{ = .true.}  
    2038 (see the \textit{\ngn{namptr} } namelist below) can be computed on-line the poleward heat and salt transports, their advective and diffusive component, and the meriodional stream function . 
     2036The module \mdl{diaar5} is active when one of the following outputs is required : 
     2037global total volume (voltot), global mean ssh (sshtot), global total mass (masstot), global mean temperature (temptot), 
     2038global mean ssh steric (sshsteric), global mean ssh thermosteric (sshthster), global mean salinity (saltot), 
     2039sea water pressure at sea floor (botpres), dynamic sea surface height (sshdyn). 
     2040 
     2041In \mdl{diaptr} when \np{ln\_diaptr}\forcode{ = .true.} 
     2042(see the \nam{ptr} namelist below) can be computed on-line the poleward heat and salt transports, 
     2043their advective and diffusive component, and the meriodional stream function . 
    20392044When \np{ln\_subbas}\forcode{ = .true.}, transports and stream function are computed for the Atlantic, Indian, 
    20402045Pacific and Indo-Pacific Oceans (defined north of 30\deg{S}) as well as for the World Ocean. 
     
    20442049%------------------------------------------namptr----------------------------------------- 
    20452050 
    2046 \nlst{namptr}  
     2051\nlst{namptr} 
    20472052%----------------------------------------------------------------------------------------- 
    20482053 
    20492054% ----------------------------------------------------------- 
    2050 %       25 hour mean and hourly Surface, Mid and Bed  
     2055%       25 hour mean and hourly Surface, Mid and Bed 
    20512056% ----------------------------------------------------------- 
    20522057\subsection{25 hour mean output for tidal models} 
     
    20972102Values greater than 1 indicate that information is propagated across more than one grid cell in a single time step. 
    20982103 
    2099 The variables can be activated by setting the \np{nn\_diacfl} namelist parameter to 1 in the \ngn{namctl} namelist. 
     2104The variables can be activated by setting the \np{nn\_diacfl} namelist parameter to 1 in the \nam{ctl} namelist. 
    21002105The diagnostics will be written out to an ascii file named cfl\_diagnostics.ascii. 
    21012106In this file the maximum value of $C_u$, $C_v$, and $C_w$ are printed at each timestep along with the coordinates of 
     
    21032108At the end of the model run the maximum value of $C_u$, $C_v$, and $C_w$ for the whole model run is printed along 
    21042109with the coordinates of each. 
    2105 The maximum values from the run are also copied to the ocean.output file.  
     2110The maximum values from the run are also copied to the ocean.output file. 
    21062111 
    21072112% ================================================================ 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_DIU.tex

    r11263 r11512  
    99\label{chap:DIU} 
    1010 
    11 \minitoc 
     11\chaptertoc 
    1212 
    1313 
     
    1616 
    1717Code to produce an estimate of the diurnal warming and cooling of the sea surface skin 
    18 temperature (skin SST) is found in the DIU directory.   
     18temperature (skin SST) is found in the DIU directory. 
    1919The skin temperature can be split into three parts: 
    2020\begin{itemize} 
     
    3030 
    3131Models are provided for both the warm layer, \mdl{diurnal\_bulk}, and the cool skin, \mdl{cool\_skin}. 
    32 Foundation SST is not considered as it can be obtained either from the main NEMO model 
    33 (\ie from the temperature of the top few model levels) or from some other source.   
     32Foundation SST is not considered as it can be obtained either from the main \NEMO\ model 
     33(\ie\ from the temperature of the top few model levels) or from some other source. 
    3434It must be noted that both the cool skin and warm layer models produce estimates of the change in temperature 
    3535($\Delta T_{\mathrm{cs}}$ and $\Delta T_{\mathrm{wl}}$) and 
    3636both must be added to a foundation SST to obtain the true skin temperature. 
    3737 
    38 Both the cool skin and warm layer models are controlled through the namelist \ngn{namdiu}: 
     38Both the cool skin and warm layer models are controlled through the namelist \nam{diu}: 
    3939 
    4040\nlst{namdiu} 
     
    4444  A logical switch for turning on/off both the cool skin and warm layer. 
    4545\item[\np{ln\_diurnal\_only}] 
    46   A logical switch which if \forcode{.true.} will run the diurnal model without the other dynamical parts of NEMO. 
     46  A logical switch which if \forcode{.true.} will run the diurnal model without the other dynamical parts of \NEMO. 
    4747  \np{ln\_diurnal\_only} must be \forcode{.false.} if \np{ln\_diurnal} is \forcode{.false.}. 
    4848\end{description} 
     
    5353Initialisation is through the restart file. 
    5454Specifically the code will expect the presence of the 2-D variable ``Dsst'' to initialise the warm layer. 
    55 The cool skin model, which is determined purely by the instantaneous fluxes, has no initialisation variable.   
     55The cool skin model, which is determined purely by the instantaneous fluxes, has no initialisation variable. 
    5656 
    5757%=============================================================== 
     
    102102\end{equation} 
    103103where $\zeta=\frac{D_T}{L}$.  It is clear that the first derivative of (\autoref{eq:stab_func_eqn}), 
    104 and thus of (\autoref{eq:ecmwf1}), is discontinuous at $\zeta=0$ (\ie $Q\rightarrow0$ in 
     104and thus of (\autoref{eq:ecmwf1}), is discontinuous at $\zeta=0$ (\ie\ $Q\rightarrow0$ in 
    105105equation (\autoref{eq:ecmwf2})). 
    106106 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_DOM.tex

    r11353 r11512  
    88\label{chap:DOM} 
    99 
    10 \minitoc 
     10%\chaptertoc 
    1111 
    1212% Missing things: 
    1313%  - istate: description of the initial state   ==> this has to be put elsewhere.. 
    14 %                  perhaps in MISC ?  By the way the initialisation of T S and dynamics  
     14%                  perhaps in MISC ?  By the way the initialisation of T S and dynamics 
    1515%                  should be put outside of DOM routine (better with TRC staff and off-line 
    1616%                  tracers) 
     
    1919 
    2020\vfill 
    21 \begin{figure}[b] 
    22 \subsubsection*{Changes record} 
    23 \begin{tabular}{m{0.08\linewidth}||m{0.32\linewidth}|m{0.6\linewidth}} 
    24     Release   & Author(s)     & Modifications \\ 
    25 \hline 
    26     {\em 4.0} & {\em Simon M{\"u}ller \& Andrew Coward} & {\em Compatibility changes for v4.0. Major simplication has moved many of the options to external domain configuration tools. For now this information has been retained in \autoref{apdx:DOMAINcfg} }  \\ 
    27     {\em 3.x} & {\em Sebastien Masson, Gurvan Madec \& Rashid Benshila } & {\em }  \\ 
    28 \end{tabular} 
    29 \end{figure} 
     21 
     22\begin{table}[b] 
     23  \footnotesize 
     24  \caption*{Changes record} 
     25  \begin{tabularx}{\textwidth}{l||X|X} 
     26    Release & Author(s) & Modifications                                                          \\ 
     27    \hline 
     28    {\em 4.0} & {\em Simon M\"{u}ller \& Andrew Coward} & 
     29    {\em 
     30      Compatibility changes Major simplification has moved many of the options to external domain configuration tools. 
     31      (see \autoref{apdx:DOMAINcfg}) 
     32    }                                                                                            \\ 
     33    {\em 3.x} & {\em Rachid Benshila, Gurvan Madec \& S\'{e}bastien Masson} & 
     34    {\em First version}                                                                          \\ 
     35  \end{tabularx} 
     36\end{table} 
    3037 
    3138\newpage 
    3239 
    33 Having defined the continuous equations in \autoref{chap:PE} and chosen a time discretization \autoref{chap:STP}, 
    34 we need to choose a grid for spatial discretization and related numerical algorithms. 
     40Having defined the continuous equations in \autoref{chap:PE} and chosen a time discretisation \autoref{chap:STP}, 
     41we need to choose a grid for spatial discretisation and related numerical algorithms. 
    3542In the present chapter, we provide a general description of the staggered grid used in \NEMO, 
    36 and other relevant information about the DOM (DOMain) source-code modules . 
     43and other relevant information about the DOM (DOMain) source code modules. 
    3744 
    3845% ================================================================ 
     
    4350 
    4451% ------------------------------------------------------------------------------------------------------------- 
    45 %        Arrangement of Variables  
     52%        Arrangement of Variables 
    4653% ------------------------------------------------------------------------------------------------------------- 
    4754\subsection{Arrangement of variables} 
     
    7582the barotropic stream function $\psi$ is defined at horizontal points overlying the $\zeta$ and $f$-points. 
    7683 
    77 The ocean mesh (\ie the position of all the scalar and vector points) is defined by the transformation that 
     84The ocean mesh (\ie\ the position of all the scalar and vector points) is defined by the transformation that 
    7885gives $(\lambda,\varphi,z)$ as a function of $(i,j,k)$. 
    7986The grid-points are located at integer or integer and a half value of $(i,j,k)$ as indicated on \autoref{tab:cell}. 
     
    127134 
    128135Note that the definition of the scale factors 
    129 (\ie as the analytical first derivative of the transformation that 
     136(\ie\ as the analytical first derivative of the transformation that 
    130137results in $(\lambda,\varphi,z)$ as a function of $(i,j,k)$) 
    131 is specific to the \NEMO model \citep{marti.madec.ea_JGR92}. 
     138is specific to the \NEMO\ model \citep{marti.madec.ea_JGR92}. 
    132139As an example, a scale factor in the $i$ direction is defined locally at a $t$-point, 
    133140whereas many other models on a C grid choose to define such a scale factor as 
     
    159166 
    160167% ------------------------------------------------------------------------------------------------------------- 
    161 %        Vector Invariant Formulation  
     168%        Vector Invariant Formulation 
    162169% ------------------------------------------------------------------------------------------------------------- 
    163170\subsection{Discrete operators} 
     
    173180 
    174181Similar operators are defined with respect to $i + 1/2$, $j$, $j + 1/2$, $k$, and $k + 1/2$. 
    175 Following \autoref{eq:PE_grad} and \autoref{eq:PE_lap}, the gradient of a variable $q$ defined at 
    176 a $t$-point has its three components defined at $u$-, $v$- and $w$-points while 
    177 its Laplacian is defined at the $t$-point. 
     182Following \autoref{eq:PE_grad} and \autoref{eq:PE_lap}, the gradient of a variable $q$ defined at a $t$-point has 
     183its three components defined at $u$-, $v$- and $w$-points while its Laplacian is defined at the $t$-point. 
    178184These operators have the following discrete forms in the curvilinear $s$-coordinates system: 
    179185\[ 
     
    215221 
    216222The vertical average over the whole water column is denoted by an overbar and is for 
    217 a masked field $q$ (\ie a quantity that is equal to zero inside solid areas): 
     223a masked field $q$ (\ie\ a quantity that is equal to zero inside solid areas): 
    218224\begin{equation} 
    219225  \label{eq:DOM_bar} 
     
    247253\end{alignat} 
    248254 
    249 In other words, the adjoint of the differencing and averaging operators are $\delta_i^* = \delta_{i + 1/2}$ and  
     255In other words, the adjoint of the differencing and averaging operators are $\delta_i^* = \delta_{i + 1/2}$ and 
    250256$(\overline{\cdots}^{\, i})^* = \overline{\cdots}^{\, i + 1/2}$, respectively. 
    251257These two properties will be used extensively in the \autoref{apdx:C} to 
     
    253259 
    254260% ------------------------------------------------------------------------------------------------------------- 
    255 %        Numerical Indexing  
     261%        Numerical Indexing 
    256262% ------------------------------------------------------------------------------------------------------------- 
    257263\subsection{Numerical indexing} 
     
    275281integer values for $t$-points only while all the other points involve integer and a half values. 
    276282Therefore, a specific integer indexing has been defined for points other than $t$-points 
    277 (\ie velocity and vorticity grid-points). 
     283(\ie\ velocity and vorticity grid-points). 
    278284Furthermore, the direction of the vertical indexing has been reversed and the surface level set at $k = 1$. 
    279285 
    280286% ----------------------------------- 
    281 %        Horizontal Indexing  
     287%        Horizontal Indexing 
    282288% ----------------------------------- 
    283289\subsubsection{Horizontal indexing} 
     
    288294the $t$-point and the eastward $u$-point (northward $v$-point) have the same index 
    289295(see the dashed area in \autoref{fig:index_hor}). 
    290 A $t$-point and its nearest northeast $f$-point have the same $i$-and $j$-indices. 
     296A $t$-point and its nearest north-east $f$-point have the same $i$-and $j$-indices. 
    291297 
    292298% ----------------------------------- 
    293 %        Vertical indexing  
     299%        Vertical indexing 
    294300% ----------------------------------- 
    295301\subsubsection{Vertical indexing} 
     
    303309The last $w$-level ($k = jpk$) either corresponds to or is below the ocean floor while 
    304310the last $t$-level is always outside the ocean domain (\autoref{fig:index_vert}). 
    305 Note that a $w$-point and the directly underlaying $t$-point have a common $k$ index (\ie $t$-points and their 
    306 nearest $w$-point neighbour in negative index direction), in contrast to the indexing on the horizontal plane where 
    307 the $t$-point has the same index as the nearest velocity points in the positive direction of the respective horizontal axis index 
     311Note that a $w$-point and the directly underlaying $t$-point have a common $k$ index 
     312(\ie\ $t$-points and their nearest $w$-point neighbour in negative index direction), 
     313in contrast to the indexing on the horizontal plane where the $t$-point has the same index as 
     314the nearest velocity points in the positive direction of the respective horizontal axis index 
    308315(compare the dashed area in \autoref{fig:index_hor} and \autoref{fig:index_vert}). 
    309316Since the scale factors are chosen to be strictly positive, 
    310 a \textit{minus sign} is included in the \fortran implementations of \textit{all the vertical derivatives} of 
    311 the discrete equations given in this manual in order to accommodate the opposing vertical index directions in implementation and documentation. 
     317a \textit{minus sign} is included in the \fortran implementations of 
     318\textit{all the vertical derivatives} of the discrete equations given in this manual in order to 
     319accommodate the opposing vertical index directions in implementation and documentation. 
    312320 
    313321%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    333341\nlst{namcfg} 
    334342 
    335 Two typical methods are available to specify the spatial domain 
    336 configuration; they can be selected using parameter \np{ln\_read\_cfg} 
    337 parameter in namelist \ngn{namcfg}.  
    338  
    339 If \np{ln\_read\_cfg} is set to \forcode{.true.}, the domain-specific parameters 
    340 and fields are read from a netCDF input file, whose name (without its .nc 
    341 suffix) can be specified as the value of the \np{cn\_domcfg} parameter in 
    342 namelist \ngn{namcfg}. 
    343  
    344 If \np{ln\_read\_cfg} is set to \forcode{.false.}, the domain-specific 
    345 parameters and fields can be provided (\eg analytically computed) by subroutines 
    346 \mdl{usrdef\_hgr} and \mdl{usrdef\_zgr}. These subroutines can be supplied in 
    347 the \path{MY_SRC} directory of the configuration, and default versions that 
    348 configure the spatial domain for the GYRE reference configuration are present in 
    349 the \path{src/OCE/USR} directory. 
    350  
    351 In version 4.0 there are no longer any options for reading complex bathmetries and  
    352 performing a vertical discretization at run-time. Whilst it is occasionally convenient 
    353 to have a common bathymetry file and, for example, to run similar models with and 
    354 without partial bottom boxes and/or sigma-coordinates, supporting such choices leads to 
    355 overly complex code. Worse still is the difficulty of ensuring the model configurations  
    356 intended to be identical are indeed so when the model domain itself can be altered by runtime 
    357 selections. The code previously used to perform vertical discretization has be incorporated  
    358 into an external tool (\path{tools/DOMAINcfg}) which is briefly described in \autoref{apdx:DOMAINcfg}. 
    359  
    360 The next subsections summarise the parameter and fields related to the 
    361 configuration of the whole model domain. These represent the minimum information 
    362 that must be provided either via the \np{cn\_domcfg} file or set by code 
    363 inserted into user-supplied versions of the \mdl{usrdef\_*} subroutines. The 
    364 requirements are presented in three sections: the domain size 
    365 (\autoref{subsec:DOM_size}), the horizontal mesh 
    366 (\autoref{subsec:DOM_hgr}), and the vertical grid 
    367 (\autoref{subsec:DOM_zgr}). 
     343Two typical methods are available to specify the spatial domain configuration; 
     344they can be selected using parameter \np{ln\_read\_cfg} parameter in namelist \nam{cfg}. 
     345 
     346If \np{ln\_read\_cfg} is set to \forcode{.true.}, 
     347the domain-specific parameters and fields are read from a netCDF input file, 
     348whose name (without its .nc suffix) can be specified as the value of the \np{cn\_domcfg} parameter in namelist \nam{cfg}. 
     349 
     350If \np{ln\_read\_cfg} is set to \forcode{.false.}, 
     351the domain-specific parameters and fields can be provided (\eg\ analytically computed) by 
     352subroutines \mdl{usrdef\_hgr} and \mdl{usrdef\_zgr}. 
     353These subroutines can be supplied in the \path{MY_SRC} directory of the configuration, 
     354and default versions that configure the spatial domain for the GYRE reference configuration are present in 
     355the \path{./src/OCE/USR} directory. 
     356 
     357In version 4.0 there are no longer any options for reading complex bathymetries and 
     358performing a vertical discretisation at run-time. 
     359Whilst it is occasionally convenient to have a common bathymetry file and, for example, 
     360to run similar models with and without partial bottom boxes and/or sigma-coordinates, 
     361supporting such choices leads to overly complex code. 
     362Worse still is the difficulty of ensuring the model configurations intended to be identical are indeed so when 
     363the model domain itself can be altered by runtime selections. 
     364The code previously used to perform vertical discretisation has been incorporated into an external tool 
     365(\path{./tools/DOMAINcfg}) which is briefly described in \autoref{apdx:DOMAINcfg}. 
     366 
     367The next subsections summarise the parameter and fields related to the configuration of the whole model domain. 
     368These represent the minimum information that must be provided either via the \np{cn\_domcfg} file or set by code 
     369inserted into user-supplied versions of the \texttt{usrdef\_*} subroutines. 
     370The requirements are presented in three sections: 
     371the domain size (\autoref{subsec:DOM_size}), the horizontal mesh (\autoref{subsec:DOM_hgr}), 
     372and the vertical grid (\autoref{subsec:DOM_zgr}). 
    368373 
    369374% ----------------------------------- 
     
    373378\label{subsec:DOM_size} 
    374379 
    375 The total size of the computational domain is set by the parameters 
    376 \np{jpiglo}, \np{jpjglo} and \np{jpkglo} for the $i$, $j$ and $k$ 
    377 directions, respectively. Note, that the variables \forcode{jpi} and \forcode{jpj} 
    378 refer to the size of each processor subdomain when the code is run in 
    379 parallel using domain decomposition (\key{mpp\_mpi} defined, see 
    380 \autoref{sec:LBC_mpp}). 
     380The total size of the computational domain is set by the parameters \jp{jpiglo}, \jp{jpjglo} and \jp{jpkglo} for 
     381the $i$, $j$ and $k$ directions, respectively. 
     382Note, that the variables \texttt{jpi} and \texttt{jpj} refer to the size of each processor subdomain when 
     383the code is run in parallel using domain decomposition (\key{mpp\_mpi} defined, 
     384see \autoref{sec:LBC_mpp}). 
    381385 
    382386The name of the configuration is set through parameter \np{cn\_cfg}, 
    383 and the nominal resolution through parameter \np{nn\_cfg} (unless in 
    384 the input file both of variables \forcode{ORCA} and \forcode{ORCA_index} 
    385 are present, in which case \np{cn\_cfg} and \np{nn\_cfg} are set from these 
    386 values accordingly). 
    387  
    388 The global lateral boundary condition type is selected from 8 options 
    389 using parameter \np{jperio}. See \autoref{sec:LBC_jperio} for 
    390 details on the available options and the corresponding values for 
    391 \np{jperio}. 
    392  
    393 % ================================================================ 
    394 % Domain: Horizontal Grid (mesh)  
     387and the nominal resolution through parameter \np{nn\_cfg} 
     388(unless in the input file both of variables \texttt{ORCA} and \texttt{ORCA\_index} are present, 
     389in which case \np{cn\_cfg} and \np{nn\_cfg} are set from these values accordingly). 
     390 
     391The global lateral boundary condition type is selected from 8 options using parameter \jp{jperio}. 
     392See \autoref{sec:LBC_jperio} for details on the available options and the corresponding values for \jp{jperio}. 
     393 
     394% ================================================================ 
     395% Domain: Horizontal Grid (mesh) 
    395396% ================================================================ 
    396397\subsection{Horizontal grid mesh (\protect\mdl{domhgr})} 
     
    402403\subsubsection{Required fields} 
    403404\label{sec:DOM_hgr_fields} 
    404 The explicit specification of a range of mesh-related fields are required for the definition of a configuration. These include: 
    405  
    406 \begin{Verbatim}[fontsize=\tiny] 
     405 
     406The explicit specification of a range of mesh-related fields are required for the definition of a configuration. 
     407These include: 
     408 
     409\begin{clines} 
    407410int    jpiglo, jpjglo, jpkglo            /* global domain sizes                                          */ 
    408411int    jperio                            /* lateral global domain b.c.                                   */ 
     
    411414double e1t, e1u, e1v, e1f                /* horizontal scale factors                                     */ 
    412415double e2t, e2u, e2v, e2f                /* horizontal scale factors                                     */ 
    413 \end{Verbatim} 
    414  
    415 The values of the geographic longitude and latitude arrays at indices $i,j$ correspond to the analytical expressions of the longitude $\lambda$ and latitude $\varphi$ as a function of $(i,j)$, evaluated at the values as specified in Table \autoref{tab:cell} for the respective grid-point position. The calculation of the values of the horizontal scale factor arrays in general additionally involves partial derivatives of $\lambda$ and $\varphi$ with respect to $i$ and $j$, evaluated for the same arguments as $\lambda$ and $\varphi$. 
     416\end{clines} 
     417 
     418The values of the geographic longitude and latitude arrays at indices $i,j$ correspond to 
     419the analytical expressions of the longitude $\lambda$ and latitude $\varphi$ as a function of $(i,j)$, 
     420evaluated at the values as specified in \autoref{tab:cell} for the respective grid-point position. 
     421The calculation of the values of the horizontal scale factor arrays in general additionally involves 
     422partial derivatives of $\lambda$ and $\varphi$ with respect to $i$ and $j$, 
     423evaluated for the same arguments as $\lambda$ and $\varphi$. 
    416424 
    417425\subsubsection{Optional fields} 
    418 \begin{Verbatim}[fontsize=\tiny] 
     426 
     427\begin{clines} 
    419428                                         /* Optional:                                                    */ 
    420429int    ORCA, ORCA_index                  /* configuration name, configuration resolution                 */ 
    421430double e1e2u, e1e2v                      /* U and V surfaces (if grid size reduction in some straits)    */ 
    422431double ff_f, ff_t                        /* Coriolis parameter (if not on the sphere)                    */ 
    423 \end{Verbatim} 
    424  
    425 NEMO can support the local reduction of key strait widths by altering individual values of 
    426 e2u or e1v at the appropriate locations. This is particularly useful for locations such as 
    427 Gibraltar or Indonesian Throughflow pinch-points (see \autoref{sec:MISC_strait} for 
    428 illustrated examples). The key is to reduce the faces of $T$-cell (\ie change the value of 
    429 the horizontal scale factors at $u$- or $v$-point) but not the volume of the cells. Doing 
    430 otherwise can lead to numerical instability issues.  In normal operation the surface areas 
    431 are computed from $\texttt{e1u} * \texttt{e2u}$ and $\texttt{e1v} * \texttt{e2v}$ but in 
    432 cases where a gridsize reduction is required, the unaltered surface areas at $u$ and $v$ 
    433 grid points (\texttt{e1e2u} and \texttt{e1e2v}, respectively) must be read or pre-computed 
    434 in \mdl{usrdef\_hgr}. If these arrays are present in the \np{cn\_domcfg} file they are 
    435 read and the internal computation is suppressed. Versions of \mdl{usrdef\_hgr} which set 
    436 their own values of \texttt{e1e2u} and \texttt{e1e2v} should set the surface-area 
    437 computation flag: \texttt{ie1e2u\_v} to a non-zero value to suppress their re-computation. 
     432\end{clines} 
     433 
     434\NEMO\ can support the local reduction of key strait widths by 
     435altering individual values of e2u or e1v at the appropriate locations. 
     436This is particularly useful for locations such as Gibraltar or Indonesian Throughflow pinch-points 
     437(see \autoref{sec:MISC_strait} for illustrated examples). 
     438The key is to reduce the faces of $T$-cell (\ie\ change the value of the horizontal scale factors at $u$- or $v$-point) but 
     439not the volume of the cells. 
     440Doing otherwise can lead to numerical instability issues. 
     441In normal operation the surface areas are computed from $e1u * e2u$ and $e1v * e2v$ but 
     442in cases where a gridsize reduction is required, 
     443the unaltered surface areas at $u$ and $v$ grid points (\texttt{e1e2u} and \texttt{e1e2v}, respectively) must be read or 
     444pre-computed in \mdl{usrdef\_hgr}. 
     445If these arrays are present in the \np{cn\_domcfg} file they are read and the internal computation is suppressed. 
     446Versions of \mdl{usrdef\_hgr} which set their own values of \texttt{e1e2u} and \texttt{e1e2v} should set 
     447the surface-area computation flag: 
     448\texttt{ie1e2u\_v} to a non-zero value to suppress their re-computation. 
    438449 
    439450\smallskip 
    440 Similar logic applies to the other optional fields: \texttt{ff\_f} and \texttt{ff\_t} 
    441 which can be used to provide the Coriolis parameter at F- and T-points respectively if the 
    442 mesh is not on a sphere. If present these fields will be read and used and the normal 
    443 calculation ($2*\Omega*\sin(\varphi)$) suppressed. Versions of \mdl{usrdef\_hgr} which set 
    444 their own values of \texttt{ff\_f} and \texttt{ff\_t} should set the Coriolis computation 
    445 flag: \texttt{iff} to a non-zero value to suppress their re-computation. 
    446  
    447 Note that longitudes, latitudes, and scale factors at $w$ points are exactly 
    448 equal to those of $t$ points, thus no specific arrays are defined at $w$ points. 
     451Similar logic applies to the other optional fields: 
     452\texttt{ff\_f} and \texttt{ff\_t} which can be used to provide the Coriolis parameter at F- and T-points respectively if 
     453the mesh is not on a sphere. 
     454If present these fields will be read and used and the normal calculation ($2 * \Omega * \sin(\varphi)$) suppressed. 
     455Versions of \mdl{usrdef\_hgr} which set their own values of \texttt{ff\_f} and \texttt{ff\_t} should set 
     456the Coriolis computation flag: 
     457\texttt{iff} to a non-zero value to suppress their re-computation. 
     458 
     459Note that longitudes, latitudes, and scale factors at $w$ points are exactly equal to those of $t$ points, 
     460thus no specific arrays are defined at $w$ points. 
    449461 
    450462 
     
    459471%------------------------------------------------------------------------------------------------------------- 
    460472 
    461 In the vertical, the model mesh is determined by four things:  
     473In the vertical, the model mesh is determined by four things: 
    462474\begin{enumerate} 
    463   \item the bathymetry given in meters;  
    464   \item the number of levels of the model (\jp{jpk});  
     475  \item the bathymetry given in meters; 
     476  \item the number of levels of the model (\jp{jpk}); 
    465477  \item the analytical transformation $z(i,j,k)$ and the vertical scale factors (derivatives of the transformation); and 
    466   \item the masking system, \ie the number of wet model levels at each  
     478  \item the masking system, \ie\ the number of wet model levels at each 
    467479$(i,j)$ location of the horizontal grid. 
    468480\end{enumerate} 
     
    488500 
    489501The choice of a vertical coordinate is made when setting up the configuration; 
    490 it is not intended to be an option which can be changed in the middle of an 
    491 experiment. The one exception to this statement being the choice of linear or 
    492 non-linear free surface. In v4.0 the linear free surface option is implemented 
    493 as a special case of the non-linear free surface. This is computationally 
    494 wasteful since it uses the structures for time-varying 3D metrics for fields 
    495 that (in the linear free surface case) are fixed. However, the linear 
    496 free-surface is rarely used and implementing it this way means a single configuration 
    497 file can support both options. 
    498  
    499 By default a non-linear free surface is used (\np{ln\_linssh} set to \forcode{ = 
    500 .false.} in \ngn{namdom}): the coordinate follow the time-variation of the free 
    501 surface so that the transformation is time dependent: $z(i,j,k,t)$ 
    502 (\eg \autoref{fig:z_zps_s_sps}f).  When a linear free surface is assumed 
    503 (\np{ln\_linssh} set to \forcode{ = .true.} in \ngn{namdom}), the vertical 
    504 coordinates are fixed in time, but the seawater can move up and down across the 
    505 $z_0$ surface (in other words, the top of the ocean in not a rigid lid). 
    506  
    507 Note that settings: \np{ln\_zco}, \np{ln\_zps}, \np{ln\_sco} and \np{ln\_isfcav} mentioned 
    508 in the following sections appear to be namelist options but they are no longer truly 
    509 namelist options for NEMO. Their value is written to and read from the domain configuration file 
    510 and they should be treated as fixed parameters for a particular configuration. They are 
    511 namelist options for the \forcode{DOMAINcfg} tool that can be used to build the 
    512 configuration file and serve both to provide a record of the choices made whilst building the 
    513 configuration and to trigger appropriate code blocks within NEMO. 
     502it is not intended to be an option which can be changed in the middle of an experiment. 
     503The one exception to this statement being the choice of linear or non-linear free surface. 
     504In v4.0 the linear free surface option is implemented as a special case of the non-linear free surface. 
     505This is computationally wasteful since it uses the structures for time-varying 3D metrics 
     506for fields that (in the linear free surface case) are fixed. 
     507However, the linear free-surface is rarely used and implementing it this way means 
     508a single configuration file can support both options. 
     509 
     510By default a non-linear free surface is used (\np{ln\_linssh} set to \forcode{ = .false.} in \nam{dom}): 
     511the coordinate follow the time-variation of the free surface so that the transformation is time dependent: 
     512$z(i,j,k,t)$ (\eg\ \autoref{fig:z_zps_s_sps}f). 
     513When a linear free surface is assumed (\np{ln\_linssh} set to \forcode{ = .true.} in \nam{dom}), 
     514the vertical coordinates are fixed in time, but the seawater can move up and down across the $z_0$ surface 
     515(in other words, the top of the ocean in not a rigid lid). 
     516 
     517Note that settings: 
     518\np{ln\_zco}, \np{ln\_zps}, \np{ln\_sco} and \np{ln\_isfcav} mentioned in the following sections 
     519appear to be namelist options but they are no longer truly namelist options for \NEMO. 
     520Their value is written to and read from the domain configuration file and 
     521they should be treated as fixed parameters for a particular configuration. 
     522They are namelist options for the \texttt{DOMAINcfg} tool that can be used to build the configuration file and 
     523serve both to provide a record of the choices made whilst building the configuration and 
     524to trigger appropriate code blocks within \NEMO. 
    514525These values should not be altered in the \np{cn\_domcfg} file. 
    515526 
     
    527538$s-z$ or $s-zps$ coordinate (\autoref{fig:z_zps_s_sps}d and \autoref{fig:z_zps_s_sps}e). 
    528539 
    529 A further choice related to vertical coordinate concerns the presence (or not) of ocean 
    530 cavities beneath ice shelves within the model domain.  A setting of \np{ln\_isfcav} as 
    531 \forcode{.true.} indicates that the domain contains  ocean cavities, otherwise the top, 
    532 wet layer of the ocean will always be at the ocean surface.  This option is currently only 
    533 available for $z$- or $zps$-coordinates. In the latter case, partial steps are also applied 
    534 at the ocean/ice shelf interface. 
    535  
    536 Within the model, the arrays describing the grid point depths and vertical scale factors 
    537 are three set of three dimensional arrays $(i,j,k)$ defined at \textit{before}, 
    538 \textit{now} and \textit{after} time step.  The time at which they are defined is 
    539 indicated by a suffix: $\_b$, $\_n$, or $\_a$, respectively.  They are updated at each 
    540 model time step. The initial fixed reference coordinate system is held in variable names 
    541 with a $\_0$ suffix.  When the linear free surface option is used 
    542 (\np{ln\_linssh}\forcode{ = .true.}), \textit{before}, \textit{now} and \textit{after} 
    543 arrays are initially set to their reference counterpart and remain fixed. 
     540A further choice related to vertical coordinate concerns 
     541the presence (or not) of ocean cavities beneath ice shelves within the model domain. 
     542A setting of \np{ln\_isfcav} as \forcode{.true.} indicates that the domain contains ocean cavities, 
     543otherwise the top, wet layer of the ocean will always be at the ocean surface. 
     544This option is currently only available for $z$- or $zps$-coordinates. 
     545In the latter case, partial steps are also applied at the ocean/ice shelf interface. 
     546 
     547Within the model, the arrays describing the grid point depths and vertical scale factors are three set of 
     548three dimensional arrays $(i,j,k)$ defined at \textit{before}, \textit{now} and \textit{after} time step. 
     549The time at which they are defined is indicated by a suffix: $\_b$, $\_n$, or $\_a$, respectively. 
     550They are updated at each model time step. 
     551The initial fixed reference coordinate system is held in variable names with a $\_0$ suffix. 
     552When the linear free surface option is used (\np{ln\_linssh}\forcode{ = .true.}), 
     553\textit{before}, \textit{now} and \textit{after} arrays are initially set to 
     554their reference counterpart and remain fixed. 
    544555 
    545556\subsubsection{Required fields} 
    546557\label{sec:DOM_zgr_fields} 
    547 The explicit specification of a range of fields related to the vertical grid are required for the definition of a configuration. These include: 
    548  
    549 \begin{Verbatim}[fontsize=\tiny] 
     558 
     559The explicit specification of a range of fields related to the vertical grid are required for 
     560the definition of a configuration. 
     561These include: 
     562 
     563\begin{clines} 
    550564int    ln_zco, ln_zps, ln_sco            /* flags for z-coord, z-coord with partial steps and s-coord    */ 
    551565int    ln_isfcav                         /* flag  for ice shelf cavities                                 */ 
     
    556570                                         /* For reference:                                               */ 
    557571float  bathy_metry                       /* bathymetry used in setting top and bottom levels             */ 
    558 \end{Verbatim} 
    559  
    560 This set of vertical metrics is sufficient to describe the initial depth and thickness of 
    561 every gridcell in the model regardless of the choice of vertical coordinate. With constant 
    562 z-levels, e3 metrics will be uniform across each horizontal level. In the partial step 
    563 case each e3 at the \np{bottom\_level} (and, possibly, \np{top\_level} if ice cavities are 
    564 present) may vary from its horizontal neighbours. And, in s-coordinates, variations can 
    565 occur throughout the water column. With the non-linear free-surface, all the coordinates 
    566 behave more like the s-coordinate in that variations occurr throughout the water column 
    567 with displacements related to the sea surface height. These variations are typically much 
    568 smaller than those arising from bottom fitted coordinates. The values for vertical metrics 
    569 supplied in the domain configuration file can be considered as those arising from a flat 
    570 sea surface with zero elevation. 
    571  
    572 The \np{bottom\_level} and \np{top\_level} 2D arrays define the \np{bottom\_level} and top 
    573 wet levels in each grid column. Without ice cavities, \np{top\_level} is essentially a land 
    574 mask (0 on land; 1 everywhere else). With ice cavities, \np{top\_level} determines the 
    575 first wet point below the overlying ice shelf. 
    576  
    577  
    578  
    579 % ------------------------------------------------------------------------------------------------------------- 
    580 %        level bathymetry and mask  
     572\end{clines} 
     573 
     574This set of vertical metrics is sufficient to describe the initial depth and thickness of every gridcell in 
     575the model regardless of the choice of vertical coordinate. 
     576With constant z-levels, e3 metrics will be uniform across each horizontal level. 
     577In the partial step case each e3 at the \jp{bottom\_level} 
     578(and, possibly, \jp{top\_level} if ice cavities are present) 
     579may vary from its horizontal neighbours. 
     580And, in s-coordinates, variations can occur throughout the water column. 
     581With the non-linear free-surface, all the coordinates behave more like the s-coordinate in 
     582that variations occur throughout the water column with displacements related to the sea surface height. 
     583These variations are typically much smaller than those arising from bottom fitted coordinates. 
     584The values for vertical metrics supplied in the domain configuration file can be considered as 
     585those arising from a flat sea surface with zero elevation. 
     586 
     587The \jp{bottom\_level} and \jp{top\_level} 2D arrays define the \jp{bottom\_level} and top wet levels in each grid column. 
     588Without ice cavities, \jp{top\_level} is essentially a land mask (0 on land; 1 everywhere else). 
     589With ice cavities, \jp{top\_level} determines the first wet point below the overlying ice shelf. 
     590 
     591 
     592% ------------------------------------------------------------------------------------------------------------- 
     593%        level bathymetry and mask 
    581594% ------------------------------------------------------------------------------------------------------------- 
    582595\subsubsection{Level bathymetry and mask} 
     
    584597 
    585598 
    586 From \np{top\_level} and \np{bottom\_level} fields, the mask fields are defined as follows: 
     599From \jp{top\_level} and \jp{bottom\_level} fields, the mask fields are defined as follows: 
    587600\begin{alignat*}{2} 
    588601  tmask(i,j,k) &= &  & 
     
    603616Note that, without ice shelves cavities, 
    604617masks at $t-$ and $w-$points are identical with the numerical indexing used (\autoref{subsec:DOM_Num_Index}). 
    605 Nevertheless, $wmask$ are required with ocean cavities to deal with the top boundary (ice shelf/ocean interface)  
     618Nevertheless, $wmask$ are required with ocean cavities to deal with the top boundary (ice shelf/ocean interface) 
    606619exactly in the same way as for the bottom boundary. 
    607620 
     
    614627 
    615628%------------------------------------------------------------------------------------------------- 
    616 %        Closed seas  
     629%        Closed seas 
    617630%------------------------------------------------------------------------------------------------- 
    618 \subsection{Closed seas} \label{subsec:DOM_closea}  
    619  
    620 When a global ocean is coupled to an atmospheric model it is better to represent all large 
    621 water bodies (\eg great lakes, Caspian sea...) even if the model resolution does not allow 
    622 their communication with the rest of the ocean.  This is unnecessary when the ocean is 
    623 forced by fixed atmospheric conditions, so these seas can be removed from the ocean 
    624 domain.  The user has the option to set the bathymetry in closed seas to zero (see 
    625 \autoref{sec:MISC_closea}) and to optionally decide on the fate of any freshwater 
    626 imbalance over the area. The options are explained in \autoref{sec:MISC_closea} but it 
    627 should be noted here that a successful use of these options requires appropriate mask 
    628 fields to be present in the domain configuration file. Among the possibilities are: 
    629  
    630 \begin{Verbatim}[fontsize=\tiny] 
     631\subsection{Closed seas} \label{subsec:DOM_closea} 
     632 
     633When a global ocean is coupled to an atmospheric model it is better to represent all large water bodies 
     634(\eg\ Great Lakes, Caspian sea \dots) even if the model resolution does not allow their communication with 
     635the rest of the ocean. 
     636This is unnecessary when the ocean is forced by fixed atmospheric conditions, 
     637so these seas can be removed from the ocean domain. 
     638The user has the option to set the bathymetry in closed seas to zero (see \autoref{sec:MISC_closea}) and 
     639to optionally decide on the fate of any freshwater imbalance over the area. 
     640The options are explained in \autoref{sec:MISC_closea} but it should be noted here that 
     641a successful use of these options requires appropriate mask fields to be present in the domain configuration file. 
     642Among the possibilities are: 
     643 
     644\begin{clines} 
    631645int    closea_mask          /* non-zero values in closed sea areas for optional masking                  */ 
    632646int    closea_mask_rnf      /* non-zero values in closed sea areas with runoff locations (precip only)   */ 
    633647int    closea_mask_emp      /* non-zero values in closed sea areas with runoff locations (total emp)     */ 
    634 \end{Verbatim} 
     648\end{clines} 
    635649 
    636650% ------------------------------------------------------------------------------------------------------------- 
     
    642656\nlst{namcfg} 
    643657 
    644 Most of the arrays relating to a particular ocean model configuration dicussed in this 
    645 chapter (grid-point position, scale factors) can be saved in a file if namelist parameter 
    646 \np{ln\_write\_cfg} (namelist \ngn{namcfg}) is set to \forcode{.true.}; the output 
    647 filename is set thorugh parameter \np{cn\_domcfg\_out}. This is only really useful 
    648 if the fields are computed in subroutines \mdl{usrdef\_hgr} or \mdl{usrdef\_zgr} and 
     658Most of the arrays relating to a particular ocean model configuration discussed in this chapter 
     659(grid-point position, scale factors) 
     660can be saved in a file if 
     661namelist parameter \np{ln\_write\_cfg} (namelist \nam{cfg}) is set to \forcode{.true.}; 
     662the output filename is set through parameter \np{cn\_domcfg\_out}. 
     663This is only really useful if 
     664the fields are computed in subroutines \mdl{usrdef\_hgr} or \mdl{usrdef\_zgr} and 
    649665checking or confirmation is required. 
    650666 
     
    652668 
    653669Alternatively, all the arrays relating to a particular ocean model configuration 
    654 (grid-point position, scale factors, depths and masks) can be saved in a file called 
    655 \texttt{mesh\_mask} if namelist parameter \np{ln\_meshmask} (namelist \ngn{namdom}) is set 
    656 to \forcode{.true.}. This file contains additional fields that can be useful for 
    657 post-processing applications 
     670(grid-point position, scale factors, depths and masks) 
     671can be saved in a file called \texttt{mesh\_mask} if 
     672namelist parameter \np{ln\_meshmask} (namelist \nam{dom}) is set to \forcode{.true.}. 
     673This file contains additional fields that can be useful for post-processing applications. 
    658674 
    659675% ================================================================ 
     
    664680\label{sec:DTA_tsd} 
    665681%-----------------------------------------namtsd------------------------------------------- 
    666 \nlst{namtsd}  
     682\nlst{namtsd} 
    667683%------------------------------------------------------------------------------------------ 
    668684 
    669 Basic initial state options are defined in \ngn{namtsd}.  By default, the ocean starts 
    670 from rest (the velocity field is set to zero) and the initialization of temperature and 
    671 salinity fields is controlled through the \np{ln\_tsd\_init} namelist parameter. 
     685Basic initial state options are defined in \nam{tsd}. 
     686By default, the ocean starts from rest (the velocity field is set to zero) and 
     687the initialization of temperature and salinity fields is controlled through the \np{ln\_tsd\_init} namelist parameter. 
    672688 
    673689\begin{description} 
    674690\item[\np{ln\_tsd\_init}\forcode{= .true.}] 
    675   Use T and S input files that can be given on the model grid itself or on their native 
    676   input data grids.  In the latter case, the data will be interpolated on-the-fly both in 
    677   the horizontal and the vertical to the model grid (see \autoref{subsec:SBC_iof}).  The 
    678   information relating to the input files are specified in the \np{sn\_tem} and 
    679   \np{sn\_sal} structures.  The computation is done in the \mdl{dtatsd} module. 
     691  Use T and S input files that can be given on the model grid itself or on their native input data grids. 
     692  In the latter case, the data will be interpolated on-the-fly both in the horizontal and the vertical to the model grid 
     693  (see \autoref{subsec:SBC_iof}). 
     694  The information relating to the input files are specified in the \np{sn\_tem} and \np{sn\_sal} structures. 
     695  The computation is done in the \mdl{dtatsd} module. 
    680696\item[\np{ln\_tsd\_init}\forcode{= .false.}] 
    681   Initial values for T and S are set via a user supplied \rou{usr\_def\_istate} routine 
    682   contained in \mdl{userdef\_istate}. The default version sets horizontally uniform T and 
    683   profiles as used in the  GYRE configuration (see \autoref{sec:CFG_gyre}). 
     697  Initial values for T and S are set via a user supplied \rou{usr\_def\_istate} routine contained in \mdl{userdef\_istate}. 
     698  The default version sets horizontally uniform T and profiles as used in the GYRE configuration 
     699  (see \autoref{sec:CFG_gyre}). 
    684700\end{description} 
    685701 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_DYN.tex

    r11263 r11512  
    88\label{chap:DYN} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212Using the representation described in \autoref{chap:DOM}, 
     
    3636(surface wind stress calculation using bulk formulae, estimation of mixing coefficients) 
    3737that are carried out in modules SBC, LDF and ZDF and are described in 
    38 \autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively.  
     38\autoref{chap:SBC}, \autoref{chap:LDF} and \autoref{chap:ZDF}, respectively. 
    3939 
    4040In the present chapter we also describe the diagnostic equations used to compute the horizontal divergence, 
    4141curl of the velocities (\emph{divcur} module) and the vertical velocity (\emph{wzvmod} module). 
    4242 
    43 The different options available to the user are managed by namelist variables.  
    44 For term \textit{ttt} in the momentum equations, the logical namelist variables are \textit{ln\_dynttt\_xxx},  
     43The different options available to the user are managed by namelist variables. 
     44For term \textit{ttt} in the momentum equations, the logical namelist variables are \textit{ln\_dynttt\_xxx}, 
    4545where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme. 
    46 If a CPP key is used for this term its name is \key{ttt}. 
     46%If a CPP key is used for this term its name is \key{ttt}. 
    4747The corresponding code can be found in the \textit{dynttt\_xxx} module in the DYN directory, 
    4848and it is usually computed in the \textit{dyn\_ttt\_xxx} subroutine. 
    4949 
    5050The user has the option of extracting and outputting each tendency term from the 3D momentum equations 
    51 (\key{trddyn} defined), as described in \autoref{chap:MISC}. 
    52 Furthermore, the tendency terms associated with the 2D barotropic vorticity balance (when \key{trdvor} is defined) 
     51(\texttt{trddyn?} defined), as described in \autoref{chap:MISC}. 
     52Furthermore, the tendency terms associated with the 2D barotropic vorticity balance (when \texttt{trdvor?} is defined) 
    5353can be derived from the 3D terms. 
    5454%%% 
    55 \gmcomment{STEVEN: not quite sure I've got the sense of the last sentence. does  
     55\gmcomment{STEVEN: not quite sure I've got the sense of the last sentence. does 
    5656MISC correspond to "extracting tendency terms" or "vorticity balance"?} 
    5757 
     
    6969\label{subsec:DYN_divcur} 
    7070 
    71 The vorticity is defined at an $f$-point (\ie corner point) as follows: 
     71The vorticity is defined at an $f$-point (\ie\ corner point) as follows: 
    7272\begin{equation} 
    7373  \label{eq:divcur_cur} 
    7474  \zeta =\frac{1}{e_{1f}\,e_{2f} }\left( {\;\delta_{i+1/2} \left[ {e_{2v}\;v} \right] 
    7575      -\delta_{j+1/2} \left[ {e_{1u}\;u} \right]\;} \right) 
    76 \end{equation}  
     76\end{equation} 
    7777 
    7878The horizontal divergence is defined at a $T$-point. 
     
    9797ensure perfect restartability. 
    9898The vorticity and divergence at the \textit{now} time step are used for the computation of 
    99 the nonlinear advection and of the vertical velocity respectively.  
     99the nonlinear advection and of the vertical velocity respectively. 
    100100 
    101101%-------------------------------------------------------------------------------------------------------------- 
     
    117117  \end{aligned} 
    118118\end{equation} 
    119 where \textit{emp} is the surface freshwater budget (evaporation minus precipitation),  
     119where \textit{emp} is the surface freshwater budget (evaporation minus precipitation), 
    120120expressed in Kg/m$^2$/s (which is equal to mm/s), 
    121121and $\rho_w$=1,035~Kg/m$^3$ is the reference density of sea water (Boussinesq approximation). 
    122122If river runoff is expressed as a surface freshwater flux (see \autoref{chap:SBC}) then 
    123 \textit{emp} can be written as the evaporation minus precipitation, minus the river runoff.  
     123\textit{emp} can be written as the evaporation minus precipitation, minus the river runoff. 
    124124The sea-surface height is evaluated using exactly the same time stepping scheme as 
    125125the tracer equation \autoref{eq:tra_nxt}: 
    126126a leapfrog scheme in combination with an Asselin time filter, 
    127 \ie the velocity appearing in \autoref{eq:dynspg_ssh} is centred in time (\textit{now} velocity). 
     127\ie\ the velocity appearing in \autoref{eq:dynspg_ssh} is centred in time (\textit{now} velocity). 
    128128This is of paramount importance. 
    129129Replacing $T$ by the number $1$ in the tracer equation and summing over the water column must lead to 
     
    144144\end{equation} 
    145145 
    146 In the case of a non-linear free surface (\key{vvl}), the top vertical velocity is $-\textit{emp}/\rho_w$,  
     146In the case of a non-linear free surface (\texttt{vvl?}), the top vertical velocity is $-\textit{emp}/\rho_w$, 
    147147as changes in the divergence of the barotropic transport are absorbed into the change of the level thicknesses, 
    148148re-orientated downward. 
     
    151151The upper boundary condition applies at a fixed level $z=0$. 
    152152The top vertical velocity is thus equal to the divergence of the barotropic transport 
    153 (\ie the first term in the right-hand-side of \autoref{eq:dynspg_ssh}). 
     153(\ie\ the first term in the right-hand-side of \autoref{eq:dynspg_ssh}). 
    154154 
    155155Note also that whereas the vertical velocity has the same discrete expression in $z$- and $s$-coordinates, 
     
    158158Note also that the $k$-axis is re-orientated downwards in the \fortran code compared to 
    159159the indexing used in the semi-discrete equations such as \autoref{eq:wzv} 
    160 (see \autoref{subsec:DOM_Num_Index_vertical}).  
     160(see \autoref{subsec:DOM_Num_Index_vertical}). 
    161161 
    162162 
     
    168168%-----------------------------------------nam_dynadv---------------------------------------------------- 
    169169 
    170 \nlst{namdyn_adv}  
     170\nlst{namdyn_adv} 
    171171%------------------------------------------------------------------------------------------------------------- 
    172172 
    173173The vector invariant form of the momentum equations is the one most often used in 
    174 applications of the \NEMO ocean model. 
     174applications of the \NEMO\ ocean model. 
    175175The flux form option (see next section) has been present since version $2$. 
    176 Options are defined through the \ngn{namdyn\_adv} namelist variables Coriolis and 
     176Options are defined through the \nam{dyn\_adv} namelist variables Coriolis and 
    177177momentum advection terms are evaluated using a leapfrog scheme, 
    178 \ie the velocity appearing in these expressions is centred in time (\textit{now} velocity).  
     178\ie\ the velocity appearing in these expressions is centred in time (\textit{now} velocity). 
    179179At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied following 
    180180\autoref{chap:LBC}. 
    181181 
    182182% ------------------------------------------------------------------------------------------------------------- 
    183 %        Vorticity term  
     183%        Vorticity term 
    184184% ------------------------------------------------------------------------------------------------------------- 
    185185\subsection[Vorticity term (\textit{dynvor.F90})] 
     
    188188%------------------------------------------nam_dynvor---------------------------------------------------- 
    189189 
    190 \nlst{namdyn_vor}  
     190\nlst{namdyn_vor} 
    191191%------------------------------------------------------------------------------------------------------------- 
    192192 
    193 Options are defined through the \ngn{namdyn\_vor} namelist variables. 
    194 Four discretisations of the vorticity term (\np{ln\_dynvor\_xxx}\forcode{ = .true.}) are available: 
     193Options are defined through the \nam{dyn\_vor} namelist variables. 
     194Four discretisations of the vorticity term (\texttt{ln\_dynvor\_xxx}\forcode{ = .true.}) are available: 
    195195conserving potential enstrophy of horizontally non-divergent flow (ENS scheme); 
    196196conserving horizontal kinetic energy (ENE scheme); 
     
    212212In the enstrophy conserving case (ENS scheme), 
    213213the discrete formulation of the vorticity term provides a global conservation of the enstrophy 
    214 ($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$-coordinates) for a horizontally non-divergent flow (\ie $\chi$=$0$), 
     214($ [ (\zeta +f ) / e_{3f} ]^2 $ in $s$-coordinates) for a horizontally non-divergent flow (\ie\ $\chi$=$0$), 
    215215but does not conserve the total kinetic energy. 
    216216It is given by: 
     
    225225    \end{aligned} 
    226226  \right. 
    227 \end{equation}  
     227\end{equation} 
    228228 
    229229%------------------------------------------------------------- 
     
    246246    \end{aligned} 
    247247  \right. 
    248 \end{equation}  
     248\end{equation} 
    249249 
    250250%------------------------------------------------------------- 
     
    285285the presence of grid point oscillation structures that will be invisible to the operator. 
    286286These structures are \textit{computational modes} that will be at least partly damped by 
    287 the momentum diffusion operator (\ie the subgrid-scale advection), but not by the resolved advection term. 
     287the momentum diffusion operator (\ie\ the subgrid-scale advection), but not by the resolved advection term. 
    288288The ENS and ENE schemes therefore do not contribute to dump any grid point noise in the horizontal velocity field. 
    289289Such noise would result in more noise in the vertical velocity field, an undesirable feature. 
     
    291291$u$ and $v$ are located at different grid points, 
    292292a price worth paying to avoid a double averaging in the pressure gradient term as in the $B$-grid. 
    293 \gmcomment{ To circumvent this, Adcroft (ADD REF HERE)  
     293\gmcomment{ To circumvent this, Adcroft (ADD REF HERE) 
    294294Nevertheless, this technique strongly distort the phase and group velocity of Rossby waves....} 
    295295 
     
    299299\citep{griffies.gnanadesikan.ea_JPO98} for the discretization of the iso-neutral diffusion operator (see \autoref{apdx:C}). 
    300300 
    301 The \citet{arakawa.hsu_MWR90} vorticity advection scheme for a single layer is modified  
    302 for spherical coordinates as described by \citet{arakawa.lamb_MWR81} to obtain the EEN scheme.  
    303 First consider the discrete expression of the potential vorticity, $q$, defined at an $f$-point:  
     301The \citet{arakawa.hsu_MWR90} vorticity advection scheme for a single layer is modified 
     302for spherical coordinates as described by \citet{arakawa.lamb_MWR81} to obtain the EEN scheme. 
     303First consider the discrete expression of the potential vorticity, $q$, defined at an $f$-point: 
    304304\[ 
    305305  % \label{eq:pot_vor} 
     
    307307\] 
    308308where the relative vorticity is defined by (\autoref{eq:divcur_cur}), 
    309 the Coriolis parameter is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is:  
     309the Coriolis parameter is given by $f=2 \,\Omega \;\sin \varphi _f $ and the layer thickness at $f$-points is: 
    310310\begin{equation} 
    311311  \label{eq:een_e3f} 
     
    326326% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    327327 
    328 A key point in \autoref{eq:een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made.  
     328A key point in \autoref{eq:een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made. 
    329329It uses the sum of masked t-point vertical scale factor divided either by the sum of the four t-point masks 
    330330(\np{nn\_een\_e3f}\forcode{ = 1}), or just by $4$ (\np{nn\_een\_e3f}\forcode{ = .true.}). 
     
    334334(with a systematic reduction of $e_{3f}$ when a model level intercept the bathymetry) 
    335335that tends to reinforce the topostrophy of the flow 
    336 (\ie the tendency of the flow to follow the isobaths) \citep{penduff.le-sommer.ea_OS07}.  
     336(\ie\ the tendency of the flow to follow the isobaths) \citep{penduff.le-sommer.ea_OS07}. 
    337337 
    338338Next, the vorticity triads, $ {^i_j}\mathbb{Q}^{i_p}_{j_p}$ can be defined at a $T$-point as 
    339339the following triad combinations of the neighbouring potential vorticities defined at f-points 
    340 (\autoref{fig:DYN_een_triad}):  
     340(\autoref{fig:DYN_een_triad}): 
    341341\begin{equation} 
    342342  \label{eq:Q_triads} 
     
    344344  = \frac{1}{12} \ \left(   q^{i-i_p}_{j+j_p} + q^{i+j_p}_{j+i_p} + q^{i+i_p}_{j-j_p}  \right) 
    345345\end{equation} 
    346 where the indices $i_p$ and $k_p$ take the values: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$.  
    347  
    348 Finally, the vorticity terms are represented as:  
     346where the indices $i_p$ and $k_p$ take the values: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$. 
     347 
     348Finally, the vorticity terms are represented as: 
    349349\begin{equation} 
    350350  \label{eq:dynvor_een} 
     
    357357      \end{aligned} 
    358358    } \right. 
    359 \end{equation}  
     359\end{equation} 
    360360 
    361361This EEN scheme in fact combines the conservation properties of the ENS and ENE schemes. 
    362362It conserves both total energy and potential enstrophy in the limit of horizontally nondivergent flow 
    363 (\ie $\chi$=$0$) (see \autoref{subsec:C_vorEEN}).  
     363(\ie\ $\chi$=$0$) (see \autoref{subsec:C_vorEEN}). 
    364364Applied to a realistic ocean configuration, it has been shown that it leads to a significant reduction of 
    365365the noise in the vertical velocity field \citep{le-sommer.penduff.ea_OM09}. 
    366366Furthermore, used in combination with a partial steps representation of bottom topography, 
    367367it improves the interaction between current and topography, 
    368 leading to a larger topostrophy of the flow \citep{barnier.madec.ea_OD06, penduff.le-sommer.ea_OS07}.  
     368leading to a larger topostrophy of the flow \citep{barnier.madec.ea_OD06, penduff.le-sommer.ea_OS07}. 
    369369 
    370370%-------------------------------------------------------------------------------------------------------------- 
     
    412412When \np{ln\_dynzad\_zts}\forcode{ = .true.}, 
    413413a split-explicit time stepping with 5 sub-timesteps is used on the vertical advection term. 
    414 This option can be useful when the value of the timestep is limited by vertical advection \citep{lemarie.debreu.ea_OM15}.  
     414This option can be useful when the value of the timestep is limited by vertical advection \citep{lemarie.debreu.ea_OM15}. 
    415415Note that in this case, 
    416416a similar split-explicit time stepping should be used on vertical advection of tracer to ensure a better stability, 
     
    425425%------------------------------------------nam_dynadv---------------------------------------------------- 
    426426 
    427 \nlst{namdyn_adv}  
     427\nlst{namdyn_adv} 
    428428%------------------------------------------------------------------------------------------------------------- 
    429429 
    430 Options are defined through the \ngn{namdyn\_adv} namelist variables. 
     430Options are defined through the \nam{dyn\_adv} namelist variables. 
    431431In the flux form (as in the vector invariant form), 
    432432the Coriolis and momentum advection terms are evaluated using a leapfrog scheme, 
    433 \ie the velocity appearing in their expressions is centred in time (\textit{now} velocity). 
     433\ie\ the velocity appearing in their expressions is centred in time (\textit{now} velocity). 
    434434At the lateral boundaries either free slip, 
    435435no slip or partial slip boundary conditions are applied following \autoref{chap:LBC}. 
     
    445445In flux form, the vorticity term reduces to a Coriolis term in which the Coriolis parameter has been modified to account for the "metric" term. 
    446446This altered Coriolis parameter is thus discretised at $f$-points. 
    447 It is given by:  
     447It is given by: 
    448448\begin{multline*} 
    449449  % \label{eq:dyncor_metric} 
     
    451451  \equiv   f + \frac{1}{e_{1f} e_{2f} } \left( { \ \overline v ^{i+1/2}\delta_{i+1/2} \left[ {e_{2u} } \right] 
    452452      -  \overline u ^{j+1/2}\delta_{j+1/2} \left[ {e_{1u} } \right]  }  \ \right) 
    453 \end{multline*}  
     453\end{multline*} 
    454454 
    455455Any of the (\autoref{eq:dynvor_ens}), (\autoref{eq:dynvor_ene}) and (\autoref{eq:dynvor_een}) schemes can be used to 
    456456compute the product of the Coriolis parameter and the vorticity. 
    457457However, the energy-conserving scheme (\autoref{eq:dynvor_een}) has exclusively been used to date. 
    458 This term is evaluated using a leapfrog scheme, \ie the velocity is centred in time (\textit{now} velocity). 
     458This term is evaluated using a leapfrog scheme, \ie\ the velocity is centred in time (\textit{now} velocity). 
    459459 
    460460%-------------------------------------------------------------------------------------------------------------- 
     
    487487or a $3^{rd}$ order upstream biased scheme, UBS. 
    488488The latter is described in \citet{shchepetkin.mcwilliams_OM05}. 
    489 The schemes are selected using the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}.  
     489The schemes are selected using the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}. 
    490490In flux form, the schemes differ by the choice of a space and time interpolation to define the value of 
    491 $u$ and $v$ at the centre of each face of $u$- and $v$-cells, \ie at the $T$-, $f$-, 
    492 and $uw$-points for $u$ and at the $f$-, $T$- and $vw$-points for $v$.  
     491$u$ and $v$ at the centre of each face of $u$- and $v$-cells, \ie\ at the $T$-, $f$-, 
     492and $uw$-points for $u$ and at the $f$-, $T$- and $vw$-points for $v$. 
    493493 
    494494%------------------------------------------------------------- 
     
    508508    \end{aligned} 
    509509  \right. 
    510 \end{equation}  
    511  
    512 The scheme is non diffusive (\ie conserves the kinetic energy) but dispersive (\ie it may create false extrema). 
     510\end{equation} 
     511 
     512The scheme is non diffusive (\ie\ conserves the kinetic energy) but dispersive (\ie\ it may create false extrema). 
    513513It is therefore notoriously noisy and must be used in conjunction with an explicit diffusion operator to 
    514514produce a sensible solution. 
     
    535535\end{equation} 
    536536where $u"_{i+1/2} =\delta_{i+1/2} \left[ {\delta_i \left[ u \right]} \right]$. 
    537 This results in a dissipatively dominant (\ie hyper-diffusive) truncation error 
     537This results in a dissipatively dominant (\ie\ hyper-diffusive) truncation error 
    538538\citep{shchepetkin.mcwilliams_OM05}. 
    539539The overall performance of the advection scheme is similar to that reported in \citet{farrow.stevens_JPO95}. 
     
    541541It is not a \emph{positive} scheme, meaning that false extrema are permitted. 
    542542But the amplitudes of the false extrema are significantly reduced over those in the centred second order method. 
    543 As the scheme already includes a diffusion component, it can be used without explicit lateral diffusion on momentum  
    544 (\ie \np{ln\_dynldf\_lap}\forcode{ = }\np{ln\_dynldf\_bilap}\forcode{ = .false.}), 
     543As the scheme already includes a diffusion component, it can be used without explicit lateral diffusion on momentum 
     544(\ie\ \np{ln\_dynldf\_lap}\forcode{ = }\np{ln\_dynldf\_bilap}\forcode{ = .false.}), 
    545545and it is recommended to do so. 
    546546 
    547547The UBS scheme is not used in all directions. 
    548 In the vertical, the centred $2^{nd}$ order evaluation of the advection is preferred, \ie $u_{uw}^{ubs}$ and 
     548In the vertical, the centred $2^{nd}$ order evaluation of the advection is preferred, \ie\ $u_{uw}^{ubs}$ and 
    549549$u_{vw}^{ubs}$ in \autoref{eq:dynadv_cen2} are used. 
    550 UBS is diffusive and is associated with vertical mixing of momentum. \gmcomment{ gm  pursue the  
     550UBS is diffusive and is associated with vertical mixing of momentum. \gmcomment{ gm  pursue the 
    551551sentence:Since vertical mixing of momentum is a source term of the TKE equation...  } 
    552552 
     
    578578%------------------------------------------nam_dynhpg--------------------------------------------------- 
    579579 
    580 \nlst{namdyn_hpg}  
     580\nlst{namdyn_hpg} 
    581581%------------------------------------------------------------------------------------------------------------- 
    582582 
    583 Options are defined through the \ngn{namdyn\_hpg} namelist variables. 
     583Options are defined through the \nam{dyn\_hpg} namelist variables. 
    584584The key distinction between the different algorithms used for 
    585585the hydrostatic pressure gradient is the vertical coordinate used, 
    586 since HPG is a \emph{horizontal} pressure gradient, \ie computed along geopotential surfaces. 
     586since HPG is a \emph{horizontal} pressure gradient, \ie\ computed along geopotential surfaces. 
    587587As a result, any tilt of the surface of the computational levels will require a specific treatment to 
    588588compute the hydrostatic pressure gradient. 
    589589 
    590590The hydrostatic pressure gradient term is evaluated either using a leapfrog scheme, 
    591 \ie the density appearing in its expression is centred in time (\emph{now} $\rho$), 
     591\ie\ the density appearing in its expression is centred in time (\emph{now} $\rho$), 
    592592or a semi-implcit scheme. 
    593593At the lateral boundaries either free slip, no slip or partial slip boundary conditions are applied. 
     
    616616    \end{aligned} 
    617617  \right. 
    618 \end{equation}  
     618\end{equation} 
    619619 
    620620for $1<k<km$ (interior layer) 
     
    631631    \end{aligned} 
    632632  \right. 
    633 \end{equation}  
     633\end{equation} 
    634634 
    635635Note that the $1/2$ factor in (\autoref{eq:dynhpg_zco_surf}) is adequate because of the definition of $e_{3w}$ as 
    636636the vertical derivative of the scale factor at the surface level ($z=0$). 
    637 Note also that in case of variable volume level (\key{vvl} defined), 
     637Note also that in case of variable volume level (\texttt{vvl?} defined), 
    638638the surface pressure gradient is included in \autoref{eq:dynhpg_zco_surf} and 
    639639\autoref{eq:dynhpg_zco} through the space and time variations of the vertical scale factor $e_{3w}$. 
     
    649649Before taking horizontal gradients between these tracer points, 
    650650a linear interpolation is used to approximate the deeper tracer as if 
    651 it actually lived at the depth of the shallower tracer point.  
     651it actually lived at the depth of the shallower tracer point. 
    652652 
    653653Apart from this modification, 
     
    668668 
    669669Pressure gradient formulations in an $s$-coordinate have been the subject of a vast number of papers 
    670 (\eg, \citet{song_MWR98, shchepetkin.mcwilliams_OM05}).  
     670(\eg, \citet{song_MWR98, shchepetkin.mcwilliams_OM05}). 
    671671A number of different pressure gradient options are coded but the ROMS-like, 
    672672density Jacobian with cubic polynomial method is currently disabled whilst known bugs are under investigation. 
     
    683683    \end{aligned} 
    684684  \right. 
    685 \end{equation}  
     685\end{equation} 
    686686 
    687687Where the first term is the pressure gradient along coordinates, 
    688688computed as in \autoref{eq:dynhpg_zco_surf} - \autoref{eq:dynhpg_zco}, 
    689 and $z_T$ is the depth of the $T$-point evaluated from the sum of the vertical scale factors at the $w$-point  
     689and $z_T$ is the depth of the $T$-point evaluated from the sum of the vertical scale factors at the $w$-point 
    690690($e_{3w}$). 
    691   
     691 
    692692$\bullet$ Traditional coding with adaptation for ice shelf cavities (\np{ln\_dynhpg\_isf}\forcode{ = .true.}). 
    693693This scheme need the activation of ice shelf cavities (\np{ln\_isfcav}\forcode{ = .true.}). 
     
    695695$\bullet$ Pressure Jacobian scheme (prj) (a research paper in preparation) (\np{ln\_dynhpg\_prj}\forcode{ = .true.}) 
    696696 
    697 $\bullet$ Density Jacobian with cubic polynomial scheme (DJC) \citep{shchepetkin.mcwilliams_OM05}  
     697$\bullet$ Density Jacobian with cubic polynomial scheme (DJC) \citep{shchepetkin.mcwilliams_OM05} 
    698698(\np{ln\_dynhpg\_djc}\forcode{ = .true.}) (currently disabled; under development) 
    699699 
    700700Note that expression \autoref{eq:dynhpg_sco} is commonly used when the variable volume formulation is activated 
    701 (\key{vvl}) because in that case, even with a flat bottom, 
     701(\texttt{vvl?}) because in that case, even with a flat bottom, 
    702702the coordinate surfaces are not horizontal but follow the free surface \citep{levier.treguier.ea_rpt07}. 
    703703The pressure jacobian scheme (\np{ln\_dynhpg\_prj}\forcode{ = .true.}) is available as 
    704 an improved option to \np{ln\_dynhpg\_sco}\forcode{ = .true.} when \key{vvl} is active. 
     704an improved option to \np{ln\_dynhpg\_sco}\forcode{ = .true.} when \texttt{vvl?} is active. 
    705705The pressure Jacobian scheme uses a constrained cubic spline to 
    706706reconstruct the density profile across the water column. 
     
    723723 
    724724The pressure gradient due to ocean load is computed using the expression \autoref{eq:dynhpg_sco} described in 
    725 \autoref{subsec:DYN_hpg_sco}.  
     725\autoref{subsec:DYN_hpg_sco}. 
    726726 
    727727%-------------------------------------------------------------------------------------------------------------- 
     
    742742It involves the evaluation of the hydrostatic pressure gradient as 
    743743an average over the three time levels $t-\rdt$, $t$, and $t+\rdt$ 
    744 (\ie \textit{before}, \textit{now} and  \textit{after} time-steps), 
    745 rather than at the central time level $t$ only, as in the standard leapfrog scheme.  
     744(\ie\ \textit{before}, \textit{now} and  \textit{after} time-steps), 
     745rather than at the central time level $t$ only, as in the standard leapfrog scheme. 
    746746 
    747747$\bullet$ leapfrog scheme (\np{ln\_dynhpg\_imp}\forcode{ = .true.}): 
     
    795795%-----------------------------------------nam_dynspg---------------------------------------------------- 
    796796 
    797 \nlst{namdyn_spg}  
     797\nlst{namdyn_spg} 
    798798%------------------------------------------------------------------------------------------------------------ 
    799799 
    800 Options are defined through the \ngn{namdyn\_spg} namelist variables. 
     800Options are defined through the \nam{dyn\_spg} namelist variables. 
    801801The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}). 
    802802The main distinction is between the fixed volume case (linear free surface) and 
    803 the variable volume case (nonlinear free surface, \key{vvl} is defined). 
     803the variable volume case (nonlinear free surface, \texttt{vvl?} is defined). 
    804804In the linear free surface case (\autoref{subsec:PE_free_surface}) 
    805805the vertical scale factors $e_{3}$ are fixed in time, 
    806806while they are time-dependent in the nonlinear case (\autoref{subsec:PE_free_surface}). 
    807 With both linear and nonlinear free surface, external gravity waves are allowed in the equations,  
     807With both linear and nonlinear free surface, external gravity waves are allowed in the equations, 
    808808which imposes a very small time step when an explicit time stepping is used. 
    809 Two methods are proposed to allow a longer time step for the three-dimensional equations:  
    810 the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:PE_flt?}),  
     809Two methods are proposed to allow a longer time step for the three-dimensional equations: 
     810the filtered free surface, which is a modification of the continuous equations (see \autoref{eq:PE_flt?}), 
    811811and the split-explicit free surface described below. 
    812 The extra term introduced in the filtered method is calculated implicitly,  
     812The extra term introduced in the filtered method is calculated implicitly, 
    813813so that the update of the next velocities is done in module \mdl{dynspg\_flt} and not in \mdl{dynnxt}. 
    814814 
     
    819819an explicit formulation which requires a small time step; 
    820820a filtered free surface formulation which allows a larger time step by 
    821 adding a filtering term into the momentum equation;  
     821adding a filtering term into the momentum equation; 
    822822and a split-explicit free surface formulation, described below, which also allows a larger time step. 
    823823 
     
    829829% Explicit free surface formulation 
    830830%-------------------------------------------------------------------------------------------------------------- 
    831 \subsection[Explicit free surface (\texttt{\textbf{key\_dynspg\_exp}})] 
    832 {Explicit free surface (\protect\key{dynspg\_exp})} 
     831\subsection[Explicit free surface (\texttt{ln\_dynspg\_exp}\forcode{ = .true.})] 
     832{Explicit free surface (\protect\np{ln\_dynspg\_exp}\forcode{ = .true.})} 
    833833\label{subsec:DYN_spg_exp} 
    834834 
    835 In the explicit free surface formulation (\key{dynspg\_exp} defined), 
     835In the explicit free surface formulation (\np{ln\_dynspg\_exp} set to true), 
    836836the model time step is chosen to be small enough to resolve the external gravity waves 
    837837(typically a few tens of seconds). 
    838 The surface pressure gradient, evaluated using a leap-frog scheme (\ie centered in time), 
     838The surface pressure gradient, evaluated using a leap-frog scheme (\ie\ centered in time), 
    839839is thus simply given by : 
    840840\begin{equation} 
     
    846846    \end{aligned} 
    847847  \right. 
    848 \end{equation}  
    849  
    850 Note that in the non-linear free surface case (\ie \key{vvl} defined), 
     848\end{equation} 
     849 
     850Note that in the non-linear free surface case (\ie\ \texttt{vvl?} defined), 
    851851the surface pressure gradient is already included in the momentum tendency through 
    852852the level thickness variation allowed in the computation of the hydrostatic pressure gradient. 
     
    856856% Split-explict free surface formulation 
    857857%-------------------------------------------------------------------------------------------------------------- 
    858 \subsection[Split-explicit free surface (\texttt{\textbf{key\_dynspg\_ts}})] 
    859 {Split-explicit free surface (\protect\key{dynspg\_ts})} 
     858\subsection[Split-explicit free surface (\texttt{ln\_dynspg\_ts}\forcode{ = .true.})] 
     859{Split-explicit free surface (\protect\np{ln\_dynspg\_ts}\forcode{ = .true.})} 
    860860\label{subsec:DYN_spg_ts} 
    861861%------------------------------------------namsplit----------------------------------------------------------- 
     
    864864%------------------------------------------------------------------------------------------------------------- 
    865865 
    866 The split-explicit free surface formulation used in \NEMO (\key{dynspg\_ts} defined), 
     866The split-explicit free surface formulation used in \NEMO\ (\np{ln\_dynspg\_ts} set to true), 
    867867also called the time-splitting formulation, follows the one proposed by \citet{shchepetkin.mcwilliams_OM05}. 
    868868The general idea is to solve the free surface equation and the associated barotropic velocity equations with 
     
    897897Temporal discretization of the system above follows a three-time step Generalized Forward Backward algorithm 
    898898detailed in \citet{shchepetkin.mcwilliams_OM05}. 
    899 AB3-AM4 coefficients used in \NEMO follow the second-order accurate, 
     899AB3-AM4 coefficients used in \NEMO\ follow the second-order accurate, 
    900900"multi-purpose" stability compromise as defined in \citet{shchepetkin.mcwilliams_ibk09} 
    901 (see their figure 12, lower left).  
     901(see their figure 12, lower left). 
    902902 
    903903%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
     
    935935provide time filtered quantities. 
    936936These are used for the subsequent initialization of the barotropic mode in the following baroclinic step. 
    937 Since external mode equations written at baroclinic time steps finally follow a forward time stepping scheme,  
     937Since external mode equations written at baroclinic time steps finally follow a forward time stepping scheme, 
    938938asselin filtering is not applied to barotropic quantities.\\ 
    939939Alternatively, one can choose to integrate barotropic equations starting from \textit{before} time step 
     
    963963 
    964964One can eventually choose to feedback instantaneous values by not using any time filter 
    965 (\np{ln\_bt\_av}\forcode{ = .false.}).  
     965(\np{ln\_bt\_av}\forcode{ = .false.}). 
    966966In that case, external mode equations are continuous in time, 
    967 \ie they are not re-initialized when starting a new sub-stepping sequence. 
     967\ie\ they are not re-initialized when starting a new sub-stepping sequence. 
    968968This is the method used so far in the POM model, the stability being maintained by 
    969969refreshing at (almost) each barotropic time step advection and horizontal diffusion terms. 
    970 Since the latter terms have not been added in \NEMO for computational efficiency, 
     970Since the latter terms have not been added in \NEMO\ for computational efficiency, 
    971971removing time filtering is not recommended except for debugging purposes. 
    972972This may be used for instance to appreciate the damping effect of the standard formulation on 
     
    976976 
    977977%>>>>>=============== 
    978 \gmcomment{               %%% copy from griffies Book  
     978\gmcomment{               %%% copy from griffies Book 
    979979 
    980980\textbf{title: Time stepping the barotropic system } 
     
    983983Hence, we can update the surface height and vertically integrated velocity with a leap-frog scheme using 
    984984the small barotropic time step $\rdt$. 
    985 We have  
     985We have 
    986986 
    987987\[ 
     
    10061006and total depth of the ocean $H(\tau)$ are held for the duration of the barotropic time stepping over 
    10071007a single cycle. 
    1008 This is also the time that sets the barotropic time steps via  
     1008This is also the time that sets the barotropic time steps via 
    10091009\[ 
    10101010  % \label{eq:DYN_spg_ts_t} 
     
    10121012\] 
    10131013with $n$ an integer. 
    1014 The density scaled surface pressure is evaluated via  
     1014The density scaled surface pressure is evaluated via 
    10151015\[ 
    10161016  % \label{eq:DYN_spg_ts_ps} 
     
    10211021  \end{cases} 
    10221022\] 
    1023 To get started, we assume the following initial conditions  
     1023To get started, we assume the following initial conditions 
    10241024\[ 
    10251025  % \label{eq:DYN_spg_ts_eta} 
     
    10291029  \end{split} 
    10301030\] 
    1031 with  
     1031with 
    10321032\[ 
    10331033  % \label{eq:DYN_spg_ts_etaF} 
     
    10351035\] 
    10361036the time averaged surface height taken from the previous barotropic cycle. 
    1037 Likewise,  
     1037Likewise, 
    10381038\[ 
    10391039  % \label{eq:DYN_spg_ts_u} 
     
    10411041  \textbf{U}(\tau,t_{n=1}) = \textbf{U}^{(b)}(\tau,t_{n=0}) + \rdt \ \text{RHS}_{n=0} 
    10421042\] 
    1043 with  
     1043with 
    10441044\[ 
    10451045  % \label{eq:DYN_spg_ts_u} 
     
    10471047\] 
    10481048the time averaged vertically integrated transport. 
    1049 Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration.  
     1049Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration. 
    10501050 
    10511051Upon reaching $t_{n=N} = \tau + 2\rdt \tau$ , 
    10521052the vertically integrated velocity is time averaged to produce the updated vertically integrated velocity at 
    1053 baroclinic time $\tau + \rdt \tau$  
     1053baroclinic time $\tau + \rdt \tau$ 
    10541054\[ 
    10551055  % \label{eq:DYN_spg_ts_u} 
     
    10571057\] 
    10581058The surface height on the new baroclinic time step is then determined via a baroclinic leap-frog using 
    1059 the following form  
     1059the following form 
    10601060 
    10611061\begin{equation} 
    10621062  \label{eq:DYN_spg_ts_ssh} 
    1063   \eta(\tau+\Delta) - \eta^{F}(\tau-\Delta) = 2\rdt \ \left[ - \nabla \cdot \textbf{U}(\tau) + \text{EMP}_w \right]   
     1063  \eta(\tau+\Delta) - \eta^{F}(\tau-\Delta) = 2\rdt \ \left[ - \nabla \cdot \textbf{U}(\tau) + \text{EMP}_w \right] 
    10641064\end{equation} 
    10651065 
    10661066The use of this "big-leap-frog" scheme for the surface height ensures compatibility between 
    10671067the mass/volume budgets and the tracer budgets. 
    1068 More discussion of this point is provided in Chapter 10 (see in particular Section 10.2).  
    1069   
     1068More discussion of this point is provided in Chapter 10 (see in particular Section 10.2). 
     1069 
    10701070In general, some form of time filter is needed to maintain integrity of the surface height field due to 
    10711071the leap-frog splitting mode in equation \autoref{eq:DYN_spg_ts_ssh}. 
     
    10781078  \eta^{F}(\tau-\Delta) =  \overline{\eta^{(b)}(\tau)} 
    10791079\end{equation} 
    1080 Another approach tried was  
     1080Another approach tried was 
    10811081 
    10821082\[ 
     
    10911091eliminating tracer and surface height time filtering (see ?? for more complete discussion). 
    10921092However, in the general case with a non-zero $\alpha$, 
    1093 the filter \autoref{eq:DYN_spg_ts_sshf} was found to be more conservative, and so is recommended.  
     1093the filter \autoref{eq:DYN_spg_ts_sshf} was found to be more conservative, and so is recommended. 
    10941094 
    10951095}            %%end gm comment (copy of griffies book) 
     
    11011101% Filtered free surface formulation 
    11021102%-------------------------------------------------------------------------------------------------------------- 
    1103 \subsection[Filtered free surface (\texttt{\textbf{key\_dynspg\_flt}})] 
    1104 {Filtered free surface (\protect\key{dynspg\_flt})} 
     1103\subsection[Filtered free surface (\texttt{dynspg\_flt?})] 
     1104{Filtered free surface (\protect\texttt{dynspg\_flt?})} 
    11051105\label{subsec:DYN_spg_fltp} 
    11061106 
    1107 The filtered formulation follows the \citet{roullet.madec_JGR00} implementation.  
    1108 The extra term introduced in the equations (see \autoref{subsec:PE_free_surface}) is solved implicitly.  
     1107The filtered formulation follows the \citet{roullet.madec_JGR00} implementation. 
     1108The extra term introduced in the equations (see \autoref{subsec:PE_free_surface}) is solved implicitly. 
    11091109The elliptic solvers available in the code are documented in \autoref{chap:MISC}. 
    11101110 
    11111111%% gm %%======>>>>   given here the discrete eqs provided to the solver 
    1112 \gmcomment{               %%% copy from chap-model basics  
     1112\gmcomment{               %%% copy from chap-model basics 
    11131113  \[ 
    11141114    % \label{eq:spg_flt} 
     
    11231123}   %end gmcomment 
    11241124 
    1125 Note that in the linear free surface formulation (\key{vvl} not defined), 
     1125Note that in the linear free surface formulation (\texttt{vvl?} not defined), 
    11261126the ocean depth is time-independent and so is the matrix to be inverted. 
    1127 It is computed once and for all and applies to all ocean time steps.  
     1127It is computed once and for all and applies to all ocean time steps. 
    11281128 
    11291129% ================================================================ 
     
    11351135%------------------------------------------nam_dynldf---------------------------------------------------- 
    11361136 
    1137 \nlst{namdyn_ldf}  
     1137\nlst{namdyn_ldf} 
    11381138%------------------------------------------------------------------------------------------------------------- 
    11391139 
    1140 Options are defined through the \ngn{namdyn\_ldf} namelist variables. 
     1140Options are defined through the \nam{dyn\_ldf} namelist variables. 
    11411141The options available for lateral diffusion are to use either laplacian (rotated or not) or biharmonic operators. 
    11421142The coefficients may be constant or spatially variable; 
    11431143the description of the coefficients is found in the chapter on lateral physics (\autoref{chap:LDF}). 
    11441144The lateral diffusion of momentum is evaluated using a forward scheme, 
    1145 \ie the velocity appearing in its expression is the \textit{before} velocity in time, 
     1145\ie\ the velocity appearing in its expression is the \textit{before} velocity in time, 
    11461146except for the pure vertical component that appears when a tensor of rotation is used. 
    11471147This latter term is solved implicitly together with the vertical diffusion term (see \autoref{chap:STP}). 
     
    11591159  In finite difference methods, 
    11601160  the biharmonic operator is frequently the method of choice to achieve this scale selective dissipation since 
    1161   its damping time (\ie its spin down time) scale like $\lambda^{-4}$ for disturbances of wavelength $\lambda$ 
     1161  its damping time (\ie\ its spin down time) scale like $\lambda^{-4}$ for disturbances of wavelength $\lambda$ 
    11621162  (so that short waves damped more rapidelly than long ones), 
    11631163  whereas the Laplace operator damping time scales only like $\lambda^{-2}$. 
     
    11691169\label{subsec:DYN_ldf_lap} 
    11701170 
    1171 For lateral iso-level diffusion, the discrete operator is:  
     1171For lateral iso-level diffusion, the discrete operator is: 
    11721172\begin{equation} 
    11731173  \label{eq:dynldf_lap} 
     
    11751175    \begin{aligned} 
    11761176      D_u^{l{\mathrm {\mathbf U}}} =\frac{1}{e_{1u} }\delta_{i+1/2} \left[ {A_T^{lm} 
    1177           \;\chi } \right]-\frac{1}{e_{2u} {\kern 1pt}e_{3u} }\delta_j \left[  
     1177          \;\chi } \right]-\frac{1}{e_{2u} {\kern 1pt}e_{3u} }\delta_j \left[ 
    11781178        {A_f^{lm} \;e_{3f} \zeta } \right] \\ \\ 
    11791179      D_v^{l{\mathrm {\mathbf U}}} =\frac{1}{e_{2v} }\delta_{j+1/2} \left[ {A_T^{lm} 
    1180           \;\chi } \right]+\frac{1}{e_{1v} {\kern 1pt}e_{3v} }\delta_i \left[  
     1180          \;\chi } \right]+\frac{1}{e_{1v} {\kern 1pt}e_{3v} }\delta_i \left[ 
    11811181        {A_f^{lm} \;e_{3f} \zeta } \right] 
    11821182    \end{aligned} 
    11831183  \right. 
    1184 \end{equation}  
     1184\end{equation} 
    11851185 
    11861186As explained in \autoref{subsec:PE_ldf}, 
    11871187this formulation (as the gradient of a divergence and curl of the vorticity) preserves symmetry and 
    1188 ensures a complete separation between the vorticity and divergence parts of the momentum diffusion.  
     1188ensures a complete separation between the vorticity and divergence parts of the momentum diffusion. 
    11891189 
    11901190%-------------------------------------------------------------------------------------------------------------- 
     
    12301230                -e_{2f} \; r_{1f} \,\overline{\overline {\delta_{k+1/2}[v]}}^{\,i+1/2,\,k}} 
    12311231            \right)} \right]}    \right. \\ 
    1232     & \qquad +\ \delta_j \left[ {A_T^{lm} \left( {\frac{e_{1t}\,e_{3t} }{e_{2t}  
     1232    & \qquad +\ \delta_j \left[ {A_T^{lm} \left( {\frac{e_{1t}\,e_{3t} }{e_{2t} 
    12331233            }\,\delta_{j} [v] - e_{1t}\, r_{2t} 
    12341234            \,\overline{\overline {\delta_{k+1/2} [v]}} ^{\,j,\,k}} 
    12351235        \right)} \right] \\ 
    1236     & \qquad +\ \delta_k \left[ {A_{vw}^{lm} \left( {-e_{2v} \, r_{1vw} \,\overline{\overline  
     1236    & \qquad +\ \delta_k \left[ {A_{vw}^{lm} \left( {-e_{2v} \, r_{1vw} \,\overline{\overline 
    12371237              {\delta_{i+1/2} [v]}}^{\,i+1/2,\,k+1/2} }\right.} \right. \\ 
    12381238    &  \ \qquad \qquad \qquad \quad\ 
    12391239    - e_{1v} \, r_{2vw} \,\overline{\overline {\delta_{j+1/2} [v]}} ^{\,j+1/2,\,k+1/2} \\ 
    1240     & \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\  
     1240    & \left. {\left. { \ \qquad \qquad \qquad \ \ \ \left. {\ 
    12411241                +\frac{e_{1v}\, e_{2v} }{e_{3vw} }\,\left( {r_{1vw}^2+r_{2vw}^2} 
    1242                 \right)\,\delta_{k+1/2} [v]} \right)} \right]\;\;\;} \right\}  
     1242                \right)\,\delta_{k+1/2} [v]} \right)} \right]\;\;\;} \right\} 
    12431243  \end{split} 
    12441244\end{equation} 
    12451245where $r_1$ and $r_2$ are the slopes between the surface along which the diffusion operator acts and 
    1246 the surface of computation ($z$- or $s$-surfaces).  
     1246the surface of computation ($z$- or $s$-surfaces). 
    12471247The way these slopes are evaluated is given in the lateral physics chapter (\autoref{chap:LDF}). 
    12481248 
     
    12701270%----------------------------------------------namzdf------------------------------------------------------ 
    12711271 
    1272 \nlst{namzdf}  
     1272\nlst{namzdf} 
    12731273%------------------------------------------------------------------------------------------------------------- 
    12741274 
    1275 Options are defined through the \ngn{namzdf} namelist variables. 
     1275Options are defined through the \nam{zdf} namelist variables. 
    12761276The large vertical diffusion coefficient found in the surface mixed layer together with high vertical resolution implies that in the case of explicit time stepping there would be too restrictive a constraint on the time step. 
    12771277Two time stepping schemes can be used for the vertical diffusion term: 
     
    12801280$(b)$ a backward (or implicit) time differencing scheme (\np{ln\_zdfexp}\forcode{ = .false.}) 
    12811281(see \autoref{chap:STP}). 
    1282 Note that namelist variables \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics.  
     1282Note that namelist variables \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics. 
    12831283 
    12841284The formulation of the vertical subgrid scale physics is the same whatever the vertical coordinate is. 
     
    13091309where $\left( \tau_u ,\tau_v \right)$ are the two components of the wind stress vector in 
    13101310the (\textbf{i},\textbf{j}) coordinate system. 
    1311 The high mixing coefficients in the surface mixed layer ensure that the surface wind stress is distributed in  
     1311The high mixing coefficients in the surface mixed layer ensure that the surface wind stress is distributed in 
    13121312the vertical over the mixed layer depth. 
    13131313If the vertical mixing coefficient is small (when no mixed layer scheme is used) 
     
    13261326Besides the surface and bottom stresses (see the above section) 
    13271327which are introduced as boundary conditions on the vertical mixing, 
    1328 three other forcings may enter the dynamical equations by affecting the surface pressure gradient.  
     1328three other forcings may enter the dynamical equations by affecting the surface pressure gradient. 
    13291329 
    13301330(1) When \np{ln\_apr\_dyn}\forcode{ = .true.} (see \autoref{sec:SBC_apr}), 
     
    13351335 
    13361336(3) When \np{nn\_ice\_embd}\forcode{ = 2} and LIM or CICE is used 
    1337 (\ie when the sea-ice is embedded in the ocean), 
     1337(\ie\ when the sea-ice is embedded in the ocean), 
    13381338the snow-ice mass is taken into account when computing the surface pressure gradient. 
    13391339 
     
    13431343 
    13441344% ================================================================ 
    1345 % Wetting and drying  
     1345% Wetting and drying 
    13461346% ================================================================ 
    13471347\section{Wetting and drying } 
     
    13591359 
    13601360The following terminology is used. The depth of the topography (positive downwards) 
    1361 at each $(i,j)$ point is the quantity stored in array $\mathrm{ht\_wd}$ in the NEMO code. 
     1361at each $(i,j)$ point is the quantity stored in array $\mathrm{ht\_wd}$ in the \NEMO\ code. 
    13621362The height of the free surface (positive upwards) is denoted by $ \mathrm{ssh}$. Given the sign 
    13631363conventions used, the water depth, $h$, is the height of the free surface plus the depth of the 
     
    13671367covered by water. They require the topography specified with a model 
    13681368configuration to have negative depths at points where the land is higher than the 
    1369 topography's reference sea-level. The vertical grid in NEMO is normally computed relative to an 
     1369topography's reference sea-level. The vertical grid in \NEMO\ is normally computed relative to an 
    13701370initial state with zero sea surface height elevation. 
    13711371The user can choose to compute the vertical grid and heights in the model relative to 
     
    13861386All these configurations have used pure sigma coordinates. It is expected that 
    13871387the wetting and drying code will work in domains with more general s-coordinates provided 
    1388 the coordinates are pure sigma in the region where wetting and drying actually occurs.  
     1388the coordinates are pure sigma in the region where wetting and drying actually occurs. 
    13891389 
    13901390The next sub-section descrbies the directional limiter and the following sub-section the iterative limiter. 
     
    13991399\label{subsec:DYN_wd_directional_limiter} 
    14001400The principal idea of the directional limiter is that 
    1401 water should not be allowed to flow out of a dry tracer cell (i.e. one whose water depth is less than rn\_wdmin1). 
     1401water should not be allowed to flow out of a dry tracer cell (i.e. one whose water depth is less than \np{rn\_wdmin1}). 
    14021402 
    14031403All the changes associated with this option are made to the barotropic solver for the non-linear 
     
    14091409 
    14101410The flux across each $u$-face of a tracer cell is multiplied by a factor zuwdmask (an array which depends on ji and jj). 
    1411 If the user sets ln\_wd\_dl\_ramp = .False. then zuwdmask is 1 when the 
    1412 flux is from a cell with water depth greater than rn\_wdmin1 and 0 otherwise. If the user sets 
    1413 ln\_wd\_dl\_ramp = .True. the flux across the face is ramped down as the water depth decreases 
    1414 from 2 * rn\_wdmin1 to rn\_wdmin1. The use of this ramp reduced grid-scale noise in idealised test cases. 
     1411If the user sets \np{ln\_wd\_dl\_ramp}\forcode{ = .false.} then zuwdmask is 1 when the 
     1412flux is from a cell with water depth greater than \np{rn\_wdmin1} and 0 otherwise. If the user sets 
     1413\np{ln\_wd\_dl\_ramp}\forcode{ = .true.} the flux across the face is ramped down as the water depth decreases 
     1414from 2 * \np{rn\_wdmin1} to \np{rn\_wdmin1}. The use of this ramp reduced grid-scale noise in idealised test cases. 
    14151415 
    14161416At the point where the flux across a $u$-face is multiplied by zuwdmask , we have chosen 
     
    14281428fields (tracers independent of $x$, $y$ and $z$). Our scheme conserves constant tracers because 
    14291429the velocities used at the tracer cell faces on the baroclinic timesteps are carefully calculated by dynspg\_ts 
    1430 to equal their mean value during the barotropic steps. If the user sets ln\_wd\_dl\_bc = .True., the 
    1431 baroclinic velocities are also multiplied by a suitably weighted average of zuwdmask.   
     1430to equal their mean value during the barotropic steps. If the user sets \np{ln\_wd\_dl\_bc}\forcode{ = .true.}, the 
     1431baroclinic velocities are also multiplied by a suitably weighted average of zuwdmask. 
    14321432 
    14331433%----------------------------------------------------------------------------------------- 
     
    14551455 
    14561456\begin{align} \label{dyn_wd_continuity_2} 
    1457 \frac{e_1 e_2}{\Delta t} ( h_{i,j}(t_{n+1}) - h_{i,j}(t_e) )  
     1457\frac{e_1 e_2}{\Delta t} ( h_{i,j}(t_{n+1}) - h_{i,j}(t_e) ) 
    14581458&= - ( \mathrm{flxu}_{i+1,j} - \mathrm{flxu}_{i,j}  + \mathrm{flxv}_{i,j+1} - \mathrm{flxv}_{i,j} ) \\ 
    14591459&= \mathrm{zzflx}_{i,j} . 
     
    14711471 
    14721472\begin{equation} \label{dyn_wd_zzflx_p_n_1} 
    1473 \mathrm{zzflx}_{i,j} = \mathrm{zzflxp}_{i,j} + \mathrm{zzflxn}_{i,j} .   
     1473\mathrm{zzflx}_{i,j} = \mathrm{zzflxp}_{i,j} + \mathrm{zzflxn}_{i,j} . 
    14741474\end{equation} 
    14751475 
     
    14951495 
    14961496\begin{equation} \label{dyn_wd_zzflx_initial} 
    1497 \mathrm{zzflxp^{(0)}}_{i,j} = \mathrm{zzflxp}_{i,j} , \quad  \mathrm{zzflxn^{(0)}}_{i,j} = \mathrm{zzflxn}_{i,j} .  
     1497\mathrm{zzflxp^{(0)}}_{i,j} = \mathrm{zzflxp}_{i,j} , \quad  \mathrm{zzflxn^{(0)}}_{i,j} = \mathrm{zzflxn}_{i,j} . 
    14981498\end{equation} 
    14991499 
     
    15251525\begin{split} 
    15261526\mathrm{zcoef}^{(m+1)}_{i,j} = \Big[ (h_{i,j}(t_e) & - \mathrm{rn\_wdmin1} - \mathrm{rn\_wdmin2})  \frac{e_1 e_2}{\Delta t} \phantom{]} \\ 
    1527 \phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big] \frac{1}{ \mathrm{zzflxp}^{(0)}_{i,j} }  
     1527\phantom{[} & -  \mathrm{zzflxn}^{(m)}_{i,j} \Big] \frac{1}{ \mathrm{zzflxp}^{(0)}_{i,j} } 
    15281528\end{split} 
    15291529\end{equation} 
     
    16351635 
    16361636% ================================================================ 
    1637 % Time evolution term  
     1637% Time evolution term 
    16381638% ================================================================ 
    16391639\section[Time evolution term (\textit{dynnxt.F90})] 
     
    16431643%----------------------------------------------namdom---------------------------------------------------- 
    16441644 
    1645 \nlst{namdom}  
     1645\nlst{namdom} 
    16461646%------------------------------------------------------------------------------------------------------------- 
    16471647 
    1648 Options are defined through the \ngn{namdom} namelist variables. 
     1648Options are defined through the \nam{dom} namelist variables. 
    16491649The general framework for dynamics time stepping is a leap-frog scheme, 
    1650 \ie a three level centred time scheme associated with an Asselin time filter (cf. \autoref{chap:STP}). 
     1650\ie\ a three level centred time scheme associated with an Asselin time filter (cf. \autoref{chap:STP}). 
    16511651The scheme is applied to the velocity, except when 
    16521652using the flux form of momentum advection (cf. \autoref{sec:DYN_adv_cor_flux}) 
    1653 in the variable volume case (\key{vvl} defined), 
    1654 where it has to be applied to the thickness weighted velocity (see \autoref{sec:A_momentum})   
     1653in the variable volume case (\texttt{vvl?} defined), 
     1654where it has to be applied to the thickness weighted velocity (see \autoref{sec:A_momentum}) 
    16551655 
    16561656$\bullet$ vector invariant form or linear free surface 
    1657 (\np{ln\_dynhpg\_vec}\forcode{ = .true.} ; \key{vvl} not defined): 
     1657(\np{ln\_dynhpg\_vec}\forcode{ = .true.} ; \texttt{vvl?} not defined): 
    16581658\[ 
    16591659  % \label{eq:dynnxt_vec} 
     
    16671667 
    16681668$\bullet$ flux form and nonlinear free surface 
    1669 (\np{ln\_dynhpg\_vec}\forcode{ = .false.} ; \key{vvl} defined): 
     1669(\np{ln\_dynhpg\_vec}\forcode{ = .false.} ; \texttt{vvl?} defined): 
    16701670\[ 
    16711671  % \label{eq:dynnxt_flux} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_LBC.tex

    r11263 r11512  
    33\begin{document} 
    44% ================================================================ 
    5 % Chapter — Lateral Boundary Condition (LBC)  
     5% Chapter — Lateral Boundary Condition (LBC) 
    66% ================================================================ 
    77\chapter{Lateral Boundary Condition (LBC)} 
    88\label{chap:LBC} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212\newpage 
     
    2222%--------------------------------------------nam_lbc------------------------------------------------------- 
    2323 
    24 \nlst{namlbc}  
     24\nlst{namlbc} 
    2525%-------------------------------------------------------------------------------------------------------------- 
    2626 
    27 %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 \autoref{subsec:DOM_msk}).  
    28  
    29 %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, \ie 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 \autoref{subsec:DOM_msk}. 
    30  
    31 Options are defined through the \ngn{namlbc} namelist variables. 
     27%The lateral ocean boundary conditions contiguous to coastlines are Neumann conditions for heat and salt 
     28%(no flux across boundaries) and Dirichlet conditions for momentum (ranging from free-slip to "strong" no-slip). 
     29%They are handled automatically by the mask system (see \autoref{subsec:DOM_msk}). 
     30 
     31%OPA allows land and topography grid points in the computational domain due to the presence of continents or islands, 
     32%and includes the use of a full or partial step representation of bottom topography. 
     33%The computation is performed over the whole domain, \ie\ we do not try to restrict the computation to ocean-only points. 
     34%This choice has two motivations. 
     35%Firstly, working on ocean only grid points overloads the code and harms the code readability. 
     36%Secondly, and more importantly, it drastically reduces the vector portion of the computation, 
     37%leading to a dramatic increase of CPU time requirement on vector computers. 
     38%The current section describes how the masking affects the computation of the various terms of the equations 
     39%with respect to the boundary condition at solid walls. 
     40%The process of defining which areas are to be masked is described in \autoref{subsec:DOM_msk}. 
     41 
     42Options are defined through the \nam{lbc} namelist variables. 
    3243The discrete representation of a domain with complex boundaries (coastlines and bottom topography) leads to 
    3344arrays that include large portions where a computation is not required as the model variables remain at zero. 
     
    4152Since most of the boundary conditions consist of a zero flux across the solid boundaries, 
    4253they can be simply applied by multiplying variables by the correct mask arrays, 
    43 \ie the mask array of the grid point where the flux is evaluated. 
     54\ie\ the mask array of the grid point where the flux is evaluated. 
    4455For example, the heat flux in the \textbf{i}-direction is evaluated at $u$-points. 
    4556Evaluating this quantity as, 
     
    5263(where mask$_{u}$ is the mask array at a $u$-point) ensures that the heat flux is zero inside land and 
    5364at the boundaries, since mask$_{u}$ is zero at solid boundaries which in this case are defined at $u$-points 
    54 (normal velocity $u$ remains zero at the coast) (\autoref{fig:LBC_uv}).  
     65(normal velocity $u$ remains zero at the coast) (\autoref{fig:LBC_uv}). 
    5566 
    5667%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    104115\item[free-slip boundary condition (\np{rn\_shlat}\forcode{ = 0}):] the tangential velocity at 
    105116  the coastline is equal to the offshore velocity, 
    106   \ie the normal derivative of the tangential velocity is zero at the coast, 
     117  \ie\ the normal derivative of the tangential velocity is zero at the coast, 
    107118  so the vorticity: mask$_{f}$ array is set to zero inside the land and just at the coast 
    108119  (\autoref{fig:LBC_shlat}-a). 
     
    114125  the closest ocean velocity gridpoint were of the same magnitude but in the opposite direction 
    115126  (\autoref{fig:LBC_shlat}-b). 
    116   Therefore, the vorticity along the coastlines is given by:  
     127  Therefore, the vorticity along the coastlines is given by: 
    117128 
    118129  \[ 
     
    130141 
    131142\item["partial" free-slip boundary condition (0$<$\np{rn\_shlat}$<$2):] the tangential velocity at 
    132   the coastline is smaller than the offshore velocity, \ie there is a lateral friction but 
     143  the coastline is smaller than the offshore velocity, \ie\ there is a lateral friction but 
    133144  not strong enough to make the tangential velocity at the coast vanish (\autoref{fig:LBC_shlat}-c). 
    134145  This can be selected by providing a value of mask$_{f}$ strictly inbetween $0$ and $2$. 
     
    140151\end{description} 
    141152 
    142 Note that when the bottom topography is entirely represented by the $s$-coor-dinates (pure $s$-coordinate), 
     153Note that when the bottom topography is entirely represented by the $s$-coordinates (pure $s$-coordinate), 
    143154the lateral boundary condition on tangential velocity is of much less importance as 
    144155it is only applied next to the coast where the minimum water depth can be quite shallow. 
     
    149160% ================================================================ 
    150161\section[Model domain boundary condition (\texttt{jperio})] 
    151 {Model domain boundary condition (\protect\np{jperio})} 
     162{Model domain boundary condition (\protect\jp{jperio})} 
    152163\label{sec:LBC_jperio} 
    153164 
     
    155166closed, cyclic east-west, cyclic north-south, a north-fold, and combination closed-north fold or 
    156167bi-cyclic east-west and north-fold. 
    157 The north-fold boundary condition is associated with the 3-pole ORCA mesh.  
     168The north-fold boundary condition is associated with the 3-pole ORCA mesh. 
    158169 
    159170% ------------------------------------------------------------------------------------------------------------- 
    160 %        Closed, cyclic (\np{jperio}\forcode{ = 0..2})  
     171%        Closed, cyclic (\jp{jperio}\forcode{ = 0..2}) 
    161172% ------------------------------------------------------------------------------------------------------------- 
    162173\subsection[Closed, cyclic (\forcode{jperio = [0127]})] 
    163 {Closed, cyclic (\protect\np{jperio}\forcode{ = [0127]})} 
     174{Closed, cyclic (\protect\jp{jperio}\forcode{ = [0127]})} 
    164175\label{subsec:LBC_jperio012} 
    165176 
    166177The choice of closed or cyclic model domain boundary condition is made by 
    167 setting \np{jperio} to 0, 1, 2 or 7 in namelist \ngn{namcfg}. 
     178setting \jp{jperio} to 0, 1, 2 or 7 in namelist \nam{cfg}. 
    168179Each time such a boundary condition is needed, it is set by a call to routine \mdl{lbclnk}. 
    169180The computation of momentum and tracer trends proceeds from $i=2$ to $i=jpi-1$ and from $j=2$ to $j=jpj-1$, 
    170 \ie in the model interior. 
     181\ie\ in the model interior. 
    171182To choose a lateral model boundary condition is to specify the first and last rows and columns of 
    172 the model variables.  
     183the model variables. 
    173184 
    174185\begin{description} 
    175186 
    176 \item[For closed boundary (\np{jperio}\forcode{ = 0})], 
     187\item[For closed boundary (\jp{jperio}\forcode{ = 0})], 
    177188  solid walls are imposed at all model boundaries: 
    178189  first and last rows and columns are set to zero. 
    179190 
    180 \item[For cyclic east-west boundary (\np{jperio}\forcode{ = 1})], 
     191\item[For cyclic east-west boundary (\jp{jperio}\forcode{ = 1})], 
    181192  first and last rows are set to zero (closed) whilst the first column is set to 
    182193  the value of the last-but-one column and the last column to the value of the second one 
     
    184195  Whatever flows out of the eastern (western) end of the basin enters the western (eastern) end. 
    185196 
    186 \item[For cyclic north-south boundary (\np{jperio}\forcode{ = 2})], 
     197\item[For cyclic north-south boundary (\jp{jperio}\forcode{ = 2})], 
    187198  first and last columns are set to zero (closed) whilst the first row is set to 
    188199  the value of the last-but-one row and the last row to the value of the second one 
     
    190201  Whatever flows out of the northern (southern) end of the basin enters the southern (northern) end. 
    191202 
    192 \item[Bi-cyclic east-west and north-south boundary (\np{jperio}\forcode{ = 7})] combines cases 1 and 2. 
     203\item[Bi-cyclic east-west and north-south boundary (\jp{jperio}\forcode{ = 7})] combines cases 1 and 2. 
    193204 
    194205\end{description} 
     
    207218 
    208219% ------------------------------------------------------------------------------------------------------------- 
    209 %        North fold (\textit{jperio = 3 }to $6)$  
     220%        North fold (\textit{jperio = 3 }to $6)$ 
    210221% ------------------------------------------------------------------------------------------------------------- 
    211222\subsection[North-fold (\forcode{jperio = [3-6]})] 
    212 {North-fold (\protect\np{jperio}\forcode{ = [3-6]})} 
     223{North-fold (\protect\jp{jperio}\forcode{ = [3-6]})} 
    213224\label{subsec:LBC_north_fold} 
    214225 
     
    216227a three-polar ORCA grid. 
    217228Such a grid has two poles in the northern hemisphere (\autoref{fig:MISC_ORCA_msh}, 
    218 and thus requires a specific treatment illustrated in \autoref{fig:North_Fold_T}.  
     229and thus requires a specific treatment illustrated in \autoref{fig:North_Fold_T}. 
    219230Further information can be found in \mdl{lbcnfd} module which applies the north fold boundary condition. 
    220231 
     
    234245 
    235246% ==================================================================== 
    236 % Exchange with neighbouring processors  
     247% Exchange with neighbouring processors 
    237248% ==================================================================== 
    238249\section[Exchange with neighbouring processors (\textit{lbclnk.F90}, \textit{lib\_mpp.F90})] 
     
    272283After a computation, a communication phase starts: 
    273284each processor sends to its neighbouring processors the update values of the points corresponding to 
    274 the interior overlapping area to its neighbouring sub-domain (\ie the innermost of the two overlapping rows). 
     285the interior overlapping area to its neighbouring sub-domain (\ie\ the innermost of the two overlapping rows). 
    275286The communication is done through the Message Passing Interface (MPI). 
    276287The data exchanges between processors are required at the very place where 
    277288lateral domain boundary conditions are set in the mono-domain computation: 
    278289the \rou{lbc\_lnk} routine (found in \mdl{lbclnk} module) which manages such conditions is interfaced with 
    279 routines found in \mdl{lib\_mpp} module when running on an MPP computer (\ie when \key{mpp\_mpi} defined). 
     290routines found in \mdl{lib\_mpp} module when running on an MPP computer (\ie\ when \key{mpp\_mpi} defined). 
    280291It has to be pointed out that when using the MPP version of the model, 
    281292the east-west cyclic boundary condition is done implicitly, 
     
    297308The i-axis is divided by \jp{jpni} and 
    298309the j-axis by \jp{jpnj} for a number of processors \jp{jpnij} most often equal to $jpni \times jpnj$ 
    299 (parameters set in  \ngn{nammpp} namelist). 
     310(parameters set in  \nam{mpp} namelist). 
    300311Each processor is independent and without message passing or synchronous process, 
    301312programs run alone and access just its own local memory. 
     
    304315These dimensions include the internal domain and the overlapping rows. 
    305316The number of rows to exchange (known as the halo) is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). 
    306 The whole domain dimensions are named \np{jpiglo}, \np{jpjglo} and \jp{jpk}. 
     317The whole domain dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}. 
    307318The relationship between the whole domain and a sub-domain is: 
    308319\[ 
     
    312323where \jp{jpni}, \jp{jpnj} are the number of processors following the i- and j-axis. 
    313324 
    314 One also defines variables nldi and nlei which correspond to the internal domain bounds,  
    315 and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain.  
     325One also defines variables nldi and nlei which correspond to the internal domain bounds, 
     326and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain. 
    316327An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$, 
    317 a global array (whole domain) by the relationship:  
     328a global array (whole domain) by the relationship: 
    318329\[ 
    319330  % \label{eq:lbc_nimpp} 
     
    337348 
    338349 
    339 The \NEMO model computes equation terms with the help of mask arrays (0 on land points and 1 on sea points). 
     350The \NEMO\ model computes equation terms with the help of mask arrays (0 on land points and 1 on sea points). 
    340351It is easily readable and very efficient in the context of a computer with vectorial architecture. 
    341352However, in the case of a scalar processor, computations over the land regions become more expensive in 
    342 terms of CPU time.  
     353terms of CPU time. 
    343354It is worse when we use a complex configuration with a realistic bathymetry like the global ocean where 
    344355more than 50 \% of points are land points. 
     
    349360The user then chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with $jpnij < jpni \times jpnj$, 
    350361leading to the elimination of $jpni \times jpnj - jpnij$ land processors. 
    351 When those parameters are specified in \ngn{nammpp} namelist, 
     362When those parameters are specified in \nam{mpp} namelist, 
    352363the algorithm in the \rou{inimpp2} routine sets each processor's parameters (nbound, nono, noea,...) so that 
    353364the land-only processors are not taken into account. 
    354365 
    355 \gmcomment{Note that the inimpp2 routine is general so that the original inimpp  
     366\gmcomment{Note that the inimpp2 routine is general so that the original inimpp 
    356367routine should be suppressed from the code.} 
    357368 
     
    360371Note that this is a problem for the meshmask file which requires to be defined over the whole domain. 
    361372Therefore, user should not eliminate land processors when creating a meshmask file 
    362 (\ie when setting a non-zero value to \np{nn\_msh}). 
     373(\ie\ when setting a non-zero value to \np{nn\_msh}). 
    363374 
    364375%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    381392 
    382393% ==================================================================== 
    383 % Unstructured open boundaries BDY  
     394% Unstructured open boundaries BDY 
    384395% ==================================================================== 
    385396\section{Unstructured open boundary conditions (BDY)} 
     
    388399%-----------------------------------------nambdy-------------------------------------------- 
    389400 
    390 \nlst{nambdy}  
     401\nlst{nambdy} 
    391402%----------------------------------------------------------------------------------------------- 
    392403%-----------------------------------------nambdy_dta-------------------------------------------- 
    393404 
    394 \nlst{nambdy_dta}  
     405\nlst{nambdy_dta} 
    395406%----------------------------------------------------------------------------------------------- 
    396407 
    397 Options are defined through the \ngn{nambdy} \ngn{nambdy\_dta} namelist variables. 
    398 The BDY module is the core implementation of open boundary conditions for regional configurations on  
    399 temperature, salinity, barotropic and baroclinic velocities, as well as ice concentration, ice and snow thicknesses). 
    400  
    401 The BDY module was modelled on the OBC module (see NEMO 3.4) and shares many features and 
     408Options are defined through the \nam{bdy} \nam{bdy\_dta} namelist variables. 
     409The BDY module is the core implementation of open boundary conditions for regional configurations on 
     410temperature, salinity, barotropic and baroclinic velocities, as well as ice concentration, ice and snow thicknesses. 
     411 
     412The BDY module was modelled on the OBC module (see \NEMO\ 3.4) and shares many features and 
    402413a similar coding structure \citep{chanut_rpt05}. 
    403414The specification of the location of the open boundary is completely flexible and 
    404 allows for example the open boundary to follow an isobath or other irregular contour.  
    405 Boundary data files used with versions of NEMO prior to Version 3.4 may need to be re-ordered to work with this version. 
     415allows any type of setup, from regular boundaries to irregular contour (it includes the possibility to set an open boundary able to follow an isobath). 
     416Boundary data files used with versions of \NEMO\ prior to Version 3.4 may need to be re-ordered to work with this version. 
    406417See the section on the Input Boundary Data Files for details. 
    407418 
     
    415426Each boundary set may be defined as a set of straight line segments in a namelist 
    416427(\np{ln\_coords\_file}\forcode{ = .false.}) or read in from a file (\np{ln\_coords\_file}\forcode{ = .true.}). 
    417 If the set is defined in a namelist, then the namelists \ngn{nambdy\_index} must be included separately, one for each set. 
     428If the set is defined in a namelist, then the namelists \nam{bdy\_index} must be included separately, one for each set. 
    418429If the set is defined by a file, then a ``\ifile{coordinates.bdy}'' file must be provided. 
    419 The coordinates.bdy file is analagous to the usual NEMO ``\ifile{coordinates}'' file. 
     430The coordinates.bdy file is analagous to the usual \NEMO\ ``\ifile{coordinates}'' file. 
    420431In the example above, there are two boundary sets, the first of which is defined via a file and 
    421432the second is defined in a namelist. 
     
    423434 
    424435For each boundary set a boundary condition has to be chosen for the barotropic solution 
    425 (``u2d'':sea-surface height and barotropic velocities), for the baroclinic velocities (``u3d''),  
     436(``u2d'':sea-surface height and barotropic velocities), for the baroclinic velocities (``u3d''), 
    426437for the active tracers \footnote{The BDY module does not deal with passive tracers at this version} (``tra''), and sea-ice (``ice''). 
    427438For each set of variables there is a choice of algorithm and a choice for the data, 
    428 eg. for the active tracers the algorithm is set by \np{cn\_tra} and the choice of data is set by \np{nn\_tra\_dta}.\\  
     439eg. for the active tracers the algorithm is set by \np{cn\_tra} and the choice of data is set by \np{nn\_tra\_dta}.\\ 
    429440 
    430441The choice of algorithm is currently as follows: 
     
    436447\item[\forcode{'neumann'}:] Value at the boundary are duplicated (No gradient). Only available for baroclinic velocity and tracer variables. 
    437448\item[\forcode{'frs'}:] Flow Relaxation Scheme (FRS) available for all variables. 
    438 \item[\forcode{'Orlanski'}:] Orlanski radiation scheme (fully oblique) for barotropic, baroclinic and tracer variables.  
    439 \item[\forcode{'Orlanski_npo'}:] Orlanski radiation scheme for barotropic, baroclinic and tracer variables.  
     449\item[\forcode{'Orlanski'}:] Orlanski radiation scheme (fully oblique) for barotropic, baroclinic and tracer variables. 
     450\item[\forcode{'Orlanski_npo'}:] Orlanski radiation scheme for barotropic, baroclinic and tracer variables. 
    440451\item[\forcode{'flather'}:] Flather radiation scheme for the barotropic variables only. 
    441452\end{description} 
     
    443454The main choice for the boundary data is to use initial conditions as boundary data 
    444455(\np{nn\_tra\_dta}\forcode{ = 0}) or to use external data from a file (\np{nn\_tra\_dta}\forcode{ = 1}). 
    445 In case the 3d velocity data contain the total velocity (ie, baroclinic and barotropic velocity),  
     456In case the 3d velocity data contain the total velocity (ie, baroclinic and barotropic velocity), 
    446457the bdy code can derived baroclinic and barotropic velocities by setting \np{ln\_full\_vel}\forcode{ = .true. } 
    447458For the barotropic solution there is also the option to use tidal harmonic forcing either by 
    448459itself (\np{nn\_dyn2d\_dta}\forcode{ = 2}) or in addition to other external data (\np{nn\_dyn2d\_dta}\forcode{ = 3}).\\ 
    449 Sea-ice salinity, temperature and age data at the boundary are constant and defined repectively by \np{rn\_ice\_sal}, \np{rn\_ice\_tem} and \np{rn\_ice\_age}.  
    450  
    451 If external boundary data is required then the \ngn{nambdy\_dta} namelist must be defined. 
    452 One \ngn{nambdy\_dta} namelist is required for each boundary set in the order in which 
    453 the boundary sets are defined in nambdy. 
    454 In the example given, two boundary sets have been defined. The first one is reading data file in the \ngn{nambdy\_dta} namelist shown above  
    455 and the second one is using data from intial condition (no namelist bloc needed). 
     460Sea-ice salinity, temperature and age data at the boundary are constant and defined repectively by \np{rn\_ice\_sal}, \np{rn\_ice\_tem} and \np{rn\_ice\_age}. 
     461 
     462If external boundary data is required then the \nam{bdy\_dta} namelist must be defined. 
     463One \nam{bdy\_dta} namelist is required for each boundary set, adopting the same order of indexes in which the boundary sets are defined in nambdy. 
     464In the example given, two boundary sets have been defined. The first one is reading data file in the \nam{bdy\_dta} namelist shown above 
     465and the second one is using data from intial condition (no namelist block needed). 
    456466The boundary data is read in using the fldread module, 
    457 so the \ngn{nambdy\_dta} namelist is in the format required for fldread. 
    458 For each variable required, the filename, the frequency of the files and 
    459 the frequency of the data in the files is given. 
     467so the \nam{bdy\_dta} namelist is in the format required for fldread. 
     468For each required variable, the filename, the frequency of the files and 
     469the frequency of the data in the files are given. 
    460470Also whether or not time-interpolation is required and whether the data is climatological (time-cyclic) data.\\ 
    461471 
    462472There is currently an option to vertically interpolate the open boundary data onto the native grid at run-time. 
    463 If \np{nn\_bdy\_jpk} $< -1$, it is assumed that the lateral boundary data are already on the native grid.  
    464 However, if \np{nn\_bdy\_jpk} is set to the number of vertical levels present in the boundary data,  
    465 a bilinear interpolation onto the native grid will be triggered at runtime.  
    466 For this to be successful the additional variables: $gdept$, $gdepu$, $gdepv$, $e3t$, $e3u$ and $e3v$, are required to be present in the lateral boundary files.  
    467 These correspond to the depths and scale factors of the input data,  
     473If \np{nn\_bdy\_jpk} $< -1$, it is assumed that the lateral boundary data are already on the native grid. 
     474However, if \np{nn\_bdy\_jpk} is set to the number of vertical levels present in the boundary data, 
     475a bilinear interpolation onto the native grid will be triggered at runtime. 
     476For this to be successful the additional variables: $gdept$, $gdepu$, $gdepv$, $e3t$, $e3u$ and $e3v$, are required to be present in the lateral boundary files. 
     477These correspond to the depths and scale factors of the input data, 
    468478the latter used to make any adjustment to the velocity fields due to differences in the total water depths between the two vertical grids.\\ 
    469479 
    470 In the example namelists given, two boundary sets are defined. 
     480In the example of given namelists, two boundary sets are defined. 
    471481The first set is defined via a file and applies FRS conditions to temperature and salinity and 
    472482Flather conditions to the barotropic variables. No condition specified for the baroclinic velocity and sea-ice. 
     
    474484Tidal harmonic forcing is also used. 
    475485The second set is defined in a namelist. 
    476 FRS conditions are applied on temperature and salinity and climatological data is read from initial condition files.  
     486FRS conditions are applied on temperature and salinity and climatological data is read from initial condition files. 
    477487 
    478488%---------------------------------------------- 
     
    505515is relaxed towards the external conditions over the rest of the FRS zone. 
    506516The application of a relaxation zone helps to prevent spurious reflection of 
    507 outgoing signals from the model boundary.  
     517outgoing signals from the model boundary. 
    508518 
    509519The function $\alpha$ is specified as a $tanh$ function: 
     
    534544Note that the sea-surface height gradient in \autoref{eq:bdy_fla1} is a spatial gradient across the model boundary, 
    535545so that $\eta_{e}$ is defined on the $T$ points with $nbr=1$ and $\eta$ is defined on the $T$ points with $nbr=2$. 
    536 $U$ and $U_{e}$ are defined on the $U$ or $V$ points with $nbr=1$, \ie between the two $T$ grid points. 
     546$U$ and $U_{e}$ are defined on the $U$ or $V$ points with $nbr=1$, \ie\ between the two $T$ grid points. 
    537547 
    538548%---------------------------------------------- 
     
    575585\end{equation} 
    576586 
    577 Generally the relaxation time scale at inward propagation points \np{(rn\_time\_dmp}) is set much shorter than the time scale at outward propagation 
     587Generally the relaxation time scale at inward propagation points (\np{rn\_time\_dmp}) is set much shorter than the time scale at outward propagation 
    578588points (\np{rn\_time\_dmp\_out}) so that the solution is constrained more strongly by the external data at inward propagation points. 
    579 See \autoref{subsec:BDY_relaxation} for detailed on the spatial shape of the scaling.\\  
    580 The ``normal propagation of oblique radiation'' or NPO approximation (called \forcode{'orlanski_npo'}) involves assuming  
     589See \autoref{subsec:BDY_relaxation} for detailed on the spatial shape of the scaling.\\ 
     590The ``normal propagation of oblique radiation'' or NPO approximation (called \forcode{'orlanski_npo'}) involves assuming 
    581591that $c_y$ is zero in equation (\autoref{eq:wave_continuous}), but including 
    582592this term in the denominator of equation (\autoref{eq:cx}). Both versions of the scheme are options in BDY. Equations 
     
    587597\label{subsec:BDY_relaxation} 
    588598 
    589 In addition to a specific boundary condition specified as \np{cn\_tra} and \np{cn\_dyn3d}, relaxation on baroclinic velocities and tracers variables are available.  
     599In addition to a specific boundary condition specified as \np{cn\_tra} and \np{cn\_dyn3d}, relaxation on baroclinic velocities and tracers variables are available. 
    590600It is control by the namelist parameter \np{ln\_tra\_dmp} and \np{ln\_dyn3d\_dmp} for each boundary set. 
    591601 
    592 The relaxation time scale value (\np{rn\_time\_dmp} and \np{rn\_time\_dmp\_out}, $\tau$) are defined at the boundaries itself.  
     602The relaxation time scale value (\np{rn\_time\_dmp} and \np{rn\_time\_dmp\_out}, $\tau$) are defined at the boundaries itself. 
    593603This time scale ($\alpha$) is weighted by the distance ($d$) from the boundary over \np{nn\_rimwidth} cells ($N$): 
    594604 
     
    597607\] 
    598608 
    599 The same scaling is applied in the Orlanski damping.  
     609The same scaling is applied in the Orlanski damping. 
    600610 
    601611%---------------------------------------------- 
     
    605615Each open boundary set is defined as a list of points. 
    606616The information is stored in the arrays $nbi$, $nbj$, and $nbr$ in the $idx\_bdy$ structure. 
    607 The $nbi$ and $nbj$ arrays define the local $(i,j)$ indices of each point in the boundary zone and 
    608 the $nbr$ array defines the discrete distance from the boundary with $nbr=1$ meaning that 
    609 the point is next to the edge of the model domain and $nbr>1$ showing that 
    610 the point is increasingly further away from the edge of the model domain. 
     617The $nbi$ and $nbj$ arrays define the local $(i,j)$ indexes of each point in the boundary zone and 
     618the $nbr$ array defines the discrete distance from the boundary: $nbr=1$ means that 
     619the boundary point is next to the edge of the model domain, while $nbr>1$ means that 
     620the boundary point is increasingly further away from the edge of the model domain. 
    611621A set of $nbi$, $nbj$, and $nbr$ arrays is defined for each of the $T$, $U$ and $V$ grids. 
    612 Figure \autoref{fig:LBC_bdy_geom} shows an example of an irregular boundary.  
     622Figure \autoref{fig:LBC_bdy_geom} shows an example of an irregular boundary. 
    613623 
    614624The boundary geometry for each set may be defined in a namelist nambdy\_index or 
    615625by reading in a ``\ifile{coordinates.bdy}'' file. 
    616626The nambdy\_index namelist defines a series of straight-line segments for north, east, south and west boundaries. 
    617 One nambdy\_index namelist bloc is needed for each boundary condition defined by indexes.  
    618 For the northern boundary, \np{nbdysegn} gives the number of segments, 
    619 \np{jpjnob} gives the $j$ index for each segment and \np{jpindt} and 
    620 \np{jpinft} give the start and end $i$ indices for each segment with similar for the other boundaries. 
     627One nambdy\_index namelist block is needed for each boundary condition defined by indexes. 
     628For the northern boundary, \texttt{nbdysegn} gives the number of segments, 
     629\jp{jpjnob} gives the $j$ index for each segment and \jp{jpindt} and 
     630\jp{jpinft} give the start and end $i$ indices for each segment with similar for the other boundaries. 
    621631These segments define a list of $T$ grid points along the outermost row of the boundary ($nbr\,=\, 1$). 
    622632The code deduces the $U$ and $V$ points and also the points for $nbr\,>\, 1$ if \np{nn\_rimwidth}\forcode{ > 1}. 
    623633 
    624634The boundary geometry may also be defined from a ``\ifile{coordinates.bdy}'' file. 
    625 Figure \autoref{fig:LBC_nc_header} gives an example of the header information from such a file. 
     635Figure \autoref{fig:LBC_nc_header} gives an example of the header information from such a file, based on the description of geometrical setup given above. 
    626636The file should contain the index arrays for each of the $T$, $U$ and $V$ grids. 
    627637The arrays must be in order of increasing $nbr$. 
     
    629639Typically this file will be used to generate external boundary data via interpolation and so 
    630640will also contain the latitudes and longitudes of each point as shown. 
    631 However, this is not necessary to run the model.  
     641However, this is not necessary to run the model. 
    632642 
    633643For some choices of irregular boundary the model domain may contain areas of ocean which 
    634644are not part of the computational domain. 
    635 For example if an open boundary is defined along an isobath, say at the shelf break, 
     645For example, if an open boundary is defined along an isobath, say at the shelf break, 
    636646then the areas of ocean outside of this boundary will need to be masked out. 
    637647This can be done by reading a mask file defined as \np{cn\_mask\_file} in the nam\_bdy namelist. 
     
    658668a time dimension; 
    659669$xb$ which is the index of the boundary data point in the horizontal; 
    660 and $yb$ which is a degenerate dimension of 1 to enable the file to be read by the standard NEMO I/O routines. 
    661 The 3D fields also have a depth dimension.  
     670and $yb$ which is a degenerate dimension of 1 to enable the file to be read by the standard \NEMO\ I/O routines. 
     671The 3D fields also have a depth dimension. 
    662672 
    663673From Version 3.4 there are new restrictions on the order in which the boundary points are defined 
     
    670680\item All the data for a particular boundary set must be in the same order. 
    671681  (Prior to 3.4 it was possible to define barotropic data in a different order to 
    672   the data for tracers and baroclinic velocities).  
     682  the data for tracers and baroclinic velocities). 
    673683\end{enumerate} 
    674684 
     
    697707This is controlled  by the \np{ln\_vol} parameter in the namelist. 
    698708A value of \np{ln\_vol}\forcode{ = .false.} indicates that this option is not used. 
    699 Two options to control the volume are available (\np{nn\_volctl}).  
     709Two options to control the volume are available (\np{nn\_volctl}). 
    700710If \np{nn\_volctl}\forcode{ = 0} then a correction is applied to the normal barotropic velocities around the boundary at 
    701711each timestep to ensure that the integrated volume flow through the boundary is zero. 
     
    713723%-----------------------------------------nambdy_tide-------------------------------------------- 
    714724 
    715 \nlst{nambdy_tide}  
     725\nlst{nambdy_tide} 
    716726%----------------------------------------------------------------------------------------------- 
    717727 
    718728Tidal forcing at open boundaries requires the activation of surface 
    719 tides (i.e., in \ngn{nam\_tide}, \np{ln\_tide} needs to be set to 
     729tides (i.e., in \nam{\_tide}, \np{ln\_tide} needs to be set to 
    720730\forcode{.true.} and the required constituents need to be activated by 
    721 including their names in the \np{cname} array; see 
     731including their names in the \np{clname} array; see 
    722732\autoref{sec:SBC_tide}). Specific options related to the reading in of 
    723733the complex harmonic amplitudes of elevation (SSH) and barotropic 
    724734velocity (u,v) at open boundaries are defined through the 
    725 \ngn{nambdy\_tide} namelist parameters.\\ 
     735\nam{bdy\_tide} namelist parameters.\\ 
    726736 
    727737The tidal harmonic data at open boundaries can be specified in two 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_LDF.tex

    r11353 r11512  
    99\label{chap:LDF} 
    1010 
    11 \minitoc 
     11\chaptertoc 
    1212 
    1313\newpage 
     
    2222(3) the space and time variations of the eddy coefficients. 
    2323These three aspects of the lateral diffusion are set through namelist parameters 
    24 (see the \ngn{nam\_traldf} and \ngn{nam\_dynldf} below). 
     24(see the \nam{tra\_ldf} and \nam{dyn\_ldf} below). 
    2525Note that this chapter describes the standard implementation of iso-neutral tracer mixing.  
    2626Griffies's implementation, which is used if \np{ln\_traldf\_triad}\forcode{ = .true.}, 
     
    5353{Laplacian mixing (\protect\np{ln\_traldf\_lap}, \protect\np{ln\_dynldf\_lap})} 
    5454Setting \protect\np{ln\_traldf\_lap}\forcode{ = .true.} and/or \protect\np{ln\_dynldf\_lap}\forcode{ = .true.} enables  
    55 a second order diffusion on tracers and momentum respectively. Note that in \NEMO 4, one can not combine  
     55a second order diffusion on tracers and momentum respectively. Note that in \NEMO\ 4, one can not combine  
    5656Laplacian and Bilaplacian operators for the same variable. 
    5757 
     
    6060Setting \protect\np{ln\_traldf\_blp}\forcode{ = .true.} and/or \protect\np{ln\_dynldf\_blp}\forcode{ = .true.} enables  
    6161a fourth order diffusion on tracers and momentum respectively. It is implemented by calling the above Laplacian operator twice.  
    62 We stress again that from \NEMO 4, the simultaneous use Laplacian and Bilaplacian operators is not allowed. 
     62We stress again that from \NEMO\ 4, the simultaneous use Laplacian and Bilaplacian operators is not allowed. 
    6363 
    6464% ================================================================ 
     
    9090\subsection{Slopes for tracer geopotential mixing in the $s$-coordinate} 
    9191 
    92 In $s$-coordinates, geopotential mixing (\ie horizontal mixing) $r_1$ and $r_2$ are the slopes between 
     92In $s$-coordinates, geopotential mixing (\ie\ horizontal mixing) $r_1$ and $r_2$ are the slopes between 
    9393the geopotential and computational surfaces. 
    9494Their discrete formulation is found by locally solving \autoref{eq:tra_ldf_iso} when 
    9595the diffusive fluxes in the three directions are set to zero and $T$ is assumed to be horizontally uniform, 
    96 \ie a linear function of $z_T$, the depth of a $T$-point.  
     96\ie\ a linear function of $z_T$, the depth of a $T$-point.  
    9797%gm { Steven : My version is obviously wrong since I'm left with an arbitrary constant which is the local vertical temperature gradient} 
    9898 
     
    124124Their formulation does not depend on the vertical coordinate used. 
    125125Their discrete formulation is found using the fact that the diffusive fluxes of 
    126 locally referenced potential density (\ie $in situ$ density) vanish. 
     126locally referenced potential density (\ie\ $in situ$ density) vanish. 
    127127So, substituting $T$ by $\rho$ in \autoref{eq:tra_ldf_iso} and setting the diffusive fluxes in 
    128128the three directions to zero leads to the following definition for the neutral slopes: 
     
    230230To overcome this problem, several techniques have been proposed in which the numerical schemes of 
    231231the ocean model are modified \citep{weaver.eby_JPO97, griffies.gnanadesikan.ea_JPO98}. 
    232 Griffies's scheme is now available in \NEMO if \np{ln\_traldf\_triad}=\forcode{= .true.}; see \autoref{apdx:triad}. 
     232Griffies's scheme is now available in \NEMO\ if \np{ln\_traldf\_triad}\forcode{ = .true.}; see \autoref{apdx:triad}. 
    233233Here, another strategy is presented \citep{lazar_phd97}: 
    234234a local filtering of the iso-neutral slopes (made on 9 grid-points) prevents the development of 
     
    284284      \textit{(a)} in the real ocean the slope is the iso-neutral slope in the ocean interior, 
    285285      which has to be adjusted at the surface boundary 
    286       \ie it must tend to zero at the surface since there is no mixing across the air-sea interface: 
     286      \ie\ it must tend to zero at the surface since there is no mixing across the air-sea interface: 
    287287      wall boundary condition). 
    288288      Nevertheless, the profile between the surface zero value and the interior iso-neutral one is unknown, 
     
    309309\textit{vw}- points for the $v$-component. 
    310310They are computed from the slopes used for tracer diffusion, 
    311 \ie \autoref{eq:ldfslp_geo} and \autoref{eq:ldfslp_iso}: 
     311\ie\ \autoref{eq:ldfslp_geo} and \autoref{eq:ldfslp_iso}: 
    312312 
    313313\[ 
     
    323323The major issue remaining is in the specification of the boundary conditions. 
    324324The same boundary conditions are chosen as those used for lateral diffusion along model level surfaces, 
    325 \ie using the shear computed along the model levels and with no additional friction at the ocean bottom 
     325\ie\ using the shear computed along the model levels and with no additional friction at the ocean bottom 
    326326(see \autoref{sec:LBC_coast}). 
    327327 
     
    399399  A_l = \left\{ 
    400400    \begin{aligned} 
    401       & \frac{\max(e_1,e_2)}{e_{ref}} A_o^l           & \text{for laplacian operator } \\ 
    402       & \frac{\max(e_1,e_2)^{3}}{e_{ref}^{3}} A_o^l          & \text{for bilaplacian operator } 
     401      & \frac{1}{2} U_{scl}  \max(e_1,e_2)         & \text{for laplacian operator } \\ 
     402      & \frac{1}{12} U_{scl}  \max(e_1,e_2)^{3}             & \text{for bilaplacian operator } 
    403403    \end{aligned} 
    404404  \right. 
    405405\end{equation} 
    406 where $e_{ref}$ is a reference grid size harcoded to a $1^{\circ}$ grid size (\ie $e_{ref}\approx 111 km$), 
    407 and $A_o^l$ is the user defined mixing coefficient defined according to  \autoref{eq:constantah}. 
     406where $U_{scl}$ is a user defined velocity scale (\np{rn\_Ud}, \np{rn\_Uv}). 
    408407This variation is intended to reflect the lesser need for subgrid scale eddy mixing where 
    409408the grid size is smaller in the domain. 
     
    421420 
    422421The 3D space variation of the mixing coefficient is simply the combination of the 1D and 2D cases above, 
    423 \ie a hyperbolic tangent variation with depth associated with a grid size dependence of 
     422\ie\ a hyperbolic tangent variation with depth associated with a grid size dependence of 
    424423the magnitude of the coefficient.  
    425424 
     
    528527the formulation of which depends on the slopes of iso-neutral surfaces. 
    529528Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces, 
    530 \ie \autoref{eq:ldfslp_geo} is used in $z$-coordinates, 
     529\ie\ \autoref{eq:ldfslp_geo} is used in $z$-coordinates, 
    531530and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $s$-coordinates. 
    532531 
    533 If isopycnal mixing is used in the standard way, \ie \np{ln\_traldf\_triad}\forcode{ = .false.}, the eddy induced velocity is given by:  
     532If isopycnal mixing is used in the standard way, \ie\ \np{ln\_traldf\_triad}\forcode{ = .false.}, the eddy induced velocity is given by:  
    534533\begin{equation} 
    535534  \label{eq:ldfeiv} 
     
    540539  \end{split} 
    541540\end{equation} 
    542 where $A^{eiv}$ is the eddy induced velocity coefficient whose value is set through \np{nn\_aei\_ijk\_t} \ngn{namtra\_eiv} namelist parameter.  
     541where $A^{eiv}$ is the eddy induced velocity coefficient whose value is set through \np{nn\_aei\_ijk\_t} \nam{tra\_eiv} namelist parameter.  
    543542The three components of the eddy induced velocity are computed in \rou{ldf\_eiv\_trp} and 
    544543added to the eulerian velocity in \rou{tra\_adv} where tracer advection is performed. 
     
    571570%-------------------------------------------------------------------------------------------------------------- 
    572571 
    573 If  \np{ln\_mle}\forcode{ = .true.} in \ngn{namtra\_mle} namelist, a parameterization of the mixing due to unresolved mixed layer instabilities is activated (\citet{foxkemper.ferrari_JPO08}). Additional transport is computed in \rou{ldf\_mle\_trp} and added to the eulerian transport in \rou{tra\_adv} as done for eddy induced advection. 
     572If  \np{ln\_mle}\forcode{ = .true.} in \nam{tra\_mle} namelist, a parameterization of the mixing due to unresolved mixed layer instabilities is activated (\citet{foxkemper.ferrari_JPO08}). Additional transport is computed in \rou{ldf\_mle\_trp} and added to the eulerian transport in \rou{tra\_adv} as done for eddy induced advection. 
    574573 
    575574\colorbox{yellow}{TBC} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_OBS.tex

    r11353 r11512  
    88\label{chap:OBS} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212\vfill 
     
    1515\begin{tabular}{l||l|m{0.65\linewidth}} 
    1616    Release   & Author        & Modifications \\ 
    17     {\em 4.0} & {\em D. J. Lea} & {\em \NEMO 4.0 updates}  \\ 
     17    {\em 4.0} & {\em D. J. Lea} & {\em \NEMO\ 4.0 updates}  \\ 
    1818    {\em 3.6} & {\em M. Martin, A. Ryan} & {\em Add averaging operator, standalone obs oper} \\ 
    1919    {\em 3.4} & {\em D. J. Lea, M. Martin, ...} & {\em Initial version}  \\ 
     
    3232The OBS code is called from \mdl{nemogcm} for model initialisation and to calculate the model equivalent values for observations on the 0th time step. 
    3333The code is then called again after each time step from \mdl{step}. 
    34 The code is only activated if the \ngn{namobs} namelist logical \np{ln\_diaobs} is set to true. 
     34The code is only activated if the \nam{obs} namelist logical \np{ln\_diaobs} is set to true. 
    3535 
    3636For all data types a 2D horizontal interpolator or averager is needed to 
     
    4040This now works in a generalised vertical coordinate system. 
    4141 
    42 Some profile observation types (\eg tropical moored buoys) are made available as daily averaged quantities. 
     42Some profile observation types (\eg\ tropical moored buoys) are made available as daily averaged quantities. 
    4343The observation operator code can be set-up to calculate the equivalent daily average model temperature fields using 
    4444the \np{nn\_profdavtypes} namelist array. 
     
    4848Otherwise (by default) the model value from the nearest time step to the observation time is used. 
    4949 
    50 The code is controlled by the namelist \ngn{namobs}. 
     50The code is controlled by the namelist \nam{obs}. 
    5151See the following sections for more details on setting up the namelist. 
    5252 
     
    6868In this section an example of running the observation operator code is described using 
    6969profile observation data which can be freely downloaded. 
    70 It shows how to adapt an existing run and build of \NEMO to run the observation operator. Note also the observation operator and the assimilation increments code are run in the \np{ORCA2\_ICE\_OBS} SETTE test. 
     70It shows how to adapt an existing run and build of \NEMO\ to run the observation operator. Note also the observation operator and the assimilation increments code are run in the ORCA2\_ICE\_OBS SETTE test. 
    7171 
    7272\begin{enumerate} 
    73 \item Compile NEMO. 
     73\item Compile \NEMO. 
    7474 
    7575\item Download some EN4 data from \href{http://www.metoffice.gov.uk/hadobs}{www.metoffice.gov.uk/hadobs}. 
     
    7777  the observation operator compares the model and observations for a matching date and time. 
    7878 
    79 \item Compile the OBSTOOLS code in the \np{tools} directory using: 
     79\item Compile the OBSTOOLS code in the \path{tools} directory using: 
    8080\begin{cmds} 
    8181./maketools -n OBSTOOLS -m [ARCH] 
    8282\end{cmds} 
    8383 
    84 replacing \np{[ARCH]} with the build architecture file for your machine. Note the tools are checked out from a separate repository under \np{utils/tools}. 
     84replacing \texttt{[ARCH]} with the build architecture file for your machine. Note the tools are checked out from a separate location of the repository (under \path{/utils/tools}). 
    8585 
    8686\item Convert the EN4 data into feedback format: 
     
    8989\end{cmds} 
    9090 
    91 \item Include the following in the \NEMO namelist to run the observation operator on this data: 
     91\item Include the following in the \NEMO\ namelist to run the observation operator on this data: 
    9292\end{enumerate} 
    9393 
    94 Options are defined through the \ngn{namobs} namelist variables. 
     94Options are defined through the \nam{obs} namelist variables. 
    9595The options \np{ln\_t3d} and \np{ln\_s3d} switch on the temperature and salinity profile observation operator code. 
    9696The filename or array of filenames are specified using the \np{cn\_profbfiles} variable. 
     
    114114\label{sec:OBS_details} 
    115115 
    116 Here we show a more complete example namelist \ngn{namobs} and also show the NetCDF headers of 
     116Here we show a more complete example namelist \nam{obs} and also show the NetCDF headers of 
    117117the observation files that may be used with the observation operator. 
    118118 
     
    554554the model equivalent of the observation is calculated by interpolating from 
    555555the four surrounding grid points to the observation location. 
    556 Some satellite observations (\eg microwave satellite SST data, or satellite SSS data) have a footprint which 
     556Some satellite observations (\eg\ microwave satellite SST data, or satellite SSS data) have a footprint which 
    557557is similar in size or larger than the model grid size (particularly when the grid size is small). 
    558558In those cases the model counterpart should be calculated by averaging the model grid points over 
    559559the same size as the footprint. 
    560 \NEMO therefore has the capability to specify either an interpolation or an averaging 
     560\NEMO\ therefore has the capability to specify either an interpolation or an averaging 
    561561(for surface observation types only). 
    562562 
     
    571571\item \np{nn\_2dint}\forcode{ = 4}: Polynomial interpolation 
    572572\item \np{nn\_2dint}\forcode{ = 5}: Radial footprint averaging with diameter specified in the namelist as 
    573   \np{rn\_[var]\_avglamscl} in degrees or metres (set using \np{ln\_[var]\_fp\_indegs}) 
     573  \texttt{rn\_[var]\_avglamscl} in degrees or metres (set using \texttt{ln\_[var]\_fp\_indegs}) 
    574574\item \np{nn\_2dint}\forcode{ = 6}: Rectangular footprint averaging with E/W and N/S size specified in 
    575   the namelist as \np{rn\_[var]\_avglamscl} and \np{rn\_[var]\_avgphiscl} in degrees or metres 
    576   (set using \np{ln\_[var]\_fp\_indegs}) 
     575  the namelist as \texttt{rn\_[var]\_avglamscl} and \texttt{rn\_[var]\_avgphiscl} in degrees or metres 
     576  (set using \texttt{ln\_[var]\_fp\_indegs}) 
    577577\end{itemize} 
    578 Replace \np{[var]} in the last two options with the observation type (sla, sst, sss or sic) for 
     578Replace \texttt{[var]} in the last two options with the observation type (sla, sst, sss or sic) for 
    579579which the averaging is to be performed (see namelist example above). 
    580580The \np{nn\_2dint} default option can be overridden for surface observation types using 
    581 namelist values \np{nn\_2dint\_[var]} where \np{[var]} is the observation type. 
    582  
    583 Below is some more detail on the various options for interpolation and averaging available in NEMO. 
     581namelist values \texttt{nn\_2dint\_[var]} where \texttt{[var]} is the observation type. 
     582 
     583Below is some more detail on the various options for interpolation and averaging available in \NEMO. 
    584584 
    585585\subsubsection{Horizontal interpolation} 
     
    588588the four nearest neighbouring model grid points ${\mathrm A}$, ${\mathrm B}$, ${\mathrm C}$ and ${\mathrm D}$ with 
    589589longitude and latitude ($\lambda_{\mathrm A}$, $\phi_{\mathrm A}$),($\lambda_{\mathrm B}$, $\phi_{\mathrm B}$) etc. 
    590 All horizontal interpolation methods implemented in \NEMO estimate the value of a model variable $x$ at point $P$ as 
     590All horizontal interpolation methods implemented in \NEMO\ estimate the value of a model variable $x$ at point $P$ as 
    591591a weighted linear combination of the values of the model variables at the grid points ${\mathrm A}$, ${\mathrm B}$ etc.: 
    592592 
     
    628628   and $M$ corresponds to $B$, $C$ or $D$. 
    629629   A more stable form of the great-circle distance formula for small distances ($x$ near 1) 
    630    involves the arcsine function (\eg see p.~101 of \citet{daley.barker_bk01}: 
     630   involves the arcsine function (\eg\ see p.~101 of \citet{daley.barker_bk01}: 
    631631 
    632632   \begin{alignat*}{2} 
     
    722722\subsection{Grid search} 
    723723 
    724 For many grids used by the \NEMO model, such as the ORCA family, the horizontal grid coordinates $i$ and $j$ are not simple functions of latitude and longitude. 
     724For many grids used by the \NEMO\ model, such as the ORCA family, the horizontal grid coordinates $i$ and $j$ are not simple functions of latitude and longitude. 
    725725Therefore, it is not always straightforward to determine the grid points surrounding any given observational position. 
    726726Before the interpolation can be performed, a search algorithm is then required to determine the corner points of 
     
    759759\end{align*} 
    760760point in the opposite direction to the unit normal $\widehat{\mathbf k}$ 
    761 (\ie that the coefficients of $\widehat{\mathbf k}$ are negative), 
     761(\ie\ that the coefficients of $\widehat{\mathbf k}$ are negative), 
    762762where ${{\mathbf r}_{}}_{\mathrm PA}$, ${{\mathbf r}_{}}_{\mathrm PB}$, etc. correspond to 
    763763the vectors between points P and A, P and B, etc.. 
     
    775775For horizontal interpolation, there is the basic problem that 
    776776the observations are unevenly distributed on the globe. 
    777 In \NEMO the model grid is divided into subgrids (or domains) where 
     777In \NEMO\ the model grid is divided into subgrids (or domains) where 
    778778each subgrid is executed on a single processing element with explicit message passing for 
    779779exchange of information along the domain boundaries when running on a massively parallel processor (MPP) system. 
     
    807807any MPP communication. 
    808808This is under the assumption that we are dealing with point observations and only using a $2 \times 2$ grid-point stencil for 
    809 the interpolation (\eg bilinear interpolation). 
     809the interpolation (\eg\ bilinear interpolation). 
    810810For higher order interpolation schemes this is no longer valid. 
    811811A disadvantage with the above scheme is that the number of observations on each processor can be very different. 
     
    844844At the bottom boundary, this is done using the land-ocean mask. 
    845845 
    846 For profile observation types we do both vertical and horizontal interpolation. \NEMO has a generalised vertical coordinate system this means the vertical level depths can vary with location. Therefore, it is necessary first to perform vertical interpolation of the model value to the observation depths for each of the four surrounding grid points. After this the model values, at these points, at the observation depth, are horizontally interpolated to the observation location. 
     846For profile observation types we do both vertical and horizontal interpolation. \NEMO\ has a generalised vertical coordinate system this means the vertical level depths can vary with location. Therefore, it is necessary first to perform vertical interpolation of the model value to the observation depths for each of the four surrounding grid points. After this the model values, at these points, at the observation depth, are horizontally interpolated to the observation location. 
    847847 
    848848\newpage 
     
    892892 
    893893The simplest way to use the executable is to edit and append the \textbf{sao.nml} namelist to 
    894 a full \NEMO namelist and then to run the executable as if it were nemo.exe. 
     894a full \NEMO\ namelist and then to run the executable as if it were nemo.exe. 
    895895 
    896896%-------------------------------------------------------------------------------------------------------- 
     
    898898%-------------------------------------------------------------------------------------------------------- 
    899899\subsection{Configuring the standalone observation operator} 
    900 The observation files and settings understood by \ngn{namobs} have been outlined in the online observation operator section. 
    901 In addition is a further namelist \ngn{namsao} which used to set the input model fields for the SAO 
     900The observation files and settings understood by \nam{obs} have been outlined in the online observation operator section. 
     901In addition is a further namelist \nam{sao} which used to set the input model fields for the SAO 
    902902 
    903903\subsubsection{Single field} 
     
    909909\textbf{votemper}, \textbf{vosaline} and optionally \textbf{sshn} present. 
    910910 
    911 For each field read there must be an entry in the \ngn{namsao} namelist specifying 
     911For each field read there must be an entry in the \nam{sao} namelist specifying 
    912912the name of the file to read and the index along the \emph{time\_counter}. 
    913913For example, to read the second time counter from a single file the namelist would be. 
     
    958958However, just to note, it is possible to extend this approach by comparing multiple forecasts, analyses, persisted analyses and 
    959959climatologies with the same set of observations. 
    960 This approach is referred to as \emph{Class 4} since it is the fourth metric defined by the GODAE intercomparison project. This requires multiple runs of the SAO and running an additional utility (not currently in the \NEMO repository) to combine the feedback files into one class 4 file. 
     960This approach is referred to as \emph{Class 4} since it is the fourth metric defined by the GODAE intercomparison project. This requires multiple runs of the SAO and running an additional utility (not currently in the \NEMO\ repository) to combine the feedback files into one class 4 file. 
    961961 
    962962\newpage 
     
    966966 
    967967For convenience some tools for viewing and processing of observation and feedback files are provided in 
    968 the \NEMO repository. 
     968the \NEMO\ repository. 
    969969These tools include OBSTOOLS which are a collection of \fortran programs which are helpful to deal with feedback files. 
    970970They do such tasks as observation file conversion, printing of file contents, 
     
    976976\subsection{Obstools} 
    977977 
    978 A series of \fortran utilities is provided with \NEMO called OBSTOOLS. 
     978A series of \fortran utilities is provided with \NEMO\ called OBSTOOLS. 
    979979This are helpful in handling observation files and the feedback file output from the observation operator. A brief description of some of the utilities follows 
    980980 
     
    10001000 
    10011001The program fbcomb combines multiple feedback files produced by individual processors in 
    1002 an MPI run of \NEMO into a single feedback file. 
     1002an MPI run of \NEMO\ into a single feedback file. 
    10031003It is called in the following way: 
    10041004 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_SBC.tex

    r11353 r11512  
    44 
    55% ================================================================ 
    6 % Chapter —— Surface Boundary Condition (SBC, SAS, ISF, ICB)  
     6% Chapter —— Surface Boundary Condition (SBC, SAS, ISF, ICB) 
    77% ================================================================ 
    88\chapter{Surface Boundary Condition (SBC, SAS, ISF, ICB)} 
    99\label{chap:SBC} 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212\newpage 
     
    3333 
    3434Four different ways are available to provide the seven fields to the ocean. They are controlled by 
    35 namelist \ngn{namsbc} variables: 
     35namelist \nam{sbc} variables: 
    3636 
    3737\begin{itemize} 
     
    4646  a user defined formulation (\np{ln\_usr}\forcode{ = .true.}). 
    4747\end{itemize} 
    48  
    4948 
    5049The frequency at which the forcing fields have to be updated is given by the \np{nn\_fsbc} namelist parameter. 
     
    8887  a neutral drag coefficient is read from an external wave model (\np{ln\_cdgw}\forcode{ = .true.}), 
    8988\item 
    90   the Stokes drift from an external wave model is accounted for (\np{ln\_sdw}\forcode{ = .true.}),  
    91 \item 
    92   the choice of the Stokes drift profile parameterization (\np{nn\_sdrift}\forcode{ = 0..2}),  
     89  the Stokes drift from an external wave model is accounted for (\np{ln\_sdw}\forcode{ = .true.}), 
     90\item 
     91  the choice of the Stokes drift profile parameterization (\np{nn\_sdrift}\forcode{ = 0..2}), 
    9392\item 
    9493  the surface stress given to the ocean is modified by surface waves (\np{ln\_tauwoc}\forcode{ = .true.}), 
     
    9897  the Stokes-Coriolis term is included (\np{ln\_stcor}\forcode{ = .true.}), 
    9998\item 
    100   the light penetration in the ocean (\np{ln\_traqsr}\forcode{ = .true.} with namelist \ngn{namtra\_qsr}), 
    101 \item 
    102   the atmospheric surface pressure gradient effect on ocean and ice dynamics (\np{ln\_apr\_dyn}\forcode{ = .true.} with namelist \ngn{namsbc\_apr}), 
     99  the light penetration in the ocean (\np{ln\_traqsr}\forcode{ = .true.} with namelist \nam{tra\_qsr}), 
     100\item 
     101  the atmospheric surface pressure gradient effect on ocean and ice dynamics (\np{ln\_apr\_dyn}\forcode{ = .true.} with namelist \nam{sbc\_apr}), 
    103102\item 
    104103  the effect of sea-ice pressure on the ocean (\np{ln\_ice\_embd}\forcode{ = .true.}). 
     
    106105 
    107106In this chapter, we first discuss where the surface boundary conditions appear in the model equations. 
    108 Then we present the three ways of providing the surface boundary conditions,  
    109 followed by the description of the atmospheric pressure and the river runoff.  
     107Then we present the three ways of providing the surface boundary conditions, 
     108followed by the description of the atmospheric pressure and the river runoff. 
    110109Next, the scheme for interpolation on the fly is described. 
    111110Finally, the different options that further modify the fluxes applied to the ocean are discussed. 
    112111One of these is modification by icebergs (see \autoref{sec:ICB_icebergs}), 
    113112which act as drifting sources of fresh water. 
    114 Another example of modification is that due to the ice shelf melting/freezing (see \autoref{sec:SBC_isf}),  
     113Another example of modification is that due to the ice shelf melting/freezing (see \autoref{sec:SBC_isf}), 
    115114which provides additional sources of fresh water. 
    116115 
     
    127126the momentum vertical mixing trend (see \autoref{eq:dynzdf_sbc} in \autoref{sec:DYN_zdf}). 
    128127As such, it has to be provided as a 2D vector interpolated onto the horizontal velocity ocean mesh, 
    129 \ie resolved onto the model (\textbf{i},\textbf{j}) direction at $u$- and $v$-points. 
     128\ie\ resolved onto the model (\textbf{i},\textbf{j}) direction at $u$- and $v$-points. 
    130129 
    131130The surface heat flux is decomposed into two parts, a non solar and a solar heat flux, 
    132131$Q_{ns}$ and $Q_{sr}$, respectively. 
    133132The former is the non penetrative part of the heat flux 
    134 (\ie the sum of sensible, latent and long wave heat fluxes plus 
     133(\ie\ the sum of sensible, latent and long wave heat fluxes plus 
    135134the heat content of the mass exchange between the ocean and sea-ice). 
    136135It is applied in \mdl{trasbc} module as a surface boundary condition trend of 
     
    141140\np{ln\_traqsr}\forcode{ = .true.}. 
    142141The way the light penetrates inside the water column is generally a sum of decreasing exponentials 
    143 (see \autoref{subsec:TRA_qsr}).  
     142(see \autoref{subsec:TRA_qsr}). 
    144143 
    145144The surface freshwater budget is provided by the \textit{emp} field. 
     
    148147It affects the ocean in two different ways: 
    149148$(i)$  it changes the volume of the ocean, and therefore appears in the sea surface height equation as      %GS: autoref ssh equation to be added 
    150 a volume flux, and  
     149a volume flux, and 
    151150$(ii)$ it changes the surface temperature and salinity through the heat and salt contents of 
    152151the mass exchanged with atmosphere, sea-ice and ice shelves. 
     
    155154%\colorbox{yellow}{Miss: } 
    156155% 
    157 %A extensive description of all namsbc namelist (parameter that have to be  
     156%A extensive description of all namsbc namelist (parameter that have to be 
    158157%created!) 
    159158% 
    160 %Especially the \np{nn\_fsbc}, the \mdl{sbc\_oce} module (fluxes + mean sst sss ssu  
    161 %ssv) \ie information required by flux computation or sea-ice 
     159%Especially the \np{nn\_fsbc}, the \mdl{sbc\_oce} module (fluxes + mean sst sss ssu 
     160%ssv) \ie\ information required by flux computation or sea-ice 
    162161% 
    163 %\mdl{sbc\_oce} containt the definition in memory of the 7 fields (6+runoff), add  
     162%\mdl{sbc\_oce} containt the definition in memory of the 7 fields (6+runoff), add 
    164163%a word on runoff: included in surface bc or add as lateral obc{\ldots}. 
    165164% 
    166165%Sbcmod manage the ``providing'' (fourniture) to the ocean the 7 fields 
    167166% 
    168 %Fluxes update only each nf{\_}sbc time step (namsbc) explain relation  
    169 %between nf{\_}sbc and nf{\_}ice, do we define nf{\_}blk??? ? only one  
    170 %nf{\_}sbc 
     167%Fluxes update only each nf\_sbc time step (namsbc) explain relation 
     168%between nf\_sbc and nf\_ice, do we define nf\_blk??? ? only one 
     169%nf\_sbc 
    171170% 
    172171%Explain here all the namlist namsbc variable{\ldots}. 
    173 %  
     172% 
    174173% explain : use or not of surface currents 
    175174% 
     
    177176 
    178177The ocean model provides, at each time step, to the surface module (\mdl{sbcmod}) 
    179 the surface currents, temperature and salinity.   
     178the surface currents, temperature and salinity. 
    180179These variables are averaged over \np{nn\_fsbc} time-step (\autoref{tab:ssm}), and 
    181180these averaged fields are used to compute the surface fluxes at the frequency of \np{nn\_fsbc} time-steps. 
     
    197196      Ocean variables provided by the ocean to the surface module (SBC). 
    198197      The variable are averaged over \np{nn\_fsbc} time-step, 
    199       \ie the frequency of computation of surface fluxes. 
     198      \ie\ the frequency of computation of surface fluxes. 
    200199    } 
    201200  \end{center} 
     
    203202%-------------------------------------------------------------------------------------------------------------- 
    204203 
    205 %\colorbox{yellow}{Penser a} mettre dans le restant l'info nn{\_}fsbc ET nn{\_}fsbc*rdt de sorte de reinitialiser la moyenne si on change la frequence ou le pdt 
    206  
    207  
    208  
    209 % ================================================================ 
    210 %       Input Data  
     204%\colorbox{yellow}{Penser a} mettre dans le restant l'info nn\_fsbc ET nn\_fsbc*rdt de sorte de reinitialiser la moyenne si on change la frequence ou le pdt 
     205 
     206 
     207 
     208% ================================================================ 
     209%       Input Data 
    211210% ================================================================ 
    212211\section{Input data generic interface} 
     
    216215(2D or 3D fields, like surface forcing or ocean T and S) are specified in \NEMO. 
    217216This task is achieved by \mdl{fldread}. 
    218 The module is designed with four main objectives in mind:  
     217The module is designed with four main objectives in mind: 
    219218\begin{enumerate} 
    220219\item 
     
    227226\item 
    228227  provide a simple user interface and a rather simple developer interface by 
    229   limiting the number of prerequisite informations.  
     228  limiting the number of prerequisite informations. 
    230229\end{enumerate} 
    231230 
     
    238237and simply call \rou{fld\_read} to obtain the desired input field at the model time-step and grid points. 
    239238 
    240 The only constraints are that the input file is a NetCDF file, the file name follows a nomenclature  
     239The only constraints are that the input file is a NetCDF file, the file name follows a nomenclature 
    241240(see \autoref{subsec:SBC_fldread}), the period it cover is one year, month, week or day, and, 
    242241if on-the-fly interpolation is used, a file of weights must be supplied (see \autoref{subsec:SBC_iof}). 
     
    256255The structure associated with an input variable contains the following information: 
    257256\begin{forlines} 
    258 !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !  
     257!  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    259258!             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    260259\end{forlines} 
    261 where  
    262 \begin{description}   
     260where 
     261\begin{description} 
    263262\item[File name]: 
    264263  the stem name of the NetCDF file to be opened. 
    265264  This stem will be completed automatically by the model, with the addition of a '.nc' at its end and 
    266265  by date information and possibly a prefix (when using AGRIF). 
    267   Tab.\autoref{tab:fldread} provides the resulting file name in all possible cases according to 
     266  \autoref{tab:fldread} provides the resulting file name in all possible cases according to 
    268267  whether it is a climatological file or not, and to the open/close frequency (see below for definition). 
    269268 
     
    283282      The stem name is assumed to be 'fn'. 
    284283      For weekly files, the 'LLL' corresponds to the first three letters of the first day of the week 
    285       (\ie 'sun','sat','fri','thu','wed','tue','mon'). 
     284      (\ie\ 'sun','sat','fri','thu','wed','tue','mon'). 
    286285      The 'YYYY', 'MM' and 'DD' should be replaced by the actual year/month/day, always coded with 4 or 2 digits. 
    287286      Note that (1) in mpp, if the file is split over each subdomain, the suffix '.nc' is replaced by '\_PPPP.nc', 
     
    291290  \end{table} 
    292291%-------------------------------------------------------------------------------------------------------------- 
    293    
     292 
    294293 
    295294\item[Record frequency]: 
     
    311310  Records are assumed to be dated at the middle of the forcing period. 
    312311  For example, when using a daily forcing with time interpolation, 
    313   linear interpolation will be performed between mid-day of two consecutive days.  
     312  linear interpolation will be performed between mid-day of two consecutive days. 
    314313 
    315314\item[Climatological forcing]: 
     
    317316  or an interannual forcing which will requires additional files if 
    318317  the period covered by the simulation exceeds the one of the file. 
    319   See the above file naming strategy which impacts the expected name of the file to be opened.  
     318  See the above file naming strategy which impacts the expected name of the file to be opened. 
    320319 
    321320\item[Open/close frequency]: 
     
    345344For example with \np{nn\_fsbc}\forcode{ = 3}, the surface module will be called at time-steps 1, 4, 7, etc. 
    346345The date used for the time interpolation is thus redefined to the middle of \np{nn\_fsbc} time-step period. 
    347 In the previous example, this leads to: 1h30'00", 4h30'00", 7h30'00", etc. \\  
     346In the previous example, this leads to: 1h30'00", 4h30'00", 7h30'00", etc. \\ 
    348347(2) For code readablility and maintenance issues, we don't take into account the NetCDF input file calendar. 
    349348The calendar associated with the forcing field is build according to the information provided by 
     
    353352(3) If a time interpolation is requested, the code will pick up the needed data in the previous (next) file when 
    354353interpolating data with the first (last) record of the open/close period. 
    355 For example, if the input file specifications are ''yearly, containing daily data to be interpolated in time'',  
     354For example, if the input file specifications are ''yearly, containing daily data to be interpolated in time'', 
    356355the values given by the code between 00h00'00" and 11h59'59" on Jan 1st will be interpolated values between 
    357356Dec 31st 12h00'00" and Jan 1st 12h00'00". 
     
    365364we do accept that the file related to year Y-1 is not existing. 
    366365The value of Jan 1st will be used as the missing one for Dec 31st of year Y-1. 
    367 If the file of year Y-1 exists, the code will read its last record.  
     366If the file of year Y-1 exists, the code will read its last record. 
    368367Therefore, this file can contain only one record corresponding to Dec 31st, 
    369368a useful feature for user considering that it is too heavy to manipulate the complete file for year Y-1. 
     
    488487\label{subsec:SBC_iof_lim} 
    489488 
    490 \begin{enumerate}   
     489\begin{enumerate} 
    491490\item 
    492491  The case where input data grids are not logically rectangular (irregular grid case) has not been tested. 
     
    524523 
    525524In some circumstances, it may be useful to avoid calculating the 3D temperature, 
    526 salinity and velocity fields and simply read them in from a previous run or receive them from OASIS.   
     525salinity and velocity fields and simply read them in from a previous run or receive them from OASIS. 
    527526For example: 
    528527 
     
    542541 
    543542The Standalone Surface scheme provides this capacity. 
    544 Its options are defined through the \ngn{namsbc\_sas} namelist variables. 
     543Its options are defined through the \nam{sbc\_sas} namelist variables. 
    545544A new copy of the model has to be compiled with a configuration based on ORCA2\_SAS\_LIM. 
    546 However, no namelist parameters need be changed from the settings of the previous run (except perhaps nn{\_}date0). 
     545However, no namelist parameters need be changed from the settings of the previous run (except perhaps nn\_date0). 
    547546In this configuration, a few routines in the standard model are overriden by new versions. 
    548547Routines replaced are: 
     
    560559  This has been cut down and now only calculates surface forcing and the ice model required. 
    561560  New surface modules that can function when only the surface level of the ocean state is defined can also be added 
    562   (\eg icebergs). 
     561  (\eg\ icebergs). 
    563562\item 
    564563  \mdl{daymod}: 
     
    566565  so calls to restart functions have been removed. 
    567566  This also means that the calendar cannot be controlled by time in a restart file, 
    568   so the user must check that nn{\_}date0 in the model namelist is correct for his or her purposes. 
     567  so the user must check that nn\_date0 in the model namelist is correct for his or her purposes. 
    569568\item 
    570569  \mdl{stpctl}: 
     
    584583  This module initialises the input files needed for reading temperature, salinity and 
    585584  velocity arrays at the surface. 
    586   These filenames are supplied in namelist namsbc{\_}sas. 
     585  These filenames are supplied in namelist namsbc\_sas. 
    587586  Unfortunately, because of limitations with the \mdl{iom} module, 
    588587  the full 3D fields from the mean files have to be read in and interpolated in time, 
     
    592591 
    593592 
    594 The user can also choose in the \ngn{namsbc\_sas} namelist to read the mean (nn\_fsbc time-step) fraction of solar net radiation absorbed in the 1st T level using 
     593The user can also choose in the \nam{sbc\_sas} namelist to read the mean (nn\_fsbc time-step) fraction of solar net radiation absorbed in the 1st T level using 
    595594 (\np{ln\_flx}\forcode{ = .true.}) and to provide 3D oceanic velocities instead of 2D ones (\np{ln\_flx}\forcode{ = .true.}). In that last case, only the 1st level will be read in. 
    596595 
     
    598597 
    599598% ================================================================ 
    600 % Flux formulation  
     599% Flux formulation 
    601600% ================================================================ 
    602601\section[Flux formulation (\textit{sbcflx.F90})] 
     
    605604%------------------------------------------namsbc_flx---------------------------------------------------- 
    606605 
    607 \nlst{namsbc_flx}  
     606\nlst{namsbc_flx} 
    608607%------------------------------------------------------------------------------------------------------------- 
    609608 
    610609In the flux formulation (\np{ln\_flx}\forcode{ = .true.}), 
    611610the surface boundary condition fields are directly read from input files. 
    612 The user has to define in the namelist \ngn{namsbc{\_}flx} the name of the file, 
     611The user has to define in the namelist \nam{sbc\_flx} the name of the file, 
    613612the name of the variable read in the file, the time frequency at which it is given (in hours), 
    614613and a logical setting whether a time interpolation to the model time step is required for this field. 
     
    631630%-------------------------------------------------------------------------------------------------------------- 
    632631 
    633 In the bulk formulation, the surface boundary condition fields are computed with bulk formulae using atmospheric fields  
     632In the bulk formulation, the surface boundary condition fields are computed with bulk formulae using atmospheric fields 
    634633and ocean (and sea-ice) variables averaged over \np{nn\_fsbc} time-step. 
    635634 
     
    637636In forced mode, when a sea-ice model is used, a specific bulk formulation is used. 
    638637Therefore, different bulk formulae are used for the turbulent fluxes computation 
    639 over the ocean and over sea-ice surface.  
    640 For the ocean, four bulk formulations are available thanks to the \href{https://brodeau.github.io/aerobulk/}{Aerobulk} package (\citet{brodeau.barnier.ea_JPO16}):  
     638over the ocean and over sea-ice surface. 
     639For the ocean, four bulk formulations are available thanks to the \href{https://brodeau.github.io/aerobulk/}{Aerobulk} package (\citet{brodeau.barnier.ea_JPO16}): 
    641640the NCAR (formerly named CORE), COARE 3.0, COARE 3.5 and ECMWF bulk formulae. 
    642641The choice is made by setting to true one of the following namelist variable: 
     
    645644a constant transfer coefficient (1.4e-3; default value), \citet{lupkes.gryanik.ea_JGR12} (\np{ln\_Cd\_L12}), and \citet{lupkes.gryanik_JGR15} (\np{ln\_Cd\_L15}) parameterizations 
    646645 
    647 Common options are defined through the \ngn{namsbc\_blk} namelist variables. 
     646Common options are defined through the \nam{sbc\_blk} namelist variables. 
    648647The required 9 input fields are: 
    649648 
     
    675674The \np{sn\_wndi}, \np{sn\_wndj}, \np{sn\_qsr}, \np{sn\_qlw}, \np{sn\_tair}, \np{sn\_humi}, \np{sn\_prec}, 
    676675\np{sn\_snow}, \np{sn\_tdif} parameters describe the fields and the way they have to be used 
    677 (spatial and temporal interpolations).  
     676(spatial and temporal interpolations). 
    678677 
    679678\np{cn\_dir} is the directory of location of bulk files 
     
    682681\np{rn\_zu}: is the height of wind measurements (m) 
    683682 
    684 Three multiplicative factors are available:  
     683Three multiplicative factors are available: 
    685684\np{rn\_pfac} and \np{rn\_efac} allow to adjust (if necessary) the global freshwater budget by 
    686685increasing/reducing the precipitations (total and snow) and or evaporation, respectively. 
     
    690689 
    691690As for the flux formulation, information about the input data required by the model is provided in 
    692 the namsbc\_blk namelist (see \autoref{subsec:SBC_fldread}).  
     691the namsbc\_blk namelist (see \autoref{subsec:SBC_fldread}). 
    693692 
    694693 
     
    696695%        Ocean-Atmosphere Bulk formulae 
    697696% ------------------------------------------------------------------------------------------------------------- 
    698 \subsection{Ocean-Atmosphere Bulk formulae} 
    699 %\subsection[Ocean-Atmosphere Bulk formulae (\textit{sbcblk_algo\{\_ncar,\_coare,\_coare3p5,\_ecmwf}.F90})] 
     697\subsection[Ocean-Atmosphere Bulk formulae (\textit{sbcblk\_algo\_coare.F90, sbcblk\_algo\_coare3p5.F90, 
     698sbcblk\_algo\_ecmwf.F90, sbcblk\_algo\_ncar.F90})] 
     699{Ocean-Atmosphere Bulk formulae (\mdl{sbcblk\_algo\_coare}, \mdl{sbcblk\_algo\_coare3p5}, 
     700\mdl{sbcblk\_algo\_ecmwf}, \mdl{sbcblk\_algo\_ncar})} 
    700701\label{subsec:SBC_blk_ocean} 
    701702 
    702703Four different bulk algorithms are available to compute surface turbulent momentum and heat fluxes over the ocean. 
    703 COARE 3.0, COARE 3.5 and ECMWF schemes mainly differ by their roughness lenghts computation and consequently  
     704COARE 3.0, COARE 3.5 and ECMWF schemes mainly differ by their roughness lenghts computation and consequently 
    704705their neutral transfer coefficients relationships with neutral wind. 
    705706\begin{itemize} 
     
    715716  This is the so-called DRAKKAR Forcing Set (DFS) \citep{brodeau.barnier.ea_OM10}. 
    716717\item 
    717   COARE 3.0 (\np{ln\_COARE\_3p0}\forcode{ = .true.}):  
     718  COARE 3.0 (\np{ln\_COARE\_3p0}\forcode{ = .true.}): 
    718719  See \citet{fairall.bradley.ea_JC03} for more details 
    719720\item 
    720   COARE 3.5 (\np{ln\_COARE\_3p5}\forcode{ = .true.}):  
     721  COARE 3.5 (\np{ln\_COARE\_3p5}\forcode{ = .true.}): 
    721722  See \citet{edson.jampana.ea_JPO13} for more details 
    722723\item 
    723   ECMWF (\np{ln\_ECMWF}\forcode{ = .true.}):  
     724  ECMWF (\np{ln\_ECMWF}\forcode{ = .true.}): 
    724725  Based on \href{https://www.ecmwf.int/node/9221}{IFS (Cy31)} implementation and documentation. 
    725726  Surface roughness lengths needed for the Obukhov length are computed following \citet{beljaars_QJRMS95}. 
    726727\end{itemize} 
    727728 
    728  
    729729% ------------------------------------------------------------------------------------------------------------- 
    730730%        Ice-Atmosphere Bulk formulae 
    731731% ------------------------------------------------------------------------------------------------------------- 
    732 \subsection{ Ice-Atmosphere Bulk formulae } 
     732\subsection{Ice-Atmosphere Bulk formulae} 
    733733\label{subsec:SBC_blk_ice} 
    734734 
     
    742742  \citet{lupkes.gryanik.ea_JGR12} (\np{ln\_Cd\_L12}\forcode{ = .true.}): 
    743743  This scheme adds a dependency on edges at leads, melt ponds and flows 
    744   of the constant neutral air-ice drag. After some approximations,  
     744  of the constant neutral air-ice drag. After some approximations, 
    745745  this can be resumed to a dependency on ice concentration (A). 
    746746  This drag coefficient has a parabolic shape (as a function of ice concentration) 
     
    749749\item 
    750750  \citet{lupkes.gryanik_JGR15} (\np{ln\_Cd\_L15}\forcode{ = .true.}): 
    751   Alternative turbulent transfer coefficients formulation between sea-ice  
    752   and atmosphere with distinct momentum and heat coefficients depending  
     751  Alternative turbulent transfer coefficients formulation between sea-ice 
     752  and atmosphere with distinct momentum and heat coefficients depending 
    753753  on sea-ice concentration and atmospheric stability (no melt-ponds effect for now). 
    754754  The parameterization is adapted from ECHAM6 atmospheric model. 
     
    768768%------------------------------------------namsbc_cpl---------------------------------------------------- 
    769769 
    770 \nlst{namsbc_cpl}  
     770\nlst{namsbc_cpl} 
    771771%------------------------------------------------------------------------------------------------------------- 
    772772 
     
    779779It is currently interfaced with OASIS-3-MCT versions 1 to 4 (\key{oasis3}). 
    780780An additional specific CPP key (\key{oa3mct\_v1v2}) is needed for OASIS-3-MCT versions 1 and 2. 
    781 It has been successfully used to interface \NEMO to most of the European atmospheric GCM 
     781It has been successfully used to interface \NEMO\ to most of the European atmospheric GCM 
    782782(ARPEGE, ECHAM, ECMWF, HadAM, HadGAM, LMDz), as well as to \href{http://wrf-model.org/}{WRF} 
    783783(Weather Research and Forecasting Model). 
    784784 
    785 When PISCES biogeochemical model (\key{top}) is also used in the coupled system,  
     785When PISCES biogeochemical model (\key{top}) is also used in the coupled system, 
    786786the whole carbon cycle is computed. 
    787787In this case, CO$_2$ fluxes will be exchanged between the atmosphere and the ice-ocean system 
    788 (and need to be activated in \ngn{namsbc{\_}cpl} ). 
     788(and need to be activated in \nam{sbc\_cpl} ). 
    789789 
    790790The namelist above allows control of various aspects of the coupling fields (particularly for vectors) and 
    791791now allows for any coupling fields to have multiple sea ice categories (as required by LIM3 and CICE). 
    792 When indicating a multi-category coupling field in \ngn{namsbc{\_}cpl}, the number of categories will be determined by 
     792When indicating a multi-category coupling field in \nam{sbc\_cpl}, the number of categories will be determined by 
    793793the number used in the sea ice model. 
    794794In some limited cases, it may be possible to specify single category coupling fields even when 
     
    807807%------------------------------------------namsbc_apr---------------------------------------------------- 
    808808 
    809 \nlst{namsbc_apr}  
     809\nlst{namsbc_apr} 
    810810%------------------------------------------------------------------------------------------------------------- 
    811811 
    812812The optional atmospheric pressure can be used to force ocean and ice dynamics 
    813 (\np{ln\_apr\_dyn}\forcode{ = .true.}, \ngn{namsbc} namelist). 
    814 The input atmospheric forcing defined via \np{sn\_apr} structure (\ngn{namsbc\_apr} namelist) 
     813(\np{ln\_apr\_dyn}\forcode{ = .true.}, \nam{sbc} namelist). 
     814The input atmospheric forcing defined via \np{sn\_apr} structure (\nam{sbc\_apr} namelist) 
    815815can be interpolated in time to the model time step, and even in space when the interpolation on-the-fly is used. 
    816816When used to force the dynamics, the atmospheric pressure is further transformed into 
     
    823823A value of $101,000~N/m^2$ is used unless \np{ln\_ref\_apr} is set to true. 
    824824In this case, $P_o$ is set to the value of $P_{atm}$ averaged over the ocean domain, 
    825 \ie the mean value of $\eta_{ib}$ is kept to zero at all time steps. 
     825\ie\ the mean value of $\eta_{ib}$ is kept to zero at all time steps. 
    826826 
    827827The gradient of $\eta_{ib}$ is added to the RHS of the ocean momentum equation (see \mdl{dynspg} for the ocean). 
     
    833833 
    834834When using time-splitting and BDY package for open boundaries conditions, 
    835 the equivalent inverse barometer sea surface height $\eta_{ib}$ can be added to BDY ssh data:  
     835the equivalent inverse barometer sea surface height $\eta_{ib}$ can be added to BDY ssh data: 
    836836\np{ln\_apr\_obc}  might be set to true. 
    837837 
     
    851851 
    852852The tidal forcing, generated by the gravity forces of the Earth-Moon and Earth-Sun sytems, 
    853 is activated if \np{ln\_tide} and \np{ln\_tide\_pot} are both set to \forcode{.true.} in \ngn{nam\_tide}. 
     853is activated if \np{ln\_tide} and \np{ln\_tide\_pot} are both set to \forcode{.true.} in \nam{\_tide}. 
    854854This translates as an additional barotropic force in the momentum equations \ref{eq:PE_dyn} such that: 
    855855\[ 
     
    860860where $\Pi_{eq}$ stands for the equilibrium tidal forcing and 
    861861$\Pi_{sal}$ is a self-attraction and loading term (SAL). 
    862   
     862 
    863863The equilibrium tidal forcing is expressed as a sum over a subset of 
    864864constituents chosen from the set of available tidal constituents 
    865 defined in file \textit{SBC/tide.h90} (this comprises the tidal 
     865defined in file \hf{SBC/tide} (this comprises the tidal 
    866866constituents \textit{M2, N2, 2N2, S2, K2, K1, O1, Q1, P1, M4, Mf, Mm, 
    867867  Msqm, Mtm, S1, MU2, NU2, L2}, and \textit{T2}). Individual 
    868868constituents are selected by including their names in the array 
    869 \np{clname} in \ngn{nam\_tide} (e.g., \np{clname(1) = 'M2', 
    870   clname(2)='S2'} to select solely the tidal consituents \textit{M2} 
     869\np{clname} in \nam{\_tide} (e.g., \np{clname}\forcode{(1) = 'M2', } 
     870\np{clname}\forcode{(2) = 'S2'} to select solely the tidal consituents \textit{M2} 
    871871and \textit{S2}). Optionally, when \np{ln\_tide\_ramp} is set to 
    872872\forcode{.true.}, the equilibrium tidal forcing can be ramped up 
     
    880880computationally too expensive. Here, two options are available: 
    881881$\Pi_{sal}$ generated by an external model can be read in 
    882 (\np{ln\_read\_load=.true.}), or a ``scalar approximation'' can be 
    883 used (\np{ln\_scal\_load=.true.}). In the latter case 
     882(\np{ln\_read\_load}\forcode{ =.true.}), or a ``scalar approximation'' can be 
     883used (\np{ln\_scal\_load}\forcode{ =.true.}). In the latter case 
    884884\[ 
    885885  \Pi_{sal} = \beta \eta, 
     
    900900%------------------------------------------namsbc_rnf---------------------------------------------------- 
    901901 
    902 \nlst{namsbc_rnf}  
     902\nlst{namsbc_rnf} 
    903903%------------------------------------------------------------------------------------------------------------- 
    904904 
    905 %River runoff generally enters the ocean at a nonzero depth rather than through the surface.  
     905%River runoff generally enters the ocean at a nonzero depth rather than through the surface. 
    906906%Many models, however, have traditionally inserted river runoff to the top model cell. 
    907 %This was the case in \NEMO prior to the version 3.3. The switch toward a input of runoff  
    908 %throughout a nonzero depth has been motivated by the numerical and physical problems  
    909 %that arise when the top grid cells are of the order of one meter. This situation is common in  
    910 %coastal modelling and becomes more and more often open ocean and climate modelling  
     907%This was the case in \NEMO\ prior to the version 3.3. The switch toward a input of runoff 
     908%throughout a nonzero depth has been motivated by the numerical and physical problems 
     909%that arise when the top grid cells are of the order of one meter. This situation is common in 
     910%coastal modelling and becomes more and more often open ocean and climate modelling 
    911911%\footnote{At least a top cells thickness of 1~meter and a 3 hours forcing frequency are 
    912912%required to properly represent the diurnal cycle \citep{bernie.woolnough.ea_JC05}. see also \autoref{fig:SBC_dcy}.}. 
    913913 
    914914 
    915 %To do this we need to treat evaporation/precipitation fluxes and river runoff differently in the  
    916 %\mdl{tra\_sbc} module.  We decided to separate them throughout the code, so that the variable  
    917 %\textit{emp} represented solely evaporation minus precipitation fluxes, and a new 2d variable  
    918 %rnf was added which represents the volume flux of river runoff (in kg/m2s to remain consistent with  
    919 %emp).  This meant many uses of emp and emps needed to be changed, a list of all modules which use  
     915%To do this we need to treat evaporation/precipitation fluxes and river runoff differently in the 
     916%\mdl{tra\_sbc} module.  We decided to separate them throughout the code, so that the variable 
     917%\textit{emp} represented solely evaporation minus precipitation fluxes, and a new 2d variable 
     918%rnf was added which represents the volume flux of river runoff (in kg/m2s to remain consistent with 
     919%emp).  This meant many uses of emp and emps needed to be changed, a list of all modules which use 
    920920%emp or emps and the changes made are below: 
    921921 
     
    924924River runoff generally enters the ocean at a nonzero depth rather than through the surface. 
    925925Many models, however, have traditionally inserted river runoff to the top model cell. 
    926 This was the case in \NEMO prior to the version 3.3, 
     926This was the case in \NEMO\ prior to the version 3.3, 
    927927and was combined with an option to increase vertical mixing near the river mouth. 
    928928 
    929929However, with this method numerical and physical problems arise when the top grid cells are of the order of one meter. 
    930 This situation is common in coastal modelling and is becoming more common in open ocean and climate modelling  
     930This situation is common in coastal modelling and is becoming more common in open ocean and climate modelling 
    931931\footnote{ 
    932932  At least a top cells thickness of 1~meter and a 3 hours forcing frequency are required to 
     
    939939along with the depth (in metres) which the river should be added to. 
    940940 
    941 Namelist variables in \ngn{namsbc\_rnf}, \np{ln\_rnf\_depth}, \np{ln\_rnf\_sal} and 
     941Namelist variables in \nam{sbc\_rnf}, \np{ln\_rnf\_depth}, \np{ln\_rnf\_sal} and 
    942942\np{ln\_rnf\_temp} control whether the river attributes (depth, salinity and temperature) are read in and used. 
    943943If these are set as false the river is added to the surface box only, assumed to be fresh (0~psu), 
    944944and/or taken as surface temperature respectively. 
    945945 
    946 The runoff value and attributes are read in in sbcrnf.   
     946The runoff value and attributes are read in in sbcrnf. 
    947947For temperature -999 is taken as missing data and the river temperature is taken to 
    948948be the surface temperatue at the river point. 
    949 For the depth parameter a value of -1 means the river is added to the surface box only,  
    950 and a value of -999 means the river is added through the entire water column.  
     949For the depth parameter a value of -1 means the river is added to the surface box only, 
     950and a value of -999 means the river is added through the entire water column. 
    951951After being read in the temperature and salinity variables are multiplied by the amount of runoff 
    952952(converted into m/s) to give the heat and salt content of the river runoff. 
     
    955955The variable \textit{h\_dep} is then calculated to be the depth (in metres) of 
    956956the bottom of the lowest box the river water is being added to 
    957 (\ie the total depth that river water is being added to in the model). 
     957(\ie\ the total depth that river water is being added to in the model). 
    958958 
    959959The mass/volume addition due to the river runoff is, at each relevant depth level, added to 
     
    961961This increases the diffusion term in the vicinity of the river, thereby simulating a momentum flux. 
    962962The sea surface height is calculated using the sum of the horizontal divergence terms, 
    963 and so the river runoff indirectly forces an increase in sea surface height.  
     963and so the river runoff indirectly forces an increase in sea surface height. 
    964964 
    965965The \textit{hdivn} terms are used in the tracer advection modules to force vertical velocities. 
     
    983983This is done in the same way for both vvl and non-vvl. 
    984984The temperature and salinity are increased through the specified depth according to 
    985 the heat and salt content of the river.  
     985the heat and salt content of the river. 
    986986 
    987987In the non-linear free surface case (vvl), 
     
    992992 
    993993It is also possible for runnoff to be specified as a negative value for modelling flow through straits, 
    994 \ie modelling the Baltic flow in and out of the North Sea. 
     994\ie\ modelling the Baltic flow in and out of the North Sea. 
    995995When the flow is out of the domain there is no change in temperature and salinity, 
    996996regardless of the namelist options used, 
    997 as the ocean water leaving the domain removes heat and salt (at the same concentration) with it.  
    998  
    999  
    1000 %\colorbox{yellow}{Nevertheless, Pb of vertical resolution and 3D input : increase vertical mixing near river mouths to mimic a 3D river  
     997as the ocean water leaving the domain removes heat and salt (at the same concentration) with it. 
     998 
     999 
     1000%\colorbox{yellow}{Nevertheless, Pb of vertical resolution and 3D input : increase vertical mixing near river mouths to mimic a 3D river 
    10011001 
    10021002%All river runoff and emp fluxes are assumed to be fresh water (zero salinity) and at the same temperature as the sea surface.} 
     
    10101010%\gmcomment{  word doc of runoffs: 
    10111011% 
    1012 %In the current \NEMO setup river runoff is added to emp fluxes, these are then applied at just the sea surface as a volume change (in the variable volume case this is a literal volume change, and in the linear free surface case the free surface is moved) and a salt flux due to the concentration/dilution effect.  There is also an option to increase vertical mixing near river mouths; this gives the effect of having a 3d river.  All river runoff and emp fluxes are assumed to be fresh water (zero salinity) and at the same temperature as the sea surface. 
    1013 %Our aim was to code the option to specify the temperature and salinity of river runoff, (as well as the amount), along with the depth that the river water will affect.  This would make it possible to model low salinity outflow, such as the Baltic, and would allow the ocean temperature to be affected by river runoff.   
     1012%In the current \NEMO\ setup river runoff is added to emp fluxes, these are then applied at just the sea surface as a volume change (in the variable volume case this is a literal volume change, and in the linear free surface case the free surface is moved) and a salt flux due to the concentration/dilution effect.  There is also an option to increase vertical mixing near river mouths; this gives the effect of having a 3d river.  All river runoff and emp fluxes are assumed to be fresh water (zero salinity) and at the same temperature as the sea surface. 
     1013%Our aim was to code the option to specify the temperature and salinity of river runoff, (as well as the amount), along with the depth that the river water will affect.  This would make it possible to model low salinity outflow, such as the Baltic, and would allow the ocean temperature to be affected by river runoff. 
    10141014 
    10151015%The depth option makes it possible to have the river water affecting just the surface layer, throughout depth, or some specified point in between. 
     
    10301030%-------------------------------------------------------------------------------------------------------- 
    10311031 
    1032 The namelist variable in \ngn{namsbc}, \np{nn\_isf}, controls the ice shelf representation. 
    1033 Description and result of sensitivity test to \np{nn\_isf} are presented in \citet{mathiot.jenkins.ea_GMD17}.  
     1032The namelist variable in \nam{sbc}, \np{nn\_isf}, controls the ice shelf representation. 
     1033Description and result of sensitivity test to \np{nn\_isf} are presented in \citet{mathiot.jenkins.ea_GMD17}. 
    10341034The different options are illustrated in \autoref{fig:SBC_isf}. 
    10351035 
     
    10391039  The ice shelf cavity is represented (\np{ln\_isfcav}\forcode{ = .true.} needed). 
    10401040  The fwf and heat flux are depending of the local water properties. 
    1041    
     1041 
    10421042  Two different bulk formulae are available: 
    10431043 
     
    10481048   \item[\np{nn\_isfblk}\forcode{ = 2}]: 
    10491049     The melt rate and the heat flux are based on a 3 equations formulation 
    1050      (a heat flux budget at the ice base, a salt flux budget at the ice base and a linearised freezing point temperature equation).  
     1050     (a heat flux budget at the ice base, a salt flux budget at the ice base and a linearised freezing point temperature equation). 
    10511051     A complete description is available in \citet{jenkins_JGR91}. 
    10521052   \end{description} 
    10531053 
    1054      Temperature and salinity used to compute the melt are the average temperature in the top boundary layer \citet{losch_JGR08}.  
     1054     Temperature and salinity used to compute the melt are the average temperature in the top boundary layer \citet{losch_JGR08}. 
    10551055     Its thickness is defined by \np{rn\_hisf\_tbl}. 
    10561056     The fluxes and friction velocity are computed using the mean temperature, salinity and velocity in the the first \np{rn\_hisf\_tbl} m. 
     
    10601060     If \np{rn\_hisf\_tbl} smaller than top $e_{3}t$, the top boundary layer thickness is set to the top cell thickness.\\ 
    10611061 
    1062      Each melt bulk formula depends on a exchange coeficient ($\Gamma^{T,S}$) between the ocean and the ice.  
     1062     Each melt bulk formula depends on a exchange coeficient ($\Gamma^{T,S}$) between the ocean and the ice. 
    10631063     There are 3 different ways to compute the exchange coeficient: 
    10641064   \begin{description} 
    10651065        \item[\np{nn\_gammablk}\forcode{ = 0}]: 
    1066      The salt and heat exchange coefficients are constant and defined by \np{rn\_gammas0} and \np{rn\_gammat0}.  
     1066     The salt and heat exchange coefficients are constant and defined by \np{rn\_gammas0} and \np{rn\_gammat0}. 
    10671067\[ 
    10681068  % \label{eq:sbc_isf_gamma_iso} 
     
    10761076     The salt and heat exchange coefficients are velocity dependent and defined as 
    10771077\[ 
    1078 \gamma^{T} = \np{rn\_gammat0} \times u_{*}  
     1078\gamma^{T} = \np{rn\_gammat0} \times u_{*} 
    10791079\] 
    10801080\[ 
     
    10861086     The salt and heat exchange coefficients are velocity and stability dependent and defined as: 
    10871087\[ 
    1088 \gamma^{T,S} = \frac{u_{*}}{\Gamma_{Turb} + \Gamma^{T,S}_{Mole}}  
     1088\gamma^{T,S} = \frac{u_{*}}{\Gamma_{Turb} + \Gamma^{T,S}_{Mole}} 
    10891089\] 
    10901090     where $u_{*}$ is the friction velocity in the top boundary layer (ie first \np{rn\_hisf\_tbl} meters), 
    10911091     $\Gamma_{Turb}$ the contribution of the ocean stability and 
    10921092     $\Gamma^{T,S}_{Mole}$ the contribution of the molecular diffusion. 
    1093      See \citet{holland.jenkins_JPO99} for all the details on this formulation.  
    1094      This formulation has not been extensively tested in NEMO (not recommended). 
     1093     See \citet{holland.jenkins_JPO99} for all the details on this formulation. 
     1094     This formulation has not been extensively tested in \NEMO\ (not recommended). 
    10951095   \end{description} 
    10961096  \item[\np{nn\_isf}\forcode{ = 2}]: 
     
    11231123This can be useful if the water masses on the shelf are not realistic or 
    11241124the resolution (horizontal/vertical) are too coarse to have realistic melting or 
    1125 for studies where you need to control your heat and fw input.\\  
     1125for studies where you need to control your heat and fw input.\\ 
    11261126 
    11271127The ice shelf melt is implemented as a volume flux as for the runoff. 
     
    11601160\item[Step 1]: the ice sheet model send a new bathymetry and ice shelf draft netcdf file. 
    11611161\item[Step 2]: a new domcfg.nc file is built using the DOMAINcfg tools. 
    1162 \item[Step 3]: NEMO run for a specific period and output the average melt rate over the period. 
     1162\item[Step 3]: \NEMO\ run for a specific period and output the average melt rate over the period. 
    11631163\item[Step 4]: the ice sheet model run using the melt rate outputed in step 4. 
    11641164\item[Step 5]: go back to 1. 
     
    11781178  mask, T/S, U/V and ssh are set to 0. 
    11791179  Furthermore, U/V into the water column are modified to satisfy ($bt_b=bt_n$). 
    1180 \item[Wet a cell]:  
     1180\item[Wet a cell]: 
    11811181  mask is set to 1, T/S is extrapolated from neighbours, $ssh_n = ssh_b$ and U/V set to 0. 
    1182   If no neighbours, T/S is extrapolated from old top cell value.  
     1182  If no neighbours, T/S is extrapolated from old top cell value. 
    11831183  If no neighbours along i,j and k (both previous test failed), T/S/U/V/ssh and mask are set to 0. 
    11841184\item[Dry a column]: 
     
    11971197The default number is set up for the MISOMIP idealised experiments. 
    11981198This coupling procedure is able to take into account grounding line and calving front migration. 
    1199 However, it is a non-conservative processe.  
     1199However, it is a non-conservative processe. 
    12001200This could lead to a trend in heat/salt content and volume.\\ 
    12011201 
     
    12031203a simple conservation scheme is available with \np{ln\_hsb}\forcode{ = .true.}. 
    12041204The heat/salt/vol. gain/loss is diagnosed, as well as the location. 
    1205 A correction increment is computed and apply each time step during the next \np{rn\_fiscpl} time steps.  
     1205A correction increment is computed and apply each time step during the next \np{rn\_fiscpl} time steps. 
    12061206For safety, it is advised to set \np{rn\_fiscpl} equal to the coupling period (smallest increment possible). 
    12071207The corrective increment is apply into the cell itself (if it is a wet cell), the neigbouring cells or the closest wet cell (if the cell is now dry). 
     
    12191219%------------------------------------------------------------------------------------------------------------- 
    12201220 
    1221 Icebergs are modelled as lagrangian particles in NEMO \citep{marsh.ivchenko.ea_GMD15}. 
     1221Icebergs are modelled as lagrangian particles in \NEMO\ \citep{marsh.ivchenko.ea_GMD15}. 
    12221222Their physical behaviour is controlled by equations as described in \citet{martin.adcroft_OM10} ). 
    1223 (Note that the authors kindly provided a copy of their code to act as a basis for implementation in NEMO). 
     1223(Note that the authors kindly provided a copy of their code to act as a basis for implementation in \NEMO). 
    12241224Icebergs are initially spawned into one of ten classes which have specific mass and thickness as 
    1225 described in the \ngn{namberg} namelist: \np{rn\_initial\_mass} and \np{rn\_initial\_thickness}. 
     1225described in the \nam{berg} namelist: \np{rn\_initial\_mass} and \np{rn\_initial\_thickness}. 
    12261226Each class has an associated scaling (\np{rn\_mass\_scaling}), 
    12271227which is an integer representing how many icebergs of this class are being described as one lagrangian point 
     
    12471247  At each time step, a test is performed to see if there is enough ice mass to 
    12481248  calve an iceberg of each class in order (1 to 10). 
    1249   Note that this is the initial mass multiplied by the number each particle represents (\ie the scaling). 
     1249  Note that this is the initial mass multiplied by the number each particle represents (\ie\ the scaling). 
    12501250  If there is enough ice, a new iceberg is spawned and the total available ice reduced accordingly. 
    12511251\end{description} 
     
    12561256or (if \np{rn\_bits\_erosion\_fraction}~$>$~0) into melt and additionally small ice bits 
    12571257which are assumed to propagate with their larger parent and thus delay fluxing into the ocean. 
    1258 Melt water (and other variables on the configuration grid) are written into the main NEMO model output files. 
     1258Melt water (and other variables on the configuration grid) are written into the main \NEMO\ model output files. 
    12591259 
    12601260Extensive diagnostics can be produced. 
     
    12901290%------------------------------------------------------------------------------------------------------------- 
    12911291 
    1292 Ocean waves represent the interface between the ocean and the atmosphere, so NEMO is extended to incorporate  
    1293 physical processes related to ocean surface waves, namely the surface stress modified by growth and  
    1294 dissipation of the oceanic wave field, the Stokes-Coriolis force and the Stokes drift impact on mass and  
    1295 tracer advection; moreover the neutral surface drag coefficient from a wave model can be used to evaluate  
     1292Ocean waves represent the interface between the ocean and the atmosphere, so \NEMO\ is extended to incorporate 
     1293physical processes related to ocean surface waves, namely the surface stress modified by growth and 
     1294dissipation of the oceanic wave field, the Stokes-Coriolis force and the Stokes drift impact on mass and 
     1295tracer advection; moreover the neutral surface drag coefficient from a wave model can be used to evaluate 
    12961296the wind stress. 
    12971297 
    1298 Physical processes related to ocean surface waves can be accounted by setting the logical variable  
    1299 \np{ln\_wave} \forcode{= .true.} in \ngn{namsbc} namelist. In addition, specific flags accounting for  
     1298Physical processes related to ocean surface waves can be accounted by setting the logical variable 
     1299\np{ln\_wave}\forcode{ = .true.} in \nam{sbc} namelist. In addition, specific flags accounting for 
    13001300different processes should be activated as explained in the following sections. 
    13011301 
    13021302Wave fields can be provided either in forced or coupled mode: 
    13031303\begin{description} 
    1304 \item[forced mode]: wave fields should be defined through the \ngn{namsbc\_wave} namelist  
    1305 for external data names, locations, frequency, interpolation and all the miscellanous options allowed by  
    1306 Input Data generic Interface (see \autoref{sec:SBC_input}).  
    1307 \item[coupled mode]: NEMO and an external wave model can be coupled by setting \np{ln\_cpl} \forcode{= .true.}  
    1308 in \ngn{namsbc} namelist and filling the \ngn{namsbc\_cpl} namelist. 
     1304\item[forced mode]: wave fields should be defined through the \nam{sbc\_wave} namelist 
     1305for external data names, locations, frequency, interpolation and all the miscellanous options allowed by 
     1306Input Data generic Interface (see \autoref{sec:SBC_input}). 
     1307\item[coupled mode]: \NEMO\ and an external wave model can be coupled by setting \np{ln\_cpl} \forcode{= .true.} 
     1308in \nam{sbc} namelist and filling the \nam{sbc\_cpl} namelist. 
    13091309\end{description} 
    13101310 
     
    13181318\label{subsec:SBC_wave_cdgw} 
    13191319 
    1320 The neutral surface drag coefficient provided from an external data source (\ie a wave model),  
    1321 can be used by setting the logical variable \np{ln\_cdgw} \forcode{= .true.} in \ngn{namsbc} namelist.  
    1322 Then using the routine \rou{sbcblk\_algo\_ncar} and starting from the neutral drag coefficent provided,  
    1323 the drag coefficient is computed according to the stable/unstable conditions of the  
    1324 air-sea interface following \citet{large.yeager_rpt04}.  
     1320The neutral surface drag coefficient provided from an external data source (\ie\ a wave model), 
     1321can be used by setting the logical variable \np{ln\_cdgw} \forcode{= .true.} in \nam{sbc} namelist. 
     1322Then using the routine \rou{sbcblk\_algo\_ncar} and starting from the neutral drag coefficent provided, 
     1323the drag coefficient is computed according to the stable/unstable conditions of the 
     1324air-sea interface following \citet{large.yeager_rpt04}. 
    13251325 
    13261326 
     
    13321332\label{subsec:SBC_wave_sdw} 
    13331333 
    1334 The Stokes drift is a wave driven mechanism of mass and momentum transport \citep{stokes_ibk09}.  
    1335 It is defined as the difference between the average velocity of a fluid parcel (Lagrangian velocity)  
    1336 and the current measured at a fixed point (Eulerian velocity).  
    1337 As waves travel, the water particles that make up the waves travel in orbital motions but  
    1338 without a closed path. Their movement is enhanced at the top of the orbit and slowed slightly  
    1339 at the bottom, so the result is a net forward motion of water particles, referred to as the Stokes drift.  
    1340 An accurate evaluation of the Stokes drift and the inclusion of related processes may lead to improved  
     1334The Stokes drift is a wave driven mechanism of mass and momentum transport \citep{stokes_ibk09}. 
     1335It is defined as the difference between the average velocity of a fluid parcel (Lagrangian velocity) 
     1336and the current measured at a fixed point (Eulerian velocity). 
     1337As waves travel, the water particles that make up the waves travel in orbital motions but 
     1338without a closed path. Their movement is enhanced at the top of the orbit and slowed slightly 
     1339at the bottom, so the result is a net forward motion of water particles, referred to as the Stokes drift. 
     1340An accurate evaluation of the Stokes drift and the inclusion of related processes may lead to improved 
    13411341representation of surface physics in ocean general circulation models. %GS: reference needed 
    1342 The Stokes drift velocity $\mathbf{U}_{st}$ in deep water can be computed from the wave spectrum and may be written as:  
     1342The Stokes drift velocity $\mathbf{U}_{st}$ in deep water can be computed from the wave spectrum and may be written as: 
    13431343 
    13441344\[ 
     
    13491349\] 
    13501350 
    1351 where: ${\theta}$ is the wave direction, $f$ is the wave intrinsic frequency,  
    1352 $\mathrm{S}($f$,\theta)$ is the 2D frequency-direction spectrum,  
    1353 $k$ is the mean wavenumber defined as:  
     1351where: ${\theta}$ is the wave direction, $f$ is the wave intrinsic frequency, 
     1352$\mathrm{S}($f$,\theta)$ is the 2D frequency-direction spectrum, 
     1353$k$ is the mean wavenumber defined as: 
    13541354$k=\frac{2\pi}{\lambda}$ (being $\lambda$ the wavelength). \\ 
    13551355 
    1356 In order to evaluate the Stokes drift in a realistic ocean wave field, the wave spectral shape is required  
    1357 and its computation quickly becomes expensive as the 2D spectrum must be integrated for each vertical level.  
     1356In order to evaluate the Stokes drift in a realistic ocean wave field, the wave spectral shape is required 
     1357and its computation quickly becomes expensive as the 2D spectrum must be integrated for each vertical level. 
    13581358To simplify, it is customary to use approximations to the full Stokes profile. 
    1359 Three possible parameterizations for the calculation for the approximate Stokes drift velocity profile  
    1360 are included in the code through the \np{nn\_sdrift} parameter once provided the surface Stokes drift  
    1361 $\mathbf{U}_{st |_{z=0}}$ which is evaluated by an external wave model that accurately reproduces the wave spectra  
    1362 and makes possible the estimation of the surface Stokes drift for random directional waves in  
     1359Three possible parameterizations for the calculation for the approximate Stokes drift velocity profile 
     1360are included in the code through the \np{nn\_sdrift} parameter once provided the surface Stokes drift 
     1361$\mathbf{U}_{st |_{z=0}}$ which is evaluated by an external wave model that accurately reproduces the wave spectra 
     1362and makes possible the estimation of the surface Stokes drift for random directional waves in 
    13631363realistic wave conditions: 
    13641364 
    13651365\begin{description} 
    1366 \item[\np{nn\_sdrift} = 0]: exponential integral profile parameterization proposed by  
     1366\item[\np{nn\_sdrift} = 0]: exponential integral profile parameterization proposed by 
    13671367\citet{breivik.janssen.ea_JPO14}: 
    13681368 
    13691369\[ 
    13701370  % \label{eq:sbc_wave_sdw_0a} 
    1371   \mathbf{U}_{st} \cong \mathbf{U}_{st |_{z=0}} \frac{\mathrm{e}^{-2k_ez}} {1-8k_ez}  
     1371  \mathbf{U}_{st} \cong \mathbf{U}_{st |_{z=0}} \frac{\mathrm{e}^{-2k_ez}} {1-8k_ez} 
    13721372\] 
    13731373 
     
    13781378  k_e = \frac{|\mathbf{U}_{\left.st\right|_{z=0}}|} {|T_{st}|} 
    13791379  \quad \text{and }\ 
    1380   T_{st} = \frac{1}{16} \bar{\omega} H_s^2  
     1380  T_{st} = \frac{1}{16} \bar{\omega} H_s^2 
    13811381\] 
    13821382 
    13831383where $H_s$ is the significant wave height and $\omega$ is the wave frequency. 
    13841384 
    1385 \item[\np{nn\_sdrift} = 1]: velocity profile based on the Phillips spectrum which is considered to be a  
     1385\item[\np{nn\_sdrift} = 1]: velocity profile based on the Phillips spectrum which is considered to be a 
    13861386reasonable estimate of the part of the spectrum mostly contributing to the Stokes drift velocity near the surface 
    13871387\citep{breivik.bidlot.ea_OM16}: 
     
    13951395where $erf$ is the complementary error function and $k_p$ is the peak wavenumber. 
    13961396 
    1397 \item[\np{nn\_sdrift} = 2]: velocity profile based on the Phillips spectrum as for \np{nn\_sdrift} = 1  
     1397\item[\np{nn\_sdrift} = 2]: velocity profile based on the Phillips spectrum as for \np{nn\_sdrift} = 1 
    13981398but using the wave frequency from a wave model. 
    13991399 
    14001400\end{description} 
    14011401 
    1402 The Stokes drift enters the wave-averaged momentum equation, as well as the tracer advection equations  
    1403 and its effect on the evolution of the sea-surface height ${\eta}$ is considered as follows:  
     1402The Stokes drift enters the wave-averaged momentum equation, as well as the tracer advection equations 
     1403and its effect on the evolution of the sea-surface height ${\eta}$ is considered as follows: 
    14041404 
    14051405\[ 
     
    14091409\] 
    14101410 
    1411 The tracer advection equation is also modified in order for Eulerian ocean models to properly account  
    1412 for unresolved wave effect. The divergence of the wave tracer flux equals the mean tracer advection  
    1413 that is induced by the three-dimensional Stokes velocity.  
    1414 The advective equation for a tracer $c$ combining the effects of the mean current and sea surface waves  
    1415 can be formulated as follows:  
     1411The tracer advection equation is also modified in order for Eulerian ocean models to properly account 
     1412for unresolved wave effect. The divergence of the wave tracer flux equals the mean tracer advection 
     1413that is induced by the three-dimensional Stokes velocity. 
     1414The advective equation for a tracer $c$ combining the effects of the mean current and sea surface waves 
     1415can be formulated as follows: 
    14161416 
    14171417\[ 
     
    14291429\label{subsec:SBC_wave_stcor} 
    14301430 
    1431 In a rotating ocean, waves exert a wave-induced stress on the mean ocean circulation which results  
    1432 in a force equal to $\mathbf{U}_{st}$×$f$, where $f$ is the Coriolis parameter.  
    1433 This additional force may have impact on the Ekman turning of the surface current.  
    1434 In order to include this term, once evaluated the Stokes drift (using one of the 3 possible  
    1435 approximations described in \autoref{subsec:SBC_wave_sdw}),  
     1431In a rotating ocean, waves exert a wave-induced stress on the mean ocean circulation which results 
     1432in a force equal to $\mathbf{U}_{st}$×$f$, where $f$ is the Coriolis parameter. 
     1433This additional force may have impact on the Ekman turning of the surface current. 
     1434In order to include this term, once evaluated the Stokes drift (using one of the 3 possible 
     1435approximations described in \autoref{subsec:SBC_wave_sdw}), 
    14361436\np{ln\_stcor}\forcode{ = .true.} has to be set. 
    14371437 
     
    14441444\label{subsec:SBC_wave_tauw} 
    14451445 
    1446 The surface stress felt by the ocean is the atmospheric stress minus the net stress going  
    1447 into the waves \citep{janssen.breivik.ea_rpt13}. Therefore, when waves are growing, momentum and energy is spent and is not  
    1448 available for forcing the mean circulation, while in the opposite case of a decaying sea  
    1449 state, more momentum is available for forcing the ocean.  
    1450 Only when the sea state is in equilibrium, the ocean is forced by the atmospheric stress,  
    1451 but in practice, an equilibrium sea state is a fairly rare event.  
    1452 So the atmospheric stress felt by the ocean circulation $\tau_{oc,a}$ can be expressed as:  
     1446The surface stress felt by the ocean is the atmospheric stress minus the net stress going 
     1447into the waves \citep{janssen.breivik.ea_rpt13}. Therefore, when waves are growing, momentum and energy is spent and is not 
     1448available for forcing the mean circulation, while in the opposite case of a decaying sea 
     1449state, more momentum is available for forcing the ocean. 
     1450Only when the sea state is in equilibrium, the ocean is forced by the atmospheric stress, 
     1451but in practice, an equilibrium sea state is a fairly rare event. 
     1452So the atmospheric stress felt by the ocean circulation $\tau_{oc,a}$ can be expressed as: 
    14531453 
    14541454\[ 
     
    14661466 
    14671467where: $c_p$ is the phase speed of the gravity waves, 
    1468 $S_{in}$, $S_{nl}$ and $S_{diss}$ are three source terms that represent  
    1469 the physics of ocean waves. The first one, $S_{in}$, describes the generation  
    1470 of ocean waves by wind and therefore represents the momentum and energy transfer  
    1471 from air to ocean waves; the second term $S_{nl}$ denotes  
    1472 the nonlinear transfer by resonant four-wave interactions; while the third term $S_{diss}$  
    1473 describes the dissipation of waves by processes such as white-capping, large scale breaking  
     1468$S_{in}$, $S_{nl}$ and $S_{diss}$ are three source terms that represent 
     1469the physics of ocean waves. The first one, $S_{in}$, describes the generation 
     1470of ocean waves by wind and therefore represents the momentum and energy transfer 
     1471from air to ocean waves; the second term $S_{nl}$ denotes 
     1472the nonlinear transfer by resonant four-wave interactions; while the third term $S_{diss}$ 
     1473describes the dissipation of waves by processes such as white-capping, large scale breaking 
    14741474eddy-induced damping. 
    14751475 
    1476 The wave stress derived from an external wave model can be provided either through the normalized  
    1477 wave stress into the ocean by setting \np{ln\_tauwoc}\forcode{ = .true.}, or through the zonal and  
     1476The wave stress derived from an external wave model can be provided either through the normalized 
     1477wave stress into the ocean by setting \np{ln\_tauwoc}\forcode{ = .true.}, or through the zonal and 
    14781478meridional stress components by setting \np{ln\_tauw}\forcode{ = .true.}. 
    14791479 
     
    14951495%------------------------------------------namsbc------------------------------------------------------------- 
    14961496% 
    1497 \nlst{namsbc}  
     1497\nlst{namsbc} 
    14981498%------------------------------------------------------------------------------------------------------------- 
    14991499 
     
    15201520as higher frequency variations can be reconstructed from them, 
    15211521assuming that the diurnal cycle of SWF is a scaling of the top of the atmosphere diurnal cycle of incident SWF. 
    1522 The \cite{bernie.guilyardi.ea_CD07} reconstruction algorithm is available in \NEMO by 
    1523 setting \np{ln\_dm2dc}\forcode{ = .true.} (a \textit{\ngn{namsbc}} namelist variable) when 
     1522The \cite{bernie.guilyardi.ea_CD07} reconstruction algorithm is available in \NEMO\ by 
     1523setting \np{ln\_dm2dc}\forcode{ = .true.} (a \textit{\nam{sbc}} namelist variable) when 
    15241524using a bulk formulation (\np{ln\_blk}\forcode{ = .true.}) or 
    15251525the flux formulation (\np{ln\_flx}\forcode{ = .true.}). 
     
    15291529a given time step is the mean value of the analytical cycle over this time step (\autoref{fig:SBC_diurnal}). 
    15301530The use of diurnal cycle reconstruction requires the input SWF to be daily 
    1531 (\ie a frequency of 24 hours and a time interpolation set to true in \np{sn\_qsr} namelist parameter). 
     1531(\ie\ a frequency of 24 hours and a time interpolation set to true in \np{sn\_qsr} namelist parameter). 
    15321532Furthermore, it is recommended to have a least 8 surface module time steps per day, 
    15331533that is  $\rdt \ nn\_fsbc < 10,800~s = 3~h$. 
     
    15651565be defined relative to a rectilinear grid. 
    15661566To activate this option, a non-empty string is supplied in the rotation pair column of the relevant namelist. 
    1567 The eastward component must start with "U" and the northward component with "V".   
     1567The eastward component must start with "U" and the northward component with "V". 
    15681568The remaining characters in the strings are used to identify which pair of components go together. 
    15691569So for example, strings "U1" and "V1" next to "utau" and "vtau" would pair the wind stress components together and 
     
    15821582%------------------------------------------namsbc_ssr---------------------------------------------------- 
    15831583 
    1584 \nlst{namsbc_ssr}  
     1584\nlst{namsbc_ssr} 
    15851585%------------------------------------------------------------------------------------------------------------- 
    15861586 
    1587 Options are defined through the \ngn{namsbc\_ssr} namelist variables. 
     1587Options are defined through the \nam{sbc\_ssr} namelist variables. 
    15881588On forced mode using a flux formulation (\np{ln\_flx}\forcode{ = .true.}), 
    15891589a feedback term \emph{must} be added to the surface heat flux $Q_{ns}^o$: 
     
    15951595$T$ is the model surface layer temperature and 
    15961596$\frac{dQ}{dT}$ is a negative feedback coefficient usually taken equal to $-40~W/m^2/K$. 
    1597 For a $50~m$ mixed-layer depth, this value corresponds to a relaxation time scale of two months.  
    1598 This term ensures that if $T$ perfectly matches the supplied SST, then $Q$ is equal to $Q_o$.  
     1597For a $50~m$ mixed-layer depth, this value corresponds to a relaxation time scale of two months. 
     1598This term ensures that if $T$ perfectly matches the supplied SST, then $Q$ is equal to $Q_o$. 
    15991599 
    16001600In the fresh water budget, a feedback term can also be added. 
     
    16271627The presence at the sea surface of an ice covered area modifies all the fluxes transmitted to the ocean. 
    16281628There are several way to handle sea-ice in the system depending on 
    1629 the value of the \np{nn\_ice} namelist parameter found in \ngn{namsbc} namelist. 
     1629the value of the \np{nn\_ice} namelist parameter found in \nam{sbc} namelist. 
    16301630\begin{description} 
    1631 \item[nn{\_}ice = 0] 
     1631\item[nn\_ice = 0] 
    16321632  there will never be sea-ice in the computational domain. 
    16331633  This is a typical namelist value used for tropical ocean domain. 
    16341634  The surface fluxes are simply specified for an ice-free ocean. 
    16351635  No specific things is done for sea-ice. 
    1636 \item[nn{\_}ice = 1] 
     1636\item[nn\_ice = 1] 
    16371637  sea-ice can exist in the computational domain, but no sea-ice model is used. 
    16381638  An observed ice covered area is read in a file. 
     
    16451645  This manner of managing sea-ice area, just by using a IF case, 
    16461646  is usually referred as the \textit{ice-if} model. 
    1647   It can be found in the \mdl{sbcice{\_}if} module. 
    1648 \item[nn{\_}ice = 2 or more] 
     1647  It can be found in the \mdl{sbcice\_if} module. 
     1648\item[nn\_ice = 2 or more] 
    16491649  A full sea ice model is used. 
    16501650  This model computes the ice-ocean fluxes, 
     
    16521652  provide the surface averaged ocean fluxes. 
    16531653  Note that the activation of a sea-ice model is done by defining a CPP key (\key{si3} or \key{cice}). 
    1654   The activation automatically overwrites the read value of nn{\_}ice to its appropriate value 
    1655   (\ie $2$ for SI3 or $3$ for CICE). 
     1654  The activation automatically overwrites the read value of nn\_ice to its appropriate value 
     1655  (\ie\ $2$ for SI3 or $3$ for CICE). 
    16561656\end{description} 
    16571657 
     
    16671667\label{subsec:SBC_cice} 
    16681668 
    1669 It is possible to couple a regional or global NEMO configuration (without AGRIF) 
     1669It is possible to couple a regional or global \NEMO\ configuration (without AGRIF) 
    16701670to the CICE sea-ice model by using \key{cice}. 
    16711671The CICE code can be obtained from \href{http://oceans11.lanl.gov/trac/CICE/}{LANL} and 
    16721672the additional 'hadgem3' drivers will be required, even with the latest code release. 
    1673 Input grid files consistent with those used in NEMO will also be needed, 
     1673Input grid files consistent with those used in \NEMO\ will also be needed, 
    16741674and CICE CPP keys \textbf{ORCA\_GRID}, \textbf{CICE\_IN\_NEMO} and \textbf{coupled} should be used 
    16751675(seek advice from UKMO if necessary). 
    1676 Currently, the code is only designed to work when using the NCAR forcing option for NEMO %GS: still true ? 
     1676Currently, the code is only designed to work when using the NCAR forcing option for \NEMO\ %GS: still true ? 
    16771677(with \textit{calc\_strair}\forcode{ = .true.} and \textit{calc\_Tsfc}\forcode{ = .true.} in the CICE name-list), 
    1678 or alternatively when NEMO is coupled to the HadGAM3 atmosphere model 
     1678or alternatively when \NEMO\ is coupled to the HadGAM3 atmosphere model 
    16791679(with \textit{calc\_strair}\forcode{ = .false.} and \textit{calc\_Tsfc}\forcode{ = false}). 
    16801680The code is intended to be used with \np{nn\_fsbc} set to 1 
     
    16831683the user should check that results are not significantly different to the standard case). 
    16841684 
    1685 There are two options for the technical coupling between NEMO and CICE. 
     1685There are two options for the technical coupling between \NEMO\ and CICE. 
    16861686The standard version allows complete flexibility for the domain decompositions in the individual models, 
    16871687but this is at the expense of global gather and scatter operations in the coupling which 
    16881688become very expensive on larger numbers of processors. 
    1689 The alternative option (using \key{nemocice\_decomp} for both NEMO and CICE) ensures that 
     1689The alternative option (using \key{nemocice\_decomp} for both \NEMO\ and CICE) ensures that 
    16901690the domain decomposition is identical in both models (provided domain parameters are set appropriately, 
    16911691and \textit{processor\_shape~=~square-ice} and \textit{distribution\_wght~=~block} in the CICE name-list) and 
     
    16961696 
    16971697% ------------------------------------------------------------------------------------------------------------- 
    1698 %        Freshwater budget control  
     1698%        Freshwater budget control 
    16991699% ------------------------------------------------------------------------------------------------------------- 
    17001700\subsection[Freshwater budget control (\textit{sbcfwb.F90})] 
     
    17051705prevent unrealistic drift of the sea surface height due to inaccuracy in the freshwater fluxes. 
    17061706In \NEMO, two way of controlling the freshwater budget are proposed: 
    1707   
     1707 
    17081708\begin{description} 
    17091709\item[\np{nn\_fwb}\forcode{ = 0}] 
     
    17111711  The mean sea level is free to drift, and will certainly do so. 
    17121712\item[\np{nn\_fwb}\forcode{ = 1}] 
    1713   global mean \textit{emp} set to zero at each model time step.  
     1713  global mean \textit{emp} set to zero at each model time step. 
    17141714  %GS: comment below still relevant ? 
    1715   %Note that with a sea-ice model, this technique only controls the mean sea level with linear free surface and no mass flux between ocean and ice (as it is implemented in the current ice-ocean coupling).  
     1715  %Note that with a sea-ice model, this technique only controls the mean sea level with linear free surface and no mass flux between ocean and ice (as it is implemented in the current ice-ocean coupling). 
    17161716\item[\np{nn\_fwb}\forcode{ = 2}] 
    17171717  freshwater budget is adjusted from the previous year annual mean budget which 
    17181718  is read in the \textit{EMPave\_old.dat} file. 
    17191719  As the model uses the Boussinesq approximation, the annual mean fresh water budget is simply evaluated from 
    1720   the change in the mean sea level at January the first and saved in the \textit{EMPav.dat} file.  
     1720  the change in the mean sea level at January the first and saved in the \textit{EMPav.dat} file. 
    17211721\end{description} 
    17221722 
    17231723% Griffies doc: 
    1724 % When running ocean-ice simulations, we are not explicitly representing land processes,  
    1725 % such as rivers, catchment areas, snow accumulation, etc. However, to reduce model drift,  
    1726 % it is important to balance the hydrological cycle in ocean-ice models.  
    1727 % We thus need to prescribe some form of global normalization to the precipitation minus evaporation plus river runoff.  
    1728 % The result of the normalization should be a global integrated zero net water input to the ocean-ice system over  
    1729 % a chosen time scale.  
    1730 % How often the normalization is done is a matter of choice. In mom4p1, we choose to do so at each model time step,  
    1731 % so that there is always a zero net input of water to the ocean-ice system.  
    1732 % Others choose to normalize over an annual cycle, in which case the net imbalance over an annual cycle is used  
    1733 % to alter the subsequent year�s water budget in an attempt to damp the annual water imbalance.  
    1734 % Note that the annual budget approach may be inappropriate with interannually varying precipitation forcing.  
    1735 % When running ocean-ice coupled models, it is incorrect to include the water transport between the ocean  
    1736 % and ice models when aiming to balance the hydrological cycle.  
    1737 % The reason is that it is the sum of the water in the ocean plus ice that should be balanced when running ocean-ice models,  
    1738 % not the water in any one sub-component. As an extreme example to illustrate the issue,  
    1739 % consider an ocean-ice model with zero initial sea ice. As the ocean-ice model spins up,  
    1740 % there should be a net accumulation of water in the growing sea ice, and thus a net loss of water from the ocean.  
    1741 % The total water contained in the ocean plus ice system is constant, but there is an exchange of water between  
    1742 % the subcomponents. This exchange should not be part of the normalization used to balance the hydrological cycle  
    1743 % in ocean-ice models.  
     1724% When running ocean-ice simulations, we are not explicitly representing land processes, 
     1725% such as rivers, catchment areas, snow accumulation, etc. However, to reduce model drift, 
     1726% it is important to balance the hydrological cycle in ocean-ice models. 
     1727% We thus need to prescribe some form of global normalization to the precipitation minus evaporation plus river runoff. 
     1728% The result of the normalization should be a global integrated zero net water input to the ocean-ice system over 
     1729% a chosen time scale. 
     1730% How often the normalization is done is a matter of choice. In mom4p1, we choose to do so at each model time step, 
     1731% so that there is always a zero net input of water to the ocean-ice system. 
     1732% Others choose to normalize over an annual cycle, in which case the net imbalance over an annual cycle is used 
     1733% to alter the subsequent year�s water budget in an attempt to damp the annual water imbalance. 
     1734% Note that the annual budget approach may be inappropriate with interannually varying precipitation forcing. 
     1735% When running ocean-ice coupled models, it is incorrect to include the water transport between the ocean 
     1736% and ice models when aiming to balance the hydrological cycle. 
     1737% The reason is that it is the sum of the water in the ocean plus ice that should be balanced when running ocean-ice models, 
     1738% not the water in any one sub-component. As an extreme example to illustrate the issue, 
     1739% consider an ocean-ice model with zero initial sea ice. As the ocean-ice model spins up, 
     1740% there should be a net accumulation of water in the growing sea ice, and thus a net loss of water from the ocean. 
     1741% The total water contained in the ocean plus ice system is constant, but there is an exchange of water between 
     1742% the subcomponents. This exchange should not be part of the normalization used to balance the hydrological cycle 
     1743% in ocean-ice models. 
    17441744 
    17451745 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_STO.tex

    r11353 r11512  
    88\label{chap:STO} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212% \vfill 
     
    118118either first principles, model simulations, or real-world observations. 
    119119The parameters are set by default as described in \cite{brankart_OM13}, which has been shown in the paper 
    120 to give good results for a global low resolution (2°) NEMO configuration. where this parametrization produces a major effect on the average large-scale circulation, especilally in regions of intense mesoscale activity. 
     120to give good results for a global low resolution (2°) \NEMO\ configuration. where this parametrization produces a major effect on the average large-scale circulation, especilally in regions of intense mesoscale activity. 
    121121The set of parameters will need further investigation to find appropriate values 
    122122for any other configuration or resolution of the model. 
     
    127127 
    128128The code implementing stochastic parametrisation is located in the src/OCE/STO directory. 
    129 It contains three modules :  
     129It contains three modules : 
    130130% \begin{description} 
    131131 
     
    150150the values $a^{(i)}, b^{(i)}, c^{(i)}$ for each autoregressive process, 
    151151as a function of the statistical properties required by the model user 
    152 (mean, standard deviation, time correlation, order of the process,\ldots).  
     152(mean, standard deviation, time correlation, order of the process,\ldots). 
    153153This routine also includes the initialization (seeding) of the random number generator. 
    154154 
     
    162162The simulation will continue exactly as if it was not interrupted only 
    163163when \np{ln\_rstseed} is set to \forcode{.true.}, 
    164 \ie when the state of the random number generator is read in the restart file.\\ 
     164\ie\ when the state of the random number generator is read in the restart file.\\ 
    165165 
    166 The implementation includes the basics for a few possible stochastic parametrisations including equation of state, lateral diffusion, horizontal pressure gradient, ice strength, trend, tracers dynamics. As for this release, only the stochastic parametrisation of equation of state is fully available and tested. \\  
     166The implementation includes the basics for a few possible stochastic parametrisations including equation of state, 
     167lateral diffusion, horizontal pressure gradient, ice strength, trend, tracers dynamics. 
     168As for this release, only the stochastic parametrisation of equation of state is fully available and tested. \\ 
    167169 
    168170Options and parameters \\ 
    169171 
    170 The \np{ln\_sto\_eos} namelist variable activates stochastic parametrisation of equation of state. By default it set to \forcode{.false.}) and not active. 
    171 The set of parameters is available in \ngn{namsto} namelist(only the subset for equation of state stochastic parametrisation is listed below): 
     172The \np{ln\_sto\_eos} namelist variable activates stochastic parametrisation of equation of state. 
     173By default it set to \forcode{.false.}) and not active. 
     174The set of parameters is available in \nam{sto} namelist 
     175(only the subset for equation of state stochastic parametrisation is listed below): 
    172176%---------------------------------------namsto-------------------------------------------------- 
    173177 
     
    176180 
    177181The variables of stochastic paramtetrisation itself (based on the global 2° experiments as in \cite{brankart_OM13} are: 
     182 
    178183\begin{description} 
    179184\item[\np{nn\_sto\_eos}:]   number of independent random walks 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_TRA.tex

    r11263 r11512  
    88\label{chap:TRA} 
    99 
    10 \minitoc 
    11  
    12 % missing/update  
     10\chaptertoc 
     11 
     12% missing/update 
    1313% traqsr: need to coordinate with SBC module 
    1414 
    15 %STEVEN :  is the use of the word "positive" to describe a scheme enough, or should it be "positive definite"? I added a comment to this effect on some instances of this below 
     15%STEVEN :  is the use of the word "positive" to describe a scheme enough, or should it be "positive definite"? 
     16%I added a comment to this effect on some instances of this below 
    1617 
    1718Using the representation described in \autoref{chap:DOM}, several semi -discrete space forms of 
     
    3536The terms QSR, BBC, BBL and DMP are optional. 
    3637The external forcings and parameterisations require complex inputs and complex calculations 
    37 (\eg bulk formulae, estimation of mixing coefficients) that are carried out in the SBC, 
     38(\eg\ bulk formulae, estimation of mixing coefficients) that are carried out in the SBC, 
    3839LDF and ZDF modules and described in \autoref{chap:SBC}, \autoref{chap:LDF} and 
    3940\autoref{chap:ZDF}, respectively. 
     
    4748associated modules \mdl{eosbn2} and \mdl{phycst}). 
    4849 
    49 The different options available to the user are managed by namelist logicals or CPP keys. 
     50The different options available to the user are managed by namelist logicals. 
    5051For each equation term \textit{TTT}, the namelist logicals are \textit{ln\_traTTT\_xxx}, 
    5152where \textit{xxx} is a 3 or 4 letter acronym corresponding to each optional scheme. 
    52 The CPP key (when it exists) is \key{traTTT}. 
    5353The equivalent code can be found in the \textit{traTTT} or \textit{traTTT\_xxx} module, 
    5454in the \path{./src/OCE/TRA} directory. 
     
    6868%------------------------------------------------------------------------------------------------------------- 
    6969 
    70 When considered (\ie when \np{ln\_traadv\_NONE} is not set to \forcode{.true.}), 
     70When considered (\ie\ when \np{ln\_traadv\_OFF} is not set to \forcode{.true.}), 
    7171the advection tendency of a tracer is expressed in flux form, 
    72 \ie as the divergence of the advective fluxes. 
     72\ie\ as the divergence of the advective fluxes. 
    7373Its discrete expression is given by : 
    7474\begin{equation} 
     
    8282Indeed, it is obtained by using the following equality: $\nabla \cdot (\vect U \, T) = \vect U \cdot \nabla T$ which 
    8383results from the use of the continuity equation, $\partial_t e_3 + e_3 \; \nabla \cdot \vect U = 0$ 
    84 (which reduces to $\nabla \cdot \vect U = 0$ in linear free surface, \ie \np{ln\_linssh}\forcode{ = .true.}). 
     84(which reduces to $\nabla \cdot \vect U = 0$ in linear free surface, \ie\ \np{ln\_linssh}\forcode{ = .true.}). 
    8585Therefore it is of paramount importance to design the discrete analogue of the advection tendency so that 
    8686it is consistent with the continuity equation in order to enforce the conservation properties of 
     
    110110%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    111111 
    112 The key difference between the advection schemes available in \NEMO is the choice made in space and 
     112The key difference between the advection schemes available in \NEMO\ is the choice made in space and 
    113113time interpolation to define the value of the tracer at the velocity points 
    114114(\autoref{fig:adv_scheme}). 
     
    125125  the moving surface $z = \eta$. 
    126126  There is a non-zero advective flux which is set for all advection schemes as 
    127   $\tau_w|_{k = 1/2} = T_{k = 1}$, \ie the product of surface velocity (at $z = 0$) by 
     127  $\tau_w|_{k = 1/2} = T_{k = 1}$, \ie\ the product of surface velocity (at $z = 0$) by 
    128128  the first level tracer value. 
    129129\item[non-linear free surface:] 
     
    139139two quantities that are not correlated \citep{roullet.madec_JGR00, griffies.pacanowski.ea_MWR01, campin.adcroft.ea_OM04}. 
    140140 
    141 The velocity field that appears in (\autoref{eq:tra_adv} and \autoref{eq:tra_adv_zco?}) is 
    142 the centred (\textit{now}) \textit{effective} ocean velocity, \ie the \textit{eulerian} velocity 
     141The velocity field that appears in (\autoref{eq:tra_adv} is  
     142the centred (\textit{now}) \textit{effective} ocean velocity, \ie\ the \textit{eulerian} velocity 
    143143(see \autoref{chap:DYN}) plus the eddy induced velocity (\textit{eiv}) and/or 
    144144the mixed layer eddy induced velocity (\textit{eiv}) when those parameterisations are used 
     
    149149Conservative Laws scheme (MUSCL), a $3^{rd}$ Upstream Biased Scheme (UBS, also often called UP3), 
    150150and a Quadratic Upstream Interpolation for Convective Kinematics with Estimated Streaming Terms scheme (QUICKEST). 
    151 The choice is made in the \ngn{namtra\_adv} namelist, by setting to \forcode{.true.} one of 
     151The choice is made in the \nam{tra\_adv} namelist, by setting to \forcode{.true.} one of 
    152152the logicals \textit{ln\_traadv\_xxx}. 
    153153The corresponding code can be found in the \textit{traadv\_xxx.F90} module, where 
    154154\textit{xxx} is a 3 or 4 letter acronym corresponding to each scheme. 
    155 By default (\ie in the reference namelist, \textit{namelist\_ref}), all the logicals are set to \forcode{.false.}. 
     155By default (\ie\ in the reference namelist, \textit{namelist\_ref}), all the logicals are set to \forcode{.false.}. 
    156156If the user does not select an advection scheme in the configuration namelist (\textit{namelist\_cfg}), 
    157157the tracers will \textit{not} be advected! 
     
    188188\label{subsec:TRA_adv_cen} 
    189189 
    190 %        2nd order centred scheme   
     190%        2nd order centred scheme 
    191191 
    192192The centred advection scheme (CEN) is used when \np{ln\_traadv\_cen}\forcode{ = .true.}. 
     
    203203\end{equation} 
    204204 
    205 CEN2 is non diffusive (\ie it conserves the tracer variance, $\tau^2$) but dispersive 
    206 (\ie it may create false extrema). 
     205CEN2 is non diffusive (\ie\ it conserves the tracer variance, $\tau^2$) but dispersive 
     206(\ie\ it may create false extrema). 
    207207It is therefore notoriously noisy and must be used in conjunction with an explicit diffusion operator to 
    208208produce a sensible solution. 
     
    213213both (\autoref{eq:tra_adv}) and (\autoref{eq:tra_adv_cen2}) have this order of accuracy. 
    214214 
    215 %        4nd order centred scheme   
     215%        4nd order centred scheme 
    216216 
    217217In the $4^{th}$ order formulation (CEN4), tracer values are evaluated at u- and v-points as 
     
    225225a $4^{th}$ COMPACT interpolation has been prefered \citep{demange_phd14}. 
    226226In the COMPACT scheme, both the field and its derivative are interpolated, which leads, after a matrix inversion, 
    227 spectral characteristics similar to schemes of higher order \citep{lele_JCP92}.  
     227spectral characteristics similar to schemes of higher order \citep{lele_JCP92}. 
    228228 
    229229Strictly speaking, the CEN4 scheme is not a $4^{th}$ order advection scheme but 
     
    237237 
    238238A direct consequence of the pseudo-fourth order nature of the scheme is that it is not non-diffusive, 
    239 \ie the global variance of a tracer is not preserved using CEN4. 
     239\ie\ the global variance of a tracer is not preserved using CEN4. 
    240240Furthermore, it must be used in conjunction with an explicit diffusion operator to produce a sensible solution. 
    241241As in CEN2 case, the time-stepping is performed using a leapfrog scheme in conjunction with an Asselin time-filter, 
     
    250250 
    251251% ------------------------------------------------------------------------------------------------------------- 
    252 %        FCT scheme   
     252%        FCT scheme 
    253253% ------------------------------------------------------------------------------------------------------------- 
    254254\subsection[FCT: Flux Corrected Transport scheme (\forcode{ln_traadv_fct = .true.})] 
     
    278278where $c_u$ is a flux limiter function taking values between 0 and 1. 
    279279The FCT order is the one of the centred scheme used 
    280 (\ie it depends on the setting of \np{nn\_fct\_h} and \np{nn\_fct\_v}). 
     280(\ie\ it depends on the setting of \np{nn\_fct\_h} and \np{nn\_fct\_v}). 
    281281There exist many ways to define $c_u$, each corresponding to a different FCT scheme. 
    282 The one chosen in \NEMO is described in \citet{zalesak_JCP79}. 
     282The one chosen in \NEMO\ is described in \citet{zalesak_JCP79}. 
    283283$c_u$ only departs from $1$ when the advective term produces a local extremum in the tracer field. 
    284284The resulting scheme is quite expensive but \textit{positive}. 
     
    286286A comparison of FCT-2 with MUSCL and a MPDATA scheme can be found in \citet{levy.estublier.ea_GRL01}. 
    287287 
    288 An additional option has been added controlled by \np{nn\_fct\_zts}. 
    289 By setting this integer to a value larger than zero, 
    290 a $2^{nd}$ order FCT scheme is used on both horizontal and vertical direction, but on the latter, 
    291 a split-explicit time stepping is used, with a number of sub-timestep equals to \np{nn\_fct\_zts}. 
    292 This option can be useful when the size of the timestep is limited by vertical advection \citep{lemarie.debreu.ea_OM15}. 
    293 Note that in this case, a similar split-explicit time stepping should be used on vertical advection of momentum to 
    294 insure a better stability (see \autoref{subsec:DYN_zad}). 
    295288 
    296289For stability reasons (see \autoref{chap:STP}), 
     
    301294 
    302295% ------------------------------------------------------------------------------------------------------------- 
    303 %        MUSCL scheme   
     296%        MUSCL scheme 
    304297% ------------------------------------------------------------------------------------------------------------- 
    305298\subsection[MUSCL: Monotone Upstream Scheme for Conservative Laws (\forcode{ln_traadv_mus = .true.})] 
     
    310303MUSCL implementation can be found in the \mdl{traadv\_mus} module. 
    311304 
    312 MUSCL has been first implemented in \NEMO by \citet{levy.estublier.ea_GRL01}. 
     305MUSCL has been first implemented in \NEMO\ by \citet{levy.estublier.ea_GRL01}. 
    313306In its formulation, the tracer at velocity points is evaluated assuming a linear tracer variation between 
    314307two $T$-points (\autoref{fig:adv_scheme}). 
     
    338331 
    339332% ------------------------------------------------------------------------------------------------------------- 
    340 %        UBS scheme   
     333%        UBS scheme 
    341334% ------------------------------------------------------------------------------------------------------------- 
    342335\subsection[UBS a.k.a. UP3: Upstream-Biased Scheme (\forcode{ln_traadv_ubs = .true.})] 
     
    374367\citep{shchepetkin.mcwilliams_OM05, demange_phd14}. 
    375368Therefore the vertical flux is evaluated using either a $2^nd$ order FCT scheme or a $4^th$ order COMPACT scheme 
    376 (\np{nn\_cen\_v}\forcode{ = 2 or 4}). 
     369(\np{nn\_ubs\_v}\forcode{ = 2 or 4}). 
    377370 
    378371For stability reasons (see \autoref{chap:STP}), the first term  in \autoref{eq:tra_adv_ubs} 
     
    408401Thirdly, the diffusion term is in fact a biharmonic operator with an eddy coefficient which 
    409402is simply proportional to the velocity: $A_u^{lm} = \frac{1}{12} \, {e_{1u}}^3 \, |u|$. 
    410 Note the current version of NEMO uses the computationally more efficient formulation \autoref{eq:tra_adv_ubs}. 
    411  
    412 % ------------------------------------------------------------------------------------------------------------- 
    413 %        QCK scheme   
     403Note the current version of \NEMO\ uses the computationally more efficient formulation \autoref{eq:tra_adv_ubs}. 
     404 
     405% ------------------------------------------------------------------------------------------------------------- 
     406%        QCK scheme 
    414407% ------------------------------------------------------------------------------------------------------------- 
    415408\subsection[QCK: QuiCKest scheme (\forcode{ln_traadv_qck = .true.})] 
     
    423416QUICKEST is the third order Godunov scheme which is associated with the ULTIMATE QUICKEST limiter 
    424417\citep{leonard_CMAME91}. 
    425 It has been implemented in NEMO by G. Reffray (MERCATOR-ocean) and can be found in the \mdl{traadv\_qck} module. 
     418It has been implemented in \NEMO\ by G. Reffray (MERCATOR-ocean) and can be found in the \mdl{traadv\_qck} module. 
    426419The resulting scheme is quite expensive but \textit{positive}. 
    427420It can be used on both active and passive tracers. 
     
    444437\nlst{namtra_ldf} 
    445438%------------------------------------------------------------------------------------------------------------- 
    446   
    447 Options are defined through the \ngn{namtra\_ldf} namelist variables. 
    448 They are regrouped in four items, allowing to specify  
     439 
     440Options are defined through the \nam{tra\_ldf} namelist variables. 
     441They are regrouped in four items, allowing to specify 
    449442$(i)$   the type of operator used (none, laplacian, bilaplacian), 
    450443$(ii)$  the direction along which the operator acts (iso-level, horizontal, iso-neutral), 
    451 $(iii)$ some specific options related to the rotated operators (\ie non-iso-level operator), and 
     444$(iii)$ some specific options related to the rotated operators (\ie\ non-iso-level operator), and 
    452445$(iv)$  the specification of eddy diffusivity coefficient (either constant or variable in space and time). 
    453446Item $(iv)$ will be described in \autoref{chap:LDF}. 
     
    457450 
    458451The lateral diffusion of tracers is evaluated using a forward scheme, 
    459 \ie the tracers appearing in its expression are the \textit{before} tracers in time, 
     452\ie\ the tracers appearing in its expression are the \textit{before} tracers in time, 
    460453except for the pure vertical component that appears when a rotation tensor is used. 
    461454This latter component is solved implicitly together with the vertical diffusion term (see \autoref{chap:STP}). 
     
    466459%        Type of operator 
    467460% ------------------------------------------------------------------------------------------------------------- 
    468 \subsection[Type of operator (\texttt{ln\_traldf}\{\texttt{\_NONE,\_lap,\_blp}\})] 
    469 {Type of operator (\protect\np{ln\_traldf\_NONE}, \protect\np{ln\_traldf\_lap}, or \protect\np{ln\_traldf\_blp}) }  
     461\subsection[Type of operator (\texttt{ln\_traldf}\{\texttt{\_OFF,\_lap,\_blp}\})] 
     462{Type of operator (\protect\np{ln\_traldf\_OFF}, \protect\np{ln\_traldf\_lap}, or \protect\np{ln\_traldf\_blp}) } 
    470463\label{subsec:TRA_ldf_op} 
    471464 
     
    473466 
    474467\begin{description} 
    475 \item[\np{ln\_traldf\_NONE}\forcode{ = .true.}:] 
     468\item[\np{ln\_traldf\_OFF}\forcode{ = .true.}:] 
    476469  no operator selected, the lateral diffusive tendency will not be applied to the tracer equation. 
    477470  This option can be used when the selected advection scheme is diffusive enough (MUSCL scheme for example). 
     
    494487minimizing the impact on the larger scale features. 
    495488The main difference between the two operators is the scale selectiveness. 
    496 The bilaplacian damping time (\ie its spin down time) scales like $\lambda^{-4}$ for 
     489The bilaplacian damping time (\ie\ its spin down time) scales like $\lambda^{-4}$ for 
    497490disturbances of wavelength $\lambda$ (so that short waves damped more rapidelly than long ones), 
    498491whereas the laplacian damping time scales only like $\lambda^{-2}$. 
     
    502495% ------------------------------------------------------------------------------------------------------------- 
    503496\subsection[Action direction (\texttt{ln\_traldf}\{\texttt{\_lev,\_hor,\_iso,\_triad}\})] 
    504 {Direction of action (\protect\np{ln\_traldf\_lev}, \protect\np{ln\_traldf\_hor}, \protect\np{ln\_traldf\_iso}, or \protect\np{ln\_traldf\_triad}) }  
     497{Direction of action (\protect\np{ln\_traldf\_lev}, \protect\np{ln\_traldf\_hor}, \protect\np{ln\_traldf\_iso}, or \protect\np{ln\_traldf\_triad}) } 
    505498\label{subsec:TRA_ldf_dir} 
    506499 
     
    508501The operator is a simple (re-entrant) laplacian acting in the (\textbf{i},\textbf{j}) plane when 
    509502iso-level option is used (\np{ln\_traldf\_lev}\forcode{ = .true.}) or 
    510 when a horizontal (\ie geopotential) operator is demanded in \textit{z}-coordinate 
     503when a horizontal (\ie\ geopotential) operator is demanded in \textit{z}-coordinate 
    511504(\np{ln\_traldf\_hor} and \np{ln\_zco} equal \forcode{.true.}). 
    512505The associated code can be found in the \mdl{traldf\_lap\_blp} module. 
     
    516509(\np{ln\_traldf\_iso} or \np{ln\_traldf\_triad} equals \forcode{.true.}, 
    517510see \mdl{traldf\_iso} or \mdl{traldf\_triad} module, resp.), or 
    518 when a horizontal (\ie geopotential) operator is demanded in \textit{s}-coordinate 
     511when a horizontal (\ie\ geopotential) operator is demanded in \textit{s}-coordinate 
    519512(\np{ln\_traldf\_hor} and \np{ln\_sco} equal \forcode{.true.}) 
    520513\footnote{In this case, the standard iso-neutral operator will be automatically selected}. 
     
    532525\label{subsec:TRA_ldf_lev} 
    533526 
    534 The laplacian diffusion operator acting along the model (\textit{i,j})-surfaces is given by:  
     527The laplacian diffusion operator acting along the model (\textit{i,j})-surfaces is given by: 
    535528\begin{equation} 
    536529  \label{eq:tra_ldf_lap} 
     
    541534where zero diffusive fluxes is assumed across solid boundaries, 
    542535first (and third in bilaplacian case) horizontal tracer derivative are masked. 
    543 It is implemented in the \rou{traldf\_lap} subroutine found in the \mdl{traldf\_lap} module. 
    544 The module also contains \rou{traldf\_blp}, the subroutine calling twice \rou{traldf\_lap} in order to 
     536It is implemented in the \rou{tra\_ldf\_lap} subroutine found in the \mdl{traldf\_lap\_blp}} module. 
     537The module also contains \rou{tra\_ldf\_blp}, the subroutine calling twice \rou{tra\_ldf\_lap} in order to 
    545538compute the iso-level bilaplacian operator. 
    546539 
     
    584577where $b_t = e_{1t} \, e_{2t} \, e_{3t}$  is the volume of $T$-cells, 
    585578$r_1$ and $r_2$ are the slopes between the surface of computation ($z$- or $s$-surfaces) and 
    586 the surface along which the diffusion operator acts (\ie horizontal or iso-neutral surfaces). 
     579the surface along which the diffusion operator acts (\ie\ horizontal or iso-neutral surfaces). 
    587580It is thus used when, in addition to \np{ln\_traldf\_lap}\forcode{ = .true.}, 
    588581we have \np{ln\_traldf\_iso}\forcode{ = .true.}, 
     
    613606\label{subsec:TRA_ldf_triad} 
    614607 
    615 If the Griffies triad scheme is employed (\np{ln\_traldf\_triad}\forcode{ = .true.}; see \autoref{apdx:triad}) 
    616  
    617608An alternative scheme developed by \cite{griffies.gnanadesikan.ea_JPO98} which ensures tracer variance decreases 
    618 is also available in \NEMO (\np{ln\_traldf\_grif}\forcode{ = .true.}). 
     609is also available in \NEMO\ (\np{ln\_traldf\_triad}\forcode{ = .true.}). 
    619610A complete description of the algorithm is given in \autoref{apdx:triad}. 
    620611 
     
    637628\item \np{rn\_slpmax} = slope limit (both operators) 
    638629\item \np{ln\_triad\_iso} = pure horizontal mixing in ML (triad only) 
    639 \item \np{rn\_sw\_triad} $= 1$ switching triad; $= 0$ all 4 triads used (triad only)  
     630\item \np{rn\_sw\_triad} $= 1$ switching triad; $= 0$ all 4 triads used (triad only) 
    640631\item \np{ln\_botmix\_triad} = lateral mixing on bottom (triad only) 
    641632\end{itemize} 
     
    652643%-------------------------------------------------------------------------------------------------------------- 
    653644 
    654 Options are defined through the \ngn{namzdf} namelist variables. 
     645Options are defined through the \nam{zdf} namelist variables. 
    655646The formulation of the vertical subgrid scale tracer physics is the same for all the vertical coordinates, 
    656647and is based on a laplacian operator. 
     
    664655respectively. 
    665656Generally, $A_w^{vT} = A_w^{vS}$ except when double diffusive mixing is parameterised 
    666 (\ie \key{zdfddm} is defined). 
     657(\ie\ \np{ln\_zdfddm} equals \forcode{.true.},). 
    667658The way these coefficients are evaluated is given in \autoref{chap:ZDF} (ZDF). 
    668659Furthermore, when iso-neutral mixing is used, both mixing coefficients are increased by 
     
    676667 
    677668The large eddy coefficient found in the mixed layer together with high vertical resolution implies that 
    678 in the case of explicit time stepping (\np{ln\_zdfexp}\forcode{ = .true.}) 
    679 there would be too restrictive a constraint on the time step. 
    680 Therefore, the default implicit time stepping is preferred for the vertical diffusion since 
     669there would be too restrictive constraint on the time step if we use explicit time stepping. 
     670Therefore an implicit time stepping is preferred for the vertical diffusion since 
    681671it overcomes the stability constraint. 
    682 A forward time differencing scheme (\np{ln\_zdfexp}\forcode{ = .true.}) using 
    683 a time splitting technique (\np{nn\_zdfexp} $> 1$) is provided as an alternative. 
    684 Namelist variables \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics. 
    685672 
    686673% ================================================================ 
     
    704691 
    705692Due to interactions and mass exchange of water ($F_{mass}$) with other Earth system components 
    706 (\ie atmosphere, sea-ice, land), the change in the heat and salt content of the surface layer of the ocean is due 
     693(\ie\ atmosphere, sea-ice, land), the change in the heat and salt content of the surface layer of the ocean is due 
    707694both to the heat and salt fluxes crossing the sea surface (not linked with $F_{mass}$) and 
    708695to the heat and salt content of the mass exchange. 
     
    716703\item 
    717704  $Q_{ns}$, the non-solar part of the net surface heat flux that crosses the sea surface 
    718   (\ie the difference between the total surface heat flux and the fraction of the short wave flux that 
     705  (\ie\ the difference between the total surface heat flux and the fraction of the short wave flux that 
    719706  penetrates into the water column, see \autoref{subsec:TRA_qsr}) 
    720707  plus the heat content associated with of the mass exchange with the atmosphere and lands. 
     
    758745          &\overline{(\textit{sfx} -        \textit{emp} \lt. S \rt|_{k = 1})}^t 
    759746  \end{alignedat} 
    760 \end{equation}  
     747\end{equation} 
    761748Note that an exact conservation of heat and salt content is only achieved with non-linear free surface. 
    762749In the linear free surface case, there is a small imbalance. 
     
    765752 
    766753% ------------------------------------------------------------------------------------------------------------- 
    767 %        Solar Radiation Penetration  
     754%        Solar Radiation Penetration 
    768755% ------------------------------------------------------------------------------------------------------------- 
    769756\subsection[Solar radiation penetration (\textit{traqsr.F90})] 
     
    775762%-------------------------------------------------------------------------------------------------------------- 
    776763 
    777 Options are defined through the \ngn{namtra\_qsr} namelist variables. 
    778 When the penetrative solar radiation option is used (\np{ln\_flxqsr}\forcode{ = .true.}), 
     764Options are defined through the \nam{tra\_qsr} namelist variables. 
     765When the penetrative solar radiation option is used (\np{ln\_traqsr}\forcode{ = .true.}), 
    779766the solar radiation penetrates the top few tens of meters of the ocean. 
    780 If it is not used (\np{ln\_flxqsr}\forcode{ = .false.}) all the heat flux is absorbed in the first ocean level. 
     767If it is not used (\np{ln\_traqsr}\forcode{ = .false.}) all the heat flux is absorbed in the first ocean level. 
    781768Thus, in the former case a term is added to the time evolution equation of temperature \autoref{eq:PE_tra_T} and 
    782 the surface boundary condition is modified to take into account only the non-penetrative part of the surface  
     769the surface boundary condition is modified to take into account only the non-penetrative part of the surface 
    783770heat flux: 
    784771\begin{equation} 
     
    789776  \end{gathered} 
    790777\end{equation} 
    791 where $Q_{sr}$ is the penetrative part of the surface heat flux (\ie the shortwave radiation) and 
     778where $Q_{sr}$ is the penetrative part of the surface heat flux (\ie\ the shortwave radiation) and 
    792779$I$ is the downward irradiance ($\lt. I \rt|_{z = \eta} = Q_{sr}$). 
    793780The additional term in \autoref{eq:PE_qsr} is discretized as follows: 
     
    803790(specified through namelist parameter \np{rn\_abs}). 
    804791It is assumed to penetrate the ocean with a decreasing exponential profile, with an e-folding depth scale, $\xi_0$, 
    805 of a few tens of centimetres (typically $\xi_0 = 0.35~m$ set as \np{rn\_si0} in the \ngn{namtra\_qsr} namelist). 
     792of a few tens of centimetres (typically $\xi_0 = 0.35~m$ set as \np{rn\_si0} in the \nam{tra\_qsr} namelist). 
    806793For shorter wavelengths (400-700~nm), the ocean is more transparent, and solar energy propagates to 
    807794larger depths where it contributes to local heating. 
     
    836823 
    837824The RGB formulation is used when \np{ln\_qsr\_rgb}\forcode{ = .true.}. 
    838 The RGB attenuation coefficients (\ie the inverses of the extinction length scales) are tabulated over 
     825The RGB attenuation coefficients (\ie\ the inverses of the extinction length scales) are tabulated over 
    83982661 nonuniform chlorophyll classes ranging from 0.01 to 10 g.Chl/L 
    840827(see the routine \rou{trc\_oce\_rgb} in \mdl{trc\_oce} module). 
     
    842829 
    843830\begin{description} 
    844 \item[\np{nn\_chdta}\forcode{ = 0}] 
    845   a constant 0.05 g.Chl/L value everywhere ;  
    846 \item[\np{nn\_chdta}\forcode{ = 1}] 
     831\item[\np{nn\_chldta}\forcode{ = 0}] 
     832  a constant 0.05 g.Chl/L value everywhere ; 
     833\item[\np{nn\_chldta}\forcode{ = 1}] 
    847834  an observed time varying chlorophyll deduced from satellite surface ocean color measurement spread uniformly in 
    848835  the vertical direction; 
    849 \item[\np{nn\_chdta}\forcode{ = 2}] 
     836\item[\np{nn\_chldta}\forcode{ = 2}] 
    850837  same as previous case except that a vertical profile of chlorophyl is used. 
    851838  Following \cite{morel.berthon_LO89}, the profile is computed from the local surface chlorophyll value; 
     
    853840  simulated time varying chlorophyll by TOP biogeochemical model. 
    854841  In this case, the RGB formulation is used to calculate both the phytoplankton light limitation in 
    855   PISCES or LOBSTER and the oceanic heating rate. 
    856 \end{description}  
     842  PISCES and the oceanic heating rate. 
     843\end{description} 
    857844 
    858845The trend in \autoref{eq:tra_qsr} associated with the penetration of the solar radiation is added to 
     
    862849the depth of $w-$levels does not significantly vary with location. 
    863850The level at which the light has been totally absorbed 
    864 (\ie it is less than the computer precision) is computed once, 
     851(\ie\ it is less than the computer precision) is computed once, 
    865852and the trend associated with the penetration of the solar radiation is only added down to that level. 
    866853Finally, note that when the ocean is shallow ($<$ 200~m), part of the solar radiation can reach the ocean floor. 
    867854In this case, we have chosen that all remaining radiation is absorbed in the last ocean level 
    868 (\ie $I$ is masked). 
     855(\ie\ $I$ is masked). 
    869856 
    870857%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    889876%        Bottom Boundary Condition 
    890877% ------------------------------------------------------------------------------------------------------------- 
    891 \subsection[Bottom boundary condition (\textit{trabbc.F90})] 
     878\subsection[Bottom boundary condition (\textit{trabbc.F90}) - \forcode{ln_trabbc = .true.})] 
    892879{Bottom boundary condition (\protect\mdl{trabbc})} 
    893880\label{subsec:TRA_bbc} 
     
    910897 
    911898Usually it is assumed that there is no exchange of heat or salt through the ocean bottom, 
    912 \ie a no flux boundary condition is applied on active tracers at the bottom. 
     899\ie\ a no flux boundary condition is applied on active tracers at the bottom. 
    913900This is the default option in \NEMO, and it is implemented using the masking technique. 
    914901However, there is a non-zero heat flux across the seafloor that is associated with solid earth cooling. 
     
    916903but it warms systematically the ocean and acts on the densest water masses. 
    917904Taking this flux into account in a global ocean model increases the deepest overturning cell 
    918 (\ie the one associated with the Antarctic Bottom Water) by a few Sverdrups \citep{emile-geay.madec_OS09}. 
    919  
    920 Options are defined through the  \ngn{namtra\_bbc} namelist variables. 
     905(\ie\ the one associated with the Antarctic Bottom Water) by a few Sverdrups \citep{emile-geay.madec_OS09}. 
     906 
     907Options are defined through the \nam{bbc} namelist variables. 
    921908The presence of geothermal heating is controlled by setting the namelist parameter \np{ln\_trabbc} to true. 
    922909Then, when \np{nn\_geoflx} is set to 1, a constant geothermal heating is introduced whose value is given by 
    923 the \np{nn\_geoflx\_cst}, which is also a namelist parameter. 
     910the \np{rn\_geoflx\_cst}, which is also a namelist parameter. 
    924911When \np{nn\_geoflx} is set to 2, a spatially varying geothermal heat flux is introduced which is provided in 
    925912the \ifile{geothermal\_heating} NetCDF file (\autoref{fig:geothermal}) \citep{emile-geay.madec_OS09}. 
     
    928915% Bottom Boundary Layer 
    929916% ================================================================ 
    930 \section[Bottom boundary layer (\textit{trabbl.F90} - \texttt{\textbf{key\_trabbl}})] 
    931 {Bottom boundary layer (\protect\mdl{trabbl} - \protect\key{trabbl})} 
     917\section[Bottom boundary layer (\textit{trabbl.F90} - \forcode{ln_trabbl = .true.})] 
     918{Bottom boundary layer (\protect\mdl{trabbl} - \protect\np{ln\_trabbl}\forcode{ = .true.})} 
    932919\label{sec:TRA_bbl} 
    933920%--------------------------------------------nambbl--------------------------------------------------------- 
     
    936923%-------------------------------------------------------------------------------------------------------------- 
    937924 
    938 Options are defined through the \ngn{nambbl} namelist variables. 
     925Options are defined through the \nam{bbl} namelist variables. 
    939926In a $z$-coordinate configuration, the bottom topography is represented by a series of discrete steps. 
    940927This is not adequate to represent gravity driven downslope flows. 
     
    965952\label{subsec:TRA_bbl_diff} 
    966953 
    967 When applying sigma-diffusion (\key{trabbl} defined and \np{nn\_bbl\_ldf} set to 1), 
    968 the diffusive flux between two adjacent cells at the ocean floor is given by  
     954When applying sigma-diffusion (\np{ln\_trabbl}\forcode{ = .true.} and \np{nn\_bbl\_ldf} set to 1), 
     955the diffusive flux between two adjacent cells at the ocean floor is given by 
    969956\[ 
    970957  % \label{eq:tra_bbl_diff} 
     
    974961$A_l^\sigma$ the lateral diffusivity in the BBL. 
    975962Following \citet{beckmann.doscher_JPO97}, the latter is prescribed with a spatial dependence, 
    976 \ie in the conditional form 
     963\ie\ in the conditional form 
    977964\begin{equation} 
    978965  \label{eq:tra_bbl_coef} 
     
    990977(see green arrow in \autoref{fig:bbl}). 
    991978In practice, this constraint is applied separately in the two horizontal directions, 
    992 and the density gradient in \autoref{eq:tra_bbl_coef} is evaluated with the log gradient formulation:  
     979and the density gradient in \autoref{eq:tra_bbl_coef} is evaluated with the log gradient formulation: 
    993980\[ 
    994981  % \label{eq:tra_bbl_Drho} 
     
    10411028(see black arrow in \autoref{fig:bbl}) \citep{beckmann.doscher_JPO97}. 
    10421029It is a \textit{conditional advection}, that is, advection is allowed only 
    1043 if dense water overlies less dense water on the slope (\ie $\nabla_\sigma \rho \cdot \nabla H < 0$) and 
    1044 if the velocity is directed towards greater depth (\ie $\vect U \cdot \nabla H > 0$). 
     1030if dense water overlies less dense water on the slope (\ie\ $\nabla_\sigma \rho \cdot \nabla H < 0$) and 
     1031if the velocity is directed towards greater depth (\ie\ $\vect U \cdot \nabla H > 0$). 
    10451032 
    10461033\np{nn\_bbl\_adv}\forcode{ = 2}: 
     
    10481035the density difference between the higher cell and lower cell densities \citep{campin.goosse_T99}. 
    10491036The advection is allowed only  if dense water overlies less dense water on the slope 
    1050 (\ie $\nabla_\sigma \rho \cdot \nabla H < 0$). 
     1037(\ie\ $\nabla_\sigma \rho \cdot \nabla H < 0$). 
    10511038For example, the resulting transport of the downslope flow, here in the $i$-direction (\autoref{fig:bbl}), 
    10521039is simply given by the following expression: 
     
    10701057The advective BBL scheme modifies the tracer time tendency of the ocean cells near the topographic step by 
    10711058the downslope flow \autoref{eq:bbl_dw}, the horizontal \autoref{eq:bbl_hor} and 
    1072 the upward \autoref{eq:bbl_up} return flows as follows:  
     1059the upward \autoref{eq:bbl_up} return flows as follows: 
    10731060\begin{alignat}{3} 
    10741061  \label{eq:bbl_dw} 
     
    11081095    \pd[S]{t} = \cdots - \gamma (S - S_o) 
    11091096  \end{gathered} 
    1110 \end{equation}  
     1097\end{equation} 
    11111098where $\gamma$ is the inverse of a time scale, and $T_o$ and $S_o$ are given temperature and salinity fields 
    11121099(usually a climatology). 
    1113 Options are defined through the  \ngn{namtra\_dmp} namelist variables. 
     1100Options are defined through the  \nam{tra\_dmp} namelist variables. 
    11141101The restoring term is added when the namelist parameter \np{ln\_tradmp} is set to true. 
    1115 It also requires that both \np{ln\_tsd\_init} and \np{ln\_tsd\_tradmp} are set to true in 
    1116 \ngn{namtsd} namelist as well as \np{sn\_tem} and \np{sn\_sal} structures are correctly set 
    1117 (\ie that $T_o$ and $S_o$ are provided in input files and read using \mdl{fldread}, 
     1102It also requires that both \np{ln\_tsd\_init} and \np{ln\_tsd\_dmp} are set to true in 
     1103\nam{tsd} namelist as well as \np{sn\_tem} and \np{sn\_sal} structures are correctly set 
     1104(\ie\ that $T_o$ and $S_o$ are provided in input files and read using \mdl{fldread}, 
    11181105see \autoref{subsec:SBC_fldread}). 
    11191106The restoring coefficient $\gamma$ is a three-dimensional array read in during the \rou{tra\_dmp\_init} routine. 
     
    11571144%-------------------------------------------------------------------------------------------------------------- 
    11581145 
    1159 Options are defined through the \ngn{namdom} namelist variables. 
     1146Options are defined through the \nam{dom} namelist variables. 
    11601147The general framework for tracer time stepping is a modified leap-frog scheme \citep{leclair.madec_OM09}, 
    1161 \ie a three level centred time scheme associated with a Asselin time filter (cf. \autoref{sec:STP_mLF}): 
     1148\ie\ a three level centred time scheme associated with a Asselin time filter (cf. \autoref{sec:STP_mLF}): 
    11621149\begin{equation} 
    11631150  \label{eq:tra_nxt} 
     
    11651152    &(e_{3t}T)^{t + \rdt} &&= (e_{3t}T)_f^{t - \rdt} &&+ 2 \, \rdt \,e_{3t}^t \ \text{RHS}^t \\ 
    11661153    &(e_{3t}T)_f^t        &&= (e_{3t}T)^t            &&+ \, \gamma \, \lt[ (e_{3t}T)_f^{t - \rdt} - 2(e_{3t}T)^t + (e_{3t}T)^{t + \rdt} \rt] \\ 
    1167     &                     &&                         &&- \, \gamma \, \rdt \, \lt[ Q^{t + \rdt/2} - Q^{t - \rdt/2} \rt]   
     1154    &                     &&                         &&- \, \gamma \, \rdt \, \lt[ Q^{t + \rdt/2} - Q^{t - \rdt/2} \rt] 
    11681155  \end{alignedat} 
    1169 \end{equation}  
     1156\end{equation} 
    11701157where RHS is the right hand side of the temperature equation, the subscript $f$ denotes filtered values, 
    11711158$\gamma$ is the Asselin coefficient, and $S$ is the total forcing applied on $T$ 
    1172 (\ie fluxes plus content in mass exchanges). 
     1159(\ie\ fluxes plus content in mass exchanges). 
    11731160$\gamma$ is initialized as \np{rn\_atfp} (\textbf{namelist} parameter). 
    11741161Its default value is \np{rn\_atfp}\forcode{ = 10.e-3}. 
    11751162Note that the forcing correction term in the filter is not applied in linear free surface 
    1176 (\jp{lk\_vvl}\forcode{ = .false.}) (see \autoref{subsec:TRA_sbc}). 
     1163(\jp{ln\_linssh}\forcode{ = .true.}) (see \autoref{subsec:TRA_sbc}). 
    11771164Not also that in constant volume case, the time stepping is performed on $T$, not on its content, $e_{3t}T$. 
    11781165 
     
    11851172 
    11861173% ================================================================ 
    1187 % Equation of State (eosbn2)  
     1174% Equation of State (eosbn2) 
    11881175% ================================================================ 
    11891176\section[Equation of state (\textit{eosbn2.F90})] 
     
    11981185%        Equation of State 
    11991186% ------------------------------------------------------------------------------------------------------------- 
    1200 \subsection[Equation of seawater (\forcode{nn_eos = {-1,1}})] 
    1201 {Equation of seawater (\protect\np{nn\_eos}\forcode{ = {-1,1}})} 
     1187\subsection[Equation of seawater (\texttt{ln}\{\texttt{\_teso10,\_eos80,\_seos}\})] 
     1188{Equation of seawater (\protect\np{ln\_teos10}, \protect\np{ln\_teos80}, or \protect\np{ln\_seos}) } 
    12021189\label{subsec:TRA_eos} 
     1190 
    12031191 
    12041192The Equation Of Seawater (EOS) is an empirical nonlinear thermodynamic relationship linking seawater density, 
     
    12171205\textit{(ii)}  it is more accurate, being based on an updated database of laboratory measurements, and 
    12181206\textit{(iii)} it uses Conservative Temperature and Absolute Salinity (instead of potential temperature and 
    1219 practical salinity for EOS-980, both variables being more suitable for use as model variables 
     1207practical salinity for EOS-80, both variables being more suitable for use as model variables 
    12201208\citep{ioc.iapso_bk10, graham.mcdougall_JPO13}. 
    1221 EOS-80 is an obsolescent feature of the NEMO system, kept only for backward compatibility. 
     1209EOS-80 is an obsolescent feature of the \NEMO\ system, kept only for backward compatibility. 
    12221210For process studies, it is often convenient to use an approximation of the EOS. 
    12231211To that purposed, a simplified EOS (S-EOS) inspired by \citet{vallis_bk06} is also available. 
     
    12291217density in the World Ocean varies by no more than 2$\%$ from that value \citep{gill_bk82}. 
    12301218 
    1231 Options are defined through the \ngn{nameos} namelist variables, and in particular \np{nn\_eos} which 
    1232 controls the EOS used (\forcode{= -1} for TEOS10 ; \forcode{= 0} for EOS-80 ; \forcode{= 1} for S-EOS). 
     1219Options which control the EOS used are defined through the \ngn{nameos} namelist variables. 
    12331220 
    12341221\begin{description} 
    1235 \item[\np{nn\_eos}\forcode{ = -1}] 
     1222\item[\np{ln\_teos10}\forcode{ = .true.}] 
    12361223  the polyTEOS10-bsq equation of seawater \citep{roquet.madec.ea_OM15} is used. 
    12371224  The accuracy of this approximation is comparable to the TEOS-10 rational function approximation, 
     
    12491236  In particular, the initial state deined by the user have to be given as \textit{Conservative} Temperature and 
    12501237  \textit{Absolute} Salinity. 
    1251   In addition, setting \np{ln\_useCT} to \forcode{.true.} convert the Conservative SST to potential SST prior to 
     1238  In addition, when using TEOS10, the Conservative SST is converted to potential SST prior to 
    12521239  either computing the air-sea and ice-sea fluxes (forced mode) or 
    12531240  sending the SST field to the atmosphere (coupled mode). 
    1254 \item[\np{nn\_eos}\forcode{ = 0}] 
     1241\item[\np{ln\_eos80}\forcode{ = .true.}] 
    12551242  the polyEOS80-bsq equation of seawater is used. 
    12561243  It takes the same polynomial form as the polyTEOS10, but the coefficients have been optimized to 
     
    12641251  Nevertheless, a severe assumption is made in order to have a heat content ($C_p T_p$) which 
    12651252  is conserved by the model: $C_p$ is set to a constant value, the TEOS10 value. 
    1266 \item[\np{nn\_eos}\forcode{ = 1}] 
     1253\item[\np{ln\_seos}\forcode{ = .true.}] 
    12671254  a simplified EOS (S-EOS) inspired by \citet{vallis_bk06} is chosen, 
    12681255  the coefficients of which has been optimized to fit the behavior of TEOS10 
     
    12741261  as well as between \textit{absolute} and \textit{practical} salinity. 
    12751262  S-EOS takes the following expression: 
     1263 
    12761264  \begin{gather*} 
    12771265    % \label{eq:tra_S-EOS} 
    12781266    \begin{alignedat}{2} 
    12791267    &d_a(T,S,z) = \frac{1}{\rho_o} \big[ &- a_0 \; ( 1 + 0.5 \; \lambda_1 \; T_a + \mu_1 \; z ) * &T_a \big. \\ 
    1280     &                                    &+ b_0 \; ( 1 - 0.5 \; \lambda_2 \; S_a - \mu_2 \; z ) * &S_a       \\   
     1268    &                                    &+ b_0 \; ( 1 - 0.5 \; \lambda_2 \; S_a - \mu_2 \; z ) * &S_a       \\ 
    12811269    &                              \big. &- \nu \;                           T_a                  &S_a \big] \\ 
    12821270    \end{alignedat} 
     
    13261314%        Brunt-V\"{a}is\"{a}l\"{a} Frequency 
    13271315% ------------------------------------------------------------------------------------------------------------- 
    1328 \subsection[Brunt-V\"{a}is\"{a}l\"{a} frequency (\forcode{nn_eos = [0-2]})] 
    1329 {Brunt-V\"{a}is\"{a}l\"{a} frequency (\protect\np{nn\_eos}\forcode{ = [0-2]})} 
     1316\subsection[Brunt-V\"{a}is\"{a}l\"{a} frequency] 
     1317{Brunt-V\"{a}is\"{a}l\"{a} frequency} 
    13301318\label{subsec:TRA_bn2} 
    13311319 
     
    13361324In particular, $N^2$ has to be computed at the local pressure 
    13371325(pressure in decibar being approximated by the depth in meters). 
    1338 The expression for $N^2$  is given by:  
     1326The expression for $N^2$  is given by: 
    13391327\[ 
    13401328  % \label{eq:tra_bn2} 
     
    13581346  \begin{split} 
    13591347    &T_f (S,p) = \lt( a + b \, \sqrt{S} + c \, S \rt) \, S + d \, p \\ 
    1360     &\text{where~} a = -0.0575, \, b = 1.710523~10^{-3}, \, c = -2.154996~10^{-4} \\  
     1348    &\text{where~} a = -0.0575, \, b = 1.710523~10^{-3}, \, c = -2.154996~10^{-4} \\ 
    13611349    &\text{and~} d = -7.53~10^{-3} 
    13621350    \end{split} 
     
    13641352 
    13651353\autoref{eq:tra_eos_fzp} is only used to compute the potential freezing point of sea water 
    1366 (\ie referenced to the surface $p = 0$), 
     1354(\ie\ referenced to the surface $p = 0$), 
    13671355thus the pressure dependent terms in \autoref{eq:tra_eos_fzp} (last term) have been dropped. 
    13681356The freezing point is computed through \textit{eos\_fzp}, 
     
    13701358 
    13711359% ------------------------------------------------------------------------------------------------------------- 
    1372 %        Potential Energy      
     1360%        Potential Energy 
    13731361% ------------------------------------------------------------------------------------------------------------- 
    13741362%\subsection{Potential Energy anomalies} 
     
    13791367 
    13801368% ================================================================ 
    1381 % Horizontal Derivative in zps-coordinate  
     1369% Horizontal Derivative in zps-coordinate 
    13821370% ================================================================ 
    13831371\section[Horizontal derivative in \textit{zps}-coordinate (\textit{zpshde.F90})] 
     
    13851373\label{sec:TRA_zpshde} 
    13861374 
    1387 \gmcomment{STEVEN: to be consistent with earlier discussion of differencing and averaging operators,  
     1375\gmcomment{STEVEN: to be consistent with earlier discussion of differencing and averaging operators, 
    13881376I've changed "derivative" to "difference" and "mean" to "average"} 
    13891377 
     
    14271415  \rt. 
    14281416\] 
    1429 and the resulting forms for the horizontal difference and the horizontal average value of $T$ at a $U$-point are:  
     1417and the resulting forms for the horizontal difference and the horizontal average value of $T$ at a $U$-point are: 
    14301418\begin{equation} 
    14311419  \label{eq:zps_hde} 
     
    14531441Instead of forming a linear approximation of density, we compute $\widetilde \rho$ from the interpolated values of 
    14541442$T$ and $S$, and the pressure at a $u$-point 
    1455 (in the equation of state pressure is approximated by depth, see \autoref{subsec:TRA_eos}):  
     1443(in the equation of state pressure is approximated by depth, see \autoref{subsec:TRA_eos}): 
    14561444\[ 
    14571445  % \label{eq:zps_hde_rho} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_ZDF.tex

    r11353 r11512  
    88\label{chap:ZDF} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212%gm% Add here a small introduction to ZDF and naming of the different physics (similar to what have been written for TRA and DYN. 
     
    2525At the surface they are prescribed from the surface forcing (see \autoref{chap:SBC}), 
    2626while at the bottom they are set to zero for heat and salt, 
    27 unless a geothermal flux forcing is prescribed as a bottom boundary condition (\ie \np{ln\_trabbc} defined, 
     27unless a geothermal flux forcing is prescribed as a bottom boundary condition (\ie\ \np{ln\_trabbc} defined, 
    2828see \autoref{subsec:TRA_bbc}), and specified through a bottom friction parameterisation for momentum 
    29 (see \autoref{sec:ZDF_drg}).  
     29(see \autoref{sec:ZDF_drg}). 
    3030 
    3131In this section we briefly discuss the various choices offered to compute the vertical eddy viscosity and 
     
    3737the \mdl{zdfric}, \mdl{zdftke} or \mdl{zdfgls} or \mdl{zdfosm} modules. 
    3838The trends due to the vertical momentum and tracer diffusion, including the surface forcing, 
    39 are computed and added to the general trend in the \mdl{dynzdf} and \mdl{trazdf} modules, respectively.  
     39are computed and added to the general trend in the \mdl{dynzdf} and \mdl{trazdf} modules, respectively. 
    4040%These trends can be computed using either a forward time stepping scheme 
    4141%(namelist parameter \np{ln\_zdfexp}\forcode{ = .true.}) or a backward time stepping scheme 
     
    4949 
    5050% ------------------------------------------------------------------------------------------------------------- 
    51 %        Constant  
     51%        Constant 
    5252% ------------------------------------------------------------------------------------------------------------- 
    5353\subsection[Constant (\forcode{ln_zdfcst = .true.})] 
     
    5555\label{subsec:ZDF_cst} 
    5656 
    57 Options are defined through the \ngn{namzdf} namelist variables. 
     57Options are defined through the \nam{zdf} namelist variables. 
    5858When \np{ln\_zdfcst} is defined, the momentum and tracer vertical eddy coefficients are set to 
    5959constant values over the whole ocean. 
     
    6666\end{align*} 
    6767 
    68 These values are set through the \np{rn\_avm0} and \np{rn\_avt0} namelist parameters.  
     68These values are set through the \np{rn\_avm0} and \np{rn\_avt0} namelist parameters. 
    6969In all cases, do not use values smaller that those associated with the molecular viscosity and diffusivity, 
    7070that is $\sim10^{-6}~m^2.s^{-1}$ for momentum, $\sim10^{-7}~m^2.s^{-1}$ for temperature and 
     
    8484 
    8585When \np{ln\_zdfric}\forcode{ = .true.}, a local Richardson number dependent formulation for the vertical momentum and 
    86 tracer eddy coefficients is set through the \ngn{namzdf\_ric} namelist variables. 
    87 The vertical mixing coefficients are diagnosed from the large scale variables computed by the model.  
     86tracer eddy coefficients is set through the \nam{zdf\_ric} namelist variables. 
     87The vertical mixing coefficients are diagnosed from the large scale variables computed by the model. 
    8888\textit{In situ} measurements have been used to link vertical turbulent activity to large scale ocean structures. 
    8989The hypothesis of a mixing mainly maintained by the growth of Kelvin-Helmholtz like instabilities leads to 
    9090a dependency between the vertical eddy coefficients and the local Richardson number 
    91 (\ie the ratio of stratification to vertical shear). 
     91(\ie\ the ratio of stratification to vertical shear). 
    9292Following \citet{pacanowski.philander_JPO81}, the following formulation has been implemented: 
    9393\[ 
     
    101101\] 
    102102where $Ri = N^2 / \left(\partial_z \textbf{U}_h \right)^2$ is the local Richardson number, 
    103 $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}),  
     103$N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}), 
    104104$A_b^{vT} $ and $A_b^{vm}$ are the constant background values set as in the constant case 
    105105(see \autoref{subsec:ZDF_cst}), and $A_{ric}^{vT} = 10^{-4}~m^2.s^{-1}$ is the maximum value that 
     
    130130 
    131131% ------------------------------------------------------------------------------------------------------------- 
    132 %        TKE Turbulent Closure Scheme  
     132%        TKE Turbulent Closure Scheme 
    133133% ------------------------------------------------------------------------------------------------------------- 
    134134\subsection[TKE turbulent closure scheme (\forcode{ln_zdftke = .true.})] 
     
    144144and a closure assumption for the turbulent length scales. 
    145145This turbulent closure model has been developed by \citet{bougeault.lacarrere_MWR89} in the atmospheric case, 
    146 adapted by \citet{gaspar.gregoris.ea_JGR90} for the oceanic case, and embedded in OPA, the ancestor of NEMO, 
     146adapted by \citet{gaspar.gregoris.ea_JGR90} for the oceanic case, and embedded in OPA, the ancestor of \NEMO, 
    147147by \citet{blanke.delecluse_JPO93} for equatorial Atlantic simulations. 
    148148Since then, significant modifications have been introduced by \citet{madec.delecluse.ea_NPM98} in both the implementation and 
     
    167167  \end{split} 
    168168\] 
    169 where $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}),  
    170 $l_{\epsilon }$ and $l_{\kappa }$ are the dissipation and mixing length scales,  
     169where $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}), 
     170$l_{\epsilon }$ and $l_{\kappa }$ are the dissipation and mixing length scales, 
    171171$P_{rt}$ is the Prandtl number, $K_m$ and $K_\rho$ are the vertical eddy viscosity and diffusivity coefficients. 
    172172The constants $C_k =  0.1$ and $C_\epsilon = \sqrt {2} /2$ $\approx 0.7$ are designed to deal with 
    173 vertical mixing at any depth \citep{gaspar.gregoris.ea_JGR90}.  
     173vertical mixing at any depth \citep{gaspar.gregoris.ea_JGR90}. 
    174174They are set through namelist parameters \np{nn\_ediff} and \np{nn\_ediss}. 
    175175$P_{rt}$ can be set to unity or, following \citet{blanke.delecluse_JPO93}, be a function of the local Richardson number, $R_i$: 
     
    199199too weak vertical diffusion. 
    200200They must be specified at least larger than the molecular values, and are set through \np{rn\_avm0} and 
    201 \np{rn\_avt0} (\ngn{namzdf} namelist, see \autoref{subsec:ZDF_cst}). 
     201\np{rn\_avt0} (\nam{zdf} namelist, see \autoref{subsec:ZDF_cst}). 
    202202 
    203203\subsubsection{Turbulent length scale} 
     
    227227\autoref{eq:tke_mxl_constraint} means that the vertical variations of the length scale cannot be larger than 
    228228the variations of depth. 
    229 It provides a better approximation of the \citet{gaspar.gregoris.ea_JGR90} formulation while being much less  
     229It provides a better approximation of the \citet{gaspar.gregoris.ea_JGR90} formulation while being much less 
    230230time consuming. 
    231231In particular, it allows the length scale to be limited not only by the distance to the surface or 
     
    256256  \end{aligned} 
    257257\] 
    258 where $l^{(k)}$ is computed using \autoref{eq:tke_mxl0_1}, \ie $l^{(k)} = \sqrt {2 {\bar e}^{(k)} / {N^2}^{(k)} }$. 
     258where $l^{(k)}$ is computed using \autoref{eq:tke_mxl0_1}, \ie\ $l^{(k)} = \sqrt {2 {\bar e}^{(k)} / {N^2}^{(k)} }$. 
    259259 
    260260In the \np{nn\_mxl}\forcode{ = 2} case, the dissipation and mixing length scales take the same value: 
     
    283283This results in a reduction of summertime surface temperature when the mixed layer is relatively shallow. 
    284284The \citet{mellor.blumberg_JPO04} modifications acts on surface length scale and TKE values and 
    285 air-sea drag coefficient.  
    286 The latter concerns the bulk formulae and is not discussed here.  
     285air-sea drag coefficient. 
     286The latter concerns the bulk formulae and is not discussed here. 
    287287 
    288288Following \citet{craig.banner_JPO94}, the boundary condition on surface TKE value is : 
     
    292292\end{equation} 
    293293where $\alpha_{CB}$ is the \citet{craig.banner_JPO94} constant of proportionality which depends on the ''wave age'', 
    294 ranging from 57 for mature waves to 146 for younger waves \citep{mellor.blumberg_JPO04}.  
     294ranging from 57 for mature waves to 146 for younger waves \citep{mellor.blumberg_JPO04}. 
    295295The boundary condition on the turbulent length scale follows the Charnock's relation: 
    296296\begin{equation} 
     
    303303$\alpha_{CB} = 100$ the Craig and Banner's value. 
    304304As the surface boundary condition on TKE is prescribed through $\bar{e}_o = e_{bb} |\tau| / \rho_o$, 
    305 with $e_{bb}$ the \np{rn\_ebb} namelist parameter, setting \np{rn\_ebb}\forcode{ = 67.83} corresponds  
     305with $e_{bb}$ the \np{rn\_ebb} namelist parameter, setting \np{rn\_ebb}\forcode{ = 67.83} corresponds 
    306306to $\alpha_{CB} = 100$. 
    307 Further setting  \np{ln\_mxl0=.true.},  applies \autoref{eq:ZDF_Lsbc} as the surface boundary condition on the length scale, 
     307Further setting  \np{ln\_mxl0}\forcode{ =.true.},  applies \autoref{eq:ZDF_Lsbc} as the surface boundary condition on the length scale, 
    308308with $\beta$ hard coded to the Stacey's value. 
    309 Note that a minimal threshold of \np{rn\_emin0}$=10^{-4}~m^2.s^{-2}$ (namelist parameters) is applied on the  
     309Note that a minimal threshold of \np{rn\_emin0}$=10^{-4}~m^2.s^{-2}$ (namelist parameters) is applied on the 
    310310surface $\bar{e}$ value. 
    311311 
     
    319319The detailed physics behind LC is described in, for example, \citet{craik.leibovich_JFM76}. 
    320320The prevailing explanation is that LC arise from a nonlinear interaction between the Stokes drift and 
    321 wind drift currents.  
     321wind drift currents. 
    322322 
    323323Here we introduced in the TKE turbulent closure the simple parameterization of Langmuir circulations proposed by 
     
    326326an extra source term of TKE, $P_{LC}$. 
    327327The presence of $P_{LC}$ in \autoref{eq:zdftke_e}, the TKE equation, is controlled by setting \np{ln\_lc} to 
    328 \forcode{.true.} in the \ngn{namzdf\_tke} namelist. 
    329   
     328\forcode{.true.} in the \nam{zdf\_tke} namelist. 
     329 
    330330By making an analogy with the characteristic convective velocity scale (\eg, \citet{dalessio.abdella.ea_JPO98}), 
    331 $P_{LC}$ is assumed to be :  
     331$P_{LC}$ is assumed to be : 
    332332\[ 
    333333P_{LC}(z) = \frac{w_{LC}^3(z)}{H_{LC}} 
    334334\] 
    335335where $w_{LC}(z)$ is the vertical velocity profile of LC, and $H_{LC}$ is the LC depth. 
    336 With no information about the wave field, $w_{LC}$ is assumed to be proportional to  
    337 the Stokes drift $u_s = 0.377\,\,|\tau|^{1/2}$, where $|\tau|$ is the surface wind stress module  
     336With no information about the wave field, $w_{LC}$ is assumed to be proportional to 
     337the Stokes drift $u_s = 0.377\,\,|\tau|^{1/2}$, where $|\tau|$ is the surface wind stress module 
    338338\footnote{Following \citet{li.garrett_JMR93}, the surface Stoke drift velocity may be expressed as 
    339339  $u_s =  0.016 \,|U_{10m}|$. 
     
    343343For the vertical variation, $w_{LC}$ is assumed to be zero at the surface as well as at 
    344344a finite depth $H_{LC}$ (which is often close to the mixed layer depth), 
    345 and simply varies as a sine function in between (a first-order profile for the Langmuir cell structures).  
     345and simply varies as a sine function in between (a first-order profile for the Langmuir cell structures). 
    346346The resulting expression for $w_{LC}$ is : 
    347347\[ 
     
    355355The chosen value yields maximum vertical velocities $w_{LC}$ of the order of a few centimeters per second. 
    356356The value of $c_{LC}$ is set through the \np{rn\_lc} namelist parameter, 
    357 having in mind that it should stay between 0.15 and 0.54 \citep{axell_JGR02}.  
     357having in mind that it should stay between 0.15 and 0.54 \citep{axell_JGR02}. 
    358358 
    359359The $H_{LC}$ is estimated in a similar way as the turbulent length scale of TKE equations: 
    360360$H_{LC}$ is the depth to which a water parcel with kinetic energy due to Stoke drift can reach on its own by 
    361 converting its kinetic energy to potential energy, according to  
     361converting its kinetic energy to potential energy, according to 
    362362\[ 
    363363- \int_{-H_{LC}}^0 { N^2\;z  \;dz} = \frac{1}{2} u_s^2 
     
    370370produce mixed-layer depths that are too shallow during summer months and windy conditions. 
    371371This bias is particularly acute over the Southern Ocean. 
    372 To overcome this systematic bias, an ad hoc parameterization is introduced into the TKE scheme \cite{rodgers.aumont.ea_B14}.  
    373 The parameterization is an empirical one, \ie not derived from theoretical considerations, 
    374 but rather is meant to account for observed processes that affect the density structure of  
    375 the ocean’s planetary boundary layer that are not explicitly captured by default in the TKE scheme  
    376 (\ie near-inertial oscillations and ocean swells and waves). 
    377  
    378 When using this parameterization (\ie when \np{nn\_etau}\forcode{ = 1}), 
     372To overcome this systematic bias, an ad hoc parameterization is introduced into the TKE scheme \cite{rodgers.aumont.ea_B14}. 
     373The parameterization is an empirical one, \ie\ not derived from theoretical considerations, 
     374but rather is meant to account for observed processes that affect the density structure of 
     375the ocean’s planetary boundary layer that are not explicitly captured by default in the TKE scheme 
     376(\ie\ near-inertial oscillations and ocean swells and waves). 
     377 
     378When using this parameterization (\ie\ when \np{nn\_etau}\forcode{ = 1}), 
    379379the TKE input to the ocean ($S$) imposed by the winds in the form of near-inertial oscillations, 
    380380swell and waves is parameterized by \autoref{eq:ZDF_Esbc} the standard TKE surface boundary condition, 
     
    387387penetrates in the ocean, $h_\tau$ is a vertical mixing length scale that controls exponential shape of 
    388388the penetration, and $f_i$ is the ice concentration 
    389 (no penetration if $f_i=1$, \ie if the ocean is entirely covered by sea-ice). 
     389(no penetration if $f_i=1$, \ie\ if the ocean is entirely covered by sea-ice). 
    390390The value of $f_r$, usually a few percents, is specified through \np{rn\_efr} namelist parameter. 
    391391The vertical mixing length scale, $h_\tau$, can be set as a 10~m uniform value (\np{nn\_etau}\forcode{ = 0}) or 
    392392a latitude dependent value (varying from 0.5~m at the Equator to a maximum value of 30~m at high latitudes 
    393 (\np{nn\_etau}\forcode{ = 1}).  
     393(\np{nn\_etau}\forcode{ = 1}). 
    394394 
    395395Note that two other option exist, \np{nn\_etau}\forcode{ = 2, 3}. 
    396396They correspond to applying \autoref{eq:ZDF_Ehtau} only at the base of the mixed layer, 
    397 or to using the high frequency part of the stress to evaluate the fraction of TKE that penetrates the ocean.  
     397or to using the high frequency part of the stress to evaluate the fraction of TKE that penetrates the ocean. 
    398398Those two options are obsolescent features introduced for test purposes. 
    399 They will be removed in the next release.  
     399They will be removed in the next release. 
    400400 
    401401% This should be explain better below what this rn_eice parameter is meant for: 
    402402In presence of Sea Ice, the value of this mixing can be modulated by the \np{rn\_eice} namelist parameter. 
    403403This parameter varies from \forcode{0} for no effect to \forcode{4} to suppress the TKE input into the ocean when Sea Ice concentration 
    404 is greater than 25\%.  
    405  
    406 % from Burchard et al OM 2008 :  
    407 % the most critical process not reproduced by statistical turbulence models is the activity of  
    408 % internal waves and their interaction with turbulence. After the Reynolds decomposition,  
    409 % internal waves are in principle included in the RANS equations, but later partially  
    410 % excluded by the hydrostatic assumption and the model resolution.  
    411 % Thus far, the representation of internal wave mixing in ocean models has been relatively crude  
    412 % (\eg Mellor, 1989; Large et al., 1994; Meier, 2001; Axell, 2002; St. Laurent and Garrett, 2002). 
    413  
    414 % ------------------------------------------------------------------------------------------------------------- 
    415 %        GLS Generic Length Scale Scheme  
     404is greater than 25\%. 
     405 
     406% from Burchard et al OM 2008 : 
     407% the most critical process not reproduced by statistical turbulence models is the activity of 
     408% internal waves and their interaction with turbulence. After the Reynolds decomposition, 
     409% internal waves are in principle included in the RANS equations, but later partially 
     410% excluded by the hydrostatic assumption and the model resolution. 
     411% Thus far, the representation of internal wave mixing in ocean models has been relatively crude 
     412% (\eg\ Mellor, 1989; Large et al., 1994; Meier, 2001; Axell, 2002; St. Laurent and Garrett, 2002). 
     413 
     414% ------------------------------------------------------------------------------------------------------------- 
     415%        GLS Generic Length Scale Scheme 
    416416% ------------------------------------------------------------------------------------------------------------- 
    417417\subsection[GLS: Generic Length Scale (\forcode{ln_zdfgls = .true.})] 
     
    427427one for the turbulent kinetic energy $\bar {e}$, and another for the generic length scale, 
    428428$\psi$ \citep{umlauf.burchard_JMR03, umlauf.burchard_CSR05}. 
    429 This later variable is defined as: $\psi = {C_{0\mu}}^{p} \ {\bar{e}}^{m} \ l^{n}$,  
     429This later variable is defined as: $\psi = {C_{0\mu}}^{p} \ {\bar{e}}^{m} \ l^{n}$, 
    430430where the triplet $(p, m, n)$ value given in Tab.\autoref{tab:GLS} allows to recover a number of 
    431431well-known turbulent closures ($k$-$kl$ \citep{mellor.yamada_RG82}, $k$-$\epsilon$ \citep{rodi_JGR87}, 
    432 $k$-$\omega$ \citep{wilcox_AJ88} among others \citep{umlauf.burchard_JMR03,kantha.carniel_JMR03}).  
     432$k$-$\omega$ \citep{wilcox_AJ88} among others \citep{umlauf.burchard_JMR03,kantha.carniel_JMR03}). 
    433433The GLS scheme is given by the following set of equations: 
    434434\begin{equation} 
     
    467467\] 
    468468where $N$ is the local Brunt-Vais\"{a}l\"{a} frequency (see \autoref{subsec:TRA_bn2}) and 
    469 $\epsilon$ the dissipation rate.  
     469$\epsilon$ the dissipation rate. 
    470470The constants $C_1$, $C_2$, $C_3$, ${\sigma_e}$, ${\sigma_{\psi}}$ and the wall function ($Fw$) depends of 
    471471the choice of the turbulence model. 
    472472Four different turbulent models are pre-defined (\autoref{tab:GLS}). 
    473 They are made available through the \np{nn\_clo} namelist parameter.  
     473They are made available through the \np{nn\_clo} namelist parameter. 
    474474 
    475475%--------------------------------------------------TABLE-------------------------------------------------- 
     
    497497      \protect\label{tab:GLS} 
    498498      Set of predefined GLS parameters, or equivalently predefined turbulence models available with 
    499       \protect\np{ln\_zdfgls}\forcode{ = .true.} and controlled by the \protect\np{nn\_clos} namelist variable in \protect\ngn{namzdf\_gls}. 
     499      \protect\np{ln\_zdfgls}\forcode{ = .true.} and controlled by the \protect\np{nn\_clos} namelist variable in \protect\nam{zdf\_gls}. 
    500500    } 
    501501  \end{center} 
     
    508508$C_{\mu}$ and $C_{\mu'}$ are calculated from stability function proposed by \citet{galperin.kantha.ea_JAS88}, 
    509509or by \citet{kantha.clayson_JGR94} or one of the two functions suggested by \citet{canuto.howard.ea_JPO01} 
    510 (\np{nn\_stab\_func}\forcode{ = 0, 3}, resp.).   
     510(\np{nn\_stab\_func}\forcode{ = 0, 3}, resp.). 
    511511The value of $C_{0\mu}$ depends on the choice of the stability function. 
    512512 
     
    516516\np{rn\_crban}\forcode{ > 0.} \citep{craig.banner_JPO94, mellor.blumberg_JPO04}. 
    517517The \np{rn\_crban} namelist parameter is $\alpha_{CB}$ in \autoref{eq:ZDF_Esbc} and 
    518 \np{rn\_charn} provides the value of $\beta$ in \autoref{eq:ZDF_Lsbc}.  
     518\np{rn\_charn} provides the value of $\beta$ in \autoref{eq:ZDF_Lsbc}. 
    519519 
    520520The $\psi$ equation is known to fail in stably stratified flows, and for this reason 
     
    531531the TKE case described in \autoref{subsec:ZDF_tke_ene} \citep{burchard_OM02}. 
    532532Evaluation of the 4 GLS turbulent closure schemes can be found in \citet{warner.sherwood.ea_OM05} in ROMS model and 
    533  in \citet{reffray.guillaume.ea_GMD15} for the \NEMO model. 
    534  
    535  
    536 % ------------------------------------------------------------------------------------------------------------- 
    537 %        OSM OSMOSIS BL Scheme  
     533 in \citet{reffray.guillaume.ea_GMD15} for the \NEMO\ model. 
     534 
     535 
     536% ------------------------------------------------------------------------------------------------------------- 
     537%        OSM OSMOSIS BL Scheme 
    538538% ------------------------------------------------------------------------------------------------------------- 
    539539\subsection[OSM: OSMosis boundary layer scheme (\forcode{ln_zdfosm = .true.})] 
     
    562562      Illustration of the subgrid kinetic energy integration in GLS and TKE schemes and its links to the momentum and tracer time integration. 
    563563    } 
    564   \end{center}   
     564  \end{center} 
    565565\end{figure} 
    566566%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    577577With this framework, the total loss of kinetic energy (in 1D for the demonstration) due to 
    578578the vertical momentum diffusion is obtained by multiplying this quantity by $u^t$ and 
    579 summing the result vertically:    
     579summing the result vertically: 
    580580\begin{equation} 
    581581  \label{eq:energ1} 
     
    613613  \end{split} 
    614614\end{equation} 
    615 where we use $N^2 = -g \,\partial_k \rho / (e_3 \rho)$.  
     615where we use $N^2 = -g \,\partial_k \rho / (e_3 \rho)$. 
    616616The first term of the right hand side of \autoref{eq:energ2} is always zero because 
    617617there is no diffusive flux through the ocean surface and bottom). 
     
    652652%The restart of the TKE scheme requires the storage of $\bar {e}$, $K_m$, $K_\rho$ and $l_\epsilon$ as 
    653653%they all appear in the right hand side of \autoref{eq:zdftke_ene}. 
    654 %For the latter, it is in fact the ratio $\sqrt{\bar{e}}/l_\epsilon$ which is stored.  
     654%For the latter, it is in fact the ratio $\sqrt{\bar{e}}/l_\epsilon$ which is stored. 
    655655 
    656656% ================================================================ 
     
    660660\label{sec:ZDF_conv} 
    661661 
    662 Static instabilities (\ie light potential densities under heavy ones) may occur at particular ocean grid points. 
     662Static instabilities (\ie\ light potential densities under heavy ones) may occur at particular ocean grid points. 
    663663In nature, convective processes quickly re-establish the static stability of the water column. 
    664664These processes have been removed from the model via the hydrostatic assumption so they must be parameterized. 
     
    668668 
    669669% ------------------------------------------------------------------------------------------------------------- 
    670 %       Non-Penetrative Convective Adjustment  
     670%       Non-Penetrative Convective Adjustment 
    671671% ------------------------------------------------------------------------------------------------------------- 
    672672\subsection[Non-penetrative convective adjustment (\forcode{ln_tranpc = .true.})] 
     
    696696%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    697697 
    698 Options are defined through the \ngn{namzdf} namelist variables. 
     698Options are defined through the \nam{zdf} namelist variables. 
    699699The non-penetrative convective adjustment is used when \np{ln\_zdfnpc}\forcode{ = .true.}. 
    700700It is applied at each \np{nn\_npc} time step and mixes downwards instantaneously the statically unstable portion of 
    701701the water column, but only until the density structure becomes neutrally stable 
    702 (\ie until the mixed portion of the water column has \textit{exactly} the density of the water just below) 
     702(\ie\ until the mixed portion of the water column has \textit{exactly} the density of the water just below) 
    703703\citep{madec.delecluse.ea_JPO91}. 
    704704The associated algorithm is an iterative process used in the following way (\autoref{fig:npc}): 
     
    717717This algorithm is significantly different from mixing statically unstable levels two by two. 
    718718The latter procedure cannot converge with a finite number of iterations for some vertical profiles while 
    719 the algorithm used in \NEMO converges for any profile in a number of iterations which is less than 
     719the algorithm used in \NEMO\ converges for any profile in a number of iterations which is less than 
    720720the number of vertical levels. 
    721721This property is of paramount importance as pointed out by \citet{killworth_iprc89}: 
     
    727727(L. Brodeau, personnal communication). 
    728728Two main differences have been introduced compared to the original algorithm: 
    729 $(i)$ the stability is now checked using the Brunt-V\"{a}is\"{a}l\"{a} frequency  
    730 (not the difference in potential density);  
     729$(i)$ the stability is now checked using the Brunt-V\"{a}is\"{a}l\"{a} frequency 
     730(not the difference in potential density); 
    731731$(ii)$ when two levels are found unstable, their thermal and haline expansion coefficients are vertically mixed in 
    732732the same way their temperature and salinity has been mixed. 
     
    735735 
    736736% ------------------------------------------------------------------------------------------------------------- 
    737 %       Enhanced Vertical Diffusion  
     737%       Enhanced Vertical Diffusion 
    738738% ------------------------------------------------------------------------------------------------------------- 
    739739\subsection[Enhanced vertical diffusion (\forcode{ln_zdfevd = .true.})] 
     
    741741\label{subsec:ZDF_evd} 
    742742 
    743 Options are defined through the  \ngn{namzdf} namelist variables. 
     743Options are defined through the  \nam{zdf} namelist variables. 
    744744The enhanced vertical diffusion parameterisation is used when \np{ln\_zdfevd}\forcode{ = .true.}. 
    745 In this case, the vertical eddy mixing coefficients are assigned very large values  
     745In this case, the vertical eddy mixing coefficients are assigned very large values 
    746746in regions where the stratification is unstable 
    747 (\ie when $N^2$ the Brunt-Vais\"{a}l\"{a} frequency is negative) \citep{lazar_phd97, lazar.madec.ea_JPO99}. 
     747(\ie\ when $N^2$ the Brunt-Vais\"{a}l\"{a} frequency is negative) \citep{lazar_phd97, lazar.madec.ea_JPO99}. 
    748748This is done either on tracers only (\np{nn\_evdm}\forcode{ = 0}) or 
    749749on both momentum and tracers (\np{nn\_evdm}\forcode{ = 1}). 
     
    762762 
    763763% ------------------------------------------------------------------------------------------------------------- 
    764 %       Turbulent Closure Scheme  
    765 % ------------------------------------------------------------------------------------------------------------- 
    766 \subsection[Handling convection with turbulent closure schemes (\forcode{ln_zdf/tke/gls/osm = .true.})] 
    767 {Handling convection with turbulent closure schemes (\protect\np{ln\_zdf/tke/gls/osm}\forcode{ = .true.})} 
     764%       Turbulent Closure Scheme 
     765% ------------------------------------------------------------------------------------------------------------- 
     766\subsection{Handling convection with turbulent closure schemes (\forcode{ln_zdf\{tke,gls,osm\} = .true.})} 
    768767\label{subsec:ZDF_tcs} 
    769768 
    770769 
    771770The turbulent closure schemes presented in \autoref{subsec:ZDF_tke}, \autoref{subsec:ZDF_gls} and 
    772 \autoref{subsec:ZDF_osm} (\ie \np{ln\_zdftke} or \np{ln\_zdfgls} or \np{ln\_zdfosm} defined) deal, in theory,  
     771\autoref{subsec:ZDF_osm} (\ie\ \np{ln\_zdftke} or \np{ln\_zdfgls} or \np{ln\_zdfosm} defined) deal, in theory, 
    773772with statically unstable density profiles. 
    774773In such a case, the term corresponding to the destruction of turbulent kinetic energy through stratification in 
    775 \autoref{eq:zdftke_e} or \autoref{eq:zdfgls_e} becomes a source term, since $N^2$ is negative.  
    776 It results in large values of $A_T^{vT}$ and  $A_T^{vT}$, and also of the four neighboring values at  
     774\autoref{eq:zdftke_e} or \autoref{eq:zdfgls_e} becomes a source term, since $N^2$ is negative. 
     775It results in large values of $A_T^{vT}$ and  $A_T^{vT}$, and also of the four neighboring values at 
    777776velocity points $A_u^{vm} {and}\;A_v^{vm}$ (up to $1\;m^2s^{-1}$). 
    778777These large values restore the static stability of the water column in a way similar to that of 
     
    782781because the mixing length scale is bounded by the distance to the sea surface. 
    783782It can thus be useful to combine the enhanced vertical diffusion with the turbulent closure scheme, 
    784 \ie setting the \np{ln\_zdfnpc} namelist parameter to true and 
     783\ie\ setting the \np{ln\_zdfnpc} namelist parameter to true and 
    785784defining the turbulent closure (\np{ln\_zdftke} or \np{ln\_zdfgls} = \forcode{.true.}) all together. 
    786785 
     
    804803 
    805804This parameterisation has been introduced in \mdl{zdfddm} module and is controlled by the namelist parameter 
    806 \np{ln\_zdfddm} in \ngn{namzdf}. 
     805\np{ln\_zdfddm} in \nam{zdf}. 
    807806Double diffusion occurs when relatively warm, salty water overlies cooler, fresher water, or vice versa. 
    808807The former condition leads to salt fingering and the latter to diffusive convection. 
    809808Double-diffusive phenomena contribute to diapycnal mixing in extensive regions of the ocean. 
    810 \citet{merryfield.holloway.ea_JPO99} include a parameterisation of such phenomena in a global ocean model and show that  
     809\citet{merryfield.holloway.ea_JPO99} include a parameterisation of such phenomena in a global ocean model and show that 
    811810it leads to relatively minor changes in circulation but exerts significant regional influences on 
    812811temperature and salinity. 
    813812 
    814813 
    815 Diapycnal mixing of S and T are described by diapycnal diffusion coefficients  
     814Diapycnal mixing of S and T are described by diapycnal diffusion coefficients 
    816815\begin{align*} 
    817816  % \label{eq:zdfddm_Kz} 
     
    834833             \end{cases} 
    835834  \\         \label{eq:zdfddm_f_T} 
    836   A_f^{vT} &= 0.7 \ A_f^{vS} / R_\rho  
     835  A_f^{vT} &= 0.7 \ A_f^{vS} / R_\rho 
    837836\end{align} 
    838837 
     
    860859 
    861860To represent mixing of S and T by diffusive layering,  the diapycnal diffusivities suggested by 
    862 Federov (1988) is used:  
     861Federov (1988) is used: 
    863862\begin{align} 
    864863  % \label{eq:zdfddm_d} 
     
    900899%-------------------------------------------------------------------------------------------------------------- 
    901900 
    902 Options to define the top and bottom friction are defined through the \ngn{namdrg} namelist variables. 
     901Options to define the top and bottom friction are defined through the \nam{drg} namelist variables. 
    903902The bottom friction represents the friction generated by the bathymetry. 
    904903The top friction represents the friction generated by the ice shelf/ocean interface. 
    905 As the friction processes at the top and the bottom are treated in and identical way,  
     904As the friction processes at the top and the bottom are treated in and identical way, 
    906905the description below considers mostly the bottom friction case, if not stated otherwise. 
    907906 
     
    921920one needs a vertical diffusion coefficient $A^{vm} = 0.125$~m$^2$s$^{-1}$ 
    922921(for a Coriolis frequency $f = 10^{-4}$~m$^2$s$^{-1}$). 
    923 With a background diffusion coefficient $A^{vm} = 10^{-4}$~m$^2$s$^{-1}$, the Ekman layer depth is only 1.4~m.  
     922With a background diffusion coefficient $A^{vm} = 10^{-4}$~m$^2$s$^{-1}$, the Ekman layer depth is only 1.4~m. 
    924923When the vertical mixing coefficient is this small, using a flux condition is equivalent to 
    925924entering the viscous forces (either wind stress or bottom friction) as a body force over the depth of the top or 
     
    951950  - \frac{{\cal F}^{\textbf U}_{h}}{e_{3u}} = \frac{c_b^{\textbf U}}{e_{3u}} \;{\textbf U}_h^b 
    952951\end{equation} 
    953 where $\textbf{U}_h^b = (u_b\;,\;v_b)$ is the near-bottom, horizontal, ocean velocity.  
    954 Note than from \NEMO 4.0, drag coefficients are only computed at cell centers (\ie at T-points) and refer to as $c_b^T$ in the following. These are then linearly interpolated in space to get $c_b^\textbf{U}$ at velocity points. 
     952where $\textbf{U}_h^b = (u_b\;,\;v_b)$ is the near-bottom, horizontal, ocean velocity. 
     953Note than from \NEMO\ 4.0, drag coefficients are only computed at cell centers (\ie\ at T-points) and refer to as $c_b^T$ in the following. These are then linearly interpolated in space to get $c_b^\textbf{U}$ at velocity points. 
    955954 
    956955% ------------------------------------------------------------------------------------------------------------- 
     
    962961 
    963962The linear friction parameterisation (including the special case of a free-slip condition) assumes that 
    964 the friction is proportional to the interior velocity (\ie the velocity of the first/last model level): 
     963the friction is proportional to the interior velocity (\ie\ the velocity of the first/last model level): 
    965964\[ 
    966965  % \label{eq:zdfbfr_linear} 
     
    968967\] 
    969968where $r$ is a friction coefficient expressed in $m s^{-1}$. 
    970 This coefficient is generally estimated by setting a typical decay time $\tau$ in the deep ocean,  
     969This coefficient is generally estimated by setting a typical decay time $\tau$ in the deep ocean, 
    971970and setting $r = H / \tau$, where $H$ is the ocean depth. 
    972971Commonly accepted values of $\tau$ are of the order of 100 to 200 days \citep{weatherly_JMR84}. 
     
    979978It can be changed by specifying \np{rn\_Uc0} (namelist parameter). 
    980979 
    981  For the linear friction case the drag coefficient used in the general expression \autoref{eq:zdfbfr_bdef} is:  
     980 For the linear friction case the drag coefficient used in the general expression \autoref{eq:zdfbfr_bdef} is: 
    982981\[ 
    983982  % \label{eq:zdfbfr_linbfr_b} 
     
    10011000 \label{subsec:ZDF_drg_nonlinear} 
    10021001 
    1003 The non-linear bottom friction parameterisation assumes that the top/bottom friction is quadratic:  
     1002The non-linear bottom friction parameterisation assumes that the top/bottom friction is quadratic: 
    10041003\[ 
    10051004  % \label{eq:zdfdrg_nonlinear} 
     
    10891088To ensure that the friction cannot reverse the direction of flow it is necessary to have: 
    10901089\[ 
    1091   |\Delta u| < \;|u|  
     1090  |\Delta u| < \;|u| 
    10921091\] 
    10931092\noindent which, using \autoref{eq:Eqn_drgstab}, gives: 
     
    11041103For example, if $|u| = 1$ m.s$^{-1}$, $rdt = 1800$ s, $r = 10^{-3}$ then $e_{3u}$ should be greater than 3.6 m. 
    11051104For most applications, with physically sensible parameters these restrictions should not be of concern. 
    1106 But caution may be necessary if attempts are made to locally enhance the bottom friction parameters.  
     1105But caution may be necessary if attempts are made to locally enhance the bottom friction parameters. 
    11071106To ensure stability limits are imposed on the top/bottom friction coefficients both 
    11081107during initialisation and at each time step. 
     
    11271126An optional implicit form of bottom friction has been implemented to improve model stability. 
    11281127We recommend this option for shelf sea and coastal ocean applications. %, especially for split-explicit time splitting. 
    1129 This option can be invoked by setting \np{ln\_drgimp} to \forcode{.true.} in the \textit{namdrg} namelist. 
    1130 %This option requires \np{ln\_zdfexp} to be \forcode{.false.} in the \textit{namzdf} namelist.  
    1131  
    1132 This implementation is performed in \mdl{dynzdf} where the following boundary conditions are set while solving the fully implicit diffusion step:  
     1128This option can be invoked by setting \np{ln\_drgimp} to \forcode{.true.} in the \nam{drg} namelist. 
     1129%This option requires \np{ln\_zdfexp} to be \forcode{.false.} in the \nam{zdf} namelist. 
     1130 
     1131This implementation is performed in \mdl{dynzdf} where the following boundary conditions are set while solving the fully implicit diffusion step: 
    11331132 
    11341133At the top (below an ice shelf cavity): 
     
    11461145\] 
    11471146 
    1148 where $t$ and $b$ refers to top and bottom layers respectively.  
     1147where $t$ and $b$ refers to top and bottom layers respectively. 
    11491148Superscript $n+1$ means the velocity used in the friction formula is to be calculated, so it is implicit. 
    11501149 
     
    11561155 \label{subsec:ZDF_drg_ts} 
    11571156 
    1158 With split-explicit free surface, the sub-stepping of barotropic equations needs the knowledge of top/bottom stresses. An obvious way to satisfy this is to take them as constant over the course of the barotropic integration and equal to the value used to update the baroclinic momentum trend. Provided \np{ln\_drgimp}\forcode{= .false.} and a centred or \textit{leap-frog} like integration of barotropic equations is used (\ie \forcode{ln_bt_fw = .false.}, cf \autoref{subsec:DYN_spg_ts}), this does ensure that barotropic and baroclinic dynamics feel the same stresses during one leapfrog time step. However, if \np{ln\_drgimp}\forcode{= .true.},  stresses depend on the \textit{after} value of the velocities which themselves depend on the barotropic iteration result. This cyclic dependency makes difficult obtaining consistent stresses in 2d and 3d dynamics. Part of this mismatch is then removed when setting the final barotropic component of 3d velocities to the time splitting estimate. This last step can be seen as a necessary evil but should be minimized since it interferes with the adjustment to the boundary conditions.  
    1159  
    1160 The strategy to handle top/bottom stresses with split-explicit free surface in \NEMO is as follows: 
     1157With split-explicit free surface, the sub-stepping of barotropic equations needs the knowledge of top/bottom stresses. An obvious way to satisfy this is to take them as constant over the course of the barotropic integration and equal to the value used to update the baroclinic momentum trend. Provided \np{ln\_drgimp}\forcode{= .false.} and a centred or \textit{leap-frog} like integration of barotropic equations is used (\ie\ \forcode{ln_bt_fw = .false.}, cf \autoref{subsec:DYN_spg_ts}), this does ensure that barotropic and baroclinic dynamics feel the same stresses during one leapfrog time step. However, if \np{ln\_drgimp}\forcode{= .true.},  stresses depend on the \textit{after} value of the velocities which themselves depend on the barotropic iteration result. This cyclic dependency makes difficult obtaining consistent stresses in 2d and 3d dynamics. Part of this mismatch is then removed when setting the final barotropic component of 3d velocities to the time splitting estimate. This last step can be seen as a necessary evil but should be minimized since it interferes with the adjustment to the boundary conditions. 
     1158 
     1159The strategy to handle top/bottom stresses with split-explicit free surface in \NEMO\ is as follows: 
    11611160\begin{enumerate} 
    11621161\item To extend the stability of the barotropic sub-stepping, bottom stresses are refreshed at each sub-iteration. The baroclinic part of the flow entering the stresses is frozen at the initial time of the barotropic iteration. In case of non-linear friction, the drag coefficient is also constant. 
    11631162\item In case of an implicit drag, specific computations are performed in \mdl{dynzdf} which renders the overall scheme mixed explicit/implicit: the barotropic components of 3d velocities are removed before seeking for the implicit vertical diffusion result. Top/bottom stresses due to the barotropic components are explicitly accounted for thanks to the updated values of barotropic velocities. Then the implicit solution of 3d velocities is obtained. Lastly, the residual barotropic component is replaced by the time split estimate. 
    1164 \end{enumerate}  
    1165  
    1166 Note that other strategies are possible, like considering vertical diffusion step in advance, \ie prior barotropic integration.   
     1163\end{enumerate} 
     1164 
     1165Note that other strategies are possible, like considering vertical diffusion step in advance, \ie\ prior barotropic integration. 
    11671166 
    11681167 
     
    11821181the approach originally proposed by \citet{st-laurent.simmons.ea_GRL02}. 
    11831182A three-dimensional field of internal wave energy dissipation $\epsilon(x,y,z)$ is first constructed, 
    1184 and the resulting diffusivity is obtained as  
     1183and the resulting diffusivity is obtained as 
    11851184\[ 
    11861185  % \label{eq:Kwave} 
     
    11981197the mixing efficiency is constant. 
    11991198 
    1200 In addition to the mixing efficiency, the ratio of salt to heat diffusivities can chosen to vary  
    1201 as a function of $Re_b$ by setting the \np{ln\_tsdiff} parameter to \forcode{.true.}, a recommended choice.  
     1199In addition to the mixing efficiency, the ratio of salt to heat diffusivities can chosen to vary 
     1200as a function of $Re_b$ by setting the \np{ln\_tsdiff} parameter to \forcode{.true.}, a recommended choice. 
    12021201This parameterization of differential mixing, due to \cite{jackson.rehmann_JPO14}, 
    12031202is implemented as in \cite{de-lavergne.madec.ea_JPO16}. 
     
    12111210  F_{pyc}(i,j,k) &\propto N^{n_p}\\ 
    12121211  F_{bot}(i,j,k) &\propto N^2 \, e^{- h_{wkb} / h_{bot} } 
    1213 \end{align*}  
     1212\end{align*} 
    12141213In the above formula, $h_{ab}$ denotes the height above bottom, 
    12151214$h_{wkb}$ denotes the WKB-stretched height above bottom, defined by 
     
    12171216  h_{wkb} = H \, \frac{ \int_{-H}^{z} N \, dz' } { \int_{-H}^{\eta} N \, dz'  } \; , 
    12181217\] 
    1219 The $n_p$ parameter (given by \np{nn\_zpyc} in \ngn{namzdf\_iwm} namelist) 
     1218The $n_p$ parameter (given by \np{nn\_zpyc} in \nam{zdf\_iwm} namelist) 
    12201219controls the stratification-dependence of the pycnocline-intensified dissipation. 
    12211220It can take values of $1$ (recommended) or $2$. 
     
    12291228 
    12301229% ================================================================ 
    1231 % surface wave-induced mixing  
     1230% surface wave-induced mixing 
    12321231% ================================================================ 
    12331232\section[Surface wave-induced mixing (\forcode{ln_zdfswm = .true.})] 
     
    12371236Surface waves produce an enhanced mixing through wave-turbulence interaction. 
    12381237In addition to breaking waves induced turbulence (\autoref{subsec:ZDF_tke}), 
    1239 the influence of non-breaking waves can be accounted introducing  
     1238the influence of non-breaking waves can be accounted introducing 
    12401239wave-induced viscosity and diffusivity as a function of the wave number spectrum. 
    12411240Following \citet{qiao.yuan.ea_OD10}, a formulation of wave-induced mixing coefficient 
     
    12471246\end{equation} 
    12481247 
    1249 Where $B_{v}$ is the wave-induced mixing coefficient, $A$ is the wave amplitude,  
    1250 ${U}_{st}$ is the Stokes Drift velocity, $k$ is the wave number and $\alpha$  
    1251 is a constant which should be determined by observations or  
     1248Where $B_{v}$ is the wave-induced mixing coefficient, $A$ is the wave amplitude, 
     1249${U}_{st}$ is the Stokes Drift velocity, $k$ is the wave number and $\alpha$ 
     1250is a constant which should be determined by observations or 
    12521251numerical experiments and is set to be 1. 
    12531252 
    1254 The coefficient $B_{v}$ is then directly added to the vertical viscosity  
     1253The coefficient $B_{v}$ is then directly added to the vertical viscosity 
    12551254and diffusivity coefficients. 
    12561255 
    12571256In order to account for this contribution set: \forcode{ln_zdfswm = .true.}, 
    12581257then wave interaction has to be activated through \forcode{ln_wave = .true.}, 
    1259 the Stokes Drift can be evaluated by setting \forcode{ln_sdw = .true.}  
     1258the Stokes Drift can be evaluated by setting \forcode{ln_sdw = .true.} 
    12601259(see \autoref{subsec:SBC_wave_sdw}) 
    12611260and the needed wave fields can be provided either in forcing or coupled mode 
     
    12691268\label{subsec:ZDF_aimp} 
    12701269 
    1271 This refers to \citep{shchepetkin_OM15}. 
    1272  
    1273 TBC ... 
    1274  
    1275  
     1270The adaptive-implicit vertical advection option in NEMO is based on the work of 
     1271\citep{shchepetkin_OM15}.  In common with most ocean models, the timestep used with NEMO 
     1272needs to satisfy multiple criteria associated with different physical processes in order 
     1273to maintain numerical stability. \citep{shchepetkin_OM15} pointed out that the vertical 
     1274CFL criterion is commonly the most limiting. \citep{lemarie.debreu.ea_OM15} examined the 
     1275constraints for a range of time and space discretizations and provide the CFL stability 
     1276criteria for a range of advection schemes. The values for the Leap-Frog with Robert 
     1277asselin filter time-stepping (as used in NEMO) are reproduced in 
     1278\autoref{tab:zad_Aimp_CFLcrit}. Treating the vertical advection implicitly can avoid these 
     1279restrictions but at the cost of large dispersive errors and, possibly, large numerical 
     1280viscosity. The adaptive-implicit vertical advection option provides a targetted use of the 
     1281implicit scheme only when and where potential breaches of the vertical CFL condition 
     1282occur. In many practical applications these events may occur remote from the main area of 
     1283interest or due to short-lived conditions such that the extra numerical diffusion or 
     1284viscosity does not greatly affect the overall solution. With such applications, setting: 
     1285\forcode{ln_zad_Aimp = .true.} should allow much longer model timesteps to be used whilst 
     1286retaining the accuracy of the high order explicit schemes over most of the domain. 
     1287 
     1288\begin{table}[htbp] 
     1289  \begin{center} 
     1290    % \begin{tabular}{cp{70pt}cp{70pt}cp{70pt}cp{70pt}} 
     1291    \begin{tabular}{r|ccc} 
     1292      \hline 
     1293      spatial discretization &   2nd order centered   & 3rd order upwind & 4th order compact  \\ 
     1294      advective CFL criterion     & 0.904 &   0.472  &   0.522    \\ 
     1295      \hline 
     1296    \end{tabular} 
     1297    \caption{ 
     1298      \protect\label{tab:zad_Aimp_CFLcrit} 
     1299      The advective CFL criteria for a range of spatial discretizations for the Leap-Frog with Robert Asselin filter time-stepping 
     1300      ($\nu=0.1$) as given in \citep{lemarie.debreu.ea_OM15}. 
     1301    } 
     1302  \end{center} 
     1303\end{table} 
     1304 
     1305In particular, the advection scheme remains explicit everywhere except where and when 
     1306local vertical velocities exceed a threshold set just below the explicit stability limit. 
     1307Once the threshold is reached a tapered transition towards an implicit scheme is used by 
     1308partitioning the vertical velocity into a part that can be treated explicitly and any 
     1309excess that must be treated implicitly. The partitioning is achieved via a Courant-number 
     1310dependent weighting algorithm as described in \citep{shchepetkin_OM15}. 
     1311 
     1312The local cell Courant number ($Cu$) used for this partitioning is: 
     1313 
     1314\begin{equation} 
     1315  \label{eq:Eqn_zad_Aimp_Courant} 
     1316  \begin{split} 
     1317    Cu &= {2 \rdt \over e^n_{3t_{ijk}}} \bigg (\big [ \texttt{Max}(w^n_{ijk},0.0) - \texttt{Min}(w^n_{ijk+1},0.0) \big ]    \\ 
     1318       &\phantom{=} +\big [ \texttt{Max}(e_{{2_u}ij}e^n_{{3_{u}}ijk}u^n_{ijk},0.0) - \texttt{Min}(e_{{2_u}i-1j}e^n_{{3_{u}}i-1jk}u^n_{i-1jk},0.0) \big ] 
     1319                     \big / e_{{1_t}ij}e_{{2_t}ij}            \\ 
     1320       &\phantom{=} +\big [ \texttt{Max}(e_{{1_v}ij}e^n_{{3_{v}}ijk}v^n_{ijk},0.0) - \texttt{Min}(e_{{1_v}ij-1}e^n_{{3_{v}}ij-1k}v^n_{ij-1k},0.0) \big ] 
     1321                     \big / e_{{1_t}ij}e_{{2_t}ij} \bigg )    \\ 
     1322  \end{split} 
     1323\end{equation} 
     1324 
     1325\noindent and the tapering algorithm follows \citep{shchepetkin_OM15} as: 
     1326 
     1327\begin{align} 
     1328  \label{eq:Eqn_zad_Aimp_partition} 
     1329Cu_{min} &= 0.15 \nonumber \\ 
     1330Cu_{max} &= 0.3  \nonumber \\ 
     1331Cu_{cut} &= 2Cu_{max} - Cu_{min} \nonumber \\ 
     1332Fcu    &= 4Cu_{max}*(Cu_{max}-Cu_{min}) \nonumber \\ 
     1333C\kern-0.14em f &= 
     1334     \begin{cases} 
     1335        0.0                                                        &\text{if $Cu \leq Cu_{min}$} \\ 
     1336        (Cu - Cu_{min})^2 / (Fcu +  (Cu - Cu_{min})^2)             &\text{else if $Cu < Cu_{cut}$} \\ 
     1337        (Cu - Cu_{max}) / Cu                                       &\text{else} 
     1338     \end{cases} 
     1339\end{align} 
     1340 
     1341\begin{figure}[!t] 
     1342  \begin{center} 
     1343    \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_coeff} 
     1344    \caption{ 
     1345      \protect\label{fig:zad_Aimp_coeff} 
     1346      The value of the partitioning coefficient ($C\kern-0.14em f$) used to partition vertical velocities into parts to 
     1347      be treated implicitly and explicitly for a range of typical Courant numbers (\forcode{ln_zad_Aimp=.true.}) 
     1348    } 
     1349  \end{center} 
     1350\end{figure} 
     1351 
     1352\noindent The partitioning coefficient is used to determine the part of the vertical 
     1353velocity that must be handled implicitly ($w_i$) and to subtract this from the total 
     1354vertical velocity ($w_n$) to leave that which can continue to be handled explicitly: 
     1355 
     1356\begin{align} 
     1357  \label{eq:Eqn_zad_Aimp_partition2} 
     1358    w_{i_{ijk}} &= C\kern-0.14em f_{ijk} w_{n_{ijk}}     \nonumber \\ 
     1359    w_{n_{ijk}} &= (1-C\kern-0.14em f_{ijk}) w_{n_{ijk}}            
     1360\end{align} 
     1361 
     1362\noindent Note that the coefficient is such that the treatment is never fully implicit; 
     1363the three cases from \autoref{eq:Eqn_zad_Aimp_partition} can be considered as: 
     1364fully-explicit; mixed explicit/implicit and mostly-implicit.  With the settings shown the 
     1365coefficient ($C\kern-0.14em f$) varies as shown in \autoref{fig:zad_Aimp_coeff}. Note with these values 
     1366the $Cu_{cut}$ boundary between the mixed implicit-explicit treatment and 'mostly 
     1367implicit' is 0.45 which is just below the stability limited given in 
     1368\autoref{tab:zad_Aimp_CFLcrit}  for a 3rd order scheme. 
     1369 
     1370The $w_i$ component is added to the implicit solvers for the vertical mixing in 
     1371\mdl{dynzdf} and \mdl{trazdf} in a similar way to \citep{shchepetkin_OM15}.  This is 
     1372sufficient for the flux-limited advection scheme (\forcode{ln_traadv_mus}) but further 
     1373intervention is required when using the flux-corrected scheme (\forcode{ln_traadv_fct}). 
     1374For these schemes the implicit upstream fluxes must be added to both the monotonic guess 
     1375and to the higher order solution when calculating the antidiffusive fluxes. The implicit 
     1376vertical fluxes are then removed since they are added by the implicit solver later on. 
     1377 
     1378The adaptive-implicit vertical advection option is new to NEMO at v4.0 and has yet to be  
     1379used in a wide range of simulations. The following test simulation, however, does illustrate 
     1380the potential benefits and will hopefully encourage further testing and feedback from users: 
     1381 
     1382\begin{figure}[!t] 
     1383  \begin{center} 
     1384    \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_overflow_frames} 
     1385    \caption{ 
     1386      \protect\label{fig:zad_Aimp_overflow_frames} 
     1387      A time-series of temperature vertical cross-sections for the OVERFLOW test case. These results are for the default 
     1388      settings with \forcode{nn_rdt=10.0} and without adaptive implicit vertical advection (\forcode{ln_zad_Aimp=.false.}). 
     1389    } 
     1390  \end{center} 
     1391\end{figure} 
     1392 
     1393\subsection{Adaptive-implicit vertical advection in the OVERFLOW test-case} 
     1394The \href{https://forge.ipsl.jussieu.fr/nemo/chrome/site/doc/NEMO/guide/html/test\_cases.html\#overflow}{OVERFLOW test case} 
     1395provides a simple illustration of the adaptive-implicit advection in action. The example here differs from the basic test case 
     1396by only a few extra physics choices namely: 
     1397 
     1398\begin{verbatim} 
     1399     ln_dynldf_OFF = .false. 
     1400     ln_dynldf_lap = .true. 
     1401     ln_dynldf_hor = .true. 
     1402     ln_zdfnpc     = .true. 
     1403     ln_traadv_fct = .true. 
     1404        nn_fct_h   =  2 
     1405        nn_fct_v   =  2 
     1406\end{verbatim} 
     1407 
     1408\noindent which were chosen to provide a slightly more stable and less noisy solution. The 
     1409result when using the default value of \forcode{nn_rdt = 10.} without adaptive-implicit 
     1410vertical velocity is illustrated in \autoref{fig:zad_Aimp_overflow_frames}. The mass of 
     1411cold water, initially sitting on the shelf, moves down the slope and forms a 
     1412bottom-trapped, dense plume. Even with these extra physics choices the model is close to 
     1413stability limits and attempts with \forcode{nn_rdt = 30.} will fail after about 5.5 hours 
     1414with excessively high horizontal velocities. This time-scale corresponds with the time the 
     1415plume reaches the steepest part of the topography and, although detected as a horizontal 
     1416CFL breach, the instability originates from a breach of the vertical CFL limit. This is a good 
     1417candidate, therefore, for use of the adaptive-implicit vertical advection scheme. 
     1418 
     1419The results with \forcode{ln_zad_Aimp=.true.} and a variety of model timesteps 
     1420are shown in \autoref{fig:zad_Aimp_overflow_all_rdt} (together with the equivalent 
     1421frames from the base run).  In this simple example the use of the adaptive-implicit 
     1422vertcal advection scheme has enabled a 12x increase in the model timestep without 
     1423significantly altering the solution (although at this extreme the plume is more diffuse 
     1424and has not travelled so far).  Notably, the solution with and without the scheme is 
     1425slightly different even with \forcode{nn_rdt = 10.}; suggesting that the base run was 
     1426close enough to instability to trigger the scheme despite completing successfully. 
     1427To assist in diagnosing how active the scheme is, in both location and time, the 3D 
     1428implicit and explicit components of the vertical velocity are available via XIOS as 
     1429\texttt{wimp} and \texttt{wexp} respectively.  Likewise, the partitioning coefficient 
     1430($C\kern-0.14em f$) is also available as \texttt{wi\_cff}. For a quick oversight of 
     1431the schemes activity the global maximum values of the absolute implicit component 
     1432of the vertical velocity and the partitioning coefficient are written to the netCDF 
     1433version of the run statistics file (\texttt{run.stat.nc}) if this is active (see 
     1434\autoref{sec:MISC_opt} for activation details). 
     1435 
     1436\autoref{fig:zad_Aimp_maxCf} shows examples of the maximum partitioning coefficient for 
     1437the various overflow tests.  Note that the adaptive-implicit vertical advection scheme is 
     1438active even in the base run with \forcode{nn_rdt=10.0s} adding to the evidence that the 
     1439test case is close to stability limits even with this value. At the larger timesteps, the 
     1440vertical velocity is treated mostly implicitly at some location throughout the run. The 
     1441oscillatory nature of this measure appears to be linked to the progress of the plume front 
     1442as each cusp is associated with the location of the maximum shifting to the adjacent cell. 
     1443This is illustrated in \autoref{fig:zad_Aimp_maxCf_loc} where the i- and k- locations of the 
     1444maximum have been overlaid for the base run case. 
     1445 
     1446\medskip 
     1447\noindent Only limited tests have been performed in more realistic configurations. In the 
     1448ORCA2\_ICE\_PISCES reference configuration the scheme does activate and passes 
     1449restartability and reproducibility tests but it is unable to improve the model's stability 
     1450enough to allow an increase in the model time-step. A view of the time-series of maximum 
     1451partitioning coefficient (not shown here)  suggests that the default time-step of 5400s is 
     1452already pushing at stability limits, especially in the initial start-up phase. The 
     1453time-series does not, however, exhibit any of the 'cuspiness' found with the overflow 
     1454tests. 
     1455 
     1456\medskip 
     1457\noindent A short test with an eORCA1 configuration promises more since a test using a 
     1458time-step of 3600s remains stable with \forcode{ln_zad_Aimp=.true.} whereas the 
     1459time-step is limited to 2700s without. 
     1460 
     1461\begin{figure}[!t] 
     1462  \begin{center} 
     1463    \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_overflow_all_rdt} 
     1464    \caption{ 
     1465      \protect\label{fig:zad_Aimp_overflow_all_rdt} 
     1466      Sample temperature vertical cross-sections from mid- and end-run using different values for \forcode{nn_rdt}  
     1467      and with or without adaptive implicit vertical advection. Without the adaptive implicit vertical advection only 
     1468      the run with the shortest timestep is able to run to completion. Note also that the colour-scale has been 
     1469      chosen to confirm that temperatures remain within the original range of 10$^o$ to 20$^o$. 
     1470    } 
     1471  \end{center} 
     1472\end{figure} 
     1473 
     1474\begin{figure}[!t] 
     1475  \begin{center} 
     1476    \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_maxCf} 
     1477    \caption{ 
     1478      \protect\label{fig:zad_Aimp_maxCf} 
     1479      The maximum partitioning coefficient during a series of test runs with increasing model timestep length. 
     1480      At the larger timesteps, the vertical velocity is treated mostly implicitly at some location throughout  
     1481      the run. 
     1482    } 
     1483  \end{center} 
     1484\end{figure} 
     1485 
     1486\begin{figure}[!t] 
     1487  \begin{center} 
     1488    \includegraphics[width=\textwidth]{Fig_ZDF_zad_Aimp_maxCf_loc} 
     1489    \caption{ 
     1490      \protect\label{fig:zad_Aimp_maxCf_loc} 
     1491      The maximum partitioning coefficient for the  \forcode{nn_rdt=10.0s} case overlaid with  information on the gridcell i- and k- 
     1492      locations of the maximum value.  
     1493    } 
     1494  \end{center} 
     1495\end{figure} 
    12761496 
    12771497% ================================================================ 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_conservation.tex

    r11263 r11512  
    88\chapter{Invariants of the Primitive Equations} 
    99\label{chap:Invariant} 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212The continuous equations of motion have many analytic properties. 
     
    3535The alternative is to use diffusive schemes such as upstream or flux corrected schemes. 
    3636This last option was rejected because we prefer a complete handling of the model diffusion, 
    37 \ie of the model physics rather than letting the advective scheme produces its own implicit diffusion without 
     37\ie\ of the model physics rather than letting the advective scheme produces its own implicit diffusion without 
    3838controlling the space and time structure of this implicit diffusion. 
    3939Note that in some very specific cases as passive tracer studies, the positivity of the advective scheme is required. 
     
    122122This properties is satisfied locally with the choice of discretization we have made (property (II.1.9)~). 
    123123In addition, when the equation of state is linear 
    124 (\ie when an advective-diffusive equation for density can be derived from those of temperature and salinity) 
     124(\ie\ when an advective-diffusive equation for density can be derived from those of temperature and salinity) 
    125125the change of horizontal kinetic energy due to the work of pressure forces is balanced by the change of 
    126126potential energy due to buoyancy forces: 
     
    283283In discrete form, all these properties are satisfied in $z$-coordinate (see Appendix C). 
    284284In $s$-coordinates, only first order properties can be demonstrated, 
    285 \ie the vertical momentum physics conserve momentum, potential vorticity, and horizontal divergence. 
     285\ie\ the vertical momentum physics conserve momentum, potential vorticity, and horizontal divergence. 
    286286 
    287287% ------------------------------------------------------------------------------------------------------------- 
     
    294294the heat and salt contents are conserved (equations in flux form, second order centred finite differences). 
    295295As a form flux is used to compute the temperature and salinity, 
    296 the quadratic form of these quantities (\ie their variance) globally tends to diminish. 
     296the quadratic form of these quantities (\ie\ their variance) globally tends to diminish. 
    297297As for the advective term, there is generally no strict conservation of mass even if, 
    298298in practice, the mass is conserved with a very good accuracy.  
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_misc.tex

    r11353 r11512  
    88\label{chap:MISC} 
    99 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212\newpage 
     
    3030are much narrow than even a single ocean grid-point. 
    3131 
    32 We describe briefly here the two methods that can be used in \NEMO to handle such 
     32We describe briefly here the two methods that can be used in \NEMO\ to handle such 
    3333improperly resolved straits. The methods consist of opening the strait while ensuring 
    3434that the mass exchanges through the strait are not too large by either artificially 
     
    4646(\autoref{fig:MISC_strait_hand}).  This technique is sometime called "partially open face" 
    4747or "partially closed cells".  The key issue here is only to reduce the faces of $T$-cell 
    48 (\ie change the value of the horizontal scale factors at $u$- or $v$-point) but not the 
     48(\ie\ change the value of the horizontal scale factors at $u$- or $v$-point) but not the 
    4949volume of the $T$-cell.  Indeed, reducing the volume of strait $T$-cell can easily produce 
    5050a numerical instability at that grid point which would require a reduction of the model 
     
    5757and $\texttt{e1u}*\texttt{e2v}$ respectively. That is the original surface areas of $u$- 
    5858and $v$- cells respectively.  These areas are usually defined by the corresponding product 
    59 within the \NEMO code but the presence of \texttt{e1e2u} and \texttt{e1e2v} in the 
     59within the \NEMO\ code but the presence of \texttt{e1e2u} and \texttt{e1e2v} in the 
    6060\np{cn\_domcfg} file will suppress this calculation and use the supplied fields instead. 
    6161If the model domain is provided by user-supplied code in \mdl{usrdef\_hgr}, then this 
     
    6767via code in  \mdl{usrdef\_hgr}), whereever a Strait reduction is required. The choice of 
    6868whether to alter \texttt{e2u} or \texttt{e1v} depends. respectively,  on whether the 
    69 Strait in question is North-South orientated (\eg Gibraltar) or East-West orientated (\eg 
     69Strait in question is North-South orientated (\eg\ Gibraltar) or East-West orientated (\eg 
    7070Lombok). 
    7171 
     
    9898      \textit{Bottom}: using viscous boundary layers. 
    9999      The four fmask parameters along the strait coastlines are set to a value larger than 4, 
    100       \ie "strong" no-slip case (see \autoref{fig:LBC_shlat}) creating a large viscous boundary layer that 
     100      \ie\ "strong" no-slip case (see \autoref{fig:LBC_shlat}) creating a large viscous boundary layer that 
    101101      allows a reduced transport through the strait. 
    102102    } 
     
    117117      set to zero, and the total residual for all the lakes, if 
    118118      negative, will be put into the St Laurence Seaway in the area 
    119       shown.  
     119      shown. 
    120120    } 
    121121  \end{center} 
     
    141141to zero and put the residual flux into the ocean. 
    142142 
    143 Prior to NEMO 4 the locations of inland seas and lakes was set via 
    144 hardcoded indices for various ORCA configurations. From NEMO 4 onwards 
     143Prior to \NEMO\ 4 the locations of inland seas and lakes was set via 
     144hardcoded indices for various ORCA configurations. From \NEMO\ 4 onwards 
    145145the inland seas and lakes are defined using mask fields in the 
    146146domain configuration file. The options are as follows. 
     
    189189 
    190190There is a python routine to create the closea\_mask fields and append 
    191 them to the domain configuration file in the utils/tools/DOMAINcfg directory.  
    192  
    193 % ================================================================ 
    194 % Sub-Domain Functionality  
     191them to the domain configuration file in the utils/tools/DOMAINcfg directory. 
     192 
     193% ================================================================ 
     194% Sub-Domain Functionality 
    195195% ================================================================ 
    196196\section{Sub-domain functionality} 
     
    205205subsetting operates for the j-direction only and works by optionally looking for and using 
    206206a global file attribute (named: \np{open\_ocean\_jstart}) to determine the starting j-row 
    207 for input.  The use of this option is best explained with an example:  
     207for input.  The use of this option is best explained with an example: 
    208208\medskip 
    209209 
     
    220220\begin{itemize} 
    221221\item  Add the new attribute to any input files requiring a j-row offset, i.e: 
    222 \begin{cmds}  
    223 ncatted  -a open_ocean_jstart,global,a,d,41 eORCA1_domcfg.nc  
     222\begin{cmds} 
     223ncatted  -a open_ocean_jstart,global,a,d,41 eORCA1_domcfg.nc 
    224224\end{cmds} 
    225225 
    226 \item Add the logical switch \np{ln\_use\_jattr} to \ngn{namcfg} in the configuration 
     226\item Add the logical switch \np{ln\_use\_jattr} to \nam{cfg} in the configuration 
    227227namelist (if it is not already there) and set \np{.true.} 
    228228\end{itemize} 
     
    238238\end{cmds} 
    239239 
    240 The domain configuration file is unique in this respect since it also contains the value 
    241 of \texttt{jpjglo} that is read and used by the model. Any other global, 2D and 3D, 
    242 netcdf, input field can be prepared for use in a reduced domain by adding the 
    243 \texttt{open\_ocean\_jstart} attribute to the file's  global attributes. In particular 
    244 this is true for any field that is read by \NEMO using the following optional argument to 
     240The domain configuration file is unique in this respect since it also contains the value of \jp{jpjglo} 
     241that is read and used by the model. 
     242Any other global, 2D and 3D, netcdf, input field can be prepared for use in a reduced domain by adding the 
     243\texttt{open\_ocean\_jstart} attribute to the file's global attributes. 
     244In particular this is true for any field that is read by \NEMO\ using the following optional argument to 
    245245the appropriate call to \np{iom\_get}. 
     246 
    246247\begin{forlines} 
    247248lrowattr=ln_use_jattr 
     
    294295 
    295296The numerical reproducibility of simulations on distributed memory parallel computers is a critical issue. 
    296 In particular, within NEMO global summation of distributed arrays is most susceptible to rounding errors, 
     297In particular, within \NEMO\ global summation of distributed arrays is most susceptible to rounding errors, 
    297298and their propagation and accumulation cause uncertainty in final simulation reproducibility on 
    298299different numbers of processors. 
    299300To avoid so, based on \citet{he.ding_JS01} review of different technics, 
    300301we use a so called self-compensated summation method. 
    301 The idea is to estimate the roundoff error, store it in a buffer, and then add it back in the next addition.  
     302The idea is to estimate the roundoff error, store it in a buffer, and then add it back in the next addition. 
    302303 
    303304Suppose we need to calculate $b = a_1 + a_2 + a_3$. 
     
    317318The self-compensated summation method should be used in all summation in i- and/or j-direction. 
    318319See \mdl{closea} module for an example. 
    319 Note also that this implementation may be sensitive to the optimization level.  
     320Note also that this implementation may be sensitive to the optimization level. 
    320321 
    321322\subsection{MPP scalability} 
     
    339340This alternative method should give identical results to the default \textsc{ALLGATHER} method and 
    340341is recommended for large values of \np{jpni}. 
    341 The new method is activated by setting \np{ln\_nnogather} to be true (\ngn{nammpp}). 
     342The new method is activated by setting \np{ln\_nnogather} to be true (\nam{mpp}). 
    342343The reproducibility of results using the two methods should be confirmed for each new, 
    343344non-reference configuration. 
     
    350351%--------------------------------------------namctl------------------------------------------------------- 
    351352 
    352 \nlst{namctl}  
     353\nlst{namctl} 
    353354%-------------------------------------------------------------------------------------------------------------- 
    354355 
    355 Options are defined through the  \ngn{namctl} namelist variables. 
     356Options are defined through the  \nam{ctl} namelist variables. 
    356357 
    357358\subsection{Vector optimisation} 
     
    360361This is very a very efficient way to increase the length of vector calculations and thus 
    361362to speed up the model on vector computers. 
    362   
     363 
    363364% Add here also one word on NPROMA technique that has been found useless, since compiler have made significant progress during the last decade. 
    364   
     365 
    365366% Add also one word on NEC specific optimisation (Novercheck option for example) 
    366   
     367 
    367368\subsection{Control print} 
    368369 
     
    411412at a suitably long interval. For example: 
    412413 
    413 \begin{verbatim}      
     414\begin{verbatim} 
    414415       sn_cfctl%ptimincr  = 25 
    415416\end{verbatim} 
    416417 
    417 will carry out the global communications and write the information every 25 timesteps. This  
     418will carry out the global communications and write the information every 25 timesteps. This 
    418419increment also applies to the time.step file which is otherwise updated every timestep. 
    419420 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_model_basics.tex

    r11353 r11512  
     1 
    12\documentclass[../main/NEMO_manual]{subfiles} 
    23 
     
    89\chapter{Model Basics} 
    910\label{chap:PE} 
    10 \minitoc 
     11 
     12\chaptertoc 
    1113 
    1214\newpage 
     
    1921 
    2022% ------------------------------------------------------------------------------------------------------------- 
    21 %        Vector Invariant Formulation  
     23%        Vector Invariant Formulation 
    2224% ------------------------------------------------------------------------------------------------------------- 
    2325 
     
    2628 
    2729The ocean is a fluid that can be described to a good approximation by the primitive equations, 
    28 \ie the Navier-Stokes equations along with a nonlinear equation of state which 
     30\ie\ the Navier-Stokes equations along with a nonlinear equation of state which 
    2931couples the two active tracers (temperature and salinity) to the fluid velocity, 
    3032plus the following additional assumptions made from scale considerations: 
     
    3436  \textit{spherical Earth approximation}: the geopotential surfaces are assumed to be oblate spheriods 
    3537  that follow the Earth's bulge; these spheroids are approximated by spheres with 
    36   gravity locally vertical (parallel to the Earth's radius) and independent of latitude  
    37   \citep[][section 2]{white.hoskins.ea_QJRMS05}.    
     38  gravity locally vertical (parallel to the Earth's radius) and independent of latitude 
     39  \citep[][section 2]{white.hoskins.ea_QJRMS05}. 
    3840\item 
    3941  \textit{thin-shell approximation}: the ocean depth is neglected compared to the earth's radius 
     
    6567    \nabla \cdot \vect U = 0 
    6668  \end{equation} 
    67  \item  
    68   \textit{Neglect of additional Coriolis terms}: the Coriolis terms that vary with the cosine of latitude are neglected.  
     69 \item 
     70  \textit{Neglect of additional Coriolis terms}: the Coriolis terms that vary with the cosine of latitude are neglected. 
    6971  These terms may be non-negligible where the Brunt-Vaisala frequency $N$ is small, either in the deep ocean or 
    70   in the sub-mesoscale motions of the mixed layer, or near the equator \citep[][section 1]{white.hoskins.ea_QJRMS05}.  
    71   They can be consistently included as part of the ocean dynamics \citep[][section 3(d)]{white.hoskins.ea_QJRMS05} and are  
    72   retained in the MIT ocean model.      
     72  in the sub-mesoscale motions of the mixed layer, or near the equator \citep[][section 1]{white.hoskins.ea_QJRMS05}. 
     73  They can be consistently included as part of the ocean dynamics \citep[][section 3(d)]{white.hoskins.ea_QJRMS05} and are 
     74  retained in the MIT ocean model. 
    7375\end{enumerate} 
    7476 
     
    7678it is useful to choose an orthogonal set of unit vectors $(i,j,k)$ linked to the Earth such that 
    7779$k$ is the local upward vector and $(i,j)$ are two vectors orthogonal to $k$, 
    78 \ie tangent to the geopotential surfaces. 
     80\ie\ tangent to the geopotential surfaces. 
    7981Let us define the following variables: $\vect U$ the vector velocity, $\vect U = \vect U_h + w \, \vect k$ 
    80 (the subscript $h$ denotes the local horizontal vector, \ie over the $(i,j)$ plane),  
     82(the subscript $h$ denotes the local horizontal vector, \ie\ over the $(i,j)$ plane), 
    8183$T$ the potential temperature, $S$ the salinity, $\rho$ the \textit{in situ} density. 
    8284The vector invariant form of the primitive equations in the $(i,j,k)$ vector system provides 
     
    115117an air-sea or ice-sea interface at its top. 
    116118These boundaries can be defined by two surfaces, $z = - H(i,j)$ and $z = \eta(i,j,k,t)$, 
    117 where $H$ is the depth of the ocean bottom and $\eta$ is the height of the sea surface  
    118 (discretisation can introduce additional artificial ``side-wall'' boundaries).  
    119 Both $H$ and $\eta$ are referenced to a surface of constant geopotential (\ie a mean sea surface height) on which $z = 0$.  
     119where $H$ is the depth of the ocean bottom and $\eta$ is the height of the sea surface 
     120(discretisation can introduce additional artificial ``side-wall'' boundaries). 
     121Both $H$ and $\eta$ are referenced to a surface of constant geopotential (\ie\ a mean sea surface height) on which $z = 0$. 
    120122(\autoref{fig:ocean_bc}). 
    121123Through these two boundaries, the ocean can exchange fluxes of heat, fresh water, salt, and momentum with 
     
    153155  \footnote{ 
    154156    In fact, it has been shown that the heat flux associated with the solid Earth cooling 
    155     (\ie the geothermal heating) is not negligible for the thermohaline circulation of the world ocean 
     157    (\ie\ the geothermal heating) is not negligible for the thermohaline circulation of the world ocean 
    156158    (see \autoref{subsec:TRA_bbc}). 
    157159  }. 
    158160  The boundary condition is thus set to no flux of heat and salt across solid boundaries. 
    159161  For momentum, the situation is different. There is no flow across solid boundaries, 
    160   \ie the velocity normal to the ocean bottom and coastlines is zero (in other words, 
     162  \ie\ the velocity normal to the ocean bottom and coastlines is zero (in other words, 
    161163  the bottom velocity is parallel to solid boundaries). This kinematic boundary condition 
    162164  can be expressed as: 
     
    221223the time step has to be very short when they are present in the model. 
    222224The latter strategy filters out these waves since the rigid lid approximation implies $\eta = 0$, 
    223 \ie the sea surface is the surface $z = 0$. 
     225\ie\ the sea surface is the surface $z = 0$. 
    224226This well known approximation increases the surface wave speed to infinity and 
    225 modifies certain other longwave dynamics (\eg barotropic Rossby or planetary waves). 
     227modifies certain other longwave dynamics (\eg\ barotropic Rossby or planetary waves). 
    226228The rigid-lid hypothesis is an obsolescent feature in modern OGCMs. 
    227229It has been available until the release 3.1 of \NEMO, and it has been removed in release 3.2 and followings. 
     
    246248Allowing the air-sea interface to move introduces the external gravity waves (EGWs) as 
    247249a class of solution of the primitive equations. 
    248 These waves are barotropic (\ie nearly independent of depth) and their phase speed is quite high. 
     250These waves are barotropic (\ie\ nearly independent of depth) and their phase speed is quite high. 
    249251Their time scale is short with respect to the other processes described by the primitive equations. 
    250252 
     
    275277the implicit scheme \citep{dukowicz.smith_JGR94} or 
    276278the addition of a filtering force in the momentum equation \citep{roullet.madec_JGR00}. 
    277 With the present release, \NEMO  offers the choice between 
     279With the present release, \NEMO\  offers the choice between 
    278280an explicit free surface (see \autoref{subsec:DYN_spg_exp}) or 
    279281a split-explicit scheme strongly inspired the one proposed by \citet{shchepetkin.mcwilliams_OM05} 
     
    293295 
    294296In many ocean circulation problems, the flow field has regions of enhanced dynamics 
    295 (\ie surface layers, western boundary currents, equatorial currents, or ocean fronts). 
     297(\ie\ surface layers, western boundary currents, equatorial currents, or ocean fronts). 
    296298The representation of such dynamical processes can be improved by 
    297299specifically increasing the model resolution in these regions. 
     
    313315$(i,j,k)$ linked to the earth such that 
    314316$k$ is the local upward vector and $(i,j)$ are two vectors orthogonal to $k$, 
    315 \ie along geopotential surfaces (\autoref{fig:referential}). 
     317\ie\ along geopotential surfaces (\autoref{fig:referential}). 
    316318Let $(\lambda,\varphi,z)$ be the geographical coordinate system in which a position is defined by 
    317319the latitude $\varphi(i,j)$, the longitude $\lambda(i,j)$ and 
     
    445447This is the so-called \textit{vector invariant form} of the momentum advection term. 
    446448For some purposes, it can be advantageous to write this term in the so-called flux form, 
    447 \ie to write it as the divergence of fluxes. 
     449\ie\ to write it as the divergence of fluxes. 
    448450For example, the first component of \autoref{eq:PE_vector_form} (the $i$-component) is transformed as follows: 
    449451\begin{alignat*}{2} 
     
    484486the first one is expressed as the divergence of momentum fluxes (hence the flux form name given to this formulation) 
    485487and the second one is due to the curvilinear nature of the coordinate system used. 
    486 The latter is called the \textit{metric} term and can be viewed as a modification of the Coriolis parameter:  
     488The latter is called the \textit{metric} term and can be viewed as a modification of the Coriolis parameter: 
    487489\[ 
    488490  % \label{eq:PE_cor+metric} 
     
    491493 
    492494Note that in the case of geographical coordinate, 
    493 \ie when $(i,j) \to (\lambda,\varphi)$ and $(e_1,e_2) \to (a \, \cos \varphi,a)$, 
     495\ie\ when $(i,j) \to (\lambda,\varphi)$ and $(e_1,e_2) \to (a \, \cos \varphi,a)$, 
    494496we recover the commonly used modification of the Coriolis parameter $f \to f + (u / a) \tan \varphi$. 
    495497 
     
    508510                  &+ D_u^{\vect U} + F_u^{\vect U} \\ 
    509511      \pd[v]{t} = &- (\zeta + f) \, u - \frac{1}{2 e_2} \pd[]{j} (u^2 + v^2) 
    510                    - \frac{1}{e_3} w \pd[v]{k} - \frac{1}{e_2} \pd[]{j} \lt( \frac{p_s + p_h}{\rho_o} \rt) \\  
     512                   - \frac{1}{e_3} w \pd[v]{k} - \frac{1}{e_2} \pd[]{j} \lt( \frac{p_s + p_h}{\rho_o} \rt) \\ 
    511513                  &+ D_v^{\vect U} + F_v^{\vect U} 
    512514    \end{split} 
     
    540542  \[ 
    541543  % \label{eq:w_diag} 
    542     \pd[w]{k} = - \chi \; e_3 \qquad  
     544    \pd[w]{k} = - \chi \; e_3 \qquad 
    543545  % \label{eq:hp_diag} 
    544546    \pd[p_h]{k} = - \rho \; g \; e_3 
     
    546548  where the divergence of the horizontal velocity, $\chi$ is given by \autoref{eq:PE_div_Uh}. 
    547549 
    548 \item  
     550\item 
    549551  \textbf{tracer equations}: 
    550552  \begin{equation} 
     
    579581Therefore, in order to represent the ocean with respect to 
    580582the first point a space and time dependent vertical coordinate that follows the variation of the sea surface height 
    581 \eg an \zstar-coordinate; 
     583\eg\ an \zstar-coordinate; 
    582584for the second point, a space variation to fit the change of bottom topography 
    583 \eg a terrain-following or $\sigma$-coordinate; 
     585\eg\ a terrain-following or $\sigma$-coordinate; 
    584586and for the third point, one will be tempted to use a space and time dependent coordinate that 
    585 follows the isopycnal surfaces, \eg an isopycnic coordinate. 
     587follows the isopycnal surfaces, \eg\ an isopycnic coordinate. 
    586588 
    587589In order to satisfy two or more constraints one can even be tempted to mixed these coordinate systems, as in 
     
    666668  \sigma_2 = \frac{1}{e_2} \; \lt. \pd[z]{j} \rt|_s 
    667669\end{equation} 
    668 We also introduce $\omega$, a dia-surface velocity component, defined as the velocity  
     670We also introduce $\omega$, a dia-surface velocity component, defined as the velocity 
    669671relative to the moving $s$-surfaces and normal to them: 
    670672\[ 
     
    761763 
    762764In this case, the free surface equation is nonlinear, and the variations of volume are fully taken into account. 
    763 These coordinates systems is presented in a report \citep{levier.treguier.ea_rpt07} available on the \NEMO web site. 
     765These coordinates systems is presented in a report \citep{levier.treguier.ea_rpt07} available on the \NEMO\ web site. 
    764766 
    765767The \zstar coordinate approach is an unapproximated, non-linear free surface implementation which allows one to 
     
    784786\[ 
    785787  % \label{eq:PE_zstar_2} 
    786   \zstar = H \lt( \frac{z - \eta}{H + \eta} \rt) .  
     788  \zstar = H \lt( \frac{z - \eta}{H + \eta} \rt) . 
    787789\] 
    788790Since the vertical displacement of the free surface is incorporated in the vertical coordinate \zstar, 
     
    831833%end MOM doc %%% 
    832834 
    833 \newpage  
     835\newpage 
    834836 
    835837% ------------------------------------------------------------------------------------------------------------- 
     
    911913In contrast, the ocean will stay at rest in a $z$-model. 
    912914As for the truncation error, the problem can be reduced by introducing the terrain-following coordinate below 
    913 the strongly stratified portion of the water column (\ie the main thermocline) \citep{madec.delecluse.ea_JPO96}. 
     915the strongly stratified portion of the water column (\ie\ the main thermocline) \citep{madec.delecluse.ea_JPO96}. 
    914916An alternate solution consists of rotating the lateral diffusive tensor to geopotential or to isoneutral surfaces 
    915917(see \autoref{subsec:PE_ldf}). 
     
    929931 
    930932The \ztilde -coordinate has been developed by \citet{leclair.madec_OM11}. 
    931 It is available in \NEMO since the version 3.4 and is more robust in version 4.0 than previously.  
     933It is available in \NEMO\ since the version 3.4 and is more robust in version 4.0 than previously. 
    932934Nevertheless, it is currently not robust enough to be used in all possible configurations. 
    933935Its use is therefore not recommended. 
    934936 
    935 \newpage  
     937\newpage 
    936938 
    937939% ================================================================ 
     
    947949must be represented entirely in terms of large-scale patterns to close the equations. 
    948950These effects appear in the equations as the divergence of turbulent fluxes 
    949 (\ie fluxes associated with the mean correlation of small scale perturbations). 
     951(\ie\ fluxes associated with the mean correlation of small scale perturbations). 
    950952Assuming a turbulent closure hypothesis is equivalent to choose a formulation for these fluxes. 
    951953It is usually called the subgrid scale physics. 
     
    991993All the vertical physics is embedded in the specification of the eddy coefficients. 
    992994They can be assumed to be either constant, or function of the local fluid properties 
    993 (\eg Richardson number, Brunt-Vais\"{a}l\"{a} frequency, distance from the boundary ...), 
     995(\eg\ Richardson number, Brunt-Vais\"{a}l\"{a} frequency, distance from the boundary ...), 
    994996or computed from a turbulent closure model. 
    995 The choices available in \NEMO are discussed in \autoref{chap:ZDF}). 
     997The choices available in \NEMO\ are discussed in \autoref{chap:ZDF}). 
    996998 
    997999% ------------------------------------------------------------------------------------------------------------- 
     
    10061008and a sub mesoscale turbulence which is never explicitly solved even partially, but always parameterized. 
    10071009The formulation of lateral eddy fluxes depends on whether the mesoscale is below or above the grid-spacing 
    1008 (\ie the model is eddy-resolving or not). 
     1010(\ie\ the model is eddy-resolving or not). 
    10091011 
    10101012In non-eddy-resolving configurations, the closure is similar to that used for the vertical physics. 
     
    10141016(or more precisely neutral surfaces \cite{mcdougall_JPO87}) rather than across them. 
    10151017As the slope of neutral surfaces is small in the ocean, a common approximation is to assume that 
    1016 the `lateral' direction is the horizontal, \ie the lateral mixing is performed along geopotential surfaces. 
     1018the `lateral' direction is the horizontal, \ie\ the lateral mixing is performed along geopotential surfaces. 
    10171019This leads to a geopotential second order operator for lateral subgrid scale physics. 
    10181020This assumption can be relaxed: the eddy-induced turbulent fluxes can be better approached by assuming that 
     
    10211023it has components in the three space directions. 
    10221024However, 
    1023 both horizontal and isoneutral operators have no effect on mean (\ie large scale) potential energy whereas 
     1025both horizontal and isoneutral operators have no effect on mean (\ie\ large scale) potential energy whereas 
    10241026potential energy is a main source of turbulence (through baroclinic instabilities). 
    10251027\citet{gent.mcwilliams_JPO90} proposed a parameterisation of mesoscale eddy-induced turbulence which 
     
    10651067\end{equation} 
    10661068where $r_1$ and $r_2$ are the slopes between the surface along which the diffusive operator acts and 
    1067 the model level (\eg $z$- or $s$-surfaces). 
     1069the model level (\eg\ $z$- or $s$-surfaces). 
    10681070Note that the formulation \autoref{eq:PE_iso_tensor} is exact for 
    10691071the rotation between geopotential and $s$-surfaces, 
     
    11121114(or equivalently the isoneutral thickness diffusivity coefficient), 
    11131115and $\tilde r_1$ and $\tilde r_2$ are the slopes between isoneutral and \textit{geopotential} surfaces. 
    1114 Their values are thus independent of the vertical coordinate, but their expression depends on the coordinate:  
     1116Their values are thus independent of the vertical coordinate, but their expression depends on the coordinate: 
    11151117\begin{align} 
    11161118  \label{eq:PE_slopes_eiv} 
     
    11261128This can be achieved in a model by tapering either the eddy coefficient or the slopes to zero in the vicinity of 
    11271129the boundaries. 
    1128 The latter strategy is used in \NEMO (cf. \autoref{chap:LDF}). 
     1130The latter strategy is used in \NEMO\ (cf. \autoref{chap:LDF}). 
    11291131 
    11301132\subsubsection{Lateral bilaplacian tracer diffusive operator} 
     
    11481150                         - \nabla_h \times \big( A^{lm} \, \zeta \; \vect k \big) \\ 
    11491151                      &= \lt(   \frac{1}{e_1}     \pd[ \lt( A^{lm}    \chi      \rt) ]{i} \rt. 
    1150                               - \frac{1}{e_2 e_3} \pd[ \lt( A^{lm} \; e_3 \zeta \rt) ]{j} ,  
     1152                              - \frac{1}{e_2 e_3} \pd[ \lt( A^{lm} \; e_3 \zeta \rt) ]{j} , 
    11511153                                \frac{1}{e_2}     \pd[ \lt( A^{lm}    \chi      \rt) ]{j} 
    11521154                         \lt. + \frac{1}{e_1 e_3} \pd[ \lt( A^{lm} \; e_3 \zeta \rt) ]{i} \rt) 
     
    11571159Unfortunately, it is only available in \textit{iso-level} direction. 
    11581160When a rotation is required 
    1159 (\ie geopotential diffusion in $s$-coordinates or isoneutral diffusion in both $z$- and $s$-coordinates), 
     1161(\ie\ geopotential diffusion in $s$-coordinates or isoneutral diffusion in both $z$- and $s$-coordinates), 
    11601162the $u$ and $v$-fields are considered as independent scalar fields, so that the diffusive operator is given by: 
    11611163\begin{gather*} 
     
    11671169It is the same expression as those used for diffusive operator on tracers. 
    11681170It must be emphasised that such a formulation is only exact in a Cartesian coordinate system, 
    1169 \ie on a $f$- or $\beta$-plane, not on the sphere. 
     1171\ie\ on a $f$- or $\beta$-plane, not on the sphere. 
    11701172It is also a very good approximation in vicinity of the Equator in 
    11711173a geographical coordinate system \citep{lengaigne.madec.ea_JGR03}. 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_model_basics_zstar.tex

    r11263 r11512  
    1818 
    1919In that case, the free surface equation is nonlinear, and the variations of volume are fully taken into account. 
    20 These coordinates systems is presented in a report \citep{levier.treguier.ea_rpt07} available on the \NEMO web site.  
     20These coordinates systems is presented in a report \citep{levier.treguier.ea_rpt07} available on the \NEMO\ web site. 
    2121 
    2222\colorbox{yellow}{  end of to be updated} 
     
    2424% from MOM4p1 documentation 
    2525 
    26 To overcome problems with vanishing surface and/or bottom cells, we consider the zstar coordinate  
     26To overcome problems with vanishing surface and/or bottom cells, we consider the zstar coordinate 
    2727\[ 
    2828  % \label{eq:PE_} 
     
    4040the surface height, it is clear that surfaces constant $z^\star$ are very similar to the depth surfaces. 
    4141These properties greatly reduce difficulties of computing the horizontal pressure gradient relative to 
    42 terrain following sigma models discussed in \autoref{subsec:PE_sco}.  
     42terrain following sigma models discussed in \autoref{subsec:PE_sco}. 
    4343Additionally, since $z^\star$ when $\eta = 0$, no flow is spontaneously generated in 
    4444an unforced ocean starting from rest, regardless the bottom topography. 
     
    4949neutral physics parameterizations in $z^\star$ models using the same techniques as in $z$-models 
    5050(see Chapters 13-16 of Griffies (2004) for a discussion of neutral physics in $z$-models, 
    51 as well as  \autoref{sec:LDF_slp} in this document for treatment in \NEMO).  
     51as well as  \autoref{sec:LDF_slp} in this document for treatment in \NEMO). 
    5252 
    5353The range over which $z^\star$ varies is time independent $-H \leq z^\star \leq 0$. 
    5454Hence, all cells remain nonvanishing, so long as the surface height maintains $\eta > ?H$. 
    55 This is a minor constraint relative to that encountered on the surface height when using $s = z$ or $s = z - \eta$.  
     55This is a minor constraint relative to that encountered on the surface height when using $s = z$ or $s = z - \eta$. 
    5656 
    5757Because $z^\star$ has a time independent range, all grid cells have static increments ds, 
    58 and the sum of the ver tical increments yields the time independent ocean depth %�k ds = H.  
     58and the sum of the ver tical increments yields the time independent ocean depth %�k ds = H. 
    5959The $z^\star$ coordinate is therefore invisible to undulations of the free surface, 
    6060since it moves along with the free surface. 
     
    6464Quite generally, the time independent range for the $z^\star$ coordinate is a very convenient property that 
    6565allows for a nearly arbitrary vertical resolution even in the presence of large amplitude fluctuations of 
    66 the surface height, again so long as $\eta > -H$.  
     66the surface height, again so long as $\eta > -H$. 
    6767 
    6868%%% 
     
    7878%-----------------------------------------nam_dynspg---------------------------------------------------- 
    7979 
    80 %\nlst{nam_dynspg}  
     80%\nlst{nam_dynspg} 
    8181%------------------------------------------------------------------------------------------------------------ 
    82 Options are defined through the \ngn{nam\_dynspg} namelist variables. 
     82Options are defined through the \nam{\_dynspg} namelist variables. 
    8383The surface pressure gradient term is related to the representation of the free surface (\autoref{sec:PE_hor_pg}). 
    8484The main distinction is between the fixed volume case (linear free surface or rigid lid) and 
     
    116116and $\rho_w =1,000\,Kg.m^{-3}$ is the volumic mass of pure water. 
    117117The sea-surface height is evaluated using a leapfrog scheme in combination with an Asselin time filter, 
    118 (\ie the velocity appearing in (\autoref{eq:dynspg_ssh}) is centred in time (\textit{now} velocity).  
     118(\ie\ the velocity appearing in (\autoref{eq:dynspg_ssh}) is centred in time (\textit{now} velocity). 
    119119 
    120120The surface pressure gradient, also evaluated using a leap-frog scheme, is then simply given by: 
     
    127127    \end{aligned} 
    128128  \right. 
    129 \end{equation}  
     129\end{equation} 
    130130 
    131131Consistent with the linearization, a $\left. \rho \right|_{k=1} / \rho_o$ factor is omitted in 
    132 (\autoref{eq:dynspg_exp}).  
     132(\autoref{eq:dynspg_exp}). 
    133133 
    134134%------------------------------------------------------------- 
     
    140140%--------------------------------------------namdom---------------------------------------------------- 
    141141 
    142 \nlst{namdom}  
     142\nlst{namdom} 
    143143%-------------------------------------------------------------------------------------------------------------- 
    144144The split-explicit free surface formulation used in OPA follows the one proposed by \citet{Griffies2004?}. 
    145145The general idea is to solve the free surface equation with a small time step, 
    146146while the three dimensional prognostic variables are solved with a longer time step that 
    147 is a multiple of \np{rdtbt} in the \ngn{namdom} namelist (Figure III.3).  
     147is a multiple of \np{rdtbt} in the \nam{dom} namelist (Figure III.3). 
    148148 
    149149%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
     
    175175The split-explicit formulation has a damping effect on external gravity waves, 
    176176which is weaker than the filtered free surface but still significant as shown by \citet{levier.treguier.ea_rpt07} in 
    177 the case of an analytical barotropic Kelvin wave.  
     177the case of an analytical barotropic Kelvin wave. 
    178178 
    179179%from griffies book: .....   copy past ! 
     
    188188  % \label{eq:DYN_spg_ts_eta} 
    189189  \eta^{(b)}(\tau,t_{n+1}) - \eta^{(b)}(\tau,t_{n+1}) (\tau,t_{n-1}) 
    190   = 2 \Delta t \left[-\nabla \cdot \textbf{U}^{(b)}(\tau,t_n) + \text{EMP}_w(\tau) \right]  
     190  = 2 \Delta t \left[-\nabla \cdot \textbf{U}^{(b)}(\tau,t_n) + \text{EMP}_w(\tau) \right] 
    191191\] 
    192192\begin{multline*} 
     
    205205the freshwater flux $\text{EMP}_w(\tau)$, and total depth of the ocean $H(\tau)$ are held for 
    206206the duration of the barotropic time stepping over a single cycle. 
    207 This is also the time that sets the barotropic time steps via  
     207This is also the time that sets the barotropic time steps via 
    208208\[ 
    209209  % \label{eq:DYN_spg_ts_t} 
    210   t_n=\tau+n\Delta t    
     210  t_n=\tau+n\Delta t 
    211211\] 
    212212with $n$ an integer. 
    213 The density scaled surface pressure is evaluated via  
     213The density scaled surface pressure is evaluated via 
    214214\[ 
    215215  % \label{eq:DYN_spg_ts_ps} 
     
    220220  \end{cases} 
    221221\] 
    222 To get started, we assume the following initial conditions  
     222To get started, we assume the following initial conditions 
    223223\[ 
    224224  % \label{eq:DYN_spg_ts_eta} 
     
    228228  \end{split} 
    229229\] 
    230 with  
     230with 
    231231\[ 
    232232  % \label{eq:DYN_spg_ts_etaF} 
     
    240240  \textbf{U}(\tau,t_{n=1}) = \textbf{U}^{(b)}(\tau,t_{n=0}) + \Delta t \ \text{RHS}_{n=0} 
    241241\] 
    242 with  
     242with 
    243243\[ 
    244244  % \label{eq:DYN_spg_ts_u} 
     
    246246\] 
    247247the time averaged vertically integrated transport. 
    248 Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration.  
     248Notably, there is no Robert-Asselin time filter used in the barotropic portion of the integration. 
    249249 
    250250Upon reaching $t_{n=N} = \tau + 2\Delta \tau$ , the vertically integrated velocity is time averaged to 
    251 produce the updated vertically integrated velocity at baroclinic time $\tau + \Delta \tau$  
     251produce the updated vertically integrated velocity at baroclinic time $\tau + \Delta \tau$ 
    252252\[ 
    253253  % \label{eq:DYN_spg_ts_u} 
     
    256256\] 
    257257The surface height on the new baroclinic time step is then determined via 
    258 a baroclinic leap-frog using the following form  
     258a baroclinic leap-frog using the following form 
    259259\begin{equation} 
    260260  \label{eq:DYN_spg_ts_ssh} 
     
    264264The use of this "big-leap-frog" scheme for the surface height ensures compatibility between 
    265265the mass/volume budgets and the tracer budgets. 
    266 More discussion of this point is provided in Chapter 10 (see in particular Section 10.2).  
    267   
     266More discussion of this point is provided in Chapter 10 (see in particular Section 10.2). 
     267 
    268268In general, some form of time filter is needed to maintain integrity of the surface height field due to 
    269269the leap-frog splitting mode in equation \autoref{eq:DYN_spg_ts_ssh}. 
    270270We have tried various forms of such filtering, 
    271271with the following method discussed in Griffies et al. (2001) chosen due to its stability and 
    272 reasonably good maintenance of tracer conservation properties (see ??)  
     272reasonably good maintenance of tracer conservation properties (see ??) 
    273273 
    274274\begin{equation} 
     
    276276  \eta^{F}(\tau-\Delta) =  \overline{\eta^{(b)}(\tau)} 
    277277\end{equation} 
    278 Another approach tried was  
     278Another approach tried was 
    279279 
    280280\[ 
     
    289289surface height time filtering (see ?? for more complete discussion). 
    290290However, in the general case with a non-zero $\alpha$, the filter \autoref{eq:DYN_spg_ts_sshf} was found to 
    291 be more conservative, and so is recommended.  
    292  
    293 %------------------------------------------------------------- 
    294 % Filtered formulation  
     291be more conservative, and so is recommended. 
     292 
     293%------------------------------------------------------------- 
     294% Filtered formulation 
    295295%------------------------------------------------------------- 
    296296\subsubsection[Filtered formulation (\texttt{\textbf{key\_dynspg\_flt}})] 
     
    307307 
    308308%------------------------------------------------------------- 
    309 % Non-linear free surface formulation  
     309% Non-linear free surface formulation 
    310310%------------------------------------------------------------- 
    311311\subsection[Non-linear free surface formulation (\texttt{\textbf{key\_vvl}})] 
     
    314314 
    315315In the non-linear free surface formulation, the variations of volume are fully taken into account. 
    316 This option is presented in a report \citep{levier.treguier.ea_rpt07} available on the NEMO web site. 
     316This option is presented in a report \citep{levier.treguier.ea_rpt07} available on the \NEMO\ web site. 
    317317The three time-stepping methods (explicit, split-explicit and filtered) are the same as in 
    318318\autoref{DYN_spg_linear} except that the ocean depth is now time-dependent. 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/chap_time_domain.tex

    r11263 r11512  
    88\chapter{Time Domain (STP)} 
    99\label{chap:STP} 
    10 \minitoc 
     10\chaptertoc 
    1111 
    1212% Missing things: 
     
    2121Having defined the continuous equations in \autoref{chap:PE}, we need now to choose a time discretization, 
    2222a key feature of an ocean model as it exerts a strong influence on the structure of the computer code 
    23 (\ie on its flowchart). 
    24 In the present chapter, we provide a general description of the \NEMO  time stepping strategy and 
     23(\ie\ on its flowchart). 
     24In the present chapter, we provide a general description of the \NEMO\  time stepping strategy and 
    2525the consequences for the order in which the equations are solved. 
    2626 
     
    3131\label{sec:STP_environment} 
    3232 
    33 The time stepping used in \NEMO is a three level scheme that can be represented as follows: 
     33The time stepping used in \NEMO\ is a three level scheme that can be represented as follows: 
    3434\begin{equation} 
    3535  \label{eq:STP} 
    3636  x^{t + \rdt} = x^{t - \rdt} + 2 \, \rdt \ \text{RHS}_x^{t - \rdt, \, t, \, t + \rdt} 
    37 \end{equation}  
     37\end{equation} 
    3838where $x$ stands for $u$, $v$, $T$ or $S$; 
    3939RHS is the Right-Hand-Side of the corresponding time evolution equation; 
     
    5353is usually not the variable at the after time step; 
    5454but rather it is used to store the time derivative (RHS in \autoref{eq:STP}) prior to time-stepping the equation. 
    55 The time stepping itself is performed once at each time step where implicit vertical diffusion is computed, \ie in the \mdl{trazdf} and \mdl{dynzdf} modules. 
     55The time stepping itself is performed once at each time step where implicit vertical diffusion is computed, \ie\ in the \mdl{trazdf} and \mdl{dynzdf} modules. 
    5656 
    5757% ------------------------------------------------------------------------------------------------------------- 
     
    6464\citep{mesinger.arakawa_bk76}. 
    6565This scheme is widely used for advection processes in low-viscosity fluids. 
    66 It is a time centred scheme, \ie the RHS in \autoref{eq:STP} is evaluated at time step $t$, the now time step. 
     66It is a time centred scheme, \ie\ the RHS in \autoref{eq:STP} is evaluated at time step $t$, the now time step. 
    6767It may be used for momentum and tracer advection, pressure gradient, and Coriolis terms, 
    6868but not for diffusion terms. 
     
    9292Therefore, the LF-RA is a quasi second order accurate scheme. 
    9393The LF-RA scheme is preferred to other time differencing schemes such as predictor corrector or trapezoidal schemes, 
    94 because the user has an explicit and simple control of the magnitude of the time diffusion of the scheme.  
     94because the user has an explicit and simple control of the magnitude of the time diffusion of the scheme. 
    9595When used with the 2nd order space centred discretisation of the advection terms in 
    9696the momentum and tracer equations, LF-RA avoids implicit numerical diffusion: 
    97 diffusion is set explicitly by the user through the Robert-Asselin  
     97diffusion is set explicitly by the user through the Robert-Asselin 
    9898filter parameter and the viscosity and diffusion coefficients. 
    9999 
     
    128128 
    129129For the vertical diffusion terms, a forward time differencing scheme can be used, 
    130 but usually the numerical stability condition imposes a strong constraint on the time step. To overcome the stability constraint, a  
     130but usually the numerical stability condition imposes a strong constraint on the time step. To overcome the stability constraint, a 
    131131backward (or implicit) time differencing scheme is used. This scheme is unconditionally stable but diffusive and can be written as follows: 
    132132\begin{equation} 
     
    152152  -c(k + 1) \; T^{t + 1}(k + 1) + d(k) \; T^{t + 1}(k) - \; c(k) \; T^{t + 1}(k - 1) \equiv b(k) 
    153153\end{equation} 
    154 where  
    155 \begin{align*}  
     154where 
     155\begin{align*} 
    156156  c(k) &= A_w^{vT} (k) \, / \, e_{3w} (k)     \\ 
    157157  d(k) &= e_{3t}   (k)       \, / \, (2 \rdt) + c_k + c_{k + 1}    \\ 
     
    171171\label{sec:STP_spg_ts} 
    172172 
    173 The leapfrog environment supports a centred in time computation of the surface pressure, \ie evaluated  
    174 at \textit{now} time step. This refers to as the explicit free surface case in the code (\np{ln\_dynspg\_exp}\forcode{ = .true.}).  
    175 This choice however imposes a strong constraint on the time step which should be small enough to resolve the propagation  
    176 of external gravity waves. As a matter of fact, one rather use in a realistic setup, a split-explicit free surface  
    177 (\np{ln\_dynspg\_ts}\forcode{ = .true.}) in which barotropic and baroclinic dynamical equations are solved separately with ad-hoc  
    178 time steps. The use of the time-splitting (in combination with non-linear free surface) imposes some constraints on the design of  
     173The leapfrog environment supports a centred in time computation of the surface pressure, \ie\ evaluated 
     174at \textit{now} time step. This refers to as the explicit free surface case in the code (\np{ln\_dynspg\_exp}\forcode{ = .true.}). 
     175This choice however imposes a strong constraint on the time step which should be small enough to resolve the propagation 
     176of external gravity waves. As a matter of fact, one rather use in a realistic setup, a split-explicit free surface 
     177(\np{ln\_dynspg\_ts}\forcode{ = .true.}) in which barotropic and baroclinic dynamical equations are solved separately with ad-hoc 
     178time steps. The use of the time-splitting (in combination with non-linear free surface) imposes some constraints on the design of 
    179179the overall flowchart, in particular to ensure exact tracer conservation (see \autoref{fig:TimeStep_flowchart}). 
    180180 
    181 Compared to the former use of the filtered free surface in \NEMO v3.6 (\citet{roullet.madec_JGR00}), the use of a split-explicit free surface is advantageous  
    182 on massively parallel computers. Indeed, no global computations are anymore required by the elliptic solver which saves a substantial amount of communication  
    183 time. Fast barotropic motions (such as tides) are also simulated with a better accuracy.  
    184  
    185 %\gmcomment{  
     181Compared to the former use of the filtered free surface in \NEMO\ v3.6 (\citet{roullet.madec_JGR00}), the use of a split-explicit free surface is advantageous 
     182on massively parallel computers. Indeed, no global computations are anymore required by the elliptic solver which saves a substantial amount of communication 
     183time. Fast barotropic motions (such as tides) are also simulated with a better accuracy. 
     184 
     185%\gmcomment{ 
    186186%>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    187187\begin{figure}[!t] 
     
    190190    \caption{ 
    191191      \protect\label{fig:TimeStep_flowchart} 
    192       Sketch of the leapfrog time stepping sequence in \NEMO with split-explicit free surface. The latter combined 
    193        with non-linear free surface requires the dynamical tendency being updated prior tracers tendency to ensure  
    194        conservation. Note the use of time integrated fluxes issued from the barotropic loop  in subsequent calculations  
    195        of tracer advection and in the continuity equation. Details about the time-splitting scheme can be found  
     192      Sketch of the leapfrog time stepping sequence in \NEMO\ with split-explicit free surface. The latter combined 
     193       with non-linear free surface requires the dynamical tendency being updated prior tracers tendency to ensure 
     194       conservation. Note the use of time integrated fluxes issued from the barotropic loop  in subsequent calculations 
     195       of tracer advection and in the continuity equation. Details about the time-splitting scheme can be found 
    196196       in \autoref{subsec:DYN_spg_ts}. 
    197197    } 
     
    212212 
    213213In a classical LF-RA environment, the forcing term is centred in time, 
    214 \ie it is time-stepped over a $2 \rdt$ period: 
     214\ie\ it is time-stepped over a $2 \rdt$ period: 
    215215$x^t = x^t + 2 \rdt Q^t$ where $Q$ is the forcing applied to $x$, 
    216216and the time filter is given by \autoref{eq:STP_asselin} so that $Q$ is redistributed over several time step. 
     
    236236Second, the LF-RA becomes a truly quasi -second order scheme. 
    237237Indeed, \autoref{eq:STP_forcing} used in combination with a careful treatment of static instability 
    238 (\autoref{subsec:ZDF_evd}) and of the TKE physics (\autoref{subsec:ZDF_tke_ene})  
     238(\autoref{subsec:ZDF_evd}) and of the TKE physics (\autoref{subsec:ZDF_tke_ene}) 
    239239(the two other main sources of time step divergence), 
    240240allows a reduction by two orders of magnitude of the Asselin filter parameter. 
     
    280280  x^1 = x^0 + \rdt \ \text{RHS}^0 
    281281\] 
    282 This is done simply by keeping the leapfrog environment (\ie the \autoref{eq:STP} three level time stepping) but 
     282This is done simply by keeping the leapfrog environment (\ie\ the \autoref{eq:STP} three level time stepping) but 
    283283setting all $x^0$ (\textit{before}) and $x^1$ (\textit{now}) fields equal at the first time step and 
    284 using half the value of a leapfrog time step ($2 \rdt$).  
     284using half the value of a leapfrog time step ($2 \rdt$). 
    285285 
    286286It is also possible to restart from a previous computation, by using a restart file. 
     
    292292 
    293293Note that the time step $\rdt$, is also saved in the restart file. 
    294 When restarting, if the time step has been changed, or one of the prognostic variables at \textit{before} time step  
    295 is missing, an Euler time stepping scheme is imposed. A forward initial step can still be enforced by the user by setting  
    296 the namelist variable \np{nn\_euler}\forcode{=0}. Other options to control the time integration of the model  
    297 are defined through the  \ngn{namrun} namelist variables. 
     294When restarting, if the time step has been changed, or one of the prognostic variables at \textit{before} time step 
     295is missing, an Euler time stepping scheme is imposed. A forward initial step can still be enforced by the user by setting 
     296the namelist variable \np{nn\_euler}\forcode{=0}. Other options to control the time integration of the model 
     297are defined through the  \nam{run} namelist variables. 
    298298%%% 
    299299\gmcomment{ 
     
    302302add also the idea of writing several restart for seasonal forecast : how is it done ? 
    303303 
    304 verify that all namelist pararmeters are truly described  
     304verify that all namelist pararmeters are truly described 
    305305 
    306306a word on the check of restart  ..... 
     
    308308%%% 
    309309 
    310 \gmcomment{       % add a subsection here   
     310\gmcomment{       % add a subsection here 
    311311 
    312312%------------------------------------------------------------------------------------------------------------- 
     
    317317%--------------------------------------------namrun------------------------------------------- 
    318318 
    319 \nlst{namdom}          
     319\nlst{namdom} 
    320320%-------------------------------------------------------------------------------------------------------------- 
    321321 
    322 Options are defined through the  \ngn{namdom} namelist variables. 
     322Options are defined through the  \nam{dom} namelist variables. 
    323323 \colorbox{yellow}{add here a few word on nit000 and nitend} 
    324324 
     
    332332 
    333333%% 
    334 \gmcomment{       % add implicit in vvl case  and Crant-Nicholson scheme    
     334\gmcomment{       % add implicit in vvl case  and Crant-Nicholson scheme 
    335335 
    336336Implicit time stepping in case of variable volume thickness. 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/NEMO/subfiles/introduction.tex

    r11353 r11512  
    11\documentclass[../main/NEMO_manual]{subfiles} 
     2 
     3%% Remove section heading (no section here) 
     4\rehead{} 
    25 
    36\begin{document} 
     
    1215namely OPA \footnote{OPA: Oc\'{e}an PArall\'{e}lis\'{e} (french)} for the ocean dynamics and thermodynamics, 
    1316SI$^3$ \footnote{SI$^3$: Sea-Ice modelling Integrated Initiative} for the sea-ice dynamics and thermodynamics, 
    14 TOP \footnote{TOP: Tracer in the Ocean Paradigm} for the biogeochemistry  
    15 (both transport (TRP) and sources minus sinks  
     17TOP \footnote{TOP: Tracer in the Ocean Paradigm} for the biogeochemistry 
     18(both transport (TRP) and sources minus sinks 
    1619(PISCES \footnote{PISCES: Pelagic Interactions Scheme for Carbon and Ecosystem Studies})). 
    1720It is intended to be a flexible tool for studying the ocean and its interactions with the other components of 
    1821the earth climate system (atmosphere, sea-ice, biogeochemical tracers, ...) over 
    1922a wide range of space and time scales. 
    20 This manual provides information about the physics represented by the ocean component of \NEMO and 
     23This manual provides information about the physics represented by the ocean component of \NEMO\ and 
    2124the rationale for the choice of numerical schemes and the model design. 
    22 For the use of framework,  
    23 a guide which gathers the \texttt{README} files spread out in the source code can be build and  
     25For the use of framework, 
     26a guide which gathers the \texttt{README} files spread out in the source code can be build and 
    2427exported in web or printable format (see \path{./doc/rst}). 
    25 An online version of the guide is also available on the  
    26 \href{http://forge.ipsl.jussieu.fr/nemo}{\NEMO forge platform}. 
    27  
    28 The ocean component of \NEMO has been developed from the legacy of the OPA model, release 8.2,  
     28An online version of the guide is also available on the 
     29\href{http://forge.ipsl.jussieu.fr/nemo}{\NEMO\ forge platform}. 
     30 
     31The ocean component of \NEMO\ has been developed from the legacy of the OPA model, release 8.2, 
    2932described in \citet{madec.delecluse.ea_NPM98}. 
    30 This model has been used for a wide range of applications, both regional or global, as a forced ocean model and  
     33This model has been used for a wide range of applications, both regional or global, as a forced ocean model and 
    3134as a model coupled with the sea-ice and/or the atmosphere. 
    3235 
    3336This manual is organised in as follows. 
    34 \autoref{chap:PE} presents the model basics, \ie the equations and their assumptions, 
     37\autoref{chap:PE} presents the model basics, \ie\ the equations and their assumptions, 
    3538the vertical coordinates used, and the subgrid scale physics. 
    3639This part deals with the continuous equations of the model 
     
    4346The following chapters deal with the discrete equations. 
    4447\autoref{chap:STP} presents the time domain. 
    45 The model time stepping environment is a three level scheme in which  
    46 the tendency terms of the equations are evaluated either centered in time, or forward, or backward depending of  
     48The model time stepping environment is a three level scheme in which 
     49the tendency terms of the equations are evaluated either centered in time, or forward, or backward depending of 
    4750the nature of the term. 
    4851\autoref{chap:DOM} presents the space domain. 
    4952The model is discretised on a staggered grid (Arakawa C grid) with masking of land areas. 
    50 Vertical discretisation used depends on both how the bottom topography is represented and whether  
     53Vertical discretisation used depends on both how the bottom topography is represented and whether 
    5154the free surface is linear or not. 
    52 Full step or partial step $z$-coordinate or $s$- (terrain-following) coordinate is used with linear free surface  
     55Full step or partial step $z$-coordinate or $s$- (terrain-following) coordinate is used with linear free surface 
    5356(level position are then fixed in time). 
    5457In non-linear free surface, the corresponding rescaled height coordinate formulation (\zstar or \sstar) is used 
     
    5760the prognostic equations for the active tracers and the momentum. 
    5861Explicit, split-explicit and filtered free surface formulations are implemented. 
    59 A number of numerical schemes are available for momentum advection,  
    60 for the computation of the pressure gradients, as well as for the advection of tracers  
     62A number of numerical schemes are available for momentum advection, 
     63for the computation of the pressure gradients, as well as for the advection of tracers 
    6164(second or higher order advection schemes, including positive ones). 
    6265 
    63 Surface boundary conditions (\autoref{chap:SBC}) can be implemented as prescribed fluxes, or bulk formulations for  
     66Surface boundary conditions (\autoref{chap:SBC}) can be implemented as prescribed fluxes, or bulk formulations for 
    6467the surface fluxes (wind stress, heat, freshwater). 
    6568The model allows penetration of solar radiation. 
    6669There is an optional geothermal heating at the ocean bottom. 
    67 Within the \NEMO system the ocean model is interactively coupled with a sea ice model (SI$^3$) and 
     70Within the \NEMO\ system the ocean model is interactively coupled with a sea ice model (SI$^3$) and 
    6871a biogeochemistry model (PISCES). 
    6972Interactive coupling to Atmospheric models is possible via the \href{https://portal.enes.org/oasis}{OASIS coupler}. 
     
    8689\citet{treguier.held.ea_JPO97}. 
    8790The model has vertical harmonic viscosity and diffusion with a space and time variable coefficient, 
    88 with options to compute the coefficients with \citet{blanke.delecluse_JPO93}, \citet{pacanowski.philander_JPO81}, or  
     91with options to compute the coefficients with \citet{blanke.delecluse_JPO93}, \citet{pacanowski.philander_JPO81}, or 
    8992\citet{umlauf.burchard_JMR03} mixing schemes. 
    90   
     93 
    9194%%gm    To be put somewhere else .... 
    9295%%nm    We should consider creating a glossary for all this kind of stuff (terms, acronyms and symbols) 
     
    100103it changes the code from one set of CPP keys to the other. 
    101104It is used only when the addition/suppression of the part of code highly changes the amount of memory at run time. 
    102 Usual coding looks like:  
     105Usual coding looks like: 
    103106 
    104107\begin{forlines} 
     
    112115 
    113116The namelist allows to input variables (character, logical, real and integer) into the code. 
    114 There is one namelist file for each component of NEMO (dynamics, sea-ice, biogeochemistry...) 
     117There is one namelist file for each component of \NEMO\ (dynamics, sea-ice, biogeochemistry...) 
    115118containing all the \fortran namelists needed. 
    116 The implementation in NEMO uses a 2-step process.  
     119The implementation in \NEMO\ uses a 2-step process. 
    117120For each \fortran namelist, two files are read: 
    118121 
     
    136139the computation of on-line floats trajectories... 
    137140\autoref{chap:OBS} describes a tool which reads in observation files 
    138 (profile temperature and salinity, sea surface temperature, sea level anomaly and sea ice concentration)  
     141(profile temperature and salinity, sea surface temperature, sea level anomaly and sea ice concentration) 
    139142and calculates an interpolated model equivalent value at the observation location and nearest model timestep. 
    140143Originally developed of data assimilation, it is a fantastic tool for model and data comparison. 
     
    143146(water column model, ORCA and GYRE families of configurations). 
    144147 
    145 %%nm: Add some words on the NEMO dependencies 
     148%%nm: Add some words on the \NEMO\ dependencies 
    146149The model is implemented in \fninety, with preprocessing (C pre-processor). 
    147150It runs under UNIX. 
     
    164167The manual mirrors the organization of the model. 
    165168After the presentation of the continuous equations (\autoref{chap:PE}), 
    166 the following chapters refer to specific terms of the equations each associated with a group of modules  
     169the following chapters refer to specific terms of the equations each associated with a group of modules 
    167170(\autoref{tab:chapters}). 
    168171 
    169172%--------------------------------------------------TABLE-------------------------------------------------- 
    170 \begin{table}[!t]  
     173\begin{table}[!t] 
    171174  \caption{ 
    172175    \protect\label{tab:chapters} 
     
    207210%-------------------------------------------------------------------------------------------------------------- 
    208211 
    209 %% nm: the following section has to vastly remodeled to focus only on well-identified versions of NEMO 
     212%% nm: the following section has to vastly remodeled to focus only on well-identified versions of \NEMO 
    210213%% (3.4, 3.6, 4.0 and further releases). Then its formatting must be improved too. 
    211214\subsubsection{Changes between releases} 
    212215 
    213 NEMO/OPA, like all research tools, is in perpetual evolution. 
    214 The present document describes the OPA version include in the release 3.4 of NEMO. 
     216\NEMO/OPA, like all research tools, is in perpetual evolution. 
     217The present document describes the OPA version include in the release 3.4 of \NEMO. 
    215218This release differs significantly from version 8, documented in \citet{madec.delecluse.ea_NPM98}. \\ 
    216219 
    217 The main modifications from OPA v8 and NEMO/OPA v3.2 are : 
    218  
    219 \begin{itemize} 
    220 \item 
    221   transition to full native \fninety, deep code restructuring and drastic reduction of CPP keys;  
     220The main modifications from OPA v8 and \NEMO/OPA v3.2 are : 
     221 
     222\begin{itemize} 
     223\item 
     224  transition to full native \fninety, deep code restructuring and drastic reduction of CPP keys; 
    222225\item 
    223226  introduction of partial step representation of bottom topography 
     
    253256  which includes an on-the-fly interpolation of input forcing fields; 
    254257\item 
    255   RGB light penetration and optional use of ocean color  
     258  RGB light penetration and optional use of ocean color 
    256259\item 
    257260  major changes in the TKE schemes: it now includes a Langmuir cell parameterization \citep{axell_JGR02}, 
     
    267270\end{itemize} 
    268271 
    269 The main modifications from NEMO/OPA v3.2 and v3.3 are: 
     272The main modifications from \NEMO/OPA v3.2 and v3.3 are: 
    270273 
    271274\begin{itemize} 
    272275\item 
    273276  introduction of a modified leapfrog-Asselin filter time stepping scheme 
    274   \citep{leclair.madec_OM09};  
     277  \citep{leclair.madec_OM09}; 
    275278\item 
    276279  additional scheme for iso-neutral mixing \citep{griffies.gnanadesikan.ea_JPO98}, although it is still a "work in progress"; 
     
    315318improving the model performance. 
    316319 
    317 The main modifications from NEMO/OPA v3.3 and v3.4 are: 
     320The main modifications from \NEMO/OPA v3.3 and v3.4 are: 
    318321 
    319322\begin{itemize} 
     
    329332\end{itemize} 
    330333 
    331 The main modifications from NEMO/OPA v3.4 and v3.6 are: 
     334The main modifications from \NEMO/OPA v3.4 and v3.6 are: 
    332335 
    333336\begin{itemize} 
     
    335338\end{itemize} 
    336339 
    337 The main modifications from NEMO/OPA v3.6 and v4.0 are: 
     340The main modifications from \NEMO/OPA v3.6 and v4.0 are: 
    338341 
    339342\begin{itemize} 
    340343\item new definition of configurations; 
    341344\item bulk formulation; 
    342 \item NEMO-wave large scale interactions; 
     345\item \NEMO-wave large scale interactions; 
    343346\item ...; 
    344347\end{itemize} 
     
    348351\pindex 
    349352 
     353%% Restore section heading 
     354\rehead{Sect.\ \thesection\ \rightmark} 
     355 
    350356\end{document} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/SI3/main/definitions.tex

    r11263 r11512  
    22\def \engine{SI3} 
    33 
    4 %% Title (variable name already use by 'titling' pkg) 
    5 \def \heading{Sea Ice modelling Integrated Initiative (SI$^3$) \\ The NEMO sea ice engine} 
     4%% Title and cover page settings 
     5\def \spacetop{  \vspace*{1.2cm} } 
     6\def \heading{Sea Ice modelling Integrated Initiative (SI$^3$)} 
     7\def \subheading{The NEMO sea ice engine} 
     8\def \spacedown{ \vspace*{1cm  } } 
     9\def \authorswidth{0.2\linewidth} 
     10\def \rulelenght{230pt} 
     11\def \abstractwidth{0.65\linewidth} 
    612 
    7 %% Authors (thanks will apply to the second author) 
    8 \def \firstauthor{} 
    9 \def \secondauthor{NEMO Sea Ice Working Group} 
     13%% Color for document (frontpage banner, links and chapter boxes) 
     14\def \setcolor{ \definecolor{manualcolor}{cmyk}{0, 0, 0, 0.4} } 
    1015 
    1116%% IPSL publication number 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/SI3/main/foreword.tex

    r11263 r11512  
     1%% ================================================================ 
     2%% Abstract 
     3%% ================================================================ 
     4 
     5%% Common part between NEMO-SI3-TOP 
     6``Sea Ice Modelling Integrated Initiative'' (\SIcube) is the sea ice engine of 
     7the \NEMO\ ocean model (``Nucleus for European Modelling of the Ocean''). 
     8It is intended to be a flexible tool for studying the sea ice dynamics and thermodynamics, 
     9brine inclusions and subgrid-scale thickness variations (``white ocean''), 
     10as well as its interactions with the other components of the Earth climate system over 
     11a wide range of space and time scales. 
     12\SIcube\ is interfaced with the \NEMO\ ocean engine, and, 
     13via the \href{http://portal.enes.org/oasis}{OASIS} coupler, 
     14with several atmospheric general circulation models. 
     15It also supports two-way grid embedding by means of the \href{http://agrif.imag.fr}{AGRIF} software. 
     16 
     17%% Specific part 
     18Designed for global to regional applications up to $~$10 km of effective resolution, 
     19\SIcube\ is a curvilinear grid, finite-difference implementation of the classical AIDJEX model 
     20(Arctic Ice Dynamics Joint EXperiment), 
     21combining the conservation of momentum for viscous-plastic continuum, 
     22energy and salt-conserving halo-thermodynamics, 
     23an explicit representation of subgrid-scale ice thickness variations, snow and melt ponds. 
     24An option to switch back to the \textit{single-category} (or \textit{2-level}) framework provides 
     25a cheap sea ice modelling solution. 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/SI3/main/thanks.tex

    r11263 r11512  
    1 TBD 
     1Yevgeny Aksenov       \\ 
     2Ed Blockley           \\ 
     3Matthieu Chevallier   \\ 
     4Danny Feltham         \\ 
     5Thierry Fichefet      \\ 
     6Gilles Garric         \\ 
     7Paul Holland          \\ 
     8Dorotea Iovino        \\ 
     9Gurvan Madec          \\ 
     10Fran\c cois Massonnet \\ 
     11Jeff Ridley           \\ 
     12Cl\'ement Rousset     \\ 
     13David Salas           \\ 
     14David Schroeder       \\ 
     15Steffen Tietsche      \\ 
     16Martin Vancoppenolle 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/SI3/subfiles/introduction.tex

    r11263 r11512  
    88\textcolor{red}{[ \textit{July 2018} ]} \\ 
    99 
    10 %Near the poles of the Earth, the seas and oceans freeze when seawater at the freezing point loses heat. The resulting forms of saline ice are collectively called \textit{sea ice} \citep{WMO70}, reaching up to a few meters in thickness, where as sea ice coverage is about 5\% of the global ocean, about 30 million square kilometers. All sea ice characteristics vary over a wide range of spatio-temporal scales, reflecting changes in heat, mass and momentum exchanges with the atmosphere and the ocean; the clearest temporal signal being an ample seasonal cycle. Sea ice formation and melting affects water mass formation in the ocean \citep{goosse_1999}. It not only impacts, but also reflects the state of the climate system \citep{budyko_1969,notz_2016}.  Sea ice also affects marine life, water chemistry and human activities in polar regions. Local populations use sea ice for travelling and hunting, whereas navigation and resource exploitation are dependent on sea ice conditions. For such reasons, ocean modelling systems, including NEMO, must include a sea ice component. 
     10%Near the poles of the Earth, the seas and oceans freeze when seawater at the freezing point loses heat. The resulting forms of saline ice are collectively called \textit{sea ice} \citep{WMO70}, reaching up to a few meters in thickness, where as sea ice coverage is about 5\% of the global ocean, about 30 million square kilometers. All sea ice characteristics vary over a wide range of spatio-temporal scales, reflecting changes in heat, mass and momentum exchanges with the atmosphere and the ocean; the clearest temporal signal being an ample seasonal cycle. Sea ice formation and melting affects water mass formation in the ocean \citep{goosse_1999}. It not only impacts, but also reflects the state of the climate system \citep{budyko_1969,notz_2016}.  Sea ice also affects marine life, water chemistry and human activities in polar regions. Local populations use sea ice for travelling and hunting, whereas navigation and resource exploitation are dependent on sea ice conditions. For such reasons, ocean modelling systems, including \NEMO, must include a sea ice component. 
    1111 
    12 The sea Ice Modelling Integrated Initiative (SI$^3$) is the sea ice engine of the Nucleus for European Modelling of the Ocean (NEMO). It is intended to be a flexible tool for studying sea ice and its interactions with the other components of the Earth System over a wide range of space and time scales. SI$^3$ is a curvilinear grid, finite-difference implementation of the classical AIDJEX\footnote{AIDJEX=\textbf{A}rctic \textbf{I}ce \textbf{D}ynamics \textbf{J}oint \textbf{EX}periment} model \citep{coon_1974}, combining the conservation of momentum for viscous-plastic continuum, energy and salt-conserving halo-thermodynamics, an explicit representation of subgrid-scale ice thickness variations, snow and melt ponds. An option to switch back to the \textit{single-category} (or \textit{2-level}) framework of \cite{hibler_1979} provides a cheap sea ice modelling solution. 
    13  
    14 SI$^3$ is the result of the recommendation of the Sea Ice Working Group (SIWG) to reduce duplication and better use development resources. SI$^3$ merges the capabilities of the 3 formerly used NEMO sea ice models (CICE, GELATO and LIM). The \textbf{3} in SI$^3$ refers to the three formerly used sea ice models. It also refers to linkages between 3 different media (ocean, ice, snow). The model can be spelt 'SI3' in situations where the superscript could be problematic (i.e., within code and svn repository etc.) The model name would be pronounced as 'si-cube' for short (or 'sea ice cubed' for slightly longer).  
     12\SIcube\ is the result of the recommendation of the Sea Ice Working Group (SIWG) to 
     13reduce duplication and better use development resources. 
     14\SIcube\ merges the capabilities of the 3 formerly sea ice models used in \NEMO\ (CICE, GELATO and LIM). 
     15The \textbf{3} in \SIcube\ refers either to the three formerly used sea ice models and 
     16linkages between 3 different media (ocean-ice-snow). 
     17The model would be pronounced as ``SI cube'' for short (or ``Sea Ice cubed'' for slightly longer), 
     18otherwise it can be spelt ``SI three'' in situations where the superscript could be problematic. 
    1519 
    1620% Limitations & scope 
    17 %There are limitations to the applicability of models such as SI$^3$. The continuum approach is not invalid for grid cell size above at least 1 km, below which sea ice particles may include just a few floes, which is not sufficient \citep{lepparanta_2011}. Second, one must remember that our current knowledge of sea ice is not as complete as for the ocean: there are no fundamental equations such as Navier Stokes equations for sea ice. Besides, important features and processes span widely different scales, such as brine inclusions (1 $\mu$m-1 mm) \citep{perovich_1996}, horizontal thickness variations (1 m-100 km) \citep{percival_2008}, deformation and fracturing (10 m-1000 km) \citep{marsan_2004}. These impose complicated and often subjective subgrid-scale treatments. All in all, there is more empirism in sea ice models than in ocean models.  
     21%There are limitations to the applicability of models such as \SIcube. The continuum approach is not invalid for grid cell size above at least 1 km, below which sea ice particles may include just a few floes, which is not sufficient \citep{lepparanta_2011}. Second, one must remember that our current knowledge of sea ice is not as complete as for the ocean: there are no fundamental equations such as Navier Stokes equations for sea ice. Besides, important features and processes span widely different scales, such as brine inclusions (1 $\mu$m-1 mm) \citep{perovich_1996}, horizontal thickness variations (1 m-100 km) \citep{percival_2008}, deformation and fracturing (10 m-1000 km) \citep{marsan_2004}. These impose complicated and often subjective subgrid-scale treatments. All in all, there is more empiricism in sea ice models than in ocean models. 
    1822 
    1923In order to handle all the subsequent required subjective choices, we applied the following guidelines or principles: 
    2024\begin{itemize} 
    21 \item Sea ice is frozen seawater that is in tight interaction with the underlying ocean. This close connexion suggests that the sea ice and ocean model components must be as consistent as possible. In practice, this is materialized by the close match between LIM and NEMO, in terms of numerical choices, regarding the grid (Arakawa C-type) and the numerical discretization (finite differences with NEMO scale factors). 
     25\item Sea ice is frozen seawater that is in tight interaction with the underlying ocean. This close connexion suggests that the sea ice and ocean model components must be as consistent as possible. In practice, this is materialized by the close match between LIM and \NEMO, in terms of numerical choices, regarding the grid (Arakawa C-type) and the numerical discretization (finite differences with \NEMO\ scale factors). 
    2226\item It is useful to be able to either prescribe the atmospheric state or to use an atmospheric model. For consistency and simplicity of the code, we choose to use formulations as close as possible in both cases. 
    23 \item Different resolutions and time steps can be used. There are parameters that depend on such choices. We thrieved to achieve a resolution and time-step independent code, by imposing a priori scaling on the resolution / time step dependence of such parameters. 
     27\item Different resolutions and time steps can be used. There are parameters that depend on such choices. We thrived to achieve a resolution and time-step independent code, by imposing a priori scaling on the resolution / time step dependence of such parameters. 
    2428\item Energy, mass and salt must be conserved as much as possible. 
    2529\end{itemize} 
     
    3135There are no more CPP keys in the code. \\ 
    3236 
    33 Namelists and output management follow NEMO guidelines. \\ 
     37Namelists and output management follow \NEMO\ guidelines. \\ 
    3438 
    3539Changes between releases. \\ 
     
    5559\item David Schroeder (CPOM, Reading, UK) 
    5660\item Steffen Tietsche (ECMWF, Reading, UK) 
    57 \item Martin Vancoppenolle (LOCEAN, CNRS, Paris, France, co-chair)  
     61\item Martin Vancoppenolle (LOCEAN, CNRS, Paris, France, co-chair) 
    5862\end{footnotesize} 
    5963\end{itemize} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/TOP/main/definitions.tex

    r11263 r11512  
    22\def \engine{TOP} 
    33 
    4 %% Title (variable name already use by 'titling' pkg) 
    5 \def \heading{Tracers in Ocean Paradigm (TOP) \\ The NEMO passive tracers engine} 
     4%% Title and cover page settings 
     5\def \spacetop{  \vspace*{1.3cm} } 
     6\def \heading{Tracers in Ocean Paradigm (TOP) 
     7\def \subheading{The NEMO passive tracers engine} 
     8\def \spacedown{ \vspace*{1cm  } } 
     9\def \authorswidth{0.15\linewidth} 
     10\def \rulelenght{110pt} 
     11\def \abstractwidth{0.7\linewidth} 
    612 
    7 %% Authors (thanks will apply to the second author) 
    8 \def \firstauthor{} 
    9 \def \secondauthor{NEMO TOP Working Group} 
     13%% Color for document (frontpage banner, links and chapter boxes) 
     14\def \setcolor{ \definecolor{manualcolor}{cmyk}{1, 0, 1, 0.4} } 
    1015 
    1116%% IPSL publication number 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/TOP/main/foreword.tex

    r11263 r11512  
     1%% ================================================================ 
     2%% Abstract 
     3%% ================================================================ 
     4 
     5%% Common part between NEMO-SI3-TOP 
     6``Tracers in Ocean Paradigm'' (\TOP) is the passive tracers engine of 
     7the \NEMO\ ocean model (``Nucleus for European Modelling of the Ocean''). 
     8It is intended to be a flexible tool for studying the on/offline oceanic tracers transport and 
     9the biogeochemical processes (``green ocean''), 
     10as well as its interactions with the other components of the Earth climate system over 
     11a wide range of space and time scales. 
     12\TOP\ is interfaced with the \NEMO\ ocean engine, and, 
     13via the \href{http://portal.enes.org/oasis}{OASIS} coupler, 
     14with several atmospheric general circulation models. 
     15%It also supports two-way grid embedding by means of the \href{http://agrif.imag.fr}{AGRIF} software. 
     16 
     17%% Specific part 
     18This component provides the physical constraints and boundaries conditions for 
     19oceanic tracers transport and represents a generalized, hardwired interface toward 
     20biogeochemical models to enable a seamless coupling. 
     21In particular, transport dynamics are supplied by the ocean dynamical core thus 
     22enabling the use of all available advection and diffusion schemes in both on- and off-line modes. 
     23\TOP\ is designed to handle multiple oceanic tracers through a modular approach and 
     24it includes different sub-modules: ocean water age, inorganic carbon (CFCs) \& radiocarbon (C14b), 
     25built-in biogeochemical model (PISCES), and prototype for user-defined cases or 
     26coupling with alternative biogeochemical models (\eg \href{http://www.bfm-community.eu}{BFM}). 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/TOP/main/thanks.tex

    r11263 r11512  
    1 \'{E}th\'{e} Christian,  
    2 Lovato Tomas,  
    3 Aumont Olivier,  
    4 Palmi\'{e}ri Julien,  
    5 Mouchet Anne,  
    6 Nurser Georges,  
    7 Yool Andrew 
    8  
     1Olivier Aumont         \\ 
     2Christian \'{E}th\'{e} \\ 
     3Tomas Lovato           \\ 
     4Anne Mouchet           \\ 
     5Georges Nurser         \\ 
     6Julien Palmi\'{e}ri    \\ 
     7Andrew Yool 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/coding_rules.tex

    r11353 r11512  
    1 %\documentclass{article} 
    2  
    3 %\usepackage{fancyhdr} 
    4 %\usepackage{times} 
    5 %\usepackage{graphicx} 
    6 %\usepackage{hyperref} 
    7 %\usepackage{minted} 
    8 %\usepackage[normalem]{ulem}   % striketrough style with \sout{...} 
    9  
    10 %\hypersetup{pdftitle={NEMO coding conventions}, pdfauthor={NEMO System Team}, colorlinks} 
    11 %\setminted{style=emacs, breaklines, frame=leftline} 
    12 %\newmintinline[forcode]{fortran}{fontsize=auto, frame=lines}   % \forcode{...} 
    13 %\newminted[forlines]{fortran}{}                                % \begin{forlines} 
    14  
    15 %\pagestyle{empty} 
    16 %\setlength{\leftmargin}{1 cm} 
    17 %\setlength{\rightmargin}{1 cm} 
    18 %\setlength{\oddsidemargin}{0 cm} 
    19 %\setlength{\evensidemargin}{0 cm} 
    20 %\setlength{\topmargin}{-1cm} 
    21 %\setlength{\textwidth}{16 cm} 
    22 %\setlength{\textheight}{25cm} 
    23 %\pagestyle{fancy} 
    24  
    25 %\title{ 
    26 %  \includegraphics[width=0.3\textwidth]{../../../figures/NEMO_grey} \\ 
    27 %  \vspace{1.0cm} \rule{345pt}{1.5pt} \\ 
    28 %  \vspace{0.45cm} {\Huge NEMO coding conventions} \rule{345pt}{1.5pt} \\ 
    29 %} 
    30 %\title{NEMO coding conventions} 
    31 %\author{\Large NEMO System Team 
    32 %  \thanks{ 
    33 %    To be completed 
    34 %  } 
    35 %} 
    36 %\date{version X.X -- month year} 
    37  
    38 %\begin{document} 
    39  
    40 %\maketitle 
    41  
    42 %\newpage 
    43  
    44 %\tableofcontents 
    45  
    46 %\newpage 
    47  
    48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     1 
    492\chapter{Coding Rules} 
    503\label{apdx:coding} 
     
    6013produces fewer bugs and is easier to maintain. 
    6114Therefore, it is essential that the model development follows some rules: 
    62  
    63 - well planned and designed 
    64  
    65 - well written 
    66  
    67 - well documented (both on- and off-line) 
    68  
    69 - maintainable 
    70  
    71 - easily portable 
    72  
    73 - flexible. 
     15\begin{itemize} 
     16   \item well planned and designed 
     17   \item well written 
     18   \item well documented (both on- and off-line) 
     19   \item maintainable 
     20   \item easily portable 
     21   \item flexible. 
     22\end{itemize} 
    7423 
    7524To satisfy part of these aims, \NEMO is written with a coding standard which is close to the ECMWF rules, 
    7625named DOCTOR \citep{gibson_rpt86}.  
    7726These rules present some advantages like: 
    78  
    79 - to provide a well presented program 
    80  
    81 - to use rules for variable names which allow recognition of their type 
    82 (integer, real, parameter, local or shared variables, etc. ).  
     27\begin{itemize} 
     28   \item to provide a well presented program 
     29   \item to use rules for variable names which allow recognition of their type 
     30   (integer, real, parameter, local or shared variables, etc. ).  
     31\end{itemize} 
    8332 
    8433This facilitates both the understanding and the debugging of an algorithm. 
     
    8635\section{Introduction} 
    8736 
    88 This document describes conventions\index{conventions} used in NEMO coding and suggested for its development. 
    89 The objectives are to offer a guide to all readers of the NEMO code, and to facilitate the work of 
     37This document describes conventions used in \NEMO coding and suggested for its development. 
     38The objectives are to offer a guide to all readers of the \NEMO code, and to facilitate the work of 
    9039all the developers, including the validation of their developments, and 
    91 eventually the implementation of these developments within the NEMO platform. 
     40eventually the implementation of these developments within the \NEMO platform. 
    9241 
    9342A first approach of these rules can be found in the code in \path{./src/OCE/module_example} where 
     
    9847\footnote {\href{http://www.cesm.ucar.edu/working_groups/Software/dev_guide/dev_guide/node7.html}{UCAR conventions}},  
    9948the previous version of this document (``FORTRAN coding standard in the OPA System'') and 
    100 the expertise of the NEMO System Team. 
     49the expertise of the \NEMO System Team. 
    10150After a general overview below, this document will describe: 
    10251 
    10352\begin{itemize} 
    104 \item 
    105   The style rules, $i.e.$ the syntax, appearance and naming conventions chosen to improve readability of the code; 
    106 \item 
    107   The content rules, $i.e.$ the conventions to improve the reliability of the different parts of the code; 
    108 \item 
    109   The package rules to go a step further by improving the reliability of the whole and 
    110   interfaces between routines and modules. 
     53   \item The style rules, $i.e.$ the syntax, appearance and naming conventions chosen to improve readability of the code; 
     54   \item The content rules, $i.e.$ the conventions to improve the reliability of the different parts of the code; 
     55   \item The package rules to go a step further by improving the reliability of the whole and 
     56   interfaces between routines and modules. 
    11157\end{itemize} 
    11258 
    113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    11459\section{Overview and general conventions} 
    11560 
    116 NEMO has 3 major components: ocean dynamics (\path{./src/OCE}), sea-ice (\path{./src/ICE}) and 
     61\NEMO has 3 major components: ocean dynamics (\path{./src/OCE}), sea-ice (\path{./src/ICE}) and 
    11762marine biogeochemistry (\path{./src/MBG}). 
    11863%, linear-tangent and adjoint of the dynamics ($TAM$) each of them corresponding to a directory. 
     
    12671See \path{.src/OCE/DOM/phycst.F90} files for conversions. 
    12772 
    128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    12973\section{Architecture} 
    13074 
    131 Within each directory, organisation of files is driven by orthogonality\index{orthogonality}, 
     75Within each directory, organisation of files is driven by orthogonality, 
    13276$i.e.$ one functionality of the code is intended to be in one and only one directory, and 
    13377one module and all its related routines are in one file. 
    134 The functional modules\index{module} are: 
     78The functional modules are: 
    13579 
    13680\begin{itemize} 
    137 \item \path{SBC}             surface module 
    138 \item \path{IOM}             management of the I/O 
    139 \item \path{NST}             interface to AGRIF (nesting model) for dynamics and biogeochemistry 
    140 \item \path{OBC}, \path{BDY} management of structured and unstructured open boundaries  
    141 \item \path{C1D}             1D (vertical) configuration for dynamics, sea-ice and biogeochemistry 
    142 \item \path{OFF}             off-line module: passive tracer or biogeochemistry alone 
    143 \item \path{...} 
     81   \item \path{SBC}             surface module 
     82   \item \path{IOM}             management of the I/O 
     83   \item \path{NST}             interface to AGRIF (nesting model) for dynamics and biogeochemistry 
     84   \item \path{OBC}, \path{BDY} management of structured and unstructured open boundaries  
     85   \item \path{C1D}             1D (vertical) configuration for dynamics, sea-ice and biogeochemistry 
     86   \item \path{OFF}             off-line module: passive tracer or biogeochemistry alone 
     87   \item \path{...} 
    14488\end{itemize} 
    14589 
     
    14791this module (\texttt{dom\_init, dom\_nam, dom\_ctl}). 
    14892 
    149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    15093\section{Style rules} 
    15194 
    152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    15395\subsection{Argument list format} 
    15496 
    155 Routine argument lists will contain a maximum 5 variables\index{variable} per line, 
     97Routine argument lists will contain a maximum 5 variables per line, 
    15698whilst continuation lines can be used. 
    15799This applies both to the calling routine and the dummy argument list in the routine being called. 
     
    164106\end{forlines} 
    165107 
    166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    167108\subsection{Array syntax} 
    168109 
     
    198139\end{forlines} 
    199140 
    200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    201141\subsection{Case} 
    202142 
    203143All FORTRAN keywords are in capital: \forcode{DIMENSION}, \forcode{WRITE}, \forcode{DO}, \forcode{END DO}, 
    204 \forcode{NAMELIST}, ... All other parts of the NEMO code will be written in lower case. 
    205  
    206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     144\forcode{NAMELIST}, ... All other parts of the \NEMO code will be written in lower case. 
     145 
    207146\subsection{Comments} 
    208147 
     
    248187\end{enumerate} 
    249188 
    250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    251189\subsection{Continuation lines} 
    252190 
     
    265203use a ``\&'' as first character of the continuing lines to maintain the alignment. 
    266204 
    267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    268205\subsection{Declaration of arguments and local variables} 
    269206 
     
    277214\end{forlines} 
    278215 
    279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    280216\subsection{F90 Standard} 
    281217 
    282 NEMO software adheres to the FORTRAN 95 language standard and does not rely on any specific language or 
     218\NEMO software adheres to the \fninety language standard and does not rely on any specific language or 
    283219vendor extensions. 
    284220 
    285  
    286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    287221\subsection{Free-Form Source} 
    288222 
     
    292226Multi-line comments that extend to column 100 are unacceptable. 
    293227 
    294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    295228\subsection{Indentation} 
    296229 
     
    310243\end{forlines} 
    311244 
    312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    313245\subsection{Loops} 
    314246 
     
    317249In the case of a long loop, a self-descriptive label can be used ($i.e.$ not just a number). 
    318250 
    319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    320251\subsection{Naming Conventions: files} 
    321252 
     
    331262} 
    332263 
    333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    334264\subsection{Naming Conventions: modules} 
    335265 
     
    338268For example, zdftke, where ``zdf'' stands for vertical diffusion, and ``tke'' for turbulent kinetic energy. \\ 
    339269Note that by implication multiple modules are not allowed in a single file. 
    340 The use of common blocks is deprecated in Fortran 90 and their use in NEMO is strongly discouraged. 
     270The use of common blocks is deprecated in \fortran 90 and their use in \NEMO is strongly discouraged. 
    341271Modules are a better way to declare static data. 
    342272Among the advantages of modules is the ability to freely mix data of various types, and 
    343273to limit access to contained variables through the use of the \forcode{ONLY} and \forcode{PRIVATE} attributes. 
    344274 
    345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    346275\subsection{Naming Conventions: variables} 
    347276 
    348277All variable should be named as explicitly as possible in English. 
    349278The naming convention concerns prefix letters of these name, in order to identify the variable type and status. \\ 
    350 Never use a FORTRAN keyword as a routine or variable name. \\ 
     279Never use a \fortran keyword as a routine or variable name. \\ 
    351280The table below lists the starting letter(s) to be used for variable naming, depending on their type and status: 
    352281%--------------------------------------------------TABLE-------------------------------------------------- 
     
    355284    \begin{tabular}{|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|p{50pt}|} 
    356285      \hline 
    357       Type \par / Status &   integer&   real&   logical &   character&   double \par precision&   complex \\ 
    358       \hline 
    359       public  \par or  \par module variable& \textbf{m n} \par \textit{but not } \par \textbf{nn\_}& \textbf{a b e f g h o} \textbf{q} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_}& \textbf{l} \par \textit{but not} \par \textbf{lp ld ll ln\_}& \textbf{c} \par \textit{but not} \par \textbf{cp cd cl cn\_}& \textbf{d} \par \textit{but not} \par \textbf{dp dd dl dn\_}& \textbf{y} \par \textit{but not} \par \textbf{yp yd yl} \\ 
    360       \hline 
    361       dummy \par argument& \textbf{k} \par \textit{but not} \par \textbf{kf}& \textbf{p} \par \textit{but not}  \par \textbf{pp pf}& \textbf{ld}& \textbf{cd}& \textbf{dd}& \textbf{yd} \\ 
    362       \hline 
    363       local \par variable& \textbf{i}& \textbf{z}& \textbf{ll}& \textbf{cl}& \textbf{cd}& \textbf{yl} \\ 
    364       \hline 
    365       loop \par control& \textbf{j} \par \textit{but not } \par \textbf{jp}& & & & &  \\ 
    366       \hline 
    367       parameter& \textbf{jp}& \textbf{pp}& \textbf{lp}& \textbf{cp}& \textbf{dp}& \textbf{yp} \\ 
    368       \hline 
    369       namelist& \textbf{nn\_}& \textbf{rn\_}& \textbf{ln\_}& \textbf{cn\_}& \textbf{dn\_}& \\ 
    370       \hline 
    371       CPP \par macro& \textbf{kf}& \textbf{sf} \par & & & & \\ 
     286      Type \par / Status                                                                          & 
     287      integer                                                                                     & 
     288      real                                                                                        & 
     289      logical                                                                                     & 
     290      character                                                                                   & 
     291      double \par precision                                                                       & 
     292      complex                                                                                     \\ 
     293      \hline 
     294      public \par or \par module variable                                                         &  
     295      \textbf{m n} \par \textit{but not} \par \textbf{nn\_}                                       &  
     296      \textbf{a b e f g h o} \textbf{q} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_} & 
     297      \textbf{l} \par \textit{but not} \par \textbf{lp ld ll ln\_}                                & 
     298      \textbf{c} \par \textit{but not} \par \textbf{cp cd cl cn\_}                                & 
     299      \textbf{d} \par \textit{but not} \par \textbf{dp dd dl dn\_}                                & 
     300      \textbf{y} \par \textit{but not} \par \textbf{yp yd yl}                                     \\ 
     301      \hline 
     302      dummy \par argument                                                                         & 
     303      \textbf{k} \par \textit{but not} \par \textbf{kf}                                           &  
     304      \textbf{p} \par \textit{but not} \par \textbf{pp pf}                                        &  
     305      \textbf{ld}                                                                                 & 
     306      \textbf{cd}                                                                                 & 
     307      \textbf{dd}                                                                                 & 
     308      \textbf{yd}                                                                                 \\ 
     309      \hline 
     310      local \par variable                                                                         & 
     311      \textbf{i}                                                                                  &  
     312      \textbf{z}                                                                                  & 
     313      \textbf{ll}                                                                                 & 
     314      \textbf{cl}                                                                                 & 
     315      \textbf{cd}                                                                                 & 
     316      \textbf{yl}                                                                                 \\ 
     317      \hline 
     318      loop \par control                                                                           & 
     319      \textbf{j} \par \textit{but not} \par \textbf{jp}                                           & 
     320                                                                                                  & 
     321                                                                                                  & 
     322                                                                                                  & 
     323                                                                                                  & 
     324                                                                                                  \\ 
     325      \hline 
     326      parameter                                                                                   & 
     327      \textbf{jp}                                                                                 & 
     328      \textbf{pp}                                                                                 & 
     329      \textbf{lp}                                                                                 & 
     330      \textbf{cp}                                                                                 & 
     331      \textbf{dp}                                                                                 & 
     332      \textbf{yp}                                                                                 \\ 
     333      \hline 
     334      namelist                                                                                    & 
     335      \textbf{nn\_}                                                                               &  
     336      \textbf{rn\_}                                                                               & 
     337      \textbf{ln\_}                                                                               & 
     338      \textbf{cn\_}                                                                               & 
     339      \textbf{dn\_}                                                                               & 
     340                                                                                                  \\ 
     341      \hline 
     342      CPP \par macro                                                                              & 
     343      \textbf{kf}                                                                                 & 
     344      \textbf{sf}                                                                                 & 
     345                                                                                                  & 
     346                                                                                                  & 
     347                                                                                                  & 
     348                                                                                                  \\ 
    372349      \hline 
    373350    \end{tabular} 
     
    377354%-------------------------------------------------------------------------------------------------------------- 
    378355 
    379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    380356\subsection{Operators} 
    381357 
     
    385361In general use the notation: \\ 
    386362$<Blank><Operator><Blank>$ 
    387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     363 
    388364\subsection{Pre processor} 
    389365 
     
    412388Is to be used rather than the \#ifdef abbreviate form since it may have conflicts with some Unix scripts. 
    413389 
    414 Tests on cpp keys included in NEMO at compilation step: 
     390Tests on cpp keys included in \NEMO at compilation step: 
    415391 
    416392\begin{itemize} 
     
    421397  If a change occurs in the CPP keys used for a given experiment, the whole compilation phase is done again. 
    422398\end{itemize} 
    423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     399 
    424400\section{Content rules} 
    425401 
    426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    427402\subsection{Configurations} 
    428403 
    429 The configuration defines the domain and the grid on which NEMO is running. 
    430 It may be useful to associate a cpp key and some variables to a given configuration, although 
     404The configuration defines the domain and the grid on which \NEMO is running. 
     405It may be useful to associate a CPP key and some variables to a given configuration, although 
    431406the part of the code changed under each of those keys should be minimized. 
    432407As an example, the "ORCA2" configuration (global ocean, 2 degrees grid size) is associated with 
     
    438413\end{forlines} 
    439414 
    440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    441415\subsection{Constants} 
    442416 
    443 Physical constants ($e.g.$ $\pi$, gas constants) must never be hardwired into the executable portion of a code. 
     417Physical constants ($e.g.$ $\pi$, gas constants) must never be hard-wired into the executable portion of a code. 
    444418Instead, a mnemonically named variable or parameter should be set to the appropriate value, 
    445 in the setup routine for the package\index{package}. 
     419in the setup routine for the package. 
    446420We realize than many parameterizations rely on empirically derived constants or fudge factors, 
    447421which are not easy to name. 
     
    450424Hard-coded numbers should never be passed through argument lists. 
    451425 
    452 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    453426\subsection{Declaration for variables and constants} 
    454427 
     
    512485improve control of variables in routine calls. 
    513486 
    514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    515487\subsection{Headers} 
    516488 
    517 Prologues are not used in NEMO for now, although it may become an interesting tool in combination with 
     489Prologues are not used in \NEMO for now, although it may become an interesting tool in combination with 
    518490ProTeX auto documentation script in the future. 
    519491Rules to code the headers and layout of a module or a routine are illustrated in the example module available with 
    520492the code: \path{./src/OCE/module_example} 
    521493 
    522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    523494\subsection{Interface blocks} 
    524495 
     
    528499FORTRAN 95 compilers can automatically provide explicit interface blocks for routines contained in a module. 
    529500 
    530 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    531501\subsection{I/O Error Conditions} 
    532502 
     
    536506a negative value means the end of record or end of file was encountered. 
    537507 
    538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    539508\subsection{PRINT - ASCII output files} 
    540509 
     
    551520\end{forlines} 
    552521 
    553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    554522\subsection{Precision} 
    555523 
     
    570538\end{forlines} 
    571539 
    572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    573540\subsection{Structures} 
    574541 
    575 The \forcode{TYPE} structure allowing to declare some variables is more often used in NEMO, 
     542The \forcode{TYPE} structure allowing to declare some variables is more often used in \NEMO, 
    576543especially in the modules dealing with reading fields, or interfaces. 
    577544For example: 
     
    592559Missing rule on structure name?? 
    593560 
    594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    595561\section{Packages coding rules} 
    596562 
    597 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    598563\subsection{Bounds checking} 
    599564 
    600 NEMO is able to run when an array bounds checking option is enabled 
     565\NEMO is able to run when an array bounds checking option is enabled 
    601566(provided the cpp key \texttt{key\_vectopt\_loop} is not defined). \\ 
    602567Thus, constructs of the following form are disallowed: 
     
    610575it effectively disables array bounds checking. 
    611576 
    612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    613577\subsection{Communication} 
    614578 
     
    624588} 
    625589 
    626 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    627590\subsection{Error conditions} 
    628591 
     
    634597see \textit{stpctl.F90}. 
    635598 
    636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    637599\subsection{Memory management} 
    638600 
    639601The main action is to identify and declare which arrays are \forcode{PUBLIC} and which are \forcode{PRIVATE}. \\ 
    640 As of version 3.3.1 of NEMO, the use of static arrays (size fixed at compile time) has been deprecated. 
     602As of version 3.3.1 of \NEMO, the use of static arrays (size fixed at compile time) has been deprecated. 
    641603All module arrays are now declared \forcode{ALLOCATABLE} and 
    642604allocated in either the \texttt{<module\_name>\_alloc()} or \texttt{<module\_name>\_init()} routines. 
     
    644606the \texttt{stat=<integer\ variable>} optional argument. \\ 
    645607 
    646 In addition to arrays contained within modules, many routines in NEMO require local, ``workspace'' arrays to 
     608In addition to arrays contained within modules, many routines in \NEMO require local, ``workspace'' arrays to 
    647609hold the intermediate results of calculations. 
    648 In previous versions of NEMO, these arrays were declared in such a way as to be automatically allocated on 
     610In previous versions of \NEMO, these arrays were declared in such a way as to be automatically allocated on 
    649611the stack when the routine was called. 
    650612An example of an automatic array is: 
     
    735697It is then associated with a sub-array of \texttt{wrk\_3d\_5} once the call to 
    736698\texttt{wrk\_in\_use()} has completed successfully. 
    737 Note that in F95 (to which NEMO conforms) it is not possible for either the upper or lower array bounds of 
     699Note that in F95 (to which \NEMO conforms) it is not possible for either the upper or lower array bounds of 
    738700the pointer object to differ from those of the target array. \\ 
    739701 
     
    748710This should enable the developer to choose alternatives for use in the subroutine being worked on. \\ 
    749711 
    750 When compiling NEMO for production runs, 
     712When compiling \NEMO for production runs, 
    751713the calls to {\texttt{wrk\_in\_use()} / \texttt{wrk\_not\_released()} can be reduced to stubs that just 
    752714return \forcode{.false.} by setting the cpp key \texttt{key\_no\_workspace\_check}. 
    753 These stubs may then be inlined (and thus effectively removed altogether) by setting appropriate compiler flags 
     715These stubs may then be in-lined (and thus effectively removed altogether) by setting appropriate compiler flags 
    754716($e.g.$ ``-finline'' for the Intel compiler or ``-Q'' for the IBM compiler). 
    755717 
    756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    757718\subsection{Optimisation} 
    758719 
    759720Considering the new computer architecture, optimisation cannot be considered independently from the computer type. 
    760 In NEMO, portability is a priority, before any too specific optimisation. 
     721In \NEMO, portability is a priority, before any too specific optimisation. 
    761722 
    762723Some tools are available to help: for vector computers, \texttt{key\_vectopt\_loop} allows to unroll a loop 
    763724 
    764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    765725\subsection{Package attribute: \forcode{PRIVATE}, \forcode{PUBLIC}, \forcode{USE}, \forcode{ONLY}} 
    766726 
     
    770730defined in a module are to be made available to the using routine. 
    771731 
    772 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    773 \subsection {Parallelism using MPI} 
    774  
    775 NEMO is written in order to be able to run on one processor, or on one or more using MPI 
     732\subsection{Parallelism using MPI} 
     733 
     734\NEMO is written in order to be able to run on one processor, or on one or more using MPI 
    776735($i.e.$ activating the cpp key $key\_mpp\_mpi$). 
    777 The domain decomposition divides the global domain in cubes (see NEMO reference manual). 
     736The domain decomposition divides the global domain in cubes (see \NEMO reference manual). 
    778737Whilst coding a new development, the MPI compatibility has to be taken in account 
    779738(see \path{./src/LBC/lib_mpp.F90}) and should be tested. 
    780739By default, the $x$-$z$ part of the decomposition is chosen to be as square as possible. 
    781 However, this may be overriden by specifying the number of subdomains in latitude and longitude in 
     740However, this may be overriden by specifying the number of sub-domains in latitude and longitude in 
    782741the \texttt{nammpp} section of the namelist file. 
    783742 
    784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    785743\section{Features to be avoided} 
    786744 
     
    804762  \forcode{SELECT CASE} construct instead) 
    805763\item 
    806   Labeled \forcode{DO} construct 
    807   (use unlabeled \forcode{END DO} instead) 
     764  Labelled \forcode{DO} construct 
     765  (use unlabelled \forcode{END DO} instead) 
    808766\item 
    809767  \forcode{FORMAT} statement 
     
    817775  \forcode{PAUSE} 
    818776\item 
    819   \forcode{ENTRY} statement: a subprogram must only have one entry point. 
     777  \forcode{ENTRY} statement: a sub-program must only have one entry point. 
    820778\item 
    821779  \forcode{RETURN} is obsolete and so not necessary at the end of program units 
     
    837795\end{itemize} 
    838796 
    839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    840  
    841 % \printindex 
    842 % \input NEMO_coding.conv.ind 
    843  
    844 %\end{document} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/document.tex

    r11353 r11512  
    55 
    66%% NEMO release version 
    7 \def \version{4.0rc~} 
     7\def \version{trunk} 
    88 
    99%% Preamble 
     
    1111 
    1212%% Document layout 
    13 \documentclass[draft]{scrreprt} 
     13\documentclass[twoside = semi, abstract = on]{scrreprt} 
    1414 
    15 %% Load the configuration of the manual 
    16 \input{../main/definitions} 
    17  
    18 %% Load global *.tex files 
     15%% Load configurations 
    1916\input{../../global/preamble} 
    2017 
    2118\dominitoc 
    22  
    23 %% Launch the creation of the indexes 
    24 \input{../../global/indexes} 
    25  
    2619 
    2720%% End of common preamble between main and sub-files 
     
    4235%% ============================================================================== 
    4336 
     37%% Disable page numbering temporarily 
    4438\pagenumbering{gobble} 
    4539 
    4640%% Title page 
    47 \input{../../global/frontpage} 
     41%\input{../../global/frontpage} 
     42\input{../../global/frontpage_new} 
    4843 
    49 \maketitle 
    50 \emptythanks 
     44%\maketitle 
     45%\emptythanks 
    5146 
    5247%% Information page (2nd page) 
    5348\input{../../global/info_page} 
    5449 
     50%% Headings for introductory parts (no header, simple footer) 
     51\ofoot{\engine\ Reference Manual}\ifoot{\pagemark} 
     52\pagenumbering{roman} 
     53 
    5554%% Foreword 
    56 %\frontmatter   %% Chapter numbering off and Roman numerals for page numbers 
    57 \pagenumbering{roman} 
    58 \input{foreword} 
     55%\input{foreword} 
    5956 
    6057%% Table of Contents 
    6158\tableofcontents 
    62 \listoffigures 
    63 \listoftables 
    64 \listoflistings 
     59%\listoffigures 
     60%\listoftables 
     61%\listoflistings 
    6562 
    6663\clearpage 
    67 %\end{document} 
    6864 
    6965 
     
    7167%% ============================================================================== 
    7268 
    73 %\mainmatter   %% Chapter numbering on, page numbering is reset with Arabic numerals 
     69%% Headings for document body 
     70\lohead{Chap.\ \thechapter\ \leftmark}\rehead{Sect.\ \thesection\ \rightmark} 
     71\ifoot{Page\ \pagemark\ of \pageref*{LastPage}} 
    7472\pagenumbering{arabic} 
    7573 
     
    8179 
    8280%% Chapter numbering is reset with letters now 
    83 \appendix    
     81\appendix 
    8482 
    8583\include{appendices} 
     
    110108 
    111109\end{document} 
    112  
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/frontpage.tex

    r11176 r11512  
    11 
    22\title{\heading} 
    3 \author{\firstauthor \and \secondauthor\thanks{\protect\input{thanks}}} 
    43\date{\today} 
     4\author{\protect\input{thanks}} 
    55 
    66\pretitle{ 
    77  \begin{center} 
    8 \begin{figure}[H] 
    9   \begin{minipage}[c]{0.35\textwidth} 
    10     \href{http://www.nemo-ocean.eu}{\includegraphics[width=0.7\textwidth]{logos/NEMO_grey}} 
    11   \end{minipage} 
    12   \hfill 
    13   \begin{minipage}[c]{0.65\textwidth} 
    14     \centering 
    15     \large{\em{{N}ucleus for {E}uropean {M}odelling of the {O}cean}} 
    16   \end{minipage} 
    17 \end{figure} 
    18 \vfill 
     8    \begin{figure}[H] 
     9      \begin{minipage}[c]{0.35\textwidth} 
     10        \href{http://www.nemo-ocean.eu}{\includegraphics[width=0.7\textwidth]{logos/NEMO_grey}} 
     11      \end{minipage} 
     12      \hfill 
     13      \begin{minipage}[c]{0.65\textwidth} 
     14        \centering 
     15        \large{\em{{N}ucleus for {E}uropean {M}odelling of the {O}cean}} 
     16      \end{minipage} 
     17    \end{figure} 
     18    \vfill 
    1919    \Huge 
    2020} 
    21 \posttitle{\par\end{center}\vskip 0.5em} 
    22 \preauthor{\begin{center}\Large\lineskip0.5em\begin{tabular}[t]{c}} 
    23 \postauthor{\end{tabular}\par\end{center}} 
     21\posttitle{ 
     22  \par 
     23  \end{center} 
     24  \vskip 0.5em 
     25} 
    2426\predate{ 
    2527  \vfill 
     
    4648} 
    4749 
     50\preauthor{ 
     51  \begin{center} 
     52    \Large 
     53    \lineskip 0.5em 
     54    \begin{tabular}[t]{c c c} 
     55} 
     56\postauthor{ 
     57    \end{tabular} 
     58    \par 
     59  \end{center} 
     60} 
     61 
    4862\thanksmarkseries{fnsymbol} 
    49  
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/indexes.tex

    r11212 r11512  
    88\newcommand{\key}[1]{\index[keys]{#1}        \texttt{\textbf{key\_#1}}} 
    99\newcommand{\mdl}[1]{\index[modules]{#1}     \textit{#1.F90}          } 
    10 \newcommand{\ngn}[1]{\index[blocks]{#1}      \texttt{#1}              } 
     10\newcommand{\nam}[1]{\index[blocks]{#1}      \texttt{nam#1}           } 
    1111\newcommand{\np}[1]{ \index[parameters]{#1}  \texttt{#1}              } 
    1212\newcommand{\rou}[1]{\index[subroutines]{#1} \texttt{#1}              } 
     
    1414\indexsetup{toclevel=section, othercode=\small} 
    1515 
    16 \makeindex[intoc=true, name=keys       , title=CPP keys                      ] 
    17 \makeindex[intoc=true, name=modules    , title=Modules                       ] 
    18 \makeindex[intoc=true, name=blocks     , title=Namelist blocks               ] 
    19 \makeindex[intoc=true, name=parameters , title=Namelist parameters, columns=3] 
    20 \makeindex[intoc=true, name=subroutines, title=Subroutines                   ] 
    21  
    22  
    23 %% Load hyperref at the end of the preamble to make it work with other pkgs 
    24 \usepackage{hyperref}                    %% hyper 
    25 \hypersetup{ 
    26 %  pdftitle={\heading}, 
    27 %  pdfauthor={\firstauthor and \secondauthor}, 
    28   colorlinks, 
    29   citecolor=olive, 
    30   linkcolor=blue, 
    31   urlcolor=gray 
    32 } 
     16\makeindex[intoc=true, name=keys       , title=CPP keys            ({\em key\_     } prefix)           ] 
     17\makeindex[intoc=true, name=modules    , title=\fortran modules                                        ] 
     18\makeindex[intoc=true, name=blocks     , title=Namelist blocks     ({\em nam       } prefix), columns=3] 
     19\makeindex[intoc=true, name=parameters , title=Namelist parameters ({\em [cdlnr]n\_}       ), columns=3] 
     20\makeindex[intoc=true, name=subroutines, title=Subroutines                                             ] 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/info_page.tex

    r11176 r11512  
    88 
    99Like all components of the modelling framework, 
    10 the \engine~core engine is developed under the \href{http://www.cecill.info}{CECILL license}, 
    11 which is a French adaptation of the GNU GPL (General Public License). 
     10the \engine\ core engine is developed under the \href{http://www.cecill.info}{CECILL license}, 
     11which is a French adaptation of the GNU GPL (\textbf{G}eneral \textbf{P}ublic \textbf{L}icense). 
    1212Anyone may use it freely for research purposes, and is encouraged to 
    13 communicate back to the NEMO team its own developments and improvements. 
     13communicate back to the \NEMO\ team its own developments and improvements. 
    1414 
    1515The model and the present document have been made available as a service to the community. 
     
    2727Additional information can be found on: 
    2828\begin{itemize} 
    29 \item the \href{http://www.nemo-ocean.eu}{website} of the project detailing several 
     29\item \faWordpress\ the \href{http://www.nemo-ocean.eu}{website} of the project detailing several 
    3030  associated applications and an exhaustive users bibliography 
    31 \item the \href{http://forge.ipsl.jussieu.fr/nemo}{development platform} of the model with 
    32   the code repository and some main resources (wiki, ticket system, forums, \ldots) 
    33 \item the \href{http://zenodo.org/communities/nemo-ocean}{online archive} 
    34   delivering the publications issued by the consortium 
    35 \item two mailing lists: 
     31\item \faCodeFork\ the \href{http://forge.ipsl.jussieu.fr/nemo}{development platform} of 
     32  the model with the code repository for the shared reference and some main resources 
     33  (wiki, ticket system, forums, \ldots) \\ 
     34  \faGithub\ the \href{http://github.com/NEMO-ocean/NEMO-examples} 
     35  {repository of the demonstration cases} for research or training 
     36\item \faCloudDownload\ the \href{http://zenodo.org/communities/nemo-ocean}{online archive} 
     37  delivering the publications issued by the consortium (manuals, reports, datasets, \ldots) 
     38\item \faEnvelope\ two mailing lists: 
    3639  the \href{http://listes.ipsl.fr/sympa/info/nemo-newsletter}{newsletter} for 
    3740  top-down communications from the project 
     
    4851Reference for papers and other publications is as follows: 
    4952 
    50 \vspace{0.5cm} 
    51  
    52 %% \sloppy: workaround for breaking DOI URL 
    53 \sloppy 
    54 ``{\bfseries \heading}'',  
    55 \firstauthor and \secondauthor,  
    56 {\em Scientific Notes of Climate Modelling Center}, \textbf{\ipslnum} --- ISSN 1288-1619,  
    57 Institut Pierre-Simon Laplace (IPSL),  
     53``{\bfseries \heading}'', 
     54%\firstauthor and \secondauthor, 
     55{\em Scientific Notes of Climate Modelling Center}, \textbf{\ipslnum} --- ISSN 1288-1619, 
     56Institut Pierre-Simon Laplace (IPSL), 
    5857\href{https://doi.org/10.5281/zenodo.\zid}{doi:10.5281/zenodo.\zid} 
    5958 
    6059\begin{figure}[b] 
    61   \begin{minipage}[c]{0.72\textwidth} 
    62     \small\ttfamily{Scientific Notes of Climate Modelling Center \\ 
    63       ISSN 1288-1619                                             \\ 
     60  \begin{minipage}[c]{0.7\textwidth} 
     61    \small 
     62    \ttfamily{ 
     63      Scientific Notes of Climate Modelling Center \\ 
     64      ISSN 1288-1619                               \\ 
    6465      Institut Pierre-Simon Laplace (IPSL) 
    6566    } 
     
    7172\end{figure} 
    7273 
     74\end{document} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/latexmkrc

    r11212 r11512  
    1010## Custom cmds 
    1111$makeindex = 'makeindex -s %R.ist %O -o %D %S'; 
    12 $pdflatex  = 'pdflatex -shell-escape %O %S'; 
     12#$pdflatex  = 'pdflatex -shell-escape %O %S'; 
     13$pdflatex  = 'xelatex -shell-escape %O %S'; 
    1314 
    1415#@BIBINPUTS=('.', '../main'); 
    1516#$bibtex    = 'bibtex %O ../main/bibliography.bib'; 
    1617#$kpsewhich = 'kpsewhich bibliography.bib' 
    17  
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/new_cmds.tex

    r11212 r11512  
    22%% ============================================================================== 
    33 
    4 %% Include references and index for compilation of single subfile  
     4%% Include references and index for compilation of single subfile 
    55\newcommand{\mtoc}{\minitoc} 
    6 \newcommand{\biblio}{\bibliography{../main/bibliography}} 
     6\newcommand{\biblio}{ \bibliography{../main/bibliography} } 
    77\newcommand{\pindex}{\printindex} 
    88 
    99%% NEMO and Fortran in small capitals 
    10 \newcommand{\NEMO}{\textsc{nemo}~} 
    11 \newcommand{\fortran}{\textsc{Fortran}~} 
    12 \newcommand{\fninety}{\textsc{Fortran 90}~} 
     10\newcommand{\NEMO   }{\textsc{nemo}} 
     11\newcommand{\SIcube }{\textsc{si$^3$}} 
     12\newcommand{\TOP    }{\textsc{top}} 
     13\newcommand{\fortran}{\textsc{Fortran}} 
     14\newcommand{\fninety}{\textsc{Fortran 90}} 
    1315 
    1416%% Common aliases 
     
    1820\newcommand{\ztilde}{\ensuremath{\tilde z}} 
    1921\newcommand{\stilde}{\ensuremath{\tilde s}} 
    20 \newcommand{\ie}{\ensuremath{i.e.}~} 
    21 \newcommand{\eg}{\ensuremath{e.g.}~} 
     22\newcommand{\ie}{\ensuremath{i.e.}} 
     23\newcommand{\eg}{\ensuremath{e.g.}} 
    2224 
    2325%% Inline maths 
     
    2527\newcommand{\rdt}{\Delta t} 
    2628 
    27 %% Text env. for Gurvan 
     29%% Gurvan's comments 
    2830\newcommand{\gmcomment}[1]{} 
    2931 
     
    3133\newcommand{\lt}{\left} 
    3234\newcommand{\rt}{\right} 
    33 \newcommand{\vect}[1]{\ensuremath{\mathbf{#1}}} 
     35\newcommand{\vect}[1]{\ensuremath{ \mathbf{#1} }} 
    3436\newcommand{\pd}[2][]{\ensuremath{\frac{\partial #1}{\partial #2}}} 
    3537 
     38%% Convert chapter/section headings to lowercase 
     39\renewcommand{\chaptermark}[1]{\markboth{#1}{}} 
     40\renewcommand{\sectionmark}[1]{\markright{#1}{}} 
     41 
     42%% Retrieve month name 
     43\renewcommand{\today}{ 
     44  \ifcase \month\or January\or February\or March\or 
     45                    April\or   May\or      June\or 
     46                    July\or    August\or   September\or 
     47                    October\or November\or December 
     48  \fi, \number \year 
     49} 
     50 
     51%% Macro for link to orcid profile 
     52\newcommand{\orcid}[1]{ \href{http://orcid.org/#1}{\textcolor{orcidcolor} \aiOrcidSquare} } 
     53 
    3654%% Workaround for issue with \listoffigures 
    37 \DeclareRobustCommand{\triad}[6][]{\ensuremath{{}_{#2}^{#3}{\mathbb{#4}_{#1}}_{#5}^{\,#6}}} 
     55\DeclareRobustCommand{\triad}[6][]{\ensuremath{ {}_{#2}^{#3} { \mathbb{#4}_{#1} }_{#5}^{\,#6} }} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/packages.tex

    r11189 r11512  
    33%% ============================================================================== 
    44 
    5 \usepackage{natbib}                      %% bib 
    6 \usepackage{caption}                     %% caption 
    7 \usepackage{xcolor}                      %% color 
    8 \usepackage{times}                       %% font 
    9 \usepackage{enumitem}                    %% list 
    10 \usepackage{amsmath}                     %% maths 
    11 %\usepackage{fancyhdr}                    %% page 
    12 \usepackage{minitoc}                     %% toc 
    13 \usepackage{subfiles}                    %% subdocs 
    14 \usepackage{draftwatermark}              %% watermark 
    15 \usepackage{titling}                     %% titlepage 
     5%% 'hyperref' pkg is loaded at the end of the preamble 
     6\usepackage{natbib}                 %% bibtex 
     7\usepackage{caption}                %% caption 
     8\usepackage{xcolor}                 %% colour 
     9\usepackage{times}                  %% font 
     10\usepackage{enumitem}               %% list 
     11\usepackage{amsmath}                %% maths 
     12\usepackage{minitoc}                %% toc 
     13\usepackage{subfiles}               %% subdocs 
     14\usepackage{draftwatermark}         %% watermark 
     15\usepackage[Bjornstrup]{fncychap}   %% headings 
     16\usepackage{fontspec} 
     17%\setmainfont[Ligatures=TeX]{Georgia} 
     18%\setsansfont[Ligatures=TeX]{Arial} 
     19\defaultfontfeatures{ 
     20    Path = /home/ntmlod/.local/texlive2019/texmf-dist/fonts/opentype/public/fontawesome/ 
     21} 
     22\usepackage{academicons}            %% font 
     23\usepackage{fontawesome}            %% font 
     24\usepackage{lastpage}               %% label 
     25\usepackage[pages = some]{background}             %% decoration 
     26\usepackage{geometry}               %% margin 
    1627 
    1728%% Extensions in bundle package 
    1829\usepackage{amssymb, graphicx, tabularx, textcomp} 
    19 \usepackage[utf8]{inputenc}              %% input encoding 
     30%\usepackage[utf8]{inputenc}         %% encoding 
     31\usepackage[footsepline=0.25pt, 
     32headsepline=0.25pt]{scrlayer-scrpage}   %% page layout 
    2033 
    2134%% Configuration 
    2235\graphicspath{ {../../figures/} {../../figures/\engine/} } 
    23 %\captionsetup{margin=10pt, font={small}, labelsep=colon, labelfont={bf}} 
    24 \renewcommand{\bibfont}{\small} 
    25 %\renewcommand{\bibsep}{3pt} 
    26  
     36\geometry{showframe} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/preamble.tex

    r11187 r11512  
    11 
     2%% Specific configuration 
     3\input{../main/definitions} 
     4 
     5%% Global configuration 
    26\input{../../global/packages} 
    37\input{../../global/highlighting} 
     8\input{../../global/indexes} 
     9\input{../../global/styles} 
     10\backgroundsetup{ 
     11  firstpage = true, 
     12  scale = 1, angle = 0, opacity = 1, 
     13  contents = { 
     14    \begin{tikzpicture}[remember picture, overlay] 
     15      \path [fill = manualcolor] (-0.5\paperwidth, 7) rectangle (0.5\paperwidth, 10); 
     16    \end{tikzpicture} 
     17  } 
     18} 
    419\input{../../global/new_cmds} 
    5 \input{../../global/styles} 
    620%\input{../../global/todonotes} 
    721 
     22%% Load hyperref at the end of the preamble to make it work with other pkgs 
     23\usepackage{hyperref}   %% links 
     24\hypersetup{ 
     25  colorlinks, 
     26  citecolor = manualcolor, linkcolor = manualcolor, urlcolor = manualcolor, 
     27  final   %% Links even with draft building 
     28} 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/latex/global/styles.tex

    r11212 r11512  
    33%% ============================================================================== 
    44 
    5 %\pagestyle{fancy} 
    6 \bibliographystyle{../../global/ametsoc} 
    7 \renewcommand{\bibpreamble}{\begin{multicols}{2}} 
    8 \renewcommand{\bibpostamble}{\end{multicols}} 
     5\setcolor 
     6%\definecolor{ghcolor}{HTML}{000333} 
     7\definecolor{orcidcolor}{HTML}{A6CE39} 
     8%\definecolor{wpcolor}{HTML}{464646} 
     9 
     10%% Page layout 
     11\pagestyle{scrheadings} 
     12\addtokomafont{pagehead}{  \sffamily              } 
     13\addtokomafont{pagefoot}{  \sffamily \footnotesize} 
     14\addtokomafont{pagenumber}{\sffamily \slshape     } 
     15\ohead{} \ofoot{}   %% Clear defaults 
     16 
     17%% Caption 
     18\captionsetup{font = footnotesize, justification = justified} 
    919 
    1020%% Additional fonts 
    1121\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it} 
    1222 
    13 %% Page layout 
    14 %\fancyhf{} 
    15 %\fancyhead[LE,RO]{\bfseries\thepage} 
    16 %\fancyhead[LO]{\bfseries\hspace{-0em}\rightmark} 
    17 %\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}} 
    18 %\fancyhead[RE]{\bfseries\leftmark} 
    19 %\renewcommand{\chaptermark}[1]{\markboth{#1}{}} 
    20 %\renewcommand{\headrulewidth}{0.5pt} 
    21 %\renewcommand{\footrulewidth}{0pt  } 
    22 %\addtolength{\headheight}{2.6pt} 
    23  
     23%% Bibliography 
     24\bibliographystyle{../../global/ametsoc} 
     25\renewcommand{\bibfont}{\small} 
     26\renewcommand{\bibpreamble }{\begin{multicols}{2}} 
     27\renewcommand{\bibpostamble}{  \end{multicols}   } 
    2428 
    2529%% Catcodes 
    26 %\makeatletter 
    27 %\def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax} 
    28 %\def\LignesVerticales{\let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV} 
    29 %\def\GrosCarreAvecUnChiffre#1{ 
    30 %  \rlap{\vrule height 0.8cm width 1cm depth 0.2cm} 
    31 %  \rlap{\hbox to 1cm{\hss\mbox{\color{white} #1}\hss}} 
    32 %  \vrule height 0pt width 1cm depth 0pt 
     30\makeatletter 
     31 
     32%% Prevent error with tikz and namelist inclusion 
     33\global\let\tikz@ensure@dollar@catcode=\relax 
     34 
     35%% Apply engine color for chapter boxes (code from fncychap.sty) 
     36%\renewcommand{\DOTI}[1]{ 
     37%  \nointerlineskip\raggedright 
     38%  \fboxsep=\myhi 
     39%  \vskip-1ex 
     40%  \colorbox[manualcolor]{.85}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak 
     41%  \vskip 40\p@ 
    3342%} 
    34 %\def\@makechapterhead#1{ 
    35 %  \hbox{ 
    36 %     \huge\LignesVerticales\hspace{-0.5cm} 
    37 %     \GrosCarreAvecUnChiffre{\thechapter}\hspace{0.2cm} 
    38 %     \hbox{#1} 
    39 %  } 
    40 %  \par\vskip 
    41 %1cm 
    42 %} 
    43 %\def\@makeschapterhead#1{ 
    44 %  \hbox{ 
    45 %     \huge\LignesVerticales 
    46 %     \hbox{#1} 
    47 %  } 
    48 %  \par\vskip 
    49 %2cm 
    50 %} 
    51 %\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else 
    52 %  \hbox{} 
    53 %  \vspace*{\fill} 
    54 %  \vspace{\fill} 
    55 %  \thispagestyle{empty} 
    56 %  \newpage 
    57 %  \if@twocolumn\hbox{}\newpage\fi\fi\fi} 
    58 %\def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\quad}} 
    59 %\makeatother 
    6043 
    61  
     44\makeatother 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DIA/diawri.F90

    r11358 r11512  
    210210      ENDIF 
    211211 
     212      IF( ln_zad_Aimp ) wn = wn + wi               ! Recombine explicit and implicit parts of vertical velocity for diagnostic output 
     213      ! 
    212214      CALL iom_put( "woce", wn )                   ! vertical velocity 
    213215      IF( iom_use('w_masstr') .OR. iom_use('w_masstr2') ) THEN   ! vertical mass transport & its square value 
     
    220222         IF( iom_use('w_masstr2') )   CALL iom_put( "w_masstr2", z3d(:,:,:) * z3d(:,:,:) ) 
    221223      ENDIF 
     224      ! 
     225      IF( ln_zad_Aimp ) wn = wn - wi               ! Remove implicit part of vertical velocity that was added for diagnostic output 
    222226 
    223227      CALL iom_put( "avt" , avt )                  ! T vert. eddy diff. coef. 
     
    829833      CALL histwrite( nid_V, "sometauy", it, vtau          , ndim_hV, ndex_hV )   ! j-wind stress 
    830834 
    831       CALL histwrite( nid_W, "vovecrtz", it, wn             , ndim_T, ndex_T )    ! vert. current 
     835      IF( ln_zad_Aimp ) THEN 
     836         CALL histwrite( nid_W, "vovecrtz", it, wn + wi     , ndim_T, ndex_T )    ! vert. current 
     837      ELSE 
     838         CALL histwrite( nid_W, "vovecrtz", it, wn          , ndim_T, ndex_T )    ! vert. current 
     839      ENDIF 
    832840      CALL histwrite( nid_W, "votkeavt", it, avt            , ndim_T, ndex_T )    ! T vert. eddy diff. coef. 
    833841      CALL histwrite( nid_W, "votkeavm", it, avm            , ndim_T, ndex_T )    ! T vert. eddy visc. coef. 
     
    890898      CALL iom_rstput( 0, 0, inum, 'vozocrtx', un                )    ! now i-velocity 
    891899      CALL iom_rstput( 0, 0, inum, 'vomecrty', vn                )    ! now j-velocity 
    892       CALL iom_rstput( 0, 0, inum, 'vovecrtz', wn                )    ! now k-velocity 
     900      IF( ln_zad_Aimp ) THEN 
     901         CALL iom_rstput( 0, 0, inum, 'vovecrtz', wn + wi        )    ! now k-velocity 
     902      ELSE 
     903         CALL iom_rstput( 0, 0, inum, 'vovecrtz', wn             )    ! now k-velocity 
     904      ENDIF 
    893905      IF( ALLOCATED(ahtu) ) THEN 
    894906         CALL iom_rstput( 0, 0, inum,  'ahtu', ahtu              )    ! aht at u-point 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DOM/domvvl.F90

    r11317 r11512  
    327327      END DO 
    328328      ! 
    329       IF( ln_vvl_ztilde .OR. ln_vvl_layer .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
    330          !                                                            ! ------baroclinic part------ ! 
     329      IF( (ln_vvl_ztilde .OR. ln_vvl_layer) .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
     330         !                                                               ! ------baroclinic part------ ! 
    331331         ! I - initialization 
    332332         ! ================== 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DYN/dynhpg.F90

    r11317 r11512  
    3737   USE trd_oce         ! trends: ocean variables 
    3838   USE trddyn          ! trend manager: dynamics 
    39 !jc   USE zpshde          ! partial step: hor. derivative     (zps_hde routine) 
     39   USE zpshde          ! partial step: hor. derivative     (zps_hde routine) 
    4040   ! 
    4141   USE in_out_manager  ! I/O manager 
     
    338338      REAL(wp) ::   zcoef0, zcoef1, zcoef2, zcoef3   ! temporary scalars 
    339339      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zhpi, zhpj 
     340      REAL(wp), DIMENSION(jpi,jpj) :: zgtsu, zgtsv, zgru, zgrv 
    340341      !!---------------------------------------------------------------------- 
    341342      ! 
     
    346347      ENDIF 
    347348 
    348       ! Partial steps: bottom before horizontal gradient of t, s, rd at the last ocean level 
    349 !jc      CALL zps_hde    ( kt, jpts, tsn, gtsu, gtsv, rhd, gru , grv ) 
     349      ! Partial steps: Compute NOW horizontal gradient of t, s, rd at the last ocean level 
     350      CALL zps_hde( kt, jpts, tsn, zgtsu, zgtsv, rhd, zgru , zgrv ) 
    350351 
    351352      ! Local constant initialization 
     
    385386      END DO 
    386387 
    387       ! partial steps correction at the last level  (use gru & grv computed in zpshde.F90) 
     388      ! partial steps correction at the last level  (use zgru & zgrv computed in zpshde.F90) 
    388389      DO jj = 2, jpjm1 
    389390         DO ji = 2, jpim1 
     
    395396               ua  (ji,jj,iku) = ua(ji,jj,iku) - zhpi(ji,jj,iku)         ! subtract old value 
    396397               zhpi(ji,jj,iku) = zhpi(ji,jj,iku-1)                   &   ! compute the new one 
    397                   &            + zcoef2 * ( rhd(ji+1,jj,iku-1) - rhd(ji,jj,iku-1) + gru(ji,jj) ) * r1_e1u(ji,jj) 
     398                  &            + zcoef2 * ( rhd(ji+1,jj,iku-1) - rhd(ji,jj,iku-1) + zgru(ji,jj) ) * r1_e1u(ji,jj) 
    398399               ua  (ji,jj,iku) = ua(ji,jj,iku) + zhpi(ji,jj,iku)         ! add the new one to the general momentum trend 
    399400            ENDIF 
     
    401402               va  (ji,jj,ikv) = va(ji,jj,ikv) - zhpj(ji,jj,ikv)         ! subtract old value 
    402403               zhpj(ji,jj,ikv) = zhpj(ji,jj,ikv-1)                   &   ! compute the new one 
    403                   &            + zcoef3 * ( rhd(ji,jj+1,ikv-1) - rhd(ji,jj,ikv-1) + grv(ji,jj) ) * r1_e2v(ji,jj) 
     404                  &            + zcoef3 * ( rhd(ji,jj+1,ikv-1) - rhd(ji,jj,ikv-1) + zgrv(ji,jj) ) * r1_e2v(ji,jj) 
    404405               va  (ji,jj,ikv) = va(ji,jj,ikv) + zhpj(ji,jj,ikv)         ! add the new one to the general momentum trend 
    405406            ENDIF 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DYN/sshwzv.F90

    r11353 r11512  
    99   !!             -   !  2010-09  (D.Storkey and E.O'Dea) bug fixes for BDY module 
    1010   !!            3.3  !  2011-10  (M. Leclair) split former ssh_wzv routine and remove all vvl related work 
     11   !!            4.0  !  2018-12  (A. Coward) add mixed implicit/explicit advection 
    1112   !!---------------------------------------------------------------------- 
    1213 
     
    279280      !!            :   wi      : now vertical velocity (for implicit treatment) 
    280281      !! 
    281       !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling. 
     282      !! Reference  : Shchepetkin, A. F. (2015): An adaptive, Courant-number-dependent 
     283      !!              implicit scheme for vertical advection in oceanic modeling.  
     284      !!              Ocean Modelling, 91, 38-69. 
    282285      !!---------------------------------------------------------------------- 
    283286      INTEGER, INTENT(in) ::   kt   ! time step 
     
    286289      REAL(wp)             ::   zCu, zcff, z1_e3t                     ! local scalars 
    287290      REAL(wp) , PARAMETER ::   Cu_min = 0.15_wp                      ! local parameters 
    288       REAL(wp) , PARAMETER ::   Cu_max = 0.27                         ! local parameters 
     291      REAL(wp) , PARAMETER ::   Cu_max = 0.30_wp                      ! local parameters 
    289292      REAL(wp) , PARAMETER ::   Cu_cut = 2._wp*Cu_max - Cu_min        ! local parameters 
    290293      REAL(wp) , PARAMETER ::   Fcu    = 4._wp*Cu_max*(Cu_max-Cu_min) ! local parameters 
     
    300303      ENDIF 
    301304      ! 
    302       ! 
    303       DO jk = 1, jpkm1            ! calculate Courant numbers 
    304          DO jj = 2, jpjm1 
    305             DO ji = 2, fs_jpim1   ! vector opt. 
    306                z1_e3t = 1._wp / e3t_n(ji,jj,jk) 
    307                Cu_adv(ji,jj,jk) = 2._wp * rdt * ( ( MAX( wn(ji,jj,jk) , 0._wp ) - MIN( wn(ji,jj,jk+1) , 0._wp ) )   &  ! 2*rdt and not r2dt (for restartability) 
    308                   &                             + ( MAX( e2u(ji  ,jj)*e3u_n(ji  ,jj,jk)*un(ji  ,jj,jk), 0._wp ) -   & 
    309                   &                                 MIN( e2u(ji-1,jj)*e3u_n(ji-1,jj,jk)*un(ji-1,jj,jk), 0._wp ) )   & 
    310                   &                               * r1_e1e2t(ji,jj)                                                 & 
    311                   &                             + ( MAX( e1v(ji,jj  )*e3v_n(ji,jj  ,jk)*vn(ji,jj  ,jk), 0._wp ) -   & 
    312                   &                                 MIN( e1v(ji,jj-1)*e3v_n(ji,jj-1,jk)*vn(ji,jj-1,jk), 0._wp ) )   & 
    313                   &                               * r1_e1e2t(ji,jj)                                                 & 
    314                   &                             ) * z1_e3t 
     305      ! Calculate Courant numbers 
     306      IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN 
     307         DO jk = 1, jpkm1 
     308            DO jj = 2, jpjm1 
     309               DO ji = 2, fs_jpim1   ! vector opt. 
     310                  z1_e3t = 1._wp / e3t_n(ji,jj,jk) 
     311                  ! 2*rdt and not r2dt (for restartability) 
     312                  Cu_adv(ji,jj,jk) = 2._wp * rdt * ( ( MAX( wn(ji,jj,jk) , 0._wp ) - MIN( wn(ji,jj,jk+1) , 0._wp ) )                       &   
     313                     &                             + ( MAX( e2u(ji  ,jj)*e3u_n(ji  ,jj,jk)*un(ji  ,jj,jk) + un_td(ji  ,jj,jk), 0._wp ) -   & 
     314                     &                                 MIN( e2u(ji-1,jj)*e3u_n(ji-1,jj,jk)*un(ji-1,jj,jk) + un_td(ji-1,jj,jk), 0._wp ) )   & 
     315                     &                               * r1_e1e2t(ji,jj)                                                                     & 
     316                     &                             + ( MAX( e1v(ji,jj  )*e3v_n(ji,jj  ,jk)*vn(ji,jj  ,jk) + vn_td(ji,jj  ,jk), 0._wp ) -   & 
     317                     &                                 MIN( e1v(ji,jj-1)*e3v_n(ji,jj-1,jk)*vn(ji,jj-1,jk) + vn_td(ji,jj-1,jk), 0._wp ) )   & 
     318                     &                               * r1_e1e2t(ji,jj)                                                                     & 
     319                     &                             ) * z1_e3t 
     320               END DO 
    315321            END DO 
    316322         END DO 
    317       END DO 
     323      ELSE 
     324         DO jk = 1, jpkm1 
     325            DO jj = 2, jpjm1 
     326               DO ji = 2, fs_jpim1   ! vector opt. 
     327                  z1_e3t = 1._wp / e3t_n(ji,jj,jk) 
     328                  ! 2*rdt and not r2dt (for restartability) 
     329                  Cu_adv(ji,jj,jk) = 2._wp * rdt * ( ( MAX( wn(ji,jj,jk) , 0._wp ) - MIN( wn(ji,jj,jk+1) , 0._wp ) )   &  
     330                     &                             + ( MAX( e2u(ji  ,jj)*e3u_n(ji  ,jj,jk)*un(ji  ,jj,jk), 0._wp ) -   & 
     331                     &                                 MIN( e2u(ji-1,jj)*e3u_n(ji-1,jj,jk)*un(ji-1,jj,jk), 0._wp ) )   & 
     332                     &                               * r1_e1e2t(ji,jj)                                                 & 
     333                     &                             + ( MAX( e1v(ji,jj  )*e3v_n(ji,jj  ,jk)*vn(ji,jj  ,jk), 0._wp ) -   & 
     334                     &                                 MIN( e1v(ji,jj-1)*e3v_n(ji,jj-1,jk)*vn(ji,jj-1,jk), 0._wp ) )   & 
     335                     &                               * r1_e1e2t(ji,jj)                                                 & 
     336                     &                             ) * z1_e3t 
     337               END DO 
     338            END DO 
     339         END DO 
     340      ENDIF 
    318341      CALL lbc_lnk( 'sshwzv', Cu_adv, 'T', 1. ) 
    319342      ! 
     
    346369                  wn(ji,jj,jk) = ( 1._wp - zcff ) * wn(ji,jj,jk) 
    347370                  ! 
    348                   Cu_adv(ji,jj,jk) = zcff               ! Reuse array to output coefficient 
     371                  Cu_adv(ji,jj,jk) = zcff               ! Reuse array to output coefficient below and in stp_ctl 
    349372               END DO 
    350373            END DO 
     
    353376      ELSE 
    354377         ! Fully explicit everywhere 
    355          Cu_adv(:,:,:) = 0._wp                          ! Reuse array to output coefficient 
     378         Cu_adv(:,:,:) = 0._wp                          ! Reuse array to output coefficient below and in stp_ctl 
    356379         wi    (:,:,:) = 0._wp 
    357380      ENDIF 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/TRA/traadv_fct.F90

    r10425 r11512  
    2121   USE diaar5         ! AR5 diagnostics 
    2222   USE phycst  , ONLY : rau0_rcp 
     23   USE zdf_oce , ONLY : ln_zad_Aimp 
    2324   ! 
    2425   USE in_out_manager ! I/O manager 
     
    8687      REAL(wp), DIMENSION(jpi,jpj,jpk)        ::   zwi, zwx, zwy, zwz, ztu, ztv, zltu, zltv, ztw 
    8788      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdx, ztrdy, ztrdz, zptry 
     89      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   zwinf, zwdia, zwsup 
     90      LOGICAL  ::   ll_zAimp                                 ! flag to apply adaptive implicit vertical advection 
    8891      !!---------------------------------------------------------------------- 
    8992      ! 
     
    97100      l_hst = .FALSE. 
    98101      l_ptr = .FALSE. 
     102      ll_zAimp = .FALSE. 
    99103      IF( ( cdtype =='TRA' .AND. l_trdtra  ) .OR. ( cdtype =='TRC' .AND. l_trdtrc ) )       l_trd = .TRUE. 
    100104      IF(   cdtype =='TRA' .AND. ln_diaptr )                                                l_ptr = .TRUE.  
     
    116120      ! 
    117121      zwi(:,:,:) = 0._wp         
     122      ! 
     123      ! If adaptive vertical advection, check if it is needed on this PE at this time 
     124      IF( ln_zad_Aimp ) THEN 
     125         IF( MAXVAL( ABS( wi(:,:,:) ) ) > 0._wp ) ll_zAimp = .TRUE. 
     126      END IF 
     127      ! If active adaptive vertical advection, build tridiagonal matrix 
     128      IF( ll_zAimp ) THEN 
     129         ALLOCATE(zwdia(jpi,jpj,jpk), zwinf(jpi,jpj,jpk),zwsup(jpi,jpj,jpk)) 
     130         DO jk = 1, jpkm1 
     131            DO jj = 2, jpjm1 
     132               DO ji = fs_2, fs_jpim1   ! vector opt. (ensure same order of calculation as below if wi=0.) 
     133                  zwdia(ji,jj,jk) =  1._wp + p2dt * ( MAX( wi(ji,jj,jk  ) , 0._wp ) - MIN( wi(ji,jj,jk+1) , 0._wp ) ) / e3t_a(ji,jj,jk) 
     134                  zwinf(ji,jj,jk) =  p2dt * MIN( wi(ji,jj,jk  ) , 0._wp ) / e3t_a(ji,jj,jk) 
     135                  zwsup(ji,jj,jk) = -p2dt * MAX( wi(ji,jj,jk+1) , 0._wp ) / e3t_a(ji,jj,jk) 
     136               END DO 
     137            END DO 
     138         END DO 
     139      END IF 
    118140      ! 
    119141      DO jn = 1, kjpt            !==  loop over the tracers  ==! 
     
    169191            END DO 
    170192         END DO 
     193          
     194         IF ( ll_zAimp ) THEN 
     195            CALL tridia_solver( zwdia, zwsup, zwinf, zwi, zwi , 0 ) 
     196            ! 
     197            ztw(:,:,1) = 0._wp ; ztw(:,:,jpk) = 0._wp ; 
     198            DO jk = 2, jpkm1        ! Interior value ( multiplied by wmask) 
     199               DO jj = 2, jpjm1 
     200                  DO ji = fs_2, fs_jpim1   ! vector opt.   
     201                     zfp_wk = wi(ji,jj,jk) + ABS( wi(ji,jj,jk) ) 
     202                     zfm_wk = wi(ji,jj,jk) - ABS( wi(ji,jj,jk) ) 
     203                     ztw(ji,jj,jk) =  0.5 * e1e2t(ji,jj) * ( zfp_wk * zwi(ji,jj,jk) + zfm_wk * zwi(ji,jj,jk-1) ) * wmask(ji,jj,jk) 
     204                     zwz(ji,jj,jk) = zwz(ji,jj,jk) + ztw(ji,jj,jk) ! update vertical fluxes 
     205                  END DO 
     206               END DO 
     207            END DO 
     208            DO jk = 1, jpkm1 
     209               DO jj = 2, jpjm1 
     210                  DO ji = fs_2, fs_jpim1   ! vector opt.   
     211                     pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) - ( ztw(ji,jj,jk) - ztw(ji  ,jj  ,jk+1) ) & 
     212                        &                                  * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 
     213                  END DO 
     214               END DO 
     215            END DO 
     216            ! 
     217         END IF 
    171218         !                 
    172219         IF( l_trd .OR. l_hst )  THEN             ! trend diagnostics (contribution of upstream fluxes) 
     
    277324            zwz(:,:,1) = 0._wp   ! only ocean surface as interior zwz values have been w-masked 
    278325         ENDIF 
     326         !          
     327         IF ( ll_zAimp ) THEN 
     328            DO jk = 1, jpkm1     !* trend and after field with monotonic scheme 
     329               DO jj = 2, jpjm1 
     330                  DO ji = fs_2, fs_jpim1   ! vector opt. 
     331                     !                             ! total intermediate advective trends 
     332                     ztra = - (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )   & 
     333                        &      + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )   & 
     334                        &      + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) ) * r1_e1e2t(ji,jj) 
     335                     ztw(ji,jj,jk)  = zwi(ji,jj,jk) + p2dt * ztra / e3t_a(ji,jj,jk) * tmask(ji,jj,jk) 
     336                  END DO 
     337               END DO 
     338            END DO 
     339            ! 
     340            CALL tridia_solver( zwdia, zwsup, zwinf, ztw, ztw , 0 ) 
     341            ! 
     342            DO jk = 2, jpkm1        ! Interior value ( multiplied by wmask) 
     343               DO jj = 2, jpjm1 
     344                  DO ji = fs_2, fs_jpim1   ! vector opt. 
     345                     zfp_wk = wi(ji,jj,jk) + ABS( wi(ji,jj,jk) ) 
     346                     zfm_wk = wi(ji,jj,jk) - ABS( wi(ji,jj,jk) ) 
     347                     zwz(ji,jj,jk) =  zwz(ji,jj,jk) + 0.5 * e1e2t(ji,jj) * ( zfp_wk * ztw(ji,jj,jk) + zfm_wk * ztw(ji,jj,jk-1) ) * wmask(ji,jj,jk) 
     348                  END DO 
     349               END DO 
     350            END DO 
     351         END IF 
    279352         ! 
    280353         CALL lbc_lnk_multi( 'traadv_fct', zwi, 'T', 1., zwx, 'U', -1. , zwy, 'V', -1.,  zwz, 'W',  1. ) 
     
    289362            DO jj = 2, jpjm1 
    290363               DO ji = fs_2, fs_jpim1   ! vector opt.   
    291                   pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) - (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )   & 
    292                      &                                   + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )   & 
    293                      &                                   + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) ) & 
    294                      &                                * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 
    295                END DO 
    296             END DO 
    297          END DO 
     364                  ztra = - (  zwx(ji,jj,jk) - zwx(ji-1,jj  ,jk  )   & 
     365                     &      + zwy(ji,jj,jk) - zwy(ji  ,jj-1,jk  )   & 
     366                     &      + zwz(ji,jj,jk) - zwz(ji  ,jj  ,jk+1) ) * r1_e1e2t(ji,jj) 
     367                  pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) + ztra / e3t_n(ji,jj,jk) 
     368                  zwi(ji,jj,jk) = zwi(ji,jj,jk) + p2dt * ztra / e3t_a(ji,jj,jk) * tmask(ji,jj,jk) 
     369               END DO 
     370            END DO 
     371         END DO 
     372         ! 
     373         IF ( ll_zAimp ) THEN 
     374            ! 
     375            ztw(:,:,1) = 0._wp ; ztw(:,:,jpk) = 0._wp 
     376            DO jk = 2, jpkm1        ! Interior value ( multiplied by wmask) 
     377               DO jj = 2, jpjm1 
     378                  DO ji = fs_2, fs_jpim1   ! vector opt. 
     379                     zfp_wk = wi(ji,jj,jk) + ABS( wi(ji,jj,jk) ) 
     380                     zfm_wk = wi(ji,jj,jk) - ABS( wi(ji,jj,jk) ) 
     381                     ztw(ji,jj,jk) = - 0.5 * e1e2t(ji,jj) * ( zfp_wk * zwi(ji,jj,jk) + zfm_wk * zwi(ji,jj,jk-1) ) * wmask(ji,jj,jk) 
     382                     zwz(ji,jj,jk) = zwz(ji,jj,jk) + ztw(ji,jj,jk) ! Update vertical fluxes for trend diagnostic 
     383                  END DO 
     384               END DO 
     385            END DO 
     386            DO jk = 1, jpkm1 
     387               DO jj = 2, jpjm1 
     388                  DO ji = fs_2, fs_jpim1   ! vector opt.   
     389                     pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) - ( ztw(ji,jj,jk) - ztw(ji  ,jj  ,jk+1) ) & 
     390                        &                                * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 
     391                  END DO 
     392               END DO 
     393            END DO 
     394         END IF          
    298395         ! 
    299396         IF( l_trd .OR. l_hst ) THEN   ! trend diagnostics // heat/salt transport 
     
    318415      END DO                     ! end of tracer loop 
    319416      ! 
     417      IF ( ll_zAimp ) THEN 
     418         DEALLOCATE( zwdia, zwinf, zwsup ) 
     419      ENDIF 
    320420      IF( l_trd .OR. l_hst ) THEN  
    321421         DEALLOCATE( ztrdx, ztrdy, ztrdz ) 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/TRA/traqsr.F90

    r11317 r11512  
    168168               DO jj = 2, jpjm1                       ! Separation in R-G-B depending of the surface Chl 
    169169                  DO ji = fs_2, fs_jpim1 
    170                      zchl    = sf_chl(1)%fnow(ji,jj,1) 
     170                     zchl    = MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) 
    171171                     zCtot   = 40.6  * zchl**0.459 
    172172                     zze     = 568.2 * zCtot**(-0.746) 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/step.F90

    r11385 r11512  
    165165                            CALL eos    ( tsn, rhd, rhop, gdept_n(:,:,:) )  ! now in situ density for hpg computation 
    166166                             
    167 !!jc: fs simplification 
    168 !!jc: lines below are useless if ln_linssh=F. Keep them here (which maintains a bug if ln_linssh=T and ln_zps=T, cf ticket #1636)  
    169 !!                                         but ensures reproductible results 
    170 !!                                         with previous versions using split-explicit free surface           
    171             IF( ln_zps .AND. .NOT. ln_isfcav )                               & 
    172                &            CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,   &  ! Partial steps: before horizontal gradient 
    173                &                                          rhd, gru , grv     )  ! of t, s, rd at the last ocean level 
    174             IF( ln_zps .AND.       ln_isfcav )                                          & 
    175                &            CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv, gtui, gtvi,  &  ! Partial steps for top cell (ISF) 
    176                &                                          rhd, gru , grv , grui, grvi   )  ! of t, s, rd at the first ocean level 
    177 !!jc: fs simplification 
    178167                             
    179168                         ua(:,:,:) = 0._wp            ! set dynamics trends to zero 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/stpctl.F90

    r10570 r11512  
    9696            IF( ln_zad_Aimp ) THEN 
    9797               istatus = NF90_DEF_VAR( idrun,   'abs_wi_max', NF90_DOUBLE, (/ idtime /), idw1  ) 
    98                istatus = NF90_DEF_VAR( idrun,       'Cu_max', NF90_DOUBLE, (/ idtime /), idc1  ) 
     98               istatus = NF90_DEF_VAR( idrun,       'Cf_max', NF90_DOUBLE, (/ idtime /), idc1  ) 
    9999            ENDIF 
    100100            istatus = NF90_ENDDEF(idrun) 
     
    123123      IF( ln_zad_Aimp ) THEN 
    124124         zmax(8) = MAXVAL(  ABS( wi(:,:,:) ) , mask = wmask(:,:,:) == 1._wp ) ! implicit vertical vel. max 
    125          zmax(9) = MAXVAL(   Cu_adv(:,:,:)   , mask = tmask(:,:,:) == 1._wp ) !       cell Courant no. max 
     125         zmax(9) = MAXVAL(   Cu_adv(:,:,:)   , mask = tmask(:,:,:) == 1._wp ) ! partitioning coeff. max 
    126126      ENDIF 
    127127      ! 
Note: See TracChangeset for help on using the changeset viewer.