Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DataAssimilation
DART-WRF
Commits
8eda9dbe
Commit
8eda9dbe
authored
Feb 14, 2022
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
fix vert loc norm hgt
parent
84b989fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dartwrf/assim_synth_obs.py
+14
-17
14 additions, 17 deletions
dartwrf/assim_synth_obs.py
with
14 additions
and
17 deletions
dartwrf/assim_synth_obs.py
+
14
−
17
View file @
8eda9dbe
...
@@ -12,19 +12,16 @@ from dartwrf import obsseq
...
@@ -12,19 +12,16 @@ from dartwrf import obsseq
earth_radius_km
=
6370
earth_radius_km
=
6370
# Kelvin, fit of Fig 7b, Harnisch 2016
x_ci
=
[
0
,
5
,
10.5
,
13
,
16
]
# average cloud impact
y_oe
=
[
1
,
4.5
,
10
,
12
,
13
]
# adjusted observation error
oe_73_linear
=
interp1d
(
x_ci
,
y_oe
,
assume_sorted
=
True
)
def
OE_model_harnisch_WV73
(
ci
):
def
OE_model_harnisch_WV73
(
ci
):
if
ci
>=
0
and
ci
<
16
:
if
ci
>=
0
and
ci
<
16
:
# Kelvin, fit of Fig 7b, Harnisch 2016
x_ci
=
[
0
,
5
,
10.5
,
13
,
16
]
# average cloud impact [K]
y_oe
=
[
1
,
4.5
,
10
,
12
,
13
]
# adjusted observation error [K]
oe_73_linear
=
interp1d
(
x_ci
,
y_oe
,
assume_sorted
=
True
)
return
oe_73_linear
(
ci
)
return
oe_73_linear
(
ci
)
else
:
else
:
return
13.0
return
13.0
def
cloudimpact_73
(
bt_mod
,
bt_obs
):
def
cloudimpact_73
(
bt_mod
,
bt_obs
):
"""
"""
follows Harnisch 2016
follows Harnisch 2016
...
@@ -150,15 +147,15 @@ def set_DART_nml(just_prior_values=False):
...
@@ -150,15 +147,15 @@ def set_DART_nml(just_prior_values=False):
"
<list_cutoffs>
"
:
"
,
"
.
join
(
list_cov_loc_radian
),
"
<list_cutoffs>
"
:
"
,
"
.
join
(
list_cov_loc_radian
),
}
}
#
if cov_loc_vert_km:
#
Note: only one value of vertical localization possible
options
[
"
<horiz_dist_only>
"
]
=
"
.true.
"
if
hasattr
(
exp
,
'
cov_loc_vert_km_horiz_km
'
):
options
[
"
<horiz_dist_only>
"
]
=
"
.false.
"
cov_loc_vert_km
,
cov_loc_horiz_km
=
exp
.
cov_loc_vert_km_horiz_km
cov_loc_vert_km
,
cov_loc_horiz_km
=
exp
.
cov_loc_vert_km_horiz_km
vert_norm_hgt
=
to_vertical_normalization
(
cov_loc_vert_km
,
cov_loc_horiz_km
)
vert_norm_hgt
=
to_vertical_normalization
(
cov_loc_vert_km
,
cov_loc_horiz_km
)
options
[
"
<vert_norm_hgt>
"
]
=
str
(
vert_norm_hgt
)
options
[
"
<vert_norm_hgt>
"
]
=
str
(
vert_norm_hgt
)
#
else:
else
:
#
options[
'
<horiz_dist_only>
'
] =
'
.true.
'
options
[
"
<horiz_dist_only>
"
]
=
"
.true.
"
#
options[
'
<vert_norm_hgt>
'
] =
'50000
.0
'
# dummy value
options
[
"
<vert_norm_hgt>
"
]
=
"
99999
.0
"
# dummy value
for
key
,
value
in
options
.
items
():
for
key
,
value
in
options
.
items
():
sed_inplace
(
cluster
.
dartrundir
+
"
/input.nml
"
,
key
,
value
)
sed_inplace
(
cluster
.
dartrundir
+
"
/input.nml
"
,
key
,
value
)
...
@@ -474,7 +471,7 @@ def set_obserr_assimilate_in_obsseqout(obsseqout, outfile="./obs_seq.out"):
...
@@ -474,7 +471,7 @@ def set_obserr_assimilate_in_obsseqout(obsseqout, outfile="./obs_seq.out"):
if
is_assim_error_parametrized
(
obscfg
):
if
is_assim_error_parametrized
(
obscfg
):
assim_err
=
get_parametrized_error
(
obscfg
)
assim_err
=
get_parametrized_error
(
obscfg
)
obsseqout
.
df
.
loc
[
mask_kind
,
'
variance
'
]
=
assim_err
**
2
obsseqout
.
df
.
loc
[
mask_kind
,
'
variance
'
]
=
assim_err
**
2
assert
np
.
allclose
(
assim_err
,
obsseqout
.
df
[
'
variance
'
]
**
2
)
#
assert np.allclose(assim_err, obsseqout.df['variance']**2)
else
:
else
:
# overwrite with user-defined values
# overwrite with user-defined values
...
...
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
sign in
to comment