Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
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
f822926c
Commit
f822926c
authored
6 months ago
by
Lukas Kugler
Browse files
Options
Downloads
Patches
Plain Diff
remove old scripts
parent
e5d9981c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
dartwrf/create_obs_upfront.py
+0
-68
0 additions, 68 deletions
dartwrf/create_obs_upfront.py
dartwrf/evaluate_posterior.py
+0
-27
0 additions, 27 deletions
dartwrf/evaluate_posterior.py
evaluate_plus1.py
+0
-24
0 additions, 24 deletions
evaluate_plus1.py
with
0 additions
and
119 deletions
dartwrf/create_obs_upfront.py
deleted
100755 → 0
+
0
−
68
View file @
e5d9981c
from
multiprocessing.sharedctypes
import
Value
import
os
,
sys
,
shutil
,
warnings
import
time
as
time_module
import
datetime
as
dt
import
numpy
as
np
from
dartwrf.exp_config
import
exp
from
dartwrf.server_config
import
cluster
from
dartwrf.utils
import
copy
,
print
import
dartwrf.obs.create_obsseq_in
as
osq
from
dartwrf.obs
import
obsseq
from
dartwrf
import
assim_synth_obs
as
aso
tformat
=
'
%Y-%m-%d_%H:%M
'
if
__name__
==
"
__main__
"
:
"""
Create observations for multiple times upfront
"""
args
=
sys
.
argv
[
1
:]
times
=
[]
for
tstr
in
args
:
times
.
append
(
dt
.
datetime
.
strptime
(
tstr
,
tformat
))
# strange path?
# dir_for_obsseqout = exp.nature_wrfout + '/../../../obs_seq_out/'+exp.use_existing_obsseq
raise
NotImplementedError
(
'
where to save obsseq to?
'
)
dir_for_obsseqout
=
''
# TODO: solve this when necessary
print
(
'
will save obsseq to
'
,
dir_for_obsseqout
)
os
.
makedirs
(
dir_for_obsseqout
,
exist_ok
=
True
)
os
.
chdir
(
cluster
.
dart_rundir
)
# link DART binaries to run_DART
os
.
system
(
cluster
.
python
+
"
"
+
cluster
.
scripts_rundir
+
"
/link_dart_rttov.py
"
)
# remove any existing observation files
os
.
system
(
"
rm -f input.nml obs_seq.in obs_seq.out obs_seq.out-orig obs_seq.final
"
)
aso
.
set_DART_nml
()
for
time
in
times
:
print
(
'
obsseq for time
'
,
time
)
aso
.
prepare_nature_dart
(
time
)
# link WRF files to DART directory
osq
.
create_obsseqin_alltypes
(
time
,
exp
.
observations
)
# obs_seq.in
aso
.
run_perfect_model_obs
(
nproc
=
6
)
# create observations (obs_seq.out)
oso
=
obsseq
.
ObsSeq
(
cluster
.
dart_rundir
+
"
/obs_seq.out
"
)
if
True
:
# set reflectance < surface albedo to surface albedo
print
(
"
2.2) removing obs below surface albedo
"
)
if_vis_obs
=
oso
.
df
[
'
kind
'
].
values
==
262
if_obs_below_surface_albedo
=
oso
.
df
[
'
observations
'
].
values
<
0.2928
oso
.
df
.
loc
[
if_vis_obs
&
if_obs_below_surface_albedo
,
(
'
observations
'
)]
=
0.2928
oso
.
to_dart
(
f
=
cluster
.
dart_rundir
+
"
/obs_seq.out
"
)
if
getattr
(
exp
,
"
superob_km
"
,
False
):
print
(
"
2.3) superobbing to
"
,
exp
.
superob_km
,
"
km
"
)
oso
.
df
=
oso
.
df
.
superob
(
window_km
=
exp
.
superob_km
)
copy
(
cluster
.
dart_rundir
+
"
/obs_seq.out
"
,
cluster
.
dart_rundir
+
"
/obs_seq.out-orig
"
)
oso
.
to_dart
(
f
=
cluster
.
dart_rundir
+
"
/obs_seq.out
"
)
aso
.
archive_osq_out
(
time
,
dir_obsseq
=
dir_for_obsseqout
)
This diff is collapsed.
Click to expand it.
dartwrf/evaluate_posterior.py
deleted
100755 → 0
+
0
−
27
View file @
e5d9981c
import
os
,
sys
,
shutil
,
warnings
import
time
as
time_module
import
datetime
as
dt
import
numpy
as
np
from
dartwrf.exp_config
import
exp
from
dartwrf.server_config
import
cluster
from
dartwrf
import
assimilate
as
aso
if
__name__
==
"
__main__
"
:
assim_time
=
dt
.
datetime
.
strptime
(
sys
.
argv
[
1
],
"
%Y-%m-%d_%H:%M
"
)
print
(
"
computing posterior observations
"
)
aso
.
write_list_of_inputfiles_posterior
(
assim_time
)
# prepare an obsseq without rejected observations
if
exp
.
use_existing_obsseq
:
# from another exp
oso_input
=
assim_time
.
strftime
(
exp
.
use_existing_obsseq
)
else
:
# from same exp
oso_input
=
cluster
.
archivedir
+
'
/obs_seq_out
'
+
assim_time
.
strftime
(
"
/%Y-%m-%d_%H:%M_obs_seq.out-beforeQC
"
)
if
not
os
.
path
.
isfile
(
oso_input
):
oso_input
=
cluster
.
archivedir
+
'
/obs_seq_out
'
+
assim_time
.
strftime
(
"
/%Y-%m-%d_%H:%M_obs_seq.out
"
)
shutil
.
copy
(
oso_input
,
cluster
.
dart_rundir
+
'
/obs_seq.out
'
)
aso
.
evaluate
(
assim_time
,
output_format
=
"
%Y-%m-%d_%H:%M_obs_seq.final-evaluate
"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
evaluate_plus1.py
deleted
100755 → 0
+
0
−
24
View file @
e5d9981c
#!/usr/bin/python3
"""
Evaluate the forecast in observation space one minute after the analysis time.
"""
import
datetime
as
dt
from
dartwrf.workflows
import
WorkFlows
w
=
WorkFlows
(
exp_config
=
'
exp_nonlin.py
'
,
server_config
=
'
jet.py
'
)
id
=
None
assim_times
=
[
dt
.
datetime
(
2008
,
7
,
30
,
12
),
]
# dt.datetime(2008,7,30,12,30),
# dt.datetime(2008,7,30,13),
# dt.datetime(2008,7,30,13,30),
# dt.datetime(2008,7,30,14),]
# generate observations at +1 minute after the assimilation time
tuples
=
[]
for
init
in
assim_times
:
for
s
in
range
(
30
,
3
*
60
+
1
,
30
):
tuples
.
append
((
init
,
init
+
dt
.
timedelta
(
seconds
=
s
)))
w
.
evaluate_obs_posterior_after_analysis
(
tuples
,
depends_on
=
id
)
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
sign in
to comment