Commit 9c8fff5f authored by Franssen, Wietse's avatar Franssen, Wietse
Browse files

minor updates

parent 7bb7485a
......@@ -6,6 +6,10 @@ reformat the old 0.75 degree data (seperate years, seperate members, combined le
regrid the 0.75 degree data into 0.50 degree data
both datasets are: combined years, combined members, seperate leadmonths
## Step 3
biascorrect both 0.75 and 0.50 degree data
all datasets are: combined years, combined members, seperate leadmonths
# If downloading new data
## Step 1
......@@ -12,11 +12,9 @@ if (submitscript) {
leadMonths<-c(0:6)
locName <- 'X'
resolution<-"0.50"
# inPath<-"./testData/reFormatted_noBC"
obsPath<-sprintf("../DATA/wfdei_rev3.0/%sdeg/%s/", resolution, locName)
inPath<-sprintf("../DATA/System4_seasonal_15_rev2.0/%sdeg/%s_noBC", resolution, locName)
outPath<-sprintf("../DATA/System4_seasonal_15_rev2.0/%sdeg/%s_BC", resolution, locName)
# outPath<-"./testData/reFormatted_BC"
inPath<-sprintf("../DATA/System4_seasonal_15_rev1.1/%sdeg/%s_noBC", resolution, locName)
outPath<-sprintf("../DATA/System4_seasonal_15_rev1.1/%sdeg/%s_BC", resolution, locName)
} else {
members <-c(1:15)
initYears <-c(1981:2010)
......@@ -24,15 +22,13 @@ if (submitscript) {
leadMonths<-c(0:6)
#locName<-"GHA"
locName<-"EU"
resolution<-"0.50"
obsPath<-sprintf("../DATA/wfdei_rev3.0/%sdeg/%s/", resolution, locName)
inPath<-"./testData/reFormatted_noBC"
outPath<-"./testData/reFormatted_BC"
resolution<-"0.50"
}
variables<-names(variableInfo)
variables<-c( "rsds" , "rlds" , "tasmin","tasmax", "huss" , "sfcWind","pr" , "psl")
variables<-c( "tasmin","tasmax", "huss" , "sfcWind","pr" , "psl")
variables<-c( "pr", "sfcWind", "rsds", "rlds", "huss", "tas", "tasmin", "tasmax")
#variables<-c("tas")
......@@ -53,10 +49,6 @@ for (variableName in variables) {
RData_noBC<-RData
rm(RData)
# obsFile <- sprintf("/home/WUR/frans004/L_BACKUP/PROJECTS/EUPORIAS/DATA_BIAS/DATA/DATA_RAW_R/%s_WFD/%s_wfdei_%4d-%4d_%02d.RData",
# locName, variableName,
# initYears[1], initYears[length(initYears)],
# currMonth)
obsFile <- sprintf("%s/%s_wfdei_%s_%4d-%4d_%02d.RData",
obsPath, variableName, locName,
initYears[1], initYears[length(initYears)],
......
......@@ -25,12 +25,13 @@ if (submitscript) {
# targetYears <-c(1981:1982)
locName<-"GHA"
locName<-"EU"
resolution<-"0.75"
resolution<-"0.50"
outPath<-sprintf("../DATA/wfdei_rev3.0/%sdeg/%s", resolution, locName)
}
variables<-names(variableInfo)
variables<-c( "pr", "sfcWind", "rsds", "rlds", "huss", "tas", "tasmin", "tasmax")
variables<-c( "pr")
dir.create(outPath, recursive = TRUE, showWarnings = FALSE)
......@@ -68,6 +69,21 @@ for (variableName in variables) {
years = targetYears,
time = "DD")
if (variableName == "pr") {
print("Because on a error on the ecoms server. Pr only contains rainfall.\n
Because of this we also download snow and sum it up to total precip.\n
Please check if this error still exists!!!")
RData_snow<-loadECOMS(dataset = "WFDEI",
var = "prsn",
lonLim = lonLim,
latLim = latLim,
season = targetMonth,
years = targetYears,
time = "DD")
RData$Data[]<-RData$Data[]+RData_snow$Data[]
}
RData$xyCoords$x[]<-round(RData$xyCoords$x[],2)
RData$xyCoords$y[]<-round(RData$xyCoords$y[],2)
......
......@@ -29,7 +29,7 @@ if (submitscript) {
}
variables<-names(variableInfo)
variables<-c("tas")
variables<-c("tasmin", "tasmax", "pr", "psl", "rsds", "rlds", "huss", "sfcWind" )
dir.create(outPath, recursive = TRUE, showWarnings = FALSE)
......@@ -55,7 +55,7 @@ for (variableName in variables) {
print(sprintf("Regridding..."))
RData <- interpGridData(RData, new.grid = newGrid, method = "bilinear");
oFile <- sprintf("%s/%s_forcing_seas15_%s_BC_E%02d-%02d_%4d-%4d_%02d_LM%d.RData",
oFile <- sprintf("%s/%s_forcing_seas15_%s_noBC_E%02d-%02d_%4d-%4d_%02d_LM%d.RData",
outPath, variableName, locName,
members[1], members[length(members)],
initYears[1], initYears[length(initYears)],
......
......@@ -4,7 +4,7 @@ tmpScripts="./tmpScripts"
location="EU"
mkdir -p $tmpScripts
for iCurrMonth in $(seq -f "%1g" 1 1); do
for iCurrMonth in $(seq -f "%1g" 1 12); do
echo "leadMonth: $iCurrMonth"
sed -e "s|<currMonth>|$iCurrMonth|g" \
-e "s|<location>|$location|g" \
......
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