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
32d3b64d
Commit
32d3b64d
authored
4 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
72c783c3
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
scripts/assim_synth_obs.py
+3
-2
3 additions, 2 deletions
scripts/assim_synth_obs.py
scripts/obsseq_to_netcdf.py
+27
-0
27 additions, 0 deletions
scripts/obsseq_to_netcdf.py
scripts/update_wrfinput_from_filteroutput.py
+2
-2
2 additions, 2 deletions
scripts/update_wrfinput_from_filteroutput.py
with
32 additions
and
4 deletions
scripts/assim_synth_obs.py
+
3
−
2
View file @
32d3b64d
...
@@ -303,14 +303,15 @@ if __name__ == "__main__":
...
@@ -303,14 +303,15 @@ if __name__ == "__main__":
Hx_prior
=
obs_operator_ensemble
(
istage
)
# files are already linked to DART directory
Hx_prior
=
obs_operator_ensemble
(
istage
)
# files are already linked to DART directory
obscfg
[
'
err_std
'
]
=
calc_obserr_WV73
(
Hx_nat
,
Hx_prior
)
obscfg
[
'
err_std
'
]
=
calc_obserr_WV73
(
Hx_nat
,
Hx_prior
)
else
:
obscfg
[
'
err_std
'
]
=
np
.
ones
(
n_obs
)
*
obscfg
[
'
err_std
'
]
# fixed stderr
# create obs template file, now with correct errors
# create obs template file, now with correct errors
osq
.
create_obsseq_in
(
time
,
obscfg
,
archive_obs_coords
=
archive_stage
+
'
/obs_coords.pkl
'
)
osq
.
create_obsseq_in
(
time
,
obscfg
,
archive_obs_coords
=
archive_stage
+
'
/obs_coords.pkl
'
)
prepare_nature_dart
(
time
)
# link WRF files to DART directory
prepare_nature_dart
(
time
)
# link WRF files to DART directory
run_perfect_model_obs
()
# actually create observations that are used to assimilate
run_perfect_model_obs
()
# actually create observations that are used to assimilate
#for iens in range(1,41):
# os.system('ncks -A -v Times '+cluster.dartrundir+'/wrfout_d01 '+cluster.dartrundir+'/advance_temp'+str(iens)+'/wrfout_d01')
assimilate
()
assimilate
()
dir_obsseq
=
cluster
.
archivedir
()
+
'
/obs_seq_final/assim_stage
'
+
str
(
istage
)
dir_obsseq
=
cluster
.
archivedir
()
+
'
/obs_seq_final/assim_stage
'
+
str
(
istage
)
archive_diagnostics
(
dir_obsseq
,
time
)
archive_diagnostics
(
dir_obsseq
,
time
)
...
...
This diff is collapsed.
Click to expand it.
scripts/obsseq_to_netcdf.py
0 → 100644
+
27
−
0
View file @
32d3b64d
import
os
,
sys
,
glob
def
listdir_dirs
(
path
):
return
[
a
for
a
in
os
.
listdir
(
path
)
if
os
.
path
.
isdir
(
os
.
path
.
join
(
path
,
a
))]
#sys.path.append('')
from
config.cfg
import
exp
,
cluster
import
run_obs_diag
as
rod
#sys.path.append('/home/fs71386/lkugler/DART-WRF/scripts')
#from obs import read_dartobs as rdo
if
__name__
==
'
__main__
'
:
datadir
=
cluster
.
archive_base
ddir
=
datadir
+
exp
.
expname
+
'
/obs_seq_final/
'
for
dir_name
in
listdir_dirs
(
ddir
):
files
=
sorted
(
glob
.
glob
(
ddir
+
'
/
'
+
dir_name
+
'
/*.final
'
))
#rod.run_obsdiag(files, f_out=ddir+'/obsdiag_'+dir_name+'.nc')
rod
.
run_obs_seq_to_netcdf
(
files
,
f_out
=
ddir
+
'
/obs_epoch-
'
+
dir_name
+
'
.nc
'
)
ddir
=
datadir
+
exp
.
expname
+
'
/obs_seq_final_1min/
'
for
dir_name
in
listdir_dirs
(
ddir
):
files
=
sorted
(
glob
.
glob
(
ddir
+
'
/
'
+
dir_name
+
'
/*.final
'
))
rod
.
run_obs_seq_to_netcdf
(
files
,
f_out
=
ddir
+
'
/obs_epoch-
'
+
dir_name
+
'
.nc
'
)
This diff is collapsed.
Click to expand it.
scripts/update_wrfinput_from_filteroutput.py
+
2
−
2
View file @
32d3b64d
...
@@ -27,11 +27,11 @@ for iens in range(1, exp.n_ens+1):
...
@@ -27,11 +27,11 @@ for iens in range(1, exp.n_ens+1):
wrf_ic
=
cluster
.
wrf_rundir
(
iens
)
+
'
/wrfinput_d01
'
wrf_ic
=
cluster
.
wrf_rundir
(
iens
)
+
'
/wrfinput_d01
'
# cycles variables from wrfout (prior state)
# cycles variables from wrfout (prior state)
print
(
'
copy prior
'
,
prior_wrf
,
'
to wrfinput
'
,
wrf_ic
)
print
(
'
cycle some variables (copy from last init) =>
copy prior
'
,
prior_wrf
,
'
to wrfinput
'
,
wrf_ic
)
# os.system(cluster.ncks+' -A -v '+cycles+' '+prior_wrf+' '+wrf_ic)
# os.system(cluster.ncks+' -A -v '+cycles+' '+prior_wrf+' '+wrf_ic)
copy
(
prior_wrf
,
wrf_ic
)
copy
(
prior_wrf
,
wrf_ic
)
print
(
'
updat
ing
'
,
updates
,
'
in
'
,
wrf_ic
,
'
from
'
,
filter_out
)
print
(
'
updat
e assimilated variables => overwrite
'
,
updates
,
'
in
'
,
wrf_ic
,
'
from
'
,
filter_out
)
os
.
system
(
cluster
.
ncks
+
'
-A -v
'
+
updates
+
'
'
+
filter_out
+
'
'
+
wrf_ic
)
os
.
system
(
cluster
.
ncks
+
'
-A -v
'
+
updates
+
'
'
+
filter_out
+
'
'
+
wrf_ic
)
print
(
'
writing T into THM of wrfinput
'
)
# assumes T = THM (dry potential temperature as prognostic variable)
print
(
'
writing T into THM of wrfinput
'
)
# assumes T = THM (dry potential temperature as prognostic variable)
...
...
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