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
71bd36a8
Commit
71bd36a8
authored
2 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
small fix
parent
a86c9b13
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dartwrf/dart_nml.py
+10
-40
10 additions, 40 deletions
dartwrf/dart_nml.py
with
10 additions
and
40 deletions
dartwrf/dart_nml.py
+
10
−
40
View file @
71bd36a8
...
...
@@ -198,9 +198,9 @@ def _get_list_of_localizations():
l_loc_vert_km
.
append
(
vert_norm_hgt
)
# set the other (unused) list to a dummy value
l_loc_vert_scaleheight
=
[
-
1
,]
l_loc_vert_scaleheight
.
append
(
-
1
)
except
Attribute
Error
:
# localization by scale height
except
Key
Error
:
# localization by scale height
try
:
loc_vert_scaleheight
=
obscfg
[
"
loc_vert_scaleheight
"
]
...
...
@@ -208,13 +208,13 @@ def _get_list_of_localizations():
l_loc_vert_scaleheight
.
append
(
loc_vert_scaleheight
)
# set the other (unused) list to a dummy value
l_loc_vert_km
=
[
-
1
,]
l_loc_vert_km
.
append
(
-
1
)
except
Attribute
Error
:
except
Key
Error
:
# do we have vertical localization?
# check parameter horiz_dist_only == true
if
exp
.
dart_nml
[
'
&location_nml
'
][
'
horiz_dist_only
'
]
[
0
]
==
'
.true.
'
:
if
exp
.
dart_nml
[
'
&location_nml
'
][
'
horiz_dist_only
'
]
==
'
.true.
'
:
# no vertical localization
l_loc_vert_km
.
append
(
-
1
)
l_loc_vert_scaleheight
.
append
(
-
1
)
...
...
@@ -224,38 +224,6 @@ def _get_list_of_localizations():
return
l_obstypes
,
l_loc_horiz_rad
,
l_loc_vert_km
,
l_loc_vert_scaleheight
# def _fortran_format(l):
# # do we have multiples entries?
# # Caution: a string is iterable
# if isinstance(l, list):
# pass
# else:
# l = [l,]
# # do we have strings as elements?
# if isinstance(l[0], str):
# return l
# def _as_fortran_list(l):
# """Convert parameter list
# if l contains strings:
# output: "arg1", "arg2", "arg3"
# else
# output 1,2,3
# """
# assert isinstance(l, list)
# if isinstance(l[0], str):
# # contains strings
# l = ['"'+a+'"' for a in l] # add quotation marks
def
write_namelist
(
just_prior_values
=
False
):
"""
Write a DART namelist file (
'
input.nml
'
)
...
...
@@ -281,9 +249,11 @@ def write_namelist(just_prior_values=False):
nml
=
read_namelist
(
cluster
.
dart_srcdir
+
"
/input.nml
"
)
if
len
(
list_obstypes
)
>
0
:
n_obstypes
=
len
(
list_obstypes
)
if
n_obstypes
>
0
:
# make sure that observations defined in `exp.observations` are assimilated
nml
[
'
&obs_kind_nml
'
][
'
assimilate_these_obs_types
'
]
=
[
list_obstypes
]
nml
[
'
&obs_kind_nml
'
][
'
evaluate_these_obs_types
'
]
=
[[]]
# write localization variables
nml
[
'
&assim_tools_nml
'
][
'
special_localization_obs_types
'
]
=
[
list_obstypes
]
...
...
@@ -293,8 +263,8 @@ def write_namelist(just_prior_values=False):
nml
[
'
&location_nml
'
][
'
special_vert_normalization_heights
'
]
=
[
list_loc_vert_km
]
nml
[
'
&location_nml
'
][
'
special_vert_normalization_scale_heights
'
]
=
[
list_loc_vert_scaleheight
]
nml
[
'
&location_nml
'
][
'
special_vert_normalization_levels
'
]
=
[[
-
1
,]]
nml
[
'
&location_nml
'
][
'
special_vert_normalization_pressures
'
]
=
[[
-
1
,]]
nml
[
'
&location_nml
'
][
'
special_vert_normalization_levels
'
]
=
[[
-
1
,]
*
n_obstypes
]
nml
[
'
&location_nml
'
][
'
special_vert_normalization_pressures
'
]
=
[[
-
1
,]
*
n_obstypes
]
# dont compute posterior, just evaluate prior
if
just_prior_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
register
or
sign in
to comment