tilbud / rCMEM

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

Do we need different code libraries for CTM and MEM #24

Closed HolmquistJ closed 4 years ago

HolmquistJ commented 4 years ago

Are these two code libraries different enough where we should separate them under different names, CTM and MEM, or should we change the name of the repo to rMEM, or should we keep it as rCTM and just add the MEM functionality?

ktoddbrown commented 4 years ago

I like the idea of having MEM as a function in the rCTM package. MEM seems to be a collection of boundary conditions and rCTM the underlaying algorithm. But this is my poor programer brain trying to understand things.

tilbud commented 4 years ago

CTM  only sets up the initial condition.  MEM must be started at time zero with a collection of cohorts, populated with roots, inorganics, and dead stuff.  The model starts with a stack of cohorts with volumes sufficient to fill a 1 m column.  The cohort dimensions depend on the parameters.  CTM makes the assumption that the parameters you put in represent an equilibrium state. That was the easiest way to to it.  The alternative would be to ask people to populate those cohorts with real data.  Good luck with that.   Anyway, once the CTM is finished, MEM starts the forward simulation.  It adds new cohorts to the top and it changes the existing cohort volumes as roots are added, turnover, or decay.  That's where the model has to iterate to reach a stable solution for each cohort in the vertical stack, starting at the top and working down.  The #1 cohort is at the bottom of the stack.  At every new time step, cohorts inherit the labile and refractory OM and inorganic matter that they had in the previous step, and the model calculates a new live root volume depending on the standing biomass and depth distribution.  The model allows additional volume input from root turnover, and volume loss from decay.  There now is a v8.2 that grows a forest.  It's slick.

On 11/8/2019 10:34 AM, Kathe Todd-Brown wrote:

I like the idea of having MEM as a function in the rCTM package. MEM seems to be a collection of boundary conditions and rCTM the underlaying algorithm. But this is my poor programer brain trying to understand things.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://protect2.fireeye.com/v1/url?k=eeb86a0f-b2221105-eeb824ce-8682cccad822-0f69ac08e964c99a&q=1&e=e9ce97d0-606d-4061-b3fb-c02c43041ddc&u=https%3A%2F%2Fgithub.com%2Ftilbud%2FrCTM%2Fissues%2F24%3Femail_source%3Dnotifications%26email_token%3DACAWM25NN3MHJHAOLQ2I7I3QSWBJXA5CNFSM4JKJMFZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDSO5KY%23issuecomment-551874219, or unsubscribe https://protect2.fireeye.com/v1/url?k=e7214b99-bbbb3093-e7210558-8682cccad822-aa79270f83b00cf6&q=1&e=e9ce97d0-606d-4061-b3fb-c02c43041ddc&u=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACAWM25U7C67QP3ACDSEEWTQSWBJXANCNFSM4JKJMFZQ.

-- James Morris Distinguished Research Professor Baruch Institute for Marine & Coastal Sciences University of South Carolina Columbia, SC 29208 803-777-3948

HolmquistJ commented 4 years ago

Cool stuff. What you described @tilbud is what I have implemented in my dev-JH branch, so I think we're on the right track. I think the question is should we change the name of the repository from rMEM to rCTM to recognize the fact that CTM is mostly going to be used to run up those initial conditions for MEM? You don't have to make this decision now, but we should once we get an R version of the MEM implementation you're happy with.

I'll open up a separate issue about the forest function. We can definitely integrate that too.

HolmquistJ commented 4 years ago

I think I'll close this issue for now. It seems like we're keeping it one repo, under the name CTM, since CTM is the engine and the runMemWithCohorts is a special implementation of CTM.