masschg2_mod.f
30 lines · 1 definitions · on GitHub (7be4133)
Python version: masschg2_mod.py, 15 lines, on the right (switch to Python above the code).
Purpose
MASSCHG2_MOD holds the quantities of the (experimental) thermal response of the convective envelope to accretion, shared by MASSLOSS, MDOT and COEFFT. It replaces COMMON/MASSCHG2/ (MHP via Claude, 10/14/26). All members are REAL*8.
What its variables hold, who sets them, who reads them.
SCEN: the convective envelope's mass-averaged $(\mathcal R/\mu)(\tfrac32\ln T - \ln\rho)$ (an entropy per gram), computed byMASSLOSSand then set to 0 in both branches that follow; read byMDOT.SACC: the same quantity at the base of the envelope, set byMASSLOSS(massloss.f, line 201↗); read nowhere (only commented-out lines of MDOT and MASSLOSS read it).DLOGT,DLOGP: the changes of $\log T$ and $\log P$ thatMDOTderives fromSCENand applies to the envelope; read also byCOEFFT, which adds them in its entropy terms with accretion. SinceSCEN= 0, they are zero in practice (MDOT's and MASSLOSS's notes ask whether this code is kept for later work).SMASS0: the total mass (solar units) after the step's mass change, set byMDOT(mdot.f, line 263↗); read nowhere (only a commented-out line of COEFFT reads it). Both are kept on purpose: they belong to the experimental mass-loss code, "not finished," not "dead" (settled fromKNOWN_ISSUES.md, issue 12, Nov 9, 2026).
Design
A blanket USE MASSCHG2_MOD. At rp_1, MASSLOSS declared DLOGT and DLOGP in the opposite order from MDOT and COEFFT, so under COMMON's storage association each name there held the other's value; MASSLOSS uses neither, so this had no effect, and the module removes the hazard.
Definitions
moduleMASSCHG2_MOD
Change log
The changes since rp_1
Changed since rp_1. New file: COMMON/MASSCHG2/ as a module.