commit 33587a304a695de5d1596a4db74bcd7687449825
parent 54f3f18b8ee8ca8e2fe130102bbb86e8d3a71888
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 8 Aug 2018 17:07:04 +0200
Handle a possible error in the quadpoints_bounds func
Diffstat:
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/htgop_get_radiative_properties_bounds.h b/src/htgop_get_radiative_properties_bounds.h
@@ -65,6 +65,7 @@ htgop_layer_,DOMAIN),_spectral_interval_quadpoints_get_),DATA),_bounds)
res = CONCAT(CONCAT(CONCAT(CONCAT(
htgop_layer_,DOMAIN),_spectral_interval_tab_get_),DATA),_bounds)
(&tab, x_h2o_range, tab_bounds);
+ if(res != RES_OK) goto exit;
bounds[0] = MMIN(bounds[0], tab_bounds[0]);
bounds[1] = MMAX(bounds[1], tab_bounds[1]);
diff --git a/src/test_htgop_fetch_radiative_properties.h b/src/test_htgop_fetch_radiative_properties.h
@@ -86,8 +86,8 @@ CONCAT(CONCAT(CONCAT(check_layer_fetch_, DOMAIN),_), DATA)
FOR_EACH(i, 0, N) {
const double r = rand_canonic();
const double x1 = itab ? layer->x_h2o_tab[itab-1] : 0;
- const double k1 = itab ? GET_K(&lay_tab, itab-1) : 0;
const double x2 = layer->x_h2o_tab[itab];
+ const double k1 = itab ? GET_K(&lay_tab, itab-1) : 0;
const double k2 = GET_K(&lay_tab, itab);
double ref;
@@ -102,6 +102,14 @@ CONCAT(CONCAT(CONCAT(check_layer_fetch_, DOMAIN),_), DATA)
CHK(FETCH_K(&lay_tab, x_h2o, &k) == RES_OK);
CHK(eq_eps(k, ref, 1.e-6));
+#ifdef Kext
+ {
+ double ka, ks;
+ CHK(FETCH_Ka(&lay_tab, x_h2o, &ka) == RES_OK);
+ CHK(FETCH_Ks(&lay_tab ,x_h2o, &ks) == RES_OK);
+ CHK(ka <= k && ks <= k);
+ }
+#endif
}
}
}