Commit 93005601 authored by SemjonSchimanke's avatar SemjonSchimanke
Browse files

Create all directories if needed. Improved README.

parent 2138a0ff
#!/usr/bin/env python #!/usr/bin/env python
#SBATCH -n 1 #SBATCH -n 1
#SBATCH -t 1-0 #SBATCH -t 3-0
#SBATCH -J NEMO_forcing__precise #SBATCH -J NEMO_forcing__precise
#SBATCH --qos=risk #SBATCH --qos=risk
#SBATCH --requeue #SBATCH --requeue
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
######################################### #########################################
### Configure section ### Configure section
######################################### #########################################
YYYY1=2018 # first year YYYY1=2017 # first year
MM1 =1 # first month MM1 =1 # first month
YYYY2=2018 # last year YYYY2=2017 # last year
MM2 =8 # last month MM2 =12 # last month
# workdir: a directory where the processing takes place and # workdir: a directory where the processing takes place and
# intermediate data is stored. # intermediate data is stored.
...@@ -57,17 +57,20 @@ else: ...@@ -57,17 +57,20 @@ else:
if not os.path.isdir(finaldir): if not os.path.isdir(finaldir):
os.makedirs(finaldir) os.makedirs(finaldir)
print ("Final directory %s created." % finaldir) print ("Final directory %s created." % finaldir)
# Create subdirectories without additional tests! if not os.path.exists(finaldir+'Humidity'):
os.makedirs(finaldir+'Humidity') os.makedirs(finaldir+'Humidity')
if not os.path.exists(finaldir+'MSLP'):
os.makedirs(finaldir+'MSLP') os.makedirs(finaldir+'MSLP')
if not os.path.exists(finaldir+'Precip'):
os.makedirs(finaldir+'Precip') os.makedirs(finaldir+'Precip')
if not os.path.exists(finaldir+'Radiation'):
os.makedirs(finaldir+'Radiation') os.makedirs(finaldir+'Radiation')
if not os.path.exists(finaldir+'Snow'):
os.makedirs(finaldir+'Snow') os.makedirs(finaldir+'Snow')
if not os.path.exists(finaldir+'T2m'):
os.makedirs(finaldir+'T2m') os.makedirs(finaldir+'T2m')
if not os.path.exists(finaldir+'Wind'):
os.makedirs(finaldir+'Wind') os.makedirs(finaldir+'Wind')
else:
print ("Final directory %s exists already." % finaldir)
if not os.path.isdir(workdir): if not os.path.isdir(workdir):
os.makedirs(workdir) os.makedirs(workdir)
print ("Work directory %s created." % workdir) print ("Work directory %s created." % workdir)
...@@ -87,15 +90,16 @@ Get_UERRA_data.retrieve_uerra_precip(YYYY1, MM1, YYYY2, MM2, download_dir) ...@@ -87,15 +90,16 @@ Get_UERRA_data.retrieve_uerra_precip(YYYY1, MM1, YYYY2, MM2, download_dir)
sys.stdout.flush() sys.stdout.flush()
######################################### #########################################
### Prepare the data for NEMO-Nordic ### Prepare the data for NEMO-Nordic
######################################### #########################################
Convert_for_NEMO.precipitation (YYYY1, MM1, YYYY2, MM2, workdir, download_dir, finaldir) Convert_for_NEMO.precipitation (YYYY1, MM1, YYYY2, MM2, workdir, download_dir, finaldir)
sys.stdout.flush() sys.stdout.flush()
Convert_for_NEMO.param_with_analysis (YYYY1, MM1, YYYY2, MM2, workdir, download_dir, finaldir)
sys.stdout.flush()
Convert_for_NEMO.radiation (YYYY1, MM1, YYYY2, MM2, workdir, download_dir, finaldir) Convert_for_NEMO.radiation (YYYY1, MM1, YYYY2, MM2, workdir, download_dir, finaldir)
sys.stdout.flush() sys.stdout.flush()
Convert_for_NEMO.param_with_analysis (YYYY1, MM1, YYYY2, MM2, workdir, download_dir, finaldir)
sys.stdout.flush()
Convert_for_NEMO.humidity (YYYY1, MM1, YYYY2, MM2, workdir, download_dir, finaldir) Convert_for_NEMO.humidity (YYYY1, MM1, YYYY2, MM2, workdir, download_dir, finaldir)
sys.stdout.flush() sys.stdout.flush()
......
...@@ -18,9 +18,16 @@ main script - Create_NEMO_forcing_from_UERRA.py ...@@ -18,9 +18,16 @@ main script - Create_NEMO_forcing_from_UERRA.py
Then, all you have to do is to run the main script... Then, all you have to do is to run the main script...
Create_NEMO_forcing_from_UERRA.py Create_NEMO_forcing_from_UERRA.py
Good to know
------------
The scripts need some time to run. Especially the downloading of data The scripts need some time to run. Especially the downloading of data
from the MARS archive takes time. Here, we are talking about days if from the MARS archive takes time. Here, we are talking about days if
you want to produce forcing data for longer periods (several years). you want to produce forcing data for longer periods (several years).
A rough estimate is about six hours for each year. However, this depends
on your system as well as the load on MARS.
You will need some disk space. For each year you will need around 50GB
space.
Technical details Technical details
......
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