--- manual/s_algorithm/text/spatial-discrete.tex 2001/09/25 20:13:42 1.6 +++ manual/s_algorithm/text/spatial-discrete.tex 2017/06/14 21:05:01 1.25 @@ -1,29 +1,35 @@ -% $Header: /home/ubuntu/mnt/e9_copy/manual/s_algorithm/text/spatial-discrete.tex,v 1.6 2001/09/25 20:13:42 adcroft Exp $ +% $Header: /home/ubuntu/mnt/e9_copy/manual/s_algorithm/text/spatial-discrete.tex,v 1.25 2017/06/14 21:05:01 jmc Exp $ % $Name: $ \section{Spatial discretization of the dynamical equations} +\begin{rawhtml} + +\end{rawhtml} Spatial discretization is carried out using the finite volume method. This amounts to a grid-point method (namely second-order centered finite difference) in the fluid interior but allows boundaries to intersect a regular grid allowing a more accurate representation of the position of the boundary. We treat the -horizontal and veritical directions as seperable and differently. - -\input{part2/notation} +horizontal and vertical directions as separable and differently. \subsection{The finite volume method: finite volumes versus finite difference} +\begin{rawhtml} + +\end{rawhtml} + + The finite volume method is used to discretize the equations in space. The expression ``finite volume'' actually has two meanings; one -is the method of cut or instecting boundaries (shaved or lopped cells -in our terminology) and the other is non-linear interpolation methods -that can deal with non-smooth solutions such as shocks (i.e. flux -limiters for advection). Both make use of the integral form of the -conservation laws to which the {\it weak solution} is a solution on -each finite volume of (sub-domain). The weak solution can be -constructed outof piece-wise constant elements or be +is the method of embedded or intersecting boundaries (shaved or lopped +cells in our terminology) and the other is non-linear interpolation +methods that can deal with non-smooth solutions such as shocks +(i.e. flux limiters for advection). Both make use of the integral form +of the conservation laws to which the {\it weak solution} is a +solution on each finite volume of (sub-domain). The weak solution can +be constructed out of piece-wise constant elements or be differentiable. The differentiable equations can not be satisfied by piece-wise constant functions. @@ -37,7 +43,7 @@ \begin{displaymath} \Delta x \partial_t \theta + \delta_i ( F ) = 0 \end{displaymath} -is exact if $\theta(x)$ is peice-wise constant over the interval +is exact if $\theta(x)$ is piece-wise constant over the interval $\Delta x_i$ or more generally if $\theta_i$ is defined as the average over the interval $\Delta x_i$. @@ -57,17 +63,19 @@ interior of a fluid. Differences arise at boundaries where a boundary is not positioned on a regular or smoothly varying grid. This method is used to represent the topography using lopped cell, see -\cite{Adcroft98}. Subtle difference also appear in more than one +\cite{adcroft:97}. Subtle difference also appear in more than one dimension away from boundaries. This happens because the each -direction is discretized independantly in the finite difference method +direction is discretized independently in the finite difference method while the integrating over finite volume implicitly treats all directions simultaneously. Illustration of this is given in -\cite{Adcroft02}. +\cite{ac:02}. \subsection{C grid staggering of variables} \begin{figure} -\centerline{ \resizebox{!}{2in}{ \includegraphics{part2/cgrid3d.eps}} } +\begin{center} +\resizebox{!}{2in}{ \includegraphics{s_algorithm/figs/cgrid3d.eps}} +\end{center} \caption{Three dimensional staggering of velocity components. This facilitates the natural discretization of the continuity and tracer equations. } @@ -77,12 +85,12 @@ The basic algorithm employed for stepping forward the momentum equations is based on retaining non-divergence of the flow at all times. This is most naturally done if the components of flow are -staggered in space in the form of an Arakawa C grid \cite{Arakawa70}. +staggered in space in the form of an Arakawa C grid \cite{arakawa:77}. Fig. \ref{fig:cgrid3d} shows the components of flow ($u$,$v$,$w$) staggered in space such that the zonal component falls on the -interface between continiuty cells in the zonal direction. Similarly -for the meridional and vertical directions. The continiuty cell is +interface between continuity cells in the zonal direction. Similarly +for the meridional and vertical directions. The continuity cell is synonymous with tracer cells (they are one and the same). @@ -113,50 +121,53 @@ \subsection{Horizontal grid} +\label{sec:spatial_discrete_horizontal_grid} \begin{figure} -\centerline{ \begin{tabular}{cc} - \raisebox{1.5in}{a)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Ac.eps}} -& \raisebox{1.5in}{b)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Az.eps}} +\begin{center} +\begin{tabular}{cc} + \raisebox{1.5in}{a)}\resizebox{!}{2in}{ \includegraphics{s_algorithm/figs/hgrid-Ac.eps}} +& \raisebox{1.5in}{b)}\resizebox{!}{2in}{ \includegraphics{s_algorithm/figs/hgrid-Az.eps}} \\ - \raisebox{1.5in}{c)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Au.eps}} -& \raisebox{1.5in}{d)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Av.eps}} -\end{tabular} } + \raisebox{1.5in}{c)}\resizebox{!}{2in}{ \includegraphics{s_algorithm/figs/hgrid-Au.eps}} +& \raisebox{1.5in}{d)}\resizebox{!}{2in}{ \includegraphics{s_algorithm/figs/hgrid-Av.eps}} +\end{tabular} +\end{center} \caption{ Staggering of horizontal grid descriptors (lengths and areas). The grid lines indicate the tracer cell boundaries and are the reference grid for all panels. a) The area of a tracer cell, $A_c$, is bordered by the lengths $\Delta x_g$ and $\Delta y_g$. b) The area of a vorticity cell, $A_\zeta$, is bordered by the lengths $\Delta x_c$ and -$\Delta y_c$. c) The area of a u cell, $A_c$, is bordered by the -lengths $\Delta x_v$ and $\Delta y_f$. d) The area of a v cell, $A_c$, +$\Delta y_c$. c) The area of a u cell, $A_w$, is bordered by the +lengths $\Delta x_v$ and $\Delta y_f$. d) The area of a v cell, $A_s$, is bordered by the lengths $\Delta x_f$ and $\Delta y_u$.} \label{fig:hgrid} \end{figure} The model domain is decomposed into tiles and within each tile a quasi-regular grid is used. A tile is the basic unit of domain -decomposition for parallelization but may be used whether parallized -or not; see section \ref{sect:tiles} for more details. Although the -tiles may be patched together in an unstructured manner +decomposition for parallelization but may be used whether parallelized +or not; see section \ref{sec:domain_decomposition} for more details. +Although the tiles may be patched together in an unstructured manner (i.e. irregular or non-tessilating pattern), the interior of tiles is -a structered grid of quadrilateral cells. The horizontal coordinate +a structured grid of quadrilateral cells. The horizontal coordinate system is orthogonal curvilinear meaning we can not necessarily treat -the two horizontal directions as seperable. Instead, each cell in the +the two horizontal directions as separable. Instead, each cell in the horizontal grid is described by the length of it's sides and it's area. The grid information is quite general and describes any of the available coordinates systems, cartesian, spherical-polar or curvilinear. All that is necessary to distinguish between the -coordinate systems is to initialize the grid data (discriptors) +coordinate systems is to initialize the grid data (descriptors) appropriately. In the following, we refer to the orientation of quantities on the computational grid using geographic terminology such as points of the compass. \marginpar{Caution!} -This is purely for convenience but should note be confused +This is purely for convenience but should not be confused with the actual geographic orientation of model quantities. Fig.~\ref{fig:hgrid}a shows the tracer cell (synonymous with the @@ -175,7 +186,7 @@ Fig.~\ref{fig:hgrid}b shows the vorticity cell. The length of the southern edge, $\Delta x_c$, western edge, $\Delta y_c$ and surface area, $A_\zeta$, presented in the vertical are stored in arrays {\bf -DXg}, {\bf DYg} and {\bf rAz}. +DXc}, {\bf DYc} and {\bf rAz}. \marginpar{$A_\zeta$: {\bf rAz}} \marginpar{$\Delta x_c$: {\bf DXc}} \marginpar{$\Delta y_c$: {\bf DYc}} @@ -183,7 +194,7 @@ cell centers and the ``$\zeta$'' suffix associates points with the vorticity points. The quantities are staggered in space and the indexing is such that {\bf DXc(i,j)} is positioned to the north of -{\bf rAc(i,j)} and {\bf DYc(i,j)} positioned to the east. +{\bf rAz(i,j)} and {\bf DYc(i,j)} positioned to the east. Fig.~\ref{fig:hgrid}c shows the ``u'' or western (w) cell. The length of the southern edge, $\Delta x_v$, eastern edge, $\Delta y_f$ and @@ -288,7 +299,7 @@ spacing can be set to uniform via scalars {\bf dXspacing} and {\bf dYspacing} in namelist {\em PARM04} or to variable resolution by the vectors {\bf DELX} and {\bf DELY}. Units are normally -meters. Non-dimensional coordinates can be used by interpretting the +meters. Non-dimensional coordinates can be used by interpreting the gravitational constant as the Rayleigh number. \subsubsection{Spherical-polar coordinates} @@ -313,11 +324,13 @@ \subsection{Vertical grid} \begin{figure} -\centerline{ \begin{tabular}{cc} +\begin{center} + \begin{tabular}{cc} \raisebox{4in}{a)} \resizebox{!}{4in}{ - \includegraphics{part2/vgrid-cellcentered.eps}} & \raisebox{4in}{b)} - \resizebox{!}{4in}{ \includegraphics{part2/vgrid-accurate.eps}} -\end{tabular} } + \includegraphics{s_algorithm/figs/vgrid-cellcentered.eps}} & \raisebox{4in}{b)} + \resizebox{!}{4in}{ \includegraphics{s_algorithm/figs/vgrid-accurate.eps}} +\end{tabular} +\end{center} \caption{Two versions of the vertical grid. a) The cell centered approach where the interface depths are specified and the tracer points centered in between the interfaces. b) The interface centered @@ -340,7 +353,7 @@ INI\_VERTICAL\_GRID} and specified via the vector {\bf DELR} in namelist {\em PARM04}. The units of ``r'' are either meters or Pascals depending on the isomorphism being used which in turn is dependent -only on the choise of equation of state. +only on the choice of equation of state. There are alternative namelist vectors {\bf DELZ} and {\bf DELP} which dictate whether z- or @@ -354,15 +367,23 @@ The above grid (Fig.~\ref{fig:vgrid}a) is known as the cell centered approach because the tracer points are at cell centers; the cell -centers are mid-way between the cell interfaces. An alternative, the -vertex or interface centered approach, is shown in +centers are mid-way between the cell interfaces. +This discretization is selected when the thickness of the +levels are provided ({\bf delR}, parameter file {\em data}, +namelist {\em PARM04}) +An alternative, the vertex or interface centered approach, is shown in Fig.~\ref{fig:vgrid}b. Here, the interior interfaces are positioned mid-way between the tracer nodes (no longer cell centers). This approach is formally more accurate for evaluation of hydrostatic pressure and vertical advection but historically the cell centered approach has been used. An alternative form of subroutine {\em INI\_VERTICAL\_GRID} is used to select the interface centered approach -but no run time option is currently available. +This form requires to specify $Nr+1$ vertical distances {\bf delRc} +(parameter file {\em data}, namelist {\em PARM04}, e.g. +{\em verification/ideal\_2D\_oce/input/data}) +corresponding to surface to center, $Nr-1$ center to center, and center to +bottom distances. +%but no run time option is currently available. \fbox{ \begin{minipage}{4.75in} {\em S/R INI\_VERTICAL\_GRID} ({\em @@ -380,11 +401,14 @@ \subsection{Topography: partially filled cells} +\begin{rawhtml} + +\end{rawhtml} \begin{figure} -\centerline{ -\resizebox{4.5in}{!}{\includegraphics{part2/vgrid-xz.eps}} -} +\begin{center} +\resizebox{4.5in}{!}{\includegraphics{s_algorithm/figs/vgrid-xz.eps}} +\end{center} \caption{ A schematic of the x-r plane showing the location of the non-dimensional fractions $h_c$ and $h_w$. The physical thickness of a @@ -393,13 +417,13 @@ \label{fig:hfacs} \end{figure} -\cite{Adcroft97} presented two alternatives to the step-wise finite +\cite{adcroft:97} presented two alternatives to the step-wise finite difference representation of topography. The method is known to the engineering community as {\em intersecting boundary method}. It involves allowing the boundary to intersect a grid of cells thereby modifying the shape of those cells intersected. We suggested allowing -the topgoraphy to take on a peice-wise linear representation (shaved -cells) or a simpler piecewise constant representaion (partial step). +the topography to take on a piece-wise linear representation (shaved +cells) or a simpler piecewise constant representation (partial step). Both show dramatic improvements in solution compared to the traditional full step representation, the piece-wise linear being the best. However, the storage requirements are excessive so the simpler @@ -413,7 +437,7 @@ \marginpar{$h_s$: {\bf hFacS}} The physical thickness of a tracer cell is given by $h_c(i,j,k) \Delta r_f(k)$ and the physical thickness of the open side is given by -$h_w(i,j,k) \Delta r_f(k)$. Three 3-D discriptors $h_c$, $h_w$ and +$h_w(i,j,k) \Delta r_f(k)$. Three 3-D descriptors $h_c$, $h_w$ and $h_s$ are used to describe the geometry: {\bf hFacC}, {\bf hFacW} and {\bf hFacS} respectively. These are calculated in subroutine {\em INI\_MASKS\_ETC} along with there reciprocals {\bf RECIP\_hFacC}, {\bf @@ -450,6 +474,10 @@ \section{Continuity and horizontal pressure gradient terms} +\begin{rawhtml} + +\end{rawhtml} + The core algorithm is based on the ``C grid'' discretization of the continuity equation which can be summarized as: @@ -464,7 +492,7 @@ \end{eqnarray} where the continuity equation has been most naturally discretized by staggering the three components of velocity as shown in -Fig.~\ref{fig-cgrid3d}. The grid lengths $\Delta x_c$ and $\Delta y_c$ +Fig.~\ref{fig:cgrid3d}. The grid lengths $\Delta x_c$ and $\Delta y_c$ are the lengths between tracer points (cell centers). The grid lengths $\Delta x_g$, $\Delta y_g$ are the grid lengths between cell corners. $\Delta r_f$ and $\Delta r_c$ are the distance (in units of @@ -477,7 +505,7 @@ \marginpar{$h_s$: {\bf hFacS}} The last equation, the discrete continuity equation, can be summed in -the vertical to yeild the free-surface equation: +the vertical to yield the free-surface equation: \begin{equation} {\cal A}_c \partial_t \eta + \delta_i \sum_k \Delta y_g \Delta r_f h_w u + \delta_j \sum_k \Delta x_g \Delta r_f h_s v = {\cal @@ -488,6 +516,9 @@ evaporation and only enters the top-level of the {\em ocean} model. \section{Hydrostatic balance} +\begin{rawhtml} + +\end{rawhtml} The vertical momentum equation has the hydrostatic or quasi-hydrostatic balance on the right hand side. This discretization @@ -496,7 +527,7 @@ from the pressure gradient terms when forming the kinetic energy equation. -In the ocean, using z-ccordinates, the hydrostatic balance terms are +In the ocean, using z-coordinates, the hydrostatic balance terms are discretized: \begin{equation} \epsilon_{nh} \partial_t w @@ -516,8 +547,8 @@ The difference in approach between ocean and atmosphere occurs because of the direct use of the ideal gas equation in forming the potential -energy conversion term $\alpha \omega$. The form of these consversion -terms is discussed at length in \cite{Adcroft01}. +energy conversion term $\alpha \omega$. The form of these conversion +terms is discussed at length in \cite{adcroft:02}. Because of the different representation of hydrostatic balance between ocean and atmosphere there is no elegant way to represent both systems