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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefano Serafin
PE_CBL
Commits
d6419d75
Commit
d6419d75
authored
Jul 11, 2024
by
Stefano Serafin
Browse files
Options
Downloads
Patches
Plain Diff
added random perturbations to surface heat flux
parent
e0bbbe51
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
models.py
+8
-2
8 additions, 2 deletions
models.py
with
8 additions
and
2 deletions
models.py
+
8
−
2
View file @
d6419d75
...
...
@@ -240,6 +240,8 @@ class CBL:
z0
=
self
.
z0
theta_0
=
self
.
theta_0
Hmax
=
self
.
Hmax
H0_perturbation_ampl_init
=
self
.
H0_perturbation_ampl_init
H0_perturbation_ampl_time
=
self
.
H0_perturbation_ampl_time
exct
=
self
.
exct
ug
=
self
.
ug
vg
=
self
.
vg
...
...
@@ -311,6 +313,9 @@ class CBL:
else
:
H0
=
Hmax
# Add random perturbations to the initial value
H0
+=
np
.
random
.
normal
(
scale
=
H0_perturbation_ampl_init
)
# Set the surface momentum flux (ustar)
ustar
=
0
...
...
@@ -357,8 +362,9 @@ class CBL:
# Inverse grid spacing
rdz
=
1.
/
self
.
dz
# Compute sensible heat flux and integrate T equation
H
[
0
,
j
]
=
H0
# Add time-dependent surface perturbations
# Then compute sensible heat flux and integrate T equation
H
[
0
,
j
]
=
H0
+
np
.
random
.
normal
(
scale
=
H0_perturbation_ampl_time
)
H
[
1
:
-
1
,
j
]
=
-
K
[
1
:
-
1
,
j
]
*
(
(
thetap
[
1
:]
-
thetap
[:
-
1
])
*
rdz
-
gammac
)
H
[
nz
,
j
]
=
2
*
H
[
nz
-
1
,
j
]
-
H
[
nz
-
2
,
j
]
theta
[:,
j
]
=
thetap
[:]
-
dt
*
rdz
*
(
H
[
1
:,
j
]
-
H
[:
-
1
,
j
])
...
...
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