﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
962	Important: Modeling 4D-Var Background Standard Deviation	arango		"GitHub Pull Request: https://github.com/myroms/roms/pull/25

In 4D-Var, the background (prior) error covariance, **B**, is a large matrix that cannot be computed or stored directly. Still, its effects can be modeled using spatial correlations, **C**, and spatial convolutions via diffusion operators. To convert correlations into error covariance, we multiply by a diagonal matrix of the background error standard deviations, **S**. Hence,

**B = L S C S^T^ L^T^**

where **L** is a balance operator, if **BALANCE_OPERATOR** is activated in **ROMS**. It allows the information on unobserved state variables to be extracted from directly observed quantities by imposing linear balance relationships between temperature and other state variables using **T-S** empirical formulas, the linear equation of state, hydrostatic balance, and geostrophic balance. Please check Moore ''et al.'' (2011) for more information.

This update includes an approach to computing the standard deviation,  **S**, directly from the background state field as an alternative to climatological values read from the input NetCDF files. It follows the work of Mogensen ''et al.'' (2012) by assuming the background errors are proportional to the vertical derivatives of the background field. The field error has a similar profile shape, but the difference with the actual error values is due to a vertical displacement.

In the past, the standard deviation was read from input NetCDF files and computed from a long simulation of the **ROMS** application. The climatological **S** can be categorized as monthly, seasonal, or annual values.

The modeling of the standard deviation from the background (prior) is activated with the **STD_MODEL** option and done in the new module **background_std.F**. For further information about this capability in **ROMS**, check Moore ''et al.'' (2020).

New parameters are added to 4D-Var input script **s4dvar.in** to constraint the standard deviation profile at the mixed-layer depth and deep ocean:

{{{
! Modeled standard deviation (STD) of Background Error Covariance parameters.
!
! The Mogensen et al. (2012) formulation assumes that the background errors
! are proportional to vertical derivatives of the state vector field. Its
! error has a similar field profile shape, but the difference with its
! ture error value is due to a vertical displacement.
!
! If COMPUTE_MLD is activated, the mixed-layer depth is computed using the
! criterion from Kara et al. (2000). Otherwise, it will be set to a uniform
! value provided below.

Sigma_max(isFsur) == 0.025d0           ! free surface  maximum STD value

Sigma_max(isUvel) == 0.06d0            ! U-velocity maximum STD value
 Sigma_ml(isUvel) == 0.05d0            ! U-velocity minimum STD at mixed layer
 Sigma_do(isUvel) == 0.02d0            ! U-velocity minimum STD in deep ocean
 Sigma_dz(isUvel) == 500.0d0           ! U-velocity vertical displacement

Sigma_max(isVvel) == 0.06d0            ! V-velocity maximum STD
 Sigma_ml(isVvel) == 0.05d0            ! V-velocity minimum STD at mixed layer
 Sigma_do(isVvel) == 0.02d0            ! V-velocity minimum STD in deep ocean
 Sigma_dz(isVvel) == 500.0d0           ! V-velocity vertical displacement

Sigma_max(isTvar) == 0.33d0   0.056d0  ! 1:NT tracers maximum STD
 Sigma_ml(isTvar) == 0.05d0   0.05d0   ! 1:NT tracers minimum STD at the mixed layer
 Sigma_do(isTvar) == 0.02d0   0.0028d0 ! 1:NT tracers minimum STD in the deep ocean
 Sigma_dz(isTvar) == 40.0d0   40.0d0   ! 1:NT tracer vertical displacement

      mld_uniform == -75.0d0           ! Uniform mixed layer depth value
}}}

Notice we have the option **COMPUTE_MLD** to compute the mixed-layer depth using the approach of Kara ''et al.'' (2000) or set a constant value of **mld_uniform**.

Two new routines are added, **def_std.F** and **wrt_std.F**, to write the standard deviation modeled from the background into an output NetCDF file. It will be needed in the split 4D-Var algorithms and for postprocessing. The new filename is also specified in **s4dvar.in**:

{{{
! If computing the standard deviation from the background (prior) state
! vector as an alternative to climatological values read from the
! input NetCDF file, enter the output standard deviation file name,
! [1:Ngrids].

       STDnameC == roms_std_c.nc
}}}

We foresee enhancing this capability in the future. We only model the standard deviation for adjusting the initial state vector (**zeta**, **u**, **v**, **T**, and **S**). We don't have options for background error on the model (weak constraint), lateral model boundary conditions, surface tracer fluxes, and surface momentum stress. Thus, those standard deviation values are still read from input files.

Notice that the standard deviation structure for I/O management increased its inner dimension from **4** to **5** in **mod_iounits.F**:

{{{
       IF (.not.allocated(STD)) THEN
         allocate ( STD(5,Ngrids) )
       END IF
}}}

== [[span(style=color: #FF0000, WARNING:)]] ==

* The **s4dvar.in** has the additional parameters mentioned above. Please update your 4D-Var input script to use his new capability.
----

== [[span(style=color: #0000FF, References: )]] ==

* Kara A., P. Rochford, and E. Hulburt, 2000: An optimal definition for ocean mixed layer depth, ''J. Geophys. Res.'', **105**, NoC7, pp 16, 803-16, 821.

* Mogensen, K., M.A. Balmaseda, and A.T. Weaver, 2012: The NEMOVAR    ocean data assimilation system implemented in the ECMWF ocean analysis for system 4, ''ECMWF Tech. Memorandum 668'', **59**.

* Moore, A.M., H.G. Arango, G. Broquet, B.S. Powell, A.T. Weaver, and J. Zavala-Garay, 2011: The Regional Ocean Modeling System (ROMS)  4-dimensional variational data assimilations systems, Part I - System overview and formulation, ''Prog. Oceanogr.'', **91**, 34-49, https://doi:10.1016/j.pocean.2011.05.004.

* Moore, A., J. Zavala-Garay, H.G. Arango, C.A. Edwards, J. Anderson, and T. Hoar, 2020: Regional and basin scale applications of ensemble adjustment Kalman filter and 4D-Var ocean data assimilation systems, ''Progress in Oceanography'', **189**, 102450, https://doi.org/10.1016/j.pocean.2020.102450."	upgrade	closed	major	Release ROMS/TOMS 4.2	Nonlinear	4.1	Done		
