From 9ffa61ccfa7416391159e29b23f0d71cb2b39f06 Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Fri, 13 Dec 2024 15:30:38 -0800 Subject: [PATCH] Remove water_params from params, format --- src/parameters/Parameters.jl | 7 +----- src/parameters/create_parameters.jl | 33 +++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/parameters/Parameters.jl b/src/parameters/Parameters.jl index a1bb42b596c..d7c6b922bea 100644 --- a/src/parameters/Parameters.jl +++ b/src/parameters/Parameters.jl @@ -77,8 +77,7 @@ Base.@kwdef struct ClimaAtmosParameters{ insolation_params::IP microphysics_cloud_params::MPC microphysics_0m_params::MP0M - microphysics_1m_params:: MP1M - water_params::WP + microphysics_1m_params::MP1M surface_fluxes_params::SFP turbconv_params::TCP surface_temp_params::STP @@ -130,10 +129,6 @@ for var in [:molmass_ratio, :R_d, :R_v, :e_int_v0, :cp_d, :cv_v, :cv_l, :cv_d] @eval $var(ps::ACAP) = TD.Parameters.$var(thermodynamics_params(ps)) end -# Forwarding CloudMicrophysics parameters -ρ_cloud_liq(ps::ACAP) = ps.water_params.ρw -ρ_cloud_ice(ps::ACAP) = ps.water_params.ρi - # Forwarding SurfaceFluxes parameters von_karman_const(ps::ACAP) = SF.Parameters.von_karman_const(surface_fluxes_params(ps)) diff --git a/src/parameters/create_parameters.jl b/src/parameters/create_parameters.jl index dccd14a84d7..847b72a703e 100644 --- a/src/parameters/create_parameters.jl +++ b/src/parameters/create_parameters.jl @@ -8,15 +8,21 @@ import CloudMicrophysics as CM import StaticArrays as SA function ClimaAtmosParameters(config::AtmosConfig) - (;toml_dict, parsed_args ) = config + (; toml_dict, parsed_args) = config FT = CP.float_type(toml_dict) - return ClimaAtmosParameters(toml_dict, FT(CA.time_to_seconds(parsed_args["dt"]))) + return ClimaAtmosParameters( + toml_dict, + FT(CA.time_to_seconds(parsed_args["dt"])), + ) end -ClimaAtmosParameters(::Type{FT}, dt = nothing) where {FT} = +ClimaAtmosParameters(::Type{FT}, dt = nothing) where {FT} = ClimaAtmosParameters(CP.create_toml_dict(FT), dt) -function ClimaAtmosParameters(toml_dict::TD, dt = nothing) where {TD<:CP.AbstractTOMLDict} +function ClimaAtmosParameters( + toml_dict::TD, + dt = nothing, +) where {TD <: CP.AbstractTOMLDict} if !isnothing(dt) toml_dict["precipitation_timescale"]["value"] = dt end @@ -34,9 +40,6 @@ function ClimaAtmosParameters(toml_dict::TD, dt = nothing) where {TD<:CP.Abstrac insolation_params = InsolationParameters(toml_dict) IP = typeof(insolation_params) - water_params = CM.Parameters.WaterProperties(toml_dict) - WP = typeof(water_params) - surface_fluxes_params = SF.Parameters.SurfaceFluxesParameters(toml_dict, UF.BusingerParams) SFP = typeof(surface_fluxes_params) @@ -57,7 +60,20 @@ function ClimaAtmosParameters(toml_dict::TD, dt = nothing) where {TD<:CP.Abstrac parameters = CP.get_parameter_values(toml_dict, atmos_name_map, "ClimaAtmos") - return CAP.ClimaAtmosParameters{FT, TP, RP, IP, MPC, MP0M, MP1M, WP, SFP, TCP, STP, VDP}(; + return CAP.ClimaAtmosParameters{ + FT, + TP, + RP, + IP, + MPC, + MP0M, + MP1M, + WP, + SFP, + TCP, + STP, + VDP, + }(; parameters..., thermodynamics_params, rrtmgp_params, @@ -65,7 +81,6 @@ function ClimaAtmosParameters(toml_dict::TD, dt = nothing) where {TD<:CP.Abstrac microphysics_cloud_params, microphysics_0m_params, microphysics_1m_params, - water_params, surface_fluxes_params, turbconv_params, surface_temp_params,