SABER
|
Usual functions. More...
Data Types | |
interface | c_fletcher32 |
Functions/Subroutines | |
integer function, public | fletcher32 (var) |
Fletcher-32 checksum algorithm. More... | |
subroutine, public | lonlatmod (lon, lat) |
Set latitude between -pi/2 and pi/2 and longitude between -pi and pi. More... | |
real(kind_real) function, public | lonlathash (lon, lat, il) |
Define a unique real from a lon/lat pair. More... | |
subroutine, public | sphere_dist (lon_i, lat_i, lon_f, lat_f, dist) |
Compute the great-circle distance between two points. More... | |
subroutine, public | reduce_arc (lon_i, lat_i, lon_f, lat_f, maxdist, dist) |
Reduce arc to a given distance. More... | |
subroutine, public | lonlat2xyz (mpl, lon, lat, x, y, z) |
Convert longitude/latitude to cartesian coordinates. More... | |
subroutine, public | xyz2lonlat (mpl, x, y, z, lon, lat) |
Convert longitude/latitude to cartesian coordinates. More... | |
subroutine, public | vector_product (v1, v2, vp) |
Compute normalized vector product. More... | |
subroutine, public | vector_triple_product (v1, v2, v3, p, cflag) |
Compute vector triple product. More... | |
subroutine, public | add (mpl, val, cumul, num, wgt) |
Check if value missing and add if not missing. More... | |
subroutine, public | divide (mpl, val, num) |
Check if value missing and divide if not missing. More... | |
subroutine, public | fit_diag (mpl, nc3, nl0r, nl0, l0rl0_to_l0, disth, distv, coef, rh, rv, fit) |
Compute diagnostic fit function. More... | |
real(kind_real) function | gc99 (distnorm) |
Gaspari and Cohn (1999) function, with the support radius as a parameter. More... | |
real(kind_real) function, public | fit_func (mpl, distnorm) |
Fit_function. More... | |
subroutine, public | fit_lct (mpl, nc, nl0, dxsq, dysq, dxdy, dzsq, dmask, nscales, D, coef, fit) |
LCT fit. More... | |
subroutine, public | lct_d2h (mpl, D11, D22, D33, D12, H11, H22, H33, H12) |
From D (Daley tensor) to H (local correlation tensor) More... | |
subroutine, public | lct_h2r (mpl, H11, H22, H33, H12, rh, rv) |
From H (local correlation tensor) to support radii. More... | |
subroutine, public | lct_r2d (r, D) |
From support radius to Daley tensor diagonal element. More... | |
subroutine, public | check_cond (d1, d2, nod, valid) |
Check tensor conditioning. More... | |
real(kind_real) function | matern (mpl, M, x) |
Compute the normalized diffusion function from eq. (55) of Mirouze and Weaver (2013), for the 3d case (d = 3) More... | |
subroutine, public | cholesky (mpl, n, a, u, ierr) |
Compute cholesky decomposition. More... | |
subroutine, public | syminv (mpl, n, a, c, ierr) |
Compute inverse of a symmetric matrix. More... | |
subroutine, public | pseudoinv (mpl, n, a, c, ierr, mmax, var_th) |
subroutine | da_eof_decomposition (kz, bx, e, l, ierr) |
subroutine, public | histogram (mpl, nlist, list, nbins, histmin, histmax, bins, hist) |
Compute bins and histogram from a list of values. More... | |
Variables | |
real(kind_real), parameter, public | gc2gau = 0.28 |
real(kind_real), parameter, public | gau2gc = 3.57 |
real(kind_real), parameter, public | dmin = 1.0e-12_kind_real |
real(kind_real), parameter | condmax = 1.0e3 |
integer, parameter, public | m = 0 |
Usual functions.
subroutine, public tools_func::add | ( | type(mpl_type), intent(in) | mpl, |
real(kind_real), intent(in) | val, | ||
real(kind_real), intent(inout) | cumul, | ||
real(kind_real), intent(inout) | num, | ||
real(kind_real), intent(in), optional | wgt | ||
) |
Check if value missing and add if not missing.
[in] | mpl | MPI data |
[in] | val | Value to add |
[in,out] | num | Number of values |
[in] | wgt | Weight |
Definition at line 329 of file tools_func.F90.
subroutine, public tools_func::check_cond | ( | real(kind_real), intent(in) | d1, |
real(kind_real), intent(in) | d2, | ||
real(kind_real), intent(in) | nod, | ||
logical, intent(out) | valid | ||
) |
Check tensor conditioning.
[in] | d1 | First diagonal coefficient |
[in] | d2 | Second diagonal coefficient |
[in] | nod | Normalized off-diagonal coefficient |
[out] | valid | Conditioning validity |
Definition at line 791 of file tools_func.F90.
subroutine, public tools_func::cholesky | ( | type(mpl_type), intent(inout) | mpl, |
integer, intent(in) | n, | ||
real(kind_real), dimension(n,n), intent(in) | a, | ||
real(kind_real), dimension(n,n), intent(out) | u, | ||
integer, intent(out) | ierr | ||
) |
Compute cholesky decomposition.
[in,out] | mpl | MPI data |
[in] | n | Matrix rank |
[in] | a | Matrix |
[out] | u | Matrix square-root |
[out] | ierr | Error status |
Definition at line 876 of file tools_func.F90.
|
private |
subroutine, public tools_func::divide | ( | type(mpl_type), intent(in) | mpl, |
real(kind_real), intent(inout) | val, | ||
real(kind_real), intent(in) | num | ||
) |
Check if value missing and divide if not missing.
[in] | mpl | MPI data |
[in,out] | val | Value to divide |
[in] | num | Divider |
Definition at line 359 of file tools_func.F90.
subroutine, public tools_func::fit_diag | ( | type(mpl_type), intent(inout) | mpl, |
integer, intent(in) | nc3, | ||
integer, intent(in) | nl0r, | ||
integer, intent(in) | nl0, | ||
integer, dimension(nl0r,nl0), intent(in) | l0rl0_to_l0, | ||
real(kind_real), dimension(nc3), intent(in) | disth, | ||
real(kind_real), dimension(nl0,nl0), intent(in) | distv, | ||
real(kind_real), dimension(nl0), intent(in) | coef, | ||
real(kind_real), dimension(nl0), intent(in) | rh, | ||
real(kind_real), dimension(nl0), intent(in) | rv, | ||
real(kind_real), dimension(nc3,nl0r,nl0), intent(out) | fit | ||
) |
Compute diagnostic fit function.
[in,out] | mpl | MPI data |
[in] | nc3 | Number of classes |
[in] | nl0r | Effective number of levels |
[in] | nl0 | Number of levels |
[in] | l0rl0_to_l0 | Effective level to level |
[in] | disth | Horizontal distance |
[in] | distv | Vertical distance |
[in] | coef | Diagonal coefficient |
[in] | rh | Horizontal support radius |
[in] | rv | Vertical support radius |
Definition at line 381 of file tools_func.F90.
real(kind_real) function, public tools_func::fit_func | ( | type(mpl_type), intent(inout) | mpl, |
real(kind_real), intent(in) | distnorm | ||
) |
Fit_function.
[in,out] | mpl | MPI data |
[in] | distnorm | Normalized distance |
Definition at line 583 of file tools_func.F90.
subroutine, public tools_func::fit_lct | ( | type(mpl_type), intent(inout) | mpl, |
integer, intent(in) | nc, | ||
integer, intent(in) | nl0, | ||
real(kind_real), dimension(nc,nl0), intent(in) | dxsq, | ||
real(kind_real), dimension(nc,nl0), intent(in) | dysq, | ||
real(kind_real), dimension(nc,nl0), intent(in) | dxdy, | ||
real(kind_real), dimension(nc,nl0), intent(in) | dzsq, | ||
logical, dimension(nc,nl0), intent(in) | dmask, | ||
integer, intent(in) | nscales, | ||
real(kind_real), dimension(4,nscales), intent(in) | D, | ||
real(kind_real), dimension(nscales), intent(in) | coef, | ||
real(kind_real), dimension(nc,nl0), intent(out) | fit | ||
) |
LCT fit.
[in,out] | mpl | MPI data |
[in] | nc | Number of classes |
[in] | nl0 | Number of levels |
[in] | dxsq | Zonal separation squared |
[in] | dysq | Meridian separation squared |
[in] | dxdy | Zonal x meridian separations product |
[in] | dzsq | Vertical separation squared |
[in] | dmask | Mask |
[in] | nscales | Number of LCT scales |
[in] | d | LCT components |
[in] | coef | LCT coefficients |
Definition at line 610 of file tools_func.F90.
integer function, public tools_func::fletcher32 | ( | real(kind_real), dimension(:), intent(in) | var | ) |
Fletcher-32 checksum algorithm.
[in] | var | Variable |
Definition at line 46 of file tools_func.F90.
|
private |
Gaspari and Cohn (1999) function, with the support radius as a parameter.
[in] | distnorm | Normalized distance |
Definition at line 560 of file tools_func.F90.
subroutine, public tools_func::histogram | ( | type(mpl_type), intent(inout) | mpl, |
integer, intent(in) | nlist, | ||
real(kind_real), dimension(nlist), intent(in) | list, | ||
integer, intent(in) | nbins, | ||
real(kind_real), intent(in) | histmin, | ||
real(kind_real), intent(in) | histmax, | ||
real(kind_real), dimension(nbins+1), intent(out) | bins, | ||
real(kind_real), dimension(nbins), intent(out) | hist | ||
) |
Compute bins and histogram from a list of values.
[in,out] | mpl | MPI data |
[in] | nlist | List size |
[in] | nbins | Number of bins |
[in] | histmin | Histogram minimum |
[in] | histmax | Histogram maximum |
[out] | hist | Histogram |
Definition at line 1115 of file tools_func.F90.
subroutine, public tools_func::lct_d2h | ( | type(mpl_type), intent(inout) | mpl, |
real(kind_real), intent(in) | D11, | ||
real(kind_real), intent(in) | D22, | ||
real(kind_real), intent(in) | D33, | ||
real(kind_real), intent(in) | D12, | ||
real(kind_real), intent(out) | H11, | ||
real(kind_real), intent(out) | H22, | ||
real(kind_real), intent(out) | H33, | ||
real(kind_real), intent(out) | H12 | ||
) |
From D (Daley tensor) to H (local correlation tensor)
[in,out] | mpl | MPI data |
[in] | d11 | Daley tensor component 11 |
[in] | d22 | Daley tensor component 22 |
[in] | d33 | Daley tensor component 33 |
[in] | d12 | Daley tensor component 12 |
[out] | h11 | Local correlation tensor component 11 |
[out] | h22 | Local correlation tensor component 22 |
[out] | h33 | Local correlation tensor component 33 |
[out] | h12 | Local correlation tensor component 12 |
Definition at line 681 of file tools_func.F90.
subroutine, public tools_func::lct_h2r | ( | type(mpl_type), intent(inout) | mpl, |
real(kind_real), intent(in) | H11, | ||
real(kind_real), intent(in) | H22, | ||
real(kind_real), intent(in) | H33, | ||
real(kind_real), intent(in) | H12, | ||
real(kind_real), intent(out) | rh, | ||
real(kind_real), intent(out) | rv | ||
) |
From H (local correlation tensor) to support radii.
[in,out] | mpl | MPI data |
[in] | h11 | Local correlation tensor component 11 |
[in] | h22 | Local correlation tensor component 22 |
[in] | h33 | Local correlation tensor component 33 |
[in] | h12 | Local correlation tensor component 12 |
[out] | rh | Horizontal support radius |
[out] | rv | Vertical support radius |
Definition at line 723 of file tools_func.F90.
subroutine, public tools_func::lct_r2d | ( | real(kind_real), intent(in) | r, |
real(kind_real), intent(out) | D | ||
) |
From support radius to Daley tensor diagonal element.
[in] | r | Support radius |
[out] | d | Daley tensor diagonal element |
Definition at line 774 of file tools_func.F90.
subroutine, public tools_func::lonlat2xyz | ( | type(mpl_type), intent(inout) | mpl, |
real(kind_real), intent(in) | lon, | ||
real(kind_real), intent(in) | lat, | ||
real(kind_real), intent(out) | x, | ||
real(kind_real), intent(out) | y, | ||
real(kind_real), intent(out) | z | ||
) |
Convert longitude/latitude to cartesian coordinates.
[in,out] | mpl | MPI data |
[in] | lon | Longitude (radians) |
[in] | lat | Latitude (radians) |
[out] | x | X coordinate |
[out] | y | Y coordinate |
[out] | z | Z coordinate |
Definition at line 188 of file tools_func.F90.
real(kind_real) function, public tools_func::lonlathash | ( | real(kind_real), intent(in) | lon, |
real(kind_real), intent(in) | lat, | ||
integer, intent(in), optional | il | ||
) |
Define a unique real from a lon/lat pair.
[in] | lon | Longitude (radians) |
[in] | lat | Latitude (radians) |
[in] | il | Level |
Definition at line 95 of file tools_func.F90.
subroutine, public tools_func::lonlatmod | ( | real(kind_real), intent(inout) | lon, |
real(kind_real), intent(inout) | lat | ||
) |
Set latitude between -pi/2 and pi/2 and longitude between -pi and pi.
[in,out] | lon | Longitude (radians) |
[in,out] | lat | Latitude (radians) |
Definition at line 65 of file tools_func.F90.
|
private |
Compute the normalized diffusion function from eq. (55) of Mirouze and Weaver (2013), for the 3d case (d = 3)
[in,out] | mpl | MPI data |
[in] | m | Matern function order |
[in] | x | Argument |
Definition at line 832 of file tools_func.F90.
subroutine, public tools_func::pseudoinv | ( | type(mpl_type), intent(inout) | mpl, |
integer, intent(in) | n, | ||
real(kind_real), dimension(n,n), intent(in) | a, | ||
real(kind_real), dimension(n,n), intent(out) | c, | ||
integer, intent(out) | ierr, | ||
integer, intent(in), optional | mmax, | ||
real(kind_real), intent(in), optional | var_th | ||
) |
Definition at line 982 of file tools_func.F90.
subroutine, public tools_func::reduce_arc | ( | real(kind_real), intent(in) | lon_i, |
real(kind_real), intent(in) | lat_i, | ||
real(kind_real), intent(inout) | lon_f, | ||
real(kind_real), intent(inout) | lat_f, | ||
real(kind_real), intent(in) | maxdist, | ||
real(kind_real), intent(out) | dist | ||
) |
Reduce arc to a given distance.
[in] | lon_i | Initial point longitude (radians) |
[in] | lat_i | Initial point latitude (radians) |
[in,out] | lon_f | Final point longitude (radians) |
[in,out] | lat_f | Final point latitude (radians) |
[in] | maxdist | Maximum distance |
[out] | dist | Effective distance |
Definition at line 151 of file tools_func.F90.
subroutine, public tools_func::sphere_dist | ( | real(kind_real), intent(in) | lon_i, |
real(kind_real), intent(in) | lat_i, | ||
real(kind_real), intent(in) | lon_f, | ||
real(kind_real), intent(in) | lat_f, | ||
real(kind_real), intent(out) | dist | ||
) |
Compute the great-circle distance between two points.
[in] | lon_i | Initial point longitude (radians) |
[in] | lat_i | Initial point latitude (radians) |
[in] | lon_f | Final point longitude (radians) |
[in] | lat_f | Final point longilatitudetude (radians) |
[out] | dist | Great-circle distance |
Definition at line 125 of file tools_func.F90.
subroutine, public tools_func::syminv | ( | type(mpl_type), intent(inout) | mpl, |
integer, intent(in) | n, | ||
real(kind_real), dimension(n,n), intent(in) | a, | ||
real(kind_real), dimension(n,n), intent(out) | c, | ||
integer, intent(out) | ierr | ||
) |
Compute inverse of a symmetric matrix.
[in,out] | mpl | MPI data |
[in] | n | Matrix rank |
[in] | a | Matrix |
[out] | c | Matrix inverse |
[out] | ierr | Error status |
Definition at line 929 of file tools_func.F90.
subroutine, public tools_func::vector_product | ( | real(kind_real), dimension(3), intent(in) | v1, |
real(kind_real), dimension(3), intent(in) | v2, | ||
real(kind_real), dimension(3), intent(out) | vp | ||
) |
Compute normalized vector product.
[in] | v1 | First vector |
[in] | v2 | Second vector |
[out] | vp | Vector product |
Definition at line 264 of file tools_func.F90.
subroutine, public tools_func::vector_triple_product | ( | real(kind_real), dimension(3), intent(in) | v1, |
real(kind_real), dimension(3), intent(in) | v2, | ||
real(kind_real), dimension(3), intent(in) | v3, | ||
real(kind_real), intent(out) | p, | ||
logical, intent(out) | cflag | ||
) |
Compute vector triple product.
[in] | v1 | First vector |
[in] | v2 | Second vector |
[in] | v3 | Third vector |
[out] | p | Triple product |
[out] | cflag | Confidence flag |
Definition at line 291 of file tools_func.F90.
subroutine, public tools_func::xyz2lonlat | ( | type(mpl_type), intent(in) | mpl, |
real(kind_real), intent(in) | x, | ||
real(kind_real), intent(in) | y, | ||
real(kind_real), intent(in) | z, | ||
real(kind_real), intent(out) | lon, | ||
real(kind_real), intent(out) | lat | ||
) |
Convert longitude/latitude to cartesian coordinates.
[in] | mpl | MPI data |
[in] | x | X coordinate |
[in] | y | Y coordinate |
[in] | z | Z coordinate |
[out] | lon | Longitude (radians) |
[out] | lat | Latitude (radians) |
Definition at line 227 of file tools_func.F90.
real(kind_real), parameter tools_func::condmax = 1.0e3 |
Definition at line 23 of file tools_func.F90.
real(kind_real), parameter, public tools_func::dmin = 1.0e-12_kind_real |
Definition at line 22 of file tools_func.F90.
real(kind_real), parameter, public tools_func::gau2gc = 3.57 |
Definition at line 21 of file tools_func.F90.
real(kind_real), parameter, public tools_func::gc2gau = 0.28 |
Definition at line 20 of file tools_func.F90.
integer, parameter, public tools_func::m = 0 |
Definition at line 24 of file tools_func.F90.