star-line

Structure for accelerating line importance sampling
git clone git://git.meso-star.fr/star-line.git
Log | Files | Refs | README | LICENSE

commit 4692b695c2e313a7acfef82f4bfbc43cc1f75a02
parent 06d74cd441d850dc197cd75a29702dc600e873bf
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 23 Mar 2026 10:12:16 +0100

Fix the computation of the Lorentz gamma

The computation did not account for the temperature-dependent broadening
of the line.

In fact, this function appears to have been written on the assumption
that the reference temperature in the database and the temperature at
which the Lorentz half-width of the line was calculated were identical.
That may have been the case more than three years ago, in the context
for which the library was originally designed, but it cannot be
considered to apply in general.

Diffstat:
Msrc/sln.h | 9++++++++-
Msrc/sln_line.c | 5+++--
2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/sln.h b/src/sln.h @@ -378,13 +378,20 @@ static INLINE double sln_compute_line_half_width_lorentz (const double gamma_air, /* Air broadening half width [cm^-1.atm^-1] */ const double gamma_self, /* Air broadening half width [cm^-1.atm^-1] */ + const double temperature, /* [K] */ const double pressure, /* [atm^-1] */ + const double n_air, const double concentration) { + const double TREF=296; /* Ref temperature [K] for HITRAN/HITEMP database */ const double Ps = pressure * concentration; - const double gamma_l = (pressure - Ps) * gamma_air + Ps * gamma_self; + const double n_self = n_air; /* In HITRAN n_air == n_self */ + const double gamma_l = + pow(TREF/temperature, n_air) * (pressure - Ps) * gamma_air + + pow(TREF/temperature, n_self) * Ps * gamma_self; ASSERT(gamma_air > 0 && gamma_self > 0); ASSERT(pressure > 0 && concentration >= 0 && concentration <= 1); + return gamma_l; } diff --git a/src/sln_line.c b/src/sln_line.c @@ -454,8 +454,9 @@ line_setup line->wavenumber = line_center(&shtr_line, tree->args.pressure); line->gamma_d = sln_compute_line_half_width_doppler (line->wavenumber, molar_mass, tree->args.temperature); - line->gamma_l = sln_compute_line_half_width_lorentz(shtr_line.gamma_air, - shtr_line.gamma_self, tree->args.pressure, mol_params->concentration); + line->gamma_l = sln_compute_line_half_width_lorentz + (shtr_line.gamma_air, shtr_line.gamma_self, tree->args.temperature, + tree->args.pressure, shtr_line.n_air, mol_params->concentration); line->molecule_id = shtr_line.molecule_id; exit: