Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
NearRealTimeCTDAS
CTDAS
Commits
08755fc9
Commit
08755fc9
authored
Jan 15, 2019
by
brunner
Browse files
No commit message
No commit message
parent
823b5ad3
Changes
2
Hide whitespace changes
Inline
Side-by-side
da/cosmo/observationoperator.py
View file @
08755fc9
...
...
@@ -58,6 +58,9 @@ class ObservationOperator(object):
def
run
(
self
,
lag
,
dacycle
):
absolute_start_time
=
str
((
to_datetime
(
dacycle
[
'abs.time.start'
])).
strftime
(
'%Y-%m-%d'
))
starth
=
abs
((
to_datetime
(
dacycle
[
'abs.time.start'
])
-
dacycle
[
'time.start'
]).
days
)
*
24
endh
=
abs
((
to_datetime
(
dacycle
[
'abs.time.start'
])
-
dacycle
[
'time.finish'
]).
days
)
*
24
f
=
io
.
CT_CDF
(
self
.
simulated_file
,
method
=
'create'
)
logging
.
debug
(
'Creating new simulated observation file in ObservationOperator (%s)'
%
self
.
simulated_file
)
...
...
@@ -131,17 +134,17 @@ class ObservationOperator(object):
os
.
chdir
(
dacycle
[
'da.obsoperator.home'
])
if
os
.
path
.
exists
(
"/scratch/snx3000/parsenov/ctdas/"
+
dacycle
[
'time.start'
].
strftime
(
'%Y%m%d%H'
)
+
"_"
+
str
(
168
*
lag
)
+
"_"
+
str
(
168
*
lag
+
168
)
+
"/cosmo/output/"
):
os
.
rename
(
"/scratch/snx3000/parsenov/ctdas/"
+
dacycle
[
'time.start'
].
strftime
(
'%Y%m%d%H'
)
+
"_"
+
str
(
168
*
lag
)
+
"_"
+
str
(
168
*
lag
+
168
),
"/scratch/snx3000/parsenov/ctdas/non_opt_"
+
dacycle
[
'time.start'
].
strftime
(
'%Y%m%d%H'
)
+
"_"
+
str
(
168
*
lag
)
+
"_"
+
str
(
168
*
lag
+
168
))
if
os
.
path
.
exists
(
"/scratch/snx3000/parsenov/ctdas/"
+
absolute_start_time
+
"_"
+
str
(
starth
+
lag
*
168
)
+
"_"
+
str
(
endh
+
lag
*
168
)
+
"/cosmo/output/"
):
os
.
rename
(
"/scratch/snx3000/parsenov/ctdas/"
+
absolute_start_time
+
"_"
+
str
(
starth
+
lag
*
168
)
+
"_"
+
str
(
endh
+
lag
*
168
),
"/scratch/snx3000/parsenov/ctdas/non_opt_"
+
dacycle
[
'time.start'
].
strftime
(
'%Y%m%d%H'
)
+
"_"
+
str
(
starth
+
lag
*
168
)
+
"_"
+
str
(
endh
+
lag
*
168
))
os
.
system
(
'python run_chain.py ctdas '
+
absolute_start_time
+
' '
+
str
(
lag
*
168
)
+
' '
+
str
(
lag
*
168
+
168
)
+
' -j meteo icbc emissions biofluxes int2lm post_int2lm cosmo'
)
os
.
system
(
'python run_chain.py ctdas '
+
absolute_start_time
+
' '
+
str
(
starth
+
lag
*
168
)
+
' '
+
str
(
endh
+
lag
*
168
)
+
' -j meteo icbc emissions biofluxes int2lm post_int2lm cosmo'
)
os
.
chdir
(
dacycle
[
'dir.da_run'
])
args
=
[
(
dacycle
,
hstart
,
hstop
,
self
.
forecast_nmembers
)
for
dacycle
,
(
hstart
,
hstop
),
self
.
forecast_nmembers
in
zip
(
repeat
(
dacycle
),
[(
168
*
lag
,
168
*
lag
+
167
)],
[(
starth
+
168
*
lag
,
endh
+
168
*
lag
-
1
)],
repeat
(
self
.
forecast_nmembers
))
]
...
...
@@ -172,17 +175,18 @@ class ObservationOperator(object):
self
.
dacycle
=
dacycle
time_stamp
=
str
((
dacycle
[
'time.start'
]
+
timedelta
(
hours
=
hstart
)).
strftime
(
'%Y%m%d%H'
))
+
'_'
+
str
((
dacycle
[
'time.start'
]
+
timedelta
(
hours
=
hstop
)).
strftime
(
'%Y%m%d%H'
))
abs_start_time
=
str
((
to_datetime
(
dacycle
[
'abs.time.start'
])).
strftime
(
'%Y%m%d%H'
))
cosmo_
start
=
dacycle
[
'time.start'
].
strftime
(
'%Y%m%d%H'
)
#+timedelta(hours=168)
cosmo_out
=
"/scratch/snx3000/parsenov/ctdas/"
+
cosmo
_start
+
"_"
+
str
(
hstart
)
+
"_"
+
str
(
hstop
+
1
)
+
"
/cosmo/output/"
cosmo_
out
=
"/scratch/snx3000/parsenov/ctdas/"
+
abs_start_time
+
"_"
+
str
(
hstart
)
+
"_"
+
str
(
hstop
+
1
)
+
"/cosmo/output/"
hhl_
cosmo_out
=
"/scratch/snx3000/parsenov/ctdas/"
+
abs
_start
_time
+
"_0_168
/cosmo/output/"
cosmo_save
=
"/store/empa/em05/parsenov/cosmo_data/"
hhl_fn
=
cosmo_out
+
'lffd'
+
dacycle
[
'time.start'
].
strftime
(
'%Y%m%d%H'
)
+
'c.nc'
hhl_fn
=
hhl_
cosmo_out
+
'lffd'
+
abs_start_time
+
'c.nc'
cdo
.
selname
(
"HHL"
,
input
=
hhl_fn
,
output
=
cosmo_out
+
"hhl.nc"
)
for
ens
in
range
(
0
,
ensnum
):
ens
=
str
(
ens
).
zfill
(
3
)
files2cat
=
[]
for
dt
in
rrule
.
rrule
(
rrule
.
HOURLY
,
dtstart
=
dacycle
[
'time.start'
]
+
timedelta
(
hours
=
hstart
),
until
=
dacycle
[
'time.start'
]
+
timedelta
(
hours
=
hstop
)):
for
dt
in
rrule
.
rrule
(
rrule
.
HOURLY
,
dtstart
=
to_datetime
(
dacycle
[
'
abs.
time.start'
]
)
+
timedelta
(
hours
=
hstart
),
until
=
to_datetime
(
dacycle
[
'
abs.
time.start'
]
)
+
timedelta
(
hours
=
hstop
)):
dt
=
dt
.
strftime
(
'%Y%m%d%H'
)
logging
.
info
(
'Extracting output for ens %s, time %s'
%
(
str
(
ens
),
str
(
dt
)))
co2_in_fn
=
cosmo_out
+
'lffd'
+
dt
+
'.nc'
...
...
template.rc
View file @
08755fc9
...
...
@@ -28,15 +28,20 @@
!
! The time for which to start and end the data assimilation experiment in format YYYY-MM-DD HH:MM:SS
time.start : 2013-04-01 00:00:00
time.finish : 2013-04-07 23:00:00
time.end : 2013-04-07 23:00:00
! the following 3 lines are for initial start
!time.start : 2013-04-01 00:00:00
!time.finish : 2013-04-07 23:00:00
!time.end : 2013-04-07 23:00:00
time.start : 2013-04-08 00:00:00
time.finish : 2013-04-14 23:00:00
time.end : 2013-04-14 23:00:00
abs.time.start : 2013-04-01 00:00:00
! Whether to restart the CTDAS system from a previous cycle, or to start the sequence fresh. Valid entries are T/F/True/False/TRUE/FALSE
time.restart :
F
time.restart :
T
da.restart.tstamp : 2013-04-01 00:00:00
! The length of a cycle is given in days, such that the integer 7 denotes the typically used weekly cycle. Valid entries are integers > 1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment