Skip to content

Commit

Permalink
Resolved issue #503 and added printf statements for parameter tracking
Browse files Browse the repository at this point in the history
- remove unnecessary columns still lingering in species.in
-add printf statements for debugging
  • Loading branch information
kpalmqui committed Feb 14, 2021
1 parent 5289f9e commit e1cee42
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion ST_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ int main(int argc, char **argv) {
logProgress(iter, year, SIMULATION);
}

//printf("------------------------Repetition/year = %d / %d\n", iter, year);
printf("------------------------Repetition/year = %d / %d\n", iter, year);

Globals->currYear = year;

Expand Down
6 changes: 5 additions & 1 deletion ST_seedDispersal.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,14 @@ void disperseSeeds(int year) {

// These variables are independent of recipient.
height = getSpeciesHeight(Species[sp]);
printf("height after getSpeciesHeight called Species = %s, height = %f\n ", Species[sp]->name, height);

rate = _rateOfDispersal(Species[sp]->maxDispersalProbability,
getSpeciesHeight(Species[sp]),
_maxDispersalDistance(height));

printf("rate after _rateOfDispersal called Species = %s, rate = %f\n ", Species[sp]->name, rate);

// Iterate through all possible recipients of seeds.
for (receiverRow = 0; receiverRow < grid_Rows; ++receiverRow) {
for (receiverCol = 0; receiverCol < grid_Cols; ++receiverCol) {
Expand Down Expand Up @@ -406,4 +410,4 @@ void _recordDispersalEvent(int year, int iteration, int fromCell, int toCell,
_lastEvent->next = newEvent;
_lastEvent = newEvent;
}
}
}
2 changes: 2 additions & 0 deletions ST_species.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ RealF getSpeciesHeight(SpeciesType* sp)
}
}

printf("within getSpeciesHeight maxrelsize = %f, Species mature_biomass = %f, maxHeight= %f, heightSlope= %f\n ", maxrelsize, sp->mature_biomass, sp->maxHeight, sp->heightSlope);

// (maxrelsize * sp->mature_biomass) is the biomass of the individual.
return sp->maxHeight * (1 - exp(
-(sp->heightSlope * maxrelsize * sp->mature_biomass)));
Expand Down
38 changes: 19 additions & 19 deletions testing.sagebrush.master/Stepwat_Inputs/Input/species.in
Original file line number Diff line number Diff line change
Expand Up @@ -171,25 +171,25 @@
# MAXD = The maximum distance, in meters, a seed can travel.
# PMD = Probability of Maximum Dispersal. The probability that a seed disperses MAXD meters
#
# name Use MRS PPTdry PPTwet HMax PMD HSlope
artr 1 0.5 105 520 240.0 0.005 0.00181
trdu 0 0.5 105 520 25.0 0.005 0.8302
cryp 0 0.5 105 520 25.0 0.005 0.8302
amre 0 0.5 105 520 25.0 0.005 0.8302
chen 0 0.5 105 520 180.0 0.005 0.8302
acmi 0 0.5 105 520 25.0 0.005 0.8302
phho 0 0.5 105 520 4.0 0.005 0.8302
arfr 0 0.5 105 520 30.0 0.005 0.8302
lipu 0 0.5 105 520 30.0 0.005 0.8302
brte 0 0.5 105 520 90.0 0.005 0.7674
vuoc 0 0.5 105 520 40.0 0.005 0.7674
pssp 0 0.5 105 520 24.5 0.005 0.7674
koma 0 0.5 105 520 24.5 0.005 0.7674
bogr 0 0.5 105 520 12.0 0.005 4.4117
spcr 0 0.5 105 520 24.5 0.005 0.7674
gusa 0 0.5 105 520 40.0 0.005 0.00181
chvi 0 0.5 105 520 100.0 0.005 0.00181
oppo 0 0.5 105 520 40.0 0.005 0.8302
# name Use MRS HMax PMD HSlope
artr 1 0.5 240.0 0.005 0.00181
trdu 0 0.5 25.0 0.005 0.8302
cryp 0 0.5 25.0 0.005 0.8302
amre 0 0.5 25.0 0.005 0.8302
chen 0 0.5 180.0 0.005 0.8302
acmi 0 0.5 25.0 0.005 0.8302
phho 0 0.5 4.0 0.005 0.8302
arfr 0 0.5 30.0 0.005 0.8302
lipu 0 0.5 30.0 0.005 0.8302
brte 0 0.5 90.0 0.005 0.7674
vuoc 0 0.5 40.0 0.005 0.7674
pssp 0 0.5 24.5 0.005 0.7674
koma 0 0.5 24.5 0.005 0.7674
bogr 0 0.5 12.0 0.005 4.4117
spcr 0 0.5 24.5 0.005 0.7674
gusa 0 0.5 40.0 0.005 0.00181
chvi 0 0.5 100.0 0.005 0.00181
oppo 0 0.5 40.0 0.005 0.8302

[end] # this marks the end of the seed-dispersal parameters

0 comments on commit e1cee42

Please sign in to comment.