Closed cmahony closed 7 months ago
Reprex:
library(climr)
points_downscale_ref <- readRDS("C:/Users/CMAHONY/OneDrive - Government of BC/Projects/2023_climr/climr/tests/testthat/data/points_downscale_ref.rds")
pt <- points_downscale_ref[1,]
projected <- climr_downscale(pt,
gcm_models = list_gcm()[1],
ssp = list_ssp()[c(4)],
max_run = 10,
gcm_hist_years = 1851:2014,
gcm_ts_years = 2015:2100,
vars = "Tmax07"
)
gcms <- na.omit(unique(projected$GCM))[1]
ssps <- na.omit(unique(projected$SSP))[1]
runs <- unique(projected$RUN)
runs <- runs[grep("r", runs)]
par(mar=c(3,3,0.1, 0.1), mgp=c(1.5, 0.25, 0), tck=-0.01)
plot(projected$PERIOD, projected$Tmax07, col="white")
for(run in runs){
s <- which(projected$RUN==run)
lines(projected$PERIOD[s], projected$Tmax07[s], col=which(runs==run))
# Sys.sleep(1)
}
lines(projected$PERIOD[projected$RUN=="ensembleMean"], projected$Tmax07[projected$RUN=="ensembleMean"], col=1, lwd=3)
mtext(paste(gcms, ssps), side=3, line=-1.5, adj=0.05)
Should be fixed now:
the final year of GCM time series is broken:
it may or may not be broken for SSP126.
the problem is not just isolated to CanESM5:
I wondered whether the SSP126 run was being recycled for the other ssps, or alternatively that the year 2015 value was being recycled, but neither is the case.