GithubHelp home page GithubHelp logo

vezy / dynacof Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 3.0 44.35 MB

The Dynamic Agroforestry Coffee Crop Model

Home Page: https://vezy.github.io/DynACof/

License: GNU General Public License v3.0

R 99.04% TeX 0.96%

dynacof's People

Contributors

vezy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dynacof's Issues

Rewrite the way we compute senescence due to lifespan

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.

Loading metamodels for shade trees?

I'm trying to understand how to run DynACof with parameters for shade trees.

The example code supplied uses Tree = NULL, which if I understand correctly assumes that there are no shade trees.

I tried loading the sample data available from the DynACof_inputs github, but when I run the code

sim= DynACof(Inpath = dynacof_data, FileName = list(Site = "site.R", Meteo ="meteorology.txt", Soil = "soil.R",Coffee = "coffee.R", Tree = "tree.R"))

as suggested, I keep getting the error:

Error in Tree() : object 'Metamodels' not found

The tree.R file from DynACof_inputs seems to define Metamodels = Metamodels, but as far as I can tell the function or object does not exist. In contrast, Allometries seems to be a function that loads as part of the DynACof library.

Is there somewhere to download example files for Metamodels?

(I also posted an issue on the DynACof_inputs, but the Issues here seems slightly more active, so I thought I would try here as well.)

Compute RH from Tair

Using this formula:
humedadRelativaTavg: tAvg tempMax: tMax tempMin: tMin
"RH = 100 - 5 (T - Td) Td= temp dewpoint : point de rosée.
RH = (Td - T + 20) * 5
Td = 0.38 Tmax - 0.018 Tmax^2 + 1.4 Tmin - 5"

Intercrevapor computed with Rn from met

Intercrevapor, the evaporation from the leaves -i.e. the precipitation intercepted by leaves and re-evaporated- is computed using the net radiation computed in the meteorology with Allen et al. (1998) equations. This should be replaced by an Rn computed by the model.
The difficulty is that Rn can only be computed knowing Intercrevapor, so an iteration process is needed. We could maybe find another equation to avoid that because it will increase the computation time that is already long.

Round computations to avoid memory usage

Many variables should only be computed (and kept) with 2 digits only. Find an efficient way to do that:

  • Search if there is a way to limit the digits allowed in the main list
  • If not, use round(.,2).

In any case, test the computation time (the first purpose here is to reduce overall computation time).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.