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():

The soil input for water balance simulation is actually a list of class soil that is created using a function with the same name:

examplesoil <- soil(spar)

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 = "Cochard", 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. This is done by calling function spwbInput(), but if one has a forest object, the object can be generated more directly using function forest2spwbInput():

x <- forest2spwbInput(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"                "canopy"             
##  [4] "herbLAI"             "herbLAImax"          "cohorts"            
##  [7] "above"               "below"               "belowLayers"        
## [10] "paramsPhenology"     "paramsAnatomy"       "paramsInterception" 
## [13] "paramsTranspiration" "paramsWaterStorage"  "internalPhenology"  
## [16] "internalWater"       "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.1]

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.902334206             0.000000000             0.000000000 
##                 NetRain                Snowmelt                   Runon 
##             0.000000000             0.000000000             0.000000000 
##            Infiltration                  Runoff            DeepDrainage 
##             0.000000000             0.000000000             0.008440323 
##         SoilEvaporation       HerbTranspiration         PlantExtraction 
##             0.500000000             0.048725420             0.668683872 
##           Transpiration HydraulicRedistribution 
##             0.668683872             0.000000000 
## 
## $Soil
##   HerbTranspiration HydraulicInput HydraulicOutput PlantExtraction         psi
## 1       0.008571001              0      0.48671421      0.48671421 -0.03561662
## 2       0.012000080              0      0.16122392      0.16122392 -0.03318488
## 3       0.013576976              0      0.01660923      0.01660923 -0.03297589
## 4       0.014577363              0      0.00413651      0.00413651 -0.03300932
## 
## $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.40874422
## T2_168 0.70557382 0.70557382 72.36365           30.444383 0.23318589
## S1_165 0.03062604 0.03062604 44.32407            2.366131 0.02675376
##        Transpiration GrossPhotosynthesis PlantPsi         DDS   StemRWC
## T1_148    0.40874422           2.7741548   -0.033 0.005808769 0.9998350
## T2_168    0.23318589           2.1058696   -0.033 0.010612890 0.9997489
## S1_165    0.02675376           0.1635903   -0.033 0.003088161 0.9983684
##          LeafRWC      LFMC      StemPLC      LeafPLC WaterBalance
## T1_148 0.9979679 125.89003 1.320577e-11 3.713826e-03            0
## T2_168 0.9986794  93.07448 1.691266e-06 3.473351e-05            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.9838922 0.9988208 1.0001543 0.9999404

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): 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.05708
## Final soil water content (mm): 322.866
## Final snowpack content (mm): 0
## Change in plant water content (mm): -0.00151384
## Plant water balance result (mm): -0.00151384
## Change in soil water content (mm): 31.9909
## Soil water balance result (mm): 31.9406
## 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) 325 Runoff (mm) 45 Deep drainage (mm) 127
##   Soil evaporation (mm) 16  Herbaceous transpiration (mm) 14 Woody plant transpiration (mm) 187
##   Plant extraction from soil (mm) 187  Plant water balance (mm) -0 Hydraulic redistribution (mm) 2

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"         "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"                "canopy"             
##  [4] "herbLAI"             "herbLAImax"          "cohorts"            
##  [7] "above"               "below"               "belowLayers"        
## [10] "paramsPhenology"     "paramsAnatomy"       "paramsInterception" 
## [13] "paramsTranspiration" "paramsWaterStorage"  "internalPhenology"  
## [16] "internalWater"       "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 Runoff DeepDrainage Evapotranspiration Interception
## 2001-01-01    3.4241795      0  0.008464442          2.0551277     1.444929
## 2001-01-02    1.0717469      0  0.008522595          1.7959855     1.426545
## 2001-01-03    0.0000000      0  0.008594922          0.2975262     0.000000
## 2001-01-04    4.3625616      0  0.008663866          1.6097210     1.434411
## 2001-01-05    0.7539027      0  0.008736669          1.4664059     1.130499
## 2001-01-06   11.7240275      0  0.008816975          1.8850428     1.635773
##            SoilEvaporation HerbTranspiration PlantExtraction Transpiration
## 2001-01-01      0.44789475       0.011023432      0.15128020    0.15128020
## 2001-01-02      0.06815427       0.020448134      0.28083835    0.28083835
## 2001-01-03      0.05799418       0.016254749      0.22327725    0.22327725
## 2001-01-04      0.07060554       0.007106159      0.09759798    0.09759798
## 2001-01-05      0.02721406       0.020930945      0.28776211    0.28776211
## 2001-01-06      0.02682805       0.015082070      0.20735952    0.20735952
##            HydraulicRedistribution
## 2001-01-01             0.000000000
## 2001-01-02             0.017897872
## 2001-01-03             0.014690001
## 2001-01-04             0.006765439
## 2001-01-05             0.019714384
## 2001-01-06             0.014541996

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.02951758 -0.03050848 -0.03003168
## 2001-01-03 -0.02890922 -0.03001067 -0.02948276
## 2001-01-04 -0.02957884 -0.03039120 -0.03000394
## 2001-01-05 -0.02487192 -0.02705731 -0.02602192
## 2001-01-06 -0.02473400 -0.02685630 -0.02585353

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 Runoff DeepDrainage Evapotranspiration Interception
## 1    3.4241795      0  0.008464442          2.0551277     1.444929
## 2    1.0717469      0  0.008522595          1.7959855     1.426545
## 3    0.0000000      0  0.008594922          0.2975262     0.000000
## 4    4.3625616      0  0.008663866          1.6097210     1.434411
## 5    0.7539027      0  0.008736669          1.4664059     1.130499
## 6   11.7240275      0  0.008816975          1.8850428     1.635773
##   SoilEvaporation HerbTranspiration PlantExtraction Transpiration
## 1      0.44789475       0.011023432      0.15128020    0.15128020
## 2      0.06815427       0.020448134      0.28083835    0.28083835
## 3      0.05799418       0.016254749      0.22327725    0.22327725
## 4      0.07060554       0.007106159      0.09759798    0.09759798
## 5      0.02721406       0.020930945      0.28776211    0.28776211
## 6      0.02682805       0.015082070      0.20735952    0.20735952
##   HydraulicRedistribution      LAI   LAIherb  LAIlive LAIexpanded LAIdead
## 1             0.000000000 1.758585 0.1736369 1.584948    1.584948       0
## 2             0.017897872 1.758585 0.1736369 1.584948    1.584948       0
## 3             0.014690001 1.758585 0.1736369 1.584948    1.584948       0
## 4             0.006765439 1.758585 0.1736369 1.584948    1.584948       0
## 5             0.019714384 1.758585 0.1736369 1.584948    1.584948       0
## 6             0.014541996 1.758585 0.1736369 1.584948    1.584948       0
##         Cm LgroundPAR LgroundSWR      W.1      W.2      W.3      W.4     ML.1
## 1 1.390485   40.00754   50.73297 1.000000 1.000000 1.000000 1.000000 68.17381
## 2 1.390485   40.00754   50.73297 1.026403 1.007792 1.001098 1.000442 69.97381
## 3 1.390485   40.00754   50.73297 1.031191 1.010213 1.001917 1.001201 70.30021
## 4 1.390485   40.00754   50.73297 1.025451 1.010337 1.002559 1.001927 69.90891
## 5 1.390485   40.00754   50.73297 1.067175 1.020660 1.004008 1.002607 72.75342
## 6 1.390485   40.00754   50.73297 1.068148 1.022820 1.004892 1.003397 72.81970
##       ML.2     ML.3     ML.4    MLTot      WTD SWE PlantExt.1 PlantExt.2
## 1 116.6530 75.74868 30.29947 290.8749 3961.453   0 0.11011216 0.03647462
## 2 117.5620 75.83185 30.31287 293.6805 3947.729   0 0.23992016 0.05881606
## 3 117.8443 75.89390 30.33588 294.3743 3946.579   0 0.19145132 0.04651593
## 4 117.8588 75.94254 30.35785 294.0681 3889.977   0 0.08293675 0.02142667
## 5 119.0630 76.05226 30.37846 298.2471 3879.263   0 0.25553799 0.05193850
## 6 119.3150 76.11922 30.40241 298.6563 3730.611   0 0.18385494 0.03804657
##     PlantExt.3    PlantExt.4 HydraulicInput.1 HydraulicInput.2 HydraulicInput.3
## 1  0.003757603  0.0009358264                0                0      0.000000000
## 2 -0.006235893 -0.0116619793                0                0      0.006235893
## 3 -0.005254725 -0.0094352760                0                0      0.005254725
## 4 -0.002424284 -0.0043411553                0                0      0.002424284
## 5 -0.007609389 -0.0121049954                0                0      0.007609389
## 6 -0.005637492 -0.0089045039                0                0      0.005637492
##   HydraulicInput.4       psi.1       psi.2       psi.3       psi.4
## 1      0.000000000 -0.02911359 -0.03180352 -0.03282877 -0.03293093
## 2      0.011661979 -0.02845746 -0.03144058 -0.03270161 -0.03281269
## 3      0.009435276 -0.02924575 -0.03142203 -0.03260225 -0.03270011
## 4      0.004341155 -0.02394313 -0.02991958 -0.03237923 -0.03259489
## 5      0.012104995 -0.02383056 -0.02961393 -0.03224385 -0.03247304
## 6      0.008904504 -0.01302897 -0.02589535 -0.03179471 -0.03234676

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.09247256           0.8934407 -0.03300000 0.003713826
## 2            35.07634    0.17167226           1.5611765 -0.02951758 0.003157972
## 3            35.07634    0.13648547           1.3089514 -0.02890922 0.003063776
## 4            35.07634    0.05965898           0.5972837 -0.02957884 0.003167505
## 5            35.07634    0.17590438           1.6200910 -0.02487192 0.002461788
## 6            35.07634    0.12675398           1.3121531 -0.02473400 0.002441958
##        StemPLC PlantWaterBalance   LeafRWC   StemRWC     LFMC PlantStress
## 1 1.320577e-11      0.000000e+00 0.9979679 0.9998350 125.8900 0.005808769
## 2 1.320577e-11      1.908389e-04 0.9981823 0.9998524 125.9049 0.004932295
## 3 1.320577e-11      3.334063e-05 0.9982197 0.9998554 125.9075 0.004783882
## 4 1.320577e-11     -3.669746e-05 0.9981785 0.9998521 125.9046 0.004947317
## 5 1.320577e-11      2.579668e-04 0.9984682 0.9998756 125.9247 0.003836334
## 6 1.320577e-11      7.558992e-06 0.9984767 0.9998763 125.9252 0.003805150

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 average soil moisture and water potentials by months one can use:

summary(S, freq="months",FUN=mean, output="Soil")
##                  W.1      W.2      W.3      W.4     ML.1     ML.2     ML.3
## 2001-01-01 1.1832948 1.132263 1.037686 1.013238 80.66972 132.0818 78.60334
## 2001-02-01 1.0029762 1.214418 1.226702 1.130190 68.37671 141.6655 92.92105
## 2001-03-01 1.1218518 1.207655 1.298821 1.369937 76.48091 140.8765 98.38398
## 2001-04-01 0.9714427 1.121488 1.248299 1.359250 66.22695 130.8249 94.55701
## 2001-05-01 1.0322684 1.090530 1.197692 1.314739 70.37368 127.2135 90.72356
## 2001-06-01 0.8389875 0.988646 1.139449 1.238293 57.19698 115.3285 86.31179
## 2001-07-01 1.0847195 1.033553 1.095341 1.154467 73.94947 120.5670 82.97062
## 2001-08-01 1.0853454 1.128277 1.137350 1.144378 73.99213 131.6169 86.15280
## 2001-09-01 1.0542639 1.163151 1.215791 1.227809 71.87319 135.6850 92.09455
## 2001-10-01 1.0613549 1.137133 1.240113 1.333936 72.35661 132.6499 93.93690
## 2001-11-01 1.1249313 1.179790 1.240338 1.346123 76.69086 137.6260 93.95394
## 2001-12-01 0.9474179 1.178870 1.285001 1.380952 64.58909 137.5187 97.33710
##                ML.4    MLTot       WTD        SWE PlantExt.1 PlantExt.2
## 2001-01-01 30.70058 322.0555 3435.1893 1.65619239 0.14602130 0.04159703
## 2001-02-01 34.24415 337.2074 2326.4824 0.27608905 0.13239223 0.21487108
## 2001-03-01 41.50838 357.2498  911.6781 0.01762496 0.21214792 0.12314557
## 2001-04-01 41.18455 332.7934 1374.3155 0.58072652 0.19814837 0.20494711
## 2001-05-01 39.83589 328.1467 1738.5183 0.00000000 0.31948918 0.18020538
## 2001-06-01 37.51964 296.3569 2464.7900 0.00000000 0.24387255 0.36234605
## 2001-07-01 34.97975 312.4668 2812.8362 0.00000000 0.57273666 0.10870511
## 2001-08-01 34.67406 326.4359 2626.4794 0.00000000 0.46365614 0.23477201
## 2001-09-01 37.20197 336.8548 1958.8639 0.00000000 0.28395785 0.21833333
## 2001-10-01 40.41756 339.3610 1426.5425 0.00000000 0.21510582 0.11982186
## 2001-11-01 40.78680 349.0576 1226.3862 2.60802857 0.16778824 0.08287584
## 2001-12-01 41.84212 341.2870 1070.9767 0.00000000 0.06998114 0.13751595
##              PlantExt.3    PlantExt.4 HydraulicInput.1 HydraulicInput.2
## 2001-01-01 -0.004883586 -0.0087003956     0.000000e+00      0.000000000
## 2001-02-01  0.044500183 -0.0008872063     0.000000e+00      0.000000000
## 2001-03-01  0.035528683  0.0365968873     0.000000e+00      0.000362775
## 2001-04-01  0.066177937  0.0596396712     0.000000e+00      0.000000000
## 2001-05-01  0.060574705  0.0679023696     0.000000e+00      0.000000000
## 2001-06-01  0.163287158  0.1238589680     0.000000e+00      0.000000000
## 2001-07-01  0.025776968  0.0548342874     0.000000e+00      0.004686296
## 2001-08-01  0.036881900  0.0318747391     0.000000e+00      0.000000000
## 2001-09-01  0.057129886  0.0341171638     0.000000e+00      0.000000000
## 2001-10-01  0.038252396  0.0401360856     0.000000e+00      0.000000000
## 2001-11-01  0.016620692  0.0279494607     0.000000e+00      0.000102615
## 2001-12-01  0.037152544  0.0306972723     2.749531e-06      0.000000000
##            HydraulicInput.3 HydraulicInput.4       psi.1       psi.2
## 2001-01-01     0.0050102738     0.0087305835 -0.01369548 -0.01776348
## 2001-02-01     0.0000273933     0.0077677542 -0.03584120 -0.01128791
## 2001-03-01     0.0000000000     0.0000000000 -0.01924505 -0.01137393
## 2001-04-01     0.0000000000     0.0000000000 -0.03898937 -0.01887460
## 2001-05-01     0.0000000000     0.0000000000 -0.03081532 -0.02154554
## 2001-06-01     0.0000000000     0.0000000000 -0.07424054 -0.03586248
## 2001-07-01     0.0098675510     0.0000000000 -0.02497344 -0.02859795
## 2001-08-01     0.0048904217     0.0058282338 -0.02274888 -0.01764117
## 2001-09-01     0.0000000000     0.0002652793 -0.02644398 -0.01477779
## 2001-10-01     0.0000000000     0.0000000000 -0.02558056 -0.01694436
## 2001-11-01     0.0022885547     0.0000000000 -0.02013385 -0.01359735
## 2001-12-01     0.0000000000     0.0000000000 -0.04598328 -0.01416425
##                   psi.3        psi.4
## 2001-01-01 -0.027426636 -0.030851092
## 2001-02-01 -0.009939852 -0.017598240
## 2001-03-01 -0.005789310 -0.001730668
## 2001-04-01 -0.008935663 -0.002622830
## 2001-05-01 -0.012173367 -0.005018704
## 2001-06-01 -0.016989777 -0.009668968
## 2001-07-01 -0.020805616 -0.015495418
## 2001-08-01 -0.016738051 -0.016181295
## 2001-09-01 -0.010707582 -0.009876602
## 2001-10-01 -0.009259632 -0.003822782
## 2001-11-01 -0.009113008 -0.003170981
## 2001-12-01 -0.006745345 -0.001340681

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.001985462 0.005232916 0.001268496
## 2001-02-01 0.005715021 0.007259694 0.002520776
## 2001-03-01 0.002806560 0.004803863 0.001391760
## 2001-04-01 0.006774315 0.009031853 0.003043899
## 2001-05-01 0.004971766 0.008042035 0.002434006
## 2001-06-01 0.016997242 0.017716655 0.006913838
## 2001-07-01 0.005042894 0.008893714 0.002588027
## 2001-08-01 0.003331616 0.006343846 0.001765602
## 2001-09-01 0.003913303 0.006381814 0.001918654
## 2001-10-01 0.003793325 0.006530277 0.001904921
## 2001-11-01 0.002904384 0.005236764 0.001483781
## 2001-12-01 0.008205662 0.009305483 0.003446380

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.005808769       0.003088161  0.010612890
## 2001-01-02      0.004932295       0.002732516  0.009765614
## 2001-01-03      0.004783882       0.002667853  0.009596770
## 2001-01-04      0.004947317       0.002729240  0.009725823
## 2001-01-05      0.003836334       0.002268566  0.008598340
## 2001-01-06      0.003805150       0.002249521  0.008530598

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.001985462       0.001268496  0.005232916
## 2001-02-01      0.005715021       0.002520776  0.007259694
## 2001-03-01      0.002806560       0.001391760  0.004803863
## 2001-04-01      0.006774315       0.003043899  0.009031853
## 2001-05-01      0.004971766       0.002434006  0.008042035
## 2001-06-01      0.016997242       0.006913838  0.017716655
## 2001-07-01      0.005042894       0.002588027  0.008893714
## 2001-08-01      0.003331616       0.001765602  0.006343846
## 2001-09-01      0.003913303       0.001918654  0.006381814
## 2001-10-01      0.003793325       0.001904921  0.006530277
## 2001-11-01      0.002904384       0.001483781  0.005236764
## 2001-12-01      0.008205662       0.003446380  0.009305483

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.02483919 0.02314682 0.009659831

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.040875
## 2001-02-01   8.178847
## 2001-03-01   8.976320
## 2001-04-01   8.807687
## 2001-05-01   8.207741
## 2001-06-01   6.285326
## 2001-07-01   6.966234
## 2001-08-01   6.219062
## 2001-09-01   7.434114
## 2001-10-01   7.642937
## 2001-11-01   8.710472
## 2001-12-01   8.406079

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).