update_ganges_params_SLR.Rd
Adjust Ganges salinity model at Khulna to sea level rise
update_ganges_params_SLR(v, SLR_m, control_volume, d_probs)
v | Vector of length 4 containing log parameter values: |
---|---|
SLR_m | vector of sea level rise in meters |
control_volume | set to "channel", "gw", or "avg" |
d_probs | Determines the quantile for d, where 1 returns max(d), 0 returns min(d) |
Returns a vector of logged parameters c(log(a), log(b), log(d),
log(C_d))
, calibrated to future sea level rise (relative to 2010).
This function takes a vector of logged parameter values as inputs
c(log(a), log(b), log(d), log(C_d))
and adjusts the parameters for a
given sea level rise in meters, relative to 2010. Parameters a
and
b
require specifying the control volume as "channel"
,
"gw"
, or "avg"
, the last (avg) being the mean of the first two.
The resulting parameters that are returned are log transformed, but the
average (if taken) is calculated on the untransformed parameters.
# Load parameters for no sea level rise v <- ganges_params$param # Generate parameters for SLR of 0.25 and 0.5 m # (including min, median, and maximum d for SLR of 0.5 m) v_slr25 <- update_ganges_params_SLR(ganges_params$param, SLR_m = 0.25, "avg", d_probs = 0.5) v_slr50 <- update_ganges_params_SLR(ganges_params$param, SLR_m = 0.50, "avg", d_probs = 0.5) v_slr50_min_d <- update_ganges_params_SLR(ganges_params$param, SLR_m = 0.5, "avg", d_probs = 0) v_slr50_max_d <- update_ganges_params_SLR(ganges_params$param, SLR_m = 0.5, "avg", d_probs = 1) # Simulate salnity for each of the parameter sets results_df <- ganges_streamflow results_df$S_ppm_current <- sim_salin_annual(results_df, v) results_df$S_ppm_SLR25 <- sim_salin_annual(results_df, v_slr25) results_df$S_ppm_SLR50 <- sim_salin_annual(results_df, v_slr50) results_df$S_ppm_SLR50_min_d <- sim_salin_annual(results_df, v_slr50_min_d) results_df$S_ppm_SLR50_max_d <- sim_salin_annual(results_df, v_slr50_max_d) # Plot the results library(ggplot2) ggplot(results_df) + geom_line(aes(yday, S_ppm_current, color = "current", linetype = "median d")) + geom_line(aes(yday, S_ppm_SLR25, color = "SLR 25 cm", linetype = "median d")) + geom_line(aes(yday, S_ppm_SLR50, color = "SLR 50 cm", linetype = "median d")) + geom_line(aes(yday, S_ppm_SLR50_min_d, color = "SLR 50 cm", linetype = "min d")) + geom_line(aes(yday, S_ppm_SLR50_max_d, color = "SLR 50 cm", linetype = "max d")) + scale_linetype_manual(values = c("dotted","solid","dashed")) + facet_wrap(~group)