
% ================================================================
% Chapter Ñ Appendix A : Curvilinear s-Coordinate Equations
% ================================================================
\chapter{Appendix A : Curvilinear $s$-Coordinate Equations}
\label{Apdx_A}
\minitoc

In order to establish the set of Primitive Equation in curvilinear 
$s$-coordinates (i.e. orthogonal curvilinear coordinates in the horizontal and 
$s$-coordinates in the vertical), we start from the set of equation established 
in {\S}~I.3 for the special case $k = z$ and thus $e_3 = 1$, and we introduce an arbitrary 
vertical coordinate $s = s(i,j,z)$. Let us define a new vertical scale factor by $e_3 = \partial z / \partial s$ (which now depends on $(i,j,z)$) and the horizontal slope of $s$-surfaces by :
\begin{equation} \label{Apdx_A_A1}
\sigma _1 =\frac{1}{e_1 }\;\left. {\frac{\partial z}{\partial i}} \right|_s 
\quad \text{and}
\sigma _2 =\frac{1}{e_2 }\;\left. {\frac{\partial z}{\partial j}} \right|_s 
\end{equation}

The chain rule to establish the model equations in the curvilinear 
s-coordinate system is:
\begin{equation} \label{Apdx_A_A2}
\begin{aligned}
&\left. {\frac{\partial \bullet }{\partial i}} \right|_z  =\left. 
{\frac{\partial \bullet }{\partial i}} \right|_s +\frac{\partial \bullet 
}{\partial s}\;\frac{\partial s}{\partial i}=\left. {\frac{\partial \bullet 
}{\partial i}} \right|_s -\frac{e_1 }{e_3 }\sigma _1 \frac{\partial \bullet 
}{\partial s} \\
&\left. {\frac{\partial \bullet }{\partial j}} \right|_z  =\left. 
{\frac{\partial \bullet }{\partial j}} \right|_s +\frac{\partial \bullet 
}{\partial s}\;\frac{\partial s}{\partial j}=\left. {\frac{\partial \bullet 
}{\partial j}} \right|_s -\frac{e_2 }{e_3 }\sigma _2 \frac{\partial \bullet 
}{\partial s} \\
&\;\frac{\partial \bullet }{\partial z}  =\frac{1}{e_3 }\frac{\partial \bullet 
}{\partial s} \\
\end{aligned}
\end{equation}

Using (\ref{Apdx_A_A2}), the divergence of the velocity is transformed as follows:


\begin{equation*}
\nabla \cdot {\rm {\bf U}}=\frac{1}{e_1 \,e_2 }\left[ {\left. 
{\frac{\partial (e_2 \,u)}{\partial i}} \right|_z +\left. {\frac{\partial 
(e_1 \,v)}{\partial j}} \right|_z } \right]+\frac{\partial w}{\partial z} \\
\end{equation*}

%\begin{equation} \label{   }
\begin{multline*}
=\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,u)}{\partial i}} 
\right|_s -\frac{e_1 }{e_3 }\sigma _1 \frac{\partial (e_2 \,u)}{\partial s}} 
\right. \\ 
\shoveright { \left. { +\left. {\frac{\partial (e_1 \,v)}{\partial j}} \right|_s -\frac{e_2 }{e_3 }\sigma _2 \frac{\partial (e_1 v)}{\partial s}} \right]+\frac{\partial w}{\partial s}\frac{\partial s}{\partial z} }\\ 
\end{multline*}
%\end{equation}

\begin{equation*}
%\begin{multline}
=\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,u)}{\partial i}} 
\right|_s +\left. {\frac{\partial (e_1 \,v)}{\partial j}} \right|_s } 
\right]+\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial s}-\sigma _1 
\frac{\partial u}{\partial s}-\sigma _2 \frac{\partial v}{\partial s}} 
\right]
%\end{multline}
\end{equation*}

%\begin{equation} \label{   }
\begin{multline*}
 =\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\frac{\partial (e_2 \,e_3 
\,u)}{\partial i}} \right|_s -\left. {e_2 \,u\frac{\partial e_3 }{\partial 
i}} \right|_s +\left. {\frac{\partial (e_1 \,e_3 \,v)}{\partial j}} 
\right|_s -\left. {e_1 v\frac{\partial e_3 }{\partial j}} \right|_s } 
\right] \\ 
\shoveright{ +\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial s}-\sigma _1 
\frac{\partial u}{\partial s}-\sigma _2 \frac{\partial v}{\partial s}} 
\right]} \\ 
\end{multline*}
%\end{equation}


Noting that $\frac{1}{e_1 }\left. {\frac{\partial e_3 }{\partial i}} 
\right|_s =\frac{1}{e_1 }\left. {\frac{\partial ^2z}{\partial i\,\partial 
s}} \right|_s =\frac{\partial }{\partial s}\left( {\frac{1}{e_1 }\left. 
{\frac{\partial z}{\partial i}} \right|_s } \right)=\frac{\partial \sigma _1 
}{\partial s}$ and $\frac{1}{e_2 }\left. {\frac{\partial e_3 }{\partial j}} 
\right|_s =\frac{\partial \sigma _2 }{\partial s}$, it becomes:

\begin{multline*}
 =\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\frac{\partial (e_2 \,e_3 
\,u)}{\partial i}} \right|_s +\left. {\frac{\partial (e_1 \,e_3 
\,v)}{\partial j}} \right|_s } \right] \\ 
\shoveright{ +\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial s}-u\frac{\partial \sigma _1 }{\partial s}-v\frac{\partial \sigma _2 }{\partial s}-\sigma _1 \frac{\partial u}{\partial s}-\sigma _2 \frac{\partial v}{\partial s}} \right]} \\ 
 \end{multline*}
 
\begin{multline*}
 =\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\frac{\partial (e_2 \,e_3 
\,u)}{\partial i}} \right|_s +\left. {\frac{\partial (e_1 \,e_3 
\,v)}{\partial j}} \right|_s } \right] \\ 
\shoveright{ +\frac{1}{e_3 }\left[ {\frac{\partial w}{\partial 
s}-\frac{\partial (u\;\sigma _1 )}{\partial s}-\frac{\partial (v\;\sigma _2 
)}{\partial s}} \right]} \\ 
 \end{multline*}
 
Introducing a "vertical" velocity $\omega $ as the velocity normal to $s$-surfaces:

\begin{equation} \label{Apdx_A_A3}
\omega =w-\sigma _1 \,u-\sigma _2 \,v
\end{equation}

the divergence of the velocity is given in curvilinear $s$-coordinates by:
\begin{equation} \label{Apdx_A_A4}
\nabla \cdot {\rm {\bf U}}=\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. 
{\frac{\partial (e_2 \,e_3 \,u)}{\partial i}} \right|_s +\left. 
{\frac{\partial (e_1 \,e_3 \,v)}{\partial j}} \right|_s } 
\right]+\frac{1}{e_3 }\frac{\partial \omega }{\partial s}
\end{equation}


As a result, the continuity equation (I.1.3) in $s$-coordinates becomes:
\begin{equation} \label{Apdx_A_A5}
\frac{1}{e_1 \,e_2 \,e_3 }\left[ {\left. {\frac{\partial (e_2 \,e_3 
\,u)}{\partial i}} \right|_s +\left. {\frac{\partial (e_1 \,e_3 
\,v)}{\partial j}} \right|_s } \right]+\frac{1}{e_3 }\frac{\partial \omega 
}{\partial s}=0
\end{equation}


\textbf{Momentum equation:}

As an example let us consider (I.3.10), the first component of the momentum 
equation. Its non linear term can be transformed as follows:

\begin{equation*}
\begin{aligned}
&+\left. \zeta \right|_z v-\frac{1}{2e_1 }\left. {\frac{\partial 
(u^2+v^2)}{\partial i}} \right|_z -w\frac{\partial u}{\partial z} \\
&=\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,v)}{\partial i}} 
\right|_z -\left. {\frac{\partial (e_1 \,u)}{\partial j}} \right|_z } 
\right]\;v-\frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} 
\right|_z -w\frac{\partial u}{\partial z}
\end{aligned}
\end{equation*}
\begin{multline*}
 =\frac{1}{e_1 \,e_2 }\left[ {\left. {\frac{\partial (e_2 \,v)}{\partial i}} 
\right|_s -\left. {\frac{\partial (e_1 \,u)}{\partial j}} \right|_s } 
\right. \\ 
 \left. {-\frac{e_1 }{e_3 }\sigma _1 \frac{\partial (e_2 \,v)}{\partial s}+\frac{e_2 }{e_3 }\sigma _2 \frac{\partial (e_1 \,u)}{\partial s}} \right]\;v \\ 
\shoveright{ -\frac{1}{2e_1 }\left( {\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s -\frac{e_1 }{e_3 }\sigma _1 \frac{\partial (u^2+v^2)}{\partial s}} \right)-\frac{w}{e_3 }\frac{\partial u}{\partial s} }\\
 \end{multline*}

\begin{equation*}
 =\left. \zeta \right|_s \;v-\frac{1}{2e_1 }\left. {\frac{\partial 
(u^2+v^2)}{\partial i}} \right|_s -\frac{w}{e_3 }\frac{\partial u}{\partial 
s}-\left[ {\frac{\sigma _1 }{e_3 }\frac{\partial v}{\partial s}-\frac{\sigma 
_2 }{e_3 }\frac{\partial u}{\partial s}} \right]\;v \\ 
 +\frac{\sigma _1 }{2e_3 }\frac{\partial (u^2+v^2)}{\partial s} 
\end{equation*}


\begin{multline*}
 =\left. \zeta \right|_s \;v-\frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s \\ 
\shoveright{ -\frac{1}{e_3 }\left[ {w\frac{\partial u}{\partial s}+\sigma _1 v\frac{\partial v}{\partial s}-\sigma _2 v\frac{\partial u}{\partial s}-\sigma _1 u\frac{\partial u}{\partial s}-\sigma _1 v\frac{\partial v}{\partial s}} \right] }\\ 
 \end{multline*}

\begin{equation} \label{Apdx_A_A6}
=\left. \zeta \right|_s \;v-\frac{1}{2e_1 }\left. {\frac{\partial (u^2+v^2)}{\partial i}} \right|_s -\frac{1}{e_3 }\omega \frac{\partial u}{\partial s} 
\end{equation}

Therefore, the non-linear terms of the momentum equation have the same form 
in $z- $and $s-$coordinates

The pressure gradient term can be transformed as follows:
\begin{equation} \label{Apdx_A_A7}
\begin{split}
 -\frac{1}{\rho _o e_1 }\left. {\frac{\partial p}{\partial i}} \right|_z& =-\frac{1}{\rho _o e_1 }\left[ {\left. {\frac{\partial p}{\partial i}} \right|_s -\frac{e_1 }{e_3 }\sigma _1 \frac{\partial p}{\partial s}} \right] \\
& =-\frac{1}{\rho _o \,e_1 }\left. {\frac{\partial p}{\partial i}} \right|_s +\frac{\sigma _1 }{\rho _o \,e_3 }\left( {-g\;\rho \;e_3 } \right) \\
&=-\frac{1}{\rho _o \,e_1 }\left. {\frac{\partial p}{\partial i}} \right|_s -\frac{g\;\rho }{\rho _o }\sigma _1
\end{split}
\end{equation}

An additional term appears in (\ref{Apdx_A_A7}) which accounts for the tilt of model 
levels.

\textbf{Tracer equation:}

The tracer equation is obtained using the same calculation as for the 
continuity equation:

%\begin{equation} \label{Eq_   }
\begin{multline} \label{Apdx_A_A8}
 \frac{\partial T}{\partial t} = -\frac{1}{e_1 \,e_2 \,e_3 } \left[ {\frac{\partial }{\partial i}} \left( {e_2 \,e_3 \;Tu} \right) + \frac{\partial }{\partial j} \left( {e_1 \,e_3 \;Tv} \right) \;\right .\\
 \shoveright{\left . +\frac{\partial }{\partial k} \left( {e_1 \,e_2 \;T\omega } \right) \right] +D^{lT} +D^{vT} }\\
\end{multline}
%\end{equation}


The expression of the advection term is a straight consequence of (A.4), the 
expression of the 3D divergence in $s$-coordinates established above.

