This note describes the formulation of weak constraint 4D-Var, and its implementation in OOPS.
Let J denote the cost function and xk denote the state at time tk. The weak constraint 4D-Var cost function (equation cost-nonlin
) is a function a set of model states xk defined at regular intervals over a time window [t0, tN). We refer to this set of states as the "four-dimensional state vector". Note that there are N sub-windows and that the four-dimensional state vector contains the N states x0, …, xN − 1.
The cost function has three terms. The first term penalizes departures of x0 from a prior estimate (the "model background"), xb. The matrix B is the covariance matrix of background error.
The second term of the cost function penalizes the discrepancies between observations yk, j and their model equivalents, xk, j. Here, the double subscript denotes a time such that (for j = 1…M − 1) tk, j ∈ [tk, tk + 1). We assume that tk, 0 = tk and tk, M = tk + 1. We refer to the interval [tk, tk + 1) as a "sub-window", and the times tk, j as "observation time slots". The operator
The final term in the cost function penalizes departures of model error qk, defined at the boundaries between sub-windows, from a separately-estimated systematic model error, q̄. The matrix Qk is the covariance matrix of model error.
The states at times tk, j are given by an un-forced integration of the model:
for k = 0, …, N − 1 and j = 1, …, M.
The model errors are determined as the difference between the state at the start of a sub-window and the corresponding state at the end of the preceding sub-window. There are N − 1 model errors corresponding to the N − 1 boundaries between sub-windows:
qk = xk, 0 − xk − 1, M for k = 1, …, N − 1.
The linear (incremental) cost function is defined by linearizing the operators in equation cost-nonlin
around a "trajectory", to give a quadratic approximation Ĵ of the cost function. In principle, the trajectory is known at every timestep of the model. In practice, it may be necessary to assume the trajectory remains constant over small time intervals.
Let us denote by xkt the trajectory state at time tk. The approximate cost function is expressed as a function of increments δxk to these trajectory states:
Here, Hk, j is a linearization of
The increments δxk, j satisfy a linearized version of equation nonlin-propagate-eqn
:
δxk, j = Mk, jδxk, j − 1
for k = 0, …, N − 1 and j = 1, …, M.
The model error increments are given by:
δqk = δxk, 0 − δxk − 1, M for k = 1, …, N − 1.
The cost function (equation cost-nonlin
) is minimized by successive quadratic approximations according to the following algorithm:
Given an initial four-dimensional state {x0, x1, …, xN − 1}:
- For each sub-window, integrate equation
nonlin-propagate-eqn
from the initial condition xk, 0 = xk, to determine the trajectory and the state xk, M at the end of the sub-window. - Calculate the model errors from equation
nonlin-model-error-eqn
. - Minimize the linear cost function (equation
cost-linear
) to determine the increments δxk and δqk. - Set xk := xk + δxk and qk := qk + δqk.
- Repeat from step 1.
There are several possibilities for minimizing the linear cost function. Some of these are described in the following sub-sections.
The initial state and forcing formulation expresses the linear cost function as a function of the initial increment δx0 and the model error increments δq1, …, δqN − 1.
The control vector for the minimization comprizes a set of three-dimensional vectors χk for k = 0, …, N − 1, and is defined by:
The background and observation terms of the cost function can be evaluated directly from the control vector as:
The contribution to the gradient of the cost function from these terms is simply equal to the control vector itself.
To evaluate the observation term, we must generate the four-dimensional increment: {δxk; k = 0, …, N − 1}. This is done by first calculating δx0 and δqk from equations psi-to-dx0-eqn
and psi-to-dq-eqn
, and then generating δxk using equations linear-propagate-eqn
and linear-model-error-eqn
.
The cost function is minimized, resulting in an updated control vector, corresponding to the minimum of the linear cost function. From this cost function, we must generate the four-dimensional increment required by the outer loop. This is done using equations linear-propagate-eqn
and linear-model-error-eqn
, and requires a integration of the tangent linear model
In the four dimensional state formulation, the cost function is expressed as a function of the four dimensional state, δx0, …, δxN − 1.
The control vector for the minimization is defined by:
With this choice for χ0, the background term of the cost function can be evaluated as
where δqk is determined from equation linear-model-error-eqn
.
Note that this requires that the inverse model error covariance matrix is available, and is reasonably well conditioned.