Changeset 11573 for NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/doc/latex/NEMO/subfiles/chap_LBC.tex
- Timestamp:
- 2019-09-19T11:18:03+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/doc/latex/NEMO/subfiles/chap_LBC.tex
r11179 r11573 3 3 \begin{document} 4 4 % ================================================================ 5 % Chapter — Lateral Boundary Condition (LBC) 5 % Chapter — Lateral Boundary Condition (LBC) 6 6 % ================================================================ 7 7 \chapter{Lateral Boundary Condition (LBC)} 8 8 \label{chap:LBC} 9 9 10 \ minitoc10 \chaptertoc 11 11 12 12 \newpage … … 17 17 % Boundary Condition at the Coast 18 18 % ================================================================ 19 \section[Boundary condition at the coast (\texttt{rn\_shlat})] 20 {Boundary condition at the coast (\protect\np{rn\_shlat})} 19 \section[Boundary condition at the coast (\forcode{rn_shlat})]{Boundary condition at the coast (\protect\np{rn\_shlat})} 21 20 \label{sec:LBC_coast} 22 %--------------------------------------------nam_lbc------------------------------------------------------- 23 24 \nlst{namlbc} 21 %--------------------------------------------namlbc------------------------------------------------------- 22 23 \begin{listing} 24 \nlst{namlbc} 25 \caption{\forcode{&namlbc}} 26 \label{lst:namlbc} 27 \end{listing} 25 28 %-------------------------------------------------------------------------------------------------------------- 26 29 27 %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 \autoref{subsec:DOM_msk}). 28 29 %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, \ie 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 \autoref{subsec:DOM_msk}. 30 31 Options are defined through the \ngn{namlbc} namelist variables. 30 %The lateral ocean boundary conditions contiguous to coastlines are Neumann conditions for heat and salt 31 %(no flux across boundaries) and Dirichlet conditions for momentum (ranging from free-slip to "strong" no-slip). 32 %They are handled automatically by the mask system (see \autoref{subsec:DOM_msk}). 33 34 %OPA allows land and topography grid points in the computational domain due to the presence of continents or islands, 35 %and includes the use of a full or partial step representation of bottom topography. 36 %The computation is performed over the whole domain, \ie\ we do not try to restrict the computation to ocean-only points. 37 %This choice has two motivations. 38 %Firstly, working on ocean only grid points overloads the code and harms the code readability. 39 %Secondly, and more importantly, it drastically reduces the vector portion of the computation, 40 %leading to a dramatic increase of CPU time requirement on vector computers. 41 %The current section describes how the masking affects the computation of the various terms of the equations 42 %with respect to the boundary condition at solid walls. 43 %The process of defining which areas are to be masked is described in \autoref{subsec:DOM_msk}. 44 45 Options are defined through the \nam{lbc} namelist variables. 32 46 The discrete representation of a domain with complex boundaries (coastlines and bottom topography) leads to 33 47 arrays that include large portions where a computation is not required as the model variables remain at zero. … … 41 55 Since most of the boundary conditions consist of a zero flux across the solid boundaries, 42 56 they can be simply applied by multiplying variables by the correct mask arrays, 43 \ie the mask array of the grid point where the flux is evaluated.57 \ie\ the mask array of the grid point where the flux is evaluated. 44 58 For example, the heat flux in the \textbf{i}-direction is evaluated at $u$-points. 45 59 Evaluating this quantity as, 46 60 47 61 \[ 48 % \label{eq: lbc_aaaa}62 % \label{eq:LBC_aaaa} 49 63 \frac{A^{lT} }{e_1 }\frac{\partial T}{\partial i}\equiv \frac{A_u^{lT} 50 64 }{e_{1u} } \; \delta_{i+1 / 2} \left[ T \right]\;\;mask_u … … 52 66 (where mask$_{u}$ is the mask array at a $u$-point) ensures that the heat flux is zero inside land and 53 67 at the boundaries, since mask$_{u}$ is zero at solid boundaries which in this case are defined at $u$-points 54 (normal velocity $u$ remains zero at the coast) (\autoref{fig:LBC_uv}). 68 (normal velocity $u$ remains zero at the coast) (\autoref{fig:LBC_uv}). 55 69 56 70 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 57 71 \begin{figure}[!t] 58 \begin{center} 59 \includegraphics[width=\textwidth]{Fig_LBC_uv} 60 \caption{ 61 \protect\label{fig:LBC_uv} 62 Lateral boundary (thick line) at T-level. 63 The velocity normal to the boundary is set to zero. 64 } 65 \end{center} 72 \centering 73 \includegraphics[width=0.66\textwidth]{Fig_LBC_uv} 74 \caption[Lateral boundary at $T$-level]{ 75 Lateral boundary (thick line) at T-level. 76 The velocity normal to the boundary is set to zero.} 77 \label{fig:LBC_uv} 66 78 \end{figure} 67 79 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 85 97 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 86 98 \begin{figure}[!p] 87 \begin{center} 88 \includegraphics[width=\textwidth]{Fig_LBC_shlat} 89 \caption{ 90 \protect\label{fig:LBC_shlat} 91 lateral boundary condition 92 (a) free-slip ($rn\_shlat=0$); 93 (b) no-slip ($rn\_shlat=2$); 94 (c) "partial" free-slip ($0<rn\_shlat<2$) and 95 (d) "strong" no-slip ($2<rn\_shlat$). 96 Implied "ghost" velocity inside land area is display in grey. 97 } 98 \end{center} 99 \centering 100 \includegraphics[width=0.66\textwidth]{Fig_LBC_shlat} 101 \caption[Lateral boundary conditions]{ 102 Lateral boundary conditions 103 (a) free-slip (\protect\np{rn\_shlat}\forcode{=0}); 104 (b) no-slip (\protect\np{rn\_shlat}\forcode{=2}); 105 (c) "partial" free-slip (\forcode{0<}\protect\np{rn\_shlat}\forcode{<2}) and 106 (d) "strong" no-slip (\forcode{2<}\protect\np{rn\_shlat}). 107 Implied "ghost" velocity inside land area is display in grey.} 108 \label{fig:LBC_shlat} 99 109 \end{figure} 100 110 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 102 112 \begin{description} 103 113 104 \item[free-slip boundary condition (\np{rn\_shlat}\forcode{ =0}):] the tangential velocity at114 \item[free-slip boundary condition (\np{rn\_shlat}\forcode{=0}):] the tangential velocity at 105 115 the coastline is equal to the offshore velocity, 106 \ie the normal derivative of the tangential velocity is zero at the coast,116 \ie\ the normal derivative of the tangential velocity is zero at the coast, 107 117 so the vorticity: mask$_{f}$ array is set to zero inside the land and just at the coast 108 118 (\autoref{fig:LBC_shlat}-a). 109 119 110 \item[no-slip boundary condition (\np{rn\_shlat}\forcode{ =2}):] the tangential velocity vanishes at the coastline.120 \item[no-slip boundary condition (\np{rn\_shlat}\forcode{=2}):] the tangential velocity vanishes at the coastline. 111 121 Assuming that the tangential velocity decreases linearly from 112 122 the closest ocean velocity grid point to the coastline, … … 114 124 the closest ocean velocity gridpoint were of the same magnitude but in the opposite direction 115 125 (\autoref{fig:LBC_shlat}-b). 116 Therefore, the vorticity along the coastlines is given by: 126 Therefore, the vorticity along the coastlines is given by: 117 127 118 128 \[ … … 123 133 the no-slip boundary condition, simply by multiplying it by the mask$_{f}$ : 124 134 \[ 125 % \label{eq: lbc_bbbb}135 % \label{eq:LBC_bbbb} 126 136 \zeta \equiv \frac{1}{e_{1f} {\kern 1pt}e_{2f} }\left( {\delta_{i+1/2} 127 137 \left[ {e_{2v} \,v} \right]-\delta_{j+1/2} \left[ {e_{1u} \,u} \right]} … … 130 140 131 141 \item["partial" free-slip boundary condition (0$<$\np{rn\_shlat}$<$2):] the tangential velocity at 132 the coastline is smaller than the offshore velocity, \ie there is a lateral friction but142 the coastline is smaller than the offshore velocity, \ie\ there is a lateral friction but 133 143 not strong enough to make the tangential velocity at the coast vanish (\autoref{fig:LBC_shlat}-c). 134 144 This can be selected by providing a value of mask$_{f}$ strictly inbetween $0$ and $2$. … … 140 150 \end{description} 141 151 142 Note that when the bottom topography is entirely represented by the $s$-coor -dinates (pure $s$-coordinate),152 Note that when the bottom topography is entirely represented by the $s$-coordinates (pure $s$-coordinate), 143 153 the lateral boundary condition on tangential velocity is of much less importance as 144 154 it is only applied next to the coast where the minimum water depth can be quite shallow. … … 148 158 % Boundary Condition around the Model Domain 149 159 % ================================================================ 150 \section[Model domain boundary condition (\texttt{jperio})] 151 {Model domain boundary condition (\protect\np{jperio})} 160 \section[Model domain boundary condition (\forcode{jperio})]{Model domain boundary condition (\protect\jp{jperio})} 152 161 \label{sec:LBC_jperio} 153 162 … … 155 164 closed, cyclic east-west, cyclic north-south, a north-fold, and combination closed-north fold or 156 165 bi-cyclic east-west and north-fold. 157 The north-fold boundary condition is associated with the 3-pole ORCA mesh. 166 The north-fold boundary condition is associated with the 3-pole ORCA mesh. 158 167 159 168 % ------------------------------------------------------------------------------------------------------------- 160 % Closed, cyclic (\ np{jperio}\forcode{ = 0..2})169 % Closed, cyclic (\jp{jperio}\forcode{ = 0..2}) 161 170 % ------------------------------------------------------------------------------------------------------------- 162 \subsection[Closed, cyclic (\forcode{jperio = [0127]})] 163 {Closed, cyclic (\protect\np{jperio}\forcode{ = [0127]})} 171 \subsection[Closed, cyclic (\forcode{=0,1,2,7})]{Closed, cyclic (\protect\jp{jperio}\forcode{=0,1,2,7})} 164 172 \label{subsec:LBC_jperio012} 165 173 166 174 The choice of closed or cyclic model domain boundary condition is made by 167 setting \ np{jperio} to 0, 1, 2 or 7 in namelist \ngn{namcfg}.175 setting \jp{jperio} to 0, 1, 2 or 7 in namelist \nam{cfg}. 168 176 Each time such a boundary condition is needed, it is set by a call to routine \mdl{lbclnk}. 169 177 The computation of momentum and tracer trends proceeds from $i=2$ to $i=jpi-1$ and from $j=2$ to $j=jpj-1$, 170 \ie in the model interior.178 \ie\ in the model interior. 171 179 To choose a lateral model boundary condition is to specify the first and last rows and columns of 172 the model variables. 180 the model variables. 173 181 174 182 \begin{description} 175 183 176 \item[For closed boundary (\ np{jperio}\forcode{ =0})],184 \item[For closed boundary (\jp{jperio}\forcode{=0})], 177 185 solid walls are imposed at all model boundaries: 178 186 first and last rows and columns are set to zero. 179 187 180 \item[For cyclic east-west boundary (\ np{jperio}\forcode{ =1})],188 \item[For cyclic east-west boundary (\jp{jperio}\forcode{=1})], 181 189 first and last rows are set to zero (closed) whilst the first column is set to 182 190 the value of the last-but-one column and the last column to the value of the second one … … 184 192 Whatever flows out of the eastern (western) end of the basin enters the western (eastern) end. 185 193 186 \item[For cyclic north-south boundary (\ np{jperio}\forcode{ =2})],194 \item[For cyclic north-south boundary (\jp{jperio}\forcode{=2})], 187 195 first and last columns are set to zero (closed) whilst the first row is set to 188 196 the value of the last-but-one row and the last row to the value of the second one … … 190 198 Whatever flows out of the northern (southern) end of the basin enters the southern (northern) end. 191 199 192 \item[Bi-cyclic east-west and north-south boundary (\ np{jperio}\forcode{ =7})] combines cases 1 and 2.200 \item[Bi-cyclic east-west and north-south boundary (\jp{jperio}\forcode{=7})] combines cases 1 and 2. 193 201 194 202 \end{description} … … 196 204 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 197 205 \begin{figure}[!t] 198 \begin{center} 199 \includegraphics[width=\textwidth]{Fig_LBC_jperio} 200 \caption{ 201 \protect\label{fig:LBC_jperio} 202 setting of (a) east-west cyclic (b) symmetric across the equator boundary conditions. 203 } 204 \end{center} 206 \centering 207 \includegraphics[width=0.66\textwidth]{Fig_LBC_jperio} 208 \caption[Setting of east-west cyclic and symmetric across the Equator boundary conditions]{ 209 Setting of (a) east-west cyclic (b) symmetric across the Equator boundary conditions} 210 \label{fig:LBC_jperio} 205 211 \end{figure} 206 212 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 207 213 208 214 % ------------------------------------------------------------------------------------------------------------- 209 % North fold (\textit{jperio = 3 }to $6)$ 215 % North fold (\textit{jperio = 3 }to $6)$ 210 216 % ------------------------------------------------------------------------------------------------------------- 211 \subsection[North-fold (\forcode{jperio = [3-6]})] 212 {North-fold (\protect\np{jperio}\forcode{ = [3-6]})} 217 \subsection[North-fold (\forcode{=3,6})]{North-fold (\protect\jp{jperio}\forcode{=3,6})} 213 218 \label{subsec:LBC_north_fold} 214 219 215 220 The north fold boundary condition has been introduced in order to handle the north boundary of 216 221 a three-polar ORCA grid. 217 Such a grid has two poles in the northern hemisphere (\autoref{fig: MISC_ORCA_msh},218 and thus requires a specific treatment illustrated in \autoref{fig: North_Fold_T}.222 Such a grid has two poles in the northern hemisphere (\autoref{fig:CFGS_ORCA_msh}, 223 and thus requires a specific treatment illustrated in \autoref{fig:LBC_North_Fold_T}. 219 224 Further information can be found in \mdl{lbcnfd} module which applies the north fold boundary condition. 220 225 221 226 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 222 227 \begin{figure}[!t] 223 \begin{center} 224 \includegraphics[width=\textwidth]{Fig_North_Fold_T} 225 \caption{ 226 \protect\label{fig:North_Fold_T} 227 North fold boundary with a $T$-point pivot and cyclic east-west boundary condition ($jperio=4$), 228 as used in ORCA 2, 1/4, and 1/12. 229 Pink shaded area corresponds to the inner domain mask (see text). 230 } 231 \end{center} 228 \centering 229 \includegraphics[width=0.66\textwidth]{Fig_North_Fold_T} 230 \caption[North fold boundary in ORCA 2\deg, 1/4\deg and 1/12\deg]{ 231 North fold boundary with a $T$-point pivot and cyclic east-west boundary condition ($jperio=4$), 232 as used in ORCA 2\deg, 1/4\deg and 1/12\deg. 233 Pink shaded area corresponds to the inner domain mask (see text).} 234 \label{fig:LBC_North_Fold_T} 232 235 \end{figure} 233 236 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 234 237 235 238 % ==================================================================== 236 % Exchange with neighbouring processors 239 % Exchange with neighbouring processors 237 240 % ==================================================================== 238 \section[Exchange with neighbouring processors (\textit{lbclnk.F90}, \textit{lib\_mpp.F90})] 239 {Exchange with neighbouring processors (\protect\mdl{lbclnk}, \protect\mdl{lib\_mpp})} 241 \section[Exchange with neighbouring processors (\textit{lbclnk.F90}, \textit{lib\_mpp.F90})]{Exchange with neighbouring processors (\protect\mdl{lbclnk}, \protect\mdl{lib\_mpp})} 240 242 \label{sec:LBC_mpp} 241 243 244 %-----------------------------------------nammpp-------------------------------------------- 245 246 \begin{listing} 247 \nlst{nammpp} 248 \caption{\forcode{&nammpp}} 249 \label{lst:nammpp} 250 \end{listing} 251 %----------------------------------------------------------------------------------------------- 252 242 253 For massively parallel processing (mpp), a domain decomposition method is used. 243 The basic idea of the method is to split the large computation domain of a numerical experiment into 244 s everal smaller domains and solve the set of equations by addressing independent local problems.254 The basic idea of the method is to split the large computation domain of a numerical experiment into several smaller domains and 255 solve the set of equations by addressing independent local problems. 245 256 Each processor has its own local memory and computes the model equation over a subdomain of the whole model domain. 246 The subdomain boundary conditions are specified through communications between processors which 247 are organized by explicit statements (message passing method). 248 249 A big advantage is that the method does not need many modifications of the initial \fortran code. 250 From the modeller's point of view, each sub domain running on a processor is identical to the "mono-domain" code. 251 In addition, the programmer manages the communications between subdomains, 252 and the code is faster when the number of processors is increased. 253 The porting of OPA code on an iPSC860 was achieved during Guyon's PhD [Guyon et al. 1994, 1995] 254 in collaboration with CETIIS and ONERA. 255 The implementation in the operational context and the studies of performance on 256 a T3D and T3E Cray computers have been made in collaboration with IDRIS and CNRS. 257 The subdomain boundary conditions are specified through communications between processors which are organized by 258 explicit statements (message passing method). 257 259 The present implementation is largely inspired by Guyon's work [Guyon 1995]. 258 260 … … 261 263 depend at the very most on one neighbouring point. 262 264 The only non-local computations concern the vertical physics 263 (implicit diffusion, turbulent closure scheme, ...) (delocalization over the whole water column), 264 and the solving of the elliptic equation associated with the surface pressure gradient computation 265 (delocalization over the whole horizontal domain). 265 (implicit diffusion, turbulent closure scheme, ...). 266 266 Therefore, a pencil strategy is used for the data sub-structuration: 267 267 the 3D initial domain is laid out on local processor memories following a 2D horizontal topological splitting. … … 272 272 After a computation, a communication phase starts: 273 273 each processor sends to its neighbouring processors the update values of the points corresponding to 274 the interior overlapping area to its neighbouring sub-domain (\ie the innermost of the two overlapping rows). 275 The communication is done through the Message Passing Interface (MPI). 274 the interior overlapping area to its neighbouring sub-domain (\ie\ the innermost of the two overlapping rows). 275 Communications are first done according to the east-west direction and next according to the north-south direction. 276 There is no specific communications for the corners. 277 The communication is done through the Message Passing Interface (MPI) and requires \key{mpp\_mpi}. 278 Use also \key{mpi2} if MPI3 is not available on your computer. 276 279 The data exchanges between processors are required at the very place where 277 280 lateral domain boundary conditions are set in the mono-domain computation: 278 281 the \rou{lbc\_lnk} routine (found in \mdl{lbclnk} module) which manages such conditions is interfaced with 279 routines found in \mdl{lib\_mpp} module when running on an MPP computer (\ie when \key{mpp\_mpi} defined). 280 It has to be pointed out that when using the MPP version of the model, 281 the east-west cyclic boundary condition is done implicitly, 282 whilst the south-symmetric boundary condition option is not available. 282 routines found in \mdl{lib\_mpp} module. 283 The output file \textit{communication\_report.txt} provides the list of which routines do how 284 many communications during 1 time step of the model.\\ 283 285 284 286 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 285 287 \begin{figure}[!t] 286 \begin{center} 287 \includegraphics[width=\textwidth]{Fig_mpp} 288 \caption{ 289 \protect\label{fig:mpp} 290 Positioning of a sub-domain when massively parallel processing is used. 291 } 292 \end{center} 288 \centering 289 \includegraphics[width=0.66\textwidth]{Fig_mpp} 290 \caption{Positioning of a sub-domain when massively parallel processing is used} 291 \label{fig:LBC_mpp} 293 292 \end{figure} 294 293 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 295 294 296 In the standard version of \NEMO, the splitting is regular and arithmetic. 297 The i-axis is divided by \jp{jpni} and 298 the j-axis by \jp{jpnj} for a number of processors \jp{jpnij} most often equal to $jpni \times jpnj$ 299 (parameters set in \ngn{nammpp} namelist). 300 Each processor is independent and without message passing or synchronous process, 301 programs run alone and access just its own local memory. 302 For this reason, the main model dimensions are now the local dimensions of the subdomain (pencil) that 303 are named \jp{jpi}, \jp{jpj}, \jp{jpk}. 295 In \NEMO, the splitting is regular and arithmetic. 296 The total number of subdomains corresponds to the number of MPI processes allocated to \NEMO\ when the model is launched 297 (\ie\ mpirun -np x ./nemo will automatically give x subdomains). 298 The i-axis is divided by \np{jpni} and the j-axis by \np{jpnj}. 299 These parameters are defined in \nam{mpp} namelist. 300 If \np{jpni} and \np{jpnj} are < 1, they will be automatically redefined in the code to give the best domain decomposition 301 (see bellow). 302 303 Each processor is independent and without message passing or synchronous process, programs run alone and access just its own local memory. 304 For this reason, 305 the main model dimensions are now the local dimensions of the subdomain (pencil) that are named \jp{jpi}, \jp{jpj}, \jp{jpk}. 304 306 These dimensions include the internal domain and the overlapping rows. 305 The number of rows to exchange (known as the halo) is usually set to one (\jp{jpreci}=1, in \mdl{par\_oce}). 306 The whole domain dimensions are named \np{jpiglo}, \np{jpjglo} and \jp{jpk}. 307 The number of rows to exchange (known as the halo) is usually set to one (nn\_hls=1, in \mdl{par\_oce}, 308 and must be kept to one until further notice). 309 The whole domain dimensions are named \jp{jpiglo}, \jp{jpjglo} and \jp{jpk}. 307 310 The relationship between the whole domain and a sub-domain is: 311 \begin{gather*} 312 jpi = ( jpiglo-2\times nn\_hls + (jpni-1) ) / jpni + 2\times nn\_hls \\ 313 jpj = ( jpjglo-2\times nn\_hls + (jpnj-1) ) / jpnj + 2\times nn\_hls 314 \end{gather*} 315 316 One also defines variables nldi and nlei which correspond to the internal domain bounds, and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain (\autoref{fig:LBC_mpp}). Note that since the version 4, there is no more extra-halo area as defined in \autoref{fig:LBC_mpp} so \jp{jpi} is now always equal to nlci and \jp{jpj} equal to nlcj. 317 318 An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$, 319 a global array (whole domain) by the relationship: 308 320 \[ 309 jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci 310 jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj 311 \] 312 where \jp{jpni}, \jp{jpnj} are the number of processors following the i- and j-axis. 313 314 One also defines variables nldi and nlei which correspond to the internal domain bounds, 315 and the variables nimpp and njmpp which are the position of the (1,1) grid-point in the global domain. 316 An element of $T_{l}$, a local array (subdomain) corresponds to an element of $T_{g}$, 317 a global array (whole domain) by the relationship: 318 \[ 319 % \label{eq:lbc_nimpp} 321 % \label{eq:LBC_nimpp} 320 322 T_{g} (i+nimpp-1,j+njmpp-1,k) = T_{l} (i,j,k), 321 323 \] 322 with $1 \leq i \leq jpi$, $1 \leq j \leq jpj $ , and $1 \leq k \leq jpk$. 323 324 Processors are numbered from 0 to $jpnij-1$, the number is saved in the variable nproc. 325 In the standard version, a processor has no more than 326 four neighbouring processors named nono (for north), noea (east), noso (south) and nowe (west) and 327 two variables, nbondi and nbondj, indicate the relative position of the processor: 328 \begin{itemize} 329 \item nbondi = -1 an east neighbour, no west processor, 330 \item nbondi = 0 an east neighbour, a west neighbour, 331 \item nbondi = 1 no east processor, a west neighbour, 332 \item nbondi = 2 no splitting following the i-axis. 333 \end{itemize} 334 During the simulation, processors exchange data with their neighbours. 335 If there is effectively a neighbour, the processor receives variables from this processor on its overlapping row, 336 and sends the data issued from internal domain corresponding to the overlapping row of the other processor. 337 338 339 The \NEMO model computes equation terms with the help of mask arrays (0 on land points and 1 on sea points). 340 It is easily readable and very efficient in the context of a computer with vectorial architecture. 341 However, in the case of a scalar processor, computations over the land regions become more expensive in 342 terms of CPU time. 343 It is worse when we use a complex configuration with a realistic bathymetry like the global ocean where 344 more than 50 \% of points are land points. 345 For this reason, a pre-processing tool can be used to choose the mpp domain decomposition with a maximum number of 346 only land points processors, which can then be eliminated (\autoref{fig:mppini2}) 347 (For example, the mpp\_optimiz tools, available from the DRAKKAR web site). 348 This optimisation is dependent on the specific bathymetry employed. 349 The user then chooses optimal parameters \jp{jpni}, \jp{jpnj} and \jp{jpnij} with $jpnij < jpni \times jpnj$, 350 leading to the elimination of $jpni \times jpnj - jpnij$ land processors. 351 When those parameters are specified in \ngn{nammpp} namelist, 352 the algorithm in the \rou{inimpp2} routine sets each processor's parameters (nbound, nono, noea,...) so that 353 the land-only processors are not taken into account. 354 355 \gmcomment{Note that the inimpp2 routine is general so that the original inimpp 356 routine should be suppressed from the code.} 357 358 When land processors are eliminated, 359 the value corresponding to these locations in the model output files is undefined. 360 Note that this is a problem for the meshmask file which requires to be defined over the whole domain. 361 Therefore, user should not eliminate land processors when creating a meshmask file 362 (\ie when setting a non-zero value to \np{nn\_msh}). 324 with $1 \leq i \leq jpi$, $1 \leq j \leq jpj $ , and $1 \leq k \leq jpk$. 325 326 The 1-d arrays $mig(1:\jp{jpi})$ and $mjg(1:\jp{jpj})$, defined in \rou{dom\_glo} routine (\mdl{domain} module), should be used to get global domain indices from local domain indices. The 1-d arrays, $mi0(1:\jp{jpiglo})$, $mi1(1:\jp{jpiglo})$ and $mj0(1:\jp{jpjglo})$, $mj1(1:\jp{jpjglo})$ have the reverse purpose and should be used to define loop indices expressed in global domain indices (see examples in \mdl{dtastd} module).\\ 327 328 The \NEMO\ model computes equation terms with the help of mask arrays (0 on land points and 1 on sea points). It is therefore possible that an MPI subdomain contains only land points. To save ressources, we try to supress from the computational domain as much land subdomains as possible. For example if $N_{mpi}$ processes are allocated to NEMO, the domain decomposition will be given by the following equation: 329 \[ 330 N_{mpi} = jpni \times jpnj - N_{land} + N_{useless} 331 \] 332 $N_{land}$ is the total number of land subdomains in the domain decomposition defined by \np{jpni} and \np{jpnj}. $N_{useless}$ is the number of land subdomains that are kept in the compuational domain in order to make sure that $N_{mpi}$ MPI processes are indeed allocated to a given subdomain. The values of $N_{mpi}$, \np{jpni}, \np{jpnj}, $N_{land}$ and $N_{useless}$ are printed in the output file \texttt{ocean.output}. $N_{useless}$ must, of course, be as small as possible to limit the waste of ressources. A warning is issued in \texttt{ocean.output} if $N_{useless}$ is not zero. Note that non-zero value of $N_{useless}$ is uselly required when using AGRIF as, up to now, the parent grid and each of the child grids must use all the $N_{mpi}$ processes. 333 334 If the domain decomposition is automatically defined (when \np{jpni} and \np{jpnj} are < 1), the decomposition chosen by the model will minimise the sub-domain size (defined as $max_{all domains}(jpi \times jpj)$) and maximize the number of eliminated land subdomains. This means that no other domain decomposition (a set of \np{jpni} and \np{jpnj} values) will use less processes than $(jpni \times jpnj - N_{land})$ and get a smaller subdomain size. 335 In order to specify $N_{mpi}$ properly (minimize $N_{useless}$), you must run the model once with \np{ln\_list} activated. In this case, the model will start the initialisation phase, print the list of optimum decompositions ($N_{mpi}$, \np{jpni} and \np{jpnj}) in \texttt{ocean.output} and directly abort. The maximum value of $N_{mpi}$ tested in this list is given by $max(N_{MPI\_tasks}, jpni \times jpnj)$. For example, run the model on 40 nodes with ln\_list activated and $jpni = 10000$ and $jpnj = 1$, will print the list of optimum domains decomposition from 1 to about 10000. 336 337 Processors are numbered from 0 to $N_{mpi} - 1$. Subdomains containning some ocean points are numbered first from 0 to $jpni * jpnj - N_{land} -1$. The remaining $N_{useless}$ land subdomains are numbered next, which means that, for a given (\np{jpni}, \np{jpnj}), the numbers attributed to he ocean subdomains do not vary with $N_{useless}$. 338 339 When land processors are eliminated, the value corresponding to these locations in the model output files is undefined. \np{ln\_mskland} must be activated in order avoid Not a Number values in output files. Note that it is better to not eliminate land processors when creating a meshmask file (\ie\ when setting a non-zero value to \np{nn\_msh}). 363 340 364 341 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 365 342 \begin{figure}[!ht] 366 \begin{center} 367 \includegraphics[width=\textwidth]{Fig_mppini2} 368 \caption { 369 \protect\label{fig:mppini2} 370 Example of Atlantic domain defined for the CLIPPER projet. 371 Initial grid is composed of 773 x 1236 horizontal points. 372 (a) the domain is split onto 9 \time 20 subdomains (jpni=9, jpnj=20). 373 52 subdomains are land areas. 374 (b) 52 subdomains are eliminated (white rectangles) and 375 the resulting number of processors really used during the computation is jpnij=128. 376 } 377 \end{center} 343 \centering 344 \includegraphics[width=0.66\textwidth]{Fig_mppini2} 345 \caption[Atlantic domain defined for the CLIPPER projet]{ 346 Example of Atlantic domain defined for the CLIPPER projet. 347 Initial grid is composed of 773 x 1236 horizontal points. 348 (a) the domain is split onto 9 $times$ 20 subdomains (jpni=9, jpnj=20). 349 52 subdomains are land areas. 350 (b) 52 subdomains are eliminated (white rectangles) and 351 the resulting number of processors really used during the computation is jpnij=128.} 352 \label{fig:LBC_mppini2} 378 353 \end{figure} 379 354 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 381 356 382 357 % ==================================================================== 383 % Unstructured open boundaries BDY 358 % Unstructured open boundaries BDY 384 359 % ==================================================================== 385 360 \section{Unstructured open boundary conditions (BDY)} … … 388 363 %-----------------------------------------nambdy-------------------------------------------- 389 364 390 \nlst{nambdy} 365 \begin{listing} 366 \nlst{nambdy} 367 \caption{\forcode{&nambdy}} 368 \label{lst:nambdy} 369 \end{listing} 391 370 %----------------------------------------------------------------------------------------------- 392 371 %-----------------------------------------nambdy_dta-------------------------------------------- 393 372 394 \nlst{nambdy_dta} 373 \begin{listing} 374 \nlst{nambdy_dta} 375 \caption{\forcode{&nambdy_dta}} 376 \label{lst:nambdy_dta} 377 \end{listing} 395 378 %----------------------------------------------------------------------------------------------- 396 379 397 Options are defined through the \n gn{nambdy} \ngn{nambdy\_dta} namelist variables.398 The BDY module is the core implementation of open boundary conditions for regional configurations on 399 temperature, salinity, barotropic and baroclinic velocities, as well as ice concentration, ice and snow thicknesses).400 401 The BDY module was modelled on the OBC module (see NEMO3.4) and shares many features and380 Options are defined through the \nam{bdy} and \nam{bdy\_dta} namelist variables. 381 The BDY module is the core implementation of open boundary conditions for regional configurations on 382 ocean temperature, salinity, barotropic-baroclinic velocities, ice-snow concentration, thicknesses, temperatures, salinity and melt ponds concentration and thickness. 383 384 The BDY module was modelled on the OBC module (see \NEMO\ 3.4) and shares many features and 402 385 a similar coding structure \citep{chanut_rpt05}. 403 386 The specification of the location of the open boundary is completely flexible and 404 allows for example the open boundary to follow an isobath or other irregular contour.405 Boundary data files used with versions of NEMOprior to Version 3.4 may need to be re-ordered to work with this version.387 allows any type of setup, from regular boundaries to irregular contour (it includes the possibility to set an open boundary able to follow an isobath). 388 Boundary data files used with versions of \NEMO\ prior to Version 3.4 may need to be re-ordered to work with this version. 406 389 See the section on the Input Boundary Data Files for details. 407 390 408 391 %---------------------------------------------- 409 392 \subsection{Namelists} 410 \label{subsec: BDY_namelist}411 412 The BDY module is activated by setting \np{ln\_bdy}\forcode{ =.true.} .393 \label{subsec:LBC_bdy_namelist} 394 395 The BDY module is activated by setting \np{ln\_bdy}\forcode{=.true.} . 413 396 It is possible to define more than one boundary ``set'' and apply different boundary conditions to each set. 414 397 The number of boundary sets is defined by \np{nb\_bdy}. 415 Each boundary set may be defined as a set of straight line segments in a namelist 416 (\np{ln\_coords\_file}\forcode{ = .false.}) or read in from a file (\np{ln\_coords\_file}\forcode{ = .true.}). 417 If the set is defined in a namelist, then the namelists \ngn{nambdy\_index} must be included separately, one for each set. 418 If the set is defined by a file, then a ``\ifile{coordinates.bdy}'' file must be provided. 419 The coordinates.bdy file is analagous to the usual NEMO ``\ifile{coordinates}'' file. 398 Each boundary set can be either defined as a series of straight line segments directly in the namelist 399 (\np{ln\_coords\_file}\forcode{=.false.}, and a namelist block \nam{bdy\_index} must be included for each set) or read in from a file (\np{ln\_coords\_file}\forcode{=.true.}, and a ``\ifile{coordinates.bdy}'' file must be provided). 400 The coordinates.bdy file is analagous to the usual \NEMO\ ``\ifile{coordinates}'' file. 420 401 In the example above, there are two boundary sets, the first of which is defined via a file and 421 the second is defined in anamelist.422 For more details of the definition of the boundary geometry see section \autoref{subsec: BDY_geometry}.402 the second is defined in the namelist. 403 For more details of the definition of the boundary geometry see section \autoref{subsec:LBC_bdy_geometry}. 423 404 424 405 For each boundary set a boundary condition has to be chosen for the barotropic solution 425 (``u2d'':sea-surface height and barotropic velocities), for the baroclinic velocities (``u3d''), 426 for the active tracers \footnote{The BDY module does not deal with passive tracers at this version} (``tra''), and sea-ice (``ice''). 427 For each set of variables there is a choice of algorithm and a choice for the data, 428 eg. for the active tracers the algorithm is set by \np{cn\_tra} and the choice of data is set by \np{nn\_tra\_dta}.\\ 406 (``u2d'':sea-surface height and barotropic velocities), for the baroclinic velocities (``u3d''), 407 for the active tracers \footnote{The BDY module does not deal with passive tracers at this version} (``tra''), and for sea-ice (``ice''). 408 For each set of variables one has to choose an algorithm and the boundary data (set resp. by \np{cn\_tra} and \np{nn\_tra\_dta} for tracers).\\ 429 409 430 410 The choice of algorithm is currently as follows: … … 436 416 \item[\forcode{'neumann'}:] Value at the boundary are duplicated (No gradient). Only available for baroclinic velocity and tracer variables. 437 417 \item[\forcode{'frs'}:] Flow Relaxation Scheme (FRS) available for all variables. 438 \item[\forcode{'Orlanski'}:] Orlanski radiation scheme (fully oblique) for barotropic, baroclinic and tracer variables. 439 \item[\forcode{'Orlanski_npo'}:] Orlanski radiation scheme for barotropic, baroclinic and tracer variables. 418 \item[\forcode{'Orlanski'}:] Orlanski radiation scheme (fully oblique) for barotropic, baroclinic and tracer variables. 419 \item[\forcode{'Orlanski_npo'}:] Orlanski radiation scheme for barotropic, baroclinic and tracer variables. 440 420 \item[\forcode{'flather'}:] Flather radiation scheme for the barotropic variables only. 441 421 \end{description} 442 422 443 The main choice for the boundary data is to use initial conditions as boundary data444 (\np{nn\_tra\_dta}\forcode{ = 0}) or to use external data from a file (\np{nn\_tra\_dta}\forcode{ =1}).445 In case the 3d velocity data contain the total velocity (ie, baroclinic and barotropic velocity), 446 the bdy code can derived baroclinic and barotropic velocities by setting \np{ln\_full\_vel}\forcode{ = .true.}423 The boundary data is either set to initial conditions 424 (\np{nn\_tra\_dta}\forcode{=0}) or forced with external data from a file (\np{nn\_tra\_dta}\forcode{=1}). 425 In case the 3d velocity data contain the total velocity (ie, baroclinic and barotropic velocity), 426 the bdy code can derived baroclinic and barotropic velocities by setting \np{ln\_full\_vel}\forcode{=.true.} 447 427 For the barotropic solution there is also the option to use tidal harmonic forcing either by 448 itself (\np{nn\_dyn2d\_dta}\forcode{ = 2}) or in addition to other external data (\np{nn\_dyn2d\_dta}\forcode{ = 3}).\\ 449 Sea-ice salinity, temperature and age data at the boundary are constant and defined repectively by \np{rn\_ice\_sal}, \np{rn\_ice\_tem} and \np{rn\_ice\_age}. 450 451 If external boundary data is required then the \ngn{nambdy\_dta} namelist must be defined. 452 One \ngn{nambdy\_dta} namelist is required for each boundary set in the order in which 453 the boundary sets are defined in nambdy. 454 In the example given, two boundary sets have been defined. The first one is reading data file in the \ngn{nambdy\_dta} namelist shown above 455 and the second one is using data from intial condition (no namelist bloc needed). 428 itself (\np{nn\_dyn2d\_dta}\forcode{=2}) or in addition to other external data (\np{nn\_dyn2d\_dta}\forcode{=3}).\\ 429 If not set to initial conditions, sea-ice salinity, temperatures and melt ponds data at the boundary can either be read in a file or defined as constant (by \np{rn\_ice\_sal}, \np{rn\_ice\_tem}, \np{rn\_ice\_apnd}, \np{rn\_ice\_hpnd}). Ice age is constant and defined by \np{rn\_ice\_age}. 430 431 If external boundary data is required then the \nam{bdy\_dta} namelist must be defined. 432 One \nam{bdy\_dta} namelist is required for each boundary set, adopting the same order of indexes in which the boundary sets are defined in nambdy. 433 In the example given, two boundary sets have been defined. The first one is reading data file in the \nam{bdy\_dta} namelist shown above 434 and the second one is using data from intial condition (no namelist block needed). 456 435 The boundary data is read in using the fldread module, 457 so the \ngn{nambdy\_dta} namelist is in the format required for fldread. 458 For each variable required, the filename, the frequency of the files and 459 the frequency of the data in the files is given. 460 Also whether or not time-interpolation is required and whether the data is climatological (time-cyclic) data.\\ 436 so the \nam{bdy\_dta} namelist is in the format required for fldread. 437 For each required variable, the filename, the frequency of the files and 438 the frequency of the data in the files are given. 439 Also whether or not time-interpolation is required and whether the data is climatological (time-cyclic) data. 440 For sea-ice salinity, temperatures and melt ponds, reading the files are skipped and constant values are used if filenames are defined as {'NOT USED'}.\\ 461 441 462 442 There is currently an option to vertically interpolate the open boundary data onto the native grid at run-time. 463 If \np{nn\_bdy\_jpk} $< -1$, it is assumed that the lateral boundary data are already on the native grid.464 However, if \np{nn\_bdy\_jpk} is set to the number of vertical levels present in the boundary data, 465 a bilinear interpolation onto the native grid will be triggered at runtime. 466 For this to be successful the additional variables: $gdept$, $gdepu$, $gdepv$, $e3t$, $e3u$ and $e3v$, are required to be present in the lateral boundary files. 467 These correspond to the depths and scale factors of the input data, 443 If \np{nn\_bdy\_jpk}$<-1$, it is assumed that the lateral boundary data are already on the native grid. 444 However, if \np{nn\_bdy\_jpk} is set to the number of vertical levels present in the boundary data, 445 a bilinear interpolation onto the native grid will be triggered at runtime. 446 For this to be successful the additional variables: $gdept$, $gdepu$, $gdepv$, $e3t$, $e3u$ and $e3v$, are required to be present in the lateral boundary files. 447 These correspond to the depths and scale factors of the input data, 468 448 the latter used to make any adjustment to the velocity fields due to differences in the total water depths between the two vertical grids.\\ 469 449 470 In the example namelists given, two boundary sets are defined.450 In the example of given namelists, two boundary sets are defined. 471 451 The first set is defined via a file and applies FRS conditions to temperature and salinity and 472 452 Flather conditions to the barotropic variables. No condition specified for the baroclinic velocity and sea-ice. … … 474 454 Tidal harmonic forcing is also used. 475 455 The second set is defined in a namelist. 476 FRS conditions are applied on temperature and salinity and climatological data is read from initial condition files. 456 FRS conditions are applied on temperature and salinity and climatological data is read from initial condition files. 477 457 478 458 %---------------------------------------------- 479 459 \subsection{Flow relaxation scheme} 480 \label{subsec: BDY_FRS_scheme}460 \label{subsec:LBC_bdy_FRS_scheme} 481 461 482 462 The Flow Relaxation Scheme (FRS) \citep{davies_QJRMS76,engedahl_T95}, … … 485 465 Given a model prognostic variable $\Phi$ 486 466 \[ 487 % \label{eq: bdy_frs1}467 % \label{eq:LBC_bdy_frs1} 488 468 \Phi(d) = \alpha(d)\Phi_{e}(d) + (1-\alpha(d))\Phi_{m}(d)\;\;\;\;\; d=1,N 489 469 \] … … 494 474 the prognostic equation for $\Phi$ of the form: 495 475 \[ 496 % \label{eq: bdy_frs2}476 % \label{eq:LBC_bdy_frs2} 497 477 -\frac{1}{\tau}\left(\Phi - \Phi_{e}\right) 498 478 \] 499 479 where the relaxation time scale $\tau$ is given by a function of $\alpha$ and the model time step $\Delta t$: 500 480 \[ 501 % \label{eq: bdy_frs3}481 % \label{eq:LBC_bdy_frs3} 502 482 \tau = \frac{1-\alpha}{\alpha} \,\rdt 503 483 \] … … 505 485 is relaxed towards the external conditions over the rest of the FRS zone. 506 486 The application of a relaxation zone helps to prevent spurious reflection of 507 outgoing signals from the model boundary. 487 outgoing signals from the model boundary. 508 488 509 489 The function $\alpha$ is specified as a $tanh$ function: 510 490 \[ 511 % \label{eq: bdy_frs4}491 % \label{eq:LBC_bdy_frs4} 512 492 \alpha(d) = 1 - \tanh\left(\frac{d-1}{2}\right), \quad d=1,N 513 493 \] … … 517 497 %---------------------------------------------- 518 498 \subsection{Flather radiation scheme} 519 \label{subsec: BDY_flather_scheme}499 \label{subsec:LBC_bdy_flather_scheme} 520 500 521 501 The \citet{flather_JPO94} scheme is a radiation condition on the normal, 522 502 depth-mean transport across the open boundary. 523 503 It takes the form 524 \begin{equation} \label{eq:bdy_fla1} 525 U = U_{e} + \frac{c}{h}\left(\eta - \eta_{e}\right), 504 \begin{equation} 505 \label{eq:LBC_bdy_fla1} 506 U = U_{e} + \frac{c}{h}\left(\eta - \eta_{e}\right), 526 507 \end{equation} 527 508 where $U$ is the depth-mean velocity normal to the boundary and $\eta$ is the sea surface height, … … 532 513 the external depth-mean normal velocity, 533 514 plus a correction term that allows gravity waves generated internally to exit the model boundary. 534 Note that the sea-surface height gradient in \autoref{eq: bdy_fla1} is a spatial gradient across the model boundary,515 Note that the sea-surface height gradient in \autoref{eq:LBC_bdy_fla1} is a spatial gradient across the model boundary, 535 516 so that $\eta_{e}$ is defined on the $T$ points with $nbr=1$ and $\eta$ is defined on the $T$ points with $nbr=2$. 536 $U$ and $U_{e}$ are defined on the $U$ or $V$ points with $nbr=1$, \ie between the two $T$ grid points.517 $U$ and $U_{e}$ are defined on the $U$ or $V$ points with $nbr=1$, \ie\ between the two $T$ grid points. 537 518 538 519 %---------------------------------------------- 539 520 \subsection{Orlanski radiation scheme} 540 \label{subsec: BDY_orlanski_scheme}521 \label{subsec:LBC_bdy_orlanski_scheme} 541 522 542 523 The Orlanski scheme is based on the algorithm described by \citep{marchesiello.mcwilliams.ea_OM01}, hereafter MMS. … … 544 525 The adaptive Orlanski condition solves a wave plus relaxation equation at the boundary: 545 526 \begin{equation} 546 \frac{\partial\phi}{\partial t} + c_x \frac{\partial\phi}{\partial x} + c_y \frac{\partial\phi}{\partial y} = 547 -\frac{1}{\tau}(\phi - \phi^{ext})548 \label{eq:wave_continuous} 527 \label{eq:LBC_wave_continuous} 528 \frac{\partial\phi}{\partial t} + c_x \frac{\partial\phi}{\partial x} + c_y \frac{\partial\phi}{\partial y} = 529 -\frac{1}{\tau}(\phi - \phi^{ext}) 549 530 \end{equation} 550 531 … … 552 533 velocities are diagnosed from the model fields as: 553 534 554 \begin{equation} \label{eq:cx} 555 c_x = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial x}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2} 535 \begin{equation} 536 \label{eq:LBC_cx} 537 c_x = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial x}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2} 556 538 \end{equation} 557 539 \begin{equation} 558 \label{eq:cy}559 c_y = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial y}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2}540 \label{eq:LBC_cy} 541 c_y = -\frac{\partial\phi}{\partial t}\frac{\partial\phi / \partial y}{(\partial\phi /\partial x)^2 + (\partial\phi /\partial y)^2} 560 542 \end{equation} 561 543 562 544 (As noted by MMS, this is a circular diagnosis of the phase speeds which only makes sense on a discrete grid). 563 Equation (\autoref{eq: wave_continuous}) is defined adaptively depending on the sign of the phase velocity normal to the boundary $c_x$.545 Equation (\autoref{eq:LBC_wave_continuous}) is defined adaptively depending on the sign of the phase velocity normal to the boundary $c_x$. 564 546 For $c_x$ outward, we have 565 547 … … 571 553 572 554 \begin{equation} 573 \tau = \tau_{in}\,\,\,;\,\,\, c_x = c_y = 0 574 \label{eq:tau_in} 555 \label{eq:LBC_tau_in} 556 \tau = \tau_{in}\,\,\,;\,\,\, c_x = c_y = 0 575 557 \end{equation} 576 558 577 Generally the relaxation time scale at inward propagation points \np{(rn\_time\_dmp}) is set much shorter than the time scale at outward propagation559 Generally the relaxation time scale at inward propagation points (\np{rn\_time\_dmp}) is set much shorter than the time scale at outward propagation 578 560 points (\np{rn\_time\_dmp\_out}) so that the solution is constrained more strongly by the external data at inward propagation points. 579 See \autoref{subsec: BDY_relaxation} for detailed on the spatial shape of the scaling.\\580 The ``normal propagation of oblique radiation'' or NPO approximation (called \forcode{'orlanski_npo'}) involves assuming 581 that $c_y$ is zero in equation (\autoref{eq: wave_continuous}), but including582 this term in the denominator of equation (\autoref{eq: cx}). Both versions of the scheme are options in BDY. Equations583 (\autoref{eq: wave_continuous}) - (\autoref{eq:tau_in}) correspond to equations (13) - (15) and (2) - (3) in MMS.\\561 See \autoref{subsec:LBC_bdy_relaxation} for detailed on the spatial shape of the scaling.\\ 562 The ``normal propagation of oblique radiation'' or NPO approximation (called \forcode{'orlanski_npo'}) involves assuming 563 that $c_y$ is zero in equation (\autoref{eq:LBC_wave_continuous}), but including 564 this term in the denominator of equation (\autoref{eq:LBC_cx}). Both versions of the scheme are options in BDY. Equations 565 (\autoref{eq:LBC_wave_continuous}) - (\autoref{eq:LBC_tau_in}) correspond to equations (13) - (15) and (2) - (3) in MMS.\\ 584 566 585 567 %---------------------------------------------- 586 568 \subsection{Relaxation at the boundary} 587 \label{subsec: BDY_relaxation}588 589 In addition to a specific boundary condition specified as \np{cn\_tra} and \np{cn\_dyn3d}, relaxation on baroclinic velocities and tracers variables are available. 569 \label{subsec:LBC_bdy_relaxation} 570 571 In addition to a specific boundary condition specified as \np{cn\_tra} and \np{cn\_dyn3d}, relaxation on baroclinic velocities and tracers variables are available. 590 572 It is control by the namelist parameter \np{ln\_tra\_dmp} and \np{ln\_dyn3d\_dmp} for each boundary set. 591 573 592 The relaxation time scale value (\np{rn\_time\_dmp} and \np{rn\_time\_dmp\_out}, $\tau$) are defined at the boundaries itself. 574 The relaxation time scale value (\np{rn\_time\_dmp} and \np{rn\_time\_dmp\_out}, $\tau$) are defined at the boundaries itself. 593 575 This time scale ($\alpha$) is weighted by the distance ($d$) from the boundary over \np{nn\_rimwidth} cells ($N$): 594 576 … … 597 579 \] 598 580 599 The same scaling is applied in the Orlanski damping. 581 The same scaling is applied in the Orlanski damping. 600 582 601 583 %---------------------------------------------- 602 584 \subsection{Boundary geometry} 603 \label{subsec: BDY_geometry}585 \label{subsec:LBC_bdy_geometry} 604 586 605 587 Each open boundary set is defined as a list of points. 606 588 The information is stored in the arrays $nbi$, $nbj$, and $nbr$ in the $idx\_bdy$ structure. 607 The $nbi$ and $nbj$ arrays define the local $(i,j)$ ind ices of each point in the boundary zone and608 the $nbr$ array defines the discrete distance from the boundary with $nbr=1$ meaningthat609 the point is next to the edge of the model domain and $nbr>1$ showingthat610 the point is increasingly further away from the edge of the model domain.589 The $nbi$ and $nbj$ arrays define the local $(i,j)$ indexes of each point in the boundary zone and 590 the $nbr$ array defines the discrete distance from the boundary: $nbr=1$ means that 591 the boundary point is next to the edge of the model domain, while $nbr>1$ means that 592 the boundary point is increasingly further away from the edge of the model domain. 611 593 A set of $nbi$, $nbj$, and $nbr$ arrays is defined for each of the $T$, $U$ and $V$ grids. 612 Figure \autoref{fig:LBC_bdy_geom} shows an example of an irregular boundary. 594 \autoref{fig:LBC_bdy_geom} shows an example of an irregular boundary. 613 595 614 596 The boundary geometry for each set may be defined in a namelist nambdy\_index or 615 597 by reading in a ``\ifile{coordinates.bdy}'' file. 616 598 The nambdy\_index namelist defines a series of straight-line segments for north, east, south and west boundaries. 617 One nambdy\_index namelist bloc is needed for each boundary condition defined by indexes.618 For the northern boundary, \ np{nbdysegn} gives the number of segments,619 \ np{jpjnob} gives the $j$ index for each segment and \np{jpindt} and620 \ np{jpinft} give the start and end $i$ indices for each segment with similar for the other boundaries.599 One nambdy\_index namelist block is needed for each boundary condition defined by indexes. 600 For the northern boundary, \texttt{nbdysegn} gives the number of segments, 601 \jp{jpjnob} gives the $j$ index for each segment and \jp{jpindt} and 602 \jp{jpinft} give the start and end $i$ indices for each segment with similar for the other boundaries. 621 603 These segments define a list of $T$ grid points along the outermost row of the boundary ($nbr\,=\, 1$). 622 The code deduces the $U$ and $V$ points and also the points for $nbr\,>\, 1$ if \np{nn\_rimwidth}\forcode{ >1}.604 The code deduces the $U$ and $V$ points and also the points for $nbr\,>\, 1$ if \np{nn\_rimwidth}\forcode{>1}. 623 605 624 606 The boundary geometry may also be defined from a ``\ifile{coordinates.bdy}'' file. 625 Figure \autoref{fig:LBC_nc_header} gives an example of the header information from such a file.607 \autoref{fig:LBC_nc_header} gives an example of the header information from such a file, based on the description of geometrical setup given above. 626 608 The file should contain the index arrays for each of the $T$, $U$ and $V$ grids. 627 609 The arrays must be in order of increasing $nbr$. … … 629 611 Typically this file will be used to generate external boundary data via interpolation and so 630 612 will also contain the latitudes and longitudes of each point as shown. 631 However, this is not necessary to run the model. 613 However, this is not necessary to run the model. 632 614 633 615 For some choices of irregular boundary the model domain may contain areas of ocean which 634 616 are not part of the computational domain. 635 For example if an open boundary is defined along an isobath, say at the shelf break,617 For example, if an open boundary is defined along an isobath, say at the shelf break, 636 618 then the areas of ocean outside of this boundary will need to be masked out. 637 619 This can be done by reading a mask file defined as \np{cn\_mask\_file} in the nam\_bdy namelist. … … 640 622 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 641 623 \begin{figure}[!t] 642 \begin{center} 643 \includegraphics[width=\textwidth]{Fig_LBC_bdy_geom} 644 \caption { 645 \protect\label{fig:LBC_bdy_geom} 646 Example of geometry of unstructured open boundary 647 } 648 \end{center} 624 \centering 625 \includegraphics[width=0.66\textwidth]{Fig_LBC_bdy_geom} 626 \caption[Geometry of unstructured open boundary]{Example of geometry of unstructured open boundary} 627 \label{fig:LBC_bdy_geom} 649 628 \end{figure} 650 629 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 652 631 %---------------------------------------------- 653 632 \subsection{Input boundary data files} 654 \label{subsec: BDY_data}633 \label{subsec:LBC_bdy_data} 655 634 656 635 The data files contain the data arrays in the order in which the points are defined in the $nbi$ and $nbj$ arrays. … … 658 637 a time dimension; 659 638 $xb$ which is the index of the boundary data point in the horizontal; 660 and $yb$ which is a degenerate dimension of 1 to enable the file to be read by the standard NEMOI/O routines.661 The 3D fields also have a depth dimension. 639 and $yb$ which is a degenerate dimension of 1 to enable the file to be read by the standard \NEMO\ I/O routines. 640 The 3D fields also have a depth dimension. 662 641 663 642 From Version 3.4 there are new restrictions on the order in which the boundary points are defined … … 670 649 \item All the data for a particular boundary set must be in the same order. 671 650 (Prior to 3.4 it was possible to define barotropic data in a different order to 672 the data for tracers and baroclinic velocities). 651 the data for tracers and baroclinic velocities). 673 652 \end{enumerate} 674 653 675 654 These restrictions mean that data files used with versions of the 676 655 model prior to Version 3.4 may not work with Version 3.4 onwards. 677 A \fortran utility {\itshape bdy\_reorder} exists in the TOOLS directory which656 A \fortran\ utility {\itshape bdy\_reorder} exists in the TOOLS directory which 678 657 will re-order the data in old BDY data files. 679 658 680 659 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 681 660 \begin{figure}[!t] 682 \begin{center} 683 \includegraphics[width=\textwidth]{Fig_LBC_nc_header} 684 \caption { 685 \protect\label{fig:LBC_nc_header} 686 Example of the header for a \protect\ifile{coordinates.bdy} file 687 } 688 \end{center} 661 \centering 662 \includegraphics[width=0.66\textwidth]{Fig_LBC_nc_header} 663 \caption[Header for a \protect\ifile{coordinates.bdy} file]{ 664 Example of the header for a \protect\ifile{coordinates.bdy} file} 665 \label{fig:LBC_nc_header} 689 666 \end{figure} 690 667 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 692 669 %---------------------------------------------- 693 670 \subsection{Volume correction} 694 \label{subsec: BDY_vol_corr}671 \label{subsec:LBC_bdy_vol_corr} 695 672 696 673 There is an option to force the total volume in the regional model to be constant. 697 674 This is controlled by the \np{ln\_vol} parameter in the namelist. 698 A value of \np{ln\_vol}\forcode{ =.false.} indicates that this option is not used.699 Two options to control the volume are available (\np{nn\_volctl}). 700 If \np{nn\_volctl}\forcode{ =0} then a correction is applied to the normal barotropic velocities around the boundary at675 A value of \np{ln\_vol}\forcode{=.false.} indicates that this option is not used. 676 Two options to control the volume are available (\np{nn\_volctl}). 677 If \np{nn\_volctl}\forcode{=0} then a correction is applied to the normal barotropic velocities around the boundary at 701 678 each timestep to ensure that the integrated volume flow through the boundary is zero. 702 If \np{nn\_volctl}\forcode{ =1} then the calculation of the volume change on679 If \np{nn\_volctl}\forcode{=1} then the calculation of the volume change on 703 680 the timestep includes the change due to the freshwater flux across the surface and 704 681 the correction velocity corrects for this as well. … … 709 686 %---------------------------------------------- 710 687 \subsection{Tidal harmonic forcing} 711 \label{subsec: BDY_tides}688 \label{subsec:LBC_bdy_tides} 712 689 713 690 %-----------------------------------------nambdy_tide-------------------------------------------- 714 691 715 \nlst{nambdy_tide} 692 \begin{listing} 693 \nlst{nambdy_tide} 694 \caption{\forcode{&nambdy_tide}} 695 \label{lst:nambdy_tide} 696 \end{listing} 716 697 %----------------------------------------------------------------------------------------------- 717 698 718 699 Tidal forcing at open boundaries requires the activation of surface 719 tides (i.e., in \n gn{nam\_tide}, \np{ln\_tide} needs to be set to700 tides (i.e., in \nam{\_tide}, \np{ln\_tide} needs to be set to 720 701 \forcode{.true.} and the required constituents need to be activated by 721 including their names in the \np{c name} array; see702 including their names in the \np{clname} array; see 722 703 \autoref{sec:SBC_tide}). Specific options related to the reading in of 723 704 the complex harmonic amplitudes of elevation (SSH) and barotropic 724 705 velocity (u,v) at open boundaries are defined through the 725 \n gn{nambdy\_tide} namelist parameters.\\706 \nam{bdy\_tide} namelist parameters.\\ 726 707 727 708 The tidal harmonic data at open boundaries can be specified in two
Note: See TracChangeset
for help on using the changeset viewer.