commit d030170bf319776fb481c0cda38cba6ab67d1a13
parent d667a1e2a4f467df08f37bf617b36b7eb63e6c67
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 26 Aug 2022 17:35:01 +0200
Exclude the gas band upper limit when looking for aerosol bands
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/rnatm_octree.c b/src/rnatm_octree.c
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#define _POSIX_C_SOURCE 200112L /* lround support */
+#define _POSIX_C_SOURCE 200112L /* lround and nextafter support */
#include "rnatm_c.h"
#include "rnatm_log.h"
@@ -512,14 +512,15 @@ setup_tetra_radcoefs_aerosol
/* Look for the aerosol bands covered by the gas band */
SCK(get_band(atm->gas.ck, iband, &gas_band));
gas_spectral_range[0] = gas_band.lower;
- gas_spectral_range[1] = gas_band.upper;
+ gas_spectral_range[1] = nextafter(gas_band.upper, 0); /* inclusive */
SARS(find_bands(aerosol->sars, gas_spectral_range, ars_ibands));
/* TODO ask VE what to do if:
* - the spectral meshes have holes
* - no aerosol band is overlaid by the gas band
* - the aerosol bands are entirely included in the gas band
- * - gas/an aerosol band is degenerated (i.e. lower == upper) */
+ * - gas/an aerosol band is degenerated (i.e. lower == upper)
+ * - the gas band and aerosol band are the same */
/* Aerosol spectral data is not overlaid by the gas band */
if(ars_ibands[0] > ars_ibands[1]) FATAL("Not implemented yet!\n");