Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ClimaAtmos.jl Release Notes
main
-------

PR [#3886](https://github.com/CliMA/ClimaAtmos.jl/pull/3886) renames `PrognosticSurfaceTemperature` -> `SlabOceanSST`, `PrescribedSurfaceTemperature` -> `PrescribedSST` and deprecates the `prognostic_surface = "Prognostic/PrescribedSurfaceTemperature"` config argument

PR [#3883](https://github.com/CliMA/ClimaAtmos.jl/pull/3883) adds atmosphere initial condition for WeatherQuest from ERA5

PR [#3870](https://github.com/CliMA/ClimaAtmos.jl/pull/3870) adds externally driven SCM models forced by monthly-averaged ERA5
Expand All @@ -12,7 +14,6 @@ factor speedup. The associated documentation section, "Single Column Model", was

v0.30.4
-------

PR [#3856](https://github.com/CliMA/ClimaAtmos.jl/pull/3856) adds number adjustment tendencies to the two-moment microphysics scheme.

v0.30.3
Expand Down
2 changes: 1 addition & 1 deletion config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ prognostic_tke:
help: "A flag for prognostic TKE [`false` (default), `true`]"
value: false
prognostic_surface:
help: "Determines if surface temperature is prognostic [`false` (default), , `true`, `PrognosticSurfaceTemperature`, `PrescribedSurfaceTemperature`]"
help: "Determines if surface temperature is prognostic [`false` (default), , `true`, `SlabOceanSST`, `PrescribedSST`]"
value: false
albedo_model:
help: "Variable surface albedo [`ConstantAlbedo` (default), `RegressionFunctionAlbedo`, `CouplerAlbedo`]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ t_end: "360days"
dt_save_state_to_disk: "30days"
check_conservation: true
moist: "equil"
prognostic_surface: "PrognosticSurfaceTemperature"
prognostic_surface: "SlabOceanSST"
albedo_model: "RegressionFunctionAlbedo"
surface_setup: "DefaultMoninObukhov"
vert_diff: "DecayWithHeightDiffusion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ approximate_linear_solve_iters: 2
rad: "clearsky"
insolation: "timevarying"
dt_rad: "1hours"
prognostic_surface: "PrognosticSurfaceTemperature"
prognostic_surface: "SlabOceanSST"
check_conservation: true
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ approximate_linear_solve_iters: 2
rad: "clearsky"
insolation: "timevarying"
dt_rad: "1hours"
prognostic_surface: "PrognosticSurfaceTemperature"
prognostic_surface: "SlabOceanSST"
check_conservation: true
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dt: "400secs"
t_end: "10days"
moist: "equil"
surface_setup: DefaultMoninObukhov
prognostic_surface: "PrognosticSurfaceTemperature"
prognostic_surface: "SlabOceanSST"
rad: "clearsky"
precip_model: "0M"
vert_diff: true
Expand Down
2 changes: 1 addition & 1 deletion src/cache/cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function build_cache(
net_energy_flux_sfc = [Geometry.WVector(FT(0))]

conservation_check =
!(atmos.precip_model isa NoPrecipitation) ?
!(atmos.microphysics_model isa NoPrecipitation) ?
(;
col_integrated_precip_energy_tendency = zeros(
axes(Fields.level(Geometry.WVector.(Y.f.u₃), half)),
Expand Down
45 changes: 24 additions & 21 deletions src/cache/diagnostic_edmf_precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function compute_ρaʲu³ʲ(
detrʲ_prev_level,
u³ʲ_data_prev_halflevel,
S_q_totʲ_prev_level,
precip_model,
microphysics_model,
)

ρaʲu³ʲ_data =
Expand All @@ -282,7 +282,7 @@ function compute_ρaʲu³ʲ(
ρaʲu³ʲ_data +=
(1 / J_halflevel) *
(J_prev_level * ρaʲ_prev_level * (entrʲ_prev_level - detrʲ_prev_level))
if precip_model isa Union{Microphysics0Moment, Microphysics1Moment}
if microphysics_model isa Union{Microphysics0Moment, Microphysics1Moment}
ρaʲu³ʲ_data +=
(1 / J_halflevel) *
(J_prev_level * ρaʲ_prev_level * S_q_totʲ_prev_level)
Expand All @@ -295,7 +295,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
p,
t,
)
(; turbconv_model, precip_model) = p.atmos
(; turbconv_model, microphysics_model) = p.atmos
FT = eltype(Y)
n = n_mass_flux_subdomains(turbconv_model)
ᶜz = Fields.coordinate_field(Y.c).z
Expand Down Expand Up @@ -323,7 +323,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
) = p.precomputed
(; ᶠu³⁰, ᶜK⁰, ᶜtke⁰) = p.precomputed

if precip_model isa Microphysics1Moment
if microphysics_model isa Microphysics1Moment
ᶜq_liqʲs = p.precomputed.ᶜq_liqʲs
ᶜq_iceʲs = p.precomputed.ᶜq_iceʲs
q_rai = p.precomputed.ᶜqᵣ
Expand Down Expand Up @@ -384,7 +384,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
z_prev_level = Fields.field_values(Fields.level(ᶜz, i - 1))
dz_prev_level = Fields.field_values(Fields.level(ᶜdz, i - 1))

if precip_model isa Microphysics1Moment
if microphysics_model isa Microphysics1Moment
q_rai_prev_level = Fields.field_values(Fields.level(q_rai, i - 1))
q_sno_prev_level = Fields.field_values(Fields.level(q_sno, i - 1))
end
Expand All @@ -409,10 +409,11 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
ᶠnh_pressure³_buoyʲ = ᶠnh_pressure³_buoyʲs.:($j)
ᶠnh_pressure³_dragʲ = ᶠnh_pressure³_dragʲs.:($j)

if precip_model isa Union{Microphysics0Moment, Microphysics1Moment}
if microphysics_model isa
Union{Microphysics0Moment, Microphysics1Moment}
ᶜS_q_totʲ = p.precomputed.ᶜSqₜᵖʲs.:($j)
end
if precip_model isa Microphysics1Moment
if microphysics_model isa Microphysics1Moment
ᶜS_q_raiʲ = p.precomputed.ᶜSqᵣᵖʲs.:($j)
ᶜS_q_snoʲ = p.precomputed.ᶜSqₛᵖʲs.:($j)
ᶜS_e_totʲ = p.precomputed.ᶜSeₜᵖʲs.:($j)
Expand Down Expand Up @@ -455,13 +456,13 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
CAP.R_d(params) * CAP.T_surf_ref(params) / CAP.grav(params)

S_q_totʲ_prev_level =
if precip_model isa
if microphysics_model isa
Union{Microphysics0Moment, Microphysics1Moment}
Fields.field_values(Fields.level(ᶜS_q_totʲ, i - 1))
else
Ref(nothing)
end
if precip_model isa Microphysics1Moment
if microphysics_model isa Microphysics1Moment
S_q_raiʲ_prev_level =
Fields.field_values(Fields.level(ᶜS_q_raiʲ, i - 1))
S_q_snoʲ_prev_level =
Expand Down Expand Up @@ -571,15 +572,15 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
# Updraft q_tot sources from precipitation formation
# To be applied in updraft continuity, moisture and energy
# for updrafts and grid mean
if precip_model isa Microphysics0Moment
if microphysics_model isa Microphysics0Moment
@. S_q_totʲ_prev_level = q_tot_0M_precipitation_sources(
thermo_params,
microphys_0m_params,
dt,
q_totʲ_prev_level,
tsʲ_prev_level,
)
elseif precip_model isa Microphysics1Moment
elseif microphysics_model isa Microphysics1Moment
compute_precipitation_sources!(
Sᵖ_prev_level,
Sᵖ_snow_prev_level,
Expand Down Expand Up @@ -689,7 +690,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
detrʲ_prev_level,
u³ʲ_data_prev_halflevel,
S_q_totʲ_prev_level,
precip_model,
microphysics_model,
)

@. u³ʲ_halflevel = ifelse(
Expand Down Expand Up @@ -733,7 +734,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
mseʲ_prev_level
)
)
if precip_model isa Microphysics0Moment
if microphysics_model isa Microphysics0Moment
@. ρaʲu³ʲ_datamse +=
(1 / local_geometry_halflevel.J) * (
local_geometry_prev_level.J *
Expand All @@ -747,7 +748,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
)
)
)
elseif precip_model isa Microphysics1Moment
elseif microphysics_model isa Microphysics1Moment
@. ρaʲu³ʲ_datamse +=
(1 / local_geometry_halflevel.J) * (
local_geometry_prev_level.J *
Expand Down Expand Up @@ -782,7 +783,8 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_do_integral!(
q_totʲ_prev_level
)
)
if precip_model isa Union{Microphysics0Moment, Microphysics1Moment}
if microphysics_model isa
Union{Microphysics0Moment, Microphysics1Moment}
@. ρaʲu³ʲ_dataq_tot +=
(1 / local_geometry_halflevel.J) * (
local_geometry_prev_level.J *
Expand Down Expand Up @@ -885,7 +887,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_top_bc!(
(; ᶜentrʲs, ᶜdetrʲs, ᶜturb_entrʲs) = p.precomputed
(; ᶠu³⁰, ᶠu³ʲs, ᶜuʲs, ᶠnh_pressure³_buoyʲs, ᶠnh_pressure³_dragʲs) =
p.precomputed
(; precip_model) = p.atmos
(; microphysics_model) = p.atmos

# set values for the top level
i_top = Spaces.nlevels(axes(Y.c))
Expand Down Expand Up @@ -924,12 +926,13 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_top_bc!(
fill!(turb_entrʲ_level, RecursiveApply.rzero(eltype(turb_entrʲ_level)))
@. ᶜuʲ = C123(Y.c.uₕ) + ᶜinterp(C123(ᶠu³ʲ))

if precip_model isa Union{Microphysics0Moment, Microphysics1Moment}
if microphysics_model isa
Union{Microphysics0Moment, Microphysics1Moment}
ᶜS_q_totʲ = p.precomputed.ᶜSqₜᵖʲs.:($j)
S_q_totʲ_level = Fields.field_values(Fields.level(ᶜS_q_totʲ, i_top))
@. S_q_totʲ_level = 0
end
if precip_model isa Microphysics1Moment
if microphysics_model isa Microphysics1Moment
ᶜS_q_raiʲ = p.precomputed.ᶜSqᵣᵖʲs.:($j)
ᶜS_q_snoʲ = p.precomputed.ᶜSqₛᵖʲs.:($j)
ᶜS_e_totʲ = p.precomputed.ᶜSeₜᵖʲs.:($j)
Expand All @@ -954,7 +957,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_env_closures!
p,
t,
)
(; moisture_model, turbconv_model, precip_model) = p.atmos
(; moisture_model, turbconv_model, microphysics_model) = p.atmos
n = n_mass_flux_subdomains(turbconv_model)
ᶜz = Fields.coordinate_field(Y.c).z
ᶜdz = Fields.Δz_field(axes(Y.c))
Expand Down Expand Up @@ -1072,7 +1075,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_env_precipita
Y,
p,
t,
precip_model::Microphysics0Moment,
microphysics_model::Microphysics0Moment,
)
thermo_params = CAP.thermodynamics_params(p.params)
microphys_0m_params = CAP.microphysics_0m_params(p.params)
Expand All @@ -1093,7 +1096,7 @@ NVTX.@annotate function set_diagnostic_edmf_precomputed_quantities_env_precipita
Y,
p,
t,
precip_model::Microphysics1Moment,
microphysics_model::Microphysics1Moment,
)
error("Not implemented yet")
#thermo_params = CAP.thermodynamics_params(p.params)
Expand Down
12 changes: 6 additions & 6 deletions src/cache/precipitation_precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Kin(ᶜw_precip, ᶜu_air)
end

"""
set_precipitation_velocities!(Y, p, moisture_model, precip_model)
set_precipitation_velocities!(Y, p, moisture_model, microphysics_model)

Updates the precipitation terminal velocity, cloud sedimentation velocity,
and their contribution to total water and energy advection.
Expand All @@ -46,7 +46,7 @@ function set_precipitation_velocities!(
Y,
p,
moisture_model::NonEquilMoistModel,
precip_model::Microphysics1Moment,
microphysics_model::Microphysics1Moment,
)
(; ᶜwₗ, ᶜwᵢ, ᶜwᵣ, ᶜwₛ, ᶜwₜqₜ, ᶜwₕhₜ, ᶜts, ᶜu) = p.precomputed
(; ᶜΦ) = p.core
Expand Down Expand Up @@ -102,7 +102,7 @@ function set_precipitation_velocities!(
Y,
p,
moisture_model::NonEquilMoistModel,
precip_model::Microphysics2Moment,
microphysics_model::Microphysics2Moment,
)
(; ᶜwₗ, ᶜwᵢ, ᶜwᵣ, ᶜwₛ, ᶜwnₗ, ᶜwnᵣ, ᶜwₜqₜ, ᶜwₕhₜ, ᶜts, ᶜu) = p.precomputed
(; ᶜΦ) = p.core
Expand Down Expand Up @@ -182,7 +182,7 @@ function set_precipitation_velocities!(
end

"""
set_precipitation_cache!(Y, p, precip_model, turbconv_model)
set_precipitation_cache!(Y, p, microphysics_model, turbconv_model)

Computes the cache needed for precipitation tendencies. When run without edmf
model this involves computing precipitation sources based on the grid mean
Expand Down Expand Up @@ -423,7 +423,7 @@ set_precipitation_surface_fluxes!(Y, p, _) = nothing
function set_precipitation_surface_fluxes!(
Y,
p,
precip_model::Microphysics0Moment,
microphysics_model::Microphysics0Moment,
)
ᶜT = p.scratch.ᶜtemp_scalar
(; ᶜts) = p.precomputed # assume ᶜts has been updated
Expand All @@ -450,7 +450,7 @@ end
function set_precipitation_surface_fluxes!(
Y,
p,
precip_model::Union{Microphysics1Moment, Microphysics2Moment},
microphysics_model::Union{Microphysics1Moment, Microphysics2Moment},
)
(; surface_rain_flux, surface_snow_flux) = p.precomputed
(; col_integrated_precip_energy_tendency,) = p.conservation_check
Expand Down
Loading
Loading