## 1. Introduction

The coastal ocean has a number of unique physical and meteorological processes that promote high biological productivity, active sedimentary processes, dynamic chemical transformations, and intense air–sea interactions. In addition to being an area of great scientific interest, the coastal ocean is important for a number of economic reasons, including recreation, coastal development, mineral extraction, and fisheries. As the population and various activities in the coastal region increase, real-time monitoring and forecasting become increasingly important.

In response to its scientific and economic importance, there are ongoing efforts in the federal and state government to establish a network of coastal ocean observing systems that will suit both research and operational needs (National Research Council 2003). As a consequence, we have been seeing an explosive development of new observational tools and platforms. Development in satellite oceanography provides unprecedented views of the ocean with increasing resolutions and accuracy, coupled with capabilities of measuring new variables (e.g., sea surface salinity). We also envision a new generation of in situ observations, ranging from autonomous instruments and probes to cabled observatories. Shore-based high-frequency (HF) radars provide spatially and temporally continuous sea surface velocity maps. Coastal oceanography is in a rapid transition from an era of exploratory mapping and sampling to one of real-time observing systems.

Real-time observing systems make it possible to develop predictive numerical modeling systems that will routinely provide coastal oceanic “weather” predictions, as today’s meteorological models routinely provide numerical weather predictions for the atmosphere. A predictive modeling system requires two basic components: an advanced numerical model and real-time data assimilation system (Kalnay 2003). During the last two decades, coastal ocean modeling has greatly advanced. Data assimilation, which integrates data from observing systems into models, has also been extensively investigated (e.g., Wunsch 1996; Bennett 1997). From the beginning of the 1990s, major meteorological centers around the world have operationally implemented advanced data assimilation systems. These include three- and four-dimensional variational data assimilation (3DVAR and 4DVAR) methods (e.g., Parrish and Derber 1992; Cohn et al. 1998; Courtier et al. 1998; Rabier et al. 1998a; Moore et al. 2004; DiLorenzo et al. 2007) and the Kalman filter method (e.g., Fukumori et al. 1999; Lermusiaux and Robinson 1999). The progress made in coastal ocean science during the last two decades has laid a sound scientific foundation for the development of advanced real-time coastal ocean data assimilation systems similar to the ones meteorological centers have been using on a routine basis.

In this paper we present a theoretical framework of a 3DVAR algorithm within the framework of the Regional Ocean Modeling System (ROMS) (Shchepetkin and McWilliams 2003, 2005; Marchesiello et al. 2001, 2003).

We chose to implement 3DVAR for the following reasons: first, it has been widely adopted for operational use in meteorological centers and proved to be a reliable algorithm; second, it is computationally efficient enough to serve as part of an operational system that focuses on coastal oceans and has time scales of hours to days; third, it is flexible enough to incorporate nonstandard measurements; and, fourth, it is the soundest path to the ultimate development of more advanced data assimilation systems, such as the Kalman filter (e.g., Fisher et al. 2006; Li and Navon 2001) and 4DVAR (e.g., Daley and Barker 2001).

ROMS3DVAR was developed as an operational data assimilation system similar to those implemented in major meteorological centers and thus possesses the following capabilities: first, it generates initial conditions that ROMS uses to predict future coastal oceanic states; second, it provides basic analyzed fields for various users, including oceanic forecasters and the public; and, third, it produces datasets for various diagnostic analyses, such as those used for health monitoring. ROMS3DVAR also has the capability of being used as a numerical test bed for the evaluation and assessment of new types of measurements. ROMS3DVAR was developed to maximize flexibility and stability in assimilating different types of new measurements. For example, it allows simultaneous assimilation of measurements ranging from radial velocities from HF radars (Paduan and Graber 1997) to radiance from satellite-flown remote sensing instruments. Moreover, assimilation of chemical and biological quantities can be formulated as an extension of the physical quantities. For example, biological concentrations can be treated in the same way as salinity.

We here present the formulation of ROMS3DVAR. ROMS3DVAR has been implemented in the coastal regions off central California (http://ourocean.jpl.nasa.gov/MB06) and in the Southern California Bight (http://ourocean.jpl.nasa.gov/SCB) as an operational system. The implementation and basic assessment of the system are described in Li et al. (2008), and the evaluation of this system off central California is reported in Chao et al. (2008, manuscript submitted to *Deep-Sea Res*.).

This paper is organized as follows: sections 2 and 3 present the basic formulation of ROMS3DVAR. Section 3 details the particular formulation of the dynamic constraints. Section 4 is dedicated to the estimation and modeling of error covariance, especially the Kronecker product–based algorithms proposed for model error correlations. In section 5, the minimization method is addressed, and a sophisticated procedure for reconditioning cost functions is described. Section 6 gives a summary.

## 2. Three-dimensional variational data assimilation

In this section, we will describe the basic formulation of ROMS3DVAR. We will follow the notation conventions suggested by Ide et al. (1997). Vectors will be represented by boldface lowercase letters, and matrices by sans serif uppercase Roman and Greek letters. Also, the superscript “*f*” stands for forecast, the superscript “*a*” for analysis, the superscript “*t*” for truth, the superscript “T” for matrix transpose, and the symbol 〈·〉 for mathematical expectation.

The formulation presented in this paper will involve only the physical components of ROMS for simplicity, though ROMS has chemical, biological, and other components. The physical variables in ROMS are sea surface height (SSH) *ζ*, horizontal velocity components *u* and *υ,* temperature *T,* and salinity *S.*

*ζ*,

*u*,

*υ*,

*T*, and

*S*at the model grid points. We use

**x**

*,*

_{u}**x**

*,*

_{υ}**x**

*,*

_{T}**x**

*, and*

_{s}**x**

*for the model state along with*

_{ζ}*N*,

_{u}*N*,

_{υ}*N*,

_{T}*N*, and

_{S}*N*for their dimensions as denoted by the corresponding subscript. For convenience, we organize them into three groups:

_{ζ}**x**

*,*

_{ζ}**x**

_{uυ}= (

**x**

^{T}

_{u},

**x**

^{T}

_{υ})

^{T}for velocity with dimension

*N*

_{uυ}=

*N*

_{u}+

*N*

_{υ,}

**x**

_{TS}= (

**x**

^{T}

_{T},

**x**

^{T}

_{S})

^{T}for

*T*, and

*S*with dimension

*N*. Altogether, the net state vector

_{TS}= N_{T}+ N_{S}**x**of ROMS at a given time can be written as

*N = N*is the dimension of

_{ζ}+ N_{u}+ N_{υ}+ N_{T}+ N_{S}**x**.

*M*-dimensional observation vector

**y**is related to the model state

**x**by

**x**

^{t}is the unknown true state to be estimated; H is the observational operator that maps the model state to the observation location and

**e**is the observational error.

*M*-dimensional SSH observation

_{ζ}**y**

*,*

_{ζ}*M*dimensional velocity observation

_{uυ}-**y**

*, and*

_{uυ}*M*-dimensional

_{TS}*T*and

*S*observation

**y**

*. Similar to a model state, we write the net observation as*

_{TS}*M*

_{obs}=

*M*+

_{ζ}*M*is the total number of observations. When the observational operator is linear, we have

_{uυ}+ M_{TS}**x**) = 𝗛

**x**, where

*M*×

*N*-dimensional observation matrix; 𝗛

*is the*

_{ζ}*M*×

_{ζ}*N*-dimensional SSH observation matrix; 𝗛

_{ζ}*is*

_{uυ}*M*×

_{uυ}*N*-dimensional velocity observation matrix; 𝗛

_{uυ}*is*

_{TS}*M*×

_{TS}*N*dimensional velocity observation matrix; and the

_{TS}-**0**

_{M*×N*}stands for

*M*

_{*}×

*N*

_{*}-dimensional zero matrix. When a type of observation is unavailable, corresponding rows are removed from

**y**and 𝗛 in (2) and (4). For simplicity in presentation, the dimension of vectors and matrices is noted only when necessary from here on.

**e**consists of two parts:

**e**

*is the instrumental error and*

_{O}**e**

*is the representativeness error, respectively. While the source of*

_{F}**e**

*is obvious, the causes of*

_{O}**e**

*can be complex. The representativeness error can be described as that component present in the observation that cannot be represented by*

_{F}**x**) (Lorenc et al. 2000). For coastal ocean models there are mostly two processes that contribute to

**e**

*. First, a tidal model is implemented as an independent component and is not coupled with the ocean model, such as the one used in this study; and second, the model does not resolve subgrid-scale processes. The latter can be crucial in some coastal regions. For example, in the Southern California Bight there are active and energetic small-scale eddies with spatial scales ranging from a few hundred meters to a few kilometers (DiGiacomo and Holt 2001).*

_{F}**x**

*is the forecast generated by the forward time integration of ROMS, and*

^{f}*N*×

*N*background (forecast) error covariance matrix for

**x**

*and the*

^{f}*M*×

*M*observation error covariance matrix for

**y**, respectively. The minimizer of

*J*(

**x**) is the so-called analysis

**x**

*, which is the desired estimate for*

^{a}**x**

*. This analysis is statistically optimal if 𝗕 and 𝗥 are accurately given. When the observation operator*

^{t}**x**

*is also a minimum error variance estimate (e.g., Jazwinski 1970; Cohn 1997). Furthermore, if both forecast and observation errors are Gaussian, then it yields a maximum likelihood (Bayesian) estimate.*

^{a}For operational atmospheric and oceanic data assimilation systems using large-dimensional models and a substantial number of observations, minimizing *J*(**x**) is always a challenge. To improve computational efficiency and reliability, *J*(**x**) defined by (6) is often transformed and/or approximated before a minimization algorithm is applied. The incremental formulation has been used as a basic approximation in operational 3DVAR and 4DVAR systems (Courtier et al. 1994). When a forecast is accurate, the analysis increment is a small derivation from the forecast. This grants a foundation for linearization around **x*** ^{f}* in

*J*(

**x**). It is a reasonable assumption for current coastal ocean models like ROMS.

*δ*

**x**=

**x**−

**x**

*is the increment, measuring the deviation of*

^{f}**x**from

**x**

*;*

^{f}**d**=

**y**−

**x**

*) is the innovation, measuring the deviation of*

^{f}**y**from

**x**

*; and 𝗛 = ∂*

^{f}**x**is Jacobian matrix for nonlinear

*J*

_{inc}(

*δ*

**x**) quadratic and positive definite in the control variables,

*δ*

**x**. The quadratic and positive definite properties guarantee that

*J*

_{inc}(

*δ*

**x**) has a unique minimum; this uniqueness is also essential for the efficiency and reliability of the minimization process. The final analysis of the incremental 3DVAR is

*δ*

**x**

^{a}minimizes

*J*

_{inc}(

*δ*

**x**).

The adjustment of *J*_{inc}(*δ***x**) for dynamical constraints and improved computational performance is addressed in sections 3 through 5.

## 3. Dynamical constraints

ROMS3DVAR is designed to assimilate different types of observations simultaneously and reliably. Different types of observations come with different errors and generally are dynamically inconsistent. One challenge is to keep the obtained analysis in reasonable dynamic balance after the different types of observations are assimilated. For example, in many cases the velocity is nearly in geostrophic balance, but the data assimilation algorithm described above has no capacity for keeping the velocity analysis close in geostrophic balance. The concept of dynamical constraints has been used extensively by meteorological data analysis since their introduction by Sasaki (1970).

*p,*125 density

*ρ,*gravitational acceleration

*g,*angular velocity of earth’s rotation

**Ω**, and horizontal velocity vector

**. In (10) and (11), the balance constraints are applied to the increment, rather than the total field. Applying the balance constraints to the increments is important for coastal regions. In regions with complex coastline and bottom topography, and especially for upwelling-related strong fronts and energetic eddies, the internal dynamic consistency of**

*υ***x**

*is subtle and delicate. Such consistency should not be disrupted by applying relatively simple dynamic balance constraints like (10) and (11). When the dynamic balance constraint is applied to*

^{f}*δ*

**x**, the analysis can still inherit the dynamic consistency of

**x**

*when*

^{f}*δ*

**x**

*is not large.*

^{a}Moreover, *δ***x*** _{ζ}* and

*δ*

**x**

*in the coastal ocean may not necessarily be in exact dynamic balance. Rather, they have both balanced and unbalanced components (Li et al. 2008). To formulate an incremental 3DVAR algorithm that has the capacity to address balanced and unbalanced components simultaneously, we follow the method proposed by Parrish and Derber (1992). Their method partitions the model state vector into slow (balanced) and fast (unbalanced) components, and replaces a portion of the control variables with the unbalanced components. Doing so imposes dynamic balance only partially and hence implements what are called weak constraints. This method has recently been applied in several different data assimilation systems (Lorenc 2003a; Barker et al. 2004).*

_{uυ}*δ*

**x**

*can be approximately represented in discrete form as*

_{ζ}**Π**

*δ*

**x**

*is the steric SSH that is in balance with the*

_{TS}*T*and

*S*increment (11), and

*δ*

**x**is the nonsteric SSH increment due to water mass convergence in the column; see appendix A for details. In contrast to ocean data assimilation with large-scale models (e.g., Fukumori et al. 1999),

_{ζ}_{′}*δ*

**x**

_{ζ}_{′}is nonnegligible for coastal data assimilation as illustrated in Li et al. (2008).

*δ*

**x**

*can be approximately represented in discrete form as*

_{uυ}**Γ**

_{TS}δ**x**

*+*

_{TS}**Γ**

_{ζ′}δ**x**

*is the geostrophic velocity that is in balance with the pressure gradient (11) in a response to changes in steric and nonsteric SSH (12), and*

_{ζ′}*δ*

**x**

_{u}_{″}

_{υ}_{″}is the ageostrophic velocity; see appendix A for details. While

**Γ**

_{TS}δ**x**

*due to*

_{TS}*T*/

*S*profile changes may be dominant offshore,

**Γ**

_{ζ}_{′}

*δ*

**x**

_{ζ}_{′}due to nonsteric SSH and ageostrophic

*δ*

**x**

_{u}_{″}

*can be sizable nearshore.*

_{υ″}*δu*″,

*δυ*″) may be written using the incremental ageostrophic streamfunction

*δψ*″ and the velocity potential

*δχ*″ as

*δ*

**x**

_{ψ}_{″}

_{χ}_{″}is the

*N*-dimensional vector, encompassing the discrete

_{ψχ}*δψ*″ and

*δχ*″, and

**Φ**is a matrix for computing the velocity component from the streamfunction and velocity potential. A numerical method for computing streamfunction and velocity potential from the velocity components for irregular domains like coastal oceans is available (Li et al. 2006).

*J*

_{inc}(

*δ*

**x**) for dynamic constraints, we assume that errors in

*δ*

**x**

_{ζ}_{′},

*δ*

**x**

_{ψ}_{″}

_{χ}_{″}, and

*δ*

**x**

*are uncorrelated to each other in the present ROMS3DVAR. This assumption is examined in Li et al. (2008), although some adjustments may be needed. For example, it can be helpful to use spatially smoothed steric SSHs, rather than steric SSHs directly. With this assumption, a natural form of the control variable under the constraints chosen is then*

_{TS}*δ*

**x**is given by (12) and (15). We further assume that observational errors

**e**

*,*

_{ζ}**e**

*, and*

_{uυ}**e**

*in*

_{TS}**y**

*,*

_{ζ}**y**

*, and*

_{uυ}**y**

*are also uncorrelated to each other as well as any errors in*

_{TS}*δ*

**x**

*. Accordingly, an incremental 3DVAR (8) can be formulated as the weak constraints:*

_{c}*, 𝗕*

_{ζ′}

_{ψ}_{″}

_{χ}_{″}, and 𝗕

*are the background error covariance matrices corresponding to nonsteric SSH, ageostrophic streamfunction and velocity potential, and*

_{TS}*T*and

*S.*The observational cost function also breaks up into three parts:

*, 𝗥*

_{ζ}*, and 𝗥*

_{uυ}*are the error covariance matrices of*

_{TS}**e**

*,*

_{ζ}**e**

*, and*

_{uυ}**e**

*, respectively. The resulting cost function (17) possesses several desirable properties in comparison to (8), as follows.*

_{TS}First, the sizes of 𝗕* _{ζ}*, 𝗕

_{ψ}_{″}

_{χ}_{″}, and 𝗕

*are considerably smaller than that of 𝗕, which greatly reduces the difficulty in the estimation of error covariance and the computational load in minimizing*

_{TS}*J*(

_{c}*δ*

**x**

*), as will be discussed in section 4.*

_{c}Second, *δ***x**_{ψ}_{″}_{χ}_{″} is used as a control variable, rather than *δ***x**_{u}_{″υ″}, in *δ***x*** _{c}*. It is known that the self-error covariances of

*δ*

**x**

_{u″}and

*δ*

**x**

_{υ}_{″}are always nonhomogeneous and anisotropic, and their cross-error covariance is nonzero. Practically, it is difficult to estimate and simplify the error covariance, and thus it is difficult to use

*δ*

**x**

_{u}_{″}and

*δ*

**x**

_{υ}_{″}in data assimilation (Daley 1991). In contrast, the self-error covariance of streamfunction and velocity potential is much more homogeneous and isotropic, and their cross-error covariance tends to be negligible (estimation and simplification of forecast error covariances are discussed in depth in section 4).

Third, if there are no observations in velocity and sea surface height to be assimilated, the analysis of *δ***x**_{ψ}_{″}_{χ}_{″} and *δ***x**_{ζ}_{′} shows them to be zero vectors. This is due to the implicit assumption of the weak constraint formulation, that is, the errors in the unbalanced part of *δ***x**_{ψ}_{″}_{χ}_{″} and *δ***x**_{ζ}_{′} are not correlated with those of *δ***x*** _{TS}*. Accordingly, the measurements in

*T*,

*S*, and SSH are not able to correct ageostrophic velocities and nonsteric SSH.

Fourth, the cost function *J _{c}*(

*δ*

**x**

*) permits substantial flexibility in implementation. It is straightforward to add additional dynamic constraints. For example, setting the ageostrophic velocity potential to zero forces*

_{c}*δ*

**x**

_{u}_{″υ″}to be nondivergent.

Finally, if the assumptions of uncorrelated errors for *δ***x*** _{c}* and

**e**are violated, (17) needs to be extended (Daley 1991). When necessary, we can add more terms to (18), such as penalty or regularization terms as suggested by the theory for an ill-posed problem (Tikhonov and Arsenin 1977), which may improve the performance of optimization.

## 4. Construction of background error covariance

Construction of error covariances is central to the development of any 3DVAR system. The performance of ROMS3DVAR hinges on the accurate description of 𝗕 and 𝗥 in (18) and (19). The choice of 𝗥 will not be discussed in this paper because it depends specifically on the properties of observations. Statistically, an accurate estimate of 𝗕 is required to render the analysis **x**^{a}_{c} the maximum likelihood estimate. Practically, 𝗕 plays the role of spreading out observational information contained in **d**’s, which is especially crucial when observations are sporadic and irregularly distributed.

In general, there are two challenges in constructing 𝗕. First, we do not know **x*** ^{t}*, and thus

**x**

*−*

^{f}**x**

*[see (7)]. Although the observations may be assumed to sample*

^{t}**x**

*, the available observations are too few to reliably estimate 𝗕. To address this challenge, the National Meteorological Center (NMC; currently the Environmental Center for Environmental Prediction) method (Parrish and Derber 1992; Rabier et al. 1998b) is generally employed to generate data to represent forecast errors, and then the generated data are used for estimating model error correlations. It is also possible to follow the method proposed by Hollingsworth and Lönnberg (1986). In that method the forecast error is estimated as the difference between the model forecast and raw observations and then the correlated length is estimated. In ROMS3DVAR, we use the NMC method due to the lack of raw observations. Second, the size of 𝗕 is too large to handle numerically. For a realistic coastal ocean model, the number of model grid points is generally on the order of*

^{t}*O*(10

^{6}). The number of elements in 𝗕 is therefore

*O*(10

^{12}). It is impossible to perform explicit manipulation of matrices of this size even on supercomputers. This is true even for 𝗕

_{ζ}_{′}, 𝗕

_{ψ}_{″}

_{χ}_{″}, and 𝗕

*, although they are much smaller than 𝗕 for the standard (incremental) 3DVAR method. Hence, it is necessary to simplify them.*

_{TS}

_{ζ}_{′}, 𝗕

_{ψ}_{″}

_{χ}_{″}and 𝗕

*that are computationally tractable yet physically appropriate for coastal data assimilation. For this purpose, we factorize them as*

_{TS}**Σ**

_{ζ′},

**Σ**

_{ψ″χ″}, and

**Σ**

_{TS}are standard deviation matrices that are diagonal with the effective dimension being the same as the corresponding incremental vectors. Therefore, they can be used without simplification. Because of the assumption made for the errors among the five variables, there are five self-correlation matrices, 𝗖

^{ξη}

_{ζ′ζ′}, 𝗖

^{ξηκ}

_{ψ″ψ″}, 𝗖

^{ξηκ}

_{χ″χ″}, 𝗖

^{ξηκ}

_{TT}, and 𝗖

^{ξηκ}

_{SS}, and two cross-correlation matrices, 𝗖

^{ξηκ}

_{ψ″χ″}= (𝗖

^{ξηκ}

_{χ″ψ″})

^{T}and 𝗖

^{ξηκ}

_{TS}= (𝗖

^{ξηκ}

_{ST})

^{T}. The superscripts of the correlation matrices indicate the spatial dimensionality of the correlation matrices, with

*ξ*,

*η*, and

*κ*representing the cross-shore, alongshore, and vertical directions, respectively. The subscripts represent the two corresponding control variables. The cross-correlation matrices 𝗖

^{ξηκ}

_{ψ″χ″}and 𝗖

^{ξηκ}

_{TS}should not be confused with the correlation matrices of 𝗖

_{ψ″χ″}and 𝗖

_{TS}, which are the correlation matrices corresponding to

**x**

_{ψ″χ″}and

**x**

_{TS}, respectively. In contrast to the standard deviation matrices, self- and cross-correlation matrices may be dense and hence require simplification because of their prohibitive size.

### a. Self-correlation matrices

#### 1) Approach

For convenience, we introduce some new notations. Since ROMS employs curvilinear coordinates, we assume that the horizontal coordinates are in the cross-shore and alongshore directions. For simplicity, we consider a model grid box of dimensions *N ^{ξ}* ×

*N*×

^{η}*N*Extension to an irregular model grid is straightforward.

^{κ}.Since the same formulation is used for the construction of all five self-correlation matrices, we simply use the notation 𝗖 in the following discussion. We further employ the following notations: 𝗖* ^{ξ}* for any one-dimensional (1D) cross-shore correlation matrix with the dimension (

*N*)

^{ξ}^{2}; 𝗖

*for any 1D alongshore correlation matrix with dimension (*

^{η}*N*)

^{η}^{2}; 𝗖

*for any two-dimensional (2D) horizontal correlation matrix with dimension (*

^{ξη}*N*)

^{ξ}N^{η}^{2}and 𝗖

*for any 2D vertical cross-shore correlation matrix with dimension (*

^{ξκ}*N*)

^{ξ}N^{κ}^{2}; and 𝗖

*for any three-dimensional (3D) correlation matrix with dimension (*

^{ξηκ}*N*)

^{ξ}N^{η}N^{κ}^{2}. Generally, 1D correlations are manageable, and can be constructed with various methods, while simplification is necessary for the 2D and 3D correlations for a sophisticated model. As correlation matrices, any 𝗖 must be positive definite.

A variety of methods for constructing 𝗖 has been developed by the data assimilation community. Two basic classes are extensively used in operational data assimilation systems. The first class is to directly reduce the degrees of freedom of 𝗖. The simplest method in the first class is to assume 𝗖 to be diagonal. This assumption is not acceptable for 3DVAR associated with a grid model, since this assumption implies that there are no horizontal correlations. It is useful only with spectral models as implemented for atmospheric data assimilation systems such as that at the European Centre for Medium-Range Weather Forecasts (ECMWF) (Courtier et al. 1998), since it is equivalent to the assumption of homogeneity and isotropy for 𝗕 (Boer 1983). A more sophisticated method in this class is the so-called rank reduction. With this method, 𝗖 is computed on a resolution lower than the one for the forecast model. This method has been applied to global ocean data assimilation (e.g., Fukumori et al. 1999).

The second class can be described as parameterization algorithms. One frequently used method in this class is the computation of all the entries of 𝗖 with a given formula along with a set of prescribed parameters. A classic example is to compute 𝗖 by assuming that the correlation function is a Gaussian with a prescribed correlated radius. Other known methods include the use of second- or third-order autoregression (SOAR–TOAR), or particular polynomial functions (Gaspari and Cohn 1999). There are some merits to using such methods: they are relatively easy to implement; the prescribed parameters may be derived by using a limited number of observations (e.g., Dee 1995; Lönnberg and Hollingsworth 1986; Hollingsworth and Lönnberg 1986; Xu and Li 2001); and instead of saving all the entries of 𝗖, they can be instantly computed. The last merit is particularly important in increasing computational feasibility. The methods of this class have been implemented in operational global atmospheric data assimilation systems (e.g., Cohn et al. 1998; Daley and Barker 2001). The limitation of this class is that it can generate mostly only isotropic and homogeneous correlations. The recursive filter method also belongs to this class, but it has the capability of modeling some aspects of anisotropic and inhomogeneous correlations (Purser et al. 2003).

Following the reasoning of the parameterization used in the second class, we propose a new method. This new method has the capability of expressing the major anisotropic and inhomogeneous features of correlations for coastal oceans. In the coastal ocean the anisotropy and inhomogeneity of self-correlations are not negligible. The typical expression of this anisotropy and inhomogeneity is that self-correlations far offshore have larger spatial scales in the cross-shore direction than those nearshore, and correlations nearshore have larger spatial scales along the shore than cross-shore. Such spatial features of correlations can be seen in Fig. 1, where the correlations are computed from model-generated data as described in Li et al. (2008). Further, the constructed error correlation matrices have other advantages that are discussed later. For example, they guarantee positive definiteness and can be numerically manipulated efficiently and reliably.

The formulation of this new method hinges on the Kronecker product. The Kronecker product is also known as the tensor product or direct product. For its general definition and properties, readers are referred to Graham (1981). Appendix B presents some useful properties of the Kronecker product in constructing error covariance matrices.

#### 2) Two-dimensional error correlation 𝗖^{ξη}

^{ξη}

*from two 1D correlation matrices, 𝗖*

^{ξη}*and 𝗖*

^{ξ}

^{η}:*to be the correlations between the 2D grid points (*

^{ξη}*i*

_{1}:

*j*

_{1}) and (

*i*

_{2}:

*j*

_{2}) given by

*C*(

^{ξ}*i*

_{1},

*i*

_{2}) is the element of 𝗖

*corresponding to correlation between the 1D*

^{ξ}*ξ*grid points

*i*

_{1}and

*i*

_{2}, and

*C*(

^{η}*j*

_{1},

*j*

_{2}) follows the same convention for 1D

*η*grid points. Quantitatively, such a 𝗖

*can be an accurate approximation to the 2D correlation in many circumstances.*

^{ξη}One desirable characteristic of the Kronecker product formulation is that we can directly construct relatively sophisticated 2D anisotropic and inhomogeneous correlations using data. With the NMC method, we can construct the 2D correlations as follows: the element of the 1D correlation 𝗖* ^{ξ}* is computed as the correlation between the two columns of the model grids, and the element of the 1D correlation 𝗖

*as the correlation between two rows of the model grids. The 2D correlation can then be constructed with the Kronecker product of 𝗖*

^{η}*and 𝗖*

^{ξ}*. The correlation computed in this way will be detailed in Li et al. (2008). Here we present the nonsteric SSH correlation 𝗖*

^{η}^{ξη}

_{ζ′ζ′}as an illustration. The computed 1D correlation is shown in Fig. 2.

The cross-shore 1D correlation 𝗖^{ξ}_{ζ′ζ′} displays significant inhomogeneity. The decorrelation length scale varies from about 15 km nearshore to about 35 km offshore. The alongshore 1D correlation 𝗖^{η}_{ζ′ζ′} is basically homogeneous, with a decorrelation length scale of about 35 km. From the decorrelation length scale in these two 1D correlations, we learn that the 2D correlation is approximately isotropic offshore with a decorrelation length scale of about 35 km, while it is significantly anisotropic nearshore with an alongshore decorrelation length scale 2 times larger than the cross-shore one. Such inhomogeneity and anisotropy can be illustrated in the 2D correlation constructed with the Kronecker product as shown in Fig. 3, which reflects the inhomogeneity and anisotropy seen in Fig. 1, though the correlation computed from the Kronecker product is not exactly the same as the correlation computed from the data.

#### 3) Three-dimensional error correlation 𝗖^{ξηκ}

^{ξηκ}

Like horizontal 2D error correlation matrices, a 3D error correlation matrix can also be constructed using the Kronecker product formulation. In a simple form it may be constructed from the three 1D correlation matrices 𝗖* ^{ξ}*, 𝗖

*, and 𝗖*

^{η}*that is, 𝗖*

^{κ},*= 𝗖*

^{ξηκ}*⊗ 𝗖*

^{ξ}*⊗ 𝗖*

^{η}*, where 𝗖*

^{κ}*is the 1D correlation matrix in the vertical direction. This formulation implies the separability of the correlations in the three spatial dimensions. For coastal oceans, horizontal separability may be acceptable. Also the separability between the alongshore and vertical directions can be used when the model domain does not span a long distance alongshore, and when the coastline is relatively straight such as the area off California. However, the correlation is usually not separable between the vertical and cross-shore directions, because the vertical correlation function depends on the distance away from the coastline cross-shore. This dependence can be significant, especially when strong upwelling is present. The upwelling raises the thermocline nearshore, and results in a shallower mixed layer nearshore than in areas farther offshore. The difference in the mixed layer vertical structure, in turn, causes the difference in the vertical correlation.*

^{κ}*. The 3D correlation is then constructed with the Kronecker product*

^{ξκ}#### 4) Computational issues

Having described the construction of the anisotropic, inhomogeneous, and inseparable 3D error correlation 𝗖* ^{ξηκ}* using the Kronecker product formulation, we now describe some computational issues in implementing 𝗖

*in 3DVAR. The Kronecker product formulation requires limited memory. For a coastal ocean model the number of grid points in both the alongshore and cross-shore directions are on the order of*

^{ξηκ}*O*(10

^{3}), and the number of the vertical levels is on the order of

*O*(10

^{1}). Therefore, the memory required to define a symmetric matrix 𝗖

*is (½)(*

^{ξηκ}*N*)

^{ξ}N^{κ}^{2}+ (½)(

*N*)

^{η}^{2}and is of

*O*(10

^{8}). This memory requirement is easily satisfied by present day computers. Further, the positive definiteness of 𝗖

*is guaranteed if 𝗖*

^{ξηκ}*and 𝗖*

^{ξκ}*are individually positive definite. More mathematical details can be found in appendix B.*

^{η}### b. Cross-correlation matrices

^{ξηκ}

_{ψ″χ″}and 𝗖

^{ξηκ}

_{TS}. We parameterize 𝗖

^{ξηκ}

_{TS}as the average amplitude of the cross correlations and the average decorrelation length scale of the corresponding self-correlations:

^{ξηκ}

_{mTS}is obtained by the local cross-correlation vector

**r**

*arranged in the same order as*

_{TS}*δ*

**x**

*, and 𝗗*

_{TS}^{ξηκ}

_{rTS}whose column vectors are all

**r**

*:*

_{TS}^{ξηκ}

_{mTS}are the local cross correlations, and the off-diagonal elements are the average of local cross correlations at the two distinct locations. The average of the two self-correlation matrices

This approximation of 𝗖^{ξηκ}_{TS} constitutes an extension of the method used for modifying *S* with *T* observations in a few studies (e.g., Vossepoel et al. 1999; Troccoli and Haines 1999), where the off-diagonal elements of 𝗖^{ξηκ}_{TS} are approximated to be zero. Such an approximation implies that *δ***x*** _{T}* and

*δ*

**x**

*have a nonzero cross correlation only at the same location. In the approximation given by (24), the cross correlation of*

_{S}*δ*

**x**

*and*

_{T}*δ*

**x**

*is allowed among distinct locations.*

_{S}Although 𝗖^{ξηκ}_{ψ″χ″} between the ageostrophic streamfunction and the ageostrophic velocity potential can be obtained using the same procedure as 𝗖^{ξηκ}_{TS}, we choose a zero cross correlation for 𝗖^{ξηκ}_{ψ″χ″} in ROMS3DVAR. This is made possible by the use of *δ***x*** _{ψ″}* and

*δ*

**x**

*as control variables, rather than*

_{χ″}*δ*

**x**

_{u″}and

*δ*

**x**

*. The zero cross-correlation 𝗖*

_{υ″}^{ξηκ}

_{ψ″χ″}leads to nonzero cross-correlation 𝗖

^{ξηκ}

_{u″υ″}between the ageostrophic horizontal velocities that are adequately represented in various circumstances (Daley 1991, chapter 5.2).

It is noteworthy that the use of cross correlation between *δ***x*** _{T}* and

*δ*

**x**

*can be very complicated in data assimilation, particularly for coastal oceans. One major concern is that the cross correlation may not be as steady in coastal oceans as it is in the tropics and hence a flow-dependent*

_{S}*T*–

*S*correlation may be required. Also, the approximation in the cross correlation may introduce nonpositiveness in the covariance matrix 𝗕

*. It may require tweaking 𝗗*

_{TS}^{ξηκ}

_{mTS}to guarantee the positive definiteness of 𝗕

*. More discussions of the cross correlations can be found in Li et al. (2008).*

_{TS}*and 𝗕*

_{ψ″χ″}*, we further apply Cholesky factorizations to the five self-correlation matrices obtained in section 4a,*

_{TS}^{ξη}

_{ζ′}, 𝗟

^{ξηκ}

_{ψ″ψ″}, 𝗟

^{ξηκ}

_{χ″χ″}, 𝗟

^{ξηκ}

_{TT}, and 𝗟

^{ξηκ}

_{SS}are lower triangular matrices and are also referred to as Cholesky triangles. Since these self-error correlation matrices are constructed with the Kronecker product formulations, the Cholesky factorizations (27) are practically feasible as shown in appendix B.

## 5. Minimization procedures

After all the matrices are given, the next major computational task is to minimize the cost functions (17). Because of the large dimension, this minimization must be done using particular algorithms. In the past two decades, minimization algorithms for large-scale problems have been developed by the computational community (e.g., Nocedal and Wright 1999). Two types of minimization algorithm have been applied in data assimilation. The first type is preconditioned conjugate gradient algorithms, and the second type is limited memory quasi-Newton algorithms. These two methods minimize the cost function iteratively using the information on the gradient of the cost function. ROMS3DVAR uses a limited memory quasi-Newton algorithm (Liu and Nocedal 1989) that can update the preconditioning during the minimization procedure.

In the implementation of these iterative algorithms, two major steps need to be carefully considered. First, a preconditioning is applied to improve the convergence of the iteration. Second, the cost functions and their gradients must be accurately and efficiently computed. These two issues are addressed in this section.

### a. Preconditioning of cost functions

When minimizing the *J _{c}*(

*δ*

**x**

*) defined by (17), a well-known numerical difficulty may be encountered in computing the inverse of the large-dimensional 𝗕*

_{c}_{ζ′}, 𝗕

*, and 𝗕*

_{ψ″}*in*

_{TS}*J*

^{b}

_{TS},

*J*

^{b}

_{ζ}, and

*J*

^{b}

_{uυ}. In contrast, the observational cost functions

*J*

^{o}

_{TS},

*J*

^{o}

_{ζ}, and

*J*

^{o}

_{uυ}are generally less troublesome because 𝗥

*, 𝗥*

_{TS}*, and 𝗥*

_{ζ}*are mostly diagonal with nearly uniform values in the diagonal elements. These matrices’ behavior is more like the identity matrix during the minimization procedure. The other primary numerical difficulty associated with minimization is that (17) might be ill-conditioned. When it is ill-conditioned, the minimization procedure may converge at a slow rate or not at all (e.g., Nocedal and Wright 1999). To improve the efficiency and reliability of the minimization procedure, preconditioning is often employed in 3DVAR (e.g., Courtier et al. 1994). It mainly focuses on the transformation of*

_{uυ}**x**

*to improve the minimization of*

_{c}*J*

^{b}

_{TS},

*J*

^{b}

_{ζ}, and

*J*

^{b}

_{uυ}.

_{ζ′}, 𝗕

*, and 𝗕*

_{ψ″}*as in (28), we implement the transformation from*

_{TS}*δ*

**x**

_{c}to

*δ*

**z**

_{c}= (

*δ*

**z**

^{T}

_{ζ′},

*δ*

**z**

^{T}

_{ψ″χ″},

*δ*

**z**

^{T}

_{TS})

^{T}defined by

*δ*

**z**

*as the control variables*

_{c}*δ*

**z**

*Here*

_{c}.*δ*

**x**in the full model space (8) but are computed from

*δ*

**z**

*using preconditioning (30) as well as the dynamical constraints (12) and (13).*

_{c}With this transformation (30), the condition of *J ^{b}* is improved for efficient and reliable minimization:

*J*

^{b}

_{ζ′}is perfectly conditioned; and

*J*

^{b}

_{ψ″χ″}and

*J*

^{b}

_{TS}are well conditioned, too, because 𝗪

*and 𝗪*

_{ψ″χ″}*are almost identity matrices because of the small values of the diagonals in 𝗗(*

_{TS}*δ*

**x**

*,*

_{ψ″}*δ*

**x**

*) and 𝗗(*

_{χ″}*δ*

**x**

*,*

_{T}*δ*

**x**

*). Further, inversion of error covariance matrices is no longer necessary. The observational cost functions are the same as in (19), but*

_{S}*δ*

**x**

*is now computed from*

_{c}*δ*

**z**

*by linear transformations given by (30).*

_{c}Once *δ***z**^{a}_{c}, which minimizes (31), is obtained using the limited memory quasi-Newton algorithm, the analysis increment *δ***x**^{a}_{c} = *δ***x**^{†}_{c} is obtained by setting *δ***z**_{c} = *δ***z**^{a}_{c} in (34). The final analysis **x*** ^{a}* is then obtained using (9).

### b. Remarks on programming procedures and computing

The major computational overhead in minimizing the cost function is due to the matrix–vector products used to compute *δ***x**^{†}_{c} given by (34). The Cholesky factorization reduces the computational overhead by approximately one-half. Although we also employ the property of localized correlations, those matrix–vector products still use more than 80% of the total CPU time for each minimization iteration. Fortunately, these matrix–vector products are not difficult to parallelize in a load-balanced way with both OpenMP and MPI parallelism.

*J*(

_{c}*δ*

**z**

*) with respect to*

_{c}*δ*

**z**

_{ζ}_{′},

*δ*

**z**

_{ψ}_{″}

*, and*

_{χ″}*δ*

**z**

*for application of the quasi-Newton minimization algorithm. By differentiation their gradients may be written as*

_{TS}**Π**

^{T}

_{TS},

**Γ**

^{T},

**Φ**

^{T}, 𝗛

^{T}

_{ζ}, 𝗛

^{T}

_{uυ}, and 𝗛

^{T}

_{TS}. These are also called the adjoint of

**Π**

*,*

_{TS}**Γ**,

**Φ**, 𝗛

*, 𝗛*

_{ζ}*, and 𝗛*

_{uυ}*. While we have seen the complexity of*

_{TS}**Π**

*,*

_{TS}**Γ**, and

**Φ**, the observational operators of 𝗛

*, 𝗛*

_{ζ}*, and 𝗛*

_{uυ}*can also be complicated when nonconventional observations are assimilated. For example, 𝗛*

_{TS}*becomes complicated when HF radar radial velocity measurements are directly assimilated. To handle such complexity we develop the adjoint code of those six matrices, with the coding method taken directly from the computer codes that are extensively used in oceanic and atmospheric data assimilation systems (e.g., Navon et al. 1992; Stammer et al. 2002).*

_{uυ}## 6. Summary

A 3DVAR data assimilation system has been developed for operational coastal oceanography within the framework of ROMS. The theoretical formulation was described here. In recognition of the dynamic complexities of coastal oceans, we comprehensively and carefully incorporated dynamic balance constraints, constructed forecast error covariances, and preconditioned the cost function.

The dynamic constraints are incorporated to keep the analysis in the desired dynamic balance. In ROMS3DVAR, both strong and weak dynamic constraints are formulated in the framework of the maximum-likelihood estimation (Jazwinski 1970; Cohn 1997). The formulation is different from Sasaki’s (Sasaki 1970), but it follows the method of partitioning for the balanced and unbalanced parts (Parrish and Derber 1992). Applying the partition to the increments, rather than the total field, ROMS3DVAR maintains the internal dynamic consistency with the forecast **x*** ^{f}*, which can be subtle and delicate in a coastal ocean model.

The dynamic constraints are incorporated not only for keeping the analysis near the dynamic balance, but also for improving the cross correlations between the control variables. The cross correlations between velocity components and *T*/*S* are mainly the consequence of geostrophic and hydrostatic balance. In ROMS3DVAR the incremental steric SSH and geostrophic velocity components are determined by the incremental temperature and salinity. The control variables are then transformed into incremental nonsteric SSH, ageostrophic streamfunction and velocity potential, and temperature and salinity. In this way the cross correlations among nonsteric SSH, ageostrophic streamfunction and velocity potential, and temperature and salinity are neglected in ROMS3DVAR.

A Kronecker product formulation has been proposed to construct forecast error correlations. The most important capability of this formulation is its ability to represent 3D inhomogeneous and anisotropic correlations. The inhomogeneity and anisotropy in the forecast error covariance are significant and ubiquitous in coastal oceans. The significance and ubiquity is due to the control of the dynamics of coastal oceans by two physical boundaries: the sea surface and the coastline. The atmosphere drives the ocean at its surface; therefore, more dramatic changes in the ocean occur near the surface than in the deep water. The difference is dramatically manifested by the existence of the thermocline. Such a vertical difference in the dynamics necessarily leads to a vertical difference in forecast error correlations. As shown earlier, the horizontal correlations are influenced by the coastline. The structure of the forecast error correlation is thus a function of the distance from the coastline. The Kronecker product formulation has the capability to model such inhomogeneity and anisotropy.

The construction of the 3D correlations is particularly important for oceanic data assimilations. Many oceanic observations are limited to the surface. The success of a data assimilation system relies on the spread of the observed information from the surface to the deep water. The 3D correlation constructed with (23) dictates how information is spread vertically.

The Kronecker product formulation also offers computational advantages. One advantage is that it reduces the memory requirement for the error correlation. As such, the memory required for a typical coastal ocean model becomes manageable on present day supercomputers. The most important computational advantage of the Kronecker product formulation is that the Cholesky factorizations of the 3D correlation matrices can be implemented directly. In fact, ROMS3DVAR relies greatly on the Cholesky factorizations of the 3D correlation matrices. The preconditioning of the cost function requires Cholesky factorizations of the correlation matrices. The Cholesky factorization is also used to guarantee that the correlation matrices are positive definite. These applications of the Cholesky factorizations play a crucial role in the efficiency and reliability of ROMS3DVAR. Because of these computational advantages, this 3DVAR system lays a path to more advanced data assimilation schemes, such as a hybrid ensemble and 3DVAR scheme (e.g., Hamill and Snyder 2000; Lorenc 2003b; Buehner 2005; Wang et al. 2007).

We have so far only described the theoretical framework of ROMS3DVAR. Extensive assessment and evaluation of this data assimilation system are necessary and is the focus of Li et al. (2008), in which we describe the constructed forecast error variance and correlations, conduct a number of idealized experiments to further illustrate the algorithm, perform various experiments under various operational conditions to examine the validity of the assumptions used, and explore some operational issues. Chao et al. (2008, manuscript submitted to *Deep-Sea Res*.) summarizes the real-time performance of ROMS3DVAR when it was employed in generating real-time analyses during the Autonomous Ocean Sampling Network (AOSN) experiment in August 2003 (http://www.mbari.org/aosn/). The ROMS3DVAR system implemented off the central California coast has been run operationally in real time since August 2006. Similar ROMS3DVAR real-time forecasting systems are also currently being developed for the Southern California Bight and the Prince Williams Sound, Alaska.

## Acknowledgments

The research described in this publication was carried out, in part, by the Jet Propulsion Laboratory (JPL), California Institute of Technology, under a contract with the National Aeronautics and Space Administration (NASA). Computations were performed on the SGI Origin computer through the JPL Supercomputing Project. Support from the Office of Naval Research (ONR) under the Grants N00014-04-1-0166, N00014-04-1-0191, N00014-04-1-0401, and N00014-05-1-0293 is gratefully acknowledged. ZL thanks Prof. Navon at the Florida State University for many stimulating discussions and Drs. Greene and Lampal at Raytheon for persistent help and support.

## REFERENCES

Alves, J. O. S., Haines K. , and Anderson D. L. T. , 2001: Sea level assimilation experiments in the tropical Pacific.

,*J. Phys. Oceanogr.***31****,**305–323.Barker, D. M., Huang W. , Guo Y-R. , Bourgeois A. J. , and Xiao Q. N. , 2004: A three-dimensional variational data assimilation system for MM5: Implementation and initial results.

,*Mon. Wea. Rev.***132****,**897–914.Bennett, A. F., 1997:

*Inverse Methods in Physical Oceanography*. Cambridge University Press, 346 pp.Boer, G. J., 1983: Homogeneous and isotropic turbulence on the sphere.

,*J. Atmos. Sci.***40****,**154–163.Buehner, M., 2005: Ensemble-derived stationary and flow-dependent background-error covariances: Evaluation in a quasi-operational NWP setting.

,*Quart. J. Roy. Meteor. Soc.***131****,**1013–1043.Cohn, S. E., 1997: Estimation theory for data assimilation problems: Basic conceptual framework and some open questions.

,*J. Meteor. Soc. Japan***75****,**257–288.Cohn, S. E., da Silva D. M. , Guo J. , Sienkiewicz M. , and Lamich D. , 1998: Assessing the effects of data selection with the DAO Physical-Space Statistical Analysis System.

,*Mon. Wea. Rev.***126****,**2913–2926.Courtier, P., Thepaut J-N. , and Hollingsworth A. , 1994: A strategy for operational implementation of 4D-Var, using an incremental approach.

,*Quart. J. Roy. Meteor. Soc.***120****,**1367–1387.Courtier, P., and Coauthors, 1998: The ECMWF implementation of three-dimensional variational assimilation (3D-Var). I: Formulation.

,*Quart. J. Roy. Meteor. Soc.***124****,**1783–1807.Daley, R., 1991:

*Atmospheric Data Analysis*. Cambridge University Press, 457 pp.Daley, R., and Barker E. , 2001: NAVDAS: Formulation and diagnostics.

,*Mon. Wea. Rev.***129****,**869–883.Dee, D. P., 1995: Online estimation of error covariance parameters for atmospheric data assimilation.

,*Mon. Wea. Rev.***123****,**1128–1145.DiGiacomo, P. M., and Holt B. , 2001: Satellite observations of small coastal ocean eddies in the Southern California Bight.

,*J. Geophys. Res.***106****,**22521–22543.Di Lorenzo, E., Moore A. M. , Arango H. G. , Cornuelle B. D. , Miller A. J. , Powell B. , Chua B. S. , and Bennett A. F. , 2007: Weak and strong constraint data assimilation in the inverse Regional Ocean Modeling System (ROMS): Development and application for a baroclinic coastal upwelling system.

,*Ocean Modell.***16****,**160–187.Fisher, M., Leutbecher M. , and Kelly G. A. , 2006: On the equivalence between Kalman smoothing and weak-constraint four-dimensional variational data assimilation.

,*Quart. J. Roy. Meteor. Soc.***131****,**3235–3246.Fukumori, I., Raghunath R. , Fu R. L. , and Chao Y. , 1999: Assimilation of TOPEX/Poseidon altimeter data into a global ocean circulation model: How good are the results?

,*J. Geophys. Res.***104****,**25647–25665.Gaspari, G., and Cohn S. E. , 1999: Construction of correlation functions in two and three dimensions.

,*Quart. J. Roy. Meteor. Soc.***125****,**723–757.Graham, A., 1981:

*Kronecker Product and Matrix Calculus with Applications*. Ellis Horwood Ltd., 160 pp.Hamill, T. M., and Snyder C. , 2000: A hybrid ensemble Kalman filter–3D variational analysis scheme.

,*Mon. Wea. Rev.***128****,**2905–2919.Hollingsworth, A., and Lönnberg P. , 1986: The statistical structure of short-range forecast error as determined from radiosonde data. Part I: The wind field.

,*Tellus***38A****,**111–136.Ide, K., Courtier P. , Ghil M. , and Lorenc A. , 1997: Unified notation for data assimilation: Operational, sequential and variational.

,*J. Meteor. Soc. Japan***75****,**181–189.Jackett, D. R., and McDougall T. J. , 1995: Minimal adjustment of hydrostatic profiles to achieve static stability.

,*J. Atmos. Oceanic Technol.***12****,**381–389.Jazwinski, A. H., 1970:

*Stochastic Processes and Filtering Theory*. Academic Press, 376 pp.Kalnay, E., 2003:

*Atmospheric Modeling, Data Assimilation and Predictability*. Cambridge University Press, 341 pp.Lermusiaux, P. F. J., and Robinson A. R. , 1999: Data assimilation via error subspace statistical estimation. Part I: Theory and schemes.

,*Mon. Wea. Rev.***127****,**1385–1407.Li, Z., and Navon I. M. , 2001: Optimality of variational data assimilation and its relationship with the Kalman filter and smoother.

,*Quart. J. Roy. Meteor. Soc.***127****,**661–683.Li, Z., Chao Y. , and McWilliams J. C. , 2006: Computation of the streamfunction and velocity potential for limited and irregular domains.

,*Mon. Wea. Rev.***134****,**3384–3394.Li, Z., Chao Y. , McWilliams J. C. , and Ide K. , 2008: A three-dimensional variational data assimilation scheme for the Regional Ocean Modeling System: Implementation and basic experiments.

,*J. Geophys. Res.***113****.**C05002, doi:10.1029/2006JC004042.Liu, D. C., and Nocedal J. , 1989: On the limited memory BFGS method for large scale optimization.

,*Math. Program.***45****,**503–528.Lönnberg, P., and Hollingsworth A. , 1986: The statistical structure of short-range forecast errors as determined from radiosonde data. Part II: The covariance of height and wind errors.

,*Tellus***38A****,**137–161.Lorenc, A. C., 2003a: Modelling of error covariances by 4D-Var data assimilation.

,*Quart. J. Roy. Meteor. Soc.***129****,**3167–3182.Lorenc, A. C., 2003b: The potential of the ensemble Kalman filter for NWP—A comparison with 4D-Var.

,*Quart. J. Roy. Meteor. Soc.***129****,**3183–3203.Lorenc, A. C., and Coauthors, 2000: The Met Office global 3-dimensional variational data assimilation scheme.

,*Quart. J. Roy. Meteor. Soc.***26****,**2991–3012.Marchesiello, P., McWilliams J. C. , and Shchepetkin A. F. , 2001: Open boundary conditions for long-term integration of regional ocean models.

,*Ocean Modell.***3****,**1–20.Marchesiello, P., McWilliams J. C. , and Shchepetkin A. , 2003: Equilibrium structure and dynamics of the California Current System.

,*J. Phys. Oceanogr.***33****,**753–783.Moore, A. M., Arango H. G. , DiLorenzo E. , Cornuelle B. D. , Miller A. J. , and Neilson D. J. , 2004: A comprehensive ocean prediction and analysis system based on the tangent linear and adjoint of a regional ocean model.

,*Ocean Modell.***7****,**227–258.National Research Council, 2003:

*Enabling Ocean Research in the*.*21st Century: Implementation of a Network of Ocean Observatories.*The National Academies Press, 220 pp.Nocedal, J., and Wright S. J. , 1999:

*Numerical Optimization*. Springer-Verlag, 636 pp.Paduan, J. D., and Graber H. C. , 1997: Introduction to high-frequency radar: Reality and myth.

,*Oceanography***10****,**36–39.Parrish, D. F., and Derber J. C. , 1992: The National Meteorological Center’s spectral-interpolation analysis system.

,*Mon. Wea. Rev.***120****,**1747–1763.Purser, R. J., Wu W-S. , Parrish D. F. , and Roberts N. M. , 2003: Numerical aspects of the application of recursive filters to variational statistical analysis. Part II: Spatially inhomogeneous and anisotropic general covariances.

,*Mon. Wea. Rev.***131****,**1536–1548.Rabier, F., Jarvinnen H. , Klinker E. , Mahfouf J-F. , and Simmons A. , 1998a: The ECMWF operational implementation of four-dimensional variational assimilation. Part I: Experimental results with simplified physics.

,*Quart. J. Roy. Meteor. Soc.***126****,**1143–1170.Rabier, F., McNally A. , Andersson E. , Courtier P. , Unden P. , Eyre J. , Hollingsworth A. , and Bouttier F. , 1998b: The ECMWF implementation of three-dimensional variational assimilation (3D-Var). II: Structure functions.

,*Quart. J. Roy. Meteor. Soc.***124****,**1809–1829.Sasaki, Y., 1970: Some basic formalisms in numerical variational analysis.

,*Mon. Wea. Rev.***98****,**875–883.Shchepetkin, A. F., and McWilliams J. C. , 2003: A method for computing horizontal pressure-gradient force in an oceanic model with a nonaligned vertical coordinate.

,*J. Geophys. Res.***108****.**3090, doi:10.1029/2001JC001047.Shchepetkin, A. F., and McWilliams J. C. , 2005: The Regional Ocean Modeling System (ROMS): A split-explicit, free-surface, topography-following-coordinate oceanic model.

,*Ocean Modell.***9****,**347–404.Stammer, D., and Coauthors, 2002: Global ocean circulation during 1992–1997, estimated from ocean observations and a general circulation model.

,*J. Geophys. Res.***107****.**3118, doi:10.1029/2001JC000888.Tikhonov, A. N., and Arsenin V. , 1977:

*Solutions of Ill-Posed Problems*. Halsted Press, 258 pp.Troccoli, A., and Haines K. , 1999: Use of the temperature–salinity relation in a data assimilation context.

,*J. Atmos. Oceanic Technol.***16****,**2011–2025.Vossepoel, F. C., Reynolds R. W. , and Miller L. , 1999: Use of sea level observations to estimate salinity variability in the tropical Pacific.

,*J. Atmos. Oceanic Technol.***16****,**1401–1415.Wang, X., Hamill T. M. , Whitaker J. S. , and Bishop C. H. , 2007: A comparison of hybrid ensemble transform Kalman filter–optimum interpolation and ensemble square root filter analysis schemes.

,*Mon. Wea. Rev.***135****,**1055–1076.Wunsch, C., 1996:

*The Ocean Circulation Inverse Problem*. Cambridge University Press, 458 pp.Xu, Q., and Li W. , 2001: Estimation of three-dimensional error covariances. Part II: Analysis of wind innovation vectors.

,*Mon. Wea. Rev.***129****,**2939–2954.

## APPENDIX A

### Seawater Density, Geostrophic Velocity, and Sea Surface Level

#### Seawater density

In ocean models, the seawater density anomaly, which is the deviation from the Boussinesq approximation of the mean density, is computed via the equation of state (EOS). In ROMS the nonlinear EOS by Jackett and McDougall (1995) is used. To be consistent with ROMS, ROMS3DVAR employs the same EOS.

#### Sea surface level

*ρ*

_{0}is the Boussinesq approximation of the mean density,

*ρ*the seawater density anomaly,

*g*gravitational acceleration, and

*p*seawater pressure at the depth

*h*.

*h*to

*ζ*yields

*ζ*is the sea surface level. The incremental form of (A2) can be approximately written as

*ρ*

^{f}

_{s}is the forecast surface density anomaly, diagnostically computed from the temperature and salinity forecast. Let the depth of the bottom be

*h*, and the bottom pressure

_{b}*p*

_{hb}. We can obtain from (A3)

When only considering the steric change in SSH, that is, the incremental density does not increase or decrease the total mass of the water column from the bottom to surface, *δ**p*_{hb} = 0. As such, we call the first part of the right-hand side in (A4) the steric component, while the second part is the nonsteric component. The nonsteric component is generally neglected in data assimilation for large-scale models (e.g., Alves et al. 2001).

Since *δρ* is computed by the linearized EOS (Jackett and McDougall 1995), it is determined using the temperature and salinity increment. Let *δ**ζ*′ = *δ**p*_{hb}/*ρ*_{0} + *ρ*^{f}_{s}, and then the discrete form of (A4) can be written as (12).

#### Geostrophic velocity

## APPENDIX B

### Properties of the Kronecker Product

#### Basics

*m*×

*n*matrix 𝗕 and the

*p*×

*q*matrix 𝗖,

*mp*×

*nq*matrix with the block structure

The Kronecker product operator has a number of properties (Graham 1981). In the following it is assumed that 𝗔, 𝗕, 𝗖, and 𝗗 are real-valued matrices. Some identities hold only for appropriately dimensioned matrices.

- The Kronecker product is a bilinear operator. Given a constant
*α*, - The Kronecker product is distributive over addition:
- The Kronecker product is associative:
- Transposition is distributive over the Kronecker product (does not invert the order):
- Matrix multiplication, when dimensions are appropriate:
- When 𝗔 and 𝗕 are square and full rank,

#### Inversion, Cholesky factorization, and positive definiteness

_{ζ′}, 𝗕

_{ψ″χ″}, and 𝗕

*. The minimization of (17) generally does not require an explicit computation of the inverse by preconditioning. Nevertheless, if necessary in some circumstances, the inverse can be computed,*

_{TS}*, we need only to perform the Cholesky factorization 𝗖*

^{ξηκ}*and 𝗖*

^{ξκ}*, since we have*

^{η}*and 𝗖*

^{ξκ}*. Efficiency is gained because the dimensions of 𝗖*

^{η}*and 𝗖*

^{ξκ}*are much smaller than 𝗖*

^{η}*.*

^{ξηκ}**Σ**

^{η}and

**Σ**

^{ξκ}are diagonal matrices whose diagonal elements are the singular values; 𝗩

*and 𝗩*

^{η}*are the matrices whose columns are the singular vectors; and 𝗖*

^{ξκ}*is positive definite only if 𝗖*

^{ξηκ}*and 𝗖*

^{η}*are positive definite. The formulation (B14) can also be used to perform the singular vector decomposition efficiently.*

^{ξκ}#### Demonstration

The Kronecker product–based algorithm gives the exact isotropic and homogeneous 2D correlation if the actual 2D correlation, 𝗖* ^{ξη}*, and two 1D correlations, 𝗖

*and 𝗖, satisfy the relation (22), as is the case for Gaussian correlations. The algorithm can give a fairly accurate 2D correlation when the correlations are based on SOAR–TOAR or polynomial functions. As an illustration, Fig. B1 presents the comparison between the actual 2D correlation based on the polynomial function proposed by Gaspari and Cohn (1999) and its approximation based on the Kronecker product-based algorithm. The difference in the correlation is less than 5%, although the algorithm introduces some anisotropy.*

^{ξ}*L*and

^{ξ}*L*are the cross-shore and alongshore length scales, respectively, and

^{η}*ξ*= 0 corresponds to the eastern coastline. We let

*L*= 15(50 +

^{ξ}*ξ*/2)

^{2}, while keeping

*L*= 15 km fixed. As such,

^{η}*L*increases with the distance from the shore. The constructed correlation shows the anisotropic and inhomogeneous features as in Fig. B2. In Fig. B2 we can see some similarities to the correlation computed from the data shown in Fig. 1.

^{ξ}