Skip to content

Commit

Permalink
fix PrecipitatingColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Dec 1, 2023
1 parent 38ee599 commit 931c642
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/initial_conditions/initial_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,8 @@ struct PrecipitatingColumn <: InitialCondition end
prescribed_prof(::Type{FT}, z_mid, z_max, val) where {FT} =
z -> z < z_max ? FT(val) * exp(-(z - FT(z_mid))^2 / 2 / FT(1e3)^2) : FT(0)

function PrecipitatingColumn(params)
FT = eltype(params)
thermo_params = CAP.thermodynamics_params(params)
function PrecipitatingColumn(grav, thermo_params)
FT = eltype(thermo_params)
p_0 = FT(101300.0)
qᵣ = prescribed_prof(FT, 2000, 5000, 1e-6)
qₛ = prescribed_prof(FT, 5000, 8000, 2e-6)
Expand All @@ -918,8 +917,9 @@ function PrecipitatingColumn(params)
TD.PhasePartition(q_tot(z), qₗ(z), qᵢ(z)),
)
return LocalState(;
params,
geometry = local_geometry,
grav,
thermo_params,
thermo_state = ts,
velocity = Geometry.UVVector(u(z), v(z)),
turbconv_state = nothing,
Expand Down
2 changes: 1 addition & 1 deletion src/initial_conditions/local_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function LocalState(;
turbconv_state = nothing,
precip_state = nothing,
)
FT = typeof(grav)
FT = eltype(thermo_params)
return LocalState(
geometry,
grav,
Expand Down
5 changes: 3 additions & 2 deletions src/solver/type_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ function get_initial_condition(parsed_args, params)
ic = getproperty(ICs, Symbol(parsed_args["initial_condition"]))
thermo_params = CAP.thermodynamics_params(params)
grav = CAP.grav(params)
if parsed_args["initial_condition"] in
if parsed_args["initial_condition"] == "PrecipitatingColumn"
return ic(grav, thermo_params)
elseif parsed_args["initial_condition"] in
["DecayingProfile", "MoistAdiabaticProfileEDMFX"]
return ic(grav, thermo_params, parsed_args["perturb_initstate"])
elseif parsed_args["initial_condition"] in
Expand All @@ -326,7 +328,6 @@ function get_initial_condition(parsed_args, params)
"DYCOMS_RF02",
"Rico",
"TRMM_LBA",
"PrecipitatingColumn",
]
return ic(grav, thermo_params, parsed_args["prognostic_tke"])
elseif parsed_args["initial_condition"] in [
Expand Down

0 comments on commit 931c642

Please sign in to comment.