Skip to content
Snippets Groups Projects
Commit 0c0e7cb7 authored by Andreas Gattringer's avatar Andreas Gattringer
Browse files

butterflies: simply grid pre-processing

parent b75f6b39
No related branches found
No related tags found
No related merge requests found
......@@ -21,18 +21,28 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info *
const cats_dt_coord start_col = ts->area.start_col;
const cats_dt_coord end_col = ts->area.end_col;
cats_dt_rates ot = grid->param.OT;
bool hybrid = grid->param.parametrization == PARAM_HYBRID;
const cats_dt_rates ot = grid->param.OT;
for (cats_dt_coord row = start_row; row < end_row; row++) {
for (cats_dt_coord col = start_col; col < end_col; col++) {
bool suitability_to_low = false;
if (hybrid && get_suitability(grid, row, col) < ot) suitability_to_low = true;
if (cell_excluded_by_overlay(conf, row, col)
|| ! (data->info_layer[row][col] & BF_CELL_VALID_DISPERSAL_TARGET)
|| suitability_to_low == true) {
if (get_suitability(grid, row, col) < ot)
{
data->eggs[row][col] = 0.0f;
data->generations[row][col] = 0.0f;
set_population_ignore_cc(grid, row, col, 0);
continue;
}
if (cell_excluded_by_overlay(conf, row, col)) {
data->eggs[row][col] = 0.0f;
data->generations[row][col] = 0.0f;
set_population_ignore_cc(grid, row, col, 0);
continue;
}
if ( ! (data->info_layer[row][col] & BF_CELL_VALID_DISPERSAL_TARGET)){
data->eggs[row][col] = 0.0f;
data->generations[row][col] = 0.0f;
set_population_ignore_cc(grid, row, col, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment