Skip to contents

About this vignette

The present document describes how to run the soil plant water balance model described in De Cáceres et al. (2015) using package medfate. The document illustrates how to prepare the inputs, use the simulation functions and inspect the outputs. All the details of the model design and formulation can be found at the medfatebook. Because it introduces many basic features of simulations with package medfate, this document should be read before addressing advanced topics of water balance simulations or growth simulations.

Preparing model inputs

Model inputs are explained in greater detail in vignettes Understanding model inputs and Preparing model inputs. Here we only review the different steps required to run function spwb().

Soil, vegetation, meteorology and species data

Soil information needs to be entered as a data frame with soil layers in rows and physical attributes in columns. Soil physical attributes can be initialized to default values, for a given number of layers, using function defaultSoilParams():

examplesoil <- defaultSoilParams(4)
examplesoil
##   widths clay sand om nitrogen  bd rfc
## 1    300   25   25 NA       NA 1.5  25
## 2    700   25   25 NA       NA 1.5  45
## 3   1000   25   25 NA       NA 1.5  75
## 4   2000   25   25 NA       NA 1.5  95

As explained in the package overview, models included in medfate were primarily designed to be ran on forest inventory plots. Here we use the example object provided with the package:

data(exampleforest)
exampleforest
## $treeData
##            Species   N   DBH Height Z50  Z95
## 1 Pinus halepensis 168 37.55    800 100  600
## 2     Quercus ilex 384 14.60    660 300 1000
## 
## $shrubData
##             Species Cover Height Z50  Z95
## 1 Quercus coccifera  3.75     80 200 1000
## 
## $herbCover
## [1] 10
## 
## $herbHeight
## [1] 20
## 
## $seedBank
## [1] Species Percent
## <0 rows> (or 0-length row.names)
## 
## attr(,"class")
## [1] "forest" "list"

Importantly, a data frame with daily weather for the period to be simulated is required. Here we use the default data frame included with the package:

data(examplemeteo)
head(examplemeteo)
##        dates MinTemperature MaxTemperature Precipitation MinRelativeHumidity
## 1 2001-01-01     -0.5934215       6.287950      4.869109            65.15411
## 2 2001-01-02     -2.3662458       4.569737      2.498292            57.43761
## 3 2001-01-03     -3.8541036       2.661951      0.000000            58.77432
## 4 2001-01-04     -1.8744860       3.097705      5.796973            66.84256
## 5 2001-01-05      0.3288287       7.551532      1.884401            62.97656
## 6 2001-01-06      0.5461322       7.186784     13.359801            74.25754
##   MaxRelativeHumidity Radiation WindSpeed
## 1           100.00000  12.89251  2.000000
## 2            94.71780  13.03079  7.662544
## 3            94.66823  16.90722  2.000000
## 4            95.80950  11.07275  2.000000
## 5           100.00000  13.45205  7.581347
## 6           100.00000  12.84841  6.570501

Finally, simulations in medfate require a data frame with species parameter values, which we load using defaults for Catalonia (NE Spain):

data("SpParamsMED")

Simulation control

Apart from data inputs, the behaviour of simulation models can be controlled using a set of global parameters. The default parameterization is obtained using function defaultControl():

control <- defaultControl("Granier")

Some parameters deserve explanation here:

  1. Console output can be turned off by setting verbose = FALSE.
  2. The soil water retention curves can be switched between Saxton’s and Van Genuchten’s using parameter soilFunctions.
  3. The complexity of the soil water balance calculations will be very different if we set transpirationMode = "Sperry" or transpirationMode = "Sureau", instead of transpirationMode = "Granier".

Water balance input object

A last object is needed before calling simulation functions, called spwbInput. It consists in the compilation of aboveground and belowground parameters and the specification of additional parameter values for each plant cohort. The object can be generated using function spwbInput():

x <- spwbInput(exampleforest, examplesoil, SpParamsMED, control)

Different parameter variables will be drawn depending on the value of transpirationMode. For the basic water balance model (transpirationMode = "Granier"), relatively few parameters are needed. All the input information for forest data and species parameter values can be inspected by accessing the different elements of this object, whose names are.

##  [1] "control"                 "soil"                   
##  [3] "snowpack"                "canopy"                 
##  [5] "herbLAI"                 "herbLAImax"             
##  [7] "cohorts"                 "above"                  
##  [9] "below"                   "belowLayers"            
## [11] "paramsPhenology"         "paramsAnatomy"          
## [13] "paramsInterception"      "paramsTranspiration"    
## [15] "paramsWaterStorage"      "internalPhenology"      
## [17] "internalWater"           "internalLAIDistribution"
## [19] "internalFCCS"

Finally, note that users can set cohort-specific parameters for soil water balance (instead of using species-level values) by modifying manually the parameter values in this object. Since some parameters may be coordinated by design, however, it is better to use specific package functions for this purpose.

Executing the soil water balance model

Water balance for a single day

Soil water balance simulations will normally span periods of several months or years, but since the model operates at a daily temporal scale, it is possible to perform soil water balance for one day only. This is done using function spwb_day(). In the following code we select day 100 from the meteorological input data and perform soil water balance for that day only:

d <- 100
date <- examplemeteo$dates[d]
meteovec <- unlist(examplemeteo[d,])
sd1<-spwb_day(x, date, meteovec,  
             latitude = 41.82592, elevation = 100, slope= 0, aspect = 0)
## Package 'meteoland' [ver. 2.2.2]

Function spwb_day() is most useful when working with the complex transpiration model. This is why so many meteorological variables are required. The output of spwb_day() is a list with five elements:

names(sd1)
## [1] "cohorts"      "topography"   "weather"      "WaterBalance" "Soil"        
## [6] "Stand"        "Plants"
  • cohorts: Table with the species code and species name of each cohort.
  • WaterBalance: Contains the soil water balance flows (precipitation, infiltration, transpiration, …)
  • Soil: Contains output values by soil layer (i.e. water evaporated from each soil layer, water transpired from each soil layer and the final soil water potential).
  • Stand: A list with stand LAI (expanded and dead leaves), canopy water retention capacity and the proportion of light (SWR or PAR) reaching the ground.
  • Plants: Contains output values by plant cohort (i.e. LAI values, transpiration, water potential, drought stress index, …).
sd1
## $cohorts
##         SP              Name
## T1_148 148  Pinus halepensis
## T2_168 168      Quercus ilex
## S1_165 165 Quercus coccifera
## 
## $topography
## elevation     slope    aspect 
##       100         0         0 
## 
## $weather
##        tday        prec        tmin        tmax       rhmin       rhmax 
##   6.2323731   0.0000000   0.3881289  10.0320962  42.0207334  82.3036989 
##         rad        wind        Catm        Patm         pet        rint 
##  28.7201692   3.3228840 386.0000000          NA   3.9023342   1.5000000 
## 
## $WaterBalance
##                     PET                    Rain                    Snow 
##              3.90233421              0.00000000              0.00000000 
##                 NetRain                Snowmelt                   Runon 
##              0.00000000              0.00000000              0.00000000 
##            Infiltration      InfiltrationExcess        SaturationExcess 
##              0.00000000              0.00000000              0.00000000 
##                  Runoff            DeepDrainage         CapillarityRise 
##              0.00000000              0.00000000              0.00000000 
##         SoilEvaporation       HerbTranspiration         PlantExtraction 
##              0.50000000              0.04872542              0.89968355 
##           Transpiration HydraulicRedistribution 
##              0.89968355              0.00000000 
## 
## $Soil
##           Psi HerbTranspiration HydraulicInput HydraulicOutput PlantExtraction
## 1 -0.03586605      0.0444001775              0     0.654144225     0.654144225
## 2 -0.03329772      0.0034620610              0     0.217680714     0.217680714
## 3 -0.03304737      0.0006078123              0     0.022325608     0.022325608
## 4 -0.03302988      0.0002553696              0     0.005533003     0.005533003
## 
## $Stand
##         LAI     LAIherb     LAIlive LAIexpanded     LAIdead          Cm 
##   1.7585845   0.1736369   1.5849476   1.5849476   0.0000000   1.3904846 
##  LgroundPAR  LgroundSWR 
##  40.0075402  50.7329667 
## 
## $Plants
##               LAI    LAIlive     FPAR AbsorbedSWRFraction Extraction
## T1_148 0.84874773 0.84874773 92.18285           35.076344 0.55258221
## T2_168 0.70557382 0.70557382 72.36365           30.444383 0.32034759
## S1_165 0.03062604 0.03062604 44.32407            2.366131 0.02675376
##        Transpiration GrossPhotosynthesis PlantPsi         DDS   StemRWC
## T1_148    0.55258221           3.7143297   -0.033 0.004613739 0.9998350
## T2_168    0.32034759           2.9300190   -0.033 0.006282261 0.9997500
## S1_165    0.02675376           0.1635903   -0.033 0.003088161 0.9983684
##          LeafRWC      LFMC      StemPLC      LeafPLC WaterBalance
## T1_148 0.9979679 125.89003 0.000000e+00 0.000000e+00            0
## T2_168 0.9986797  93.07454 3.681226e-09 2.905929e-03            0
## S1_165 0.9987207  96.39176 4.394058e-08 3.473351e-05            0
## 
## attr(,"class")
## [1] "spwb_day" "list"

Water balance for multiple days

Most often, users will use function spwb() to run the soil water balance model. This function requires the spwbInput object and the meteorological data frame. However, function spwb_day() by default modifies the state variables of the input objects. In particular, the values of soil moisture are now:

x$soil$W
## [1] 0.9824193 0.9981043 0.9996972 0.9998090

We simply reset state variables to their default values so that new simulations are not affected by the end state of the previous simulation:

resetInputs(x)
x$soil$W
## [1] 1 1 1 1

Now we are ready to call function spwb():

S <- spwb(x, examplemeteo, latitude = 41.82592, elevation = 100)
## Initial plant water content (mm): 4.73001
## Initial soil water content (mm): 290.875
## Initial snowpack content (mm): 0
## Performing daily simulations
## 
##  [Year 2001]:............
## 
## Final plant water content (mm): 4.7285
## Final soil water content (mm): 274.723
## Final snowpack content (mm): 0
## Change in plant water content (mm): -0.00151775
## Plant water balance result (mm): -0.00151775
## Change in soil water content (mm): -16.1521
## Soil water balance result (mm): -16.1521
## 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) 400 Infiltration excess (mm) 21 Saturation excess (mm) 0 Capillarity rise (mm) 0
##   Soil evaporation (mm) 26  Herbaceous transpiration (mm) 14 Woody plant transpiration (mm) 249
##   Plant extraction from soil (mm) 249  Plant water balance (mm) -0 Hydraulic redistribution (mm) 5
##   Runoff (mm) 21 Deep drainage (mm) 128

Function spwb() returns an object of class with the same name, actually a list:

## [1] "spwb" "list"

If we inspect its elements, we realize that the output is arranged differently than in spwb_day():

##  [1] "latitude"     "topography"   "weather"      "spwbInput"    "spwbOutput"  
##  [6] "WaterBalance" "Soil"         "Snow"         "Stand"        "Plants"

In particular, element spwbInput contains a copy of the input parameters that were used to run the model:

names(S$spwbInput)
##  [1] "control"                 "soil"                   
##  [3] "snowpack"                "canopy"                 
##  [5] "herbLAI"                 "herbLAImax"             
##  [7] "cohorts"                 "above"                  
##  [9] "below"                   "belowLayers"            
## [11] "paramsPhenology"         "paramsAnatomy"          
## [13] "paramsInterception"      "paramsTranspiration"    
## [15] "paramsWaterStorage"      "internalPhenology"      
## [17] "internalWater"           "internalLAIDistribution"
## [19] "internalFCCS"

As before, WaterBalance contains water balance components, but in this case in form of a data frame with days in rows:

head(S$WaterBalance)
##                  PET Precipitation      Rain Snow    NetRain Snowmelt
## 2001-01-01 0.8828475      4.869109  4.869109    0  3.4241795        0
## 2001-01-02 1.6375337      2.498292  2.498292    0  1.0717469        0
## 2001-01-03 1.3017026      0.000000  0.000000    0  0.0000000        0
## 2001-01-04 0.5690790      5.796973  5.796973    0  4.3625616        0
## 2001-01-05 1.6760567      1.884401  1.884401    0  0.7539027        0
## 2001-01-06 1.2077028     13.359801 13.359801    0 11.7240275        0
##            Infiltration InfiltrationExcess SaturationExcess Runoff DeepDrainage
## 2001-01-01    3.4241795                  0                0      0   2.76172073
## 2001-01-02    1.0717469                  0                0      0   0.18953238
## 2001-01-03    0.0000000                  0                0      0   0.00000000
## 2001-01-04    4.3625616                  0                0      0   3.24803369
## 2001-01-05    0.7539027                  0                0      0   0.09976167
## 2001-01-06   11.7240275                  0                0      0   4.12141379
##            CapillarityRise Evapotranspiration Interception SoilEvaporation
## 2001-01-01               0          2.1073881     1.444929       0.4478948
## 2001-01-02               0          2.3245249     1.426545       0.5000000
## 2001-01-03               0          0.8008422     0.000000       0.4844828
## 2001-01-04               0          1.7323314     1.434411       0.1596478
## 2001-01-05               0          2.0378414     1.130499       0.5000000
## 2001-01-06               0          2.2365181     1.635773       0.3072545
##            HerbTranspiration PlantExtraction Transpiration
## 2001-01-01       0.011023432       0.2035406     0.2035406
## 2001-01-02       0.020446613       0.3775336     0.3775336
## 2001-01-03       0.016253339       0.3001060     0.3001060
## 2001-01-04       0.007105403       0.1311669     0.1311669
## 2001-01-05       0.020927620       0.3864150     0.3864150
## 2001-01-06       0.015079467       0.2784110     0.2784110
##            HydraulicRedistribution
## 2001-01-01                       0
## 2001-01-02                       0
## 2001-01-03                       0
## 2001-01-04                       0
## 2001-01-05                       0
## 2001-01-06                       0

Element Plants is in turn a list with several dataframes with plant output variables, for example plant water potentials are in:

head(S$Plants$PlantPsi)
##                 T1_148      T2_168      S1_165
## 2001-01-01 -0.03300000 -0.03300000 -0.03300000
## 2001-01-02 -0.03300000 -0.03300000 -0.03300000
## 2001-01-03 -0.03303113 -0.03301812 -0.03302460
## 2001-01-04 -0.03443824 -0.03388161 -0.03415864
## 2001-01-05 -0.03300000 -0.03300000 -0.03300000
## 2001-01-06 -0.03350436 -0.03329360 -0.03339865

Inspecting model outputs

Plots

Package medfate provides a simple plot function for objects of class spwb. It can be used to show meteorological inputs, snow dynamics, and different components of the water balance:

plot(S, type = "PET_Precipitation")

plot(S, type = "Snow")

plot(S, type = "Export")

plot(S, type = "Evapotranspiration")

Function plot is also allows displaying soil moisture dynamics by layer, which can be done in four different ways (the first two only imply a change in axis units):

plot(S, type="SoilTheta")

plot(S, type="SoilRWC")

plot(S, type="SoilPsi")

plot(S, type="SoilVol")

Finally, the same function can also be used to draw the dynamics of plant variables by cohorts, such as transpiration, gross photosynthesis or water potential:

plot(S, type="Transpiration")

plot(S, type="GrossPhotosynthesis")

plot(S, type="PlantPsi")

Finally, one can interactively create plots using function shinyplot, e.g.:

Extracting output

Simulation outputs in form of lists have a nested structure that is not easy to handle. Functions are provided to extract model outputs as data.frame objects. The following code extracts daily series of stand-level variables:

df <- extract(S, "forest")
head(df)
##         date       PET Precipitation      Rain Snow    NetRain Snowmelt
## 1 2001-01-01 0.8828475      4.869109  4.869109    0  3.4241795        0
## 2 2001-01-02 1.6375337      2.498292  2.498292    0  1.0717469        0
## 3 2001-01-03 1.3017026      0.000000  0.000000    0  0.0000000        0
## 4 2001-01-04 0.5690790      5.796973  5.796973    0  4.3625616        0
## 5 2001-01-05 1.6760567      1.884401  1.884401    0  0.7539027        0
## 6 2001-01-06 1.2077028     13.359801 13.359801    0 11.7240275        0
##   Infiltration InfiltrationExcess SaturationExcess Runoff DeepDrainage
## 1    3.4241795                  0                0      0   2.76172073
## 2    1.0717469                  0                0      0   0.18953238
## 3    0.0000000                  0                0      0   0.00000000
## 4    4.3625616                  0                0      0   3.24803369
## 5    0.7539027                  0                0      0   0.09976167
## 6   11.7240275                  0                0      0   4.12141379
##   CapillarityRise Evapotranspiration Interception SoilEvaporation
## 1               0          2.1073881     1.444929       0.4478948
## 2               0          2.3245249     1.426545       0.5000000
## 3               0          0.8008422     0.000000       0.4844828
## 4               0          1.7323314     1.434411       0.1596478
## 5               0          2.0378414     1.130499       0.5000000
## 6               0          2.2365181     1.635773       0.3072545
##   HerbTranspiration PlantExtraction Transpiration HydraulicRedistribution
## 1       0.011023432       0.2035406     0.2035406                       0
## 2       0.020446613       0.3775336     0.3775336                       0
## 3       0.016253339       0.3001060     0.3001060                       0
## 4       0.007105403       0.1311669     0.1311669                       0
## 5       0.020927620       0.3864150     0.3864150                       0
## 6       0.015079467       0.2784110     0.2784110                       0
##        LAI   LAIherb  LAIlive LAIexpanded LAIdead       Cm LgroundPAR
## 1 1.758585 0.1736369 1.584948    1.584948       0 1.390485   40.00754
## 2 1.758585 0.1736369 1.584948    1.584948       0 1.390485   40.00754
## 3 1.758585 0.1736369 1.584948    1.584948       0 1.390485   40.00754
## 4 1.758585 0.1736369 1.584948    1.584948       0 1.390485   40.00754
## 5 1.758585 0.1736369 1.584948    1.584948       0 1.390485   40.00754
## 6 1.758585 0.1736369 1.584948    1.584948       0 1.390485   40.00754
##   LgroundSWR SWE
## 1   50.73297   0
## 2   50.73297   0
## 3   50.73297   0
## 4   50.73297   0
## 5   50.73297   0
## 6   50.73297   0

And a similar code can be used to daily series of cohort-level variables:

df <- extract(S, "cohort")
head(df)
##         date cohort          species       LAI   LAIlive     FPAR
## 1 2001-01-01 T1_148 Pinus halepensis 0.8487477 0.8487477 92.18285
## 2 2001-01-02 T1_148 Pinus halepensis 0.8487477 0.8487477 92.18285
## 3 2001-01-03 T1_148 Pinus halepensis 0.8487477 0.8487477 92.18285
## 4 2001-01-04 T1_148 Pinus halepensis 0.8487477 0.8487477 92.18285
## 5 2001-01-05 T1_148 Pinus halepensis 0.8487477 0.8487477 92.18285
## 6 2001-01-06 T1_148 Pinus halepensis 0.8487477 0.8487477 92.18285
##   AbsorbedSWRFraction Transpiration GrossPhotosynthesis    PlantPsi LeafPLC
## 1            35.07634    0.12501386            1.213416 -0.03300000       0
## 2            35.07634    0.23187968            2.104075 -0.03300000       0
## 3            35.07634    0.18432378            1.774462 -0.03303113       0
## 4            35.07634    0.08055859            0.813316 -0.03443824       0
## 5            35.07634    0.23733465            2.184267 -0.03300000       0
## 6            35.07634    0.17099608            1.791178 -0.03350436       0
##   StemPLC PlantWaterBalance   LeafRWC   StemRWC     LFMC PlantStress
## 1       0      0.000000e+00 0.9979679 0.9998350 125.8900 0.004613739
## 2       0      0.000000e+00 0.9979679 0.9998350 125.8900 0.004613739
## 3       0     -1.405221e-06 0.9979660 0.9998348 125.8899 0.004620274
## 4       0     -6.351485e-05 0.9978794 0.9998278 125.8839 0.004918823
## 5       0      6.492007e-05 0.9979679 0.9998350 125.8900 0.004613739
## 6       0     -2.276642e-05 0.9979369 0.9998324 125.8879 0.004719988

Temporal summaries

While the simulation model uses daily steps, users will normally be interested in outputs at larger time scales. The package provides a summary for objects of class spwb. This function can be used to summarize the model’s output at different temporal steps (i.e. weekly, annual, …). For example, to obtain the water balance by months one can use:

summary(S, freq="months",FUN=mean, output="WaterBalance")
##                 PET Precipitation       Rain      Snow    NetRain   Snowmelt
## 2001-01-01 1.011397    2.41127383 1.87415609 0.5371177 1.34613589 0.42235503
## 2001-02-01 2.278646    0.17855109 0.08778069 0.0907704 0.03511889 0.19831578
## 2001-03-01 2.368035    2.41917349 2.41917349 0.0000000 1.93933438 0.01762496
## 2001-04-01 3.086567    0.63056064 0.29195973 0.3386009 0.13472156 0.33860091
## 2001-05-01 3.662604    0.76337345 0.76337345 0.0000000 0.57881566 0.00000000
## 2001-06-01 5.265359    0.21959509 0.21959509 0.0000000 0.15746695 0.00000000
## 2001-07-01 4.443053    3.27810591 3.27810591 0.0000000 2.81775241 0.00000000
## 2001-08-01 4.463242    1.92222891 1.92222891 0.0000000 1.55188110 0.00000000
## 2001-09-01 3.453891    1.30651303 1.30651303 0.0000000 1.04946567 0.00000000
## 2001-10-01 2.405506    1.33598175 1.33598175 0.0000000 1.05395924 0.00000000
## 2001-11-01 1.716591    2.20566281 1.47764599 0.7280168 1.33350571 0.72801682
## 2001-12-01 1.608082    0.05046181 0.05046181 0.0000000 0.02018853 0.00000000
##            Infiltration InfiltrationExcess SaturationExcess     Runoff
## 2001-01-01   1.76849092         0.00000000                0 0.00000000
## 2001-02-01   0.23343467         0.00000000                0 0.00000000
## 2001-03-01   1.95695933         0.00000000                0 0.00000000
## 2001-04-01   0.47332247         0.00000000                0 0.00000000
## 2001-05-01   0.57881566         0.00000000                0 0.00000000
## 2001-06-01   0.15746695         0.00000000                0 0.00000000
## 2001-07-01   2.52051838         0.29723403                0 0.29723403
## 2001-08-01   1.51260303         0.03927806                0 0.03927806
## 2001-09-01   1.04946567         0.00000000                0 0.00000000
## 2001-10-01   0.94550777         0.10845147                0 0.10845147
## 2001-11-01   1.81380382         0.24771871                0 0.24771871
## 2001-12-01   0.02018853         0.00000000                0 0.00000000
##            DeepDrainage CapillarityRise Evapotranspiration Interception
## 2001-01-01   1.42475654               0          0.9469929   0.52802019
## 2001-02-01   0.00443135               0          0.6648546   0.05266179
## 2001-03-01   1.13215212               0          1.1747925   0.47983911
## 2001-04-01   0.00000000               0          0.9197907   0.15723817
## 2001-05-01   0.00000000               0          1.1375146   0.18455779
## 2001-06-01   0.00000000               0          1.3146359   0.06212814
## 2001-07-01   0.00000000               0          1.6430660   0.46035350
## 2001-08-01   0.00000000               0          1.5123815   0.37034782
## 2001-09-01   0.00000000               0          1.1564214   0.25704736
## 2001-10-01   0.36163006               0          0.9433241   0.28202252
## 2001-11-01   1.23136121               0          0.6253738   0.14414028
## 2001-12-01   0.00000000               0          0.4403926   0.03027328
##            SoilEvaporation HerbTranspiration PlantExtraction Transpiration
## 2001-01-01     0.173200243        0.01262829       0.2331442     0.2331442
## 2001-02-01     0.059381717        0.02844432       0.5243667     0.5243667
## 2001-03-01     0.120250680        0.02956161       0.5451411     0.5451411
## 2001-04-01     0.016035154        0.03851007       0.7080074     0.7080074
## 2001-05-01     0.067146317        0.04569483       0.8401156     0.8401156
## 2001-06-01     0.006696057        0.06533277       1.1804789     1.1804789
## 2001-07-01     0.110999950        0.05539539       1.0163172     1.0163172
## 2001-08-01     0.061171907        0.05569881       1.0251630     1.0251630
## 2001-09-01     0.062199712        0.04310862       0.7940657     0.7940657
## 2001-10-01     0.077508497        0.03002986       0.5537632     0.5537632
## 2001-11-01     0.064779318        0.02142805       0.3950262     0.3950262
## 2001-12-01     0.020637953        0.02006816       0.3694132     0.3694132
##            HydraulicRedistribution
## 2001-01-01            0.0005519858
## 2001-02-01            0.0003086511
## 2001-03-01            0.0005558499
## 2001-04-01            0.0000000000
## 2001-05-01            0.0113159388
## 2001-06-01            0.0000000000
## 2001-07-01            0.0613223302
## 2001-08-01            0.0540533907
## 2001-09-01            0.0131069615
## 2001-10-01            0.0055364191
## 2001-11-01            0.0005577914
## 2001-12-01            0.0000000000

Parameter output is used to indicate the element of the spwb object for which we desire summaries. Similarly, it is possible to calculate the average stress of plant cohorts by months:

summary(S, freq="months",FUN=mean, output="PlantStress")
##                 T1_148      T2_168      S1_165
## 2001-01-01 0.004773280 0.006381122 0.003160206
## 2001-02-01 0.006705762 0.007649057 0.004059289
## 2001-03-01 0.006241447 0.007320306 0.003834123
## 2001-04-01 0.010550415 0.010187824 0.005819370
## 2001-05-01 0.009599211 0.009424160 0.005341480
## 2001-06-01 0.037076275 0.023913153 0.016427375
## 2001-07-01 0.012835893 0.012459017 0.007043919
## 2001-08-01 0.008878109 0.009235359 0.005121251
## 2001-09-01 0.007878910 0.008458217 0.004608889
## 2001-10-01 0.006250142 0.007456718 0.003881840
## 2001-11-01 0.006570576 0.007550018 0.003988078
## 2001-12-01 0.008947174 0.009012524 0.005057706

The summary function can be also used to aggregate the output by species. In this case, the values of plant cohorts belonging to the same species will be averaged using LAI values as weights. For example, we may average the daily drought stress across cohorts of the same species (here there is only one cohort by species, so this does not modify the output):

head(summary(S, freq="day", output="PlantStress", bySpecies = TRUE))
##            Pinus halepensis Quercus coccifera Quercus ilex
## 2001-01-01      0.004613739       0.003088161  0.006282261
## 2001-01-02      0.004613739       0.003088161  0.006282261
## 2001-01-03      0.004620274       0.003091150  0.006286213
## 2001-01-04      0.004918823       0.003229622  0.006474864
## 2001-01-05      0.004613739       0.003088161  0.006282261
## 2001-01-06      0.004719988       0.003136670  0.006346322

Or we can combine the aggregation by species with a temporal aggregation (here monthly averages):

summary(S, freq="month", FUN = mean, output="PlantStress", bySpecies = TRUE)
##            Pinus halepensis Quercus coccifera Quercus ilex
## 2001-01-01      0.004773280       0.003160206  0.006381122
## 2001-02-01      0.006705762       0.004059289  0.007649057
## 2001-03-01      0.006241447       0.003834123  0.007320306
## 2001-04-01      0.010550415       0.005819370  0.010187824
## 2001-05-01      0.009599211       0.005341480  0.009424160
## 2001-06-01      0.037076275       0.016427375  0.023913153
## 2001-07-01      0.012835893       0.007043919  0.012459017
## 2001-08-01      0.008878109       0.005121251  0.009235359
## 2001-09-01      0.007878910       0.004608889  0.008458217
## 2001-10-01      0.006250142       0.003881840  0.007456718
## 2001-11-01      0.006570576       0.003988078  0.007550018
## 2001-12-01      0.008947174       0.005057706  0.009012524

Specific output functions

The package provides some functions to extract or transform specific outputs from soil plant water balance simulations. In particular, function droughtStress() allows calculating several plant stress indices, such as the number of days with drought stress > 0.5 or the maximum drought stress:

droughtStress(S, index = "NDD", freq = "years", draw=FALSE)
##            T1_148 T2_168 S1_165
## 2001-01-01      0      0      0
droughtStress(S, index = "MDS", freq = "years", draw=FALSE)
##                T1_148     T2_168     S1_165
## 2001-01-01 0.06072597 0.03471311 0.02524436

As the general summary function, droughtStress() allows calculating stress indices at several temporal scales. For example the water stress index (integral of water potential values) can be calculated and drawn for every month:

droughtStress(S, index = "WSI", freq = "months", draw=TRUE)

Another specific summary function is waterUseEfficiency(). This is most useful with advanced water and energy balance modeling, but for simple water balance it calculates the ratio between photosynthesis and transpiration at the desired scale. In this case it is equal to the value of the input species parameter WUE:

waterUseEfficiency(S, type = "Stand Ag/E", freq = "months", draw=FALSE)
##            Stand Ag/E
## 2001-01-01  10.153004
## 2001-02-01   8.238184
## 2001-03-01   9.036680
## 2001-04-01   8.838007
## 2001-05-01   8.275341
## 2001-06-01   6.379552
## 2001-07-01   7.028561
## 2001-08-01   6.308963
## 2001-09-01   7.485210
## 2001-10-01   7.685487
## 2001-11-01   8.767115
## 2001-12-01   8.446743

References

  • De Cáceres M, Martínez-Vilalta J, Coll L, Llorens P, Casals P, Poyatos R, Pausas JG, Brotons L. (2015) Coupling a water balance model with forest inventory data to predict drought stress: the role of forest structural changes vs. climate changes. Agricultural and Forest Meteorology 213: 77-90 (https://doi.org/10.1016/j.agrformet.2015.06.012).