File: SCOC.R

package info (click to toggle)
r-cran-desolve 1.40-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,592 kB
  • sloc: fortran: 18,729; ansic: 4,956; makefile: 11
file content (21 lines) | stat: -rw-r--r-- 571 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SCOC <- function(times, y=NULL, parms, Flux, ...) {

  if (is.null(y)){
    meanDepo <- mean(approx(Flux[,1],Flux[,2], xout=seq(1,365,by=1))$y)
    y <- meanDepo/parms
  } else if (length(y) != 1)
    stop ("length of state variable vector should be 1")

  if (length(parms) != 1)
    stop ("length of parameter vector should be 1")

  names(y) <- c("C")

  out <- vode(y, times, func = "scocder",
    parms = parms, dllname = "deSolve",
    initforc="scocforc",  forcings=Flux,
    initfunc = "scocpar", nout = 2,
    outnames = c("Mineralisation","Depo"),...)
  out
}