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)

#Initialize soil with default soil params (2 layers)
examplesoil = soil(defaultSoilParams(2))

#Initialize control parameters
control = defaultControl("Granier")

#Initialize input
x = forest2spwbInput(exampleforest,examplesoil, SpParamsMED, control)

#Call simulation function
S1<-spwb(x, examplemeteo, latitude = 41.82592, elevation = 100)
#> Initial plant water content (mm): 5.25158
#> Initial soil water content (mm): 184.827
#> Initial snowpack content (mm): 0
#> Performing daily simulations
#> 
#>  [Year 2001]:....................................
#> 
#> Final plant water content (mm): 5.25043
#> Final soil water content (mm): 190.317
#> Final snowpack content (mm): 0
#> Change in plant water content (mm): -0.00114829
#> Plant water balance result (mm): -0.00114829
#> Change in soil water content (mm): 5.48975
#> Soil water balance result (mm): 5.49199
#> 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) 326 Runoff (mm) 43 Deep drainage (mm) 157
#>   Soil evaporation (mm) 16  Herbaceous transpiration (mm) 14 Woody plant transpiration (mm) 186
#>   Plant extraction from soil (mm) 186  Plant water balance (mm) -0 Hydraulic redistribution (mm) 1

#Monthly summary (averages) of soil status
summary(S1, freq="months",FUN=mean, output="Soil")
#>                  W.1       W.2     ML.1     ML.2    MLTot      WTD        SWE
#> 2001-01-01 1.1852367 1.1214569 80.80211 130.8213 211.6234 632.1350 1.65619239
#> 2001-02-01 1.0535534 1.1666394 71.82475 136.0920 207.9167 670.7991 0.27608905
#> 2001-03-01 1.1365794 1.2112297 77.48495 141.2935 218.7785 518.5155 0.01762496
#> 2001-04-01 0.9550179 1.1267274 65.10721 131.4361 196.5433 780.7232 0.58072652
#> 2001-05-01 1.0136926 1.0850607 69.10729 126.5756 195.6828 822.4167 0.00000000
#> 2001-06-01 0.8095439 0.9499095 55.18969 110.8098 165.9995 997.0519 0.00000000
#> 2001-07-01 1.0492898 0.9657927 71.53409 112.6626 184.1967 907.4252 0.00000000
#> 2001-08-01 1.0647473 1.0594232 72.58789 123.5849 196.1727 837.8987 0.00000000
#> 2001-09-01 1.0560780 1.1041385 71.99686 128.8010 200.7979 772.0859 0.00000000
#> 2001-10-01 1.0748990 1.1095187 73.27996 129.4287 202.7086 750.1074 0.00000000
#> 2001-11-01 1.1313671 1.1674137 77.12961 136.1823 213.3119 598.6702 2.60802857
#> 2001-12-01 0.9703768 1.1760774 66.15429 137.1929 203.3472 685.6113 0.00000000
#>            PlantExt.1 PlantExt.2 HydraulicInput.1 HydraulicInput.2       psi.1
#> 2001-01-01 0.15038461 0.02366189                0     1.664622e-03 -0.01349716
#> 2001-02-01 0.19425234 0.19716581                0     0.000000e+00 -0.02751226
#> 2001-03-01 0.23728956 0.17018857                0     2.865210e-04 -0.01806805
#> 2001-04-01 0.20344178 0.32501538                0     0.000000e+00 -0.04224915
#> 2001-05-01 0.33373519 0.29389957                0     0.000000e+00 -0.03364641
#> 2001-06-01 0.30704268 0.58190717                0     0.000000e+00 -0.08761518
#> 2001-07-01 0.67030763 0.08982684                0     1.594499e-02 -0.03063745
#> 2001-08-01 0.58281731 0.18355741                0     2.188437e-03 -0.02530720
#> 2001-09-01 0.36253130 0.23076270                0     4.829639e-05 -0.02602824
#> 2001-10-01 0.25902795 0.15429900                0     2.121730e-04 -0.02388229
#> 2001-11-01 0.18761228 0.10761869                0     8.967033e-04 -0.01937473
#> 2001-12-01 0.09704647 0.17849927                0     0.000000e+00 -0.04149902
#>                  psi.2
#> 2001-01-01 -0.01860746
#> 2001-02-01 -0.01476012
#> 2001-03-01 -0.01110610
#> 2001-04-01 -0.01839096
#> 2001-05-01 -0.02229438
#> 2001-06-01 -0.04402363
#> 2001-07-01 -0.03959486
#> 2001-08-01 -0.02486604
#> 2001-09-01 -0.02000390
#> 2001-10-01 -0.01944996
#> 2001-11-01 -0.01455560
#> 2001-12-01 -0.01414712

#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="Plants$PlantStress", 
        bySpecies = TRUE)
#>            Pinus halepensis Quercus coccifera Quercus ilex
#> 2001-01-01      0.001921880       0.001214749  0.005127388
#> 2001-02-01      0.004040428       0.001997868  0.006558304
#> 2001-03-01      0.002512809       0.001309533  0.004657330
#> 2001-04-01      0.007692026       0.003450278  0.009876686
#> 2001-05-01      0.005711328       0.002782130  0.008889513
#> 2001-06-01      0.022028456       0.008943538  0.022028430
#> 2001-07-01      0.007188462       0.003653964  0.012006614
#> 2001-08-01      0.004083978       0.002225655  0.008012450
#> 2001-09-01      0.004011769       0.002097918  0.007301252
#> 2001-10-01      0.003564596       0.001909909  0.006839872
#> 2001-11-01      0.002826664       0.001499904  0.005395219
#> 2001-12-01      0.007234052       0.003185654  0.008900818