PyREC scaffolding (from YREC development, 7be4133)source on GitHubGlossary

PyREC scaffolding (from YREC development, 7be4133)

YREC at 7be4133: 282 source files · 47,169 lines · 290 definitions. Generated from the code by codemap.py; the code was run only to check the suspected bugs. Each file has a page; each function, class or method a section, with links to what it calls and from what calls it.

Glossary: the code's 898 shared variables, by module, each with what it holds; every page lists the ones it uses.

Overview

What it is. YREC, the Yale Rotating Evolution Code, at its development branch's commit 7be4133 (Nov 2, 2026; the map was written for 09c3b9b and moved on Oct 31 and Nov 9): 282 fixed-form Fortran files in src/, about one routine per file. 85 of them are modules (*_mod.f), which replaced the COMMON blocks of the release rp_1 (where this site began): routines share data through the modules they USE (see the Modules page; every module variable is in the Glossary, under its name in lower case) as much as through arguments, so a routine's modules matter as much as its calls. Since rp_1, the development branch has also removed legacy options (the MHD equation of state, the OPAL 1995 and 2001 equations of state, the Kurucz 1990, LAOL89 (all but its pure-metal table), Alexander 1995 and OPAL92 opacities, and the Monte Carlo loop), with 58 files, and fixed a number of bugs; each page's explanation ends with a "Changed since rp_1" line.

Where to start. main.f is the main program (it has no PROGRAM statement), and its page walks through the whole run. In order, it:

  1. reads the run's settings and tables: PARMIN, then SETUPS;
  2. optionally sets up a calibration: of the Sun (SETCAL) or of a star of given $L$ and $T_\mathrm{eff}$ (SETSCAL);
  3. for each "kind card" (one run of the job), reads the starting model (STARIN), writes the headers (WRTHEAD) and sets the first time step (HTIMER);
  4. evolves it model by model. Each step: mass loss (MASSLOSS); mixing, burning and settling (MIX, with KEMCOM and GRSETT); rezoning (HPOINT); the structure, by four levels of the Henyey iteration (CRRECT), where a divergence ends the run (despite a comment about cutting the step, see main.f); convective mixing (MIXCZ); rotation (GETW, FPFT); lithium burning (LIRATE88, LIBURN); the next time step (HTIMER); output (WRTOUT); and the stop conditions. The composition is not among the Henyey unknowns: MIX changes it over the step with the current structure, the Henyey iteration then solves for $P$, $T$, $r$, $L$ with the composition fixed, and levels 3 and 4 redo the burning and mixing, from the start-of-step composition, with the new structure (an operator split; CRRECT, step 2);
  5. ends each kind card with PUTSTORE and the calibration checks (CHKCAL, CHKSCAL).

How a run goes. (From YREC's documentation, yrec.readthedocs.io, as the code does it.) One call, yrec control.nml1 physics.nml2, runs one job on one star. PARMIN reads the two namelists: the control namelist names the starting model, the tables and the output files (paths may use {YREC_INPUT}, {YREC_START}, {YREC_OUTPUT}, filled from environment variables) and lists the job's runs, the "kind cards"; the physics namelist chooses the physics (equation of state, opacities, atmosphere, nuclear rates, convection and overshoot, diffusion, rotation) and the numerical controls. SETUPS reads the tables. Since YREC is a relaxation code, every job starts from a converged model, from the library in input/models/ (most often one at the deuterium-burning birthline) or from an earlier job's .last file, read by STARIN.

Each kind card then rescales the model to the wanted mass, composition and mixing length (RSCALE; with a zero time step, or with evolution for a pre-main-sequence model, which has no static solution unless deuterium burning carries its luminosity, see main.f, step 3 of the evolution step), or evolves it, model by model, until a number of models, an age or a central abundance is reached.

After each model, WRTOUT appends a line to the .track file (the global properties over time) and numerical details to .short, rewrites .last (the latest model, to restart from), and, as asked, writes snapshots of the structure to .store (PUTSTORE) and pulsation files (WRTMOD). A grid of stars is many such jobs, run by scripts or by the Python wrapper (pip install yrec), which runs the same executable. The test suite (testsuite/, run with pytest) runs a set of such jobs, solar models, brown dwarfs and stars of 0.1 to 9 $M_\odot$ evolved to various stages, and compares their outputs with stored reference outputs; it is how a change to the code is checked.

The code's conventions. Changes in the source carry a comment with their date and the author's initials ("MHP 10/24," "G. Somers 11/14," "KC 2025-05-31," and, for changes made with an AI assistant, "MHP via Claude"), which is why the pages list them. Variable names still follow the old implicit types (A–H and O–Z real, I–N integer, L logical), although every file now declares its types under IMPLICIT NONE. Character strings stay out of the modules, as they once stayed out of the COMMON blocks: file names are read and tied to unit numbers in PARMIN, and the few strings used elsewhere (the version, the mixture's name) are passed as arguments through the main program. The namelist variables live in two modules, NMLPAR_MOD and NMLBYPASS_MOD, with their defaults. A physics routine returns its derivatives with its value (an opacity with its derivatives in density and temperature, for example), so an alternative must return the same set.

Reading this site

Each file's page has an outline in the margin, its text on the left, and the whole file's code on the right, which stays in view: the Fortran, re-indented by its loops and IF blocks (switch to "as in YREC" for the code as written), or its Python translation, whose blocks name the Fortran lines they translate. Every link to lines (in a question, a bug, a call) shows those lines in the code, and a ↗ beside it opens them on GitHub. Each routine's section gives the modules it uses (each linked to the module's page, which lists every unit using it), what calls it, and a flowchart of its calls in the order of the source, nested in boxes for its loops and branches; lines with a compiler's warning (gfortran) or a linter's finding (ruff, in the Python) are marked. Calls are found by reading the code, not by running it. Only src/ is mapped; the .f files under input/, tools for the data tables, are left out. Many files carry changes marked "KC 20…" (Kaili Cao's), with the old lines kept as comments beside them, which is where they are read.

A reading path

A route through the 15 topics of Files by topic, for a newcomer who wants to read every page. Within each topic, read the files named here first, then the rest in the order their topic's table lists them (the routines, then the modules, which are short and best read beside the routines that use them).

  1. The main program and the run's control: main.f first, its page walks through a whole run; then rscale.f, and the calibrations setcal.f and chkcal.f.
  2. Input: parmin.f with nmlpar_mod.f (what every setting means), then setups.f and starin.f.
  3. The structure equations and the Henyey solver: crrect.f, coefft.f (the four equations), then reduce.f and hsolve.f.
  4. Atmospheres, the envelope and the boundary conditions: surfbc.f (the envelope triangle), envint.f, then qenv.f and qatm.f.
  5. The equation of state: eqstat.f, eqstat2.f (the choice and blending of the tables), then eqsaha.f.
  6. Opacities: getopac.f, then setupopac.f and getopal95.f.
  7. Nuclear reactions, energy generation and neutrinos: engeb.f, rates.f, kemcom.f.
  8. Convection, overshoot and the mixing of composition: mix.f (the composition over a step), convec.f, tpgrad.f (mixing-length theory), oversh.f, mixcz.f.
  9. The time step and rezoning: htimer.f, hpoint.f.
  10. Output: wrtout.f, wrthead.f, putstore.f.

This completes a run without rotation or diffusion. The remaining topics are options, each switched on by the namelists:

  1. Microscopic diffusion and settling: grsett.f (the older treatment), then microdiff.f (the newer one) and thdiff.f (Burgers' equations).
  2. Rotation, the structure of a rotating star: fpft.f, shape.f, momi.f, getrot.f.
  3. Rotation, angular-momentum transport and rotational mixing: getw.f (the driver), midmod.f, seculr.f, vcirc.f, codiff.f.
  4. Angular-momentum loss and mass loss: mwind.f, gettau.f (the overturn time), massloss.f, mdot.f.
  5. Numerical utilities: as the other pages call them; intrp2.f, interp.f and osplin.f are the most used.

What the explanations found

Each page has questions for the experts, placed where their context is, and, where the code seems wrong, suspected bugs, each with a possible fix in the code's own style, each checked by running YREC (Nov 9-10, 2026: what reaches it, whether its faulty condition occurred, and what its fix changed), and each marked by what the runs showed; each topic of Files by topic lists its suspected bugs and questions in tables of their own (being reorganized this way page by page, from Nov 9, 2026; the opacity pages are done). The development branch has already fixed several found at rp_1 (for example, MASSLOSS called MDOT with one argument too many, and SECULR's whole-domain option was never switched on). Some that remain: GRSETT's convergence test ignores negative changes, and its coefficient correction sits one midpoint off; in SNEUT, cap-cap stands where cap*cap is expected; VCIRC's restored μ-current option divides by the speed of light CC, which is never set; and the acoustic-depth output (CALCAD) never runs, since nothing sets its switch LACOUT (see ACDPTH_MOD).

Found in passing. Four CALLs name routines not in src/: DERIV (in MMID, a routine passed as an argument, QENV or QATM) and, in PARMIN, GETARG, GETENV and SYSTEM (compiler extensions for the command line, the environment and the shell).

Where the overhaul stands

An overhaul goes in four stages: a documentation site for the old code (this part of the site); the documentation of a new code on the same site, with references to the old one; the new code, with benchmarks (same inputs, same outputs); and a paper. The first stage is complete for rp_1, where every file had an explanation with questions for the code's experts and every page went through one round of review and revision; a page's review findings, folded at its end, refer to rp_1. On Oct 27 every page was moved to 09c3b9b, each with its Python translation in the current structure (the pyrec repository): the translation is checked only by compiling it, and is to be tested routine by routine against the Fortran. On Oct 31 the pages moved to a8a5950, with YREC's public documentation, the YREC paper's notation, the files grouped by topic with a reading path, and the glossary. On Nov 9 they moved to 7be4133, after a round of bug fixes by YREC's developers; each page changed since ends with a "Changed since a8a5950" line. The second stage is drafted: a new design, a high-level design on one page (Nov 9, 2026): a Model holding the star's state and its history, with its physics and numerical methods as families of callables, each a Python base class, in Python with Numba.

Notation

The pages write the physics in the symbols of the YREC paper (Pinsonneault et al., "The YREC Stellar Evolution Code: Public Data Release," YREC_Public_Data_Release_Paper_revised.pdf in the repository's root), and the code's variables in code font. The paper names some quantities only in words; for those, marked *, the pages use the usual symbol. Many arrays hold logarithms (base 10) of the quantity, per shell. The code works in cgs, except that HL is in $L_\odot$ and is not a logarithm, SMASS is in $M_\odot$, the age DAGE is in Gyr and the step DDAGE in yr (DELTS, the same step, in s).

Symbol Meaning Fortran names
$m$* mass coordinate (mass inside a shell); $M$ the total mass HS ($\log m$), HS1 ($m$, g), HS2 (the shell's mass $\Delta m$, g); HSTOT ($\log M$), SMASS ($M/M_\odot$)
$r$, $R$ radius of a shell; $R$ the star's radius HR ($\log r$); RL ($\log R/R_\odot$)
$L$ luminosity (at a shell, or the star's) HL ($L/L_\odot$); BL ($\log L/L_\odot$)
$P$, $T$, $\rho$ pressure, temperature, density HP, HT, HD (their logarithms)
$T_\mathrm{eff}$ effective temperature TEFFL ($\log T_\mathrm{eff}$)
$\kappa$ opacity (Rosseland mean) O, OL ($\log\kappa$), with QOD, QOT its derivatives
$\nabla$, $\nabla_\mathrm{ad}$, $\nabla_\mathrm{rad}$ actual, adiabatic and radiative temperature gradients, $d\ln T/d\ln P$ DEL, DELA, DELR (from TPGRAD); per shell SDEL(2,·), SDEL(3,·), SDEL(1,·)
$H_p$ pressure scale height computed where needed (HSUBP, TPGRAD)
$X$, $Y$, $Z$ mass fractions of hydrogen, helium and metals HCOMP(1,·), HCOMP(2,·), HCOMP(3,·) (HCOMP(4..15,·) the tracked isotopes: ³He, CNO, ²H, ⁶Li, ⁷Li, ⁹Be); the envelope's XENV, ZENV, YENV
$\mu$ mean molecular weight RMU $=\mathcal{R}/\mu$ (the gas constant over $\mu$), with its terms AMU $=\mu_\mathrm{ion}^{-1}$ and EMU $=\mu_e^{-1}$ (in the equation of state)
$Q_{\rho T}$, $Q_{\rho P}$ $(\partial\ln\rho/\partial\ln T)_P$ and $(\partial\ln\rho/\partial\ln P)_T$; in Kippenhahn, Weigert & Weiss's notation $-\delta$ and $\alpha$ QDT, QDP (their derivatives QDTT, QDTP)
$c_P$* specific heat at constant pressure QCP (its derivatives QCPT, QCPP)
$\beta$* ratio of gas to total pressure, $P_\mathrm{gas}/P$ BETA, BETAI ($1/\beta$), BETA14 ($4(1-\beta)/\beta$ in the Yale equation of state)
$\eta$* electron degeneracy parameter ETA
$\epsilon$* energy generation rate per gram ($\epsilon_\mathrm{nuc}$ nuclear, $\epsilon_\nu$ neutrino losses, $\epsilon_\mathrm{grav}$ gravitational) SESUM, SEG(1..7,·), EPSM
$\alpha$ mixing-length parameter (the mixing length in units of $H_p$) CMIXL (per kind card CMIXLA)
$\alpha_c$, $\alpha_e$, $\alpha_m$* step overshoot of cores, envelopes and intermediate zones, in units of $H_p$ (the paper: "0.2 $H_p$") ALPHAC, ALPHAE, ALPHAM; the limit by core size BETAC
$\Omega$ (the paper also $\omega$) angular velocity OMEGA
$j$, $I$ specific angular momentum and moment of inertia of a shell HJM, HI
$\dot M$ mass-loss rate DMDT (in MASSLOSS and MDOT)
$\tau_\mathrm{cz}$, Ro convective overturn time and Rossby number TAUCZ
$f_c$ efficiency of rotational mixing relative to angular-momentum transport FC
$\tau$ optical depth in the atmosphere integration (QATM, HRA)
$S_0$ astrophysical factor of a reaction at zero energy the rate tables of RATES and CROSS_MOD
Variables on this page (15)

alphac, alphae, alpham, betac, cmixla, epsm, fc, lacout, ldify, lnewdif, sesum, taucz, xenv, yenv, zenv

Files by topic

Modules: the data the units share (85 modules).

The 282 files, in 15 topics, in the order of the reading path (in Reading this site); within each topic the routines come first, in reading order, then the modules that hold its data.

The main program and the run's control

The main program, which runs the job kind card by kind card and model by model, with the rescaling of a starting model and the automatic calibrations of the Sun and of other stars.

8 files · 7 suspected bugs (results/output/fragile) · 16 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
(file level)main.f12360/0/14
RUNLOOP_MODrunloop_mod.f6510
RSCALErscale.f432110/0/25
SETCALsetcal.f103110/0/13
CHKCALchkcal.f186110/1/13
SETSCALsetscal.f14311
CHKSCALchkscal.f179110/0/11
SETVERSIONversion.f2411

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Input: namelists, tables, and the starting model

Reading the two namelists and the tables, the run's settings and constants, and the starting model.

12 files · 15 suspected bugs (results/output/fragile) · 15 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
PARMIN +1parmin.f1541111/2/35
NMLPAR_MODnmlpar_mod.f2791031
NMLBYPASS_MODnmlbypass_mod.f1183
REMAPremap.f298112
SETUPSsetups.f396110/0/12
IOUNITS_MODiounits_mod.f54650/0/1
CONSTANTS_MODconstants_mod.f7589
CONFAC_MODconfac_mod.f294
DIMENSIONS_MODdimensions_mod.f44142
STARINstarin.f1049121/1/33
GETMODEL2getmodel2.f111110/0/11
GETYREC7getyrec7.f262110/0/11

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

The structure equations and the Henyey solver

The four equations of stellar structure, their coefficients at each shell, and the Henyey iteration that solves them.

9 files · 2 suspected bugs (results/output/fragile) · 9 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
CRRECTcrrect.f313140/0/12
COEFFTcoefft.f507110/0/14
PHYSICphysic.f19133
REDUCEreduce.f113112
HSOLVEhsolve.f45111
OLDMOD_MODoldmod_mod.f4317
INTVAR_MODintvar_mod.f404
SCRTCH_MODscrtch_mod.f3916
CTOL_MODctol_mod.f262

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Atmospheres, the envelope, and the boundary conditions

The outer boundary condition: the envelope triangle (envelopes integrated at three points around the model's $(\log T_\mathrm{eff}, \log L)$, whose values at the fitting point are fitted by a plane to give the outer boundary condition), the integration of the envelope and atmosphere, and the model-atmosphere tables.

29 files · 17 suspected bugs (results/output/fragile) · 21 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
SURFBCsurfbc.f275114
ENVINTenvint.f975770/2/32
QENVqenv.f136120/0/1
QATMqatm.f12511
BSSTEPbsstep.f74120/0/2
MMIDmmid.f5511
RATEXTratext.f5623
GETNEWENVgetnewenv.f326110/0/23
HRAhra.f34331
SURFPsurfp.f155110/0/13
KCSURFPkcsurfp.f164110/0/13
ALFILEIN +1alfilein.f412110/0/2
ALTABINITaltabinit.f153110/0/31
ALSURFPalsurfp.f327222
ALPRINTalprint.f84111
INTPAR_MODintpar_mod.f403
QENVMIX_MODqenvmix_mod.f262
ENVPRT_MODenvprt_mod.f352
ENVSTRUCT_MODenvstruct_mod.f477
ATMPRT_MODatmprt_mod.f316
ATMSTRUCT_MODatmstruct_mod.f412
ATMOS_MODatmos_mod.f263
ATMOS2_MODatmos2_mod.f3621
ATMOS2C_MODatmos2c_mod.f352
FAC_MODfac_mod.f383
CENV_MODcenv_mod.f272
ALATM01_MODalatm01_mod.f444
ALATM02_MODalatm02_mod.f393
ALATM05_MODalatm05_mod.f272

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

The equation of state

Pressure, density and the thermodynamic derivatives: the Yale equation of state, the SCV and OPAL 2006 tables, and the blending between them.

25 files · 13 suspected bugs (results/output/fragile) · 26 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
EQSTATeqstat.f17510130/0/11
EQSTAT2eqstat2.f364270/0/15
EQSAHAeqsaha.f347124
EQRELVeqrelv.f331123
MUmu.f50111
IFERMI12ifermi12.f6111
ZFERMIM12zfermim12.f7011
EQSCVEeqscve.f474150/0/12
EQSCVGeqscvg.f337111/0/12
SETSCVsetscv.f255110/0/21
OEQOS06oeqos06.f132111
ESAC06 +1esac06.f542360/0/41
EQBOUND06eqbound06.f131112
T6RINTEOS06t6rinteos06.f105111
QUADEOS06quadeos06.f4228
RADSUB06radsub06.f11711
RHOOFP06rhoofp06.f148111
GMASS06gmass06.f61111
READCOEOS06readcoeos06.f163110/0/2
DEBHU_MODdebhu_mod.f3111
CCR_MODccr_mod.f292
SCVEOS_MODscveos_mod.f414
AEOS06_MODaeos06_mod.f526
EEEOS06_MODeeeos06_mod.f344
EOS06MISC_MODeos06misc_mod.f729

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Opacities

The radiative opacity from the OPAL 1995 and the low-temperature (Ferguson et al.) tables, LAOL89's pure-metal table (FPUREZ, used where $Z > 0.1$ and $\log T > 7$, in helium-burning cores; LAOL89's tables for mixtures are removed), and the conductive opacity.

28 files · 21 suspected bugs (results/output/fragile) · 13 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
GETOPACgetopac.f225790/0/24
SETUPOPACsetupopac.f9511
SURFOPACsurfopac.f4422
GETOPAL95getopal95.f430121/0/2
LL95TBLll95tbl.f219111/0/01
OP95XTABop95xtab.f104220/0/21
OP95ZTABop95ztab.f126110/0/21
OP952Dop952d.f7611
OP953Dop953d.f8911
OP954Dop954d.f11411
GETALEX06getalex06.f132110/0/12
READALEX06readalex06.f141110/0/21
ALEX06TABalex06tab.f134110/0/11
GTPURZgtpurz.f135110/0/2
RDZLAOLrdzlaol.f7411
ZSULAOLzsulaol.f5111
CONDOPACP +2condopacp.f277160/0/1
CONDOPACPINTcondopacpint.f109113/0/12
NEWOPAC_MODnewopac_mod.f374
OP95INTERP_MODop95interp_mod.f516
LLOT95_MODllot95_mod.f354
LLOT95A_MODllot95a_mod.f495
LLOT95E_MODllot95e_mod.f343
ALOT06_MODalot06_mod.f443
ALOT06ALL_MODalot06all_mod.f342
GALOT06_MODgalot06_mod.f513
ZLAOL_MODzlaol_mod.f303
ZSLAOL_MODzslaol_mod.f292

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Nuclear reactions, energy generation, and neutrinos

Reaction rates, energy generation, the burning network, deuterium and the light elements, and neutrino losses.

19 files · 21 suspected bugs (results/output/fragile) · 28 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
ENGEBengeb.f1323343/0/15
RATESrates.f677335
KEMCOMkemcom.f413240/0/26
EQBURNeqburn.f219230/0/11
DBURNdburn.f153120/0/12
DBURNMdburnm.f170120/0/11
DEUTRATEdeutrate.f86111
LIRATE88lirate88.f157232
LIBURN +1liburn.f561220/0/42
LIBURN2liburn2.f350220/0/6
NEUTRINOneutrino.f62111/0/0
NULOSSES +1nulosses.f97111
SNEUTsneut.f1355111/0/02
CROSS_MODcross_mod.f293
FLUXES_MODfluxes_mod.f294
DEUTER_MODdeuter_mod.f3311
NEWRAT_MODnewrat_mod.f325
OLDRAT_MODoldrat_mod.f325
PREVCZ_MODprevcz_mod.f353

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Convection, overshoot, and the mixing of composition

Where the model is convective, its temperature gradient, overshoot and semiconvection, and the change of composition over a step (burning and mixing of convection zones).

14 files · 8 suspected bugs (results/output/fragile) · 21 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
MIXmix.f507225
CONVECconvec.f209451/0/11
TPGRADtpgrad.f227571/0/13
HSUBPhsubp.f77142
FINDSHfindsh.f126231
OVERSHoversh.f179112
SCONVECsconvec.f302110/0/24
MIXCZmixcz.f248340/0/23
OVROTovrot.f3744
COMP_MODcomp_mod.f3423
COMP2_MODcomp2_mod.f273
DPMIX_MODdpmix_mod.f286
LIOV_MODliov_mod.f275
PUALPHA_MODpualpha_mod.f352

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

The time step and rezoning

The choice of the next time step, and the redistribution of the mass points at the start of each step.

8 files · 7 suspected bugs (results/output/fragile) · 13 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
HTIMERhtimer.f230120/0/14
XTIMExtime.f11011
YTIMEytime.f181112
PTIMEptime.f138112
ENTIMEentime.f9911
WTIMEwtime.f81110/0/1
HPOINThpoint.f878111/0/45
ENTROP_MODentrop_mod.f332

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Output

The output files: headers, the track and short output, stored models, model files and profiles for pulsation.

19 files · 34 suspected bugs (results/output/fragile) · 21 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
WRTHEADwrthead.f181110/0/12
WRTOUTwrtout.f731110/1/16
WRTLSTwrtlst.f159230/0/2
PUTSTOREputstore.f385220/2/23
STITCHstitch.f256111/2/32
PUTMODEL2putmodel2.f131110/1/01
PUTYREC7putyrec7.f1460/0/11
WRTMODwrtmod.f310220/3/12
WRTMILwrtmil.f111220/0/12
PINDEXpindex.f85110/0/2
PDISTpdist.f125110/0/11
CALCADcalcad.f542110/0/81
ACDPTH_MODacdpth_mod.f5760/0/1
CCOUT_MODccout_mod.f262
CENT_MODcent_mod.f302
LABEL_MODlabel_mod.f376
PULSE1_MODpulse1_mod.f396
PULSE2_MODpulse2_mod.f454
SOUND_MODsound_mod.f315

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Microscopic diffusion and settling

Gravitational settling and thermal diffusion of helium, metals and light elements: the older GRSETT treatment and the newer MICRODIFF. Settling is off by default (LDIFY); with it on, MICRODIFF needs LNEWDIF (also off by default, set by the test suite's settling cases), and GRSETT runs otherwise.

16 files · 16 suspected bugs (results/output/fragile) · 20 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
GRSETTgrsett.f273220/0/22
SETUP_GRSETTsetup_grsett.f330110/0/14
MODEL_TO_EQUALmodel_to_equal.f275110/0/1
LAX_WENDROF1lax_wendrof1.f7622
LAX_WENDROF2lax_wendrof2.f7422
GET_IMP_DIFFCOget_imp_diffco.f3622
TRIDIAG_GStridiag_gs.f31221
EQUAL_TO_MODELequal_to_model.f144110/0/1
MICRODIFFmicrodiff.f245223
MICRODIFF_SETUPmicrodiff_setup.f169110/0/12
MICRODIFF_MTEmicrodiff_mte.f294110/0/22
MICRODIFF_CODmicrodiff_cod.f217120/0/21
MICRODIFF_RUNmicrodiff_run.f204130/0/31
MICRODIFF_ETMmicrodiff_etm.f174110/0/21
THDIFFthdiff.f299220/0/13
GRAVEZ_MODgravez_mod.f365

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Rotation: the structure of a rotating star

The distortion of a rotating star, its moments of inertia and the form factors that correct the structure equations, and the rotation curve.

14 files · 8 suspected bugs (results/output/fragile) · 16 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
FPFTfpft.f109453
SHAPEshape.f170220/0/24
FUNCfunc.f50122
QGAUSSqgauss.f4311
TRAPZDtrapzd.f59110/0/1
GETQUAgetqua.f129111/0/11
INTMOMintmom.f3411
MOMImomi.f92342
GETROTgetrot.f61680/0/1
SOLIDsolid.f1025130/0/21
WCZIMPwczimp.f159243
ERRMOM_MODerrmom_mod.f302
QUADD_MODquadd_mod.f333
QUADRU_MODquadru_mod.f313

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Rotation: angular-momentum transport and rotational mixing

The internal rotation over a step: angular-momentum transport by rotational instabilities and the mixing of composition they drive.

40 files · 19 suspected bugs (results/output/fragile) · 34 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
GETWgetw.f482111/0/02
MIDMODmidmod.f523114
SECULRseculr.f532114
SETUPVsetupv.f467112
VCIRCvcirc.f690121/0/36
CODIFFcodiff.f14911
GETFCgetfc.f119121/0/02
VISCOSviscos.f111110/0/31
GETGRIDgetgrid.f94222
ROTGRIDrotgrid.f28511
DCOEFTdcoeft.f14211
DADCOEFTdadcoeft.f623110/0/53
TRIDIAtridia.f45111
EQ2MODeq2mod.f138111
CHECKJcheckj.f404111
MIXGRIDmixgrid.f16711
MIXCOMmixcom.f20312
CCOEFTccoeft.f8211
NDIFCOMndifcom.f124231
ROTMIXrotmix.f251220/0/2
BURSMIXbursmix.f147110/0/12
BSROTMIXbsrotmix.f271120/0/21
CHECKCcheckc.f188111
EGRID_MODegrid_mod.f347
EGRIDDER_MODegridder_mod.f333
DIFAD_MODdifad_mod.f314
DIFAD2_MODdifad2_mod.f333
DIFAD3_MODdifad3_mod.f503
DWMAX_MODdwmax_mod.f312
OLDROT_MODoldrot_mod.f356
OLDROT2_MODoldrot2_mod.f385
OLDPHY_MODoldphy_mod.f413
MDPHY_MODmdphy_mod.f4110
ROTDER_MODrotder_mod.f322
ROTEN_MODroten_mod.f303
TAUKH_MODtaukh_mod.f352
TEMP_MODtemp_mod.f345
TEMP2_MODtemp2_mod.f375
TRIDI_MODtridi_mod.f356
VFACT_MODvfact_mod.f362

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Angular-momentum loss and mass loss

Magnetic braking by winds (with the convective overturn time it needs), disk locking, and mass loss or accretion.

14 files · 8 suspected bugs (results/output/fragile) · 30 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
MWINDmwind.f218240/0/13
COWINDcowind.f118113
MCOWINDmcowind.f172113
WINDwind.f152110/0/13
AMCALCamcalc.f8922
GETTAUgettau.f199333
TAUCALtaucal.f231110/0/15
TAUINTtauint.f196112
TAUINTNEWtauintnew.f289110/0/23
MASSLOSSmassloss.f245111/0/02
MDOTmdot.f327111/0/13
DISK_MODdisk_mod.f265
OVRTRN_MODovrtrn_mod.f3018
MASSCHG2_MODmasschg2_mod.f303

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

Numerical utilities

Interpolation, splines, quadrature and linear solvers, most of them from Numerical Recipes or published algorithms.

27 files · 3 suspected bugs (results/output/fragile) · 16 questions
DefinitionFileLinesCallersCallsSuspected bugsQuestions
INTERPinterp.f436151
INTER3inter3.f3736
INTRP2intrp2.f37712
XRNG4xrng4.f24111
LOCATElocate.f37231
POLINTpolint.f6127
CSPLINEcspline.f55221
SPLINCsplinc.f32131
SPLINJsplinj.f2923
SPLINTsplint.f56351
SPLINTD2splintd2.f59131
KSPLINEkspline.f29420
KSPLINTksplint.f43420
OSPLINosplin.f506360/0/1
MEVALmeval.f265110/0/11
SPLINEspline.f14813
CASEScases.f11014
CHOOSEchoose.f148141
SEARCHsearch.f9211
SLOPES +1slopes.f141112
SPLIN_MODsplin_mod.f334
BOOLEboole.f82121
BANDWbandw.f186112
CTRIDIctridi.f32111
SIMEQCsimeqc.f78110/0/11
LUDCMPludcmp.f9711
LUBKSBlubksb.f5113

Suspected bugs: results/output/fragile. Results: the fix moved a run clearly beyond a null change, or the bug stopped a run; output: it writes wrong output only; fragile: the others, whose fixes can wait for the full test suite.

README

description


Documentation Zenodo yreclab

YREC is a modern & efficient public stellar evolution code delivering fast, precise models across a wide spectrum of initial conditions and physical prescriptions. Stellar evolution calculations from YREC have been used to study the physics of solar analogs, evolved giants, low-mass stars, rapidly rotators, and magnetically-active stars. With modern microphysics and prescriptions for rotation, surface magnetism, composition, and mixing, YREC provides a versatile foundation for tackling many different astrophysical problems. In the era of precision stellar astrophysics, YREC offers an open, performant, and lightweight alternative to existing codes.

To get started using YREC, consult the documentation. Try the quick start guide or dive into the interactive YREC web interface.

Software Ecosystem

YREC User Tools: Functions and guidelines for using the Yale Rotating Evolution Code

ISTARY: Isochrones and Stellar Tracks for Astrophysics Research by the YREC collaboration

Kīauhōkū: Python utilities for stellar model grid interpolation

yreclab: Stellar evolution web laboratory with the Yale Rotating Evolution Code

Community

Feedback and contributions are welcome, please open an issue or create a pull request.

Namelists, models, or tools relevant to YREC are invited to be posted to the YREC Zenodo community.

You can subscribe to the YREC newsletter here.

Citing

If you use YREC in your research, please cite one or more of the relevant papers.

Larson& Demarque 1964: The original Yale stellar evolution code paper.

Pinsonneault et al. 1989: The paper documenting the addition of rotation to the YREC code.

Demarque et al. 2008 A paper summarizing the classical model properties of the YREC code, with a focus on convection.

van Saders & Pinsonneault 2013: This paper updates the description of rotation and magnetized winds in the code.

Pinsonneault et al. 2026: The YREC public release paper