History:

19 Nov 2002: A small bug in HLINOP which allowed the wavelength to go negative if the REFLECT switch was turned on was fixed. Thanks to Kjell Eriksson for reporting it.

4 Jun 2003: I fixed the example files so they actually work;-), the old line file referenced the wrong model (one that is on my machine but not the tarred one!). I also have added compiler options for Intel's Fortran compiler under Linux to the makefile.

26 Aug 2003: Two minor bugs fixed which meant the resonance and Stark broadening in the Lyman alpha red wing was incorrect (bugs meant they were not computed at all).

27 April 2005: Small bug in HLINPROF, meant that log(0) occurred if using the self-broadening grids and interrogating a wavelength beyond the range of the profile grids. Now fixed thanks to Ulrike Heiter.

9 Jul 2008: SYNTH code updated so that it warns, rather than crashes, if one tries to feed it a spherical model. Thanks to Nik.

2 Mar 2011: Small bug for case where XHOLT4000 goes to zero fixed. Thanks to Kjell.

2 Mar 2011: hbop code added.

11 July 2023: Bug fixed in LOGINT routine in HBOP.f.  Thanks to Richard Hoppe. 
12 July 2023: Small improvement to LOGINT - log-linear interpolation performs better than log-log.

17 Dec 2025:  Added hbop_auto.f, and some small changes to hbop.f.  (Note these changes were actually made a year earlier, took some time to post to github;)).

25 Nov 2026: hbop.f - the neutral-perturber (excluded-volume) part of the occupation probability in WCALC is now switchable with CALL HBOP_SET_EXCLUDED_VOLUME(SCALE), which multiplies the excluded volume of neutral H and He (SCALE = 1: Hummer & Mihalas hard spheres as before; SCALE = 0: off). The default is now off. The charged-particle part is unchanged. HBOP recomputes the populations when the setting changes. Test suite and GitHub Actions CI added in tests/ (Mingjie Jian).

25 Nov 2026: hlinprof.f - HLINPROF now uses the full Stehle & Hutcheon (1999) tables (stehle_long.dat, built from the CDS catalogue J/A+AS/140/93 with tools/make_stehle_table.py; corrected Paschen files of 2007): Lyman (n_up 3-30), Balmer and Paschen (to n_up 30), T 2500 K - 1.26e6 K, log n_e 10 - 19.5. Lyman alpha stays with HLINOP. Above a line's last tabulated density the last profile is scaled quasistatically (F0 ~ n_e^(2/3)); below 1e10 cm^-3 the first profile is used; outside the temperature range and for lines without tables HLINPROF returns HLINOP. Padding rows in the CDS files (alpha printed as 0) are removed; a log10(0) at alpha = ALPHA(2) in STEHLE fixed. HSELF_PDWIDTH, HE_PDWIDTH, RAD_WIDTH and ALI_GRIEM replaced by the versions distributed with SME (SMElib), which take (NLOW, NUP), apply self and He broadening only to the lines they were derived for, and give radiative widths for all lines (RAD_WIDTH header: PB, 12/6/2013). hbop.f - line profiles from HLINPROF by default, with the HLINOP cutoffs (new function HLCUT in hlinop.f); CALL HBOP_SET_LINE_PROFILE(0) restores HLINOP for all lines (Mingjie Jian).

25 Nov 2026: hlinop.f - STARK1 now convolves the normalised ion quasistatic profile with the normalised electron profile (impact Lorentzian with the Lewis-cutoff width plus the quasistatic electron wing) instead of adding the parts, which gave areas of 1.7-2.1 and peaks 3-4 times too high. Chosen over convolving norm(ion + electron quasistatic) with norm(impact) by comparison with the Stark-only profiles of Stehle & Hutcheon (1999; 171 Balmer and Paschen cases, Paschen as a blind test) and Lemke (1997, VCS; 48 Brackett cases): median HWHM and peak within 2-5 per cent, wings within 5-8 per cent. The convolution is done once per line and plasma state by FFT and cached (STARK1C); beyond 40 widths the normalised parts are added. The earlier construction is kept as STARK1L, used for Lyman alpha and with CALL HLINOP_SET_CONVOLUTION(0) (called HLINOP_SET_STARK in an intermediate version). STARK1PARTS returns the parts (line constants cached on N, M and the line centre) (Mingjie Jian).

25 Nov 2026: hlinop.f - HPROFL now convolves the Doppler profile (with fine structure), the Lorentz profile (resonance, van der Waals, natural) and the Stark profile (HPCONV) instead of taking the dominant mechanism inside the core and adding all of them outside it, which added up to 39 per cent to the area where Doppler broadening dominates and left Stark broadening out of such cores. The Doppler and Lorentz parts enter through their analytic Fourier transforms, the Stark profile is sampled (with discrete normalisation) and the result is cached per plasma state. Areas are now 1 to 0.1 per cent; HLINOP and the tabulated profiles join without jumps (H30 table / H31 HLINOP). One switch, HLINOP_SET_CONVOLUTION(MODE), covers STARK1 and HPROFL; MODE = 0 reproduces the code before Nov 2026 bit for bit. Lyman alpha keeps the earlier code (Mingjie Jian).

25 Nov 2026: hbop.f - fixes. (1) The dissolved fraction uses the effective quantum number from the code's own level energies (new function HBNSTAR; IONH, the infinite-mass Rydberg, put the n = 2 dissolution edge 2 A blueward of the series limit) and is computed in vacuum wavelengths (WAVE is in air above 2000 A, as for the lines); the edge now coincides with the series limit at which HLINOP cuts the lines. (2) NBF = 15 (was 6; HBF has Gaunt factors for n = 1-15), so bound-free absorption from n = 7-15 is included; HBOP_AUTO (NBF = 15) works up to the n = 15 edge at 20.5 micron (it stopped at 3.28 micron). (3) Levels whose red-wing taper has underflowed are skipped, which removes Inf/NaN in TOTAL and CONTIN beyond about 5 micron. (4) Line broadening by hydrogen uses the total H I density NH instead of the ground-state population NP(1) (Mingjie Jian).

25 Nov 2026: hlinprof.f - HLINPROF convolves the tabulated profiles (Stark with the thermal Doppler profile of H) with the remaining Doppler broadening (a Gaussian of 1/e half width WAVE0*sqrt(DOP**2 - DOP_thermal**2), e.g. microturbulence, which was ignored for tabulated lines) and with the Lorentz profile of the radiative, self and helium widths (previously added beyond 0.2 A, up to 4 per cent extra area). Done by FFT with analytic transforms of the Gaussian and Lorentzian and cached (HLPCONV); the tabulated profile keeps its own area. The same switch HLINOP_SET_CONVOLUTION covers this; ISELF = 1 and ICONV = 2 keep the earlier treatment. hlinop.f, hlinprof.f - the cached convolutions (STARK1C, HPCONV, HLPCONV) are stored on 1200 instead of 240 logarithmic points (interpolation errors up to 2 per cent in steep shoulders), and the grid size no longer overflows the integer range for extremely narrow components (segmentation fault for Lyman 10 at 1e16 cm^-3) (Mingjie Jian).

25 Nov 2026: hlinprof.f - STEHLE interpolates the tabulated profiles between the detuning nodes with a monotone cubic (Fritsch & Carlson 1980, the PCHIP form) in log S against log alpha instead of linearly in these variables. The linear form lies below the profile in Doppler-dominated cores: half widths were 1-6 per cent narrower than the widths given with the CDS tables and areas 0.96-0.99, which had been taken for a normalisation of the tables. Now areas are 0.98-1.00 and half widths within 3 per cent of the tabulated ones. HLINOP_SET_CONVOLUTION(0) keeps the linear form; HGRID (ISELF = 1) is unchanged (Mingjie Jian).

25 Nov 2026: hlinprof.f - Lyman alpha now comes from the Stehle & Hutcheon table (HLYAPRF): the core is the tabulated profile convolved with the remaining Doppler width and the Lorentz profile of the natural (left out redward of 1240 A, as RAYLCUT in HPROFL), resonance (Ali & Griem) and helium (van der Waals) widths as in HPROFL; the red side is multiplied by the Boltzmann factor exp(-hc dsigma/kT) (Stehle 1994, as in STARK1); beyond -4000 cm^-1 (1278 A) the red wing is the Allard et al. (1998) H-H and H-H+ quasi-molecular profiles (HLYAFW in hlinop.f, tables from HPROFL) plus half the tabulated quasistatic wing (the H-H+ profiles count protons only, the tabulated wing ions and electrons), 0 redward of 5000 A; between the line centre and -4000 cm^-1 the red core is multiplied by a factor going linearly to the value that joins the far wing. HLINOP (STARK1, HPROFL) keeps the earlier Lyman alpha, which is good to n_e ~ 1e14 cm^-3 but has half widths 0.1-0.9 of the tabulated ones and peaks up to 9 times too high at 1e15-1e18 cm^-3. HLINOP_SET_CONVOLUTION(0) and ISELF = 1, ICONV = 2 send Lyman alpha to HLINOP as before. hbop.f - HBOP takes Lyman alpha from HLINPROF with the HLINOP cutoffs (Mingjie Jian).

25 Nov 2026: hlinop.f, hlinprof.f - the convolution caches of STARK1C, HPCONV and HLPCONV held 128 states in turn, so in the call order of synthesis codes (wavelength by wavelength, at each wavelength every depth and line) every call rebuilt the convolution once there were more than 128 (line, depth) states (4.4 ms per call for 72 depths x 28 lines). They now hold up to 6144 states each, stored densely and found by an open-addressing hash index (new subroutine HLCKEY), and emptied when full; the logarithmic output grid is computed instead of stored and the cached profiles are kept as single-precision logarithms (changes below 2e-6), so a state takes 9.6 kB and memory is taken only for the states used (50 MB in all for 72 depths x 28 lines including the table, at most 59 MB per routine); CALL HLINOP_CLEAR_CACHE empties them (a synthesis code calls it for each new model). The cached profiles are interpolated from the FFT grid in log space instead of linearly (closer to a 64 times finer reference; changes up to 1.6e-4). HLFFT uses a twiddle table (twice as fast) and the convolutions use real-input transforms (new subroutines HLRFFT, HLTWIN); STEHLE precomputes the logarithms of the tabulated detunings and profiles and the monotone-cubic slopes when the table is read (30 MB with the table, was 10 MB), finds the interval by bisection and keeps the temperature and density weights of the last call (results bit for bit as before), and the new STEHL2 returns the profile on both sides of the line in one call, which HLPCONV uses on its symmetric grid; HLPCONV reuses the end points of its area quadrature. The padding guard in STEHLE no longer reads ALPHA(0) (out of bounds; no effect on the results). For 72 depths x 28 Balmer lines: 0.7 ms per state to build, then 0.08 microsecond per call (0.05-0.1 with HLINOP_SET_CONVOLUTION(0)); H alpha alone at 72 depths, 2000 wavelengths: 0.07 s (0.03 s with HLINOP_SET_CONVOLUTION(0)) (Mingjie Jian).

25 Nov 2026: interfaces for synthesis codes that call the profiles themselves (such as SME), so that they can use these files unchanged. hlinprof.f - CALL HLINPROF_SET_FILES(STEHLE, SELF, VCS) sets the table files at run time (full paths up to 592 characters; blank keeps the name from DATA.FILES); INTEGER FUNCTION HLINPROF_SOURCE() returns which profile the last call used (1 Stehle & Hutcheon table, 2 VCS table, 0 HLINOP). hbop.f - HBOP_LEVELS(NH,NHE,NE,T,NLEV,W,NLTE) returns the occupation probabilities and LTE populations, HBOP_BF(WAVE,NH,NHE,NE,T,W,NP,NLTE,CONTIN) the bound-free opacity with the dissolved levels; HBOP uses the same code (internal HBOPLV, HBOPBF, HBOPEN), with results bit for bit as before (Mingjie Jian).

25 Nov 2026: hlinprof.f - CALL HLINPROF_SET_MESSAGES(0) switches off the informational messages of HLINPROF, STEHLE and HGRID ("Will use Stehle's tables ...", " Using Hlinop code!"), for codes that report the tables in use themselves; default 1 (messages on, as before). The VCS calls in HLINPROF pass arrays (VCS now takes assumed-size arrays), so that hlinprof.f compiles without -std=legacy (newer gfortran rejects a scalar passed for an array argument) (Mingjie Jian).

25 Nov 2026: hbop.f - HBOP_BF_DISSOLVED(WAVE,NH,NHE,NE,T,W,NP,NLTE,NBFMAX,CONTIN) returns only the dissolved-level part of the bound-free opacity (levels 1..NBFMAX for which WAVE lies redward of their edge), for codes that already compute the ordinary bound-free opacity above the edges (e.g. Kurucz's HOP); same code as HBOP (internal HBOPBX), HBOP bit for bit as before (Mingjie Jian).

25 Nov 2026: hlinop.f, hbop.f, hbop_auto.f - CALL HLINOP_SET_MEDIUM(IAIR) sets the wavelength medium: IAIR = 1 (default, as before) air above 2000 A and vacuum below, IAIR = 0 vacuum at all wavelengths. It applies to the series limits and red cuts of HLINOP and HLCUT, the bound-free edges of HBOP (HBOP_BF, HBOP_BF_DISSOLVED) and the line list of HBOP_AUTO; before, vacuum wavelengths above 2000 A were treated as air (Mingjie Jian).

26 Nov 2026: hlinprof.f - optional blending of the tabulated Balmer profiles H10-H22 with the Stark profiles of Tremblay & Bergeron (2009, ApJ 696, 1755; November 2015 table, SYNSPEC tremblay.dat), which include the non-ideal (Hummer & Mihalas critical field) cut of the proton microfield and are computed 0.5-1.5 dex beyond the last Stehle & Hutcheon density (the Inglis-Teller limit). CALL HLINOP_SET_TB09(FILE, MODE, DLO, DHI): MODE = 1 gives the profile (1-w) Stehle + w TB09 with w = 3t^2 - 2t^3, t = (log n_e - (L - DLO))/(DLO - DHI) in [0, 1], L = log10 of the line's last tabulated Stehle density; MODE = 0 (default) Stehle only, bit for bit as before. The two tables differ by an L1 of 0.16-0.30 at L and 0.02-0.07 at L - 1 (the non-ideal cut, which Stehle's ideal profiles lack). In fits of H10-H22 in seven metal-poor dwarfs (UVES) and 240 DESI turnoff stars, DLO = 2.0, DHI = 1.5 fitted best (better than either table alone in the dwarfs) and is recommended; it is meant to be used with the charged-perturber occupation probability. The old evaluator is now STEHLS (it records L in COMMON /HLSLIM/), STEHL2 the blending wrapper, HTB09P reads SYNSPEC's tremblay.dat unchanged (Lemke format, all 69 lines: Lyman, Balmer, Paschen, Brackett; a file that cannot be read stops the run; the table is not distributed here). The setting empties the profile caches (Mingjie Jian).
