MOM6
|
Solvers of linear systems.
Date of creation: 2008.06.12 L. White
This module contains solvers of linear systems. These routines could (should ?) be replaced later by more efficient ones.
Functions/Subroutines | |
subroutine, public | solve_linear_system (A, B, X, system_size) |
Solve the linear system AX = B by Gaussian elimination. More... | |
subroutine, public | solve_tridiagonal_system (Al, Ad, Au, B, X, system_size) |
Solve the tridiagonal system AX = B. More... | |
subroutine, public regrid_solvers::solve_linear_system | ( | real, dimension(:,:), intent(inout) | A, |
real, dimension(:), intent(inout) | B, | ||
real, dimension(:), intent(inout) | X, | ||
integer, intent(in) | system_size | ||
) |
Solve the linear system AX = B by Gaussian elimination.
This routine uses Gauss's algorithm to transform the system's original matrix into an upper triangular matrix. Back substitution yields the answer. The matrix A must be square and its size must be that of the vectors B and X.
[in,out] | a | The matrix being inverted |
[in,out] | b | system right-hand side |
[in,out] | x | solution vector |
[in] | system_size | The size of the system |
Definition at line 20 of file regrid_solvers.F90.
References mom_error_handler::mom_error().
Referenced by regrid_edge_slopes::edge_slopes_implicit_h3(), regrid_edge_slopes::edge_slopes_implicit_h5(), regrid_edge_values::edge_values_explicit_h4(), regrid_edge_values::edge_values_implicit_h4(), and regrid_edge_values::edge_values_implicit_h6().
subroutine, public regrid_solvers::solve_tridiagonal_system | ( | real, dimension(:), intent(inout) | Al, |
real, dimension(:), intent(inout) | Ad, | ||
real, dimension(:), intent(inout) | Au, | ||
real, dimension(:), intent(inout) | B, | ||
real, dimension(:), intent(inout) | X, | ||
integer, intent(in) | system_size | ||
) |
Solve the tridiagonal system AX = B.
This routine uses Thomas's algorithm to solve the tridiagonal system AX = B. (A is made up of lower, middle and upper diagonals)
[in,out] | ad | Maxtix center diagonal |
[in,out] | al | Matrix lower diagonal |
[in,out] | au | Matrix upper diagonal |
[in,out] | b | system right-hand side |
[in,out] | x | solution vector |
[in] | system_size | The size of the system |
Definition at line 114 of file regrid_solvers.F90.
Referenced by regrid_edge_slopes::edge_slopes_implicit_h3(), regrid_edge_slopes::edge_slopes_implicit_h5(), regrid_edge_values::edge_values_implicit_h4(), and regrid_edge_values::edge_values_implicit_h6().