DrylandEcology / rSFSTEP2

R program that interfaces with the STEPWAT2 C code and runs in parallel for multiple sites, climate scenarios, disturbance regimes, and time periods
0 stars 1 forks source link

Create flag and associated code to turn off C4 grasses under future conditions if current climate is not suitable #249

Open kpalmqui opened 2 years ago

kpalmqui commented 2 years ago

Currently, if current climate is not suitable for a functional type, that functional type will be turned off for that particular site. However, if climate becomes suitable in the future, that functional type will be turned on, regardless of the fact that it was not present under current conditions.

This enhancement will allow the user to turn this functionality on or off for C4 perennial grasses in particular, so simulations can be run for two cases: (1) C4 grasses not present under current conditions, but present under future conditions due to increased suitability (2) C4 grasses not present under current conditions, so not present under future conditions regardless of suitability

Proposed solution: 1) Implement new flag to turn on option (2) above. Flag should be specified in Main.R at the top where other flags are specified, line 29.

2) If flag = TRUE, then add a check in Vegetation.R after relative abundance is set (line 101) to see if C4 grass relative abundance is 0 under current conditions. If current C4 grass relative abundance = 0, set future c4 grass relative abundance to 0 as well for all climate scenarios.

Something like (but perhaps without referring to these fixed slots):

if(res[1,1,4]==0) res[1,,4]=0