SABER
tools_func Module Reference

Subroutines/functions list. More...

Data Types

interface  c_fletcher32
 
interface  fletcher32
 
interface  lonlatmod
 
interface  gridhash
 
interface  independent_levels
 
interface  sphere_dist
 
interface  cart_dist
 
interface  lonlat2xyz
 
interface  xyz2lonlat
 
interface  vector_product
 
interface  det
 
interface  inside
 
interface  order_cc
 
interface  add
 
interface  divide
 
interface  vert_interp_size
 
interface  vert_interp_setup
 
interface  vert_interp
 
interface  fit_diag
 
interface  gc99
 
interface  fit_func
 
interface  fit_lct
 
interface  lct_d2h
 
interface  lct_h2r
 
interface  lct_r2d
 
interface  check_cond
 
interface  matern
 
interface  cholesky
 
interface  syminv
 
interface  histogram
 
interface  cx_to_cxa
 
interface  cx_to_proc
 
interface  cx_to_cxu
 
interface  convert_i2l
 
interface  convert_l2i
 
interface  zss_maxval
 
interface  zss_minval
 
interface  zss_sum
 
interface  zss_count
 

Functions/Subroutines

integer function func_fletcher32 (var)
 Fletcher-32 checksum algorithm. More...
 
subroutine func_lonlatmod (lon, lat)
 Set latitude between -pi/2 and pi/2 and longitude between -pi and pi. More...
 
subroutine func_gridhash (ncx, nlx, lon_cx, lat_cx, mask_cx, grid_hash)
 Compute grid hash profile. More...
 
subroutine func_independent_levels (mpl, nlx, grid_hash, nlxi, lx_to_lxi, lxi_to_lx, ifmt)
 Compute independent levels. More...
 
subroutine func_cart_dist (x_i, y_i, z_i, x_f, y_f, z_f, dist)
 Compute the cartesian distance between two points. More...
 
subroutine func_sphere_dist (lon_i, lat_i, lon_f, lat_f, dist)
 Compute the great-circle distance between two points. More...
 
subroutine func_lonlat2xyz (mpl, lon, lat, x, y, z)
 Convert longitude/latitude to cartesian coordinates. More...
 
subroutine func_xyz2lonlat (mpl, x, y, z, lon, lat)
 Convert longitude/latitude to cartesian coordinates. More...
 
subroutine func_vector_product (v1, v2, vp)
 Compute normalized vector product. More...
 
subroutine func_det (v1, v2, v3, p, cflag)
 Compute determinant (vector triple product) More...
 
subroutine func_inside (mpl, vbnd, lon, lat, inside_hull)
 Find whether a point is inside the hull boundaries or not. More...
 
subroutine func_order_cc (mpl, lon, lat, n, x, y, z, order, diff)
 Order points in counter-clockwise order with respect to a central point. More...
 
subroutine func_add (mpl, val, cumul, num, wgt)
 Check if value missing and add if not missing. More...
 
subroutine func_divide (mpl, val, num)
 Check if value missing and divide if not missing. More...
 
subroutine func_vert_interp_size (nl0, dl0, nl1)
 Count vertical interpolation levels. More...
 
subroutine func_vert_interp_setup (nl0, dl0, nl1, il0_interp, il1inf, il1sup, rinf, rsup)
 Setup vertical interpolation levels and weights. More...
 
subroutine func_vert_interp (mpl, nl1, var_l1, nl0, il1inf, il1sup, rinf, rsup, var_l0)
 Apply vertical interpolation. More...
 
subroutine func_fit_diag (mpl, nc3, nl0r, disth, distv, coef, rh, rv, fit)
 Compute diagnostic fit function. More...
 
real(kind_real) function func_gc99 (distnorm)
 Gaspari and Cohn (1999) function, with the support radius as a parameter. More...
 
real(kind_real) function func_fit_func (mpl, distnorm)
 Fit_function. More...
 
subroutine func_fit_lct (mpl, nc3, nl0r, dxsq, dysq, dxdy, dzsq, dmask, nscales, D, coef, fit)
 LCT fit. More...
 
subroutine func_lct_d2h (mpl, D11, D22, D33, D12, H11, H22, H33, H12)
 From D (Daley tensor) to H (local correlation tensor) More...
 
subroutine func_lct_h2r (mpl, H11, H22, H33, H12, rh, rv)
 From H (local correlation tensor) to support radii. More...
 
subroutine func_lct_r2d (r, D)
 From support radius to Daley tensor diagonal element. More...
 
subroutine func_check_cond (d1, d2, nod, valid)
 Check tensor conditioning. More...
 
real(kind_real) function func_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 func_cholesky (mpl, n, a, u)
 Compute cholesky decomposition. More...
 
subroutine func_syminv (mpl, n, a, c)
 Compute inverse of a symmetric matrix. More...
 
subroutine func_histogram (mpl, nlist, list, nbins, histmin, histmax, bins, hist)
 Compute bins and histogram from a list of values. More...
 
integer function func_cx_to_cxa (nproc, proc_to_cx_offset, icx)
 Conversion from global to halo A on subset Scx. More...
 
integer function func_cx_to_proc (nproc, proc_to_cx_offset, icx)
 Conversion from global to processor on subset Scx. More...
 
integer function func_cx_to_cxu (nproc, proc_to_cx_offset, proc_to_ncxa, myuniverse, icx)
 Conversion from global to universe on subset Scx. More...
 
subroutine func_convert_i2l_r0 (mpl, fldi, fldl)
 Convert integer to logical. More...
 
subroutine func_convert_i2l_r1 (mpl, fldi, fldl)
 Convert integer to logical. More...
 
subroutine func_convert_i2l_r2 (mpl, fldi, fldl)
 Convert integer to logical. More...
 
subroutine func_convert_i2l_r3 (mpl, fldi, fldl)
 Convert integer to logical. More...
 
subroutine func_convert_i2l_r4 (mpl, fldi, fldl)
 Convert integer to logical. More...
 
subroutine func_convert_l2i_r0 (fldl, fldi)
 Convert logical to integer. More...
 
subroutine func_convert_l2i_r1 (fldl, fldi)
 Convert logical to integer. More...
 
subroutine func_convert_l2i_r2 (fldl, fldi)
 Convert logical to integer. More...
 
subroutine func_convert_l2i_r3 (fldl, fldi)
 Convert logical to integer. More...
 
subroutine func_convert_l2i_r4 (fldl, fldi)
 Convert logical to integer. More...
 
integer(kind_int) function func_zss_maxval_int_r1 (array, mask)
 Zero-size-safe maxval function. More...
 
integer(kind_int) function func_zss_maxval_int_r2 (array, mask)
 Zero-size-safe maxval function. More...
 
integer(kind_int) function func_zss_maxval_int_r3 (array, mask)
 Zero-size-safe maxval function. More...
 
integer(kind_int) function func_zss_maxval_int_r4 (array, mask)
 Zero-size-safe maxval function. More...
 
integer(kind_int) function func_zss_maxval_int_r5 (array, mask)
 Zero-size-safe maxval function. More...
 
integer(kind_int) function func_zss_maxval_int_r6 (array, mask)
 Zero-size-safe maxval function. More...
 
real(kind_real) function func_zss_maxval_real_r1 (array, mask)
 Zero-size-safe maxval function. More...
 
real(kind_real) function func_zss_maxval_real_r2 (array, mask)
 Zero-size-safe maxval function. More...
 
real(kind_real) function func_zss_maxval_real_r3 (array, mask)
 Zero-size-safe maxval function. More...
 
real(kind_real) function func_zss_maxval_real_r4 (array, mask)
 Zero-size-safe maxval function. More...
 
real(kind_real) function func_zss_maxval_real_r5 (array, mask)
 Zero-size-safe maxval function. More...
 
real(kind_real) function func_zss_maxval_real_r6 (array, mask)
 Zero-size-safe maxval function. More...
 
integer(kind_int) function func_zss_minval_int_r1 (array, mask)
 Zero-size-safe minval function. More...
 
integer(kind_int) function func_zss_minval_int_r2 (array, mask)
 Zero-size-safe minval function. More...
 
integer(kind_int) function func_zss_minval_int_r3 (array, mask)
 Zero-size-safe minval function. More...
 
integer(kind_int) function func_zss_minval_int_r4 (array, mask)
 Zero-size-safe minval function. More...
 
integer(kind_int) function func_zss_minval_int_r5 (array, mask)
 Zero-size-safe minval function. More...
 
integer(kind_int) function func_zss_minval_int_r6 (array, mask)
 Zero-size-safe minval function. More...
 
real(kind_real) function func_zss_minval_real_r1 (array, mask)
 Zero-size-safe minval function. More...
 
real(kind_real) function func_zss_minval_real_r2 (array, mask)
 Zero-size-safe minval function. More...
 
real(kind_real) function func_zss_minval_real_r3 (array, mask)
 Zero-size-safe minval function. More...
 
real(kind_real) function func_zss_minval_real_r4 (array, mask)
 Zero-size-safe minval function. More...
 
real(kind_real) function func_zss_minval_real_r5 (array, mask)
 Zero-size-safe minval function. More...
 
real(kind_real) function func_zss_minval_real_r6 (array, mask)
 Zero-size-safe minval function. More...
 
integer(kind_int) function func_zss_sum_int_r1 (array, mask)
 Zero-size-safe sum function. More...
 
integer(kind_int) function func_zss_sum_int_r2 (array, mask)
 Zero-size-safe sum function. More...
 
integer(kind_int) function func_zss_sum_int_r3 (array, mask)
 Zero-size-safe sum function. More...
 
integer(kind_int) function func_zss_sum_int_r4 (array, mask)
 Zero-size-safe sum function. More...
 
integer(kind_int) function func_zss_sum_int_r5 (array, mask)
 Zero-size-safe sum function. More...
 
integer(kind_int) function func_zss_sum_int_r6 (array, mask)
 Zero-size-safe sum function. More...
 
real(kind_real) function func_zss_sum_real_r1 (array, mask)
 Zero-size-safe sum function. More...
 
real(kind_real) function func_zss_sum_real_r2 (array, mask)
 Zero-size-safe sum function. More...
 
real(kind_real) function func_zss_sum_real_r3 (array, mask)
 Zero-size-safe sum function. More...
 
real(kind_real) function func_zss_sum_real_r4 (array, mask)
 Zero-size-safe sum function. More...
 
real(kind_real) function func_zss_sum_real_r5 (array, mask)
 Zero-size-safe sum function. More...
 
real(kind_real) function func_zss_sum_real_r6 (array, mask)
 Zero-size-safe sum function. More...
 
integer function func_zss_count_r1 (array)
 Zero-size-safe count function. More...
 
integer function func_zss_count_r2 (array)
 Zero-size-safe count function. More...
 
integer function func_zss_count_r3 (array)
 Zero-size-safe count function. More...
 
integer function func_zss_count_r4 (array)
 Zero-size-safe count function. More...
 
integer function func_zss_count_r5 (array)
 Zero-size-safe count function. More...
 
integer function func_zss_count_r6 (array)
 Zero-size-safe count function. More...
 

Variables

real(kind_real), parameter, public gc2gau = 0.28_kind_real
 GC99 support radius to Gaussian Daley length-scale (empirical) More...
 
real(kind_real), parameter, public gau2gc = one/gc2gau
 Gaussian Daley length-scale to GC99 support radius (empirical) More...
 
real(kind_real), parameter, public dmin = 1.0e-12_kind_real
 Minimum tensor diagonal value. More...
 
real(kind_real), parameter condmax = thousand
 Maximum tensor conditioning number. More...
 
integer, parameter, public m = 0
 Number of implicit iteration for the Matern function (-1: GC99, 0: Gaussian, >0: Matern) More...
 

Detailed Description

Subroutines/functions list.

Instrumentation functions Generic ranks, dimensions and types Usual functions

Function/Subroutine Documentation

◆ func_add()

subroutine tools_func::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 
)
private

Check if value missing and add if not missing.

Parameters
[in]mplMPI data
[in]valValue to add
[in,out]numNumber of values
[in]wgtWeight

Definition at line 926 of file tools_func.F90.

◆ func_cart_dist()

subroutine tools_func::func_cart_dist ( real(kind_real), intent(in)  x_i,
real(kind_real), intent(in)  y_i,
real(kind_real), intent(in)  z_i,
real(kind_real), intent(in)  x_f,
real(kind_real), intent(in)  y_f,
real(kind_real), intent(in)  z_f,
real(kind_real), intent(out)  dist 
)
private

Compute the cartesian distance between two points.

Parameters
[in]x_iInitial point X coordinate
[in]y_iInitial point Y coordinate
[in]z_iInitial point Z coordinate
[in]x_fFinal point X coordinate
[in]y_fFinal point Y coordinate
[in]z_fFinal point Z coordinate
[out]distGreat-circle distance

Definition at line 550 of file tools_func.F90.

◆ func_check_cond()

subroutine tools_func::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 
)
private

Check tensor conditioning.

Parameters
[in]d1First diagonal coefficient
[in]d2Second diagonal coefficient
[in]nodNormalized off-diagonal coefficient
[out]validConditioning validity

Definition at line 1538 of file tools_func.F90.

◆ func_cholesky()

subroutine tools_func::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 
)
private

Compute cholesky decomposition.

Parameters
[in,out]mplMPI data
[in]nMatrix rank
[in]aMatrix
[out]uMatrix square-root

Definition at line 1643 of file tools_func.F90.

◆ func_convert_i2l_r0()

subroutine tools_func::func_convert_i2l_r0 ( type(mpl_type), intent(inout)  mpl,
integer, intent(in)  fldi,
logical, intent(out)  fldl 
)
private

Convert integer to logical.

Parameters
[in,out]mplMPI data
[in]fldiInteger field
[out]fldlLogical field

Definition at line 1962 of file tools_func.F90.

◆ func_convert_i2l_r1()

subroutine tools_func::func_convert_i2l_r1 ( type(mpl_type), intent(inout)  mpl,
integer, dimension(:), intent(in)  fldi,
logical, dimension(:), intent(out)  fldl 
)
private

Convert integer to logical.

Parameters
[in,out]mplMPI data
[in]fldiInteger field
[out]fldlLogical field

Definition at line 1995 of file tools_func.F90.

◆ func_convert_i2l_r2()

subroutine tools_func::func_convert_i2l_r2 ( type(mpl_type), intent(inout)  mpl,
integer, dimension(:,:), intent(in)  fldi,
logical, dimension(:,:), intent(out)  fldl 
)
private

Convert integer to logical.

Parameters
[in,out]mplMPI data
[in]fldiInteger field
[out]fldlLogical field

Definition at line 2036 of file tools_func.F90.

◆ func_convert_i2l_r3()

subroutine tools_func::func_convert_i2l_r3 ( type(mpl_type), intent(inout)  mpl,
integer, dimension(:,:,:), intent(in)  fldi,
logical, dimension(:,:,:), intent(out)  fldl 
)
private

Convert integer to logical.

Parameters
[in,out]mplMPI data
[in]fldiInteger field
[out]fldlLogical field

Definition at line 2087 of file tools_func.F90.

◆ func_convert_i2l_r4()

subroutine tools_func::func_convert_i2l_r4 ( type(mpl_type), intent(inout)  mpl,
integer, dimension(:,:,:,:), intent(in)  fldi,
logical, dimension(:,:,:,:), intent(out)  fldl 
)
private

Convert integer to logical.

Parameters
[in,out]mplMPI data
[in]fldiInteger field
[out]fldlLogical field

Definition at line 2148 of file tools_func.F90.

◆ func_convert_l2i_r0()

subroutine tools_func::func_convert_l2i_r0 ( logical, intent(in)  fldl,
integer, intent(out)  fldi 
)
private

Convert logical to integer.

Parameters
[in]fldlLogical field
[out]fldiInteger field

Definition at line 2220 of file tools_func.F90.

◆ func_convert_l2i_r1()

subroutine tools_func::func_convert_l2i_r1 ( logical, dimension(:), intent(in)  fldl,
integer, dimension(:), intent(out)  fldi 
)
private

Convert logical to integer.

Parameters
[in]fldlLogical field
[out]fldiInteger field

Definition at line 2250 of file tools_func.F90.

◆ func_convert_l2i_r2()

subroutine tools_func::func_convert_l2i_r2 ( logical, dimension(:,:), intent(in)  fldl,
integer, dimension(:,:), intent(out)  fldi 
)
private

Convert logical to integer.

Parameters
[in]fldlLogical field
[out]fldiInteger field

Definition at line 2290 of file tools_func.F90.

◆ func_convert_l2i_r3()

subroutine tools_func::func_convert_l2i_r3 ( logical, dimension(:,:,:), intent(in)  fldl,
integer, dimension(:,:,:), intent(out)  fldi 
)
private

Convert logical to integer.

Parameters
[in]fldlLogical field
[out]fldiInteger field

Definition at line 2340 of file tools_func.F90.

◆ func_convert_l2i_r4()

subroutine tools_func::func_convert_l2i_r4 ( logical, dimension(:,:,:,:), intent(in)  fldl,
integer, dimension(:,:,:,:), intent(out)  fldi 
)
private

Convert logical to integer.

Parameters
[in]fldlLogical field
[out]fldiInteger field

Definition at line 2400 of file tools_func.F90.

◆ func_cx_to_cxa()

integer function tools_func::func_cx_to_cxa ( integer, intent(in)  nproc,
integer, dimension(nproc), intent(in)  proc_to_cx_offset,
integer, intent(in)  icx 
)
private

Conversion from global to halo A on subset Scx.

Parameters
[in]nprocNumber of processors
[in]proc_to_cx_offsetProcessor to offset on subset Scx
[in]icxGlobal index

Definition at line 1839 of file tools_func.F90.

◆ func_cx_to_cxu()

integer function tools_func::func_cx_to_cxu ( integer, intent(in)  nproc,
integer, dimension(nproc), intent(in)  proc_to_cx_offset,
integer, dimension(nproc), intent(in)  proc_to_ncxa,
logical, dimension(nproc), intent(in)  myuniverse,
integer, intent(in)  icx 
)
private

Conversion from global to universe on subset Scx.

Parameters
[in]nprocNumber of processors
[in]proc_to_cx_offsetProcessor to offset on subset Scx
[in]proc_to_ncxaProcessor to halo A size for subset Scx
[in]myuniverseTask universe
[in]icxGlobal index

Definition at line 1910 of file tools_func.F90.

◆ func_cx_to_proc()

integer function tools_func::func_cx_to_proc ( integer, intent(in)  nproc,
integer, dimension(nproc), intent(in)  proc_to_cx_offset,
integer, intent(in)  icx 
)
private

Conversion from global to processor on subset Scx.

Parameters
[in]nprocNumber of processors
[in]proc_to_cx_offsetProcessor to offset on subset Scx
[in]icxGlobal index

Definition at line 1875 of file tools_func.F90.

◆ func_det()

subroutine tools_func::func_det ( 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 
)
private

Compute determinant (vector triple product)

Parameters
[in]v1First vector
[in]v2Second vector
[in]v3Third vector
[out]pDeterminant
[out]cflagConfidence flag

Definition at line 745 of file tools_func.F90.

◆ func_divide()

subroutine tools_func::func_divide ( type(mpl_type), intent(in)  mpl,
real(kind_real), intent(inout)  val,
real(kind_real), intent(in)  num 
)
private

Check if value missing and divide if not missing.

Parameters
[in]mplMPI data
[in,out]valValue to divide
[in]numDivider

Definition at line 965 of file tools_func.F90.

◆ func_fit_diag()

subroutine tools_func::func_fit_diag ( type(mpl_type), intent(inout)  mpl,
integer, intent(in)  nc3,
integer, intent(in)  nl0r,
real(kind_real), dimension(nc3), intent(in)  disth,
real(kind_real), dimension(nl0r), intent(in)  distv,
real(kind_real), intent(in)  coef,
real(kind_real), intent(in)  rh,
real(kind_real), intent(in)  rv,
real(kind_real), dimension(nc3,nl0r), intent(out)  fit 
)
private

Compute diagnostic fit function.

Parameters
[in,out]mplMPI data
[in]nc3Number of classes
[in]nl0rEffective number of levels
[in]disthHorizontal distance
[in]distvVertical distance
[in]coefDiagonal coefficient
[in]rhHorizontal support radius
[in]rvVertical support radius

Definition at line 1147 of file tools_func.F90.

◆ func_fit_func()

real(kind_real) function tools_func::func_fit_func ( type(mpl_type), intent(inout)  mpl,
real(kind_real), intent(in)  distnorm 
)
private

Fit_function.

Parameters
[in,out]mplMPI data
[in]distnormNormalized distance

Definition at line 1273 of file tools_func.F90.

◆ func_fit_lct()

subroutine tools_func::func_fit_lct ( type(mpl_type), intent(inout)  mpl,
integer, intent(in)  nc3,
integer, intent(in)  nl0r,
real(kind_real), dimension(nc3,nl0r), intent(in)  dxsq,
real(kind_real), dimension(nc3,nl0r), intent(in)  dysq,
real(kind_real), dimension(nc3,nl0r), intent(in)  dxdy,
real(kind_real), dimension(nc3,nl0r), intent(in)  dzsq,
logical, dimension(nc3,nl0r), 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(nc3,nl0r), intent(out)  fit 
)
private

LCT fit.

Parameters
[in,out]mplMPI data
[in]nc3Number of classes
[in]nl0rNumber of levels
[in]dxsqZonal separation squared
[in]dysqMeridian separation squared
[in]dxdyZonal x meridian separations product
[in]dzsqVertical separation squared
[in]dmaskMask
[in]nscalesNumber of LCT scales
[in]dLCT components
[in]coefLCT coefficients

Definition at line 1306 of file tools_func.F90.

◆ func_fletcher32()

integer function tools_func::func_fletcher32 ( real(kind_real), dimension(:), intent(in)  var)
private

Fletcher-32 checksum algorithm.

Parameters
[in]varVariable

Definition at line 312 of file tools_func.F90.

◆ func_gc99()

real(kind_real) function tools_func::func_gc99 ( real(kind_real), intent(in)  distnorm)
private

Gaspari and Cohn (1999) function, with the support radius as a parameter.

Parameters
[in]distnormNormalized distance

Definition at line 1229 of file tools_func.F90.

◆ func_gridhash()

subroutine tools_func::func_gridhash ( integer, intent(in)  ncx,
integer, intent(in)  nlx,
real(kind_real), dimension(ncx), intent(in)  lon_cx,
real(kind_real), dimension(ncx), intent(in)  lat_cx,
logical, dimension(ncx,nlx), intent(in)  mask_cx,
integer, dimension(0:nlx), intent(out)  grid_hash 
)
private

Compute grid hash profile.

Parameters
[in]ncxNumber of points
[in]nlxNumber of levels
[in]lon_cxLongitude [radians]
[in]lat_cxLatitude [radians]
[in]mask_cxMask
[out]grid_hashGrid hash profile

Definition at line 396 of file tools_func.F90.

◆ func_histogram()

subroutine tools_func::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 
)
private

Compute bins and histogram from a list of values.

Parameters
[in,out]mplMPI data
[in]nlistList size
[in]nbinsNumber of bins
[in]histminHistogram minimum
[in]histmaxHistogram maximum
[out]histHistogram

Definition at line 1764 of file tools_func.F90.

◆ func_independent_levels()

subroutine tools_func::func_independent_levels ( type(mpl_type), intent(inout)  mpl,
integer, intent(in)  nlx,
integer, dimension(nlx), intent(in)  grid_hash,
integer, intent(out)  nlxi,
integer, dimension(nlx), intent(out)  lx_to_lxi,
integer, dimension(nlx), intent(out)  lxi_to_lx,
integer, intent(in)  ifmt 
)
private

Compute independent levels.

Parameters
[in,out]mplMPI data
[in]nlxNumber of levels
[in]grid_hashGrid hash profile
[out]nlxiNumber of independent levels
[out]lx_to_lxiLevels to independent levels
[out]lxi_to_lxIndependent levels to levels
[in]ifmtIndentation

Definition at line 459 of file tools_func.F90.

◆ func_inside()

subroutine tools_func::func_inside ( type(mpl_type), intent(inout)  mpl,
real(kind_real), dimension(:,:), intent(in)  vbnd,
real(kind_real), intent(in)  lon,
real(kind_real), intent(in)  lat,
logical, intent(out)  inside_hull 
)
private

Find whether a point is inside the hull boundaries or not.

Parameters
[in,out]mplMPI data
[in]vbndBoundary coordinates
[in]lonLongitude
[in]latLatitude
[out]inside_hullTrue if the point is inside the hull

Definition at line 792 of file tools_func.F90.

◆ func_lct_d2h()

subroutine tools_func::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 
)
private

From D (Daley tensor) to H (local correlation tensor)

Parameters
[in,out]mplMPI data
[in]d11Daley tensor component 11
[in]d22Daley tensor component 22
[in]d33Daley tensor component 33
[in]d12Daley tensor component 12
[out]h11Local correlation tensor component 11
[out]h22Local correlation tensor component 22
[out]h33Local correlation tensor component 33
[out]h12Local correlation tensor component 12

Definition at line 1389 of file tools_func.F90.

◆ func_lct_h2r()

subroutine tools_func::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 
)
private

From H (local correlation tensor) to support radii.

Parameters
[in,out]mplMPI data
[in]h11Local correlation tensor component 11
[in]h22Local correlation tensor component 22
[in]h33Local correlation tensor component 33
[in]h12Local correlation tensor component 12
[out]rhHorizontal support radius
[out]rvVertical support radius

Definition at line 1447 of file tools_func.F90.

◆ func_lct_r2d()

subroutine tools_func::func_lct_r2d ( real(kind_real), intent(in)  r,
real(kind_real), intent(out)  D 
)
private

From support radius to Daley tensor diagonal element.

Parameters
[in]rSupport radius
[out]dDaley tensor diagonal element

Definition at line 1512 of file tools_func.F90.

◆ func_lonlat2xyz()

subroutine tools_func::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 
)
private

Convert longitude/latitude to cartesian coordinates.

Parameters
[in,out]mplMPI data
[in]lonLongitude [radians]
[in]latLatitude [radians]
[out]xX coordinate
[out]yY coordinate
[out]zZ coordinate

Definition at line 616 of file tools_func.F90.

◆ func_lonlatmod()

subroutine tools_func::func_lonlatmod ( real(kind_real), intent(inout)  lon,
real(kind_real), intent(inout)  lat 
)
private

Set latitude between -pi/2 and pi/2 and longitude between -pi and pi.

Parameters
[in,out]lonLongitude [radians]
[in,out]latLatitude [radians]

Definition at line 354 of file tools_func.F90.

◆ func_matern()

real(kind_real) function tools_func::func_matern ( type(mpl_type), intent(inout)  mpl,
integer, intent(in)  M,
real(kind_real), intent(in)  x 
)
private

Compute the normalized diffusion function from eq. (55) of Mirouze and Weaver (2013), for the 3d case (d = 3)

Parameters
[in,out]mplMPI data
[in]mMatern function order
[in]xArgument

Definition at line 1588 of file tools_func.F90.

◆ func_order_cc()

subroutine tools_func::func_order_cc ( type(mpl_type), intent(inout)  mpl,
real(kind_real), intent(in)  lon,
real(kind_real), intent(in)  lat,
integer  n,
real(kind_real), dimension(n), intent(in)  x,
real(kind_real), dimension(n), intent(in)  y,
real(kind_real), dimension(n), intent(in)  z,
integer, dimension(n), intent(out)  order,
real(kind_real), dimension(n), intent(out), optional  diff 
)
private

Order points in counter-clockwise order with respect to a central point.

Parameters
[in,out]mplMPI data
[in]lonLongitude of the central point
[in]latLatitude of the central point
nNumber of points
[in]xList of X-coordinates
[in]yList of Y-coordinates
[in]zList of Z-coordinates
[out]orderCounter-clockwise order
[out]diffAngles differences

Definition at line 851 of file tools_func.F90.

◆ func_sphere_dist()

subroutine tools_func::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 
)
private

Compute the great-circle distance between two points.

Parameters
[in]lon_iInitial point longitude [radians]
[in]lat_iInitial point latitude [radians]
[in]lon_fFinal point longitude [radians]
[in]lat_fFinal point latitude [radians]
[out]distGreat-circle distance

Definition at line 581 of file tools_func.F90.

◆ func_syminv()

subroutine tools_func::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 
)
private

Compute inverse of a symmetric matrix.

Parameters
[in,out]mplMPI data
[in]nMatrix rank
[in]aMatrix
[out]cMatrix inverse

Definition at line 1704 of file tools_func.F90.

◆ func_vector_product()

subroutine tools_func::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 
)
private

Compute normalized vector product.

Parameters
[in]v1First vector
[in]v2Second vector
[out]vpVector product

Definition at line 709 of file tools_func.F90.

◆ func_vert_interp()

subroutine tools_func::func_vert_interp ( type(mpl_type), intent(inout)  mpl,
integer, intent(in)  nl1,
real(kind_real), dimension(nl1), intent(in)  var_l1,
integer, intent(in)  nl0,
integer, dimension(nl0), intent(in)  il1inf,
integer, dimension(nl0), intent(in)  il1sup,
real(kind_real), dimension(nl0), intent(in)  rinf,
real(kind_real), dimension(nl0), intent(in)  rsup,
real(kind_real), dimension(nl0), intent(out)  var_l0 
)
private

Apply vertical interpolation.

Parameters
[in,out]mplMPI data
[in]nl1Number of interpolation levels
[in]var_l1Input variable
[in]nl0Number of levels
[in]il1infInferior interpolation levels
[in]il1supSuperior interpolation levels
[in]rinfInferior interpolation weights
[in]rsupSuperior interpolation weights
[out]var_l0Output variable

Definition at line 1105 of file tools_func.F90.

◆ func_vert_interp_setup()

subroutine tools_func::func_vert_interp_setup ( integer, intent(in)  nl0,
integer, intent(in)  dl0,
integer, intent(in)  nl1,
integer, dimension(nl1), intent(out)  il0_interp,
integer, dimension(nl0), intent(out)  il1inf,
integer, dimension(nl0), intent(out)  il1sup,
real(kind_real), dimension(nl0), intent(out)  rinf,
real(kind_real), dimension(nl0), intent(out)  rsup 
)
private

Setup vertical interpolation levels and weights.

Parameters
[in]nl0Number of levels
[in]dl0Level delta
[in]nl1Number of interpolation levels
[out]il0_interpInterpolation levels
[out]il1infInferior interpolation levels
[out]il1supSuperior interpolation levels
[out]rinfInferior interpolation weights
[out]rsupSuperior interpolation weights

Definition at line 1036 of file tools_func.F90.

◆ func_vert_interp_size()

subroutine tools_func::func_vert_interp_size ( integer, intent(in)  nl0,
integer, intent(in)  dl0,
integer, intent(out)  nl1 
)
private

Count vertical interpolation levels.

Parameters
[in]nl0Number of levels
[in]dl0Level delta
[out]nl1Number of interpolation levels

Definition at line 996 of file tools_func.F90.

◆ func_xyz2lonlat()

subroutine tools_func::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 
)
private

Convert longitude/latitude to cartesian coordinates.

Parameters
[in]mplMPI data
[in]xX coordinate
[in]yY coordinate
[in]zZ coordinate
[out]lonLongitude [radians]
[out]latLatitude [radians]

Definition at line 663 of file tools_func.F90.

◆ func_zss_count_r1()

integer function tools_func::func_zss_count_r1 ( logical, dimension(:), intent(in)  array)
private

Zero-size-safe count function.

Definition at line 3930 of file tools_func.F90.

◆ func_zss_count_r2()

integer function tools_func::func_zss_count_r2 ( logical, dimension(:,:), intent(in)  array)
private

Zero-size-safe count function.

Definition at line 3961 of file tools_func.F90.

◆ func_zss_count_r3()

integer function tools_func::func_zss_count_r3 ( logical, dimension(:,:,:), intent(in)  array)
private

Zero-size-safe count function.

Definition at line 3992 of file tools_func.F90.

◆ func_zss_count_r4()

integer function tools_func::func_zss_count_r4 ( logical, dimension(:,:,:,:), intent(in)  array)
private

Zero-size-safe count function.

Definition at line 4023 of file tools_func.F90.

◆ func_zss_count_r5()

integer function tools_func::func_zss_count_r5 ( logical, dimension(:,:,:,:,:), intent(in)  array)
private

Zero-size-safe count function.

Definition at line 4054 of file tools_func.F90.

◆ func_zss_count_r6()

integer function tools_func::func_zss_count_r6 ( logical, dimension(:,:,:,:,:,:), intent(in)  array)
private

Zero-size-safe count function.

Definition at line 4085 of file tools_func.F90.

◆ func_zss_maxval_int_r1()

integer(kind_int) function tools_func::func_zss_maxval_int_r1 ( integer(kind_int), dimension(:), intent(in)  array,
logical, dimension(:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2473 of file tools_func.F90.

◆ func_zss_maxval_int_r2()

integer(kind_int) function tools_func::func_zss_maxval_int_r2 ( integer(kind_int), dimension(:,:), intent(in)  array,
logical, dimension(:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2513 of file tools_func.F90.

◆ func_zss_maxval_int_r3()

integer(kind_int) function tools_func::func_zss_maxval_int_r3 ( integer(kind_int), dimension(:,:,:), intent(in)  array,
logical, dimension(:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2553 of file tools_func.F90.

◆ func_zss_maxval_int_r4()

integer(kind_int) function tools_func::func_zss_maxval_int_r4 ( integer(kind_int), dimension(:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2593 of file tools_func.F90.

◆ func_zss_maxval_int_r5()

integer(kind_int) function tools_func::func_zss_maxval_int_r5 ( integer(kind_int), dimension(:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2633 of file tools_func.F90.

◆ func_zss_maxval_int_r6()

integer(kind_int) function tools_func::func_zss_maxval_int_r6 ( integer(kind_int), dimension(:,:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2673 of file tools_func.F90.

◆ func_zss_maxval_real_r1()

real(kind_real) function tools_func::func_zss_maxval_real_r1 ( real(kind_real), dimension(:), intent(in)  array,
logical, dimension(:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2715 of file tools_func.F90.

◆ func_zss_maxval_real_r2()

real(kind_real) function tools_func::func_zss_maxval_real_r2 ( real(kind_real), dimension(:,:), intent(in)  array,
logical, dimension(:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2755 of file tools_func.F90.

◆ func_zss_maxval_real_r3()

real(kind_real) function tools_func::func_zss_maxval_real_r3 ( real(kind_real), dimension(:,:,:), intent(in)  array,
logical, dimension(:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2795 of file tools_func.F90.

◆ func_zss_maxval_real_r4()

real(kind_real) function tools_func::func_zss_maxval_real_r4 ( real(kind_real), dimension(:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2835 of file tools_func.F90.

◆ func_zss_maxval_real_r5()

real(kind_real) function tools_func::func_zss_maxval_real_r5 ( real(kind_real), dimension(:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2875 of file tools_func.F90.

◆ func_zss_maxval_real_r6()

real(kind_real) function tools_func::func_zss_maxval_real_r6 ( real(kind_real), dimension(:,:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe maxval function.

Definition at line 2915 of file tools_func.F90.

◆ func_zss_minval_int_r1()

integer(kind_int) function tools_func::func_zss_minval_int_r1 ( integer(kind_int), dimension(:), intent(in)  array,
logical, dimension(:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 2959 of file tools_func.F90.

◆ func_zss_minval_int_r2()

integer(kind_int) function tools_func::func_zss_minval_int_r2 ( integer(kind_int), dimension(:,:), intent(in)  array,
logical, dimension(:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 2999 of file tools_func.F90.

◆ func_zss_minval_int_r3()

integer(kind_int) function tools_func::func_zss_minval_int_r3 ( integer(kind_int), dimension(:,:,:), intent(in)  array,
logical, dimension(:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3039 of file tools_func.F90.

◆ func_zss_minval_int_r4()

integer(kind_int) function tools_func::func_zss_minval_int_r4 ( integer(kind_int), dimension(:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3079 of file tools_func.F90.

◆ func_zss_minval_int_r5()

integer(kind_int) function tools_func::func_zss_minval_int_r5 ( integer(kind_int), dimension(:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3119 of file tools_func.F90.

◆ func_zss_minval_int_r6()

integer(kind_int) function tools_func::func_zss_minval_int_r6 ( integer(kind_int), dimension(:,:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3159 of file tools_func.F90.

◆ func_zss_minval_real_r1()

real(kind_real) function tools_func::func_zss_minval_real_r1 ( real(kind_real), dimension(:), intent(in)  array,
logical, dimension(:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3201 of file tools_func.F90.

◆ func_zss_minval_real_r2()

real(kind_real) function tools_func::func_zss_minval_real_r2 ( real(kind_real), dimension(:,:), intent(in)  array,
logical, dimension(:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3241 of file tools_func.F90.

◆ func_zss_minval_real_r3()

real(kind_real) function tools_func::func_zss_minval_real_r3 ( real(kind_real), dimension(:,:,:), intent(in)  array,
logical, dimension(:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3281 of file tools_func.F90.

◆ func_zss_minval_real_r4()

real(kind_real) function tools_func::func_zss_minval_real_r4 ( real(kind_real), dimension(:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3321 of file tools_func.F90.

◆ func_zss_minval_real_r5()

real(kind_real) function tools_func::func_zss_minval_real_r5 ( real(kind_real), dimension(:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3361 of file tools_func.F90.

◆ func_zss_minval_real_r6()

real(kind_real) function tools_func::func_zss_minval_real_r6 ( real(kind_real), dimension(:,:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe minval function.

Definition at line 3401 of file tools_func.F90.

◆ func_zss_sum_int_r1()

integer(kind_int) function tools_func::func_zss_sum_int_r1 ( integer(kind_int), dimension(:), intent(in)  array,
logical, dimension(:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3445 of file tools_func.F90.

◆ func_zss_sum_int_r2()

integer(kind_int) function tools_func::func_zss_sum_int_r2 ( integer(kind_int), dimension(:,:), intent(in)  array,
logical, dimension(:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3485 of file tools_func.F90.

◆ func_zss_sum_int_r3()

integer(kind_int) function tools_func::func_zss_sum_int_r3 ( integer(kind_int), dimension(:,:,:), intent(in)  array,
logical, dimension(:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3525 of file tools_func.F90.

◆ func_zss_sum_int_r4()

integer(kind_int) function tools_func::func_zss_sum_int_r4 ( integer(kind_int), dimension(:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3565 of file tools_func.F90.

◆ func_zss_sum_int_r5()

integer(kind_int) function tools_func::func_zss_sum_int_r5 ( integer(kind_int), dimension(:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3605 of file tools_func.F90.

◆ func_zss_sum_int_r6()

integer(kind_int) function tools_func::func_zss_sum_int_r6 ( integer(kind_int), dimension(:,:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3645 of file tools_func.F90.

◆ func_zss_sum_real_r1()

real(kind_real) function tools_func::func_zss_sum_real_r1 ( real(kind_real), dimension(:), intent(in)  array,
logical, dimension(:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3687 of file tools_func.F90.

◆ func_zss_sum_real_r2()

real(kind_real) function tools_func::func_zss_sum_real_r2 ( real(kind_real), dimension(:,:), intent(in)  array,
logical, dimension(:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3727 of file tools_func.F90.

◆ func_zss_sum_real_r3()

real(kind_real) function tools_func::func_zss_sum_real_r3 ( real(kind_real), dimension(:,:,:), intent(in)  array,
logical, dimension(:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3767 of file tools_func.F90.

◆ func_zss_sum_real_r4()

real(kind_real) function tools_func::func_zss_sum_real_r4 ( real(kind_real), dimension(:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3807 of file tools_func.F90.

◆ func_zss_sum_real_r5()

real(kind_real) function tools_func::func_zss_sum_real_r5 ( real(kind_real), dimension(:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3847 of file tools_func.F90.

◆ func_zss_sum_real_r6()

real(kind_real) function tools_func::func_zss_sum_real_r6 ( real(kind_real), dimension(:,:,:,:,:,:), intent(in)  array,
logical, dimension(:,:,:,:,:,:), intent(in), optional  mask 
)
private

Zero-size-safe sum function.

Definition at line 3887 of file tools_func.F90.

Variable Documentation

◆ condmax

real(kind_real), parameter tools_func::condmax = thousand

Maximum tensor conditioning number.

Definition at line 59 of file tools_func.F90.

◆ dmin

real(kind_real), parameter, public tools_func::dmin = 1.0e-12_kind_real

Minimum tensor diagonal value.

Definition at line 58 of file tools_func.F90.

◆ gau2gc

real(kind_real), parameter, public tools_func::gau2gc = one/gc2gau

Gaussian Daley length-scale to GC99 support radius (empirical)

Definition at line 57 of file tools_func.F90.

◆ gc2gau

real(kind_real), parameter, public tools_func::gc2gau = 0.28_kind_real

GC99 support radius to Gaussian Daley length-scale (empirical)

Definition at line 56 of file tools_func.F90.

◆ m

integer, parameter, public tools_func::m = 0

Number of implicit iteration for the Matern function (-1: GC99, 0: Gaussian, >0: Matern)

Definition at line 60 of file tools_func.F90.