Skip to content

Commit

Permalink
remove alpha from buoy grad
Browse files Browse the repository at this point in the history
  • Loading branch information
yairchn committed May 19, 2022
1 parent ba29a2b commit 09ded2e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions driver/Cases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ ForcingBase(case::TRMM_LBA, param_set::APS; kwargs...) =
function surface_ref_state(::TRMM_LBA, param_set::APS, namelist)
molmass_ratio = CPP.molmass_ratio(param_set)
Pg = 991.3 * 100 #Pressure at ground
Tg = 296.85 # surface values for reference state (RS) which outputs p rho0 alpha0
Tg = 296.85 # surface values for reference state (RS) which outputs p, ρ
pvg = TD.saturation_vapor_pressure(param_set, Tg, TD.Liquid())
qtg = (1 / molmass_ratio) * pvg / (Pg - pvg) #Total water mixing ratio at surface
return TD.PhaseEquil_pTq(param_set, Pg, Tg, qtg)
Expand Down Expand Up @@ -647,7 +647,7 @@ ForcingBase(case::ARM_SGP, param_set::APS; kwargs...) =

function surface_ref_state(::ARM_SGP, param_set::APS, namelist)
Pg = 970.0 * 100 #Pressure at ground
Tg = 299.0 # surface values for reference state (RS) which outputs p rho0 alpha0
Tg = 299.0 # surface values for reference state (RS) which outputs p, ρ
qtg = 15.2 / 1000 #Total water mixing ratio at surface
return TD.PhaseEquil_pTq(param_set, Pg, Tg, qtg)
end
Expand Down Expand Up @@ -731,7 +731,7 @@ ForcingBase(case::GATE_III, param_set::APS; kwargs...) = ForcingBase(get_forcing

function surface_ref_state(::GATE_III, param_set::APS, namelist)
Pg = 1013.0 * 100 #Pressure at ground
Tg = 299.184 # surface values for reference state (RS) which outputs p rho0 alpha0
Tg = 299.184 # surface values for reference state (RS) which outputs p, ρ
qtg = 16.5 / 1000 #Total water mixing ratio at surface
return TD.PhaseEquil_pTq(param_set, Pg, Tg, qtg)
end
Expand Down Expand Up @@ -1028,7 +1028,7 @@ end
function surface_ref_state(::SP, param_set::APS, namelist)
Pg = 1.0e5 #Pressure at ground
Tg = 300.0 #Temperature at ground
qtg = 1.0e-4 #Total water mixing ratio at TC. if set to 0, alpha0, rho0, p are NaN.
qtg = 1.0e-4 #Total water mixing ratio at TC. if set to 0, p, ρ are NaN.
return TD.PhaseEquil_pTq(param_set, Pg, Tg, qtg)
end

Expand Down
2 changes: 1 addition & 1 deletion src/closures/buoyancy_gradients.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function buoyancy_gradients(
phase_part = TD.PhasePartition(0.0, 0.0, 0.0) # assuming R_d = R_m
Π = TD.exner_given_pressure(param_set, bg_model.p, phase_part)

∂b∂θv = g * (R_d / bg_model.alpha0 / bg_model.p) * Π
∂b∂θv = g * (R_d * bg_model.ρ / bg_model.p) * Π

if bg_model.en_cld_frac > 0.0
ts_sat = thermo_state_pθq(param_set, bg_model.p, bg_model.θ_liq_ice_sat, bg_model.qt_sat)
Expand Down
4 changes: 2 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ Base.@kwdef struct EnvBuoyGrad{FT, EBC <: AbstractEnvBuoyGradClosure}
p::FT
"cloud fraction"
en_cld_frac::FT
"specific volume"
alpha0::FT
"density"
ρ::FT
end
function EnvBuoyGrad(::EBG; t_sat::FT, bg_kwargs...) where {FT <: Real, EBG <: AbstractEnvBuoyGradClosure}
return EnvBuoyGrad{FT, EBG}(; t_sat, bg_kwargs...)
Expand Down
4 changes: 2 additions & 2 deletions src/update_aux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function update_aux!(edmf::EDMFModel, grid::Grid, state::State, surf::SurfaceBas
∂θl∂z_sat = ∂θl∂z[k],
p = p_c[k],
en_cld_frac = aux_en.cloud_fraction[k],
alpha0 = 1 / ρ_c[k],
ρ = ρ_c[k],
)
bg_model = EnvBuoyGrad(edmf.bg_closure; bg_kwargs...)

Expand All @@ -410,7 +410,7 @@ function update_aux!(edmf::EDMFModel, grid::Grid, state::State, surf::SurfaceBas
∂θl∂z_sat = ∂θl∂z_sat[k],
p = p_c[k],
en_cld_frac = aux_en.cloud_fraction[k],
alpha0 = 1 / ρ_c[k],
ρ = ρ_c[k],
)
bg_model = EnvBuoyGrad(edmf.bg_closure; bg_kwargs...)
else
Expand Down

0 comments on commit 09ded2e

Please sign in to comment.