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.
Chap_LBC.tex in branches/nemo_v3_3_beta/DOC/TexFiles/Chapters – NEMO

source: branches/nemo_v3_3_beta/DOC/TexFiles/Chapters/Chap_LBC.tex @ 2298

Last change on this file since 2298 was 2282, checked in by gm, 14 years ago

ticket:#658 merge DOC of all the branches that form the v3.3 beta

  • Property svn:executable set to *
File size: 54.9 KB
Line 
1% ================================================================
2% Chapter Ñ Lateral Boundary Condition (LBC)
3% ================================================================
4\chapter{Lateral Boundary Condition (LBC) }
5\label{LBC}
6\minitoc
7
8\newpage
9$\ $\newline    % force a new ligne
10
11
12%gm% add here introduction to this chapter
13
14% ================================================================
15% Boundary Condition at the Coast
16% ================================================================
17\section{Boundary Condition at the Coast (\np{rn\_shlat})}
18\label{LBC_coast}
19%--------------------------------------------nam_lbc-------------------------------------------------------
20\namdisplay{namlbc} 
21%--------------------------------------------------------------------------------------------------------------
22
23%The lateral ocean boundary conditions contiguous to coastlines are Neumann conditions for heat and salt (no flux across boundaries) and Dirichlet conditions for momentum (ranging from free-slip to "strong" no-slip). They are handled automatically by the mask system (see \S\ref{DOM_msk}).
24
25%OPA allows land and topography grid points in the computational domain due to the presence of continents or islands, and includes the use of a full or partial step representation of bottom topography. The computation is performed over the whole domain, i.e. we do not try to restrict the computation to ocean-only points. This choice has two motivations. Firstly, working on ocean only grid points overloads the code and harms the code readability. Secondly, and more importantly, it drastically reduces the vector portion of the computation, leading to a dramatic increase of CPU time requirement on vector computers.  The current section describes how the masking affects the computation of the various terms of the equations with respect to the boundary condition at solid walls. The process of defining which areas are to be masked is described in \S\ref{DOM_msk}.
26
27The discrete representation of a domain with complex boundaries (coastlines and
28bottom topography) leads to arrays that include large portions where a computation
29is not required as the model variables remain at zero. Nevertheless, vectorial
30supercomputers are far more efficient when computing over a whole array, and the
31readability of a code is greatly improved when boundary conditions are applied in
32an automatic way rather than by a specific computation before or after each
33computational loop. An efficient way to work over the whole domain while specifying
34the boundary conditions, is to use multiplication by mask arrays in the computation.
35A mask array is a matrix whose elements are $1$ in the ocean domain and $0$ 
36elsewhere. A simple multiplication of a variable by its own mask ensures that it will
37remain zero over land areas. Since most of the boundary conditions consist of a
38zero flux across the solid boundaries, they can be simply applied by multiplying
39variables by the correct mask arrays, $i.e.$ the mask array of the grid point where
40the flux is evaluated. For example, the heat flux in the \textbf{i}-direction is evaluated
41at $u$-points. Evaluating this quantity as,
42
43\begin{equation} \label{Eq_lbc_aaaa}
44\frac{A^{lT} }{e_1 }\frac{\partial T}{\partial i}\equiv \frac{A_u^{lT} 
45}{e_{1u} } \; \delta _{i+1 / 2} \left[ T \right]\;\;mask_u
46\end{equation}
47(where mask$_{u}$ is the mask array at a $u$-point) ensures that the heat flux is
48zero inside land and at the boundaries, since mask$_{u}$ is zero at solid boundaries
49which in this case are defined at $u$-points (normal velocity $u$ remains zero at
50the coast) (Fig.~\ref{Fig_LBC_uv}).
51
52%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
53\begin{figure}[!t] \label{Fig_LBC_uv}  \begin{center}
54\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_LBC_uv.pdf}
55\caption {Lateral boundary (thick line) at T-level. The velocity normal to the
56       boundary is set to zero.}
57\end{center}   \end{figure}
58%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
59
60For momentum the situation is a bit more complex as two boundary conditions
61must be provided along the coast (one each for the normal and tangential velocities).
62The boundary of the ocean in the C-grid is defined by the velocity-faces.
63For example, at a given $T$-level, the lateral boundary (a coastline or an intersection
64with the bottom topography) is made of segments joining $f$-points, and normal
65velocity points are located between two $f-$points (Fig.~\ref{Fig_LBC_uv}).
66The boundary condition on the normal velocity (no flux through solid boundaries)
67can thus be easily implemented using the mask system. The boundary condition
68on the tangential velocity requires a more specific treatment. This boundary
69condition influences the relative vorticity and momentum diffusive trends, and is
70required in order to compute the vorticity at the coast. Four different types of
71lateral boundary condition are available, controlled by the value of the \np{rn\_shlat} 
72namelist parameter. (The value of the mask$_{f}$ array along the coastline is set
73equal to this parameter.) These are:
74
75%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
76\begin{figure}[!p] \label{Fig_LBC_shlat}  \begin{center}
77\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_LBC_shlat.pdf}
78\caption {lateral boundary condition (a) free-slip ($rn\_shlat=0$) ; (b) no-slip ($rn\_shlat=2$)
79; (c) "partial" free-slip ($0<rn\_shlat<2$) and (d) "strong" no-slip ($2<rn\_shlat$).
80Implied "ghost" velocity inside land area is display in grey. }
81\end{center}   \end{figure}
82%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
83
84\begin{description}
85
86\item[free-slip boundary condition (\np{rn\_shlat}=0): ]  the tangential velocity at the
87coastline is equal to the offshore velocity, $i.e.$ the normal derivative of the
88tangential velocity is zero at the coast, so the vorticity: mask$_{f}$ array is set
89to zero inside the land and just at the coast (Fig.~\ref{Fig_LBC_shlat}-a).
90
91\item[no-slip boundary condition (\np{rn\_shlat}=2): ] the tangential velocity vanishes
92at the coastline. Assuming that the tangential velocity decreases linearly from
93the closest ocean velocity grid point to the coastline, the normal derivative is
94evaluated as if the velocities at the closest land velocity gridpoint and the closest
95ocean velocity gridpoint were of the same magnitude but in the opposite direction
96(Fig.~\ref{Fig_LBC_shlat}-b). Therefore, the vorticity along the coastlines is given by:
97
98\begin{equation*}
99\zeta \equiv 2 \left(\delta_{i+1/2} \left[e_{2v} v \right] - \delta_{j+1/2} \left[e_{1u} u \right] \right) / \left(e_{1f} e_{2f} \right) \ ,
100\end{equation*}
101where $u$ and $v$ are masked fields. Setting the mask$_{f}$ array to $2$ along
102the coastline provides a vorticity field computed with the no-slip boundary condition,
103simply by multiplying it by the mask$_{f}$ :
104\begin{equation} \label{Eq_lbc_bbbb}
105\zeta \equiv \frac{1}{e_{1f} {\kern 1pt}e_{2f} }\left( {\delta _{i+1/2} 
106\left[ {e_{2v} \,v} \right]-\delta _{j+1/2} \left[ {e_{1u} \,u} \right]} 
107\right)\;\mbox{mask}_f
108\end{equation}
109
110\item["partial" free-slip boundary condition (0$<$\np{rn\_shlat}$<$2): ] the tangential
111velocity at the coastline is smaller than the offshore velocity, $i.e.$ there is a lateral
112friction but not strong enough to make the tangential velocity at the coast vanish
113(Fig.~\ref{Fig_LBC_shlat}-c). This can be selected by providing a value of mask$_{f}$ 
114strictly inbetween $0$ and $2$.
115
116\item["strong" no-slip boundary condition (2$<$\np{rn\_shlat}): ] the viscous boundary
117layer is assumed to be smaller than half the grid size (Fig.~\ref{Fig_LBC_shlat}-d).
118The friction is thus larger than in the no-slip case.
119
120\end{description}
121
122Note that when the bottom topography is entirely represented by the $s$-coor-dinates
123(pure $s$-coordinate), the lateral boundary condition on tangential velocity is of much
124less importance as it is only applied next to the coast where the minimum water depth
125can be quite shallow.
126
127The alternative numerical implementation of the no-slip boundary conditions for an
128arbitrary coast line of \citet{Shchepetkin1996} is also available through the
129\key{noslip\_accurate} CPP key. It is based on a fourth order evaluation of the shear at the
130coast which, in turn, allows a true second order scheme in the interior of the domain
131($i.e.$ the numerical boundary scheme simulates the truncation error of the numerical
132scheme used in the interior of the domain). \citet{Shchepetkin1996} found that such a
133technique considerably improves the quality of the numerical solution. In \NEMO, such
134spectacular improvements have not been found in the half-degree global ocean
135(ORCA05), but significant reductions of numerically induced coastal upwellings were
136found in an eddy resolving simulation of the Alboran Sea \citep{Olivier_PhD01}.
137Nevertheless, since a no-slip boundary condition is not recommended in an eddy
138permitting or resolving simulation \citep{Penduff_al_OS07}, the use of this option is also
139not recommended.
140
141In practice, the no-slip accurate option changes the way the curl is evaluated at the
142coast (see \mdl{divcur} module), and requires the nature of each coastline grid point
143(convex or concave corners, straight north-south or east-west coast) to be specified. 
144This is performed in routine \rou{dom\_msk\_nsa} in the \mdl{domask} module.
145
146% ================================================================
147% Boundary Condition around the Model Domain
148% ================================================================
149\section{Model Domain Boundary Condition (\jp{jperio})}
150\label{LBC_jperio}
151
152At the model domain boundaries several choices are offered: closed, cyclic east-west,
153south symmetric across the equator, a north-fold, and combination closed-north fold
154or cyclic-north-fold. The north-fold boundary condition is associated with the 3-pole ORCA mesh.
155
156% -------------------------------------------------------------------------------------------------------------
157%        Closed, cyclic, south symmetric (\jp{jperio} = 0, 1 or 2)
158% -------------------------------------------------------------------------------------------------------------
159\subsection{Closed, cyclic, south symmetric (\jp{jperio} = 0, 1 or 2)}
160\label{LBC_jperio012}
161
162The choice of closed, cyclic or symmetric model domain boundary condition is made
163by setting \jp{jperio} to 0, 1 or 2 in file \mdl{par\_oce}. Each time such a boundary
164condition is needed, it is set by a call to routine \mdl{lbclnk}. The computation of
165momentum and tracer trends proceeds from $i=2$ to $i=jpi-1$ and from $j=2$ to
166$j=jpj-1$, $i.e.$ in the model interior. To choose a lateral model boundary condition
167is to specify the first and last rows and columns of the model variables.
168
169\begin{description}
170
171\item[For closed boundary (\textit{jperio=0})], solid walls are imposed at all model
172boundaries: first and last rows and columns are set to zero.
173
174\item[For cyclic east-west boundary (\textit{jperio=1})], first and last rows are set
175to zero (closed) whilst the first column is set to the value of the last-but-one column
176and the last column to the value of the second one (Fig.~\ref{Fig_LBC_jperio}-a).
177Whatever flows out of the eastern (western) end of the basin enters the western
178(eastern) end. Note that there is no option for north-south cyclic or for doubly
179cyclic cases.
180
181\item[For symmetric boundary condition across the equator (\textit{jperio=2})],
182last rows, and first and last columns are set to zero (closed). The row of symmetry
183is chosen to be the $u$- and $T-$points equator line ($j=2$, i.e. at the southern
184end of the domain). For arrays defined at $u-$ or $T-$points, the first row is set
185to the value of the third row while for most of $v$- and $f$-point arrays ($v$, $\zeta$,
186$j\psi$, but \gmcomment{not sure why this is "but"} scalar arrays such as eddy coefficients)
187the first row is set to minus the value of the second row (Fig.~\ref{Fig_LBC_jperio}-b).
188Note that this boundary condition is not yet available for the case of a massively
189parallel computer (\textbf{key{\_}mpp} defined).
190
191\end{description}
192
193%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
194\begin{figure}[!t] \label{Fig_LBC_jperio}  \begin{center}
195\includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_LBC_jperio.pdf}
196\caption {setting of (a) east-west cyclic  (b) symmetric across the equator boundary conditions.}
197\end{center}   \end{figure}
198%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
199
200% -------------------------------------------------------------------------------------------------------------
201%        North fold (\textit{jperio = 3 }to $6)$
202% -------------------------------------------------------------------------------------------------------------
203\subsection{North-fold (\textit{jperio = 3 }to $6)$ }
204\label{LBC_north_fold}
205
206The north fold boundary condition has been introduced in order to handle the north
207boundary of a three-polar ORCA grid. Such a grid has two poles in the northern hemisphere.
208\colorbox{yellow}{to be completed...}
209
210%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
211\begin{figure}[!t] \label{Fig_North_Fold_T}  \begin{center}
212\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_North_Fold_T.pdf}
213\caption {North fold boundary with a $T$-point pivot and cyclic east-west boundary condition
214($jperio=4$), as used in ORCA 2, 1/4, and 1/12. Pink shaded area corresponds to the inner
215domain mask (see text). }
216\end{center}   \end{figure}
217%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
218
219% ====================================================================
220% Exchange with neighbouring processors
221% ====================================================================
222\section  [Exchange with neighbouring processors (\textit{lbclnk}, \textit{lib\_mpp})]
223      {Exchange with neighbouring processors (\mdl{lbclnk}, \mdl{lib\_mpp})}
224\label{LBC_mpp}
225
226For massively parallel processing (mpp), a domain decomposition method is used.
227The basic idea of the method is to split the large computation domain of a numerical
228experiment into several smaller domains and solve the set of equations by addressing
229independent local problems. Each processor has its own local memory and computes
230the model equation over a subdomain of the whole model domain. The subdomain
231boundary conditions are specified through communications between processors
232which are organized by explicit statements (message passing method).
233
234A big advantage is that the method does not need many modifications of the initial
235FORTRAN code. From the modeller's point of view, each sub domain running on
236a processor is identical to the "mono-domain" code. In addition, the programmer
237manages the communications between subdomains, and the code is faster when
238the number of processors is increased. The porting of OPA code on an iPSC860
239was achieved during Guyon's PhD [Guyon et al. 1994, 1995] in collaboration with
240CETIIS and ONERA. The implementation in the operational context and the studies
241of performance on a T3D and T3E Cray computers have been made in collaboration
242with IDRIS and CNRS. The present implementation is largely inspired by Guyon's
243work  [Guyon 1995].
244
245The parallelization strategy is defined by the physical characteristics of the
246ocean model. Second order finite difference schemes lead to local discrete
247operators that depend at the very most on one neighbouring point. The only
248non-local computations concern the vertical physics (implicit diffusion, 1.5
249turbulent closure scheme, ...) (delocalization over the whole water column),
250and the solving of the elliptic equation associated with the surface pressure
251gradient computation (delocalization over the whole horizontal domain).
252Therefore, a pencil strategy is used for the data sub-structuration
253\gmcomment{no idea what this means!}
254: the 3D initial domain is laid out on local processor
255memories following a 2D horizontal topological splitting. Each sub-domain
256computes its own surface and bottom boundary conditions and has a side
257wall overlapping interface which defines the lateral boundary conditions for
258computations in the inner sub-domain. The overlapping area consists of the
259two rows at each edge of the sub-domain. After a computation, a communication
260phase starts: each processor sends to its neighbouring processors the update
261values of the points corresponding to the interior overlapping area to its
262neighbouring sub-domain (i.e. the innermost of the two overlapping rows).
263The communication is done through message passing. Usually the parallel virtual
264language, PVM, is used as it is a standard language available on  nearly  all
265MPP computers. More specific languages (i.e. computer dependant languages)
266can be easily used to speed up the communication, such as SHEM on a T3E
267computer. The data exchanges between processors are required at the very
268place where lateral domain boundary conditions are set in the mono-domain
269computation (\S III.10-c): the lbc\_lnk routine which manages such conditions
270is substituted by mpplnk.F or mpplnk2.F routine when running on an MPP
271computer (\key{mpp\_mpi} defined). It has to be pointed out that when using
272the MPP version of the model, the east-west cyclic boundary condition is done
273implicitly, whilst the south-symmetric boundary condition option is not available.
274
275%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
276\begin{figure}[!t] \label{Fig_mpp}  \begin{center}
277\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_mpp.pdf}
278\caption {Positioning of a sub-domain when massively parallel processing is used. }
279\end{center}   \end{figure}
280%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
281
282In the standard version of the OPA model, the splitting is regular and arithmetic.
283 the i-axis is divided by \jp{jpni} and the j-axis by \jp{jpnj} for a number of processors
284 \jp{jpnij} most often equal to $jpni \times jpnj$ (model parameters set in
285 \mdl{par\_oce}). Each processor is independent and without message passing
286 or synchronous process
287 \gmcomment{how does a synchronous process relate to this?},
288 programs run alone and access just its own local memory. For this reason, the
289 main model dimensions are now the local dimensions of the subdomain (pencil)
290 that are named \jp{jpi}, \jp{jpj}, \jp{jpk}. These dimensions include the internal
291 domain and the overlapping rows. The number of rows to exchange (known as
292 the halo) is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). The whole domain
293 dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}. The relationship between
294 the whole domain and a sub-domain is:
295\begin{eqnarray} 
296      jpi & = & ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci  \nonumber \\
297      jpj & = & ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj  \label{Eq_lbc_jpi}
298\end{eqnarray}
299where \jp{jpni}, \jp{jpnj} are the number of processors following the i- and j-axis.
300
301\colorbox{yellow}{Figure IV.3: example of a domain splitting with 9 processors and
302no east-west cyclic boundary conditions.}
303
304One also defines variables nldi and nlei which correspond to the internal
305domain bounds, and the variables nimpp and njmpp which are the position
306of the (1,1) grid-point in the global domain. An element of $T_{l}$, a local array
307(subdomain) corresponds to an element of $T_{g}$, a global array
308(whole domain) by the relationship:
309\begin{equation} \label{Eq_lbc_nimpp}
310T_{g} (i+nimpp-1,j+njmpp-1,k) = T_{l} (i,j,k),
311\end{equation}
312with  $1 \leq i \leq jpi$, $1  \leq j \leq jpj $ , and  $1  \leq k \leq jpk$.
313
314Processors are numbered from 0 to $jpnij-1$, the number is saved in the variable
315nproc. In the standard version, a processor has no more than four neighbouring
316processors named nono (for north), noea (east), noso (south) and nowe (west)
317and two variables, nbondi and nbondj, indicate the relative position of the processor
318\colorbox{yellow}{(see Fig.IV.3)}:
319\begin{itemize}
320\item       nbondi = -1    an east neighbour, no west processor,
321\item       nbondi =  0 an east neighbour, a west neighbour,
322\item       nbondi =  1    no east processor, a west neighbour,
323\item       nbondi =  2    no splitting following the i-axis.
324\end{itemize}
325During the simulation, processors exchange data with their neighbours.
326If there is effectively a neighbour, the processor receives variables from this
327processor on its overlapping row, and sends the data issued from internal
328domain corresponding to the overlapping row of the other processor.
329       
330\colorbox{yellow}{Figure IV.4: pencil splitting with the additional outer halos }
331
332
333The \NEMO model computes equation terms with the help of mask arrays (0 on land
334points and 1 on sea points). It is easily readable and very efficient in the context of
335a computer with vectorial architecture. However, in the case of a scalar processor,
336computations over the land regions become more expensive in terms of CPU time.
337It is worse when we use a complex configuration with a realistic bathymetry like the
338global ocean where more than 50 \% of points are land points. For this reason, a
339pre-processing tool can be used to choose the mpp domain decomposition with a
340maximum number of only land points processors, which can then be eliminated.
341(For example, the mpp\_optimiz tools, available from the DRAKKAR web site.)
342This optimisation is dependent on the specific bathymetry employed. The user
343then chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with
344$jpnij < jpni \times jpnj$, leading to the elimination of $jpni \times jpnj - jpnij$ 
345land processors. When those parameters are specified in module \mdl{par\_oce},
346the algorithm in the \rou{inimpp2} routine sets each processor's parameters (nbound,
347nono, noea,...) so that the land-only processors are not taken into account.
348
349\colorbox{yellow}{Note that the inimpp2 routine is general so that the original inimpp
350routine should be suppressed from the code.}
351
352When land processors are eliminated, the value corresponding to these locations in
353the model output files is zero. Note that this is a problem for a mesh output file written
354by such a model configuration, because model users often divide by the scale factors
355($e1t$, $e2t$, etc) and do not expect the grid size to be zero, even on land. It may be
356best not to eliminate land processors when running the model especially to write the
357mesh files as outputs (when \np{nn\_msh} namelist parameter differs from 0).
358%%
359\gmcomment{Steven : dont understand this, no land processor means no output file
360covering this part of globe; its only when files are stitched together into one that you
361can leave a hole}
362%%
363
364%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
365\begin{figure}[!ht] \label{Fig_mppini2}  \begin{center}
366\includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_mppini2.pdf}
367\caption {Example of Atlantic domain defined for the CLIPPER projet. Initial grid is
368composed of 773 x 1236 horizontal points. (a) the domain is split onto 9 \time 20
369subdomains (jpni=9, jpnj=20). 52 subdomains are land areas. (b) 52 subdomains
370are eliminated (white rectangles) and the resulting number of processors really
371used during the computation is jpnij=128.}
372\end{center}   \end{figure}
373%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
374
375
376% ================================================================
377% Open Boundary Conditions
378% ================================================================
379\section{Open Boundary Conditions (\key{obc})}
380\label{LBC_obc}
381%-----------------------------------------nam_obc  -------------------------------------------
382%-    nobc_dta    =    0     !  = 0 the obc data are equal to the initial state
383%-                           !  = 1 the obc data are read in 'obc   .dta' files
384%-    rn_dpein      =    1.    !  ???
385%-    rn_dpwin      =    1.    !  ???
386%-    rn_dpnin      =   30.    !  ???
387%-    rn_dpsin      =    1.    !  ???
388%-    rn_dpeob      = 1500.    !  time relaxation (days) for the east  open boundary
389%-    rn_dpwob      =   15.    !    "        "           for the west  open boundary
390%-    rn_dpnob      =  150.    !    "        "           for the north open boundary
391%-    rn_dpsob      =   15.    !    "        "           for the south open boundary
392%-    ln_obc_clim = .true.   !  climatological obc data files (default T)
393%-    ln_vol_cst  = .true.   !  total volume conserved
394\namdisplay{namobc} 
395
396It is often necessary to implement a model configuration limited to an oceanic
397region or a basin, which communicates with the rest of the global ocean through
398''open boundaries''. As stated by \citet{Roed1986}, an open boundary is a
399computational border where the aim of the calculations is to allow the perturbations
400generated inside the computational domain to leave it without deterioration of the
401inner model solution. However, an open boundary also has to let information from
402the outer ocean enter the model and should support inflow and outflow conditions.
403
404The open boundary package OBC is the first open boundary option developed in
405NEMO (originally in OPA8.2). It allows the user to
406\begin{itemize}
407\item tell the model that a boundary is ''open'' and not closed by a wall, for example
408by modifying the calculation of the divergence of velocity there;
409\item impose values of tracers and velocities at that boundary (values which may
410be taken from a climatology): this is the``fixed OBC'' option.
411\item calculate boundary values by a sophisticated algorithm combining radiation
412and relaxation (``radiative OBC'' option)
413\end{itemize}
414
415The package resides in the OBC directory. It is described here in four parts: the
416boundary geometry (parameters to be set in \mdl{obc\_par}), the forcing data at
417the boundaries (module \mdl{obcdta}),  the radiation algorithm involving the
418namelist and module \mdl{obcrad}, and a brief presentation of boundary update
419and restart files.
420
421%----------------------------------------------
422\subsection{Boundary geometry}
423\label{OBC_geom}
424%
425First one has to realize that open boundaries may not necessarily be located
426at the extremities of the computational domain. They may exist in the middle
427of the domain, for example at Gibraltar Straits if one wants to avoid including
428the Mediterranean in an Atlantic domain. This flexibility has been found necessary
429for the CLIPPER project \citep{Treguier_al_JGR01}. Because of the complexity of the
430geometry of ocean basins, it may even be necessary to have more than one
431''west'' open boundary, more than one ''north'', etc. This is not possible with
432the OBC option: only one open boundary of each kind, west, east, south and
433north is allowed; these names refer to the grid geometry (not to the direction
434of the geographical ''west'', ''east'', etc).
435
436The open boundary geometry is set by a series of parameters in the module
437\mdl{obc\_par}. For an eastern open boundary, parameters are \jp{lp\_obc\_east} 
438(true if an east open boundary exists), \jp{jpieob} the $i$-index along which
439the eastern open boundary (eob) is located, \jp{jpjed} the $j$-index at which
440it starts, and \jp{jpjef} the $j$-index where it ends (note $d$ is for ''d\'{e}but''
441and $f$ for ''fin'' in French). Similar parameters exist for the west, south and
442north cases (Table~\ref{Tab_obc_param}).
443
444
445%--------------------------------------------------TABLE--------------------------------------------------
446
447\begin{table}[htbp]  \label{Tab_obc_param}
448\begin{center}
449\begin{tabular}{|l|c|c|c|}
450\hline
451Boundary and  & Constant index  & Starting index (d\'{e}but) & Ending index (fin) \\
452Logical flag  &                 &                            &                     \\
453\hline
454West          & \jp{jpiwob} $>= 2$         &  \jp{jpjwd}$>= 2$          &  \jp{jpjwf}<= \jp{jpjglo}-1 \\
455lp\_obc\_west & $i$-index of a $u$ point   & $j$ of a $T$ point   &$j$ of a $T$ point \\
456\hline
457East            & \jp{jpieob}$<=$\jp{jpiglo}-2&\jp{jpjed} $>= 2$         & \jp{jpjef}$<=$ \jp{jpjglo}-1 \\
458 lp\_obc\_east  & $i$-index of a $u$ point    & $j$ of a $T$ point & $j$ of a $T$ point \\
459\hline
460South           & \jp{jpjsob} $>= 2$         & \jp{jpisd} $>= 2$          & \jp{jpisf}$<=$\jp{jpiglo}-1 \\
461lp\_obc\_south  & $j$-index of a $v$ point   & $i$ of a $T$ point   & $i$ of a $T$ point \\
462\hline
463North           & \jp{jpjnob} $<=$ \jp{jpjglo}-2& \jp{jpind} $>= 2$        & \jp{jpinf}$<=$\jp{jpiglo}-1 \\
464lp\_obc\_north  & $j$-index of a $v$ point      & $i$  of a $T$ point & $i$ of a $T$ point \\
465\hline
466\end{tabular}
467\end{center}
468\caption{Names of different indices relating to the open boundaries. In the case
469of a completely open ocean domain with four ocean boundaries, the parameters
470take exactly the values indicated.}
471\end{table}
472
473The open boundaries must be along coordinate lines. On the C-grid, the boundary
474itself is along a line of normal velocity points: $v$ points for a zonal open boundary
475(the south or north one), and $u$ points for a meridional open boundary (the west
476or east one). Another constraint is that there still must be a row of masked points
477all around the domain, as if the domain were a closed basin (unless periodic conditions
478are used together with open boundary conditions). Therefore, an open boundary
479cannot be located at the first/last index, namely, 1, \jp{jpiglo} or \jp{jpjglo}. Also,
480the open boundary algorithm involves calculating the normal velocity points situated
481just on the boundary, as well as the tangential velocity and temperature and salinity
482just outside the boundary. This means that for a west/south boundary, normal
483velocities and temperature are calculated at the same index \jp{jpiwob} and
484\jp{jpjsob}, respectively. For an east/north boundary, the normal velocity is
485calculated at index \jp{jpieob} and \jp{jpjnob}, but the ``outside'' temperature is
486at index \jp{jpieob}+1 and \jp{jpjnob}+1. This means that \jp{jpieob}, \jp{jpjnob} 
487cannot be bigger than \jp{jpiglo}-2, \jp{jpjglo}-2.
488
489
490The starting and ending indices are to be thought of as $T$ point indices: in many
491cases they indicate the first land $T$-point, at the extremity of an open boundary
492(the coast line follows the $f$ grid points, see Fig.~\ref{Fig_obc_north} for an example
493of a northern open boundary). All indices are relative to the global domain. In the
494free surface case it is possible to have ``ocean corners'', that is, an open boundary
495starting and ending in the ocean.
496
497%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
498\begin{figure}[!t] \label{Fig_obc_north}  \begin{center}
499\includegraphics[width=0.70\textwidth]{./TexFiles/Figures/Fig_obc_north.pdf}
500\caption {Localization of the North open boundary points.}
501\end{center} 
502\end{figure}
503%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
504
505Although not compulsory, it is highly recommended that the bathymetry in the
506vicinity of an open boundary follows the following rule: in the direction perpendicular
507to the open line, the water depth should be constant for 4 grid points. This is in
508order to ensure that the radiation condition, which involves model variables next
509to the boundary, is calculated in a consistent way. On Fig.\ref{Fig_obc_north} we
510indicate by an $=$ symbol, the points which should have the same depth. It means
511that at the 4 points near the boundary, the bathymetry is cylindrical \gmcomment{not sure
512why cylindrical}. The line behind the open $T$-line must be 0 in the bathymetry file
513(as shown on Fig.\ref{Fig_obc_north} for example).
514
515%----------------------------------------------
516\subsection{Boundary data}
517\label{OBC_data}
518
519It is necessary to provide information at the boundaries. The simplest case is
520when this information does not change in time and is equal to the initial conditions
521(namelist variable \np{nn\_obcdta}=0). This is the case for the standard configuration
522EEL5 with open boundaries. When (\np{nn\_obcdta}=1), open boundary information
523is read from netcdf files. For convenience the input files are supposed to be similar
524to the ''history'' NEMO output files, for dimension names and variable names.
525Open boundary arrays must be dimensioned according to the parameters of table~
526\ref{Tab_obc_param}: for example, at the western boundary, arrays have a
527dimension of \jp{jpwf}-\jp{jpwd}+1 in the horizontal and \jp{jpk} in the vertical.
528
529When ocean observations are used to generate the boundary data (a hydrographic
530section for example, as in \citet{Treguier_al_JGR01}) it happens often that only the velocity
531normal to the boundary is known, which is the reason why the initial OBC code
532assumes that only $T$, $S$, and the normal velocity ($u$ or $v$) needs to be
533specified. As more and more global model solutions and ocean analysis products
534become available, it will be possible to provide information about all the variables
535(including the tangential velocity) so that the specification of four variables at each
536boundaries will become standard. For the sea surface height, one must distinguish
537between the filtered free surface case and the time-splitting or explicit treatment of
538the free surface.
539 In the first case, it is assumed that the user does not wish to represent high
540 frequency motions such as tides. The boundary condition is thus one of zero
541 normal gradient of sea surface height at the open boundaries, following \citet{Marchesiello2001}.
542No information other than the total velocity needs to be provided at the open
543boundaries in that case. In the other two cases (time splitting or explicit free surface),
544the user must provide barotropic information (sea surface height and barotropic
545velocities) and the use of the Flather algorithm for barotropic variables is
546recommanded. However, this algorithm has not yet been fully tested and bugs
547remain in NEMO v2.3. Users should read the code carefully before using it. Finally,
548in the case of the rigid lid approximation the barotropic streamfunction must be
549provided, as documented in \citet{Treguier_al_JGR01}). This option is no longer
550recommended but remains in NEMO V2.3.
551
552One frequently encountered case is when an open boundary domain is constructed
553from a global or larger scale NEMO configuration. Assuming the domain corresponds
554to indices $ib:ie$, $jb:je$ of the global domain, the bathymetry and forcing of the
555small domain can be created by using the following netcdf utility on the global files:
556ncks -F $-d\;x,ib,ie$ $-d\;y,jb,je$ (part of the nco series of utilities, see http://nco.sourceforge.net).
557The open boundary files can be constructed using ncks
558commands, following table~\ref{Tab_obc_ind}.
559
560%--------------------------------------------------TABLE--------------------------------------------------
561
562\begin{table}[htbp]  \label{Tab_obc_ind}
563\begin{center}
564\begin{tabular}{|l|c|c|c|c|c|}
565\hline
566OBC  & Variable   & file name      & Index  & Start  & end  \\
567West &  T,S       &   obcwest\_TS.nc &  $ib$+1     &   $jb$+1 &  $je-1$  \\
568     &    U       &   obcwest\_U.nc  &  $ib$+1     &   $jb$+1 &  $je-1$  \\ 
569     &    V       &   obcwest\_V.nc  &  $ib$+1     &   $jb$+1 &  $je-1$  \\       
570\hline
571East &  T,S       &   obceast\_TS.nc &  $ie$-1     &   $jb$+1 &  $je-1$  \\
572     &    U       &   obceast\_U.nc  &  $ie$-2     &   $jb$+1 &  $je-1$  \\ 
573     &    V       &   obceast\_V.nc  &  $ie$-1     &   $jb$+1 &  $je-1$  \\       
574\hline         
575South &  T,S      &   obcsouth\_TS.nc &  $jb$+1     &  $ib$+1 &  $ie-1$  \\
576      &    U      &   obcsouth\_U.nc  &  $jb$+1     &  $ib$+1 &  $ie-1$  \\ 
577      &    V      &   obcsouth\_V.nc  &  $jb$+1     &  $ib$+1 &  $ie-1$  \\   
578\hline
579North &  T,S      &   obcnorth\_TS.nc &  $je$-1     &  $ib$+1 &  $ie-1$  \\
580      &    U      &   obcnorth\_U.nc  &  $je$-1     &  $ib$+1 &  $ie-1$  \\ 
581      &    V      &   obcnorth\_V.nc  &  $je$-2     &  $ib$+1 &  $ie-1$  \\ 
582\hline
583\end{tabular}
584\end{center}
585\caption{Requirements for creating open boundary files from a global configuration,
586appropriate for the subdomain of indices $ib:ie$, $jb:je$. ``Index'' designates the
587$i$ or $j$ index along which the $u$ of $v$ boundary point is situated in the global
588configuration, starting and ending with the $j$ or $i$ indices indicated.
589For example, to generate file obcnorth\_V.nc, use the command ncks
590$-F$ $-d\;y,je-2$  $-d\;x,ib+1,ie-1$ } 
591\end{table}
592
593It is assumed that the open boundary files contain the variables for the period of
594the model integration. If the boundary files contain one time frame, the boundary
595data is held fixed in time. If the files contain 12 values, it is assumed that the input
596is a climatology for a repeated annual cycle (corresponding to the case \np{ln\_obc\_clim} 
597=true). The case of an arbitrary number of time frames is not yet implemented
598correctly; the user is required to write his own code in the module \mdl{obc\_dta} 
599to deal with this situation.
600
601\subsection{Radiation algorithm}
602\label{OBC_rad}
603
604The art of open boundary management consists in applying a constraint strong
605enough that the inner domain "feels" the rest of the ocean, but weak enough
606that perturbations are allowed to leave the domain with minimum false reflections
607of energy. The constraints are specified separately at each boundary as time
608scales for ''inflow'' and ''outflow'' as defined below. The time scales are set (in days)
609by namelist parameters such as \np{rn\_dpein}, \np{rn\_dpeob} for the eastern open
610boundary for example. When both time scales are zero for a given boundary
611($e.g.$ for the western boundary, \jp{lp\_obc\_west}=true, \np{rn\_dpwob}=0 and
612\np{rn\_dpwin}=0) this means that the boundary in question is a ''fixed '' boundary
613where the solution is set exactly by the boundary data. This is not recommended,
614except in combination with increased viscosity in a ''sponge'' layer next to the
615boundary in order to avoid spurious reflections. 
616
617
618The radiation\/relaxation \gmcomment{the / doesnt seem to appear in the output} 
619algorithm is applied when either relaxation time (for ''inflow'' or ''outflow'') is
620non-zero. It has been developed and tested in the SPEM model and its
621successor ROMS \citep{Barnier1996, Marchesiello2001}, which is an
622$s$-coordinate model on an Arakawa C-grid. Although the algorithm has
623been numerically successful in the CLIPPER Atlantic models, the physics
624do not work as expected \citep{Treguier_al_JGR01}. Users are invited to consider
625open boundary conditions (OBC hereafter) with some scepticism
626\citep{Durran2001, Blayo2005}.
627
628The first part of the algorithm calculates a phase velocity to determine
629whether perturbations tend to propagate toward, or away from, the
630boundary. Let us consider a model variable $\phi$.
631The phase velocities ($C_{\phi x}$,$C_{\phi y}$) for the variable $\phi$,
632in the directions normal and tangential to the boundary are
633\begin{equation} \label{Eq_obc_cphi}
634C_{\phi x} = \frac{ -\phi_{t} }{ ( \phi_{x}^{2} + \phi_{y}^{2}) } \phi_{x} 
635\;\;\;\;\; \;\;\; 
636C_{\phi y} = \frac{ -\phi_{t} }{ ( \phi_{x}^{2} + \phi_{y}^{2}) } \phi_{y}.
637\end{equation}
638Following \citet{Treguier_al_JGR01} and \citet{Marchesiello2001} we retain only
639the normal component of the velocity, $C_{\phi x}$, setting $C_{\phi y} =0$ 
640(but unlike the original Orlanski radiation algorithm we retain $\phi_{y}$ in
641the expression for $C_{\phi x}$). 
642
643The discrete form of (\ref{Eq_obc_cphi}), described by \citet{Barnier1998},
644takes into account the two rows of grid points situated inside the domain
645next to the boundary, and the three previous time steps ($n$, $n-1$,
646and $n-2$). The same equation can then be discretized at the boundary at
647time steps $n-1$, $n$ and $n+1$ \gmcomment{since the original was three time-level} 
648in order to extrapolate for the new boundary value $\phi^{n+1}$.
649
650In the open boundary algorithm as implemented in NEMO v2.3, the new boundary
651values are updated differently depending on the sign of $C_{\phi x}$. Let us take
652an eastern boundary as an example. The solution for variable $\phi$ at the
653boundary is given by a generalized wave equation with phase velocity $C_{\phi}$,
654with the addition of a relaxation term, as:
655\begin{eqnarray}
656\phi_{t} &  =  & -C_{\phi x} \phi_{x} + \frac{1}{\tau_{o}} (\phi_{c}-\phi)
657                        \;\;\; \;\;\; \;\;\; (C_{\phi x} > 0), \label{Eq_obc_rado} \\
658\phi_{t} &  =  & \frac{1}{\tau_{i}} (\phi_{c}-\phi)
659\;\;\; \;\;\; \;\;\;\;\;\; (C_{\phi x} < 0), \label{Eq_obc_radi}
660\end{eqnarray}
661where $\phi_{c}$ is the estimate of $\phi$ at the boundary, provided as boundary
662data. Note that in (\ref{Eq_obc_rado}), $C_{\phi x}$ is bounded by the ratio
663$\delta x/\delta t$ for stability reasons. When $C_{\phi x}$ is eastward (outward
664propagation), the radiation condition (\ref{Eq_obc_rado}) is used.
665When  $C_{\phi x}$ is westward (inward propagation), (\ref{Eq_obc_radi}) is
666used with a strong relaxation to climatology (usually $\tau_{i}=\np{rn\_dpein}=$1~day).
667Equation (\ref{Eq_obc_radi}) is solved with a Euler time-stepping scheme. As a
668consequence, setting $\tau_{i}$ smaller than, or equal to the time step is equivalent
669to a fixed boundary condition. A time scale of one day is usually a good compromise
670which guarantees that the inflow conditions remain close to climatology while ensuring
671numerical stability.
672
673In  the case of a western boundary located in the Eastern Atlantic, \citet{Penduff_al_JGR00} 
674have been able to implement the radiation algorithm without any boundary data,
675using persistence from the previous time step instead. This solution has not worked
676in other cases \citep{Treguier_al_JGR01}, so that the use of boundary data is recommended.
677Even in the outflow condition (\ref{Eq_obc_rado}), we have found it desirable to
678maintain a weak relaxation to climatology. The time step is usually chosen so as to
679be larger than typical turbulent scales (of order 1000~days \gmcomment{or maybe seconds?}).
680
681The radiation condition is applied to the model variables: temperature, salinity,
682tangential and normal velocities. For normal and tangential velocities, $u$ and $v$,
683radiation is applied with phase velocities calculated from $u$ and $v$ respectively. 
684For the radiation of tracers, we use the phase velocity calculated from the tangential
685velocity in order to avoid calculating too many independent radiation velocities and
686because tangential velocities and tracers have the same position along the boundary
687on a C-grid. 
688
689\subsection{Domain decomposition (\key{mpp\_mpi})}
690\label{OBC_mpp}
691When \key{mpp\_mpi} is active in the code, the computational domain is divided
692into rectangles that are attributed each to a different processor. The open boundary
693code is ``mpp-compatible'' up to a certain point. The radiation algorithm will not
694work if there is an mpp subdomain boundary parallel to the open boundary at the
695index of the boundary, or the grid point after (outside), or three grid points before
696(inside). On the other hand, there is no problem if an mpp subdomain boundary
697cuts the open boundary perpendicularly. These geometrical limitations must be
698checked for by the user (there is no safeguard in the code). 
699The general principle for the open boundary mpp code is that loops over the open
700boundaries {not sure what this means} are performed on local indices (nie0,
701nie1, nje0, nje1 for an eastern boundary for instance) that are initialized in module
702\mdl{obc\_ini}. Those indices have relevant values on the processors that contain
703a segment of an open boundary. For processors that do not include an open
704boundary segment, the indices are such that the calculations within the loops are
705not performed.
706\gmcomment{I dont understand most of the last few sentences}
707 
708Arrays of climatological data that are read from files are seen by all processors
709and have the same dimensions for all (for instance, for the eastern boundary,
710uedta(jpjglo,jpk,2)). On the other hand, the arrays for the calculation of radiation
711are local to each processor (uebnd(jpj,jpk,3,3) for instance).  This allowed the
712CLIPPER model for example, to save on memory where the eastern boundary
713crossed 8 processors so that \jp{jpj} was much smaller than (\jp{jpjef}-\jp{jpjed}+1).
714
715\subsection{Volume conservation}
716\label{OBC_vol}
717
718It is necessary to control the volume inside a domain when using open boundaries.
719With fixed boundaries, it is enough to ensure that the total inflow/outflow has
720reasonable values (either zero or a value compatible with an observed volume
721balance). When using radiative boundary conditions it is necessary to have a
722volume constraint because each open boundary works independently from the
723others. The methodology used to control this volume is identical to the one
724coded in the ROMS model \citep{Marchesiello2001}.
725
726
727%---------------------------------------- EXTRAS
728\colorbox{yellow}{Explain obc\_vol{\ldots}}
729
730\colorbox{yellow}{OBC algorithm for update, OBC restart, list of routines where obc key appears{\ldots}}
731
732\colorbox{yellow}{OBC rigid lid? {\ldots}}
733
734% ====================================================================
735% Unstructured open boundaries BDY
736% ====================================================================
737\section{Unstructured Open Boundary Conditions (\key{bdy})}
738\label{LBC_bdy}
739
740%-----------------------------------------nambdy--------------------------------------------
741%-    filbdy_mask    =  ''                  !  name of mask file (if ln_bdy_mask=.TRUE.)
742%-    filbdy_data_T  = 'bdydata_grid_T.nc'  !  name of data file for FRS condition (T-points)
743%-    filbdy_data_U  = 'bdydata_grid_U.nc'  !  name of data file for FRS condition (U-points)
744%-    filbdy_data_V  = 'bdydata_grid_V.nc'  !  name of data file for FRS condition (V-points)
745%-    filbdy_data_bt_T  = 'bdydata_bt_grid_T.nc'  !  name of data file for Flather condition (T-points)
746%-    filbdy_data_bt_U  = 'bdydata_bt_grid_U.nc'  !  name of data file for Flather condition (U-points)
747%-    filbdy_data_bt_V  = 'bdydata_bt_grid_V.nc'  !  name of data file for Flather condition (V-points)
748%-    ln_bdy_clim    = .false.              !  contain 1 (T) or 12 (F) time dumps and be cyclic
749%-    ln_bdy_vol     = .true.               !  total volume correction (see volbdy parameter)
750%-    ln_bdy_mask    = .false.              !  boundary mask from filbdy_mask (T) or boundaries are on edges of domain (F)
751%-    ln_bdy_tides   = .true.               !  Apply tidal harmonic forcing with Flather condition
752%-    ln_bdy_dyn_fla = .true.               !  Apply Flather condition to velocities
753%-    ln_bdy_tra_frs = .false.              !  Apply FRS condition to temperature and salinity
754%-    ln_bdy_dyn_frs = .false.              !  Apply FRS condition to velocities
755%-    nbdy_dta       =  1                   !  = 0, bdy data are equal to the initial state
756%-                                          !  = 1, bdy data are read in 'bdydata   .nc' files
757%-    nb_rimwidth    = 9                    !  width of the relaxation zone
758%-    volbdy         = 0                    !  = 0, the total water flux across open boundaries is zero
759\namdisplay{nambdy} 
760%-----------------------------------------------------------------------------------------------
761
762The BDY module is an alternative implementation of open boundary
763conditions for regional configurations. It implements the Flow
764Relaxation Scheme algorithm for temperature, salinity, velocities and
765ice fields, and the Flather radiation condition for the depth-mean
766transports. The specification of the location of the open boundary is
767completely flexible and allows for example the open boundary to follow
768an isobath or other irregular contour.
769
770The BDY module was modelled on the OBC module and shares many features
771and a similar coding structure \citep{Chanut2005}.
772
773%----------------------------------------------
774\subsection{The Flow Relaxation Scheme}
775\label{BDY_FRS_scheme}
776
777The Flow Relaxation Scheme (FRS) \citep{Davies_QJRMS76,Engerdahl_Tel95},
778applies a simple relaxation of the model fields to
779externally-specified values over a zone next to the edge of the model
780domain. Given a model prognostic variable $\Phi$ 
781\begin{equation}  \label{Eq_bdy_frs1}
782\Phi(d) = \alpha(d)\Phi_{e}(d) + (1-\alpha(d))\Phi_{m}(d)\;\;\;\;\; d=1,N
783\end{equation}
784where $\Phi_{m}$ is the model solution and $\Phi_{e}$ is the specified
785external field, $d$ gives the discrete distance from the model
786boundary  and $\alpha$ is a parameter that varies from $1$ at $d=1$ to
787a small value at $d=N$. It can be shown that this scheme is equivalent
788to adding a relaxation term to the prognostic equation for $\Phi$ of
789the form:
790\begin{equation}  \label{Eq_bdy_frs2}
791-\frac{1}{\tau}\left(\Phi - \Phi_{e}\right)
792\end{equation}
793where the relaxation time scale $\tau$ is given by a function of
794$\alpha$ and the model time step $\Delta t$:
795\begin{equation}  \label{Eq_bdy_frs3}
796\tau = \frac{1-\alpha}{\alpha}  \,\rdt
797\end{equation}
798Thus the model solution is completely prescribed by the external
799conditions at the edge of the model domain and is relaxed towards the
800external conditions over the rest of the FRS zone. The application of
801a relaxation zone helps to prevent spurious reflection of outgoing
802signals from the model boundary.
803
804The function $\alpha$ is specified as a $tanh$ function:
805\begin{equation}  \label{Eq_bdy_frs4}
806\alpha(d) = 1 - \tanh\left(\frac{d-1}{2}\right),       \quad d=1,N
807\end{equation}
808The width of the FRS zone is specified in the namelist as
809\np{nb\_rimwidth}. This is typically set to a value between 8 and 10.
810
811%----------------------------------------------
812\subsection{The Flather radiation scheme}
813\label{BDY_flather_scheme}
814
815The \citet{Flather_JPO94} scheme is a radiation condition on the normal, depth-mean
816transport across the open boundary. It takes the form
817\begin{equation}  \label{Eq_bdy_fla1}
818U = U_{e} + \frac{c}{h}\left(\eta - \eta_{e}\right),
819\end{equation}
820where $U$ is the depth-mean velocity normal to the boundary and $\eta$
821is the sea surface height, both from the model. The subscript $e$
822indicates the same fields from external sources. The speed of external
823gravity waves is given by $c = \sqrt{gh}$, and $h$ is the depth of the
824water column. The depth-mean normal velocity along the edge of the
825model domain is set equal to the
826external depth-mean normal velocity, plus a correction term that
827allows gravity waves generated internally to exit the model boundary.
828Note that the sea-surface height gradient in \eqref{Eq_bdy_fla1}
829is a spatial gradient across the model boundary, so that $\eta_{e}$ is
830defined on the $T$ points with $nbrdta=1$ and $\eta$ is defined on the
831$T$ points with $nbrdta=2$. $U$ and $U_{e}$ are defined on the $U$ or
832$V$ points with $nbrdta=1$, $i.e.$ between the two $T$ grid points.
833
834%----------------------------------------------
835\subsection{Choice of schemes}
836\label{BDY_choice_of_schemes}
837
838The Flow Relaxation Scheme may be applied separately to the
839temperature and salinity (\np{ln\_bdy\_tra\_frs} = true) and
840the velocity fields (\np{ln\_bdy\_dyn\_frs} = true). Flather
841radiation conditions may be applied using externally defined
842barotropic velocities and sea-surface height (\np{ln\_bdy\_dyn\_fla} = true)
843or using tidal harmonics fields (\np{ln\_bdy\_tides} = true)
844or both. FRS and Flather conditions may be applied simultaneously.
845A typical configuration where all possible conditions might be used is a tidal,
846shelf-seas model, where the barotropic boundary conditions are fixed
847with the Flather scheme using tidal harmonics and possibly output
848from a large-scale model, and FRS conditions are applied to the tracers
849and baroclinic velocity fields, using fields from a large-scale model.
850
851Note that FRS conditions will work with the filtered
852(\key{dynspg\_flt}) or time-split (\key{dynspg\_ts}) solutions for the
853surface pressure gradient. The Flather condition will only work for
854the time-split solution (\key{dynspg\_ts}). FRS conditions are applied
855at the end of the main model time step. Flather conditions are applied
856during the barotropic subcycle in the time-split solution.
857
858%----------------------------------------------
859\subsection{Boundary geometry}
860\label{BDY_geometry}
861
862The definition of the open boundary is completely flexible. An example
863is shown in Fig.~\ref{Fig_LBC_bdy_geom}. The boundary zone is
864defined by a series of index arrays read in from the input boundary
865data files: $nbidta$, $nbjdta$, and $nbrdta$. The first two of these
866define the global $(i,j)$ indices of each point in the boundary zone
867and the $nbrdta$ array defines the discrete distance from the boundary
868with $nbrdta=1$ meaning that the point is next to the edge of the
869model domain and $nbrdta>1$ showing that the point is increasingly
870further away from the edge of the model domain. These arrays are
871defined separately for each of the $T$, $U$ and $V$ grids, but the
872relationship between the points is assumed to be as in Fig.
873\ref{Fig_LBC_bdy_geom} with the $T$ points forming the outermost row
874of the boundary and the first row of velocities normal to the boundary
875being inside the first row of $T$ points. The order in which the
876points are defined is unimportant.
877
878%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
879\begin{figure}[!t] \label{Fig_LBC_bdy_geom}  \begin{center}
880\includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_LBC_bdy_geom.pdf}
881\caption {Example of geometry of unstructured open boundary}
882\end{center}   \end{figure}
883%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
884
885%----------------------------------------------
886\subsection{Input boundary data files}
887\label{BDY_data}
888
889The input data files for the FRS conditions are defined in the
890namelist as \np{filbdy\_data\_T}, \np{filbdy\_data\_U},
891\np{filbdy\_data\_V}. The input data files for the Flather conditions
892are defined in the namelist as \np{filbdy\_data\_bt\_T},
893\np{filbdy\_data\_bt\_U}, \np{filbdy\_data\_bt\_V}.
894
895The netcdf header of a typical input data file is shown in Figure
896\ref{Fig_LBC_nc_header}. The file contains the index arrays which
897define the boundary geometry as noted above and the data arrays for
898each field.  The data arrays are dimensioned on: a time
899dimension; $xb$ which is the index of the boundary data point in the
900horizontal; and $yb$ which is a degenerate dimension of 1 to enable
901the file to be read by the standard NEMO I/O routines. The 3D fields
902also have a depth dimension.
903
904If \np{ln\_bdy\_clim} is set to $false$, the model expects the
905units of the time axis to have the form shown in
906\ref{Fig_bdy_input_file}, $i.e.$ {\it ``seconds since yyyy-mm-dd
907hh:mm:ss''} The fields are then linearly interpolated to the model
908time at each timestep. Note that for this option, the time axis of the
909input files must completely span the time period of the model
910integration. If \np{ln\_bdy\_clim} is set to $.true.$ (climatological
911boundary forcing), the model will expect either a single set of annual
912mean fields (constant boundary forcing) or 12 sets of monthly mean
913fields in the input files.
914
915As in the OBC module there is an option to use initial conditions as
916boundary conditions. This is chosen by setting
917$\np{nb\_dta}=0$. However, since the model defines the boundary
918geometry by reading the boundary index arrays from the input files,
919it is still necessary to provide a set of input files in this
920case. They need only contain the boundary index arrays, $nbidta$,
921$nbjdta$, $nbrdta$.
922
923%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
924\begin{figure}[!t] \label{Fig_LBC_nc_header}  \begin{center}
925\includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_LBC_nc_header.pdf}
926\caption {Example of header of netcdf input data file for BDY}
927\end{center}   \end{figure}
928%>>>>>>>>>>>>>>>>>>>>>>>>>>>>
929
930%----------------------------------------------
931\subsection{Volume correction}
932\label{BDY_vol_corr}
933
934There is an option to force the total volume in the regional model to be constant, similar to the option in the OBC module. This is controlled  by the \np{volbdy} parameter in the namelist. A value of $\np{volbdy} = 0$ indicates that this option is not used. If  $\np{volbdy} = 1$ then a correction is applied to the normal velocities around the boundary at each timestep to ensure that the integrated volume flow through the boundary is zero. If $\np{volbdy} = 2$ then the calculation of the volume change on the timestep includes the change due to the freshwater flux across the surface and the correction velocity corrects for this as well.
935
936
937%----------------------------------------------
938\subsection{Tidal harmonic forcing}
939\label{BDY_tides}
940
941To be written....
942
943
944
945
Note: See TracBrowser for help on using the repository browser.