From 6763a2f77a11d30bfb05e86b7fb20f215b2ecd88 Mon Sep 17 00:00:00 2001 From: Hemaditya Malla Date: Wed, 8 Nov 2023 15:02:46 +0100 Subject: [PATCH] Improve error handling in custom photoionization settings --- src/m_photoi_helmh.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/m_photoi_helmh.f90 b/src/m_photoi_helmh.f90 index dcc228a8..e16c392f 100644 --- a/src/m_photoi_helmh.f90 +++ b/src/m_photoi_helmh.f90 @@ -124,6 +124,7 @@ subroutine photoi_helmh_initialize(tree, cfg, is_used, eta) coeffs = coeffs * (frac_O2 * gas_pressure)**2 ! 1/m^2 case ("custom") call CFG_get_size(cfg, "photoi_helmh%lambdas", n_modes) + if (n_modes < 1) error stop "Custom photoionization lambdas and coeffs missing." allocate(lambdas(n_modes)) allocate(coeffs(n_modes)) call CFG_get(cfg, "photoi_helmh%lambdas", lambdas)