scrtch_mod.f
39 lines · 1 definitions · on GitHub (7be4133)
Python version: scrtch_mod.py, 27 lines, on the right (switch to Python above the code).
Purpose
SCRTCH_MOD holds the local physics of the interior at each shell, as computed in the last pass of the structure equations: energy generation, opacity, temperature gradients, ionization, convective velocity. Many routines read it later in the step (mixing, burning, regridding, output). Shared by 16 routines. It replaces COMMON/SCRTCH/ (MHP via Claude, 10/14/26); JSON comes from DIMENSIONS_MOD.
What its variables hold, who sets them, who reads them. COEFFT stores all of them at each shell IM; PHYSIC stores SO, SDEL and SVEL again when it recomputes the physics.
SESUM(JSON): the sum of the nuclear energy generation's five termsEG(1)…EG(5)(0 below the cutoff temperatureTCUT(1));SEG(7,JSON): those five as fractions ofSESUM, then the neutrino termEG(6)and the gravitational termHHC(EGRAV) (SEG(6),SEG(7)). Read byHPOINT(which interpolates them, throughOSPLIN, to the grid at the start of the step),MIDMOD,WRTMIL, the setup of rotation (FRACNUCinROTDER_MOD) and the output (PUTSTORE,STITCH,WRTMOD).SO(JSON): the opacity. Read byHPOINT,MIDMOD,VISCOSand the output (PUTSTORE,STITCH,WRTMOD,WRTOUT).SDEL(3,JSON): $\nabla_\mathrm{rad}$, $\nabla$, $\nabla_\mathrm{ad}$.ROTMIXreplacesSDEL(2,·)for a while and restores it. Read by the burning and mixing routines (LIBURN,LIBURN2,MICRODIFF_MTE,SETUP_GRSETT,ROTMIX),GETTAU,HPOINT,MIDMOD,PHYSICand the output.SVEL(JSON): the convective velocity (cm/s); read byGETTAU,HPOINT,MIDMODand the output.SBETA(JSON),SETA(JSON),SFXION(3,JSON),SCP(JSON): $\beta$ (gas over total pressure), the degeneracy parameter $\eta$, the three ionization fractions and $c_P$, for the stored model (PUTSTORE,STITCH).LOCONS(JSON): meant to say whether conduction dominates the opacity; set byCOEFFTfrom itsLOCOND, which it always sets to true (coefft.f, line 161↗; coefft.f, line 444↗), and read by no routine (unused?).
Design
A blanket USE SCRTCH_MOD in each routine.
Definitions
moduleSCRTCH_MOD
Uses modules DIMENSIONS_MOD
Change log
The changes since rp_1
Changed since rp_1. New file: COMMON/SCRTCH/ as a module.