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 | |
---|
27 | Options are defined through the \ngn{namlbc} namelist variables. |
---|
28 | The discrete representation of a domain with complex boundaries (coastlines and |
---|
29 | bottom topography) leads to arrays that include large portions where a computation |
---|
30 | is not required as the model variables remain at zero. Nevertheless, vectorial |
---|
31 | supercomputers are far more efficient when computing over a whole array, and the |
---|
32 | readability of a code is greatly improved when boundary conditions are applied in |
---|
33 | an automatic way rather than by a specific computation before or after each |
---|
34 | computational loop. An efficient way to work over the whole domain while specifying |
---|
35 | the boundary conditions, is to use multiplication by mask arrays in the computation. |
---|
36 | A mask array is a matrix whose elements are $1$ in the ocean domain and $0$ |
---|
37 | elsewhere. A simple multiplication of a variable by its own mask ensures that it will |
---|
38 | remain zero over land areas. Since most of the boundary conditions consist of a |
---|
39 | zero flux across the solid boundaries, they can be simply applied by multiplying |
---|
40 | variables by the correct mask arrays, $i.e.$ the mask array of the grid point where |
---|
41 | the flux is evaluated. For example, the heat flux in the \textbf{i}-direction is evaluated |
---|
42 | at $u$-points. Evaluating this quantity as, |
---|
43 | |
---|
44 | \begin{equation} \label{Eq_lbc_aaaa} |
---|
45 | \frac{A^{lT} }{e_1 }\frac{\partial T}{\partial i}\equiv \frac{A_u^{lT} |
---|
46 | }{e_{1u} } \; \delta _{i+1 / 2} \left[ T \right]\;\;mask_u |
---|
47 | \end{equation} |
---|
48 | (where mask$_{u}$ is the mask array at a $u$-point) ensures that the heat flux is |
---|
49 | zero inside land and at the boundaries, since mask$_{u}$ is zero at solid boundaries |
---|
50 | which in this case are defined at $u$-points (normal velocity $u$ remains zero at |
---|
51 | the coast) (Fig.~\ref{Fig_LBC_uv}). |
---|
52 | |
---|
53 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
54 | \begin{figure}[!t] \begin{center} |
---|
55 | \includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_LBC_uv.pdf} |
---|
56 | \caption{ \label{Fig_LBC_uv} |
---|
57 | Lateral boundary (thick line) at T-level. The velocity normal to the boundary is set to zero.} |
---|
58 | \end{center} \end{figure} |
---|
59 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
60 | |
---|
61 | For momentum the situation is a bit more complex as two boundary conditions |
---|
62 | must be provided along the coast (one each for the normal and tangential velocities). |
---|
63 | The boundary of the ocean in the C-grid is defined by the velocity-faces. |
---|
64 | For example, at a given $T$-level, the lateral boundary (a coastline or an intersection |
---|
65 | with the bottom topography) is made of segments joining $f$-points, and normal |
---|
66 | velocity points are located between two $f-$points (Fig.~\ref{Fig_LBC_uv}). |
---|
67 | The boundary condition on the normal velocity (no flux through solid boundaries) |
---|
68 | can thus be easily implemented using the mask system. The boundary condition |
---|
69 | on the tangential velocity requires a more specific treatment. This boundary |
---|
70 | condition influences the relative vorticity and momentum diffusive trends, and is |
---|
71 | required in order to compute the vorticity at the coast. Four different types of |
---|
72 | lateral boundary condition are available, controlled by the value of the \np{rn\_shlat} |
---|
73 | namelist parameter. (The value of the mask$_{f}$ array along the coastline is set |
---|
74 | equal to this parameter.) These are: |
---|
75 | |
---|
76 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
77 | \begin{figure}[!p] \begin{center} |
---|
78 | \includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_LBC_shlat.pdf} |
---|
79 | \caption{ \label{Fig_LBC_shlat} |
---|
80 | lateral boundary condition (a) free-slip ($rn\_shlat=0$) ; (b) no-slip ($rn\_shlat=2$) |
---|
81 | ; (c) "partial" free-slip ($0<rn\_shlat<2$) and (d) "strong" no-slip ($2<rn\_shlat$). |
---|
82 | Implied "ghost" velocity inside land area is display in grey. } |
---|
83 | \end{center} \end{figure} |
---|
84 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
85 | |
---|
86 | \begin{description} |
---|
87 | |
---|
88 | \item[free-slip boundary condition (\np{rn\_shlat}=0): ] the tangential velocity at the |
---|
89 | coastline is equal to the offshore velocity, $i.e.$ the normal derivative of the |
---|
90 | tangential velocity is zero at the coast, so the vorticity: mask$_{f}$ array is set |
---|
91 | to zero inside the land and just at the coast (Fig.~\ref{Fig_LBC_shlat}-a). |
---|
92 | |
---|
93 | \item[no-slip boundary condition (\np{rn\_shlat}=2): ] the tangential velocity vanishes |
---|
94 | at the coastline. Assuming that the tangential velocity decreases linearly from |
---|
95 | the closest ocean velocity grid point to the coastline, the normal derivative is |
---|
96 | evaluated as if the velocities at the closest land velocity gridpoint and the closest |
---|
97 | ocean velocity gridpoint were of the same magnitude but in the opposite direction |
---|
98 | (Fig.~\ref{Fig_LBC_shlat}-b). Therefore, the vorticity along the coastlines is given by: |
---|
99 | |
---|
100 | \begin{equation*} |
---|
101 | \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) \ , |
---|
102 | \end{equation*} |
---|
103 | where $u$ and $v$ are masked fields. Setting the mask$_{f}$ array to $2$ along |
---|
104 | the coastline provides a vorticity field computed with the no-slip boundary condition, |
---|
105 | simply by multiplying it by the mask$_{f}$ : |
---|
106 | \begin{equation} \label{Eq_lbc_bbbb} |
---|
107 | \zeta \equiv \frac{1}{e_{1f} {\kern 1pt}e_{2f} }\left( {\delta _{i+1/2} |
---|
108 | \left[ {e_{2v} \,v} \right]-\delta _{j+1/2} \left[ {e_{1u} \,u} \right]} |
---|
109 | \right)\;\mbox{mask}_f |
---|
110 | \end{equation} |
---|
111 | |
---|
112 | \item["partial" free-slip boundary condition (0$<$\np{rn\_shlat}$<$2): ] the tangential |
---|
113 | velocity at the coastline is smaller than the offshore velocity, $i.e.$ there is a lateral |
---|
114 | friction but not strong enough to make the tangential velocity at the coast vanish |
---|
115 | (Fig.~\ref{Fig_LBC_shlat}-c). This can be selected by providing a value of mask$_{f}$ |
---|
116 | strictly inbetween $0$ and $2$. |
---|
117 | |
---|
118 | \item["strong" no-slip boundary condition (2$<$\np{rn\_shlat}): ] the viscous boundary |
---|
119 | layer is assumed to be smaller than half the grid size (Fig.~\ref{Fig_LBC_shlat}-d). |
---|
120 | The friction is thus larger than in the no-slip case. |
---|
121 | |
---|
122 | \end{description} |
---|
123 | |
---|
124 | Note that when the bottom topography is entirely represented by the $s$-coor-dinates |
---|
125 | (pure $s$-coordinate), the lateral boundary condition on tangential velocity is of much |
---|
126 | less importance as it is only applied next to the coast where the minimum water depth |
---|
127 | can be quite shallow. |
---|
128 | |
---|
129 | |
---|
130 | % ================================================================ |
---|
131 | % Boundary Condition around the Model Domain |
---|
132 | % ================================================================ |
---|
133 | \section{Model Domain Boundary Condition (\np{jperio})} |
---|
134 | \label{LBC_jperio} |
---|
135 | |
---|
136 | At the model domain boundaries several choices are offered: closed, cyclic east-west, |
---|
137 | south symmetric across the equator, a north-fold, and combination closed-north fold |
---|
138 | or cyclic-north-fold. The north-fold boundary condition is associated with the 3-pole ORCA mesh. |
---|
139 | |
---|
140 | % ------------------------------------------------------------------------------------------------------------- |
---|
141 | % Closed, cyclic, south symmetric (\np{jperio} = 0, 1 or 2) |
---|
142 | % ------------------------------------------------------------------------------------------------------------- |
---|
143 | \subsection{Closed, cyclic, south symmetric (\np{jperio} = 0, 1 or 2)} |
---|
144 | \label{LBC_jperio012} |
---|
145 | |
---|
146 | The choice of closed, cyclic or symmetric model domain boundary condition is made |
---|
147 | by setting \np{jperio} to 0, 1 or 2 in namelist \ngn{namcfg}. Each time such a boundary |
---|
148 | condition is needed, it is set by a call to routine \mdl{lbclnk}. The computation of |
---|
149 | momentum and tracer trends proceeds from $i=2$ to $i=jpi-1$ and from $j=2$ to |
---|
150 | $j=jpj-1$, $i.e.$ in the model interior. To choose a lateral model boundary condition |
---|
151 | is to specify the first and last rows and columns of the model variables. |
---|
152 | |
---|
153 | \begin{description} |
---|
154 | |
---|
155 | \item[For closed boundary (\textit{jperio=0})], solid walls are imposed at all model |
---|
156 | boundaries: first and last rows and columns are set to zero. |
---|
157 | |
---|
158 | \item[For cyclic east-west boundary (\textit{jperio=1})], first and last rows are set |
---|
159 | to zero (closed) whilst the first column is set to the value of the last-but-one column |
---|
160 | and the last column to the value of the second one (Fig.~\ref{Fig_LBC_jperio}-a). |
---|
161 | Whatever flows out of the eastern (western) end of the basin enters the western |
---|
162 | (eastern) end. Note that there is no option for north-south cyclic or for doubly |
---|
163 | cyclic cases. |
---|
164 | |
---|
165 | \item[For symmetric boundary condition across the equator (\textit{jperio=2})], |
---|
166 | last rows, and first and last columns are set to zero (closed). The row of symmetry |
---|
167 | is chosen to be the $u$- and $T-$points equator line ($j=2$, i.e. at the southern |
---|
168 | end of the domain). For arrays defined at $u-$ or $T-$points, the first row is set |
---|
169 | to the value of the third row while for most of $v$- and $f$-point arrays ($v$, $\zeta$, |
---|
170 | $j\psi$, but \gmcomment{not sure why this is "but"} scalar arrays such as eddy coefficients) |
---|
171 | the first row is set to minus the value of the second row (Fig.~\ref{Fig_LBC_jperio}-b). |
---|
172 | Note that this boundary condition is not yet available for the case of a massively |
---|
173 | parallel computer (\textbf{key{\_}mpp} defined). |
---|
174 | |
---|
175 | \end{description} |
---|
176 | |
---|
177 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
178 | \begin{figure}[!t] \begin{center} |
---|
179 | \includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_LBC_jperio.pdf} |
---|
180 | \caption{ \label{Fig_LBC_jperio} |
---|
181 | setting of (a) east-west cyclic (b) symmetric across the equator boundary conditions.} |
---|
182 | \end{center} \end{figure} |
---|
183 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
184 | |
---|
185 | % ------------------------------------------------------------------------------------------------------------- |
---|
186 | % North fold (\textit{jperio = 3 }to $6)$ |
---|
187 | % ------------------------------------------------------------------------------------------------------------- |
---|
188 | \subsection{North-fold (\textit{jperio = 3 }to $6$) } |
---|
189 | \label{LBC_north_fold} |
---|
190 | |
---|
191 | The north fold boundary condition has been introduced in order to handle the north |
---|
192 | boundary of a three-polar ORCA grid. Such a grid has two poles in the northern hemisphere |
---|
193 | (Fig.\ref{Fig_MISC_ORCA_msh}, and thus requires a specific treatment illustrated in Fig.\ref{Fig_North_Fold_T}. |
---|
194 | Further information can be found in \mdl{lbcnfd} module which applies the north fold boundary condition. |
---|
195 | |
---|
196 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
197 | \begin{figure}[!t] \begin{center} |
---|
198 | \includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_North_Fold_T.pdf} |
---|
199 | \caption{ \label{Fig_North_Fold_T} |
---|
200 | North fold boundary with a $T$-point pivot and cyclic east-west boundary condition |
---|
201 | ($jperio=4$), as used in ORCA 2, 1/4, and 1/12. Pink shaded area corresponds |
---|
202 | to the inner domain mask (see text). } |
---|
203 | \end{center} \end{figure} |
---|
204 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
205 | |
---|
206 | % ==================================================================== |
---|
207 | % Exchange with neighbouring processors |
---|
208 | % ==================================================================== |
---|
209 | \section [Exchange with neighbouring processors (\textit{lbclnk}, \textit{lib\_mpp})] |
---|
210 | {Exchange with neighbouring processors (\mdl{lbclnk}, \mdl{lib\_mpp})} |
---|
211 | \label{LBC_mpp} |
---|
212 | |
---|
213 | For massively parallel processing (mpp), a domain decomposition method is used. |
---|
214 | The basic idea of the method is to split the large computation domain of a numerical |
---|
215 | experiment into several smaller domains and solve the set of equations by addressing |
---|
216 | independent local problems. Each processor has its own local memory and computes |
---|
217 | the model equation over a subdomain of the whole model domain. The subdomain |
---|
218 | boundary conditions are specified through communications between processors |
---|
219 | which are organized by explicit statements (message passing method). |
---|
220 | |
---|
221 | A big advantage is that the method does not need many modifications of the initial |
---|
222 | FORTRAN code. From the modeller's point of view, each sub domain running on |
---|
223 | a processor is identical to the "mono-domain" code. In addition, the programmer |
---|
224 | manages the communications between subdomains, and the code is faster when |
---|
225 | the number of processors is increased. The porting of OPA code on an iPSC860 |
---|
226 | was achieved during Guyon's PhD [Guyon et al. 1994, 1995] in collaboration with |
---|
227 | CETIIS and ONERA. The implementation in the operational context and the studies |
---|
228 | of performance on a T3D and T3E Cray computers have been made in collaboration |
---|
229 | with IDRIS and CNRS. The present implementation is largely inspired by Guyon's |
---|
230 | work [Guyon 1995]. |
---|
231 | |
---|
232 | The parallelization strategy is defined by the physical characteristics of the |
---|
233 | ocean model. Second order finite difference schemes lead to local discrete |
---|
234 | operators that depend at the very most on one neighbouring point. The only |
---|
235 | non-local computations concern the vertical physics (implicit diffusion, |
---|
236 | turbulent closure scheme, ...) (delocalization over the whole water column), |
---|
237 | and the solving of the elliptic equation associated with the surface pressure |
---|
238 | gradient computation (delocalization over the whole horizontal domain). |
---|
239 | Therefore, a pencil strategy is used for the data sub-structuration |
---|
240 | : the 3D initial domain is laid out on local processor |
---|
241 | memories following a 2D horizontal topological splitting. Each sub-domain |
---|
242 | computes its own surface and bottom boundary conditions and has a side |
---|
243 | wall overlapping interface which defines the lateral boundary conditions for |
---|
244 | computations in the inner sub-domain. The overlapping area consists of the |
---|
245 | two rows at each edge of the sub-domain. After a computation, a communication |
---|
246 | phase starts: each processor sends to its neighbouring processors the update |
---|
247 | values of the points corresponding to the interior overlapping area to its |
---|
248 | neighbouring sub-domain ($i.e.$ the innermost of the two overlapping rows). |
---|
249 | The communication is done through the Message Passing Interface (MPI). |
---|
250 | The data exchanges between processors are required at the very |
---|
251 | place where lateral domain boundary conditions are set in the mono-domain |
---|
252 | computation : the \rou{lbc\_lnk} routine (found in \mdl{lbclnk} module) |
---|
253 | which manages such conditions is interfaced with routines found in \mdl{lib\_mpp} module |
---|
254 | when running on an MPP computer ($i.e.$ when \key{mpp\_mpi} defined). |
---|
255 | It has to be pointed out that when using the MPP version of the model, |
---|
256 | the east-west cyclic boundary condition is done implicitly, |
---|
257 | whilst the south-symmetric boundary condition option is not available. |
---|
258 | |
---|
259 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
260 | \begin{figure}[!t] \begin{center} |
---|
261 | \includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_mpp.pdf} |
---|
262 | \caption{ \label{Fig_mpp} |
---|
263 | Positioning of a sub-domain when massively parallel processing is used. } |
---|
264 | \end{center} \end{figure} |
---|
265 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
266 | |
---|
267 | In the standard version of \NEMO, the splitting is regular and arithmetic. |
---|
268 | The i-axis is divided by \jp{jpni} and the j-axis by \jp{jpnj} for a number of processors |
---|
269 | \jp{jpnij} most often equal to $jpni \times jpnj$ (parameters set in |
---|
270 | \ngn{nammpp} namelist). Each processor is independent and without message passing |
---|
271 | or synchronous process, programs run alone and access just its own local memory. |
---|
272 | For this reason, the main model dimensions are now the local dimensions of the subdomain (pencil) |
---|
273 | that are named \jp{jpi}, \jp{jpj}, \jp{jpk}. These dimensions include the internal |
---|
274 | domain and the overlapping rows. The number of rows to exchange (known as |
---|
275 | the halo) is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). The whole domain |
---|
276 | dimensions are named \np{jpiglo}, \np{jpjglo} and \jp{jpk}. The relationship between |
---|
277 | the whole domain and a sub-domain is: |
---|
278 | \begin{eqnarray} |
---|
279 | jpi & = & ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci \nonumber \\ |
---|
280 | jpj & = & ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj \label{Eq_lbc_jpi} |
---|
281 | \end{eqnarray} |
---|
282 | where \jp{jpni}, \jp{jpnj} are the number of processors following the i- and j-axis. |
---|
283 | |
---|
284 | One also defines variables nldi and nlei which correspond to the internal domain bounds, |
---|
285 | and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain. |
---|
286 | An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$, |
---|
287 | a global array (whole domain) by the relationship: |
---|
288 | \begin{equation} \label{Eq_lbc_nimpp} |
---|
289 | T_{g} (i+nimpp-1,j+njmpp-1,k) = T_{l} (i,j,k), |
---|
290 | \end{equation} |
---|
291 | with $1 \leq i \leq jpi$, $1 \leq j \leq jpj $ , and $1 \leq k \leq jpk$. |
---|
292 | |
---|
293 | Processors are numbered from 0 to $jpnij-1$, the number is saved in the variable |
---|
294 | nproc. In the standard version, a processor has no more than four neighbouring |
---|
295 | processors named nono (for north), noea (east), noso (south) and nowe (west) |
---|
296 | and two variables, nbondi and nbondj, indicate the relative position of the processor : |
---|
297 | \begin{itemize} |
---|
298 | \item nbondi = -1 an east neighbour, no west processor, |
---|
299 | \item nbondi = 0 an east neighbour, a west neighbour, |
---|
300 | \item nbondi = 1 no east processor, a west neighbour, |
---|
301 | \item nbondi = 2 no splitting following the i-axis. |
---|
302 | \end{itemize} |
---|
303 | During the simulation, processors exchange data with their neighbours. |
---|
304 | If there is effectively a neighbour, the processor receives variables from this |
---|
305 | processor on its overlapping row, and sends the data issued from internal |
---|
306 | domain corresponding to the overlapping row of the other processor. |
---|
307 | |
---|
308 | |
---|
309 | The \NEMO model computes equation terms with the help of mask arrays (0 on land |
---|
310 | points and 1 on sea points). It is easily readable and very efficient in the context of |
---|
311 | a computer with vectorial architecture. However, in the case of a scalar processor, |
---|
312 | computations over the land regions become more expensive in terms of CPU time. |
---|
313 | It is worse when we use a complex configuration with a realistic bathymetry like the |
---|
314 | global ocean where more than 50 \% of points are land points. For this reason, a |
---|
315 | pre-processing tool can be used to choose the mpp domain decomposition with a |
---|
316 | maximum number of only land points processors, which can then be eliminated (Fig. \ref{Fig_mppini2}) |
---|
317 | (For example, the mpp\_optimiz tools, available from the DRAKKAR web site). |
---|
318 | This optimisation is dependent on the specific bathymetry employed. The user |
---|
319 | then chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with |
---|
320 | $jpnij < jpni \times jpnj$, leading to the elimination of $jpni \times jpnj - jpnij$ |
---|
321 | land processors. When those parameters are specified in \ngn{nammpp} namelist, |
---|
322 | the algorithm in the \rou{inimpp2} routine sets each processor's parameters (nbound, |
---|
323 | nono, noea,...) so that the land-only processors are not taken into account. |
---|
324 | |
---|
325 | \gmcomment{Note that the inimpp2 routine is general so that the original inimpp |
---|
326 | routine should be suppressed from the code.} |
---|
327 | |
---|
328 | When land processors are eliminated, the value corresponding to these locations in |
---|
329 | the model output files is undefined. Note that this is a problem for the meshmask file |
---|
330 | which requires to be defined over the whole domain. Therefore, user should not eliminate |
---|
331 | land processors when creating a meshmask file ($i.e.$ when setting a non-zero value to \np{nn\_msh}). |
---|
332 | |
---|
333 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
334 | \begin{figure}[!ht] \begin{center} |
---|
335 | \includegraphics[width=0.90\textwidth]{./TexFiles/Figures/Fig_mppini2.pdf} |
---|
336 | \caption { \label{Fig_mppini2} |
---|
337 | Example of Atlantic domain defined for the CLIPPER projet. Initial grid is |
---|
338 | composed of 773 x 1236 horizontal points. |
---|
339 | (a) the domain is split onto 9 \time 20 subdomains (jpni=9, jpnj=20). |
---|
340 | 52 subdomains are land areas. |
---|
341 | (b) 52 subdomains are eliminated (white rectangles) and the resulting number |
---|
342 | of processors really used during the computation is jpnij=128.} |
---|
343 | \end{center} \end{figure} |
---|
344 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
345 | |
---|
346 | |
---|
347 | % ==================================================================== |
---|
348 | % Unstructured open boundaries BDY |
---|
349 | % ==================================================================== |
---|
350 | \section{Unstructured Open Boundary Conditions (\key{bdy}) (BDY)} |
---|
351 | \label{LBC_bdy} |
---|
352 | |
---|
353 | %-----------------------------------------nambdy-------------------------------------------- |
---|
354 | \namdisplay{nambdy} |
---|
355 | %----------------------------------------------------------------------------------------------- |
---|
356 | %-----------------------------------------nambdy_index-------------------------------------------- |
---|
357 | \namdisplay{nambdy_index} |
---|
358 | %----------------------------------------------------------------------------------------------- |
---|
359 | %-----------------------------------------nambdy_dta-------------------------------------------- |
---|
360 | \namdisplay{nambdy_dta} |
---|
361 | %----------------------------------------------------------------------------------------------- |
---|
362 | %-----------------------------------------nambdy_dta-------------------------------------------- |
---|
363 | \namdisplay{nambdy_dta2} |
---|
364 | %----------------------------------------------------------------------------------------------- |
---|
365 | |
---|
366 | Options are defined through the \ngn{nambdy} \ngn{nambdy\_index} |
---|
367 | \ngn{nambdy\_dta} \ngn{nambdy\_dta2} namelist variables. |
---|
368 | The BDY module is an alternative implementation of open boundary |
---|
369 | conditions for regional configurations. It implements the Flow |
---|
370 | Relaxation Scheme algorithm for temperature, salinity, velocities and |
---|
371 | ice fields, and the Flather radiation condition for the depth-mean |
---|
372 | transports. The specification of the location of the open boundary is |
---|
373 | completely flexible and allows for example the open boundary to follow |
---|
374 | an isobath or other irregular contour. |
---|
375 | |
---|
376 | The BDY module was modelled on the OBC module and shares many features |
---|
377 | and a similar coding structure \citep{Chanut2005}. |
---|
378 | |
---|
379 | The BDY module is completely rewritten at NEMO 3.4 and there is a new |
---|
380 | set of namelists. Boundary data files used with earlier versions of |
---|
381 | NEMO may need to be re-ordered to work with this version. See the |
---|
382 | section on the Input Boundary Data Files for details. |
---|
383 | |
---|
384 | %---------------------------------------------- |
---|
385 | \subsection{The namelists} |
---|
386 | \label{BDY_namelist} |
---|
387 | |
---|
388 | It is possible to define more than one boundary ``set'' and apply |
---|
389 | different boundary conditions to each set. The number of boundary |
---|
390 | sets is defined by \np{nb\_bdy}. Each boundary set may be defined |
---|
391 | as a set of straight line segments in a namelist |
---|
392 | (\np{ln\_coords\_file}=.false.) or read in from a file |
---|
393 | (\np{ln\_coords\_file}=.true.). If the set is defined in a namelist, |
---|
394 | then the namelists nambdy\_index must be included separately, one for |
---|
395 | each set. If the set is defined by a file, then a |
---|
396 | ``coordinates.bdy.nc'' file must be provided. The coordinates.bdy file |
---|
397 | is analagous to the usual NEMO ``coordinates.nc'' file. In the example |
---|
398 | above, there are two boundary sets, the first of which is defined via |
---|
399 | a file and the second is defined in a namelist. For more details of |
---|
400 | the definition of the boundary geometry see section |
---|
401 | \ref{BDY_geometry}. |
---|
402 | |
---|
403 | For each boundary set a boundary |
---|
404 | condition has to be chosen for the barotropic solution (``u2d'': |
---|
405 | sea-surface height and barotropic velocities), for the baroclinic |
---|
406 | velocities (``u3d''), and for the active tracers\footnote{The BDY |
---|
407 | module does not deal with passive tracers at this version} |
---|
408 | (``tra''). For each set of variables there is a choice of algorithm |
---|
409 | and a choice for the data, eg. for the active tracers the algorithm is |
---|
410 | set by \np{nn\_tra} and the choice of data is set by |
---|
411 | \np{nn\_tra\_dta}. |
---|
412 | |
---|
413 | The choice of algorithm is currently as follows: |
---|
414 | |
---|
415 | \mbox{} |
---|
416 | |
---|
417 | \begin{itemize} |
---|
418 | \item[0.] No boundary condition applied. So the solution will ``see'' |
---|
419 | the land points around the edge of the edge of the domain. |
---|
420 | \item[1.] Flow Relaxation Scheme (FRS) available for all variables. |
---|
421 | \item[2.] Flather radiation scheme for the barotropic variables. The |
---|
422 | Flather scheme is not compatible with the filtered free surface |
---|
423 | ({\it dynspg\_ts}). |
---|
424 | \end{itemize} |
---|
425 | |
---|
426 | \mbox{} |
---|
427 | |
---|
428 | The main choice for the boundary data is |
---|
429 | to use initial conditions as boundary data (\np{nn\_tra\_dta}=0) or to |
---|
430 | use external data from a file (\np{nn\_tra\_dta}=1). For the |
---|
431 | barotropic solution there is also the option to use tidal |
---|
432 | harmonic forcing either by itself or in addition to other external |
---|
433 | data. |
---|
434 | |
---|
435 | If external boundary data is required then the nambdy\_dta namelist |
---|
436 | must be defined. One nambdy\_dta namelist is required for each boundary |
---|
437 | set in the order in which the boundary sets are defined in nambdy. In |
---|
438 | the example given, two boundary sets have been defined and so there |
---|
439 | are two nambdy\_dta namelists. The boundary data is read in using the |
---|
440 | fldread module, so the nambdy\_dta namelist is in the format required |
---|
441 | for fldread. For each variable required, the filename, the frequency |
---|
442 | of the files and the frequency of the data in the files is given. Also |
---|
443 | whether or not time-interpolation is required and whether the data is |
---|
444 | climatological (time-cyclic) data. Note that on-the-fly spatial |
---|
445 | interpolation of boundary data is not available at this version. |
---|
446 | |
---|
447 | In the example namelists given, two boundary sets are defined. The |
---|
448 | first set is defined via a file and applies FRS conditions to |
---|
449 | temperature and salinity and Flather conditions to the barotropic |
---|
450 | variables. External data is provided in daily files (from a |
---|
451 | large-scale model). Tidal harmonic forcing is also used. The second |
---|
452 | set is defined in a namelist. FRS conditions are applied on |
---|
453 | temperature and salinity and climatological data is read from external |
---|
454 | files. |
---|
455 | |
---|
456 | %---------------------------------------------- |
---|
457 | \subsection{The Flow Relaxation Scheme} |
---|
458 | \label{BDY_FRS_scheme} |
---|
459 | |
---|
460 | The Flow Relaxation Scheme (FRS) \citep{Davies_QJRMS76,Engerdahl_Tel95}, |
---|
461 | applies a simple relaxation of the model fields to |
---|
462 | externally-specified values over a zone next to the edge of the model |
---|
463 | domain. Given a model prognostic variable $\Phi$ |
---|
464 | \begin{equation} \label{Eq_bdy_frs1} |
---|
465 | \Phi(d) = \alpha(d)\Phi_{e}(d) + (1-\alpha(d))\Phi_{m}(d)\;\;\;\;\; d=1,N |
---|
466 | \end{equation} |
---|
467 | where $\Phi_{m}$ is the model solution and $\Phi_{e}$ is the specified |
---|
468 | external field, $d$ gives the discrete distance from the model |
---|
469 | boundary and $\alpha$ is a parameter that varies from $1$ at $d=1$ to |
---|
470 | a small value at $d=N$. It can be shown that this scheme is equivalent |
---|
471 | to adding a relaxation term to the prognostic equation for $\Phi$ of |
---|
472 | the form: |
---|
473 | \begin{equation} \label{Eq_bdy_frs2} |
---|
474 | -\frac{1}{\tau}\left(\Phi - \Phi_{e}\right) |
---|
475 | \end{equation} |
---|
476 | where the relaxation time scale $\tau$ is given by a function of |
---|
477 | $\alpha$ and the model time step $\Delta t$: |
---|
478 | \begin{equation} \label{Eq_bdy_frs3} |
---|
479 | \tau = \frac{1-\alpha}{\alpha} \,\rdt |
---|
480 | \end{equation} |
---|
481 | Thus the model solution is completely prescribed by the external |
---|
482 | conditions at the edge of the model domain and is relaxed towards the |
---|
483 | external conditions over the rest of the FRS zone. The application of |
---|
484 | a relaxation zone helps to prevent spurious reflection of outgoing |
---|
485 | signals from the model boundary. |
---|
486 | |
---|
487 | The function $\alpha$ is specified as a $tanh$ function: |
---|
488 | \begin{equation} \label{Eq_bdy_frs4} |
---|
489 | \alpha(d) = 1 - \tanh\left(\frac{d-1}{2}\right), \quad d=1,N |
---|
490 | \end{equation} |
---|
491 | The width of the FRS zone is specified in the namelist as |
---|
492 | \np{nn\_rimwidth}. This is typically set to a value between 8 and 10. |
---|
493 | |
---|
494 | %---------------------------------------------- |
---|
495 | \subsection{The Flather radiation scheme} |
---|
496 | \label{BDY_flather_scheme} |
---|
497 | |
---|
498 | The \citet{Flather_JPO94} scheme is a radiation condition on the normal, depth-mean |
---|
499 | transport across the open boundary. It takes the form |
---|
500 | \begin{equation} \label{Eq_bdy_fla1} |
---|
501 | U = U_{e} + \frac{c}{h}\left(\eta - \eta_{e}\right), |
---|
502 | \end{equation} |
---|
503 | where $U$ is the depth-mean velocity normal to the boundary and $\eta$ |
---|
504 | is the sea surface height, both from the model. The subscript $e$ |
---|
505 | indicates the same fields from external sources. The speed of external |
---|
506 | gravity waves is given by $c = \sqrt{gh}$, and $h$ is the depth of the |
---|
507 | water column. The depth-mean normal velocity along the edge of the |
---|
508 | model domain is set equal to the |
---|
509 | external depth-mean normal velocity, plus a correction term that |
---|
510 | allows gravity waves generated internally to exit the model boundary. |
---|
511 | Note that the sea-surface height gradient in \eqref{Eq_bdy_fla1} |
---|
512 | is a spatial gradient across the model boundary, so that $\eta_{e}$ is |
---|
513 | defined on the $T$ points with $nbr=1$ and $\eta$ is defined on the |
---|
514 | $T$ points with $nbr=2$. $U$ and $U_{e}$ are defined on the $U$ or |
---|
515 | $V$ points with $nbr=1$, $i.e.$ between the two $T$ grid points. |
---|
516 | |
---|
517 | %---------------------------------------------- |
---|
518 | \subsection{Boundary geometry} |
---|
519 | \label{BDY_geometry} |
---|
520 | |
---|
521 | Each open boundary set is defined as a list of points. The information |
---|
522 | is stored in the arrays $nbi$, $nbj$, and $nbr$ in the $idx\_bdy$ |
---|
523 | structure. The $nbi$ and $nbj$ arrays |
---|
524 | define the local $(i,j)$ indices of each point in the boundary zone |
---|
525 | and the $nbr$ array defines the discrete distance from the boundary |
---|
526 | with $nbr=1$ meaning that the point is next to the edge of the |
---|
527 | model domain and $nbr>1$ showing that the point is increasingly |
---|
528 | further away from the edge of the model domain. A set of $nbi$, $nbj$, |
---|
529 | and $nbr$ arrays is defined for each of the $T$, $U$ and $V$ |
---|
530 | grids. Figure \ref{Fig_LBC_bdy_geom} shows an example of an irregular |
---|
531 | boundary. |
---|
532 | |
---|
533 | The boundary geometry for each set may be defined in a namelist |
---|
534 | nambdy\_index or by reading in a ``coordinates.bdy.nc'' file. The |
---|
535 | nambdy\_index namelist defines a series of straight-line segments for |
---|
536 | north, east, south and west boundaries. For the northern boundary, |
---|
537 | \np{nbdysegn} gives the number of segments, \np{jpjnob} gives the $j$ |
---|
538 | index for each segment and \np{jpindt} and \np{jpinft} give the start |
---|
539 | and end $i$ indices for each segment with similar for the other |
---|
540 | boundaries. These segments define a list of $T$ grid points along the |
---|
541 | outermost row of the boundary ($nbr\,=\, 1$). The code deduces the $U$ and |
---|
542 | $V$ points and also the points for $nbr\,>\, 1$ if |
---|
543 | $nn\_rimwidth\,>\,1$. |
---|
544 | |
---|
545 | The boundary geometry may also be defined from a |
---|
546 | ``coordinates.bdy.nc'' file. Figure \ref{Fig_LBC_nc_header} |
---|
547 | gives an example of the header information from such a file. The file |
---|
548 | should contain the index arrays for each of the $T$, $U$ and $V$ |
---|
549 | grids. The arrays must be in order of increasing $nbr$. Note that the |
---|
550 | $nbi$, $nbj$ values in the file are global values and are converted to |
---|
551 | local values in the code. Typically this file will be used to generate |
---|
552 | external boundary data via interpolation and so will also contain the |
---|
553 | latitudes and longitudes of each point as shown. However, this is not |
---|
554 | necessary to run the model. |
---|
555 | |
---|
556 | For some choices of irregular boundary the model domain may contain |
---|
557 | areas of ocean which are not part of the computational domain. For |
---|
558 | example if an open boundary is defined along an isobath, say at the |
---|
559 | shelf break, then the areas of ocean outside of this boundary will |
---|
560 | need to be masked out. This can be done by reading a mask file defined |
---|
561 | as \np{cn\_mask\_file} in the nam\_bdy namelist. Only one mask file is |
---|
562 | used even if multiple boundary sets are defined. |
---|
563 | |
---|
564 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
565 | \begin{figure}[!t] \begin{center} |
---|
566 | \includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_LBC_bdy_geom.pdf} |
---|
567 | \caption { \label{Fig_LBC_bdy_geom} |
---|
568 | Example of geometry of unstructured open boundary} |
---|
569 | \end{center} \end{figure} |
---|
570 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
571 | |
---|
572 | %---------------------------------------------- |
---|
573 | \subsection{Input boundary data files} |
---|
574 | \label{BDY_data} |
---|
575 | |
---|
576 | The data files contain the data arrays |
---|
577 | in the order in which the points are defined in the $nbi$ and $nbj$ |
---|
578 | arrays. The data arrays are dimensioned on: a time dimension; |
---|
579 | $xb$ which is the index of the boundary data point in the horizontal; |
---|
580 | and $yb$ which is a degenerate dimension of 1 to enable the file to be |
---|
581 | read by the standard NEMO I/O routines. The 3D fields also have a |
---|
582 | depth dimension. |
---|
583 | |
---|
584 | At Version 3.4 there are new restrictions on the order in which the |
---|
585 | boundary points are defined (and therefore restrictions on the order |
---|
586 | of the data in the file). In particular: |
---|
587 | |
---|
588 | \mbox{} |
---|
589 | |
---|
590 | \begin{enumerate} |
---|
591 | \item The data points must be in order of increasing $nbr$, ie. all |
---|
592 | the $nbr=1$ points, then all the $nbr=2$ points etc. |
---|
593 | \item All the data for a particular boundary set must be in the same |
---|
594 | order. (Prior to 3.4 it was possible to define barotropic data in a |
---|
595 | different order to the data for tracers and baroclinic velocities). |
---|
596 | \end{enumerate} |
---|
597 | |
---|
598 | \mbox{} |
---|
599 | |
---|
600 | These restrictions mean that data files used with previous versions of |
---|
601 | the model may not work with version 3.4. A fortran utility |
---|
602 | {\it bdy\_reorder} exists in the TOOLS directory which will re-order the |
---|
603 | data in old BDY data files. |
---|
604 | |
---|
605 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
606 | \begin{figure}[!t] \begin{center} |
---|
607 | \includegraphics[width=1.0\textwidth]{./TexFiles/Figures/Fig_LBC_nc_header.pdf} |
---|
608 | \caption { \label{Fig_LBC_nc_header} |
---|
609 | Example of the header for a coordinates.bdy.nc file} |
---|
610 | \end{center} \end{figure} |
---|
611 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
612 | |
---|
613 | %---------------------------------------------- |
---|
614 | \subsection{Volume correction} |
---|
615 | \label{BDY_vol_corr} |
---|
616 | |
---|
617 | There is an option to force the total volume in the regional model to be constant, |
---|
618 | similar to the option in the OBC module. This is controlled by the \np{nn\_volctl} |
---|
619 | parameter in the namelist. A value of \np{nn\_volctl}~=~0 indicates that this option is not used. |
---|
620 | If \np{nn\_volctl}~=~1 then a correction is applied to the normal velocities |
---|
621 | around the boundary at each timestep to ensure that the integrated volume flow |
---|
622 | through the boundary is zero. If \np{nn\_volctl}~=~2 then the calculation of |
---|
623 | the volume change on the timestep includes the change due to the freshwater |
---|
624 | flux across the surface and the correction velocity corrects for this as well. |
---|
625 | |
---|
626 | If more than one boundary set is used then volume correction is |
---|
627 | applied to all boundaries at once. |
---|
628 | |
---|
629 | \newpage |
---|
630 | %---------------------------------------------- |
---|
631 | \subsection{Tidal harmonic forcing} |
---|
632 | \label{BDY_tides} |
---|
633 | |
---|
634 | %-----------------------------------------nambdy_tide-------------------------------------------- |
---|
635 | \namdisplay{nambdy_tide} |
---|
636 | %----------------------------------------------------------------------------------------------- |
---|
637 | |
---|
638 | Options are defined through the \ngn{nambdy\_tide} namelist variables. |
---|
639 | To be written.... |
---|
640 | |
---|
641 | |
---|
642 | |
---|
643 | |
---|