Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PE_CBL
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefano Serafin
PE_CBL
Commits
a2b65a22
Commit
a2b65a22
authored
2 weeks ago
by
Stefano Serafin
Browse files
Options
Downloads
Patches
Plain Diff
bug fix in BouLac scheme (parcel energy computation)
parent
fb0f3616
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
PE_CBL_models.py
+2
-11
2 additions, 11 deletions
PE_CBL_models.py
with
2 additions
and
11 deletions
PE_CBL_models.py
+
2
−
11
View file @
a2b65a22
...
@@ -899,7 +899,7 @@ class CBL:
...
@@ -899,7 +899,7 @@ class CBL:
lup
[
k
]
=
0
lup
[
k
]
=
0
# Compute vertical profile of energy perturbations for lifted parcels (from the current level up)
# Compute vertical profile of energy perturbations for lifted parcels (from the current level up)
energy_profile_upwards
=
g
/
theta_0
*
(
(
theta
[
k
+
1
:]
+
theta
[
k
:
-
1
])
*
0.5
-
theta
[
k
]
)
*
(
zf
[
k
+
1
:]
-
zf
[
k
:
-
1
])
-
tke
[
k
]
energy_profile_upwards
=
g
/
theta_0
*
np
.
cumsum
(
(
(
theta
[
k
+
1
:]
+
theta
[
k
:
-
1
])
*
0.5
-
theta
[
k
]
)
*
(
zf
[
k
+
1
:]
-
zf
[
k
:
-
1
])
)
-
tke
[
k
]
# Track the level at which the energy perturbation profile changes sign
# Track the level at which the energy perturbation profile changes sign
# from negative (below) to positive (above)
# from negative (below) to positive (above)
...
@@ -918,7 +918,7 @@ class CBL:
...
@@ -918,7 +918,7 @@ class CBL:
ldown
[
k
]
=
0
ldown
[
k
]
=
0
# Compute vertical profile of energy perturbations for sinking parcels (from the current level down)
# Compute vertical profile of energy perturbations for sinking parcels (from the current level down)
energy_profile_downwards
=
g
/
theta_0
*
(
(
theta
[:
k
]
+
theta
[
1
:
k
+
1
])
*
0.5
-
theta
[
k
]
)
*
(
zf
[:
k
]
-
zf
[
1
:
k
+
1
])
-
tke
[
k
]
energy_profile_downwards
=
g
/
theta_0
*
np
.
cumsum
(
(
(
theta
[:
k
]
+
theta
[
1
:
k
+
1
])
*
0.5
-
theta
[
k
]
)
*
(
zf
[:
k
]
-
zf
[
1
:
k
+
1
])
)
-
tke
[
k
]
# Track the lowermost level at which the energy perturbation profile
# Track the lowermost level at which the energy perturbation profile
# is negative (in a stable atmosphere, it's always positive).
# is negative (in a stable atmosphere, it's always positive).
...
@@ -1107,7 +1107,6 @@ class CBL:
...
@@ -1107,7 +1107,6 @@ class CBL:
# Determine the countergradient correction
# Determine the countergradient correction
# According to Deardorff 1972 and Therry-Lacarrere 1982 (Eq. 41)
# According to Deardorff 1972 and Therry-Lacarrere 1982 (Eq. 41)
is_cgrad
=
True
if
is_cgrad
:
if
is_cgrad
:
tstar
=
H0
/
wstar
tstar
=
H0
/
wstar
is_pbl
=
zf
<
h
[
j
]
is_pbl
=
zf
<
h
[
j
]
...
@@ -1204,14 +1203,6 @@ class CBL:
...
@@ -1204,14 +1203,6 @@ class CBL:
up
=
u
[:,
j
]
up
=
u
[:,
j
]
vp
=
v
[:,
j
]
vp
=
v
[:,
j
]
"""
print(thetap)
print(tkep)
if is_bwind:
print(up)
print(vp)
"""
# Form state vector
# Form state vector
xb
[:
nz
]
=
theta
[:,
-
1
]
xb
[:
nz
]
=
theta
[:,
-
1
]
if
is_bwind
:
if
is_bwind
:
...
...
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