New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 11577 for NEMO/trunk/doc/latex/NEMO/subfiles/chap_ZDF.tex – NEMO

Ignore:
Timestamp:
2019-09-19T19:01:38+02:00 (5 years ago)
Author:
nicolasmartin
Message:

New LaTeX commands \nam and \np to mention namelist content
(Partial commit to serve as a backup before other large edits)
In order to benefit of the syntax highlighting and to have a simpler syntax for
citing namelist block (\nam) and parameter (\np) with an optional variable assignment (\forcode{...}),
at this time the only viable solution I found is to require a double marker for
what it looks like the same item:

  1. Marker with the real name: 'tra_adv' block or 'ln_flx' parameter
  2. Marker with underscore character escaping: 'tra\_adv' block or 'ln\_flx' parameter

Despite many searches and attempts, I did not find a workaround to edit on-the-fly one or
the other marker.
In fact, the problem is on one side that the LaTeX index interprets '_' as a switch for lowering like
in math mode while on the other hand the backslash is considered for Pygments as a typo in Fortran
(red box).

For instance, \nam and \np have as of now the aforementioned 2 mandatory arguments in
the previous order (between braces) + an optional argument for \np when the parameter is defined
(between brackets at the first position):

  • \nam: LaTeX code in the \nam{tra_adv}{tra\_adv} -> PDF ' in the &namtra_adv (namelist X.X) ' with syntax highlighting, the hyperlink and the index entry
  • \np: LaTeX code \np[=.true.]{ln_flx}{ln\_flx} -> PDF ln_flux=.true. with syntax highlighting for the whole string and the entry in the 'parameters' index
File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/latex/NEMO/subfiles/chap_ZDF.tex

    r11571 r11577  
    2828At the surface they are prescribed from the surface forcing (see \autoref{chap:SBC}), 
    2929while at the bottom they are set to zero for heat and salt, 
    30 unless a geothermal flux forcing is prescribed as a bottom boundary condition (\ie\ \np{ln\_trabbc} defined, 
     30unless a geothermal flux forcing is prescribed as a bottom boundary condition (\ie\ \np{ln_trabbc}{ln\_trabbc} defined, 
    3131see \autoref{subsec:TRA_bbc}), and specified through a bottom friction parameterisation for momentum 
    3232(see \autoref{sec:ZDF_drg}). 
     
    4242are computed and added to the general trend in the \mdl{dynzdf} and \mdl{trazdf} modules, respectively. 
    4343%These trends can be computed using either a forward time stepping scheme 
    44 %(namelist parameter \np{ln\_zdfexp}\forcode{=.true.}) or a backward time stepping scheme 
    45 %(\np{ln\_zdfexp}\forcode{=.false.}) depending on the magnitude of the mixing coefficients, 
     44%(namelist parameter \np{ln_zdfexp}{ln\_zdfexp}\forcode{=.true.}) or a backward time stepping scheme 
     45%(\np{ln_zdfexp}{ln\_zdfexp}\forcode{=.false.}) depending on the magnitude of the mixing coefficients, 
    4646%and thus of the formulation used (see \autoref{chap:TD}). 
    4747 
     
    5858%        Constant 
    5959% ------------------------------------------------------------------------------------------------------------- 
    60 \subsection[Constant (\forcode{ln_zdfcst})]{Constant (\protect\np{ln\_zdfcst})} 
     60\subsection[Constant (\forcode{ln_zdfcst})]{Constant (\protect\np{ln_zdfcst}{ln\_zdfcst})} 
    6161\label{subsec:ZDF_cst} 
    6262 
    6363Options are defined through the \nam{zdf} namelist variables. 
    64 When \np{ln\_zdfcst} is defined, the momentum and tracer vertical eddy coefficients are set to 
     64When \np{ln_zdfcst}{ln\_zdfcst} is defined, the momentum and tracer vertical eddy coefficients are set to 
    6565constant values over the whole ocean. 
    6666This is the crudest way to define the vertical ocean physics. 
     
    7272\end{align*} 
    7373 
    74 These values are set through the \np{rn\_avm0} and \np{rn\_avt0} namelist parameters. 
     74These values are set through the \np{rn_avm0}{rn\_avm0} and \np{rn_avt0}{rn\_avt0} namelist parameters. 
    7575In all cases, do not use values smaller that those associated with the molecular viscosity and diffusivity, 
    7676that is $\sim10^{-6}~m^2.s^{-1}$ for momentum, $\sim10^{-7}~m^2.s^{-1}$ for temperature and 
     
    8080%        Richardson Number Dependent 
    8181% ------------------------------------------------------------------------------------------------------------- 
    82 \subsection[Richardson number dependent (\forcode{ln_zdfric})]{Richardson number dependent (\protect\np{ln\_zdfric})} 
     82\subsection[Richardson number dependent (\forcode{ln_zdfric})]{Richardson number dependent (\protect\np{ln_zdfric}{ln\_zdfric})} 
    8383\label{subsec:ZDF_ric} 
    8484 
     
    9292%-------------------------------------------------------------------------------------------------------------- 
    9393 
    94 When \np{ln\_zdfric}\forcode{=.true.}, a local Richardson number dependent formulation for the vertical momentum and 
    95 tracer eddy coefficients is set through the \nam{zdf\_ric} namelist variables. 
     94When \np{ln_zdfric}{ln\_zdfric}\forcode{=.true.}, a local Richardson number dependent formulation for the vertical momentum and 
     95tracer eddy coefficients is set through the \nam{zdf_ric}{zdf\_ric} namelist variables. 
    9696The vertical mixing coefficients are diagnosed from the large scale variables computed by the model. 
    9797\textit{In situ} measurements have been used to link vertical turbulent activity to large scale ocean structures. 
     
    114114(see \autoref{subsec:ZDF_cst}), and $A_{ric}^{vT} = 10^{-4}~m^2.s^{-1}$ is the maximum value that 
    115115can be reached by the coefficient when $Ri\leq 0$, $a=5$ and $n=2$. 
    116 The last three values can be modified by setting the \np{rn\_avmri}, \np{rn\_alp} and 
    117 \np{nn\_ric} namelist parameters, respectively. 
     116The last three values can be modified by setting the \np{rn_avmri}{rn\_avmri}, \np{rn_alp}{rn\_alp} and 
     117\np{nn_ric}{nn\_ric} namelist parameters, respectively. 
    118118 
    119119A simple mixing-layer model to transfer and dissipate the atmospheric forcings 
    120 (wind-stress and buoyancy fluxes) can be activated setting the \np{ln\_mldw}\forcode{=.true.} in the namelist. 
     120(wind-stress and buoyancy fluxes) can be activated setting the \np{ln_mldw}{ln\_mldw}\forcode{=.true.} in the namelist. 
    121121 
    122122In this case, the local depth of turbulent wind-mixing or "Ekman depth" $h_{e}(x,y,t)$ is evaluated and 
     
    134134\] 
    135135is computed from the wind stress vector $|\tau|$ and the reference density $ \rho_o$. 
    136 The final $h_{e}$ is further constrained by the adjustable bounds \np{rn\_mldmin} and \np{rn\_mldmax}. 
     136The final $h_{e}$ is further constrained by the adjustable bounds \np{rn_mldmin}{rn\_mldmin} and \np{rn_mldmax}{rn\_mldmax}. 
    137137Once $h_{e}$ is computed, the vertical eddy coefficients within $h_{e}$ are set to 
    138 the empirical values \np{rn\_wtmix} and \np{rn\_wvmix} \citep{lermusiaux_JMS01}. 
     138the empirical values \np{rn_wtmix}{rn\_wtmix} and \np{rn_wvmix}{rn\_wvmix} \citep{lermusiaux_JMS01}. 
    139139 
    140140% ------------------------------------------------------------------------------------------------------------- 
    141141%        TKE Turbulent Closure Scheme 
    142142% ------------------------------------------------------------------------------------------------------------- 
    143 \subsection[TKE turbulent closure scheme (\forcode{ln_zdftke})]{TKE turbulent closure scheme (\protect\np{ln\_zdftke})} 
     143\subsection[TKE turbulent closure scheme (\forcode{ln_zdftke})]{TKE turbulent closure scheme (\protect\np{ln_zdftke}{ln\_zdftke})} 
    144144\label{subsec:ZDF_tke} 
    145145%--------------------------------------------namzdf_tke-------------------------------------------------- 
     
    184184The constants $C_k =  0.1$ and $C_\epsilon = \sqrt {2} /2$ $\approx 0.7$ are designed to deal with 
    185185vertical mixing at any depth \citep{gaspar.gregoris.ea_JGR90}. 
    186 They are set through namelist parameters \np{nn\_ediff} and \np{nn\_ediss}. 
     186They are set through namelist parameters \np{nn_ediff}{nn\_ediff} and \np{nn_ediss}{nn\_ediss}. 
    187187$P_{rt}$ can be set to unity or, following \citet{blanke.delecluse_JPO93}, be a function of the local Richardson number, $R_i$: 
    188188\begin{align*} 
     
    195195  \end{cases} 
    196196\end{align*} 
    197 The choice of $P_{rt}$ is controlled by the \np{nn\_pdl} namelist variable. 
     197The choice of $P_{rt}$ is controlled by the \np{nn_pdl}{nn\_pdl} namelist variable. 
    198198 
    199199At the sea surface, the value of $\bar{e}$ is prescribed from the wind stress field as 
    200 $\bar{e}_o = e_{bb} |\tau| / \rho_o$, with $e_{bb}$ the \np{rn\_ebb} namelist parameter. 
     200$\bar{e}_o = e_{bb} |\tau| / \rho_o$, with $e_{bb}$ the \np{rn_ebb}{rn\_ebb} namelist parameter. 
    201201The default value of $e_{bb}$ is 3.75. \citep{gaspar.gregoris.ea_JGR90}), however a much larger value can be used when 
    202202taking into account the surface wave breaking (see below Eq. \autoref{eq:ZDF_Esbc}). 
     
    204204The time integration of the $\bar{e}$ equation may formally lead to negative values because 
    205205the numerical scheme does not ensure its positivity. 
    206 To overcome this problem, a cut-off in the minimum value of $\bar{e}$ is used (\np{rn\_emin} namelist parameter). 
     206To overcome this problem, a cut-off in the minimum value of $\bar{e}$ is used (\np{rn_emin}{rn\_emin} namelist parameter). 
    207207Following \citet{gaspar.gregoris.ea_JGR90}, the cut-off value is set to $\sqrt{2}/2~10^{-6}~m^2.s^{-2}$. 
    208208This allows the subsequent formulations to match that of \citet{gargett_JMR84} for the diffusion in 
     
    210210In addition, a cut-off is applied on $K_m$ and $K_\rho$ to avoid numerical instabilities associated with 
    211211too weak vertical diffusion. 
    212 They must be specified at least larger than the molecular values, and are set through \np{rn\_avm0} and 
    213 \np{rn\_avt0} (\nam{zdf} namelist, see \autoref{subsec:ZDF_cst}). 
     212They must be specified at least larger than the molecular values, and are set through \np{rn_avm0}{rn\_avm0} and 
     213\np{rn_avt0}{rn\_avt0} (\nam{zdf} namelist, see \autoref{subsec:ZDF_cst}). 
    214214 
    215215\subsubsection{Turbulent length scale} 
     
    217217For computational efficiency, the original formulation of the turbulent length scales proposed by 
    218218\citet{gaspar.gregoris.ea_JGR90} has been simplified. 
    219 Four formulations are proposed, the choice of which is controlled by the \np{nn\_mxl} namelist parameter. 
     219Four formulations are proposed, the choice of which is controlled by the \np{nn_mxl}{nn\_mxl} namelist parameter. 
    220220The first two are based on the following first order approximation \citep{blanke.delecluse_JPO93}: 
    221221\begin{equation} 
     
    225225which is valid in a stable stratified region with constant values of the Brunt-Vais\"{a}l\"{a} frequency. 
    226226The resulting length scale is bounded by the distance to the surface or to the bottom 
    227 (\np{nn\_mxl}\forcode{=0}) or by the local vertical scale factor (\np{nn\_mxl}\forcode{=1}). 
     227(\np{nn_mxl}{nn\_mxl}\forcode{=0}) or by the local vertical scale factor (\np{nn\_mxl}\forcode{=1}). 
    228228\citet{blanke.delecluse_JPO93} notice that this simplification has two major drawbacks: 
    229229it makes no sense for locally unstable stratification and the computation no longer uses all 
    230230the information contained in the vertical density profile. 
    231 To overcome these drawbacks, \citet{madec.delecluse.ea_NPM98} introduces the \np{nn\_mxl}\forcode{=2, 3} cases, 
     231To overcome these drawbacks, \citet{madec.delecluse.ea_NPM98} introduces the \np{nn_mxl}{nn\_mxl}\forcode{=2, 3} cases, 
    232232which add an extra assumption concerning the vertical gradient of the computed length scale. 
    233233So, the length scales are first evaluated as in \autoref{eq:ZDF_tke_mxl0_1} and then bounded such that: 
     
    267267where $l^{(k)}$ is computed using \autoref{eq:ZDF_tke_mxl0_1}, \ie\ $l^{(k)} = \sqrt {2 {\bar e}^{(k)} / {N^2}^{(k)} }$. 
    268268 
    269 In the \np{nn\_mxl}\forcode{=2} case, the dissipation and mixing length scales take the same value: 
    270 $ l_k=  l_\epsilon = \min \left(\ l_{up} \;,\;  l_{dwn}\ \right)$, while in the \np{nn\_mxl}\forcode{=3} case, 
     269In the \np{nn_mxl}{nn\_mxl}\forcode{=2} case, the dissipation and mixing length scales take the same value: 
     270$ l_k=  l_\epsilon = \min \left(\ l_{up} \;,\;  l_{dwn}\ \right)$, while in the \np{nn_mxl}{nn\_mxl}\forcode{=3} case, 
    271271the dissipation and mixing turbulent length scales are give as in \citet{gaspar.gregoris.ea_JGR90}: 
    272272\[ 
     
    278278\] 
    279279 
    280 At the ocean surface, a non zero length scale is set through the  \np{rn\_mxl0} namelist parameter. 
     280At the ocean surface, a non zero length scale is set through the  \np{rn_mxl0}{rn\_mxl0} namelist parameter. 
    281281Usually the surface scale is given by $l_o = \kappa \,z_o$ where $\kappa = 0.4$ is von Karman's constant and 
    282282$z_o$ the roughness parameter of the surface. 
    283 Assuming $z_o=0.1$~m \citep{craig.banner_JPO94} leads to a 0.04~m, the default value of \np{rn\_mxl0}. 
     283Assuming $z_o=0.1$~m \citep{craig.banner_JPO94} leads to a 0.04~m, the default value of \np{rn_mxl0}{rn\_mxl0}. 
    284284In the ocean interior a minimum length scale is set to recover the molecular viscosity when 
    285285$\bar{e}$ reach its minimum value ($1.10^{-6}= C_k\, l_{min} \,\sqrt{\bar{e}_{min}}$ ). 
     
    312312$\alpha_{CB} = 100$ the Craig and Banner's value. 
    313313As the surface boundary condition on TKE is prescribed through $\bar{e}_o = e_{bb} |\tau| / \rho_o$, 
    314 with $e_{bb}$ the \np{rn\_ebb} namelist parameter, setting \np{rn\_ebb}\forcode{ = 67.83} corresponds 
     314with $e_{bb}$ the \np{rn_ebb}{rn\_ebb} namelist parameter, setting \np{rn\_ebb}\forcode{ = 67.83} corresponds 
    315315to $\alpha_{CB} = 100$. 
    316 Further setting  \np{ln\_mxl0}\forcode{ =.true.},  applies \autoref{eq:ZDF_Lsbc} as the surface boundary condition on the length scale, 
     316Further setting  \np{ln_mxl0}{ln\_mxl0}\forcode{ =.true.},  applies \autoref{eq:ZDF_Lsbc} as the surface boundary condition on the length scale, 
    317317with $\beta$ hard coded to the Stacey's value. 
    318 Note that a minimal threshold of \np{rn\_emin0}$=10^{-4}~m^2.s^{-2}$ (namelist parameters) is applied on the 
     318Note that a minimal threshold of \np{rn_emin0}{rn\_emin0}$=10^{-4}~m^2.s^{-2}$ (namelist parameters) is applied on the 
    319319surface $\bar{e}$ value. 
    320320 
     
    334334The parameterization, tuned against large-eddy simulation, includes the whole effect of LC in 
    335335an extra source term of TKE, $P_{LC}$. 
    336 The presence of $P_{LC}$ in \autoref{eq:ZDF_tke_e}, the TKE equation, is controlled by setting \np{ln\_lc} to 
    337 \forcode{.true.} in the \nam{zdf\_tke} namelist. 
     336The presence of $P_{LC}$ in \autoref{eq:ZDF_tke_e}, the TKE equation, is controlled by setting \np{ln_lc}{ln\_lc} to 
     337\forcode{.true.} in the \nam{zdf_tke}{zdf\_tke} namelist. 
    338338 
    339339By making an analogy with the characteristic convective velocity scale (\eg, \citet{dalessio.abdella.ea_JPO98}), 
     
    363363where $c_{LC} = 0.15$ has been chosen by \citep{axell_JGR02} as a good compromise to fit LES data. 
    364364The chosen value yields maximum vertical velocities $w_{LC}$ of the order of a few centimeters per second. 
    365 The value of $c_{LC}$ is set through the \np{rn\_lc} namelist parameter, 
     365The value of $c_{LC}$ is set through the \np{rn_lc}{rn\_lc} namelist parameter, 
    366366having in mind that it should stay between 0.15 and 0.54 \citep{axell_JGR02}. 
    367367 
     
    385385(\ie\ near-inertial oscillations and ocean swells and waves). 
    386386 
    387 When using this parameterization (\ie\ when \np{nn\_etau}\forcode{=1}), 
     387When using this parameterization (\ie\ when \np{nn_etau}{nn\_etau}\forcode{=1}), 
    388388the TKE input to the ocean ($S$) imposed by the winds in the form of near-inertial oscillations, 
    389389swell and waves is parameterized by \autoref{eq:ZDF_Esbc} the standard TKE surface boundary condition, 
     
    397397the penetration, and $f_i$ is the ice concentration 
    398398(no penetration if $f_i=1$, \ie\ if the ocean is entirely covered by sea-ice). 
    399 The value of $f_r$, usually a few percents, is specified through \np{rn\_efr} namelist parameter. 
    400 The vertical mixing length scale, $h_\tau$, can be set as a 10~m uniform value (\np{nn\_etau}\forcode{=0}) or 
     399The value of $f_r$, usually a few percents, is specified through \np{rn_efr}{rn\_efr} namelist parameter. 
     400The vertical mixing length scale, $h_\tau$, can be set as a 10~m uniform value (\np{nn_etau}{nn\_etau}\forcode{=0}) or 
    401401a latitude dependent value (varying from 0.5~m at the Equator to a maximum value of 30~m at high latitudes 
    402 (\np{nn\_etau}\forcode{=1}). 
    403  
    404 Note that two other option exist, \np{nn\_etau}\forcode{=2, 3}. 
     402(\np{nn_etau}{nn\_etau}\forcode{=1}). 
     403 
     404Note that two other option exist, \np{nn_etau}{nn\_etau}\forcode{=2, 3}. 
    405405They correspond to applying \autoref{eq:ZDF_Ehtau} only at the base of the mixed layer, 
    406406or to using the high frequency part of the stress to evaluate the fraction of TKE that penetrates the ocean. 
     
    409409 
    410410% This should be explain better below what this rn_eice parameter is meant for: 
    411 In presence of Sea Ice, the value of this mixing can be modulated by the \np{rn\_eice} namelist parameter. 
     411In presence of Sea Ice, the value of this mixing can be modulated by the \np{rn_eice}{rn\_eice} namelist parameter. 
    412412This parameter varies from \forcode{0} for no effect to \forcode{4} to suppress the TKE input into the ocean when Sea Ice concentration 
    413413is greater than 25\%. 
     
    424424%        GLS Generic Length Scale Scheme 
    425425% ------------------------------------------------------------------------------------------------------------- 
    426 \subsection[GLS: Generic Length Scale (\forcode{ln_zdfgls})]{GLS: Generic Length Scale (\protect\np{ln\_zdfgls})} 
     426\subsection[GLS: Generic Length Scale (\forcode{ln_zdfgls})]{GLS: Generic Length Scale (\protect\np{ln_zdfgls}{ln\_zdfgls})} 
    427427\label{subsec:ZDF_gls} 
    428428 
     
    483483the choice of the turbulence model. 
    484484Four different turbulent models are pre-defined (\autoref{tab:ZDF_GLS}). 
    485 They are made available through the \np{nn\_clo} namelist parameter. 
     485They are made available through the \np{nn_clo}{nn\_clo} namelist parameter. 
    486486 
    487487%--------------------------------------------------TABLE-------------------------------------------------- 
     
    494494    \hline 
    495495    \hline 
    496     \np{nn\_clo}     & \textbf{0} &   \textbf{1}  &   \textbf{2}   &    \textbf{3}   \\ 
     496    \np{nn_clo}{nn\_clo}     & \textbf{0} &   \textbf{1}  &   \textbf{2}   &    \textbf{3}   \\ 
    497497    \hline 
    498498    $( p , n , m )$         &   ( 0 , 1 , 1 )   & ( 3 , 1.5 , -1 )   & ( -1 , 0.5 , -1 )    &  ( 2 , 1 , -0.67 )  \\ 
     
    508508  \caption[Set of predefined GLS parameters or equivalently predefined turbulence models available]{ 
    509509    Set of predefined GLS parameters, or equivalently predefined turbulence models available with 
    510     \protect\np{ln\_zdfgls}\forcode{=.true.} and controlled by 
    511     the \protect\np{nn\_clos} namelist variable in \protect\nam{zdf\_gls}.} 
     510    \protect\np{ln_zdfgls}{ln\_zdfgls}\forcode{=.true.} and controlled by 
     511    the \protect\np{nn_clos}{nn\_clos} namelist variable in \protect\nam{zdf_gls}{zdf\_gls}.} 
    512512  \label{tab:ZDF_GLS} 
    513513\end{table} 
     
    519519$C_{\mu}$ and $C_{\mu'}$ are calculated from stability function proposed by \citet{galperin.kantha.ea_JAS88}, 
    520520or by \citet{kantha.clayson_JGR94} or one of the two functions suggested by \citet{canuto.howard.ea_JPO01} 
    521 (\np{nn\_stab\_func}\forcode{=0, 3}, resp.). 
     521(\np{nn_stab_func}{nn\_stab\_func}\forcode{=0, 3}, resp.). 
    522522The value of $C_{0\mu}$ depends on the choice of the stability function. 
    523523 
    524524The surface and bottom boundary condition on both $\bar{e}$ and $\psi$ can be calculated thanks to Dirichlet or 
    525 Neumann condition through \np{nn\_bc\_surf} and \np{nn\_bc\_bot}, resp. 
     525Neumann condition through \np{nn_bc_surf}{nn\_bc\_surf} and \np{nn_bc_bot}{nn\_bc\_bot}, resp. 
    526526As for TKE closure, the wave effect on the mixing is considered when 
    527 \np{rn\_crban}\forcode{ > 0.} \citep{craig.banner_JPO94, mellor.blumberg_JPO04}. 
    528 The \np{rn\_crban} namelist parameter is $\alpha_{CB}$ in \autoref{eq:ZDF_Esbc} and 
    529 \np{rn\_charn} provides the value of $\beta$ in \autoref{eq:ZDF_Lsbc}. 
     527\np{rn_crban}{rn\_crban}\forcode{ > 0.} \citep{craig.banner_JPO94, mellor.blumberg_JPO04}. 
     528The \np{rn_crban}{rn\_crban} namelist parameter is $\alpha_{CB}$ in \autoref{eq:ZDF_Esbc} and 
     529\np{rn_charn}{rn\_charn} provides the value of $\beta$ in \autoref{eq:ZDF_Lsbc}. 
    530530 
    531531The $\psi$ equation is known to fail in stably stratified flows, and for this reason 
     
    536536the entrainment depth predicted in stably stratified situations, 
    537537and that its value has to be chosen in accordance with the algebraic model for the turbulent fluxes. 
    538 The clipping is only activated if \np{ln\_length\_lim}\forcode{=.true.}, 
    539 and the $c_{lim}$ is set to the \np{rn\_clim\_galp} value. 
     538The clipping is only activated if \np{ln_length_lim}{ln\_length\_lim}\forcode{=.true.}, 
     539and the $c_{lim}$ is set to the \np{rn_clim_galp}{rn\_clim\_galp} value. 
    540540 
    541541The time and space discretization of the GLS equations follows the same energetic consideration as for 
     
    548548%        OSM OSMOSIS BL Scheme 
    549549% ------------------------------------------------------------------------------------------------------------- 
    550 \subsection[OSM: OSMosis boundary layer scheme (\forcode{ln_zdfosm})]{OSM: OSMosis boundary layer scheme (\protect\np{ln\_zdfosm})} 
     550\subsection[OSM: OSMosis boundary layer scheme (\forcode{ln_zdfosm})]{OSM: OSMosis boundary layer scheme (\protect\np{ln_zdfosm}{ln\_zdfosm})} 
    551551\label{subsec:ZDF_osm} 
    552552%--------------------------------------------namzdf_osm--------------------------------------------------------- 
     
    682682%       Non-Penetrative Convective Adjustment 
    683683% ------------------------------------------------------------------------------------------------------------- 
    684 \subsection[Non-penetrative convective adjustment (\forcode{ln_tranpc})]{Non-penetrative convective adjustment (\protect\np{ln\_tranpc})} 
     684\subsection[Non-penetrative convective adjustment (\forcode{ln_tranpc})]{Non-penetrative convective adjustment (\protect\np{ln_tranpc}{ln\_tranpc})} 
    685685\label{subsec:ZDF_npc} 
    686686 
     
    707707 
    708708Options are defined through the \nam{zdf} namelist variables. 
    709 The non-penetrative convective adjustment is used when \np{ln\_zdfnpc}\forcode{=.true.}. 
    710 It is applied at each \np{nn\_npc} time step and mixes downwards instantaneously the statically unstable portion of 
     709The non-penetrative convective adjustment is used when \np{ln_zdfnpc}{ln\_zdfnpc}\forcode{=.true.}. 
     710It is applied at each \np{nn_npc}{nn\_npc} time step and mixes downwards instantaneously the statically unstable portion of 
    711711the water column, but only until the density structure becomes neutrally stable 
    712712(\ie\ until the mixed portion of the water column has \textit{exactly} the density of the water just below) 
     
    747747%       Enhanced Vertical Diffusion 
    748748% ------------------------------------------------------------------------------------------------------------- 
    749 \subsection[Enhanced vertical diffusion (\forcode{ln_zdfevd})]{Enhanced vertical diffusion (\protect\np{ln\_zdfevd})} 
     749\subsection[Enhanced vertical diffusion (\forcode{ln_zdfevd})]{Enhanced vertical diffusion (\protect\np{ln_zdfevd}{ln\_zdfevd})} 
    750750\label{subsec:ZDF_evd} 
    751751 
    752752Options are defined through the  \nam{zdf} namelist variables. 
    753 The enhanced vertical diffusion parameterisation is used when \np{ln\_zdfevd}\forcode{=.true.}. 
     753The enhanced vertical diffusion parameterisation is used when \np{ln_zdfevd}{ln\_zdfevd}\forcode{=.true.}. 
    754754In this case, the vertical eddy mixing coefficients are assigned very large values 
    755755in regions where the stratification is unstable 
    756756(\ie\ when $N^2$ the Brunt-Vais\"{a}l\"{a} frequency is negative) \citep{lazar_phd97, lazar.madec.ea_JPO99}. 
    757 This is done either on tracers only (\np{nn\_evdm}\forcode{=0}) or 
    758 on both momentum and tracers (\np{nn\_evdm}\forcode{=1}). 
    759  
    760 In practice, where $N^2\leq 10^{-12}$, $A_T^{vT}$ and $A_T^{vS}$, and if \np{nn\_evdm}\forcode{=1}, 
     757This is done either on tracers only (\np{nn_evdm}{nn\_evdm}\forcode{=0}) or 
     758on both momentum and tracers (\np{nn_evdm}{nn\_evdm}\forcode{=1}). 
     759 
     760In practice, where $N^2\leq 10^{-12}$, $A_T^{vT}$ and $A_T^{vS}$, and if \np{nn_evdm}{nn\_evdm}\forcode{=1}, 
    761761the four neighbouring $A_u^{vm} \;\mbox{and}\;A_v^{vm}$ values also, are set equal to 
    762 the namelist parameter \np{rn\_avevd}. 
     762the namelist parameter \np{rn_avevd}{rn\_avevd}. 
    763763A typical value for $rn\_avevd$ is between 1 and $100~m^2.s^{-1}$. 
    764764This parameterisation of convective processes is less time consuming than 
     
    778778 
    779779The turbulent closure schemes presented in \autoref{subsec:ZDF_tke}, \autoref{subsec:ZDF_gls} and 
    780 \autoref{subsec:ZDF_osm} (\ie\ \np{ln\_zdftke} or \np{ln\_zdfgls} or \np{ln\_zdfosm} defined) deal, in theory, 
     780\autoref{subsec:ZDF_osm} (\ie\ \np{ln_zdftke}{ln\_zdftke} or \np{ln_zdfgls}{ln\_zdfgls} or \np{ln_zdfosm}{ln\_zdfosm} defined) deal, in theory, 
    781781with statically unstable density profiles. 
    782782In such a case, the term corresponding to the destruction of turbulent kinetic energy through stratification in 
     
    790790because the mixing length scale is bounded by the distance to the sea surface. 
    791791It can thus be useful to combine the enhanced vertical diffusion with the turbulent closure scheme, 
    792 \ie\ setting the \np{ln\_zdfnpc} namelist parameter to true and 
    793 defining the turbulent closure (\np{ln\_zdftke} or \np{ln\_zdfgls} = \forcode{.true.}) all together. 
     792\ie\ setting the \np{ln_zdfnpc}{ln\_zdfnpc} namelist parameter to true and 
     793defining the turbulent closure (\np{ln_zdftke}{ln\_zdftke} or \np{ln_zdfgls}{ln\_zdfgls} = \forcode{.true.}) all together. 
    794794 
    795795The OSMOSIS turbulent closure scheme already includes enhanced vertical diffusion in the case of convection, 
    796796%as governed by the variables $bvsqcon$ and $difcon$ found in \mdl{zdfkpp}, 
    797 therefore \np{ln\_zdfevd}\forcode{=.false.} should be used with the OSMOSIS scheme. 
     797therefore \np{ln_zdfevd}{ln\_zdfevd}\forcode{=.false.} should be used with the OSMOSIS scheme. 
    798798% gm%  + one word on non local flux with KPP scheme trakpp.F90 module... 
    799799 
     
    801801% Double Diffusion Mixing 
    802802% ================================================================ 
    803 \section[Double diffusion mixing (\forcode{ln_zdfddm})]{Double diffusion mixing (\protect\np{ln\_zdfddm})} 
     803\section[Double diffusion mixing (\forcode{ln_zdfddm})]{Double diffusion mixing (\protect\np{ln_zdfddm}{ln\_zdfddm})} 
    804804\label{subsec:ZDF_ddm} 
    805805 
     
    811811 
    812812This parameterisation has been introduced in \mdl{zdfddm} module and is controlled by the namelist parameter 
    813 \np{ln\_zdfddm} in \nam{zdf}. 
     813\np{ln_zdfddm}{ln\_zdfddm} in \nam{zdf}. 
    814814Double diffusion occurs when relatively warm, salty water overlies cooler, fresher water, or vice versa. 
    815815The former condition leads to salt fingering and the latter to diffusive convection. 
     
    976976%       Linear Bottom Friction 
    977977% ------------------------------------------------------------------------------------------------------------- 
    978 \subsection[Linear top/bottom friction (\forcode{ln_lin})]{Linear top/bottom friction (\protect\np{ln\_lin})} 
     978\subsection[Linear top/bottom friction (\forcode{ln_lin})]{Linear top/bottom friction (\protect\np{ln_lin}{ln\_lin})} 
    979979\label{subsec:ZDF_drg_linear} 
    980980 
     
    995995and assuming an ocean depth $H = 4000$~m, the resulting friction coefficient is $r = 4\;10^{-4}$~m\;s$^{-1}$. 
    996996This is the default value used in \NEMO. It corresponds to a decay time scale of 115~days. 
    997 It can be changed by specifying \np{rn\_Uc0} (namelist parameter). 
     997It can be changed by specifying \np{rn_Uc0}{rn\_Uc0} (namelist parameter). 
    998998 
    999999 For the linear friction case the drag coefficient used in the general expression \autoref{eq:ZDF_bfr_bdef} is: 
     
    10021002    c_b^T = - r 
    10031003\] 
    1004 When \np{ln\_lin} \forcode{= .true.}, the value of $r$ used is \np{rn\_Uc0}*\np{rn\_Cd0}. 
    1005 Setting \np{ln\_OFF} \forcode{= .true.} (and \forcode{ln_lin=.true.}) is equivalent to setting $r=0$ and leads to a free-slip boundary condition. 
     1004When \np{ln_lin}{ln\_lin} \forcode{= .true.}, the value of $r$ used is \np{rn_Uc0}{rn\_Uc0}*\np{rn_Cd0}{rn\_Cd0}. 
     1005Setting \np{ln_OFF}{ln\_OFF} \forcode{= .true.} (and \forcode{ln_lin=.true.}) is equivalent to setting $r=0$ and leads to a free-slip boundary condition. 
    10061006 
    10071007These values are assigned in \mdl{zdfdrg}. 
    10081008Note that there is support for local enhancement of these values via an externally defined 2D mask array 
    1009 (\np{ln\_boost}\forcode{=.true.}) given in the \ifile{bfr\_coef} input NetCDF file. 
     1009(\np{ln_boost}{ln\_boost}\forcode{=.true.}) given in the \ifile{bfr\_coef} input NetCDF file. 
    10101010The mask values should vary from 0 to 1. 
    10111011Locations with a non-zero mask value will have the friction coefficient increased by 
    1012 $mask\_value$ * \np{rn\_boost} * \np{rn\_Cd0}. 
     1012$mask\_value$ * \np{rn_boost}{rn\_boost} * \np{rn_Cd0}{rn\_Cd0}. 
    10131013 
    10141014% ------------------------------------------------------------------------------------------------------------- 
    10151015%       Non-Linear Bottom Friction 
    10161016% ------------------------------------------------------------------------------------------------------------- 
    1017 \subsection[Non-linear top/bottom friction (\forcode{ln_non_lin})]{Non-linear top/bottom friction (\protect\np{ln\_non\_lin})} 
     1017\subsection[Non-linear top/bottom friction (\forcode{ln_non_lin})]{Non-linear top/bottom friction (\protect\np{ln_non_lin}{ln\_non\_lin})} 
    10181018\label{subsec:ZDF_drg_nonlinear} 
    10191019 
     
    10301030$e_b = 2.5\;10^{-3}$m$^2$\;s$^{-2}$, while the FRAM experiment \citep{killworth_JPO92} uses $C_D = 1.4\;10^{-3}$ and 
    10311031$e_b =2.5\;\;10^{-3}$m$^2$\;s$^{-2}$. 
    1032 The CME choices have been set as default values (\np{rn\_Cd0} and \np{rn\_ke0} namelist parameters). 
     1032The CME choices have been set as default values (\np{rn_Cd0}{rn\_Cd0} and \np{rn_ke0}{rn\_ke0} namelist parameters). 
    10331033 
    10341034As for the linear case, the friction is imposed in the code by adding the trend due to 
     
    10411041 
    10421042The coefficients that control the strength of the non-linear friction are initialised as namelist parameters: 
    1043 $C_D$= \np{rn\_Cd0}, and $e_b$ =\np{rn\_bfeb2}. 
    1044 Note that for applications which consider tides explicitly, a low or even zero value of \np{rn\_bfeb2} is recommended. A local enhancement of $C_D$ is again possible via an externally defined 2D mask array 
    1045 (\np{ln\_boost}\forcode{=.true.}). 
     1043$C_D$= \np{rn_Cd0}{rn\_Cd0}, and $e_b$ =\np{rn_bfeb2}{rn\_bfeb2}. 
     1044Note that for applications which consider tides explicitly, a low or even zero value of \np{rn_bfeb2}{rn\_bfeb2} is recommended. A local enhancement of $C_D$ is again possible via an externally defined 2D mask array 
     1045(\np{ln_boost}{ln\_boost}\forcode{=.true.}). 
    10461046This works in the same way as for the linear friction case with non-zero masked locations increased by 
    1047 $mask\_value$ * \np{rn\_boost} * \np{rn\_Cd0}. 
     1047$mask\_value$ * \np{rn_boost}{rn\_boost} * \np{rn_Cd0}{rn\_Cd0}. 
    10481048 
    10491049% ------------------------------------------------------------------------------------------------------------- 
    10501050%       Bottom Friction Log-layer 
    10511051% ------------------------------------------------------------------------------------------------------------- 
    1052 \subsection[Log-layer top/bottom friction (\forcode{ln_loglayer})]{Log-layer top/bottom friction (\protect\np{ln\_loglayer})} 
     1052\subsection[Log-layer top/bottom friction (\forcode{ln_loglayer})]{Log-layer top/bottom friction (\protect\np{ln_loglayer}{ln\_loglayer})} 
    10531053\label{subsec:ZDF_drg_loglayer} 
    10541054 
    10551055In the non-linear friction case, the drag coefficient, $C_D$, can be optionally enhanced using 
    10561056a "law of the wall" scaling. This assumes that the model vertical resolution can capture the logarithmic layer which typically occur for layers thinner than 1 m or so. 
    1057 If  \np{ln\_loglayer} \forcode{= .true.}, $C_D$ is no longer constant but is related to the distance to the wall (or equivalently to the half of the top/bottom layer thickness): 
     1057If  \np{ln_loglayer}{ln\_loglayer} \forcode{= .true.}, $C_D$ is no longer constant but is related to the distance to the wall (or equivalently to the half of the top/bottom layer thickness): 
    10581058\[ 
    10591059  C_D = \left ( {\kappa \over {\mathrm log}\left ( 0.5 \; e_{3b} / rn\_{z0} \right ) } \right )^2 
    10601060\] 
    10611061 
    1062 \noindent where $\kappa$ is the von-Karman constant and \np{rn\_z0} is a roughness length provided via the namelist. 
     1062\noindent where $\kappa$ is the von-Karman constant and \np{rn_z0}{rn\_z0} is a roughness length provided via the namelist. 
    10631063 
    10641064The drag coefficient is bounded such that it is kept greater or equal to 
    1065 the base \np{rn\_Cd0} value which occurs where layer thicknesses become large and presumably logarithmic layers are not resolved at all. For stability reason, it is also not allowed to exceed the value of an additional namelist parameter: 
    1066 \np{rn\_Cdmax}, \ie 
     1065the base \np{rn_Cd0}{rn\_Cd0} value which occurs where layer thicknesses become large and presumably logarithmic layers are not resolved at all. For stability reason, it is also not allowed to exceed the value of an additional namelist parameter: 
     1066\np{rn_Cdmax}{rn\_Cdmax}, \ie 
    10671067\[ 
    10681068  rn\_Cd0 \leq C_D \leq rn\_Cdmax 
     
    10701070 
    10711071\noindent The log-layer enhancement can also be applied to the top boundary friction if 
    1072 under ice-shelf cavities are activated (\np{ln\_isfcav}\forcode{=.true.}). 
    1073 %In this case, the relevant namelist parameters are \np{rn\_tfrz0}, \np{rn\_tfri2} and \np{rn\_tfri2\_max}. 
     1072under ice-shelf cavities are activated (\np{ln_isfcav}{ln\_isfcav}\forcode{=.true.}). 
     1073%In this case, the relevant namelist parameters are \np{rn_tfrz0}{rn\_tfrz0}, \np{rn_tfri2}{rn\_tfri2} and \np{rn_tfri2_max}{rn\_tfri2\_max}. 
    10741074 
    10751075% ------------------------------------------------------------------------------------------------------------- 
    10761076%       Explicit bottom Friction 
    10771077% ------------------------------------------------------------------------------------------------------------- 
    1078 \subsection[Explicit top/bottom friction (\forcode{ln_drgimp=.false.})]{Explicit top/bottom friction (\protect\np{ln\_drgimp}\forcode{=.false.})} 
     1078\subsection[Explicit top/bottom friction (\forcode{ln_drgimp=.false.})]{Explicit top/bottom friction (\protect\np{ln_drgimp}{ln\_drgimp}\forcode{=.false.})} 
    10791079\label{subsec:ZDF_drg_stability} 
    10801080 
    1081 Setting \np{ln\_drgimp} \forcode{= .false.} means that bottom friction is treated explicitly in time, which has the advantage of simplifying the interaction with the split-explicit free surface (see \autoref{subsec:ZDF_drg_ts}). The latter does indeed require the knowledge of bottom stresses in the course of the barotropic sub-iteration, which becomes less straightforward in the implicit case. In the explicit case, top/bottom stresses can be computed using \textit{before} velocities and inserted in the overall momentum tendency budget. This reads: 
     1081Setting \np{ln_drgimp}{ln\_drgimp} \forcode{= .false.} means that bottom friction is treated explicitly in time, which has the advantage of simplifying the interaction with the split-explicit free surface (see \autoref{subsec:ZDF_drg_ts}). The latter does indeed require the knowledge of bottom stresses in the course of the barotropic sub-iteration, which becomes less straightforward in the implicit case. In the explicit case, top/bottom stresses can be computed using \textit{before} velocities and inserted in the overall momentum tendency budget. This reads: 
    10821082 
    10831083At the top (below an ice shelf cavity): 
     
    11371137%       Implicit Bottom Friction 
    11381138% ------------------------------------------------------------------------------------------------------------- 
    1139 \subsection[Implicit top/bottom friction (\forcode{ln_drgimp=.true.})]{Implicit top/bottom friction (\protect\np{ln\_drgimp}\forcode{=.true.})} 
     1139\subsection[Implicit top/bottom friction (\forcode{ln_drgimp=.true.})]{Implicit top/bottom friction (\protect\np{ln_drgimp}{ln\_drgimp}\forcode{=.true.})} 
    11401140\label{subsec:ZDF_drg_imp} 
    11411141 
    11421142An optional implicit form of bottom friction has been implemented to improve model stability. 
    11431143We recommend this option for shelf sea and coastal ocean applications. %, especially for split-explicit time splitting. 
    1144 This option can be invoked by setting \np{ln\_drgimp} to \forcode{.true.} in the \nam{drg} namelist. 
    1145 %This option requires \np{ln\_zdfexp} to be \forcode{.false.} in the \nam{zdf} namelist. 
     1144This option can be invoked by setting \np{ln_drgimp}{ln\_drgimp} to \forcode{.true.} in the \nam{drg} namelist. 
     1145%This option requires \np{ln_zdfexp}{ln\_zdfexp} to be \forcode{.false.} in the \nam{zdf} namelist. 
    11461146 
    11471147This implementation is performed in \mdl{dynzdf} where the following boundary conditions are set while solving the fully implicit diffusion step: 
     
    11701170\label{subsec:ZDF_drg_ts} 
    11711171 
    1172 With split-explicit free surface, the sub-stepping of barotropic equations needs the knowledge of top/bottom stresses. An obvious way to satisfy this is to take them as constant over the course of the barotropic integration and equal to the value used to update the baroclinic momentum trend. Provided \np{ln\_drgimp}\forcode{= .false.} and a centred or \textit{leap-frog} like integration of barotropic equations is used (\ie\ \forcode{ln_bt_fw=.false.}, cf \autoref{subsec:DYN_spg_ts}), this does ensure that barotropic and baroclinic dynamics feel the same stresses during one leapfrog time step. However, if \np{ln\_drgimp}\forcode{= .true.},  stresses depend on the \textit{after} value of the velocities which themselves depend on the barotropic iteration result. This cyclic dependency makes difficult obtaining consistent stresses in 2d and 3d dynamics. Part of this mismatch is then removed when setting the final barotropic component of 3d velocities to the time splitting estimate. This last step can be seen as a necessary evil but should be minimized since it interferes with the adjustment to the boundary conditions. 
     1172With split-explicit free surface, the sub-stepping of barotropic equations needs the knowledge of top/bottom stresses. An obvious way to satisfy this is to take them as constant over the course of the barotropic integration and equal to the value used to update the baroclinic momentum trend. Provided \np{ln_drgimp}{ln\_drgimp}\forcode{= .false.} and a centred or \textit{leap-frog} like integration of barotropic equations is used (\ie\ \forcode{ln_bt_fw=.false.}, cf \autoref{subsec:DYN_spg_ts}), this does ensure that barotropic and baroclinic dynamics feel the same stresses during one leapfrog time step. However, if \np{ln\_drgimp}\forcode{= .true.},  stresses depend on the \textit{after} value of the velocities which themselves depend on the barotropic iteration result. This cyclic dependency makes difficult obtaining consistent stresses in 2d and 3d dynamics. Part of this mismatch is then removed when setting the final barotropic component of 3d velocities to the time splitting estimate. This last step can be seen as a necessary evil but should be minimized since it interferes with the adjustment to the boundary conditions. 
    11731173 
    11741174The strategy to handle top/bottom stresses with split-explicit free surface in \NEMO\ is as follows: 
     
    11841184% Internal wave-driven mixing 
    11851185% ================================================================ 
    1186 \section[Internal wave-driven mixing (\forcode{ln_zdfiwm})]{Internal wave-driven mixing (\protect\np{ln\_zdfiwm})} 
     1186\section[Internal wave-driven mixing (\forcode{ln_zdfiwm})]{Internal wave-driven mixing (\protect\np{ln_zdfiwm}{ln\_zdfiwm})} 
    11871187\label{subsec:ZDF_tmx_new} 
    11881188 
     
    12061206where $R_f$ is the mixing efficiency and $\epsilon$ is a specified three dimensional distribution of 
    12071207the energy available for mixing. 
    1208 If the \np{ln\_mevar} namelist parameter is set to \forcode{.false.}, the mixing efficiency is taken as constant and 
     1208If the \np{ln_mevar}{ln\_mevar} namelist parameter is set to \forcode{.false.}, the mixing efficiency is taken as constant and 
    12091209equal to 1/6 \citep{osborn_JPO80}. 
    12101210In the opposite (recommended) case, $R_f$ is instead a function of 
     
    12161216 
    12171217In addition to the mixing efficiency, the ratio of salt to heat diffusivities can chosen to vary 
    1218 as a function of $Re_b$ by setting the \np{ln\_tsdiff} parameter to \forcode{.true.}, a recommended choice. 
     1218as a function of $Re_b$ by setting the \np{ln_tsdiff}{ln\_tsdiff} parameter to \forcode{.true.}, a recommended choice. 
    12191219This parameterization of differential mixing, due to \cite{jackson.rehmann_JPO14}, 
    12201220is implemented as in \cite{de-lavergne.madec.ea_JPO16}. 
     
    12341234  h_{wkb} = H \, \frac{ \int_{-H}^{z} N \, dz' } { \int_{-H}^{\eta} N \, dz'  } \; , 
    12351235\] 
    1236 The $n_p$ parameter (given by \np{nn\_zpyc} in \nam{zdf\_iwm} namelist) 
     1236The $n_p$ parameter (given by \np{nn_zpyc}{nn\_zpyc} in \nam{zdf_iwm}{zdf\_iwm} namelist) 
    12371237controls the stratification-dependence of the pycnocline-intensified dissipation. 
    12381238It can take values of $1$ (recommended) or $2$. 
     
    12481248% surface wave-induced mixing 
    12491249% ================================================================ 
    1250 \section[Surface wave-induced mixing (\forcode{ln_zdfswm})]{Surface wave-induced mixing (\protect\np{ln\_zdfswm})} 
     1250\section[Surface wave-induced mixing (\forcode{ln_zdfswm})]{Surface wave-induced mixing (\protect\np{ln_zdfswm}{ln\_zdfswm})} 
    12511251\label{subsec:ZDF_swm} 
    12521252 
     
    12811281% Adaptive-implicit vertical advection 
    12821282% ================================================================ 
    1283 \section[Adaptive-implicit vertical advection (\forcode{ln_zad_Aimp})]{Adaptive-implicit vertical advection(\protect\np{ln\_zad\_Aimp})} 
     1283\section[Adaptive-implicit vertical advection (\forcode{ln_zad_Aimp})]{Adaptive-implicit vertical advection(\protect\np{ln_zad_Aimp}{ln\_zad\_Aimp})} 
    12841284\label{subsec:ZDF_aimp} 
    12851285 
Note: See TracChangeset for help on using the changeset viewer.