Skip to content

Commit

Permalink
Use new ClimaParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Feb 13, 2024
1 parent 5d3b8e0 commit 42d1b74
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ KernelAbstractions = "0.9"
Random = "1"
RootSolvers = "0.4"
julia = "1.6"
CLIMAParameters = "0.8"
CLIMAParameters = "0.9"
2 changes: 1 addition & 1 deletion gpuenv/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion perf/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
24 changes: 12 additions & 12 deletions src/config_numerical_method.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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,
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 42d1b74

Please sign in to comment.