Skip to content

Commit

Permalink
bug soil plots
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcaceres committed Jun 12, 2024
1 parent 8ee10c9 commit 3453a72
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions R/plot_internals.R
Original file line number Diff line number Diff line change
Expand Up @@ -594,47 +594,47 @@
if(!is.null(dates)) PsiM = PsiM[row.names(PsiM) %in% as.character(dates),,drop = FALSE]
if(!is.null(summary.freq)) PsiM = .temporalSummary(PsiM, summary.freq, mean, na.rm=TRUE)
return(.multiple_dynamics(as.matrix(PsiM), xlab = xlab, ylab = ylab, ylim = ylim,
labels = c("Overall", paste("Layer", 1:nlayers))))
labels = c(paste("Layer", 1:nlayers), "Overall")))
}
else if(type=="SoilTheta") {
SWCM = as.data.frame(Soil$SWC)
if(!is.null(dates)) SWCM = SWCM[row.names(SWCM) %in% as.character(dates),,drop = FALSE]
if(!is.null(summary.freq)) SWCM = .temporalSummary(SWCM, summary.freq, mean, na.rm=TRUE)
if(is.null(ylab)) ylab = "Soil water content (% volume)"
return(.multiple_dynamics(as.matrix(SWCM), xlab = xlab, ylab = ylab, ylim = ylim,
labels = c("Overall", paste("Layer", 1:nlayers))))
labels = c(paste("Layer", 1:nlayers), "Overall")))
}
else if(type=="SoilREW") {
REWM = as.data.frame(100*Soil$REW)
if(!is.null(dates)) REWM = REWM[row.names(REWM) %in% as.character(dates),,drop = FALSE]
if(!is.null(summary.freq)) REWM = .temporalSummary(REWM, summary.freq, mean, na.rm=TRUE)
if(is.null(ylab)) ylab = "Relative extractable water (%)"
return(.multiple_dynamics(as.matrix(REWM), xlab = xlab, ylab = ylab, ylim = ylim,
labels = c("Overall", paste("Layer", 1:nlayers))))
labels = c(paste("Layer", 1:nlayers), "Overall")))
}
else if(type=="SoilRWC") {
RWCM = as.data.frame(100*Soil$RWC)
if(!is.null(dates)) RWCM = RWCM[row.names(RWCM) %in% as.character(dates),,drop = FALSE]
if(!is.null(summary.freq)) RWCM = .temporalSummary(RWCM, summary.freq, mean, na.rm=TRUE)
if(is.null(ylab)) ylab = "Relative water content (% field capacity)"
return(.multiple_dynamics(as.matrix(RWCM), xlab = xlab, ylab = ylab, ylim = ylim,
labels = c("Overall", paste("Layer", 1:nlayers))))
labels = c(paste("Layer", 1:nlayers), "Overall")))
}
else if(type=="SoilVol") {
if(is.null(ylab)) ylab = "Soil water content (mm)"
MLM = as.data.frame(Soil$ML)
if(!is.null(dates)) MLM = MLM[row.names(MLM) %in% as.character(dates),]
if(!is.null(summary.freq)) MLM = .temporalSummary(MLM, summary.freq, mean, na.rm=TRUE)
return(.multiple_dynamics(as.matrix(MLM), ylab = ylab, ylim = ylim,
xlab=xlab, labels = c("Overall", paste("Layer", 1:nlayers))))
xlab=xlab, labels = c(paste("Layer", 1:nlayers), "Overall")))
}
else if(type=="PlantExtraction") {
extrBal = as.data.frame(100*Soil$PlantExt)
extrBal = as.data.frame(Soil$PlantExt)
if(!is.null(dates)) extrBal = extrBal[row.names(extrBal) %in% as.character(dates),,drop = FALSE]
if(is.null(ylab)) ylab = .getYLab(type)
if(!is.null(summary.freq)) extrBal = .temporalSummary(extrBal, summary.freq, sum, na.rm=TRUE)
g<-.multiple_dynamics(as.matrix(extrBal), xlab = xlab, ylab = ylab, ylim = ylim,
labels = c("Overall", paste("Layer", 1:nlayers)))
labels = c(paste("Layer", 1:nlayers), "Overall"))
g<-g+geom_abline(slope=0, intercept=0, col="gray")
return(g)
}
Expand All @@ -644,7 +644,7 @@
if(is.null(ylab)) ylab = "Hydraulic input (mm)"
if(!is.null(summary.freq)) hydrIn = .temporalSummary(hydrIn, summary.freq, sum, na.rm=TRUE)
return(.multiple_dynamics(as.matrix(hydrIn), xlab = xlab, ylab = ylab, ylim = ylim,
labels = c("Overall", paste("Layer", 1:nlayers))))
labels = c(paste("Layer", 1:nlayers), "Overall")))
}
}
.plot_stand<-function(Stand, type,
Expand Down
2 changes: 1 addition & 1 deletion man/defaultControl.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/workedexamples/PlantWaterPools.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ cowplot::plot_grid(fb_sperry_plot, fb_sureau_plot,
## Simulations
As target forest stands we take five experimental plots whose data was already used when presenting the water balance model in De Cáceres et al. (2021). An evaluation of model performance in these experimental plots is given in [*Stand-level evaluation*](https://emf-creaf.github.io/medfate/articles/evaluation/StandLevelEvaluation.html).

For each of these plots we performed two simulations with the advanced water balance model (`transpirationMode = "Sperry"`), one using the default assumption of complete rhizosphere overlap (`rhizosphereOverlap = "total"`) and the other assuming complete independence of water pools (`rhizosphereOverlap = "none"`). Recovery from embolism was assumed to depend on soil moisture (`cavitationRefill = "rate"`). We performed a burn-in simulation for the available weather of the forest plot (1 to 3 years, depending on the plot), so that soil moisture, plant water potentials and xylem percent loss conductance (PLC) could be equilibrated. After this burn-in period, we run again the model for one year only, to simplify the examination of the results.
For each of these plots we performed two simulations with the advanced water balance model (`transpirationMode = "Sperry"`), one using the default assumption of complete rhizosphere overlap (`rhizosphereOverlap = "total"`) and the other assuming complete independence of water pools (`rhizosphereOverlap = "none"`). Recovery from embolism was assumed to depend on soil moisture (`stemCavitationRecovery = "rate"` and `leafCavitationRecovery = "rate"`). We performed a burn-in simulation for the available weather of the forest plot (1 to 3 years, depending on the plot), so that soil moisture, plant water potentials and xylem percent loss conductance (PLC) could be equilibrated. After this burn-in period, we run again the model for one year only, to simplify the examination of the results.


## Results
Expand Down

0 comments on commit 3453a72

Please sign in to comment.