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 11692 for NEMO/branches/2019/dev_r11514_HPC-02_single-core-extrahalo/doc/latex/NEMO/subfiles/chap_LBC.tex – NEMO

Ignore:
Timestamp:
2019-10-12T16:08:18+02:00 (5 years ago)
Author:
francesca
Message:

Update branch to integrate the development starting from the current v4.01 ready trunk

Location:
NEMO/branches/2019/dev_r11514_HPC-02_single-core-extrahalo/doc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11514_HPC-02_single-core-extrahalo/doc

    • Property svn:externals set to
      ^/utils/badges badges
      ^/utils/logos logos
  • NEMO/branches/2019/dev_r11514_HPC-02_single-core-extrahalo/doc/latex

    • Property svn:ignore deleted
  • NEMO/branches/2019/dev_r11514_HPC-02_single-core-extrahalo/doc/latex/NEMO

    • Property svn:externals set to
      ^/utils/figures/NEMO figures
  • NEMO/branches/2019/dev_r11514_HPC-02_single-core-extrahalo/doc/latex/NEMO/subfiles

    • Property svn:ignore
      •  

        old new  
        1 *.aux 
        2 *.bbl 
        3 *.blg 
        4 *.dvi 
        5 *.fdb* 
        6 *.fls 
        7 *.idx 
         1*.ind 
        82*.ilg 
        9 *.ind 
        10 *.log 
        11 *.maf 
        12 *.mtc* 
        13 *.out 
        14 *.pdf 
        15 *.toc 
        16 _minted-* 
  • NEMO/branches/2019/dev_r11514_HPC-02_single-core-extrahalo/doc/latex/NEMO/subfiles/chap_LBC.tex

    r11445 r11692  
    22 
    33\begin{document} 
    4 % ================================================================ 
    5 % Chapter — Lateral Boundary Condition (LBC) 
    6 % ================================================================ 
     4 
    75\chapter{Lateral Boundary Condition (LBC)} 
    86\label{chap:LBC} 
    97 
     8\thispagestyle{plain} 
     9 
    1010\chaptertoc 
    1111 
    12 \newpage 
     12\paragraph{Changes record} ~\\ 
     13 
     14{\footnotesize 
     15  \begin{tabularx}{\textwidth}{l||X|X} 
     16    Release & Author(s) & Modifications \\ 
     17    \hline 
     18    {\em   4.0} & {\em ...} & {\em ...} \\ 
     19    {\em   3.6} & {\em ...} & {\em ...} \\ 
     20    {\em   3.4} & {\em ...} & {\em ...} \\ 
     21    {\em <=3.4} & {\em ...} & {\em ...} 
     22  \end{tabularx} 
     23} 
     24 
     25\clearpage 
    1326 
    1427%gm% add here introduction to this chapter 
    1528 
    16 % ================================================================ 
    17 % Boundary Condition at the Coast 
    18 % ================================================================ 
    19 \section[Boundary condition at the coast (\texttt{rn\_shlat})] 
    20 {Boundary condition at the coast (\protect\np{rn\_shlat})} 
     29%% ================================================================================================= 
     30\section[Boundary condition at the coast (\forcode{rn_shlat})]{Boundary condition at the coast (\protect\np{rn_shlat}{rn\_shlat})} 
    2131\label{sec:LBC_coast} 
    22 %--------------------------------------------nam_lbc------------------------------------------------------- 
    23  
    24 \nlst{namlbc} 
    25 %-------------------------------------------------------------------------------------------------------------- 
     32 
     33\begin{listing} 
     34  \nlst{namlbc} 
     35  \caption{\forcode{&namlbc}} 
     36  \label{lst:namlbc} 
     37\end{listing} 
    2638 
    2739%The lateral ocean boundary conditions contiguous to coastlines are Neumann conditions for heat and salt 
     
    4052%The process of defining which areas are to be masked is described in \autoref{subsec:DOM_msk}. 
    4153 
    42 Options are defined through the \nam{lbc} namelist variables. 
     54Options are defined through the \nam{lbc}{lbc} namelist variables. 
    4355The discrete representation of a domain with complex boundaries (coastlines and bottom topography) leads to 
    4456arrays that include large portions where a computation is not required as the model variables remain at zero. 
     
    5769 
    5870\[ 
    59   % \label{eq:lbc_aaaa} 
     71  % \label{eq:LBC_aaaa} 
    6072  \frac{A^{lT} }{e_1 }\frac{\partial T}{\partial i}\equiv \frac{A_u^{lT} 
    6173  }{e_{1u} } \; \delta_{i+1 / 2} \left[ T \right]\;\;mask_u 
     
    6577(normal velocity $u$ remains zero at the coast) (\autoref{fig:LBC_uv}). 
    6678 
    67 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    6879\begin{figure}[!t] 
    69   \begin{center} 
    70     \includegraphics[width=\textwidth]{Fig_LBC_uv} 
    71     \caption{ 
    72       \protect\label{fig:LBC_uv} 
    73       Lateral boundary (thick line) at T-level. 
    74       The velocity normal to the boundary is set to zero. 
    75     } 
    76   \end{center} 
     80  \centering 
     81  \includegraphics[width=0.66\textwidth]{LBC_uv} 
     82  \caption[Lateral boundary at $T$-level]{ 
     83    Lateral boundary (thick line) at T-level. 
     84    The velocity normal to the boundary is set to zero.} 
     85  \label{fig:LBC_uv} 
    7786\end{figure} 
    78 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    7987 
    8088For momentum the situation is a bit more complex as two boundary conditions must be provided along the coast 
     
    9098and is required in order to compute the vorticity at the coast. 
    9199Four different types of lateral boundary condition are available, 
    92 controlled by the value of the \np{rn\_shlat} namelist parameter 
     100controlled by the value of the \np{rn_shlat}{rn\_shlat} namelist parameter 
    93101(The value of the mask$_{f}$ array along the coastline is set equal to this parameter). 
    94102These are: 
    95103 
    96 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    97104\begin{figure}[!p] 
    98   \begin{center} 
    99     \includegraphics[width=\textwidth]{Fig_LBC_shlat} 
    100     \caption{ 
    101       \protect\label{fig:LBC_shlat} 
    102       lateral boundary condition 
    103       (a) free-slip ($rn\_shlat=0$); 
    104       (b) no-slip ($rn\_shlat=2$); 
    105       (c) "partial" free-slip ($0<rn\_shlat<2$) and 
    106       (d) "strong" no-slip ($2<rn\_shlat$). 
    107       Implied "ghost" velocity inside land area is display in grey. 
    108     } 
    109   \end{center} 
     105  \centering 
     106  \includegraphics[width=0.66\textwidth]{LBC_shlat} 
     107  \caption[Lateral boundary conditions]{ 
     108    Lateral boundary conditions 
     109    (a) free-slip                       (\protect\np[=0]{rn_shlat}{rn\_shlat}); 
     110    (b) no-slip                         (\protect\np[=2]{rn_shlat}{rn\_shlat}); 
     111    (c) "partial" free-slip (\forcode{0<}\protect\np[<2]{rn_shlat}{rn\_shlat}) and 
     112    (d) "strong" no-slip    (\forcode{2<}\protect\np{rn_shlat}{rn\_shlat}). 
     113    Implied "ghost" velocity inside land area is display in grey.} 
     114  \label{fig:LBC_shlat} 
    110115\end{figure} 
    111 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    112116 
    113117\begin{description} 
    114118 
    115 \item[free-slip boundary condition (\np{rn\_shlat}\forcode{ = 0}):] the tangential velocity at 
     119\item [free-slip boundary condition ({\np[=0]{rn_shlat}{rn\_shlat}})] the tangential velocity at 
    116120  the coastline is equal to the offshore velocity, 
    117121  \ie\ the normal derivative of the tangential velocity is zero at the coast, 
     
    119123  (\autoref{fig:LBC_shlat}-a). 
    120124 
    121 \item[no-slip boundary condition (\np{rn\_shlat}\forcode{ = 2}):] the tangential velocity vanishes at the coastline. 
     125\item [no-slip boundary condition ({\np[=2]{rn_shlat}{rn\_shlat}})] the tangential velocity vanishes at the coastline. 
    122126  Assuming that the tangential velocity decreases linearly from 
    123127  the closest ocean velocity grid point to the coastline, 
     
    134138  the no-slip boundary condition, simply by multiplying it by the mask$_{f}$ : 
    135139  \[ 
    136     % \label{eq:lbc_bbbb} 
     140    % \label{eq:LBC_bbbb} 
    137141    \zeta \equiv \frac{1}{e_{1f} {\kern 1pt}e_{2f} }\left( {\delta_{i+1/2} 
    138142        \left[ {e_{2v} \,v} \right]-\delta_{j+1/2} \left[ {e_{1u} \,u} \right]} 
     
    140144  \] 
    141145 
    142 \item["partial" free-slip boundary condition (0$<$\np{rn\_shlat}$<$2):] the tangential velocity at 
     146\item ["partial" free-slip boundary condition (0$<$\np{rn_shlat}{rn\_shlat}$<$2)] the tangential velocity at 
    143147  the coastline is smaller than the offshore velocity, \ie\ there is a lateral friction but 
    144148  not strong enough to make the tangential velocity at the coast vanish (\autoref{fig:LBC_shlat}-c). 
    145149  This can be selected by providing a value of mask$_{f}$ strictly inbetween $0$ and $2$. 
    146150 
    147 \item["strong" no-slip boundary condition (2$<$\np{rn\_shlat}):] the viscous boundary layer is assumed to 
     151\item ["strong" no-slip boundary condition (2$<$\np{rn_shlat}{rn\_shlat})] the viscous boundary layer is assumed to 
    148152  be smaller than half the grid size (\autoref{fig:LBC_shlat}-d). 
    149153  The friction is thus larger than in the no-slip case. 
     
    155159it is only applied next to the coast where the minimum water depth can be quite shallow. 
    156160 
    157  
    158 % ================================================================ 
    159 % Boundary Condition around the Model Domain 
    160 % ================================================================ 
    161 \section[Model domain boundary condition (\texttt{jperio})] 
    162 {Model domain boundary condition (\protect\jp{jperio})} 
     161%% ================================================================================================= 
     162\section[Model domain boundary condition (\forcode{jperio})]{Model domain boundary condition (\protect\jp{jperio})} 
    163163\label{sec:LBC_jperio} 
    164164 
     
    168168The north-fold boundary condition is associated with the 3-pole ORCA mesh. 
    169169 
    170 % ------------------------------------------------------------------------------------------------------------- 
    171 %        Closed, cyclic (\jp{jperio}\forcode{ = 0..2}) 
    172 % ------------------------------------------------------------------------------------------------------------- 
    173 \subsection[Closed, cyclic (\forcode{jperio = [0127]})] 
    174 {Closed, cyclic (\protect\jp{jperio}\forcode{ = [0127]})} 
     170%% ================================================================================================= 
     171\subsection[Closed, cyclic (\forcode{=0,1,2,7})]{Closed, cyclic (\protect\jp{jperio}\forcode{=0,1,2,7})} 
    175172\label{subsec:LBC_jperio012} 
    176173 
    177174The choice of closed or cyclic model domain boundary condition is made by 
    178 setting \jp{jperio} to 0, 1, 2 or 7 in namelist \nam{cfg}. 
     175setting \jp{jperio} to 0, 1, 2 or 7 in namelist \nam{cfg}{cfg}. 
    179176Each time such a boundary condition is needed, it is set by a call to routine \mdl{lbclnk}. 
    180177The computation of momentum and tracer trends proceeds from $i=2$ to $i=jpi-1$ and from $j=2$ to $j=jpj-1$, 
     
    185182\begin{description} 
    186183 
    187 \item[For closed boundary (\jp{jperio}\forcode{ = 0})], 
    188   solid walls are imposed at all model boundaries: 
     184\item [For closed boundary (\jp{jperio}\forcode{=0})], solid walls are imposed at all model boundaries: 
    189185  first and last rows and columns are set to zero. 
    190186 
    191 \item[For cyclic east-west boundary (\jp{jperio}\forcode{ = 1})], 
    192   first and last rows are set to zero (closed) whilst the first column is set to 
     187\item [For cyclic east-west boundary (\jp{jperio}\forcode{=1})], first and last rows are set to zero (closed) whilst the first column is set to 
    193188  the value of the last-but-one column and the last column to the value of the second one 
    194189  (\autoref{fig:LBC_jperio}-a). 
    195190  Whatever flows out of the eastern (western) end of the basin enters the western (eastern) end. 
    196191 
    197 \item[For cyclic north-south boundary (\jp{jperio}\forcode{ = 2})], 
    198   first and last columns are set to zero (closed) whilst the first row is set to 
     192\item [For cyclic north-south boundary (\jp{jperio}\forcode{=2})], first and last columns are set to zero (closed) whilst the first row is set to 
    199193  the value of the last-but-one row and the last row to the value of the second one 
    200194  (\autoref{fig:LBC_jperio}-a). 
    201195  Whatever flows out of the northern (southern) end of the basin enters the southern (northern) end. 
    202196 
    203 \item[Bi-cyclic east-west and north-south boundary (\jp{jperio}\forcode{ = 7})] combines cases 1 and 2. 
     197\item [Bi-cyclic east-west and north-south boundary (\jp{jperio}\forcode{=7})] combines cases 1 and 2. 
    204198 
    205199\end{description} 
    206200 
    207 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    208201\begin{figure}[!t] 
    209   \begin{center} 
    210     \includegraphics[width=\textwidth]{Fig_LBC_jperio} 
    211     \caption{ 
    212       \protect\label{fig:LBC_jperio} 
    213       setting of (a) east-west cyclic  (b) symmetric across the equator boundary conditions. 
    214     } 
    215   \end{center} 
     202  \centering 
     203  \includegraphics[width=0.66\textwidth]{LBC_jperio} 
     204  \caption[Setting of east-west cyclic and symmetric across the Equator boundary conditions]{ 
     205    Setting of (a) east-west cyclic (b) symmetric across the Equator boundary conditions} 
     206  \label{fig:LBC_jperio} 
    216207\end{figure} 
    217 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    218  
    219 % ------------------------------------------------------------------------------------------------------------- 
    220 %        North fold (\textit{jperio = 3 }to $6)$ 
    221 % ------------------------------------------------------------------------------------------------------------- 
    222 \subsection[North-fold (\forcode{jperio = [3-6]})] 
    223 {North-fold (\protect\jp{jperio}\forcode{ = [3-6]})} 
     208 
     209%% ================================================================================================= 
     210\subsection[North-fold (\forcode{=3,6})]{North-fold (\protect\jp{jperio}\forcode{=3,6})} 
    224211\label{subsec:LBC_north_fold} 
    225212 
    226213The north fold boundary condition has been introduced in order to handle the north boundary of 
    227214a three-polar ORCA grid. 
    228 Such a grid has two poles in the northern hemisphere (\autoref{fig:MISC_ORCA_msh}, 
    229 and thus requires a specific treatment illustrated in \autoref{fig:North_Fold_T}. 
     215Such a grid has two poles in the northern hemisphere (\autoref{fig:CFGS_ORCA_msh}, 
     216and thus requires a specific treatment illustrated in \autoref{fig:LBC_North_Fold_T}. 
    230217Further information can be found in \mdl{lbcnfd} module which applies the north fold boundary condition. 
    231218 
    232 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    233219\begin{figure}[!t] 
    234   \begin{center} 
    235     \includegraphics[width=\textwidth]{Fig_North_Fold_T} 
    236     \caption{ 
    237       \protect\label{fig:North_Fold_T} 
    238       North fold boundary with a $T$-point pivot and cyclic east-west boundary condition ($jperio=4$), 
    239       as used in ORCA 2, 1/4, and 1/12. 
    240       Pink shaded area corresponds to the inner domain mask (see text). 
    241     } 
    242   \end{center} 
     220  \centering 
     221  \includegraphics[width=0.66\textwidth]{LBC_North_Fold_T} 
     222  \caption[North fold boundary in ORCA 2\deg, 1/4\deg and 1/12\deg]{ 
     223    North fold boundary with a $T$-point pivot and cyclic east-west boundary condition ($jperio=4$), 
     224    as used in ORCA 2\deg, 1/4\deg and 1/12\deg. 
     225    Pink shaded area corresponds to the inner domain mask (see text).} 
     226  \label{fig:LBC_North_Fold_T} 
    243227\end{figure} 
    244 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    245  
    246 % ==================================================================== 
    247 % Exchange with neighbouring processors 
    248 % ==================================================================== 
    249 \section[Exchange with neighbouring processors (\textit{lbclnk.F90}, \textit{lib\_mpp.F90})] 
    250 {Exchange with neighbouring processors (\protect\mdl{lbclnk}, \protect\mdl{lib\_mpp})} 
     228 
     229%% ================================================================================================= 
     230\section[Exchange with neighbouring processors (\textit{lbclnk.F90}, \textit{lib\_mpp.F90})]{Exchange with neighbouring processors (\protect\mdl{lbclnk}, \protect\mdl{lib\_mpp})} 
    251231\label{sec:LBC_mpp} 
    252232 
     233\begin{listing} 
     234  \nlst{nammpp} 
     235  \caption{\forcode{&nammpp}} 
     236  \label{lst:nammpp} 
     237\end{listing} 
     238 
    253239For massively parallel processing (mpp), a domain decomposition method is used. 
    254 The basic idea of the method is to split the large computation domain of a numerical experiment into 
    255 several smaller domains and solve the set of equations by addressing independent local problems. 
     240The basic idea of the method is to split the large computation domain of a numerical experiment into several smaller domains and 
     241solve the set of equations by addressing independent local problems. 
    256242Each processor has its own local memory and computes the model equation over a subdomain of the whole model domain. 
    257 The subdomain boundary conditions are specified through communications between processors which 
    258 are organized by explicit statements (message passing method). 
    259  
    260 A big advantage is that the method does not need many modifications of the initial \fortran code. 
    261 From the modeller's point of view, each sub domain running on a processor is identical to the "mono-domain" code. 
    262 In addition, the programmer manages the communications between subdomains, 
    263 and the code is faster when the number of processors is increased. 
    264 The porting of OPA code on an iPSC860 was achieved during Guyon's PhD [Guyon et al. 1994, 1995] 
    265 in collaboration with CETIIS and ONERA. 
    266 The implementation in the operational context and the studies of performance on 
    267 a T3D and T3E Cray computers have been made in collaboration with IDRIS and CNRS. 
     243The subdomain boundary conditions are specified through communications between processors which are organized by 
     244explicit statements (message passing method). 
    268245The present implementation is largely inspired by Guyon's work [Guyon 1995]. 
    269246 
     
    272249depend at the very most on one neighbouring point. 
    273250The only non-local computations concern the vertical physics 
    274 (implicit diffusion, turbulent closure scheme, ...) (delocalization over the whole water column), 
    275 and the solving of the elliptic equation associated with the surface pressure gradient computation 
    276 (delocalization over the whole horizontal domain). 
     251(implicit diffusion, turbulent closure scheme, ...). 
    277252Therefore, a pencil strategy is used for the data sub-structuration: 
    278253the 3D initial domain is laid out on local processor memories following a 2D horizontal topological splitting. 
     
    284259each processor sends to its neighbouring processors the update values of the points corresponding to 
    285260the interior overlapping area to its neighbouring sub-domain (\ie\ the innermost of the two overlapping rows). 
    286 The communication is done through the Message Passing Interface (MPI). 
     261Communications are first done according to the east-west direction and next according to the north-south direction. 
     262There is no specific communications for the corners. 
     263The communication is done through the Message Passing Interface (MPI) and requires \key{mpp\_mpi}. 
     264Use also \key{mpi2} if MPI3 is not available on your computer. 
    287265The data exchanges between processors are required at the very place where 
    288266lateral domain boundary conditions are set in the mono-domain computation: 
    289267the \rou{lbc\_lnk} routine (found in \mdl{lbclnk} module) which manages such conditions is interfaced with 
    290 routines found in \mdl{lib\_mpp} module when running on an MPP computer (\ie\ when \key{mpp\_mpi} defined). 
    291 It has to be pointed out that when using the MPP version of the model, 
    292 the east-west cyclic boundary condition is done implicitly, 
    293 whilst the south-symmetric boundary condition option is not available. 
    294  
    295 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     268routines found in \mdl{lib\_mpp} module. 
     269The output file \textit{communication\_report.txt} provides the list of which routines do how 
     270many communications during 1 time step of the model.\\ 
     271 
    296272\begin{figure}[!t] 
    297   \begin{center} 
    298     \includegraphics[width=\textwidth]{Fig_mpp} 
    299     \caption{ 
    300       \protect\label{fig:mpp} 
    301       Positioning of a sub-domain when massively parallel processing is used. 
    302     } 
    303   \end{center} 
     273  \centering 
     274  \includegraphics[width=0.66\textwidth]{LBC_mpp} 
     275  \caption{Positioning of a sub-domain when massively parallel processing is used} 
     276  \label{fig:LBC_mpp} 
    304277\end{figure} 
    305 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    306  
    307 In the standard version of \NEMO, the splitting is regular and arithmetic. 
    308 The i-axis is divided by \jp{jpni} and 
    309 the j-axis by \jp{jpnj} for a number of processors \jp{jpnij} most often equal to $jpni \times jpnj$ 
    310 (parameters set in  \nam{mpp} namelist). 
    311 Each processor is independent and without message passing or synchronous process, 
    312 programs run alone and access just its own local memory. 
    313 For this reason, the main model dimensions are now the local dimensions of the subdomain (pencil) that 
    314 are named \jp{jpi}, \jp{jpj}, \jp{jpk}. 
     278 
     279In \NEMO, the splitting is regular and arithmetic. 
     280The total number of subdomains corresponds to the number of MPI processes allocated to \NEMO\ when the model is launched 
     281(\ie\ mpirun -np x ./nemo will automatically give x subdomains). 
     282The i-axis is divided by \np{jpni}{jpni} and the j-axis by \np{jpnj}{jpnj}. 
     283These parameters are defined in \nam{mpp}{mpp} namelist. 
     284If \np{jpni}{jpni} and \np{jpnj}{jpnj} are < 1, they will be automatically redefined in the code to give the best domain decomposition 
     285(see bellow). 
     286 
     287Each processor is independent and without message passing or synchronous process, programs run alone and access just its own local memory. 
     288For this reason, 
     289the main model dimensions are now the local dimensions of the subdomain (pencil) that are named \jp{jpi}, \jp{jpj}, \jp{jpk}. 
    315290These dimensions include the internal domain and the overlapping rows. 
    316 The number of rows to exchange (known as the halo) is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). 
     291The number of rows to exchange (known as the halo) is usually set to one (nn\_hls=1, in \mdl{par\_oce}, 
     292and must be kept to one until further notice). 
    317293The whole domain dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}. 
    318294The relationship between the whole domain and a sub-domain is: 
    319 \[ 
    320   jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci 
    321   jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj 
    322 \] 
    323 where \jp{jpni}, \jp{jpnj} are the number of processors following the i- and j-axis. 
    324  
    325 One also defines variables nldi and nlei which correspond to the internal domain bounds, 
    326 and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain. 
     295\begin{gather*} 
     296  jpi = ( jpiglo-2\times nn\_hls + (jpni-1) ) / jpni + 2\times nn\_hls \\ 
     297  jpj = ( jpjglo-2\times nn\_hls + (jpnj-1) ) / jpnj + 2\times nn\_hls 
     298\end{gather*} 
     299 
     300One also defines variables nldi and nlei which correspond to the internal domain bounds, and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain (\autoref{fig:LBC_mpp}). Note that since the version 4, there is no more extra-halo area as defined in \autoref{fig:LBC_mpp} so \jp{jpi} is now always equal to nlci and \jp{jpj} equal to nlcj. 
     301 
    327302An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$, 
    328303a global array (whole domain) by the relationship: 
    329304\[ 
    330   % \label{eq:lbc_nimpp} 
     305  % \label{eq:LBC_nimpp} 
    331306  T_{g} (i+nimpp-1,j+njmpp-1,k) = T_{l} (i,j,k), 
    332307\] 
    333 with  $1 \leq i \leq jpi$, $1  \leq j \leq jpj $ , and  $1  \leq k \leq jpk$. 
    334  
    335 Processors are numbered from 0 to $jpnij-1$, the number is saved in the variable nproc. 
    336 In the standard version, a processor has no more than 
    337 four neighbouring processors named nono (for north), noea (east), noso (south) and nowe (west) and 
    338 two variables, nbondi and nbondj, indicate the relative position of the processor: 
    339 \begin{itemize} 
    340 \item       nbondi = -1    an east neighbour, no west processor, 
    341 \item       nbondi =  0 an east neighbour, a west neighbour, 
    342 \item       nbondi =  1    no east processor, a west neighbour, 
    343 \item       nbondi =  2    no splitting following the i-axis. 
    344 \end{itemize} 
    345 During the simulation, processors exchange data with their neighbours. 
    346 If there is effectively a neighbour, the processor receives variables from this processor on its overlapping row, 
    347 and sends the data issued from internal domain corresponding to the overlapping row of the other processor. 
    348  
    349  
    350 The \NEMO\ model computes equation terms with the help of mask arrays (0 on land points and 1 on sea points). 
    351 It is easily readable and very efficient in the context of a computer with vectorial architecture. 
    352 However, in the case of a scalar processor, computations over the land regions become more expensive in 
    353 terms of CPU time. 
    354 It is worse when we use a complex configuration with a realistic bathymetry like the global ocean where 
    355 more than 50 \% of points are land points. 
    356 For this reason, a pre-processing tool can be used to choose the mpp domain decomposition with a maximum number of 
    357 only land points processors, which can then be eliminated (\autoref{fig:mppini2}) 
    358 (For example, the mpp\_optimiz tools, available from the DRAKKAR web site). 
    359 This optimisation is dependent on the specific bathymetry employed. 
    360 The user then chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with $jpnij < jpni \times jpnj$, 
    361 leading to the elimination of $jpni \times jpnj - jpnij$ land processors. 
    362 When those parameters are specified in \nam{mpp} namelist, 
    363 the algorithm in the \rou{inimpp2} routine sets each processor's parameters (nbound, nono, noea,...) so that 
    364 the land-only processors are not taken into account. 
    365  
    366 \gmcomment{Note that the inimpp2 routine is general so that the original inimpp 
    367 routine should be suppressed from the code.} 
    368  
    369 When land processors are eliminated, 
    370 the value corresponding to these locations in the model output files is undefined. 
    371 Note that this is a problem for the meshmask file which requires to be defined over the whole domain. 
    372 Therefore, user should not eliminate land processors when creating a meshmask file 
    373 (\ie\ when setting a non-zero value to \np{nn\_msh}). 
    374  
    375 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     308with $1 \leq i \leq jpi$, $1  \leq j \leq jpj $ , and  $1  \leq k \leq jpk$. 
     309 
     310The 1-d arrays $mig(1:\jp{jpi})$ and $mjg(1:\jp{jpj})$, defined in \rou{dom\_glo} routine (\mdl{domain} module), should be used to get global domain indices from local domain indices. The 1-d arrays, $mi0(1:\jp{jpiglo})$, $mi1(1:\jp{jpiglo})$ and $mj0(1:\jp{jpjglo})$, $mj1(1:\jp{jpjglo})$ have the reverse purpose and should be used to define loop indices expressed in global domain indices (see examples in \mdl{dtastd} module).\\ 
     311 
     312The \NEMO\ model computes equation terms with the help of mask arrays (0 on land points and 1 on sea points). It is therefore possible that an MPI subdomain contains only land points. To save ressources, we try to supress from the computational domain as much land subdomains as possible. For example if $N_{mpi}$ processes are allocated to NEMO, the domain decomposition will be given by the following equation: 
     313\[ 
     314  N_{mpi} = jpni \times jpnj - N_{land} + N_{useless} 
     315\] 
     316$N_{land}$ is the total number of land subdomains in the domain decomposition defined by \np{jpni}{jpni} and \np{jpnj}{jpnj}. $N_{useless}$ is the number of land subdomains that are kept in the compuational domain in order to make sure that $N_{mpi}$ MPI processes are indeed allocated to a given subdomain. The values of $N_{mpi}$, \np{jpni}{jpni}, \np{jpnj}{jpnj},  $N_{land}$ and $N_{useless}$ are printed in the output file \texttt{ocean.output}. $N_{useless}$ must, of course, be as small as possible to limit the waste of ressources. A warning is issued in  \texttt{ocean.output} if $N_{useless}$ is not zero. Note that non-zero value of $N_{useless}$ is uselly required when using AGRIF as, up to now, the parent grid and each of the child grids must use all the $N_{mpi}$ processes. 
     317 
     318If the domain decomposition is automatically defined (when \np{jpni}{jpni} and \np{jpnj}{jpnj} are < 1), the decomposition chosen by the model will minimise the sub-domain size (defined as $max_{all domains}(jpi \times jpj)$) and maximize the number of eliminated land subdomains. This means that no other domain decomposition (a set of \np{jpni}{jpni} and \np{jpnj}{jpnj} values) will use less processes than $(jpni  \times  jpnj - N_{land})$ and get a smaller subdomain size. 
     319In order to specify $N_{mpi}$ properly (minimize $N_{useless}$), you must run the model once with \np{ln_list}{ln\_list} activated. In this case, the model will start the initialisation phase, print the list of optimum decompositions ($N_{mpi}$, \np{jpni}{jpni} and \np{jpnj}{jpnj}) in \texttt{ocean.output} and directly abort. The maximum value of $N_{mpi}$ tested in this list is given by $max(N_{MPI\_tasks}, jpni \times jpnj)$. For example, run the model on 40 nodes with ln\_list activated and $jpni = 10000$ and $jpnj = 1$, will print the list of optimum domains decomposition from 1 to about 10000. 
     320 
     321Processors are numbered from 0 to $N_{mpi} - 1$. Subdomains containning some ocean points are numbered first from 0 to $jpni * jpnj - N_{land} -1$. The remaining $N_{useless}$ land subdomains are numbered next, which means that, for a given (\np{jpni}{jpni}, \np{jpnj}{jpnj}), the numbers attributed to he ocean subdomains do not vary with $N_{useless}$. 
     322 
     323When land processors are eliminated, the value corresponding to these locations in the model output files is undefined. \np{ln_mskland}{ln\_mskland} must be activated in order avoid Not a Number values in output files. Note that it is better to not eliminate land processors when creating a meshmask file (\ie\ when setting a non-zero value to \np{nn_msh}{nn\_msh}). 
     324 
    376325\begin{figure}[!ht] 
    377   \begin{center} 
    378     \includegraphics[width=\textwidth]{Fig_mppini2} 
    379     \caption { 
    380       \protect\label{fig:mppini2} 
    381       Example of Atlantic domain defined for the CLIPPER projet. 
    382       Initial grid is composed of 773 x 1236 horizontal points. 
    383       (a) the domain is split onto 9 \time 20 subdomains (jpni=9, jpnj=20). 
    384       52 subdomains are land areas. 
    385       (b) 52 subdomains are eliminated (white rectangles) and 
    386       the resulting number of processors really used during the computation is jpnij=128. 
    387     } 
    388   \end{center} 
     326  \centering 
     327  \includegraphics[width=0.66\textwidth]{LBC_mppini2} 
     328  \caption[Atlantic domain defined for the CLIPPER projet]{ 
     329    Example of Atlantic domain defined for the CLIPPER projet. 
     330    Initial grid is composed of 773 x 1236 horizontal points. 
     331    (a) the domain is split onto 9 $times$ 20 subdomains (jpni=9, jpnj=20). 
     332    52 subdomains are land areas. 
     333    (b) 52 subdomains are eliminated (white rectangles) and 
     334    the resulting number of processors really used during the computation is jpnij=128.} 
     335  \label{fig:LBC_mppini2} 
    389336\end{figure} 
    390 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    391  
    392  
    393 % ==================================================================== 
    394 % Unstructured open boundaries BDY 
    395 % ==================================================================== 
     337 
     338%% ================================================================================================= 
    396339\section{Unstructured open boundary conditions (BDY)} 
    397340\label{sec:LBC_bdy} 
    398341 
    399 %-----------------------------------------nambdy-------------------------------------------- 
    400  
    401 \nlst{nambdy} 
    402 %----------------------------------------------------------------------------------------------- 
    403 %-----------------------------------------nambdy_dta-------------------------------------------- 
    404  
    405 \nlst{nambdy_dta} 
    406 %----------------------------------------------------------------------------------------------- 
    407  
    408 Options are defined through the \nam{bdy} \nam{bdy\_dta} namelist variables. 
     342\begin{listing} 
     343  \nlst{nambdy} 
     344  \caption{\forcode{&nambdy}} 
     345  \label{lst:nambdy} 
     346\end{listing} 
     347 
     348\begin{listing} 
     349  \nlst{nambdy_dta} 
     350  \caption{\forcode{&nambdy_dta}} 
     351  \label{lst:nambdy_dta} 
     352\end{listing} 
     353 
     354Options are defined through the \nam{bdy}{bdy} and \nam{bdy_dta}{bdy\_dta} namelist variables. 
    409355The BDY module is the core implementation of open boundary conditions for regional configurations on 
    410 temperature, salinity, barotropic and baroclinic velocities, as well as ice concentration, ice and snow thicknesses. 
     356ocean temperature, salinity, barotropic-baroclinic velocities, ice-snow concentration, thicknesses, temperatures, salinity and melt ponds concentration and thickness. 
    411357 
    412358The BDY module was modelled on the OBC module (see \NEMO\ 3.4) and shares many features and 
     
    417363See the section on the Input Boundary Data Files for details. 
    418364 
    419 %---------------------------------------------- 
     365%% ================================================================================================= 
    420366\subsection{Namelists} 
    421 \label{subsec:BDY_namelist} 
    422  
    423 The BDY module is activated by setting \np{ln\_bdy}\forcode{ = .true.} . 
     367\label{subsec:LBC_bdy_namelist} 
     368 
     369The BDY module is activated by setting \np[=.true.]{ln_bdy}{ln\_bdy} . 
    424370It is possible to define more than one boundary ``set'' and apply different boundary conditions to each set. 
    425 The number of boundary sets is defined by \np{nb\_bdy}. 
    426 Each boundary set may be defined as a set of straight line segments in a namelist 
    427 (\np{ln\_coords\_file}\forcode{ = .false.}) or read in from a file (\np{ln\_coords\_file}\forcode{ = .true.}). 
    428 If the set is defined in a namelist, then the namelists \nam{bdy\_index} must be included separately, one for each set. 
    429 If the set is defined by a file, then a ``\ifile{coordinates.bdy}'' file must be provided. 
     371The number of boundary sets is defined by \np{nb_bdy}{nb\_bdy}. 
     372Each boundary set can be either defined as a series of straight line segments directly in the namelist 
     373(\np[=.false.]{ln_coords_file}{ln\_coords\_file}, and a namelist block \nam{bdy_index}{bdy\_index} must be included for each set) or read in from a file (\np[=.true.]{ln_coords_file}{ln\_coords\_file}, and a ``\ifile{coordinates.bdy}'' file must be provided). 
    430374The coordinates.bdy file is analagous to the usual \NEMO\ ``\ifile{coordinates}'' file. 
    431375In the example above, there are two boundary sets, the first of which is defined via a file and 
    432 the second is defined in a namelist. 
    433 For more details of the definition of the boundary geometry see section \autoref{subsec:BDY_geometry}. 
     376the second is defined in the namelist. 
     377For more details of the definition of the boundary geometry see section \autoref{subsec:LBC_bdy_geometry}. 
    434378 
    435379For each boundary set a boundary condition has to be chosen for the barotropic solution 
    436380(``u2d'':sea-surface height and barotropic velocities), for the baroclinic velocities (``u3d''), 
    437 for the active tracers \footnote{The BDY module does not deal with passive tracers at this version} (``tra''), and sea-ice (``ice''). 
    438 For each set of variables there is a choice of algorithm and a choice for the data, 
    439 eg. for the active tracers the algorithm is set by \np{cn\_tra} and the choice of data is set by \np{nn\_tra\_dta}.\\ 
     381for the active tracers \footnote{The BDY module does not deal with passive tracers at this version} (``tra''), and for sea-ice (``ice''). 
     382For each set of variables one has to choose an algorithm and the boundary data (set resp. by \np{cn_tra}{cn\_tra} and \np{nn_tra_dta}{nn\_tra\_dta} for tracers).\\ 
    440383 
    441384The choice of algorithm is currently as follows: 
    442385 
    443386\begin{description} 
    444 \item[\forcode{'none'}:] No boundary condition applied. 
     387\item [\forcode{'none'}:] No boundary condition applied. 
    445388  So the solution will ``see'' the land points around the edge of the edge of the domain. 
    446 \item[\forcode{'specified'}:] Specified boundary condition applied (only available for baroclinic velocity and tracer variables). 
    447 \item[\forcode{'neumann'}:] Value at the boundary are duplicated (No gradient). Only available for baroclinic velocity and tracer variables. 
    448 \item[\forcode{'frs'}:] Flow Relaxation Scheme (FRS) available for all variables. 
    449 \item[\forcode{'Orlanski'}:] Orlanski radiation scheme (fully oblique) for barotropic, baroclinic and tracer variables. 
    450 \item[\forcode{'Orlanski_npo'}:] Orlanski radiation scheme for barotropic, baroclinic and tracer variables. 
    451 \item[\forcode{'flather'}:] Flather radiation scheme for the barotropic variables only. 
     389\item [\forcode{'specified'}:] Specified boundary condition applied (only available for baroclinic velocity and tracer variables). 
     390\item [\forcode{'neumann'}:] Value at the boundary are duplicated (No gradient). Only available for baroclinic velocity and tracer variables. 
     391\item [\forcode{'frs'}:] Flow Relaxation Scheme (FRS) available for all variables. 
     392\item [\forcode{'Orlanski'}:] Orlanski radiation scheme (fully oblique) for barotropic, baroclinic and tracer variables. 
     393\item [\forcode{'Orlanski_npo'}:] Orlanski radiation scheme for barotropic, baroclinic and tracer variables. 
     394\item [\forcode{'flather'}:] Flather radiation scheme for the barotropic variables only. 
    452395\end{description} 
    453396 
    454 The main choice for the boundary data is to use initial conditions as boundary data 
    455 (\np{nn\_tra\_dta}\forcode{ = 0}) or to use external data from a file (\np{nn\_tra\_dta}\forcode{ = 1}). 
     397The boundary data is either set to initial conditions 
     398(\np[=0]{nn_tra_dta}{nn\_tra\_dta}) or forced with external data from a file (\np[=1]{nn_tra_dta}{nn\_tra\_dta}). 
    456399In case the 3d velocity data contain the total velocity (ie, baroclinic and barotropic velocity), 
    457 the bdy code can derived baroclinic and barotropic velocities by setting \np{ln\_full\_vel}\forcode{ = .true. } 
     400the bdy code can derived baroclinic and barotropic velocities by setting \np[=.true.]{ln_full_vel}{ln\_full\_vel} 
    458401For the barotropic solution there is also the option to use tidal harmonic forcing either by 
    459 itself (\np{nn\_dyn2d\_dta}\forcode{ = 2}) or in addition to other external data (\np{nn\_dyn2d\_dta}\forcode{ = 3}).\\ 
    460 Sea-ice salinity, temperature and age data at the boundary are constant and defined repectively by \np{rn\_ice\_sal}, \np{rn\_ice\_tem} and \np{rn\_ice\_age}. 
    461  
    462 If external boundary data is required then the \nam{bdy\_dta} namelist must be defined. 
    463 One \nam{bdy\_dta} namelist is required for each boundary set, adopting the same order of indexes in which the boundary sets are defined in nambdy. 
    464 In the example given, two boundary sets have been defined. The first one is reading data file in the \nam{bdy\_dta} namelist shown above 
     402itself (\np[=2]{nn_dyn2d_dta}{nn\_dyn2d\_dta}) or in addition to other external data (\np[=3]{nn_dyn2d_dta}{nn\_dyn2d\_dta}).\\ 
     403If not set to initial conditions, sea-ice salinity, temperatures and melt ponds data at the boundary can either be read in a file or defined as constant (by \np{rn_ice_sal}{rn\_ice\_sal}, \np{rn_ice_tem}{rn\_ice\_tem}, \np{rn_ice_apnd}{rn\_ice\_apnd}, \np{rn_ice_hpnd}{rn\_ice\_hpnd}). Ice age is constant and defined by \np{rn_ice_age}{rn\_ice\_age}. 
     404 
     405If external boundary data is required then the \nam{bdy_dta}{bdy\_dta} namelist must be defined. 
     406One \nam{bdy_dta}{bdy\_dta} namelist is required for each boundary set, adopting the same order of indexes in which the boundary sets are defined in nambdy. 
     407In the example given, two boundary sets have been defined. The first one is reading data file in the \nam{bdy_dta}{bdy\_dta} namelist shown above 
    465408and the second one is using data from intial condition (no namelist block needed). 
    466409The boundary data is read in using the fldread module, 
    467 so the \nam{bdy\_dta} namelist is in the format required for fldread. 
     410so the \nam{bdy_dta}{bdy\_dta} namelist is in the format required for fldread. 
    468411For each required variable, the filename, the frequency of the files and 
    469412the frequency of the data in the files are given. 
    470 Also whether or not time-interpolation is required and whether the data is climatological (time-cyclic) data.\\ 
     413Also whether or not time-interpolation is required and whether the data is climatological (time-cyclic) data. 
     414For sea-ice salinity, temperatures and melt ponds, reading the files are skipped and constant values are used if filenames are defined as {'NOT USED'}.\\ 
    471415 
    472416There is currently an option to vertically interpolate the open boundary data onto the native grid at run-time. 
    473 If \np{nn\_bdy\_jpk} $< -1$, it is assumed that the lateral boundary data are already on the native grid. 
    474 However, if \np{nn\_bdy\_jpk} is set to the number of vertical levels present in the boundary data, 
     417If \np{nn_bdy_jpk}{nn\_bdy\_jpk}$<-1$, it is assumed that the lateral boundary data are already on the native grid. 
     418However, if \np{nn_bdy_jpk}{nn\_bdy\_jpk} is set to the number of vertical levels present in the boundary data, 
    475419a bilinear interpolation onto the native grid will be triggered at runtime. 
    476420For this to be successful the additional variables: $gdept$, $gdepu$, $gdepv$, $e3t$, $e3u$ and $e3v$, are required to be present in the lateral boundary files. 
     
    486430FRS conditions are applied on temperature and salinity and climatological data is read from initial condition files. 
    487431 
    488 %---------------------------------------------- 
     432%% ================================================================================================= 
    489433\subsection{Flow relaxation scheme} 
    490 \label{subsec:BDY_FRS_scheme} 
     434\label{subsec:LBC_bdy_FRS_scheme} 
    491435 
    492436The Flow Relaxation Scheme (FRS) \citep{davies_QJRMS76,engedahl_T95}, 
     
    495439Given a model prognostic variable $\Phi$ 
    496440\[ 
    497   % \label{eq:bdy_frs1} 
     441  % \label{eq:LBC_bdy_frs1} 
    498442  \Phi(d) = \alpha(d)\Phi_{e}(d) + (1-\alpha(d))\Phi_{m}(d)\;\;\;\;\; d=1,N 
    499443\] 
     
    504448the prognostic equation for $\Phi$ of the form: 
    505449\[ 
    506   % \label{eq:bdy_frs2} 
     450  % \label{eq:LBC_bdy_frs2} 
    507451  -\frac{1}{\tau}\left(\Phi - \Phi_{e}\right) 
    508452\] 
    509453where the relaxation time scale $\tau$ is given by a function of $\alpha$ and the model time step $\Delta t$: 
    510454\[ 
    511   % \label{eq:bdy_frs3} 
     455  % \label{eq:LBC_bdy_frs3} 
    512456  \tau = \frac{1-\alpha}{\alpha}  \,\rdt 
    513457\] 
     
    519463The function $\alpha$ is specified as a $tanh$ function: 
    520464\[ 
    521   % \label{eq:bdy_frs4} 
     465  % \label{eq:LBC_bdy_frs4} 
    522466  \alpha(d) = 1 - \tanh\left(\frac{d-1}{2}\right),       \quad d=1,N 
    523467\] 
    524 The width of the FRS zone is specified in the namelist as \np{nn\_rimwidth}. 
     468The width of the FRS zone is specified in the namelist as \np{nn_rimwidth}{nn\_rimwidth}. 
    525469This is typically set to a value between 8 and 10. 
    526470 
    527 %---------------------------------------------- 
     471%% ================================================================================================= 
    528472\subsection{Flather radiation scheme} 
    529 \label{subsec:BDY_flather_scheme} 
     473\label{subsec:LBC_bdy_flather_scheme} 
    530474 
    531475The \citet{flather_JPO94} scheme is a radiation condition on the normal, 
    532476depth-mean transport across the open boundary. 
    533477It takes the form 
    534 \begin{equation}  \label{eq:bdy_fla1} 
    535 U = U_{e} + \frac{c}{h}\left(\eta - \eta_{e}\right), 
     478\begin{equation} 
     479  \label{eq:LBC_bdy_fla1} 
     480  U = U_{e} + \frac{c}{h}\left(\eta - \eta_{e}\right), 
    536481\end{equation} 
    537482where $U$ is the depth-mean velocity normal to the boundary and $\eta$ is the sea surface height, 
     
    542487the external depth-mean normal velocity, 
    543488plus a correction term that allows gravity waves generated internally to exit the model boundary. 
    544 Note that the sea-surface height gradient in \autoref{eq:bdy_fla1} is a spatial gradient across the model boundary, 
     489Note that the sea-surface height gradient in \autoref{eq:LBC_bdy_fla1} is a spatial gradient across the model boundary, 
    545490so that $\eta_{e}$ is defined on the $T$ points with $nbr=1$ and $\eta$ is defined on the $T$ points with $nbr=2$. 
    546491$U$ and $U_{e}$ are defined on the $U$ or $V$ points with $nbr=1$, \ie\ between the two $T$ grid points. 
    547492 
    548 %---------------------------------------------- 
     493%% ================================================================================================= 
    549494\subsection{Orlanski radiation scheme} 
    550 \label{subsec:BDY_orlanski_scheme} 
     495\label{subsec:LBC_bdy_orlanski_scheme} 
    551496 
    552497The Orlanski scheme is based on the algorithm described by \citep{marchesiello.mcwilliams.ea_OM01}, hereafter MMS. 
     
    554499The adaptive Orlanski condition solves a wave plus relaxation equation at the boundary: 
    555500\begin{equation} 
    556 \frac{\partial\phi}{\partial t} + c_x \frac{\partial\phi}{\partial x} + c_y \frac{\partial\phi}{\partial y} = 
    557                                                 -\frac{1}{\tau}(\phi - \phi^{ext}) 
    558 \label{eq:wave_continuous} 
     501  \label{eq:LBC_wave_continuous} 
     502  \frac{\partial\phi}{\partial t} + c_x \frac{\partial\phi}{\partial x} + c_y \frac{\partial\phi}{\partial y} = 
     503  -\frac{1}{\tau}(\phi - \phi^{ext}) 
    559504\end{equation} 
    560505 
     
    562507velocities are diagnosed from the model fields as: 
    563508 
    564 \begin{equation} \label{eq:cx} 
    565 c_x = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial x}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2} 
     509\begin{equation} 
     510  \label{eq:LBC_cx} 
     511  c_x = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial x}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2} 
    566512\end{equation} 
    567513\begin{equation} 
    568 \label{eq:cy} 
    569 c_y = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial y}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2} 
     514  \label{eq:LBC_cy} 
     515  c_y = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial y}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2} 
    570516\end{equation} 
    571517 
    572518(As noted by MMS, this is a circular diagnosis of the phase speeds which only makes sense on a discrete grid). 
    573 Equation (\autoref{eq:wave_continuous}) is defined adaptively depending on the sign of the phase velocity normal to the boundary $c_x$. 
     519Equation (\autoref{eq:LBC_wave_continuous}) is defined adaptively depending on the sign of the phase velocity normal to the boundary $c_x$. 
    574520For $c_x$ outward, we have 
    575521 
     
    581527 
    582528\begin{equation} 
    583 \tau = \tau_{in}\,\,\,;\,\,\, c_x = c_y = 0 
    584 \label{eq:tau_in} 
     529  \label{eq:LBC_tau_in} 
     530  \tau = \tau_{in}\,\,\,;\,\,\, c_x = c_y = 0 
    585531\end{equation} 
    586532 
    587 Generally the relaxation time scale at inward propagation points (\np{rn\_time\_dmp}) is set much shorter than the time scale at outward propagation 
    588 points (\np{rn\_time\_dmp\_out}) so that the solution is constrained more strongly by the external data at inward propagation points. 
    589 See \autoref{subsec:BDY_relaxation} for detailed on the spatial shape of the scaling.\\ 
     533Generally the relaxation time scale at inward propagation points (\np{rn_time_dmp}{rn\_time\_dmp}) is set much shorter than the time scale at outward propagation 
     534points (\np{rn_time_dmp_out}{rn\_time\_dmp\_out}) so that the solution is constrained more strongly by the external data at inward propagation points. 
     535See \autoref{subsec:LBC_bdy_relaxation} for detailed on the spatial shape of the scaling.\\ 
    590536The ``normal propagation of oblique radiation'' or NPO approximation (called \forcode{'orlanski_npo'}) involves assuming 
    591 that $c_y$ is zero in equation (\autoref{eq:wave_continuous}), but including 
    592 this term in the denominator of equation (\autoref{eq:cx}). Both versions of the scheme are options in BDY. Equations 
    593 (\autoref{eq:wave_continuous}) - (\autoref{eq:tau_in}) correspond to equations (13) - (15) and (2) - (3) in MMS.\\ 
    594  
    595 %---------------------------------------------- 
     537that $c_y$ is zero in equation (\autoref{eq:LBC_wave_continuous}), but including 
     538this term in the denominator of equation (\autoref{eq:LBC_cx}). Both versions of the scheme are options in BDY. Equations 
     539(\autoref{eq:LBC_wave_continuous}) - (\autoref{eq:LBC_tau_in}) correspond to equations (13) - (15) and (2) - (3) in MMS.\\ 
     540 
     541%% ================================================================================================= 
    596542\subsection{Relaxation at the boundary} 
    597 \label{subsec:BDY_relaxation} 
    598  
    599 In addition to a specific boundary condition specified as \np{cn\_tra} and \np{cn\_dyn3d}, relaxation on baroclinic velocities and tracers variables are available. 
    600 It is control by the namelist parameter \np{ln\_tra\_dmp} and \np{ln\_dyn3d\_dmp} for each boundary set. 
    601  
    602 The relaxation time scale value (\np{rn\_time\_dmp} and \np{rn\_time\_dmp\_out}, $\tau$) are defined at the boundaries itself. 
    603 This time scale ($\alpha$) is weighted by the distance ($d$) from the boundary over \np{nn\_rimwidth} cells ($N$): 
     543\label{subsec:LBC_bdy_relaxation} 
     544 
     545In addition to a specific boundary condition specified as \np{cn_tra}{cn\_tra} and \np{cn_dyn3d}{cn\_dyn3d}, relaxation on baroclinic velocities and tracers variables are available. 
     546It is control by the namelist parameter \np{ln_tra_dmp}{ln\_tra\_dmp} and \np{ln_dyn3d_dmp}{ln\_dyn3d\_dmp} for each boundary set. 
     547 
     548The relaxation time scale value (\np{rn_time_dmp}{rn\_time\_dmp} and \np{rn_time_dmp_out}{rn\_time\_dmp\_out}, $\tau$) are defined at the boundaries itself. 
     549This time scale ($\alpha$) is weighted by the distance ($d$) from the boundary over \np{nn_rimwidth}{nn\_rimwidth} cells ($N$): 
    604550 
    605551\[ 
     
    609555The same scaling is applied in the Orlanski damping. 
    610556 
    611 %---------------------------------------------- 
     557%% ================================================================================================= 
    612558\subsection{Boundary geometry} 
    613 \label{subsec:BDY_geometry} 
     559\label{subsec:LBC_bdy_geometry} 
    614560 
    615561Each open boundary set is defined as a list of points. 
     
    620566the boundary point is increasingly further away from the edge of the model domain. 
    621567A set of $nbi$, $nbj$, and $nbr$ arrays is defined for each of the $T$, $U$ and $V$ grids. 
    622 Figure \autoref{fig:LBC_bdy_geom} shows an example of an irregular boundary. 
     568\autoref{fig:LBC_bdy_geom} shows an example of an irregular boundary. 
    623569 
    624570The boundary geometry for each set may be defined in a namelist nambdy\_index or 
     
    630576\jp{jpinft} give the start and end $i$ indices for each segment with similar for the other boundaries. 
    631577These segments define a list of $T$ grid points along the outermost row of the boundary ($nbr\,=\, 1$). 
    632 The code deduces the $U$ and $V$ points and also the points for $nbr\,>\, 1$ if \np{nn\_rimwidth}\forcode{ > 1}. 
     578The code deduces the $U$ and $V$ points and also the points for $nbr\,>\, 1$ if \np[>1]{nn_rimwidth}{nn\_rimwidth}. 
    633579 
    634580The boundary geometry may also be defined from a ``\ifile{coordinates.bdy}'' file. 
    635 Figure \autoref{fig:LBC_nc_header} gives an example of the header information from such a file, based on the description of geometrical setup given above. 
     581\autoref{fig:LBC_nc_header} gives an example of the header information from such a file, based on the description of geometrical setup given above. 
    636582The file should contain the index arrays for each of the $T$, $U$ and $V$ grids. 
    637583The arrays must be in order of increasing $nbr$. 
     
    645591For example, if an open boundary is defined along an isobath, say at the shelf break, 
    646592then the areas of ocean outside of this boundary will need to be masked out. 
    647 This can be done by reading a mask file defined as \np{cn\_mask\_file} in the nam\_bdy namelist. 
     593This can be done by reading a mask file defined as \np{cn_mask_file}{cn\_mask\_file} in the nam\_bdy namelist. 
    648594Only one mask file is used even if multiple boundary sets are defined. 
    649595 
    650 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    651596\begin{figure}[!t] 
    652   \begin{center} 
    653     \includegraphics[width=\textwidth]{Fig_LBC_bdy_geom} 
    654     \caption { 
    655       \protect\label{fig:LBC_bdy_geom} 
    656       Example of geometry of unstructured open boundary 
    657     } 
    658   \end{center} 
     597  \centering 
     598  \includegraphics[width=0.66\textwidth]{LBC_bdy_geom} 
     599  \caption[Geometry of unstructured open boundary]{Example of geometry of unstructured open boundary} 
     600  \label{fig:LBC_bdy_geom} 
    659601\end{figure} 
    660 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    661  
    662 %---------------------------------------------- 
     602 
     603%% ================================================================================================= 
    663604\subsection{Input boundary data files} 
    664 \label{subsec:BDY_data} 
     605\label{subsec:LBC_bdy_data} 
    665606 
    666607The data files contain the data arrays in the order in which the points are defined in the $nbi$ and $nbj$ arrays. 
     
    685626These restrictions mean that data files used with versions of the 
    686627model prior to Version 3.4 may not work with Version 3.4 onwards. 
    687 A \fortran utility {\itshape bdy\_reorder} exists in the TOOLS directory which 
     628A \fortran\ utility {\itshape bdy\_reorder} exists in the TOOLS directory which 
    688629will re-order the data in old BDY data files. 
    689630 
    690 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    691631\begin{figure}[!t] 
    692   \begin{center} 
    693     \includegraphics[width=\textwidth]{Fig_LBC_nc_header} 
    694     \caption { 
    695       \protect\label{fig:LBC_nc_header} 
    696       Example of the header for a \protect\ifile{coordinates.bdy} file 
    697     } 
    698   \end{center} 
     632  \centering 
     633  \includegraphics[width=0.66\textwidth]{LBC_nc_header} 
     634  \caption[Header for a \protect\ifile{coordinates.bdy} file]{ 
     635    Example of the header for a \protect\ifile{coordinates.bdy} file} 
     636  \label{fig:LBC_nc_header} 
    699637\end{figure} 
    700 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    701  
    702 %---------------------------------------------- 
     638 
     639%% ================================================================================================= 
    703640\subsection{Volume correction} 
    704 \label{subsec:BDY_vol_corr} 
     641\label{subsec:LBC_bdy_vol_corr} 
    705642 
    706643There is an option to force the total volume in the regional model to be constant. 
    707 This is controlled  by the \np{ln\_vol} parameter in the namelist. 
    708 A value of \np{ln\_vol}\forcode{ = .false.} indicates that this option is not used. 
    709 Two options to control the volume are available (\np{nn\_volctl}). 
    710 If \np{nn\_volctl}\forcode{ = 0} then a correction is applied to the normal barotropic velocities around the boundary at 
     644This is controlled  by the \np{ln_vol}{ln\_vol} parameter in the namelist. 
     645A value of \np[=.false.]{ln_vol}{ln\_vol} indicates that this option is not used. 
     646Two options to control the volume are available (\np{nn_volctl}{nn\_volctl}). 
     647If \np[=0]{nn_volctl}{nn\_volctl} then a correction is applied to the normal barotropic velocities around the boundary at 
    711648each timestep to ensure that the integrated volume flow through the boundary is zero. 
    712 If \np{nn\_volctl}\forcode{ = 1} then the calculation of the volume change on 
     649If \np[=1]{nn_volctl}{nn\_volctl} then the calculation of the volume change on 
    713650the timestep includes the change due to the freshwater flux across the surface and 
    714651the correction velocity corrects for this as well. 
     
    717654applied to all boundaries at once. 
    718655 
    719 %---------------------------------------------- 
     656%% ================================================================================================= 
    720657\subsection{Tidal harmonic forcing} 
    721 \label{subsec:BDY_tides} 
    722  
    723 %-----------------------------------------nambdy_tide-------------------------------------------- 
    724  
    725 \nlst{nambdy_tide} 
    726 %----------------------------------------------------------------------------------------------- 
     658\label{subsec:LBC_bdy_tides} 
     659 
     660\begin{listing} 
     661  \nlst{nambdy_tide} 
     662  \caption{\forcode{&nambdy_tide}} 
     663  \label{lst:nambdy_tide} 
     664\end{listing} 
    727665 
    728666Tidal forcing at open boundaries requires the activation of surface 
    729 tides (i.e., in \nam{\_tide}, \np{ln\_tide} needs to be set to 
     667tides (i.e., in \nam{_tide}{\_tide}, \np{ln_tide}{ln\_tide} needs to be set to 
    730668\forcode{.true.} and the required constituents need to be activated by 
    731 including their names in the \np{clname} array; see 
     669including their names in the \np{clname}{clname} array; see 
    732670\autoref{sec:SBC_tide}). Specific options related to the reading in of 
    733671the complex harmonic amplitudes of elevation (SSH) and barotropic 
    734672velocity (u,v) at open boundaries are defined through the 
    735 \nam{bdy\_tide} namelist parameters.\\ 
     673\nam{bdy_tide}{bdy\_tide} namelist parameters.\\ 
    736674 
    737675The tidal harmonic data at open boundaries can be specified in two 
    738676different ways, either on a two-dimensional grid covering the entire 
    739677model domain or along open boundary segments; these two variants can 
    740 be selected by setting \np{ln\_bdytide\_2ddta } to \forcode{.true.} or 
     678be selected by setting \np{ln_bdytide_2ddta }{ln\_bdytide\_2ddta } to \forcode{.true.} or 
    741679\forcode{.false.}, respectively. In either case, the real and 
    742680imaginary parts of SSH and the two barotropic velocity components for 
     
    744682separately: when two-dimensional data is used, variables 
    745683\textit{tcname\_z1} and \textit{tcname\_z2} for real and imaginary SSH, 
    746 respectively, are expected in input file \np{filtide} with suffix 
     684respectively, are expected in input file \np{filtide}{filtide} with suffix 
    747685\ifile{\_grid\_T}, variables \textit{tcname\_u1} and 
    748686\textit{tcname\_u2} for real and imaginary u, respectively, are 
    749 expected in input file \np{filtide} with suffix \ifile{\_grid\_U}, and 
     687expected in input file \np{filtide}{filtide} with suffix \ifile{\_grid\_U}, and 
    750688\textit{tcname\_v1} and \textit{tcname\_v2} for real and imaginary v, 
    751 respectively, are expected in input file \np{filtide} with suffix 
     689respectively, are expected in input file \np{filtide}{filtide} with suffix 
    752690\ifile{\_grid\_V}; when data along open boundary segments is used, 
    753691variables \textit{z1} and \textit{z2} (real and imaginary part of SSH) 
    754 are expected to be available from file \np{filtide} with suffix 
     692are expected to be available from file \np{filtide}{filtide} with suffix 
    755693\ifile{tcname\_grid\_T}, variables \textit{u1} and \textit{u2} (real 
    756694and imaginary part of u) are expected to be available from file 
    757 \np{filtide} with suffix \ifile{tcname\_grid\_U}, and variables 
     695\np{filtide}{filtide} with suffix \ifile{tcname\_grid\_U}, and variables 
    758696\textit{v1} and \textit{v2} (real and imaginary part of v) are 
    759 expected to be available from file \np{filtide} with suffix 
    760 \ifile{tcname\_grid\_V}. If \np{ln\_bdytide\_conj} is set to 
     697expected to be available from file \np{filtide}{filtide} with suffix 
     698\ifile{tcname\_grid\_V}. If \np{ln_bdytide_conj}{ln\_bdytide\_conj} is set to 
    761699\forcode{.true.}, the data is expected to be in complex conjugate 
    762700form. 
     
    770708direction of rotation). %, e.g. anticlockwise or clockwise. 
    771709 
    772 \biblio 
    773  
    774 \pindex 
     710\onlyinsubfile{\input{../../global/epilogue}} 
    775711 
    776712\end{document} 
Note: See TracChangeset for help on using the changeset viewer.