diff --git a/Project.toml b/Project.toml index b41bfcf9..54b6e3a5 100644 --- a/Project.toml +++ b/Project.toml @@ -23,4 +23,4 @@ KernelAbstractions = "0.9" Random = "1" RootSolvers = "0.4" julia = "1.6" -CLIMAParameters = "0.8" +CLIMAParameters = "0.9" diff --git a/ext/CreateParametersExt.jl b/ext/CreateParametersExt.jl index 38b05024..d1405531 100644 --- a/ext/CreateParametersExt.jl +++ b/ext/CreateParametersExt.jl @@ -29,6 +29,7 @@ function ThermodynamicsParameters(toml_dict::CP.AbstractTOMLDict) :isobaric_specific_heat_liquid => :cp_l, :latent_heat_vaporization_at_reference => :LH_v0, :temperature_saturation_adjustment_min => :T_min, + :temperature_saturation_adjustment_init_min => :T_init_min, :gas_constant => :gas_constant, :temperature_mean_at_reference => :T_surf_ref, :gravitational_acceleration => :grav, diff --git a/gpuenv/Project.toml b/gpuenv/Project.toml index 9523d868..6ba34545 100644 --- a/gpuenv/Project.toml +++ b/gpuenv/Project.toml @@ -10,7 +10,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c" [compat] -CLIMAParameters = "0.8" +CLIMAParameters = "0.9" CUDA = "3.5, 4, 5" KernelAbstractions = "0.9" RootSolvers = "0.4" diff --git a/perf/Project.toml b/perf/Project.toml index f873269e..dbec6373 100644 --- a/perf/Project.toml +++ b/perf/Project.toml @@ -15,7 +15,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c" [compat] -CLIMAParameters = "0.8" +CLIMAParameters = "0.9" KernelAbstractions = "0.9" RootSolvers = "0.4" julia = "1.7" diff --git a/src/Parameters.jl b/src/Parameters.jl index 19b871bf..86c053d7 100644 --- a/src/Parameters.jl +++ b/src/Parameters.jl @@ -35,6 +35,7 @@ Base.@kwdef struct ThermodynamicsParameters{FT} T_freeze::FT T_min::FT T_max::FT + T_init_min::FT entropy_reference_temperature::FT entropy_dry_air::FT entropy_water_vapor::FT diff --git a/src/config_numerical_method.jl b/src/config_numerical_method.jl index 370ffce2..b9ba41e7 100644 --- a/src/config_numerical_method.jl +++ b/src/config_numerical_method.jl @@ -55,7 +55,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.NewtonsMethod, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) T_init = if T_guess isa Nothing max(T_min, air_temperature(param_set, e_int, PhasePartition(q_tot))) # Assume all vapor else @@ -73,7 +73,7 @@ end ::Type{phase_type}, T_guess::FT, ) where {FT, NM <: RS.NewtonsMethodAD, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) T_init = if T_guess isa Nothing max(T_min, air_temperature(param_set, e_int, PhasePartition(q_tot))) # Assume all vapor else @@ -91,7 +91,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.SecantMethod, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) q_pt = PhasePartition(q_tot, FT(0), q_tot) # Assume all ice T_2 = air_temperature(param_set, e_int, q_pt) T_1 = max(T_min, air_temperature(param_set, e_int, PhasePartition(q_tot))) # Assume all vapor @@ -108,7 +108,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.RegulaFalsiMethod, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) q_pt = PhasePartition(q_tot, FT(0), q_tot) # Assume all ice T_2 = air_temperature(param_set, e_int, q_pt) T_1 = max(T_min, air_temperature(param_set, e_int, PhasePartition(q_tot))) # Assume all vapor @@ -166,7 +166,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.NewtonsMethodAD, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) T_init = if T_guess isa Nothing max(T_min, air_temperature(param_set, e_int, PhasePartition(q_tot))) # Assume all vapor else @@ -184,7 +184,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.SecantMethod, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) q_pt = PhasePartition(q_tot, FT(0), q_tot) # Assume all ice T_2 = air_temperature(param_set, e_int, q_pt) T_1 = max(T_min, air_temperature(param_set, e_int, PhasePartition(q_tot))) # Assume all vapor @@ -205,7 +205,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.NewtonsMethodAD, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) T_init = if T_guess isa Nothing # Assume all vapor max( T_min, @@ -226,7 +226,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.SecantMethod, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) q_pt = PhasePartition(q_tot, FT(0), q_tot) # Assume all ice T_2 = air_temperature_from_enthalpy(param_set, h, q_pt) T_1 = max( @@ -246,7 +246,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.RegulaFalsiMethod, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) q_pt = PhasePartition(q_tot, FT(0), q_tot) # Assume all ice T_2 = air_temperature_from_enthalpy(param_set, h, q_pt) T_1 = max( @@ -270,7 +270,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.RegulaFalsiMethod, phase_type <: PhaseEquil} - _T_min = TP.T_min(param_set) + _T_min = TP.T_init_min(param_set) _T_max = TP.T_max(param_set) @inline air_temp(q) = air_temperature_given_pθq(param_set, p, θ_liq_ice, q) T_1 = max(_T_min, air_temp(PhasePartition(q_tot))) # Assume all vapor @@ -288,7 +288,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.SecantMethod, phase_type <: PhaseEquil} - _T_min = TP.T_min(param_set) + _T_min = TP.T_init_min(param_set) @inline air_temp(q) = air_temperature_given_pθq(param_set, p, θ_liq_ice, q) T_1 = max(_T_min, air_temp(PhasePartition(q_tot))) # Assume all vapor T_2 = air_temp(PhasePartition(q_tot, FT(0), q_tot)) # Assume all ice @@ -305,7 +305,7 @@ end ::Type{phase_type}, T_guess::Union{FT, Nothing}, ) where {FT, NM <: RS.NewtonsMethodAD, phase_type <: PhaseEquil} - T_min = TP.T_min(param_set) + T_min = TP.T_init_min(param_set) @inline air_temp(q) = air_temperature_given_pθq(param_set, p, θ_liq_ice, q) T_init = if T_guess isa Nothing max(T_min, air_temp(PhasePartition(q_tot))) # Assume all vapor diff --git a/test/Project.toml b/test/Project.toml index d889c0f3..cb6dbcdd 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -18,7 +18,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c" [compat] -CLIMAParameters = "0.8" +CLIMAParameters = "0.9" KernelAbstractions = "0.9" RootSolvers = "0.4" julia = "1.7"