tridi_mod.f
35 lines · 1 definitions · on GitHub (7be4133)
Python version: tridi_mod.py, 22 lines, on the right (switch to Python above the code).
Purpose
TRIDI_MOD holds a tridiagonal system $a_i u_{i-1} + b_i u_i + c_i u_{i+1} = d_i$ and its solution, shared between the routines that set up the implicit steps of rotational mixing and the routines that solve them. Shared by 6 routines. It replaces COMMON/TRIDI/ (MHP via Claude, 10/14/26); JSON comes from DIMENSIONS_MOD.
What its variables hold, who sets them, who reads them.
A,B,C,D(JSONeach): the sub-diagonal, diagonal, super-diagonal and right-hand side. Set byDCOEFT(angular-momentum transport, solved byTRIDIA) andCCOEFT(composition transport, solved byCTRIDI), and byGETQUA(the quadrupole moment, solved in place).U(JSON): the solution, set byTRIDIA,CTRIDIandGETQUA; read byTRIDIA(which turns it into the change of angular momentum),MIXCOMandGETQUA(QUADinQUADRU_MOD).GAMA(JSON): the Thomas algorithm's work array, set and read by the solvers;DCOEFTalso uses it as work space while setting up.
Design
A blanket USE TRIDI_MOD in each routine. The one-letter names A, B, C, D, U are global in every file that uses the module, so a local of the same name added to one of them later would silently be the module's: the hazard RUNLOOP_MOD's header describes (KNOWN_ISSUES.md issue 22).
Definitions
moduleTRIDI_MOD
Uses modules DIMENSIONS_MOD
Change log
The changes since rp_1
Changed since rp_1. New file: COMMON/TRIDI/ as a module.