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

ndifcom.f

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

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

Variables on this page (1)

json

Purpose

Mixing of composition by rotationally induced instabilities, as part of angular momentum transport. Its comment: it "calculates the diffusion of composition due to angular momentum transport," by transforming to an equally spaced grid ("in radius," the comment says; the grid is in fact in the coordinate $\chi$ of GETGRID), solving a diffusion equation and transforming back. It finds each unstable region and hands it to MIXGRID (the grid) and MIXCOM (the solve).

How it fits

  • Inputs: the diffusion step DT (s); the mixing coefficients COD2 at the model points; the transport velocities HV (a region is unstable where HV > 0); the model (HD, HL, HP, HR, HS, HS1, HS2, HSTOT); the convection flags LCZ (overshoot included); the search range IMIN..IMAX; the flag LOK (final iteration); and the species range JBEG..JEND.
  • Who calls it: SECULR (the angular momentum transport) and BURSMIX (burning and mixing).
  • What it calls: MIXGRID and MIXCOM.
  • Outputs: HCOMP updated in place; IBEG, IEND, ECOD2 and EM for the last region (kept for the next call).
  • Modules: only DIMENSIONS_MOD (JSON); the grid is shared between MIXGRID and MIXCOM through EGRID_MOD.

The method

  • Before the last iteration (LOK = F): MIXCOM is called once for the region found earlier (IBEG..IEND, with its grid), so that the comments' aim, the change of the $\mu$ gradient caused by mixing, can be found (lines 64–66↗). The header's "the program checks for additional unstable regions" is done by the caller: SECULR scans the regions itself, builds each one's grid with ROTGRID and calls NDIFCOM once per region (seculr.f, lines 304–430↗) (settled from the code, Nov 9, 2026). The comment says only H, ⁴He and ³He are mixed then; which species are mixed is set by the caller through JBEG..JEND: SECULR passes rows 1–4 before its last iteration and rows 5–11 (5–15 with LEXCOM) after it (seculr.f, lines 419–420↗, seculr.f, lines 466–475↗), as the comments say; BURSMIX passes rows 4 to 11 (or 15) on every call (bursmix.f, lines 69–70↗), since its substeps burn ³He too and it restores $X$, $Z$ and the closure for $Y$ afterwards (settled from the code, Nov 9, 2026).
  • On the last iteration (LOK = T): it scans IMIN..IMAX for runs of interfaces with HV > 0. Each run, from the zone below its first such interface (IBEG) to the zone above its last (IEND), gets its own grid from MIXGRID and its own solve in MIXCOM. A region of only two zones (LDUM2) is skipped (lines 102–112↗).

Definitions

subroutineNDIFCOM

lines 2–124 · GitHub

Finds each run of unstable interfaces (HV > 0) between IMIN and IMAX and mixes its composition (on the final call), or mixes the last region again (before it).

Uses modules DIMENSIONS_MOD

Called by BURSMIX, SECULR ×2

Flowchart of its calls, in order (3)
if (.NOT.LOK), lines 64–66
repeated from label 60 (GO TO at line 120), lines 76–120

Change log

The changes since rp_1

Changed since rp_1. Declarations only: IMPLICIT NONE, JSON from DIMENSIONS_MOD.