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
44b6c1bb
Commit
44b6c1bb
authored
2 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
d9f52d13
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/workflows.py
+27
-27
27 additions, 27 deletions
dartwrf/workflows.py
with
27 additions
and
27 deletions
dartwrf/workflows.py
+
27
−
27
View file @
44b6c1bb
...
...
@@ -20,32 +20,6 @@ def dict_to_py(d, outfile):
txt
+=
'
}
'
f
.
write
(
txt
)
def
_obskind_read
():
"""
Read dictionary of observation types + ID numbers (
"
kind
"
)
from DART f90 script
"""
definitionfile
=
self
.
cluster
.
dart_srcdir
+
'
/../../../assimilation_code/modules/observations/obs_kind_mod.f90
'
with
open
(
definitionfile
,
'
r
'
)
as
f
:
kind_def_f
=
f
.
readlines
()
obskind_nrs
=
{}
for
i
,
line
in
enumerate
(
kind_def_f
):
if
'
Integer definitions for DART OBS TYPES
'
in
line
:
# data starts below this line
i_start
=
i
break
for
line
in
kind_def_f
[
i_start
+
1
:]:
if
'
MAX_DEFINED_TYPES_OF_OBS
'
in
line
:
# end of data
break
if
'
::
'
in
line
:
# a line looks like this
# integer, parameter, public :: MSG_4_SEVIRI_TB = 261
data
=
line
.
split
(
'
::
'
)[
-
1
].
split
(
'
=
'
)
kind_str
=
data
[
0
].
strip
()
kind_nr
=
int
(
data
[
1
].
strip
())
obskind_nrs
[
kind_str
]
=
kind_nr
return
obskind_nrs
class
WorkFlows
(
object
):
def
__init__
(
self
,
exp_config
=
'
cfg.py
'
,
server_config
=
'
server.py
'
):
...
...
@@ -74,8 +48,34 @@ class WorkFlows(object):
# copy obs kind def to config, we will read a table from there
# file needs to exist within package so sphinx can read it
def
_obskind_read
():
"""
Read dictionary of observation types + ID numbers (
"
kind
"
)
from DART f90 script
"""
definitionfile
=
self
.
cluster
.
dart_srcdir
+
'
/../../../assimilation_code/modules/observations/obs_kind_mod.f90
'
with
open
(
definitionfile
,
'
r
'
)
as
f
:
kind_def_f
=
f
.
readlines
()
obskind_nrs
=
{}
for
i
,
line
in
enumerate
(
kind_def_f
):
if
'
Integer definitions for DART OBS TYPES
'
in
line
:
# data starts below this line
i_start
=
i
break
for
line
in
kind_def_f
[
i_start
+
1
:]:
if
'
MAX_DEFINED_TYPES_OF_OBS
'
in
line
:
# end of data
break
if
'
::
'
in
line
:
# a line looks like this
# integer, parameter, public :: MSG_4_SEVIRI_TB = 261
data
=
line
.
split
(
'
::
'
)[
-
1
].
split
(
'
=
'
)
kind_str
=
data
[
0
].
strip
()
kind_nr
=
int
(
data
[
1
].
strip
())
obskind_nrs
[
kind_str
]
=
kind_nr
return
obskind_nrs
dict_to_py
(
_obskind_read
(),
self
.
cluster
.
scriptsdir
+
'
/../config/obskind.py
'
)
# Copy scripts to self.cluster.archivedir folder
os
.
makedirs
(
self
.
cluster
.
archivedir
,
exist_ok
=
True
)
try
:
...
...
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