Function summary summarizes the model's output in different temporal steps (i.e. weekly, annual, ...).

# S3 method for spwb
summary(
  object,
  freq = "years",
  output = "WaterBalance",
  FUN = sum,
  bySpecies = FALSE,
  months = NULL,
  ...
)

# S3 method for pwb
summary(
  object,
  freq = "years",
  output = "WaterBalance",
  FUN = sum,
  bySpecies = FALSE,
  months = NULL,
  ...
)

# S3 method for growth
summary(
  object,
  freq = "years",
  output = "WaterBalance",
  FUN = sum,
  bySpecies = FALSE,
  months = NULL,
  ...
)

# S3 method for fordyn
summary(
  object,
  freq = "years",
  output = "WaterBalance",
  FUN = sum,
  bySpecies = FALSE,
  months = NULL,
  ...
)

Arguments

object

An object of class spwb, pwb, growth or fordyn.

freq

Frequency of summary statistics (see cut.Date).

output

The data table to be summarized. Accepted values are the path to data tables in object, such as 'WaterBalance', 'Soil', 'Stand' or 'Plants$LAI'. It is also possible to use strings like 'Transpiration' and the function will interpret it as 'Plants$Transpiration'.

FUN

The function to summarize results (e.g., sum, mean, ...)

bySpecies

Allows aggregating output by species before calculating summaries (only has an effect with some values of output). Aggregation can involve a sum (as for plant lai or transpiration) or a LAI-weighted mean (as for plant stress or plant water potential).

months

A vector of month numbers (1 to 12) to subset the season where summaries apply.

...

Additional parameters for function summary.

Value

A matrix with dates as row names and the desired summaries in columns

Note

When applied to fordyn objects, the summary function can be used to gather the results of different yearly steps into a single table while keeping a daily resolution (i.e. using freq = "days".

Author

Miquel De Cáceres Ainsa, CREAF

Examples

#Load example daily meteorological data
data(examplemeteo)

#Load example plot plant data
data(exampleforest)

#Default species parameterization
data(SpParamsMED)

#Define soil with default soil params (4 layers)
examplesoil <- defaultSoilParams(4)

#Initialize control parameters
control <- defaultControl("Granier")

#Initialize input
x <- spwbInput(exampleforest,examplesoil, SpParamsMED, control)

#Call simulation function
S1<-spwb(x, examplemeteo, latitude = 41.82592, elevation = 100)
#> Initial plant water content (mm): 7.05859
#> Initial soil water content (mm): 290.875
#> Initial snowpack content (mm): 0
#> Performing daily simulations
#> 
#>  [Year 2001]:....................................
#> 
#> Final plant water content (mm): 7.05925
#> Final soil water content (mm): 350.456
#> Final snowpack content (mm): 0
#> Change in plant water content (mm): 0.000654694
#> Plant water balance result (mm): 0.000654694
#> Change in soil water content (mm): 59.5809
#> Soil water balance result (mm): 59.5809
#> Change in snowpack water content (mm): 0
#> Snowpack water balance result (mm): -7.10543e-15
#> Water balance components:
#>   Precipitation (mm) 513 Rain (mm) 462 Snow (mm) 51
#>   Interception (mm) 92 Net rainfall (mm) 370
#>   Infiltration (mm) 391 Infiltration excess (mm) 30 Saturation excess (mm) 0 Capillarity rise (mm) 2
#>   Soil evaporation (mm) 11  Herbaceous transpiration (mm) 14 Woody plant transpiration (mm) 187
#>   Plant extraction from soil (mm) 187  Plant water balance (mm) 0 Hydraulic redistribution (mm) 2
#>   Runoff (mm) 30 Deep drainage (mm) 122

#Queries the tables in 'Soil'
names(S1$Soil)
#> [1] "SWC"            "RWC"            "REW"            "ML"            
#> [5] "Psi"            "PlantExt"       "HydraulicInput"

#Monthly summary (averages) of soil relative water content
summary(S1, freq="months",FUN=mean, output="RWC")
#>                   1        2        3        4  Overall
#> 2001-01-01 1.219802 1.132674 1.026476 1.011845 1.112852
#> 2001-02-01 1.125502 1.209589 1.155175 1.077561 1.161958
#> 2001-03-01 1.192009 1.259743 1.299911 1.310224 1.259587
#> 2001-04-01 1.042924 1.164666 1.266087 1.375701 1.184527
#> 2001-05-01 1.064962 1.152764 1.232940 1.348295 1.173432
#> 2001-06-01 0.863565 1.030672 1.158989 1.285709 1.051488
#> 2001-07-01 1.108830 1.099321 1.128373 1.220833 1.121773
#> 2001-08-01 1.101952 1.162201 1.204452 1.287924 1.172179
#> 2001-09-01 1.095629 1.173850 1.244056 1.352750 1.192435
#> 2001-10-01 1.118145 1.172238 1.235041 1.349485 1.194378
#> 2001-11-01 1.173050 1.234757 1.288264 1.370991 1.248420
#> 2001-12-01 1.087599 1.221255 1.328590 1.392669 1.235737

#Queries the tables in 'Plants'
names(S1$Plants)
#>  [1] "LAI"                 "LAIlive"             "FPAR"               
#>  [4] "AbsorbedSWRFraction" "Transpiration"       "GrossPhotosynthesis"
#>  [7] "PlantPsi"            "LeafPLC"             "StemPLC"            
#> [10] "PlantWaterBalance"   "LeafRWC"             "StemRWC"            
#> [13] "LFMC"                "PlantStress"        

#Monthly summary (averages) of plant stress
summary(S1, freq="months",FUN=mean, output="PlantStress", 
        bySpecies = TRUE)
#>            Pinus halepensis Quercus coccifera Quercus ilex
#> 2001-01-01      0.001751549      0.0011772164  0.005032489
#> 2001-02-01      0.002276863      0.0012332617  0.004550331
#> 2001-03-01      0.001516807      0.0008315598  0.003228428
#> 2001-04-01      0.003989288      0.0019378096  0.006390051
#> 2001-05-01      0.003798277      0.0018723032  0.006305162
#> 2001-06-01      0.013829534      0.0057043450  0.014950119
#> 2001-07-01      0.004272062      0.0021542226  0.007378441
#> 2001-08-01      0.002938432      0.0015397401  0.005551542
#> 2001-09-01      0.002903151      0.0015039726  0.005375883
#> 2001-10-01      0.002511830      0.0013514821  0.005043298
#> 2001-11-01      0.001943624      0.0010338485  0.003859938
#> 2001-12-01      0.002813039      0.0014018357  0.004808315