Changeset 10354
- Timestamp:
- 2018-11-21T17:59:55+01:00 (6 years ago)
- Location:
- NEMO/trunk/doc/latex/NEMO/subfiles
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/doc/latex/NEMO/subfiles/abstract_foreword.tex
r9393 r10354 11 11 12 12 {\small 13 The ocean engine of NEMO (Nucleus for European Modelling of the Ocean) is a primitive 14 equation model adapted to regional and global ocean circulation problems. It is intended to 15 be a flexible tool for studying the ocean and its interactions with the others components of 16 the earth climate system over a wide range of space and time scales. 17 Prognostic variables are the three-dimensional velocity field, a non-linear sea surface height, 18 the \textit{Conservative} Temperature and the \textit{Absolute} Salinity. 19 In the horizontal direction, the model uses a curvilinear orthogonal grid and in the vertical direction, 20 a full or partial step $z$-coordinate, or $s$-coordinate, or a mixture of the two. 21 The distribution of variables is a three-dimensional Arakawa C-type grid. 22 Various physical choices are available to describe ocean physics, including TKE, and GLS vertical physics. 23 Within NEMO, the ocean is interfaced with a sea-ice model (LIM or CICE), passive tracer and 24 biogeochemical models (TOP) and, via the OASIS coupler, with several atmospheric general circulation models. 25 It also support two-way grid embedding via the AGRIF software. 13 The ocean engine of NEMO (Nucleus for European Modelling of the Ocean) is a primitive equation model adapted to 14 regional and global ocean circulation problems. 15 It is intended to be a flexible tool for studying the ocean and its interactions with 16 the others components of the earth climate system over a wide range of space and time scales. 17 Prognostic variables are the three-dimensional velocity field, a non-linear sea surface height, 18 the \textit{Conservative} Temperature and the \textit{Absolute} Salinity. 19 In the horizontal direction, the model uses a curvilinear orthogonal grid and in the vertical direction, 20 a full or partial step $z$-coordinate, or $s$-coordinate, or a mixture of the two. 21 The distribution of variables is a three-dimensional Arakawa C-type grid. 22 Various physical choices are available to describe ocean physics, including TKE, and GLS vertical physics. 23 Within NEMO, the ocean is interfaced with a sea-ice model (LIM or CICE), 24 passive tracer and biogeochemical models (TOP) and, 25 via the OASIS coupler, with several atmospheric general circulation models. 26 It also support two-way grid embedding via the AGRIF software. 26 27 } 27 28 … … 31 32 \chapter*{Disclaimer} 32 33 33 Like all components of NEMO, the ocean component is developed under the \href{http://www.cecill.info/}{CECILL license}, 34 which is a French adaptation of the GNU GPL (General Public License). Anyone may use it 35 freely for research purposes, and is encouraged to communicate back to the NEMO team 36 its own developments and improvements. The model and the present document have been 37 made available as a service to the community. We cannot certify that the code and its manual 38 are free of errors. Bugs are inevitable and some have undoubtedly survived the testing phase. 39 Users are encouraged to bring them to our attention. The author assumes no responsibility 40 for problems, errors, or incorrect usage of NEMO. 34 Like all components of NEMO, 35 the ocean component is developed under the \href{http://www.cecill.info/}{CECILL license}, 36 which is a French adaptation of the GNU GPL (General Public License). 37 Anyone may use it freely for research purposes, 38 and is encouraged to communicate back to the NEMO team its own developments and improvements. 39 The model and the present document have been made available as a service to the community. 40 We cannot certify that the code and its manual are free of errors. 41 Bugs are inevitable and some have undoubtedly survived the testing phase. 42 Users are encouraged to bring them to our attention. 43 The author assumes no responsibility for problems, errors, or incorrect usage of NEMO. 41 44 42 45 \vspace{1cm} -
NEMO/trunk/doc/latex/NEMO/subfiles/annex_A.tex
r9414 r10354 19 19 20 20 In order to establish the set of Primitive Equation in curvilinear $s$-coordinates 21 ($i.e.$ an orthogonal curvilinear coordinate in the horizontal and an Arbitrary Lagrangian 22 Eulerian (ALE) coordinate in the vertical), we start from the set of equations established 23 in \autoref{subsec:PE_zco_Eq} for the special case $k = z$ and thus $e_3 = 1$, and we introduce 24 an arbitrary vertical coordinate $a = a(i,j,z,t)$. Let us define a new vertical scale factor by 25 $e_3 = \partial z / \partial s$ (which now depends on $(i,j,z,t)$) and the horizontal 26 slope of $s-$surfaces by : 21 ($i.e.$ an orthogonal curvilinear coordinate in the horizontal and 22 an Arbitrary Lagrangian Eulerian (ALE) coordinate in the vertical), 23 we start from the set of equations established in \autoref{subsec:PE_zco_Eq} for 24 the special case $k = z$ and thus $e_3 = 1$, 25 and we introduce an arbitrary vertical coordinate $a = a(i,j,z,t)$. 26 Let us define a new vertical scale factor by $e_3 = \partial z / \partial s$ (which now depends on $(i,j,z,t)$) and 27 the horizontal slope of $s-$surfaces by: 27 28 \begin{equation} \label{apdx:A_s_slope} 28 29 \sigma _1 =\frac{1}{e_1 }\;\left. {\frac{\partial z}{\partial i}} \right|_s … … 31 32 \end{equation} 32 33 33 The chain rule to establish the model equations in the curvilinear $s-$coordinate 34 system is: 34 The chain rule to establish the model equations in the curvilinear $s-$coordinate system is: 35 35 \begin{equation} \label{apdx:A_s_chain_rule} 36 36 \begin{aligned} … … 52 52 \end{equation} 53 53 54 In particular applying the time derivative chain rule to $z$ provides the expression 55 for $w_s$,the vertical velocity of the $s-$surfaces referenced to a fix z-coordinate:54 In particular applying the time derivative chain rule to $z$ provides the expression for $w_s$, 55 the vertical velocity of the $s-$surfaces referenced to a fix z-coordinate: 56 56 \begin{equation} \label{apdx:A_w_in_s} 57 57 w_s = \left. \frac{\partial z }{\partial t} \right|_s … … 67 67 \label{sec:A_continuity} 68 68 69 Using (\autoref{apdx:A_s_chain_rule}) and the fact that the horizontal scale factors70 $e_1$ and $e_2$ do not depend on the vertical coordinate, the divergence of 71 the velocity relative to the ($i$,$j$,$z$) coordinate system is transformed as follows72 in order toobtain its expression in the curvilinear $s-$coordinate system:69 Using (\autoref{apdx:A_s_chain_rule}) and 70 the fact that the horizontal scale factors $e_1$ and $e_2$ do not depend on the vertical coordinate, 71 the divergence of the velocity relative to the ($i$,$j$,$z$) coordinate system is transformed as follows in order to 72 obtain its expression in the curvilinear $s-$coordinate system: 73 73 74 74 \begin{subequations} … … 128 128 \end{subequations} 129 129 130 Here, $w$ is the vertical velocity relative to the $z-$coordinate system. 131 Introducing the dia-surface velocity component, $\omega $, defined as132 the volume flux across the moving $s$-surfaces per unit horizontal area:130 Here, $w$ is the vertical velocity relative to the $z-$coordinate system. 131 Introducing the dia-surface velocity component, 132 $\omega $, defined as the volume flux across the moving $s$-surfaces per unit horizontal area: 133 133 \begin{equation} \label{apdx:A_w_s} 134 134 \omega = w - w_s - \sigma _1 \,u - \sigma _2 \,v \\ 135 135 \end{equation} 136 with $w_s$ given by \autoref{apdx:A_w_in_s}, we obtain the expression for137 the divergence of the velocity in the curvilinear $s-$coordinate system:136 with $w_s$ given by \autoref{apdx:A_w_in_s}, 137 we obtain the expression for the divergence of the velocity in the curvilinear $s-$coordinate system: 138 138 \begin{subequations} 139 139 \begin{align*} {\begin{array}{*{20}l} … … 167 167 \end{subequations} 168 168 169 As a result, the continuity equation \autoref{eq:PE_continuity} in the 170 $s-$coordinates is: 169 As a result, the continuity equation \autoref{eq:PE_continuity} in the $s-$coordinates is: 171 170 \begin{equation} \label{apdx:A_sco_Continuity} 172 171 \frac{1}{e_3 } \frac{\partial e_3}{\partial t} … … 176 175 +\frac{1}{e_3 }\frac{\partial \omega }{\partial s} = 0 177 176 \end{equation} 178 A additional term has appeared that take into account the contribution of the time variation179 of the vertical coordinate to the volume budget.177 A additional term has appeared that take into account 178 the contribution of the time variation of the vertical coordinate to the volume budget. 180 179 181 180 … … 186 185 \label{sec:A_momentum} 187 186 188 Here we only consider the first component of the momentum equation, 187 Here we only consider the first component of the momentum equation, 189 188 the generalization to the second one being straightforward. 190 189 … … 193 192 $\bullet$ \textbf{Total derivative in vector invariant form} 194 193 195 Let us consider \autoref{eq:PE_dyn_vect}, the first component of the momentum 196 equation in the vector invariant form. Its total $z-$coordinate time derivative, 197 $\left. \frac{D u}{D t} \right|_z$ can be transformed as follows in order to obtain 194 Let us consider \autoref{eq:PE_dyn_vect}, the first component of the momentum equation in the vector invariant form. 195 Its total $z-$coordinate time derivative, 196 $\left. \frac{D u}{D t} \right|_z$ can be transformed as follows in order to obtain 198 197 its expression in the curvilinear $s-$coordinate system: 199 198 … … 258 257 \end{subequations} 259 258 % 260 Applying the time derivative chain rule (first equation of (\autoref{apdx:A_s_chain_rule})) 261 to $u$ and using (\autoref{apdx:A_w_in_s}) provides the expression of the last term 262 of the right hand side, 259 Applying the time derivative chain rule (first equation of (\autoref{apdx:A_s_chain_rule})) to $u$ and 260 using (\autoref{apdx:A_w_in_s}) provides the expression of the last term of the right hand side, 263 261 \begin{equation*} {\begin{array}{*{20}l} 264 262 w_s \;\frac{\partial u}{\partial s} … … 267 265 \end{array} } 268 266 \end{equation*} 269 leads to the $s-$coordinate formulation of the total $z-$coordinate time derivative, 267 leads to the $s-$coordinate formulation of the total $z-$coordinate time derivative, 270 268 $i.e.$ the total $s-$coordinate time derivative : 271 269 \begin{align} \label{apdx:A_sco_Dt_vect} … … 276 274 + \frac{1}{e_3 } \omega \;\frac{\partial u}{\partial s} 277 275 \end{align} 278 Therefore, the vector invariant form of the total time derivative has exactly the same 279 mathematical form in $z-$ and $s-$coordinates. This is not the case for the flux form 280 as shown in next paragraph.276 Therefore, the vector invariant form of the total time derivative has exactly the same mathematical form in 277 $z-$ and $s-$coordinates. 278 This is not the case for the flux form as shown in next paragraph. 281 279 282 280 $\ $\newline % force a new ligne … … 284 282 $\bullet$ \textbf{Total derivative in flux form} 285 283 286 Let us start from the total time derivative in the curvilinear $s-$coordinate system 287 we have just establish. Following the procedure used to establish (\autoref{eq:PE_flux_form}), 288 it can be transformed into : 284 Let us start from the total time derivative in the curvilinear $s-$coordinate system we have just establish. 285 Following the procedure used to establish (\autoref{eq:PE_flux_form}), it can be transformed into : 289 286 %\begin{subequations} 290 287 \begin{align*} {\begin{array}{*{20}l} … … 355 352 \end{subequations} 356 353 which leads to the $s-$coordinate flux formulation of the total $s-$coordinate time derivative, 357 $i.e.$ the total $s-$coordinate time derivative in flux form 354 $i.e.$ the total $s-$coordinate time derivative in flux form: 358 355 \begin{flalign}\label{apdx:A_sco_Dt_flux} 359 356 \left. \frac{D u}{D t} \right|_s = \frac{1}{e_3} \left. \frac{\partial ( e_3\,u)}{\partial t} \right|_s … … 363 360 \end{flalign} 364 361 which is the total time derivative expressed in the curvilinear $s-$coordinate system. 365 It has the same form as in the $z-$coordinate but for the vertical scale factor 366 that has appeared inside the time derivative which comes from the modification 367 of (\autoref{apdx:A_sco_Continuity}), the continuity equation. 362 It has the same form as in the $z-$coordinate but for 363 the vertical scale factor that has appeared inside the time derivative which 364 comes from the modification of (\autoref{apdx:A_sco_Continuity}), 365 the continuity equation. 368 366 369 367 $\ $\newline % force a new ligne … … 380 378 \end{split} 381 379 \end{equation*} 382 Applying similar manipulation to the second component and replacing383 $\sigma _1$ and $\sigma _2$ by their expression \autoref{apdx:A_s_slope}, it comes:380 Applying similar manipulation to the second component and 381 replacing $\sigma _1$ and $\sigma _2$ by their expression \autoref{apdx:A_s_slope}, it comes: 384 382 \begin{equation} \label{apdx:A_grad_p_1} 385 383 \begin{split} … … 394 392 \end{equation} 395 393 396 An additional term appears in (\autoref{apdx:A_grad_p_1}) which accounts for the 397 tilt of $s-$surfaces with respect to geopotential $z-$surfaces. 398 399 As in $z$-coordinate, the horizontal pressure gradient can be split in two parts 400 following \citet{Marsaleix_al_OM08}. Let defined a density anomaly, $d$, by $d=(\rho - \rho_o)/ \rho_o$, 401 and a hydrostatic pressure anomaly, $p_h'$, by $p_h'= g \; \int_z^\eta d \; e_3 \; dk$. 394 An additional term appears in (\autoref{apdx:A_grad_p_1}) which accounts for 395 the tilt of $s-$surfaces with respect to geopotential $z-$surfaces. 396 397 As in $z$-coordinate, 398 the horizontal pressure gradient can be split in two parts following \citet{Marsaleix_al_OM08}. 399 Let defined a density anomaly, $d$, by $d=(\rho - \rho_o)/ \rho_o$, 400 and a hydrostatic pressure anomaly, $p_h'$, by $p_h'= g \; \int_z^\eta d \; e_3 \; dk$. 402 401 The pressure is then given by: 403 402 \begin{equation*} … … 416 415 \end{equation*} 417 416 418 Substituing \autoref{apdx:A_pressure} in \autoref{apdx:A_grad_p_1} and using the definition of419 the density anomaly it comes the expression in two parts:417 Substituing \autoref{apdx:A_pressure} in \autoref{apdx:A_grad_p_1} and 418 using the definition of the density anomaly it comes the expression in two parts: 420 419 \begin{equation} \label{apdx:A_grad_p_2} 421 420 \begin{split} … … 429 428 \end{split} 430 429 \end{equation} 431 This formulation of the pressure gradient is characterised by the appearance of a term depending on the432 the sea surface height only (last term on the right hand side of expression \autoref{apdx:A_grad_p_2}). 433 This term will be loosely termed \textit{surface pressure gradient} 434 whereas the first term will be termed the 435 \textit{hydrostatic pressure gradient} by analogy to the $z$-coordinate formulation. 436 In fact, the the true surface pressure gradient is $1/\rho_o \nabla (\rho \eta)$, and 437 $\eta$ is implicitly included in the computation of $p_h'$ through the upper bound of 438 the vertical integration.439 430 This formulation of the pressure gradient is characterised by the appearance of 431 a term depending on the sea surface height only 432 (last term on the right hand side of expression \autoref{apdx:A_grad_p_2}). 433 This term will be loosely termed \textit{surface pressure gradient} whereas 434 the first term will be termed the \textit{hydrostatic pressure gradient} by analogy to 435 the $z$-coordinate formulation. 436 In fact, the true surface pressure gradient is $1/\rho_o \nabla (\rho \eta)$, 437 and $\eta$ is implicitly included in the computation of $p_h'$ through the upper bound of the vertical integration. 438 440 439 441 440 $\ $\newline % force a new ligne … … 443 442 $\bullet$ \textbf{The other terms of the momentum equation} 444 443 445 The coriolis and forcing terms as well as the the vertical physics remain unchanged 446 as they involve neither time nor space derivatives. The form of the lateral physics is 447 discussed in \autoref{apdx:B}.444 The coriolis and forcing terms as well as the the vertical physics remain unchanged as 445 they involve neither time nor space derivatives. 446 The form of the lateral physics is discussed in \autoref{apdx:B}. 448 447 449 448 … … 452 451 $\bullet$ \textbf{Full momentum equation} 453 452 454 To sum up, in a curvilinear $s$-coordinate system, the vector invariant momentum equation455 solved by the model has the same mathematical expression as the one in a curvilinear 456 $z-$coordinate, except for the pressure gradient term:453 To sum up, in a curvilinear $s$-coordinate system, 454 the vector invariant momentum equation solved by the model has the same mathematical expression as 455 the one in a curvilinear $z-$coordinate, except for the pressure gradient term: 457 456 \begin{subequations} \label{apdx:A_dyn_vect} 458 457 \begin{multline} \label{apdx:A_PE_dyn_vect_u} … … 475 474 \end{multline} 476 475 \end{subequations} 477 whereas the flux form momentum equation differ from it by the formulation of both478 the time derivative and the pressure gradient term:476 whereas the flux form momentum equation differs from it by 477 the formulation of both the time derivative and the pressure gradient term: 479 478 \begin{subequations} \label{apdx:A_dyn_flux} 480 479 \begin{multline} \label{apdx:A_PE_dyn_flux_u} … … 503 502 \end{equation} 504 503 505 It is important to realize that the change in coordinate system has only concerned 506 the position on the vertical. It has not affected (\textbf{i},\textbf{j},\textbf{k}), the 507 orthogonal curvilinear set of unit vectors. ($u$,$v$) are always horizontal velocities 508 so that their evolution is driven by \emph{horizontal} forces, in particular 509 the pressure gradient. By contrast, $\omega$ is not $w$, the third component of the velocity, 510 but the dia-surface velocity component, $i.e.$ the volume flux across the moving 511 $s$-surfaces per unit horizontal area. 504 It is important to realize that the change in coordinate system has only concerned the position on the vertical. 505 It has not affected (\textbf{i},\textbf{j},\textbf{k}), the orthogonal curvilinear set of unit vectors. 506 ($u$,$v$) are always horizontal velocities so that their evolution is driven by \emph{horizontal} forces, 507 in particular the pressure gradient. 508 By contrast, $\omega$ is not $w$, the third component of the velocity, but the dia-surface velocity component, 509 $i.e.$ the volume flux across the moving $s$-surfaces per unit horizontal area. 512 510 513 511 … … 518 516 \label{sec:A_tracer} 519 517 520 The tracer equation is obtained using the same calculation as for the continuity 521 equation and thenregrouping the time derivative terms in the left hand side :518 The tracer equation is obtained using the same calculation as for the continuity equation and then 519 regrouping the time derivative terms in the left hand side : 522 520 523 521 \begin{multline} \label{apdx:A_tracer} … … 531 529 532 530 533 The expression for the advection term is a straight consequence of (A.4), the534 expression of the 3D divergence in the $s-$coordinates established above.531 The expression for the advection term is a straight consequence of (A.4), 532 the expression of the 3D divergence in the $s-$coordinates established above. 535 533 536 534 \end{document} -
NEMO/trunk/doc/latex/NEMO/subfiles/annex_B.tex
r9407 r10354 19 19 20 20 \subsubsection*{In z-coordinates} 21 In $z$-coordinates, the horizontal/vertical second order tracer diffusion operator 22 is given by: 21 In $z$-coordinates, the horizontal/vertical second order tracer diffusion operator is given by: 23 22 \begin{eqnarray} \label{apdx:B1} 24 23 &D^T = \frac{1}{e_1 \, e_2} \left[ … … 30 29 31 30 \subsubsection*{In generalized vertical coordinates} 32 In $s$-coordinates, we defined the slopes of $s$-surfaces, $\sigma_1$ and 33 $\sigma_2$ by \autoref{apdx:A_s_slope} and the vertical/horizontal ratio of diffusion 34 coefficient by $\epsilon = A^{vT} / A^{lT}$.The diffusion operator is given by:31 In $s$-coordinates, we defined the slopes of $s$-surfaces, $\sigma_1$ and $\sigma_2$ by \autoref{apdx:A_s_slope} and 32 the vertical/horizontal ratio of diffusion coefficient by $\epsilon = A^{vT} / A^{lT}$. 33 The diffusion operator is given by: 35 34 36 35 \begin{equation} \label{apdx:B2} … … 56 55 \end{subequations} 57 56 58 Equation \autoref{apdx:B2} is obtained from \autoref{apdx:B1} without any 59 additional assumption.Indeed, for the special case $k=z$ and thus $e_3 =1$,60 we introduce an arbitrary vertical coordinate $s = s (i,j,z)$ as in \autoref{apdx:A} 61 anduse \autoref{apdx:A_s_slope} and \autoref{apdx:A_s_chain_rule}.62 Since no cross horizontal derivative $\partial _i \partial _j $ appears in 63 \autoref{apdx:B1},the ($i$,$z$) and ($j$,$z$) planes are independent.64 The derivation can then be demonstrated for the ($i$,$z$)~$\to$~($j$,$s$) 65 transformation withoutany loss of generality:57 Equation \autoref{apdx:B2} is obtained from \autoref{apdx:B1} without any additional assumption. 58 Indeed, for the special case $k=z$ and thus $e_3 =1$, 59 we introduce an arbitrary vertical coordinate $s = s (i,j,z)$ as in \autoref{apdx:A} and 60 use \autoref{apdx:A_s_slope} and \autoref{apdx:A_s_chain_rule}. 61 Since no cross horizontal derivative $\partial _i \partial _j $ appears in \autoref{apdx:B1}, 62 the ($i$,$z$) and ($j$,$z$) planes are independent. 63 The derivation can then be demonstrated for the ($i$,$z$)~$\to$~($j$,$s$) transformation without 64 any loss of generality: 66 65 67 66 \begin{subequations} … … 143 142 \subsubsection*{In z-coordinates} 144 143 145 The iso/diapycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in the ($i$,$j$,$k$) 146 curvilinear coordinate system in which the equations of the ocean circulation model are 147 formulated, takes the following form \citep{Redi_JPO82}: 144 The iso/diapycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in 145 the ($i$,$j$,$k$) curvilinear coordinate system in which 146 the equations of the ocean circulation model are formulated, 147 takes the following form \citep{Redi_JPO82}: 148 148 149 149 \begin{equation} \label{apdx:B3} … … 155 155 \end{array} }} \right] 156 156 \end{equation} 157 where ($a_1$, $a_2$) are the isopycnal slopes in ($\textbf{i}$, 158 $\textbf{j}$) directions, relative to geopotentials: 157 where ($a_1$, $a_2$) are the isopycnal slopes in ($\textbf{i}$, $\textbf{j}$) directions, relative to geopotentials: 159 158 \begin{equation*} 160 159 a_1 =\frac{e_3 }{e_1 }\left( {\frac{\partial \rho }{\partial i}} \right)\left( {\frac{\partial \rho }{\partial k}} \right)^{-1} … … 164 163 \end{equation*} 165 164 166 In practice, isopycnal slopes are generally less than $10^{-2}$ in the ocean, so167 $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{Cox1987}:165 In practice, isopycnal slopes are generally less than $10^{-2}$ in the ocean, 166 so $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{Cox1987}: 168 167 \begin{subequations} \label{apdx:B4} 169 168 \begin{equation} \label{apdx:B4a} … … 183 182 184 183 185 Physically, the full tensor \autoref{apdx:B3} 186 represents strong isoneutral diffusion on a plane parallel to the isoneutral 187 surface and weak dianeutral diffusion perpendicular to this plane. 188 However, the approximate `weak-slope' tensor \autoref{apdx:B4a} represents strong 189 diffusion along the isoneutral surface, with weak 190 \emph{vertical} diffusion -- the principal axes of the tensor are no 191 longer orthogonal. This simplification also decouples 192 the ($i$,$z$) and ($j$,$z$) planes of the tensor. The weak-slope operator therefore takes the same 193 form, \autoref{apdx:B4}, as \autoref{apdx:B2}, the diffusion operator for geopotential 194 diffusion written in non-orthogonal $i,j,s$-coordinates. Written out 195 explicitly, 184 Physically, the full tensor \autoref{apdx:B3} represents strong isoneutral diffusion on a plane parallel to 185 the isoneutral surface and weak dianeutral diffusion perpendicular to this plane. 186 However, 187 the approximate `weak-slope' tensor \autoref{apdx:B4a} represents strong diffusion along the isoneutral surface, 188 with weak \emph{vertical} diffusion -- the principal axes of the tensor are no longer orthogonal. 189 This simplification also decouples the ($i$,$z$) and ($j$,$z$) planes of the tensor. 190 The weak-slope operator therefore takes the same form, \autoref{apdx:B4}, as \autoref{apdx:B2}, 191 the diffusion operator for geopotential diffusion written in non-orthogonal $i,j,s$-coordinates. 192 Written out explicitly, 196 193 197 194 \begin{multline} \label{apdx:B_ldfiso} … … 204 201 205 202 The isopycnal diffusion operator \autoref{apdx:B4}, 206 \autoref{apdx:B_ldfiso} conserves tracer quantity and dissipates its 207 square. The demonstration of the first property is trivial as \autoref{apdx:B4} is the divergence 208 of fluxes.Let us demonstrate the second one:203 \autoref{apdx:B_ldfiso} conserves tracer quantity and dissipates its square. 204 The demonstration of the first property is trivial as \autoref{apdx:B4} is the divergence of fluxes. 205 Let us demonstrate the second one: 209 206 \begin{equation*} 210 207 \iiint\limits_D T\;\nabla .\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv … … 229 226 \end{subequations} 230 227 \addtocounter{equation}{-1} 231 228 the property becomes obvious. 232 229 233 230 \subsubsection*{In generalized vertical coordinates} 234 231 235 Because the weak-slope operator \autoref{apdx:B4}, \autoref{apdx:B_ldfiso} is decoupled 236 in the ($i$,$z$) and ($j$,$z$) planes, it may be transformed into 237 generalized $s$-coordinates in the same way as \autoref{sec:B_1} was transformed into 238 \autoref{sec:B_2}. The resulting operator then takes the simple form 232 Because the weak-slope operator \autoref{apdx:B4}, 233 \autoref{apdx:B_ldfiso} is decoupled in the ($i$,$z$) and ($j$,$z$) planes, 234 it may be transformed into generalized $s$-coordinates in the same way as 235 \autoref{sec:B_1} was transformed into \autoref{sec:B_2}. 236 The resulting operator then takes the simple form 239 237 240 238 \begin{equation} \label{apdx:B_ldfiso_s} … … 249 247 \end{equation} 250 248 251 where ($r_1$, $r_2$) are the isopycnal slopes in ($\textbf{i}$, 252 $\textbf{j}$) directions,relative to $s$-coordinate surfaces:249 where ($r_1$, $r_2$) are the isopycnal slopes in ($\textbf{i}$, $\textbf{j}$) directions, 250 relative to $s$-coordinate surfaces: 253 251 \begin{equation*} 254 252 r_1 =\frac{e_3 }{e_1 }\left( {\frac{\partial \rho }{\partial i}} \right)\left( {\frac{\partial \rho }{\partial s}} \right)^{-1} … … 258 256 \end{equation*} 259 257 260 To prove \autoref{apdx:B5} by direct re-expression of \autoref{apdx:B_ldfiso} is 261 straightforward, but laborious. An easier way is first to note (by reversing the 262 derivation of \autoref{sec:B_2} from \autoref{sec:B_1} ) that the 263 weak-slope operator may be \emph{exactly} reexpressed in 264 non-orthogonal $i,j,\rho$-coordinates as 258 To prove \autoref{apdx:B5} by direct re-expression of \autoref{apdx:B_ldfiso} is straightforward, but laborious. 259 An easier way is first to note (by reversing the derivation of \autoref{sec:B_2} from \autoref{sec:B_1} ) that 260 the weak-slope operator may be \emph{exactly} reexpressed in non-orthogonal $i,j,\rho$-coordinates as 265 261 266 262 \begin{equation} \label{apdx:B5} … … 273 269 \end{array} }} \right). 274 270 \end{equation} 275 Then direct transformation from $i,j,\rho$-coordinates to 276 $i,j,s$-coordinates gives \autoref{apdx:B_ldfiso_s} immediately. 277 278 Note that the weak-slope approximation is only made in 279 transforming from the (rotated,orthogonal) isoneutral axes to the 280 non-orthogonal $i,j,\rho$-coordinates. The further transformation 281 into $i,j,s$-coordinates is exact, whatever the steepness of 282 the $s$-surfaces, in the same way as the transformation of 283 horizontal/vertical Laplacian diffusion in $z$-coordinates, 271 Then direct transformation from $i,j,\rho$-coordinates to $i,j,s$-coordinates gives 272 \autoref{apdx:B_ldfiso_s} immediately. 273 274 Note that the weak-slope approximation is only made in transforming from 275 the (rotated,orthogonal) isoneutral axes to the non-orthogonal $i,j,\rho$-coordinates. 276 The further transformation into $i,j,s$-coordinates is exact, whatever the steepness of the $s$-surfaces, 277 in the same way as the transformation of horizontal/vertical Laplacian diffusion in $z$-coordinates, 284 278 \autoref{sec:B_1} onto $s$-coordinates is exact, however steep the $s$-surfaces. 285 279 … … 291 285 \label{sec:B_3} 292 286 293 The second order momentum diffusion operator (Laplacian) in the $z$-coordinate 294 is found by applying \autoref{eq:PE_lap_vector}, the expression for the Laplacian 295 of a vector, to the horizontal velocity vector:287 The second order momentum diffusion operator (Laplacian) in the $z$-coordinate is found by 288 applying \autoref{eq:PE_lap_vector}, the expression for the Laplacian of a vector, 289 to the horizontal velocity vector: 296 290 \begin{align*} 297 291 \Delta {\textbf{U}}_h … … 329 323 \end{array} }} \right) 330 324 \end{align*} 331 Using \autoref{eq:PE_div}, the definition of the horizontal divergence, the third332 componant of the second vector is obviously zero and thus :325 Using \autoref{eq:PE_div}, the definition of the horizontal divergence, 326 the third componant of the second vector is obviously zero and thus : 333 327 \begin{equation*} 334 328 \Delta {\textbf{U}}_h = \nabla _h \left( \chi \right) - \nabla _h \times \left( \zeta \right) + \frac {1}{e_3 } \frac {\partial }{\partial k} \left( {\frac {1}{e_3 } \frac{\partial {\textbf{ U}}_h }{\partial k}} \right) 335 329 \end{equation*} 336 330 337 Note that this operator ensures a full separation between the vorticity and horizontal338 divergence fields (see \autoref{apdx:C}). It is only equal to a Laplacian 339 applied to each component in Cartesian coordinates, not on the sphere.340 341 The horizontal/vertical second order (Laplacian type) operator used to diffuse 342 horizontal momentum in the $z$-coordinate therefore takes the following form:331 Note that this operator ensures a full separation between 332 the vorticity and horizontal divergence fields (see \autoref{apdx:C}). 333 It is only equal to a Laplacian applied to each component in Cartesian coordinates, not on the sphere. 334 335 The horizontal/vertical second order (Laplacian type) operator used to diffuse horizontal momentum in 336 the $z$-coordinate therefore takes the following form: 343 337 \begin{equation} \label{apdx:B_Lap_U} 344 338 {\textbf{D}}^{\textbf{U}} = … … 360 354 \end{align*} 361 355 362 Note Bene: introducing a rotation in \autoref{apdx:B_Lap_U} does not lead to a363 useful expression for the iso/diapycnal Laplacian operator in the $z$-coordinate.364 Similarly, we did not found an expression of practical use for the geopotential365 horizontal/vertical Laplacian operator in the $s$-coordinate. Generally, 366 \autoref{apdx:B_Lap_U} is used in both $z$- and $s$-coordinate systems, that is 367 a Laplacian diffusion is applied on momentum along the coordinate directions.356 Note Bene: introducing a rotation in \autoref{apdx:B_Lap_U} does not lead to 357 a useful expression for the iso/diapycnal Laplacian operator in the $z$-coordinate. 358 Similarly, we did not found an expression of practical use for 359 the geopotential horizontal/vertical Laplacian operator in the $s$-coordinate. 360 Generally, \autoref{apdx:B_Lap_U} is used in both $z$- and $s$-coordinate systems, 361 that is a Laplacian diffusion is applied on momentum along the coordinate directions. 368 362 \end{document} -
NEMO/trunk/doc/latex/NEMO/subfiles/annex_C.tex
r9414 r10354 22 22 \label{sec:C.0} 23 23 24 Notation used in this appendix in the demonstations 24 Notation used in this appendix in the demonstations: 25 25 26 26 fluxes at the faces of a $T$-box: … … 37 37 38 38 $dv=e_1\,e_2\,e_3 \,di\,dj\,dk$ is the volume element, with only $e_3$ that depends on time. 39 $D$ and $S$ are the ocean domain volume and surface, respectively. 40 No wetting/drying is allow ($i.e.$ $\frac{\partial S}{\partial t} = 0$) 41 Let $k_s$ and $k_b$ be the ocean surface and bottom, resp. 39 $D$ and $S$ are the ocean domain volume and surface, respectively. 40 No wetting/drying is allow ($i.e.$ $\frac{\partial S}{\partial t} = 0$). 41 Let $k_s$ and $k_b$ be the ocean surface and bottom, resp. 42 42 ($i.e.$ $s(k_s) = \eta$ and $s(k_b)=-H$, where $H$ is the bottom depth). 43 43 \begin{flalign*} … … 60 60 = \int_D { \frac{1}{e_3} \partial_t \left( e_3 \, Q \right) dv } =0 61 61 \end{equation*} 62 equation of evolution of $Q$ written as the time evolution of the vertical content of $Q$ 63 like for tracers, or momentum in flux form, the quadratic quantity $\frac{1}{2}Q^2$ is conserved when : 62 equation of evolution of $Q$ written as 63 the time evolution of the vertical content of $Q$ like for tracers, or momentum in flux form, 64 the quadratic quantity $\frac{1}{2}Q^2$ is conserved when: 64 65 \begin{flalign*} 65 66 \partial_t \left( \int_D{ \frac{1}{2} \,Q^2\;dv } \right) … … 74 75 - \frac{1}{2} \int_D { \frac{Q^2}{e_3} \partial_t (e_3) \;dv } 75 76 \end{flalign} 76 equation of evolution of $Q$ written as the time evolution of $Q$ 77 like for momentum in vector invariant form, the quadratic quantity $\frac{1}{2}Q^2$ is conserved when:77 equation of evolution of $Q$ written as the time evolution of $Q$ like for momentum in vector invariant form, 78 the quadratic quantity $\frac{1}{2}Q^2$ is conserved when: 78 79 \begin{flalign*} 79 80 \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) … … 82 83 + \int_D { \frac{1}{2} Q^2 \, \partial_t e_3 \;e_1e_2\;di\,dj\,dk } \\ 83 84 \end{flalign*} 84 that is in a more compact form 85 that is in a more compact form: 85 86 \begin{flalign} \label{eq:Q2_vect} 86 87 \partial_t \left( \int_D {\frac{1}{2} Q^2\;dv} \right) … … 97 98 98 99 99 The discretization of pimitive equation in $s$-coordinate ($i.e.$ time and space varying 100 vertical coordinate) must be chosen so that the discrete equation of the model satisfy 101 integral constrains on energy and enstrophy. 100 The discretization of pimitive equation in $s$-coordinate ($i.e.$ time and space varying vertical coordinate) 101 must be chosen so that the discrete equation of the model satisfy integral constrains on energy and enstrophy. 102 102 103 103 104 104 Let us first establish those constraint in the continuous world. 105 The total energy ($i.e.$ kinetic plus potential energies) is conserved 105 The total energy ($i.e.$ kinetic plus potential energies) is conserved: 106 106 \begin{flalign} \label{eq:Tot_Energy} 107 107 \partial_t \left( \int_D \left( \frac{1}{2} {\textbf{U}_h}^2 + \rho \, g \, z \right) \;dv \right) = & 0 108 108 \end{flalign} 109 under the following assumptions: no dissipation, no forcing 110 (wind, buoyancy flux, atmospheric pressure variations), mass 111 conservation, and closed domain. 112 113 This equation can be transformed to obtain several sub-equalities. 114 The transformation for the advection term depends on whether 115 the vector invariant form or the flux form is used for the momentum equation. 116 Using \autoref{eq:Q2_vect} and introducing \autoref{apdx:A_dyn_vect} in \autoref{eq:Tot_Energy} 117 for the former form and 118 Using \autoref{eq:Q2_flux} and introducing \autoref{apdx:A_dyn_flux} in \autoref{eq:Tot_Energy} 119 for the latter form leads to: 109 under the following assumptions: no dissipation, no forcing (wind, buoyancy flux, atmospheric pressure variations), 110 mass conservation, and closed domain. 111 112 This equation can be transformed to obtain several sub-equalities. 113 The transformation for the advection term depends on whether the vector invariant form or 114 the flux form is used for the momentum equation. 115 Using \autoref{eq:Q2_vect} and introducing \autoref{apdx:A_dyn_vect} in 116 \autoref{eq:Tot_Energy} for the former form and 117 using \autoref{eq:Q2_flux} and introducing \autoref{apdx:A_dyn_flux} in 118 \autoref{eq:Tot_Energy} for the latter form leads to: 120 119 121 120 \begin{subequations} \label{eq:E_tot} … … 348 347 349 348 Substituting the discrete expression of the time derivative of the velocity either in vector invariant, 350 leads to the discrete equivalent of the four equations \autoref{eq:E_tot_flux}. 349 leads to the discrete equivalent of the four equations \autoref{eq:E_tot_flux}. 351 350 352 351 % ------------------------------------------------------------------------------------------------------------- … … 356 355 \label{subsec:C_vor} 357 356 358 Let $q$, located at $f$-points, be either the relative ($q=\zeta / e_{3f}$), or 359 the planetary ($q=f/e_{3f}$), or the total potential vorticity ($q=(\zeta +f) /e_{3f}$). 360 Two discretisation of the vorticity term (ENE and EEN) allows the conservation of 361 the kinetic energy. 357 Let $q$, located at $f$-points, be either the relative ($q=\zeta / e_{3f}$), 358 or the planetary ($q=f/e_{3f}$), or the total potential vorticity ($q=(\zeta +f) /e_{3f}$). 359 Two discretisation of the vorticity term (ENE and EEN) allows the conservation of the kinetic energy. 362 360 % ------------------------------------------------------------------------------------------------------------- 363 361 % Vorticity Term with ENE scheme … … 366 364 \label{subsec:C_vorENE} 367 365 368 For the ENE scheme, the two components of the vorticity term are given by 366 For the ENE scheme, the two components of the vorticity term are given by: 369 367 \begin{equation*} 370 368 - e_3 \, q \;{\textbf{k}}\times {\textbf {U}}_h \equiv … … 377 375 \end{equation*} 378 376 379 This formulation does not conserve the enstrophy but it does conserve the 380 total kinetic energy. Indeed, the kinetic energy tendency associated to the 381 vorticity term and averaged over the ocean domain can be transformed as 382 follows: 377 This formulation does not conserve the enstrophy but it does conserve the total kinetic energy. 378 Indeed, the kinetic energy tendency associated to the vorticity term and 379 averaged over the ocean domain can be transformed as follows: 383 380 \begin{flalign*} 384 381 &\int\limits_D - \left( e_3 \, q \;\textbf{k} \times \textbf{U}_h \right) \cdot \textbf{U}_h \; dv && \\ … … 412 409 \end{aligned} } \right. 413 410 \end{equation} 414 where the indices $i_p$ and $j_p$ take the following value: 415 $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$, 411 where the indices $i_p$ and $j_p$ take the following value: $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$, 416 412 and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by: 417 413 \begin{equation} \tag{\ref{eq:Q_triads}} … … 420 416 \end{equation} 421 417 422 This formulation does conserve the total kinetic energy. Indeed, 418 This formulation does conserve the total kinetic energy. 419 Indeed, 423 420 \begin{flalign*} 424 421 &\int\limits_D - \textbf{U}_h \cdot \left( \zeta \;\textbf{k} \times \textbf{U}_h \right) \; dv && \\ … … 473 470 \label{subsec:C_zad} 474 471 475 The change of Kinetic Energy (KE) due to the vertical advection is exactly 476 balanced by the change of KE due to the horizontal gradient of KE~: 472 The change of Kinetic Energy (KE) due to the vertical advection is exactly balanced by the change of KE due to the horizontal gradient of KE~: 477 473 \begin{equation*} 478 474 \int_D \textbf{U}_h \cdot \frac{1}{e_3 } \omega \partial_k \textbf{U}_h \;dv … … 480 476 + \frac{1}{2} \int_D { \frac{{\textbf{U}_h}^2}{e_3} \partial_t ( e_3) \;dv } \\ 481 477 \end{equation*} 482 Indeed, using successively \autoref{eq:DOM_di_adj} ($i.e.$ the skew symmetry 483 property of the $\delta$ operator) and the continuity equation, then 484 \autoref{eq:DOM_di_adj} again, then the commutativity of operators 485 $\overline {\,\cdot \,}$ and $\delta$, and finally \autoref{eq:DOM_mi_adj} 486 ($i.e.$ the symmetry property of the $\overline {\,\cdot \,}$ operator) 478 Indeed, using successively \autoref{eq:DOM_di_adj} ($i.e.$ the skew symmetry property of the $\delta$ operator) 479 and the continuity equation, then \autoref{eq:DOM_di_adj} again, 480 then the commutativity of operators $\overline {\,\cdot \,}$ and $\delta$, and finally \autoref{eq:DOM_mi_adj} 481 ($i.e.$ the symmetry property of the $\overline {\,\cdot \,}$ operator) 487 482 applied in the horizontal and vertical directions, it becomes: 488 483 \begin{flalign*} … … 543 538 \end{flalign*} 544 539 545 There is two main points here. First, the satisfaction of this property links the choice of 546 the discrete formulation of the vertical advection and of the horizontal gradient 547 of KE. Choosing one imposes the other. For example KE can also be discretized 548 as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$. This leads to the following 549 expression for the vertical advection: 540 There is two main points here. 541 First, the satisfaction of this property links the choice of the discrete formulation of the vertical advection and 542 of the horizontal gradient of KE. 543 Choosing one imposes the other. 544 For example KE can also be discretized as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$. 545 This leads to the following expression for the vertical advection: 550 546 \begin{equation*} 551 547 \frac{1} {e_3 }\; \omega\; \partial_k \textbf{U}_h … … 557 553 \end{array}} } \right) 558 554 \end{equation*} 559 a formulation that requires an additional horizontal mean in contrast with 560 the one used in NEMO. Nine velocity points have to be used instead of 3. 555 a formulation that requires an additional horizontal mean in contrast with the one used in NEMO. 556 Nine velocity points have to be used instead of 3. 561 557 This is the reason why it has not been chosen. 562 558 563 Second, as soon as the chosen $s$-coordinate depends on time, an extra constraint564 a rises on the time derivative of the volume at $u$- and $v$-points:559 Second, as soon as the chosen $s$-coordinate depends on time, 560 an extra constraint arises on the time derivative of the volume at $u$- and $v$-points: 565 561 \begin{flalign*} 566 562 e_{1u}\,e_{2u}\,\partial_t (e_{3u}) =\overline{ e_{1t}\,e_{2t}\;\partial_t (e_{3t}) }^{\,i+1/2} \\ … … 583 579 584 580 \gmcomment{ 585 A pressure gradient has no contribution to the evolution of the vorticity as the 586 curl of a gradient is zero. In the $z$-coordinate, this property is satisfied locally 587 on a C-grid with 2nd order finite differences(property \autoref{eq:DOM_curl_grad}).581 A pressure gradient has no contribution to the evolution of the vorticity as the curl of a gradient is zero. 582 In the $z$-coordinate, this property is satisfied locally on a C-grid with 2nd order finite differences 583 (property \autoref{eq:DOM_curl_grad}). 588 584 } 589 585 590 When the equation of state is linear ($i.e.$ when an advection-diffusion equation591 for density can be derived from those of temperature and salinity) the change of 592 KE due to the work of pressure forces is balanced by the change of potential 593 energy due to buoyancy forces:586 When the equation of state is linear 587 ($i.e.$ when an advection-diffusion equation for density can be derived from those of temperature and salinity) 588 the change of KE due to the work of pressure forces is balanced by 589 the change of potential energy due to buoyancy forces: 594 590 \begin{equation*} 595 591 - \int_D \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv … … 598 594 \end{equation*} 599 595 600 This property can be satisfied in a discrete sense for both $z$- and $s$-coordinates. 601 Indeed, defining the depth of a $T$-point, $z_t$, as the sum of the vertical scale602 factors at $w$-points starting from the surface, the work of pressure forces can be 603 written as:596 This property can be satisfied in a discrete sense for both $z$- and $s$-coordinates. 597 Indeed, defining the depth of a $T$-point, $z_t$, 598 as the sum of the vertical scale factors at $w$-points starting from the surface, 599 the work of pressure forces can be written as: 604 600 \begin{flalign*} 605 601 &- \int_D \left. \nabla p \right|_z \cdot \textbf{U}_h \;dv … … 658 654 \end{flalign*} 659 655 The first term is exactly the first term of the right-hand-side of \autoref{eq:KE+PE_vect_discrete}. 660 It remains to demonstrate that the last term, which is obviously a discrete analogue of 661 $\int_D \frac{p}{e_3} \partial_t (e_3)\;dv$ is equal to the last term of \autoref{eq:KE+PE_vect_discrete}. 656 It remains to demonstrate that the last term, 657 which is obviously a discrete analogue of $\int_D \frac{p}{e_3} \partial_t (e_3)\;dv$ is equal to 658 the last term of \autoref{eq:KE+PE_vect_discrete}. 662 659 In other words, the following property must be satisfied: 663 660 \begin{flalign*} … … 666 663 \end{flalign*} 667 664 668 Let introduce $p_w$ the pressure at $w$-point such that $\delta_k [p_w] = - \rho \,g\,e_{3t}$. 665 Let introduce $p_w$ the pressure at $w$-point such that $\delta_k [p_w] = - \rho \,g\,e_{3t}$. 669 666 The right-hand-side of the above equation can be transformed as follows: 670 667 … … 718 715 719 716 720 Note that this property strongly constrains the discrete expression of both 721 the depth of $T-$points and of the term added to the pressure gradient in the 722 $s$-coordinate. Nevertheless, it is almost never satisfied since a linear equation 723 of state is rarely used. 717 Note that this property strongly constrains the discrete expression of both the depth of $T-$points and 718 of the term added to the pressure gradient in the $s$-coordinate. 719 Nevertheless, it is almost never satisfied since a linear equation of state is rarely used. 724 720 725 721 … … 755 751 \end{flalign*} 756 752 757 Substituting the discrete expression of the time derivative of the velocity either in vector invariant or in flux form,758 leads to the discrete equivalent of the 753 Substituting the discrete expression of the time derivative of the velocity either in 754 vector invariant or in flux form, leads to the discrete equivalent of the ???? 759 755 760 756 … … 771 767 \label{subsec:C.3.3} 772 768 773 In flux from the vorticity term reduces to a Coriolis term in which the Coriolis 774 parameter has been modified to account for the ``metric'' term. This altered 775 Coriolis parameter is discretised at an f-point. It is given by: 769 In flux from the vorticity term reduces to a Coriolis term in which 770 the Coriolis parameter has been modified to account for the ``metric'' term. 771 This altered Coriolis parameter is discretised at an f-point. 772 It is given by: 776 773 \begin{equation*} 777 774 f+\frac{1} {e_1 e_2 } \left( v \frac{\partial e_2 } {\partial i} - u \frac{\partial e_1 } {\partial j}\right)\; … … 781 778 \end{equation*} 782 779 783 Either the ENE or EEN scheme is then applied to obtain the vorticity term in flux form. 784 It therefore conserves the total KE. The derivation is the same as for the785 vorticity term in the vector invariant form (\autoref{subsec:C_vor}).780 Either the ENE or EEN scheme is then applied to obtain the vorticity term in flux form. 781 It therefore conserves the total KE. 782 The derivation is the same as for the vorticity term in the vector invariant form (\autoref{subsec:C_vor}). 786 783 787 784 % ------------------------------------------------------------------------------------------------------------- … … 791 788 \label{subsec:C.3.4} 792 789 793 The flux form operator of the momentum advection is evaluated using a 794 centered second order finite difference scheme. Because of the flux form, 795 the discrete operator does not contribute to the global budget of linear 796 momentum. Because of the centered second order scheme, it conserves 797 the horizontal kinetic energy, that is : 790 The flux form operator of the momentum advection is evaluated using 791 a centered second order finite difference scheme. 792 Because of the flux form, the discrete operator does not contribute to the global budget of linear momentum. 793 Because of the centered second order scheme, it conserves the horizontal kinetic energy, that is: 798 794 799 795 \begin{equation} \label{eq:C_ADV_KE_flux} … … 804 800 \end{equation} 805 801 806 Let us first consider the first term of the scalar product ($i.e.$ just the the terms807 associated with the i-component of the advection):802 Let us first consider the first term of the scalar product 803 ($i.e.$ just the the terms associated with the i-component of the advection): 808 804 \begin{flalign*} 809 805 & - \int_D u \cdot \nabla \cdot \left( \textbf{U}\,u \right) \; dv \\ … … 845 841 \biggl\{ \left( \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t} \right) \; b_t \biggr\} &&& \\ 846 842 \end{flalign*} 847 Applying similar manipulation applied to the second term of the scalar product 848 leads to : 843 Applying similar manipulation applied to the second term of the scalar product leads to: 849 844 \begin{equation*} 850 845 - \int_D \textbf{U}_h \cdot \left( {{\begin{array} {*{20}c} … … 854 849 \biggl\{ \left( \frac{1}{e_{3t}} \frac{\partial e_{3t}}{\partial t} \right) \; b_t \biggr\} 855 850 \end{equation*} 856 which is the discrete form of 857 $ \frac{1}{2} \int_D u \cdot \nabla \cdot \left( \textbf{U}\,u \right) \; dv $. 851 which is the discrete form of $ \frac{1}{2} \int_D u \cdot \nabla \cdot \left( \textbf{U}\,u \right) \; dv $. 858 852 \autoref{eq:C_ADV_KE_flux} is thus satisfied. 859 853 860 854 861 When the UBS scheme is used to evaluate the flux form momentum advection, 862 the discrete operator does not contribute to the global budget of linear momentum 863 (flux form). The horizontal kinetic energy is not conserved, but forced to decay 864 ($i.e.$ the scheme is diffusive). 855 When the UBS scheme is used to evaluate the flux form momentum advection, 856 the discrete operator does not contribute to the global budget of linear momentum (flux form). 857 The horizontal kinetic energy is not conserved, but forced to decay ($i.e.$ the scheme is diffusive). 865 858 866 859 … … 894 887 \end{equation} 895 888 896 The scheme does not allow but the conservation of the total kinetic energy but the conservation 897 of $q^2$, the potential enstrophy for a horizontally non-divergent flow ($i.e.$ when $\chi$=$0$). 898 Indeed, using the symmetry or skew symmetry properties of the operators ( \autoref{eq:DOM_mi_adj} 899 and \autoref{eq:DOM_di_adj}), it can be shown that: 889 The scheme does not allow but the conservation of the total kinetic energy but the conservation of $q^2$, 890 the potential enstrophy for a horizontally non-divergent flow ($i.e.$ when $\chi$=$0$). 891 Indeed, using the symmetry or skew symmetry properties of the operators 892 ( \autoref{eq:DOM_mi_adj} and \autoref{eq:DOM_di_adj}), 893 it can be shown that: 900 894 \begin{equation} \label{eq:C_1.1} 901 895 \int_D {q\,\;{\textbf{k}}\cdot \frac{1} {e_3} \nabla \times \left( {e_3 \, q \;{\textbf{k}}\times {\textbf{U}}_h } \right)\;dv} \equiv 0 902 896 \end{equation} 903 where $dv=e_1\,e_2\,e_3 \; di\,dj\,dk$ is the volume element. Indeed, using904 \autoref{eq:dynvor_ens}, the discrete form of the right hand side of \autoref{eq:C_1.1} 905 can be transformed as follow:897 where $dv=e_1\,e_2\,e_3 \; di\,dj\,dk$ is the volume element. 898 Indeed, using \autoref{eq:dynvor_ens}, 899 the discrete form of the right hand side of \autoref{eq:C_1.1} can be transformed as follow: 906 900 \begin{flalign*} 907 901 &\int_D q \,\; \textbf{k} \cdot \frac{1} {e_3 } \nabla \times … … 955 949 \end{aligned} } \right. 956 950 \end{equation} 957 where the indices $i_p$ and $k_p$ take the following value :951 where the indices $i_p$ and $k_p$ take the following values: 958 952 $i_p = -1/2$ or $1/2$ and $j_p = -1/2$ or $1/2$, 959 953 and the vorticity triads, ${^i_j}\mathbb{Q}^{i_p}_{j_p}$, defined at $T$-point, are given by: … … 966 960 This formulation does conserve the potential enstrophy for a horizontally non-divergent flow ($i.e.$ $\chi=0$). 967 961 968 Let consider one of the vorticity triad, for example ${^{i}_j}\mathbb{Q}^{+1/2}_{+1/2} $, 969 similar manipulation can be done for the 3 others. The discrete form of the right hand 970 side of \autoref{eq:C_1.1} applied to this triad only can be transformed as follow: 962 Let consider one of the vorticity triad, for example ${^{i}_j}\mathbb{Q}^{+1/2}_{+1/2} $, 963 similar manipulation can be done for the 3 others. 964 The discrete form of the right hand side of \autoref{eq:C_1.1} applied to 965 this triad only can be transformed as follow: 971 966 972 967 \begin{flalign*} … … 1020 1015 1021 1016 1022 All the numerical schemes used in NEMO are written such that the tracer content 1023 is conserved by the internal dynamics and physics (equations in flux form). 1024 For advection, only the CEN2 scheme ($i.e.$ $2^{nd}$ order finite different scheme) 1025 conserves the global variance of tracer. Nevertheless the other schemes ensure 1026 that the global variance decreases ($i.e.$ they are at least slightly diffusive). 1027 For diffusion, all the schemes ensure the decrease of the total tracer variance, 1028 except the iso-neutral operator. There is generally no strict conservation of mass, 1029 as the equation of state is non linear with respect to $T$ and $S$. In practice, 1030 the mass is conserved to a very high accuracy. 1017 All the numerical schemes used in NEMO are written such that the tracer content is conserved by 1018 the internal dynamics and physics (equations in flux form). 1019 For advection, 1020 only the CEN2 scheme ($i.e.$ $2^{nd}$ order finite different scheme) conserves the global variance of tracer. 1021 Nevertheless the other schemes ensure that the global variance decreases 1022 ($i.e.$ they are at least slightly diffusive). 1023 For diffusion, all the schemes ensure the decrease of the total tracer variance, except the iso-neutral operator. 1024 There is generally no strict conservation of mass, 1025 as the equation of state is non linear with respect to $T$ and $S$. 1026 In practice, the mass is conserved to a very high accuracy. 1031 1027 % ------------------------------------------------------------------------------------------------------------- 1032 1028 % Advection Term … … 1049 1045 1050 1046 1051 Whatever the advection scheme considered it conserves of the tracer content as all 1052 the scheme are written in flux form. Indeed, let $T$ be the tracer and $\tau_u$, $\tau_v$, 1053 and $\tau_w$ its interpolated values at velocity point (whatever the interpolation is), 1047 Whatever the advection scheme considered it conserves of the tracer content as 1048 all the scheme are written in flux form. 1049 Indeed, let $T$ be the tracer and its $\tau_u$, $\tau_v$, and $\tau_w$ interpolated values at velocity point 1050 (whatever the interpolation is), 1054 1051 the conservation of the tracer content due to the advection tendency is obtained as follows: 1055 1052 \begin{flalign*} … … 1067 1064 \end{flalign*} 1068 1065 1069 The conservation of the variance of tracer due to the advection tendency 1070 can be achieved only with the CEN2 scheme, $i.e.$ when 1071 $\tau_u= \overline T^{\,i+1/2}$, $\tau_v= \overline T^{\,j+1/2}$, and $\tau_w= \overline T^{\,k+1/2}$. 1066 The conservation of the variance of tracer due to the advection tendency can be achieved only with the CEN2 scheme, 1067 $i.e.$ when $\tau_u= \overline T^{\,i+1/2}$, $\tau_v= \overline T^{\,j+1/2}$, and $\tau_w= \overline T^{\,k+1/2}$. 1072 1068 It can be demonstarted as follows: 1073 1069 \begin{flalign*} … … 1103 1099 1104 1100 1105 The discrete formulation of the horizontal diffusion of momentum ensures the 1106 conservation of potential vorticity and the horizontal divergence, and the 1107 dissipation of the square of these quantities ($i.e.$ enstrophy and the 1108 variance of the horizontal divergence) as well as the dissipation of the 1109 horizontal kinetic energy. In particular, when the eddy coefficients are 1110 horizontally uniform, it ensures a complete separation of vorticity and 1111 horizontal divergence fields, so that diffusion (dissipation) of vorticity 1112 (enstrophy) does not generate horizontal divergence (variance of the 1113 horizontal divergence) and \textit{vice versa}. 1114 1115 These properties of the horizontal diffusion operator are a direct consequence 1116 of properties \autoref{eq:DOM_curl_grad} and \autoref{eq:DOM_div_curl}. 1117 When the vertical curl of the horizontal diffusion of momentum (discrete sense) 1118 is taken, the term associated with the horizontal gradient of the divergence is 1119 locally zero. 1101 The discrete formulation of the horizontal diffusion of momentum ensures 1102 the conservation of potential vorticity and the horizontal divergence, 1103 and the dissipation of the square of these quantities 1104 ($i.e.$ enstrophy and the variance of the horizontal divergence) as well as 1105 the dissipation of the horizontal kinetic energy. 1106 In particular, when the eddy coefficients are horizontally uniform, 1107 it ensures a complete separation of vorticity and horizontal divergence fields, 1108 so that diffusion (dissipation) of vorticity (enstrophy) does not generate horizontal divergence 1109 (variance of the horizontal divergence) and \textit{vice versa}. 1110 1111 These properties of the horizontal diffusion operator are a direct consequence of 1112 properties \autoref{eq:DOM_curl_grad} and \autoref{eq:DOM_div_curl}. 1113 When the vertical curl of the horizontal diffusion of momentum (discrete sense) is taken, 1114 the term associated with the horizontal gradient of the divergence is locally zero. 1120 1115 1121 1116 % ------------------------------------------------------------------------------------------------------------- … … 1125 1120 \label{subsec:C.6.1} 1126 1121 1127 The lateral momentum diffusion term conserves the potential vorticity 1122 The lateral momentum diffusion term conserves the potential vorticity: 1128 1123 \begin{flalign*} 1129 1124 &\int \limits_D \frac{1} {e_3 } \textbf{k} \cdot \nabla \times … … 1211 1206 \label{subsec:C.6.3} 1212 1207 1213 The lateral momentum diffusion term dissipates the enstrophy when the eddy 1214 coefficients are horizontally uniform: 1208 The lateral momentum diffusion term dissipates the enstrophy when the eddy coefficients are horizontally uniform: 1215 1209 \begin{flalign*} 1216 1210 &\int\limits_D \zeta \; \textbf{k} \cdot \nabla \times … … 1236 1230 \label{subsec:C.6.4} 1237 1231 1238 When the horizontal divergence of the horizontal diffusion of momentum 1239 (discrete sense) is taken, the term associated with the vertical curl of the 1240 vorticity is zero locally, due to \autoref{eq:DOM_div_curl}. 1241 The resulting term conserves the $\chi$ and dissipates $\chi^2$ 1242 when the eddy coefficients are horizontally uniform. 1232 When the horizontal divergence of the horizontal diffusion of momentum (discrete sense) is taken, 1233 the term associated with the vertical curl of the vorticity is zero locally, due to \autoref{eq:DOM_div_curl}. 1234 The resulting term conserves the $\chi$ and dissipates $\chi^2$ when the eddy coefficients are horizontally uniform. 1243 1235 \begin{flalign*} 1244 1236 & \int\limits_D \nabla_h \cdot … … 1291 1283 \label{sec:C.7} 1292 1284 1293 As for the lateral momentum physics, the continuous form of the vertical diffusion1294 of momentum satisfies several integral constraints. The first two are associated 1295 with the conservation of momentum and the dissipation of horizontal kinetic energy:1285 As for the lateral momentum physics, 1286 the continuous form of the vertical diffusion of momentum satisfies several integral constraints. 1287 The first two are associated with the conservation of momentum and the dissipation of horizontal kinetic energy: 1296 1288 \begin{align*} 1297 1289 \int\limits_D \frac{1} {e_3 }\; \frac{\partial } {\partial k} … … 1306 1298 \end{align*} 1307 1299 1308 The first property is obvious. The second results from: 1300 The first property is obvious. 1301 The second results from: 1309 1302 \begin{flalign*} 1310 1303 \int\limits_D … … 1326 1319 \end{flalign*} 1327 1320 1328 The vorticity is also conserved. Indeed: 1321 The vorticity is also conserved. 1322 Indeed: 1329 1323 \begin{flalign*} 1330 1324 \int \limits_D … … 1346 1340 \end{flalign*} 1347 1341 1348 If the vertical diffusion coefficient is uniform over the whole domain, the 1349 enstrophy is dissipated, $i.e.$ 1342 If the vertical diffusion coefficient is uniform over the whole domain, the enstrophy is dissipated, $i.e.$ 1350 1343 \begin{flalign*} 1351 1344 \int\limits_D \zeta \, \textbf{k} \cdot \nabla \times … … 1378 1371 &\left[ \frac{A_u^{\,vm}} {e_{3uw}} \delta_{k+1/2} \left[ \delta_{j+1/2} \left[ e_{1u}\,u \right] \right] \right] \biggr\} &&\\ 1379 1372 \end{flalign*} 1380 Using the fact that the vertical diffusion coefficients are uniform, and that in 1381 $z$-coordinate, the vertical scale factors do not depend on $i$ and $j$ so 1382 that: $e_{3f} =e_{3u} =e_{3v} =e_{3t} $ and $e_{3w} =e_{3uw} =e_{3vw} $, 1383 it follows: 1373 Using the fact that the vertical diffusion coefficients are uniform, 1374 and that in $z$-coordinate, the vertical scale factors do not depend on $i$ and $j$ so that: 1375 $e_{3f} =e_{3u} =e_{3v} =e_{3t} $ and $e_{3w} =e_{3uw} =e_{3vw} $, it follows: 1384 1376 \begin{flalign*} 1385 1377 \equiv A^{\,vm} \sum\limits_{i,j,k} \zeta \;\delta_k … … 1398 1390 \left( \frac{A^{\,vm}} {e_3 }\; \frac{\partial \textbf{U}_h } {\partial k} \right) \right)\; dv = 0 &&&\\ 1399 1391 \end{flalign*} 1400 and the square of the horizontal divergence decreases ($i.e.$ the horizontal 1401 divergence is dissipated) if the vertical diffusion coefficient is uniform over the 1402 whole domain: 1392 and the square of the horizontal divergence decreases ($i.e.$ the horizontal divergence is dissipated) if 1393 the vertical diffusion coefficient is uniform over the whole domain: 1403 1394 1404 1395 \begin{flalign*} … … 1463 1454 \label{sec:C.8} 1464 1455 1465 The numerical schemes used for tracer subgridscale physics are written such 1466 th at the heat and salt contents are conserved (equations in flux form).1467 Since a flux form is used to compute the temperature and salinity, 1468 the quadratic form of these quantities ($i.e.$ their variance) globally tends to diminish. 1456 The numerical schemes used for tracer subgridscale physics are written such that 1457 the heat and salt contents are conserved (equations in flux form). 1458 Since a flux form is used to compute the temperature and salinity, 1459 the quadratic form of these quantities ($i.e.$ their variance) globally tends to diminish. 1469 1460 As for the advection term, there is conservation of mass only if the Equation Of Seawater is linear. 1470 1461 -
NEMO/trunk/doc/latex/NEMO/subfiles/annex_D.tex
r9407 r10354 13 13 14 14 15 A "model life" is more than ten years. Its software, composed of a few16 hundred modules, is used by many people who are scientists or students 17 and do not necessarily know every aspect of computing very well. 18 Moreover, a well thought-out program is easier to read and understand, 19 less difficult to modify, produces fewer bugs and is easier to maintain. 20 Therefore, it is essential that the model development follows some rules 15 A "model life" is more than ten years. 16 Its software, composed of a few hundred modules, is used by many people who are scientists or students and 17 do not necessarily know every aspect of computing very well. 18 Moreover, a well thought-out program is easier to read and understand, less difficult to modify, 19 produces fewer bugs and is easier to maintain. 20 Therefore, it is essential that the model development follows some rules: 21 21 22 22 - well planned and designed … … 32 32 - flexible. 33 33 34 To satisfy part of these aims, \NEMO is written with a coding standard which 35 is close to the ECMWF rules,named DOCTOR \citep{Gibson_TR86}.36 These rules present some advantages like 34 To satisfy part of these aims, \NEMO is written with a coding standard which is close to the ECMWF rules, 35 named DOCTOR \citep{Gibson_TR86}. 36 These rules present some advantages like: 37 37 38 38 - to provide a well presented program 39 39 40 - to use rules for variable names which allow recognition of their type 40 - to use rules for variable names which allow recognition of their type 41 41 (integer, real, parameter, local or shared variables, etc. ). 42 42 … … 49 49 \label{sec:D_structure} 50 50 51 Each program begins with a set of headline comments containing 51 Each program begins with a set of headline comments containing: 52 52 53 53 - the program title … … 65 65 - the author name(s), the date of creation and any updates. 66 66 67 - Each program is split into several well separated sections and 67 - Each program is split into several well separated sections and 68 68 sub-sections with an underlined title and specific labelled statements. 69 69 70 70 - A program has not more than 200 to 300 lines. 71 71 72 A template of a module style can be found on the NEMO depository 73 in the following file :NEMO/OPA\_SRC/module\_example.72 A template of a module style can be found on the NEMO depository in the following file: 73 NEMO/OPA\_SRC/module\_example. 74 74 % ================================================================ 75 75 % Coding conventions … … 78 78 \label{sec:D_coding} 79 79 80 - Use of the universal language \textsc{Fortran} 90, and try to avoid obsolescent 81 features like statement functions, do not use GO TO and EQUIVALENCE statements. 82 83 - A continuation line begins with the character {\&} indented by three spaces 84 compared to the previous line, while the previous line ended with the character {\&}. 85 86 - All the variables must be declared. The code is usually compiled with implicit none. 80 - Use of the universal language \textsc{Fortran} 90, and try to avoid obsolescent features like statement functions, 81 do not use GO TO and EQUIVALENCE statements. 82 83 - A continuation line begins with the character {\&} indented by three spaces compared to the previous line, 84 while the previous line ended with the character {\&}. 85 86 - All the variables must be declared. 87 The code is usually compiled with implicit none. 87 88 88 - Never use continuation lines in the declaration of a variable. When searching a 89 variable in the code through a \textit{grep} command, the declaration line will be found. 90 91 - In the declaration of a PUBLIC variable, the comment part at the end of the line 92 should start with the two characters "\verb?!:?". the following UNIX command, \\ 89 - Never use continuation lines in the declaration of a variable. 90 When searching a variable in the code through a \textit{grep} command, the declaration line will be found. 91 92 - In the declaration of a PUBLIC variable, the comment part at the end of the line should start with 93 the two characters "\verb?!:?". 94 The following UNIX command, \\ 93 95 \verb?grep var_name *90 \ grep \!: ? \\ 94 96 will display the module name and the line where the var\_name declaration is. 95 97 96 - Always use a three spaces indentation in DO loop, CASE, or IF-ELSEIF-ELSE-ENDIF 97 statements. 98 - Always use a three spaces indentation in DO loop, CASE, or IF-ELSEIF-ELSE-ENDIF statements. 98 99 99 100 - use a space after a comma, except when it appears to separate the indices of an array. … … 109 110 \label{sec:D_naming} 110 111 111 The purpose of the naming conventions is to use prefix letters to classify 112 model variables. These conventions allow the variable type to be easily 113 known and rapidly identified. The naming conventions are summarised 114 in the Table below: 112 The purpose of the naming conventions is to use prefix letters to classify model variables. 113 These conventions allow the variable type to be easily known and rapidly identified. 114 The naming conventions are summarised in the Table below: 115 115 116 116 … … 192 192 %-------------------------------------------------------------------------------------------------------------- 193 193 194 N.B. Parameter here, in not only parameter in the \textsc{Fortran} acceptation, it is also used for code variables195 that are read in namelist and should never been modified during a simulation.194 N.B. Parameter here, in not only parameter in the \textsc{Fortran} acceptation, 195 it is also used for code variables that are read in namelist and should never been modified during a simulation. 196 196 It is the case, for example, for the size of a domain (jpi,jpj,jpk). 197 197 -
NEMO/trunk/doc/latex/NEMO/subfiles/annex_E.tex
r9407 r10354 10 10 \newpage 11 11 $\ $\newline % force a new ligne 12 13 This appendix some on going consideration on algorithms used or planned to be used 14 in \NEMO. 12 13 This appendix some on going consideration on algorithms used or planned to be used in \NEMO. 15 14 16 15 $\ $\newline % force a new ligne … … 22 21 \label{sec:TRA_adv_ubs} 23 22 24 The UBS advection scheme is an upstream biased third order scheme based on 25 an upstream-biased parabolic interpolation. It is also known as Cell Averaged26 QUICK scheme (Quadratic Upstream Interpolation for Convective 27 Kinematics). For example, in the $i$-direction:23 The UBS advection scheme is an upstream biased third order scheme based on 24 an upstream-biased parabolic interpolation. 25 It is also known as Cell Averaged QUICK scheme (Quadratic Upstream Interpolation for Convective Kinematics). 26 For example, in the $i$-direction: 28 27 \begin{equation} \label{eq:tra_adv_ubs2} 29 28 \tau _u^{ubs} = \left\{ \begin{aligned} … … 38 37 - \frac{1}{2}\, |U|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i] 39 38 \end{equation} 40 where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and 41 $\tau "_i =\delta _i \left[ {\delta _{i+1/2} \left[ \tau \right]} \right]$. 42 By choosing this expression for $\tau "$ we consider a fourth order approximation 43 of $\partial_i^2$ with a constant i-grid spacing ($\Delta i=1$). 39 where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and 40 $\tau "_i =\delta _i \left[ {\delta _{i+1/2} \left[ \tau \right]} \right]$. 41 By choosing this expression for $\tau "$ we consider a fourth order approximation of $\partial_i^2$ with 42 a constant i-grid spacing ($\Delta i=1$). 44 43 45 44 Alternative choice: introduce the scale factors: … … 47 46 48 47 49 This results in a dissipatively dominant (i.e. hyper-diffusive) truncation 50 error \citep{Shchepetkin_McWilliams_OM05}. The overall performance of the 51 advection scheme is similar to that reported in \cite{Farrow1995}. 52 It is a relatively good compromise between accuracy and smoothness. It is 53 not a \emph{positive} scheme meaning false extrema are permitted but the 54 amplitude of such are significantly reduced over the centred second order 55 method. Nevertheless it is not recommended to apply it to a passive tracer 56 that requires positivity. 57 58 The intrinsic diffusion of UBS makes its use risky in the vertical direction 59 where the control of artificial diapycnal fluxes is of paramount importance. 60 It has therefore been preferred to evaluate the vertical flux using the TVD 61 scheme when \np{ln\_traadv\_ubs}\forcode{ = .true.}. 62 63 For stability reasons, in \autoref{eq:tra_adv_ubs}, the first term which corresponds 64 to a second order centred scheme is evaluated using the \textit{now} velocity 65 (centred in time) while the second term which is the diffusive part of the scheme, 66 is evaluated using the \textit{before} velocity (forward in time. This is discussed 67 by \citet{Webb_al_JAOT98} in the context of the Quick advection scheme. UBS and QUICK 68 schemes only differ by one coefficient. Substituting 1/6 with 1/8 in 69 (\autoref{eq:tra_adv_ubs}) leads to the QUICK advection scheme \citep{Webb_al_JAOT98}. 70 This option is not available through a namelist parameter, since the 1/6 71 coefficient is hard coded. Nevertheless it is quite easy to make the 72 substitution in \mdl{traadv\_ubs} module and obtain a QUICK scheme 73 74 NB 1: When a high vertical resolution $O(1m)$ is used, the model stability can 75 be controlled by vertical advection (not vertical diffusion which is usually 76 solved using an implicit scheme). Computer time can be saved by using a 77 time-splitting technique on vertical advection. This possibility have been 78 implemented and validated in ORCA05-L301. It is not currently offered in the 79 current reference version. 80 81 NB 2 : In a forthcoming release four options will be proposed for the 82 vertical component used in the UBS scheme. $\tau _w^{ubs}$ will be 83 evaluated using either \textit{(a)} a centred $2^{nd}$ order scheme , 84 or \textit{(b)} a TVD scheme, or \textit{(c)} an interpolation based on conservative 85 parabolic splines following \citet{Shchepetkin_McWilliams_OM05} implementation of UBS in ROMS, 86 or \textit{(d)} an UBS. The $3^{rd}$ case has dispersion properties similar to an 87 eight-order accurate conventional scheme. 88 89 NB 3 : It is straight forward to rewrite \autoref{eq:tra_adv_ubs} as follows: 48 This results in a dissipatively dominant (i.e. hyper-diffusive) truncation error 49 \citep{Shchepetkin_McWilliams_OM05}. 50 The overall performance of the advection scheme is similar to that reported in \cite{Farrow1995}. 51 It is a relatively good compromise between accuracy and smoothness. 52 It is not a \emph{positive} scheme meaning false extrema are permitted but 53 the amplitude of such are significantly reduced over the centred second order method. 54 Nevertheless it is not recommended to apply it to a passive tracer that requires positivity. 55 56 The intrinsic diffusion of UBS makes its use risky in the vertical direction where 57 the control of artificial diapycnal fluxes is of paramount importance. 58 It has therefore been preferred to evaluate the vertical flux using the TVD scheme when 59 \np{ln\_traadv\_ubs}\forcode{ = .true.}. 60 61 For stability reasons, in \autoref{eq:tra_adv_ubs}, the first term which corresponds to 62 a second order centred scheme is evaluated using the \textit{now} velocity (centred in time) while 63 the second term which is the diffusive part of the scheme, is evaluated using the \textit{before} velocity 64 (forward in time). 65 This is discussed by \citet{Webb_al_JAOT98} in the context of the Quick advection scheme. 66 UBS and QUICK schemes only differ by one coefficient. 67 Substituting 1/6 with 1/8 in (\autoref{eq:tra_adv_ubs}) leads to the QUICK advection scheme \citep{Webb_al_JAOT98}. 68 This option is not available through a namelist parameter, since the 1/6 coefficient is hard coded. 69 Nevertheless it is quite easy to make the substitution in \mdl{traadv\_ubs} module and obtain a QUICK scheme. 70 71 NB 1: When a high vertical resolution $O(1m)$ is used, the model stability can be controlled by vertical advection 72 (not vertical diffusion which is usually solved using an implicit scheme). 73 Computer time can be saved by using a time-splitting technique on vertical advection. 74 This possibility have been implemented and validated in ORCA05-L301. 75 It is not currently offered in the current reference version. 76 77 NB 2: In a forthcoming release four options will be proposed for the vertical component used in the UBS scheme. 78 $\tau _w^{ubs}$ will be evaluated using either \textit{(a)} a centered $2^{nd}$ order scheme, 79 or \textit{(b)} a TVD scheme, or \textit{(c)} an interpolation based on conservative parabolic splines following 80 \citet{Shchepetkin_McWilliams_OM05} implementation of UBS in ROMS, or \textit{(d)} an UBS. 81 The $3^{rd}$ case has dispersion properties similar to an eight-order accurate conventional scheme. 82 83 NB 3: It is straight forward to rewrite \autoref{eq:tra_adv_ubs} as follows: 90 84 \begin{equation} \label{eq:tra_adv_ubs2} 91 85 \tau _u^{ubs} = \left\{ \begin{aligned} … … 102 96 \end{split} 103 97 \end{equation} 104 \autoref{eq:tra_adv_ubs2} has several advantages. First it clearly evidence that105 the UBS scheme is based on the fourth order scheme to which is added an 106 upstream biased diffusive term. Second, this emphasises that the $4^{th}$ order 107 part have to be evaluated at \emph{now} time step, not only the $2^{th}$ order 108 part as stated above using \autoref{eq:tra_adv_ubs}. Third, the diffusive term is 109 in fact a biharmonic operator with a eddy coefficient with is simply proportional 110 to the velocity.98 \autoref{eq:tra_adv_ubs2} has several advantages. 99 First it clearly evidences that the UBS scheme is based on the fourth order scheme to which 100 is added an upstream biased diffusive term. 101 Second, this emphasises that the $4^{th}$ order part have to be evaluated at \emph{now} time step, 102 not only the $2^{th}$ order part as stated above using \autoref{eq:tra_adv_ubs}. 103 Third, the diffusive term is in fact a biharmonic operator with a eddy coefficient which 104 is simply proportional to the velocity. 111 105 112 106 laplacian diffusion: … … 135 129 with ${A_u^{lT}}^2 = \frac{1}{12} {e_{1u}}^3\ |u|$, 136 130 $i.e.$ $A_u^{lT} = \frac{1}{\sqrt{12}} \,e_{1u}\ \sqrt{ e_{1u}\,|u|\,}$ 137 it comes 131 it comes: 138 132 \begin{equation} \label{eq:tra_ldf_lap} 139 133 \begin{split} … … 163 157 \end{split} 164 158 \end{equation} 165 if the velocity is uniform ($i.e.$ $|u|=cst$) and choosing $\tau "_i =\frac{e_{1T}}{e_{2T}\,e_{3T}}\delta _i \left[ \frac{e_{2u} e_{3u} }{e_{1u} } \delta _{i+1/2}[\tau] \right]$ 159 if the velocity is uniform ($i.e.$ $|u|=cst$) and 160 choosing $\tau "_i =\frac{e_{1T}}{e_{2T}\,e_{3T}}\delta _i \left[ \frac{e_{2u} e_{3u} }{e_{1u} } \delta _{i+1/2}[\tau] \right]$ 166 161 167 162 sol 1 coefficient at T-point ( add $e_{1u}$ and $e_{1T}$ on both side of first $\delta$): … … 191 186 \label{sec:LF} 192 187 193 We adopt the following semi-discrete notation for time derivative. Given the values of a variable $q$ at successive time step, the time derivation and averaging operators at the mid time step are: 188 We adopt the following semi-discrete notation for time derivative. 189 Given the values of a variable $q$ at successive time step, 190 the time derivation and averaging operators at the mid time step are: 194 191 \begin{subequations} \label{eq:dt_mt} 195 192 \begin{align} … … 198 195 \end{align} 199 196 \end{subequations} 200 As for space operator, the adjoint of the derivation and averaging time operators are201 $\delta_t^*=\delta_{t+\rdt/2}$ and $\overline{\cdot}^{\,t\,*}= \overline{\cdot}^{\,t+\Delta/2}$ 202 , respectively. 197 As for space operator, 198 the adjoint of the derivation and averaging time operators are $\delta_t^*=\delta_{t+\rdt/2}$ and 199 $\overline{\cdot}^{\,t\,*}= \overline{\cdot}^{\,t+\Delta/2}$, respectively. 203 200 204 201 The Leap-frog time stepping given by \autoref{eq:DOM_nxt} can be defined as: … … 208 205 = \frac{q^{t+\rdt}-q^{t-\rdt}}{2\rdt} 209 206 \end{equation} 210 Note that \autoref{chap:LF} shows that the leapfrog time step is $\rdt$, not $2\rdt$211 as it can be found sometime in literature. 212 The leap-Frog time stepping is a second order centered scheme. As such it respects213 the quadratic invariant in integral forms, $i.e.$ the following continuous property,207 Note that \autoref{chap:LF} shows that the leapfrog time step is $\rdt$, 208 not $2\rdt$ as it can be found sometimes in literature. 209 The leap-Frog time stepping is a second order centered scheme. 210 As such it respects the quadratic invariant in integral forms, $i.e.$ the following continuous property, 214 211 \begin{equation} \label{eq:Energy} 215 212 \int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt} … … 217 214 = \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) , 218 215 \end{equation} 219 is satisfied in discrete form. Indeed, 216 is satisfied in discrete form. 217 Indeed, 220 218 \begin{equation} \begin{split} 221 219 \int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt} … … 228 226 \equiv \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) 229 227 \end{split} \end{equation} 230 NB here pb of boundary condition when applying the adjoin ! In space, setting to 0231 the quantity in land area is sufficient to get rid of the boundary condition232 (equivalently of the boundary value of the integration by part). In time this boundary233 condition is not physical and \textbf{add something here!!!}228 NB here pb of boundary condition when applying the adjoint! 229 In space, setting to 0 the quantity in land area is sufficient to get rid of the boundary condition 230 (equivalently of the boundary value of the integration by part). 231 In time this boundary condition is not physical and \textbf{add something here!!!} 234 232 235 233 … … 249 247 \subsection{Griffies iso-neutral diffusion operator} 250 248 251 Let try to define a scheme that get its inspiration from the \citet{Griffies_al_JPO98} 252 scheme, but is formulated within the \NEMO framework ($i.e.$ using scale 253 factors rather than grid-size and having a position of $T$-points that is not 254 necessary in the middle of vertical velocity points, see \autoref{fig:zgr_e3}). 255 256 In the formulation \autoref{eq:tra_ldf_iso} introduced in 1995 in OPA, the ancestor of \NEMO, 257 the off-diagonal terms of the small angle diffusion tensor contain several double 258 spatial averages of a gradient, for example $\overline{\overline{\delta_k \cdot}}^{\,i,k}$. 259 It is apparent that the combination of a $k$ average and a $k$ derivative of the tracer 260 allows for the presence of grid point oscillation structures that will be invisible 261 to the operator. These structures are \textit{computational modes}. They 262 will not be damped by the iso-neutral operator, and even possibly amplified by it. 263 In other word, the operator applied to a tracer does not warranties the decrease of 264 its global average variance. To circumvent this, we have introduced a smoothing of 265 the slopes of the iso-neutral surfaces (see \autoref{chap:LDF}). Nevertheless, this technique 266 works fine for $T$ and $S$ as they are active tracers ($i.e.$ they enter the computation 267 of density), but it does not work for a passive tracer. \citep{Griffies_al_JPO98} introduce 268 a different way to discretise the off-diagonal terms that nicely solve the problem. 269 The idea is to get rid of combinations of an averaged in one direction combined 270 with a derivative in the same direction by considering triads. For example in the 271 (\textbf{i},\textbf{k}) plane, the four triads are defined at the $(i,k)$ $T$-point as follows: 249 Let try to define a scheme that get its inspiration from the \citet{Griffies_al_JPO98} scheme, 250 but is formulated within the \NEMO framework 251 ($i.e.$ using scale factors rather than grid-size and having a position of $T$-points that 252 is not necessary in the middle of vertical velocity points, see \autoref{fig:zgr_e3}). 253 254 In the formulation \autoref{eq:tra_ldf_iso} introduced in 1995 in OPA, the ancestor of \NEMO, 255 the off-diagonal terms of the small angle diffusion tensor contain several double spatial averages of a gradient, 256 for example $\overline{\overline{\delta_k \cdot}}^{\,i,k}$. 257 It is apparent that the combination of a $k$ average and a $k$ derivative of the tracer allows for 258 the presence of grid point oscillation structures that will be invisible to the operator. 259 These structures are \textit{computational modes}. 260 They will not be damped by the iso-neutral operator, and even possibly amplified by it. 261 In other word, the operator applied to a tracer does not warranties the decrease of its global average variance. 262 To circumvent this, we have introduced a smoothing of the slopes of the iso-neutral surfaces 263 (see \autoref{chap:LDF}). 264 Nevertheless, this technique works fine for $T$ and $S$ as they are active tracers 265 ($i.e.$ they enter the computation of density), but it does not work for a passive tracer. 266 \citep{Griffies_al_JPO98} introduce a different way to discretise the off-diagonal terms that 267 nicely solve the problem. 268 The idea is to get rid of combinations of an averaged in one direction combined with 269 a derivative in the same direction by considering triads. 270 For example in the (\textbf{i},\textbf{k}) plane, the four triads are defined at the $(i,k)$ $T$-point as follows: 272 271 \begin{equation} \label{eq:Gf_triads} 273 272 _i^k \mathbb{T}_{i_p}^{k_p} (T) … … 277 276 \right) 278 277 \end{equation} 279 where the indices $i_p$ and $k_p$ define the four triads and take the following value: 280 $i_p = -1/2$ or $1/2$ and $k_p = -1/2$ or $1/2$, 281 $b_u= e_{1u}\,e_{2u}\,e_{3u}$ is the volume of $u$-cells, 278 where the indices $i_p$ and $k_p$ define the four triads and take the following value: 279 $i_p = -1/2$ or $1/2$ and $k_p = -1/2$ or $1/2$, 280 $b_u= e_{1u}\,e_{2u}\,e_{3u}$ is the volume of $u$-cells, 282 281 $A_i^k$ is the lateral eddy diffusivity coefficient defined at $T$-point, 283 and $_i^k \mathbb{R}_{i_p}^{k_p}$ is the slope associated with each triad 282 and $_i^k \mathbb{R}_{i_p}^{k_p}$ is the slope associated with each triad: 284 283 \begin{equation} \label{eq:Gf_slopes} 285 284 _i^k \mathbb{R}_{i_p}^{k_p} … … 288 287 {\left(\alpha / \beta \right)_i^k \ \delta_{k+k_p}[T^i ] - \delta_{k+k_p}[S^i ] } 289 288 \end{equation} 290 Note that in \autoref{eq:Gf_slopes} we use the ratio $\alpha / \beta$ instead of 291 multiplying the temperature derivative by $\alpha$ and the salinity derivative 292 by $\beta$. This is more efficient as the ratio $\alpha / \beta$ can to be 293 evaluated directly. 294 295 Note that in \autoref{eq:Gf_triads}, we chose to use ${b_u}_{\,i+i_p}^{\,k}$ instead of 296 ${b_{uw}}_{\,i+i_p}^{\,k+k_p}$. This choice has been motivated by the decrease 297 of tracer variance and the presence of partial cell at the ocean bottom 298 (see \autoref{apdx:Gf_operator}). 289 Note that in \autoref{eq:Gf_slopes} we use the ratio $\alpha / \beta$ instead of 290 multiplying the temperature derivative by $\alpha$ and the salinity derivative by $\beta$. 291 This is more efficient as the ratio $\alpha / \beta$ can to be evaluated directly. 292 293 Note that in \autoref{eq:Gf_triads}, we chose to use ${b_u}_{\,i+i_p}^{\,k}$ instead of ${b_{uw}}_{\,i+i_p}^{\,k+k_p}$. 294 This choice has been motivated by the decrease of tracer variance and 295 the presence of partial cell at the ocean bottom (see \autoref{apdx:Gf_operator}). 299 296 300 297 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 301 298 \begin{figure}[!ht] \begin{center} 302 299 \includegraphics[width=0.70\textwidth]{Fig_ISO_triad} 303 \caption{ \protect\label{fig:ISO_triad} 304 Triads used in the Griffies's like iso-neutral diffision scheme for 305 $u$-component (upper panel) and $w$-component (lower panel).}300 \caption{ \protect\label{fig:ISO_triad} 301 Triads used in the Griffies's like iso-neutral diffision scheme for 302 $u$-component (upper panel) and $w$-component (lower panel).} 306 303 \end{center} 307 304 \end{figure} … … 309 306 310 307 The four iso-neutral fluxes associated with the triads are defined at $T$-point. 311 They take the following expression 308 They take the following expression: 312 309 \begin{flalign} \label{eq:Gf_fluxes} 313 310 \begin{split} … … 320 317 \end{flalign} 321 318 322 The resulting iso-neutral fluxes at $u$- and $w$-points are then given by the323 sum of the fluxes that cross the $u$- and $w$-face (\autoref{fig:ISO_triad}):319 The resulting iso-neutral fluxes at $u$- and $w$-points are then given by 320 the sum of the fluxes that cross the $u$- and $w$-face (\autoref{fig:ISO_triad}): 324 321 \begin{flalign} \label{eq:iso_flux} 325 322 \textbf{F}_{iso}(T) … … 350 347 % \end{pmatrix} 351 348 \end{flalign} 352 resulting in a iso-neutral diffusion tendency on temperature given by the divergence353 of the sum of all the four triad fluxes:349 resulting in a iso-neutral diffusion tendency on temperature given by 350 the divergence of the sum of all the four triad fluxes: 354 351 \begin{equation} \label{eq:Gf_operator} 355 352 D_l^T = \frac{1}{b_T} \sum_{\substack{i_p,\,k_p}} \left\{ … … 359 356 where $b_T= e_{1T}\,e_{2T}\,e_{3T}$ is the volume of $T$-cells. 360 357 361 This expression of the iso-neutral diffusion has been chosen in order to satisfy 362 the following six properties: 358 This expression of the iso-neutral diffusion has been chosen in order to satisfy the following six properties: 363 359 \begin{description} 364 \item[$\bullet$ horizontal diffusion] The discretization of the diffusion operator 365 recovers the traditional five-point Laplacian in the limit of flat iso-neutral direction : 360 \item[$\bullet$ horizontal diffusion] 361 The discretization of the diffusion operator recovers the traditional five-point Laplacian in 362 the limit of flat iso-neutral direction: 366 363 \begin{equation} \label{eq:Gf_property1a} 367 364 D_l^T = \frac{1}{b_T} \ \delta_{i} … … 371 368 \end{equation} 372 369 373 \item[$\bullet$ implicit treatment in the vertical] In the diagonal term associated374 with the vertical divergence of the iso-neutral fluxes (i.e. the term associated 375 with a second order vertical derivative) appears only tracer values associated 376 with a single water column. This is of paramount importance since it means 377 that the implicit in time algorithm for solving the vertical diffusion equation can 378 be used to evaluate this term. It is a necessity since the vertical eddy diffusivity 379 associated with this term,370 \item[$\bullet$ implicit treatment in the vertical] 371 In the diagonal term associated with the vertical divergence of the iso-neutral fluxes 372 (i.e. the term associated with a second order vertical derivative) 373 appears only tracer values associated with a single water column. 374 This is of paramount importance since it means that 375 the implicit in time algorithm for solving the vertical diffusion equation can be used to evaluate this term. 376 It is a necessity since the vertical eddy diffusivity associated with this term, 380 377 \begin{equation} 381 378 \sum_{\substack{i_p, \,k_p}} \left\{ … … 385 382 can be quite large. 386 383 387 \item[$\bullet$ pure iso-neutral operator] The iso-neutral flux of locally referenced388 potential density is zero, $i.e.$384 \item[$\bullet$ pure iso-neutral operator] 385 The iso-neutral flux of locally referenced potential density is zero, $i.e.$ 389 386 \begin{align} \label{eq:Gf_property2} 390 387 \begin{matrix} … … 397 394 \end{matrix} 398 395 \end{align} 399 This result is trivially obtained using the \autoref{eq:Gf_triads} applied to $T$ and $S$ 400 andthe definition of the triads' slopes \autoref{eq:Gf_slopes}.401 402 \item[$\bullet$ conservation of tracer] The iso-neutral diffusion term conserve the403 total tracer content, $i.e.$396 This result is trivially obtained using the \autoref{eq:Gf_triads} applied to $T$ and $S$ and 397 the definition of the triads' slopes \autoref{eq:Gf_slopes}. 398 399 \item[$\bullet$ conservation of tracer] 400 The iso-neutral diffusion term conserve the total tracer content, $i.e.$ 404 401 \begin{equation} \label{eq:Gf_property1} 405 402 \sum_{i,j,k} \left\{ D_l^T \ b_T \right\} = 0 406 403 \end{equation} 407 This property is trivially satisfied since the iso-neutral diffusive operator 408 is written in flux form. 409 410 \item[$\bullet$ decrease of tracer variance] The iso-neutral diffusion term does 411 not increase the total tracer variance, $i.e.$ 404 This property is trivially satisfied since the iso-neutral diffusive operator is written in flux form. 405 406 \item[$\bullet$ decrease of tracer variance] 407 The iso-neutral diffusion term does not increase the total tracer variance, $i.e.$ 412 408 \begin{equation} \label{eq:Gf_property1} 413 409 \sum_{i,j,k} \left\{ T \ D_l^T \ b_T \right\} \leq 0 414 410 \end{equation} 415 The property is demonstrated in the \autoref{apdx:Gf_operator}. It is a 416 key property for a diffusion term. It means that the operator is also a dissipation 417 term, $i.e.$ it is a sink term for the square of the quantity on which it is applied. 418 It therfore ensure that, when the diffusivity coefficient is large enough, the field 419 on which it is applied become free of grid-point noise. 420 421 \item[$\bullet$ self-adjoint operator] The iso-neutral diffusion operator is self-adjoint, 422 $i.e.$ 411 The property is demonstrated in the \autoref{apdx:Gf_operator}. 412 It is a key property for a diffusion term. 413 It means that the operator is also a dissipation term, 414 $i.e.$ it is a sink term for the square of the quantity on which it is applied. 415 It therfore ensures that, when the diffusivity coefficient is large enough, 416 the field on which it is applied become free of grid-point noise. 417 418 \item[$\bullet$ self-adjoint operator] 419 The iso-neutral diffusion operator is self-adjoint, $i.e.$ 423 420 \begin{equation} \label{eq:Gf_property1} 424 421 \sum_{i,j,k} \left\{ S \ D_l^T \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\} 425 422 \end{equation} 426 In other word, there is no needs to develop a specific routine from the adjoint of this 427 operator. We just have to apply the same routine. This properties can be demonstrated 428 quite easily in a similar way the "non increase of tracer variance" property has been 429 proved (see \autoref{apdx:Gf_operator}).423 In other word, there is no needs to develop a specific routine from the adjoint of this operator. 424 We just have to apply the same routine. 425 This properties can be demonstrated quite easily in a similar way the "non increase of tracer variance" property 426 has been proved (see \autoref{apdx:Gf_operator}). 430 427 \end{description} 431 428 … … 437 434 \subsection{Eddy induced velocity and skew flux formulation} 438 435 439 When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined), 440 an additional advection term is added. The associated velocity is the so called441 eddy induced velocity, the formulation of which depends on the slopes of iso- 442 neutral surfaces. Contrary to the case of iso-neutral mixing, the slopes used 443 here are referenced to the geopotential surfaces, $i.e.$ \autoref{eq:ldfslp_geo} 444 is used in $z$-coordinate, and the sum \autoref{eq:ldfslp_geo} 445 + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates.436 When Gent and McWilliams [1990] diffusion is used (\key{traldf\_eiv} defined), 437 an additional advection term is added. 438 The associated velocity is the so called eddy induced velocity, 439 the formulation of which depends on the slopes of iso-neutral surfaces. 440 Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces, 441 $i.e.$ \autoref{eq:ldfslp_geo} is used in $z$-coordinate, 442 and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates. 446 443 447 444 The eddy induced velocity is given by: … … 456 453 \end{split} 457 454 \end{equation} 458 where $A_{e}$ is the eddy induced velocity coefficient, and $r_i$ and $r_j$ the459 slopes between the iso-neutral and the geopotential surfaces.455 where $A_{e}$ is the eddy induced velocity coefficient, 456 and $r_i$ and $r_j$ the slopes between the iso-neutral and the geopotential surfaces. 460 457 %%gm wrong: to be modified with 2 2D streamfunctions 461 In other words, 462 the eddy induced velocity can be derived from a vector streamfuntion, $\phi$, which 463 is given by $\phi = A_e\,\textbf{r}$ as $\textbf{U}^* = \textbf{k} \times \nabla \phi$ 458 In other words, the eddy induced velocity can be derived from a vector streamfuntion, $\phi$, 459 which is given by $\phi = A_e\,\textbf{r}$ as $\textbf{U}^* = \textbf{k} \times \nabla \phi$. 464 460 %%end gm 465 461 466 A traditional way to implement this additional advection is to add it to the eulerian 467 velocity prior to compute the tracer advection. This allows us to take advantage of 468 all the advection schemes offered for the tracers (see \autoref{sec:TRA_adv}) and not just 469 a $2^{nd}$ order advection scheme. This is particularly useful for passive tracers 470 where \emph{positivity} of the advection scheme is of paramount importance. 462 A traditional way to implement this additional advection is to add it to the eulerian velocity prior to 463 compute the tracer advection. 464 This allows us to take advantage of all the advection schemes offered for the tracers 465 (see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ order advection scheme. 466 This is particularly useful for passive tracers where 467 \emph{positivity} of the advection scheme is of paramount importance. 471 468 % give here the expression using the triads. It is different from the one given in \autoref{eq:ldfeiv} 472 469 % see just below a copy of this equation: … … 490 487 \end{equation} 491 488 492 \citep{Griffies_JPO98} introduces another way to implement the eddy induced advection, 493 the so-called skew form. It is based on a transformation of the advective fluxes 494 using the non-divergent nature of the eddy induced velocity. 495 For example in the (\textbf{i},\textbf{k}) plane, the tracer advective fluxes can be 496 transformed as follows: 489 \citep{Griffies_JPO98} introduces another way to implement the eddy induced advection, the so-called skew form. 490 It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity. 491 For example in the (\textbf{i},\textbf{k}) plane, the tracer advective fluxes can be transformed as follows: 497 492 \begin{flalign*} 498 493 \begin{split} … … 519 514 \end{split} 520 515 \end{flalign*} 521 and since the eddy induces velocity field is no-divergent, we end up with the skew522 form of the eddy induced advective fluxes:516 and since the eddy induces velocity field is no-divergent, 517 we end up with the skew form of the eddy induced advective fluxes: 523 518 \begin{equation} \label{eq:eiv_skew_continuous} 524 519 \textbf{F}_{eiv}^T = \begin{pmatrix} … … 527 522 \end{pmatrix} 528 523 \end{equation} 529 The tendency associated with eddy induced velocity is then simply the divergence 530 of the \autoref{eq:eiv_skew_continuous} fluxes. It naturally conserves the tracer 531 content, as it is expressed in flux form and, as the advective form, it preserve the 532 tracer variance. Another interesting property of \autoref{eq:eiv_skew_continuous} 533 form is that when $A=A_e$, a simplification occurs in the sum of the iso-neutral 534 diffusion and eddy induced velocity terms:524 The tendency associated with eddy induced velocity is then simply the divergence of 525 the \autoref{eq:eiv_skew_continuous} fluxes. 526 It naturally conserves the tracer content, as it is expressed in flux form and, 527 as the advective form, it preserves the tracer variance. 528 Another interesting property of \autoref{eq:eiv_skew_continuous} form is that when $A=A_e$, 529 a simplification occurs in the sum of the iso-neutral diffusion and eddy induced velocity terms: 535 530 \begin{flalign} \label{eq:eiv_skew+eiv_continuous} 536 531 \textbf{F}_{iso}^T + \textbf{F}_{eiv}^T &= … … 549 544 \end{pmatrix} 550 545 \end{flalign} 551 The horizontal component reduces to the one use for an horizontal laplacian 552 operator and the vertical one keep the same complexity, but not more. This property 553 has been used to reduce the computational time \citep{Griffies_JPO98}, but it is 554 not of practical use as usually $A \neq A_e$. Nevertheless this property can be used to 555 choose a discret form of \autoref{eq:eiv_skew_continuous} which is consistent with the 556 is o-neutral operator \autoref{eq:Gf_operator}. Using the slopes \autoref{eq:Gf_slopes}557 and defining $A_e$ at $T$-point($i.e.$ as $A$, the eddy diffusivity coefficient),558 the resulting discret form is given by:546 The horizontal component reduces to the one use for an horizontal laplacian operator and 547 the vertical one keeps the same complexity, but not more. 548 This property has been used to reduce the computational time \citep{Griffies_JPO98}, 549 but it is not of practical use as usually $A \neq A_e$. 550 Nevertheless this property can be used to choose a discret form of \autoref{eq:eiv_skew_continuous} which 551 is consistent with the iso-neutral operator \autoref{eq:Gf_operator}. 552 Using the slopes \autoref{eq:Gf_slopes} and defining $A_e$ at $T$-point($i.e.$ as $A$, 553 the eddy diffusivity coefficient), the resulting discret form is given by: 559 554 \begin{equation} \label{eq:eiv_skew} 560 555 \textbf{F}_{eiv}^T \equiv \frac{1}{4} \left( \begin{aligned} … … 569 564 \end{equation} 570 565 Note that \autoref{eq:eiv_skew} is valid in $z$-coordinate with or without partial cells. 571 In $z^*$ or $s$-coordinate, the slope between the level and the geopotential surfaces 572 must be added to$\mathbb{R}$ for the discret form to be exact.573 574 Such a choice of discretisation is consistent with the iso-neutral operator as it uses the575 same definition for the slopes. It also ensures the conservation of the tracer variance 576 (see Appendix \autoref{apdx:eiv_skew}), $i.e.$ it does not include a diffusive component 577 but is a "pure" advection term.566 In $z^*$ or $s$-coordinate, the slope between the level and the geopotential surfaces must be added to 567 $\mathbb{R}$ for the discret form to be exact. 568 569 Such a choice of discretisation is consistent with the iso-neutral operator as 570 it uses the same definition for the slopes. 571 It also ensures the conservation of the tracer variance (see Appendix \autoref{apdx:eiv_skew}), 572 $i.e.$ it does not include a diffusive component but is a "pure" advection term. 578 573 579 574 … … 591 586 This part will be moved in an Appendix. 592 587 593 The continuous property to be demonstrated is 588 The continuous property to be demonstrated is: 594 589 \begin{align*} 595 590 \int_D D_l^T \; T \;dv \leq 0 … … 642 637 % 643 638 \allowdisplaybreaks 644 \intertext{The summation is done over all $i$ and $k$ indices, it is therefore possible to introduce a shift of $-1$ either in $i$ or $k$ direction in order to regroup all the terms of the summation by triad at a ($i$,$k$) point. In other words, we regroup all the terms in the neighbourhood that contain a triad at the same ($i$,$k$) indices. It becomes: } 639 \intertext{The summation is done over all $i$ and $k$ indices, 640 it is therefore possible to introduce a shift of $-1$ either in $i$ or $k$ direction in order to 641 regroup all the terms of the summation by triad at a ($i$,$k$) point. 642 In other words, we regroup all the terms in the neighbourhood that contain a triad at the same ($i$,$k$) indices. 643 It becomes: } 645 644 % 646 645 &\equiv -\sum_{i,k} … … 672 671 % 673 672 \allowdisplaybreaks 674 \intertext{Then outing in factor the triad in each of the four terms of the summation and substituting the triads by their expression given in \autoref{eq:Gf_triads}. It becomes: } 673 \intertext{Then outing in factor the triad in each of the four terms of the summation and 674 substituting the triads by their expression given in \autoref{eq:Gf_triads}. 675 It becomes: } 675 676 % 676 677 &\equiv -\sum_{i,k} … … 710 711 The last inequality is obviously obtained as we succeed in obtaining a negative summation of square quantities. 711 712 712 Note that, if instead of multiplying $D_l^T$ by $T$, we were using another tracer field, let say $S$, then the previous demonstration would have let to: 713 Note that, if instead of multiplying $D_l^T$ by $T$, we were using another tracer field, let say $S$, 714 then the previous demonstration would have let to: 713 715 \begin{align*} 714 716 \int_D S \; D_l^T \;dv &\equiv \sum_{i,k} \left\{ S \ D_l^T \ b_T \right\} \\ … … 729 731 &\equiv \sum_{i,k} \left\{ D_l^S \ T \ b_T \right\} 730 732 \end{align*} 731 This means that the iso-neutral operator is self-adjoint. There is no need to develop a specific to obtain it. 733 This means that the iso-neutral operator is self-adjoint. 734 There is no need to develop a specific to obtain it. 732 735 733 736 … … 745 748 This have to be moved in an Appendix. 746 749 747 The continuous property to be demonstrated is 750 The continuous property to be demonstrated is: 748 751 \begin{align*} 749 752 \int_D \nabla \cdot \textbf{F}_{eiv}(T) \; T \;dv \equiv 0 … … 797 800 \end{matrix} 798 801 \end{align*} 799 The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{+1/2}}$ are the 800 same but of opposite signs,they cancel out.801 Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{-1/2}}$. 802 The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{-1/2}}$ are the 803 s ame but both of opposite signs and shifted by 1 in $k$ direction. When summing over $k$804 they cancel out with the neighbouring grid points. 805 Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{+1/2}}$ in the 806 $i$ direction. Therefore the sum over the domain is zero, $i.e.$ the variance of the 807 tracer is preserved by the discretisation of the skew fluxes.802 The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{+1/2}}$ are the same but of opposite signs, 803 they cancel out. 804 Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{-1/2}}$. 805 The two terms associated with the triad ${_i^k \mathbb{R}_{+1/2}^{-1/2}}$ are the same but both of opposite signs and 806 shifted by 1 in $k$ direction. 807 When summing over $k$ they cancel out with the neighbouring grid points. 808 Exactly the same thing occurs for the triad ${_i^k \mathbb{R}_{-1/2}^{+1/2}}$ in the $i$ direction. 809 Therefore the sum over the domain is zero, 810 $i.e.$ the variance of the tracer is preserved by the discretisation of the skew fluxes. 808 811 809 812 \end{document} -
NEMO/trunk/doc/latex/NEMO/subfiles/annex_iso.tex
r10146 r10354 15 15 %--------------------------------------------------------------------------------------------------------- 16 16 17 Two scheme are available to perform the iso-neutral diffusion. 18 If the namelist logical \np{ln\_traldf\_triad} is set true, 19 \NEMO updates both active and passive tracers using the Griffies triad representation 20 of iso-neutral diffusion and the eddy-induced advective skew (GM) fluxes. 21 If the namelist logical \np{ln\_traldf\_iso} is set true, 22 the filtered version of Cox's original scheme (the Standard scheme) is employed (\autoref{sec:LDF_slp}). 23 In the present implementation of the Griffies scheme, 17 Two scheme are available to perform the iso-neutral diffusion. 18 If the namelist logical \np{ln\_traldf\_triad} is set true, 19 \NEMO updates both active and passive tracers using the Griffies triad representation of iso-neutral diffusion and 20 the eddy-induced advective skew (GM) fluxes. 21 If the namelist logical \np{ln\_traldf\_iso} is set true, 22 the filtered version of Cox's original scheme (the Standard scheme) is employed (\autoref{sec:LDF_slp}). 23 In the present implementation of the Griffies scheme, 24 24 the advective skew fluxes are implemented even if \np{ln\_traldf\_eiv} is false. 25 25 26 Values of iso-neutral diffusivity and GM coefficient are set as 27 described in \autoref{sec:LDF_coef}. Note that when GM fluxes are used, 28 the eddy-advective (GM) velocities are output for diagnostic purposes using xIOS, 26 Values of iso-neutral diffusivity and GM coefficient are set as described in \autoref{sec:LDF_coef}. 27 Note that when GM fluxes are used, the eddy-advective (GM) velocities are output for diagnostic purposes using xIOS, 29 28 even though the eddy advection is accomplished by means of the skew fluxes. 30 29 … … 32 31 The options specific to the Griffies scheme include: 33 32 \begin{description}[font=\normalfont] 34 \item[\np{ln\_triad\_iso}] See \autoref{sec:taper}. If this is set false (the default), then 35 `iso-neutral' mixing is accomplished within the surface mixed-layer 36 along slopes linearly decreasing with depth from the value immediately below 37 the mixed-layer to zero (flat) at the surface (\autoref{sec:lintaper}). 38 This is the same treatment as used in the default implementation \autoref{subsec:LDF_slp_iso}; \autoref{fig:eiv_slp}. 39 Where \np{ln\_triad\_iso} is set true, the vertical skew flux is further reduced 40 to ensure no vertical buoyancy flux, giving an almost pure 41 horizontal diffusive tracer flux within the mixed layer. This is similar to 42 the tapering suggested by \citet{Gerdes1991}. See \autoref{subsec:Gerdes-taper} 43 \item[\np{ln\_botmix\_triad}] See \autoref{sec:iso_bdry}. 33 \item[\np{ln\_triad\_iso}] 34 See \autoref{sec:taper}. 35 If this is set false (the default), 36 then `iso-neutral' mixing is accomplished within the surface mixed-layer along slopes linearly decreasing with 37 depth from the value immediately below the mixed-layer to zero (flat) at the surface (\autoref{sec:lintaper}). 38 This is the same treatment as used in the default implementation 39 \autoref{subsec:LDF_slp_iso}; \autoref{fig:eiv_slp}. 40 Where \np{ln\_triad\_iso} is set true, 41 the vertical skew flux is further reduced to ensure no vertical buoyancy flux, 42 giving an almost pure horizontal diffusive tracer flux within the mixed layer. 43 This is similar to the tapering suggested by \citet{Gerdes1991}. See \autoref{subsec:Gerdes-taper} 44 \item[\np{ln\_botmix\_triad}] 45 See \autoref{sec:iso_bdry}. 44 46 If this is set false (the default) then the lateral diffusive fluxes 45 47 associated with triads partly masked by topography are neglected. 46 48 If it is set true, however, then these lateral diffusive fluxes are applied, 47 49 giving smoother bottom tracer fields at the cost of introducing diapycnal mixing. 48 \item[\np{rn\_sw\_triad}] blah blah to be added.... 50 \item[\np{rn\_sw\_triad}] 51 blah blah to be added.... 49 52 \end{description} 50 53 The options shared with the Standard scheme include: … … 56 59 \section{Triad formulation of iso-neutral diffusion} 57 60 \label{sec:iso} 58 We have implemented into \NEMO a scheme inspired by \citet{Griffies_al_JPO98}, 61 We have implemented into \NEMO a scheme inspired by \citet{Griffies_al_JPO98}, 59 62 but formulated within the \NEMO framework, using scale factors rather than grid-sizes. 60 63 61 64 \subsection{Iso-neutral diffusion operator} 62 The iso-neutral second order tracer diffusive operator for small 63 angles between iso-neutral surfaces and geopotentials is given by 64 \autoref{eq:iso_tensor_1}: 65 The iso-neutral second order tracer diffusive operator for small angles between 66 iso-neutral surfaces and geopotentials is given by \autoref{eq:iso_tensor_1}: 65 67 \begin{subequations} \label{eq:iso_tensor_1} 66 68 \begin{equation} … … 94 96 % {-r_1 } \hfill & {-r_2 } \hfill & {r_1 ^2+r_2 ^2} \hfill \\ 95 97 % \end{array} }} \right) 96 98 Here \autoref{eq:PE_iso_slopes} 97 99 \begin{align*} 98 100 r_1 &=-\frac{e_3 }{e_1 } \left( \frac{\partial \rho }{\partial i} … … 104 106 }{\partial k} \right)^{-1} 105 107 \end{align*} 106 is the $i$-component of the slope of the iso-neutral surface relative to the computational 107 surface, and $r_2$ is the $j$-component. 108 109 We will find it useful to consider the fluxes per unit area in $i,j,k$ 110 space; we write 108 is the $i$-component of the slope of the iso-neutral surface relative to the computational surface, 109 and $r_2$ is the $j$-component. 110 111 We will find it useful to consider the fluxes per unit area in $i,j,k$ space; we write 111 112 \begin{equation} 112 113 \label{eq:Fijk} 113 114 \vect{F}_{\mathrm{iso}}=\left(f_1^{lT}e_2e_3, f_2^{lT}e_1e_3, f_3^{lT}e_1e_2\right). 114 115 \end{equation} 115 Additionally, we will sometimes write the contributions towards the 116 fluxes $\vect{f}$ and $\vect{F}_{\mathrm{iso}}$ from the component 117 $R_{ij}$ of $\Re$ as $f_{ij}$, $F_{\mathrm{iso}\: ij}$, with 118 $f_{ij}=R_{ij}e_i^{-1}\partial T/\partial x_i$ (no summation) etc. 116 Additionally, we will sometimes write the contributions towards the fluxes $\vect{f}$ and 117 $\vect{F}_{\mathrm{iso}}$ from the component $R_{ij}$ of $\Re$ as $f_{ij}$, $F_{\mathrm{iso}\: ij}$, 118 with $f_{ij}=R_{ij}e_i^{-1}\partial T/\partial x_i$ (no summation) etc. 119 119 120 120 The off-diagonal terms of the small angle diffusion tensor 121 \autoref{eq:iso_tensor_1}, \autoref{eq:iso_tensor_2} produce skew-fluxes along the122 $i$- and $j$-directions resulting from the vertical tracer gradient:121 \autoref{eq:iso_tensor_1}, \autoref{eq:iso_tensor_2} produce skew-fluxes along 122 the $i$- and $j$-directions resulting from the vertical tracer gradient: 123 123 \begin{align} 124 124 \label{eq:i13c} … … 129 129 \end{align} 130 130 131 The vertical diffusive flux associated with the $_{33}$ 132 component of the small angle diffusion tensor is 131 The vertical diffusive flux associated with the $_{33}$ component of the small angle diffusion tensor is 133 132 \begin{equation} 134 133 \label{eq:i33c} … … 136 135 \end{equation} 137 136 138 Since there are no cross terms involving $r_1$ and $r_2$ in the above, we can 139 consider the iso-neutral diffusive fluxes separately in the $i$-$k$ and $j$-$k$ 140 planes, just adding together the vertical components from each 141 plane. The following description will describe the fluxes on the $i$-$k$ 142 plane. 143 144 There is no natural discretization for the $i$-component of the 145 skew-flux, \autoref{eq:i13c}, as 146 although it must be evaluated at $u$-points, it involves vertical 147 gradients (both for the tracer and the slope $r_1$), defined at 148 $w$-points. Similarly, the vertical skew flux, \autoref{eq:i31c}, is evaluated at 149 $w$-points but involves horizontal gradients defined at $u$-points. 137 Since there are no cross terms involving $r_1$ and $r_2$ in the above, 138 we can consider the iso-neutral diffusive fluxes separately in the $i$-$k$ and $j$-$k$ planes, 139 just adding together the vertical components from each plane. 140 The following description will describe the fluxes on the $i$-$k$ plane. 141 142 There is no natural discretization for the $i$-component of the skew-flux, \autoref{eq:i13c}, 143 as although it must be evaluated at $u$-points, 144 it involves vertical gradients (both for the tracer and the slope $r_1$), defined at $w$-points. 145 Similarly, the vertical skew flux, \autoref{eq:i31c}, 146 is evaluated at $w$-points but involves horizontal gradients defined at $u$-points. 150 147 151 148 \subsection{Standard discretization} 152 149 The straightforward approach to discretize the lateral skew flux 153 \autoref{eq:i13c} from tracer cell $i,k$ to $i+1,k$, introduced in 1995 154 into OPA, \autoref{eq:tra_ldf_iso}, is to calculate a mean vertical 155 gradient at the $u$-point from the average of the four surrounding 156 vertical tracer gradients, and multiply this by a mean slope at the 157 $u$-point, calculated from the averaged surrounding vertical density 158 gradients. The total area-integrated skew-flux (flux per unit area in 159 $ijk$ space) from tracer cell $i,k$ 160 to $i+1,k$, noting that the $e_{{3}_{i+1/2}^k}$ in the area 161 $e{_{3}}_{i+1/2}^k{e_{2}}_{i+1/2}i^k$ at the $u$-point cancels out with 162 the $1/{e_{3}}_{i+1/2}^k$ associated with the vertical tracer 163 gradient, is then \autoref{eq:tra_ldf_iso} 150 \autoref{eq:i13c} from tracer cell $i,k$ to $i+1,k$, introduced in 1995 into OPA, 151 \autoref{eq:tra_ldf_iso}, is to calculate a mean vertical gradient at the $u$-point from 152 the average of the four surrounding vertical tracer gradients, and multiply this by a mean slope at the $u$-point, 153 calculated from the averaged surrounding vertical density gradients. 154 The total area-integrated skew-flux (flux per unit area in $ijk$ space) from tracer cell $i,k$ to $i+1,k$, 155 noting that the $e_{{3}_{i+1/2}^k}$ in the area $e{_{3}}_{i+1/2}^k{e_{2}}_{i+1/2}i^k$ at the $u$-point cancels out with 156 the $1/{e_{3}}_{i+1/2}^k$ associated with the vertical tracer gradient, is then \autoref{eq:tra_ldf_iso} 164 157 \begin{equation*} 165 158 \left(F_u^{13} \right)_{i+\hhalf}^k = \Alts_{i+\hhalf}^k … … 173 166 \frac{\delta_{i+1/2} [\rho]}{\overline{\overline{\delta_k \rho}}^{\,i,k}}, 174 167 \end{equation*} 175 and here and in the following we drop the $^{lT}$ superscript from 176 $\Alt$ for simplicity. 177 Unfortunately the resulting combination $\overline{\overline{\delta_k 178 \bullet}}^{\,i,k}$ of a $k$ average and a $k$ difference %of the tracer 179 reduces to $\bullet_{k+1}-\bullet_{k-1}$, so two-grid-point oscillations are 180 invisible to this discretization of the iso-neutral operator. These 181 \emph{computational modes} will not be damped by this operator, and 182 may even possibly be amplified by it. Consequently, applying this 183 operator to a tracer does not guarantee the decrease of its 184 global-average variance. To correct this, we introduced a smoothing of 185 the slopes of the iso-neutral surfaces (see \autoref{chap:LDF}). This 186 technique works for $T$ and $S$ in so far as they are active tracers 187 ($i.e.$ they enter the computation of density), but it does not work 188 for a passive tracer. 168 and here and in the following we drop the $^{lT}$ superscript from $\Alt$ for simplicity. 169 Unfortunately the resulting combination $\overline{\overline{\delta_k\bullet}}^{\,i,k}$ of a $k$ average and 170 a $k$ difference of the tracer reduces to $\bullet_{k+1}-\bullet_{k-1}$, 171 so two-grid-point oscillations are invisible to this discretization of the iso-neutral operator. 172 These \emph{computational modes} will not be damped by this operator, and may even possibly be amplified by it. 173 Consequently, applying this operator to a tracer does not guarantee the decrease of its global-average variance. 174 To correct this, we introduced a smoothing of the slopes of the iso-neutral surfaces (see \autoref{chap:LDF}). 175 This technique works for $T$ and $S$ in so far as they are active tracers 176 ($i.e.$ they enter the computation of density), but it does not work for a passive tracer. 189 177 190 178 \subsection{Expression of the skew-flux in terms of triad slopes} 191 \citep{Griffies_al_JPO98} introduce a different discretization of the 192 off-diagonal terms thatnicely solves the problem.179 \citep{Griffies_al_JPO98} introduce a different discretization of the off-diagonal terms that 180 nicely solves the problem. 193 181 % Instead of multiplying the mean slope calculated at the $u$-point by 194 182 % the mean vertical gradient at the $u$-point, … … 203 191 \end{center} \end{figure} 204 192 % >>>>>>>>>>>>>>>>>>>>>>>>>>>> 205 They get the skew flux from the products of the vertical gradients at 206 each $w$-point surrounding the $u$-point with the corresponding `triad' 207 slope calculated from the lateral density gradient across the $u$-point 208 divided by the vertical density gradient at the same $w$-point as the 209 tracer gradient. See \autoref{fig:ISO_triad}a, where the thick lines 210 denote the tracer gradients, and the thin lines the corresponding 211 triads, with slopes $s_1, \dotsc s_4$. The total area-integrated 212 skew-flux from tracer cell $i,k$ to $i+1,k$ 193 They get the skew flux from the products of the vertical gradients at each $w$-point surrounding the $u$-point with 194 the corresponding `triad' slope calculated from the lateral density gradient across the $u$-point divided by 195 the vertical density gradient at the same $w$-point as the tracer gradient. 196 See \autoref{fig:ISO_triad}a, where the thick lines denote the tracer gradients, 197 and the thin lines the corresponding triads, with slopes $s_1, \dotsc s_4$. 198 The total area-integrated skew-flux from tracer cell $i,k$ to $i+1,k$ 213 199 \begin{multline} 214 200 \label{eq:i13} … … 222 208 _{k-\frac{1}{2}} \left[ T^i \right]/e_{{3w}_{i+1}}^{k+\frac{1}{2}}, 223 209 \end{multline} 224 where the contributions of the triad fluxes are weighted by areas 225 $a_1, \dotsc a_4$, and $\Alts$ is now defined at the tracer points 226 rather than the $u$-points. This discretization gives a much closer 227 stencil, and disallows the two-point computational modes. 228 229 The vertical skew flux \autoref{eq:i31c} from tracer cell $i,k$ to $i,k+1$ at the 230 $w$-point $i,k+\hhalf$ is constructed similarly (\autoref{fig:ISO_triad}b) 231 by multiplying lateral tracer gradients from each of the four 232 surrounding $u$-points by the appropriate triad slope: 210 where the contributions of the triad fluxes are weighted by areas $a_1, \dotsc a_4$, 211 and $\Alts$ is now defined at the tracer points rather than the $u$-points. 212 This discretization gives a much closer stencil, and disallows the two-point computational modes. 213 214 The vertical skew flux \autoref{eq:i31c} from tracer cell $i,k$ to $i,k+1$ at 215 the $w$-point $i,k+\hhalf$ is constructed similarly (\autoref{fig:ISO_triad}b) by 216 multiplying lateral tracer gradients from each of the four surrounding $u$-points by the appropriate triad slope: 233 217 \begin{multline} 234 218 \label{eq:i31} … … 241 225 242 226 We notate the triad slopes $s_i$ and $s'_i$ in terms of the `anchor point' $i,k$ 243 (appearing in both the vertical and lateral gradient), and the $u$- and244 $w$-points $(i+i_p,k)$, $(i,k+k_p)$ at the centres of the `arms' of the 245 triad as follows(see also \autoref{fig:ISO_triad}):227 (appearing in both the vertical and lateral gradient), 228 and the $u$- and $w$-points $(i+i_p,k)$, $(i,k+k_p)$ at the centres of the `arms' of the triad as follows 229 (see also \autoref{fig:ISO_triad}): 246 230 \begin{equation} 247 231 \label{eq:R} … … 253 237 { \alpha_i^k \ \delta_{k+k_p}[T^i] - \beta_i^k \ \delta_{k+k_p}[S^i] }. 254 238 \end{equation} 255 In calculating the slopes of the local neutral surfaces, 256 the expansion coefficients $\alpha$ and $\beta$ are evaluated at the anchor points of the triad, 239 In calculating the slopes of the local neutral surfaces, 240 the expansion coefficients $\alpha$ and $\beta$ are evaluated at the anchor points of the triad, 257 241 while the metrics are calculated at the $u$- and $w$-points on the arms. 258 242 … … 261 245 \includegraphics[width=0.80\textwidth]{Fig_GRIFF_qcells} 262 246 \caption{ \protect\label{fig:qcells} 263 Triad notation for quarter cells. $T$-cells are inside264 boxes, while the $i+\half,k$ $u$-cell is shaded in green and the265 $i,k+\half$ $w$-cell is shaded in pink.}247 Triad notation for quarter cells. $T$-cells are inside boxes, 248 while the $i+\half,k$ $u$-cell is shaded in green and 249 the $i,k+\half$ $w$-cell is shaded in pink.} 266 250 \end{center} \end{figure} 267 251 % >>>>>>>>>>>>>>>>>>>>>>>>>>>> 268 252 269 Each triad $\{_i^{k}\:_{i_p}^{k_p}\}$ is associated (\autoref{fig:qcells}) with the quarter 270 cell that is the intersection of the $i,k$ $T$-cell, the $i+i_p,k$ $u$-cell and the $i,k+k_p$ $w$-cell. 271 Expressing the slopes $s_i$ and $s'_i$ in \autoref{eq:i13} and \autoref{eq:i31} in this notation, 272 we have $e.g.$ \ $s_1=s'_1={\:}_i^k \mathbb{R}_{1/2}^{1/2}$. 273 Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ is used once (as an $s$) 274 to calculate the lateral flux along its $u$-arm, at $(i+i_p,k)$, 275 and then again as an $s'$ to calculate the vertical flux along its $w$-arm at $(i,k+k_p)$. 276 Each vertical area $a_i$ used to calculate the lateral flux and horizontal area $a'_i$ used 277 to calculate the vertical flux can also be identified as the area across the $u$- and $w$-arms 278 of a unique triad, and we notate these areas, similarly to the triad slopes, 279 as $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$, $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$, 280 where $e.g.$ in \autoref{eq:i13} $a_{1}={\:}_i^k{\mathbb{A}_u}_{1/2}^{1/2}$, 253 Each triad $\{_i^{k}\:_{i_p}^{k_p}\}$ is associated (\autoref{fig:qcells}) with the quarter cell that is 254 the intersection of the $i,k$ $T$-cell, the $i+i_p,k$ $u$-cell and the $i,k+k_p$ $w$-cell. 255 Expressing the slopes $s_i$ and $s'_i$ in \autoref{eq:i13} and \autoref{eq:i31} in this notation, 256 we have $e.g.$ \ $s_1=s'_1={\:}_i^k \mathbb{R}_{1/2}^{1/2}$. 257 Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ is used once (as an $s$) to 258 calculate the lateral flux along its $u$-arm, at $(i+i_p,k)$, 259 and then again as an $s'$ to calculate the vertical flux along its $w$-arm at $(i,k+k_p)$. 260 Each vertical area $a_i$ used to calculate the lateral flux and horizontal area $a'_i$ used to 261 calculate the vertical flux can also be identified as the area across the $u$- and $w$-arms of a unique triad, 262 and we notate these areas, similarly to the triad slopes, 263 as $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$, $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$, 264 where $e.g.$ in \autoref{eq:i13} $a_{1}={\:}_i^k{\mathbb{A}_u}_{1/2}^{1/2}$, 281 265 and in \autoref{eq:i31} $a'_{1}={\:}_i^k{\mathbb{A}_w}_{1/2}^{1/2}$. 282 266 283 267 \subsection{Full triad fluxes} 284 A key property of iso-neutral diffusion is that it should not affect 285 the (locally referenced) density. In particular there should be no 286 lateral or vertical density flux. The lateral density flux disappears so long as the 287 area-integrated lateral diffusive flux from tracer cell $i,k$ to 288 $i+1,k$ coming from the $_{11}$ term of the diffusion tensor takes the 289 form 268 A key property of iso-neutral diffusion is that it should not affect the (locally referenced) density. 269 In particular there should be no lateral or vertical density flux. 270 The lateral density flux disappears so long as the area-integrated lateral diffusive flux from 271 tracer cell $i,k$ to $i+1,k$ coming from the $_{11}$ term of the diffusion tensor takes the form 290 272 \begin{equation} 291 273 \label{eq:i11} … … 295 277 \frac{\delta _{i+1/2} \left[ T^k\right]}{{e_{1u}}_{\,i+1/2}^{\,k}}, 296 278 \end{equation} 297 where the areas $a_i$ are as in \autoref{eq:i13}. In this case, 298 separating the total lateral flux, the sum of \autoref{eq:i13} and 299 \autoref{eq:i11}, into triad components, a lateral tracer 300 flux 279 where the areas $a_i$ are as in \autoref{eq:i13}. 280 In this case, separating the total lateral flux, the sum of \autoref{eq:i13} and \autoref{eq:i11}, 281 into triad components, a lateral tracer flux 301 282 \begin{equation} 302 283 \label{eq:latflux-triad} … … 308 289 \right) 309 290 \end{equation} 310 can be identified with each triad. Then, because the 311 same metric factors ${e_{3w}}_{\,i}^{\,k+k_p}$ and 312 ${e_{1u}}_{\,i+i_p}^{\,k}$ are employed for both the density gradients 313 in $ _i^k \mathbb{R}_{i_p}^{k_p}$ and the tracer gradients, the lateral 314 density flux associated with each triad separately disappears. 291 can be identified with each triad. 292 Then, because the same metric factors ${e_{3w}}_{\,i}^{\,k+k_p}$ and ${e_{1u}}_{\,i+i_p}^{\,k}$ are employed for both 293 the density gradients in $ _i^k \mathbb{R}_{i_p}^{k_p}$ and the tracer gradients, 294 the lateral density flux associated with each triad separately disappears. 315 295 \begin{equation} 316 296 \label{eq:latflux-rho} 317 297 {\mathbb{F}_u}_{i_p}^{k_p} (\rho)=-\alpha _i^k {\:}_i^k {\mathbb{F}_u}_{i_p}^{k_p} (T) + \beta_i^k {\:}_i^k {\mathbb{F}_u}_{i_p}^{k_p} (S)=0 318 298 \end{equation} 319 Thus the total flux $\left( F_u^{31} \right) ^i _{i,k+\frac{1}{2}} + 320 \left( F_u^{11} \right) ^i _{i,k+\frac{1}{2}}$ from tracer cell $i,k$ 321 to $i+1,k$ must also vanish since it is a sum of four such triad fluxes. 322 323 The squared slope $r_1^2$ in the expression \autoref{eq:i33c} for the 324 $_{33}$ component is also expressed in terms of area-weighted 325 squared triad slopes, so the area-integrated vertical flux from tracer 326 cell $i,k$ to $i,k+1$ resulting from the $r_1^2$ term is 299 Thus the total flux $\left( F_u^{31} \right) ^i _{i,k+\frac{1}{2}} + \left( F_u^{11} \right) ^i _{i,k+\frac{1}{2}}$ from 300 tracer cell $i,k$ to $i+1,k$ must also vanish since it is a sum of four such triad fluxes. 301 302 The squared slope $r_1^2$ in the expression \autoref{eq:i33c} for the $_{33}$ component is also expressed in 303 terms of area-weighted squared triad slopes, 304 so the area-integrated vertical flux from tracer cell $i,k$ to $i,k+1$ resulting from the $r_1^2$ term is 327 305 \begin{equation} 328 306 \label{eq:i33} … … 333 311 + \Alts_i^k a_{4}' s_{4}'^2 \right)\delta_{k+\frac{1}{2}} \left[ T^{i+1} \right], 334 312 \end{equation} 335 where the areas $a'$ and slopes $s'$ are the same as in 336 \autoref{eq:i31}. 337 Then, separating the total vertical flux, the sum of \autoref{eq:i31} and 338 \autoref{eq:i33}, into triad components, a vertical flux 313 where the areas $a'$ and slopes $s'$ are the same as in \autoref{eq:i31}. 314 Then, separating the total vertical flux, the sum of \autoref{eq:i31} and \autoref{eq:i33}, 315 into triad components, a vertical flux 339 316 \begin{align} 340 317 \label{eq:vertflux-triad} … … 349 326 {_i^k\mathbb{R}_{i_p}^{k_p}}{\: }_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T) \label{eq:vertflux-triad2} 350 327 \end{align} 351 may be associated with each triad. Each vertical density flux $_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)$ 352 associated with a triad then separately disappears (because the 353 lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (\rho)$ 354 disappears). Consequently the total vertical density flux $\left( F_w^{31} \right)_i ^{k+\frac{1}{2}} + 355 \left( F_w^{33} \right)_i^{k+\frac{1}{2}}$ from tracer cell $i,k$ 356 to $i,k+1$ must also vanish since it is a sum of four such triad 357 fluxes. 358 359 We can explicitly identify (\autoref{fig:qcells}) the triads associated with the $s_i$, $a_i$, and $s'_i$, $a'_i$ used in the definition of 360 the $u$-fluxes and $w$-fluxes in 361 \autoref{eq:i31}, \autoref{eq:i13}, \autoref{eq:i11} \autoref{eq:i33} and 362 \autoref{fig:ISO_triad} to write out the iso-neutral fluxes at $u$- and 363 $w$-points as sums of the triad fluxes that cross the $u$- and $w$-faces: 328 may be associated with each triad. 329 Each vertical density flux $_i^k {\mathbb{F}_w}_{i_p}^{k_p} (\rho)$ associated with a triad then 330 separately disappears (because the lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (\rho)$ disappears). 331 Consequently the total vertical density flux 332 $\left( F_w^{31} \right)_i ^{k+\frac{1}{2}} + \left( F_w^{33} \right)_i^{k+\frac{1}{2}}$ from 333 tracer cell $i,k$ to $i,k+1$ must also vanish since it is a sum of four such triad fluxes. 334 335 We can explicitly identify (\autoref{fig:qcells}) the triads associated with the $s_i$, $a_i$, 336 and $s'_i$, $a'_i$ used in the definition of the $u$-fluxes and $w$-fluxes in \autoref{eq:i31}, 337 \autoref{eq:i13}, \autoref{eq:i11} \autoref{eq:i33} and \autoref{fig:ISO_triad} to write out 338 the iso-neutral fluxes at $u$- and $w$-points as sums of the triad fluxes that cross the $u$- and $w$-faces: 364 339 %(\autoref{fig:ISO_triad}): 365 340 \begin{flalign} \label{eq:iso_flux} \vect{F}_{\mathrm{iso}}(T) &\equiv … … 375 350 \label{subsec:variance} 376 351 377 We now require that this operator should not increase the 378 globally-integrated tracer variance. 352 We now require that this operator should not increase the globally-integrated tracer variance. 379 353 %This changes according to 380 354 % \begin{align*} … … 387 361 % + {_i^{k+1/2-k_p} {\mathbb{F}_w}_{i_p}^{k_p}} \ \delta_{k+1/2} [T] \right\} \\ 388 362 % \end{align*} 389 Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ drives a lateral flux 390 $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ across the $u$-point $i+i_p,k$ and 391 a vertical flux $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ across the 392 $w$-point $i,k+k_p$. The lateral flux drives a net rate of change of 393 variance, summed over the two $T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of 363 Each triad slope $_i^k\mathbb{R}_{i_p}^{k_p}$ drives a lateral flux $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ across 364 the $u$-point $i+i_p,k$ and a vertical flux $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ across the $w$-point $i,k+k_p$. 365 The lateral flux drives a net rate of change of variance, 366 summed over the two $T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of 394 367 \begin{multline} 395 368 {b_T}_{i+i_p-1/2}^k\left(\frac{\partial T}{\partial t}T\right)_{i+i_p-1/2}^k+ … … 402 375 \end{aligned} 403 376 \end{multline} 404 while the vertical flux similarly drives a net rate of change of 405 variance summed over the $T$-points $i,k+k_p-\half$ (above) and 406 $i,k+k_p+\half$ (below) of 377 while the vertical flux similarly drives a net rate of change of variance summed over 378 the $T$-points $i,k+k_p-\half$ (above) and $i,k+k_p+\half$ (below) of 407 379 \begin{equation} 408 380 \label{eq:dvar_iso_k} 409 381 _i^k{\mathbb{F}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i]. 410 382 \end{equation} 411 The total variance tendency driven by the triad is the sum of these 412 two. Expanding $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ and 413 $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ with \autoref{eq:latflux-triad} and 414 \autoref{eq:vertflux-triad}, it is 383 The total variance tendency driven by the triad is the sum of these two. 384 Expanding $_i^k{\mathbb{F}_u}_{i_p}^{k_p} (T)$ and $_i^k{\mathbb{F}_w}_{i_p}^{k_p} (T)$ with 385 \autoref{eq:latflux-triad} and \autoref{eq:vertflux-triad}, it is 415 386 \begin{multline*} 416 387 -\Alts_i^k\left \{ … … 428 399 \right \}. 429 400 \end{multline*} 430 The key point is then that if we require 431 $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$ and $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$ 432 to be related to a triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$ by 401 The key point is then that if we require $_i^k{\mathbb{A}_u}_{i_p}^{k_p}$ and $_i^k{\mathbb{A}_w}_{i_p}^{k_p}$ to 402 be related to a triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$ by 433 403 \begin{equation} 434 404 \label{eq:V-A} … … 447 417 \right)^2\leq 0. 448 418 \end{equation} 449 Thus, the constraint \autoref{eq:V-A} ensures that the fluxes (\autoref{eq:latflux-triad}, \autoref{eq:vertflux-triad}) associated 450 with a given slope triad $_i^k\mathbb{R}_{i_p}^{k_p}$ do not increase 451 the net variance. Since the total fluxes are sums of such fluxes from 452 the various triads, this constraint, applied to all triads, is 453 sufficient to ensure that the globally integrated variance does not 454 increase. 455 456 The expression \autoref{eq:V-A} can be interpreted as a discretization 457 of the global integral 419 Thus, the constraint \autoref{eq:V-A} ensures that the fluxes 420 (\autoref{eq:latflux-triad}, \autoref{eq:vertflux-triad}) associated with 421 a given slope triad $_i^k\mathbb{R}_{i_p}^{k_p}$ do not increase the net variance. 422 Since the total fluxes are sums of such fluxes from the various triads, this constraint, applied to all triads, 423 is sufficient to ensure that the globally integrated variance does not increase. 424 425 The expression \autoref{eq:V-A} can be interpreted as a discretization of the global integral 458 426 \begin{equation} 459 427 \label{eq:cts-var} … … 461 429 \int\!\mathbf{F}\cdot\nabla T\, dV, 462 430 \end{equation} 463 where, within each triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$, the 464 lateral and vertical fluxes/unit area 431 where, within each triad volume $_i^k\mathbb{V}_{i_p}^{k_p}$, the lateral and vertical fluxes/unit area 465 432 \[ 466 433 \mathbf{F}=\left( … … 477 444 478 445 \subsection{Triad volumes in Griffes's scheme and in \NEMO} 479 To complete the discretization we now need only specify the triad 480 volumes $_i^k\mathbb{V}_{i_p}^{k_p}$. \citet{Griffies_al_JPO98} identify 481 these $_i^k\mathbb{V}_{i_p}^{k_p}$ as the volumes of the quarter 482 cells, defined in terms of the distances between $T$, $u$,$f$ and 483 $w$-points. This is the natural discretization of 484 \autoref{eq:cts-var}. The \NEMO model, however, operates with scale 485 factors instead of grid sizes, and scale factors for the quarter 486 cells are not defined. Instead, therefore we simply choose 446 To complete the discretization we now need only specify the triad volumes $_i^k\mathbb{V}_{i_p}^{k_p}$. 447 \citet{Griffies_al_JPO98} identifies these $_i^k\mathbb{V}_{i_p}^{k_p}$ as the volumes of the quarter cells, 448 defined in terms of the distances between $T$, $u$,$f$ and $w$-points. 449 This is the natural discretization of \autoref{eq:cts-var}. 450 The \NEMO model, however, operates with scale factors instead of grid sizes, 451 and scale factors for the quarter cells are not defined. 452 Instead, therefore we simply choose 487 453 \begin{equation} 488 454 \label{eq:V-NEMO} 489 455 _i^k\mathbb{V}_{i_p}^{k_p}=\quarter {b_u}_{i+i_p}^k, 490 456 \end{equation} 491 as a quarter of the volume of the $u$-cell inside which the triad 492 quarter-cell lies. This has the nice property that when the slopes 493 $\mathbb{R}$ vanish, the lateral flux from tracer cell $i,k$ to 494 $i+1,k$ reduces to the classical form 457 as a quarter of the volume of the $u$-cell inside which the triad quarter-cell lies. 458 This has the nice property that when the slopes $\mathbb{R}$ vanish, 459 the lateral flux from tracer cell $i,k$ to $i+1,k$ reduces to the classical form 495 460 \begin{equation} 496 461 \label{eq:lat-normal} … … 500 465 = -\overline\Alts_{\,i+1/2}^k\;\frac{{e_{1w}}_{\,i + 1/2}^{\,k}\:{e_{1v}}_{\,i + 1/2}^{\,k}\;\delta_{i+ 1/2}[T^k]}{{e_{1u}}_{\,i + 1/2}^{\,k}}. 501 466 \end{equation} 502 In fact if the diffusive coefficient is defined at $u$-points, so that503 we employ $\Alts_{i+i_p}^k$ instead of $\Alts_i^k$ in the definitions of the 504 triad fluxes\autoref{eq:latflux-triad} and \autoref{eq:vertflux-triad},467 In fact if the diffusive coefficient is defined at $u$-points, 468 so that we employ $\Alts_{i+i_p}^k$ instead of $\Alts_i^k$ in the definitions of the triad fluxes 469 \autoref{eq:latflux-triad} and \autoref{eq:vertflux-triad}, 505 470 we can replace $\overline{A}_{\,i+1/2}^k$ by $A_{i+1/2}^k$ in the above. 506 471 507 472 \subsection{Summary of the scheme} 508 The iso-neutral fluxes at $u$- and 509 $w$-points are the sums of the triad fluxes that cross the $u$- and 510 $w$-faces \autoref{eq:iso_flux}: 473 The iso-neutral fluxes at $u$- and $w$-points are the sums of the triad fluxes that 474 cross the $u$- and $w$-faces \autoref{eq:iso_flux}: 511 475 \begin{subequations}\label{eq:alltriadflux} 512 476 \begin{flalign}\label{eq:vect_isoflux} … … 545 509 \end{subequations} 546 510 547 511 The divergence of the expression \autoref{eq:iso_flux} for the fluxes gives the iso-neutral diffusion tendency at 548 512 each tracer point: 549 513 \begin{equation} \label{eq:iso_operator} D_l^T = \frac{1}{b_T} … … 555 519 The diffusion scheme satisfies the following six properties: 556 520 \begin{description} 557 \item[$\bullet$ horizontal diffusion] The discretization of the558 diffusion operator recovers \autoref{eq:lat-normal} the traditional five-point Laplacian in559 the limit of flat iso-neutral direction:521 \item[$\bullet$ horizontal diffusion] 522 The discretization of the diffusion operator recovers the traditional five-point Laplacian 523 \autoref{eq:lat-normal} in the limit of flat iso-neutral direction: 560 524 \begin{equation} \label{eq:iso_property0} D_l^T = \frac{1}{b_T} \ 561 525 \delta_{i} \left[ \frac{e_{2u}\,e_{3u}}{e_{1u}} \; … … 564 528 \end{equation} 565 529 566 \item[$\bullet$ implicit treatment in the vertical] Only tracer values 567 associated with a single water column appear in the expression 568 \autoref{eq:i33} for the $_{33}$ fluxes, vertical fluxes driven by 569 vertical gradients. This is of paramount importance since it means 570 that a time-implicit algorithm can be used to solve the vertical 571 diffusion equation. This is necessary 572 since the vertical eddy 573 diffusivity associated with this term, 530 \item[$\bullet$ implicit treatment in the vertical] 531 Only tracer values associated with a single water column appear in the expression \autoref{eq:i33} for 532 the $_{33}$ fluxes, vertical fluxes driven by vertical gradients. 533 This is of paramount importance since it means that a time-implicit algorithm can be used to 534 solve the vertical diffusion equation. 535 This is necessary since the vertical eddy diffusivity associated with this term, 574 536 \begin{equation} 575 537 \frac{1}{b_w}\sum_{\substack{i_p, \,k_p}} \left\{ … … 579 541 {b_u}_{i+i_p}^k\: \Alts_i^k \: \left(_i^k \mathbb{R}_{i_p}^{k_p}\right)^2 580 542 \right\}, 581 \end{equation}543 \end{equation} 582 544 (where $b_w= e_{1w}\,e_{2w}\,e_{3w}$ is the volume of $w$-cells) can be quite large. 583 545 584 \item[$\bullet$ pure iso-neutral operator] The iso-neutral flux of585 locally referenced potential density is zero. See586 \autoref{eq:latflux-rho} and \autoref{eq:vertflux-triad2}.587 588 \item[$\bullet$ conservation of tracer] The iso-neutral diffusion589 conserves tracer content, $i.e.$546 \item[$\bullet$ pure iso-neutral operator] 547 The iso-neutral flux of locally referenced potential density is zero. 548 See \autoref{eq:latflux-rho} and \autoref{eq:vertflux-triad2}. 549 550 \item[$\bullet$ conservation of tracer] 551 The iso-neutral diffusion conserves tracer content, $i.e.$ 590 552 \begin{equation} \label{eq:iso_property1} \sum_{i,j,k} \left\{ D_l^T \ 591 553 b_T \right\} = 0 592 554 \end{equation} 593 This property is trivially satisfied since the iso-neutral diffusive 594 operator is written in flux form. 595 596 \item[$\bullet$ no increase of tracer variance] The iso-neutral diffusion 597 does not increase the tracer variance, $i.e.$ 555 This property is trivially satisfied since the iso-neutral diffusive operator is written in flux form. 556 557 \item[$\bullet$ no increase of tracer variance] 558 The iso-neutral diffusion does not increase the tracer variance, $i.e.$ 598 559 \begin{equation} \label{eq:iso_property2} \sum_{i,j,k} \left\{ T \ D_l^T 599 560 \ b_T \right\} \leq 0 600 561 \end{equation} 601 The property is demonstrated in 602 \autoref{subsec:variance} above. It is a key property for a diffusion 603 term. It means that it is also a dissipation term, $i.e.$ it 604 dissipates the square of the quantity on which it is applied. It 605 therefore ensures that, when the diffusivity coefficient is large 606 enough, the field on which it is applied becomes free of grid-point 607 noise. 608 609 \item[$\bullet$ self-adjoint operator] The iso-neutral diffusion 610 operator is self-adjoint, $i.e.$ 562 The property is demonstrated in \autoref{subsec:variance} above. 563 It is a key property for a diffusion term. 564 It means that it is also a dissipation term, 565 $i.e.$ it dissipates the square of the quantity on which it is applied. 566 It therefore ensures that, when the diffusivity coefficient is large enough, 567 the field on which it is applied becomes free of grid-point noise. 568 569 \item[$\bullet$ self-adjoint operator] 570 The iso-neutral diffusion operator is self-adjoint, $i.e.$ 611 571 \begin{equation} \label{eq:iso_property3} \sum_{i,j,k} \left\{ S \ D_l^T 612 572 \ b_T \right\} = \sum_{i,j,k} \left\{ D_l^S \ T \ b_T \right\} 613 573 \end{equation} 614 In other word, there is no need to develop a specific routine from 615 the adjoint of this operator. We just have to apply the same 616 routine. This property can be demonstrated similarly to the proof of 617 the `no increase of tracer variance' property. The contribution by a 618 single triad towards the left hand side of \autoref{eq:iso_property3}, can 619 be found by replacing $\delta[T]$ by $\delta[S]$ in \autoref{eq:dvar_iso_i} 620 and \autoref{eq:dvar_iso_k}. This results in a term similar to 621 \autoref{eq:perfect-square}, 574 In other word, there is no need to develop a specific routine from the adjoint of this operator. 575 We just have to apply the same routine. 576 This property can be demonstrated similarly to the proof of the `no increase of tracer variance' property. 577 The contribution by a single triad towards the left hand side of \autoref{eq:iso_property3}, 578 can be found by replacing $\delta[T]$ by $\delta[S]$ in \autoref{eq:dvar_iso_i} and \autoref{eq:dvar_iso_k}. 579 This results in a term similar to \autoref{eq:perfect-square}, 622 580 \begin{equation} 623 581 \label{eq:TScovar} … … 634 592 \right). 635 593 \end{equation} 636 This is symmetrical in $T $ and $S$, so exactly the same term arises 637 from the discretization of this triad's contribution towards the 638 RHS of \autoref{eq:iso_property3}. 594 This is symmetrical in $T $ and $S$, so exactly the same term arises from 595 the discretization of this triad's contribution towards the RHS of \autoref{eq:iso_property3}. 639 596 \end{description} 640 597 641 598 \subsection{Treatment of the triads at the boundaries}\label{sec:iso_bdry} 642 The triad slope can only be defined where both the grid boxes centred at 643 the end of the arms exist. Triads that would poke up 644 through the upper ocean surface into the atmosphere, or down into the 645 ocean floor, must be masked out. See \autoref{fig:bdry_triads}. Surface layer triads 646 $\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and 647 $\triad{i+1}{1}{R}{-1/2}{-1/2}$ (blue) that require density to be 648 specified above the ocean surface are masked (\autoref{fig:bdry_triads}a): this ensures that lateral 649 tracer gradients produce no flux through the ocean surface. However, 650 to prevent surface noise, it is customary to retain the $_{11}$ contributions towards 651 the lateral triad fluxes $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and 652 $\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$; this drives diapycnal tracer 653 fluxes. Similar comments apply to triads that would intersect the 654 ocean floor (\autoref{fig:bdry_triads}b). Note that both near bottom 655 triad slopes $\triad{i}{k}{R}{1/2}{1/2}$ and 656 $\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$ 657 or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ $u$-point is 658 masked. The associated lateral fluxes (grey-black dashed line) are 659 masked if \np{ln\_botmix\_triad}\forcode{ = .false.}, but left unmasked, 660 giving bottom mixing, if \np{ln\_botmix\_triad}\forcode{ = .true.}. 661 662 The default option \np{ln\_botmix\_triad}\forcode{ = .false.} is suitable when the 663 bbl mixing option is enabled (\key{trabbl}, with \np{nn\_bbl\_ldf}\forcode{ = 1}), 664 or for simple idealized problems. For setups with topography without 665 bbl mixing, \np{ln\_botmix\_triad}\forcode{ = .true.} may be necessary. 599 The triad slope can only be defined where both the grid boxes centred at the end of the arms exist. 600 Triads that would poke up through the upper ocean surface into the atmosphere, 601 or down into the ocean floor, must be masked out. 602 See \autoref{fig:bdry_triads}. 603 Surface layer triads $\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and $\triad{i+1}{1}{R}{-1/2}{-1/2}$ (blue) that 604 require density to be specified above the ocean surface are masked (\autoref{fig:bdry_triads}a): 605 this ensures that lateral tracer gradients produce no flux through the ocean surface. 606 However, to prevent surface noise, it is customary to retain the $_{11}$ contributions towards 607 the lateral triad fluxes $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and $\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$; 608 this drives diapycnal tracer fluxes. 609 Similar comments apply to triads that would intersect the ocean floor (\autoref{fig:bdry_triads}b). 610 Note that both near bottom triad slopes $\triad{i}{k}{R}{1/2}{1/2}$ and 611 $\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, 612 i.e.\ the $i,k+1$ $u$-point is masked. 613 The associated lateral fluxes (grey-black dashed line) are masked if \np{ln\_botmix\_triad}\forcode{ = .false.}, 614 but left unmasked, giving bottom mixing, if \np{ln\_botmix\_triad}\forcode{ = .true.}. 615 616 The default option \np{ln\_botmix\_triad}\forcode{ = .false.} is suitable when the bbl mixing option is enabled 617 (\key{trabbl}, with \np{nn\_bbl\_ldf}\forcode{ = 1}), or for simple idealized problems. 618 For setups with topography without bbl mixing, \np{ln\_botmix\_triad}\forcode{ = .true.} may be necessary. 666 619 % >>>>>>>>>>>>>>>>>>>>>>>>>>>> 667 620 \begin{figure}[h] \begin{center} 668 621 \includegraphics[width=0.60\textwidth]{Fig_GRIFF_bdry_triads} 669 622 \caption{ \protect\label{fig:bdry_triads} 670 (a) Uppermost model layer $k=1$ with $i,1$ and $i+1,1$ tracer 671 points (black dots), and $i+1/2,1$ $u$-point (blue square). Triad 672 slopes $\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and $\triad{i+1}{1}{R}{-1/2}{-1/2}$ 673 (blue) poking through the ocean surface are masked (faded in 674 figure). However, the lateral $_{11}$ contributions towards 675 $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and $\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$ 676 (yellow line) are still applied, giving diapycnal diffusive 677 fluxes.\newline 623 (a) Uppermost model layer $k=1$ with $i,1$ and $i+1,1$ tracer points (black dots), 624 and $i+1/2,1$ $u$-point (blue square). 625 Triad slopes $\triad{i}{1}{R}{1/2}{-1/2}$ (magenta) and $\triad{i+1}{1}{R}{-1/2}{-1/2}$ (blue) poking through 626 the ocean surface are masked (faded in figure). 627 However, the lateral $_{11}$ contributions towards $\triad[u]{i}{1}{F}{1/2}{-1/2}$ and 628 $\triad[u]{i+1}{1}{F}{-1/2}{-1/2}$ (yellow line) are still applied, 629 giving diapycnal diffusive fluxes.\newline 678 630 (b) Both near bottom triad slopes $\triad{i}{k}{R}{1/2}{1/2}$ and 679 $\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$ 680 or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ $u$-point681 is masked. The associated lateral fluxes (grey-black dashed682 line) are masked if \protect\np{botmix\_triad}\forcode{ = .false.}, but left683 unmasked,giving bottom mixing, if \protect\np{botmix\_triad}\forcode{ = .true.}}631 $\triad{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, 632 i.e.\ the $i,k+1$ $u$-point is masked. 633 The associated lateral fluxes (grey-black dashed line) are masked if 634 \protect\np{botmix\_triad}\forcode{ = .false.}, but left unmasked, 635 giving bottom mixing, if \protect\np{botmix\_triad}\forcode{ = .true.}} 684 636 \end{center} \end{figure} 685 637 % >>>>>>>>>>>>>>>>>>>>>>>>>>>> 686 638 687 639 \subsection{ Limiting of the slopes within the interior}\label{sec:limit} 688 As discussed in \autoref{subsec:LDF_slp_iso}, iso-neutral slopes relative to689 geopotentials must be bounded everywhere, both for consistency with the small-slope 690 approximation and for numerical stability \citep{Cox1987, 691 Griffies_Bk04}. The bound chosen in \NEMO is applied to each 692 component of the slope separately andhas a value of $1/100$ in the ocean interior.640 As discussed in \autoref{subsec:LDF_slp_iso}, 641 iso-neutral slopes relative to geopotentials must be bounded everywhere, 642 both for consistency with the small-slope approximation and for numerical stability \citep{Cox1987, Griffies_Bk04}. 643 The bound chosen in \NEMO is applied to each component of the slope separately and 644 has a value of $1/100$ in the ocean interior. 693 645 %, ramping linearly down above 70~m depth to zero at the surface 694 It is of course relevant to the iso-neutral slopes $\tilde{r}_i=r_i+\sigma_i$ relative to 695 geopotentials (here the $\sigma_i$ are the slopes of the coordinate surfaces relative to 696 geopotentials) \autoref{eq:PE_slopes_eiv} rather than the slope $r_i$ relative to coordinate 697 surfaces, so we require 646 It is of course relevant to the iso-neutral slopes $\tilde{r}_i=r_i+\sigma_i$ relative to geopotentials 647 (here the $\sigma_i$ are the slopes of the coordinate surfaces relative to geopotentials) 648 \autoref{eq:PE_slopes_eiv} rather than the slope $r_i$ relative to coordinate surfaces, so we require 698 649 \begin{equation*} 699 650 |\tilde{r}_i|\leq \tilde{r}_\mathrm{max}=0.01. … … 701 652 and then recalculate the slopes $r_i$ relative to coordinates. 702 653 Each individual triad slope 703 \begin{equation} 704 \label{eq:Rtilde} 705 _i^k\tilde{\mathbb{R}}_{i_p}^{k_p} = {}_i^k\mathbb{R}_{i_p}^{k_p} + \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}} 706 \end{equation} 707 is limited like this and then the corresponding 708 $_i^k\mathbb{R}_{i_p}^{k_p} $ are recalculated and combined to form the fluxes. 709 Note that where the slopes have been limited, there is now a non-zero 710 iso-neutral density flux that drives dianeutral mixing. In particular this iso-neutral density flux 711 is always downwards, and so acts to reduce gravitational potential energy. 654 \begin{equation} 655 \label{eq:Rtilde} 656 _i^k\tilde{\mathbb{R}}_{i_p}^{k_p} = {}_i^k\mathbb{R}_{i_p}^{k_p} + \frac{\delta_{i+i_p}[z_T^k]}{{e_{1u}}_{\,i + i_p}^{\,k}} 657 \end{equation} 658 is limited like this and then the corresponding $_i^k\mathbb{R}_{i_p}^{k_p} $ are recalculated and 659 combined to form the fluxes. 660 Note that where the slopes have been limited, there is now a non-zero iso-neutral density flux that 661 drives dianeutral mixing. 662 In particular this iso-neutral density flux is always downwards, 663 and so acts to reduce gravitational potential energy. 712 664 713 665 \subsection{Tapering within the surface mixed layer}\label{sec:taper} 714 Additional tapering of the iso-neutral fluxes is necessary within the 715 surface mixed layer. When the Griffies triads are used, we offer two 716 options for this. 666 Additional tapering of the iso-neutral fluxes is necessary within the surface mixed layer. 667 When the Griffies triads are used, we offer two options for this. 717 668 718 669 \subsubsection{Linear slope tapering within the surface mixed layer}\label{sec:lintaper} 719 This is the option activated by the default choice 720 \np{ln\_triad\_iso}\forcode{ = .false.}. Slopes $\tilde{r}_i$ relative to 721 geopotentials are tapered linearly from their value immediately below the mixed layer to zero at the 722 surface, as described in option (c) of \autoref{fig:eiv_slp}, to values 670 This is the option activated by the default choice \np{ln\_triad\_iso}\forcode{ = .false.}. 671 Slopes $\tilde{r}_i$ relative to geopotentials are tapered linearly from their value immediately below 672 the mixed layer to zero at the surface, as described in option (c) of \autoref{fig:eiv_slp}, to values 723 673 \begin{subequations} 724 674 \begin{equation} 725 \label{eq:rmtilde}726 727 -\frac{z}{h}\left.\tilde{r}_i\right|_{z=-h}\quad \text{ for } z>-h,675 \label{eq:rmtilde} 676 \rMLt = 677 -\frac{z}{h}\left.\tilde{r}_i\right|_{z=-h}\quad \text{ for } z>-h, 728 678 \end{equation} 729 and then the $r_i$ relative to vertical coordinate surfaces are appropriately 730 adjusted to 679 and then the $r_i$ relative to vertical coordinate surfaces are appropriately adjusted to 731 680 \begin{equation} 732 \label{eq:rm}733 \rML =\rMLt -\sigma_i \quad \text{ for } z>-h.681 \label{eq:rm} 682 \rML =\rMLt -\sigma_i \quad \text{ for } z>-h. 734 683 \end{equation} 735 684 \end{subequations} … … 744 693 \end{equation} 745 694 746 This slope tapering gives a natural connection between tracer in the 747 mixed-layer and in isopycnal layers immediately below, in the 748 thermocline. It is consistent with the way the $\tilde{r}_i$ are 749 tapered within the mixed layer (see \autoref{sec:taperskew} below) 750 so as to ensure a uniform GM eddy-induced velocity throughout the 751 mixed layer. However, it gives a downwards density flux and so acts so 752 as to reduce potential energy in the same way as does the slope 753 limiting discussed above in \autoref{sec:limit}. 695 This slope tapering gives a natural connection between tracer in the mixed-layer and 696 in isopycnal layers immediately below, in the thermocline. 697 It is consistent with the way the $\tilde{r}_i$ are tapered within the mixed layer 698 (see \autoref{sec:taperskew} below) so as to ensure a uniform GM eddy-induced velocity throughout the mixed layer. 699 However, it gives a downwards density flux and so acts so as to reduce potential energy in the same way as 700 does the slope limiting discussed above in \autoref{sec:limit}. 754 701 755 As in \autoref{sec:limit} above, the tapering 756 \autoref{eq:rmtilde} is applied separately to each triad 757 $_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}$, and the 758 $_i^k\mathbb{R}_{i_p}^{k_p}$ adjusted. For clarity, we assume 759 $z$-coordinates in the following; the conversion from 760 $\mathbb{R}$ to $\tilde{\mathbb{R}}$ and back to $\mathbb{R}$ follows exactly as described 761 above by \autoref{eq:Rtilde}. 702 As in \autoref{sec:limit} above, the tapering \autoref{eq:rmtilde} is applied separately to 703 each triad $_i^k\tilde{\mathbb{R}}_{i_p}^{k_p}$, and the $_i^k\mathbb{R}_{i_p}^{k_p}$ adjusted. 704 For clarity, we assume $z$-coordinates in the following; 705 the conversion from $\mathbb{R}$ to $\tilde{\mathbb{R}}$ and back to $\mathbb{R}$ follows exactly as 706 described above by \autoref{eq:Rtilde}. 762 707 \begin{enumerate} 763 \item Mixed-layer depth is defined so as to avoid including regions of weak 764 vertical stratification in the slope definition. 765 At each $i,j$ (simplified to $i$ in 766 \autoref{fig:MLB_triad}), we define the mixed-layer by setting 767 the vertical index of the tracer point immediately below the mixed 768 layer, $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) 769 such that the potential density 770 ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$, where $i,k_{10}$ is 771 the tracer gridbox within which the depth reaches 10~m. See the left 772 side of \autoref{fig:MLB_triad}. We use the $k_{10}$-gridbox 773 instead of the surface gridbox to avoid problems e.g.\ with thin 774 daytime mixed-layers. Currently we use the same 775 $\Delta\rho_c=0.01\;\mathrm{kg\:m^{-3}}$ for ML triad tapering as is 776 used to output the diagnosed mixed-layer depth 777 $h_{\mathrm{ML}}=|z_{W}|_{k_{\mathrm{ML}}+1/2}$, the depth of the $w$-point 778 above the $i,k_{\mathrm{ML}}$ tracer point. 779 780 \item We define `basal' triad slopes 781 ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ as the slopes 782 of those triads whose vertical `arms' go down from the 783 $i,k_{\mathrm{ML}}$ tracer point to the $i,k_{\mathrm{ML}}-1$ tracer point 784 below. This is to ensure that the vertical density gradients 785 associated with these basal triad slopes 786 ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ are 787 representative of the thermocline. The four basal triads defined in the bottom part 788 of \autoref{fig:MLB_triad} are then 708 \item 709 Mixed-layer depth is defined so as to avoid including regions of weak vertical stratification in 710 the slope definition. 711 At each $i,j$ (simplified to $i$ in \autoref{fig:MLB_triad}), 712 we define the mixed-layer by setting the vertical index of the tracer point immediately below the mixed layer, 713 $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) such that 714 the potential density ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$, 715 where $i,k_{10}$ is the tracer gridbox within which the depth reaches 10~m. 716 See the left side of \autoref{fig:MLB_triad}. 717 We use the $k_{10}$-gridbox instead of the surface gridbox to avoid problems e.g.\ with thin daytime mixed-layers. 718 Currently we use the same $\Delta\rho_c=0.01\;\mathrm{kg\:m^{-3}}$ for ML triad tapering as is used to 719 output the diagnosed mixed-layer depth $h_{\mathrm{ML}}=|z_{W}|_{k_{\mathrm{ML}}+1/2}$, 720 the depth of the $w$-point above the $i,k_{\mathrm{ML}}$ tracer point. 721 \item 722 We define `basal' triad slopes ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ as 723 the slopes of those triads whose vertical `arms' go down from the $i,k_{\mathrm{ML}}$ tracer point to 724 the $i,k_{\mathrm{ML}}-1$ tracer point below. 725 This is to ensure that the vertical density gradients associated with 726 these basal triad slopes ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ are representative of the thermocline. 727 The four basal triads defined in the bottom part of \autoref{fig:MLB_triad} are then 789 728 \begin{align} 790 729 {\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p} &= … … 795 734 {\:}^{k_{\mathrm{ML}}}_i{\mathbb{R}_{\mathrm{base}}}_{\,1/2}^{-1/2}. \notag 796 735 \end{align} 797 The vertical flux associated with each of these triads passes through the $w$-point 798 $i,k_{\mathrm{ML}}-1/2$ lying \emph{below} the $i,k_{\mathrm{ML}}$ tracer point, 799 so it is this depth 736 The vertical flux associated with each of these triads passes through 737 the $w$-point $i,k_{\mathrm{ML}}-1/2$ lying \emph{below} the $i,k_{\mathrm{ML}}$ tracer point, so it is this depth 800 738 \begin{equation} 801 739 \label{eq:zbase} 802 740 {z_\mathrm{base}}_{\,i}={z_{w}}_{k_\mathrm{ML}-1/2} 803 741 \end{equation} 804 (one gridbox deeper than the 805 diagnosed ML depth $z_{\mathrm{ML}})$ that sets the $h$ used to taper 806 the slopes in \autoref{eq:rmtilde}. 807 \item Finally, we calculate the adjusted triads 808 ${\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,i_p}^{k_p}$ within the mixed 809 layer, by multiplying the appropriate 810 ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ by the ratio of 811 the depth of the $w$-point ${z_w}_{k+k_p}$ to ${z_{\mathrm{base}}}_{\,i}$. For 812 instance the green triad centred on $i,k$ 742 one gridbox deeper than the diagnosed ML depth $z_{\mathrm{ML}})$ that sets the $h$ used to taper the slopes in 743 \autoref{eq:rmtilde}. 744 \item 745 Finally, we calculate the adjusted triads ${\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,i_p}^{k_p}$ within 746 the mixed layer, by multiplying the appropriate ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$ by 747 the ratio of the depth of the $w$-point ${z_w}_{k+k_p}$ to ${z_{\mathrm{base}}}_{\,i}$. 748 For instance the green triad centred on $i,k$ 813 749 \begin{align} 814 750 {\:}_i^k{\mathbb{R}_{\mathrm{ML}}}_{\,1/2}^{-1/2} &= … … 824 760 \begin{figure}[h] 825 761 % \fcapside { 826 \caption{\protect\label{fig:MLB_triad} Definition of 827 mixed-layer depth and calculation of linearly tapered 828 triads. The figure shows a water column at a given $i,j$ 829 (simplified to $i$), with the ocean surface at the top. Tracer points are denoted by 830 bullets, and black lines the edges of the tracer cells; $k$ 831 increases upwards. \newline 832 \hspace{5 em}We define the mixed-layer by setting the vertical index 833 of the tracer point immediately below the mixed layer, 834 $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) 835 such that ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$, 836 where $i,k_{10}$ is the tracer gridbox within which the depth 837 reaches 10~m. We calculate the triad slopes within the mixed 838 layer by linearly tapering them from zero (at the surface) to 839 the `basal' slopes, the slopes of the four triads passing through the 840 $w$-point $i,k_{\mathrm{ML}}-1/2$ (blue square), 841 ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$. Triads with 842 different $i_p,k_p$, denoted by different colours, (e.g. the green 843 triad $i_p=1/2,k_p=-1/2$) are tapered to the appropriate basal triad.} 762 \caption{\protect\label{fig:MLB_triad} 763 Definition of mixed-layer depth and calculation of linearly tapered triads. 764 The figure shows a water column at a given $i,j$ (simplified to $i$), with the ocean surface at the top. 765 Tracer points are denoted by bullets, and black lines the edges of the tracer cells; 766 $k$ increases upwards. \newline 767 \hspace{5 em} 768 We define the mixed-layer by setting the vertical index of the tracer point immediately below the mixed layer, 769 $k_{\mathrm{ML}}$, as the maximum $k$ (shallowest tracer point) such that 770 ${\rho_0}_{i,k}>{\rho_0}_{i,k_{10}}+\Delta\rho_c$, 771 where $i,k_{10}$ is the tracer gridbox within which the depth reaches 10~m. 772 We calculate the triad slopes within the mixed layer by linearly tapering them from zero 773 (at the surface) to the `basal' slopes, 774 the slopes of the four triads passing through the $w$-point $i,k_{\mathrm{ML}}-1/2$ (blue square), 775 ${\:}_i{\mathbb{R}_{\mathrm{base}}}_{\,i_p}^{k_p}$. 776 Triads with different $i_p,k_p$, denoted by different colours, 777 (e.g. the green triad $i_p=1/2,k_p=-1/2$) are tapered to the appropriate basal triad.} 844 778 %} 845 779 {\includegraphics[width=0.60\textwidth]{Fig_GRIFF_MLB_triads}} … … 849 783 \subsubsection{Additional truncation of skew iso-neutral flux components} 850 784 \label{subsec:Gerdes-taper} 851 The alternative option is activated by setting \np{ln\_triad\_iso} = 852 true. This retains the same tapered slope $\rML$ described above for the 853 calculation of the $_{33}$ term of the iso-neutral diffusion tensor (the 854 vertical tracer flux driven by vertical tracer gradients), but 855 replaces the $\rML$ in the skew term by 785 The alternative option is activated by setting \np{ln\_triad\_iso} = true. 786 This retains the same tapered slope $\rML$ described above for the calculation of the $_{33}$ term of 787 the iso-neutral diffusion tensor (the vertical tracer flux driven by vertical tracer gradients), 788 but replaces the $\rML$ in the skew term by 856 789 \begin{equation} 857 790 \label{eq:rm*} … … 868 801 \end{equation} 869 802 This operator 870 \footnote{ To ensure good behaviour where horizontal density871 gradients are weak, we in fact follow \citet{Gerdes1991} and set872 $\rML^*=\mathrm{sgn}(\tilde{r}_i)\min(|\rMLt^2/\tilde{r}_i|,|\tilde{r}_i|)-\sigma_i$.} 873 then has the property it gives no vertical density flux, and so does 874 not change the potential energy.875 This approach is similar to multiplying the iso-neutral diffusion876 coefficient by $\tilde{r}_{\mathrm{max}}^{-2}\tilde{r}_i^{-2}$ for steep 877 slopes,as suggested by \citet{Gerdes1991} (see also \citet{Griffies_Bk04}).803 \footnote{ 804 To ensure good behaviour where horizontal density gradients are weak, 805 we in fact follow \citet{Gerdes1991} and 806 set $\rML^*=\mathrm{sgn}(\tilde{r}_i)\min(|\rMLt^2/\tilde{r}_i|,|\tilde{r}_i|)-\sigma_i$.} 807 then has the property it gives no vertical density flux, and so does not change the potential energy. 808 This approach is similar to multiplying the iso-neutral diffusion coefficient by 809 $\tilde{r}_{\mathrm{max}}^{-2}\tilde{r}_i^{-2}$ for steep slopes, 810 as suggested by \citet{Gerdes1991} (see also \citet{Griffies_Bk04}). 878 811 Again it is applied separately to each triad $_i^k\mathbb{R}_{i_p}^{k_p}$ 879 812 880 In practice, this approach gives weak vertical tracer fluxes through 881 the mixed-layer, as well as vanishing density fluxes. While it is 882 theoretically advantageous that it does not change the potential 883 energy, it may give a discontinuity between the 884 fluxes within the mixed-layer (purely horizontal) and just below (along 885 iso-neutral surfaces). 813 In practice, this approach gives weak vertical tracer fluxes through the mixed-layer, 814 as well as vanishing density fluxes. 815 While it is theoretically advantageous that it does not change the potential energy, 816 it may give a discontinuity between the fluxes within the mixed-layer (purely horizontal) and 817 just below (along iso-neutral surfaces). 886 818 % This may give strange looking results, 887 819 % particularly where the mixed-layer depth varies strongly laterally. … … 893 825 \subsection{Continuous skew flux formulation}\label{sec:continuous-skew-flux} 894 826 895 When Gent and McWilliams's [1990] diffusion is used, 896 an additional advection term is added. The associated velocity is the so called 897 eddy induced velocity, the formulation of which depends on the slopes of iso- 898 neutral surfaces. Contrary to the case of iso-neutral mixing, the slopes used 899 here are referenced to the geopotential surfaces, $i.e.$ \autoref{eq:ldfslp_geo} 900 is used in $z$-coordinate, and the sum \autoref{eq:ldfslp_geo} 901 + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates. 827 When Gent and McWilliams's [1990] diffusion is used, an additional advection term is added. 828 The associated velocity is the so called eddy induced velocity, 829 the formulation of which depends on the slopes of iso-neutral surfaces. 830 Contrary to the case of iso-neutral mixing, the slopes used here are referenced to the geopotential surfaces, 831 $i.e.$ \autoref{eq:ldfslp_geo} is used in $z$-coordinate, 832 and the sum \autoref{eq:ldfslp_geo} + \autoref{eq:ldfslp_iso} in $z^*$ or $s$-coordinates. 902 833 903 834 The eddy induced velocity is given by: … … 919 850 \end{equation} 920 851 \end{subequations} 921 with $A_{e}$ the eddy induced velocity coefficient, and $\tilde{r}_1$ and $\tilde{r}_2$ the slopes between the iso-neutral and the geopotential surfaces. 922 923 The traditional way to implement this additional advection is to add 924 it to the Eulerian velocity prior to computing the tracer 925 advection. This is implemented if \key{traldf\_eiv} is set in the 926 default implementation, where \np{ln\_traldf\_triad} is set 927 false. This allows us to take advantage of all the advection schemes 928 offered for the tracers (see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ 929 order advection scheme. This is particularly useful for passive 930 tracers where \emph{positivity} of the advection scheme is of 931 paramount importance. 932 933 However, when \np{ln\_traldf\_triad} is set true, \NEMO instead 934 implements eddy induced advection according to the so-called skew form 935 \citep{Griffies_JPO98}. It is based on a transformation of the advective fluxes 936 using the non-divergent nature of the eddy induced velocity. 937 For example in the (\textbf{i},\textbf{k}) plane, the tracer advective 938 fluxes per unit area in $ijk$ space can be 939 transformed as follows: 852 with $A_{e}$ the eddy induced velocity coefficient, 853 and $\tilde{r}_1$ and $\tilde{r}_2$ the slopes between the iso-neutral and the geopotential surfaces. 854 855 The traditional way to implement this additional advection is to add it to the Eulerian velocity prior to 856 computing the tracer advection. 857 This is implemented if \key{traldf\_eiv} is set in the default implementation, 858 where \np{ln\_traldf\_triad} is set false. 859 This allows us to take advantage of all the advection schemes offered for the tracers 860 (see \autoref{sec:TRA_adv}) and not just a $2^{nd}$ order advection scheme. 861 This is particularly useful for passive tracers where 862 \emph{positivity} of the advection scheme is of paramount importance. 863 864 However, when \np{ln\_traldf\_triad} is set true, 865 \NEMO instead implements eddy induced advection according to the so-called skew form \citep{Griffies_JPO98}. 866 It is based on a transformation of the advective fluxes using the non-divergent nature of the eddy induced velocity. 867 For example in the (\textbf{i},\textbf{k}) plane, 868 the tracer advective fluxes per unit area in $ijk$ space can be transformed as follows: 940 869 \begin{flalign*} 941 870 \begin{split} … … 962 891 \end{split} 963 892 \end{flalign*} 964 and since the eddy induced velocity field is non-divergent, we end up with the skew965 form of the eddy induced advective fluxes per unit area in $ijk$ space:893 and since the eddy induced velocity field is non-divergent, 894 we end up with the skew form of the eddy induced advective fluxes per unit area in $ijk$ space: 966 895 \begin{equation} \label{eq:eiv_skew_ijk} 967 896 \textbf{F}_\mathrm{eiv}^T = \begin{pmatrix} … … 979 908 \end{split} 980 909 \end{equation} 981 Note that \autoref{eq:eiv_skew_physical} takes the same form whatever the982 vertical coordinate, though of course the slopes 983 $\tilde{r}_i$ which define the $\psi_i$ in \autoref{eq:eiv_psi} are relative togeopotentials.984 The tendency associated with eddy induced velocity is then simply the convergence 985 of the fluxes(\autoref{eq:eiv_skew_ijk}, \autoref{eq:eiv_skew_physical}), so910 Note that \autoref{eq:eiv_skew_physical} takes the same form whatever the vertical coordinate, 911 though of course the slopes $\tilde{r}_i$ which define the $\psi_i$ in \autoref{eq:eiv_psi} are relative to 912 geopotentials. 913 The tendency associated with eddy induced velocity is then simply the convergence of the fluxes 914 (\autoref{eq:eiv_skew_ijk}, \autoref{eq:eiv_skew_physical}), so 986 915 \begin{equation} \label{eq:skew_eiv_conv} 987 916 \frac{\partial T}{\partial t}= -\frac{1}{e_1 \, e_2 \, e_3 } \left[ … … 992 921 + e_{1} \psi_2 \partial_j T \right) \right] 993 922 \end{equation} 994 It naturally conserves the tracer content, as it is expressed in flux 995 form. Since it has the same divergence as the advective form it also 996 preserves the tracer variance. 923 It naturally conserves the tracer content, as it is expressed in flux form. 924 Since it has the same divergence as the advective form it also preserves the tracer variance. 997 925 998 926 \subsection{Discrete skew flux formulation} 999 The skew fluxes in (\autoref{eq:eiv_skew_physical}, \autoref{eq:eiv_skew_ijk}), like the off-diagonal terms1000 (\autoref{eq:i13c}, \autoref{eq:i31c}) of the small angle diffusion tensor, are best 1001 expressed in terms of the triad slopes, as in \autoref{fig:ISO_triad} 1002 and (\autoref{eq:i13}, \autoref{eq:i31}); but now in terms of the triad slopes 1003 $\tilde{\mathbb{R}}$ relative to geopotentials instead of the 1004 $\mathbb{R}$ relative to coordinate surfaces. The discrete form of 1005 \autoref{eq:eiv_skew_ijk} using the slopes \autoref{eq:R} and927 The skew fluxes in (\autoref{eq:eiv_skew_physical}, \autoref{eq:eiv_skew_ijk}), 928 like the off-diagonal terms (\autoref{eq:i13c}, \autoref{eq:i31c}) of the small angle diffusion tensor, 929 are best expressed in terms of the triad slopes, as in \autoref{fig:ISO_triad} and 930 (\autoref{eq:i13}, \autoref{eq:i31}); 931 but now in terms of the triad slopes $\tilde{\mathbb{R}}$ relative to geopotentials instead of 932 the $\mathbb{R}$ relative to coordinate surfaces. 933 The discrete form of \autoref{eq:eiv_skew_ijk} using the slopes \autoref{eq:R} and 1006 934 defining $A_e$ at $T$-points is then given by: 1007 935 … … 1017 945 \end{pmatrix}, 1018 946 \end{flalign} 1019 where the skew flux in the $i$-direction associated with a given 1020 triad is (\autoref{eq:latflux-triad},\autoref{eq:triadfluxu}):947 where the skew flux in the $i$-direction associated with a given triad is (\autoref{eq:latflux-triad}, 948 \autoref{eq:triadfluxu}): 1021 949 \begin{align} 1022 950 \label{eq:skewfluxu} … … 1034 962 \end{subequations} 1035 963 1036 Such a discretisation is consistent with the iso-neutral 1037 operator as it uses the same definition for the slopes. It also 1038 ensures the following two key properties. 964 Such a discretisation is consistent with the iso-neutral operator as it uses the same definition for the slopes. 965 It also ensures the following two key properties. 1039 966 1040 967 \subsubsection{No change in tracer variance} 1041 The discretization conserves tracer variance, $i.e.$ it does not 1042 include a diffusive component but is a `pure' advection term. This can 1043 be seen 1044 %either from Appendix \autoref{apdx:eiv_skew} or 1045 by considering the 1046 fluxes associated with a given triad slope 1047 $_i^k{\mathbb{R}}_{i_p}^{k_p} (T)$. For, following 1048 \autoref{subsec:variance} and \autoref{eq:dvar_iso_i}, the 1049 associated horizontal skew-flux $_i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)$ 1050 drives a net rate of change of variance, summed over the two 1051 $T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of 968 The discretization conserves tracer variance, $i.e.$ it does not include a diffusive component but is a `pure' advection term. 969 This can be seen %either from Appendix \autoref{apdx:eiv_skew} or 970 by considering the fluxes associated with a given triad slope $_i^k{\mathbb{R}}_{i_p}^{k_p} (T)$. 971 For, following \autoref{subsec:variance} and \autoref{eq:dvar_iso_i}, 972 the associated horizontal skew-flux $_i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)$ drives a net rate of change of variance, 973 summed over the two $T$-points $i+i_p-\half,k$ and $i+i_p+\half,k$, of 1052 974 \begin{equation} 1053 975 \label{eq:dvar_eiv_i} 1054 976 _i^k{\mathbb{S}_u}_{i_p}^{k_p} (T)\,\delta_{i+ i_p}[T^k], 1055 977 \end{equation} 1056 while the associated vertical skew-flux gives a variance change summed over the1057 $T$-points $i,k+k_p-\half$ (above) and $i,k+k_p+\half$ (below) of978 while the associated vertical skew-flux gives a variance change summed over 979 the $T$-points $i,k+k_p-\half$ (above) and $i,k+k_p+\half$ (below) of 1058 980 \begin{equation} 1059 981 \label{eq:dvar_eiv_k} 1060 982 _i^k{\mathbb{S}_w}_{i_p}^{k_p} (T) \,\delta_{k+ k_p}[T^i]. 1061 983 \end{equation} 1062 Inspection of the definitions (\autoref{eq:skewfluxu}, \autoref{eq:skewfluxw}) 1063 shows that these two variance changes (\autoref{eq:dvar_eiv_i}, \autoref{eq:dvar_eiv_k}) 1064 sum to zero. Hence the two fluxes associated with each triad make no 1065 net contribution to the variance budget. 984 Inspection of the definitions (\autoref{eq:skewfluxu}, \autoref{eq:skewfluxw}) shows that 985 these two variance changes (\autoref{eq:dvar_eiv_i}, \autoref{eq:dvar_eiv_k}) sum to zero. 986 Hence the two fluxes associated with each triad make no net contribution to the variance budget. 1066 987 1067 988 \subsubsection{Reduction in gravitational PE} 1068 The vertical density flux associated with the vertical skew-flux 1069 always has the same sign as the vertical density gradient; thus, so 1070 long as the fluid is stable (the vertical density gradient is 1071 negative) the vertical density flux is negative (downward) and hence 1072 reduces the gravitational PE. 989 The vertical density flux associated with the vertical skew-flux always has the same sign as 990 the vertical density gradient; 991 thus, so long as the fluid is stable (the vertical density gradient is negative) 992 the vertical density flux is negative (downward) and hence reduces the gravitational PE. 1073 993 1074 994 For the change in gravitational PE driven by the $k$-flux is … … 1091 1011 \frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}}, 1092 1012 \end{align} 1093 using the definition of the triad slope $\rtriad{R}$, 1094 \autoref{eq:R} to express $-\alpha _i^k\delta_{i+ i_p}[T^k]+ 1095 \beta_i^k\delta_{i+ i_p}[S^k]$ in terms of $-\alpha_i^k \delta_{k+ 1096 k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]$. 1013 using the definition of the triad slope $\rtriad{R}$, \autoref{eq:R} to 1014 express $-\alpha _i^k\delta_{i+ i_p}[T^k]+\beta_i^k\delta_{i+ i_p}[S^k]$ in terms of 1015 $-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]$. 1097 1016 1098 1017 Where the coordinates slope, the $i$-flux gives a PE change … … 1108 1027 \frac{-\alpha_i^k \delta_{k+ k_p}[T^i]+ \beta_i^k\delta_{k+ k_p}[S^i]} {{e_{3w}}_{\,i}^{\,k+k_p}}, 1109 1028 \end{multline} 1110 (using \autoref{eq:skewfluxu}) and so the total PE change 1111 \autoref{eq: vert_densityPE} + \autoref{eq:lat_densityPE} associated with the triad fluxes is1029 (using \autoref{eq:skewfluxu}) and so the total PE change \autoref{eq:vert_densityPE} + 1030 \autoref{eq:lat_densityPE} associated with the triad fluxes is 1112 1031 \begin{multline} 1113 1032 \label{eq:tot_densityPE} … … 1122 1041 1123 1042 \subsection{Treatment of the triads at the boundaries}\label{sec:skew_bdry} 1124 Triad slopes \rtriadt{R} used for the calculation of the eddy-induced skew-fluxes 1125 are masked at the boundaries in exactly the same way as are the triad 1126 slopes \rtriad{R} used for the iso-neutral diffusive fluxes, as 1127 described in \autoref{sec:iso_bdry} and 1128 \autoref{fig:bdry_triads}. Thus surface layer triads 1129 $\triadt{i}{1}{R}{1/2}{-1/2}$ and $\triadt{i+1}{1}{R}{-1/2}{-1/2}$ are 1130 masked, and both near bottom triad slopes $\triadt{i}{k}{R}{1/2}{1/2}$ 1131 and $\triadt{i+1}{k}{R}{-1/2}{1/2}$ are masked when either of the 1132 $i,k+1$ or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ 1133 $u$-point is masked. The namelist parameter \np{ln\_botmix\_triad} has 1134 no effect on the eddy-induced skew-fluxes. 1043 Triad slopes \rtriadt{R} used for the calculation of the eddy-induced skew-fluxes are masked at the boundaries 1044 in exactly the same way as are the triad slopes \rtriad{R} used for the iso-neutral diffusive fluxes, 1045 as described in \autoref{sec:iso_bdry} and \autoref{fig:bdry_triads}. 1046 Thus surface layer triads $\triadt{i}{1}{R}{1/2}{-1/2}$ and $\triadt{i+1}{1}{R}{-1/2}{-1/2}$ are masked, 1047 and both near bottom triad slopes $\triadt{i}{k}{R}{1/2}{1/2}$ and $\triadt{i+1}{k}{R}{-1/2}{1/2}$ are masked when 1048 either of the $i,k+1$ or $i+1,k+1$ tracer points is masked, i.e.\ the $i,k+1$ $u$-point is masked. 1049 The namelist parameter \np{ln\_botmix\_triad} has no effect on the eddy-induced skew-fluxes. 1135 1050 1136 1051 \subsection{Limiting of the slopes within the interior}\label{sec:limitskew} 1137 Presently, the iso-neutral slopes $\tilde{r}_i$ relative 1138 to geopotentials are limited to be less than $1/100$, exactly as in 1139 calculating the iso-neutral diffusion, \S \autoref{sec:limit}. Each 1140 individual triad \rtriadt{R} is so limited. 1052 Presently, the iso-neutral slopes $\tilde{r}_i$ relative to geopotentials are limited to be less than $1/100$, 1053 exactly as in calculating the iso-neutral diffusion, \S \autoref{sec:limit}. 1054 Each individual triad \rtriadt{R} is so limited. 1141 1055 1142 1056 \subsection{Tapering within the surface mixed layer}\label{sec:taperskew} 1143 The slopes $\tilde{r}_i$ relative to 1144 geopotentials (and thus the individual triads \rtriadt{R}) are always tapered linearly from their value immediately below the mixed layer to zero at the 1145 surface \autoref{eq:rmtilde}, as described in \autoref{sec:lintaper}. This is 1146 option (c) of \autoref{fig:eiv_slp}. This linear tapering for the 1147 slopes used to calculate the eddy-induced fluxes is 1148 unaffected by the value of \np{ln\_triad\_iso}. 1149 1150 The justification for this linear slope tapering is that, for $A_e$ 1151 that is constant or varies only in the horizontal (the most commonly 1152 used options in \NEMO: see \autoref{sec:LDF_coef}), it is 1153 equivalent to a horizontal eiv (eddy-induced velocity) that is uniform 1154 within the mixed layer \autoref{eq:eiv_v}. This ensures that the 1155 eiv velocities do not restratify the mixed layer \citep{Treguier1997, 1156 Danabasoglu_al_2008}. Equivantly, in terms 1157 of the skew-flux formulation we use here, the 1158 linear slope tapering within the mixed-layer gives a linearly varying 1159 vertical flux, and so a tracer convergence uniform in depth (the 1160 horizontal flux convergence is relatively insignificant within the mixed-layer). 1057 The slopes $\tilde{r}_i$ relative to geopotentials (and thus the individual triads \rtriadt{R}) 1058 are always tapered linearly from their value immediately below the mixed layer to zero at the surface 1059 \autoref{eq:rmtilde}, as described in \autoref{sec:lintaper}. 1060 This is option (c) of \autoref{fig:eiv_slp}. 1061 This linear tapering for the slopes used to calculate the eddy-induced fluxes is unaffected by 1062 the value of \np{ln\_triad\_iso}. 1063 1064 The justification for this linear slope tapering is that, for $A_e$ that is constant or varies only in 1065 the horizontal (the most commonly used options in \NEMO: see \autoref{sec:LDF_coef}), 1066 it is equivalent to a horizontal eiv (eddy-induced velocity) that is uniform within the mixed layer 1067 \autoref{eq:eiv_v}. 1068 This ensures that the eiv velocities do not restratify the mixed layer \citep{Treguier1997,Danabasoglu_al_2008}. 1069 Equivantly, in terms of the skew-flux formulation we use here, 1070 the linear slope tapering within the mixed-layer gives a linearly varying vertical flux, 1071 and so a tracer convergence uniform in depth 1072 (the horizontal flux convergence is relatively insignificant within the mixed-layer). 1161 1073 1162 1074 \subsection{Streamfunction diagnostics}\label{sec:sfdiag} 1163 Where the namelist parameter \np{ln\_traldf\_gdia}\forcode{ = .true.}, diagnosed 1164 mean eddy-induced velocities are output. Each time step, 1165 streamfunctions are calculated in the $i$-$k$ and $j$-$k$ planes at 1166 $uw$ (integer +1/2 $i$, integer $j$, integer +1/2 $k$) and $vw$ 1167 (integer $i$, integer +1/2 $j$, integer +1/2 $k$) points (see Table 1168 \autoref{tab:cell}) respectively. We follow \citep{Griffies_Bk04} and 1169 calculate the streamfunction at a given $uw$-point from the 1170 surrounding four triads according to: 1075 Where the namelist parameter \np{ln\_traldf\_gdia}\forcode{ = .true.}, 1076 diagnosed mean eddy-induced velocities are output. 1077 Each time step, streamfunctions are calculated in the $i$-$k$ and $j$-$k$ planes at 1078 $uw$ (integer +1/2 $i$, integer $j$, integer +1/2 $k$) and $vw$ (integer $i$, integer +1/2 $j$, integer +1/2 $k$) 1079 points (see Table \autoref{tab:cell}) respectively. 1080 We follow \citep{Griffies_Bk04} and calculate the streamfunction at a given $uw$-point from 1081 the surrounding four triads according to: 1171 1082 \begin{equation} 1172 1083 \label{eq:sfdiagi} … … 1175 1086 \end{equation} 1176 1087 The streamfunction $\psi_1$ is calculated similarly at $vw$ points. 1177 The eddy-induced velocities are then calculated from the 1178 straightforward discretisation of \autoref{eq:eiv_v}: 1088 The eddy-induced velocities are then calculated from the straightforward discretisation of \autoref{eq:eiv_v}: 1179 1089 \begin{equation}\label{eq:eiv_v_discrete} 1180 1090 \begin{split} -
NEMO/trunk/doc/latex/NEMO/subfiles/chap_ASM.tex
r10146 r10354 15 15 $\ $\newline % force a new line 16 16 17 The ASM code adds the functionality to apply increments to the model variables: 18 temperature, salinity,sea surface height, velocity and sea ice concentration.19 These are read into the model from a NetCDF file which may be produced by separate data 20 assimilation code. The code can also output model background fields which are used 21 as an input to data assimilation code. This is all controlled by the namelist 22 \textit{\ngn{nam\_asminc} }. There is a brief description of all the namelist options 23 provided.To build the ASM code \key{asminc} must be set.17 The ASM code adds the functionality to apply increments to the model variables: temperature, salinity, 18 sea surface height, velocity and sea ice concentration. 19 These are read into the model from a NetCDF file which may be produced by separate data assimilation code. 20 The code can also output model background fields which are used as an input to data assimilation code. 21 This is all controlled by the namelist \textit{\ngn{nam\_asminc} }. 22 There is a brief description of all the namelist options provided. 23 To build the ASM code \key{asminc} must be set. 24 24 25 25 %=============================================================== … … 28 28 \label{sec:ASM_DI} 29 29 30 Direct initialization (DI) refers to the instantaneous correction 31 of the model background state usingthe analysis increment.30 Direct initialization (DI) refers to the instantaneous correction of the model background state using 31 the analysis increment. 32 32 DI is used when \np{ln\_asmdin} is set to true. 33 33 … … 36 36 37 37 Rather than updating the model state directly with the analysis increment, 38 it may be preferable to introduce the increment gradually into the ocean 39 m odel in order to minimize spurious adjustment processes. This technique40 is referred to as Incremental Analysis Updates (IAU) \citep{Bloom_al_MWR96}.38 it may be preferable to introduce the increment gradually into the ocean model in order to 39 minimize spurious adjustment processes. 40 This technique is referred to as Incremental Analysis Updates (IAU) \citep{Bloom_al_MWR96}. 41 41 IAU is a common technique used with 3D assimilation methods such as 3D-Var or OI. 42 42 IAU is used when \np{ln\_asmiau} is set to true. 43 43 44 With IAU, the model state trajectory ${\bf x}$ in the assimilation window 45 ($t_{0} \leq t_{i} \leq t_{N}$) 46 is corrected by adding the analysis increments for temperature, salinity, horizontal velocity and SSH 47 as additional tendency terms to the prognostic equations: 44 With IAU, the model state trajectory ${\bf x}$ in the assimilation window ($t_{0} \leq t_{i} \leq t_{N}$) 45 is corrected by adding the analysis increments for temperature, salinity, horizontal velocity and SSH as 46 additional tendency terms to the prognostic equations: 48 47 \begin{eqnarray} \label{eq:wa_traj_iau} 49 48 {\bf x}^{a}(t_{i}) = M(t_{i}, t_{0})[{\bf x}^{b}(t_{0})] 50 49 \; + \; F_{i} \delta \tilde{\bf x}^{a} 51 50 \end{eqnarray} 52 where $F_{i}$ is a weighting function for applying the increments $\delta 53 \tilde{\bf x}^{a}$ defined such that $\sum_{i=1}^{N} F_{i}=1$. 54 ${\bf x}^b$ denotes the model initial state and ${\bf x}^a$ is the model state 55 after the increments are applied. 51 where $F_{i}$ is a weighting function for applying the increments $\delta\tilde{\bf x}^{a}$ defined such that 52 $\sum_{i=1}^{N} F_{i}=1$. 53 ${\bf x}^b$ denotes the model initial state and ${\bf x}^a$ is the model state after the increments are applied. 56 54 To control the adjustment time of the model to the increment, 57 the increment can be applied over an arbitrary sub-window, 58 $t_{m} \leq t_{i} \leq t_{n}$, of the main assimilation window, 59 where $t_{0} \leq t_{m} \leq t_{i}$ and $t_{i} \leq t_{n} \leq t_{N}$, 55 the increment can be applied over an arbitrary sub-window, $t_{m} \leq t_{i} \leq t_{n}$, 56 of the main assimilation window, where $t_{0} \leq t_{m} \leq t_{i}$ and $t_{i} \leq t_{n} \leq t_{N}$. 60 57 Typically the increments are spread evenly over the full window. 61 58 In addition, two different weighting functions have been implemented. … … 70 67 \end{eqnarray} 71 68 where $M = m-n$. 72 The second function employs peaked hat-like weights in order to give maximum 73 weight in the centre of the sub-window, with the weighting reduced 74 linearly to a small value at the window end-points: 69 The second function employs peaked hat-like weights in order to give maximum weight in the centre of the sub-window, 70 with the weighting reduced linearly to a small value at the window end-points: 75 71 \begin{eqnarray} \label{eq:F2_i} 76 72 F^{(2)}_{i} … … 83 79 \end{eqnarray} 84 80 where $\alpha^{-1} = \sum_{i=1}^{M/2} 2i$ and $M$ is assumed to be even. 85 The weights described by \autoref{eq:F2_i} provide a 86 smoother transition of the analysis trajectory from one assimilation cycle 87 to the next than that described by \autoref{eq:F1_i}. 81 The weights described by \autoref{eq:F2_i} provide a smoother transition of the analysis trajectory from 82 one assimilation cycle to the next than that described by \autoref{eq:F1_i}. 88 83 89 84 %========================================================================== … … 92 87 \label{sec:ASM_div_dmp} 93 88 94 The velocity increments may be initialized by the iterative application of 95 a divergence damping operator. In iteration step $n$ new estimates of 96 velocity increments $u^{n}_I$ and $v^{n}_I$ are updated by: 89 The velocity increments may be initialized by the iterative application of a divergence damping operator. 90 In iteration step $n$ new estimates of velocity increments $u^{n}_I$ and $v^{n}_I$ are updated by: 97 91 \begin{equation} \label{eq:asm_dmp} 98 92 \left\{ \begin{aligned} … … 110 104 +\delta _j \left[ {e_{1v}\,e_{3v}\,v^{n-1}_I} \right]} \right). 111 105 \end{equation} 112 By the application of \autoref{eq:asm_dmp} and \autoref{eq:asm_dmp} the divergence is filtered 113 in each iteration, and the vorticity is left unchanged. In the presence of coastal boundaries 114 with zero velocity increments perpendicular to the coast the divergence is strongly damped. 115 This type of the initialisation reduces the vertical velocity magnitude and alleviates the 116 problem of the excessive unphysical vertical mixing in the first steps of the model 117 integration \citep{Talagrand_JAS72, Dobricic_al_OS07}. Diffusion coefficients are defined as 118 $A_D = \alpha e_{1t} e_{2t}$, where $\alpha = 0.2$. The divergence damping is activated by 119 assigning to \np{nn\_divdmp} in the \textit{nam\_asminc} namelist a value greater than zero. 120 By choosing this value to be of the order of 100 the increments in the vertical velocity will 121 be significantly reduced. 106 By the application of \autoref{eq:asm_dmp} and \autoref{eq:asm_dmp} the divergence is filtered in each iteration, 107 and the vorticity is left unchanged. 108 In the presence of coastal boundaries with zero velocity increments perpendicular to the coast 109 the divergence is strongly damped. 110 This type of the initialisation reduces the vertical velocity magnitude and 111 alleviates the problem of the excessive unphysical vertical mixing in the first steps of the model integration 112 \citep{Talagrand_JAS72, Dobricic_al_OS07}. 113 Diffusion coefficients are defined as $A_D = \alpha e_{1t} e_{2t}$, where $\alpha = 0.2$. 114 The divergence damping is activated by assigning to \np{nn\_divdmp} in the \textit{nam\_asminc} namelist 115 a value greater than zero. 116 By choosing this value to be of the order of 100 the increments in 117 the vertical velocity will be significantly reduced. 122 118 123 119 … … 127 123 \label{sec:ASM_details} 128 124 129 Here we show an example \ngn{namasm} namelist and the header of an example assimilation 130 increments file onthe ORCA2 grid.125 Here we show an example \ngn{namasm} namelist and the header of an example assimilation increments file on 126 the ORCA2 grid. 131 127 132 128 %------------------------------------------namasm----------------------------------------------------- -
NEMO/trunk/doc/latex/NEMO/subfiles/chap_CONFIG.tex
r10146 r10354 18 18 19 19 20 The purpose of this part of the manual is to introduce the \NEMO reference configurations. 21 These configurations are offered as means to explore various numerical and physical options, 22 thus allowing the user to verify that the code is performing in a manner consistent with that 23 we are running. This form of verification is critical as one adopts the code for his or her particular 24 research purposes. The reference configurations also provide a sense for some of the options available 25 in the code,though by no means are all options exercised in the reference configurations.20 The purpose of this part of the manual is to introduce the \NEMO reference configurations. 21 These configurations are offered as means to explore various numerical and physical options, 22 thus allowing the user to verify that the code is performing in a manner consistent with that we are running. 23 This form of verification is critical as one adopts the code for his or her particular research purposes. 24 The reference configurations also provide a sense for some of the options available in the code, 25 though by no means are all options exercised in the reference configurations. 26 26 27 27 %------------------------------------------namcfg---------------------------------------------------- … … 40 40 $\ $\newline 41 41 42 The 1D model option simulates a stand alone water column within the 3D \NEMO system. 43 It can be applied to the ocean alone or to the ocean-ice system and can include passive tracers 44 or a biogeochemical model. It is set up by defining the position of the 1D water column in the grid 42 The 1D model option simulates a stand alone water column within the 3D \NEMO system. 43 It can be applied to the ocean alone or to the ocean-ice system and can include passive tracers or a biogeochemical model. 44 It is set up by defining the position of the 1D water column in the grid 45 45 (see \textit{CONFIG/SHARED/namelist\_ref} ). 46 The 1D model is a very useful tool 47 \textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes ;48 \textit{(b)} to investigate suitable parameterisations of unresolved turbulence (surface wave49 breaking, Langmuir circulation, ...) ; 50 \textit{(c)} to compare the behaviour of different vertical mixing schemes ;51 \textit{(d)} to perform sensitivity studies on the vertical diffusion at a particular point of an ocean domain ;46 The 1D model is a very useful tool 47 \textit{(a)} to learn about the physics and numerical treatment of vertical mixing processes; 48 \textit{(b)} to investigate suitable parameterisations of unresolved turbulence 49 (surface wave breaking, Langmuir circulation, ...); 50 \textit{(c)} to compare the behaviour of different vertical mixing schemes; 51 \textit{(d)} to perform sensitivity studies on the vertical diffusion at a particular point of an ocean domain; 52 52 \textit{(d)} to produce extra diagnostics, without the large memory requirement of the full 3D model. 53 53 54 The methodology is based on the use of the zoom functionality over the smallest possible 55 domain : a 3x3 domain centered on the grid point of interest, 56 with some extra routines. There is no need to define a new mesh, bathymetry, 57 initial state or forcing, since the 1D model will use those of the configuration it is a zoom of. 58 The chosen grid point is set in \textit{\ngn{namcfg}} namelist by setting the \np{jpizoom} and \np{jpjzoom}59 parameters to the indices of the location of the chosen grid point.60 61 The 1D model has some specifies. First, all the horizontal derivatives are assumed to be zero, and62 second, the two components of the velocity are moved on a $T$-point.54 The methodology is based on the use of the zoom functionality over the smallest possible domain: 55 a 3x3 domain centered on the grid point of interest, with some extra routines. 56 There is no need to define a new mesh, bathymetry, initial state or forcing, 57 since the 1D model will use those of the configuration it is a zoom of. 58 The chosen grid point is set in \textit{\ngn{namcfg}} namelist by 59 setting the \np{jpizoom} and \np{jpjzoom} parameters to the indices of the location of the chosen grid point. 60 61 The 1D model has some specifies. First, all the horizontal derivatives are assumed to be zero, 62 and second, the two components of the velocity are moved on a $T$-point. 63 63 Therefore, defining \key{c1d} changes five main things in the code behaviour: 64 64 \begin{description} 65 \item[(1)] the lateral boundary condition routine (\rou{lbc\_lnk}) set the value of the central column 66 of the 3x3 domain is imposed over the whole domain ; 67 \item[(3)] a call to \rou{lbc\_lnk} is systematically done when reading input data ($i.e.$ in \mdl{iom}) ; 68 \item[(3)] a simplified \rou{stp} routine is used (\rou{stp\_c1d}, see \mdl{step\_c1d} module) in which 69 both lateral tendancy terms and lateral physics are not called ; 70 \item[(4)] the vertical velocity is zero (so far, no attempt at introducing a Ekman pumping velocity 71 has been made) ; 72 \item[(5)] a simplified treatment of the Coriolis term is performed as $U$- and $V$-points are the same 73 (see \mdl{dyncor\_c1d}). 65 \item[(1)] 66 the lateral boundary condition routine (\rou{lbc\_lnk}) set the value of the central column of 67 the 3x3 domain is imposed over the whole domain; 68 \item[(3)] 69 a call to \rou{lbc\_lnk} is systematically done when reading input data ($i.e.$ in \mdl{iom}); 70 \item[(3)] 71 a simplified \rou{stp} routine is used (\rou{stp\_c1d}, see \mdl{step\_c1d} module) in which 72 both lateral tendancy terms and lateral physics are not called; 73 \item[(4)] 74 the vertical velocity is zero 75 (so far, no attempt at introducing a Ekman pumping velocity has been made); 76 \item[(5)] 77 a simplified treatment of the Coriolis term is performed as $U$- and $V$-points are the same 78 (see \mdl{dyncor\_c1d}). 74 79 \end{description} 75 All the relevant \textit{\_c1d} modules can be found in the NEMOGCM/NEMO/OPA\_SRC/C1D directory of 80 All the relevant \textit{\_c1d} modules can be found in the NEMOGCM/NEMO/OPA\_SRC/C1D directory of 76 81 the \NEMO distribution. 77 82 … … 84 89 \label{sec:CFG_orca} 85 90 86 The ORCA family is a series of global ocean configurations that are run together with 87 the LIM sea-ice model (ORCA-LIM) and possibly with PISCES biogeochemical model 88 (ORCA-LIM-PISCES),using various resolutions.89 An appropriate namelist is available in \path{CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg} 90 for ORCA2. 91 The domain of ORCA2 configuration is defined in \ifile{ORCA\_R2\_zps\_domcfg} file, this file is available in tar file in the wiki of NEMO: \\91 The ORCA family is a series of global ocean configurations that are run together with 92 the LIM sea-ice model (ORCA-LIM) and possibly with PISCES biogeochemical model (ORCA-LIM-PISCES), 93 using various resolutions. 94 An appropriate namelist is available in \path{CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg} for ORCA2. 95 The domain of ORCA2 configuration is defined in \ifile{ORCA\_R2\_zps\_domcfg} file, 96 this file is available in tar file in the wiki of NEMO: \\ 92 97 https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ReferenceConfigurations/ORCA2\_LIM3\_PISCES \\ 93 98 In this namelist\_cfg the name of domain input file is set in \ngn{namcfg} block of namelist. 94 99 95 100 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 96 \begin{figure}[!t] \begin{center} 97 \includegraphics[width=0.98\textwidth]{Fig_ORCA_NH_mesh} 98 \caption{ \protect\label{fig:MISC_ORCA_msh} 99 ORCA mesh conception. The departure from an isotropic Mercator grid start poleward of 20\degN. 100 The two "north pole" are the foci of a series of embedded ellipses (blue curves) 101 which are determined analytically and form the i-lines of the ORCA mesh (pseudo latitudes). 102 Then, following \citet{Madec_Imbard_CD96}, the normal to the series of ellipses (red curves) is computed 103 which provide the j-lines of the mesh (pseudo longitudes). } 104 \end{center} \end{figure} 101 \begin{figure}[!t] 102 \begin{center} 103 \includegraphics[width=0.98\textwidth]{Fig_ORCA_NH_mesh} 104 \caption{ \protect\label{fig:MISC_ORCA_msh} 105 ORCA mesh conception. 106 The departure from an isotropic Mercator grid start poleward of 20\degN. 107 The two "north pole" are the foci of a series of embedded ellipses (blue curves) which 108 are determined analytically and form the i-lines of the ORCA mesh (pseudo latitudes). 109 Then, following \citet{Madec_Imbard_CD96}, the normal to the series of ellipses (red curves) is computed which 110 provides the j-lines of the mesh (pseudo longitudes). } 111 \end{center} 112 \end{figure} 105 113 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 106 114 … … 111 119 \label{subsec:CFG_orca_grid} 112 120 113 The ORCA grid is a tripolar is based on the semi-analytical method of \citet{Madec_Imbard_CD96}. 114 It allows to construct a global orthogonal curvilinear ocean mesh which has no singularity point inside 121 The ORCA grid is a tripolar is based on the semi-analytical method of \citet{Madec_Imbard_CD96}. 122 It allows to construct a global orthogonal curvilinear ocean mesh which has no singularity point inside 115 123 the computational domain since two north mesh poles are introduced and placed on lands. 116 The method involves defining an analytical set of mesh parallels in the stereographic polar plan, 117 computing the associated set of mesh meridians, and projecting the resulting mesh onto the sphere. 118 The set of mesh parallels used is a series of embedded ellipses which foci are the two mesh north 119 poles (\autoref{fig:MISC_ORCA_msh}). The resulting mesh presents no loss of continuity in 120 either the mesh lines or the scale factors, or even the scale factor derivatives over the whole 121 ocean domain, as the mesh is not a composite mesh. 122 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 123 \begin{figure}[!tbp] \begin{center} 124 \includegraphics[width=1.0\textwidth]{Fig_ORCA_NH_msh05_e1_e2} 125 \includegraphics[width=0.80\textwidth]{Fig_ORCA_aniso} 126 \caption { \protect\label{fig:MISC_ORCA_e1e2} 127 \textit{Top}: Horizontal scale factors ($e_1$, $e_2$) and 128 \textit{Bottom}: ratio of anisotropy ($e_1 / e_2$) 129 for ORCA 0.5\deg ~mesh. South of 20\degN a Mercator grid is used ($e_1 = e_2$) 130 so that the anisotropy ratio is 1. Poleward of 20\degN, the two "north pole" 131 introduce a weak anisotropy over the ocean areas ($< 1.2$) except in vicinity of Victoria Island 132 (Canadian Arctic Archipelago). } 124 The method involves defining an analytical set of mesh parallels in the stereographic polar plan, 125 computing the associated set of mesh meridians, and projecting the resulting mesh onto the sphere. 126 The set of mesh parallels used is a series of embedded ellipses which foci are the two mesh north poles 127 (\autoref{fig:MISC_ORCA_msh}). 128 The resulting mesh presents no loss of continuity in either the mesh lines or the scale factors, 129 or even the scale factor derivatives over the whole ocean domain, as the mesh is not a composite mesh. 130 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 131 \begin{figure}[!tbp] 132 \begin{center} 133 \includegraphics[width=1.0\textwidth]{Fig_ORCA_NH_msh05_e1_e2} 134 \includegraphics[width=0.80\textwidth]{Fig_ORCA_aniso} 135 \caption { \protect\label{fig:MISC_ORCA_e1e2} 136 \textit{Top}: Horizontal scale factors ($e_1$, $e_2$) and 137 \textit{Bottom}: ratio of anisotropy ($e_1 / e_2$) 138 for ORCA 0.5\deg ~mesh. 139 South of 20\degN a Mercator grid is used ($e_1 = e_2$) so that the anisotropy ratio is 1. 140 Poleward of 20\degN, the two "north pole" introduce a weak anisotropy over the ocean areas ($< 1.2$) except in 141 vicinity of Victoria Island (Canadian Arctic Archipelago). } 133 142 \end{center} \end{figure} 134 143 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 135 144 136 145 137 The method is applied to Mercator grid ($i.e.$ same zonal and meridional grid spacing) poleward 138 of 20\degN, so that the Equator is a mesh line, which provides a better numerical solution 139 for equatorial dynamics. The choice of the series of embedded ellipses (position of the foci and 140 variation of the ellipses) is a compromise between maintaining the ratio of mesh anisotropy 141 ($e_1 / e_2$) close to one in the ocean (especially in area of strong eddy activities such as 142 the Gulf Stream) and keeping the smallest scale factor in the northern hemisphere larger 143 than the smallest one in the southern hemisphere. 144 The resulting mesh is shown in \autoref{fig:MISC_ORCA_msh} and \autoref{fig:MISC_ORCA_e1e2} 145 for a half a degree grid (ORCA\_R05). 146 The smallest ocean scale factor is found in along Antarctica, while the ratio of anisotropy remains close to one except near the Victoria Island 147 in the Canadian Archipelago. 146 The method is applied to Mercator grid ($i.e.$ same zonal and meridional grid spacing) poleward of 20\degN, 147 so that the Equator is a mesh line, which provides a better numerical solution for equatorial dynamics. 148 The choice of the series of embedded ellipses (position of the foci and variation of the ellipses) 149 is a compromise between maintaining the ratio of mesh anisotropy ($e_1 / e_2$) close to one in the ocean 150 (especially in area of strong eddy activities such as the Gulf Stream) and keeping the smallest scale factor in 151 the northern hemisphere larger than the smallest one in the southern hemisphere. 152 The resulting mesh is shown in \autoref{fig:MISC_ORCA_msh} and \autoref{fig:MISC_ORCA_e1e2} for 153 a half a degree grid (ORCA\_R05). 154 The smallest ocean scale factor is found in along Antarctica, 155 while the ratio of anisotropy remains close to one except near the Victoria Island in the Canadian Archipelago. 148 156 149 157 % ------------------------------------------------------------------------------------------------------------- … … 154 162 155 163 156 The NEMO system is provided with five built-in ORCA configurations which differ in the 157 horizontal resolution. The value of the resolution is given by the resolution at the Equator 158 expressed in degrees. Each of configuration is set through the \textit{domain\_cfg} domain configuration file, 159 which sets the grid size and configuration name parameters. The NEMO System Team provides only ORCA2 domain input file "\ifile{ORCA\_R2\_zps\_domcfg}" file (Tab. \autoref{tab:ORCA}). 164 The NEMO system is provided with five built-in ORCA configurations which differ in the horizontal resolution. 165 The value of the resolution is given by the resolution at the Equator expressed in degrees. 166 Each of configuration is set through the \textit{domain\_cfg} domain configuration file, 167 which sets the grid size and configuration name parameters. 168 The NEMO System Team provides only ORCA2 domain input file "\ifile{ORCA\_R2\_zps\_domcfg}" file 169 (Tab. \autoref{tab:ORCA}). 160 170 161 171 … … 176 186 \hline \hline 177 187 \end{tabular} 178 \caption{ \protect\label{tab:ORCA} 179 Domain size of ORCA family configurations.180 The flag for configurations of ORCA family need to be set in \textit{domain\_cfg} file. }188 \caption{ \protect\label{tab:ORCA} 189 Domain size of ORCA family configurations. 190 The flag for configurations of ORCA family need to be set in \textit{domain\_cfg} file. } 181 191 \end{center} 182 192 \end{table} … … 184 194 185 195 186 The ORCA\_R2 configuration has the following specificity : starting from a 2\deg~ORCA mesh, 187 local mesh refinements were applied to the Mediterranean, Red, Black and Caspian Seas, 188 so that the resolution is 1\deg \time 1\deg there. A local transformation were also applied 189 with in the Tropics in order to refine the meridional resolution up to 0.5\deg at the Equator. 190 191 The ORCA\_R1 configuration has only a local tropical transformation to refine the meridional 192 resolution up to 1/3\deg~at the Equator. Note that the tropical mesh refinements in ORCA\_R2 193 and R1 strongly increases the mesh anisotropy there. 196 The ORCA\_R2 configuration has the following specificity: starting from a 2\deg~ORCA mesh, 197 local mesh refinements were applied to the Mediterranean, Red, Black and Caspian Seas, 198 so that the resolution is 1\deg \time 1\deg there. 199 A local transformation were also applied with in the Tropics in order to refine the meridional resolution up to 200 0.5\deg at the Equator. 201 202 The ORCA\_R1 configuration has only a local tropical transformation to refine the meridional resolution up to 203 1/3\deg~at the Equator. 204 Note that the tropical mesh refinements in ORCA\_R2 and R1 strongly increases the mesh anisotropy there. 194 205 195 206 The ORCA\_R05 and higher global configurations do not incorporate any regional refinements. 196 207 197 For ORCA\_R1 and R025, setting the configuration key to 75 allows to use 75 vertical levels, 198 otherwise 46 are used. In the other ORCA configurations, 31 levels are used 208 For ORCA\_R1 and R025, setting the configuration key to 75 allows to use 75 vertical levels, otherwise 46 are used. 209 In the other ORCA configurations, 31 levels are used 199 210 (see \autoref{tab:orca_zgr} \sfcomment{HERE I need to put new table for ORCA2 values} and \autoref{fig:zgr}). 200 211 201 Only the ORCA\_R2 is provided with all its input files in the \NEMO distribution. 202 It is very similar to that used as part of the climate model developed at IPSL for the 4th IPCC 203 assessment of climate change (Marti et al., 2009). It is also the basis for the \NEMO contribution 204 to the Coordinate Ocean-ice Reference Experiments (COREs) documented in \citet{Griffies_al_OM09}. 205 206 This version of ORCA\_R2 has 31 levels in the vertical, with the highest resolution (10m) 207 in the upper 150m (see \autoref{tab:orca_zgr} and \autoref{fig:zgr}). 212 Only the ORCA\_R2 is provided with all its input files in the \NEMO distribution. 213 It is very similar to that used as part of the climate model developed at IPSL for the 4th IPCC assessment of 214 climate change (Marti et al., 2009). 215 It is also the basis for the \NEMO contribution to the Coordinate Ocean-ice Reference Experiments (COREs) 216 documented in \citet{Griffies_al_OM09}. 217 218 This version of ORCA\_R2 has 31 levels in the vertical, with the highest resolution (10m) in the upper 150m 219 (see \autoref{tab:orca_zgr} and \autoref{fig:zgr}). 208 220 The bottom topography and the coastlines are derived from the global atlas of Smith and Sandwell (1997). 209 221 The default forcing uses the boundary forcing from \citet{Large_Yeager_Rep04} (see \autoref{subsec:SBC_blk_core}), 210 which was developed for the purpose of running global coupled ocean-ice simulations 211 without an interactive atmosphere. This \citet{Large_Yeager_Rep04} dataset is available 212 through the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}{GFDL web site}. 213 The "normal year" of \citet{Large_Yeager_Rep04} has been chosen of the \NEMO distribution 214 since release v3.3.215 216 ORCA\_R2 pre-defined configuration can also be run with an AGRIF zoom over the Agulhas 217 current area ( \key{agrif} defined) and, by setting the appropriate variables, see \path{CONFIG/SHARED/namelist_ref} 218 a regional Arctic or peri-Antarctic configuration is extracted from an ORCA\_R2 or R05 configurations 219 usingsponge layers at open boundaries.222 which was developed for the purpose of running global coupled ocean-ice simulations without 223 an interactive atmosphere. 224 This \citet{Large_Yeager_Rep04} dataset is available through 225 the \href{http://nomads.gfdl.noaa.gov/nomads/forms/mom4/CORE.html}{GFDL web site}. 226 The "normal year" of \citet{Large_Yeager_Rep04} has been chosen of the \NEMO distribution since release v3.3. 227 228 ORCA\_R2 pre-defined configuration can also be run with an AGRIF zoom over the Agulhas current area 229 (\key{agrif} defined) and, by setting the appropriate variables, see \path{CONFIG/SHARED/namelist_ref}. 230 A regional Arctic or peri-Antarctic configuration is extracted from an ORCA\_R2 or R05 configurations using 231 sponge layers at open boundaries. 220 232 221 233 % ------------------------------------------------------------------------------------------------------------- … … 225 237 \label{sec:CFG_gyre} 226 238 227 The GYRE configuration \citep{Levy_al_OM10} has been built to simulate228 the seasonal cycle of a double-gyre box model. It consists in an idealized domain 229 similar to that used in the studies of \citet{Drijfhout_JPO94} and \citet{Hazeleger_Drijfhout_JPO98, 230 Hazeleger_Drijfhout_JPO99, Hazeleger_Drijfhout_JGR00, Hazeleger_Drijfhout_JPO00}, 231 over which an analytical seasonal forcing is applied. This allows to investigate the232 spontaneous generation of a large number of interacting, transient mesoscale eddies239 The GYRE configuration \citep{Levy_al_OM10} has been built to 240 simulate the seasonal cycle of a double-gyre box model. 241 It consists in an idealized domain similar to that used in the studies of \citet{Drijfhout_JPO94} and 242 \citet{Hazeleger_Drijfhout_JPO98, Hazeleger_Drijfhout_JPO99, Hazeleger_Drijfhout_JGR00, Hazeleger_Drijfhout_JPO00}, 243 over which an analytical seasonal forcing is applied. 244 This allows to investigate the spontaneous generation of a large number of interacting, transient mesoscale eddies 233 245 and their contribution to the large scale circulation. 234 246 235 The domain geometry is a closed rectangular basin on the $\beta$-plane centred 236 at $\sim$ 30\degN and rotated by 45\deg, 3180~km long, 2120~km wide 237 and 4~km deep (\autoref{fig:MISC_strait_hand}). 238 The domain is bounded by vertical walls and by a flat bottom. The configuration is 239 meant to represent an idealized North Atlantic or North Pacific basin. 240 The circulation is forced by analytical profiles of wind and buoyancy fluxes. 241 The applied forcings vary seasonally in a sinusoidal manner between winter 242 and summer extrema \citep{Levy_al_OM10}. 243 The wind stress is zonal and its curl changes sign at 22\degN and 36\degN. 244 It forces a subpolar gyre in the north, a subtropical gyre in the wider part of the domain 245 and a small recirculation gyre in the southern corner. 246 The net heat flux takes the form of a restoring toward a zonal apparent air 247 temperature profile. A portion of the net heat flux which comes from the solar radiation 248 is allowed to penetrate within the water column. 249 The fresh water flux is also prescribed and varies zonally. 250 It is determined such as, at each time step, the basin-integrated flux is zero. 251 The basin is initialised at rest with vertical profiles of temperature and salinity 252 uniformly applied to the whole domain. 253 254 The GYRE configuration is set like an analytical configuration. Through \np{ln\_read\_cfg}\forcode{ = .false.} in \textit{namcfg} namelist defined in the reference configuration \path{CONFIG/GYRE/EXP00/namelist_cfg} anaylitical definition of grid in GYRE is done in usrdef\_hrg, usrdef\_zgr routines. Its horizontal resolution 255 (and thus the size of the domain) is determined by setting \np{nn\_GYRE} in \ngn{namusr\_def}: \\ 247 The domain geometry is a closed rectangular basin on the $\beta$-plane centred at $\sim$ 30\degN and 248 rotated by 45\deg, 3180~km long, 2120~km wide and 4~km deep (\autoref{fig:MISC_strait_hand}). 249 The domain is bounded by vertical walls and by a flat bottom. 250 The configuration is meant to represent an idealized North Atlantic or North Pacific basin. 251 The circulation is forced by analytical profiles of wind and buoyancy fluxes. 252 The applied forcings vary seasonally in a sinusoidal manner between winter and summer extrema \citep{Levy_al_OM10}. 253 The wind stress is zonal and its curl changes sign at 22\degN and 36\degN. 254 It forces a subpolar gyre in the north, a subtropical gyre in the wider part of the domain and 255 a small recirculation gyre in the southern corner. 256 The net heat flux takes the form of a restoring toward a zonal apparent air temperature profile. 257 A portion of the net heat flux which comes from the solar radiation is allowed to penetrate within the water column. 258 The fresh water flux is also prescribed and varies zonally. 259 It is determined such as, at each time step, the basin-integrated flux is zero. 260 The basin is initialised at rest with vertical profiles of temperature and salinity uniformly applied to 261 the whole domain. 262 263 The GYRE configuration is set like an analytical configuration. 264 Through \np{ln\_read\_cfg}\forcode{ = .false.} in \textit{namcfg} namelist defined in 265 the reference configuration \path{CONFIG/GYRE/EXP00/namelist_cfg} 266 analytical definition of grid in GYRE is done in usrdef\_hrg, usrdef\_zgr routines. 267 Its horizontal resolution (and thus the size of the domain) is determined by 268 setting \np{nn\_GYRE} in \ngn{namusr\_def}: \\ 256 269 \np{jpiglo} $= 30 \times$ \np{nn\_GYRE} + 2 \\ 257 270 \np{jpjglo} $= 20 \times$ \np{nn\_GYRE} + 2 \\ 258 Obviously, the namelist parameters have to be adjusted to the chosen resolution, see the Configurations259 pages on the NEMO web site (Using NEMO\/Configurations).271 Obviously, the namelist parameters have to be adjusted to the chosen resolution, 272 see the Configurations pages on the NEMO web site (Using NEMO\/Configurations). 260 273 In the vertical, GYRE uses the default 30 ocean levels (\jp{jpk}\forcode{ = 31}) (\autoref{fig:zgr}). 261 274 262 The GYRE configuration is also used in benchmark test as it is very simple to increase 263 its resolution and as it does not requires any input file. For example, keeping a same model size 264 on each processor while increasing the number of processor used is very easy, even though the 265 physical integrity of the solution can be compromised. Benchmark is activate via \np{ln\_bench}\forcode{ = .true.} in \ngn{namusr\_def} in namelist \path{CONFIG/GYRE/EXP00/namelist_cfg}. 266 267 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 268 \begin{figure}[!t] \begin{center} 269 \includegraphics[width=1.0\textwidth]{Fig_GYRE} 270 \caption{ \protect\label{fig:GYRE} 271 Snapshot of relative vorticity at the surface of the model domain 272 in GYRE R9, R27 and R54. From \citet{Levy_al_OM10}.} 273 \end{center} \end{figure} 275 The GYRE configuration is also used in benchmark test as it is very simple to increase its resolution and 276 as it does not requires any input file. 277 For example, keeping a same model size on each processor while increasing the number of processor used is very easy, 278 even though the physical integrity of the solution can be compromised. 279 Benchmark is activate via \np{ln\_bench}\forcode{ = .true.} in \ngn{namusr\_def} in 280 namelist \path{CONFIG/GYRE/EXP00/namelist_cfg}. 281 282 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 283 \begin{figure}[!t] 284 \begin{center} 285 \includegraphics[width=1.0\textwidth]{Fig_GYRE} 286 \caption{ \protect\label{fig:GYRE} 287 Snapshot of relative vorticity at the surface of the model domain in GYRE R9, R27 and R54. 288 From \citet{Levy_al_OM10}.} 289 \end{center} 290 \end{figure} 274 291 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 275 292 … … 280 297 \label{sec:MISC_config_AMM} 281 298 282 The AMM, Atlantic Margins Model, is a regional model covering the 283 Northwest European Shelf domain on a regular lat-lon grid at 284 approximately 12km horizontal resolution. The appropriate 285 \textit{\&namcfg} namelist is available in \textit{CONFIG/AMM12/EXP00/namelist\_cfg}. 299 The AMM, Atlantic Margins Model, is a regional model covering the Northwest European Shelf domain on 300 a regular lat-lon grid at approximately 12km horizontal resolution. 301 The appropriate \textit{\&namcfg} namelist is available in \textit{CONFIG/AMM12/EXP00/namelist\_cfg}. 286 302 It is used to build the correct dimensions of the AMM domain. 287 303 288 This configuration tests several features of NEMO functionality specific 289 to the shelf seas. 290 In particular, the AMM uses $S$-coordinates in the vertical rather than 291 $z$-coordinates and is forced with tidal lateral boundary conditions 292 using a flather boundary condition from the BDY module. 293 The AMM configuration uses the GLS (\key{zdfgls}) turbulence scheme, the 294 VVL non-linear free surface(\key{vvl}) and time-splitting 295 (\key{dynspg\_ts}). 296 297 In addition to the tidal boundary condition the model may also take 298 open boundary conditions from a North Atlantic model. Boundaries may be 299 completely omitted by setting \np{ln\_bdy} to false. 300 Sample surface fluxes, river forcing and a sample initial restart file 301 are included to test a realistic model run. The Baltic boundary is 302 included within the river input file and is specified as a river source. 303 Unlike ordinary river points the Baltic inputs also include salinity and 304 temperature data. 304 This configuration tests several features of NEMO functionality specific to the shelf seas. 305 In particular, the AMM uses $S$-coordinates in the vertical rather than $z$-coordinates and 306 is forced with tidal lateral boundary conditions using a flather boundary condition from the BDY module. 307 The AMM configuration uses the GLS (\key{zdfgls}) turbulence scheme, 308 the VVL non-linear free surface(\key{vvl}) and time-splitting (\key{dynspg\_ts}). 309 310 In addition to the tidal boundary condition the model may also take open boundary conditions from 311 a North Atlantic model. 312 Boundaries may be completely omitted by setting \np{ln\_bdy} to false. 313 Sample surface fluxes, river forcing and a sample initial restart file are included to test a realistic model run. 314 The Baltic boundary is included within the river input file and is specified as a river source. 315 Unlike ordinary river points the Baltic inputs also include salinity and temperature data. 305 316 306 317 \end{document} -
NEMO/trunk/doc/latex/NEMO/subfiles/chap_DIA.tex
r10146 r10354 17 17 \label{sec:DIA_io_old} 18 18 19 The model outputs are of three types: the restart file, the output listing, and 20 the diagnostic output file(s). 21 The restart file is used internally by the code when the user wants to start the model with 19 The model outputs are of three types: the restart file, the output listing, and the diagnostic output file(s). 20 The restart file is used internally by the code when the user wants to start the model with 22 21 initial conditions defined by a previous simulation. 23 It contains all the information that is necessary in order for there to be no changes in 24 the model results (even at the computer precision) between a run performed with several restarts and 22 It contains all the information that is necessary in order for there to be no changes in the model results 23 (even at the computer precision) between a run performed with several restarts and 25 24 the same run performed in one step. 26 It should be noted that this requires that the restart file contains two consecutive time steps for 27 all the prognostic variables, and that it is saved in the same binary format as the one used by 28 the computer that is to read it (in particular, 32 bits binary IEEE format must not be used for this file). 29 30 The output listing and file(s) are predefined but should be checked and eventually adapted to 31 the user's needs. 25 It should be noted that this requires that the restart file contains two consecutive time steps for 26 all the prognostic variables, and that it is saved in the same binary format as the one used by the computer that 27 is to read it (in particular, 32 bits binary IEEE format must not be used for this file). 28 29 The output listing and file(s) are predefined but should be checked and eventually adapted to the user's needs. 32 30 The output listing is stored in the $ocean.output$ file. 33 31 The information is printed from within the code on the logical unit $numout$. … … 35 33 36 34 By default, diagnostic output files are written in NetCDF format. 37 Since version 3.2, when defining \key{iomput}, an I/O server has been added which 38 provides more flexibility in the choice of the fields to be written as well as 39 how the writing work is distributed over the processors in massively parallel computing. 40 A complete description of the use of this I/O server is presented in the next section. 41 42 By default, \key{iomput} is not defined, NEMO produces NetCDF with the old IOIPSL library which43 has been kept for compatibility and its easy installation.44 However, the IOIPSL library is quite inefficient on parallel machines and, since version 3.2, 45 many diagnostic options have been added presuming the use of \key{iomput}. 46 The usefulness of the default IOIPSL-based option is expected to reduce with each new release. 47 If \key{iomput} is not defined, output files and content are defined in the \mdl{diawri} module and 48 contain mean (or instantaneous if \key{diainstant} is defined) values over a regular period of 35 Since version 3.2, when defining \key{iomput}, an I/O server has been added which 36 provides more flexibility in the choice of the fields to be written as well as how 37 the writing work is distributed over the processors in massively parallel computing. 38 A complete description of the use of this I/O server is presented in the next section. 39 40 By default, \key{iomput} is not defined, 41 NEMO produces NetCDF with the old IOIPSL library which has been kept for compatibility and its easy installation. 42 However, the IOIPSL library is quite inefficient on parallel machines and, since version 3.2, 43 many diagnostic options have been added presuming the use of \key{iomput}. 44 The usefulness of the default IOIPSL-based option is expected to reduce with each new release. 45 If \key{iomput} is not defined, output files and content are defined in the \mdl{diawri} module and 46 contain mean (or instantaneous if \key{diainstant} is defined) values over a regular period of 49 47 nn\_write time-steps (namelist parameter). 50 48 … … 57 55 \label{sec:DIA_iom} 58 56 59 Since version 3.2, iomput is the NEMO output interface of choice. 60 It has been designed to be simple to use, flexible and efficient. 57 Since version 3.2, iomput is the NEMO output interface of choice. 58 It has been designed to be simple to use, flexible and efficient. 61 59 The two main purposes of iomput are: 62 60 63 61 \begin{enumerate} 64 \item The complete and flexible control of the output files through external XML files adapted by 65 the user from standard templates. 66 \item To achieve high performance and scalable output through the optional distribution of 67 all diagnostic output related tasks to dedicated processes. 62 \item 63 The complete and flexible control of the output files through external XML files adapted by 64 the user from standard templates. 65 \item 66 To achieve high performance and scalable output through the optional distribution of 67 all diagnostic output related tasks to dedicated processes. 68 68 \end{enumerate} 69 69 … … 72 72 73 73 \begin{itemize} 74 \item The choice of output frequencies that can be different for each file 75 (including real months and years). 76 \item The choice of file contents; includes complete flexibility over which data are written in 77 which files (the same data can be written in different files). 78 \item The possibility to split output files at a chosen frequency. 79 \item The possibility to extract a vertical or an horizontal subdomain. 80 \item The choice of the temporal operation to perform, 81 e.g.: average, accumulate, instantaneous, min, max and once. 82 \item Control over metadata via a large XML "database" of possible output fields. 74 \item 75 The choice of output frequencies that can be different for each file (including real months and years). 76 \item 77 The choice of file contents; includes complete flexibility over which data are written in which files 78 (the same data can be written in different files). 79 \item 80 The possibility to split output files at a chosen frequency. 81 \item 82 The possibility to extract a vertical or an horizontal subdomain. 83 \item 84 The choice of the temporal operation to perform, $e.g.$: average, accumulate, instantaneous, min, max and once. 85 \item 86 Control over metadata via a large XML "database" of possible output fields. 83 87 \end{itemize} 84 88 85 In addition, iomput allows the user to add in the code the output of any new variable (scalar, 2D or 86 3D)in a very easy way.89 In addition, iomput allows the user to add in the code the output of any new variable (scalar, 2D or 3D) 90 in a very easy way. 87 91 All details of iomput functionalities are listed in the following subsections. 88 Examples of the XML files that control the outputs can be found in: 89 \path{NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml}, \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and 90 \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}. \\ 92 Examples of the XML files that control the outputs can be found in: \path{NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml}, 93 \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}. \\ 91 94 92 95 The second functionality targets output performance when running in parallel (\key{mpp\_mpi}). 93 Iomput provides the possibility to specify N dedicated I/O processes (in addition to 94 t he NEMO processes) to collect and write the outputs.95 With an appropriate choice of N by the user, the bottleneck associated with the writing of 96 Iomput provides the possibility to specify N dedicated I/O processes (in addition to the NEMO processes) 97 to collect and write the outputs. 98 With an appropriate choice of N by the user, the bottleneck associated with the writing of 96 99 the output files can be greatly reduced. 97 100 98 In version 3.6, the iom\_put interface depends on an external code called99 \href{https://forge.ipsl.jussieu.fr/ioserver/browser/XIOS/branchs/xios-1.0}{XIOS-1.0}101 In version 3.6, the iom\_put interface depends on 102 an external code called \href{https://forge.ipsl.jussieu.fr/ioserver/browser/XIOS/branchs/xios-1.0}{XIOS-1.0} 100 103 (use of revision 618 or higher is required). 101 This new IO server can take advantage of the parallel I/O functionality of NetCDF4 to 104 This new IO server can take advantage of the parallel I/O functionality of NetCDF4 to 102 105 create a single output file and therefore to bypass the rebuilding phase. 103 Note that writing in parallel into the same NetCDF files requires that 104 your NetCDF4 library is linked to an HDF5 library that has been correctly compiled ($i.e.$ with 105 the configure option $--$enable-parallel). 106 Note that writing in parallel into the same NetCDF files requires that your NetCDF4 library is linked to 107 an HDF5 library that has been correctly compiled ($i.e.$ with the configure option $--$enable-parallel). 106 108 Note that the files created by iomput through XIOS are incompatible with NetCDF3. 107 All post-processsing and visualization tools must therefore be compatible with 108 NetCDF4 and not only NetCDF3. 109 110 Even if not using the parallel I/O functionality of NetCDF4, using N dedicated I/O servers, 111 where N is typically much less than the number of NEMO processors, 112 will reduce the number of output files created. 113 This can greatly reduce the post-processing burden usually associated with using 114 large numbers of NEMO processors. 115 Note that for smaller configurations, the rebuilding phase can be avoided, even without 116 a parallel-enabled NetCDF4 library, simply by employing only one dedicated I/O server. 109 All post-processsing and visualization tools must therefore be compatible with NetCDF4 and not only NetCDF3. 110 111 Even if not using the parallel I/O functionality of NetCDF4, using N dedicated I/O servers, 112 where N is typically much less than the number of NEMO processors, will reduce the number of output files created. 113 This can greatly reduce the post-processing burden usually associated with using large numbers of NEMO processors. 114 Note that for smaller configurations, the rebuilding phase can be avoided, 115 even without a parallel-enabled NetCDF4 library, simply by employing only one dedicated I/O server. 117 116 118 117 \subsection{XIOS: XML Inputs-Outputs Server} … … 120 119 \subsubsection{Attached or detached mode?} 121 120 122 Iomput is based on \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS}, 121 Iomput is based on \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS}, 123 122 the io\_server developed by Yann Meurdesoif from IPSL. 124 123 The behaviour of the I/O subsystem is controlled by settings in the external XML files listed above. … … 127 126 \xmlline|<variable id="using_server" type="bool"></variable>| 128 127 129 The {\tt using\_server} setting determines whether or not the server will be used in 130 \textit{attached mode} (as a library) [{\tt> false <}] or in \textit{detached mode} (as 131 an external executable on N additional, dedicated cpus) [{\tt > true <}].128 The {\tt using\_server} setting determines whether or not the server will be used in \textit{attached mode} 129 (as a library) [{\tt> false <}] or in \textit{detached mode} 130 (as an external executable on N additional, dedicated cpus) [{\tt > true <}]. 132 131 The \textit{attached mode} is simpler to use but much less efficient for massively parallel applications. 133 132 The type of each file can be either ''multiple\_file'' or ''one\_file''. 134 133 135 In \textit{attached mode} and if the type of file is ''multiple\_file'', 134 In \textit{attached mode} and if the type of file is ''multiple\_file'', 136 135 then each NEMO process will also act as an IO server and produce its own set of output files. 137 136 Superficially, this emulates the standard behaviour in previous versions. 138 However, the subdomain written out by each process does not correspond to 137 However, the subdomain written out by each process does not correspond to 139 138 the \forcode{jpi x jpj x jpk} domain actually computed by the process (although it may if \forcode{jpni=1}). 140 139 Instead each process will have collected and written out a number of complete longitudinal strips. 141 If the ''one\_file'' option is chosen then all processes will collect their longitudinal strips and 140 If the ''one\_file'' option is chosen then all processes will collect their longitudinal strips and 142 141 write (in parallel) to a single output file. 143 142 144 In \textit{detached mode} and if the type of file is ''multiple\_file'', then145 each stand-alone XIOS process will collect data for a range of complete longitudinal strips and 143 In \textit{detached mode} and if the type of file is ''multiple\_file'', 144 then each stand-alone XIOS process will collect data for a range of complete longitudinal strips and 146 145 write to its own set of output files. 147 If the ''one\_file'' option is chosen then all XIOS processes will collect their longitudinal strips and 146 If the ''one\_file'' option is chosen then all XIOS processes will collect their longitudinal strips and 148 147 write (in parallel) to a single output file. 149 148 Note running in detached mode requires launching a Multiple Process Multiple Data (MPMD) parallel job. 150 The following subsection provides a typical example but the syntax will vary in 151 different MPP environments. 149 The following subsection provides a typical example but the syntax will vary in different MPP environments. 152 150 153 151 \subsubsection{Number of cpu used by XIOS in detached mode} … … 156 154 The number of cores dedicated to XIOS should be from \texttildelow1/10 to \texttildelow1/50 of the number of 157 155 cores dedicated to NEMO. 158 Some manufacturers suggest using O($\sqrt{N}$) dedicated IO processors for N processors but 156 Some manufacturers suggest using O($\sqrt{N}$) dedicated IO processors for N processors but 159 157 this is a general recommendation and not specific to NEMO. 160 It is difficult to provide precise recommendations because the optimal choice will depend on 158 It is difficult to provide precise recommendations because the optimal choice will depend on 161 159 the particular hardware properties of the target system 162 (parallel filesystem performance, available memory, memory bandwidth etc.) and163 the volume and frequency of data to be created.160 (parallel filesystem performance, available memory, memory bandwidth etc.) 161 and the volume and frequency of data to be created. 164 162 Here is an example of 2 cpus for the io\_server and 62 cpu for nemo using mpirun: 165 163 \cmd|mpirun -np 62 ./nemo.exe : -np 2 ./xios_server.exe| … … 167 165 \subsubsection{Control of XIOS: the context in iodef.xml} 168 166 169 As well as the {\tt using\_server} flag, other controls on the use of XIOS are set in 170 the XIOS context in iodef.xml. 167 As well as the {\tt using\_server} flag, other controls on the use of XIOS are set in the XIOS context in iodef.xml. 171 168 See the XML basics section below for more details on XML syntax and rules. 172 169 … … 205 202 \subsubsection{Installation} 206 203 207 As mentioned, XIOS is supported separately and must be downloaded and compiled before 208 it can be used with NEMO. 209 See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for 210 help and guidance. 204 As mentioned, XIOS is supported separately and must be downloaded and compiled before it can be used with NEMO. 205 See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for help and guidance. 211 206 NEMO will need to link to the compiled XIOS library. 212 The 213 \href{https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#Inputs-OutputsusingXIOS} 214 {XIOS with NEMO} 215 guide provides an example illustration of how this can be achieved. 207 The \href{https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#Inputs-OutputsusingXIOS} 208 {XIOS with NEMO} guide provides an example illustration of how this can be achieved. 216 209 217 210 \subsubsection{Add your own outputs} 218 211 219 212 It is very easy to add your own outputs with iomput. 220 Many standard fields and diagnostics are already prepared ($i.e.$, steps 1 to 3 below have been done) and 213 Many standard fields and diagnostics are already prepared ($i.e.$, steps 1 to 3 below have been done) and 221 214 simply need to be activated by including the required output in a file definition in iodef.xml (step 4). 222 215 To add new output variables, all 4 of the following steps must be taken. 223 216 224 217 \begin{enumerate} 225 \item[1.] in NEMO code, add a \forcode{CALL iom\_put( 'identifier', array )} where you want to 226 output a 2D or 3D array. 227 \item[2.] If necessary, add \forcode{USE iom ! I/O manager library} to the list of used modules in 228 the upper part of your module. 229 \item[3.] in the field\_def.xml file, add the definition of your variable using 230 the same identifier you used in the f90 code (see subsequent sections for 231 a details of the XML syntax and rules). 232 For example: 218 \item[1.] 219 in NEMO code, add a \forcode{CALL iom\_put( 'identifier', array )} where you want to output a 2D or 3D array. 220 \item[2.] 221 If necessary, add \forcode{USE iom ! I/O manager library} to the list of used modules in 222 the upper part of your module. 223 \item[3.] 224 in the field\_def.xml file, add the definition of your variable using the same identifier you used in the f90 code 225 (see subsequent sections for a details of the XML syntax and rules). 226 For example: 233 227 234 228 \begin{xmllines} … … 241 235 \end{xmllines} 242 236 243 Note your definition must be added to the field\_group whose reference grid is consistent with 244 the size of thearray passed to iomput.245 The grid\_ref attribute refers to definitions set in iodef.xml which, in turn, reference grids and246 axes either defined in the code (iom\_set\_domain\_attr and iom\_set\_axis\_attr in \mdl{iom}) or 247 defined in the domain\_def.xml file.237 Note your definition must be added to the field\_group whose reference grid is consistent with the size of 238 the array passed to iomput. 239 The grid\_ref attribute refers to definitions set in iodef.xml which, in turn, 240 reference grids and axes either defined in the code 241 (iom\_set\_domain\_attr and iom\_set\_axis\_attr in \mdl{iom}) or defined in the domain\_def.xml file. 248 242 $e.g.$: 249 243 … … 252 246 \end{xmllines} 253 247 254 Note, if your array is computed within the surface module each \np{nn\_fsbc} time\_step, 248 Note, if your array is computed within the surface module each \np{nn\_fsbc} time\_step, 255 249 add the field definition within the field\_group defined with the id "SBC": 256 \xmlcode{<field_group id="SBC" ...>} which has been defined with the correct frequency of 257 operations (iom\_set\_field\_attr in \mdl{iom}) 258 \item[4.] add your field in one of the output files defined in iodef.xml 259 (again see subsequent sections for syntax and rules) 250 \xmlcode{<field_group id="SBC" ...>} which has been defined with the correct frequency of operations 251 (iom\_set\_field\_attr in \mdl{iom}) 252 \item[4.] 253 add your field in one of the output files defined in iodef.xml 254 (again see subsequent sections for syntax and rules) 260 255 261 256 \begin{xmllines} … … 274 269 275 270 XML tags begin with the less-than character ("$<$") and end with the greater-than character ("$>$"). 276 You use tags to mark the start and end of elements, which are the logical units of information in 277 an XML document. 278 In addition to marking the beginning of an element, XML start tags also provide a place to 279 specify attributes. 280 An attribute specifies a single property for an element, using a name/value pair, for example: 271 You use tags to mark the start and end of elements, which are the logical units of information in an XML document. 272 In addition to marking the beginning of an element, XML start tags also provide a place to specify attributes. 273 An attribute specifies a single property for an element, using a name/value pair, for example: 281 274 \xmlcode{<a b="x" c="y" d="z"> ... </a>}. 282 275 See \href{http://www.xmlnews.org/docs/xml-basics.html}{here} for more details. … … 284 277 \subsubsection{Structure of the XML file used in NEMO} 285 278 286 The XML file used in XIOS is structured by 7 families of tags: 279 The XML file used in XIOS is structured by 7 families of tags: 287 280 context, axis, domain, grid, field, file and variable. 288 281 Each tag family has hierarchy of three flavors (except for context): … … 302 295 303 296 Each element may have several attributes. 304 Some attributes are mandatory, other are optional but have a default value and 305 other are completely optional. 297 Some attributes are mandatory, other are optional but have a default value and other are completely optional. 306 298 Id is a special attribute used to identify an element or a group of elements. 307 299 It must be unique for a kind of element. 308 300 It is optional, but no reference to the corresponding element can be done if it is not defined. 309 301 310 The XML file is split into context tags that are used to isolate IO definition from different codes or311 different parts of a code.302 The XML file is split into context tags that are used to isolate IO definition from 303 different codes or different parts of a code. 312 304 No interference is possible between 2 different contexts. 313 305 Each context has its own calendar and an associated timestep. … … 370 362 371 363 \noindent In NEMO, by default, the field and domain definition is done in 2 separate files: 372 \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml} 373 thatare included in the main iodef.xml file through the following commands:364 \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml} that 365 are included in the main iodef.xml file through the following commands: 374 366 \begin{xmllines} 375 367 <field_definition src="./field_def.xml" /> … … 380 372 381 373 XML extensively uses the concept of inheritance. 382 XML has a tree based structure with a parent-child oriented relation: 383 all children inherit attributes from parent, but an attribute defined in a child replace 384 the inherited attribute value. 385 Note that the special attribute ''id'' is never inherited. \\ \\ 374 XML has a tree based structure with a parent-child oriented relation: all children inherit attributes from parent, 375 but an attribute defined in a child replace the inherited attribute value. 376 Note that the special attribute ''id'' is never inherited. 377 \\ 378 \\ 386 379 example 1: Direct inheritance. 387 380 … … 393 386 \end{xmllines} 394 387 395 The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''average'' 396 ofthe attribute ''operation'' from its parent.388 The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''average'' of 389 the attribute ''operation'' from its parent. 397 390 Note that a child can overwrite the attribute definition inherited from its parents. 398 In the example above, the field ''sss'' will for example output instantaneous values instead of 399 average values. \\ \\ 391 In the example above, the field ''sss'' will for example output instantaneous values instead of average values. 392 \\ 393 \\ 400 394 example 2: Inheritance by reference. 401 395 … … 418 412 419 413 Groups can be used for 2 purposes. 420 Firstly, the group can be used to define common attributes to be shared by the elements of 414 Firstly, the group can be used to define common attributes to be shared by the elements of 421 415 the group through inheritance. 422 416 In the following example, we define a group of field that will share a common grid ''grid\_T\_2D''. 423 Note that for the field ''toce'', we overwrite the grid definition inherited from the group by 424 ''grid\_T\_3D''. 417 Note that for the field ''toce'', we overwrite the grid definition inherited from the group by ''grid\_T\_3D''. 425 418 426 419 \begin{xmllines} … … 456 449 \subsection{Detailed functionalities} 457 450 458 The file \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml} provides several examples of the use of 451 The file \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml} provides several examples of the use of 459 452 the new functionalities offered by the XML interface of XIOS. 460 453 461 454 \subsubsection{Define horizontal subdomains} 462 455 463 Horizontal subdomains are defined through the attributs zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj of 456 Horizontal subdomains are defined through the attributs zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj of 464 457 the tag family domain. 465 458 It must therefore be done in the domain part of the XML file. … … 472 465 \end{xmllines} 473 466 474 The use of this subdomain is done through the redefinition of the attribute domain\_ref of 475 the tag family field. 467 The use of this subdomain is done through the redefinition of the attribute domain\_ref of the tag family field. 476 468 For example: 477 469 … … 483 475 484 476 Moorings are seen as an extrem case corresponding to a 1 by 1 subdomain. 485 The Equatorial section, the TAO, RAMA and PIRATA moorings are alre dy registered in the code and477 The Equatorial section, the TAO, RAMA and PIRATA moorings are already registered in the code and 486 478 can therefore be outputted without taking care of their (i,j) position in the grid. 487 479 These predefined domains can be activated by the use of specific domain\_ref: 488 ''EqT'', ''EqU'' or ''EqW'' for the equatorial sections and the mooring position for489 TAO, RAMA and PIRATA followed by ''T'' (for example: ''8s137eT'', ''1.5s80.5eT'' ...)480 ''EqT'', ''EqU'' or ''EqW'' for the equatorial sections and 481 the mooring position for TAO, RAMA and PIRATA followed by ''T'' (for example: ''8s137eT'', ''1.5s80.5eT'' ...) 490 482 491 483 \begin{xmllines} … … 503 495 \subsubsection{Define vertical zooms} 504 496 505 Vertical zooms are defined through the attributs zoom\_begin and zoom\_end of the tag family axis. 506 It must therefore be done in the axis part of the XML file. 497 Vertical zooms are defined through the attributs zoom\_begin and zoom\_end of the tag family axis. 498 It must therefore be done in the axis part of the XML file. 507 499 For example, in \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml}, we provide the following example: 508 500 … … 513 505 \end{xmllines} 514 506 515 The use of this vertical zoom is done through the redefinition of the attribute axis\_ref of 516 the tag family field. 507 The use of this vertical zoom is done through the redefinition of the attribute axis\_ref of the tag family field. 517 508 For example: 518 509 … … 539 530 \end{xmllines} 540 531 541 However it is often very convienent to define the file name with the name of the experiment, 542 the output file frequency and the date of the beginning and the end of the simulation 532 However it is often very convienent to define the file name with the name of the experiment, 533 the output file frequency and the date of the beginning and the end of the simulation 543 534 (which are informations stored either in the namelist or in the XML file). 544 To do so, we added the following rule: if the id of the tag file is ''fileN'' (where N = 1 to 999 on545 1 to 3 digits) or one of the predefined sections or moorings (see next subsection), 546 the following part of the name and the name\_suffix (that can be inherited) will be automatically 547 replaced by:535 To do so, we added the following rule: 536 if the id of the tag file is ''fileN'' (where N = 1 to 999 on 1 to 3 digits) or 537 one of the predefined sections or moorings (see next subsection), 538 the following part of the name and the name\_suffix (that can be inherited) will be automatically replaced by: 548 539 549 540 \begin{table} \scriptsize … … 580 571 \end{forlines} 581 572 582 \noindent will give the following file name radical: 583 \ifile{myfile\_ORCA2\_19891231\_freq1d} 573 \noindent will give the following file name radical: \ifile{myfile\_ORCA2\_19891231\_freq1d} 584 574 585 575 \subsubsection{Other controls of the XML attributes from NEMO} 586 576 587 577 The values of some attributes are defined by subroutine calls within NEMO 588 (calls to iom\_set\_domain\_attr, iom\_set\_axis\_attr and iom\_set\_field\_attr in \mdl{iom}). 589 Any definition given in the XML file will be overwritten. 590 By convention, these attributes are defined to ''auto'' (for string) or ''0000'' (for integer) in 591 the XML file (but this is not necessary). \\ 592 593 Here is the list of these attributes: \\ 578 (calls to iom\_set\_domain\_attr, iom\_set\_axis\_attr and iom\_set\_field\_attr in \mdl{iom}). 579 Any definition given in the XML file will be overwritten. 580 By convention, these attributes are defined to ''auto'' (for string) or ''0000'' (for integer) in the XML file 581 (but this is not necessary). 582 \\ 583 584 Here is the list of these attributes: 585 \\ 594 586 595 587 \begin{table} \scriptsize … … 631 623 632 624 \begin{enumerate} 633 \item Simple computation: directly define the computation when refering to the variable in634 the file definition.625 \item 626 Simple computation: directly define the computation when refering to the variable in the file definition. 635 627 636 628 \begin{xmllines} … … 640 632 \end{xmllines} 641 633 642 \item Simple computation: define a new variable and use it in the file definition. 634 \item 635 Simple computation: define a new variable and use it in the file definition. 643 636 644 637 in field\_definition: … … 654 647 \end{xmllines} 655 648 656 Note that in this case, the following syntaxe \xmlcode{<field field_ref="sst2" />} is not working as 649 Note that in this case, the following syntaxe \xmlcode{<field field_ref="sst2" />} is not working as 657 650 sst2 won't be evaluated. 658 651 659 \item Change of variable precision: 652 \item 653 Change of variable precision: 660 654 661 655 \begin{xmllines} … … 667 661 668 662 Note that, then the code is crashing, writting real4 variables forces a numerical convection from 669 real8 to real4 which will create an internal error in NetCDF and will avoid the creation of 670 the output files. 671 Forcing double precision outputs with prec="8" (for example in the field\_definition) will 672 avoid this problem. 673 674 \item add user defined attributes: 663 real8 to real4 which will create an internal error in NetCDF and will avoid the creation of the output files. 664 Forcing double precision outputs with prec="8" (for example in the field\_definition) will avoid this problem. 665 666 \item 667 add user defined attributes: 675 668 676 669 \begin{xmllines} … … 687 680 \end{xmllines} 688 681 689 \item use of the ``@'' function: example 1, weighted temporal average 682 \item 683 use of the ``@'' function: example 1, weighted temporal average 690 684 691 685 - define a new variable in field\_definition … … 706 700 707 701 The freq\_op="5d" attribute is used to define the operation frequency of the ``@'' function: here 5 day. 708 The temporal operation done by the ``@'' is the one defined in the field definition: 702 The temporal operation done by the ``@'' is the one defined in the field definition: 709 703 here we use the default, average. 710 704 So, in the above case, @toce\_e3t will do the 5-day mean of toce*e3t. 711 Operation="instant" refers to the temporal operation to be performed on the field''@toce\_e3t / @e3t'': 712 here the temporal average is alreday done by the ``@'' function so we just use instant to do the ratio of 705 Operation="instant" refers to the temporal operation to be performed on the field''@toce\_e3t / @e3t'': 706 here the temporal average is alreday done by the ``@'' function so we just use instant to do the ratio of 713 707 the 2 mean values. 714 708 field\_ref="toce" means that attributes not explicitely defined, are inherited from toce field. 715 709 Note that in this case, freq\_op must be equal to the file output\_freq. 716 710 717 \item use of the ``@'' function: example 2, monthly SSH standard deviation 711 \item 712 use of the ``@'' function: example 2, monthly SSH standard deviation 718 713 719 714 - define a new variable in field\_definition … … 737 732 738 733 The freq\_op="1m" attribute is used to define the operation frequency of the ``@'' function: here 1 month. 739 The temporal operation done by the ``@'' is the one defined in the field definition: 734 The temporal operation done by the ``@'' is the one defined in the field definition: 740 735 here we use the default, average. 741 736 So, in the above case, @ssh2 will do the monthly mean of ssh*ssh. 742 Operation="instant" refers to the temporal operation to be performed on 743 the field ''sqrt( @ssh2 - @ssh * @ssh )'': 737 Operation="instant" refers to the temporal operation to be performed on the field ''sqrt( @ssh2 - @ssh * @ssh )'': 744 738 here the temporal average is alreday done by the ``@'' function so we just use instant. 745 739 field\_ref="ssh" means that attributes not explicitely defined, are inherited from ssh field. 746 740 Note that in this case, freq\_op must be equal to the file output\_freq. 747 741 748 \item use of the ``@'' function: example 3, monthly average of SST diurnal cycle 742 \item 743 use of the ``@'' function: example 3, monthly average of SST diurnal cycle 749 744 750 745 - define 2 new variables in field\_definition … … 770 765 771 766 The freq\_op="1d" attribute is used to define the operation frequency of the ``@'' function: here 1 day. 772 The temporal operation done by the ``@'' is the one defined in the field definition: here maximum for773 sstmax and minimum for sstmin.767 The temporal operation done by the ``@'' is the one defined in the field definition: 768 here maximum for sstmax and minimum for sstmin. 774 769 So, in the above case, @sstmax will do the daily max and @sstmin the daily min. 775 Operation="average" refers to the temporal operation to be performed on the field ``@sstmax - @sstmin'': 770 Operation="average" refers to the temporal operation to be performed on the field ``@sstmax - @sstmin'': 776 771 here monthly mean (of daily max - daily min of the sst). 777 772 field\_ref="sst" means that attributes not explicitely defined, are inherited from sst field. … … 1126 1121 1127 1122 Output from the XIOS-1.0 IO server is compliant with 1128 \href{http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html}{version 1.5} 1129 of the CF metadata standard. 1130 Therefore while a user may wish to add their own metadata to the output files (as demonstrated in 1131 example 4 of section \autoref{subsec:IOM_xmlref}) the metadata should, for the most part, comply with 1132 the CF-1.5 standard. 1133 1134 Some metadata that may significantly increase the file size (horizontal cell areas and 1135 vertices) are controlled by the namelist parameter \np{ln\_cfmeta} in the \ngn{namrun} namelist. 1123 \href{http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html}{version 1.5} of 1124 the CF metadata standard. 1125 Therefore while a user may wish to add their own metadata to the output files (as demonstrated in example 4 of 1126 section \autoref{subsec:IOM_xmlref}) the metadata should, for the most part, comply with the CF-1.5 standard. 1127 1128 Some metadata that may significantly increase the file size (horizontal cell areas and vertices) are controlled by 1129 the namelist parameter \np{ln\_cfmeta} in the \ngn{namrun} namelist. 1136 1130 This must be set to true if these metadata are to be included in the output files. 1137 1131 … … 1144 1138 1145 1139 Since version 3.3, support for NetCDF4 chunking and (loss-less) compression has been included. 1146 These options build on the standard NetCDF output and allow the user control over the size of 1147 the chunks vianamelist settings.1140 These options build on the standard NetCDF output and allow the user control over the size of the chunks via 1141 namelist settings. 1148 1142 Chunking and compression can lead to significant reductions in file sizes for a small runtime overhead. 1149 For a fuller discussion on chunking and other performance issues the reader is referred to 1150 the NetCDF4 documentation found 1151 \href{http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html#Chunking}{here}. 1152 1153 The new features are only available when the code has been linked with a NetCDF4 library 1154 (version 4.1 onwards, recommended) which has been built with HDF5 support 1155 (version 1.8.4 onwards, recommended). 1156 Datasets created with chunking and compression are not backwards compatible with 1157 NetCDF3 "classic" format but most analysis codes can be relinked simply with the new libraries and 1158 will then read both NetCDF3 and NetCDF4 files. 1159 NEMO executables linked with NetCDF4 libraries can be made to produce NetCDF3 files by 1143 For a fuller discussion on chunking and other performance issues the reader is referred to 1144 the NetCDF4 documentation found \href{http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html#Chunking}{here}. 1145 1146 The new features are only available when the code has been linked with a NetCDF4 library 1147 (version 4.1 onwards, recommended) which has been built with HDF5 support (version 1.8.4 onwards, recommended). 1148 Datasets created with chunking and compression are not backwards compatible with NetCDF3 "classic" format but 1149 most analysis codes can be relinked simply with the new libraries and will then read both NetCDF3 and NetCDF4 files. 1150 NEMO executables linked with NetCDF4 libraries can be made to produce NetCDF3 files by 1160 1151 setting the \np{ln\_nc4zip} logical to false in the \textit{namnc4} namelist: 1161 1152 … … 1166 1157 1167 1158 If \key{netcdf4} has not been defined, these namelist parameters are not read. 1168 In this case, \np{ln\_nc4zip} is set false and dummy routines for 1169 a few NetCDF4-specific functions are defined. 1170 These functions will not be used but need to be included so that compilation is possible with 1171 NetCDF3 libraries. 1172 1173 When using NetCDF4 libraries, \key{netcdf4} should be defined even if the intention is to 1159 In this case, \np{ln\_nc4zip} is set false and dummy routines for a few NetCDF4-specific functions are defined. 1160 These functions will not be used but need to be included so that compilation is possible with NetCDF3 libraries. 1161 1162 When using NetCDF4 libraries, \key{netcdf4} should be defined even if the intention is to 1174 1163 create only NetCDF3-compatible files. 1175 This is necessary to avoid duplication between the dummy routines and 1176 the actual routines present in the library. 1164 This is necessary to avoid duplication between the dummy routines and the actual routines present in the library. 1177 1165 Most compilers will fail at compile time when faced with such duplication. 1178 Thus when linking with NetCDF4 libraries the user must define \key{netcdf4} and 1166 Thus when linking with NetCDF4 libraries the user must define \key{netcdf4} and 1179 1167 control the type of NetCDF file produced via the namelist parameter. 1180 1168 1181 Chunking and compression is applied only to 4D fields and there is no advantage in1182 chunking across more than one time dimension since previously written chunks would have to 1183 be read back and decompressed before being added to.1169 Chunking and compression is applied only to 4D fields and 1170 there is no advantage in chunking across more than one time dimension since 1171 previously written chunks would have to be read back and decompressed before being added to. 1184 1172 Therefore, user control over chunk sizes is provided only for the three space dimensions. 1185 1173 The user sets an approximate number of chunks along each spatial axis. 1186 The actual size of the chunks will depend on global domain size for mono-processors or, 1187 more likely,the local processor domain size for distributed processing.1188 The derived values are subject to practical minimum values (to avoid wastefully small chunk sizes) and 1174 The actual size of the chunks will depend on global domain size for mono-processors or, more likely, 1175 the local processor domain size for distributed processing. 1176 The derived values are subject to practical minimum values (to avoid wastefully small chunk sizes) and 1189 1177 cannot be greater than the domain size in any dimension. 1190 1178 The algorithm used is: … … 1203 1191 \end{forlines} 1204 1192 1205 \noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\tt 46x38x1} respectively in 1193 \noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\tt 46x38x1} respectively in 1206 1194 the mono-processor case (i.e. global domain of {\small\tt 182x149x31}). 1207 1195 An illustration of the potential space savings that NetCDF4 chunking and compression provides is given in 1208 table \autoref{tab:NC4} which compares the results of two short runs of 1209 the ORCA2\_LIM reference configuration witha 4x2 mpi partitioning.1210 Note the variation in the compression ratio achieved which reflects chiefly the dry to 1211 wet volume ratio ofeach processing region.1196 table \autoref{tab:NC4} which compares the results of two short runs of the ORCA2\_LIM reference configuration with 1197 a 4x2 mpi partitioning. 1198 Note the variation in the compression ratio achieved which reflects chiefly the dry to wet volume ratio of 1199 each processing region. 1212 1200 1213 1201 %------------------------------------------TABLE---------------------------------------------------- … … 1249 1237 %---------------------------------------------------------------------------------------------------- 1250 1238 1251 When \key{iomput} is activated with \key{netcdf4} chunking and compression parameters for 1252 fields produced via \np{iom\_put} calls are set via an equivalent and identically named namelist to 1253 \ textit{namnc4} in \np{xmlio\_server.def}.1254 Typically this namelist serves the mean files whilst the \ngn{ namnc4} in 1255 the main namelist file continues toserve the restart files.1256 This duplication is unfortunate but appropriate since, if using io\_servers, the domain sizes of 1257 the individual files produced by the io\_server processes may be different to those produced by 1239 When \key{iomput} is activated with \key{netcdf4} chunking and compression parameters for fields produced via 1240 \np{iom\_put} calls are set via an equivalent and identically named namelist to \textit{namnc4} in 1241 \np{xmlio\_server.def}. 1242 Typically this namelist serves the mean files whilst the \ngn{ namnc4} in the main namelist file continues to 1243 serve the restart files. 1244 This duplication is unfortunate but appropriate since, if using io\_servers, the domain sizes of 1245 the individual files produced by the io\_server processes may be different to those produced by 1258 1246 the invidual processing regions and different chunking choices may be desired. 1259 1247 … … 1269 1257 %------------------------------------------------------------------------------------------------------------- 1270 1258 1271 Each trend of the dynamics and/or temperature and salinity time evolution equations can be send to 1272 \mdl{trddyn} and/or \mdl{trdtra} modules (see TRD directory) just after their computation ($i.e.$ at1273 the end of each $dyn\cdots.F90$ and/or $tra\cdots.F90$ routines).1259 Each trend of the dynamics and/or temperature and salinity time evolution equations can be send to 1260 \mdl{trddyn} and/or \mdl{trdtra} modules (see TRD directory) just after their computation 1261 ($i.e.$ at the end of each $dyn\cdots.F90$ and/or $tra\cdots.F90$ routines). 1274 1262 This capability is controlled by options offered in \ngn{namtrd} namelist. 1275 1263 Note that the output are done with xIOS, and therefore the \key{IOM} is required. … … 1278 1266 1279 1267 \begin{description} 1280 \item[\np{ln\_glo\_trd}]: at each \np{nn\_trd} time-step a check of the basin averaged properties of 1281 the momentum and tracer equations is performed. 1282 This also includes a check of $T^2$, $S^2$, $\tfrac{1}{2} (u^2+v2)$, and 1283 potential energy time evolution equations properties; 1284 \item[\np{ln\_dyn\_trd}]: each 3D trend of the evolution of the two momentum components is output; 1285 \item[\np{ln\_dyn\_mxl}]: each 3D trend of the evolution of the two momentum components averaged over 1286 the mixed layer is output; 1287 \item[\np{ln\_vor\_trd}]: a vertical summation of the moment tendencies is performed, then 1288 the curl is computed to obtain the barotropic vorticity tendencies which 1289 are output; 1290 \item[\np{ln\_KE\_trd}] : each 3D trend of the Kinetic Energy equation is output ; 1291 \item[\np{ln\_tra\_trd}]: each 3D trend of the evolution of temperature and salinity is output ; 1292 \item[\np{ln\_tra\_mxl}]: each 2D trend of the evolution of temperature and salinity averaged over 1293 the mixed layer is output; 1268 \item[\np{ln\_glo\_trd}]: 1269 at each \np{nn\_trd} time-step a check of the basin averaged properties of 1270 the momentum and tracer equations is performed. 1271 This also includes a check of $T^2$, $S^2$, $\tfrac{1}{2} (u^2+v2)$, 1272 and potential energy time evolution equations properties; 1273 \item[\np{ln\_dyn\_trd}]: 1274 each 3D trend of the evolution of the two momentum components is output; 1275 \item[\np{ln\_dyn\_mxl}]: 1276 each 3D trend of the evolution of the two momentum components averaged over the mixed layer is output; 1277 \item[\np{ln\_vor\_trd}]: 1278 a vertical summation of the moment tendencies is performed, 1279 then the curl is computed to obtain the barotropic vorticity tendencies which are output; 1280 \item[\np{ln\_KE\_trd}] : 1281 each 3D trend of the Kinetic Energy equation is output; 1282 \item[\np{ln\_tra\_trd}]: 1283 each 3D trend of the evolution of temperature and salinity is output; 1284 \item[\np{ln\_tra\_mxl}]: 1285 each 2D trend of the evolution of temperature and salinity averaged over the mixed layer is output; 1294 1286 \end{description} 1295 1287 … … 1298 1290 1299 1291 \textbf{Note that} in the current version (v3.6), many changes has been introduced but not fully tested. 1300 In particular, options associated with \np{ln\_dyn\_mxl}, \np{ln\_vor\_trd}, and \np{ln\_tra\_mxl} are 1301 not working,and none of the options have been tested with variable volume ($i.e.$ \key{vvl} defined).1292 In particular, options associated with \np{ln\_dyn\_mxl}, \np{ln\_vor\_trd}, and \np{ln\_tra\_mxl} are not working, 1293 and none of the options have been tested with variable volume ($i.e.$ \key{vvl} defined). 1302 1294 1303 1295 % ------------------------------------------------------------------------------------------------------------- … … 1311 1303 %-------------------------------------------------------------------------------------------------------------- 1312 1304 1313 The on-line computation of floats advected either by the three dimensional velocity field or 1314 constraint to remain at a given depth ($w = 0$ in the computation) have been introduced in 1315 the system during the CLIPPER project. 1305 The on-line computation of floats advected either by the three dimensional velocity field or constraint to 1306 remain at a given depth ($w = 0$ in the computation) have been introduced in the system during the CLIPPER project. 1316 1307 Options are defined by \ngn{namflo} namelis variables. 1317 The algorithm used is based either on the work of \cite{Blanke_Raynaud_JPO97} (default option), or1318 o n a $4^th$ Runge-Hutta algorithm (\np{ln\_flork4}\forcode{ = .true.}).1319 Note that the \cite{Blanke_Raynaud_JPO97} algorithm have the advantage of providing trajectories which 1308 The algorithm used is based either on the work of \cite{Blanke_Raynaud_JPO97} (default option), 1309 or on a $4^th$ Runge-Hutta algorithm (\np{ln\_flork4}\forcode{ = .true.}). 1310 Note that the \cite{Blanke_Raynaud_JPO97} algorithm have the advantage of providing trajectories which 1320 1311 are consistent with the numeric of the code, so that the trajectories never intercept the bathymetry. 1321 1312 1322 1313 \subsubsection{Input data: initial coordinates} 1323 1314 1324 Initial coordinates can be given with Ariane Tools convention (IJK coordinates,1325 ( \np{ln\_ariane}\forcode{ = .true.}) ) or with longitude and latitude.1315 Initial coordinates can be given with Ariane Tools convention 1316 (IJK coordinates, (\np{ln\_ariane}\forcode{ = .true.}) ) or with longitude and latitude. 1326 1317 1327 1318 In case of Ariane convention, input filename is \np{init\_float\_ariane}. … … 1368 1359 1369 1360 \np{jpnfl} is the total number of floats during the run. 1370 When initial positions are read in a restart file (\np{ln\_rstflo}\forcode{ = .true.} ), 1361 When initial positions are read in a restart file (\np{ln\_rstflo}\forcode{ = .true.} ), 1371 1362 \np{jpnflnewflo} can be added in the initialization file. 1372 1363 1373 1364 \subsubsection{Output data} 1374 1365 1375 \np{nn\_writefl} is the frequency of writing in float output file and \np{nn\_stockfl} is 1376 the frequency ofcreation of the float restart file.1366 \np{nn\_writefl} is the frequency of writing in float output file and \np{nn\_stockfl} is the frequency of 1367 creation of the float restart file. 1377 1368 1378 1369 Output data can be written in ascii files (\np{ln\_flo\_ascii}\forcode{ = .true.}). … … 1382 1373 There are 2 possibilities: 1383 1374 1384 1385 1375 - if (\key{iomput}) is used, outputs are selected in iodef.xml. 1376 Here it is an example of specification to put in files description section: 1386 1377 1387 1378 \begin{xmllines} … … 1401 1392 - if (\key{iomput}) is not used, a file called \ifile{trajec\_float} will be created by IOIPSL library. 1402 1393 1403 See also \href{http://stockage.univ-brest.fr/~grima/Ariane/}{here} the web site describing 1404 the off-line use ofthis marvellous diagnostic tool.1394 See also \href{http://stockage.univ-brest.fr/~grima/Ariane/}{here} the web site describing the off-line use of 1395 this marvellous diagnostic tool. 1405 1396 1406 1397 % ------------------------------------------------------------------------------------------------------------- … … 1418 1409 This on-line Harmonic analysis is actived with \key{diaharm}. 1419 1410 1420 Some parameters are available in namelist \ngn{namdia\_harm} 1411 Some parameters are available in namelist \ngn{namdia\_harm}: 1421 1412 1422 1413 - \np{nit000\_han} is the first time step used for harmonic analysis … … 1430 1421 - \np{tname} is an array with names of tidal constituents to analyse 1431 1422 1432 \np{nit000\_han} and \np{nitend\_han} must be between \np{nit000} and \np{nitend} of the simulation.1433 The restart capability is not implemented.1434 1435 The Harmonic analysis solve the following equation:1423 \np{nit000\_han} and \np{nitend\_han} must be between \np{nit000} and \np{nitend} of the simulation. 1424 The restart capability is not implemented. 1425 1426 The Harmonic analysis solve the following equation: 1436 1427 1437 1428 \[h_{i} - A_{0} + \sum^{nb\_ana}_{j=1}[A_{j}cos(\nu_{j}t_{j}-\phi_{j})] = e_{i}\] 1438 1429 1439 With $A_{j}$, $\nu_{j}$, $\phi_{j}$, the amplitude, frequency and phase for each wave and 1440 $e_{i}$ the error. 1430 With $A_{j}$, $\nu_{j}$, $\phi_{j}$, the amplitude, frequency and phase for each wave and $e_{i}$ the error. 1441 1431 $h_{i}$ is the sea level for the time $t_{i}$ and $A_{0}$ is the mean sea level. \\ 1442 1432 We can rewrite this equation: … … 1459 1449 %------------------------------------------------------------------------------------------------------------- 1460 1450 1461 A module is available to compute the transport of volume, heat and salt through sections. 1451 A module is available to compute the transport of volume, heat and salt through sections. 1462 1452 This diagnostic is actived with \key{diadct}. 1463 1453 1464 1454 Each section is defined by the coordinates of its 2 extremities. 1465 The pathways between them are contructed using tools which can be found in 1466 \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT} 1467 and are written in a binary file 1468 \texttt{section\_ijglobal.diadct\_ORCA2\_LIM} 1469 which is later read in by NEMO to compute on-line transports. 1455 The pathways between them are contructed using tools which can be found in \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT} 1456 and are written in a binary file \texttt{section\_ijglobal.diadct\_ORCA2\_LIM} which is later read in by 1457 NEMO to compute on-line transports. 1470 1458 1471 1459 The on-line transports module creates three output ascii files: … … 1477 1465 - \texttt{salt\_transport} for salt transports (unit: $10^{9}Kg s^{-1}$) \\ 1478 1466 1479 Namelist variables in \ngn{namdct} control how frequently the flows are summed and the time scales over 1480 whichthey are averaged, as well as the level of output for debugging:1467 Namelist variables in \ngn{namdct} control how frequently the flows are summed and the time scales over which 1468 they are averaged, as well as the level of output for debugging: 1481 1469 \np{nn\_dct} : frequency of instantaneous transports computing 1482 1470 \np{nn\_dctwri}: frequency of writing ( mean of instantaneous transports ) … … 1485 1473 \subsubsection{Creating a binary file containing the pathway of each section} 1486 1474 1487 In \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT/run}, 1488 the file \textit{ {list\_sections.ascii\_global}} contains a list of all the sections that are to 1489 be computed(this list of sections is based on MERSEA project metrics).1475 In \texttt{NEMOGCM/TOOLS/SECTIONS\_DIADCT/run}, 1476 the file \textit{ {list\_sections.ascii\_global}} contains a list of all the sections that are to be computed 1477 (this list of sections is based on MERSEA project metrics). 1490 1478 1491 1479 Another file is available for the GYRE configuration (\texttt{ {list\_sections.ascii\_GYRE}}). … … 1505 1493 - \texttt{ice} to compute surface and volume ice transports, \texttt{noice} if no. \\ 1506 1494 1507 \noindent The results of the computing of transports, and the directions of positive and 1508 negative flow do not depend on the order of the 2 extremities in this file. \\1509 1510 \noindent If nclass $\neq$ 0, the next lines contain the class type and the nclass bounds: \\1495 \noindent The results of the computing of transports, and the directions of positive and 1496 negative flow do not depend on the order of the 2 extremities in this file. \\ 1497 1498 \noindent If nclass $\neq$ 0, the next lines contain the class type and the nclass bounds: \\ 1511 1499 {\scriptsize \texttt{ 1512 1500 long1 lat1 long2 lat2 nclass (ok/no)strpond (no)ice section\_name \\ … … 1531 1519 - \texttt{zsigp} for potential density classes \\ 1532 1520 1533 The script \texttt{job.ksh} computes the pathway for each section and 1534 creates a binary file\texttt{section\_ijglobal.diadct\_ORCA2\_LIM} which is read by NEMO. \\1535 1536 It is possible to use this tools for new configuations: \texttt{job.ksh} has to be updated with 1537 the coordinates file name and path. \\1538 1539 Examples of two sections, the ACC\_Drake\_Passage with no classes, and the ATL\_Cuba\_Florida with 1540 4 temperature clases (5 class bounds), are shown: \\1521 The script \texttt{job.ksh} computes the pathway for each section and creates a binary file 1522 \texttt{section\_ijglobal.diadct\_ORCA2\_LIM} which is read by NEMO. \\ 1523 1524 It is possible to use this tools for new configuations: \texttt{job.ksh} has to be updated with 1525 the coordinates file name and path. \\ 1526 1527 Examples of two sections, the ACC\_Drake\_Passage with no classes, 1528 and the ATL\_Cuba\_Florida with 4 temperature clases (5 class bounds), are shown: \\ 1541 1529 \noindent {\scriptsize \texttt{ 1542 1530 -68. -54.5 -60. -64.7 00 okstrpond noice ACC\_Drake\_Passage \\ … … 1559 1547 transport\_total}} \\ 1560 1548 1561 For sections with classes, the first \texttt{nclass-1} lines correspond to the transport for 1562 each class andthe last line corresponds to the total transport summed over all classes.1563 For sections with no classes, class number \texttt{1} corresponds to \texttt{total class} and 1549 For sections with classes, the first \texttt{nclass-1} lines correspond to the transport for each class and 1550 the last line corresponds to the total transport summed over all classes. 1551 For sections with no classes, class number \texttt{1} corresponds to \texttt{total class} and 1564 1552 this class is called \texttt{N}, meaning \texttt{none}. 1565 1553 … … 1568 1556 - \texttt{transport\_direction2} is the negative part of the transport ($\leq$ 0). \\ 1569 1557 1570 \noindent The \texttt{section slope coefficient} gives information about the significance of 1571 transports signs anddirection: \\1558 \noindent The \texttt{section slope coefficient} gives information about the significance of transports signs and 1559 direction: \\ 1572 1560 1573 1561 \begin{table} \scriptsize … … 1591 1579 1592 1580 1593 Changes in steric sea level are caused when changes in the density of the water column imply an 1594 expansion orcontraction of the column.1595 It is essentially produced through surface heating/cooling and to a lesser extent through 1596 non-linear effects ofthe equation of state (cabbeling, thermobaricity...).1581 Changes in steric sea level are caused when changes in the density of the water column imply an expansion or 1582 contraction of the column. 1583 It is essentially produced through surface heating/cooling and to a lesser extent through non-linear effects of 1584 the equation of state (cabbeling, thermobaricity...). 1597 1585 Non-Boussinesq models contain all ocean effects within the ocean acting on the sea level. 1598 1586 In particular, they include the steric effect. 1599 In contrast, Boussinesq models, such as \NEMO, conserve volume, rather than mass, 1587 In contrast, Boussinesq models, such as \NEMO, conserve volume, rather than mass, 1600 1588 and so do not properly represent expansion or contraction. 1601 1589 The steric effect is therefore not explicitely represented. 1602 This approximation does not represent a serious error with respect to the flow field calculated by 1603 the model \citep{Greatbatch_JGR94}, but extra attention is required when investigating sea level, 1604 as steric changes are an important contribution to local changes in sea level on seasonal and 1605 climatic time scales. 1606 This is especially true for investigation into sea level rise due to global warming. 1607 1608 Fortunately, the steric contribution to the sea level consists of a spatially uniform component that 1590 This approximation does not represent a serious error with respect to the flow field calculated by the model 1591 \citep{Greatbatch_JGR94}, but extra attention is required when investigating sea level, 1592 as steric changes are an important contribution to local changes in sea level on seasonal and climatic time scales. 1593 This is especially true for investigation into sea level rise due to global warming. 1594 1595 Fortunately, the steric contribution to the sea level consists of a spatially uniform component that 1609 1596 can be diagnosed by considering the mass budget of the world ocean \citep{Greatbatch_JGR94}. 1610 In order to better understand how global mean sea level evolves and thus how the steric sea level can 1611 be diagnosed,we compare, in the following, the non-Boussinesq and Boussinesq cases.1597 In order to better understand how global mean sea level evolves and thus how the steric sea level can be diagnosed, 1598 we compare, in the following, the non-Boussinesq and Boussinesq cases. 1612 1599 1613 1600 Let denote … … 1628 1615 \] 1629 1616 1630 Temporal changes in total mass is obtained from the density conservation equation 1617 Temporal changes in total mass is obtained from the density conservation equation: 1631 1618 1632 1619 \[ \frac{1}{e_3} \partial_t ( e_3\,\rho) + \nabla( \rho \, \textbf{U} ) … … 1634 1621 \label{eq:Co_nBq} \] 1635 1622 1636 where $\rho$ is the \textit{in situ} density, and \textit{emp} the surface mass 1637 exchanges with the other media of the Earth system (atmosphere, sea-ice, land). 1623 where $\rho$ is the \textit{in situ} density, and \textit{emp} the surface mass exchanges with the other media of 1624 the Earth system (atmosphere, sea-ice, land). 1638 1625 Its global averaged leads to the total mass change 1639 1626 … … 1642 1629 1643 1630 where $\overline{\textit{emp}} = \int_S \textit{emp}\,ds$ is the net mass flux through the ocean surface. 1644 Bringing \autoref{eq:Mass_nBq} and the time derivative of \autoref{eq:MV_nBq} together leads to 1631 Bringing \autoref{eq:Mass_nBq} and the time derivative of \autoref{eq:MV_nBq} together leads to 1645 1632 the evolution equation of the mean sea level 1646 1633 … … 1649 1636 \label{eq:ssh_nBq} \] 1650 1637 1651 The first term in equation \autoref{eq:ssh_nBq} alters sea level by adding or 1652 subtracting mass from the ocean. 1653 The second term arises from temporal changes in the global mean density; $i.e.$ from steric effects. 1654 1655 In a Boussinesq fluid, $\rho$ is replaced by $\rho_o$ in all the equation except when 1656 $\rho$ appears multiplied by the gravity ($i.e.$ in the hydrostatic balance of the primitive Equations). 1657 In particular, the mass conservation equation, \autoref{eq:Co_nBq}, degenerates into 1658 the incompressibility equation: 1638 The first term in equation \autoref{eq:ssh_nBq} alters sea level by adding or subtracting mass from the ocean. 1639 The second term arises from temporal changes in the global mean density; $i.e.$ from steric effects. 1640 1641 In a Boussinesq fluid, $\rho$ is replaced by $\rho_o$ in all the equation except when $\rho$ appears multiplied by 1642 the gravity ($i.e.$ in the hydrostatic balance of the primitive Equations). 1643 In particular, the mass conservation equation, \autoref{eq:Co_nBq}, degenerates into the incompressibility equation: 1659 1644 1660 1645 \[ \frac{1}{e_3} \partial_t ( e_3 ) + \nabla( \textbf{U} ) … … 1667 1652 \label{eq:V_Bq} \] 1668 1653 1669 Only the volume is conserved, not mass, or, more precisely, the mass which is conserved is 1670 the Boussinesq mass, $\mathcal{M}_o = \rho_o \mathcal{V}$. 1671 The total volume (or equivalently the global mean sea level) is altered only by net volume fluxes across 1672 the ocean surface, not by changes in mean mass of the ocean: the steric effect is missing in 1673 a Boussinesq fluid. 1674 1675 Nevertheless, following \citep{Greatbatch_JGR94}, the steric effect on the volume can be diagnosed by 1654 Only the volume is conserved, not mass, or, more precisely, the mass which is conserved is the Boussinesq mass, 1655 $\mathcal{M}_o = \rho_o \mathcal{V}$. 1656 The total volume (or equivalently the global mean sea level) is altered only by net volume fluxes across 1657 the ocean surface, not by changes in mean mass of the ocean: the steric effect is missing in a Boussinesq fluid. 1658 1659 Nevertheless, following \citep{Greatbatch_JGR94}, the steric effect on the volume can be diagnosed by 1676 1660 considering the mass budget of the ocean. 1677 The apparent changes in $\mathcal{M}$, mass of the ocean, which are not induced by 1678 surface mass flux must be compensated by a spatially uniform change in the mean sea level due to 1679 expansion/contraction of the ocean\citep{Greatbatch_JGR94}.1680 In others words, the Boussinesq mass, $\mathcal{M}_o$, can be related to $\mathcal{M}$, 1681 the total mass of the ocean seen by the Boussinesq model, via the steric contribution to the sea level,1661 The apparent changes in $\mathcal{M}$, mass of the ocean, which are not induced by surface mass flux 1662 must be compensated by a spatially uniform change in the mean sea level due to expansion/contraction of the ocean 1663 \citep{Greatbatch_JGR94}. 1664 In others words, the Boussinesq mass, $\mathcal{M}_o$, can be related to $\mathcal{M}$, 1665 the total mass of the ocean seen by the Boussinesq model, via the steric contribution to the sea level, 1682 1666 $\eta_s$, a spatially uniform variable, as follows: 1683 1667 … … 1685 1669 \label{eq:M_Bq} \] 1686 1670 1687 Any change in $\mathcal{M}$ which cannot be explained by the net mass flux through 1688 the ocean surfaceis converted into a mean change in sea level.1689 Introducing the total density anomaly, $\mathcal{D}= \int_D d_a \,dv$, where1690 $d_a = (\rho -\rho_o ) / \rho_o$ is the density anomaly used in \NEMO (cf. \autoref{subsec:TRA_eos}) in 1691 \autoref{eq:M_Bq} leads to a very simple form for the steric height:1671 Any change in $\mathcal{M}$ which cannot be explained by the net mass flux through the ocean surface 1672 is converted into a mean change in sea level. 1673 Introducing the total density anomaly, $\mathcal{D}= \int_D d_a \,dv$, 1674 where $d_a = (\rho -\rho_o ) / \rho_o$ is the density anomaly used in \NEMO (cf. \autoref{subsec:TRA_eos}) 1675 in \autoref{eq:M_Bq} leads to a very simple form for the steric height: 1692 1676 1693 1677 \[ \eta_s = - \frac{1}{\mathcal{A}} \mathcal{D} … … 1699 1683 We do not recommend that. 1700 1684 Indeed, in this case $\rho_o$ depends on the initial state of the ocean. 1701 Since $\rho_o$ has a direct effect on the dynamics of the ocean (it appears in1702 the pressure gradient term of the momentum equation) it is definitively not a good idea when 1703 i nter-comparing experiments.1685 Since $\rho_o$ has a direct effect on the dynamics of the ocean 1686 (it appears in the pressure gradient term of the momentum equation) 1687 it is definitively not a good idea when inter-comparing experiments. 1704 1688 We better recommend to fixe once for all $\rho_o$ to $1035\;Kg\,m^{-3}$. 1705 This value is a sensible choice for the reference density used in a Boussinesq ocean climate model since, 1706 with the exception of only a small percentage of the ocean, density in the World Ocean varies by 1707 no more than2$\%$ from this value (\cite{Gill1982}, page 47).1708 1709 Second, we have assumed here that the total ocean surface, $\mathcal{A}$, does not change when1710 the sea level is changing as it is the case in all global ocean GCMs 1689 This value is a sensible choice for the reference density used in a Boussinesq ocean climate model since, 1690 with the exception of only a small percentage of the ocean, density in the World Ocean varies by no more than 1691 2$\%$ from this value (\cite{Gill1982}, page 47). 1692 1693 Second, we have assumed here that the total ocean surface, $\mathcal{A}$, 1694 does not change when the sea level is changing as it is the case in all global ocean GCMs 1711 1695 (wetting and drying of grid point is not allowed). 1712 1696 1713 Third, the discretisation of \autoref{eq:steric_Bq} depends on the type of 1714 free surface which is considered. 1697 Third, the discretisation of \autoref{eq:steric_Bq} depends on the type of free surface which is considered. 1715 1698 In the non linear free surface case, $i.e.$ \key{vvl} defined, it is given by 1716 1699 … … 1719 1702 \label{eq:discrete_steric_Bq_nfs} \] 1720 1703 1721 whereas in the linear free surface, the volume above the \textit{z=0} surface must be explicitly 1722 taken into account to better approximate the total ocean mass and thus the steric sea level: 1704 whereas in the linear free surface, 1705 the volume above the \textit{z=0} surface must be explicitly taken into account to 1706 better approximate the total ocean mass and thus the steric sea level: 1723 1707 1724 1708 \[ \eta_s = - \frac{ \sum_{i,\,j,\,k} d_a\; e_{1t}e_{2t}e_{3t} + \sum_{i,\,j} d_a\; e_{1t}e_{2t} \eta } … … 1729 1713 In the real ocean, sea ice (and snow above it) depresses the liquid seawater through its mass loading. 1730 1714 This depression is a result of the mass of sea ice/snow system acting on the liquid ocean. 1731 There is, however, no dynamical effect associated with these depressions in the liquid ocean sea level, 1715 There is, however, no dynamical effect associated with these depressions in the liquid ocean sea level, 1732 1716 so that there are no associated ocean currents. 1733 Hence, the dynamically relevant sea level is the effective sea level, $i.e.$ the sea level as if 1734 sea ice (and snow) were converted to liquid seawater \citep{Campin_al_OM08}. 1735 However, in the current version of \NEMO the sea-ice is levitating above the ocean without 1736 mass exchanges between ice and ocean. 1737 Therefore the model effective sea level is always given by $\eta + \eta_s$, 1738 whether or not there is sea ice present. 1717 Hence, the dynamically relevant sea level is the effective sea level, 1718 $i.e.$ the sea level as if sea ice (and snow) were converted to liquid seawater \citep{Campin_al_OM08}. 1719 However, in the current version of \NEMO the sea-ice is levitating above the ocean without mass exchanges between 1720 ice and ocean. 1721 Therefore the model effective sea level is always given by $\eta + \eta_s$, whether or not there is sea ice present. 1739 1722 1740 1723 In AR5 outputs, the thermosteric sea level is demanded. … … 1747 1730 where $S_o$ and $p_o$ are the initial salinity and pressure, respectively. 1748 1731 1749 Both steric and thermosteric sea level are computed in \mdl{diaar5} which needs 1750 the \key{diaar5} defined tobe called.1732 Both steric and thermosteric sea level are computed in \mdl{diaar5} which needs the \key{diaar5} defined to 1733 be called. 1751 1734 1752 1735 % ------------------------------------------------------------------------------------------------------------- … … 1761 1744 \subsection{Depth of various quantities (\protect\mdl{diahth})} 1762 1745 1763 Among the available diagnostics the following ones are obtained when defining the \key{diahth} CPP key: 1746 Among the available diagnostics the following ones are obtained when defining the \key{diahth} CPP key: 1764 1747 1765 1748 - the mixed layer depth (based on a density criterion \citep{de_Boyer_Montegut_al_JGR04}) (\mdl{diahth}) … … 1782 1765 %----------------------------------------------------------------------------------------- 1783 1766 1784 The poleward heat and salt transports, their advective and diffusive component, and1785 the meriodional stream function can be computed on-line in \mdl{diaptr} \np{ln\_diaptr} to true 1767 The poleward heat and salt transports, their advective and diffusive component, 1768 and the meriodional stream function can be computed on-line in \mdl{diaptr} \np{ln\_diaptr} to true 1786 1769 (see the \textit{\ngn{namptr} } namelist below). 1787 When \np{ln\_subbas}\forcode{ = .true.}, transports and stream function are computed for the Atlantic, 1788 Indian, Pacific and Indo-Pacific Oceans (defined north of 30\deg S) as well as for the World Ocean. 1789 The sub-basin decomposition requires an input file (\ifile{subbasins}) which contains 1790 three 2D mask arrays, the Indo-Pacific mask been deduced from the sum of the Indian and 1791 Pacific mask (\autoref{fig:mask_subasins}). 1770 When \np{ln\_subbas}\forcode{ = .true.}, transports and stream function are computed for the Atlantic, Indian, 1771 Pacific and Indo-Pacific Oceans (defined north of 30\deg S) as well as for the World Ocean. 1772 The sub-basin decomposition requires an input file (\ifile{subbasins}) which contains three 2D mask arrays, 1773 the Indo-Pacific mask been deduced from the sum of the Indian and Pacific mask (\autoref{fig:mask_subasins}). 1792 1774 1793 1775 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 1794 \begin{figure}[!t] \begin{center}1795 \includegraphics[width=1.0\textwidth]{Fig_mask_subasins}1796 \caption{ \protect\label{fig:mask_subasins}1797 Decomposition of the World Ocean (here ORCA2) into sub-basin used in to compute the heat and 1798 salt transports as well as the meridional stream-function: Atlantic basin (red),1799 Pacific basin (green), Indian basin (bleue), Indo-Pacific basin (bleue+green). 1800 Note that semi-enclosed seas (Red, Med and Baltic seas) as well as Hudson Bay are removed from 1801 the sub-basins. Note also that the Arctic Ocean has been split into Atlantic and1802 1776 \begin{figure}[!t] 1777 \begin{center} 1778 \includegraphics[width=1.0\textwidth]{Fig_mask_subasins} 1779 \caption{ \protect\label{fig:mask_subasins} 1780 Decomposition of the World Ocean (here ORCA2) into sub-basin used in to 1781 compute the heat and salt transports as well as the meridional stream-function: 1782 Atlantic basin (red), Pacific basin (green), Indian basin (bleue), Indo-Pacific basin (bleue+green). 1783 Note that semi-enclosed seas (Red, Med and Baltic seas) as well as Hudson Bay are removed from the sub-basins. 1784 Note also that the Arctic Ocean has been split into Atlantic and Pacific basins along the North fold line.} 1803 1785 \end{center} \end{figure} 1804 1786 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 1827 1809 The 25 hour mean is available for daily runs by summing up the 25 hourly instantananeous hourly values from 1828 1810 midnight at the start of the day to midight at the day end. 1829 This diagnostic is actived with the logical $ln\_dia25h$1811 This diagnostic is actived with the logical $ln\_dia25h$. 1830 1812 1831 1813 % ----------------------------------------------------------- … … 1839 1821 %---------------------------------------------------------------------------------------------------------- 1840 1822 1841 A module is available to output the surface (top), mid water and bed diagnostics of a set of 1842 standard variables. 1843 This can be a useful diagnostic when hourly or sub-hourly output is required in 1844 high resolution tidal outputs. 1823 A module is available to output the surface (top), mid water and bed diagnostics of a set of standard variables. 1824 This can be a useful diagnostic when hourly or sub-hourly output is required in high resolution tidal outputs. 1845 1825 The tidal signal is retained but the overall data usage is cut to just three vertical levels. 1846 1826 Also the bottom level is calculated for each cell. 1847 This diagnostic is actived with the logical $ln\_diatmb$1827 This diagnostic is actived with the logical $ln\_diatmb$. 1848 1828 1849 1829 % ----------------------------------------------------------- … … 1859 1839 1860 1840 in the zonal, meridional and vertical directions respectively. 1861 The vertical component is included although it is not strictly valid as the vertical velocity is 1862 calculated fromthe continuity equation rather than as a prognostic variable.1841 The vertical component is included although it is not strictly valid as the vertical velocity is calculated from 1842 the continuity equation rather than as a prognostic variable. 1863 1843 Physically this represents the rate at which information is propogated across a grid cell. 1864 Values greater than 1 indicate that information is propagated across more than one grid cell in 1865 a single time step. 1866 1867 The variables can be activated by setting the \np{nn\_diacfl} namelist parameter to 1 in 1868 the \ngn{namctl} namelist. 1844 Values greater than 1 indicate that information is propagated across more than one grid cell in a single time step. 1845 1846 The variables can be activated by setting the \np{nn\_diacfl} namelist parameter to 1 in the \ngn{namctl} namelist. 1869 1847 The diagnostics will be written out to an ascii file named cfl\_diagnostics.ascii. 1870 In this file the maximum value of $C_u$, $C_v$, and $C_w$ are printed at each timestep along with 1871 the coordinates ofwhere the maximum value occurs.1872 At the end of the model run the maximum value of $C_u$, $C_v$, and $C_w$ for the whole model run is 1873 printed alongwith the coordinates of each.1848 In this file the maximum value of $C_u$, $C_v$, and $C_w$ are printed at each timestep along with the coordinates of 1849 where the maximum value occurs. 1850 At the end of the model run the maximum value of $C_u$, $C_v$, and $C_w$ for the whole model run is printed along 1851 with the coordinates of each. 1874 1852 The maximum values from the run are also copied to the ocean.output file. 1875 1853 -
NEMO/trunk/doc/latex/NEMO/subfiles/chap_DIU.tex
r10146 r10354 18 18 The skin temperature can be split into three parts: 19 19 \begin{itemize} 20 \item A foundation SST which is free from diurnal warming. 21 \item A warm layer, typically ~3\,m thick, where heating from solar radiation can 22 cause a warm stably stratified layer during the daytime 23 \item A cool skin, a thin layer, approximately ~1\,mm thick, where long wave cooling 24 is dominant and cools the immediate ocean surface. 20 \item 21 A foundation SST which is free from diurnal warming. 22 \item 23 A warm layer, typically ~3\,m thick, 24 where heating from solar radiation can cause a warm stably stratified layer during the daytime 25 \item 26 A cool skin, a thin layer, approximately ~1\, mm thick, 27 where long wave cooling is dominant and cools the immediate ocean surface. 25 28 \end{itemize} 26 29 27 Models are provided for both the warm layer, \mdfl{diurnal_bulk}, and the cool skin, 28 \mdl{cool_skin}. Foundation SST is not considered as it can be obtained 29 either from the main NEMO model ($i.e.$ from the temperature of the top few model levels) 30 or from some other source. 31 It must be noted that both the cool skin and warm layer models produce estimates of 32 the change in temperature ($\Delta T_{\rm{cs}}$ and $\Delta T_{\rm{wl}}$) 33 and both must be added to a foundation SST to obtain the true skin temperature. 30 Models are provided for both the warm layer, \mdfl{diurnal_bulk}, and the cool skin, \mdl{cool_skin}. 31 Foundation SST is not considered as it can be obtained either from the main NEMO model 32 ($i.e.$ from the