Skip to content
Snippets Groups Projects
Commit f991b446 authored by Lukas Kugler's avatar Lukas Kugler
Browse files

only remove wrfrst files (for speedup)

parent 7b75efed
Branches
No related tags found
No related merge requests found
import os, sys
import os, sys, glob
import datetime as dt
from dartwrf.utils import copy, clean_wrfdir, Config
from dartwrf.utils import copy, Config
"""
Sets initial condition data (wrfinput/wrfrst file) in the run_WRF directory for each ensemble member
......@@ -21,7 +21,9 @@ def create_wrfrst_in_WRF_rundir(time: dt.datetime, prior_init_time: dt.datetime,
"""
for iens in range(1, cfg.ensemble_size+1):
dir_wrf_run = cfg.dir_wrf_run.replace('<exp>', cfg.name).replace('<ens>', str(iens))
clean_wrfdir(dir_wrf_run)
for f in glob.glob(dir_wrf_run+'/wrfrst_*'):
os.remove(f)
prior_wrfrst = prior_path_exp + prior_init_time.strftime('/%Y-%m-%d_%H:%M/') \
+str(iens)+time.strftime('/wrfrst_d01_%Y-%m-%d_%H:%M:%S')
......
......@@ -270,12 +270,6 @@ def copy_contents(src, dst):
os.system('cp -rf '+src+'/* '+dst+'/')
def clean_wrfdir(dir):
for s in ['wrfout_*', 'rsl.*', 'wrfrst_*']:
for f in glob.glob(dir+'/'+s):
os.remove(f)
def symlink(src, dst):
"""Create a symbolic link from src to dst
Creates the folder if it does not exist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment