From 6eb26f5bce9ccc3656337c210e6ae027606094fc Mon Sep 17 00:00:00 2001 From: lkugler <lukas.kugler@gmail.com> Date: Sun, 19 Feb 2023 18:31:43 +0100 Subject: [PATCH] old --- dartwrf/cleanup_exp.py | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/dartwrf/cleanup_exp.py b/dartwrf/cleanup_exp.py index f9edebf..a9b8001 100644 --- a/dartwrf/cleanup_exp.py +++ b/dartwrf/cleanup_exp.py @@ -1,26 +1,26 @@ -import os, sys, glob, shutil -from utils import try_remove - -"""Run this script to reduce wrfrst files - -Example call: - python ./cleanup_exp.py -""" -keep_last_init_wrfrst = True - -datadir = '/gpfs/data/fs71386/lkugler/sim_archive/' -#exp = sys.argv[1] -for exp in os.listdir(datadir): - - print('removing files for exp', exp) - - inits = glob.glob(datadir+exp+'/20??-??-??_??:??') - for init in inits: - for iens in range(1, 41): - rst_files = sorted(glob.glob(init+'/'+str(iens)+'/wrfrst_*')) - #print(rst_files) - if len(rst_files)>1: - for f in sorted(rst_files)[:-1]: - try_remove(f) - print(f, 'removed') - +#import os, sys, glob, shutil +#from utils import try_remove +# +#"""Run this script to reduce wrfrst files +# +#Example call: +# python ./cleanup_exp.py +#""" +#keep_last_init_wrfrst = True +# +#datadir = '/gpfs/data/fs71386/lkugler/sim_archive/' +##exp = sys.argv[1] +#for exp in os.listdir(datadir): +# +# print('removing files for exp', exp) +# +# inits = glob.glob(datadir+exp+'/20??-??-??_??:??') +# for init in inits: +# for iens in range(1, 41): +# rst_files = sorted(glob.glob(init+'/'+str(iens)+'/wrfrst_*')) +# #print(rst_files) +# if len(rst_files)>1: +# for f in sorted(rst_files)[:-1]: +# try_remove(f) +# print(f, 'removed') +# -- GitLab