10 |
terms are described first, afterwards the schemes that apply to |
terms are described first, afterwards the schemes that apply to |
11 |
passive and dynamically active tracers are described. |
passive and dynamically active tracers are described. |
12 |
|
|
13 |
|
\input{s_algorithm/text/notation} |
14 |
|
|
15 |
\section{Time-stepping} |
\section{Time-stepping} |
16 |
\begin{rawhtml} |
\begin{rawhtml} |
74 |
|
|
75 |
\begin{figure} |
\begin{figure} |
76 |
\begin{center} |
\begin{center} |
77 |
\resizebox{4.0in}{!}{\includegraphics{part2/pressure-method-rigid-lid.eps}} |
\resizebox{4.0in}{!}{\includegraphics{s_algorithm/figs/pressure-method-rigid-lid.eps}} |
78 |
\end{center} |
\end{center} |
79 |
\caption{ |
\caption{ |
80 |
A schematic of the evolution in time of the pressure method |
A schematic of the evolution in time of the pressure method |
198 |
Fig.~\ref{fig:call-tree-pressure-method}. |
Fig.~\ref{fig:call-tree-pressure-method}. |
199 |
|
|
200 |
|
|
201 |
|
%\paragraph{Need to discuss implicit viscosity somewhere:} |
202 |
\paragraph{Need to discuss implicit viscosity somewhere:} |
In general, the horizontal momentum time-stepping can contain some terms |
203 |
|
that are treated implicitly in time, |
204 |
|
such as the vertical viscosity when using the backward time-stepping scheme |
205 |
|
(\varlink{implicitViscosity}{implicitViscosity} {\it =.TRUE.}). |
206 |
|
The method used to solve those implicit terms is provided in |
207 |
|
section \ref{sect:implicit-backward-stepping}, and modifies |
208 |
|
equations \ref{eq:discrete-time-u} and \ref{eq:discrete-time-v} to |
209 |
|
give: |
210 |
\begin{eqnarray} |
\begin{eqnarray} |
211 |
\frac{1}{\Delta t} u^{n+1} - \partial_z A_v \partial_z u^{n+1} |
u^{n+1} - \Delta t \partial_z A_v \partial_z u^{n+1} |
212 |
+ g \partial_x \eta^{n+1} & = & \frac{1}{\Delta t} u^{n} + |
+ \Delta t g \partial_x \eta^{n+1} & = & u^{n} + \Delta t G_u^{(n+1/2)} |
|
G_u^{(n+1/2)} |
|
213 |
\\ |
\\ |
214 |
\frac{1}{\Delta t} v^{n+1} - \partial_z A_v \partial_z v^{n+1} |
v^{n+1} - \Delta t \partial_z A_v \partial_z v^{n+1} |
215 |
+ g \partial_y \eta^{n+1} & = & \frac{1}{\Delta t} v^{n} + G_v^{(n+1/2)} |
+ \Delta t g \partial_y \eta^{n+1} & = & v^{n} + \Delta t G_v^{(n+1/2)} |
216 |
\end{eqnarray} |
\end{eqnarray} |
217 |
|
|
218 |
|
|
251 |
\label{eq:discrete-time-backward-free-surface} |
\label{eq:discrete-time-backward-free-surface} |
252 |
\end{equation} |
\end{equation} |
253 |
where the use of flow at time level $n+1$ makes the method implicit |
where the use of flow at time level $n+1$ makes the method implicit |
254 |
and backward in time. The is the preferred scheme since it still |
and backward in time. This is the preferred scheme since it still |
255 |
filters the fast unresolved wave motions by damping them. A centered |
filters the fast unresolved wave motions by damping them. A centered |
256 |
scheme, such as Crank-Nicholson, would alias the energy of the fast |
scheme, such as Crank-Nicholson (see section \ref{sect:freesurf-CrankNick}), |
257 |
modes onto slower modes of motion. |
would alias the energy of the fast modes onto slower modes of motion. |
258 |
|
|
259 |
As for the rigid-lid pressure method, equations |
As for the rigid-lid pressure method, equations |
260 |
\ref{eq:discrete-time-u}, \ref{eq:discrete-time-v} and |
\ref{eq:discrete-time-u}, \ref{eq:discrete-time-v} and |
285 |
the flow to be divergent and for the surface pressure/elevation to |
the flow to be divergent and for the surface pressure/elevation to |
286 |
respond on a finite time-scale (as opposed to instantly). To recover |
respond on a finite time-scale (as opposed to instantly). To recover |
287 |
the rigid-lid formulation, we introduced a switch-like parameter, |
the rigid-lid formulation, we introduced a switch-like parameter, |
288 |
$\epsilon_{fs}$, which selects between the free-surface and rigid-lid; |
$\epsilon_{fs}$ (\varlink{freesurfFac}{freesurfFac}), |
289 |
|
which selects between the free-surface and rigid-lid; |
290 |
$\epsilon_{fs}=1$ allows the free-surface to evolve; $\epsilon_{fs}=0$ |
$\epsilon_{fs}=1$ allows the free-surface to evolve; $\epsilon_{fs}=0$ |
291 |
imposes the rigid-lid. The evolution in time and location of variables |
imposes the rigid-lid. The evolution in time and location of variables |
292 |
is exactly as it was for the rigid-lid model so that |
is exactly as it was for the rigid-lid model so that |
324 |
\end{tabbing} \end{minipage} } \end{center} |
\end{tabbing} \end{minipage} } \end{center} |
325 |
\caption{ |
\caption{ |
326 |
Calling tree for the Adams-Bashforth time-stepping of temperature with |
Calling tree for the Adams-Bashforth time-stepping of temperature with |
327 |
implicit diffusion.} |
implicit diffusion. |
328 |
|
(\filelink{THERMODYNAMICS}{model-src-thermodynamics.F}, |
329 |
|
\filelink{ADAMS\_BASHFORTH2}{model-src-adams_bashforth2.F})} |
330 |
\label{fig:call-tree-adams-bashforth} |
\label{fig:call-tree-adams-bashforth} |
331 |
\end{figure} |
\end{figure} |
332 |
|
|
357 |
and forcing evolves smoothly. Problems can, and do, arise when forcing |
and forcing evolves smoothly. Problems can, and do, arise when forcing |
358 |
or motions are high frequency and this corresponds to a reduced |
or motions are high frequency and this corresponds to a reduced |
359 |
stability compared to a simple forward time-stepping of such terms. |
stability compared to a simple forward time-stepping of such terms. |
360 |
The model offers the possibility to leave the forcing term outside the |
The model offers the possibility to leave the tracer and momentum |
361 |
Adams-Bashforth extrapolation, by turning off the logical flag |
forcing terms and the dissipation terms outside the |
362 |
{\bf forcing\_In\_AB } (parameter file {\em data}, namelist {\em PARM01}, |
Adams-Bashforth extrapolation, by turning off the logical flags |
363 |
default value = True). |
\varlink{forcing\_In\_AB}{forcing_In_AB} |
364 |
|
(parameter file {\em data}, namelist {\em PARM01}, default value = True). |
365 |
|
(\varlink{tracForcingOutAB}{tracForcingOutAB}, default=0, |
366 |
|
\varlink{momForcingOutAB}{momForcingOutAB}, default=0) |
367 |
|
and \varlink{momDissip\_In\_AB}{momDissip_In_AB} |
368 |
|
(parameter file {\em data}, namelist {\em PARM01}, default value = True). |
369 |
|
respectively. |
370 |
|
|
371 |
A stability analysis for an oscillation equation should be given at this point. |
A stability analysis for an oscillation equation should be given at this point. |
372 |
\marginpar{AJA needs to find his notes on this...} |
\marginpar{AJA needs to find his notes on this...} |
374 |
A stability analysis for a relaxation equation should be given at this point. |
A stability analysis for a relaxation equation should be given at this point. |
375 |
\marginpar{...and for this too.} |
\marginpar{...and for this too.} |
376 |
|
|
377 |
|
\begin{figure} |
378 |
|
\begin{center} |
379 |
|
\resizebox{5.5in}{!}{\includegraphics{s_algorithm/figs/oscil+damp_AB2.eps}} |
380 |
|
\end{center} |
381 |
|
\caption{ |
382 |
|
Oscillatory and damping response of |
383 |
|
quasi-second order Adams-Bashforth scheme for different values |
384 |
|
of the $\epsilon_{AB}$ parameter (0., 0.1, 0.25, from top to bottom) |
385 |
|
The analytical solution (in black), the physical mode (in blue) |
386 |
|
and the numerical mode (in red) are represented with a CFL |
387 |
|
step of 0.1. |
388 |
|
The left column represents the oscillatory response |
389 |
|
on the complex plane for CFL ranging from 0.1 up to 0.9. |
390 |
|
The right column represents the damping response amplitude |
391 |
|
(y-axis) function of the CFL (x-axis). |
392 |
|
} |
393 |
|
\label{fig:adams-bashforth-respons} |
394 |
|
\end{figure} |
395 |
|
|
396 |
|
|
397 |
|
|
398 |
\section{Implicit time-stepping: backward method} |
\section{Implicit time-stepping: backward method} |
399 |
|
\label{sect:implicit-backward-stepping} |
400 |
\begin{rawhtml} |
\begin{rawhtml} |
401 |
<!-- CMIREDIR:implicit_time-stepping_backward: --> |
<!-- CMIREDIR:implicit_time-stepping_backward: --> |
402 |
\end{rawhtml} |
\end{rawhtml} |
451 |
|
|
452 |
\begin{figure} |
\begin{figure} |
453 |
\begin{center} |
\begin{center} |
454 |
\resizebox{5.0in}{!}{\includegraphics{part2/adams-bashforth-sync.eps}} |
\resizebox{5.0in}{!}{\includegraphics{s_algorithm/figs/adams-bashforth-sync.eps}} |
455 |
\end{center} |
\end{center} |
456 |
\caption{ |
\caption{ |
457 |
A schematic of the explicit Adams-Bashforth and implicit time-stepping |
A schematic of the explicit Adams-Bashforth and implicit time-stepping |
571 |
|
|
572 |
\begin{figure} |
\begin{figure} |
573 |
\begin{center} |
\begin{center} |
574 |
\resizebox{5.5in}{!}{\includegraphics{part2/adams-bashforth-staggered.eps}} |
\resizebox{5.5in}{!}{\includegraphics{s_algorithm/figs/adams-bashforth-staggered.eps}} |
575 |
\end{center} |
\end{center} |
576 |
\caption{ |
\caption{ |
577 |
A schematic of the explicit Adams-Bashforth and implicit time-stepping |
A schematic of the explicit Adams-Bashforth and implicit time-stepping |
645 |
(\theta^*,S^*) & = & (\theta^{n},S^{n}) + \Delta t G_{\theta,S}^{(n+1/2)} |
(\theta^*,S^*) & = & (\theta^{n},S^{n}) + \Delta t G_{\theta,S}^{(n+1/2)} |
646 |
\label{eq:tstar-staggered} \\ |
\label{eq:tstar-staggered} \\ |
647 |
(\theta^{n+1},S^{n+1}) & = & {\cal L}^{-1}_{\theta,S} (\theta^*,S^*) |
(\theta^{n+1},S^{n+1}) & = & {\cal L}^{-1}_{\theta,S} (\theta^*,S^*) |
648 |
\label{eq:t-n+1-staggered} \\ |
\label{eq:t-n+1-staggered} |
649 |
\end{eqnarray} |
\end{eqnarray} |
650 |
The corresponding calling tree is given in |
The corresponding calling tree is given in |
651 |
\ref{fig:call-tree-adams-bashforth-staggered}. |
\ref{fig:call-tree-adams-bashforth-staggered}. |
728 |
\frac{1}{\Delta t} v^{n+1} + g \partial_y \eta^{n+1} + \partial_y \phi_{nh}^{n+1} |
\frac{1}{\Delta t} v^{n+1} + g \partial_y \eta^{n+1} + \partial_y \phi_{nh}^{n+1} |
729 |
& = & \frac{1}{\Delta t} v^{n} + G_v^{(n+1/2)} \label{eq:discrete-time-v-nh} \\ |
& = & \frac{1}{\Delta t} v^{n} + G_v^{(n+1/2)} \label{eq:discrete-time-v-nh} \\ |
730 |
\frac{1}{\Delta t} w^{n+1} + \partial_r \phi_{nh}^{n+1} |
\frac{1}{\Delta t} w^{n+1} + \partial_r \phi_{nh}^{n+1} |
731 |
& = & \frac{1}{\Delta t} w^{n} + G_w^{(n+1/2)} \label{eq:discrete-time-w-nh} \\ |
& = & \frac{1}{\Delta t} w^{n} + G_w^{(n+1/2)} \label{eq:discrete-time-w-nh} |
732 |
\end{eqnarray} |
\end{eqnarray} |
733 |
which must satisfy the discrete-in-time depth integrated continuity, |
which must satisfy the discrete-in-time depth integrated continuity, |
734 |
equation~\ref{eq:discrete-time-backward-free-surface} and the local continuity equation |
equation~\ref{eq:discrete-time-backward-free-surface} and the local continuity equation |
832 |
\begin{eqnarray} |
\begin{eqnarray} |
833 |
{\eta}^* = \epsilon_{fs} \: {\eta}^{n} - |
{\eta}^* = \epsilon_{fs} \: {\eta}^{n} - |
834 |
\Delta t {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o} \vec{\bf v}^* dr |
\Delta t {\bf \nabla}_h \cdot \int_{R_{fixed}}^{R_o} \vec{\bf v}^* dr |
835 |
\: + \: \epsilon_{fw} \Delta_t (P-E)^{n} |
\: + \: \epsilon_{fw} \Delta t (P-E)^{n} |
836 |
\label{eq-solve2D_rhs} |
\label{eq-solve2D_rhs} |
837 |
\end{eqnarray} |
\end{eqnarray} |
838 |
|
|
839 |
\fbox{ \begin{minipage}{4.75in} |
\fbox{ \begin{minipage}{4.75in} |
840 |
{\em S/R SOLVE\_FOR\_PRESSURE} ({\em solve\_for\_pressure.F}) |
{\em S/R SOLVE\_FOR\_PRESSURE} ({\em solve\_for\_pressure.F}) |
841 |
|
|
842 |
$u^*$: {\bf GuNm1} ({\em DYNVARS.h}) |
$u^*$: {\bf gU} ({\em DYNVARS.h}) |
843 |
|
|
844 |
$v^*$: {\bf GvNm1} ({\em DYNVARS.h}) |
$v^*$: {\bf gV} ({\em DYNVARS.h}) |
845 |
|
|
846 |
$\eta^*$: {\bf cg2d\_b} (\em SOLVE\_FOR\_PRESSURE.h) |
$\eta^*$: {\bf cg2d\_b} (\em SOLVE\_FOR\_PRESSURE.h) |
847 |
|
|
851 |
|
|
852 |
|
|
853 |
Once ${\eta}^{n+1}$ has been found, substituting into |
Once ${\eta}^{n+1}$ has been found, substituting into |
854 |
\ref{eq:discrete-time-u,eq:discrete-time-v} yields $\vec{\bf v}^{n+1}$ if the model is |
\ref{eq:discrete-time-u}, \ref{eq:discrete-time-v} yields $\vec{\bf v}^{n+1}$ |
855 |
hydrostatic ($\epsilon_{nh}=0$): |
if the model is hydrostatic ($\epsilon_{nh}=0$): |
856 |
$$ |
$$ |
857 |
\vec{\bf v}^{n+1} = \vec{\bf v}^{*} |
\vec{\bf v}^{n+1} = \vec{\bf v}^{*} |
858 |
- \Delta t {\bf \nabla}_h b_s {\eta}^{n+1} |
- \Delta t {\bf \nabla}_h b_s {\eta}^{n+1} |
893 |
|
|
894 |
$\eta^{n+1}$: {\bf etaN} (\em DYNVARS.h) |
$\eta^{n+1}$: {\bf etaN} (\em DYNVARS.h) |
895 |
|
|
896 |
$\phi_{nh}^{n+1}$: {\bf phi\_nh} (\em DYNVARS.h) |
$\phi_{nh}^{n+1}$: {\bf phi\_nh} (\em NH\_VARS.h) |
897 |
|
|
898 |
$u^*$: {\bf GuNm1} ({\em DYNVARS.h}) |
$u^*$: {\bf gU} ({\em DYNVARS.h}) |
899 |
|
|
900 |
$v^*$: {\bf GvNm1} ({\em DYNVARS.h}) |
$v^*$: {\bf gV} ({\em DYNVARS.h}) |
901 |
|
|
902 |
$u^{n+1}$: {\bf uVel} ({\em DYNVARS.h}) |
$u^{n+1}$: {\bf uVel} ({\em DYNVARS.h}) |
903 |
|
|