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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DataAssimilation
DART-WRF
Commits
51871c03
Commit
51871c03
authored
3 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
read obs kind from DART
parent
0e02b26f
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/create_obsseq.py
+26
-29
26 additions, 29 deletions
dartwrf/create_obsseq.py
with
26 additions
and
29 deletions
dartwrf/create_obsseq.py
+
26
−
29
View file @
51871c03
...
@@ -10,34 +10,31 @@ from pysolar.solar import get_altitude, get_azimuth
...
@@ -10,34 +10,31 @@ from pysolar.solar import get_altitude, get_azimuth
def
obskind_read
():
def
obskind_read
():
raw_obskind_dart
=
"""
"""
Read dictionary of observation types + ID numbers (
"
kind
"
)
5 RADIOSONDE_TEMPERATURE
from DART f90 script
6 RADIOSONDE_SPECIFIC_HUMIDITY
"""
12 AIRCRAFT_U_WIND_COMPONENT
13 AIRCRAFT_V_WIND_COMPONENT
definitionfile
=
cluster
.
dart_srcdir
+
'
/../../../assimilation_code/modules/observations/obs_kind_mod.f90
'
14 AIRCRAFT_TEMPERATURE
with
open
(
definitionfile
,
'
r
'
)
as
f
:
16 ACARS_U_WIND_COMPONENT
kind_def_f
=
f
.
readlines
()
17 ACARS_V_WIND_COMPONENT
18 ACARS_TEMPERATURE
29 LAND_SFC_PRESSURE
30 SAT_U_WIND_COMPONENT
31 SAT_V_WIND_COMPONENT
36 DOPPLER_RADIAL_VELOCITY
37 RADAR_REFLECTIVITY
83 GPSRO_REFRACTIVITY
94 SYNOP_SURFACE_PRESSURE
95 SYNOP_SPECIFIC_HUMIDITY
96 SYNOP_TEMPERATURE
254 MSG_4_SEVIRI_RADIANCE
255 MSG_4_SEVIRI_TB
256 MSG_4_SEVIRI_BDRF
"""
# lookup table for kind nr
alist
=
raw_obskind_dart
.
split
()
assert
len
(
alist
)
%
2
==
0
,
alist
obskind_nrs
=
{}
obskind_nrs
=
{}
for
i
in
range
(
0
,
len
(
alist
)
-
1
,
2
):
for
i
,
line
in
enumerate
(
kind_def_f
):
obskind_nrs
[
alist
[
i
+
1
]]
=
alist
[
i
]
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
return
obskind_nrs
...
@@ -215,7 +212,7 @@ obs_kind_definitions
...
@@ -215,7 +212,7 @@ obs_kind_definitions
def
preamble_multi
(
n_obs_3d_total
,
list_kinds
):
def
preamble_multi
(
n_obs_3d_total
,
list_kinds
):
lines_obstypedef
=
''
lines_obstypedef
=
''
for
kind
in
list_kinds
:
for
kind
in
list_kinds
:
lines_obstypedef
+=
'
\n
'
+
obs_kind_nrs
[
kind
]
+
'
'
+
kind
lines_obstypedef
+=
'
\n
'
+
str
(
obs_kind_nrs
[
kind
]
)
+
'
'
+
kind
n_obs_str
=
str
(
n_obs_3d_total
)
n_obs_str
=
str
(
n_obs_3d_total
)
num_obstypes
=
str
(
len
(
list_kinds
))
num_obstypes
=
str
(
len
(
list_kinds
))
...
@@ -278,7 +275,7 @@ obdef
...
@@ -278,7 +275,7 @@ obdef
loc3d
loc3d
"""
+
lon_rad
+
"
"
+
lat_rad
+
"
"
+
str
(
obs
[
'
vert_coord
'
])
+
"
"
+
obs
[
'
vert_coord_sys
'
]
+
"""
"""
+
lon_rad
+
"
"
+
lat_rad
+
"
"
+
str
(
obs
[
'
vert_coord
'
])
+
"
"
+
obs
[
'
vert_coord_sys
'
]
+
"""
kind
kind
"""
+
obs
[
'
kind_nr
'
]
+
"""
"""
+
str
(
obs
[
'
kind_nr
'
]
)
+
"""
"""
+
obs
[
'
appendix
'
]
+
"""
"""
+
obs
[
'
appendix
'
]
+
"""
"""
+
obs
[
'
secs_thatday
'
]
+
"""
"""
+
obs
[
'
dart_date_day
'
]
+
"""
"""
+
obs
[
'
secs_thatday
'
]
+
"""
"""
+
obs
[
'
dart_date_day
'
]
+
"""
"""
+
str
(
obs
[
'
obserr_var
'
])
"""
+
str
(
obs
[
'
obserr_var
'
])
...
...
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