PyREC scaffolding (from YREC development, 7be4133)/ tridia.fGlossary

tridia.f

45 lines · 1 definitions · on GitHub (7be4133)

Python version: tridia.py, 69 lines, on the right (switch to Python above the code).

Variables on this page (7)

a, b, c, d, gama, json, u

Purpose

TRIDIA solves the tridiagonal system of the implicit angular-momentum diffusion step (the Thomas algorithm), and returns the change of angular momentum at each point.

How it fits

  • Inputs: TRIDI_MOD, filled by DCOEFT just before the call: the three diagonals A, B, C, the right-hand side D (by DCOEFT's comment, the angular velocities at the start of the time step, the outermost one already reduced by the wind), and GAMA(N), the wind term at the surface. GAMA is also the elimination's work array (loop 1 sets GAMA(2..N), line 29↗), so TRIDIA reads the wind term first (line 22↗). The argument EI holds the points' moments of inertia (by SECULR's use, probably).
  • Who calls it: only SECULR.
  • Outputs: U in TRIDI_MOD, the angular velocities at the end of the step; DJ, the change of angular momentum at each point; and SUMDJ, their sum. SECULR passes DJ to EQ2MOD to return to the model's grid.
  • Modules: TRIDI_MOD (formerly COMMON/TRIDI/), shared with DCOEFT, CCOEFT, CTRIDI, GETQUA and MIXCOM.

The method

Forward elimination and back substitution for $a_j u_{j-1} + b_j u_j + c_j u_{j+1} = d_j$; then $$\Delta J_j = (\Omega_j^\mathrm{new} - \Omega_j^\mathrm{old})\,I_j,$$ with, at the surface, the wind term added: $\Delta J_N = \gamma_N + (\Omega_N^\mathrm{new} - \Omega_N^\mathrm{old})\,I_N$. A zero pivot stops the run ("#TRIDIA:SINGULAR MATRIX").

Definitions

subroutineTRIDIA

lines 3–45 · GitHub

Thomas algorithm for the implicit angular-momentum diffusion, returning each point's change of angular momentum and their sum.

Uses modules DIMENSIONS_MOD, TRIDI_MOD

Called by SECULR

Compiler warnings (1)

gfortran -Wall -Wextra, compiling only; nothing was run.

  • line 31: Equality comparison for REAL(8) [-Wcompare-reals]

Change log

The changes since rp_1

Changed since rp_1. Declarations only: COMMON/TRIDI/ to TRIDI_MOD, JSON from DIMENSIONS_MOD, IMPLICIT NONE.