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
5ead0dfb
Commit
5ead0dfb
authored
3 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
spinup run
parent
0039f2a3
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
generate_free.py
+107
-17
107 additions, 17 deletions
generate_free.py
scheduler.py
+20
-12
20 additions, 12 deletions
scheduler.py
with
127 additions
and
29 deletions
generate_free.py
+
107
−
17
View file @
5ead0dfb
...
...
@@ -23,27 +23,32 @@ print('starting osse')
backup_scripts
()
id
=
None
is_nature
=
False
begin
=
dt
.
datetime
(
2008
,
7
,
30
,
12
)
id
=
prepare_WRFrundir
(
begin
)
# create initial conditions
id
=
run_ideal
(
depends_on
=
id
)
if
False
:
#True: # is_nature
begin
=
dt
.
datetime
(
2008
,
7
,
30
,
7
)
id
=
prepare_WRFrundir
(
begin
)
# create initial conditions
id
=
run_ideal
(
depends_on
=
id
)
if
is_nature
:
#id = wrfinput_insert_wbubble(perturb=False, depends_on=id)
end
=
dt
.
datetime
(
2008
,
7
,
30
,
1
4
)
end
=
dt
.
datetime
(
2008
,
7
,
30
,
1
2
)
id
=
run_ENS
(
begin
=
begin
,
end
=
end
,
input_is_restart
=
False
,
output_restart_interval
=
(
end
-
begin
).
total_seconds
()
/
60
,
depends_on
=
id
)
#id = create_satimages(begin, depends_on=id)
else
:
# id = create_satimages(begin, depends_on=id)
if
False
:
# if free run (all inits)
begin
=
dt
.
datetime
(
2008
,
7
,
30
,
7
)
id
=
prepare_WRFrundir
(
begin
)
# create initial conditions
id
=
run_ideal
(
depends_on
=
id
)
#id = wrfinput_insert_wbubble(perturb=True, depends_on=id)
restarts
=
pd
.
date_range
(
start
=
dt
.
datetime
(
2008
,
7
,
30
,
1
2
,
3
0
),
end
=
dt
.
datetime
(
2008
,
7
,
30
,
1
3
),
freq
=
dt
.
timedelta
(
minutes
=
3
0
))
#restarts = [dt.datetime(2008, 7, 30, 1
1
)]
restarts
=
pd
.
date_range
(
start
=
dt
.
datetime
(
2008
,
7
,
30
,
10
),
end
=
dt
.
datetime
(
2008
,
7
,
30
,
1
2
),
freq
=
dt
.
timedelta
(
minutes
=
6
0
))
#restarts = [dt.datetime(2008, 7, 30, 1
2, 30
)]
input_is_restart
=
False
time
=
begin
...
...
@@ -59,17 +64,15 @@ else:
last_init
=
time
time
=
next_restart
input_is_restart
=
True
#
create_satimages(last_init, depends_on=id)
create_satimages
(
last_init
,
depends_on
=
id
)
prior_path_exp
=
cluster
.
archivedir
prior_init_time
=
last_init
prior_valid_time
=
time
id
=
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
depends_on
=
id
)
#sys.exit()
# free run, no restart files anymore
end
=
dt
.
datetime
(
2008
,
7
,
30
,
1
4
)
end
=
dt
.
datetime
(
2008
,
7
,
30
,
1
8
)
print
(
'
run WRF from
'
,
time
,
'
until
'
,
end
)
id
=
run_ENS
(
begin
=
time
,
end
=
end
,
input_is_restart
=
input_is_restart
,
...
...
@@ -78,5 +81,92 @@ else:
depends_on
=
id
)
#id = create_satimages(time, depends_on=id)
id
=
create_satimages
(
time
,
depends_on
=
id
)
verify
(
depends_on
=
id
)
if
False
:
# continuation of free run
start
=
dt
.
datetime
(
2008
,
7
,
30
,
7
)
end
=
dt
.
datetime
(
2008
,
7
,
30
,
10
)
id
=
prepare_WRFrundir
(
start
)
# create initial conditions
prior_path_exp
=
'
/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.19_P5_noDA
'
# cluster.archivedir
prior_init_time
=
dt
.
datetime
(
2008
,
7
,
30
,
11
)
prior_valid_time
=
start
id
=
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
depends_on
=
id
)
id
=
run_ENS
(
begin
=
start
,
end
=
end
,
input_is_restart
=
True
,
output_restart_interval
=
(
end
-
start
).
total_seconds
()
/
60
,
#output_restart_interval=9999,
depends_on
=
id
)
id
=
create_satimages
(
start
,
depends_on
=
id
)
verify
(
depends_on
=
id
)
if
True
:
# continuation of free run after spinup
start
=
dt
.
datetime
(
2008
,
7
,
30
,
7
)
end
=
dt
.
datetime
(
2008
,
7
,
30
,
10
)
id
=
prepare_WRFrundir
(
start
)
# create initial conditions
id
=
run_ideal
(
depends_on
=
id
)
prior_path_exp
=
'
/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.19_P5_noDA
'
# cluster.archivedir
prior_init_time
=
dt
.
datetime
(
2008
,
7
,
30
,
11
)
prior_valid_time
=
dt
.
datetime
(
2008
,
7
,
30
,
12
)
id
=
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
new_start_time
=
start
,
# <---------- to start again after spinup
depends_on
=
id
)
id
=
run_ENS
(
begin
=
start
,
end
=
end
,
input_is_restart
=
False
,
output_restart_interval
=
(
end
-
start
).
total_seconds
()
/
60
,
#output_restart_interval=9999,
depends_on
=
id
)
id
=
create_satimages
(
start
,
depends_on
=
id
)
# continue now with free run
# no restart files anymore
prior_path_exp
=
cluster
.
archivedir
prior_init_time
=
start
prior_valid_time
=
end
id
=
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
depends_on
=
id
)
start
=
end
end
=
dt
.
datetime
(
2008
,
7
,
30
,
18
)
print
(
'
run WRF from
'
,
start
,
'
until
'
,
end
)
id
=
run_ENS
(
begin
=
start
,
end
=
end
,
input_is_restart
=
True
,
#output_restart_interval=(next_restart-time).total_seconds()/60,
output_restart_interval
=
9999
,
depends_on
=
id
)
id
=
create_satimages
(
start
,
depends_on
=
id
)
verify
(
depends_on
=
id
)
if
False
:
# continuation of nature after spinup
start
=
dt
.
datetime
(
2008
,
7
,
30
,
7
)
end
=
dt
.
datetime
(
2008
,
7
,
30
,
18
)
id
=
prepare_WRFrundir
(
start
)
# create initial conditions
id
=
run_ideal
(
depends_on
=
id
)
prior_path_exp
=
'
/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.19_P5_nat2
'
# cluster.archivedir
prior_init_time
=
dt
.
datetime
(
2008
,
7
,
30
,
7
)
prior_valid_time
=
dt
.
datetime
(
2008
,
7
,
30
,
12
)
id
=
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
new_start_time
=
start
,
# <---------- to start again after spinup
depends_on
=
id
)
id
=
run_ENS
(
begin
=
start
,
end
=
end
,
input_is_restart
=
False
,
output_restart_interval
=
(
end
-
start
).
total_seconds
()
/
60
,
#output_restart_interval=9999,
depends_on
=
id
)
id
=
create_satimages
(
start
,
depends_on
=
id
)
verify
(
depends_on
=
id
)
This diff is collapsed.
Click to expand it.
scheduler.py
+
20
−
12
View file @
5ead0dfb
...
...
@@ -176,12 +176,19 @@ def assimilate(assim_time, prior_init_time, prior_valid_time, prior_path_exp,
return
id
def
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
depends_on
=
None
):
def
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
new_start_time
=
None
,
depends_on
=
None
):
if
new_start_time
!=
None
:
tnew
=
new_start_time
.
strftime
(
'
%Y-%m-%d_%H:%M
'
)
else
:
tnew
=
''
id
=
my_Slurm
(
"
IC-prior
"
,
cfg_update
=
dict
(
time
=
"
8
"
)
).
run
(
cluster
.
python
+
'
'
+
cluster
.
scripts_rundir
+
'
/prep_IC_prior.py
'
+
prior_path_exp
+
prior_init_time
.
strftime
(
'
%Y-%m-%d_%H:%M
'
)
+
prior_valid_time
.
strftime
(
'
%Y-%m-%d_%H:%M
'
),
depends_on
=
[
depends_on
])
+
prior_valid_time
.
strftime
(
'
%Y-%m-%d_%H:%M
'
)
+
tnew
,
depends_on
=
[
depends_on
])
return
id
...
...
@@ -216,8 +223,8 @@ def gen_obsseq(depends_on=None):
def
verify
(
depends_on
=
None
):
s
=
my_Slurm
(
"
verify-
"
+
exp
.
expname
,
cfg_update
=
{
"
time
"
:
"
240
"
,
"
mail-type
"
:
"
FAIL,END
"
,
"
ntasks
"
:
"
1
"
,
"
ntasks-per-node
"
:
"
1
"
,
"
ntasks-per-core
"
:
"
1
"
})
s
.
run
(
cluster
.
python_enstools
+
'
/home/fs71386/lkugler/osse_analysis/analyze_fc.py
'
+
exp
.
expname
+
'
has_node
plot
'
,
depends_on
=
[
depends_on
])
cmd
=
cluster
.
python_enstools
+
'
/home/fs71386/lkugler/osse_analysis/
plot_from_raw/
analyze_fc.py
'
+
exp
.
expname
+
'
has_node
sat wrf verif1d FSS BS
'
s
.
run
(
cmd
,
depends_on
=
[
depends_on
])
################################
...
...
@@ -231,19 +238,20 @@ if __name__ == "__main__":
id
=
None
init_time
=
dt
.
datetime
(
2008
,
7
,
30
,
12
)
time
=
dt
.
datetime
(
2008
,
7
,
30
,
1
3
)
time
=
dt
.
datetime
(
2008
,
7
,
30
,
1
2
,
30
)
id
=
prepare_WRFrundir
(
init_time
)
#id = run_ideal(depends_on=id)
#prior_path_exp = cluster.archivedir #
prior_path_exp
=
'
/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.19_P1_noDA
'
#prior_path_exp = '/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.19_P2_noDA'
prior_path_exp
=
'
/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.19_P3_wbub7_noDA
'
#id = wrfinput_insert_wbubble(depends_on=id)
prior_init_time
=
init_time
prior_valid_time
=
time
while
time
<=
dt
.
datetime
(
2008
,
7
,
30
,
1
4
):
while
time
<=
dt
.
datetime
(
2008
,
7
,
30
,
1
3
,
30
):
# usually we take the prior from the current time
# but one could use a prior from a different time from another run
...
...
@@ -251,7 +259,7 @@ if __name__ == "__main__":
prior_valid_time
=
time
id
=
assimilate
(
time
,
prior_init_time
,
prior_valid_time
,
prior_path_exp
,
depends_on
=
id
)
# 1) Set posterior = prior
id
=
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
depends_on
=
id
)
...
...
@@ -261,8 +269,8 @@ if __name__ == "__main__":
# How long shall we integrate?
timedelta_integrate
=
timedelta_btw_assim
output_restart_interval
=
timedelta_btw_assim
.
total_seconds
()
/
60
if
time
==
dt
.
datetime
(
2008
,
7
,
30
,
1
4
):
#this_forecast_init.minute in [0,]: # longer forecast every full hour
timedelta_integrate
=
dt
.
timedelta
(
hours
=
1
)
if
time
==
dt
.
datetime
(
2008
,
7
,
30
,
1
3
,
30
):
#this_forecast_init.minute in [0,]: # longer forecast every full hour
timedelta_integrate
=
dt
.
timedelta
(
hours
=
4.5
)
output_restart_interval
=
9999
# 3) Run WRF ensemble
...
...
@@ -274,7 +282,7 @@ if __name__ == "__main__":
# as we have WRF output, we can use own exp path as prior
prior_path_exp
=
cluster
.
archivedir
create_satimages
(
time
,
depends_on
=
id
)
id_sat
=
create_satimages
(
time
,
depends_on
=
id
)
# increment time
time
+=
timedelta_btw_assim
...
...
@@ -283,4 +291,4 @@ if __name__ == "__main__":
prior_init_time
=
time
-
timedelta_btw_assim
id
=
gen_obsseq
(
id
)
verify
(
id
)
verify
(
id
_sat
)
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