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} |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
\subsection{Grid initialization and data} |
91 |
|
|
92 |
|
Initialization of grid data is controlled by subroutine {\em |
93 |
|
INI\_GRID} which in calls {\em INI\_VERTICAL\_GRID} to initialize the |
94 |
|
vertical grid, and then either of {\em INI\_CARTESIAN\_GRID}, {\em |
95 |
|
INI\_SPHERICAL\_POLAR\_GRID} or {\em INI\_CURV\-ILINEAR\_GRID} to |
96 |
|
initialize the horizontal grid for cartesian, spherical-polar or |
97 |
|
curvilinear coordinates respectively. |
98 |
|
|
99 |
|
The reciprocals of all grid quantities are pre-calculated and this is |
100 |
|
done in subroutine {\em INI\_MASKS\_ETC} which is called later by |
101 |
|
subroutine {\em INITIALIZE\_FIXED}. |
102 |
|
|
103 |
|
All grid descriptors are global arrays and stored in common blocks in |
104 |
|
{\em GRID.h} and a generally declared as {\em \_RS}. |
105 |
|
|
106 |
|
\fbox{ \begin{minipage}{4.75in} |
107 |
|
{\em S/R INI\_GRID} ({\em model/src/ini\_grid.F}) |
108 |
|
|
109 |
|
{\em S/R INI\_MASKS\_ETC} ({\em model/src/ini\_masks\_etc.F}) |
110 |
|
|
111 |
|
grid data: ({\em model/inc/GRID.h}) |
112 |
|
\end{minipage} } |
113 |
|
|
114 |
|
|
115 |
\subsection{Horizontal grid} |
\subsection{Horizontal grid} |
116 |
|
|
449 |
\end{minipage} } |
\end{minipage} } |
450 |
|
|
451 |
|
|
452 |
\subsection{Continuity and horizontal pressure gradient terms} |
\section{Continuity and horizontal pressure gradient terms} |
453 |
|
|
454 |
The core algorithm is based on the ``C grid'' discretization of the |
The core algorithm is based on the ``C grid'' discretization of the |
455 |
continuity equation which can be summarized as: |
continuity equation which can be summarized as: |
456 |
\begin{eqnarray} |
\begin{eqnarray} |
457 |
\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} \\ |
458 |
\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} \\ |
459 |
\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} \\ |
460 |
\delta_i \Delta y_g \Delta r_f h_w u + |
\delta_i \Delta y_g \Delta r_f h_w u + |
461 |
\delta_j \Delta x_g \Delta r_f h_s v + |
\delta_j \Delta x_g \Delta r_f h_s v + |
462 |
\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} |
479 |
The last equation, the discrete continuity equation, can be summed in |
The last equation, the discrete continuity equation, can be summed in |
480 |
the vertical to yeild the free-surface equation: |
the vertical to yeild the free-surface equation: |
481 |
\begin{equation} |
\begin{equation} |
482 |
{\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 |
483 |
{\cal A}_c(P-E)_{r=0} |
u + \delta_j \sum_k \Delta x_g \Delta r_f h_s v = {\cal |
484 |
|
A}_c(P-E)_{r=0} \label{eq:discrete-freesurface} |
485 |
\end{equation} |
\end{equation} |
486 |
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 |
487 |
addition of volume due to excess precipitation and run-off over |
addition of volume due to excess precipitation and run-off over |
488 |
evaporation and only enters the top-level of the {\em ocean} model. |
evaporation and only enters the top-level of the {\em ocean} model. |
489 |
|
|
490 |
\subsection{Hydrostatic balance} |
\section{Hydrostatic balance} |
491 |
|
|
492 |
The vertical momentum equation has the hydrostatic or |
The vertical momentum equation has the hydrostatic or |
493 |
quasi-hydrostatic balance on the right hand side. This discretization |
quasi-hydrostatic balance on the right hand side. This discretization |
501 |
\begin{equation} |
\begin{equation} |
502 |
\epsilon_{nh} \partial_t w |
\epsilon_{nh} \partial_t w |
503 |
+ 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 |
504 |
|
\label{eq:discrete_hydro_ocean} |
505 |
\end{equation} |
\end{equation} |
506 |
|
|
507 |
In the atmosphere, using p-coordinates, hydrostatic balance is |
In the atmosphere, using p-coordinates, hydrostatic balance is |
508 |
discretized: |
discretized: |
509 |
\begin{equation} |
\begin{equation} |
510 |
\overline{\theta'}^k + \frac{1}{\Delta \Pi} \delta_k \Phi_h' = 0 |
\overline{\theta'}^k + \frac{1}{\Delta \Pi} \delta_k \Phi_h' = 0 |
511 |
|
\label{eq:discrete_hydro_atmos} |
512 |
\end{equation} |
\end{equation} |
513 |
where $\Delta \Pi$ is the difference in Exner function between the |
where $\Delta \Pi$ is the difference in Exner function between the |
514 |
pressure points. The non-hydrostatic equations are not available in |
pressure points. The non-hydrostatic equations are not available in |