Skip to content

Commit

Permalink
Merge #134
Browse files Browse the repository at this point in the history
134: Add internal experimental clima parameters r=charleskawczynski a=charleskawczynski



Co-authored-by: Charles Kawczynski <[email protected]>
  • Loading branch information
bors[bot] and charleskawczynski authored Aug 16, 2021
2 parents 7ed6136 + 617a99f commit 3faaf58
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 7 deletions.
7 changes: 7 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# TurbulenceConvection.jl

```@meta
CurrentModule = TurbulenceConvection
```

```@docs
TurbulenceConvection.ClimaParams
```
1 change: 1 addition & 0 deletions integration_tests/utils/parameter_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function create_parameter_set(namelist)
MSLP = 100000.0, # or grab from, e.g., namelist[""][...]
τ_cond_evap = TC.parse_namelist(namelist, "microphysics", "τ_cond_evap"; default = 10.0),
c_ε = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "entrainment_factor"),
c_div = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "entrainment_massflux_div_factor"; default = 0.0),
α_b = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "pressure_normalmode_buoy_coeff1"),
α_a = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "pressure_normalmode_adv_coeff"),
α_d = TC.parse_namelist(namelist, "turbulence", "EDMF_PrognosticTKE", "pressure_normalmode_drag_coeff"),
Expand Down
21 changes: 21 additions & 0 deletions src/ClimaParams.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
ClimaParams
This is a module for staging experimental
clima parameters-- that we are unsure will
be used in the final model. Once they are
no longer experimental, they should be moved
to CLIMAParameters.jl.
TODO: move non-experimental parameters to CLIMAParameters
"""
module ClimaParams

import CLIMAParameters
const CP = CLIMAParameters
const APS = CP.AbstractEarthParameterSet

""" divergence factor for bubble case (zero otherwise) """
entrainment_massflux_div_factor(ps::APS) = ps.nt.c_div

end
4 changes: 4 additions & 0 deletions src/TurbulenceConvection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ function parse_namelist(namelist, keys...; default = nothing, valid_options = no
return param
end

include("ClimaParams.jl")
import .ClimaParams
const ICP = ClimaParams # internal clima parameters

include("python_primitives.jl")
include("parameters.jl")
include("Grid.jl")
Expand Down
1 change: 0 additions & 1 deletion src/Turbulence_PrognosticTKE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,6 @@ function compute_updraft_closures(self::EDMF_PrognosticTKE, GMV::GridMeanVariabl
w_min,
self.sorting_power,
self.detrainment_factor,
self.entrainment_Mdiv_factor,
self.entrainment_sigma,
self.entrainment_scale,
self.updraft_mixing_frac,
Expand Down
5 changes: 2 additions & 3 deletions src/closures/entr_detr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
w_min,
β,
c_δ,
c_div,
c_μ,
c_μ0,
χ_upd,
Expand All @@ -21,17 +20,17 @@ Cohen et al. (JAMES, 2020), given:
- `w_min`: minimum veritcal velocity
- `β`: sorting power for moist mixing
- `c_δ`: detrainment factor
- `c_div`: divergence factor for bubble case (zero otherwise)
- `c_μ`: logisitc function scale
- `c_μ0`: logisitc function timescale
- `χ_upd`: updraft mixing fraction
- `c_λ`: tke scale factor
- `c_εt`: turbulent entrainment factor
- `εδ_model`: a [`MoistureDeficitEntr`](@ref)
"""
function entr_detr(param_set, w_min, β, c_δ, c_div, c_μ, c_μ0, χ_upd, c_λ, c_εt, εδ_model::MoistureDeficitEntr)
function entr_detr(param_set, w_min, β, c_δ, c_μ, c_μ0, χ_upd, c_λ, c_εt, εδ_model::MoistureDeficitEntr)

c_ε = CPEDMF.c_ε(param_set)
c_div = ICP.entrainment_massflux_div_factor(param_set)

if (εδ_model.q_liq_up + εδ_model.q_liq_en) == 0.0
c_δ = 0.0
Expand Down
3 changes: 0 additions & 3 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ mutable struct EDMF_PrognosticTKE{PS, A1, A2}
extrapolate_buoyancy::Bool
surface_area::Float64
max_area::Float64
entrainment_Mdiv_factor::Float64
updraft_mixing_frac::Float64
entrainment_sigma::Float64
entrainment_smin_tke_coeff::Float64
Expand Down Expand Up @@ -843,7 +842,6 @@ mutable struct EDMF_PrognosticTKE{PS, A1, A2}
max_area = namelist["turbulence"]["EDMF_PrognosticTKE"]["max_area"]
# entrainment parameters
entrainment_factor = namelist["turbulence"]["EDMF_PrognosticTKE"]["entrainment_factor"]
entrainment_Mdiv_factor = namelist["turbulence"]["EDMF_PrognosticTKE"]["entrainment_massflux_div_factor"]
updraft_mixing_frac = namelist["turbulence"]["EDMF_PrognosticTKE"]["updraft_mixing_frac"]
entrainment_sigma = namelist["turbulence"]["EDMF_PrognosticTKE"]["entrainment_sigma"]
entrainment_smin_tke_coeff = namelist["turbulence"]["EDMF_PrognosticTKE"]["entrainment_smin_tke_coeff"]
Expand Down Expand Up @@ -960,7 +958,6 @@ mutable struct EDMF_PrognosticTKE{PS, A1, A2}
extrapolate_buoyancy,
surface_area,
max_area,
entrainment_Mdiv_factor,
updraft_mixing_frac,
entrainment_sigma,
entrainment_smin_tke_coeff,
Expand Down

0 comments on commit 3faaf58

Please sign in to comment.