commit b7ea2ab92a86eae5dda421a51335ff05df4773f5
parent 3cbb00a2bd7ad12bbb0fcf04c9d4ba9f1bfb52ef
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 5 Jun 2020 10:06:00 +0200
Merge branch 'release_0.1.1'
Diffstat:
5 files changed, 9 insertions(+), 52 deletions(-)
diff --git a/README.md b/README.md
@@ -20,6 +20,12 @@ informations on CMake.
## Release notes
+### Version 0.1.1
+
+- Remove the hard-coded boundaries of the shortwave/longwave domains. Actually
+ "shortwave" and "longwave" are only that define that the source of radiation
+ is whether external or internal to the medium, respectively.
+
### Version 0.1
- Add the `htgop_get_<lw|sw>_spectral_intervals` functions: they return the
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -37,7 +37,7 @@ include_directories(${RSys_INCLUDE_DIR})
################################################################################
set(VERSION_MAJOR 0)
set(VERSION_MINOR 1)
-set(VERSION_PATCH 0)
+set(VERSION_PATCH 1)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
set(HTGOP_FILES_SRC
diff --git a/src/htgop.c b/src/htgop.c
@@ -26,18 +26,6 @@
#include <math.h>
-/* Boundaries of the long wave spectral data */
-#define LW_WAVELENGTH_MIN 1000.0 /* In nanometer */
-#define LW_WAVELENGTH_MAX 100000.0 /* In nanometer */
-#define LW_WAVENUMBER_MIN WLEN_TO_WNUM(LW_WAVELENGTH_MAX) /* In cm^-1 */
-#define LW_WAVENUMBER_MAX WLEN_TO_WNUM(LW_WAVELENGTH_MIN) /* In cm^-1 */
-
-/* Boundaries of theshort wave spectral data */
-#define SW_WAVELENGTH_MIN 100.0 /* In nanometer */
-#define SW_WAVELENGTH_MAX 1200.0 /* In nanometer */
-#define SW_WAVENUMBER_MIN WLEN_TO_WNUM(SW_WAVELENGTH_MAX) /* In cm^-1 */
-#define SW_WAVENUMBER_MAX WLEN_TO_WNUM(SW_WAVELENGTH_MIN) /* In cm^-1 */
-
/*******************************************************************************
* Helper functions
******************************************************************************/
@@ -867,18 +855,6 @@ htgop_get_sw_spectral_intervals
goto error;
}
- if(wnum_range[0] < SW_WAVENUMBER_MIN
- || wnum_range[1] > SW_WAVENUMBER_MAX) {
- log_err(htgop,
- "%s: the range [%g, %g] is not strictly included "
- "in the long wave interval [%g, %g].\n",
- FUNC_NAME,
- wnum_range[0], wnum_range[1],
- SW_WAVENUMBER_MIN, SW_WAVENUMBER_MAX);
- res = RES_BAD_ARG;
- goto error;
- }
-
wnums = darray_double_cdata_get(&htgop->sw_specints.wave_numbers);
nwnums = darray_double_size_get(&htgop->sw_specints.wave_numbers);
@@ -907,18 +883,6 @@ htgop_get_lw_spectral_intervals
goto error;
}
- if(wnum_range[0] < LW_WAVENUMBER_MIN
- || wnum_range[1] > LW_WAVENUMBER_MAX) {
- log_err(htgop,
- "%s: the range [%g, %g] is not strictly included "
- "in the long wave interval [%g, %g].\n",
- FUNC_NAME,
- wnum_range[0], wnum_range[1],
- LW_WAVENUMBER_MIN, LW_WAVENUMBER_MAX);
- res = RES_BAD_ARG;
- goto error;
- }
-
wnums = darray_double_cdata_get(&htgop->lw_specints.wave_numbers);
nwnums = darray_double_size_get(&htgop->lw_specints.wave_numbers);
@@ -1036,6 +1000,7 @@ get_spectral_intervals
/* Transform the upper wnum bound in spectral interval id */
specint_range[1] = specint_range[1] - 1;
+
ASSERT(specint_range[0] <= specint_range[1]);
ASSERT(wnums[specint_range[0]+1] > wnum_range[0]);
ASSERT(wnums[specint_range[1]+0] < wnum_range[1]);
diff --git a/src/test_htgop_check_specints.h b/src/test_htgop_check_specints.h
@@ -15,9 +15,7 @@
#include "htgop.h"
-#if !defined(DOMAIN) \
- || !defined(DOMAIN_WAVELENGTH_MIN) \
- || !defined(DOMAIN_WAVELENGTH_MAX)
+#if !defined(DOMAIN)
#error "Missing the <DATA|DOMAIN> macro."
#endif
@@ -59,12 +57,6 @@ CONCAT(CONCAT(check_, DOMAIN), _specints)
CHK(GET_SPECINTS(htgop, wnums, range) == RES_BAD_ARG);
}
wnums[0] = low;
- wnums[1] = 1.e7/(DOMAIN_WAVELENGTH_MIN-1.0);
- CHK(GET_SPECINTS(htgop, wnums, range) == RES_BAD_ARG);
- wnums[0] = 1.e7/(DOMAIN_WAVELENGTH_MAX+1.0);
- wnums[1] = upp;
- CHK(GET_SPECINTS(htgop, wnums, range) == RES_BAD_ARG);
- wnums[0] = low;
wnums[1] = upp;
CHK(GET_SPECINTS(htgop, wnums, range) == RES_OK);
@@ -111,6 +103,4 @@ CONCAT(CONCAT(check_, DOMAIN), _specints)
#undef GET_SPECINTS
#undef GET_NSPECINTS
#undef DOMAIN
-#undef DOMAIN_WAVELENGTH_MIN
-#undef DOMAIN_WAVELENGTH_MAX
diff --git a/src/test_htgop_load.c b/src/test_htgop_load.c
@@ -65,13 +65,9 @@ check_position_to_layer_id(const struct htgop* htgop)
}
#define DOMAIN sw
-#define DOMAIN_WAVELENGTH_MIN 100.0
-#define DOMAIN_WAVELENGTH_MAX 1200.0
#include "test_htgop_check_specints.h"
#define DOMAIN lw
-#define DOMAIN_WAVELENGTH_MIN 1000.0
-#define DOMAIN_WAVELENGTH_MAX 100000.0
#include "test_htgop_check_specints.h"
int