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
4de356a4
Commit
4de356a4
authored
1 year ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
fix Attribute/KeyError
parent
c4f2c004
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dartwrf/dart_nml.py
+5
-5
5 additions, 5 deletions
dartwrf/dart_nml.py
with
5 additions
and
5 deletions
dartwrf/dart_nml.py
+
5
−
5
View file @
4de356a4
...
...
@@ -200,7 +200,7 @@ def _get_list_of_localizations():
# set the other (unused) list to a dummy value
l_loc_vert_scaleheight
=
[
-
1
,]
except
Attribute
Error
:
# localization by scale height
except
Key
Error
:
# localization by scale height
try
:
loc_vert_scaleheight
=
obscfg
[
"
loc_vert_scaleheight
"
]
...
...
@@ -210,16 +210,16 @@ def _get_list_of_localizations():
# set the other (unused) list to a dummy value
l_loc_vert_km
=
[
-
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
)
else
:
raise
ValueError
(
'
N
either `loc_vert_km` nor `loc_vert_scaleheight` defined in obscfg.
'
)
raise
ValueError
(
'
DART namelist requires vertical localization, but n
either `loc_vert_km` nor `loc_vert_scaleheight`
are
defined in obscfg.
'
)
return
l_obstypes
,
l_loc_horiz_rad
,
l_loc_vert_km
,
l_loc_vert_scaleheight
...
...
@@ -341,4 +341,4 @@ def write_namelist(just_prior_values=False):
append_file
(
cluster
.
dart_rundir
+
"
/input.nml
"
,
rttov_nml
)
# alternatively, we could do this in cfg.py or the template input.nml in DART's model/wrf/work folder
return
nml
# in case we want to access namelist settings in python
\ No newline at end of file
return
nml
# in case we want to access namelist settings in python
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