Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CTDAS
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
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NearRealTimeCTDAS
CTDAS
Commits
7b4208fa
Commit
7b4208fa
authored
12 years ago
by
Peters, Wouter
Browse files
Options
Downloads
Patches
Plain Diff
update of names of io functions, and input filename
parent
ebc4b4e2
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
da/analysis/expand_mixingratios.py
+13
-14
13 additions, 14 deletions
da/analysis/expand_mixingratios.py
with
13 additions
and
14 deletions
da/analysis/expand_mixingratios.py
+
13
−
14
View file @
7b4208fa
...
...
@@ -56,9 +56,9 @@ def write_mixing_ratios(dacycle):
# Step (1): Get the posterior sample output data file for this cycle
infile
=
os
.
path
.
join
(
dacycle
[
'
dir.output
'
],
'
sampleinfo_%s
__newstyle
.nc
'
%
dacycle
[
'
time.sample.stamp
'
])
infile
=
os
.
path
.
join
(
dacycle
[
'
dir.output
'
],
'
sampleinfo_%s.nc
'
%
dacycle
[
'
time.sample.stamp
'
])
ncf_in
=
io
.
CT_R
ead
(
infile
,
'
read
'
)
ncf_in
=
io
.
ct_r
ead
(
infile
,
'
read
'
)
obs_num
=
ncf_in
.
get_variable
(
'
obs_num
'
)
obs_val
=
ncf_in
.
get_variable
(
'
observed
'
)
...
...
@@ -81,7 +81,7 @@ def write_mixing_ratios(dacycle):
if
optimized_present
:
ncf_fc_in
=
io
.
CT_R
ead
(
infile
,
'
read
'
)
ncf_fc_in
=
io
.
ct_r
ead
(
infile
,
'
read
'
)
fc_obs_num
=
ncf_fc_in
.
get_variable
(
'
obspack_num
'
)
fc_obs_val
=
ncf_fc_in
.
get_variable
(
'
observed
'
)
...
...
@@ -173,7 +173,7 @@ def write_mixing_ratios(dacycle):
savedict
[
'
units
'
]
=
"
None
"
savedict
[
'
dims
'
]
=
dimid
savedict
[
'
comment
'
]
=
'
Flag (0/1/2/99) for observation value, 0 means okay, 1 means QC error, 2 means rejected, 99 means not sampled
'
ncf_out
.
A
dd
V
ariable
(
savedict
)
ncf_out
.
a
dd
_v
ariable
(
savedict
)
savedict
=
io
.
std_savedict
.
copy
()
savedict
[
'
name
'
]
=
"
modeldatamismatch
"
...
...
@@ -181,7 +181,7 @@ def write_mixing_ratios(dacycle):
savedict
[
'
units
'
]
=
"
[mol mol-1]^2
"
savedict
[
'
dims
'
]
=
dimid
savedict
[
'
comment
'
]
=
'
Variance of mole fractions resulting from model-data mismatch
'
ncf_out
.
A
dd
V
ariable
(
savedict
)
ncf_out
.
a
dd
_v
ariable
(
savedict
)
savedict
=
io
.
std_savedict
.
copy
()
savedict
[
'
name
'
]
=
"
totalmolefractionvariance_forecast
"
...
...
@@ -189,7 +189,7 @@ def write_mixing_ratios(dacycle):
savedict
[
'
units
'
]
=
"
[mol mol-1]^2
"
savedict
[
'
dims
'
]
=
dimid
savedict
[
'
comment
'
]
=
'
Variance of mole fractions resulting from prior state and model-data mismatch
'
ncf_out
.
A
dd
V
ariable
(
savedict
)
ncf_out
.
a
dd
_v
ariable
(
savedict
)
savedict
=
io
.
std_savedict
.
copy
()
savedict
[
'
name
'
]
=
"
modelsamplesmean
"
...
...
@@ -197,7 +197,7 @@ def write_mixing_ratios(dacycle):
savedict
[
'
units
'
]
=
"
mol mol-1
"
savedict
[
'
dims
'
]
=
dimid
savedict
[
'
comment
'
]
=
'
simulated mixing ratios based on optimized state vector
'
ncf_out
.
A
dd
V
ariable
(
savedict
)
ncf_out
.
a
dd
_v
ariable
(
savedict
)
savedict
=
io
.
std_savedict
.
copy
()
savedict
[
'
name
'
]
=
"
modelsamplesmean_forecast
"
...
...
@@ -205,7 +205,7 @@ def write_mixing_ratios(dacycle):
savedict
[
'
units
'
]
=
"
mol mol-1
"
savedict
[
'
dims
'
]
=
dimid
savedict
[
'
comment
'
]
=
'
simulated mixing ratios based on prior state vector
'
ncf_out
.
A
dd
V
ariable
(
savedict
)
ncf_out
.
a
dd
_v
ariable
(
savedict
)
savedict
=
io
.
std_savedict
.
copy
()
savedict
[
'
name
'
]
=
"
modelsamplesstandarddeviation
"
...
...
@@ -213,7 +213,7 @@ def write_mixing_ratios(dacycle):
savedict
[
'
units
'
]
=
"
mol mol-1
"
savedict
[
'
dims
'
]
=
dimid
savedict
[
'
comment
'
]
=
'
std dev of simulated mixing ratios based on optimized state vector
'
ncf_out
.
A
dd
V
ariable
(
savedict
)
ncf_out
.
a
dd
_v
ariable
(
savedict
)
savedict
=
io
.
std_savedict
.
copy
()
savedict
[
'
name
'
]
=
"
modelsamplesstandarddeviation_forecast
"
...
...
@@ -221,7 +221,7 @@ def write_mixing_ratios(dacycle):
savedict
[
'
units
'
]
=
"
mol mol-1
"
savedict
[
'
dims
'
]
=
dimid
savedict
[
'
comment
'
]
=
'
std dev of simulated mixing ratios based on prior state vector
'
ncf_out
.
A
dd
V
ariable
(
savedict
)
ncf_out
.
a
dd
_v
ariable
(
savedict
)
savedict
=
io
.
std_savedict
.
copy
()
savedict
[
'
name
'
]
=
"
modelsamplesensemble
"
...
...
@@ -229,7 +229,7 @@ def write_mixing_ratios(dacycle):
savedict
[
'
units
'
]
=
"
mol mol-1
"
savedict
[
'
dims
'
]
=
dimid
+
dimmembers
savedict
[
'
comment
'
]
=
'
ensemble of simulated mixing ratios based on optimized state vector
'
ncf_out
.
A
dd
V
ariable
(
savedict
)
ncf_out
.
a
dd
_v
ariable
(
savedict
)
savedict
=
io
.
std_savedict
.
copy
()
savedict
[
'
name
'
]
=
"
modelsamplesensemble_forecast
"
...
...
@@ -237,7 +237,7 @@ def write_mixing_ratios(dacycle):
savedict
[
'
units
'
]
=
"
mol mol-1
"
savedict
[
'
dims
'
]
=
dimid
+
dimmembers
savedict
[
'
comment
'
]
=
'
ensemble of simulated mixing ratios based on prior state vector
'
ncf_out
.
A
dd
V
ariable
(
savedict
)
ncf_out
.
a
dd
_v
ariable
(
savedict
)
else
:
logging
.
debug
(
"
Modifying existing file (%s) in the analysis directory
"
%
copy_file
)
...
...
@@ -327,8 +327,7 @@ if __name__ == "__main__":
dacycle
.
initialize
()
dacycle
.
parse_times
()
dasystem
=
CO2DaSystem
(
'
../rc/carbontracker_ct09_opf.rc
'
)
dasystem
.
initialize
()
dasystem
=
CO2DaSystem
(
'
../rc/carbontracker_ct09_opfnew.rc
'
)
dacycle
.
dasystem
=
dasystem
...
...
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