regrid_solvers module reference

Solvers of linear systems.

Functions/Subroutines

solve_linear_system

Solve the linear system AX = R by Gaussian elimination

linear_solver

Solve the linear system AX = R by Gaussian elimination

solve_tridiagonal_system

Solve the tridiagonal system AX = R

solve_diag_dominant_tridiag

Solve the tridiagonal system AX = R

Detailed Description

Date of creation: 2008.06.12 L. White

This module contains solvers of linear systems. These routines have now been updated for greater efficiency, especially in special cases.

Functions/Subroutine Documentation

subroutine solve_linear_system(A, R, X, N, answer_date)

Solve the linear system AX = R 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, with the first index varing down the column.

Parameters
  • N [in]

    The size of the system

  • A [inout]

    The matrix being inverted in arbitrary units [A] on input, but internally modified to become nondimensional during the solver.

  • R [inout]

    system right-hand side in arbitrary units [A B] on input, but internally modified to have units of [B] during the solver

  • X [inout]

    solution vector in arbitrary units [B]

  • answer_date [in]

    The vintage of the expressions to use

Callees call graph
Callees of regrid_solvers::solve_linear_system calls cluster_mom_error_handler MOM_error_handler cluster_regrid_solvers regrid_solvers mom_error_handler::mom_error MOM_error regrid_solvers::solve_linear_system solve_linear_system regrid_solvers::solve_linear_system->mom_error_handler::mom_error
Text view
Callers call graph
Callers of regrid_solvers::solve_linear_system calls cluster_recon1d_ppm_h4_2018 Recon1d_PPM_H4_2018 cluster_regrid_edge_values regrid_edge_values cluster_regrid_solvers regrid_solvers recon1d_ppm_h4_2018::reconstruct reconstruct [private/internal] regrid_solvers::solve_linear_system solve_linear_system recon1d_ppm_h4_2018::reconstruct->regrid_solvers::solve_linear_system regrid_edge_values::edge_slopes_implicit_h3 edge_slopes_implicit_h3 regrid_edge_values::edge_slopes_implicit_h3->regrid_solvers::solve_linear_system regrid_edge_values::edge_values_explicit_h4 edge_values_explicit_h4 regrid_edge_values::edge_values_explicit_h4->regrid_solvers::solve_linear_system regrid_edge_values::edge_values_implicit_h4 edge_values_implicit_h4 regrid_edge_values::edge_values_implicit_h4->regrid_solvers::solve_linear_system
Text view
subroutine linear_solver(N, A, R, X)

Solve the linear system AX = R by Gaussian elimination

This routine uses Gauss's algorithm to transform the system's original matrix into an upper triangular matrix. Back substitution then yields the answer. The matrix A must be square, with the first index varing along the row.

Parameters
  • N [in]

    The size of the system

  • A [inout]

    The matrix being inverted in arbitrary units [A] on input, but internally modified to become nondimensional during the solver.

  • R [inout]

    system right-hand side in [A B] on input, but internally modified to have units of [B] during the solver

  • X [inout]

    solution vector [B]

Callees call graph
Callees of regrid_solvers::linear_solver calls cluster_mom_error_handler MOM_error_handler cluster_regrid_solvers regrid_solvers mom_error_handler::mom_error MOM_error regrid_solvers::linear_solver linear_solver regrid_solvers::linear_solver->mom_error_handler::mom_error
Text view
Callers call graph
Callers of regrid_solvers::linear_solver calls cluster_regrid_edge_values regrid_edge_values cluster_regrid_solvers regrid_solvers regrid_edge_values::edge_slopes_implicit_h5 edge_slopes_implicit_h5 regrid_solvers::linear_solver linear_solver regrid_edge_values::edge_slopes_implicit_h5->regrid_solvers::linear_solver regrid_edge_values::edge_values_implicit_h6 edge_values_implicit_h6 regrid_edge_values::edge_values_implicit_h6->regrid_solvers::linear_solver
Text view
subroutine solve_tridiagonal_system(Al, Ad, Au, R, X, N, answer_date)

Solve the tridiagonal system AX = R

This routine uses Thomas's algorithm to solve the tridiagonal system AX = R. (A is made up of lower, middle and upper diagonals)

Parameters
  • N [in]

    The size of the system

  • Ad [in]

    Matrix center diagonal in arbitrary units [A]

  • Al [in]

    Matrix lower diagonal [A]

  • Au [in]

    Matrix upper diagonal [A]

  • R [in]

    system right-hand side in arbitrary units [A B]

  • X [out]

    solution vector in arbitrary units [B]

  • answer_date [in]

    The vintage of the expressions to use

Callers call graph
Callers of regrid_solvers::solve_tridiagonal_system calls cluster_regrid_edge_values regrid_edge_values cluster_regrid_solvers regrid_solvers regrid_edge_values::edge_slopes_implicit_h3 edge_slopes_implicit_h3 regrid_solvers::solve_tridiagonal_system solve_tridiagonal_system regrid_edge_values::edge_slopes_implicit_h3->regrid_solvers::solve_tridiagonal_system regrid_edge_values::edge_slopes_implicit_h5 edge_slopes_implicit_h5 regrid_edge_values::edge_slopes_implicit_h5->regrid_solvers::solve_tridiagonal_system regrid_edge_values::edge_values_implicit_h4 edge_values_implicit_h4 regrid_edge_values::edge_values_implicit_h4->regrid_solvers::solve_tridiagonal_system regrid_edge_values::edge_values_implicit_h6 edge_values_implicit_h6 regrid_edge_values::edge_values_implicit_h6->regrid_solvers::solve_tridiagonal_system
Text view
subroutine solve_diag_dominant_tridiag(Al, Ac, Au, R, X, N)

Solve the tridiagonal system AX = R

This routine uses a variant of Thomas's algorithm to solve the tridiagonal system AX = R, in a form that is guaranteed to avoid dividing by a zero pivot. The matrix A is made up of lower (Al) and upper diagonals (Au) and a central diagonal Ad = Ac+Al+Au, where Al, Au, and Ac are all positive (or negative) definite. However when Ac is smaller than roundoff compared with (Al+Au), the answers are prone to inaccuracy.

Parameters
  • N [in]

    The size of the system

  • Ac [in]

    Matrix center diagonal offset from Al + Au in arbitrary units [A]

  • Al [in]

    Matrix lower diagonal [A]

  • Au [in]

    Matrix upper diagonal [A]

  • R [in]

    system right-hand side in arbitrary units [A B]

  • X [out]

    solution vector in arbitrary units [B]

Callers call graph
Callers of regrid_solvers::solve_diag_dominant_tridiag calls cluster_regrid_edge_values regrid_edge_values cluster_regrid_solvers regrid_solvers regrid_edge_values::edge_slopes_implicit_h3 edge_slopes_implicit_h3 regrid_solvers::solve_diag_dominant_tridiag solve_diag_dominant_tridiag regrid_edge_values::edge_slopes_implicit_h3->regrid_solvers::solve_diag_dominant_tridiag regrid_edge_values::edge_values_implicit_h4 edge_values_implicit_h4 regrid_edge_values::edge_values_implicit_h4->regrid_solvers::solve_diag_dominant_tridiag
Text view
API generated with Flint · Rendered from reStructuredText