Commit 9f5e03b3 authored by SemjonSchimanke's avatar SemjonSchimanke
Browse files

Needed directories are created if needed.

parent f0b35825
......@@ -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.
#########################################
......
Markdown is supported
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