/[MITgcm]/manual/s_algorithm/text/spatial-discrete.tex
ViewVC logotype

Annotation of /manual/s_algorithm/text/spatial-discrete.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download) (as text)
Wed Aug 8 22:19:02 2001 UTC (23 years, 10 months ago) by adcroft
Branch: MAIN
Changes since 1.1: +336 -35 lines
File MIME type: application/x-tex
Added descriptions of horizontal and vertical grids. Not finished.

1 adcroft 1.2 % $Header: /u/gcmpack/mitgcmdoc/part2/spatial-discrete.tex,v 1.1.1.1 2001/08/08 16:15:21 adcroft Exp $
2     % $Name: $
3 adcroft 1.1
4     \section{Spatial discretization of the dynamical equations}
5    
6 adcroft 1.2 Spatial discretization is carried out using the finite volume
7     method. This amounts to a grid-point method (namely second-order
8     centered finite difference) in the fluid interior but allows
9     boundaries to intersect a regular grid allowing a more accurate
10     representation of the position of the boundary. We treat the
11     horizontal and veritical directions as seperable and thus slightly
12     differently.
13    
14     Initialization of grid data is controlled by subroutine {\em
15     INI\_GRID} which in calls {\em INI\_VERTICAL\_GRID} to initialize the
16     vertical grid, and then either of {\em INI\_CARTESIAN\_GRID}, {\em
17     INI\_SPHERICAL\_POLAR\_GRID} or {\em INI\_CURV\-ILINEAR\_GRID} to
18     initialize the horizontal grid for cartesian, spherical-polar or
19     curvilinear coordinates respectively.
20    
21     The reciprocals of all grid quantities are pre-calculated and this is
22     done in subroutine {\em INI\_MASKS\_ETC} which is called later by
23     subroutine {\em INITIALIZE\_FIXED}.
24    
25     All grid descriptors are global arrays and stored in common blocks in
26     {\em GRID.h} and a generally declared as {\em \_RS}.
27    
28     \fbox{ \begin{minipage}{4.75in}
29     {\em S/R INI\_GRID} ({\em model/src/ini\_grid.F})
30    
31     {\em S/R INI\_MASKS\_ETC} ({\em model/src/ini\_masks\_etc.F})
32    
33     grid data: ({\em model/inc/GRID.h})
34     \end{minipage} }
35    
36    
37     \subsection{The finite volume method: finite volumes versus finite difference}
38    
39     The finite volume method is used to discretize the equations in
40     space. The expression ``finite volume'' actually has two meanings; one
41     involves invocation of the weak formulation (e.g. integral
42     formulation) and the other involves non-linear expressions for
43     interpolation of data (e.g. flux limiters). We use both but they can
44     and will be ddiscussed seperately. The finite volume method discretizes by invoking the weak formulation of the equations or integral form. For example, the 1-D advection-diffusion equation:
45     \begin{displaymath}
46     \partial_t \theta + \partial_x ( u \theta - \kappa \partial_x \theta ) = 0
47     \end{displaymath}
48     can be discretized by integrating of finite lengths $\Delta x$:
49     \begin{displaymath}
50     \Delta x \partial_t \theta + \delta_i ( F ) = 0
51     \end{displaymath}
52     is exact but where the flux
53     \begin{displaymath}
54     F = u \overline{\theta} - \frac{\kappa}{\Delta x_c} \partial_i \theta
55     \end{displaymath}
56     is approximate. The method for obtained $\overline{\theta}$ is
57     unspecified and non-lienar finite volume methods can be invoked.
58    
59     .... INCOMPLETE
60    
61 adcroft 1.1 \subsection{C grid staggering of variables}
62    
63     \begin{figure}
64     \centerline{ \resizebox{!}{2in}{ \includegraphics{part2/cgrid3d.eps}} }
65     \caption{Three dimensional staggering of velocity components. This
66     facilitates the natural discretization of the continuity and tracer
67     equations. }
68 adcroft 1.2 \label{fig:cgrid3d}
69 adcroft 1.1 \end{figure}
70    
71 adcroft 1.2 The basic algorithm employed for stepping forward the momentum
72     equations is based on retaining non-divergence of the flow at all
73     times. This is most naturally done if the components of flow are
74     staggered in space in the form of an Arakawa C grid \cite{Arakawa70}.
75    
76     Fig. \ref{fig:cgrid3d} shows the components of flow ($u$,$v$,$w$)
77     staggered in space such that the zonal component falls on the
78     interface between continiuty cells in the zonal direction. Similarly
79     for the meridional and vertical directions. The continiuty cell is
80     synonymous with tracer cells (they are one and the same).
81    
82    
83    
84    
85 adcroft 1.1 \subsection{Horizontal grid}
86    
87     \begin{figure}
88     \centerline{ \begin{tabular}{cc}
89 adcroft 1.2 \raisebox{1.5in}{a)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Ac.eps}}
90     & \raisebox{1.5in}{b)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Az.eps}}
91 adcroft 1.1 \\
92 adcroft 1.2 \raisebox{1.5in}{c)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Au.eps}}
93     & \raisebox{1.5in}{d)}\resizebox{!}{2in}{ \includegraphics{part2/hgrid-Av.eps}}
94 adcroft 1.1 \end{tabular} }
95 adcroft 1.2 \caption{
96     Staggering of horizontal grid descriptors (lengths and areas). The
97     grid lines indicate the tracer cell boundaries and are the reference
98     grid for all panels. a) The area of a tracer cell, $A_c$, is bordered
99     by the lengths $\Delta x_g$ and $\Delta y_g$. b) The area of a
100     vorticity cell, $A_\zeta$, is bordered by the lengths $\Delta x_c$ and
101     $\Delta y_c$. c) The area of a u cell, $A_c$, is bordered by the
102     lengths $\Delta x_v$ and $\Delta y_f$. d) The area of a v cell, $A_c$,
103     is bordered by the lengths $\Delta x_f$ and $\Delta y_u$.}
104     \label{fig:hgrid}
105 adcroft 1.1 \end{figure}
106    
107 adcroft 1.2 The model domain is decomposed into tiles and within each tile a
108     quasi-regular grid is used. A tile is the basic unit of domain
109     decomposition for parallelization but may be used whether parallized
110     or not; see section \ref{sect:tiles} for more details. Although the
111     tiles may be patched together in an unstructured manner
112     (i.e. irregular or non-tessilating pattern), the interior of tiles is
113     a structered grid of quadrilateral cells. The horizontal coordinate
114     system is orthogonal curvilinear meaning we can not necessarily treat
115     the two horizontal directions as seperable. Instead, each cell in the
116     horizontal grid is described by the length of it's sides and it's
117     area.
118    
119     The grid information is quite general and describes any of the
120     available coordinates systems, cartesian, spherical-polar or
121     curvilinear. All that is necessary to distinguish between the
122     coordinate systems is to initialize the grid data (discriptors)
123     appropriately.
124    
125     \marginpar{Caution!}
126     In the following, we refer to the orientation of quantities on the
127     computational grid using geographic terminology such as points of the
128     compass. This is purely for convenience but should note be confused
129     with the actual geographic orientation of model quantities.
130    
131     \marginpar{$A_c$: {\bf rAc}}
132     \marginpar{$\Delta x_g$: {\bf DXg}}
133     \marginpar{$\Delta y_g$: {\bf DYg}}
134     Fig.~\ref{fig:hgrid}a shows the tracer cell (synonymous with the
135     continuity cell). The length of the southern edge, $\Delta x_g$,
136     western edge, $\Delta y_g$ and surface area, $A_c$, presented in the
137     vertical are stored in arrays {\bf DXg}, {\bf DYg} and {\bf rAc}. The
138     ``g'' suffix indicates that the lengths are along the defining grid
139     boundaries. The ``c'' suffix associates the quantity with the cell
140     centers. The quantities are staggered in space and the indexing is
141     such that {\bf DXg(i,j)} is positioned to the south of {\bf rAc(i,j)}
142     and {\bf DYg(i,j)} positioned to the west.
143    
144     \marginpar{$A_\zeta$: {\bf rAz}}
145     \marginpar{$\Delta x_c$: {\bf DXc}}
146     \marginpar{$\Delta y_c$: {\bf DYc}}
147     Fig.~\ref{fig:hgrid}b shows the vorticity cell. The length of the
148     southern edge, $\Delta x_c$, western edge, $\Delta y_c$ and surface
149     area, $A_\zeta$, presented in the vertical are stored in arrays {\bf
150     DXg}, {\bf DYg} and {\bf rAz}. The ``z'' suffix indicates that the
151     lengths are measured between the cell centers and the ``$\zeta$'' suffix
152     associates points with the vorticity points. The quantities are
153     staggered in space and the indexing is such that {\bf DXc(i,j)} is
154     positioned to the north of {\bf rAc(i,j)} and {\bf DYc(i,j)} positioned
155     to the east.
156    
157     \marginpar{$A_w$: {\bf rAw}}
158     \marginpar{$\Delta x_v$: {\bf DXv}}
159     \marginpar{$\Delta y_f$: {\bf DYf}}
160     Fig.~\ref{fig:hgrid}c shows the ``u'' or western (w) cell. The length of
161     the southern edge, $\Delta x_v$, eastern edge, $\Delta y_f$ and
162     surface area, $A_w$, presented in the vertical are stored in arrays
163     {\bf DXv}, {\bf DYf} and {\bf rAw}. The ``v'' suffix indicates that
164     the length is measured between the v-points, the ``f'' suffix
165     indicates that the length is measured between the (tracer) cell faces
166     and the ``w'' suffix associates points with the u-points (w stands for
167     west). The quantities are staggered in space and the indexing is such
168     that {\bf DXv(i,j)} is positioned to the south of {\bf rAw(i,j)} and
169     {\bf DYf(i,j)} positioned to the east.
170    
171     \marginpar{$A_s$: {\bf rAs}}
172     \marginpar{$\Delta x_f$: {\bf DXf}}
173     \marginpar{$\Delta y_u$: {\bf DYu}}
174     Fig.~\ref{fig:hgrid}d shows the ``v'' or southern (s) cell. The length of
175     the northern edge, $\Delta x_f$, western edge, $\Delta y_u$ and
176     surface area, $A_s$, presented in the vertical are stored in arrays
177     {\bf DXf}, {\bf DYu} and {\bf rAs}. The ``u'' suffix indicates that
178     the length is measured between the u-points, the ``f'' suffix
179     indicates that the length is measured between the (tracer) cell faces
180     and the ``s'' suffix associates points with the v-points (s stands for
181     south). The quantities are staggered in space and the indexing is such
182     that {\bf DXf(i,j)} is positioned to the north of {\bf rAs(i,j)} and
183     {\bf DYu(i,j)} positioned to the west.
184    
185     \fbox{ \begin{minipage}{4.75in}
186     {\em S/R INI\_CARTESIAN\_GRID} ({\em
187     model/src/ini\_cartesian\_grid.F})
188    
189     {\em S/R INI\_SPHERICAL\_POLAR\_GRID} ({\em
190     model/src/ini\_spherical\_polar\_grid.F})
191    
192     {\em S/R INI\_CURVILINEAR\_GRID} ({\em
193     model/src/ini\_curvilinear\_grid.F})
194    
195     $A_c$, $A_\zeta$, $A_w$, $A_s$: {\bf rAc}, {\bf rAz}, {\bf rAw}, {\bf rAs}
196     ({\em GRID.h})
197    
198     $\Delta x_g$, $\Delta y_g$: {\bf DXg}, {\bf DYg} ({\em GRID.h})
199    
200     $\Delta x_c$, $\Delta y_c$: {\bf DXc}, {\bf DYc} ({\em GRID.h})
201    
202     $\Delta x_f$, $\Delta y_f$: {\bf DXf}, {\bf DYf} ({\em GRID.h})
203    
204     $\Delta x_v$, $\Delta y_u$: {\bf DXv}, {\bf DYu} ({\em GRID.h})
205    
206     \end{minipage} }
207    
208     \subsubsection{Reciprocals of horizontal grid descriptors}
209    
210     %\marginpar{$A_c^{-1}$: {\bf RECIP\_rAc}}
211     %\marginpar{$A_\zeta^{-1}$: {\bf RECIP\_rAz}}
212     %\marginpar{$A_w^{-1}$: {\bf RECIP\_rAw}}
213     %\marginpar{$A_s^{-1}$: {\bf RECIP\_rAs}}
214     Lengths and areas appear in the denominator of expressions as much as
215     in the numerator. For efficiency and portability, we pre-calculate the
216     reciprocal of the horizontal grid quantities so that in-line divisions
217     can be avoided.
218    
219     %\marginpar{$\Delta x_g^{-1}$: {\bf RECIP\_DXg}}
220     %\marginpar{$\Delta y_g^{-1}$: {\bf RECIP\_DYg}}
221     %\marginpar{$\Delta x_c^{-1}$: {\bf RECIP\_DXc}}
222     %\marginpar{$\Delta y_c^{-1}$: {\bf RECIP\_DYc}}
223     %\marginpar{$\Delta x_f^{-1}$: {\bf RECIP\_DXf}}
224     %\marginpar{$\Delta y_f^{-1}$: {\bf RECIP\_DYf}}
225     %\marginpar{$\Delta x_v^{-1}$: {\bf RECIP\_DXv}}
226     %\marginpar{$\Delta y_u^{-1}$: {\bf RECIP\_DYu}}
227     For each grid descriptor (array) there is a reciprocal named using the
228     prefix {\bf RECIP\_}. This doubles the amount of storage in {\em
229     GRID.h} but they are all only 2-D descriptors.
230    
231     \fbox{ \begin{minipage}{4.75in}
232     {\em S/R INI\_MASKS\_ETC} ({\em
233     model/src/ini\_masks\_etc.F})
234    
235     $A_c^{-1}$: {\bf RECIP\_Ac} ({\em GRID.h})
236    
237     $A_\zeta^{-1}$: {\bf RECIP\_Az} ({\em GRID.h})
238    
239     $A_w^{-1}$: {\bf RECIP\_Aw} ({\em GRID.h})
240    
241     $A_s^{-1}$: {\bf RECIP\_As} ({\em GRID.h})
242    
243     $\Delta x_g^{-1}$, $\Delta y_g^{-1}$: {\bf RECIP\_DXg}, {\bf RECIP\_DYg} ({\em GRID.h})
244    
245     $\Delta x_c^{-1}$, $\Delta y_c^{-1}$: {\bf RECIP\_DXc}, {\bf RECIP\_DYc} ({\em GRID.h})
246    
247     $\Delta x_f^{-1}$, $\Delta y_f^{-1}$: {\bf RECIP\_DXf}, {\bf RECIP\_DYf} ({\em GRID.h})
248    
249     $\Delta x_v^{-1}$, $\Delta y_u^{-1}$: {\bf RECIP\_DXv}, {\bf RECIP\_DYu} ({\em GRID.h})
250    
251     \end{minipage} }
252    
253     \subsubsection{Cartesian coordinates}
254    
255     Cartesian coordinates are selected when the logical flag {\bf
256     using\-Cartes\-ianGrid} in namelist {\em PARM04} is set to true. The grid
257     spacing can be set to uniform via scalars {\bf dXspacing} and {\bf
258     dYspacing} in namelist {\em PARM04} or to variable resolution by the
259     vectors {\bf DELX} and {\bf DELY}. Units are normally
260     meters. Non-dimensional coordinates can be used by interpretting the
261     gravitational constant as the Rayleigh number.
262    
263     \subsubsection{Spherical-polar coordinates}
264    
265     Spherical coordinates are selected when the logical flag {\bf
266     using\-Spherical\-PolarGrid} in namelist {\em PARM04} is set to true. The
267     grid spacing can be set to uniform via scalars {\bf dXspacing} and
268     {\bf dYspacing} in namelist {\em PARM04} or to variable resolution by
269     the vectors {\bf DELX} and {\bf DELY}. Units of these namelist
270     variables are alway degrees. The horizontal grid descriptors are
271     calculated from these namelist variables have units of meters.
272    
273     \subsubsection{Curvilinear coordinates}
274    
275     Curvilinear coordinates are selected when the logical flag {\bf
276     using\-Curvil\-inear\-Grid} in namelist {\em PARM04} is set to true. The
277     grid spacing can not be set via the namelist. Instead, the grid
278     descriptors are read from data files, one for each descriptor. As for
279     other grids, the horizontal grid descriptors have units of meters.
280    
281    
282 adcroft 1.1 \subsection{Vertical grid}
283    
284     \begin{figure}
285     \centerline{ \begin{tabular}{cc}
286 adcroft 1.2 \raisebox{4in}{a)} \resizebox{!}{4in}{
287     \includegraphics{part2/vgrid-cellcentered.eps}} & \raisebox{4in}{b)}
288     \resizebox{!}{4in}{ \includegraphics{part2/vgrid-accurate.eps}}
289 adcroft 1.1 \end{tabular} }
290     \caption{Two versions of the vertical grid. a) The cell centered
291     approach where the interface depths are specified and the tracer
292     points centered in between the interfaces. b) The interface centered
293     approach where tracer levels are specified and the w-interfaces are
294     centered in between.}
295 adcroft 1.2 \label{fig:vgrid}
296 adcroft 1.1 \end{figure}
297    
298 adcroft 1.2 As for the horizontal grid, we use the suffixes ``c'' and ``f'' to
299     indicates faces and centers. Fig.~\ref{fig:vgrid}a shows the default
300     vertical grid used by the model.
301     \marginpar{$\Delta r_f$: {\bf DRf}}
302     \marginpar{$\Delta r_c$: {\bf DRc}}
303     $\Delta r_f$ is the difference in $r$
304     (vertical coordinate) between the faces (i.e. $\Delta r_f \equiv -
305     \delta_k r$ where the minus sign appears due to the convention that the
306     surface layer has index $k=1$.).
307    
308     The vertical grid is calculated in subroutine {\em
309     INI\_VERTICAL\_GRID} and specified via the vector {\bf DELR} in
310     namelist {\em PARM04}. The units of ``r'' are either meters or Pascals
311     depending on the isomorphism being used which in turn is dependent
312     only on the choise of equation of state.
313    
314     There are alternative namelist vectors {\bf DELZ} and {\bf DELP} which
315     dictate whether z- or
316     \marginpar{Caution!}
317     p- coordinates are to be used but we intend to
318     phase this out since they are redundant.
319    
320     The reciprocals $\Delta r_f^{-1}$ and $\Delta r_c^{-1}$ are
321     pre-calculated (also in subroutine {\em INI\_VERTICAL\_GRID}). All
322     vertical grid descriptors are stored in common blocks in {\em GRID.h}.
323    
324     The above grid (Fig.~\ref{fig:vgrid}a) is known as the cell centered
325     approach because the tracer points are at cell centers; the cell
326     centers are mid-way between the cell interfaces. An alternative, the
327     vertex or interface centered approach, is shown in
328     Fig.~\ref{fig:vgrid}b. Here, the interior interfaces are positioned
329     mid-way between the tracer nodes (no longer cell centers). This
330     approach is formally more accurate for evaluation of hydrostatic
331     pressure and vertical advection but historically the cell centered
332     approach has been used. An alternative form of subroutine {\em
333     INI\_VERTICAL\_GRID} is used to select the interface centered approach
334     but no run time option is currently available.
335    
336     \fbox{ \begin{minipage}{4.75in}
337     {\em S/R INI\_VERTICAL\_GRID} ({\em
338     model/src/ini\_vertical\_grid.F})
339    
340     $\Delta r_f$: {\bf DRf} ({\em GRID.h})
341    
342     $\Delta r_c$: {\bf DRc} ({\em GRID.h})
343    
344     $\Delta r_f^{-1}$: {\bf RECIP\_DRf} ({\em GRID.h})
345    
346     $\Delta r_c^{-1}$: {\bf RECIP\_DRc} ({\em GRID.h})
347    
348     \end{minipage} }
349    
350 adcroft 1.1
351     \subsection{Continuity and horizontal pressure gradient terms}
352    
353     The core algorithm is based on the ``C grid'' discretization of the
354     continuity equation which can be summarized as:
355     \begin{eqnarray}
356     \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' \\
357     \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' \\
358     \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}' \\
359     \delta_i \Delta y_g \Delta r_f h_w u +
360     \delta_j \Delta x_g \Delta r_f h_s v +
361     \delta_k {\cal A}_c w & = & {\cal A}_c \delta_k (P-E)_{r=0}
362 adcroft 1.2 \label{eq:discrete-continuity}
363 adcroft 1.1 \end{eqnarray}
364     where the continuity equation has been most naturally discretized by
365     staggering the three components of velocity as shown in
366     Fig.~\ref{fig-cgrid3d}. The grid lengths $\Delta x_c$ and $\Delta y_c$
367     are the lengths between tracer points (cell centers). The grid lengths
368     $\Delta x_g$, $\Delta y_g$ are the grid lengths between cell
369     corners. $\Delta r_f$ and $\Delta r_c$ are the distance (in units of
370     $r$) between level interfaces (w-level) and level centers (tracer
371     level). The surface area presented in the vertical is denoted ${\cal
372     A}_c$. The factors $h_w$ and $h_s$ are non-dimensional fractions
373     (between 0 and 1) that represent the fraction cell depth that is
374     ``open'' for fluid flow.
375     \marginpar{$h_w$: {\bf hFacW}}
376     \marginpar{$h_s$: {\bf hFacS}}
377    
378     The last equation, the discrete continuity equation, can be summed in
379     the vertical to yeild the free-surface equation:
380     \begin{equation}
381     {\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 =
382     {\cal A}_c(P-E)_{r=0}
383     \end{equation}
384     The source term $P-E$ on the rhs of continuity accounts for the local
385     addition of volume due to excess precipitation and run-off over
386     evaporation and only enters the top-level of the {\em ocean} model.
387    
388     \subsection{Hydrostatic balance}
389    
390     The vertical momentum equation has the hydrostatic or
391     quasi-hydrostatic balance on the right hand side. This discretization
392     guarantees that the conversion of potential to kinetic energy as
393     derived from the buoyancy equation exactly matches the form derived
394     from the pressure gradient terms when forming the kinetic energy
395     equation.
396    
397     In the ocean, using z-ccordinates, the hydrostatic balance terms are
398     discretized:
399     \begin{equation}
400     \epsilon_{nh} \partial_t w
401     + g \overline{\rho'}^k + \frac{1}{\Delta z} \delta_k \Phi_h' = \ldots
402     \end{equation}
403    
404     In the atmosphere, using p-coordinates, hydrostatic balance is
405     discretized:
406     \begin{equation}
407     \overline{\theta'}^k + \frac{1}{\Delta \Pi} \delta_k \Phi_h' = 0
408     \end{equation}
409     where $\Delta \Pi$ is the difference in Exner function between the
410     pressure points. The non-hydrostatic equations are not available in
411     the atmosphere.
412    
413     The difference in approach between ocean and atmosphere occurs because
414     of the direct use of the ideal gas equation in forming the potential
415     energy conversion term $\alpha \omega$. The form of these consversion
416     terms is discussed at length in \cite{Adcroft01}.
417    
418     Because of the different representation of hydrostatic balance between
419     ocean and atmosphere there is no elegant way to represent both systems
420     using an arbitrary coordinate.
421    
422     The integration for hydrostatic pressure is made in the positive $r$
423     direction (increasing k-index). For the ocean, this is from the
424     free-surface down and for the atmosphere this is from the ground up.
425    
426     The calculations are made in the subroutine {\em
427     CALC\_PHI\_HYD}. Inside this routine, one of other of the
428     atmospheric/oceanic form is selected based on the string variable {\bf
429     buoyancyRelation}.
430    
431     \subsection{Flux-form momentum equations}
432    
433     The original finite volume model was based on the Eulerian flux form
434     momentum equations. This is the default though the vector invariant
435     form is optionally available (and recommended in some cases).
436    
437     The ``G's'' (our colloquial name for all terms on rhs!) are broken
438     into the various advective, Coriolis, horizontal dissipation, vertical
439     dissipation and metric forces:
440     \marginpar{$G_u$: {\bf Gu} }
441     \marginpar{$G_v$: {\bf Gv} }
442     \marginpar{$G_w$: {\bf Gw} }
443     \begin{eqnarray}
444     G_u & = & G_u^{adv} + G_u^{cor} + G_u^{h-diss} + G_u^{v-diss} +
445     G_u^{metric} + G_u^{nh-metric} \\
446     G_v & = & G_v^{adv} + G_v^{cor} + G_v^{h-diss} + G_v^{v-diss} +
447     G_v^{metric} + G_v^{nh-metric} \\
448     G_w & = & G_w^{adv} + G_w^{cor} + G_w^{h-diss} + G_w^{v-diss} +
449     G_w^{metric} + G_w^{nh-metric}
450     \end{eqnarray}
451     In the hydrostatic limit, $G_w=0$ and $\epsilon_{nh}=0$, reducing the
452     vertical momentum to hydrostatic balance.
453    
454     These terms are calculated in routines called from subroutine {\em
455     CALC\_MOM\_RHS} a collected into the global arrays {\bf Gu}, {\bf Gv},
456     and {\bf Gw}.
457    
458 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
459 adcroft 1.1 {\em S/R CALC\_MOM\_RHS} ({\em pkg/mom\_fluxform/calc\_mom\_rhs.F})
460    
461     $G_u$: {\bf Gu} ({\em DYNVARS.h})
462    
463     $G_v$: {\bf Gv} ({\em DYNVARS.h})
464    
465     $G_w$: {\bf Gw} ({\em DYNVARS.h})
466     \end{minipage} }
467    
468    
469     \subsubsection{Advection of momentum}
470    
471     The advective operator is second order accurate in space:
472     \begin{eqnarray}
473     {\cal A}_w \Delta r_f h_w G_u^{adv} & = &
474     \delta_i \overline{ U }^i \overline{ u }^i
475     + \delta_j \overline{ V }^i \overline{ u }^j
476     + \delta_k \overline{ W }^i \overline{ u }^k \\
477     {\cal A}_s \Delta r_f h_s G_v^{adv} & = &
478     \delta_i \overline{ U }^j \overline{ v }^i
479     + \delta_j \overline{ V }^j \overline{ v }^j
480     + \delta_k \overline{ W }^j \overline{ v }^k \\
481     {\cal A}_c \Delta r_c G_w^{adv} & = &
482     \delta_i \overline{ U }^k \overline{ w }^i
483     + \delta_j \overline{ V }^k \overline{ w }^j
484     + \delta_k \overline{ W }^k \overline{ w }^k \\
485     \end{eqnarray}
486     and because of the flux form does not contribute to the global budget
487     of linear momentum. The quantities $U$, $V$ and $W$ are volume fluxes
488     defined:
489     \marginpar{$U$: {\bf uTrans} }
490     \marginpar{$V$: {\bf vTrans} }
491     \marginpar{$W$: {\bf rTrans} }
492     \begin{eqnarray}
493     U & = & \Delta y_g \Delta r_f h_w u \\
494     V & = & \Delta x_g \Delta r_f h_s v \\
495     W & = & {\cal A}_c w
496     \end{eqnarray}
497     The advection of momentum takes the same form as the advection of
498     tracers but by a translated advective flow. Consequently, the
499     conservation of second moments, derived for tracers later, applies to
500     $u^2$ and $v^2$ and $w^2$ so that advection of momentum correctly
501     conserves kinetic energy.
502    
503 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
504 adcroft 1.1 {\em S/R MOM\_U\_ADV\_UU} ({\em mom\_u\_adv\_uu.F})
505    
506     {\em S/R MOM\_U\_ADV\_VU} ({\em mom\_u\_adv\_vu.F})
507    
508     {\em S/R MOM\_U\_ADV\_WU} ({\em mom\_u\_adv\_wu.F})
509    
510     {\em S/R MOM\_U\_ADV\_UV} ({\em mom\_u\_adv\_uv.F})
511    
512     {\em S/R MOM\_U\_ADV\_VV} ({\em mom\_u\_adv\_vv.F})
513    
514     {\em S/R MOM\_U\_ADV\_WV} ({\em mom\_u\_adv\_wv.F})
515    
516     $uu$, $uv$, $vu$, $vv$: {\bf aF} (local to {\em calc\_mom\_rhs.F})
517     \end{minipage} }
518    
519    
520    
521     \subsubsection{Coriolis terms}
522    
523     The ``pure C grid'' Coriolis terms (i.e. in absence of C-D scheme) are
524     discretized:
525     \begin{eqnarray}
526     {\cal A}_w \Delta r_f h_w G_u^{Cor} & = &
527     \overline{ f {\cal A}_c \Delta r_f h_c \overline{ v }^j }^i
528     - \epsilon_{nh} \overline{ f' {\cal A}_c \Delta r_f h_c \overline{ w }^k }^i \\
529     {\cal A}_s \Delta r_f h_s G_v^{Cor} & = &
530     - \overline{ f {\cal A}_c \Delta r_f h_c \overline{ u }^i }^j \\
531     {\cal A}_c \Delta r_c G_w^{Cor} & = &
532     \epsilon_{nh} \overline{ f' {\cal A}_c \Delta r_f h_c \overline{ u }^i }^k
533     \end{eqnarray}
534     where the Coriolis parameters $f$ and $f'$ are defined:
535     \begin{eqnarray}
536     f & = & 2 \Omega \sin{\phi} \\
537     f' & = & 2 \Omega \cos{\phi}
538     \end{eqnarray}
539     when using spherical geometry, otherwise the $\beta$-plane definition is used:
540     \begin{eqnarray}
541     f & = & f_o + \beta y \\
542     f' & = & 0
543     \end{eqnarray}
544    
545     This discretization globally conserves kinetic energy. It should be
546     noted that despite the use of this discretization in former
547     publications, all calculations to date have used the following
548     different discretization:
549     \begin{eqnarray}
550     G_u^{Cor} & = &
551     f_u \overline{ v }^{ji}
552     - \epsilon_{nh} f_u' \overline{ w }^{ik} \\
553     G_v^{Cor} & = &
554     - f_v \overline{ u }^{ij} \\
555     G_w^{Cor} & = &
556     \epsilon_{nh} f_w' \overline{ u }^{ik}
557     \end{eqnarray}
558     \marginpar{Need to change the default in code to match this}
559     where the subscripts on $f$ and $f'$ indicate evaluation of the
560     Coriolis parameters at the appropriate points in space. The above
561     discretization does {\em not} conserve anything, especially energy. An
562     option to recover this discretization has been retained for backward
563     compatibility testing (set run-time logical {\bf
564     useNonconservingCoriolis} to {\em true} which otherwise defaults to
565     {\em false}).
566    
567 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
568 adcroft 1.1 {\em S/R MOM\_CDSCHEME} ({\em mom\_cdscheme.F})
569    
570     {\em S/R MOM\_U\_CORIOLIS} ({\em mom\_u\_coriolis.F})
571    
572     {\em S/R MOM\_V\_CORIOLIS} ({\em mom\_v\_coriolis.F})
573    
574     $G_u^{Cor}$, $G_v^{Cor}$: {\bf cF} (local to {\em calc\_mom\_rhs.F})
575     \end{minipage} }
576    
577    
578     \subsubsection{Curvature metric terms}
579    
580     The most commonly used coordinate system on the sphere is the
581     geographic system $(\lambda,\phi)$. The curvilinear nature of these
582     coordinates on the sphere lead to some ``metric'' terms in the
583     component momentum equations. Under the thin-atmosphere and
584     hydrostatic approximations these terms are discretized:
585     \begin{eqnarray}
586     {\cal A}_w \Delta r_f h_w G_u^{metric} & = &
587     \overline{ \frac{ \overline{u}^i }{a} \tan{\phi} {\cal A}_c \Delta r_f h_c \overline{ v }^j }^i \\
588     {\cal A}_s \Delta r_f h_s G_v^{metric} & = &
589     - \overline{ \frac{ \overline{u}^i }{a} \tan{\phi} {\cal A}_c \Delta r_f h_c \overline{ u }^i }^j \\
590     G_w^{metric} & = & 0
591     \end{eqnarray}
592     where $a$ is the radius of the planet (sphericity is assumed) or the
593     radial distance of the particle (i.e. a function of height). It is
594     easy to see that this discretization satisfies all the properties of
595     the discrete Coriolis terms since the metric factor $\frac{u}{a}
596     \tan{\phi}$ can be viewed as a modification of the vertical Coriolis
597     parameter: $f \rightarrow f+\frac{u}{a} \tan{\phi}$.
598    
599     However, as for the Coriolis terms, a non-energy conserving form has
600     exclusively been used to date:
601     \begin{eqnarray}
602     G_u^{metric} & = & \frac{u \overline{v}^{ij} }{a} \tan{\phi} \\
603     G_v^{metric} & = & \frac{ \overline{u}^{ij} \overline{u}^{ij}}{a} \tan{\phi}
604     \end{eqnarray}
605     where $\tan{\phi}$ is evaluated at the $u$ and $v$ points
606     respectively.
607    
608 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
609 adcroft 1.1 {\em S/R MOM\_U\_METRIC\_SPHERE} ({\em mom\_u\_metric\_sphere.F})
610    
611     {\em S/R MOM\_V\_METRIC\_SPHERE} ({\em mom\_v\_metric\_sphere.F})
612    
613     $G_u^{metric}$, $G_v^{metric}$: {\bf mT} (local to {\em calc\_mom\_rhs.F})
614     \end{minipage} }
615    
616    
617    
618     \subsubsection{Non-hydrostatic metric terms}
619    
620     For the non-hydrostatic equations, dropping the thin-atmosphere
621     approximation re-introduces metric terms involving $w$ and are
622     required to conserve anglular momentum:
623     \begin{eqnarray}
624     {\cal A}_w \Delta r_f h_w G_u^{metric} & = &
625     - \overline{ \frac{ \overline{u}^i \overline{w}^k }{a} {\cal A}_c \Delta r_f h_c }^i \\
626     {\cal A}_s \Delta r_f h_s G_v^{metric} & = &
627     - \overline{ \frac{ \overline{v}^j \overline{w}^k }{a} {\cal A}_c \Delta r_f h_c}^j \\
628     {\cal A}_c \Delta r_c G_w^{metric} & = &
629     \overline{ \frac{ {\overline{u}^i}^2 + {\overline{v}^j}^2}{a} {\cal A}_c \Delta r_f h_c }^k
630     \end{eqnarray}
631    
632     Because we are always consistent, even if consistently wrong, we have,
633     in the past, used a different discretization in the model which is:
634     \begin{eqnarray}
635     G_u^{metric} & = &
636     - \frac{u}{a} \overline{w}^{ik} \\
637     G_v^{metric} & = &
638     - \frac{v}{a} \overline{w}^{jk} \\
639     G_w^{metric} & = &
640     \frac{1}{a} ( {\overline{u}^{ik}}^2 + {\overline{v}^{jk}}^2 )
641     \end{eqnarray}
642    
643 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
644 adcroft 1.1 {\em S/R MOM\_U\_METRIC\_NH} ({\em mom\_u\_metric\_nh.F})
645    
646     {\em S/R MOM\_V\_METRIC\_NH} ({\em mom\_v\_metric\_nh.F})
647    
648     $G_u^{metric}$, $G_v^{metric}$: {\bf mT} (local to {\em calc\_mom\_rhs.F})
649     \end{minipage} }
650    
651    
652     \subsubsection{Lateral dissipation}
653    
654     Historically, we have represented the SGS Reynolds stresses as simply
655     down gradient momentum fluxes, ignoring constraints on the stress
656     tensor such as symmetry.
657     \begin{eqnarray}
658     {\cal A}_w \Delta r_f h_w G_u^{h-diss} & = &
659     \delta_i \Delta y_f \Delta r_f h_c \tau_{11}
660     + \delta_j \Delta x_v \Delta r_f h_\zeta \tau_{12} \\
661     {\cal A}_s \Delta r_f h_s G_v^{h-diss} & = &
662     \delta_i \Delta y_u \Delta r_f h_\zeta \tau_{21}
663     + \delta_j \Delta x_f \Delta r_f h_c \tau_{22}
664     \end{eqnarray}
665     \marginpar{Check signs of stress definitions}
666    
667     The lateral viscous stresses are discretized:
668     \begin{eqnarray}
669     \tau_{11} & = & A_h c_{11\Delta}(\phi) \frac{1}{\Delta x_f} \delta_i u
670     -A_4 c_{11\Delta^2}(\phi) \frac{1}{\Delta x_f} \delta_i \nabla^2 u \\
671     \tau_{12} & = & A_h c_{12\Delta}(\phi) \frac{1}{\Delta y_u} \delta_j u
672     -A_4 c_{12\Delta^2}(\phi)\frac{1}{\Delta y_u} \delta_j \nabla^2 u \\
673     \tau_{21} & = & A_h c_{21\Delta}(\phi) \frac{1}{\Delta x_v} \delta_i v
674     -A_4 c_{21\Delta^2}(\phi) \frac{1}{\Delta x_v} \delta_i \nabla^2 v \\
675     \tau_{22} & = & A_h c_{22\Delta}(\phi) \frac{1}{\Delta y_f} \delta_j v
676     -A_4 c_{22\Delta^2}(\phi) \frac{1}{\Delta y_f} \delta_j \nabla^2 v
677     \end{eqnarray}
678     where the non-dimensional factors $c_{lm\Delta^n}(\phi), \{l,m,n\} \in
679     \{1,2\}$ define the ``cosine'' scaling with latitude which can be
680     applied in various ad-hoc ways. For instance, $c_{11\Delta} =
681     c_{21\Delta} = (\cos{\phi})^{3/2}$, $c_{12\Delta}=c_{22\Delta}=0$ would
682     represent the an-isotropic cosine scaling typically used on the
683     ``lat-lon'' grid for Laplacian viscosity.
684     \marginpar{Need to tidy up method for controlling this in code}
685    
686     It should be noted that dispite the ad-hoc nature of the scaling, some
687     scaling must be done since on a lat-lon grid the converging meridians
688     make it very unlikely that a stable viscosity parameter exists across
689     the entire model domain.
690    
691     The Laplacian viscosity coefficient, $A_h$ ({\bf viscAh}), has units
692     of $m^2 s^{-1}$. The bi-harmonic viscosity coefficient, $A_4$ ({\bf
693     viscA4}), has units of $m^4 s^{-1}$.
694    
695 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
696 adcroft 1.1 {\em S/R MOM\_U\_XVISCFLUX} ({\em mom\_u\_xviscflux.F})
697    
698     {\em S/R MOM\_U\_YVISCFLUX} ({\em mom\_u\_yviscflux.F})
699    
700     {\em S/R MOM\_V\_XVISCFLUX} ({\em mom\_v\_xviscflux.F})
701    
702     {\em S/R MOM\_V\_YVISCFLUX} ({\em mom\_v\_yviscflux.F})
703    
704     $\tau_{11}$, $\tau_{12}$, $\tau_{22}$, $\tau_{22}$: {\bf vF}, {\bf
705     v4F} (local to {\em calc\_mom\_rhs.F})
706     \end{minipage} }
707    
708     Two types of lateral boundary condition exist for the lateral viscous
709     terms, no-slip and free-slip.
710    
711     The free-slip condition is most convenient to code since it is
712     equivalent to zero-stress on boundaries. Simple masking of the stress
713     components sets them to zero. The fractional open stress is properly
714     handled using the lopped cells.
715    
716     The no-slip condition defines the normal gradient of a tangential flow
717     such that the flow is zero on the boundary. Rather than modify the
718     stresses by using complicated functions of the masks and ``ghost''
719     points (see \cite{Adcroft+Marshall98}) we add the boundary stresses as
720     an additional source term in cells next to solid boundaries. This has
721     the advantage of being able to cope with ``thin walls'' and also makes
722     the interior stress calculation (code) independent of the boundary
723     conditions. The ``body'' force takes the form:
724     \begin{eqnarray}
725     G_u^{side-drag} & = &
726     \frac{4}{\Delta z_f} \overline{ (1-h_\zeta) \frac{\Delta x_v}{\Delta y_u} }^j
727     \left( A_h c_{12\Delta}(\phi) u - A_4 c_{12\Delta^2}(\phi) \nabla^2 u \right)
728     \\
729     G_v^{side-drag} & = &
730     \frac{4}{\Delta z_f} \overline{ (1-h_\zeta) \frac{\Delta y_u}{\Delta x_v} }^i
731     \left( A_h c_{21\Delta}(\phi) v - A_4 c_{21\Delta^2}(\phi) \nabla^2 v \right)
732     \end{eqnarray}
733    
734     In fact, the above discretization is not quite complete because it
735     assumes that the bathymetry at velocity points is deeper than at
736     neighbouring vorticity points, e.g. $1-h_w < 1-h_\zeta$
737    
738 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
739 adcroft 1.1 {\em S/R MOM\_U\_SIDEDRAG} ({\em mom\_u\_sidedrag.F})
740    
741     {\em S/R MOM\_V\_SIDEDRAG} ({\em mom\_v\_sidedrag.F})
742    
743     $G_u^{side-drag}$, $G_v^{side-drag}$: {\bf vF} (local to {\em calc\_mom\_rhs.F})
744     \end{minipage} }
745    
746    
747     \subsubsection{Vertical dissipation}
748    
749     Vertical viscosity terms are discretized with only partial adherence
750     to the variable grid lengths introduced by the finite volume
751     formulation. This reduces the formal accuracy of these terms to just
752     first order but only next to boundaries; exactly where other terms
753     appear such as linar and quadratic bottom drag.
754     \begin{eqnarray}
755     G_u^{v-diss} & = &
756     \frac{1}{\Delta r_f h_w} \delta_k \tau_{13} \\
757     G_v^{v-diss} & = &
758     \frac{1}{\Delta r_f h_s} \delta_k \tau_{23} \\
759     G_w^{v-diss} & = & \epsilon_{nh}
760     \frac{1}{\Delta r_f h_d} \delta_k \tau_{33}
761     \end{eqnarray}
762     represents the general discrete form of the vertical dissipation terms.
763    
764     In the interior the vertical stresses are discretized:
765     \begin{eqnarray}
766     \tau_{13} & = & A_v \frac{1}{\Delta r_c} \delta_k u \\
767     \tau_{23} & = & A_v \frac{1}{\Delta r_c} \delta_k v \\
768     \tau_{33} & = & A_v \frac{1}{\Delta r_f} \delta_k w
769     \end{eqnarray}
770     It should be noted that in the non-hydrostatic form, the stress tensor
771     is even less consistent than for the hydrostatic (see Wazjowicz
772     \cite{Waojz}). It is well known how to do this properly (see Griffies
773     \cite{Griffies}) and is on the list of to-do's.
774    
775 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
776 adcroft 1.1 {\em S/R MOM\_U\_RVISCLFUX} ({\em mom\_u\_rviscflux.F})
777    
778     {\em S/R MOM\_V\_RVISCLFUX} ({\em mom\_v\_rviscflux.F})
779    
780     $\tau_{13}$: {\bf urf} (local to {\em calc\_mom\_rhs.F})
781    
782     $\tau_{23}$: {\bf vrf} (local to {\em calc\_mom\_rhs.F})
783     \end{minipage} }
784    
785    
786     As for the lateral viscous terms, the free-slip condition is
787     equivalent to simply setting the stress to zero on boundaries. The
788     no-slip condition is implemented as an additional term acting on top
789     of the interior and free-slip stresses. Bottom drag represents
790     additional friction, in addition to that imposed by the no-slip
791     condition at the bottom. The drag is cast as a stress expressed as a
792     linear or quadratic function of the mean flow in the layer above the
793     topography:
794     \begin{eqnarray}
795     \tau_{13}^{bottom-drag} & = &
796     \left(
797     2 A_v \frac{1}{\Delta r_c}
798     + r_b
799     + C_d \sqrt{ \overline{2 KE}^i }
800     \right) u \\
801     \tau_{23}^{bottom-drag} & = &
802     \left(
803     2 A_v \frac{1}{\Delta r_c}
804     + r_b
805     + C_d \sqrt{ \overline{2 KE}^j }
806     \right) v
807     \end{eqnarray}
808     where these terms are only evaluated immediately above topography.
809     $r_b$ ({\bf bottomDragLinear}) has units of $m s^{-1}$ and a typical value
810     of the order 0.0002 $m s^{-1}$. $C_d$ ({\bf bottomDragQuadratic}) is
811     dimensionless with typical values in the range 0.001--0.003.
812    
813 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
814 adcroft 1.1 {\em S/R MOM\_U\_BOTTOMDRAG} ({\em mom\_u\_bottomdrag.F})
815    
816     {\em S/R MOM\_V\_BOTTOMDRAG} ({\em mom\_v\_bottomdrag.F})
817    
818     $\tau_{13}^{bottom-drag}$, $\tau_{23}^{bottom-drag}$: {\bf vf} (local to {\em calc\_mom\_rhs.F})
819     \end{minipage} }
820    
821    
822    
823    
824    
825     \subsection{Tracer equations}
826    
827     The tracer equations are discretized consistantly with the continuity
828     equation to facilitate conservation properties analogous to the
829     continuum:
830     \begin{equation}
831     {\cal A}_c \Delta r_f h_c \partial_\theta
832     + \delta_i U \overline{ \theta }^i
833     + \delta_j V \overline{ \theta }^j
834     + \delta_k W \overline{ \theta }^k
835     = {\cal A}_c \Delta r_f h_c {\cal S}_\theta + \theta {\cal A}_c \delta_k (P-E)_{r=0}
836     \end{equation}
837     The quantities $U$, $V$ and $W$ are volume fluxes defined:
838     \marginpar{$U$: {\bf uTrans} }
839     \marginpar{$V$: {\bf vTrans} }
840     \marginpar{$W$: {\bf rTrans} }
841     \begin{eqnarray}
842     U & = & \Delta y_g \Delta r_f h_w u \\
843     V & = & \Delta x_g \Delta r_f h_s v \\
844     W & = & {\cal A}_c w
845     \end{eqnarray}
846     ${\cal S}$ represents the ``parameterized'' SGS processes and
847     physics associated with the tracer. For instance, potential
848     temperature equation in the ocean has is forced by surface and
849     partially penetrating heat fluxes:
850     \begin{equation}
851     {\cal A}_c \Delta r_f h_c {\cal S}_\theta = \frac{1}{c_p \rho_o} \delta_k {\cal A}_c {\cal Q}
852     \end{equation}
853     while the salt equation has no real sources, ${\cal S}=0$, which
854     leaves just the $P-E$ term.
855    
856     The continuity equation can be recovered by setting ${\cal Q}=0$ and
857     $\theta=1$. The term $\theta (P-E)_{r=0}$ is required to retain local
858     conservation of $\theta$. Global conservation is not possible using
859     the flux-form (as here) and a linearized free-surface
860     (\cite{Griffies00,Campin02}).
861    
862    
863    
864    
865     \subsection{Derivation of discrete energy conservation}
866    
867     These discrete equations conserve kinetic plus potential energy using the
868     following definitions:
869     \begin{equation}
870     KE = \frac{1}{2} \left( \overline{ u^2 }^i + \overline{ v^2 }^j +
871     \epsilon_{nh} \overline{ w^2 }^k \right)
872     \end{equation}
873    
874    
875     \subsection{Vector invariant momentum equations}
876    
877     The finite volume method lends itself to describing the continuity and
878     tracer equations in curvilinear coordinate systems but the appearance
879     of new metric terms in the flux-form momentum equations makes
880     generalizing them far from elegant. The vector invariant form of the
881     momentum equations are exactly that; invariant under coordinate
882     transformations.
883    
884     The non-hydrostatic vector invariant equations read:
885     \begin{equation}
886     \partial_t \vec{v} + ( 2\vec{\Omega} + \vec{\zeta}) \wedge \vec{v}
887     - b \hat{r}
888     + \vec{\nabla} B = \vec{\nabla} \cdot \vec{\bf \tau}
889     \end{equation}
890     which describe motions in any orthogonal curvilinear coordinate
891     system. Here, $B$ is the Bernoulli function and $\vec{\zeta}=\nabla
892     \wedge \vec{v}$ is the vorticity vector. We can take advantage of the
893     elegance of these equations when discretizing them and use the
894     discrete definitions of the grad, curl and divergence operators to
895     satisfy constraints. We can also consider the analogy to forming
896     derived equations, such as the vorticity equation, and examine how the
897     discretization can be adjusted to give suitable vorticity advection
898     among other things.
899    
900     The underlying algorithm is the same as for the flux form
901     equations. All that has changed is the contents of the ``G's''. For
902     the time-being, only the hydrostatic terms have been coded but we will
903     indicate the points where non-hydrostatic contributions will enter:
904     \begin{eqnarray}
905     G_u & = & G_u^{fv} + G_u^{\zeta_3 v} + G_u^{\zeta_2 w} + G_u^{\partial_x B}
906     + G_u^{\partial_z \tau^x} + G_u^{h-dissip} + G_u^{v-dissip} \\
907     G_v & = & G_v^{fu} + G_v^{\zeta_3 u} + G_v^{\zeta_1 w} + G_v^{\partial_y B}
908     + G_v^{\partial_z \tau^y} + G_v^{h-dissip} + G_v^{v-dissip} \\
909     G_w & = & G_w^{fu} + G_w^{\zeta_1 v} + G_w^{\zeta_2 u} + G_w^{\partial_z B}
910     + G_w^{h-dissip} + G_w^{v-dissip}
911     \end{eqnarray}
912    
913 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
914 adcroft 1.1 {\em S/R CALC\_MOM\_RHS} ({\em pkg/mom\_vecinv/calc\_mom\_rhs.F})
915    
916     $G_u$: {\bf Gu} ({\em DYNVARS.h})
917    
918     $G_v$: {\bf Gv} ({\em DYNVARS.h})
919    
920     $G_w$: {\bf Gw} ({\em DYNVARS.h})
921     \end{minipage} }
922    
923     \subsubsection{Relative vorticity}
924    
925     The vertical component of relative vorticity is explicitly calculated
926     and use in the discretization. The particular form is crucial for
927     numerical stablility; alternative definitions break the conservation
928     properties of the discrete equations.
929    
930     Relative vorticity is defined:
931     \begin{equation}
932     \zeta_3 = \frac{\Gamma}{A_\zeta}
933     = \frac{1}{{\cal A}_\zeta} ( \delta_i \Delta y_c v - \delta_j \Delta x_c u )
934     \end{equation}
935     where ${\cal A}_\zeta$ is the area of the vorticity cell presented in
936     the vertical and $\Gamma$ is the circulation about that cell.
937    
938 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
939 adcroft 1.1 {\em S/R MOM\_VI\_CALC\_RELVORT3} ({\em mom\_vi\_calc\_relvort3.F})
940    
941     $\zeta_3$: {\bf vort3} (local to {\em calc\_mom\_rhs.F})
942     \end{minipage} }
943    
944    
945     \subsubsection{Kinetic energy}
946    
947     The kinetic energy, denoted $KE$, is defined:
948     \begin{equation}
949     KE = \frac{1}{2} ( \overline{ u^2 }^i + \overline{ v^2 }^j
950     + \epsilon_{nh} \overline{ w^2 }^k )
951     \end{equation}
952    
953 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
954 adcroft 1.1 {\em S/R MOM\_VI\_CALC\_KE} ({\em mom\_vi\_calc\_ke.F})
955    
956     $KE$: {\bf KE} (local to {\em calc\_mom\_rhs.F})
957     \end{minipage} }
958    
959    
960     \subsubsection{Coriolis terms}
961    
962     The potential enstrophy conserving form of the linear Coriolis terms
963     are written:
964     \begin{eqnarray}
965     G_u^{fv} & = &
966     \frac{1}{\Delta x_c}
967     \overline{ \frac{f}{h_\zeta} }^j \overline{ \overline{ \Delta x_g h_s v }^j }^i \\
968     G_v^{fu} & = & -
969     \frac{1}{\Delta y_c}
970     \overline{ \frac{f}{h_\zeta} }^i \overline{ \overline{ \Delta y_g h_w u }^i }^j
971     \end{eqnarray}
972     Here, the Coriolis parameter $f$ is defined at vorticity (corner)
973     points.
974     \marginpar{$f$: {\bf fCoriG}}
975     \marginpar{$h_\zeta$: {\bf hFacZ}}
976    
977     The potential enstrophy conserving form of the non-linear Coriolis
978     terms are written:
979     \begin{eqnarray}
980     G_u^{\zeta_3 v} & = &
981     \frac{1}{\Delta x_c}
982     \overline{ \frac{\zeta_3}{h_\zeta} }^j \overline{ \overline{ \Delta x_g h_s v }^j }^i \\
983     G_v^{\zeta_3 u} & = & -
984     \frac{1}{\Delta y_c}
985     \overline{ \frac{\zeta_3}{h_\zeta} }^i \overline{ \overline{ \Delta y_g h_w u }^i }^j
986     \end{eqnarray}
987     \marginpar{$\zeta_3$: {\bf vort3}}
988    
989     The Coriolis terms can also be evaluated together and expressed in
990     terms of absolute vorticity $f+\zeta_3$. The potential enstrophy
991     conserving form using the absolute vorticity is written:
992     \begin{eqnarray}
993     G_u^{fv} + G_u^{\zeta_3 v} & = &
994     \frac{1}{\Delta x_c}
995     \overline{ \frac{f + \zeta_3}{h_\zeta} }^j \overline{ \overline{ \Delta x_g h_s v }^j }^i \\
996     G_v^{fu} + G_v^{\zeta_3 u} & = & -
997     \frac{1}{\Delta y_c}
998     \overline{ \frac{f + \zeta_3}{h_\zeta} }^i \overline{ \overline{ \Delta y_g h_w u }^i }^j
999     \end{eqnarray}
1000    
1001     \marginpar{Run-time control needs to be added for these options} The
1002     disctinction between using absolute vorticity or relative vorticity is
1003     useful when constructing higher order advection schemes; monotone
1004     advection of relative vorticity behaves differently to monotone
1005     advection of absolute vorticity. Currently the choice of
1006     relative/absolute vorticity, centered/upwind/high order advection is
1007     available only through commented subroutine calls.
1008    
1009 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
1010 adcroft 1.1 {\em S/R MOM\_VI\_CORIOLIS} ({\em mom\_vi\_coriolis.F})
1011    
1012     {\em S/R MOM\_VI\_U\_CORIOLIS} ({\em mom\_vi\_u\_coriolis.F})
1013    
1014     {\em S/R MOM\_VI\_V\_CORIOLIS} ({\em mom\_vi\_v\_coriolis.F})
1015    
1016     $G_u^{fv}$, $G_u^{\zeta_3 v}$: {\bf uCf} (local to {\em calc\_mom\_rhs.F})
1017    
1018     $G_v^{fu}$, $G_v^{\zeta_3 u}$: {\bf vCf} (local to {\em calc\_mom\_rhs.F})
1019     \end{minipage} }
1020    
1021    
1022     \subsubsection{Shear terms}
1023    
1024     The shear terms ($\zeta_2w$ and $\zeta_1w$) are are discretized to
1025     guarantee that no spurious generation of kinetic energy is possible;
1026     the horizontal gradient of Bernoulli function has to be consistent
1027     with the vertical advection of shear:
1028     \marginpar{N-H terms have not been tried!}
1029     \begin{eqnarray}
1030     G_u^{\zeta_2 w} & = &
1031     \frac{1}{ {\cal A}_w \Delta r_f h_w } \overline{
1032     \overline{ {\cal A}_c w }^i ( \delta_k u - \epsilon_{nh} \delta_j w )
1033     }^k \\
1034     G_v^{\zeta_1 w} & = &
1035     \frac{1}{ {\cal A}_s \Delta r_f h_s } \overline{
1036     \overline{ {\cal A}_c w }^i ( \delta_k u - \epsilon_{nh} \delta_j w )
1037     }^k
1038     \end{eqnarray}
1039    
1040 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
1041 adcroft 1.1 {\em S/R MOM\_VI\_U\_VERTSHEAR} ({\em mom\_vi\_u\_vertshear.F})
1042    
1043     {\em S/R MOM\_VI\_V\_VERTSHEAR} ({\em mom\_vi\_v\_vertshear.F})
1044    
1045     $G_u^{\zeta_2 w}$: {\bf uCf} (local to {\em calc\_mom\_rhs.F})
1046    
1047     $G_v^{\zeta_1 w}$: {\bf vCf} (local to {\em calc\_mom\_rhs.F})
1048     \end{minipage} }
1049    
1050    
1051    
1052     \subsubsection{Gradient of Bernoulli function}
1053    
1054     \begin{eqnarray}
1055     G_u^{\partial_x B} & = &
1056     \frac{1}{\Delta x_c} \delta_i ( \phi' + KE ) \\
1057     G_v^{\partial_y B} & = &
1058     \frac{1}{\Delta x_y} \delta_j ( \phi' + KE )
1059     %G_w^{\partial_z B} & = &
1060     %\frac{1}{\Delta r_c} h_c \delta_k ( \phi' + KE )
1061     \end{eqnarray}
1062    
1063 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
1064 adcroft 1.1 {\em S/R MOM\_VI\_U\_GRAD\_KE} ({\em mom\_vi\_u\_grad\_ke.F})
1065    
1066     {\em S/R MOM\_VI\_V\_GRAD\_KE} ({\em mom\_vi\_v\_grad\_ke.F})
1067    
1068     $G_u^{\partial_x KE}$: {\bf uCf} (local to {\em calc\_mom\_rhs.F})
1069    
1070     $G_v^{\partial_y KE}$: {\bf vCf} (local to {\em calc\_mom\_rhs.F})
1071     \end{minipage} }
1072    
1073    
1074    
1075     \subsubsection{Horizontal dissipation}
1076    
1077     The horizontal divergence, a complimentary quantity to relative
1078     vorticity, is used in parameterizing the Reynolds stresses and is
1079     discretized:
1080     \begin{equation}
1081     D = \frac{1}{{\cal A}_c h_c} (
1082     \delta_i \Delta y_g h_w u
1083     + \delta_j \Delta x_g h_s v )
1084     \end{equation}
1085    
1086 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
1087 adcroft 1.1 {\em S/R MOM\_VI\_CALC\_HDIV} ({\em mom\_vi\_calc\_hdiv.F})
1088    
1089     $D$: {\bf hDiv} (local to {\em calc\_mom\_rhs.F})
1090     \end{minipage} }
1091    
1092    
1093     \subsubsection{Horizontal dissipation}
1094    
1095     The following discretization of horizontal dissipation conserves
1096     potential vorticity (thickness weighted relative vorticity) and
1097     divergence and dissipates energy, enstrophy and divergence squared:
1098     \begin{eqnarray}
1099     G_u^{h-dissip} & = &
1100     \frac{1}{\Delta x_c} \delta_i ( A_D D - A_{D4} D^*)
1101     - \frac{1}{\Delta y_u h_w} \delta_j h_\zeta ( A_\zeta \zeta - A_{\zeta4} \zeta^* )
1102     \\
1103     G_v^{h-dissip} & = &
1104     \frac{1}{\Delta x_v h_s} \delta_i h_\zeta ( A_\zeta \zeta - A_\zeta \zeta^* )
1105     + \frac{1}{\Delta y_c} \delta_j ( A_D D - A_{D4} D^* )
1106     \end{eqnarray}
1107     where
1108     \begin{eqnarray}
1109     D^* & = & \frac{1}{{\cal A}_c h_c} (
1110     \delta_i \Delta y_g h_w \nabla^2 u
1111     + \delta_j \Delta x_g h_s \nabla^2 v ) \\
1112     \zeta^* & = & \frac{1}{{\cal A}_\zeta} (
1113     \delta_i \Delta y_c \nabla^2 v
1114     - \delta_j \Delta x_c \nabla^2 u )
1115     \end{eqnarray}
1116    
1117 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
1118 adcroft 1.1 {\em S/R MOM\_VI\_HDISSIP} ({\em mom\_vi\_hdissip.F})
1119    
1120     $G_u^{h-dissip}$: {\bf uDiss} (local to {\em calc\_mom\_rhs.F})
1121    
1122     $G_v^{h-dissip}$: {\bf vDiss} (local to {\em calc\_mom\_rhs.F})
1123     \end{minipage} }
1124    
1125    
1126     \subsubsection{Vertical dissipation}
1127    
1128     Currently, this is exactly the same code as the flux form equations.
1129     \begin{eqnarray}
1130     G_u^{v-diss} & = &
1131     \frac{1}{\Delta r_f h_w} \delta_k \tau_{13} \\
1132     G_v^{v-diss} & = &
1133     \frac{1}{\Delta r_f h_s} \delta_k \tau_{23}
1134     \end{eqnarray}
1135     represents the general discrete form of the vertical dissipation terms.
1136    
1137     In the interior the vertical stresses are discretized:
1138     \begin{eqnarray}
1139     \tau_{13} & = & A_v \frac{1}{\Delta r_c} \delta_k u \\
1140     \tau_{23} & = & A_v \frac{1}{\Delta r_c} \delta_k v
1141     \end{eqnarray}
1142    
1143 adcroft 1.2 \fbox{ \begin{minipage}{4.75in}
1144 adcroft 1.1 {\em S/R MOM\_U\_RVISCLFUX} ({\em mom\_u\_rviscflux.F})
1145    
1146     {\em S/R MOM\_V\_RVISCLFUX} ({\em mom\_v\_rviscflux.F})
1147    
1148     $\tau_{13}$: {\bf urf} (local to {\em calc\_mom\_rhs.F})
1149    
1150     $\tau_{23}$: {\bf vrf} (local to {\em calc\_mom\_rhs.F})
1151     \end{minipage} }

  ViewVC Help
Powered by ViewVC 1.1.22