grid_tools  1.11.0
psym2::sqrtsym2 Interface Reference

Private Member Functions

subroutine sqrtsym2 (em, z)
 Get the sqrt of a symmetric positive-definite 2*2 matrix. More...
 
subroutine sqrtsym2d (x, z, zd)
 General routine to evaluate z=sqrt(x), and the symmetric derivative, zd = dz/dx, where x is a symmetric 2*2 positive-definite matrix. More...
 

Detailed Description

Definition at line 23 of file psym2.f90.

Constructor & Destructor Documentation

◆ sqrtsym2()

subroutine psym2::sqrtsym2::sqrtsym2 ( real(dp), dimension(2,2), intent(in)  em,
real(dp), dimension(2,2), intent(out)  z 
)
private

Get the sqrt of a symmetric positive-definite 2*2 matrix.

Parameters
[in]em2*2 symmetric matrix
[out]zsqrt of a symmetric positive-definite 2*2 matrix
Author
R. J. Purser

Definition at line 150 of file psym2.f90.

Member Function/Subroutine Documentation

◆ sqrtsym2d()

subroutine psym2::sqrtsym2::sqrtsym2d ( real(dp), dimension(2,2), intent(in)  x,
real(dp), dimension(2,2), intent(out)  z,
real(dp), dimension(2,2,2,2), intent(out)  zd 
)
private

General routine to evaluate z=sqrt(x), and the symmetric derivative, zd = dz/dx, where x is a symmetric 2*2 positive-definite matrix.

If the eigenvalues are very close together, extract their geometric mean for "preconditioning" a scaled version, px, of x, whose sqrt, and hence its derivative, can be easily obtained by the series expansion method. Otherwise, use the eigen-method (which entails dividing by the difference in the eignevalues to get zd, and which therefore fails when the eigenvalues become too similar).

Parameters
[in]xsymmetric 2*2 positive-definite matrix
[out]zsqrt(x) result
[out]zdsymmetric derivative
Author
R. J. Purser

Definition at line 177 of file psym2.f90.


The documentation for this interface was generated from the following file: