htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

commit 80d4207d8e37130b02fa8c772b6d4c9e567f72c9
parent 3fe858b773797b48a61e0ef54952c74f19e43725
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu,  6 Mar 2025 10:28:25 +0100

planets: correct shortwave/CIE calculation

The source was not defined when it should have been. The result was a
crash, which this commit corrects.

Diffstat:
Msrc/planets/htrdr_planets.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/planets/htrdr_planets.c b/src/planets/htrdr_planets.c @@ -346,7 +346,10 @@ setup_source ASSERT(cmd && args); if(cmd->output_type == HTRDR_PLANETS_ARGS_OUTPUT_OCTREES - || cmd->spectral_domain.type == HTRDR_SPECTRAL_LW) /* No source in Longwave */ + /* No source in Longwave. + * Check the spectral domain type on the input arguments, because when the + * source is configured, the spectral dimension may not yet be set */ + || args->spectral_domain.type == HTRDR_SPECTRAL_LW) goto exit; res = htrdr_planets_source_create(cmd->htrdr, &args->source, &cmd->source);