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
d3123b44
Commit
d3123b44
authored
4 years ago
by
Lukas Kugler
Browse files
Options
Downloads
Patches
Plain Diff
backups, conv exp
parent
04ff6e23
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
scheduler.py
+44
-25
44 additions, 25 deletions
scheduler.py
with
44 additions
and
25 deletions
scheduler.py
+
44
−
25
View file @
d3123b44
...
@@ -38,15 +38,24 @@ class Cmdline(object):
...
@@ -38,15 +38,24 @@ class Cmdline(object):
os
.
system
(
cmd
)
os
.
system
(
cmd
)
def
backup_scripts
():
def
backup_scripts
():
current
=
cluster
.
scriptsdir
main_a
=
cluster
.
archivedir
()
+
'
/DART-WRF/
'
old_a
=
main_a
+
'
/old/
'
os
.
makedirs
(
cluster
.
archivedir
(),
exist_ok
=
True
)
os
.
makedirs
(
cluster
.
archivedir
(),
exist_ok
=
True
)
dir_backup_scripts
=
cluster
.
archivedir
()
+
'
/DART-WRF/
'
os
.
makedirs
main_a
,
exist_ok
=
True
)
os
.
makedirs
(
dir_backup_scripts
,
exist_ok
=
True
)
os
.
makedirs
,
exist_ok
=
True
)
os
.
makedirs
(
dir_backup_scripts
+
'
/old/
'
,
exist_ok
=
True
)
os
.
system
(
'
mv
'
+
dir_backup_scripts
+
'
/*
'
+
dir_backup_scripts
+
'
/old/
'
)
# move old logs
# archive existing files
shutil
.
copy
(
cluster
.
scriptsdir
+
'
/../scheduler.py
'
,
dir_backup_scripts
+
'
/scheduler.py
'
)
for
f
in
os
.
listdir
(
main_a
):
shutil
.
copy
(
cluster
.
scriptsdir
+
'
/../config/clusters.py
'
,
dir_backup_scripts
+
'
/clusters.py
'
)
shutil
.
move
(
os
.
path
.
join
(
main_a
,
f
),
old_a
+
'
/
'
)
shutil
.
copy
(
cluster
.
scriptsdir
+
'
/../config/cfg.py
'
,
dir_backup_scripts
+
'
/cfg.py
'
)
os
.
system
(
'
cp -r
'
+
cluster
.
scriptsdir
+
'
'
+
dir_backup_scripts
+
'
/
'
)
# reproducibility
for
f
in
[
'
scheduler.py
'
,
'
config/clusters.py
'
,
'
config/cfg.py
'
]:
shutil
.
copy
(
current
+
'
/../
'
+
f
,
main_a
+
'
/scheduler.py
'
)
for
f
in
os
.
listdir
(
current
):
shutil
.
copy
(
os
.
path
.
join
(
current
,
f
),
main_a
+
'
/
'
)
def
prepare_wrfinput
():
def
prepare_wrfinput
():
"""
Create WRF/run directories and wrfinput files
"""
Create WRF/run directories and wrfinput files
...
@@ -230,33 +239,43 @@ if is_new_run:
...
@@ -230,33 +239,43 @@ if is_new_run:
first_guess
=
False
first_guess
=
False
elif
start_from_existing_state
:
elif
start_from_existing_state
:
#
id = prepare_wrfinput() # create initial conditions
id
=
prepare_wrfinput
()
# create initial conditions
# get initial conditions from archive
# get initial conditions from archive
background_
init_time
=
dt
.
datetime
(
2008
,
7
,
30
,
11
,
30
)
init_time
=
dt
.
datetime
(
2008
,
7
,
30
,
6
)
time
=
dt
.
datetime
(
2008
,
7
,
30
,
1
2
)
valid_
time
=
dt
.
datetime
(
2008
,
7
,
30
,
1
0
)
exppath_arch
=
'
/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.1
2
_LMU_
so_VIS
'
exppath_arch
=
'
/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.1
1
_LMU_
filter
'
first_guess
=
exppath_arch
#
id = update_wrfinput_from_archive(time,
background_
init_time, exppath_arch, depends_on=id)
id
=
update_wrfinput_from_archive
(
valid_
time
,
init_time
,
exppath_arch
,
depends_on
=
id
)
while
time
<=
dt
.
datetime
(
2008
,
7
,
30
,
14
):
# values for assimilation
assim_time
=
time
assim_time
=
valid_time
prev_forecast_init
=
assim_time
-
timedelta_btw_assim
prior_init_time
=
init_time
this_forecast_init
=
assim_time
# start integration from here
prior_path_exp
=
exppath_arch
this_forecast_end
=
assim_time
+
timedelta_integrate
while
time
<=
dt
.
datetime
(
2008
,
7
,
30
,
18
):
id
=
assimilate
(
assim_time
,
id
=
assimilate
(
assim_time
,
pr
ev_forecast_init
,
pr
ior_init_time
,
prior_path_exp
=
first_guess
,
prior_path_exp
=
prior_path_exp
,
depends_on
=
id
)
depends_on
=
id
)
#first_guess = False
prior_path_exp
=
False
# use own exp path
#id = update_wrfinput_from_archive(this_forecast_init, this_forecast_init, cluster.archivedir(), depends_on=id)
# integration
this_forecast_init
=
assim_time
# start integration from here
this_forecast_end
=
assim_time
+
timedelta_integrate
id
=
run_ENS
(
begin
=
this_forecast_init
,
id
=
run_ENS
(
begin
=
this_forecast_init
,
end
=
this_forecast_
init
+
dt
.
timedelta
(
minutes
=
10
)
,
end
=
this_forecast_
end
,
depends_on
=
id
)
depends_on
=
id
)
# increment time
time
+=
timedelta_btw_assim
time
+=
timedelta_btw_assim
#create_satimages(depends_on=id)
# values for next iteration
assim_time
=
time
prior_init_time
=
assim_time
-
timedelta_btw_assim
create_satimages
(
depends_on
=
id
)
mailme
(
id
)
mailme
(
id
)
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