Navigation

Operators and Keywords

Function List:

C++ API

divand

divand performs an n-dimensional variational analysis (interpolation) of arbitrarily located observations.

Select category:

High-level functions

divand
Compute a variational analysis of arbitrarily located observations.
divand_metric
Compute metric scale factors.
divand_kernel
Return the analytical kernel and normalization factor.

Functions for advanced usage

divand_addc
Add a constraint to the cost function.
divand_background_components
Form the different components of the background error covariance matrix.
divand_background
Form the inverse of the background error covariance matrix.
divand_constr_advec
Create the advection constrain.
divand_diagnose
Computes diagnostics for the analysis.
divand_eof_contraint
Include constraint from EOFs.
divand_error
Compute the expected error variance of the analysis.
divand_factorize
Factorize some matrices to increase performance.
divand_laplacian
Create the laplacian operator.
divand_obs
Include the constrain from the observations.
divand_operators
Generate the gradient and Laplacian operators.
divand_orthogonalize_modes
Orthogonalize EOF modes.
divand_pc_none
No preconditioner is used.
divand_pc_michol
Compute a preconditioner using a modified incomplete Cholesky decomposition.
divand_pc_sqrtiB
Compute a preconditioner using the Cholesky decomposition.
divand_rms
The RMS error between two variables.
divand_solve_eof
Solve the variational problem with the contraints from EOFs.
divand_solve
Solve the variational problem.

Utility functions

cat_cell_array
Concatenate a cell array.
colordisp
Display a message in a color (followed by a newline).
colormsg
Display a message in a color (without a newline).
conjugategradient
Solve a linear system with the preconditioned conjugated-gradient method.
interp_regular
Interpolation matrix for a n-dimensional interpolation.
localize_regular_grid
Derive fractional indices on a regular grid.
localize_separable_grid
Derive fractional indices on a separable grid.
mtimescorr
Product between a Gaussian covariance matrix and a vector.
statevector_init
Initialize structure for packing and unpacking given their mask.
statevector_pack
Pack a series of variables into a vector under the control of a mask.
statevector_unpack
Unpack a vector into different variables under the control of a mask.

Special matrices

@CatBlockMat/CatBlockMat
Create a matrix which represents the concatenation of a series of matrices.
@CatBlockMat/append
Append a matrix to a CatBlockMat matrix.
@CatBlockMat/ctranspose
Conjugate transpose of a CatBlockMat matrix.
@CatBlockMat/double
Convert a CatBlockMat matrix to a regular matrix.
@CatBlockMat/end
Last index of a CatBlockMat matrix.
@CatBlockMat/full
Convert a CatBlockMat matrix to a regular matrix.
@CatBlockMat/mldivide
Matrix left division A \ B.
@CatBlockMat/mtimes
Matrix product A*B.
@CatBlockMat/size
Size of a CatBlockMat matrix.
@CatBlockMat/subsref
Subreference of a CatBlockMat matrix.
@CovarFun/CovarFun
Create a covariance matrix based on a function handler.
@CovarFun/mldivide
Matrix left division A \ B.
@CovarIS/CovarIS
Covariance matrix with a sparse inverse matrix.
@CovarIS/diag
Diagonal elements.
@CovarIS/factorize
Factorize matrix.
@CovarIS/full
Convert a CovarIS matrix to a regular matrix.
@CovarIS/inv
Inverse of a CovarIS matrix.
@CovarIS/mldivide
Matrix left division A \ B.
@CovarIS/mtimes
Matrix product A*B.
@CovarIS/subsref
Subreference of a CovarIS matrix.
@CovarLanczos/CovarLanczos
Covariance matrix reconstructed from Lanczos vectors.
@CovarLanczos/diag
Diagonal elements.
@CovarLanczos/mtimes
Matrix product A*B.
@CovarParam/CovarParam
Parametric covariance matrix with a guassian kernel.
@CovarParam/diag
Diagonal elements.
@CovarParam/full
Convert a CovarParam matrix to a regular matrix.
@CovarParam/isscalar
Return true if argument is a scalar.
@CovarParam/isvector
Return true if argument is a vector.
@CovarParam/mldivide
Matrix left division A \ B.
@CovarParam/mtimescorr
Matrix product with correlation matrix.
@CovarParam/mtimes
Matrix product A*B.
@CovarParam/size
Size of a CovarParam matrix.
@CovarParam/subsref
Subreference of a CovarParam matrix.
@CovarSMW/CovarSMW
Covariance matrix than can be inverted using the Sherman-Morrison-Woodbury forumla.
@CovarSMW/diag
Diagonal elements.
@CovarSMW/full
Convert a CovarSWM matrix to a regular matrix.
@CovarSMW/mldivide
Matrix left division A \ B.
@CovarSMW/mtimes
Matrix product A*B.
@CovarSMW/size
Size of a CovarSWM matrix.
@DiagBlockMat/append
Append a matrix to a DiagBlockMat matrix.
@DiagBlockMat/DiagBlockMat
Block diagonal matrix.
@DiagBlockMat/diag
Diagonal elements.
@DiagBlockMat/full
Convert a DiagBlockMat matrix to a regular matrix.
@DiagBlockMat/inv
Inverse of a DiagBlockMat matrix.
@DiagBlockMat/mldivide
Matrix left division A \ B.
@DiagBlockMat/mtimes
Matrix product A*B.
@DiagBlockMat/size
Size of a DiagBlockMat matrix.
@DiagBlockMat/sum
Compute the sum.
@MatFun/ctranspose
Conjugate transpose of a MatFun matrix.
@MatFun/double
Convert a MatFun matrix to a regular matrix.
@MatFun/end
Last index of a MatFun matrix.
@MatFun/full
Convert a MatFun matrix to a regular matrix.
@MatFun/MatFun
Matrix operator object based on a function handel.
@MatFun/mtimes
Matrix product A*B.
@MatFun/size
Size of a MatFun matrix.

Sparse matrix operations

sparse_diag
Create diagonal sparse matrix.
sparse_diff
Sparse operator for differentiation.
sparse_gradient
Sparse operator for a gradient.
sparse_interp
Create a sparse interpolation matrix.
sparse_pack
Create a sparse matrix which packs an array under the control of a mask.
sparse_shift
Sparse operator shifting a field in a given dimension.
sparse_stagger
Sparse operator for staggering.
sparse_trim
Sparse operator for trimming.

Test script

test_1dvar
Testing divand in 1 dimension.
test_2dvar_adv
Testing divand in 2 dimensions with advection.
test_2dvar_check_correrr
Testing divand in 2 dimensions with correlated errors.
test_2dvar_check
Testing divand in 2 dimensions with independent verification.
test_2dvar_constrain
Testing divand in 2 dimensions with a custom constrain.
test_2dvar_cyclic
Testing divand in 2 dimensions in a cyclic domain.
test_2dvar_eof_check
Testing divand in 2 dimensions with EOF constraints.
test_2dvar_lenxy
Testing divand in 2 dimensions with lenx /= leny.
test_2dvar
Testing divand in 2 dimensions.
test_2dvar_pcg
Testing divand in 2 dimensions with pcg solver.
test_2dvar_rellen
Testing divand in 2 dimensions with relative correlation length.
test_3dvar_large_stacked
Testing divand in 3 dimensions without correlation in the 3rd dimension (vertically stacked).
test_3dvar
Testing divand in 3 dimensions.
test_4dvar
Testing divand in 4 dimensions.
test_divand
Test if divand is working correctly.
test_interp_1d
Testing 1D linear interpolation.
test_interp_2d
Testing 2D linear interpolation.
test_interp_regular
Testing linear interpolation on regular grid.
test_sparse_diff
Testing sparse operators.

Example

divand_simple_example
A simple example of divand in 2 dimensions with observations from an analytical function.
divand_realistic_example
A realistic example of divand in 2 dimensions with salinity observations in the Mediterranean Sea at 30m.

Package: divand