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 9392 for branches/2017/dev_merge_2017/DOC/tex_sub/chap_DYN.tex – NEMO

Ignore:
Timestamp:
2018-03-09T16:57:00+01:00 (6 years ago)
Author:
nicolasmartin
Message:

Global replacement of patterns \np{id}=value by \forcode{id = value} for integer and booleans

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/DOC/tex_sub/chap_DYN.tex

    r9389 r9392  
    200200%                 enstrophy conserving scheme 
    201201%------------------------------------------------------------- 
    202 \subsubsection{Enstrophy conserving scheme (\protect\np{ln\_dynvor\_ens}=true)} 
     202\subsubsection{Enstrophy conserving scheme (\protect\forcode{ln_dynvor_ens = .true.})} 
    203203\label{DYN_vor_ens} 
    204204 
     
    221221%                 energy conserving scheme 
    222222%------------------------------------------------------------- 
    223 \subsubsection{Energy conserving scheme (\protect\np{ln\_dynvor\_ene}=true)} 
     223\subsubsection{Energy conserving scheme (\protect\forcode{ln_dynvor_ene = .true.})} 
    224224\label{DYN_vor_ene} 
    225225 
     
    238238%                 mix energy/enstrophy conserving scheme 
    239239%------------------------------------------------------------- 
    240 \subsubsection{Mixed energy/enstrophy conserving scheme (\protect\np{ln\_dynvor\_mix}=true) } 
     240\subsubsection{Mixed energy/enstrophy conserving scheme (\protect\forcode{ln_dynvor_mix = .true.}) } 
    241241\label{DYN_vor_mix} 
    242242 
     
    261261%                 energy and enstrophy conserving scheme 
    262262%------------------------------------------------------------- 
    263 \subsubsection{Energy and enstrophy conserving scheme (\protect\np{ln\_dynvor\_een}=true) } 
     263\subsubsection{Energy and enstrophy conserving scheme (\protect\forcode{ln_dynvor_een = .true.}) } 
    264264\label{DYN_vor_een} 
    265265 
     
    305305A key point in \eqref{Eq_een_e3f} is how the averaging in the \textbf{i}- and \textbf{j}- directions is made.  
    306306It uses the sum of masked t-point vertical scale factor divided either  
    307 by the sum of the four t-point masks (\np{nn\_een\_e3f}~=~1),  
    308 or  just by $4$ (\np{nn\_een\_e3f}~=~true). 
     307by the sum of the four t-point masks (\np{nn_een_e3f}~=~1),  
     308or  just by $4$ (\np{nn_een_e3f}~=~true). 
    309309The latter case preserves the continuity of $e_{3f}$ when one or more of the neighbouring $e_{3t}$  
    310310tends to zero and extends by continuity the value of $e_{3f}$ into the land areas.  
     
    377377\end{aligned}         \right. 
    378378\end{equation}  
    379 When \np{ln\_dynzad\_zts}~=~\textit{true}, a split-explicit time stepping with 5 sub-timesteps is used  
     379When \np{ln_dynzad_zts}~=~\textit{true}, a split-explicit time stepping with 5 sub-timesteps is used  
    380380on the vertical advection term. 
    381381This option can be useful when the value of the timestep is limited by vertical advection \citep{Lemarie_OM2015}.  
    382382Note that in this case, a similar split-explicit time stepping should be used on  
    383383vertical advection of tracer to ensure a better stability,  
    384 an option which is only available with a TVD scheme (see \np{ln\_traadv\_tvd\_zts} in \S\ref{TRA_adv_tvd}). 
     384an option which is only available with a TVD scheme (see \np{ln_traadv_tvd_zts} in \S\ref{TRA_adv_tvd}). 
    385385 
    386386 
     
    451451difference scheme, CEN2, or a $3^{rd}$ order upstream biased scheme, UBS.  
    452452The latter is described in \citet{Shchepetkin_McWilliams_OM05}. The schemes are  
    453 selected using the namelist logicals \np{ln\_dynadv\_cen2} and \np{ln\_dynadv\_ubs}.  
     453selected using the namelist logicals \np{ln_dynadv_cen2} and \np{ln_dynadv_ubs}.  
    454454In flux form, the schemes differ by the choice of a space and time interpolation to  
    455455define the value of $u$ and $v$ at the centre of each face of $u$- and $v$-cells,  
     
    460460%                 2nd order centred scheme 
    461461%------------------------------------------------------------- 
    462 \subsubsection{$2^{nd}$ order centred scheme (cen2) (\protect\np{ln\_dynadv\_cen2}=true)} 
     462\subsubsection{$2^{nd}$ order centred scheme (cen2) (\protect\forcode{ln_dynadv_cen2 = .true.})} 
    463463\label{DYN_adv_cen2} 
    464464 
     
    481481%                 UBS scheme 
    482482%------------------------------------------------------------- 
    483 \subsubsection{Upstream Biased Scheme (UBS) (\protect\np{ln\_dynadv\_ubs}=true)} 
     483\subsubsection{Upstream Biased Scheme (UBS) (\protect\forcode{ln_dynadv_ubs = .true.})} 
    484484\label{DYN_adv_ubs} 
    485485 
     
    501501those in the centred second order method. As the scheme already includes  
    502502a diffusion component, it can be used without explicit  lateral diffusion on momentum  
    503 ($i.e.$ \np{ln\_dynldf\_lap}=\np{ln\_dynldf\_bilap}=false), and it is recommended to do so. 
     503($i.e.$ \np{ln_dynldf_lap}=\forcode{ln_dynldf_bilap = .false.}), and it is recommended to do so. 
    504504 
    505505The UBS scheme is not used in all directions. In the vertical, the centred $2^{nd}$  
     
    554554%           z-coordinate with full step 
    555555%-------------------------------------------------------------------------------------------------------------- 
    556 \subsection   [$z$-coordinate with full step (\protect\np{ln\_dynhpg\_zco}) ] 
    557          {$z$-coordinate with full step (\protect\np{ln\_dynhpg\_zco}=true)} 
     556\subsection   [$z$-coordinate with full step (\protect\np{ln_dynhpg_zco}) ] 
     557         {$z$-coordinate with full step (\protect\forcode{ln_dynhpg_zco = .true.})} 
    558558\label{DYN_hpg_zco} 
    559559 
     
    595595%           z-coordinate with partial step 
    596596%-------------------------------------------------------------------------------------------------------------- 
    597 \subsection   [$z$-coordinate with partial step (\protect\np{ln\_dynhpg\_zps})] 
    598          {$z$-coordinate with partial step (\protect\np{ln\_dynhpg\_zps}=true)} 
     597\subsection   [$z$-coordinate with partial step (\protect\np{ln_dynhpg_zps})] 
     598         {$z$-coordinate with partial step (\protect\forcode{ln_dynhpg_zps = .true.})} 
    599599\label{DYN_hpg_zps} 
    600600 
     
    624624cubic polynomial method is currently disabled whilst known bugs are under investigation. 
    625625 
    626 $\bullet$ Traditional coding (see for example \citet{Madec_al_JPO96}: (\np{ln\_dynhpg\_sco}=true) 
     626$\bullet$ Traditional coding (see for example \citet{Madec_al_JPO96}: (\forcode{ln_dynhpg_sco = .true.}) 
    627627\begin{equation} \label{Eq_dynhpg_sco} 
    628628\left\{ \begin{aligned} 
     
    639639($e_{3w}$). 
    640640  
    641 $\bullet$ Traditional coding with adaptation for ice shelf cavities (\np{ln\_dynhpg\_isf}=true). 
    642 This scheme need the activation of ice shelf cavities (\np{ln\_isfcav}=true). 
    643  
    644 $\bullet$ Pressure Jacobian scheme (prj) (a research paper in preparation) (\np{ln\_dynhpg\_prj}=true) 
     641$\bullet$ Traditional coding with adaptation for ice shelf cavities (\forcode{ln_dynhpg_isf = .true.}). 
     642This scheme need the activation of ice shelf cavities (\forcode{ln_isfcav = .true.}). 
     643 
     644$\bullet$ Pressure Jacobian scheme (prj) (a research paper in preparation) (\forcode{ln_dynhpg_prj = .true.}) 
    645645 
    646646$\bullet$ Density Jacobian with cubic polynomial scheme (DJC) \citep{Shchepetkin_McWilliams_OM05}  
    647 (\np{ln\_dynhpg\_djc}=true) (currently disabled; under development) 
     647(\forcode{ln_dynhpg_djc = .true.}) (currently disabled; under development) 
    648648 
    649649Note that expression \eqref{Eq_dynhpg_sco} is commonly used when the variable volume formulation is 
    650650activated (\key{vvl}) because in that case, even with a flat bottom, the coordinate surfaces are not 
    651651horizontal but follow the free surface \citep{Levier2007}. The pressure jacobian scheme 
    652 (\np{ln\_dynhpg\_prj}=true) is available as an improved option to \np{ln\_dynhpg\_sco}=true when 
     652(\forcode{ln_dynhpg_prj = .true.}) is available as an improved option to \forcode{ln_dynhpg_sco = .true.} when 
    653653\key{vvl} is active.  The pressure Jacobian scheme uses a constrained cubic spline to reconstruct 
    654654the density profile across the water column. This method maintains the monotonicity between the 
     
    660660\label{DYN_hpg_isf} 
    661661Beneath an ice shelf, the total pressure gradient is the sum of the pressure gradient due to the ice shelf load and 
    662  the pressure gradient due to the ocean load. If cavity opened (\np{ln\_isfcav}~=~true) these 2 terms can be 
    663  calculated by setting \np{ln\_dynhpg\_isf}~=~true. No other scheme are working with the ice shelf.\\ 
     662 the pressure gradient due to the ocean load. If cavity opened (\np{ln_isfcav}~=~true) these 2 terms can be 
     663 calculated by setting \np{ln_dynhpg_isf}~=~true. No other scheme are working with the ice shelf.\\ 
    664664 
    665665$\bullet$ The main hypothesis to compute the ice shelf load is that the ice shelf is in an isostatic equilibrium. 
     
    673673%           Time-scheme 
    674674%-------------------------------------------------------------------------------------------------------------- 
    675 \subsection   [Time-scheme (\protect\np{ln\_dynhpg\_imp}) ] 
    676          {Time-scheme (\protect\np{ln\_dynhpg\_imp}= true/false)} 
     675\subsection   [Time-scheme (\protect\np{ln_dynhpg_imp}) ] 
     676         {Time-scheme (\protect\np{ln_dynhpg_imp}= true/false)} 
    677677\label{DYN_hpg_imp} 
    678678 
     
    689689time level $t$ only, as in the standard leapfrog scheme.  
    690690 
    691 $\bullet$ leapfrog scheme (\np{ln\_dynhpg\_imp}=true): 
     691$\bullet$ leapfrog scheme (\forcode{ln_dynhpg_imp = .true.}): 
    692692 
    693693\begin{equation} \label{Eq_dynhpg_lf} 
     
    696696\end{equation} 
    697697 
    698 $\bullet$ semi-implicit scheme (\np{ln\_dynhpg\_imp}=true): 
     698$\bullet$ semi-implicit scheme (\forcode{ln_dynhpg_imp = .true.}): 
    699699\begin{equation} \label{Eq_dynhpg_imp} 
    700700\frac{u^{t+\rdt}-u^{t-\rdt}}{2\rdt} = \;\cdots \; 
     
    713713the stability limits associated with advection or diffusion. 
    714714 
    715 In practice, the semi-implicit scheme is used when \np{ln\_dynhpg\_imp}=true.  
     715In practice, the semi-implicit scheme is used when \forcode{ln_dynhpg_imp = .true.}.  
    716716In this case, we choose to apply the time filter to temperature and salinity used in  
    717717the equation of state, instead of applying it to the hydrostatic pressure or to the  
     
    727727Note that in the semi-implicit case, it is necessary to save the filtered density, an  
    728728extra three-dimensional field, in the restart file to restart the model with exact  
    729 reproducibility. This option is controlled by  \np{nn\_dynhpg\_rst}, a namelist parameter. 
     729reproducibility. This option is controlled by  \np{nn_dynhpg_rst}, a namelist parameter. 
    730730 
    731731% ================================================================ 
     
    806806variables (Fig.~\ref{Fig_DYN_dynspg_ts}).  
    807807The size of the small time step, $\rdt_e$ (the external mode or barotropic time step) 
    808  is provided through the \np{nn\_baro} namelist parameter as:  
    809 $\rdt_e = \rdt / nn\_baro$. This parameter can be optionally defined automatically (\np{ln\_bt\_nn\_auto}=true)  
     808 is provided through the \np{nn_baro} namelist parameter as:  
     809$\rdt_e = \rdt / nn\_baro$. This parameter can be optionally defined automatically (\forcode{ln_bt_nn_auto = .true.})  
    810810considering that the stability of the barotropic system is essentially controled by external waves propagation.  
    811811Maximum Courant number is in that case time independent, and easily computed online from the input bathymetry. 
    812 Therefore, $\rdt_e$ is adjusted so that the Maximum allowed Courant number is smaller than \np{rn\_bt\_cmax}. 
     812Therefore, $\rdt_e$ is adjusted so that the Maximum allowed Courant number is smaller than \np{rn_bt_cmax}. 
    813813 
    814814%%% 
     
    839839The former are used to obtain time filtered quantities at $t+\rdt$ while the latter are used to obtain time averaged  
    840840transports to advect tracers. 
    841 a) Forward time integration: \protect\np{ln\_bt\_fw}=true,  \protect\np{ln\_bt\_av}=true.  
    842 b) Centred time integration: \protect\np{ln\_bt\_fw}=false, \protect\np{ln\_bt\_av}=true.  
    843 c) Forward time integration with no time filtering (POM-like scheme): \protect\np{ln\_bt\_fw}=true, \protect\np{ln\_bt\_av}=false. } 
     841a) Forward time integration: \protect\forcode{ln_bt_fw = .true.},  \protect\forcode{ln_bt_av = .true.}.  
     842b) Centred time integration: \protect\forcode{ln_bt_fw = .false.}, \protect\forcode{ln_bt_av = .true.}.  
     843c) Forward time integration with no time filtering (POM-like scheme): \protect\forcode{ln_bt_fw = .true.}, \protect\forcode{ln_bt_av = .false.}. } 
    844844\end{center}    \end{figure} 
    845845%>   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   >   > 
    846846 
    847 In the default case (\np{ln\_bt\_fw}=true), the external mode is integrated  
     847In the default case (\forcode{ln_bt_fw = .true.}), the external mode is integrated  
    848848between \textit{now} and  \textit{after} baroclinic time-steps (Fig.~\ref{Fig_DYN_dynspg_ts}a). To avoid aliasing of fast barotropic motions into three dimensional equations, time filtering is eventually applied on barotropic  
    849 quantities (\np{ln\_bt\_av}=true). In that case, the integration is extended slightly beyond  \textit{after} time step to provide time filtered quantities.  
     849quantities (\forcode{ln_bt_av = .true.}). In that case, the integration is extended slightly beyond  \textit{after} time step to provide time filtered quantities.  
    850850These are used for the subsequent initialization of the barotropic mode in the following baroclinic step.  
    851851Since external mode equations written at baroclinic time steps finally follow a forward time stepping scheme,  
    852852asselin filtering is not applied to barotropic quantities. \\ 
    853853Alternatively, one can choose to integrate barotropic equations starting  
    854 from \textit{before} time step (\np{ln\_bt\_fw}=false). Although more computationaly expensive ( \np{nn\_baro} additional iterations are indeed necessary), the baroclinic to barotropic forcing term given at \textit{now} time step  
     854from \textit{before} time step (\forcode{ln_bt_fw = .false.}). Although more computationaly expensive ( \np{nn_baro} additional iterations are indeed necessary), the baroclinic to barotropic forcing term given at \textit{now} time step  
    855855become centred in the middle of the integration window. It can easily be shown that this property  
    856856removes part of splitting errors between modes, which increases the overall numerical robustness. 
     
    868868%%% 
    869869 
    870 One can eventually choose to feedback instantaneous values by not using any time filter (\np{ln\_bt\_av}=false).  
     870One can eventually choose to feedback instantaneous values by not using any time filter (\forcode{ln_bt_av = .false.}).  
    871871In that case, external mode equations are continuous in time, ie they are not re-initialized when starting a new  
    872872sub-stepping sequence. This is the method used so far in the POM model, the stability being maintained by refreshing at (almost)  
     
    10361036 
    10371037% ================================================================ 
    1038 \subsection   [Iso-level laplacian operator (\protect\np{ln\_dynldf\_lap}) ] 
    1039          {Iso-level laplacian operator (\protect\np{ln\_dynldf\_lap}=true)} 
     1038\subsection   [Iso-level laplacian operator (\protect\np{ln_dynldf_lap}) ] 
     1039         {Iso-level laplacian operator (\protect\forcode{ln_dynldf_lap = .true.})} 
    10401040\label{DYN_ldf_lap} 
    10411041 
     
    10601060%           Rotated laplacian operator 
    10611061%-------------------------------------------------------------------------------------------------------------- 
    1062 \subsection   [Rotated laplacian operator (\protect\np{ln\_dynldf\_iso}) ] 
    1063          {Rotated laplacian operator (\protect\np{ln\_dynldf\_iso}=true)} 
     1062\subsection   [Rotated laplacian operator (\protect\np{ln_dynldf_iso}) ] 
     1063         {Rotated laplacian operator (\protect\forcode{ln_dynldf_iso = .true.})} 
    10641064\label{DYN_ldf_iso} 
    10651065 
    10661066A rotation of the lateral momentum diffusion operator is needed in several cases:  
    1067 for iso-neutral diffusion in the $z$-coordinate (\np{ln\_dynldf\_iso}=true) and for  
    1068 either iso-neutral (\np{ln\_dynldf\_iso}=true) or geopotential  
    1069 (\np{ln\_dynldf\_hor}=true) diffusion in the $s$-coordinate. In the partial step  
     1067for iso-neutral diffusion in the $z$-coordinate (\forcode{ln_dynldf_iso = .true.}) and for  
     1068either iso-neutral (\forcode{ln_dynldf_iso = .true.}) or geopotential  
     1069(\forcode{ln_dynldf_hor = .true.}) diffusion in the $s$-coordinate. In the partial step  
    10701070case, coordinates are horizontal except at the deepest level and no  
    1071 rotation is performed when \np{ln\_dynldf\_hor}=true. The diffusion operator  
     1071rotation is performed when \forcode{ln_dynldf_hor = .true.}. The diffusion operator  
    10721072is defined simply as the divergence of down gradient momentum fluxes on each  
    10731073momentum component. It must be emphasized that this formulation ignores  
     
    11291129%           Iso-level bilaplacian operator 
    11301130%-------------------------------------------------------------------------------------------------------------- 
    1131 \subsection   [Iso-level bilaplacian operator (\protect\np{ln\_dynldf\_bilap})] 
    1132          {Iso-level bilaplacian operator (\protect\np{ln\_dynldf\_bilap}=true)} 
     1131\subsection   [Iso-level bilaplacian operator (\protect\np{ln_dynldf_bilap})] 
     1132         {Iso-level bilaplacian operator (\protect\forcode{ln_dynldf_bilap = .true.})} 
    11331133\label{DYN_ldf_bilap} 
    11341134 
     
    11571157would be too restrictive a constraint on the time step. Two time stepping schemes  
    11581158can be used for the vertical diffusion term : $(a)$ a forward time differencing  
    1159 scheme (\np{ln\_zdfexp}=true) using a time splitting technique  
    1160 (\np{nn\_zdfexp} $>$ 1) or $(b)$ a backward (or implicit) time differencing scheme  
    1161 (\np{ln\_zdfexp}=false) (see \S\ref{STP}). Note that namelist variables  
    1162 \np{ln\_zdfexp} and \np{nn\_zdfexp} apply to both tracers and dynamics.  
     1159scheme (\forcode{ln_zdfexp = .true.}) using a time splitting technique  
     1160(\np{nn_zdfexp} $>$ 1) or $(b)$ a backward (or implicit) time differencing scheme  
     1161(\forcode{ln_zdfexp = .false.}) (see \S\ref{STP}). Note that namelist variables  
     1162\np{ln_zdfexp} and \np{nn_zdfexp} apply to both tracers and dynamics.  
    11631163 
    11641164The formulation of the vertical subgrid scale physics is the same whatever  
     
    12061206may enter the dynamical equations by affecting the surface pressure gradient.  
    12071207 
    1208 (1) When \np{ln\_apr\_dyn}~=~true (see \S\ref{SBC_apr}), the atmospheric pressure is taken  
     1208(1) When \np{ln_apr_dyn}~=~true (see \S\ref{SBC_apr}), the atmospheric pressure is taken  
    12091209into account when computing the surface pressure gradient. 
    12101210 
    1211 (2) When \np{ln\_tide\_pot}~=~true and \np{ln\_tide}~=~true (see \S\ref{SBC_tide}),  
     1211(2) When \np{ln_tide_pot}~=~true and \np{ln_tide}~=~true (see \S\ref{SBC_tide}),  
    12121212the tidal potential is taken into account when computing the surface pressure gradient. 
    12131213 
    1214 (3) When \np{nn\_ice\_embd}~=~2 and LIM or CICE is used ($i.e.$ when the sea-ice is embedded in the ocean),  
     1214(3) When \np{nn_ice_embd}~=~2 and LIM or CICE is used ($i.e.$ when the sea-ice is embedded in the ocean),  
    12151215the snow-ice mass is taken into account when computing the surface pressure gradient. 
    12161216 
     
    12381238weighted velocity (see \S\ref{Apdx_A_momentum})   
    12391239 
    1240 $\bullet$ vector invariant form or linear free surface (\np{ln\_dynhpg\_vec}=true ; \key{vvl} not defined): 
     1240$\bullet$ vector invariant form or linear free surface (\forcode{ln_dynhpg_vec = .true.} ; \key{vvl} not defined): 
    12411241\begin{equation} \label{Eq_dynnxt_vec} 
    12421242\left\{   \begin{aligned} 
     
    12461246\end{equation}  
    12471247 
    1248 $\bullet$ flux form and nonlinear free surface (\np{ln\_dynhpg\_vec}=false ; \key{vvl} defined): 
     1248$\bullet$ flux form and nonlinear free surface (\forcode{ln_dynhpg_vec = .false.} ; \key{vvl} defined): 
    12491249\begin{equation} \label{Eq_dynnxt_flux} 
    12501250\left\{   \begin{aligned} 
     
    12561256where RHS is the right hand side of the momentum equation, the subscript $f$  
    12571257denotes filtered values and $\gamma$ is the Asselin coefficient. $\gamma$ is  
    1258 initialized as \np{nn\_atfp} (namelist parameter). Its default value is \np{nn\_atfp} = $10^{-3}$. 
     1258initialized as \np{nn_atfp} (namelist parameter). Its default value is \np{nn_atfp} = $10^{-3}$. 
    12591259In both cases, the modified Asselin filter is not applied since perfect conservation  
    12601260is not an issue for the momentum equations. 
Note: See TracChangeset for help on using the changeset viewer.