% Running TIMCOM

\chapter{Running TIMCOM}
\label{app:running}

\section{Running an Existed Example Case}

\subsection{Global Model/Single Domain Model}

All configuration is already done, simply go to directory {\bf TIMCOMGLO/EXAMPLES/
CASE1/} and carry out:   \newline

{\bf \% ./run.sh}

\subsection{North Pacific and Taiwan Area Coupling Model}

All configuration is already done, just go to directory {\bf TIMCOMNPNT/
EXAMPLES/CASE1/} and carry out: \newline

{\bf \% ./run.sh}

\section{Running a Brand Cew Case}
\label{sec:caserun}

\subsection{Global Model(Single Domain)}

\begin{enumerate}

\item Build the working directory: \newline
  
{\bf \% cd TIMCOMGLO/EXAMPLES}

{\bf \% mkdir NEWCASE}

\item Copy the configuration files: \newline

{\bf \% cd NEWCASE}

{\bf \% cp ../BACKUP/ocn\_para.f90.bak ./ocn\_para.f90}

{\bf \% cp ../BACKUP/precfg.txt.bak ./precfg.txt}

{\bf \% cp ../BACKUP/run.sh.bak ./run.sh}

\item Prepare the configuration files: \newline

Modify {\bf ocn\_para.f90}, {\bf precfg.txt} and {\bf run.sh} to duit your 
specific requirements. Refer to \ref{sec:configure} for how to configure these 
files.

\item Execute the code: \newline

{\bf \%	./run.sh}

\end{enumerate}

\subsection{North Pacific and Taiwan Area Coupling Model (Multi-Domain)}

\bn

\item Build the working directory: \newline
  
{\bf \% cd TIMCOMNPNT/EXAMPLES}

{\bf \% mkdir NEWCASE}

\item Copy the configuration files: \newline

{\bf \% d NEWCASE}
 
{\bf \% cp ../BACKUP/ocn\_para.f90.bak ./ocn\_para.f90}

{\bf \% cp ../BACKUP/precfgm.txt.bak ./precfg.txt}

{\bf \% cp ../BACKUP/precfgs.txt.bak ./precfg.txt}

{\bf \% cp ../BACKUP/run.sh.bak ./run.sh}

\item Prepare the configuration files: \newline

Modify {\bf ocn\_para.f90}, {\bf precfg.txt} and {\bf run.sh} to suit your 
specific requirements. Refer to \ref{sec:configure} for how to configure these 
files.

\item Execute the code:

{\bf \%	./run.sh}

\en

\section{Configuration a New Case}
\label{sec:configure}

Only a simplified configuration is provided here. Please refer to 
the comments in the source code files for further detail.

\subsection{Configure "ocn\_para.f90"}

Modify the value of each parameter to suit your requirement:  \newline

\noindent PARAMETER(I0=182,J0=92,K0=31,NB0=15,NBIR=15,N0=6)

\subsection{Configure "precfg.txt"}

\#control parameters 
\&CNTRL\newline                       
TLZ=5000.E2  \newline                       
IRUN=5\newline                                  
DAODT=384.\newline
B=2.05E-4\newline
G=980.\newline
DM0=1.E6\newline
DE0=1.E6\newline
DMZ0=.01\newline
RZMX=20.\newline
TAU=60.\newline
TAUN=5.\newline
DRAG=.002\newline
FLTW=.1\newline
/\newline

Parameters which are configured by the user are classified into multiple 
namelists. Refer to appendix \ref{app:variables} for the detail of these 
parameters. In this case:

\begin{itemize}

\item TLZ=5000.E2: max depth in the model is set to $5000m$(that is, 5000.e2 
cm)

\item IRUN=5: the model will run for a five-year simulation.

\item DAODT=384.: number of time steps in each day is set to 384. For IRUN=5, 
each simulating year have 360 days, the total time steps of the model is 
$384 \times 360 \times 5$.

\end{itemize}

%\noindent\# -- Z\_linear-exponential coordinate ------------------   \newline
\noindent \&Z\_LINEAR  \newline
C=1.e-3,  \newline
D=3.e-2  \newline
/ \newline

When linear exponential $z$ coordinate is adapted, corresponding coefficients C 
and D must be specified in the namelist. \newline

%\noindent\# -- create xy\_coordinate   ------------------\newline
\noindent \&GRID\_XY \newline
DYDX=1.\newline
DXMNUT=120.\newline
Y0DEG=-70.0064\newline
WESTDEG=0.\newline
R0=6.4E8 \newline
/ \newline

Define $XY$ coordinate by the parameters in the namelist GRID\_XY.

\subsection{Configure "run.sh"}

In {\bf run.sh}, the most important is to set directories where the model code 
and climatology data reside:\newline

\noindent\#!/bin/bash  \newline
TIMCOMGLO='/home/yhtseng/RESEARCH/TIMCOMGLO'\newline
DIR\_BATHY=\$TIMCOMGLO/DATA/Etopo \newline
DIR\_WS=\$TIMCOMGLO/DATA/Hellerman  \newline
DIR\_ST=\$TIMCOMGLO/DATA/Levitus

\newpage