\documentstyle[epsf,subfigure,epsfig,graphicx,psfig,12pt]{article}
\pagestyle{plain}
\parskip .1in
%
\def\bi{\begin{itemize}}
\def\ei{\end{itemize}}
\def\be{\begin{equation}}
\def\ee{\end{equation}}
\def\ben{\begin{enumerate}}
\def\een{\end{enumerate}}
\def\bc{\begin{center}}
\def\ec{\end{center}}
\def\hs{\hspace{5pt}}
\def\grad{\nabla}
\def\div{\nabla\cdot}
\def\curl{\nabla\times}
\dfrac{\dfrac{}{}}{}\def\epsfc{\centering\leavevmode\epsfbox}
\def\bd{\begin{description}}
\def\ed{\end{description}}
\def\bea{\begin{eqnarray}}
\def\eea{\end{eqnarray}}
\def\d{\partial}
%
\def\ni{\noindent}
\textwidth6.5in
\textheight8.0in
\hoffset          0.in
\voffset          0.in
\topmargin        0.in
\oddsidemargin    0.in
\evensidemargin   0.in
\setcounter{secnumdepth}{0}
%
%================================================
%
\def\nopagenumber{\thispagestyle{empty}}
\def\refshape{\vskip12truept\parindent=0.0cm\hangindent=2em\hangafter=1\indent}
\def\newpage{\vfill\eject}
\def\epsfc{\centering\leavevmode\epsfbox}
%
%================================================
%
\begin{document}
\bc
\LARGE
OACI 1.0 Users' Guide
\\
$ ~ $ \\
\normalsize
%\LarSeveral ge
Keston Smith
\\
%\normalsize
Dartmouth College, Hanover NH USA 03755
\\
$~$
NML-03-09\\
7 July 2003\\
updated 7 April 2004\\
\ec


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\ni {\large\bf Overview}
\begin{flushleft}

\ni OACI (Objective Analysis for Circulation Initialization) is a simple three dimensional implementation of Objective Analysis.  The software interpolates the residual (unstructured data-prior estimate of 3D field) onto the three dimensional nodes of a mesh which consists of triangular finite elements in the horizontal with sigma layers vertically.  The software is intended to provide an efficient tool for estimating initial density conditions for three dimensional finite element circulation models from a prior estimate of the three dimensional bacground climatological field and sparse observations. 

\vspace{1cm}
\ni {\large\bf Data}

\ni The observatons are given in a data file conforming to the .mir3d specification (see appendix 1).  This is a data standard which provides an "instrument number" and estimate of the measurement error variance in addition to a measured value and the location of the measurement.   The .mir3d format allows realistic observational covariance to be constructed when different instruments (i.e AVHRR, insitu CTD data, moored observations, global model output) are used together in the objective analysis.  In particular one can implement a model with indepent observational errors for differnet instruments.  The prior estimate of the field, $\bar u$, is specified in a .s3r file.


\vspace{1cm}
\ni {\large\bf Objective Analysis}

\ni The interpolation in any objective analysis relies on the specification of two covariances. The user must supply covariance functions for the observational error as well as the covariance for perturbations from the background state (model error covariance).  These covariances are needed to compute the vector of optimal linear weights, $\lambda^j$, for the interpolation to node j:

\be
\lambda^j = C_{u_j u}H^T (H C_{uu} H^T + W )^{-1}
\ee

\ni where:
\bi 
\item $d$ is the vector of observations. 
\item $H$ is the measurement operator (interpolation function) for the observations $d$.
\item $W$ is the observational error covariance matrix (This must be assigned by user subroutine { \it obsercov} ).
\item $C_{uu}$ is the error covariance matrix for the background state (eg. covariance of perturbations from climatology):
$[C_{uu}]_{ij}=E[(u_i - \bar{u_i} )(u_j - \bar{u_j} )]$.
\item $C_{u_j u}$ is the $j^{th}$ row of $C_{u u}$. 
\linebreak
\linebreak
\ni $C_{uu}$ must be assigned in user subroutine {\it modelcov}.  The optimal linear estimate is then:
\be
\hat {u_j} = u_j + \lambda^j \cdot (d - H u)  .
\ee
  The variance of the posterior estimate is given by 
\be
v_{\hat {u_j}} = v_{u_j} - \lambda^j \cdot (H C_{u_j u}),
\ee
where $v_{u_j}$ is the prior error variance for the background state at node j.
\vspace{1cm}

\ni {\large\bf Data selection}
\linebreak
\ni In general one will have too many observations to perform the objective analysis calculation globally, thus a means of locally subsampling the observations is needed. At a given horizontal mesh node, for each vertical sigma layer, the same data points are used in the interpolation.  The closest (under the metric defined by user function {\it pdist}) $nlobsdim$ data points to each horizontal node are used in the interpolation to each sigma layer at that node.

\vspace{1cm}

\ni {\large\bf Input Files}

\ni In addition to files specifying the mesh geometry there are three ascii input files:
\bi
\item oaci.dim contains the dimensioning parameters for mesh, data and inversion.  This must provide the following 5 dimensioning parameters\\
  -nndim = max number of nodes\\
  -nedim = max number of elements\\
  -nnvdim = max number of vertical sigma coordinates\\
  -nddim = max number of data points\\
  -nlobsdim = max number of data points used in each inversion\\

\item oaci.inp must contain the mesh name, the 2 data file names (prior estimate of field and the data),
\ei
plus names of all output files. The format follows:
\linebreak
\linebreak
line 1: Mesh name \linebreak  
line 2: prior estimate .s3r file name \linebreak  
line 3: observation .mir3d file name for observation \linebreak  
line 4: base horizontal search radius for data points to use in the OA \linebreak  
line 5: year day of the interpolation (same year relative to .mir3d is assumed) \linebreak  
line 6: name of .s3r file to write the interpolated residual field to. \linebreak  
line 7: name of .s3r file to write the posterior error variance field to. \linebreak  
line 8: name of .s3r file to write the analysis field to. \linebreak  
\linebreak
\linebreak
note that lines 6 to 8 are specific to user subroutine oaciout.  An example oaci.inp file is provided with the distribution.
\linebreak

\item The user must provide the .s3r file with the prior field estimate.



\vspace{1cm}
\ni {\large \bf Refrences}
Cressie, Noel A.C. {\it Statistics for Spatial Data}. Wiley series in Probability and applied Mathematics, Wiley 1993.

\vspace{1cm}
\ni {\large \bf Appendix 1: .mir3d format}

A .mir3d file consists of any number of lines with the following format:

\item Line 1:comment
\item Line 2:year
\item line 3-Nobs+2:yearday x y z f s i
\\
where :
\item yearday is the year day of the observation {\bf UTC0}
\item x is the cartesian x coordinate of the observation (m)
\item y is the cartesian y coordinate of the observation (m)
\item z is the cartesian z coordinate of the observation (m) (negative is down)
\item f is the measured value of the field at (yearday,x,y,z)
\item s is the  standard deviation of the measurement error
\item i is the integer instrument number
\\


\vspace{1cm}
\ni {\large \bf Appendix 2: Test case}
\\
A test case is provided to demonstrate the software. The test case interpolates a series of SST images from 5 days onto the $gala$ mesh with 21 vertical sigma levels.    Sample output can be found in the sampleoutput directory.  The sst data is contained in the file obs/sst.mir3d.  The prior estimate for the interpolation is contained in obs/ICS.T.s3r. To test the code:
\\
\item edit oaci/src/makefile for your architecture ({\it requires Lapack}).

\item cd src
%\ei
\item make
\item cd ../
\item src/oaci
\\
This should generate the following output files:
\\
\item residual.dat (data -prior estimate)
\item residual.s3r (interpolated data-climatology mifit)
\item variance.s3r (Posterior error variance)
\item analysis.s3r (Posterior estimate of temperature field)
\\

 Run time for this test case on a 2 processor 2GHz AMD Opteron 
computer was 40 seconds.

\end{document}




