8 |
centered finite difference) in the fluid interior but allows |
centered finite difference) in the fluid interior but allows |
9 |
boundaries to intersect a regular grid allowing a more accurate |
boundaries to intersect a regular grid allowing a more accurate |
10 |
representation of the position of the boundary. We treat the |
representation of the position of the boundary. We treat the |
11 |
horizontal and veritical directions as seperable and thus slightly |
horizontal and veritical directions as seperable and differently. |
|
differently. |
|
12 |
|
|
13 |
Initialization of grid data is controlled by subroutine {\em |
\input{part2/notation} |
|
INI\_GRID} which in calls {\em INI\_VERTICAL\_GRID} to initialize the |
|
|
vertical grid, and then either of {\em INI\_CARTESIAN\_GRID}, {\em |
|
|
INI\_SPHERICAL\_POLAR\_GRID} or {\em INI\_CURV\-ILINEAR\_GRID} to |
|
|
initialize the horizontal grid for cartesian, spherical-polar or |
|
|
curvilinear coordinates respectively. |
|
|
|
|
|
The reciprocals of all grid quantities are pre-calculated and this is |
|
|
done in subroutine {\em INI\_MASKS\_ETC} which is called later by |
|
|
subroutine {\em INITIALIZE\_FIXED}. |
|
|
|
|
|
All grid descriptors are global arrays and stored in common blocks in |
|
|
{\em GRID.h} and a generally declared as {\em \_RS}. |
|
|
|
|
|
\fbox{ \begin{minipage}{4.75in} |
|
|
{\em S/R INI\_GRID} ({\em model/src/ini\_grid.F}) |
|
|
|
|
|
{\em S/R INI\_MASKS\_ETC} ({\em model/src/ini\_masks\_etc.F}) |
|
|
|
|
|
grid data: ({\em model/inc/GRID.h}) |
|
|
\end{minipage} } |
|
14 |
|
|
15 |
|
|
16 |
\subsection{The finite volume method: finite volumes versus finite difference} |
\subsection{The finite volume method: finite volumes versus finite difference} |
17 |
|
|
18 |
The finite volume method is used to discretize the equations in |
The finite volume method is used to discretize the equations in |
19 |
space. The expression ``finite volume'' actually has two meanings; one |
space. The expression ``finite volume'' actually has two meanings; one |
20 |
is the method of cut or instecting boundaries (shaved or lopped cells |
is the method of embedded or intersecting boundaries (shaved or lopped |
21 |
in our terminology) and the other is non-linear interpolation methods |
cells in our terminology) and the other is non-linear interpolation |
22 |
that can deal with non-smooth solutions such as shocks (i.e. flux |
methods that can deal with non-smooth solutions such as shocks |
23 |
limiters for advection). Both make use of the integral form of the |
(i.e. flux limiters for advection). Both make use of the integral form |
24 |
conservation laws to which the {\it weak solution} is a solution on |
of the conservation laws to which the {\it weak solution} is a |
25 |
each finite volume of (sub-domain). The weak solution can be |
solution on each finite volume of (sub-domain). The weak solution can |
26 |
constructed outof piece-wise constant elements or be |
be constructed out of piece-wise constant elements or be |
27 |
differentiable. The differentiable equations can not be satisfied by |
differentiable. The differentiable equations can not be satisfied by |
28 |
piece-wise constant functions. |
piece-wise constant functions. |
29 |
|
|
67 |
\subsection{C grid staggering of variables} |
\subsection{C grid staggering of variables} |
68 |
|
|
69 |
\begin{figure} |
\begin{figure} |
70 |
\centerline{ \resizebox{!}{2in}{ \includegraphics{part2/cgrid3d.eps}} } |
\begin{center} |
71 |
|
\resizebox{!}{2in}{ \includegraphics{part2/cgrid3d.eps}} |
72 |
|
\end{center} |
73 |
\caption{Three dimensional staggering of velocity components. This |
\caption{Three dimensional staggering of velocity components. This |
74 |
facilitates the natural discretization of the continuity and tracer |
facilitates the natural discretization of the continuity and tracer |
75 |
equations. } |
equations. } |
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
\subsection{Grid initialization and data} |
93 |
|
|
94 |
|
Initialization of grid data is controlled by subroutine {\em |
95 |
|
INI\_GRID} which in calls {\em INI\_VERTICAL\_GRID} to initialize the |
96 |
|
vertical grid, and then either of {\em INI\_CARTESIAN\_GRID}, {\em |
97 |
|
INI\_SPHERICAL\_POLAR\_GRID} or {\em INI\_CURV\-ILINEAR\_GRID} to |
98 |
|
initialize the horizontal grid for cartesian, spherical-polar or |
99 |
|
curvilinear coordinates respectively. |
100 |
|
|
101 |
|
The reciprocals of all grid quantities are pre-calculated and this is |
102 |
|
done in subroutine {\em INI\_MASKS\_ETC} which is called later by |
103 |
|
subroutine {\em INITIALIZE\_FIXED}. |
104 |
|
|
105 |
|
All grid descriptors are global arrays and stored in common blocks in |
106 |
|
{\em GRID.h} and a generally declared as {\em \_RS}. |
107 |
|
|
108 |
|
\fbox{ \begin{minipage}{4.75in} |
109 |
|
{\em S/R INI\_GRID} ({\em model/src/ini\_grid.F}) |
110 |
|
|
111 |
|
{\em S/R INI\_MASKS\_ETC} ({\em model/src/ini\_masks\_etc.F}) |
112 |
|
|
113 |
|
grid data: ({\em model/inc/GRID.h}) |
114 |
|
\end{minipage} } |
115 |
|
|
116 |
|
|
117 |
\subsection{Horizontal grid} |
\subsection{Horizontal grid} |
118 |
|
\label{sec:spatial_discrete_horizontal_grid} |
119 |
|
|
120 |
\begin{figure} |
\begin{figure} |
121 |
\centerline{ \begin{tabular}{cc} |
\begin{center} |
122 |
|
\begin{tabular}{cc} |
123 |
\raisebox{1.5in}{a)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Ac.eps}} |
\raisebox{1.5in}{a)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Ac.eps}} |
124 |
& \raisebox{1.5in}{b)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Az.eps}} |
& \raisebox{1.5in}{b)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Az.eps}} |
125 |
\\ |
\\ |
126 |
\raisebox{1.5in}{c)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Au.eps}} |
\raisebox{1.5in}{c)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Au.eps}} |
127 |
& \raisebox{1.5in}{d)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Av.eps}} |
& \raisebox{1.5in}{d)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Av.eps}} |
128 |
\end{tabular} } |
\end{tabular} |
129 |
|
\end{center} |
130 |
\caption{ |
\caption{ |
131 |
Staggering of horizontal grid descriptors (lengths and areas). The |
Staggering of horizontal grid descriptors (lengths and areas). The |
132 |
grid lines indicate the tracer cell boundaries and are the reference |
grid lines indicate the tracer cell boundaries and are the reference |
318 |
\subsection{Vertical grid} |
\subsection{Vertical grid} |
319 |
|
|
320 |
\begin{figure} |
\begin{figure} |
321 |
\centerline{ \begin{tabular}{cc} |
\begin{center} |
322 |
|
\begin{tabular}{cc} |
323 |
\raisebox{4in}{a)} \resizebox{!}{4in}{ |
\raisebox{4in}{a)} \resizebox{!}{4in}{ |
324 |
\includegraphics{part2/vgrid-cellcentered.eps}} & \raisebox{4in}{b)} |
\includegraphics{part2/vgrid-cellcentered.eps}} & \raisebox{4in}{b)} |
325 |
\resizebox{!}{4in}{ \includegraphics{part2/vgrid-accurate.eps}} |
\resizebox{!}{4in}{ \includegraphics{part2/vgrid-accurate.eps}} |
326 |
\end{tabular} } |
\end{tabular} |
327 |
|
\end{center} |
328 |
\caption{Two versions of the vertical grid. a) The cell centered |
\caption{Two versions of the vertical grid. a) The cell centered |
329 |
approach where the interface depths are specified and the tracer |
approach where the interface depths are specified and the tracer |
330 |
points centered in between the interfaces. b) The interface centered |
points centered in between the interfaces. b) The interface centered |
389 |
\subsection{Topography: partially filled cells} |
\subsection{Topography: partially filled cells} |
390 |
|
|
391 |
\begin{figure} |
\begin{figure} |
392 |
\centerline{ |
\begin{center} |
393 |
\resizebox{4.5in}{!}{\includegraphics{part2/vgrid-xz.eps}} |
\resizebox{4.5in}{!}{\includegraphics{part2/vgrid-xz.eps}} |
394 |
} |
\end{center} |
395 |
\caption{ |
\caption{ |
396 |
A schematic of the x-r plane showing the location of the |
A schematic of the x-r plane showing the location of the |
397 |
non-dimensional fractions $h_c$ and $h_w$. The physical thickness of a |
non-dimensional fractions $h_c$ and $h_w$. The physical thickness of a |
456 |
\end{minipage} } |
\end{minipage} } |
457 |
|
|
458 |
|
|
459 |
\subsection{Continuity and horizontal pressure gradient terms} |
\section{Continuity and horizontal pressure gradient terms} |
460 |
|
|
461 |
The core algorithm is based on the ``C grid'' discretization of the |
The core algorithm is based on the ``C grid'' discretization of the |
462 |
continuity equation which can be summarized as: |
continuity equation which can be summarized as: |
463 |
\begin{eqnarray} |
\begin{eqnarray} |
464 |
\partial_t u + \frac{1}{\Delta x_c} \delta_i \left. \frac{ \partial \Phi}{\partial r}\right|_{s} \eta + \frac{\epsilon_{nh}}{\Delta x_c} \delta_i \Phi_{nh}' & = & G_u - \frac{1}{\Delta x_c} \delta_i \Phi_h' \\ |
\partial_t u + \frac{1}{\Delta x_c} \delta_i \left. \frac{ \partial \Phi}{\partial r}\right|_{s} \eta + \frac{\epsilon_{nh}}{\Delta x_c} \delta_i \Phi_{nh}' & = & G_u - \frac{1}{\Delta x_c} \delta_i \Phi_h' \label{eq:discrete-momu} \\ |
465 |
\partial_t v + \frac{1}{\Delta y_c} \delta_j \left. \frac{ \partial \Phi}{\partial r}\right|_{s} \eta + \frac{\epsilon_{nh}}{\Delta y_c} \delta_j \Phi_{nh}' & = & G_v - \frac{1}{\Delta y_c} \delta_j \Phi_h' \\ |
\partial_t v + \frac{1}{\Delta y_c} \delta_j \left. \frac{ \partial \Phi}{\partial r}\right|_{s} \eta + \frac{\epsilon_{nh}}{\Delta y_c} \delta_j \Phi_{nh}' & = & G_v - \frac{1}{\Delta y_c} \delta_j \Phi_h' \label{eq:discrete-momv} \\ |
466 |
\epsilon_{nh} \left( \partial_t w + \frac{1}{\Delta r_c} \delta_k \Phi_{nh}' \right) & = & \epsilon_{nh} G_w + \overline{b}^k - \frac{1}{\Delta r_c} \delta_k \Phi_{h}' \\ |
\epsilon_{nh} \left( \partial_t w + \frac{1}{\Delta r_c} \delta_k \Phi_{nh}' \right) & = & \epsilon_{nh} G_w + \overline{b}^k - \frac{1}{\Delta r_c} \delta_k \Phi_{h}' \label{eq:discrete-momw} \\ |
467 |
\delta_i \Delta y_g \Delta r_f h_w u + |
\delta_i \Delta y_g \Delta r_f h_w u + |
468 |
\delta_j \Delta x_g \Delta r_f h_s v + |
\delta_j \Delta x_g \Delta r_f h_s v + |
469 |
\delta_k {\cal A}_c w & = & {\cal A}_c \delta_k (P-E)_{r=0} |
\delta_k {\cal A}_c w & = & {\cal A}_c \delta_k (P-E)_{r=0} |
486 |
The last equation, the discrete continuity equation, can be summed in |
The last equation, the discrete continuity equation, can be summed in |
487 |
the vertical to yeild the free-surface equation: |
the vertical to yeild the free-surface equation: |
488 |
\begin{equation} |
\begin{equation} |
489 |
{\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 A}_c \partial_t \eta + \delta_i \sum_k \Delta y_g \Delta r_f h_w |
490 |
{\cal A}_c(P-E)_{r=0} |
u + \delta_j \sum_k \Delta x_g \Delta r_f h_s v = {\cal |
491 |
|
A}_c(P-E)_{r=0} \label{eq:discrete-freesurface} |
492 |
\end{equation} |
\end{equation} |
493 |
The source term $P-E$ on the rhs of continuity accounts for the local |
The source term $P-E$ on the rhs of continuity accounts for the local |
494 |
addition of volume due to excess precipitation and run-off over |
addition of volume due to excess precipitation and run-off over |
495 |
evaporation and only enters the top-level of the {\em ocean} model. |
evaporation and only enters the top-level of the {\em ocean} model. |
496 |
|
|
497 |
\subsection{Hydrostatic balance} |
\section{Hydrostatic balance} |
498 |
|
|
499 |
The vertical momentum equation has the hydrostatic or |
The vertical momentum equation has the hydrostatic or |
500 |
quasi-hydrostatic balance on the right hand side. This discretization |
quasi-hydrostatic balance on the right hand side. This discretization |
508 |
\begin{equation} |
\begin{equation} |
509 |
\epsilon_{nh} \partial_t w |
\epsilon_{nh} \partial_t w |
510 |
+ g \overline{\rho'}^k + \frac{1}{\Delta z} \delta_k \Phi_h' = \ldots |
+ g \overline{\rho'}^k + \frac{1}{\Delta z} \delta_k \Phi_h' = \ldots |
511 |
|
\label{eq:discrete_hydro_ocean} |
512 |
\end{equation} |
\end{equation} |
513 |
|
|
514 |
In the atmosphere, using p-coordinates, hydrostatic balance is |
In the atmosphere, using p-coordinates, hydrostatic balance is |
515 |
discretized: |
discretized: |
516 |
\begin{equation} |
\begin{equation} |
517 |
\overline{\theta'}^k + \frac{1}{\Delta \Pi} \delta_k \Phi_h' = 0 |
\overline{\theta'}^k + \frac{1}{\Delta \Pi} \delta_k \Phi_h' = 0 |
518 |
|
\label{eq:discrete_hydro_atmos} |
519 |
\end{equation} |
\end{equation} |
520 |
where $\Delta \Pi$ is the difference in Exner function between the |
where $\Delta \Pi$ is the difference in Exner function between the |
521 |
pressure points. The non-hydrostatic equations are not available in |
pressure points. The non-hydrostatic equations are not available in |