From 542f571908b45fa55c182528e2bcb77a6a5dbb53 Mon Sep 17 00:00:00 2001 From: dschlaep Date: Sun, 14 Jul 2019 17:07:31 -0400 Subject: [PATCH] Inputs density and pseed changed to units of # / m2 (#350) 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) --- ST_params.c | 8 +++++--- ST_structs.h | 4 ++-- testing.sagebrush.master/Stepwat_Inputs/Input/rgroup.in | 6 +++--- testing.sagebrush.master/Stepwat_Inputs/Input/species.in | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ST_params.c b/ST_params.c index 3758af89..dfdb8c4f 100644 --- a/ST_params.c +++ b/ST_params.c @@ -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; @@ -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; diff --git a/ST_structs.h b/ST_structs.h index 98196577..b6478e5c 100644 --- a/ST_structs.h +++ b/ST_structs.h @@ -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 @@ -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 */ diff --git a/testing.sagebrush.master/Stepwat_Inputs/Input/rgroup.in b/testing.sagebrush.master/Stepwat_Inputs/Input/rgroup.in index 9528aaac..866ff65f 100644 --- a/testing.sagebrush.master/Stepwat_Inputs/Input/rgroup.in +++ b/testing.sagebrush.master/Stepwat_Inputs/Input/rgroup.in @@ -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. diff --git a/testing.sagebrush.master/Stepwat_Inputs/Input/species.in b/testing.sagebrush.master/Stepwat_Inputs/Input/species.in index bd400209..68e94f7e 100644 --- a/testing.sagebrush.master/Stepwat_Inputs/Input/species.in +++ b/testing.sagebrush.master/Stepwat_Inputs/Input/species.in @@ -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