Skip to content

Commit

Permalink
Inputs density and pseed changed to units of # / m2 (#350)
Browse files Browse the repository at this point in the history
fix inconsistencies in units between documentation, inputs, and how the code uses these variables:
- inputs are in units of number per square meter (so that these inputs do not depend on plot size)
- internally, code converts these to number per plot (because that is the unit of the simulation)
  • Loading branch information
dschlaep committed Jul 14, 2019
1 parent cd3fd93 commit 542f571
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions ST_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,9 @@ static void _rgroup_add1( char name[], RealF space, RealF density,
RGroup[rg]->grp_num = rg;
RGroup[rg]->max_stretch = (IntS) stretch;
RGroup[rg]->max_spp_estab = (IntS) estab;
RGroup[rg]->max_density = density;
RGroup[rg]->max_per_sqm = density / Globals.plotsize;
// input of `density` is in units of [# / m2]; convert to units of [# / plot]
RGroup[rg]->max_density = density * Globals.plotsize; // density per plot
RGroup[rg]->max_per_sqm = density; // density per square-meter
RGroup[rg]->use_mort = itob(mort);
RGroup[rg]->slowrate = slow;
RGroup[rg]->baseline_min_res_req = space;
Expand Down Expand Up @@ -1103,7 +1104,8 @@ static void _species_init( void) {
Species[sp]->received_prob = 0;
Species[sp]->cohort_surv = cohort;
Species[sp]->var = var;
Species[sp]->pseed = pseed / Globals.plotsize;
// input of `pseed` is in units of [# / m2]; convert to units of [# / plot]
Species[sp]->pseed = pseed * Globals.plotsize;
/* Species[sp]->ann_mort_prob = (age > 0)
? -log(cohort)/age
: 0.0;
Expand Down
4 changes: 2 additions & 2 deletions ST_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct species_st {
estabs, /* number of individuals established in iter */
*seedprod, /* annuals: array of previous years' seed production (size = viable_yrs)*/
seedbank,
pseed;
pseed; /* average number of seeds produced by annual species per 1g of biomass, per 1m^2 and per year (internally re-calculated as seeds per 1 g biomass per plot and per year) */
RealF lastyear_relsize, /* relsize from the previous year, used for annual establishment */
extragrowth, /* amt of superfluous growth from extra resources */
received_prob, //the chance that this species received seeds this year... only applicable if using seed dispersal and gridded option
Expand Down Expand Up @@ -181,7 +181,7 @@ struct resourcegroup_st {
RealF baseline_min_res_req, /* input from table */
min_res_req, /* input from table, rescaled if an rgroup is not established */
max_density, /* number of mature plants per plot allowed */
max_per_sqm, /* convert density and plotsize to max plants/m^2 */
max_per_sqm, /* density of mature plants in units of plants / m^2 */
max_bmass, /* sum of mature biomass for all species in group */
killfreq, /* kill group at this frequency: <1=prob, >1=# years */
ignition, /* cheatgrass biomass (g/m2) that triggers potential ignition of a wildfire */
Expand Down
6 changes: 3 additions & 3 deletions testing.sagebrush.master/Stepwat_Inputs/Input/rgroup.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# name = a name to give the group (12 chars)
# space = proportion of the resource space used by the group.
# this must sum to 1.0
# density = relative number of mature individuals per plot, reassigned to max_density in the model code
# maxest = maximum species that can establish in a given year,
# this value cannot be greater than the number of species assigned
# density = number of mature individuals per square-meter, converted to `max_density` (in units of plants per plot) in the model code
# maxest = maximum species that can establish in a given year,
# this value cannot be greater than the number of species assigned
# to the resource group in the species.in file
# slow = slow growth rate, defines when to count stretched years
# stretch = max yrs resources can be stretched before low-resource mortality occurs.
Expand Down
2 changes: 1 addition & 1 deletion testing.sagebrush.master/Stepwat_Inputs/Input/species.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# along with the mean (pestab), is used to calculate the two shape parameters: alpha and beta.
# Default value: 0.0001. NOTE: var must be < pestab * (1-pestab) or alpha and/or beta will be negative,
# we will no longer be meeting the assumptions of a beta distribution, and the code will fail.
# pseed = the average number of seeds produced by annual species per 1g of biomass, per 1m^2 and per year.
# pseed = the average number of seeds produced by annual species per 1g of biomass, per 1m^2 and per year (internally re-calculated as seeds per 1 g biomass per plot and per year)

###PARAMETER SOURCES
#TM - eind values are density values taken from Adler datasets from Idaho. Species vuoc (1090), bogr, spcr, brar (2080), are from Karl et al 1999
Expand Down

1 comment on commit 542f571

@kpalmqui
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dschlaep thank you Daniel - this looks great!

Please sign in to comment.