diff --git a/dartwrf/cleanup_exp.py b/dartwrf/cleanup_exp.py index bee76fe30311448c0d3771e8aac6677f4adbd5cf..3b913cb10e919d330eeaebf04710d0d8896a3b9b 100644 --- a/dartwrf/cleanup_exp.py +++ b/dartwrf/cleanup_exp.py @@ -1,4 +1,4 @@ -import os, glob +import os, glob, shutil from config.cfg import exp, cluster from utils import try_remove @@ -10,7 +10,7 @@ from utils import try_remove """ keep_last_init_wrfrst = True -print('removing files for exp', exp) +print('removing files for exp', exp.expname) # 1) wrfrst inits = reversed(sorted(glob.glob(cluster.archivedir+'/20??-??-??_??:??'))) @@ -27,9 +27,8 @@ for k, init in enumerate(inits): try_remove(f) # 2) run_DART/exp -os.removedirs(cluster.dartrundir) +shutil.rmtree(cluster.dartrundir, ignore_errors=True) # 3) run_WRF/exp -for iens in range(1, exp.n_ens+1): - os.removedirs(cluster.wrf_rundir(iens)) - print(cluster.wrf_rundir(iens), 'removed.') +shutil.rmtree(cluster.wrf_rundir_base+'/'+exp.expname, ignore_errors=True) +print(cluster.wrf_rundir_base+'/'+exp.expname, 'removed.') diff --git a/dartwrf/obsseq.py b/dartwrf/obsseq.py index e7db51d779a006029f6204f393a5a75cd69fc202..fe8c5daed9b238a65fc79adec7b8bf68740a1fb1 100755 --- a/dartwrf/obsseq.py +++ b/dartwrf/obsseq.py @@ -3,7 +3,7 @@ import numpy as np import pandas as pd from config.cfg import exp, cluster -from utils import symlink, copy, sed_inplace, append_file, mkdir, try_remove +from dartwrf.utils import symlink, copy, sed_inplace, append_file, mkdir, try_remove def plot_box(m, lat, lon, label="", **kwargs):