Skip to content

Commit

Permalink
Test overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Sep 7, 2023
1 parent b0d14a2 commit 4946cfb
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 15 deletions.
3 changes: 3 additions & 0 deletions config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,6 @@ prognostic_tke:
prognostic_surface:
help: "Determines if surface temperature is prognostic [`false` (default), , `true`, `PrognosticSurfaceTemperature`, `PrescribedSurfaceTemperature`]"
value: "false"
override_τ_precip:
help: "If true, sets τ_precip to dt. Otherwise, τ_precip is set to the value in the toml dictionary"
value: true
2 changes: 1 addition & 1 deletion docs/src/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ debugging_tc: true
surface_setup: Bomex
turbconv_case: Bomex
t_end: 6hours
turbconv: "edmf"
turbconv: edmf
z_stretch: false
config: column
subsidence: Bomex
Expand Down
23 changes: 9 additions & 14 deletions src/parameters/create_parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ function create_climaatmos_parameter_set(
aliases = setdiff(aliases, ["modal_nuc_params"])
pairs = CP.get_parameter_values!(toml_dict, aliases, "CloudMicrophysics")
pairs = override_climaatmos_defaults((; pairs...), overrides)
# temporary fix for τ_precip
if parsed_args["override_τ_precip"]
pairs = (; pairs..., τ_precip = FT(CA.time_to_seconds(parsed_args["dt"]))
)
end
microphys_params = CM.Parameters.CloudMicrophysicsParameters{FTD, TP, MNP}(;
pairs...,
thermo_params,
Expand Down Expand Up @@ -157,25 +162,15 @@ end
# TODO: unify these parameters and refactor this method.
function create_parameter_set(config::AtmosConfig)
(; toml_dict, parsed_args) = config
FT = eltype(config)
dt = FT(CA.time_to_seconds(parsed_args["dt"]))

return if CA.is_column_edmf(parsed_args)
overrides = (; τ_precip = dt)
println("COLUMN EDMF")
create_climaatmos_parameter_set(toml_dict, parsed_args, overrides)
elseif CA.is_column_without_edmf(parsed_args)
overrides = (; τ_precip = dt)
create_climaatmos_parameter_set(toml_dict, parsed_args, overrides)
println("COLUMN WITHOUT EDMF")
else
overrides = (;
R_d = 287.0,
grav = 9.80616,
Omega = 7.29212e-5,
planet_radius = 6.371229e6,
ρ_cloud_liq = 1e3,
τ_precip = dt,
qc_0 = 5e-6, # criterion for removal after supersaturation
)
create_climaatmos_parameter_set(toml_dict, parsed_args, overrides)
end

return create_climaatmos_parameter_set(toml_dict, parsed_args, overrides)
end
4 changes: 4 additions & 0 deletions toml/column_edmf.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[mean_sea_level_pressure]
alias = "MSLP"
value = 1.0e5
type = "float"
35 changes: 35 additions & 0 deletions toml/non_column.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[R_d]
alias = "R_d"
value = 287.0
type = "float"

[MSLP]
alias = "MSLP"
value = 1.0e5
type = "float"

[grav]
alias = "grav"
value = 9.80616
type = "float"

[Omega]
alias = "Omega"
value = 7.29212e-5
type = "float"

[planet_radius]
alias = "planet_radius"
value = 6.371229e6
type = "float"

[ρ_cloud_liq]
alias = "ρ_cloud_liq"
value = 1e3
type = "float"

[qc_0]
alias = "qc_0"
value = 5e-6
type = "float"

0 comments on commit 4946cfb

Please sign in to comment.