tilbud / rCMEM

GNU General Public License v3.0
2 stars 4 forks source link

Running cohorts to equilibrium results in blank rows #15

Closed HolmquistJ closed 4 years ago

HolmquistJ commented 4 years ago

I can successfully run a depth profile to equilibrium with a custom sedimentation function, but the output has 13 blank rows with NA's for age and mass poos and 0's for root mass depths and volumes. It doesn't seem to break anything, but I thought I'd bring this up in case it was a bug.

depositInitSediment <- function(...) { return(initSedimentDelivery) }

equilibriumCohorts <- runToEquilibrium(totalRootMass_per_area=initBgb, rootDepthMax=rootDepth, rootTurnover = bgTurnover,
                                       omDecayRate = list(fast=0.8, slow=0), rootOmFrac=list(fast=0.8, slow=0.2),
                                       packing=list(organic=0.085, mineral=1.99), rootDensity=0.085, shape="linear",
                                       mineralInput_g_per_yr.fn = depositInitSediment)

Getting Strange Empty Rows

ktoddbrown commented 4 years ago

Not a bug :D This is part of the array allocation function so that we aren't copying over a new array every time we add a cohort. We should probably add something in the documentation explaining this.

HolmquistJ commented 4 years ago

Cool. Just noting here from our Slack convo, your idea to clip this out using a wrapper function. I think we should close the issue once we have that.

HolmquistJ commented 4 years ago

Fixed this with a clipCohorts function.