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
Container registry
Model registry
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
CTDAS
CTDAS
Commits
e5716b9a
Commit
e5716b9a
authored
6 years ago
by
brunner
Browse files
Options
Downloads
Patches
Plain Diff
lambdas are not 0
parent
a081bb37
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
da/cosmo/base_optimizer.py
+13
-1
13 additions, 1 deletion
da/cosmo/base_optimizer.py
da/cosmo/pipeline.py
+1
-1
1 addition, 1 deletion
da/cosmo/pipeline.py
da/cosmo/statevector_read_from_output.py
+3
-4
3 additions, 4 deletions
da/cosmo/statevector_read_from_output.py
octe.rc
+1
-1
1 addition, 1 deletion
octe.rc
with
18 additions
and
7 deletions
da/cosmo/base_optimizer.py
+
13
−
1
View file @
e5716b9a
...
@@ -347,11 +347,23 @@ class Optimizer(object):
...
@@ -347,11 +347,23 @@ class Optimizer(object):
alpha
=
np
.
double
(
1.0
)
/
(
np
.
double
(
1.0
)
+
np
.
sqrt
((
self
.
R
[
n
])
/
self
.
HPHR
[
n
]))
alpha
=
np
.
double
(
1.0
)
/
(
np
.
double
(
1.0
)
+
np
.
sqrt
((
self
.
R
[
n
])
/
self
.
HPHR
[
n
]))
# if all(self.x[:] + self.KG[:] * res >= 0.):
self
.
x
[:]
=
self
.
x
+
self
.
KG
[:]
*
res
self
.
x
[:]
=
self
.
x
+
self
.
KG
[:]
*
res
self
.
x
[
self
.
x
<
0.
]
=
0.
# cut off negative values, COSMO don't like negative fluxes # pavle
self
.
x
[
self
.
x
<
0.
]
=
0.
# cut off negative values, COSMO don't like negative fluxes # pavle
for
r
in
range
(
self
.
nmembers
):
for
r
in
range
(
self
.
nmembers
):
self
.
X_prime
[:,
r
]
=
self
.
X_prime
[:,
r
]
-
alpha
*
self
.
KG
[:]
*
(
self
.
HX_prime
[
n
,
r
])
X_prime_temp
=
self
.
X_prime
[:,
r
]
-
alpha
*
self
.
KG
[:]
*
(
self
.
HX_prime
[
n
,
r
])
X_prime_temp
[
X_prime_temp
+
self
.
x
<
0.
]
=
0.
# if all(self.X_prime[:, r] - alpha * self.KG[:] * (self.HX_prime[n, r]) + self.x[:] >= 0.):
self
.
X_prime
[:,
r
]
=
X_prime_temp
#self.X_prime[:, r] = self.X_prime[:, r] - alpha * self.KG[:] * (self.HX_prime[n, r])
# continue
# else:
# self.X_prime[:, r] = self.X_prime[:, r] - alpha * self.KG[:] * (self.HX_prime[n, r])
# for p in range(self.nparams):
# if self.X_prime[p, r]+self.x[p]<0.:
# self.X_prime[p, r]=0.
#WP !!!! Very important to first do all obervations from n=1 through the end, and only then update 1,...,n. The current observation
#WP !!!! Very important to first do all obervations from n=1 through the end, and only then update 1,...,n. The current observation
#WP should always be updated last because it features in the loop of the adjustments !!!!
#WP should always be updated last because it features in the loop of the adjustments !!!!
...
...
This diff is collapsed.
Click to expand it.
da/cosmo/pipeline.py
+
1
−
1
View file @
e5716b9a
...
@@ -266,7 +266,7 @@ def prepare_state(dacycle, statevector):
...
@@ -266,7 +266,7 @@ def prepare_state(dacycle, statevector):
current_sv
=
os
.
path
.
join
(
dacycle
[
'
dir.restart
'
],
'
savestate_%s.nc
'
%
dacycle
[
'
time.start
'
].
strftime
(
'
%Y%m%d
'
))
current_sv
=
os
.
path
.
join
(
dacycle
[
'
dir.restart
'
],
'
savestate_%s.nc
'
%
dacycle
[
'
time.start
'
].
strftime
(
'
%Y%m%d
'
))
statevector
.
write_to_file
(
current_sv
,
'
prior
'
)
# write prior info
statevector
.
write_to_file
(
current_sv
,
'
prior
'
)
# write prior info
nlag
=
int
(
dacycle
[
'
time.nlag
'
])
#
nlag = int(dacycle['time.nlag'])
# for l in range(0,nlag): # pavle added from here
# for l in range(0,nlag): # pavle added from here
## statevector.write_members_to_file(l, dacycle['restartmap.dir'])
## statevector.write_members_to_file(l, dacycle['restartmap.dir'])
# statevector.write_members_for_cosmo(l, dacycle['restartmap.dir'])
# statevector.write_members_for_cosmo(l, dacycle['restartmap.dir'])
...
...
This diff is collapsed.
Click to expand it.
da/cosmo/statevector_read_from_output.py
+
3
−
4
View file @
e5716b9a
...
@@ -290,8 +290,7 @@ class StateVector(object):
...
@@ -290,8 +290,7 @@ class StateVector(object):
newmember
.
param_values
=
newmean
.
flatten
()
# no deviations
newmember
.
param_values
=
newmean
.
flatten
()
# no deviations
self
.
ensemble_members
[
lag
].
append
(
newmember
)
self
.
ensemble_members
[
lag
].
append
(
newmember
)
# ifile = Dataset('/scratch/snx3000/parsenov/40_9reg/bckp/output/20130401/lambda.nc', mode='r')
ifile
=
Dataset
(
'
/scratch/snx3000/parsenov/octe/optimizer.20130401.nc
'
,
mode
=
'
r
'
)
ifile
=
Dataset
(
'
/scratch/snx3000/parsenov/9reg/optimizer.20130401.nc
'
,
mode
=
'
r
'
)
# par = ifile.variables['lambda'][:]
# par = ifile.variables['lambda'][:]
par
=
ifile
.
variables
[
'
statevectordeviations_prior
'
][:]
par
=
ifile
.
variables
[
'
statevectordeviations_prior
'
][:]
par
=
par
.
reshape
(
181
,
2
,
21
)
par
=
par
.
reshape
(
181
,
2
,
21
)
...
@@ -313,8 +312,8 @@ class StateVector(object):
...
@@ -313,8 +312,8 @@ class StateVector(object):
# newmember.param_values[newmember.param_values>2.] = 2.
# newmember.param_values[newmember.param_values>2.] = 2.
newmember
.
param_values
=
par
[:,
lag
,
member
]
newmember
.
param_values
=
par
[:,
lag
,
member
]
# newmember.param_values = par[lag, member, :]
# newmember.param_values = par[lag, member, :]
if
member
==
1
:
#
if member==1:
print
(
par
[:,
lag
,
member
])
#
print(par[:, lag, member])
self
.
ensemble_members
[
lag
].
append
(
newmember
)
self
.
ensemble_members
[
lag
].
append
(
newmember
)
logging
.
debug
(
'
%d new ensemble members were added to the state vector # %d
'
%
(
self
.
nmembers
,
(
lag
+
1
)))
logging
.
debug
(
'
%d new ensemble members were added to the state vector # %d
'
%
(
self
.
nmembers
,
(
lag
+
1
)))
...
...
This diff is collapsed.
Click to expand it.
octe.rc
+
1
−
1
View file @
e5716b9a
...
@@ -38,7 +38,7 @@ abs.time.start : 2013-04-01 00:00:00
...
@@ -38,7 +38,7 @@ 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
! 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 : F
da.restart.tstamp : 2013-0
1
-01 00:00:00
da.restart.tstamp : 2013-0
4
-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
! 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
...
...
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