Changeset 10368


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

dev_r10164_HPC09_ESIWACE_PREP_MERGE: merge with trunk@10365, see #2133

Location:
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE
Files:
74 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/cfgs/SHARED/field_def_nemo-oce.xml

    r9990 r10368  
    7777        <!-- variables available with MLE --> 
    7878        <field id="Lf_NHpf"      long_name="MLE: Lf = N H / f"   unit="m" /> 
     79 
     80        <!-- next variables available with ln_zad_Aimp=.true. --> 
     81        <field id="Courant"      long_name="Courant number"                                                                 unit="#"   grid_ref="grid_T_3D" /> 
     82        <field id="wimp"         long_name="Implicit vertical velocity"                                                     unit="m/s" grid_ref="grid_T_3D" /> 
     83        <field id="wexp"         long_name="Explicit vertical velocity"                                                     unit="m/s" grid_ref="grid_T_3D" /> 
     84        <field id="wi_cff"       long_name="Fraction of implicit vertical velocity"                                         unit="#"   grid_ref="grid_T_3D" /> 
    7985 
    8086        <!-- next variables available with key_diahth --> 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/cfgs/SHARED/field_def_nemo-pisces.xml

    r10345 r10368  
    240240       <field id="Irondep"     long_name="Iron deposition from dust"               unit="mol/m2/s"                        /> 
    241241       <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"   grid_ref="grid_T_3D" /> 
     242      <field id="FESCAV"      long_name="Scavenging of Iron"                      unit="mmol-Fe/m3/s"   grid_ref="grid_T_3D" /> 
     243       <field id="FECOLL"      long_name="Colloidal Pumping of FeL"                unit="mmol-FeL/m3/s"  grid_ref="grid_T_3D" /> 
     244       <field id="LGWCOLL"     long_name="Coagulation loss of ligands"             unit="mmol-L/m3/s"  grid_ref="grid_T_3D" /> 
     245       <field id="REMINF"      long_name="Oxic remineralization suppy of Fe"       unit="mmol-Fe/m3/s"  grid_ref="grid_T_3D" /> 
     246       <field id="BACT"        long_name="Bacterial Biomass"                       unit="mmol/m3"  grid_ref="grid_T_3D" /> 
     247       <field id="FEBACT"      long_name="Bacterial uptake of Fe"                  unit="molFe/m3/s"  grid_ref="grid_T_3D" /> 
     248       <field id="LPRODR"      long_name="OM remineralisation ligand production rate" unit="nmol-L/m3/s"  grid_ref="grid_T_3D" /> 
     249       <field id="LPRODP"      long_name="phytoplankton ligand production rate"    unit="nmol-L/m3/s"  grid_ref="grid_T_3D" /> 
     250       <field id="LIGREM"      long_name="Remineralisation loss of ligands"        unit="nmol-L/m3/s"  grid_ref="grid_T_3D" /> 
     251       <field id="LIGPR"       long_name="Photochemical loss of ligands"           unit="nmol-L/m3/s"  grid_ref="grid_T_3D" /> 
     252       <field id="LDETP"       long_name="Ligand destruction during phytoplankton uptake" unit="nmol-L/m3/s"  grid_ref="grid_T_3D" /> 
     253       <field id="LPRODZ2"     long_name="mesozooplankton ligand production rate"  unit="nmol-L/m3/s"  grid_ref="grid_T_3D" /> 
     254       <field id="LPRODZ"      long_name="microzooplankton ligand production rate" unit="nmol-L/m3/s"  grid_ref="grid_T_3D" /> 
     255       <field id="FEZOO"       long_name="microzooplankton iron recycling rate"    unit="nmol-FeL/m3/s"  grid_ref="grid_T_3D" /> 
     256       <field id="FEZOO2"      long_name="mesozooplankton iron recycling rate"     unit="nmol-FeL/m3/s"  grid_ref="grid_T_3D" /> 
    242257 
    243258       <!-- dbio_T on T grid : variables available with diaar5 --> 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/cfgs/SHARED/namelist_pisces_ref

    r10345 r10368  
    5555!                         !  ln_ligand enabled 
    5656   wfep       =  0.2      ! FeP sinking speed  
    57    ldocp      =  1.E-5    ! Phyto ligand production per unit doc  
    58    ldocz      =  1.E-5    ! Zoo ligand production per unit doc  
     57   ldocp      =  1.E-4    ! Phyto ligand production per unit doc  
     58   ldocz      =  1.E-4    ! Zoo ligand production per unit doc  
    5959   lthet      =  0.5      ! Proportional loss of ligands due to Fe uptake  
    6060!                         !  ln_p5z enabled 
     
    210210   resrat2    =  0.005    ! exsudation rate of mesozooplankton 
    211211   mzrat2     =  0.03     ! mesozooplankton mortality rate 
    212    xprefc     =  1.       ! mesozoo preference for diatoms 
    213    xprefp     =  0.3      ! mesozoo preference for nanophyto. 
    214    xprefz     =  1.       ! mesozoo preference for microzoo. 
    215    xprefpoc   =  0.3      ! mesozoo preference for poc 
     212   xpref2d    =  1.       ! mesozoo preference for diatoms 
     213   xpref2n    =  0.3      ! mesozoo preference for nanophyto. 
     214   xpref2z    =  1.       ! mesozoo preference for microzoo. 
     215   xpref2c    =  0.3      ! mesozoo preference for poc 
    216216   xthresh2zoo = 1E-8     ! zoo feeding threshold for mesozooplankton  
    217217   xthresh2dia = 1E-8     ! diatoms feeding threshold for mesozooplankton  
     
    221221   xkgraz2    =  20.E-6   ! half saturation constant for meso grazing 
    222222   epsher2    =  0.35     ! Efficicency of Mesozoo growth 
     223   epsher2min =  0.35     ! Minimum efficiency of mesozoo growth 
    223224   sigma2     =  0.6      ! Fraction of mesozoo excretion as DOM 
    224225   unass2     =  0.3      ! non assimilated fraction of P by mesozoo 
     
    246247   xkgraz2     =  20.E-6   ! half sturation constant for meso grazing 
    247248   epsher2     =  0.5      ! Efficicency of Mesozoo growth 
     249   epsher2min  =  0.2     ! Minimum efficiency of mesozoo growth 
    248250   ssigma2     =  0.5     ! Fraction excreted as semi-labile DOM 
    249251   srespir2    =  0.2     ! Active respiration 
     
    260262   resrat     =  0.03     ! exsudation rate of zooplankton 
    261263   mzrat      =  0.004    ! zooplankton mortality rate 
    262    xpref2c    =  0.1      ! Microzoo preference for POM 
    263    xpref2p    =  1.       ! Microzoo preference for Nanophyto 
    264    xpref2d    =  0.5      ! Microzoo preference for Diatoms 
     264   xprefc     =  0.1      ! Microzoo preference for POM 
     265   xprefn     =  1.       ! Microzoo preference for Nanophyto 
     266   xprefd     =  0.6      ! Microzoo preference for Diatoms 
    265267   xthreshdia =  1.E-8    ! Diatoms feeding threshold for microzooplankton  
    266268   xthreshphy =  1.E-8    ! Nanophyto feeding threshold for microzooplankton  
     
    269271   xkgraz     =  20.E-6   ! half sturation constant for grazing 
    270272   epsher     =  0.3      ! Efficiency of microzoo growth 
     273   epshermin  =  0.3      ! Minimum efficiency of microzoo growth 
    271274   sigma1     =  0.6      ! Fraction of microzoo excretion as DOM 
    272275   unass      =  0.3      ! non assimilated fraction of phyto by zoo 
     
    293296   xkgraz     =  20.E-6   ! half sturation constant for grazing 
    294297   epsher     =  0.5      ! Efficiency of microzoo growth 
     298   epshermin  =  0.2      ! Minimum efficiency of microzoo growth 
    295299   ssigma     =  0.5      ! Fraction excreted as semi-labile DOM 
    296300   srespir    =  0.2      ! Active respiration 
     
    304308   ln_fechem =  .false.   ! complex iron chemistry ( T/F ) 
    305309   ln_ligvar =  .false.   ! variable ligand concentration 
    306    ln_fecolloid = .false. ! variable colloidal fraction 
    307310   xlam1        =  0.005  ! scavenging rate of Iron 
    308311   xlamdust     =  150.0  ! Scavenging rate of dust 
    309312   ligand       =  0.6E-9 ! Ligands concentration  
    310    kfep         =  0.     ! Nanoparticle formation rate constant 
     313   kfep         =  0.01   ! Nanoparticle formation rate constant 
    311314/ 
    312315!-----------------------------------------------------------------------   
     
    383386   fep_rats    =  1.       ! Fep/Fer ratio from sed sources  
    384387   fep_rath    =  1.       ! Fep/Fer ratio from sed hydro sources  
     388   rdustfep    =  0.0      ! Fraction of dust that is FeP 
    385389   lgw_rath    =  0.5      ! Weak ligand ratio from sed hydro sources  
    386390/ 
     
    389393!----------------------------------------------------------------------- 
    390394   rfep        =  0.001    ! Dissolution rate of FeP 
    391    rlgw        =  1     ! Lifetime (years) of weak ligands 
     395   rlgw        =  100.     ! Lifetime (years) of weak ligands 
    392396   rlig        =  1.E-4    ! Remin ligand production per unit C 
    393397   prlgw       =  1.E-4    ! Photolysis of weak ligand 
    394    rlgs        =  1000.    ! Lifetime (years) of strong ligands 
     398   rlgs        =  1.       ! Lifetime (years) of strong ligands 
    395399/ 
    396400!----------------------------------------------------------------------- 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/cfgs/SHARED/namelist_ref

    r10345 r10368  
    972972&namzdf        !   vertical physics manager                             (default: NO selection) 
    973973!----------------------------------------------------------------------- 
     974   !                       ! adaptive-implicit vertical advection 
     975   ln_zad_Aimp = .false.      !  Courant number dependent scheme (Shchepetkin 2015) 
     976   ! 
    974977   !                       ! type of vertical closure (required) 
    975978   ln_zdfcst   = .false.      !  constant mixing 
     
    12921295   !                       !  buffer blocking send or immediate non-blocking sends, resp. 
    12931296   nn_buffer   =   0       !  size in bytes of exported buffer ('B' case), 0 no exportation 
    1294    ln_nnogather =  .false.  !  activate code to avoid mpi_allgather use at the northfold 
     1297   ln_nnogather =  .true.  !  activate code to avoid mpi_allgather use at the northfold 
    12951298   jpni        =   0       !  jpni   number of processors following i (set automatically if < 1) 
    12961299   jpnj        =   0       !  jpnj   number of processors following j (set automatically if < 1) 
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/doc/latex/NEMO/subfiles/abstract_foreword.tex

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

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

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

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

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

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

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

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

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

    r10146 r10368  
    1717\label{sec:DIA_io_old} 
    1818 
    19 The model outputs are of three types: the restart file, the output listing, and  
    20 the diagnostic output file(s). 
    21 The restart file is used internally by the code when the user wants to start the model with  
     19The model outputs are of three types: the restart file, the output listing, and the diagnostic output file(s). 
     20The restart file is used internally by the code when the user wants to start the model with 
    2221initial conditions defined by a previous simulation. 
    23 It contains all the information that is necessary in order for there to be no changes in  
    24 the model results (even at the computer precision) between a run performed with several restarts and  
     22It contains all the information that is necessary in order for there to be no changes in the model results 
     23(even at the computer precision) between a run performed with several restarts and 
    2524the same run performed in one step. 
    26 It should be noted that this requires that the restart file contains two consecutive time steps for  
    27 all the prognostic variables, and that it is saved in the same binary format as the one used by  
    28 the computer that is to read it (in particular, 32 bits binary IEEE format must not be used for this file). 
    29  
    30 The output listing and file(s) are predefined but should be checked and eventually adapted to  
    31 the user's needs. 
     25It should be noted that this requires that the restart file contains two consecutive time steps for 
     26all the prognostic variables, and that it is saved in the same binary format as the one used by the computer that 
     27is to read it (in particular, 32 bits binary IEEE format must not be used for this file). 
     28 
     29The output listing and file(s) are predefined but should be checked and eventually adapted to the user's needs. 
    3230The output listing is stored in the $ocean.output$ file. 
    3331The information is printed from within the code on the logical unit $numout$. 
     
    3533 
    3634By default, diagnostic output files are written in NetCDF format. 
    37 Since version 3.2, when defining \key{iomput}, an I/O server has been added which  
    38 provides more flexibility in the choice of the fields to be written as well as  
    39 how the writing work is distributed over the processors in massively parallel computing.  
    40 A complete description of the use of this I/O server is presented in the next section.  
    41  
    42 By default, \key{iomput} is not defined, NEMO produces NetCDF with the old IOIPSL library which  
    43 has been kept for compatibility and its easy installation. 
    44 However, the IOIPSL library is quite inefficient on parallel machines and, since version 3.2,  
    45 many diagnostic options have been added presuming the use of \key{iomput}.  
    46 The usefulness of the default IOIPSL-based option is expected to reduce with each new release.  
    47 If \key{iomput} is not defined, output files and content are defined in the \mdl{diawri} module and  
    48 contain mean (or instantaneous if \key{diainstant} is defined) values over a regular period of  
     35Since version 3.2, when defining \key{iomput}, an I/O server has been added which 
     36provides more flexibility in the choice of the fields to be written as well as how 
     37the writing work is distributed over the processors in massively parallel computing. 
     38A complete description of the use of this I/O server is presented in the next section. 
     39 
     40By default, \key{iomput} is not defined, 
     41NEMO produces NetCDF with the old IOIPSL library which has been kept for compatibility and its easy installation. 
     42However, the IOIPSL library is quite inefficient on parallel machines and, since version 3.2, 
     43many diagnostic options have been added presuming the use of \key{iomput}. 
     44The usefulness of the default IOIPSL-based option is expected to reduce with each new release. 
     45If \key{iomput} is not defined, output files and content are defined in the \mdl{diawri} module and 
     46contain mean (or instantaneous if \key{diainstant} is defined) values over a regular period of 
    4947nn\_write time-steps (namelist parameter).  
    5048 
     
    5755\label{sec:DIA_iom} 
    5856 
    59 Since version 3.2, iomput is the NEMO output interface of choice.  
    60 It has been designed to be simple to use, flexible and efficient.  
     57Since version 3.2, iomput is the NEMO output interface of choice. 
     58It has been designed to be simple to use, flexible and efficient. 
    6159The two main purposes of iomput are:  
    6260 
    6361\begin{enumerate} 
    64    \item The complete and flexible control of the output files through external XML files adapted by  
    65          the user from standard templates. 
    66    \item To achieve high performance and scalable output through the optional distribution of  
    67          all diagnostic output related tasks to dedicated processes. 
     62\item 
     63  The complete and flexible control of the output files through external XML files adapted by 
     64  the user from standard templates. 
     65\item 
     66  To achieve high performance and scalable output through the optional distribution of 
     67  all diagnostic output related tasks to dedicated processes. 
    6868\end{enumerate} 
    6969 
     
    7272 
    7373\begin{itemize} 
    74    \item The choice of output frequencies that can be different for each file  
    75          (including real months and years). 
    76    \item The choice of file contents; includes complete flexibility over which data are written in  
    77          which files (the same data can be written in different files). 
    78    \item The possibility to split output files at a chosen frequency. 
    79    \item The possibility to extract a vertical or an horizontal subdomain. 
    80    \item The choice of the temporal operation to perform,  
    81          e.g.: average, accumulate, instantaneous, min, max and once. 
    82    \item Control over metadata via a large XML "database" of possible output fields. 
     74\item 
     75  The choice of output frequencies that can be different for each file (including real months and years). 
     76\item 
     77  The choice of file contents; includes complete flexibility over which data are written in which files 
     78  (the same data can be written in different files). 
     79\item 
     80  The possibility to split output files at a chosen frequency. 
     81\item 
     82  The possibility to extract a vertical or an horizontal subdomain. 
     83\item 
     84  The choice of the temporal operation to perform, $e.g.$: average, accumulate, instantaneous, min, max and once. 
     85\item 
     86  Control over metadata via a large XML "database" of possible output fields. 
    8387\end{itemize} 
    8488 
    85 In addition, iomput allows the user to add in the code the output of any new variable (scalar, 2D or  
    86 3D) in a very easy way. 
     89In addition, iomput allows the user to add in the code the output of any new variable (scalar, 2D or 3D) 
     90in a very easy way. 
    8791All details of iomput functionalities are listed in the following subsections. 
    88 Examples of the XML files that control the outputs can be found in:  
    89 \path{NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml}, \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and  
    90 \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}. \\ 
     92Examples of the XML files that control the outputs can be found in: \path{NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml}, 
     93\path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}. \\ 
    9194 
    9295The second functionality targets output performance when running in parallel (\key{mpp\_mpi}). 
    93 Iomput provides the possibility to specify N dedicated I/O processes (in addition to  
    94 the NEMO processes) to collect and write the outputs. 
    95 With an appropriate choice of N by the user, the bottleneck associated with the writing of  
     96Iomput provides the possibility to specify N dedicated I/O processes (in addition to the NEMO processes) 
     97to collect and write the outputs. 
     98With an appropriate choice of N by the user, the bottleneck associated with the writing of 
    9699the output files can be greatly reduced. 
    97100 
    98 In version 3.6, the iom\_put interface depends on an external code called  
    99 \href{https://forge.ipsl.jussieu.fr/ioserver/browser/XIOS/branchs/xios-1.0}{XIOS-1.0}  
     101In version 3.6, the iom\_put interface depends on 
     102an external code called \href{https://forge.ipsl.jussieu.fr/ioserver/browser/XIOS/branchs/xios-1.0}{XIOS-1.0}  
    100103(use of revision 618 or higher is required). 
    101 This new IO server can take advantage of the parallel I/O functionality of NetCDF4 to  
     104This new IO server can take advantage of the parallel I/O functionality of NetCDF4 to 
    102105create a single output file and therefore to bypass the rebuilding phase. 
    103 Note that writing in parallel into the same NetCDF files requires that  
    104 your NetCDF4 library is linked to an HDF5 library that has been correctly compiled ($i.e.$ with  
    105 the configure option $--$enable-parallel). 
     106Note that writing in parallel into the same NetCDF files requires that your NetCDF4 library is linked to 
     107an HDF5 library that has been correctly compiled ($i.e.$ with the configure option $--$enable-parallel). 
    106108Note that the files created by iomput through XIOS are incompatible with NetCDF3. 
    107 All post-processsing and visualization tools must therefore be compatible with  
    108 NetCDF4 and not only NetCDF3. 
    109  
    110 Even if not using the parallel I/O functionality of NetCDF4, using N dedicated I/O servers,  
    111 where N is typically much less than the number of NEMO processors,  
    112 will reduce the number of output files created. 
    113 This can greatly reduce the post-processing burden usually associated with using  
    114 large numbers of NEMO processors. 
    115 Note that for smaller configurations, the rebuilding phase can be avoided, even without  
    116 a parallel-enabled NetCDF4 library, simply by employing only one dedicated I/O server. 
     109All post-processsing and visualization tools must therefore be compatible with NetCDF4 and not only NetCDF3. 
     110 
     111Even if not using the parallel I/O functionality of NetCDF4, using N dedicated I/O servers, 
     112where N is typically much less than the number of NEMO processors, will reduce the number of output files created. 
     113This can greatly reduce the post-processing burden usually associated with using large numbers of NEMO processors. 
     114Note that for smaller configurations, the rebuilding phase can be avoided, 
     115even without a parallel-enabled NetCDF4 library, simply by employing only one dedicated I/O server. 
    117116 
    118117\subsection{XIOS: XML Inputs-Outputs Server} 
     
    120119\subsubsection{Attached or detached mode?} 
    121120 
    122 Iomput is based on \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS},  
     121Iomput is based on \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS}, 
    123122the io\_server developed by Yann Meurdesoif from IPSL. 
    124123The behaviour of the I/O subsystem is controlled by settings in the external XML files listed above. 
     
    127126\xmlline|<variable id="using_server" type="bool"></variable>| 
    128127 
    129 The {\tt using\_server} setting determines whether or not the server will be used in  
    130 \textit{attached mode} (as a library) [{\tt> false <}] or in \textit{detached mode} (as  
    131 an external executable on N additional, dedicated cpus) [{\tt > true <}]. 
     128The {\tt using\_server} setting determines whether or not the server will be used in \textit{attached mode} 
     129(as a library) [{\tt> false <}] or in \textit{detached mode} 
     130(as an external executable on N additional, dedicated cpus) [{\tt > true <}]. 
    132131The \textit{attached mode} is simpler to use but much less efficient for massively parallel applications. 
    133132The type of each file can be either ''multiple\_file'' or ''one\_file''. 
    134133 
    135 In \textit{attached mode} and if the type of file is ''multiple\_file'',  
     134In \textit{attached mode} and if the type of file is ''multiple\_file'', 
    136135then each NEMO process will also act as an IO server and produce its own set of output files. 
    137136Superficially, this emulates the standard behaviour in previous versions. 
    138 However, the subdomain written out by each process does not correspond to  
     137However, the subdomain written out by each process does not correspond to 
    139138the \forcode{jpi x jpj x jpk} domain actually computed by the process (although it may if \forcode{jpni=1}). 
    140139Instead each process will have collected and written out a number of complete longitudinal strips. 
    141 If the ''one\_file'' option is chosen then all processes will collect their longitudinal strips and  
     140If the ''one\_file'' option is chosen then all processes will collect their longitudinal strips and 
    142141write (in parallel) to a single output file. 
    143142 
    144 In \textit{detached mode} and if the type of file is ''multiple\_file'', then  
    145 each stand-alone XIOS process will collect data for a range of complete longitudinal strips and  
     143In \textit{detached mode} and if the type of file is ''multiple\_file'', 
     144then each stand-alone XIOS process will collect data for a range of complete longitudinal strips and 
    146145write to its own set of output files. 
    147 If the ''one\_file'' option is chosen then all XIOS processes will collect their longitudinal strips and  
     146If the ''one\_file'' option is chosen then all XIOS processes will collect their longitudinal strips and 
    148147write (in parallel) to a single output file.  
    149148Note running in detached mode requires launching a Multiple Process Multiple Data (MPMD) parallel job. 
    150 The following subsection provides a typical example but the syntax will vary in  
    151 different MPP environments. 
     149The following subsection provides a typical example but the syntax will vary in different MPP environments. 
    152150 
    153151\subsubsection{Number of cpu used by XIOS in detached mode} 
     
    156154The number of cores dedicated to XIOS should be from \texttildelow1/10 to \texttildelow1/50 of the number of  
    157155cores dedicated to NEMO. 
    158 Some manufacturers suggest using O($\sqrt{N}$) dedicated IO processors for N processors but  
     156Some manufacturers suggest using O($\sqrt{N}$) dedicated IO processors for N processors but 
    159157this is a general recommendation and not specific to NEMO. 
    160 It is difficult to provide precise recommendations because the optimal choice will depend on  
     158It is difficult to provide precise recommendations because the optimal choice will depend on 
    161159the particular hardware properties of the target system  
    162 (parallel filesystem performance, available memory, memory bandwidth etc.) and  
    163 the volume and frequency of data to be created. 
     160(parallel filesystem performance, available memory, memory bandwidth etc.) 
     161and the volume and frequency of data to be created. 
    164162Here is an example of 2 cpus for the io\_server and 62 cpu for nemo using mpirun: 
    165163\cmd|mpirun -np 62 ./nemo.exe : -np 2 ./xios_server.exe| 
     
    167165\subsubsection{Control of XIOS: the context in iodef.xml} 
    168166 
    169 As well as the {\tt using\_server} flag, other controls on the use of XIOS are set in  
    170 the XIOS context in iodef.xml. 
     167As well as the {\tt using\_server} flag, other controls on the use of XIOS are set in the XIOS context in iodef.xml. 
    171168See the XML basics section below for more details on XML syntax and rules. 
    172169 
     
    205202\subsubsection{Installation} 
    206203 
    207 As mentioned, XIOS is supported separately and must be downloaded and compiled before  
    208 it can be used with NEMO. 
    209 See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for  
    210 help and guidance. 
     204As mentioned, XIOS is supported separately and must be downloaded and compiled before it can be used with NEMO. 
     205See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for help and guidance. 
    211206NEMO will need to link to the compiled XIOS library. 
    212 The  
    213 \href{https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#Inputs-OutputsusingXIOS} 
    214 {XIOS with NEMO} 
    215 guide provides an example illustration of how this can be achieved. 
     207The \href{https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#Inputs-OutputsusingXIOS} 
     208{XIOS with NEMO} guide provides an example illustration of how this can be achieved. 
    216209 
    217210\subsubsection{Add your own outputs} 
    218211 
    219212It is very easy to add your own outputs with iomput. 
    220 Many standard fields and diagnostics are already prepared ($i.e.$, steps 1 to 3 below have been done) and  
     213Many standard fields and diagnostics are already prepared ($i.e.$, steps 1 to 3 below have been done) and 
    221214simply need to be activated by including the required output in a file definition in iodef.xml (step 4). 
    222215To add new output variables, all 4 of the following steps must be taken. 
    223216 
    224217\begin{enumerate} 
    225    \item[1.] in NEMO code, add a \forcode{CALL iom\_put( 'identifier', array )} where you want to  
    226                output a 2D or 3D array. 
    227    \item[2.] If necessary, add \forcode{USE iom ! I/O manager library} to the list of used modules in  
    228                the upper part of your module. 
    229    \item[3.] in the field\_def.xml file, add the definition of your variable using  
    230                the same identifier you used in the f90 code (see subsequent sections for  
    231                a details of the XML syntax and rules). 
    232 For example: 
     218\item[1.] 
     219  in NEMO code, add a \forcode{CALL iom\_put( 'identifier', array )} where you want to output a 2D or 3D array. 
     220\item[2.] 
     221  If necessary, add \forcode{USE iom ! I/O manager library} to the list of used modules in 
     222  the upper part of your module. 
     223\item[3.] 
     224  in the field\_def.xml file, add the definition of your variable using the same identifier you used in the f90 code 
     225  (see subsequent sections for a details of the XML syntax and rules). 
     226  For example: 
    233227 
    234228\begin{xmllines} 
     
    241235\end{xmllines} 
    242236 
    243 Note your definition must be added to the field\_group whose reference grid is consistent with  
    244 the size of the array passed to iomput. 
    245 The grid\_ref attribute refers to definitions set in iodef.xml which, in turn, reference grids and  
    246 axes either defined in the code (iom\_set\_domain\_attr and iom\_set\_axis\_attr in \mdl{iom}) or  
    247 defined in the domain\_def.xml file. 
     237Note your definition must be added to the field\_group whose reference grid is consistent with the size of 
     238the array passed to iomput. 
     239The grid\_ref attribute refers to definitions set in iodef.xml which, in turn, 
     240reference grids and axes either defined in the code 
     241(iom\_set\_domain\_attr and iom\_set\_axis\_attr in \mdl{iom}) or defined in the domain\_def.xml file. 
    248242$e.g.$: 
    249243 
     
    252246\end{xmllines} 
    253247 
    254 Note, if your array is computed within the surface module each \np{nn\_fsbc} time\_step,  
     248Note, if your array is computed within the surface module each \np{nn\_fsbc} time\_step, 
    255249add the field definition within the field\_group defined with the id "SBC": 
    256 \xmlcode{<field_group id="SBC" ...>} which has been defined with the correct frequency of  
    257 operations (iom\_set\_field\_attr in \mdl{iom}) 
    258    \item[4.] add your field in one of the output files defined in iodef.xml  
    259 (again see subsequent sections for syntax and rules) 
     250\xmlcode{<field_group id="SBC" ...>} which has been defined with the correct frequency of operations 
     251(iom\_set\_field\_attr in \mdl{iom}) 
     252\item[4.] 
     253  add your field in one of the output files defined in iodef.xml 
     254  (again see subsequent sections for syntax and rules) 
    260255 
    261256\begin{xmllines} 
     
    274269 
    275270XML tags begin with the less-than character ("$<$") and end with the greater-than character ("$>$"). 
    276 You use tags to mark the start and end of elements, which are the logical units of information in  
    277 an XML document. 
    278 In addition to marking the beginning of an element, XML start tags also provide a place to  
    279 specify attributes. 
    280 An attribute specifies a single property for an element, using a name/value pair, for example:  
     271You use tags to mark the start and end of elements, which are the logical units of information in an XML document. 
     272In addition to marking the beginning of an element, XML start tags also provide a place to specify attributes. 
     273An attribute specifies a single property for an element, using a name/value pair, for example: 
    281274\xmlcode{<a b="x" c="y" d="z"> ... </a>}. 
    282275See \href{http://www.xmlnews.org/docs/xml-basics.html}{here} for more details. 
     
    284277\subsubsection{Structure of the XML file used in NEMO} 
    285278 
    286 The XML file used in XIOS is structured by 7 families of tags:  
     279The XML file used in XIOS is structured by 7 families of tags: 
    287280context, axis, domain, grid, field, file and variable. 
    288281Each tag family has hierarchy of three flavors (except for context): 
     
    302295 
    303296Each element may have several attributes. 
    304 Some attributes are mandatory, other are optional but have a default value and  
    305 other are completely optional. 
     297Some attributes are mandatory, other are optional but have a default value and other are completely optional. 
    306298Id is a special attribute used to identify an element or a group of elements. 
    307299It must be unique for a kind of element. 
    308300It is optional, but no reference to the corresponding element can be done if it is not defined. 
    309301 
    310 The XML file is split into context tags that are used to isolate IO definition from different codes or  
    311 different parts of a code. 
     302The XML file is split into context tags that are used to isolate IO definition from 
     303different codes or different parts of a code. 
    312304No interference is possible between 2 different contexts. 
    313305Each context has its own calendar and an associated timestep. 
     
    370362  
    371363\noindent In NEMO, by default, the field and domain definition is done in 2 separate files: 
    372 \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}  
    373 that are included in the main iodef.xml file through the following commands: 
     364\path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml} that 
     365are included in the main iodef.xml file through the following commands: 
    374366\begin{xmllines} 
    375367<field_definition src="./field_def.xml" /> 
     
    380372 
    381373XML extensively uses the concept of inheritance. 
    382 XML has a tree based structure with a parent-child oriented relation:  
    383 all children inherit attributes from parent, but an attribute defined in a child replace  
    384 the inherited attribute value.  
    385 Note that the special attribute ''id'' is never inherited. \\ \\ 
     374XML has a tree based structure with a parent-child oriented relation: all children inherit attributes from parent, 
     375but an attribute defined in a child replace the inherited attribute value. 
     376Note that the special attribute ''id'' is never inherited. 
     377\\ 
     378\\ 
    386379example 1: Direct inheritance. 
    387380 
     
    393386\end{xmllines} 
    394387 
    395 The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''average''  
    396 of the attribute ''operation'' from its parent. 
     388The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''average'' of 
     389the attribute ''operation'' from its parent. 
    397390Note that a child can overwrite the attribute definition inherited from its parents. 
    398 In the example above, the field ''sss'' will for example output instantaneous values instead of  
    399 average values. \\ \\ 
     391In the example above, the field ''sss'' will for example output instantaneous values instead of average values. 
     392\\ 
     393\\ 
    400394example 2: Inheritance by reference. 
    401395 
     
    418412 
    419413Groups can be used for 2 purposes. 
    420 Firstly, the group can be used to define common attributes to be shared by the elements of  
     414Firstly, the group can be used to define common attributes to be shared by the elements of 
    421415the group through inheritance. 
    422416In the following example, we define a group of field that will share a common grid ''grid\_T\_2D''. 
    423 Note that for the field ''toce'', we overwrite the grid definition inherited from the group by  
    424 ''grid\_T\_3D''. 
     417Note that for the field ''toce'', we overwrite the grid definition inherited from the group by ''grid\_T\_3D''. 
    425418 
    426419\begin{xmllines} 
     
    456449\subsection{Detailed functionalities} 
    457450 
    458 The file \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml} provides several examples of the use of  
     451The file \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml} provides several examples of the use of 
    459452the new functionalities offered by the XML interface of XIOS. 
    460453 
    461454\subsubsection{Define horizontal subdomains} 
    462455 
    463 Horizontal subdomains are defined through the attributs zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj of  
     456Horizontal subdomains are defined through the attributs zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj of 
    464457the tag family domain. 
    465458It must therefore be done in the domain part of the XML file.  
     
    472465\end{xmllines} 
    473466 
    474 The use of this subdomain is done through the redefinition of the attribute domain\_ref of  
    475 the tag family field. 
     467The use of this subdomain is done through the redefinition of the attribute domain\_ref of the tag family field. 
    476468For example: 
    477469 
     
    483475 
    484476Moorings are seen as an extrem case corresponding to a 1 by 1 subdomain.  
    485 The Equatorial section, the TAO, RAMA and PIRATA moorings are alredy registered in the code and  
     477The Equatorial section, the TAO, RAMA and PIRATA moorings are already registered in the code and 
    486478can therefore be outputted without taking care of their (i,j) position in the grid. 
    487479These predefined domains can be activated by the use of specific domain\_ref: 
    488 ''EqT'', ''EqU'' or ''EqW'' for the equatorial sections and the mooring position for  
    489 TAO, RAMA and PIRATA followed by ''T'' (for example: ''8s137eT'', ''1.5s80.5eT'' ...) 
     480''EqT'', ''EqU'' or ''EqW'' for the equatorial sections and 
     481the mooring position for TAO, RAMA and PIRATA followed by ''T'' (for example: ''8s137eT'', ''1.5s80.5eT'' ...) 
    490482 
    491483\begin{xmllines} 
     
    503495\subsubsection{Define vertical zooms} 
    504496 
    505 Vertical zooms are defined through the attributs zoom\_begin and zoom\_end of the tag family axis.  
    506 It must therefore be done in the axis part of the XML file.  
     497Vertical zooms are defined through the attributs zoom\_begin and zoom\_end of the tag family axis. 
     498It must therefore be done in the axis part of the XML file. 
    507499For example, in \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml}, we provide the following example: 
    508500 
     
    513505\end{xmllines} 
    514506 
    515 The use of this vertical zoom is done through the redefinition of the attribute axis\_ref of  
    516 the tag family field. 
     507The use of this vertical zoom is done through the redefinition of the attribute axis\_ref of the tag family field. 
    517508For example: 
    518509 
     
    539530\end{xmllines} 
    540531 
    541 However it is often very convienent to define the file name with the name of the experiment,  
    542 the output file frequency and the date of the beginning and the end of the simulation  
     532However it is often very convienent to define the file name with the name of the experiment, 
     533the output file frequency and the date of the beginning and the end of the simulation 
    543534(which are informations stored either in the namelist or in the XML file). 
    544 To do so, we added the following rule: if the id of the tag file is ''fileN'' (where N = 1 to 999 on  
    545 1 to 3 digits) or one of the predefined sections or moorings (see next subsection),  
    546 the following part of the name and the name\_suffix (that can be inherited) will be automatically  
    547 replaced by: 
     535To do so, we added the following rule: 
     536if the id of the tag file is ''fileN'' (where N = 1 to 999 on 1 to 3 digits) or 
     537one of the predefined sections or moorings (see next subsection), 
     538the following part of the name and the name\_suffix (that can be inherited) will be automatically replaced by: 
    548539 
    549540\begin{table} \scriptsize 
     
    580571\end{forlines} 
    581572 
    582 \noindent will give the following file name radical: 
    583 \ifile{myfile\_ORCA2\_19891231\_freq1d} 
     573\noindent will give the following file name radical: \ifile{myfile\_ORCA2\_19891231\_freq1d} 
    584574 
    585575\subsubsection{Other controls of the XML attributes from NEMO} 
    586576 
    587577The values of some attributes are defined by subroutine calls within NEMO  
    588 (calls to iom\_set\_domain\_attr, iom\_set\_axis\_attr and iom\_set\_field\_attr in \mdl{iom}).  
    589 Any definition given in the XML file will be overwritten.  
    590 By convention, these attributes are defined to ''auto'' (for string) or ''0000'' (for integer) in  
    591 the XML file (but this is not necessary). \\ 
    592  
    593 Here is the list of these attributes: \\ 
     578(calls to iom\_set\_domain\_attr, iom\_set\_axis\_attr and iom\_set\_field\_attr in \mdl{iom}). 
     579Any definition given in the XML file will be overwritten. 
     580By convention, these attributes are defined to ''auto'' (for string) or ''0000'' (for integer) in the XML file 
     581(but this is not necessary). 
     582\\ 
     583 
     584Here is the list of these attributes: 
     585\\ 
    594586 
    595587\begin{table} \scriptsize 
     
    631623 
    632624\begin{enumerate} 
    633 \item Simple computation: directly define the computation when refering to the variable in  
    634 the file definition. 
     625\item 
     626  Simple computation: directly define the computation when refering to the variable in the file definition. 
    635627 
    636628\begin{xmllines} 
     
    640632\end{xmllines} 
    641633 
    642 \item Simple computation: define a new variable and use it in the file definition. 
     634\item 
     635  Simple computation: define a new variable and use it in the file definition. 
    643636 
    644637in field\_definition: 
     
    654647\end{xmllines} 
    655648 
    656 Note that in this case, the following syntaxe \xmlcode{<field field_ref="sst2" />} is not working as  
     649Note that in this case, the following syntaxe \xmlcode{<field field_ref="sst2" />} is not working as 
    657650sst2 won't be evaluated. 
    658651 
    659 \item Change of variable precision: 
     652\item 
     653  Change of variable precision: 
    660654 
    661655\begin{xmllines} 
     
    667661 
    668662Note that, then the code is crashing, writting real4 variables forces a numerical convection from  
    669 real8 to real4 which will create an internal error in NetCDF and will avoid the creation of  
    670 the output files. 
    671 Forcing double precision outputs with prec="8" (for example in the field\_definition) will  
    672 avoid this problem. 
    673  
    674 \item add user defined attributes: 
     663real8 to real4 which will create an internal error in NetCDF and will avoid the creation of the output files. 
     664Forcing double precision outputs with prec="8" (for example in the field\_definition) will avoid this problem. 
     665 
     666\item 
     667  add user defined attributes: 
    675668 
    676669\begin{xmllines} 
     
    687680\end{xmllines} 
    688681 
    689 \item use of the ``@'' function: example 1, weighted temporal average 
     682\item 
     683  use of the ``@'' function: example 1, weighted temporal average 
    690684 
    691685 - define a new variable in field\_definition 
     
    706700 
    707701The freq\_op="5d" attribute is used to define the operation frequency of the ``@'' function: here 5 day. 
    708 The temporal operation done by the ``@'' is the one defined in the field definition:  
     702The temporal operation done by the ``@'' is the one defined in the field definition: 
    709703here we use the default, average. 
    710704So, in the above case, @toce\_e3t will do the 5-day mean of toce*e3t. 
    711 Operation="instant" refers to the temporal operation to be performed on the field''@toce\_e3t / @e3t'':  
    712 here the temporal average is alreday done by the ``@'' function so we just use instant to do the ratio of  
     705Operation="instant" refers to the temporal operation to be performed on the field''@toce\_e3t / @e3t'': 
     706here the temporal average is alreday done by the ``@'' function so we just use instant to do the ratio of 
    713707the 2 mean values. 
    714708field\_ref="toce" means that attributes not explicitely defined, are inherited from toce field. 
    715709Note that in this case, freq\_op must be equal to the file output\_freq. 
    716710 
    717 \item use of the ``@'' function: example 2, monthly SSH standard deviation 
     711\item 
     712  use of the ``@'' function: example 2, monthly SSH standard deviation 
    718713 
    719714 - define a new variable in field\_definition 
     
    737732 
    738733The freq\_op="1m" attribute is used to define the operation frequency of the ``@'' function: here 1 month. 
    739 The temporal operation done by the ``@'' is the one defined in the field definition:  
     734The temporal operation done by the ``@'' is the one defined in the field definition: 
    740735here we use the default, average. 
    741736So, in the above case, @ssh2 will do the monthly mean of ssh*ssh. 
    742 Operation="instant" refers to the temporal operation to be performed on  
    743 the field ''sqrt( @ssh2 - @ssh * @ssh )'':  
     737Operation="instant" refers to the temporal operation to be performed on the field ''sqrt( @ssh2 - @ssh * @ssh )'':  
    744738here the temporal average is alreday done by the ``@'' function so we just use instant. 
    745739field\_ref="ssh" means that attributes not explicitely defined, are inherited from ssh field. 
    746740Note that in this case, freq\_op must be equal to the file output\_freq. 
    747741 
    748 \item use of the ``@'' function: example 3, monthly average of SST diurnal cycle 
     742\item 
     743  use of the ``@'' function: example 3, monthly average of SST diurnal cycle 
    749744 
    750745 - define 2 new variables in field\_definition 
     
    770765 
    771766The freq\_op="1d" attribute is used to define the operation frequency of the ``@'' function: here 1 day. 
    772 The temporal operation done by the ``@'' is the one defined in the field definition: here maximum for  
    773 sstmax and minimum for sstmin. 
     767The temporal operation done by the ``@'' is the one defined in the field definition: 
     768here maximum for sstmax and minimum for sstmin. 
    774769So, in the above case, @sstmax will do the daily max and @sstmin the daily min. 
    775 Operation="average" refers to the temporal operation to be performed on the field ``@sstmax - @sstmin'':  
     770Operation="average" refers to the temporal operation to be performed on the field ``@sstmax - @sstmin'': 
    776771here monthly mean (of daily max - daily min of the sst). 
    777772field\_ref="sst" means that attributes not explicitely defined, are inherited from sst field. 
     
    11261121 
    11271122Output from the XIOS-1.0 IO server is compliant with  
    1128 \href{http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html}{version 1.5}  
    1129 of the CF metadata standard.  
    1130 Therefore while a user may wish to add their own metadata to the output files (as demonstrated in  
    1131 example 4 of section \autoref{subsec:IOM_xmlref}) the metadata should, for the most part, comply with  
    1132 the CF-1.5 standard. 
    1133  
    1134 Some metadata that may significantly increase the file size (horizontal cell areas and  
    1135 vertices) are controlled by the namelist parameter \np{ln\_cfmeta} in the \ngn{namrun} namelist. 
     1123\href{http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html}{version 1.5} of 
     1124the CF metadata standard.  
     1125Therefore while a user may wish to add their own metadata to the output files (as demonstrated in example 4 of 
     1126section \autoref{subsec:IOM_xmlref}) the metadata should, for the most part, comply with the CF-1.5 standard. 
     1127 
     1128Some metadata that may significantly increase the file size (horizontal cell areas and vertices) are controlled by 
     1129the namelist parameter \np{ln\_cfmeta} in the \ngn{namrun} namelist. 
    11361130This must be set to true if these metadata are to be included in the output files. 
    11371131 
     
    11441138 
    11451139Since version 3.3, support for NetCDF4 chunking and (loss-less) compression has been included. 
    1146 These options build on the standard NetCDF output and allow the user control over the size of  
    1147 the chunks via namelist settings. 
     1140These options build on the standard NetCDF output and allow the user control over the size of the chunks via 
     1141namelist settings. 
    11481142Chunking and compression can lead to significant reductions in file sizes for a small runtime overhead. 
    1149 For a fuller discussion on chunking and other performance issues the reader is referred to  
    1150 the NetCDF4 documentation found  
    1151 \href{http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html#Chunking}{here}. 
    1152  
    1153 The new features are only available when the code has been linked with a NetCDF4 library  
    1154 (version 4.1 onwards, recommended) which has been built with HDF5 support  
    1155 (version 1.8.4 onwards, recommended). 
    1156 Datasets created with chunking and compression are not backwards compatible with  
    1157 NetCDF3 "classic" format but most analysis codes can be relinked simply with the new libraries and  
    1158 will then read both NetCDF3 and NetCDF4 files. 
    1159 NEMO executables linked with NetCDF4 libraries can be made to produce NetCDF3 files by  
     1143For a fuller discussion on chunking and other performance issues the reader is referred to 
     1144the NetCDF4 documentation found \href{http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html#Chunking}{here}. 
     1145 
     1146The new features are only available when the code has been linked with a NetCDF4 library 
     1147(version 4.1 onwards, recommended) which has been built with HDF5 support (version 1.8.4 onwards, recommended). 
     1148Datasets created with chunking and compression are not backwards compatible with NetCDF3 "classic" format but 
     1149most analysis codes can be relinked simply with the new libraries and will then read both NetCDF3 and NetCDF4 files. 
     1150NEMO executables linked with NetCDF4 libraries can be made to produce NetCDF3 files by 
    11601151setting the \np{ln\_nc4zip} logical to false in the \textit{namnc4} namelist: 
    11611152 
     
    11661157 
    11671158If \key{netcdf4} has not been defined, these namelist parameters are not read. 
    1168 In this case, \np{ln\_nc4zip} is set false and dummy routines for  
    1169 a few NetCDF4-specific functions are defined. 
    1170 These functions will not be used but need to be included so that compilation is possible with  
    1171 NetCDF3 libraries. 
    1172  
    1173 When using NetCDF4 libraries, \key{netcdf4} should be defined even if the intention is to  
     1159In this case, \np{ln\_nc4zip} is set false and dummy routines for a few NetCDF4-specific functions are defined. 
     1160These functions will not be used but need to be included so that compilation is possible with NetCDF3 libraries. 
     1161 
     1162When using NetCDF4 libraries, \key{netcdf4} should be defined even if the intention is to 
    11741163create only NetCDF3-compatible files. 
    1175 This is necessary to avoid duplication between the dummy routines and  
    1176 the actual routines present in the library. 
     1164This is necessary to avoid duplication between the dummy routines and the actual routines present in the library. 
    11771165Most compilers will fail at compile time when faced with such duplication. 
    1178 Thus when linking with NetCDF4 libraries the user must define \key{netcdf4} and  
     1166Thus when linking with NetCDF4 libraries the user must define \key{netcdf4} and 
    11791167control the type of NetCDF file produced via the namelist parameter. 
    11801168 
    1181 Chunking and compression is applied only to 4D fields and there is no advantage in  
    1182 chunking across more than one time dimension since previously written chunks would have to  
    1183 be read back and decompressed before being added to. 
     1169Chunking and compression is applied only to 4D fields and 
     1170there is no advantage in chunking across more than one time dimension since 
     1171previously written chunks would have to be read back and decompressed before being added to. 
    11841172Therefore, user control over chunk sizes is provided only for the three space dimensions. 
    11851173The user sets an approximate number of chunks along each spatial axis. 
    1186 The actual size of the chunks will depend on global domain size for mono-processors or,  
    1187 more likely, the local processor domain size for distributed processing. 
    1188 The derived values are subject to practical minimum values (to avoid wastefully small chunk sizes) and  
     1174The actual size of the chunks will depend on global domain size for mono-processors or, more likely, 
     1175the local processor domain size for distributed processing. 
     1176The derived values are subject to practical minimum values (to avoid wastefully small chunk sizes) and 
    11891177cannot be greater than the domain size in any dimension. 
    11901178The algorithm used is: 
     
    12031191\end{forlines} 
    12041192 
    1205 \noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\tt 46x38x1} respectively in  
     1193\noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\tt 46x38x1} respectively in 
    12061194the mono-processor case (i.e. global domain of {\small\tt 182x149x31}). 
    12071195An illustration of the potential space savings that NetCDF4 chunking and compression provides is given in  
    1208 table \autoref{tab:NC4} which compares the results of two short runs of  
    1209 the ORCA2\_LIM reference configuration with a 4x2 mpi partitioning. 
    1210 Note the variation in the compression ratio achieved which reflects chiefly the dry to  
    1211 wet volume ratio of each processing region. 
     1196table \autoref{tab:NC4} which compares the results of two short runs of the ORCA2\_LIM reference configuration with 
     1197a 4x2 mpi partitioning. 
     1198Note the variation in the compression ratio achieved which reflects chiefly the dry to wet volume ratio of 
     1199each processing region. 
    12121200 
    12131201%------------------------------------------TABLE---------------------------------------------------- 
     
    12491237%---------------------------------------------------------------------------------------------------- 
    12501238 
    1251 When \key{iomput} is activated with \key{netcdf4} chunking and compression parameters for  
    1252 fields produced via \np{iom\_put} calls are set via an equivalent and identically named namelist to  
    1253 \textit{namnc4} in \np{xmlio\_server.def}. 
    1254 Typically this namelist serves the mean files whilst the \ngn{ namnc4} in  
    1255 the main namelist file continues to serve the restart files. 
    1256 This duplication is unfortunate but appropriate since, if using io\_servers, the domain sizes of  
    1257 the individual files produced by the io\_server processes may be different to those produced by  
     1239When \key{iomput} is activated with \key{netcdf4} chunking and compression parameters for fields produced via 
     1240\np{iom\_put} calls are set via an equivalent and identically named namelist to \textit{namnc4} in 
     1241\np{xmlio\_server.def}. 
     1242Typically this namelist serves the mean files whilst the \ngn{ namnc4} in the main namelist file continues to 
     1243serve the restart files. 
     1244This duplication is unfortunate but appropriate since, if using io\_servers, the domain sizes of 
     1245the individual files produced by the io\_server processes may be different to those produced by 
    12581246the invidual processing regions and different chunking choices may be desired. 
    12591247  
     
    12691257%------------------------------------------------------------------------------------------------------------- 
    12701258 
    1271 Each trend of the dynamics and/or temperature and salinity time evolution equations can be send to  
    1272 \mdl{trddyn} and/or \mdl{trdtra} modules (see TRD directory) just after their computation ($i.e.$ at  
    1273 the end of each $dyn\cdots.F90$ and/or $tra\cdots.F90$ routines). 
     1259Each trend of the dynamics and/or temperature and salinity time evolution equations can be send to 
     1260\mdl{trddyn} and/or \mdl{trdtra} modules (see TRD directory) just after their computation 
     1261($i.e.$ at the end of each $dyn\cdots.F90$ and/or $tra\cdots.F90$ routines). 
    12741262This capability is controlled by options offered in \ngn{namtrd} namelist. 
    12751263Note that the output are done with xIOS, and therefore the \key{IOM} is required. 
     
    12781266 
    12791267\begin{description} 
    1280    \item[\np{ln\_glo\_trd}]: at each \np{nn\_trd} time-step a check of the basin averaged properties of  
    1281                               the momentum and tracer equations is performed. 
    1282                               This also includes a check of $T^2$, $S^2$, $\tfrac{1}{2} (u^2+v2)$, and  
    1283                               potential energy time evolution equations properties; 
    1284    \item[\np{ln\_dyn\_trd}]: each 3D trend of the evolution of the two momentum components is output; 
    1285    \item[\np{ln\_dyn\_mxl}]: each 3D trend of the evolution of the two momentum components averaged over  
    1286                               the mixed layer is output; 
    1287    \item[\np{ln\_vor\_trd}]: a vertical summation of the moment tendencies is performed, then  
    1288                               the curl is computed to obtain the barotropic vorticity tendencies which  
    1289                               are output; 
    1290    \item[\np{ln\_KE\_trd}] : each 3D trend of the Kinetic Energy equation is output ; 
    1291    \item[\np{ln\_tra\_trd}]: each 3D trend of the evolution of temperature and salinity is output ; 
    1292    \item[\np{ln\_tra\_mxl}]: each 2D trend of the evolution of temperature and salinity averaged over  
    1293                               the mixed layer is output; 
     1268\item[\np{ln\_glo\_trd}]: 
     1269  at each \np{nn\_trd} time-step a check of the basin averaged properties of 
     1270  the momentum and tracer equations is performed. 
     1271  This also includes a check of $T^2$, $S^2$, $\tfrac{1}{2} (u^2+v2)$, 
     1272  and potential energy time evolution equations properties; 
     1273\item[\np{ln\_dyn\_trd}]: 
     1274  each 3D trend of the evolution of the two momentum components is output; 
     1275\item[\np{ln\_dyn\_mxl}]: 
     1276  each 3D trend of the evolution of the two momentum components averaged over the mixed layer is output; 
     1277\item[\np{ln\_vor\_trd}]: 
     1278  a vertical summation of the moment tendencies is performed, 
     1279  then the curl is computed to obtain the barotropic vorticity tendencies which are output; 
     1280\item[\np{ln\_KE\_trd}] : 
     1281  each 3D trend of the Kinetic Energy equation is output; 
     1282\item[\np{ln\_tra\_trd}]: 
     1283  each 3D trend of the evolution of temperature and salinity is output; 
     1284\item[\np{ln\_tra\_mxl}]: 
     1285  each 2D trend of the evolution of temperature and salinity averaged over the mixed layer is output; 
    12941286\end{description} 
    12951287 
     
    12981290 
    12991291\textbf{Note that} in the current version (v3.6), many changes has been introduced but not fully tested. 
    1300 In particular, options associated with \np{ln\_dyn\_mxl}, \np{ln\_vor\_trd}, and \np{ln\_tra\_mxl} are  
    1301 not working, and none of the options have been tested with variable volume ($i.e.$ \key{vvl} defined). 
     1292In particular, options associated with \np{ln\_dyn\_mxl}, \np{ln\_vor\_trd}, and \np{ln\_tra\_mxl} are not working, 
     1293and none of the options have been tested with variable volume ($i.e.$ \key{vvl} defined). 
    13021294 
    13031295% ------------------------------------------------------------------------------------------------------------- 
     
    13111303%-------------------------------------------------------------------------------------------------------------- 
    13121304 
    1313 The on-line computation of floats advected either by the three dimensional velocity field or  
    1314 constraint to remain at a given depth ($w = 0$ in the computation) have been introduced in  
    1315 the system during the CLIPPER project. 
     1305The on-line computation of floats advected either by the three dimensional velocity field or constraint to 
     1306remain at a given depth ($w = 0$ in the computation) have been introduced in the system during the CLIPPER project. 
    13161307Options are defined by \ngn{namflo} namelis variables. 
    1317 The algorithm used is based either on the work of \cite{Blanke_Raynaud_JPO97} (default option), or  
    1318 on a $4^th$ Runge-Hutta algorithm (\np{ln\_flork4}\forcode{ = .true.}). 
    1319 Note that the \cite{Blanke_Raynaud_JPO97} algorithm have the advantage of providing trajectories which  
     1308The algorithm used is based either on the work of \cite{Blanke_Raynaud_JPO97} (default option), 
     1309or on a $4^th$ Runge-Hutta algorithm (\np{ln\_flork4}\forcode{ = .true.}). 
     1310Note that the \cite{Blanke_Raynaud_JPO97} algorithm have the advantage of providing trajectories which 
    13201311are consistent with the numeric of the code, so that the trajectories never intercept the bathymetry. 
    13211312 
    13221313\subsubsection{Input data: initial coordinates} 
    13231314 
    1324 Initial coordinates can be given with Ariane Tools convention (IJK coordinates, 
    1325 (\np{ln\_ariane}\forcode{ = .true.}) ) or with longitude and latitude. 
     1315Initial coordinates can be given with Ariane Tools convention 
     1316(IJK coordinates, (\np{ln\_ariane}\forcode{ = .true.}) ) or with longitude and latitude. 
    13261317 
    13271318In case of Ariane convention, input filename is \np{init\_float\_ariane}. 
     
    13681359 
    13691360\np{jpnfl} is the total number of floats during the run. 
    1370 When initial positions are read in a restart file (\np{ln\_rstflo}\forcode{ = .true.} ),  
     1361When initial positions are read in a restart file (\np{ln\_rstflo}\forcode{ = .true.} ), 
    13711362\np{jpnflnewflo} can be added in the initialization file. 
    13721363 
    13731364\subsubsection{Output data} 
    13741365 
    1375 \np{nn\_writefl} is the frequency of writing in float output file and \np{nn\_stockfl} is  
    1376 the frequency of creation of the float restart file. 
     1366\np{nn\_writefl} is the frequency of writing in float output file and \np{nn\_stockfl} is the frequency of 
     1367creation of the float restart file. 
    13771368 
    13781369Output data can be written in ascii files (\np{ln\_flo\_ascii}\forcode{ = .true.}). 
     
    13821373There are 2 possibilities: 
    13831374 
    1384  - if (\key{iomput}) is used, outputs are selected in  iodef.xml. 
    1385    Here it is an example of specification to put in files description section: 
     1375- if (\key{iomput}) is used, outputs are selected in  iodef.xml. 
     1376Here it is an example of specification to put in files description section: 
    13861377 
    13871378\begin{xmllines} 
     
    14011392 -  if (\key{iomput}) is not used, a file called \ifile{trajec\_float} will be created by IOIPSL library. 
    14021393 
    1403 See also \href{http://stockage.univ-brest.fr/~grima/Ariane/}{here} the web site describing  
    1404 the off-line use of this marvellous diagnostic tool. 
     1394 See also \href{http://stockage.univ-brest.fr/~grima/Ariane/}{here} the web site describing the off-line use of 
     1395 this marvellous diagnostic tool. 
    14051396 
    14061397% ------------------------------------------------------------------------------------------------------------- 
     
    14181409This on-line Harmonic analysis is actived with \key{diaharm}. 
    14191410 
    1420 Some parameters are available in namelist \ngn{namdia\_harm} : 
     1411Some parameters are available in namelist \ngn{namdia\_harm}: 
    14211412 
    14221413 - \np{nit000\_han} is the first time step used for harmonic analysis 
     
    14301421 - \np{tname}       is an array with names of tidal constituents to analyse 
    14311422 
    1432 \np{nit000\_han} and \np{nitend\_han} must be between \np{nit000} and \np{nitend} of the simulation. 
    1433 The restart capability is not implemented. 
    1434  
    1435 The Harmonic analysis solve the following equation: 
     1423 \np{nit000\_han} and \np{nitend\_han} must be between \np{nit000} and \np{nitend} of the simulation. 
     1424 The restart capability is not implemented. 
     1425 
     1426 The Harmonic analysis solve the following equation: 
    14361427 
    14371428\[h_{i} - A_{0} + \sum^{nb\_ana}_{j=1}[A_{j}cos(\nu_{j}t_{j}-\phi_{j})] = e_{i}\] 
    14381429 
    1439 With $A_{j}$, $\nu_{j}$, $\phi_{j}$, the amplitude, frequency and phase for each wave and  
    1440 $e_{i}$ the error. 
     1430With $A_{j}$, $\nu_{j}$, $\phi_{j}$, the amplitude, frequency and phase for each wave and $e_{i}$ the error. 
    14411431$h_{i}$ is the sea level for the time $t_{i}$ and $A_{0}$ is the mean sea level. \\ 
    14421432We can rewrite this equation: 
     
    14591449%------------------------------------------------------------------------------------------------------------- 
    14601450 
    1461 A module is available to compute the transport of volume, heat and salt through sections.  
     1451A module is available to compute the transport of volume, heat and salt through sections. 
    14621452This diagnostic is actived with \key{diadct}. 
    14631453 
    14641454Each section is defined by the coordinates of its 2 extremities. 
    1465 The pathways between them are contructed using tools which can be found in  
    1466 \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT}  
    1467 and are written in a binary file  
    1468 \texttt{section\_ijglobal.diadct\_ORCA2\_LIM}  
    1469 which is later read in by NEMO to compute on-line transports. 
     1455The pathways between them are contructed using tools which can be found in \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT} 
     1456and are written in a binary file \texttt{section\_ijglobal.diadct\_ORCA2\_LIM} which is later read in by 
     1457NEMO to compute on-line transports. 
    14701458 
    14711459The on-line transports module creates three output ascii files: 
     
    14771465- \texttt{salt\_transport}   for   salt transports (unit: $10^{9}Kg s^{-1}$) \\ 
    14781466 
    1479 Namelist variables in \ngn{namdct} control how frequently the flows are summed and the time scales over  
    1480 which they are averaged, as well as the level of output for debugging: 
     1467Namelist variables in \ngn{namdct} control how frequently the flows are summed and the time scales over which 
     1468they are averaged, as well as the level of output for debugging: 
    14811469\np{nn\_dct}   : frequency of instantaneous transports computing 
    14821470\np{nn\_dctwri}: frequency of writing ( mean of instantaneous transports ) 
     
    14851473\subsubsection{Creating a binary file containing the pathway of each section} 
    14861474 
    1487 In \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT/run},  
    1488 the file \textit{ {list\_sections.ascii\_global}} contains a list of all the sections that are to  
    1489 be computed (this list of sections is based on MERSEA project metrics). 
     1475In \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT/run}, 
     1476the file \textit{ {list\_sections.ascii\_global}} contains a list of all the sections that are to be computed 
     1477(this list of sections is based on MERSEA project metrics). 
    14901478 
    14911479Another file is available for the GYRE configuration (\texttt{ {list\_sections.ascii\_GYRE}}). 
     
    15051493 - \texttt{ice}       to compute surface and volume ice transports, \texttt{noice}     if no. \\ 
    15061494 
    1507 \noindent The results of the computing of transports, and the dire