Changeset 1223
- Timestamp:
- 2008-11-26T13:12:16+01:00 (15 years ago)
- Location:
- trunk/DOC/TexFiles/Chapters
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DOC/TexFiles/Chapters/Annex_A.tex
r996 r1223 8 8 9 9 10 In order to establish the set of Primitive Equation in curvilinear $s$-coordinates ($i.e.$ 11 orthogonal curvilinear coordinate in the horizontal and $s$-coordinate in the vertical), we 12 start from the set of equation established in \S\ref{PE_zco_Eq} for the special case 13 $k = z$ and thus $e_3 = 1$, and we introduce an arbitrary vertical coordinate 14 $s = s(i,j,z,t)$. Let us define a new vertical scale factor by $e_3 = \partial z / \partial s$ 15 (which now depends on $(i,j,z,t)$) and the horizontal slope of $s$-surfaces by : 10 In order to establish the set of Primitive Equation in curvilinear $s$-coordinates 11 ($i.e.$ an orthogonal curvilinear coordinate in the horizontal and $s$-coordinate 12 in the vertical), we start from the set of equations established in \S\ref{PE_zco_Eq} 13 for the special case $k = z$ and thus $e_3 = 1$, and we introduce an arbitrary 14 vertical coordinate $s = s(i,j,z,t)$. Let us define a new vertical scale factor by 15 $e_3 = \partial z / \partial s$ (which now depends on $(i,j,z,t)$) and the horizontal 16 slope of $s$-surfaces by : 16 17 \begin{equation} \label{Apdx_A_s_slope} 17 18 \sigma _1 =\frac{1}{e_1 }\;\left. {\frac{\partial z}{\partial i}} \right|_s … … 20 21 \end{equation} 21 22 22 The chain rule to establish the model equations in the curvilinear $s$-coordinate system23 is:23 The chain rule to establish the model equations in the curvilinear $s$-coordinate 24 system is: 24 25 \begin{equation} \label{Apdx_A_s_chain_rule} 25 26 \begin{aligned} … … 41 42 \end{equation} 42 43 43 In particular applying the time derivative chain rule to $z$ provide the expression of $w_s$, the vertical velocity of the $s-$surfaces: 44 In particular applying the time derivative chain rule to $z$ provides the 45 expression for $w_s$, the vertical velocity of the $s-$surfaces: 44 46 \begin{equation} \label{Apdx_A_w_in_s} 45 47 w_s = \left. \frac{\partial z }{\partial t} \right|_s … … 54 56 \label{Apdx_B_continuity} 55 57 56 Using (\ref{Apdx_A_s_chain_rule}) and the fact that the horizontal scale factors $e_1$ and $e_2$ do not depend on the vertical coordinate, the divergence of the velocity relative to the ($i$,$j$,$z$) coordinate system is transformed as follows: 58 Using (\ref{Apdx_A_s_chain_rule}) and the fact that the horizontal scale factors 59 $e_1$ and $e_2$ do not depend on the vertical coordinate, the divergence of 60 the velocity relative to the ($i$,$j$,$z$) coordinate system is transformed as follows: 57 61 58 62 \begin{align*} … … 109 113 \end{align*} 110 114 111 Here, $w$ is the vertical velocity relative to the $z-$coordinate system. Introducing the dia-surface velocity component, $\omega $, defined as the velocity relative to the moving $s$-surfaces and normal to them: 115 Here, $w$ is the vertical velocity relative to the $z-$coordinate system. 116 Introducing the dia-surface velocity component, $\omega $, defined as 117 the velocity relative to the moving $s$-surfaces and normal to them: 112 118 \begin{equation} \label{Apdx_A_w_s} 113 119 \omega = w - w_s - \sigma _1 \,u - \sigma _2 \,v \\ 114 120 \end{equation} 115 with $w_s$ given by \eqref{Apdx_A_w_in_s}, we obtain the expression of the divergence of the velocity in the curvilinear $s$-coordinate system: 121 with $w_s$ given by \eqref{Apdx_A_w_in_s}, we obtain the expression for 122 the divergence of the velocity in the curvilinear $s$-coordinate system: 116 123 \begin{align*} \label{Apdx_A_A4} 117 124 \nabla \cdot {\rm {\bf U}} … … 142 149 \end{align*} 143 150 144 As a result, the continuity equation \eqref{Eq_PE_continuity} in $s$-coordinates becomes: 151 As a result, the continuity equation \eqref{Eq_PE_continuity} in the 152 $s$-coordinates becomes: 145 153 \begin{equation} \label{Apdx_A_A5} 146 154 \frac{1}{e_3 } \frac{\partial e_3}{\partial t} … … 157 165 \label{Apdx_B_momentum} 158 166 159 Let us consider \eqref{Eq_PE_dyn_vect}, the first component of the 160 momentum equation in the vector invariant form (similar manipulations can be performed on the second one). Its non linear term can be transformed161 as follows:167 Let us consider \eqref{Eq_PE_dyn_vect}, the first component of the momentum 168 equation in the vector invariant form (similar manipulations can be performed 169 on the second component). Its non-linear term can be transformed as follows: 162 170 163 171 \begin{align*} … … 205 213 \end{align*} 206 214 207 Therefore, the non-linear terms of the momentum equation have the same form 208 in $z-$ and $s-$coordinates but with the addition of the time derivative of the velocity: 215 Therefore, the non-linear terms of the momentum equation have the same 216 form in $z-$ and $s-$coordinates but with the addition of the time derivative 217 of the velocity: 209 218 \begin{multline} \label{Apdx_A_momentum_NL} 210 219 +\left. \zeta \right|_z v-\frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_z … … 224 233 \end{equation} 225 234 226 An additional term appears in (\ref{Apdx_A_grad_p}) which accounts for the tilt of model 227 levels. 228 229 Introducing \eqref{Apdx_A_momentum_NL} and \eqref{Apdx_A_grad_p} in \eqref{Eq_PE_dyn_vect} and regrouping the time derivative terms in the left hand side, and performing the same manipulation on the second component, we obtain the vector invariant form of momentum equation in $s-$coordinate : 235 An additional term appears in (\ref{Apdx_A_grad_p}) which accounts for the 236 tilt of model levels. 237 238 Introducing \eqref{Apdx_A_momentum_NL} and \eqref{Apdx_A_grad_p} in \eqref{Eq_PE_dyn_vect} and regrouping the time derivative terms in the left 239 hand side, and performing the same manipulation on the second component, 240 we obtain the vector invariant form of the momentum equations in the 241 $s-$coordinate : 230 242 \begin{subequations} \label{Apdx_A_dyn_vect} 231 243 \begin{multline} \label{Apdx_A_PE_dyn_vect_u} … … 249 261 \end{subequations} 250 262 251 It has the same form as in $z-$coordinate but the vertical scale factor that has appeared inside the time derivative. The form of the vertical physics and forcing terms remain unchanged. The form of the lateral physics is discussed in appendix~\ref{Apdx_B}. 263 It has the same form as in the $z-$coordinate but for the vertical scale factor 264 that has appeared inside the time derivative. The form of the vertical physics 265 and forcing terms remains unchanged. The form of the lateral physics is 266 discussed in appendix~\ref{Apdx_B}. 252 267 253 268 % ================================================================ … … 257 272 \label{Apdx_B_tracer} 258 273 259 The tracer equation is obtained using the same calculation as for the 260 continuityequation and then regrouping the time derivative terms in the left hand side :274 The tracer equation is obtained using the same calculation as for the continuity 275 equation and then regrouping the time derivative terms in the left hand side : 261 276 262 277 \begin{multline} \label{Apdx_A_tracer} … … 269 284 270 285 271 The expression ofthe advection term is a straight consequence of (A.4), the272 expression of the 3D divergence in $s$-coordinates established above.273 286 The expression for the advection term is a straight consequence of (A.4), the 287 expression of the 3D divergence in the $s$-coordinates established above. 288 -
trunk/DOC/TexFiles/Chapters/Annex_B.tex
r994 r1223 13 13 14 14 15 In $z$-coordinate, the horizontal/vertical second order tracer diffusive operator is given by: 15 In the $z$-coordinate, the horizontal/vertical second order tracer diffusion operator 16 is given by: 16 17 \begin{multline} \label{Apdx_B1} 17 18 D^T = \frac{1}{e_1 \, e_2} \left[ … … 22 23 \end{multline} 23 24 24 In $s$-coordinate, we defined the slopes of $s$-surfaces, $\sigma_1$ and $\sigma_2$ by (A.1) and the vertical/horizontal ratio of diffusive coefficient by $\epsilon = A^{vT} / A^{lT}$. The diffusive operator is given by: 25 In the $s$-coordinate, we defined the slopes of $s$-surfaces, $\sigma_1$ and 26 $\sigma_2$ by (!!!A.1!!!) and the vertical/horizontal ratio of diffusion coefficient 27 by $\epsilon = A^{vT} / A^{lT}$. The diffusion operator is given by: 25 28 26 29 \begin{equation} \label{Apdx_B2} … … 34 37 \end{array} }} \right) 35 38 \end{equation} 36 or in exp ended form:39 or in expanded form: 37 40 \begin{multline} \label{Apdx_B3} 38 41 D^T=\frac{1}{e_1\,e_2\,e_3 }\;\left[ {\quad \; \; e_2\,e_3\,A^{lT} \;\left. … … 45 48 \end{multline} 46 49 47 48 Equation \eqref{Apdx_B2} (or equivalently \eqref{Apdx_B3}) is obtained from \eqref{Apdx_B1} without any additional assumption. Indeed, for the special case $k=z$ and thus $e_3 =1$, we introduce an arbitrary vertical coordinate $s = s (i,j,z)$ as in Appendix~\ref{Apdx_A} and use \eqref{Apdx_A_s_slope} and \eqref{Apdx_A_s_chain_rule}. Since no cross horizontal derivate $\partial _i \partial _j $ appears in \eqref{Apdx_B1}, the ($i$,$z$) and ($j$,$z$) planes are independent. The demonstration can then be done for the ($i$,$z$)~$\to$~($j$,$s$) transformation without any loss of generality: 50 Equation \eqref{Apdx_B2} (or equivalently \eqref{Apdx_B3}) is obtained from 51 \eqref{Apdx_B1} without any additional assumption. Indeed, for the special 52 case $k=z$ and thus $e_3 =1$, we introduce an arbitrary vertical coordinate 53 $s = s (i,j,z)$ as in Appendix~\ref{Apdx_A} and use \eqref{Apdx_A_s_slope} 54 and \eqref{Apdx_A_s_chain_rule}. Since no cross horizontal derivative 55 $\partial _i \partial _j $ appears in \eqref{Apdx_B1}, the ($i$,$z$) and ($j$,$z$) 56 planes are independent. The derivation can then be demonstrated for the 57 ($i$,$z$)~$\to$~($j$,$s$) transformation without any loss of generality: 49 58 50 59 \begin{equation*} … … 87 96 \end{multline*} 88 97 89 Since the horizontal scale factor do not depend on the vertical coordinate, the last term of the first line and the first term of the last line cancel, while the second line reduces to a single vertical derivative, so it becomes: 98 Since the horizontal scale factors do not depend on the vertical coordinate, 99 the last term of the first line and the first term of the last line cancel, while 100 the second line reduces to a single vertical derivative, so it becomes: 90 101 91 102 \begin{multline*} … … 94 105 \end{multline*} 95 106 96 in other words, the horizontal Laplacian operator in the ($i$,$s$) plane takes the following expression:107 in other words, the horizontal Laplacian operator in the ($i$,$s$) plane takes the following form : 97 108 98 109 \begin{equation*} … … 123 134 124 135 125 The iso/diapycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in the ($i$,$j$,$k$) curvilinear coordinate system in which the equations of the ocean circulation model are formulated, takes the following expression \citep{Redi_JPO82}: 136 The iso/diapycnal diffusive tensor $\textbf {A}_{\textbf I}$ expressed in the ($i$,$j$,$k$) 137 curvilinear coordinate system in which the equations of the ocean circulation model are 138 formulated, takes the following form \citep{Redi_JPO82}: 126 139 127 140 \begin{equation*} … … 141 154 \end{equation*} 142 155 143 In practice, the isopycnal slopes are generally less than $10^{-2}$ in the ocean, so $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{Cox1987}: 156 In practice, the isopycnal slopes are generally less than $10^{-2}$ in the ocean, so 157 $\textbf {A}_{\textbf I}$ can be simplified appreciably \citep{Cox1987}: 144 158 \begin{equation*} 145 159 {\textbf{A}_{\textbf{I}}} \approx A^{lT} … … 151 165 \end{equation*} 152 166 153 The resulting isopycnal operator conserves the quantity and dissipates its square. The demonstration of the first property is trivial as \eqref{Apdx_B2} is the divergence of fluxes. Let us demonstrate the second one: 167 The resulting isopycnal operator conserves the quantity and dissipates its square. 168 The demonstration of the first property is trivial as \eqref{Apdx_B2} is the divergence 169 of fluxes. Let us demonstrate the second one: 154 170 \begin{equation*} 155 171 \iiint\limits_D T\;\nabla .\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv = -\iiint\limits_D \nabla T\;.\left( {\textbf{A}}_{\textbf{I}} \nabla T \right)\,dv … … 169 185 the property becomes obvious. 170 186 171 The resulting diffusive operator in $z$-coordinates has the following 172 expression : 187 The resulting diffusion operator in $z$-coordinate has the following form : 173 188 \begin{multline*} \label{Apdx_B_ldfiso} 174 189 D^T=\frac{1}{e_1 e_2 }\left\{ {\;\frac{\partial }{\partial i}\left[ {A_h \left( {\frac{e_2 }{e_1 }\frac{\partial T}{\partial i}-a_1 \frac{e_2}{e_3}\frac{\partial T}{\partial k}} \right)} \right]\;} \right.\;\; \\ … … 177 192 \end{multline*} 178 193 179 It has to be emphasised that the simplification introduced leads to a decoupling between ($i$,$z$) and ($j$,$z$) planes. The operator has therefore the same expression as \eqref{Apdx_B3}, the diffusive operator obtained for geopotential diffusion in $s$-coordinate. 194 It has to be emphasised that the simplification introduced, leads to a decoupling 195 between ($i$,$z$) and ($j$,$z$) planes. The operator has therefore the same 196 expression as \eqref{Apdx_B3}, the diffusion operator obtained for geopotential 197 diffusion in the $s$-coordinate. 180 198 181 199 % ================================================================ … … 185 203 \label{Apdx_B_3} 186 204 187 The second order momentum diffusive operator (Laplacian) in $z$-coordinate is found by applying \eqref{Eq_PE_lap_vector}, the expression of the Laplacian of a vector, to the horizontal velocity vector : 205 The second order momentum diffusion operator (Laplacian) in the $z$-coordinate 206 is found by applying \eqref{Eq_PE_lap_vector}, the expression for the Laplacian 207 of a vector, to the horizontal velocity vector : 188 208 \begin{align*} 189 209 \Delta {\textbf{U}}_h … … 221 241 \end{array} }} \right) 222 242 \end{align*} 223 Using \eqref{Eq_PE_div}, the definition of the horizontal divergence, the third componant of the second vector is obviously zero and thus : 243 Using \eqref{Eq_PE_div}, the definition of the horizontal divergence, the third 244 componant of the second vector is obviously zero and thus : 224 245 \begin{equation*} 225 246 \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) 226 247 \end{equation*} 227 248 228 Note that this operator ensures a full separation between the vorticity and horizontal divergence fields (see Appendix~\ref{Apdx_C}). It is only equal to a Laplacian applied on each component in Cartesian coordinate, not on the sphere. 249 Note that this operator ensures a full separation between the vorticity and horizontal 250 divergence fields (see Appendix~\ref{Apdx_C}). It is only equal to a Laplacian 251 applied to each component in Cartesian coordinates, not on the sphere. 229 252 230 253 The horizontal/vertical second order (Laplacian type) operator used to diffuse 231 horizontal momentum in $z$-coordinate takes therefore the following expression:254 horizontal momentum in the $z$-coordinate therefore takes the following form : 232 255 \begin{equation} \label{Apdx_B_Lap_U} 233 256 {\textbf{D}}^{\textbf{U}} = … … 237 260 \frac{\partial {\rm {\bf U}}_h }{\partial k}} \right) \\ 238 261 \end{equation} 239 that is in expanded form:262 that is, in expanded form: 240 263 \begin{align*} 241 264 D^{\textbf{U}}_u … … 249 272 \end{align*} 250 273 251 Note Bene: introducing a rotation in \eqref{Apdx_B_Lap_U} does not lead to any useful expression for the iso/diapycnal Laplacian operator in $z$-coordinate. Similarly, we did not found an expression of practical use for the geopotential horizontal/vertical Laplacian operator in $s$-coordinate. Generally, \eqref{Apdx_B_Lap_U} is used in both $z$- and $s$-coordinate system, that is a Laplacian diffusion is applied on momentum along the coordinate directions. 274 Note Bene: introducing a rotation in \eqref{Apdx_B_Lap_U} does not lead to a 275 useful expression for the iso/diapycnal Laplacian operator in the $z$-coordinate. 276 Similarly, we did not found an expression of practical use for the geopotential 277 horizontal/vertical Laplacian operator in the $s$-coordinate. Generally, 278 \eqref{Apdx_B_Lap_U} is used in both $z$- and $s$-coordinate systems, that is 279 a Laplacian diffusion is applied on momentum along the coordinate directions. -
trunk/DOC/TexFiles/Chapters/Annex_C.tex
r999 r1223 17 17 \label{Apdx_C.1} 18 18 19 20 First, the boundary condition on the vertical velocity (no flux through the surface and the bottom) is established for the discrete set of momentum equations. Then, it is shown that the non linear terms of the momentum equation are written such that the potential enstrophy of a horizontally non divergent flow is preserved while all the other non-diffusive terms preserve the kinetic energy: the energy is also preserved in practice. In addition, an option is also offer for the vorticity term discretization which provides 21 a total kinetic energy conserving discretization for that term. 22 23 Nota Bene: these properties are established here in the rigid-lid case and for the 2nd order centered scheme. A forthcoming update will be their generalisation to the free surface case 24 and higher order scheme. 19 First, the boundary condition on the vertical velocity (no flux through the surface 20 and the bottom) is established for the discrete set of momentum equations. 21 Then, it is shown that the non-linear terms of the momentum equation are written 22 such that the potential enstrophy of a horizontally non-divergent flow is preserved 23 while all the other non-diffusive terms preserve the kinetic energy; in practice the 24 energy is also preserved. In addition, an option is also offered for the vorticity term 25 discretization which provides a total kinetic energy conserving discretization for 26 that term. 27 28 Nota Bene: these properties are established here in the rigid-lid case and for the 29 2nd order centered scheme. A forthcoming update will be their generalisation to 30 the free surface case and higher order scheme. 25 31 26 32 % ------------------------------------------------------------------------------------------------------------- … … 31 37 32 38 33 The discrete set of momentum equations used in rigidlid approximation39 The discrete set of momentum equations used in the rigid-lid approximation 34 40 automatically satisfies the surface and bottom boundary conditions 35 41 (no flux through the surface and the bottom: $w_{surface} =w_{bottom} =~0$). 36 42 Indeed, taking the discrete horizontal divergence of the vertical sum of the 37 horizontal momentum equations ( Eqs. (II.2.1) and (II.2.2)~) wheighted by the43 horizontal momentum equations (!!!Eqs. (II.2.1) and (II.2.2)!!!) weighted by the 38 44 vertical scale factors, it becomes: 39 45 \begin{flalign*} … … 83 89 84 90 85 The surface boundary condition associated with the rigid lid approximation ($w_{surface} =0)$ is imposed in the computation of the vertical velocity (II.2.5). Therefore, it turns out to be: 91 The surface boundary condition associated with the rigid lid approximation 92 ($w_{surface} =0)$ is imposed in the computation of the vertical velocity (!!! II.2.5!!!!). 93 Therefore, it turns out to be: 86 94 \begin{equation*} 87 95 \frac{\partial } {\partial t}w_{bottom} \equiv 0 88 96 \end{equation*} 89 As the bottom velocity is initially set to zero, it remains zero all the time. Symmetrically, if $w_{bottom} =0$ is used in the computation of the vertical velocity (upward integral of the horizontal divergence), the same computation leads to $w_{surface} =0$ as soon as the surface vertical velocity is initially set to zero. 97 As the bottom velocity is initially set to zero, it remains zero all the time. 98 Symmetrically, if $w_{bottom} =0$ is used in the computation of the vertical 99 velocity (upward integral of the horizontal divergence), the same computation 100 leads to $w_{surface} =0$ as soon as the surface vertical velocity is initially 101 set to zero. 90 102 91 103 % ------------------------------------------------------------------------------------------------------------- … … 101 113 \label{Apdx_C_vor} 102 114 103 Potential vorticity is located at $f$-points and defined as: $\zeta / e_{3f}$. The standard discrete formulation of the relative vorticity term obviously conserves potential vorticity (ENS scheme). It also conserves the potential enstrophy for a horizontally non-divergent flow (i.e. $\chi $=0) but not the total kinetic energy. Indeed, using the symmetry or skew symmetry properties of the operators (Eqs \eqref{DOM_mi_adj} and \eqref{DOM_di_adj}), it can be shown that: 115 Potential vorticity is located at $f$-points and defined as: $\zeta / e_{3f}$. 116 The standard discrete formulation of the relative vorticity term obviously 117 conserves potential vorticity (ENS scheme). It also conserves the potential 118 enstrophy for a horizontally non-divergent flow (i.e. $\chi $=0) but not the 119 total kinetic energy. Indeed, using the symmetry or skew symmetry properties 120 of the operators (Eqs \eqref{DOM_mi_adj} and \eqref{DOM_di_adj}), it can 121 be shown that: 104 122 \begin{equation} \label{Apdx_C_1.1} 105 123 \int_D {\zeta / e_3\,\;{\textbf{k}}\cdot \frac{1} {e_3} \nabla \times \left( {\zeta \;{\textbf{k}}\times {\textbf{U}}_h } \right)\;dv} \equiv 0 … … 164 182 \end{align*} 165 183 166 Note that the de monstration is donehere for the relative potential167 vorticity but it still hold forthe planetary ($f/e_3$) and the total168 potential vorticity $((\zeta +f) /e_3 )$. Another formulation of 169 the twocomponents of the vorticity term is optionally offered (ENE scheme) :184 Note that the derivation is demonstrated here for the relative potential 185 vorticity but it applies also to the planetary ($f/e_3$) and the total 186 potential vorticity $((\zeta +f) /e_3 )$. Another formulation of the two 187 components of the vorticity term is optionally offered (ENE scheme) : 170 188 \begin{equation*} 171 189 - \zeta \;{\textbf{k}}\times {\textbf {U}}_h … … 185 203 \end{equation*} 186 204 187 This formulation does not conserve the enstrophy but the total kinetic 188 energy. It is also possible to mix the two formulations in order to conserve 189 enstrophy on the relative vorticity term and energy on the Coriolis term. 205 This formulation does not conserve the enstrophy but it does conserve the 206 total kinetic energy. It is also possible to mix the two formulations in order 207 to conserve enstrophy on the relative vorticity term and energy on the 208 Coriolis term. 190 209 \begin{flalign*} 191 210 &\int\limits_D - \textbf{U}_h \cdot \left( \zeta \;\textbf{k} \times \textbf{U}_h \right) \; dv && \\ … … 219 238 = - \int_D \textbf{U}_h \cdot w \frac{\partial \textbf{U}_h} {\partial k}\;dv 220 239 \end{equation*} 221 Indeed, using successively \eqref{DOM_di_adj} ($i.e.$ the skew symmetry property of the $\delta$ operator) and the incompressibility, then again \eqref{DOM_di_adj}, then 222 the commutativity of operators $\overline {\,\cdot \,}$ and $\delta$, and finally \eqref{DOM_mi_adj} ($i.e.$ the symmetry property of the $\overline {\,\cdot \,}$ operator) applied in the horizontal and vertical direction, it becomes: 240 Indeed, using successively \eqref{DOM_di_adj} ($i.e.$ the skew symmetry 241 property of the $\delta$ operator) and the incompressibility, then 242 \eqref{DOM_di_adj} again, then the commutativity of operators 243 $\overline {\,\cdot \,}$ and $\delta$, and finally \eqref{DOM_mi_adj} 244 ($i.e.$ the symmetry property of the $\overline {\,\cdot \,}$ operator) 245 applied in the horizontal and vertical directions, it becomes: 223 246 \begin{flalign*} 224 247 &\int_D \textbf{U}_h \cdot \nabla_h \left( \frac{1}{2}\;{\textbf{U}_h}^2 \right)\;dv &&&\\ … … 252 275 \biggl\{ \overline {e_{1T}\,e_{2T} \,w}^{\,i+1/2}\;2 253 276 \overline {u}^{\,k+1/2}\; \delta_{k+1/2} \left[ u \right] %&&& \\ 254 + \overline {e_{1T}\,e_{2T} \,w}^{\,j+1/2}\;2 \overline {v}^{\,k+1/2}\; \delta_{k+1/2} 277 + \overline {e_{1T}\,e_{2T} \,w}^{\,j+1/2}\;2 \overline {v}^{\,k+1/2}\; \delta_{k+1/2} \left[ v \right] \; 255 278 \biggr\} 256 279 &&\displaybreak[0] \\ … … 272 295 \end{flalign*} 273 296 274 The main point here is that the satisfaction of this property links the choice of the discrete formulation of vertical advection and of horizontal gradient of KE. Choosing one imposes the other. For example KE can also be discretized as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$. This leads to the following expression for the vertical advection: 297 The main point here is that the satisfaction of this property links the choice of 298 the discrete formulation of the vertical advection and of the horizontal gradient 299 of KE. Choosing one imposes the other. For example KE can also be discretized 300 as $1/2\,({\overline u^{\,i}}^2 + {\overline v^{\,j}}^2)$. This leads to the following 301 expression for the vertical advection: 275 302 \begin{equation*} 276 303 \frac{1} {e_3 }\; w\; \frac{\partial \textbf{U}_h } {\partial k} … … 284 311 \end{array}} } \right) 285 312 \end{equation*} 286 a formulation that requires a additional horizontal mean compare to the one used in NEMO. Nine velocity points have to be used instead of 3. This is the reason why it has not been choosen. 313 a formulation that requires an additional horizontal mean in contrast with 314 the one used in NEMO. Nine velocity points have to be used instead of 3. 315 This is the reason why it has not been chosen. 287 316 288 317 % ------------------------------------------------------------------------------------------------------------- … … 298 327 \label{Apdx_C.1.3.1} 299 328 300 In flux from the vorticity term reduces to a Coriolis term in which the Coriolis parameter has been modified to account for the ``metric'' term. This altered Coriolis parameter is discretised at F-point. It is given by: 329 In flux from the vorticity term reduces to a Coriolis term in which the Coriolis 330 parameter has been modified to account for the ``metric'' term. This altered 331 Coriolis parameter is discretised at an f-point. It is given by: 301 332 \begin{equation*} 302 333 f+\frac{1} {e_1 e_2 } … … 308 339 \end{equation*} 309 340 310 The ENE scheme is then applied to obtain the vorticity term in flux form. It therefore conserves the total KE. The demonstration is same as for the vorticity term in vector invariant form (\S\ref{Apdx_C_vor}). 341 The ENE scheme is then applied to obtain the vorticity term in flux form. 342 It therefore conserves the total KE. The derivation is the same as for the 343 vorticity term in the vector invariant form (\S\ref{Apdx_C_vor}). 311 344 312 345 % ------------------------------------------------------------------------------------------------------------- … … 316 349 \label{Apdx_C.1.3.2} 317 350 318 The flux form operator of the momentum advection is evaluated using a centered second order finite difference scheme. Because of the flux form, the discrete operator does not contribute to the global budget of linear momentum. Because of the centered second order scheme, it conserves the horizontal kinetic energy, that is : 351 The flux form operator of the momentum advection is evaluated using a 352 centered second order finite difference scheme. Because of the flux form, 353 the discrete operator does not contribute to the global budget of linear 354 momentum. Because of the centered second order scheme, it conserves 355 the horizontal kinetic energy, that is : 319 356 320 357 \begin{equation} \label{Apdx_C_I.3.10} … … 326 363 \end{equation} 327 364 328 Let us demonstrate this property for the first term of the scalar product (i.e. considering just the the terms associated with the i-component of the advection): 365 Let us demonstrate this property for the first term of the scalar product 366 ($i.e.$ considering just the the terms associated with the i-component of 367 the advection): 329 368 \begin{flalign*} 330 369 &\int_D u \cdot \nabla \cdot \left( \textbf{U}\,u \right) \; dv &&&\\ … … 382 421 \end{flalign*} 383 422 384 When the UBS scheme is used to evaluate the flux form momentum advection, the discrete operator does not contribute to the global budget of linear momentum (flux form). The horizontal kinetic energy is not conserved, but forced to decrease (the scheme is diffusive). 423 When the UBS scheme is used to evaluate the flux form momentum advection, 424 the discrete operator does not contribute to the global budget of linear momentum 425 (flux form). The horizontal kinetic energy is not conserved, but forced to decay 426 ($i.e.$ the scheme is diffusive). 385 427 386 428 % ------------------------------------------------------------------------------------------------------------- … … 391 433 392 434 393 A pressure gradient has no contribution to the evolution of the vorticity as the curl of a gradient is zero. In $z$-coordinate, this properties is satisfied locally on a C-grid with 2nd order finite differences (property \eqref{Eq_DOM_curl_grad}). When the equation of state is linear ($i.e.$ when an advective-diffusive equation for density can be derived from those of temperature and salinity) the change of KE due to the work of pressure forces is balanced by the change of potential energy due to buoyancy forces: 435 A pressure gradient has no contribution to the evolution of the vorticity as the 436 curl of a gradient is zero. In the $z$-coordinate, this property is satisfied locally 437 on a C-grid with 2nd order finite differences (property \eqref{Eq_DOM_curl_grad}). 438 When the equation of state is linear ($i.e.$ when an advection-diffusion equation 439 for density can be derived from those of temperature and salinity) the change of 440 KE due to the work of pressure forces is balanced by the change of potential 441 energy due to buoyancy forces: 394 442 \begin{equation*} 395 443 \int_D - \frac{1} {\rho_o} \left. \nabla p^h \right|_z \cdot \textbf{U}_h \;dv … … 397 445 \end{equation*} 398 446 399 This property can be satisfied in discrete sense for both $z$- and $s$-coordinates. Indeed, defining the depth of a $T$-point, $z_T$ defined as the sum of the vertical scale factors at $w$-points starting from the surface, the workof pressure forces can be written as: 447 This property can be satisfied in a discrete sense for both $z$- and $s$-coordinates. 448 Indeed, defining the depth of a $T$-point, $z_T$, as the sum of the vertical scale 449 factors at $w$-points starting from the surface, the work of pressure forces can be 450 written as: 400 451 \begin{flalign*} 401 452 &\int_D - \frac{1} {\rho_o} \left. \nabla p^h \right|_z \cdot \textbf{U}_h \;dv &&& \\ … … 410 461 \end{flalign*} 411 462 412 Using \eqref{DOM_di_adj}, $i.e.$ the skew symmetry property of the $\delta$ operator, \eqref{Eq_wzv}, the continuity equation), and \eqref{Eq_dynhpg_sco}, the hydrostatic 413 equation in $s$-coordinate, it turns out to be: 463 Using \eqref{DOM_di_adj}, $i.e.$ the skew symmetry property of the $\delta$ 464 operator, \eqref{Eq_wzv}, the continuity equation), and \eqref{Eq_dynhpg_sco}, 465 the hydrostatic equation in the $s$-coordinate, it becomes: 414 466 \begin{flalign*} 415 467 \equiv& \frac{1} {\rho_o} \sum\limits_{i,j,k} \biggl\{ … … 467 519 \end{flalign*} 468 520 469 Note that this property strongly constrain ts the discrete expression of both470 the depth of $T-$points and of the term added to the pressure gradient in 471 $s$-coordinate. Nevertheless, it is almost never satisfied as a linear equation of state472 is rarely used.521 Note that this property strongly constrains the discrete expression of both 522 the depth of $T-$points and of the term added to the pressure gradient in the 523 $s$-coordinate. Nevertheless, it is almost never satisfied since a linear equation 524 of state is rarely used. 473 525 474 526 % ------------------------------------------------------------------------------------------------------------- … … 479 531 480 532 481 The surface pressure gradient has no contribution to the evolution of the vorticity. This property is trivially satisfied locally as the equation verified by $\psi $ has been derived from the discrete formulation of the momentum equation and of the curl. But it has to be noticed that since the elliptic equation verified by $\psi $ is solved numerically by an iterative solver (preconditioned conjugate gradient or successive over relaxation), the 482 property is only satisfied at the precision required on the solver used. 483 484 With the rigid-lid approximation, the change of KE due to the work of surface pressure forces is exactly zero. This is satisfied in discrete form, at the precision required on the elliptic solver used to solve this equation. This can be demonstrated as follows: 533 The surface pressure gradient has no contribution to the evolution of the vorticity. 534 This property is trivially satisfied locally since the equation verified by $\psi$ has 535 been derived from the discrete formulation of the momentum equation and of the curl. 536 But it has to be noted that since the elliptic equation satisfied by $\psi$ is solved 537 numerically by an iterative solver (preconditioned conjugate gradient or successive 538 over relaxation), the property is only satisfied at the precision requested for the 539 solver used. 540 541 With the rigid-lid approximation, the change of KE due to the work of surface 542 pressure forces is exactly zero. This is satisfied in discrete form, at the precision 543 requested for the elliptic solver used to solve this equation. This can be 544 demonstrated as follows: 485 545 \begin{flalign*} 486 546 \int\limits_D - \frac{1} {\rho_o} \nabla_h \left( p_s \right) \cdot \textbf{U}_h \;dv% &&& \\ … … 503 563 && \\ 504 564 % 505 \intertext{using the relation between \textit{$\psi $} and the vertical lysum of the velocity, it becomes:}565 \intertext{using the relation between \textit{$\psi $} and the vertical sum of the velocity, it becomes:} 506 566 % 507 567 &\equiv \sum\limits_{i,j} … … 537 597 \end{flalign*} 538 598 539 The last equality is obtained using \eqref{Eq_dynspg_rl}, the discrete barotropic streamfunction time evolution equation. By the way, this shows that \eqref{Eq_dynspg_rl} is the only way do compute the streamfunction, otherwise the surface pressure forces will work. Nevertheless, since the elliptic equation verified by $\psi $ is solved numerically by an iterative solver, the property is only satisfied at the precision required on the solver. 599 The last equality is obtained using \eqref{Eq_dynspg_rl}, the discrete barotropic 600 streamfunction time evolution equation. By the way, this shows that 601 \eqref{Eq_dynspg_rl} is the only way to compute the streamfunction, 602 otherwise the surface pressure forces will do work. Nevertheless, since 603 the elliptic equation satisfied by $\psi $ is solved numerically by an iterative 604 solver, the property is only satisfied at the precision requested for the solver. 540 605 541 606 % ================================================================ … … 546 611 547 612 548 All the numerical schemes used in NEMO are written such that the tracer content is conserved by the internal dynamics and physics (equations in flux form). For advection, only the CEN2 scheme ($i.e.$ 2nd order finite different scheme) conserves the global variance of tracer. Nevertheless the other schemes ensure that the global variance decreases ($i.e.$ they are at least slightly diffusive). For diffusion, all the schemes ensure the decrease of the total tracer variance, but the iso-neutral operator. There is generally no strict conservation of mass, as the equation of state is non linear with respect to $T$ and $S$. In practice, the mass is conserved with a very good accuracy. 613 All the numerical schemes used in NEMO are written such that the tracer content 614 is conserved by the internal dynamics and physics (equations in flux form). 615 For advection, only the CEN2 scheme ($i.e.$ $2^{nd}$ order finite different scheme) 616 conserves the global variance of tracer. Nevertheless the other schemes ensure 617 that the global variance decreases ($i.e.$ they are at least slightly diffusive). 618 For diffusion, all the schemes ensure the decrease of the total tracer variance, 619 except the iso-neutral operator. There is generally no strict conservation of mass, 620 as the equation of state is non linear with respect to $T$ and $S$. In practice, 621 the mass is conserved to a very high accuracy. 549 622 % ------------------------------------------------------------------------------------------------------------- 550 623 % Advection Term … … 553 626 \label{Apdx_C.2.1} 554 627 555 Whatever the advection scheme considered it conserves of the tracer content as all the scheme are written in flux form. Let $\tau$ be the tracer interpolated at velocity point (whatever the interpolation is). The conservation of the tracer content is obtained as follows: 628 Whatever the advection scheme considered it conserves of the tracer content as all 629 the scheme are written in flux form. Let $\tau$ be the tracer interpolated at velocity point 630 (whatever the interpolation is). The conservation of the tracer content is obtained as follows: 556 631 \begin{flalign*} 557 632 &\int_D \nabla \cdot \left( T \textbf{U} \right)\;dv &&&\\ … … 571 646 \end{flalign*} 572 647 573 The conservation of the variance of tracer can be achieved only with the CEN2 scheme. It can be demonstarted as follows: 648 The conservation of the variance of tracer can be achieved only with the CEN2 scheme. 649 It can be demonstarted as follows: 574 650 \begin{flalign*} 575 651 &\int\limits_D T\;\nabla \cdot \left( T\; \textbf{U} \right)\;dv &&&\\ … … 614 690 615 691 The discrete formulation of the horizontal diffusion of momentum ensures the 616 conservation of potential vorticity and horizontal divergenceand the692 conservation of potential vorticity and the horizontal divergence, and the 617 693 dissipation of the square of these quantities (i.e. enstrophy and the 618 694 variance of the horizontal divergence) as well as the dissipation of the … … 623 699 horizontal divergence) and \textit{vice versa}. 624 700 625 These properties of the horizontal diffusive operator are a direct 626 consequence of properties \eqref{Eq_DOM_curl_grad} and \eqref{Eq_DOM_div_curl}. When the vertical curl of the horizontal diffusion of momentum (discrete sense) is taken, the term associated to the horizontal gradient of the divergence is zero locally. 701 These properties of the horizontal diffusion operator are a direct consequence 702 of properties \eqref{Eq_DOM_curl_grad} and \eqref{Eq_DOM_div_curl}. 703 When the vertical curl of the horizontal diffusion of momentum (discrete sense) 704 is taken, the term associated with the horizontal gradient of the divergence is 705 locally zero. 627 706 628 707 % ------------------------------------------------------------------------------------------------------------- … … 789 868 790 869 When the horizontal divergence of the horizontal diffusion of momentum 791 (discrete sense) is taken, the term associated tothe vertical curl of the792 vorticity is zero locally, due to ( II.1.8). The resulting term conserves the870 (discrete sense) is taken, the term associated with the vertical curl of the 871 vorticity is zero locally, due to (!!! II.1.8 !!!!!). The resulting term conserves the 793 872 $\chi$ and dissipates $\chi^2$ when the eddy coefficients are 794 873 horizontally uniform. … … 873 952 874 953 875 As for the lateral momentum physics, the continuous form of the vertical diffusion of momentum satisfies the several integral constraints. The first two are associated to the conservation of momentum and the dissipation of horizontal kinetic energy: 954 As for the lateral momentum physics, the continuous form of the vertical diffusion 955 of momentum satisfies several integral constraints. The first two are associated 956 with the conservation of momentum and the dissipation of horizontal kinetic energy: 876 957 \begin{align*} 877 958 \int\limits_D … … 923 1004 &&&\\ 924 1005 % 925 \intertext{ as the horizontal scale factor donot depend on $k$, it follows:}1006 \intertext{since the horizontal scale factor does not depend on $k$, it follows:} 926 1007 % 927 1008 &\equiv - \sum\limits_{i,j,k} … … 982 1063 \end{flalign*} 983 1064 If the vertical diffusion coefficient is uniform over the whole domain, the 984 enstrophy is dissipated, i.e.1065 enstrophy is dissipated, $i.e.$ 985 1066 \begin{flalign*} 986 1067 \int\limits_D \zeta \, \textbf{k} \cdot \nabla \times … … 1053 1134 &&\\ 1054 1135 \end{flalign*} 1055 Using the fact that the vertical diffusive coefficients are uniform and that in $z$-coordinates, the vertical scale factors do not depends on $i$ and $j$ so that: $e_{3f} =e_{3u} =e_{3v} =e_{3T} $ and $e_{3w} =e_{3uw} =e_{3vw} $, it follows: 1136 Using the fact that the vertical diffusion coefficients are uniform, and that in 1137 $z$-coordinate, the vertical scale factors do not depend on $i$ and $j$ so 1138 that: $e_{3f} =e_{3u} =e_{3v} =e_{3T} $ and $e_{3w} =e_{3uw} =e_{3vw} $, 1139 it follows: 1056 1140 \begin{flalign*} 1057 1141 \equiv A^{\,vm} \sum\limits_{i,j,k} \zeta \;\delta_k … … 1090 1174 &&&\\ 1091 1175 \end{flalign*} 1092 and the square of the horizontal divergence decreases (i.e. the horizontal divergence is dissipated) if vertical diffusion coefficient is uniform over the whole domain: 1176 and the square of the horizontal divergence decreases ($i.e.$ the horizontal 1177 divergence is dissipated) if the vertical diffusion coefficient is uniform over the 1178 whole domain: 1093 1179 1094 1180 \begin{flalign*} … … 1103 1189 &&&\\ 1104 1190 \end{flalign*} 1105 This property is only satisfied in $z$-coordinates: 1106 1191 This property is only satisfied in the $z$-coordinate: 1107 1192 \begin{flalign*} 1108 1193 \int\limits_D \chi \;\nabla \cdot … … 1209 1294 \label{Apdx_C.5} 1210 1295 1211 1212 1213 The numerical schemes used for tracer subgridscale physics are written such that the heat and salt contents are conserved (equations in flux form, second order centered finite differences). As a form flux is used to compute the temperature and salinity, the quadratic form of these quantities (i.e. their variance) globally tends to diminish. As for the advection term, there is generally no strict conservation of mass even if, in practice, the mass is conserved with a very good accuracy. 1296 The numerical schemes used for tracer subgridscale physics are written such 1297 that the heat and salt contents are conserved (equations in flux form, second 1298 order centered finite differences). Since a flux form is used to compute the 1299 temperature and salinity, the quadratic form of these quantities (i.e. their variance) 1300 globally tends to diminish. As for the advection term, there is generally no strict 1301 conservation of mass, even if in practice the mass is conserved to a very high 1302 accuracy. 1214 1303 1215 1304 % ------------------------------------------------------------------------------------------------------------- … … 1245 1334 \end{flalign*} 1246 1335 1247 In fact, this property is simply resultingfrom the flux form of the operator.1336 In fact, this property simply results from the flux form of the operator. 1248 1337 1249 1338 % ------------------------------------------------------------------------------------------------------------- … … 1253 1342 \label{Apdx_C.5.2} 1254 1343 1255 constraint o fdissipation of tracer variance:1344 constraint on the dissipation of tracer variance: 1256 1345 \begin{flalign*} 1257 1346 \int\limits_D T\;\nabla & \cdot \left( A\;\nabla T \right)\;dv &&&\\ -
trunk/DOC/TexFiles/Chapters/Annex_D.tex
r994 r1223 7 7 8 8 9 A "model life" is more than ten years. Its software, composed bya few10 hundred modules, is used by many people who are scientists or students and11 do not necessary know very well all computer aspects. Moreover, a well12 thought-out programme is easy to read and understand, less difficult to13 modify, produces fewer bugs and is easier to maintain. Therefore, it is14 essential that the model development follows some rules :9 A "model life" is more than ten years. Its software, composed of a few 10 hundred modules, is used by many people who are scientists or students 11 and do not necessarily know every aspect of computing very well. 12 Moreover, a well thought-out program is easier to read and understand, 13 less difficult to modify, produces fewer bugs and is easier to maintain. 14 Therefore, it is essential that the model development follows some rules : 15 15 16 16 - well planned and designed … … 27 27 28 28 To satisfy part of these aims, \NEMO is written with a coding standard which 29 is close to the ECMWF rules, named DOCTOR \citep{Gibson_TR86}. These rules present some advantages like : 29 is close to the ECMWF rules, named DOCTOR \citep{Gibson_TR86}. 30 These rules present some advantages like : 30 31 31 32 - to provide a well presented program … … 51 52 - the detail of input and output interfaces 52 53 53 - the external routines and functions used (if exist)54 - the external routines and functions used (if they exist) 54 55 55 - references (if exist)56 - references (if they exist) 56 57 57 - the author name (s), the date of creation and ofupdates.58 - the author name(s), the date of creation and any updates. 58 59 59 - Each program is split tedinto several well separated sections and60 sub-sections with a underlined title and specific labelled statements.60 - Each program is split into several well separated sections and 61 sub-sections with an underlined title and specific labelled statements. 61 62 62 63 - A program has not more than 200 to 300 lines. … … 68 69 \label{Apdx_D_coding} 69 70 70 - Use of the universal language \textsc{Fortran} 5 ANSI 77, with non 71 standard extensions, NAMELIST and \textsc{Fortran} 90 (matrix resolution 72 algorithm), and some well-identified particular statements or functions for 73 weak and massive parallelism, and vectorization 71 - Use of the universal language \textsc{Fortran} 90, and try to avoid obsolescent 72 features like statement functions, do not use GO TO and EQUIVALENCE statements. 74 73 75 - A comment line begins with a uppercase character C at the first column. A 76 space line must have a C. For the on-line documentation, comments are 77 classified into three levels : 74 - A continuation line begins with the character {\$} indented by three spaces 75 compared to the previous line. 78 76 79 Overview, triggered by CCC in columns 1 to 3. Only the title and the purpose 80 of the program are identified like that. This overview documentation can be 81 extracted by the UNIX function : grep -e '\^{}CCC' * 77 - Always use a three spaces indentation in DO loop, CASE, or IF-ELSEIF-ELSE-ENDIF 78 statements. 82 79 83 External, triggered by CC in columns 1 to 2, and which correspond to 84 headlines of each programme, extracted by : grep -e '\^{}CC' * 85 86 Internal which are all the comments, extracted by : grep -e '\^{}C' * 87 88 - Statements GO TO, EQUIVALENCE are forbidden. 89 90 - A section is numbered with labels which are in agreement with the 91 paragraph label and increase from the begin to the end of routine. Labels of 92 a hundred ( 200, 201.. 220..) are reserved to a unique section. The 93 \textsc{Fortran} 90 extension syntax DO/ENDDO is used except for multitasked 94 do-loop. In this case labels 1000, 2000, ... are used. The FORMAT statement 95 are labelled with numbers in the range 9000 to 9999. 96 97 - A continuation line begins with the character {\$} in column 6. 98 99 - All statements begin in column 7 with the following gaps : 100 101 2 spaces toward the right in a DO loop. 102 103 4 spaces toward the right in IF, ELSEIF, ELSE and ENDIF statements, with 104 only 2 spaces for ELSE and ELSEIF lines. All IF statement must be followed 105 by a ELSE statement. 106 107 Some spaces in the continuation line for alignment. 108 109 - Use of different labels for each DO loop statement. 110 111 - STOP must be well documented with the name of the subroutine or a number. 80 - use call to ctl\_stop routine instead of just a STOP. 112 81 113 82 % ================================================================ … … 118 87 119 88 The purpose of the naming conventions is to use prefix letters to classify 120 model variables. These conventions allow to know easily the variable type 121 and to identify them rapidly: 122 89 model variables. These conventions allow the variable type to be easily known 90 and rapidly identified: 123 91 124 92 %--------------------------------------------------TABLE-------------------------------------------------- … … 128 96 \hline Type \par / Status & integer& real& logical & character& double \par precision& complex \\ 129 97 \hline 130 public &131 \textbf{m n} \par \textit{but not } \par \textbf{n am}&132 \textbf{a b e f g h o} \textbf{q} \textit{to} \textbf{x} \par but not \par \textbf{ sf}&133 \textbf{l} \par \textit{but not} \par \textbf{lp ld ll }&134 \textbf{c} \par \textit{but not} \par \textbf{cp cd cl } \par \textbf{com cim}&135 \textbf{d} \par \textit{but not} \par \textbf{dp dd dl }&98 public \par or \par module variable& 99 \textbf{m n} \par \textit{but not } \par \textbf{nn\_}& 100 \textbf{a b e f g h o} \textbf{q} \textit{to} \textbf{x} \par but not \par \textbf{fs rn\_}& 101 \textbf{l} \par \textit{but not} \par \textbf{lp ld ll ln\_}& 102 \textbf{c} \par \textit{but not} \par \textbf{cp cd cl cn\_}& 103 \textbf{d} \par \textit{but not} \par \textbf{dp dd dl dn\_}& 136 104 \textbf{y} \par \textit{but not} \par \textbf{yp yd yl} \\ 137 105 \hline … … 168 136 \textbf{yp} \\ 169 137 \hline 170 statement \par function& 138 139 namelist& 140 \textbf{nn\_}& 141 \textbf{rn\_}& 142 \textbf{ln\_}& 143 \textbf{cn\_}& 144 \textbf{dn\_}& 145 \\ 146 \hline 147 CPP \par macro& 171 148 \textbf{kf}& 172 149 \textbf{sf} \par & -
trunk/DOC/TexFiles/Chapters/Annex_E.tex
r996 r1223 29 29 - \frac{1}{2}\, |U|_{i+1/2} \;\frac{1}{6} \;\delta_{i+1/2}[\tau"_i] 30 30 \end{equation} 31 where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and $\tau "_i =\delta _i \left[ {\delta _{i+1/2} \left[ \tau \right]} \right]$. By choosing this expression for $\tau "$ we consider a fourth order approximation of $\partial_i^2$ with a constant i-grid spacing ($\Delta i=1$). 32 33 Alternative choice: introduce the scale factors: $\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]$. 31 where $U_{i+1/2} = e_{1u}\,e_{3u}\,u_{i+1/2}$ and 32 $\tau "_i =\delta _i \left[ {\delta _{i+1/2} \left[ \tau \right]} \right]$. 33 By choosing this expression for $\tau "$ we consider a fourth order approximation 34 of $\partial_i^2$ with a constant i-grid spacing ($\Delta i=1$). 35 36 Alternative choice: introduce the scale factors: 37 $\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]$. 34 38 35 39 … … 48 52 scheme when \np{ln\_traadv\_ubs}=T. 49 53 50 For stability reasons, in \eqref{Eq_tra_adv_ubs}, the first term which corresponds to a 51 second order centred scheme is evaluated using the \textit{now} velocity (centred in 52 time) while the second term which is the diffusive part of the scheme, is 53 evaluated using the \textit{before} velocity (forward in time. This is discussed by \citet{Webb1998} in the context of the Quick advection scheme. UBS and QUICK 54 For stability reasons, in \eqref{Eq_tra_adv_ubs}, the first term which corresponds 55 to a second order centred scheme is evaluated using the \textit{now} velocity 56 (centred in time) while the second term which is the diffusive part of the scheme, 57 is evaluated using the \textit{before} velocity (forward in time. This is discussed 58 by \citet{Webb1998} in the context of the Quick advection scheme. UBS and QUICK 54 59 schemes only differ by one coefficient. Substituting 1/6 with 1/8 in 55 (\ref{Eq_tra_adv_ubs}) leads to the QUICK advection scheme \citep{Webb1998}. This56 option is not available through a namelist parameter, since the 1/660 (\ref{Eq_tra_adv_ubs}) leads to the QUICK advection scheme \citep{Webb1998}. 61 This option is not available through a namelist parameter, since the 1/6 57 62 coefficient is hard coded. Nevertheless it is quite easy to make the 58 63 substitution in \mdl{traadv\_ubs} module and obtain a QUICK scheme … … 67 72 NB 2 : In a forthcoming release four options will be proposed for the 68 73 vertical component used in the UBS scheme. $\tau _w^{ubs}$ will be 69 evaluated using either \textit{(a)} a centred $2^{nd}$ order scheme , or \textit{(b)} a TVD70 scheme, or \textit{(c)} an interpolation based on conservative parabolic splines71 following \citet{Sacha2005} implementation of UBS in ROMS,74 evaluated using either \textit{(a)} a centred $2^{nd}$ order scheme , 75 or \textit{(b)} a TVD scheme, or \textit{(c)} an interpolation based on conservative 76 parabolic splines following \citet{Sacha2005} implementation of UBS in ROMS, 72 77 or \textit{(d)} an UBS. The $3^{rd}$ case has dispersion properties similar to an 73 78 eight-order accurate conventional scheme. … … 88 93 \end{split} 89 94 \end{equation} 90 \eqref{Eq_tra_adv_ubs2} has several advantages. First it clearly evidence that the UBS scheme is based on the fourth order scheme to which is added an upstream biased diffusive term. Second, this emphasises that the $4^{th}$ order part have to be evaluated at \emph{now} time step, not only the $2^{th}$ order part as stated above using \eqref{Eq_tra_adv_ubs}. Third, the diffusive term is in fact a biharmonic operator with a eddy coefficient with is simply proportional to the velocity. 91 95 \eqref{Eq_tra_adv_ubs2} has several advantages. First it clearly evidence that 96 the UBS scheme is based on the fourth order scheme to which is added an 97 upstream biased diffusive term. Second, this emphasises that the $4^{th}$ order 98 part have to be evaluated at \emph{now} time step, not only the $2^{th}$ order 99 part as stated above using \eqref{Eq_tra_adv_ubs}. Third, the diffusive term is 100 in fact a biharmonic operator with a eddy coefficient with is simply proportional 101 to the velocity. 92 102 93 103 laplacian diffusion: … … 179 189 \end{align} 180 190 \end{subequations} 181 As for space operator, the adjoint of the derivation and averaging time operators are $\delta_t^*=\delta_{t+\Delta t/2}$ and $\overline{\cdot}^{\,t\,*}= \overline{\cdot}^{\,t+\Delta/2}$, respectively. 191 As for space operator, the adjoint of the derivation and averaging time operators are 192 $\delta_t^*=\delta_{t+\Delta t/2}$ and $\overline{\cdot}^{\,t\,*}= \overline{\cdot}^{\,t+\Delta/2}$ 193 , respectively. 182 194 183 195 The Leap-frog time stepping given by \eqref{Eq_DOM_nxt} can be defined as: … … 187 199 = \frac{q^{t+\Delta t}-q^{t-\Delta t}}{2\Delta t} 188 200 \end{equation} 189 Note that \eqref{LF} shows that the leapfrog time step is $\Delta t$, not $2\Delta t$ as it can be found sometime in literature. 190 The leap-Frog time stepping is a second order centered scheme. As such it respects the quadratic invariant in integral forms, $i.e.$ the following continuous property, 201 Note that \eqref{LF} shows that the leapfrog time step is $\Delta t$, not $2\Delta t$ 202 as it can be found sometime in literature. 203 The leap-Frog time stepping is a second order centered scheme. As such it respects 204 the quadratic invariant in integral forms, $i.e.$ the following continuous property, 191 205 \begin{equation} \label{Energy} 192 206 \int_{t_0}^{t_1} {q\, \frac{\partial q}{\partial t} \;dt} … … 205 219 \equiv \frac{1}{2} \left( {q_{t_1}}^2 - {q_{t_0}}^2 \right) 206 220 \end{split} \end{equation} 207 NB here pb of boundary condition when applying the adjoin! In space, setting to 0 the quantity in land area is sufficient to get rid of the boundary condition (equivalently of the boundary value of the integration by part). In time this boundary condition is not physical and \textbf{add something here!!!} 208 209 210 221 NB here pb of boundary condition when applying the adjoin! In space, setting to 0 222 the quantity in land area is sufficient to get rid of the boundary condition 223 (equivalently of the boundary value of the integration by part). In time this boundary 224 condition is not physical and \textbf{add something here!!!} 225 226 227 -
trunk/DOC/TexFiles/Chapters/Chap_Conservation.tex
r996 r1223 3 3 % Invariant of the Equations 4 4 % ================================================================ 5 \chapter{ Annex ---Invariants of the Primitive Equations}5 \chapter{Invariants of the Primitive Equations} 6 6 \label{Invariant} 7 7 \minitoc
Note: See TracChangeset
for help on using the changeset viewer.