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
c14bd0ad
Commit
c14bd0ad
authored
1 year ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
nature wrfinput_d01 fix
parent
abc1a587
No related branches found
No related tags found
1 merge request
!5
Forward to most current stage
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dartwrf/assim_synth_obs.py
+22
-19
22 additions, 19 deletions
dartwrf/assim_synth_obs.py
with
22 additions
and
19 deletions
dartwrf/assim_synth_obs.py
+
22
−
19
View file @
c14bd0ad
...
@@ -78,31 +78,32 @@ def set_DART_nml(just_prior_values=False):
...
@@ -78,31 +78,32 @@ def set_DART_nml(just_prior_values=False):
append_file
(
cluster
.
dartrundir
+
"
/input.nml
"
,
rttov_nml
)
append_file
(
cluster
.
dartrundir
+
"
/input.nml
"
,
rttov_nml
)
def
link_nature_to_dart_truth
(
time
):
def
_prepare_DART_grid_template
():
"""
Set a symlink from the WRFout file to be used as nature to the run_DART folder
# DART needs a wrfinput file as a template for the grid
# No data will be read from this file, but the grid information must match exactly.
symlink
(
cluster
.
dartrundir
+
"
/prior_ens1/wrfout_d01
"
,
cluster
.
dartrundir
+
"
/wrfinput_d01
"
)
def
prepare_nature_dart
(
time
):
"""
Prepares DART nature (wrfout_d01) if available
Args:
Args:
time (dt.datetime): Time at which observations will be made
time (dt.datetime): Time at which observations will be made
"""
"""
# get wrfout_d01 from nature run
try
:
shutil
.
copy
(
time
.
strftime
(
exp
.
nature
+
'
/
'
+
wrfout_format
),
f_wrfout_nature
=
time
.
strftime
(
exp
.
nature
+
'
/
'
+
wrfout_format
)
cluster
.
dartrundir
+
"
/wrfout_d01
"
)
os
.
path
.
exists
(
f_wrfout_nature
)
except
:
# if nature is not available due to any reason
# DART may need a wrfinput file as well, which serves as a template for dimension sizes
print
(
'
-> has no nature, not copying nature
'
)
symlink
(
cluster
.
dartrundir
+
"
/wrfout_d01
"
,
return
cluster
.
dartrundir
+
"
/wrfinput_d01
"
)
print
(
"
linked
"
,
time
.
strftime
(
exp
.
nature
+
'
/
'
+
wrfout_format
),
"
to
"
,
cluster
.
dartrundir
+
"
/wrfout_d01
"
)
print
(
"
linking nature to DART & georeferencing
"
)
shutil
.
copy
(
f_wrfout_nature
,
cluster
.
dartrundir
+
"
/wrfout_d01
"
)
print
(
"
linked
"
,
f_wrfout_nature
,
"
to
"
,
cluster
.
dartrundir
+
"
/wrfout_d01
"
)
def
prepare_nature_dart
(
time
):
wrfout_add_geo
.
run
(
cluster
.
geo_em
,
cluster
.
dartrundir
+
"
/wrfout_d01
"
)
if
hasattr
(
exp
,
'
nature
'
):
print
(
"
linking nature to DART & georeferencing
"
)
link_nature_to_dart_truth
(
time
)
wrfout_add_geo
.
run
(
cluster
.
geo_em
,
cluster
.
dartrundir
+
"
/wrfout_d01
"
)
else
:
print
(
'
has no nature, not copying nature
'
)
def
prepare_prior_ensemble
(
assim_time
,
prior_init_time
,
prior_valid_time
,
prior_path_exp
):
def
prepare_prior_ensemble
(
assim_time
,
prior_init_time
,
prior_valid_time
,
prior_path_exp
):
...
@@ -186,6 +187,8 @@ def run_perfect_model_obs(nproc=12, verbose=True):
...
@@ -186,6 +187,8 @@ def run_perfect_model_obs(nproc=12, verbose=True):
"
\n
look for
"
+
cluster
.
dartrundir
+
"
/log.perfect_model_obs
"
)
"
\n
look for
"
+
cluster
.
dartrundir
+
"
/log.perfect_model_obs
"
)
def
filter
(
nproc
=
12
):
def
filter
(
nproc
=
12
):
_prepare_DART_grid_template
()
print
(
"
time now
"
,
dt
.
datetime
.
now
())
print
(
"
time now
"
,
dt
.
datetime
.
now
())
print
(
"
running filter
"
)
print
(
"
running filter
"
)
os
.
chdir
(
cluster
.
dartrundir
)
os
.
chdir
(
cluster
.
dartrundir
)
...
...
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