% Introduction

\chapter{Introduction}

This document provides the reader with the basic information necessary to carry 
out numerical simulations using TaIwan Multi-scale Community Ocean Model 
(TIMCOM). Our main goal is to provide documentation of the TIMCOM family of 
ocean models, a flexible and user friendly mathematical modeling system for 
simulating a wide variety of real and idealized ocean flows over a wide range 
of scales and boundary conditions. 

Readers having a 
background of fundamental computational fluid dynamics concepts, some basic 
fluid mechanics concepts and Fortran language knowledge shall have no problem
following this manual, which is illustrated by example applications and 
augmented by liberal comments within the model. 

\section{History of the SOMS and DieCASt Models}

TIMCOM evolved from DieCAST (Dietrich Center for Air Sea Technology) ocean 
model and DieCAST evolved from the Sandia Ocean Modeling System (SOMS) developed 
under the Department of Eneregy sponsored Subseabed Waste Disposal Program 
\citep{Dietrich87}. 

SOMS includes the following numerical features: it uses coupled thin-shell and 
free-stream sub-models; it treats boundary fluxes numerically as internal 
sources; it uses a control volume approach with staggered control volumes 
corresponding to the Arakawa `C' staggered grid; its numerical contribution in 
each direction to the diffusion coefficients is based on a user-specified 
directional cell Reynolds number and, to avoid logical decisions, this 
contribution is simply added to the user-specified nominal diffusion coefficient 
and any contribution from a turbulence closure model; it implicitly couples 
Coriolis and vertical diffusion terms; it uses a modified leap-frog time 
integration scheme and a Mellor-Yamada level-2-5 turbulence closure scheme.

The DieCAST model is a set of primitive 
equations, a ocean and lake model patterned after the SOMS, characterized by a 
$Z$-level stretched vertical coordinate, and by a horizontal grid based on 
spherical coordinates with non-uniform latitudinal increments. The original 
model is hydrostatic, incompressible, rigid-lid, partially 
implicit, and fully conservative. The numerical differences from the SOMS model 
stem only from using a collocated, non-staggered Arakawa `A' grid instead of the 
staggered Arakawa `C' grid used by 
SOMS. The DieCAST model is simpler and requires less computation per time step 
than the SOMS model. It is also stable with substantially longer time step.

Both DieCAST and SOMS use higher order treatment of the generally dominat terms 
in ocean dynamics, i.e. pressure gradient and Coriolis. This leads to accurate 
and robust (stable with realistically small dissipation) models. In the latest 
version, the model includes the non-hydrostatic, free-surface, immersed boundary 
method (IBM) and two-ways coupling capabilities \citep{Tseng03a}.

An improved version of DieCAST is the CANDIE model, which stands for
`CANadian version of DIEcast' \citep{Sheng98}. Both `A' grid and `C' grid 
version of CANDIE exist. A useful added feature of CANDIE is partial bottom 
cells for more accurate representation of bathymetry. The difference between
the `A' grid and `C' grid is illustrated in Figure~\ref{fig:A_C_Grid}.

\begin{figure}[htbp]
\centerline{\scalebox{.4}{\includegraphics{FIGS/A_C_Grid.eps}}}
\caption{The difference between the Arakawa `A' grid and `C' grid, taking
a 2-D domain for example. Q may be any physical quantity, such as salinity
or pressure. For the `A' grid configuration, $Q$ is collocated with the 
$X$ and $Y$ velocity components, which are $u$ and $v$, respectively,
in a computational grid. But for the case of `C' grid, $u$ and $v$ are staggered
while $Q$ is "interleaved" between $u$ and $v$. Theoretically, different grid
configurations should give the same computation result, provided the 
numerical methods are well formulated and laws of conservation satisfied.
However, interpolation might be involved depending on the discretization
procedures. }
\label{fig:A_C_Grid}
\end{figure}

\section{TIMCOM and New Features}

As one of the decendents of DieCAST like CANDIE, TIMCOM is a robust, efficient, 
accurate family of models using fourth order accurate approximations for all 
significant steps in the solution procedure, in a collocated Arakawa `A' grid 
control volume framework.This includes rigorously fourth-order-accurate 
derivation of control volume face 
averages from the fundamental control volume averages of the conserved 
quantities (momentum, salt, heat and other quantities such as oxygen that may 
be needed for a particular problem). 

\subsection{Features of TIMCOM}

From the programming aspect, TIMCOM has the following improvement over DieCAST:

\begin{itemize}

\item Programming language. DieCAST is written in Fortran 77 while TIMCOM
is in Fortran 90, with improved readability and cleaner coding layout. Flow
control such as looping is done in a better manner as well.

\item Coding structure. Though both models are made up of multiple source
files, DieCAST is spread over multiple subprograms, TIMCOM contains 
only one main program which controls all processes, with higher efficiency.

\item Source code compiling. The subprograms of DieCAST are compiled 
individually, while the compile of TIMCOM is controlled and 
maintained with Makefile, making compiling more easily and less tedious.

\item Variables declaration. Most of the important variable declarations 
in DieCAST are duplicated in different source codes for data exchange. This
may cause confusion and programming error easily. TIMCOM puts variables
in modules such that they could be easily shared and accessed by the program.

\item User interface. If users are going to simulate a specified case
according to their requirements, they have to modify the source code
directly and recompile the source code most of the time. TIMCOM makes
customization simple by storing configurable options in plain text files.

\end{itemize}

\noindent As a numerical model, TIMCOM has its own strength:

\begin{itemize}

\item Full spherical metrics with variable grid increments.

\item A standard nonlinear equation of state relating in-situ density to 
potential temperature, salinity and pressure-depth. 

\item 3-D turbulent vertical diffusivity arrays, In the SOMS model from which 
TIMCOM evolved, these were determined by computation- and storage- intensive 
Mellor-Yamada level 2.5 turbulence closure~\citep{Dietrich87}; the present 
default is the~\citet{Pacanowski81} approach; the model user may apply 
any alternate preferred scheme. 

\item 3-D turbulent horizontal diffusivity arrays. Although no diffusive 
turbulence 
parameterization is deemed effective for horizontal Reynolds stress 
representation in general, these arrays are available for numerical and 
weakly physical based usages. 

\item Free surface. An explicit time-split free surface version exists 
(available under license) 
that integrates interlaced Leap-Frog shallow water equations using multiple 
`fast mode' time steps each `slow mode' time step; this version addresses fast 
free surface modes (tides, wind surge events, etc) and is efficient, accurate 
and robust, including vertically averaged baroclinic pressure gradient and 
momentum flux forcings. The motivation for this is the first derivative coupling 
of different fields, similar to the motivation for spatial grids. 

For efficiency in general circulation (slow mode) applications, TIMCOM uses a 
rigid-lid approximation. 

%Incidentally, the shallow water equations are a one-layer application of sigma 
%coordinates. They are useful for the `fast modes' of ocean dynamics. Generally, 
%these fast modes have only a very minor effect on the ocean `slow modes' that 
%dominate ocean material trajectories and general circulation, other than perhaps 
%turbulent dissipation from breaking wave effects in localized coastal regions. 
%The extent to which such localized dissipation affects the general circulation, 
%and thus climate, is not well understood, but short term local effects are quite 
%small. 

%Thus, a general circulation model may run independently, creating vertically 
%averaged baroclinic pressure gradients and fluctuation correlations that may be 
%used by a more specialized free surface `fast mode' model, while ignoring at 
%least short term feedbacks from the barotropic mode (shallow water equations 
%solution) to the baroclinic mode. Thus, models using the rigid-lid approximation 
%can be quite useful, as proven by their many demonstrated successes in general 
%circulation studies. 

\item Non-hydrostatic approximation. 
The basic model features incompressible, Boussinesq and hydrostatic 
approximations, but non-hydrostatic approximation is also incorporated
into the model.
For basic methodology, see~\citet{Dietrich02} and~\citet{Tseng03} 
for the numerical procedure. Model details available under licensing agreement.

\item A new surface flux boundary treatment, which does not 
damp transients and gives rapid convergence to ensemble average annual cycle 
climatology\citep{Dietrich04a} and may be used in combination with 
synoptic wind and surface flux forcing.

\item Grid coupling. Both multiple gridded one- and two-way grid coupling
are supported. 
See~\citet{Dietrich04a} for basic methodology and results from application 
to North Atlantic Ocean. Model details available under licensing agreement.

\end{itemize}

\subsection{Other Advanced Features under Developing}

\begin{itemize}

\item Turbulence parameterization options 

\item Bio-geochemistry dynamics

\item Immersed boundary methods for topography( to be supported by 2010)

\item Lagrangian tracers releases capacity

\item Hindcast wind forcing capability

\item New data and code structures, NetCDF and customized I/O interface

\item Ensemble simulation capability

\end{itemize} 

\section{Relative Web Links}

Reader who are interested in detail description and user's guide of the DieCAST
and CANDIE models could refer to the following website: 

\begin{description}

\item[DieCAST]: {\it http://efdl.as.ntu.edu.tw/research/diecast/index.html} 

\item[CANDIE]: {\it http://www.phys.ocean.dal.ca/programs/CANDIE/}

\end{description}

\newpage