entime.f
99 lines · 1 definitions · on GitHub (7be4133)
Python version: entime.py, 56 lines, on the right (switch to Python above the code).
Purpose
This file limits the time step so that the surface changes from one model to the next stay within the envelope "triangle": the changes of $\log T_\mathrm{eff}$ and $\log L$ must not exceed the triangle's size, so that the surface boundary condition is not extrapolated far outside the envelope integrations.
How it fits
- Inputs: the arguments
DELTS(the previous step),HL(luminosity),TEFFL,M; the previous model's surface luminosityHLSUROandTEFFLO(OLDMOD_MOD, saved by HPOINT before the rezoning, and by main.f and STARIN); the settingsTRIDT,TRIDL(the triangle's sizes, formerly/CENV/) andATIME(13)(the limit, formerly/CTLIM/), fromNMLPAR_MOD. - Who calls it: HTIMER, which sets the next time step.
- Output:
EDELT, the time step this criterion allows.
The method
$$f = \max\left(\frac{|\Delta\log T_\mathrm{eff}|}{\Delta T_\mathrm{tri}}, \frac{|\Delta\log L|}{\Delta L_\mathrm{tri}}\right), \qquad f \leftarrow \min\!\left(\max\left(f, \frac{1}{a}\right), a\right), \qquad \mathtt{EDELT} = \frac{\Delta t}{f},$$
with $a$ = ATIME(13), the largest factor by which the step may change; $f = 1$ if nothing changed. A previous step of 0 thus gives EDELT = 0, which HTIMER does not catch (htimer.f, suspected bug 1). The triangle's sizes are also copied into HMAX(1:2), which nothing reads (unused?). The header's output line, "time step for requested change in P,T,R,L," is copied from PTIME: Only $T_\mathrm{eff}$ and $L$ are tested here (settled from the code, Nov 9, 2026: line 68↗; lines 73–95↗).
Definitions
subroutineENTIME
Time step from the envelope triangle: scales the last step so that $\Delta\log T_\mathrm{eff}$ and $\Delta\log L$ stay within the triangle, by a factor bounded by ATIME(13).
Uses modules DIMENSIONS_MOD, NMLPAR_MOD, OLDMOD_MOD
Called by HTIMER
Compiler warnings (1)
gfortran -Wall -Wextra, compiling only; nothing was run.
- line 90: Equality comparison for REAL(8) [-Wcompare-reals]
Change log
The changes since rp_1
Changed since rp_1. Declarations only: COMMON blocks to modules, IMPLICIT NONE; the unused COMMON blocks are gone, which settles that half of former question 1.
Changed since a8a5950. $\Delta\log L$ is taken against the saved surface luminosity HLSURO instead of HLO(MO): HPOINT re-splines HLO onto the new mesh, so HLO(MO) was an interior point or a stale entry whenever the number of points changed (this settles HPOINT's former question 6).