Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DART-WRF-delete_byApril
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DataAssimilation
DART-WRF-delete_byApril
Commits
6eb26f5b
Commit
6eb26f5b
authored
2 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
old
parent
5aecb4b0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dartwrf/cleanup_exp.py
+26
-26
26 additions, 26 deletions
dartwrf/cleanup_exp.py
with
26 additions
and
26 deletions
dartwrf/cleanup_exp.py
+
26
−
26
View file @
6eb26f5b
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')
#
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment