Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biascorrection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
euporias
biascorrection
Commits
61ac420c
Commit
61ac420c
authored
9 years ago
by
Franssen, Wietse
Browse files
Options
Downloads
Patches
Plain Diff
added download jobscripts
parent
0234748a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
SCRIPTS/download.R
+67
-0
67 additions, 0 deletions
SCRIPTS/download.R
SCRIPTS/jobScript
+22
-0
22 additions, 0 deletions
SCRIPTS/jobScript
SCRIPTS/submit_download.sh
+17
-0
17 additions, 0 deletions
SCRIPTS/submit_download.sh
with
106 additions
and
0 deletions
SCRIPTS/download.R
0 → 100644
+
67
−
0
View file @
61ac420c
rm
(
list
=
ls
())
#setwd("/home/wietse/TODO/SCRIPTS")
source
(
file
=
"./functionDownload.R"
)
source
(
file
=
"./functionConvert.R"
)
submitscript
<-
FALSE
if
(
submitscript
)
{
members
<-
c
(
X
:
X
)
initMonths
<-
c
(
1
:
12
)
initYears
<-
c
(
1981
:
2010
)
locName
<-
'X'
outPath
<-
"./downloaded/noBC/"
}
else
{
members
<-
c
(
1
:
15
)
members
<-
c
(
1
)
initMonths
<-
c
(
1
:
12
)
#initMonths <-c(1)
initYears
<-
c
(
1981
:
2010
)
#initYears <-c(1981)
locName
<-
"GHA"
# locName<-"EU"
outPath
<-
"./testData/noBC/"
}
variables
<-
names
(
variableInfo
)
variables
<-
c
(
"pr"
)
#variables<-c("tas")
variables
<-
c
(
"rsds"
,
"rlds"
)
#variables<-c( "rsds" )
dir.create
(
outPath
,
recursive
=
TRUE
,
showWarnings
=
FALSE
)
for
(
varName
in
variables
)
{
for
(
iMember
in
members
)
{
for
(
initYear
in
initYears
)
{
for
(
initMonth
in
initMonths
)
{
RData
<-
downloadSeas15
(
variableInfo
[
varName
],
locationInfo
[
locName
],
iMember
,
initYear
,
initMonth
)
RData
<-
convert
(
RData
=
RData
,
toUnit
=
variableInfo
[[
varName
]]
$
units
)
## Solve ECOMS stuff!
## Precip issue:
# if (varName == "pr") {
# ntime<-length(RData$Data[,1,1])
# dataTmp<-RData$Data[]
# dataTmp[1:ntime-1,,]<-RData$Data[2:ntime,,]
# dataTmp[ntime,,]<-RData$Data[ntime,,]
# RData$Data[]<-dataTmp[]
# }
## Radiation issue 1: (86400*86400)
## This is solved in the conversion with the help of infoGeneral.R
## Radiation issue 2:
## The downloaded radiation of leadmonth 0 has one extra day (firstday-1).
## This is solved in functionDownload.R because it affects only leadmonth 0
## NOTE!!! Is is not right in the current dataset!!!!
oFile
<-
sprintf
(
paste0
(
outPath
,
"/%s_forcing_seas15_%s_noBC_E%02d_%4d_%02d.nc4"
),
varName
,
locName
,
iMember
,
initYear
,
initMonth
)
R2Netcdf
(
oFile
,
RData
)
}
}
}
}
#TDOD: pr + 1day
This diff is collapsed.
Click to expand it.
SCRIPTS/jobScript
0 → 100644
+
22
−
0
View file @
61ac420c
#!/bin/bash
#SBATCH --account=5120867-01
#SBATCH --time=5000
#SBATCH --mem=4024
#SBATCH --ntasks=1
#SBATCH --output=./log/log_<location>_member<member>_%j.txt
#SBATCH --job-name=DL
#SBATCH --partition=ESG_Std
#SBATCH --mail-type=FAIL
#SBATCH --mail-user=wietse.franssen@wur.nl
# print date and time
date
#
# print the working directory
pwd
module load R/3.2.0
#
# run current job
echo
'******** R-data Download...'
Rscript ./tmpScripts/download_<location>_member<member>.R
date
This diff is collapsed.
Click to expand it.
SCRIPTS/submit_download.sh
0 → 100755
+
17
−
0
View file @
61ac420c
#!/bin/bash
tmpScripts
=
"./tmpScripts"
location
=
"GHA"
mkdir
-p
$tmpScripts
for
iMember
in
$(
seq
-f
"%02g"
1 15
)
;
do
echo
"member:
$iMember
"
sed
-e
"s|<member>|
$iMember
|g"
\
-e
"s|<location>|
$location
|g"
\
jobScript
>
$tmpScripts
"/jobScript_"
$location
"_member"
$iMember
sed
-e
"s|<member>|
$iMember
|g"
\
-e
"s|submitscript <- FALSE|submitscript <- TRUE|g"
\
-e
"s|members <- c(X:X)|members <- c(
$iMember
:
$iMember
)|g"
\
-e
"s|locName <- 'X'|locName <- '
$location
'|g"
\
download.R
>
$tmpScripts
"/download_"
$location
"_member"
$iMember
".R"
sbatch
"
$tmpScripts
/jobScript_"
$location
"_member"
$iMember
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment