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