Commit 82dcccd3 authored by Franssen, Wietse's avatar Franssen, Wietse
Browse files

minor updates

parent ac41a27f
......@@ -7,8 +7,7 @@ source(file = "./functions/functionsGeneral.R")
source(file = "./functions/infoGeneral.R")
source(file = "./functions/functionMakeSelection.R")
source(file = "./functions/functionBiascorrectionWUR.R")
#source(file = "./functions/functionBiasCorrectionECOMS_precip_adapt.R")
#source(file = "./misc.R")
source(file = "./functions/functionR2Netcdf.R")
submitscript <- FALSE
......@@ -20,11 +19,8 @@ if (submitscript) {
locName <- 'X'
resolution<-"0.50"
obsPath<-sprintf("../DATA/wfdei_rev3.0/%sdeg/%s/", resolution, locName)
# inPath<-sprintf("../DATA/System4_seasonal_15_rev1.1/%sdeg/%s_noBC", resolution, locName)
inPath<-sprintf("../DATA/System4_seasonal_15_rev1.1/%sdeg/%s_noBC", resolution, locName)
# outPath<-sprintf("../DATA/System4_seasonal_15_rev1.2_1.0mm_adapt/%sdeg/%s_BC", resolution, locName)
# outPath<-sprintf("../DATA/System4_seasonal_15_rev1.1_CRU_0.1mm_new/%sdeg/%s_BC", resolution, locName)
outPath<-sprintf("../DATA/System4_seasonal_15_rev1.1/%sdeg_targetYears/%s_BC", resolution, locName)
outPath<-sprintf("../DATA/System4_seasonal_15_rev1.1/%sdeg/%s_BC", resolution, locName)
} else {
members <-c(1:15)
initYears <-c(1981:2010)
......@@ -42,7 +38,7 @@ if (submitscript) {
variables<-names(variableInfo)
variables<-c( "tas", "tasmin", "tasmax", "rsds", "rlds", "pr", "huss", "sfcWind")
variables<-c( "tas", "tasmin", "tasmax", "rsds", "rlds", "huss", "sfcWind")
variables<-c("pr")
#variables<-c("pr")
dir.create(outPath, recursive = TRUE, showWarnings = FALSE)
......@@ -53,7 +49,6 @@ for (variableName in variables) {
targetSYear <- getInitTargetInfo( initYear = initYears[1], targetMonth = targetMonth, leadMonth = leadMonth )$targetYear
targetEYear <- getInitTargetInfo( initYear = initYears[length(initYears)], targetMonth = targetMonth, leadMonth = leadMonth )$targetYear
# if (targetSYear != initYears[1]) {
iFile <- sprintf("%s/%s_forcing_seas15_%s_noBC_E%02d-%02d_TAR%4d-%4d_%02d_LM%d.RData",
inPath, variableName, locName,
members[1], members[length(members)],
......@@ -110,20 +105,20 @@ for (variableName in variables) {
} else {
## Correction: other variables
print(sprintf("Bias correction..."))
RData <- biasCorrection (RData_obs, RData_noBC_pred, RData_noBC, method = "qqmap", multi.member = FALSE, pr.threshold = 0.1)# bias
# RData <- biasCorrection (RData_obs, RData_noBC, RData_noBC, method = "qqmap", multi.member = FALSE, pr.threshold = 0.1)# bias
RData <- biasCorrection (RData_obs, RData_noBC_pred, RData_noBC, method = "qqmap", multi.member = FALSE) # bias
}
## Write output
oFile <- sprintf("%s/%s_forcing_seas15_%s_BC_E%02d-%02d_TAR%4d-%4d_%02d_LM%d.RData",
oPrefix <- sprintf("%s/%s_forcing_seas15_%s_BC_E%02d-%02d_TAR%4d-%4d_%02d_LM%d",
outPath, variableName, locName,
members[1], members[length(members)],
targetSYear, targetEYear,
targetMonth, leadMonth)
print(sprintf("Saving: %s", oFile))
save(file= oFile, RData)
# }
print(sprintf("Saving: %s", oPrefix))
#save(file = paste0(oPrefix, ".RData"), RData)
R2Netcdf(paste0(oPrefix, ".nc4"), RData)
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment