Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite the way we compute senescence due to lifespan #2

Open
VEZY opened this issue Apr 6, 2018 · 0 comments
Open

Rewrite the way we compute senescence due to lifespan #2

VEZY opened this issue Apr 6, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@VEZY
Copy link
Owner

VEZY commented Apr 6, 2018

For now, lifespan is used as a ratio over the total dry mass for each organ. It should be used to remove organ mass that was created lifespan_organ days before "i".
This is what we do:

  S$Sim$Mact_CR_Tree[i]=
    S$Sim$CM_CR_Tree[previous_i(i,1)]/S$Parameters$lifespanCR_Tree

This is what we should do:

  S$Sim$Mact_CR_Tree[i]=
    S$Sim$NPP_CR_Tree[previous_i(i,S$Parameters$lifespanCR_Tree)]*
         after(i,S$Parameters$lifespanCR_Tree)

With after() a function to avoid a positive value of NPP if i is before any mortality:

after= function(x,ref){
  index= x-ref
  index[index<=0]= 0
  index[index>0]=1
  return(index)
}

This technique will remove only the old dry mass instead of a constant ratio of the dry mass.

@VEZY VEZY added the enhancement New feature or request label Apr 6, 2018
@VEZY VEZY self-assigned this Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant