Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix isdac radiation broadcast #3304

Merged
merged 2 commits into from
Sep 17, 2024
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
39 changes: 24 additions & 15 deletions config/model_configs/les_isdac_box.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
job_id: "les_isdac_box"
# ISDAC config
initial_condition: "ISDAC"
subsidence: "ISDAC"
surface_setup: "ISDAC"
external_forcing: "ISDAC"
rad: "ISDAC"
config: "box"
# microphysics
moist: "equil"
config: "box"
hyperdiff: "false"
implicit_diffusion: false
ode_algo: "SSP33ShuOsher"
precip_model: "1M"
# diffusion
implicit_diffusion: false
approximate_linear_solve_iters: 2
hyperdiff: "false"
apply_limiter: false
smagorinsky_lilly: true
c_smag: 0.20
# time- and spatial discretization
x_elem: 10
x_max: 3.2e3
y_elem: 10
y_max: 3.2e3
z_max: 2e3
x_elem: 4
y_elem: 4
z_elem: 10
z_elem: 15
z_max: 2.5e3
z_stretch: false
rayleigh_sponge: true
toml: [toml/isdac_box.toml] # sponge height
ode_algo: "SSPKnoth"
dt: "0.05secs"
t_end: "10mins"
t_end: "2mins"
dt_cloud_fraction: "10mins"
dt_save_state_to_disk: "1mins"
# restart_file: "restart/isdac/day0.0.hdf5"
netcdf_interpolation_num_points: [10, 10, 20]
netcdf_interpolation_num_points: [30, 30, 150]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl]
reduction: average
period: 1mins
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, husra, cl, clw, cli, hussfc, evspsbl, hfes, pr]
period: 10mins
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, husra, cl, clw, cli, hussfc, evspsbl, hfes, pr]
reduction_time: average
period: 60mins
1 change: 0 additions & 1 deletion post_processing/ci_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,6 @@ EDMFBoxPlotsWithPrecip = Union{
Val{:diagnostic_edmfx_rico_box},
Val{:diagnostic_edmfx_trmm_box},
Val{:diagnostic_edmfx_trmm_stretched_box},
Val{:les_isdac_box},
}


Expand Down
17 changes: 10 additions & 7 deletions src/parameterized_tendencies/radiation/radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,17 @@ function radiation_tendency!(Yₜ, Y, p, t, radiation_mode::RadiationISDAC)
LWP_zₜ = p.scratch.temp_field_level # column integral of LWP (zₜ = top-of-domain)
Operators.column_integral_definite!(LWP_zₜ, ᶜρq)

LWP_z = p.scratch.ᶠtemp_scalar # column integral of LWP from 0 to z (z = current level)
Operators.column_integral_indefinite!(LWP_z, ᶜρq)
ᶠLWP_z = p.scratch.ᶠtemp_scalar # column integral of LWP from 0 to z (z = current level)
Operators.column_integral_indefinite!(ᶠLWP_z, ᶜρq)

@. Yₜ.c.ρe_tot -= ᶜdivᵥ(
Geometry.WVector(
F₀ * exp(-κ * (LWP_zₜ - LWP_z)) + F₁ * exp(-κ * LWP_z),
),
) # = -∂F/∂z = ρ cₚ ∂T/∂t (longwave radiation)
# TODO: Need to compute flux before `ᶜdivᵥ` until we resolve: https://github.com/CliMA/ClimaCore.jl/issues/1989
radiation_flux = p.scratch.ᶠtemp_scalar
@. radiation_flux = F₀ * exp(-κ * (LWP_zₜ - ᶠLWP_z)) + F₁ * exp(-κ * ᶠLWP_z)

@. Yₜ.c.ρe_tot -= ᶜdivᵥ(Geometry.WVector(
radiation_flux,
# F₀ * exp(-κ * (LWP_zₜ - ᶠLWP_z)) + F₁ * exp(-κ * ᶠLWP_z),
)) # = -∂F/∂z = ρ cₚ ∂T/∂t (longwave radiation)

return nothing
end
2 changes: 2 additions & 0 deletions toml/isdac_box.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[zd_rayleigh]
value = 2000.0
Loading