Skip to content

Commit

Permalink
Seed Dispersal Output and Flag #497
Browse files Browse the repository at this point in the history
changing grid_setup.in description, fixing if statement mistake
  • Loading branch information
alexisBelt committed Oct 13, 2023
1 parent 6060363 commit 260366c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions ST_seedDispersal.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,8 @@ void disperseSeeds(int year) {
ForEachSpecies(sp) {
// Running this algorithm on Species that didn't request dispersal
// wouldn't hurt, but it would be a waste of time.
if(!outputSDData){
if (!Species[sp]->use_dispersal)
continue;
}
if (!Species[sp]->use_dispersal)
continue;

// If there are no individuals of this species that are of reproductive
// age continue.
Expand Down Expand Up @@ -161,9 +159,11 @@ void disperseSeeds(int year) {
}

// If this cell already has seeds there is no point in continuing
//if (receiverCell->mySpecies[sp]->seedsPresent) {
// continue;
//}
if (!outputSDData) {
if (receiverCell->mySpecies[sp]->seedsPresent) {
continue;
}
}

// These variables depend on the recipient.
distance = _distance(col, row, receiverCol, receiverRow,
Expand Down
6 changes: 5 additions & 1 deletion testing.sagebrush.master/Grid_Inputs/grid_setup.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
300 # Number of years to perform spinup.
1 # Write separate output files for each cell.
1 # output all seed dispersal events? 1 means yes, 0 means no.
0 # output full seed dispersal output? 1 means yes, 0 means no.
0 # output all dispersed seed data? 1 means yes and seeds will continuously recieve seeds
## 0 means cell will not receive more seeds after its first

This comment has been minimized.

Copy link
@kpalmqui

kpalmqui Oct 20, 2023

Member

@alexisBelt I still do not understand the difference between these flags based on the description.

I understood one controls whether seed dispersal output files are written (or not).

I understood the second flag will turn on functionality that writes the full seed dispersal output (i.e. for each cell - every other cell it received seeds from). If this flag is set to 0, then we won't write the complete output and the code will exit the loop earlier for a given cell if that cell has already received seeds from one cell. When we exit the loop we won't track any longer if that cell received additional seeds from other cells or not and the output would just reflect the first cell that sent seeds to the focal cell in question. So here, output is still written, but it is incomplete in that we don't actually determine every cell that sent seeds to every other cell.

Can you please confirm and then try to clarify the text here accordingly?



0 comments on commit 260366c

Please sign in to comment.