Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SemjonSchimanke
C3S_322_Lot1_user_examples
Commits
9f5e03b3
Commit
9f5e03b3
authored
Mar 05, 2019
by
SemjonSchimanke
Browse files
Needed directories are created if needed.
parent
f0b35825
Changes
1
Hide whitespace changes
Inline
Side-by-side
Create_forcing_for_NEMO/Create_NEMO_forcing_from_UERRA.py
View file @
9f5e03b3
...
...
@@ -19,7 +19,7 @@ MM2 =8 # last month
workdir
=
"/scratch/local/"
# finaldir: That's where the final data will be placed.
finaldir
=
"/nobackup/smhid14/precise/data/UERRA/NEMO-Nordic/"
finaldir
=
"/nobackup/smhid14/precise/data/UERRA/NEMO-Nordic
_TEST
/"
# download_dir: A directory where the raw data downloaded from MARS will be stored.
# This needs to be cleaned manually if you do not want to keep it.
...
...
@@ -45,6 +45,36 @@ import Get_UERRA_data
import
Convert_for_NEMO
#########################################
### Create cataloges if needed
#########################################
if
not
os
.
path
.
isdir
(
download_dir
):
os
.
makedirs
(
download_dir
)
print
(
"Download directory %s created."
%
download_dir
)
else
:
print
(
"Download directory %s exists already."
%
download_dir
)
if
not
os
.
path
.
isdir
(
finaldir
):
os
.
makedirs
(
finaldir
)
print
(
"Final directory %s created."
%
finaldir
)
# Create subdirectories without additional tests!
os
.
makedirs
(
finaldir
+
'Humidity'
)
os
.
makedirs
(
finaldir
+
'MSLP'
)
os
.
makedirs
(
finaldir
+
'Precip'
)
os
.
makedirs
(
finaldir
+
'Radiation'
)
os
.
makedirs
(
finaldir
+
'Snow'
)
os
.
makedirs
(
finaldir
+
'T2m'
)
os
.
makedirs
(
finaldir
+
'Wind'
)
else
:
print
(
"Final directory %s exists already."
%
finaldir
)
if
not
os
.
path
.
isdir
(
workdir
):
os
.
makedirs
(
workdir
)
print
(
"Work directory %s created."
%
workdir
)
else
:
print
(
"Work directory %s exists already."
%
workdir
)
#########################################
### # Getting forecasts, analysis and precipitation from the MARS archive.
#########################################
...
...
Write
Preview
Markdown
is supported
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