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
78196a4f
Commit
78196a4f
authored
3 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
parent
2f9cee05
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
config/cfg.py
+5
-5
5 additions, 5 deletions
config/cfg.py
dartwrf/prep_IC_prior.py
+1
-0
1 addition, 0 deletions
dartwrf/prep_IC_prior.py
generate_free.py
+16
-17
16 additions, 17 deletions
generate_free.py
scheduler.py
+7
-19
7 additions, 19 deletions
scheduler.py
with
29 additions
and
41 deletions
config/cfg.py
+
5
−
5
View file @
78196a4f
...
...
@@ -7,7 +7,7 @@ class ExperimentConfiguration(object):
pass
exp
=
ExperimentConfiguration
()
exp
.
expname
=
"
exp_v1.19_wb
-random_Radar_zero
"
exp
.
expname
=
"
exp_v1.19_
P
wb
ub-1_WV_obs20_loc10
"
exp
.
model_dx
=
2000
exp
.
n_ens
=
40
exp
.
n_nodes
=
10
...
...
@@ -22,10 +22,10 @@ exp.input_profile = '/home/fs71386/lkugler/wrf_profiles/data/wrf/ens/2021-05-04/
# localize vertically, if it has a vertical position
# needs a horizontal scale too, to calculate the vertical normalization
# since you can not specify different vertical localizations for diff. variables
exp
.
cov_loc_vert_km_horiz_km
=
(
1
,
3
0
)
exp
.
cov_loc_vert_km_horiz_km
=
(
1
,
1
0
)
#exp.superob_km = 12
n_obs
=
961
#5776: 4km, 121: 30km, 256:16x16 (20km); 961: 10km resoltn # radar: n_obs for each observation height level
n_obs
=
256
#5776: 4km, 121: 30km, 256:16x16 (20km); 961: 10km resoltn # radar: n_obs for each observation height level
vis
=
dict
(
plotname
=
'
VIS 0.6µm
'
,
plotunits
=
'
[1]
'
,
kind
=
'
MSG_4_SEVIRI_BDRF
'
,
sat_channel
=
1
,
n_obs
=
n_obs
,
...
...
@@ -35,7 +35,7 @@ vis = dict(plotname='VIS 0.6µm', plotunits='[1]',
wv73
=
dict
(
plotname
=
'
Brightness temperature WV 7.3µm
'
,
plotunits
=
'
[K]
'
,
kind
=
'
MSG_4_SEVIRI_TB
'
,
sat_channel
=
6
,
n_obs
=
n_obs
,
error_generate
=
1.
,
error_assimilate
=
False
,
cov_loc_radius_km
=
3
0
)
cov_loc_radius_km
=
1
0
)
ir108
=
dict
(
plotname
=
'
Brightness temperature IR 10.8µm
'
,
plotunits
=
'
[K]
'
,
kind
=
'
MSG_4_SEVIRI_TB
'
,
sat_channel
=
9
,
n_obs
=
n_obs
,
...
...
@@ -65,7 +65,7 @@ psfc = dict(plotname='SYNOP Pressure', plotunits='[dBz]',
cov_loc_radius_km
=
32
)
exp
.
observations
=
[
radar
]
# 108, wv73, vis]
exp
.
observations
=
[
wv73
]
# 108, wv73, vis]
#exp.update_vars = ['T', 'QVAPOR', 'QCLOUD', 'QICE','CLDFRA']
exp
.
update_vars
=
[
'
U
'
,
'
V
'
,
'
T
'
,
'
PH
'
,
'
MU
'
,
'
QVAPOR
'
,
'
QCLOUD
'
,
'
QICE
'
,
'
CLDFRA
'
]
...
...
This diff is collapsed.
Click to expand it.
dartwrf/prep_IC_prior.py
+
1
−
0
View file @
78196a4f
...
...
@@ -21,6 +21,7 @@ def create_wrfrst_in_WRF_rundir(time, prior_init_time, prior_path_exp):
"""
copies wrfrst to run_WRF directory (for next WRF run)
"""
# for documentation: Which prior was used? -> write into txt file
os
.
makedirs
(
cluster
.
archivedir
+
time
.
strftime
(
'
/%Y-%m-%d_%H:%M/
'
),
exist_ok
=
True
)
os
.
system
(
'
echo
"'
+
prior_path_exp
+
'
\n
'
+
prior_init_time
.
strftime
(
'
/%Y-%m-%d_%H:%M/
'
)
+
'
\n
'
+
time
.
strftime
(
'
/wrfrst_d01_%Y-%m-%d_%H:%M:%S
'
)
+
'"
>
'
+
cluster
.
archivedir
+
time
.
strftime
(
'
/%Y-%m-%d_%H:%M/
'
)
+
'
link_to_prior.txt
'
)
...
...
This diff is collapsed.
Click to expand it.
generate_free.py
+
16
−
17
View file @
78196a4f
...
...
@@ -25,37 +25,33 @@ id = None
is_nature
=
False
begin
=
dt
.
datetime
(
2008
,
7
,
30
,
7
)
begin
=
dt
.
datetime
(
2008
,
7
,
30
,
12
)
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
8
)
#
id = wrfinput_insert_wbubble(perturb=False, depends_on=id)
end
=
dt
.
datetime
(
2008
,
7
,
30
,
1
4
)
id
=
run_ENS
(
begin
=
begin
,
end
=
end
,
first_minute
=
False
,
input_is_restart
=
False
,
output_restart_interval
=
(
end
-
begin
).
total_seconds
()
/
60
,
depends_on
=
id
)
id
=
create_satimages
(
begin
,
depends_on
=
id
)
#
id = create_satimages(begin, depends_on=id)
else
:
#id = wrfinput_insert_wbubble(perturb=True, depends_on=id)
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
=
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, 11)]
input_is_restart
=
False
time
=
begin
last_init
=
dt
.
datetime
(
2008
,
7
,
30
,
9
)
# dummy value
for
next_restart
in
restarts
:
for
i
,
next_restart
in
enumerate
(
restarts
)
:
print
(
'
run_WRF from
'
,
time
,
'
to
'
,
next_restart
)
id
=
run_ENS
(
begin
=
time
,
end
=
next_restart
,
first_minute
=
False
,
input_is_restart
=
input_is_restart
,
restart_path
=
cluster
.
archivedir
+
last_init
.
strftime
(
'
/%Y-%m-%d_%H:%M/
'
),
output_restart_interval
=
(
next_restart
-
time
).
total_seconds
()
/
60
,
#output_restart_interval=720,
depends_on
=
id
)
...
...
@@ -63,21 +59,24 @@ 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
,
14
)
print
(
'
run WRF from
'
,
time
,
'
until
'
,
end
)
end
=
dt
.
datetime
(
2008
,
7
,
30
,
18
)
id
=
run_ENS
(
begin
=
time
,
end
=
end
,
first_minute
=
False
,
input_is_restart
=
input_is_restart
,
restart_path
=
cluster
.
archivedir
+
time
.
strftime
(
'
/%Y-%m-%d_%H:%M/
'
),
#output_restart_interval=(next_restart-time).total_seconds()/60,
output_restart_interval
=
9999
,
depends_on
=
id
)
id
=
create_satimages
(
time
,
depends_on
=
id
)
#
id = create_satimages(time, depends_on=id)
verify
(
depends_on
=
id
)
This diff is collapsed.
Click to expand it.
scheduler.py
+
7
−
19
View file @
78196a4f
...
...
@@ -3,7 +3,7 @@
high level control script
submitting jobs into SLURM queue
"""
import
os
,
sys
,
shutil
,
glob
import
os
,
sys
,
shutil
,
glob
,
warnings
import
datetime
as
dt
from
slurmpy
import
Slurm
...
...
@@ -86,12 +86,6 @@ def run_ENS(begin, end, depends_on=None, first_minute=True,
Then run whole timespan with 5 minutes interval.
if input_is_restart: # start WRF in restart mode
if restart_path:
# restart from a wrfrst file in restart_path directory
# e.g. when restarting from a state in an archivedir (from any existing experiment)
else:
# restart from wrfrst files that are already in run_WRF directories
# e.g. after updateIC, it puts wrfrst in run_WRF directories
"""
id
=
depends_on
restart_flag
=
'
.false.
'
if
not
input_is_restart
else
'
.true.
'
...
...
@@ -108,8 +102,6 @@ def run_ENS(begin, end, depends_on=None, first_minute=True,
# str(hist_interval),
# '--radt='+str(radt),
# '--restart='+restart_flag,]
# if restart_path: # restart from a wrfrst file in restart_path directory
# args.append('--rst_inname='+restart_path)
# id = s.run(' '.join(args), depends_on=[id])
# s = my_Slurm("runWRF1", cfg_update={"nodes": "1", "array": "1-"+str(exp.n_nodes),
...
...
@@ -134,8 +126,6 @@ def run_ENS(begin, end, depends_on=None, first_minute=True,
str
(
hist_interval
),
'
--radt=
'
+
str
(
radt
),
'
--restart=
'
+
restart_flag
,]
# if restart_path:
# args.append('--rst_inname='+restart_path)
if
output_restart_interval
:
args
.
append
(
'
--restart_interval=
'
+
str
(
int
(
float
(
output_restart_interval
))))
...
...
@@ -235,20 +225,19 @@ 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.18_Pwbub-1-ensprof_40mem_rst'
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_Pwbub5_40mem
'
#id = wrfinput_insert_wbubble(depends_on=id)
prior_init_time
=
init_time
prior_valid_time
=
time
id
=
prepare_IC_from_prior
(
prior_path_exp
,
prior_init_time
,
prior_valid_time
,
depends_on
=
id
)
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
...
...
@@ -265,13 +254,12 @@ if __name__ == "__main__":
# How long shall we integrate?
timedelta_integrate
=
timedelta_btw_assim
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
=
2
)
# 3) Run WRF ensemble
id
=
run_ENS
(
begin
=
time
,
# start integration from here
end
=
time
+
timedelta_integrate
,
# integrate until here
restart_path
=
cluster
.
archivedir
+
prior_init_time
.
strftime
(
'
/%Y-%m-%d_%H:%M/
'
),
output_restart_interval
=
timedelta_btw_assim
.
total_seconds
()
/
60
,
depends_on
=
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