From bd43d1ef6b9627a8a7fbfb4ddd0ec639410f674e Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Tue, 30 Aug 2022 08:48:47 -0700 Subject: [PATCH 1/2] Set thermo state iteration params --- examples/hybrid/thermo_state.jl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/hybrid/thermo_state.jl b/examples/hybrid/thermo_state.jl index df913ac6a4..dff1dedba7 100644 --- a/examples/hybrid/thermo_state.jl +++ b/examples/hybrid/thermo_state.jl @@ -101,8 +101,15 @@ function thermo_state_ρθ!(ts, Yc, thermo_params, ::DryModel) @. ts = TD.PhaseDry_ρθ(thermo_params, Yc.ρ, Yc.ρθ / Yc.ρ) end function thermo_state_ρθ!(ts, Yc, thermo_params, ::EquilMoistModel) - @. ts = - TD.PhaseEquil_ρθq(thermo_params, Yc.ρ, Yc.ρθ / Yc.ρ, Yc.ρq_tot / Yc.ρ) + FT = Spaces.undertype(axes(Yc)) + @. ts = TD.PhaseEquil_ρθq( + thermo_params, + Yc.ρ, + Yc.ρθ / Yc.ρ, + Yc.ρq_tot / Yc.ρ, + 1, + FT(3), + ) end function thermo_state_ρθ!(ts, Yc, thermo_params, ::NonEquilMoistModel) @. ts = TD.PhaseNonEquil_ρθq( @@ -121,12 +128,15 @@ function thermo_state_ρe_tot!(ts, Yc, thermo_params, ::DryModel, z, K) TD.PhaseDry(thermo_params, internal_energy(Yc, K, g, z) / Yc.ρ, Yc.ρ) end function thermo_state_ρe_tot!(ts, Yc, thermo_params, ::EquilMoistModel, z, K) + FT = Spaces.undertype(axes(Yc)) g = TD.Parameters.grav(thermo_params) @. ts = TD.PhaseEquil_ρeq( thermo_params, Yc.ρ, internal_energy(Yc, K, g, z) / Yc.ρ, Yc.ρq_tot / Yc.ρ, + 1, + FT(3), ) end @@ -144,11 +154,14 @@ function thermo_state_ρe_int!(ts, Yc, thermo_params, ::DryModel) @. ts = TD.PhaseDry(thermo_params, Yc.ρe_int / Yc.ρ, Yc.ρ) end function thermo_state_ρe_int!(ts, Yc, thermo_params, ::EquilMoistModel) + FT = Spaces.undertype(axes(Yc)) @. ts = TD.PhaseEquil_ρeq( thermo_params, Yc.ρ, Yc.ρe_int / Yc.ρ, Yc.ρq_tot / Yc.ρ, + 1, + FT(3), ) end function thermo_state_ρe_int!(ts, Yc, thermo_params, ::NonEquilMoistModel) From 8dbc4fc23625253c62dc614e58fd6b6d3367ed88 Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Fri, 2 Sep 2022 15:50:41 -0700 Subject: [PATCH 2/2] Try 2 iterations --- examples/hybrid/thermo_state.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/hybrid/thermo_state.jl b/examples/hybrid/thermo_state.jl index dff1dedba7..ed1601807e 100644 --- a/examples/hybrid/thermo_state.jl +++ b/examples/hybrid/thermo_state.jl @@ -107,7 +107,7 @@ function thermo_state_ρθ!(ts, Yc, thermo_params, ::EquilMoistModel) Yc.ρ, Yc.ρθ / Yc.ρ, Yc.ρq_tot / Yc.ρ, - 1, + 2, FT(3), ) end @@ -135,7 +135,7 @@ function thermo_state_ρe_tot!(ts, Yc, thermo_params, ::EquilMoistModel, z, K) Yc.ρ, internal_energy(Yc, K, g, z) / Yc.ρ, Yc.ρq_tot / Yc.ρ, - 1, + 2, FT(3), ) end @@ -160,7 +160,7 @@ function thermo_state_ρe_int!(ts, Yc, thermo_params, ::EquilMoistModel) Yc.ρ, Yc.ρe_int / Yc.ρ, Yc.ρq_tot / Yc.ρ, - 1, + 2, FT(3), ) end