Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DART-WRF
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Commits
2f44f8dd
Commit
2f44f8dd
authored
2 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
Revert to the last point with working ipynb docs
This reverts commit
86151bf8
.
parent
2850e011
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cycled_exp.py
+20
-18
20 additions, 18 deletions
cycled_exp.py
dartwrf/workflows.py
+2
-2
2 additions, 2 deletions
dartwrf/workflows.py
with
22 additions
and
20 deletions
cycled_exp.py
+
20
−
18
View file @
2f44f8dd
...
@@ -3,13 +3,15 @@ import os, sys, shutil, glob, warnings
...
@@ -3,13 +3,15 @@ import os, sys, shutil, glob, warnings
import
datetime
as
dt
import
datetime
as
dt
from
dartwrf.utils
import
script_to_str
from
dartwrf.utils
import
script_to_str
from
dartwrf.workflows
import
WorkFlows
from
config.cfg
import
exp
from
config.clusters
import
cluster
from
dartwrf.workflows
import
*
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
"""
"""
Run a cycled OSSE with WRF and DART.
Run a cycled OSSE with WRF and DART.
"""
"""
w
=
WorkFlows
(
exp_config
=
'
cfg.py
'
,
server_config
=
'
jet.py
'
)
cluster
.
setup
(
)
timedelta_integrate
=
dt
.
timedelta
(
minutes
=
15
)
timedelta_integrate
=
dt
.
timedelta
(
minutes
=
15
)
timedelta_btw_assim
=
dt
.
timedelta
(
minutes
=
15
)
timedelta_btw_assim
=
dt
.
timedelta
(
minutes
=
15
)
...
@@ -24,20 +26,20 @@ if __name__ == "__main__":
...
@@ -24,20 +26,20 @@ if __name__ == "__main__":
last_assim_time
=
dt
.
datetime
(
2008
,
7
,
30
,
13
,
30
)
last_assim_time
=
dt
.
datetime
(
2008
,
7
,
30
,
13
,
30
)
forecast_until
=
dt
.
datetime
(
2008
,
7
,
30
,
18
)
forecast_until
=
dt
.
datetime
(
2008
,
7
,
30
,
18
)
w
.
prepare_WRFrundir
(
init_time
)
prepare_WRFrundir
(
init_time
)
# id =
w.
run_ideal(depends_on=id)
# id = run_ideal(depends_on=id)
# id =
w.
wrfinput_insert_wbubble(depends_on=id)
# id = wrfinput_insert_wbubble(depends_on=id)
if
True
:
# random
if
True
:
# random
prior_path_exp
=
'
/jetfs/home/lkugler/data/sim_archive/exp_v1.19_P2_noDA
'
prior_path_exp
=
'
/jetfs/home/lkugler/data/sim_archive/exp_v1.19_P2_noDA
'
init_time
=
dt
.
datetime
(
2008
,
7
,
30
,
1
2
)
init_time
=
dt
.
datetime
(
2008
,
7
,
30
,
1
3
)
time
=
dt
.
datetime
(
2008
,
7
,
30
,
1
3
)
time
=
dt
.
datetime
(
2008
,
7
,
30
,
1
4
)
last_assim_time
=
dt
.
datetime
(
2008
,
7
,
30
,
14
)
last_assim_time
=
dt
.
datetime
(
2008
,
7
,
30
,
14
)
forecast_until
=
dt
.
datetime
(
2008
,
7
,
30
,
14
,
1
8
)
forecast_until
=
dt
.
datetime
(
2008
,
7
,
30
,
14
,
1
5
)
w
.
prepare_WRFrundir
(
init_time
)
prepare_WRFrundir
(
init_time
)
# id =
w.
run_ideal(depends_on=id)
# id = run_ideal(depends_on=id)
# prior_path_exp = cluster.archivedir
# prior_path_exp = cluster.archivedir
# prior_path_exp = '/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.19_P5+su_noDA'
# prior_path_exp = '/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.19_P5+su_noDA'
...
@@ -52,13 +54,13 @@ if __name__ == "__main__":
...
@@ -52,13 +54,13 @@ if __name__ == "__main__":
# i.e. 13z as a prior to assimilate 12z observations
# i.e. 13z as a prior to assimilate 12z observations
prior_valid_time
=
time
prior_valid_time
=
time
id
=
w
.
assimilate
(
time
,
prior_init_time
,
prior_valid_time
,
prior_path_exp
,
depends_on
=
id
)
id
=
assimilate
(
time
,
prior_init_time
,
prior_valid_time
,
prior_path_exp
,
depends_on
=
id
)
# 1) Set posterior = prior
# 1) Set posterior = prior
id
=
w
.
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
depends_on
=
id
)
id
=
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
depends_on
=
id
)
# 2) Update posterior += updates from assimilation
# 2) Update posterior += updates from assimilation
id
=
w
.
update_IC_from_DA
(
time
,
depends_on
=
id
)
id
=
update_IC_from_DA
(
time
,
depends_on
=
id
)
# How long shall we integrate?
# How long shall we integrate?
timedelta_integrate
=
timedelta_btw_assim
timedelta_integrate
=
timedelta_btw_assim
...
@@ -68,7 +70,7 @@ if __name__ == "__main__":
...
@@ -68,7 +70,7 @@ if __name__ == "__main__":
output_restart_interval
=
9999
# no restart file after last assim
output_restart_interval
=
9999
# no restart file after last assim
# 3) Run WRF ensemble
# 3) Run WRF ensemble
id
=
w
.
run_ENS
(
begin
=
time
,
# start integration from here
id
=
run_ENS
(
begin
=
time
,
# start integration from here
end
=
time
+
timedelta_integrate
,
# integrate until here
end
=
time
+
timedelta_integrate
,
# integrate until here
output_restart_interval
=
output_restart_interval
,
output_restart_interval
=
output_restart_interval
,
depends_on
=
id
)
depends_on
=
id
)
...
@@ -76,7 +78,7 @@ if __name__ == "__main__":
...
@@ -76,7 +78,7 @@ if __name__ == "__main__":
# as we have WRF output, we can use own exp path as prior
# as we have WRF output, we can use own exp path as prior
prior_path_exp
=
w
.
cluster
.
archivedir
prior_path_exp
=
w
.
cluster
.
archivedir
id_sat
=
w
.
create_satimages
(
time
,
depends_on
=
id
)
id_sat
=
create_satimages
(
time
,
depends_on
=
id
)
# increment time
# increment time
time
+=
timedelta_btw_assim
time
+=
timedelta_btw_assim
...
@@ -84,6 +86,6 @@ if __name__ == "__main__":
...
@@ -84,6 +86,6 @@ if __name__ == "__main__":
# update time variables
# update time variables
prior_init_time
=
time
-
timedelta_btw_assim
prior_init_time
=
time
-
timedelta_btw_assim
w
.
verify_sat
(
id_sat
)
verify_sat
(
id_sat
)
w
.
verify_wrf
(
id
)
verify_wrf
(
id
)
w
.
verify_fast
(
id
)
verify_fast
(
id
)
This diff is collapsed.
Click to expand it.
dartwrf/workflows.py
+
2
−
2
View file @
2f44f8dd
...
@@ -25,7 +25,7 @@ def dict_to_py(d, outfile):
...
@@ -25,7 +25,7 @@ def dict_to_py(d, outfile):
class
WorkFlows
(
object
):
class
WorkFlows
(
object
):
def
__init__
(
self
,
exp_config
=
'
cfg.py
'
,
server_config
=
'
server.py
'
):
def
__init__
(
self
,
exp_config
=
'
cfg.py
'
,
server_config
=
'
server.py
'
):
"""
Set up the experiment folder in `archivedir`
, copy config files, backup scripts
.
"""
Set up the experiment folder in `archivedir`.
Args:
Args:
exp (str): Path to exp config file
exp (str): Path to exp config file
...
@@ -239,7 +239,7 @@ class WorkFlows(object):
...
@@ -239,7 +239,7 @@ class WorkFlows(object):
def
create_satimages
(
self
,
init_time
,
depends_on
=
None
):
def
create_satimages
(
self
,
init_time
,
depends_on
=
None
):
cmd
=
self
.
cluster
.
python_verif
+
'
~/RTTOV-WRF/run_init.py
'
+
self
.
cluster
.
archivedir
+
init_time
.
strftime
(
'
/%Y-%m-%d_%H:%M/
'
)
cmd
=
self
.
cluster
.
python_verif
+
'
~/RTTOV-WRF/run_init.py
'
+
self
.
cluster
.
archivedir
+
init_time
.
strftime
(
'
/%Y-%m-%d_%H:%M/
'
)
id
=
self
.
cluster
.
run_job
(
cmd
,
"
RTTOV
"
,
cfg_update
=
{
"
ntasks
"
:
"
12
"
,
"
time
"
:
"
80
"
,
"
mem
"
:
"
18
0G
"
},
depends_on
=
[
depends_on
])
id
=
self
.
cluster
.
run_job
(
cmd
,
"
RTTOV
"
,
cfg_update
=
{
"
ntasks
"
:
"
12
"
,
"
time
"
:
"
80
"
,
"
mem
"
:
"
20
0G
"
},
depends_on
=
[
depends_on
])
return
id
return
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