@@ -60,19 +60,29 @@ function ClimaAtmosSimulation(atmos_config)
6060
6161 if hasmoisture (integrator)
6262 ρ_flux_q_tot = integrator. p. precomputed. sfc_conditions. ρ_flux_q_tot
63- surface_rain_flux = integrator. p. precipitation. surface_rain_flux
64- surface_snow_flux = integrator. p. precipitation. surface_snow_flux
6563 @. ρ_flux_q_tot = CC. Geometry. Covariant3Vector (FT (0.0 ))
64+ if pkgversion (CA) >= v " 0.29.0"
65+ surface_rain_flux = integrator. p. precomputed. surface_rain_flux
66+ surface_snow_flux = integrator. p. precomputed. surface_snow_flux
67+ else
68+ surface_rain_flux = integrator. p. precipitation. surface_rain_flux
69+ surface_snow_flux = integrator. p. precipitation. surface_snow_flux
70+ end
6671 surface_rain_flux .= FT (0 )
6772 surface_snow_flux .= FT (0 )
6873 end
6974 if integrator. p. atmos. precip_model isa CA. Microphysics0Moment
70- ᶜS_ρq_tot = integrator. p. precipitation. ᶜS_ρq_tot
71- ᶜ3d_rain = integrator. p. precipitation. ᶜ3d_rain
72- ᶜ3d_snow = integrator. p. precipitation. ᶜ3d_snow
73- ᶜS_ρq_tot .= FT (0 )
74- ᶜ3d_rain .= FT (0 )
75- ᶜ3d_snow .= FT (0 )
75+ if pkgversion (CA) >= v " 0.29.0"
76+ ᶜS_ρq_tot = integrator. p. precomputed. ᶜS_ρq_tot
77+ ᶜS_ρq_tot .= FT (0 )
78+ else
79+ ᶜS_ρq_tot = integrator. p. precipitation. ᶜS_ρq_tot
80+ ᶜ3d_rain = integrator. p. precipitation. ᶜ3d_rain
81+ ᶜ3d_snow = integrator. p. precipitation. ᶜ3d_snow
82+ ᶜS_ρq_tot .= FT (0 )
83+ ᶜ3d_rain .= FT (0 )
84+ ᶜ3d_snow .= FT (0 )
85+ end
7686 end
7787 if hasradiation (integrator)
7888 ᶠradiation_flux = integrator. p. radiation. ᶠradiation_flux
@@ -164,7 +174,11 @@ function Interfacer.get_field(atmos_sim::ClimaAtmosSimulation, ::Val{:energy})
164174 if p. atmos. precip_model isa CA. Microphysics0Moment
165175 ᶜts = p. precomputed. ᶜts
166176 ᶜΦ = p. core. ᶜΦ
167- ᶜS_ρq_tot = p. precipitation. ᶜS_ρq_tot
177+ if pkgversion (CA) >= v " 0.29.0"
178+ ᶜS_ρq_tot = p. precomputed. ᶜS_ρq_tot
179+ else
180+ ᶜS_ρq_tot = p. precipitation. ᶜS_ρq_tot
181+ end
168182 thermo_params = get_thermo_params (atmos_sim)
169183 return integrator. u. c. ρe_tot .-
170184 ᶜS_ρq_tot .* CA. e_tot_0M_precipitation_sources_helper .(Ref (thermo_params), ᶜts, ᶜΦ) .*
@@ -177,12 +191,22 @@ end
177191# helpers for get_field extensions, dipatchable on different moisture model options and radiation modes
178192
179193surface_rain_flux (:: CA.DryModel , integrator) = StaticArrays. SVector (eltype (integrator. u)(0 ))
180- surface_rain_flux (:: Union{CA.EquilMoistModel, CA.NonEquilMoistModel} , integrator) =
181- integrator. p. precipitation. surface_rain_flux
194+ function surface_rain_flux (:: Union{CA.EquilMoistModel, CA.NonEquilMoistModel} , integrator)
195+ if pkgversion (CA) >= v " 0.29.0"
196+ return integrator. p. precomputed. surface_rain_flux
197+ else
198+ return integrator. p. precipitation. surface_rain_flux
199+ end
200+ end
182201
183202surface_snow_flux (:: CA.DryModel , integrator) = StaticArrays. SVector (eltype (integrator. u)(0 ))
184- surface_snow_flux (:: Union{CA.EquilMoistModel, CA.NonEquilMoistModel} , integrator) =
185- integrator. p. precipitation. surface_snow_flux
203+ function surface_snow_flux (:: Union{CA.EquilMoistModel, CA.NonEquilMoistModel} , integrator)
204+ if pkgversion (CA) >= v " 0.29.0"
205+ return integrator. p. precomputed. surface_snow_flux
206+ else
207+ return integrator. p. precipitation. surface_snow_flux
208+ end
209+ end
186210
187211surface_radiation_flux (:: Nothing , integrator) = StaticArrays. SVector (eltype (integrator. u)(0 ))
188212surface_radiation_flux (:: CA.RRTMGPI.AbstractRRTMGPMode , integrator) =
0 commit comments