NPZD: An NPZD Model

Description Usage Format Author(s) References See Also Examples

Description

Model describing nutrients (N), phytoplankton (P), zooplankton (Z), and detritus (D).

Usage

1
NPZD()

Format

An S4 object according to the odeModel specification.
The object contains the following slots:

Author(s)

Karline Soetaert

References

Chapter 2.8.1. from the book by Soetaert and Herman, 2009. A practical guide to ecological Modelling. Using R as a simulation platform. Springer.

See Also

R-package simecol for a description of the simObj class.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# initialize model
myNPZD <- NPZD()

# show model code, parameter settings,...
print(myNPZD)

#----------------------#
# RUNNING the model:   #
#----------------------#
#  2 steps
#  first year = spinup

res   <- out(sim(myNPZD))
num          <- nrow(res)   # last element
#  step 2  : the model is reinitialised with the final conditions of previous run
init(myNPZD) <- c(PHYTO   =res$PHYTO[num],
                  ZOO     =res$ZOO[num],
                  DETRITUS=res$DETRITUS[num],
                  DIN     =res$DIN[num])

# step 2: another 2 years simulated
Times <-seq(0,730,by=1)
times(myNPZD)  <- Times
res   <- out(sim(myNPZD))

#------------------------#
# PLOTTING model output: #
#------------------------#

par(mfrow=c(2,2), oma=c(0,0,3,0))

plot (Times,res$PAR        ,type="l",lwd=2,main="PAR"        ,
      xlab="time, hours",ylab="microEinst/m2/s")
plot (Times,res$Chlorophyll,type="l",lwd=2,main="Chlorophyll",
      xlab="time, hours",ylab="microg/l")
plot (Times,res$ZOO        ,type="l",lwd=2,main="Zooplankton",
      xlab="time, hours",ylab="mmolN/m3")
plot (Times,res$DIN        ,type="l",lwd=2,main="DIN"        ,
      xlab="time, hours",ylab="mmolN/m3")

mtext(outer=TRUE,side=3,"NPZD model",cex=1.5)

simecolModels documentation built on May 2, 2019, 4:59 p.m.