ctridi.f
32 lines · 1 definitions · on GitHub (7be4133)
Python version: ctridi.py, 38 lines, on the right (switch to Python above the code).
Purpose
Solves a tridiagonal linear system by the Thomas algorithm (Numerical Recipes' TRIDAG, per its comment), for the new abundance of a species after rotational mixing.
How it fits
The method
For $a_j u_{j-1} + b_j u_j + c_j u_{j+1} = d_j$: forward elimination with $\beta_1 = b_1$, $\gamma_j = c_{j-1}/\beta_{j-1}$, $\beta_j = b_j - a_j\gamma_j$, $u_j = (d_j - a_j u_{j-1})/\beta_j$; then back substitution $u_j \leftarrow u_j - \gamma_{j+1}u_{j+1}$. No pivoting; a zero $\beta$ stops the run (with the message "TRIDIA: singular matrix").
Design
TRIDIA is the same solver with extra bookkeeping of the change in angular momentum; this copy is for composition.
Definitions
subroutineCTRIDI
Thomas algorithm for the tridiagonal system in TRIDI_MOD; the solution goes to U.
Uses modules TRIDI_MOD
Called by MIXCOM
Compiler warnings (1)
gfortran -Wall -Wextra, compiling only; nothing was run.
- line 24: Equality comparison for REAL(8) [-Wcompare-reals]
Change log
The changes since rp_1
Changed since rp_1. Declarations only: /TRIDI/ to TRIDI_MOD, IMPLICIT NONE.