Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
euporias
biascorrection
Commits
ef49cdae
Commit
ef49cdae
authored
Jun 14, 2017
by
Franssen, Wietse
Browse files
rev5.0 minor improvements
parent
880e1284
Changes
2
Hide whitespace changes
Inline
Side-by-side
SCRIPTS/5_doNetcdfCombine.R
View file @
ef49cdae
...
...
@@ -31,6 +31,8 @@ if (submitscript) {
variables
<-
names
(
variableInfo
)
FillValue
<-
1e20
dir.create
(
outPath
,
recursive
=
TRUE
,
showWarnings
=
FALSE
)
for
(
iMember
in
members
)
{
for
(
initYear
in
initYears
)
{
...
...
@@ -57,13 +59,14 @@ for (iMember in members) {
NCtimeAtt
<-
ncatt_get
(
ncid_in
,
"time"
,
"units"
)
$
value
nc_close
(
ncid_in
)
NCdata
[
is.na
(
NCdata
)]
<-
FillValue
## CREATE NETCDF
if
(
firstVar
==
TRUE
)
{
dimT
<-
ncdim_def
(
"time"
,
NCtimeAtt
,
NCtime
,
unlim
=
FALSE
)
dimY
<-
ncdim_def
(
"lat"
,
"degrees_north"
,
round
(
NClat
,
2
))
dimX
<-
ncdim_def
(
"lon"
,
"degrees_east"
,
round
(
NClon
,
2
))
FillValue
<-
1e20
## SAVE AS NC-DATA
nameFileNCout
<-
sprintf
(
"%s/forcing_seas15_%s_%s_E%02d_INIT%4d_%02d.nc4"
,
...
...
@@ -73,7 +76,7 @@ for (iMember in members) {
iMember
,
initYear
,
initMonth
)
data
<-
ncvar_def
(
variableName
,
variableInfo
[[
variableName
]]
$
units
,
list
(
dimX
,
dimY
,
dimT
),
FillValue
,
prec
=
"float"
)
#
, compression=4)
data
<-
ncvar_def
(
variableName
,
variableInfo
[[
variableName
]]
$
units
,
list
(
dimX
,
dimY
,
dimT
),
FillValue
,
prec
=
"float"
,
compression
=
4
)
print
(
paste0
(
"Creating: "
,
nameFileNCout
,
" for: "
,
variableName
))
ncid_out
<-
nc_create
(
nameFileNCout
,
data
)
...
...
@@ -107,9 +110,10 @@ for (iMember in members) {
ncatt_put
(
ncid_out
,
variableName
,
"standard_name"
,
variableInfo
[[
variableName
]]
$
standardName
)
ncatt_put
(
ncid_out
,
variableName
,
"long_name"
,
variableInfo
[[
variableName
]]
$
longName
)
ncatt_put
(
ncid_out
,
variableName
,
"_FillValue"
,
FillValue
)
#
ncatt_put( ncid_out, variableName, "_FillValue", FillValue)
firstVar
<-
FALSE
rm
(
data
,
NCdata
)
}
nc_close
(
ncid_out
)
}
## end initMonth
...
...
SCRIPTS/5_jobScriptNetcdfCombine
View file @
ef49cdae
#!/bin/bash
#SBATCH --account=5120867-01
#SBATCH --time=5000
#SBATCH --mem=
4
024
#SBATCH --mem=
16
024
#SBATCH --ntasks=1
#SBATCH --output=./log/log_5_doNetcdfCombine_<location>_<bcInfo>_<resolution>deg_initMonth<initMonth>_%j.txt
#SBATCH --job-name=Combine
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment