Skip to content

Commit

Permalink
Test overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Aug 31, 2023
1 parent d4cc64c commit d1d50ee
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 19 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
31 changes: 13 additions & 18 deletions src/parameters/create_parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ function create_climaatmos_parameter_set(
aliases = setdiff(aliases, ["thermo_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}(;
pairs...,
thermo_params,
Expand Down Expand Up @@ -148,26 +153,16 @@ 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 = (; MSLP = 100000.0, τ_precip = dt)
create_climaatmos_parameter_set(toml_dict, parsed_args, overrides)
overrides = (; MSLP = 100000.0)
println("CASE OVERRIDES")
if CA.is_column_edmf(parsed_args)
println("COLUMN EDMF")
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,
MSLP = 1.0e5,
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)
println("NOT COLUMN")
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 d1d50ee

Please sign in to comment.