Skip to content

Commit

Permalink
Add an interface for debugging the implicit solver Jacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisYatunin committed Aug 26, 2024
1 parent d442b28 commit 1dc4033
Show file tree
Hide file tree
Showing 25 changed files with 1,623 additions and 1,090 deletions.
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
ArtifactWrappers = "a14bc488-3040-4b00-9dc1-f6467924858a"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
AtmosphericProfilesLibrary = "86bc3604-9858-485a-bdbe-831ec50de11d"
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884"
ClimaDiagnostics = "1ecacbb8-0713-4841-9a07-eb5aa8a2d53f"
Expand All @@ -20,6 +21,7 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Insolation = "e98cc03f-d57e-4e3c-b70c-8d51efe9e0d8"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
Expand Down Expand Up @@ -48,6 +50,7 @@ ArgParse = "1"
ArtifactWrappers = "0.2"
Artifacts = "1"
AtmosphericProfilesLibrary = "0.1.6"
BlockArrays = "0, 1"
ClimaComms = "0.6.2"
ClimaCore = "0.14.11"
ClimaDiagnostics = "0.2"
Expand All @@ -59,6 +62,7 @@ Dates = "1"
DiffEqBase = "6"
DocStringExtensions = "0.8, 0.9"
FastGaussQuadrature = "0.4, 0.5, 1"
ForwardDiff = "0.10"
Insolation = "0.9.2"
Interpolations = "0.14, 0.15"
IntervalSets = "0.5, 0.6, 0.7"
Expand Down
9 changes: 9 additions & 0 deletions config/default_configs/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ eisenstat_walker_forcing_alpha:
jvp_step_adjustment:
help: "Amount by which the step size of the forward difference approximation of the Jacobian-vector product in the Krylov method should be scaled (only used if `use_krylov_method` is `true`)"
value: 1.0
use_exact_jacobian:
help: "Whether to solve the linear system using the exact Jacobian, which is computed with forward-mode automatic differentiation (default is `false`)"
value: true
n_steps_update_exact_jacobian:
help: "Number of timesteps between updates to the exact Jacobian (default is 0, which corresponds to updating the exact Jacobian on each Newton iteration)"
value: 0
debug_approximate_jacobian:
help: "Whether to check the accuracy of the approximate Jacobian against the exact Jacobian every `n_steps_update_exact_jacobian` timesteps (default is `false`)"
value: false
# Radiation
rad:
help: "Radiation model [`nothing` (default), `gray`, `clearsky`, `allsky`, `allskywithclear`]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ turbconv: "prognostic_edmfx"
implicit_diffusion: true
implicit_sgs_advection: true
approximate_linear_solve_iters: 2
max_newton_iters_ode: 3
max_newton_iters_ode: 10
edmfx_upwinding: first_order
edmfx_entr_model: "Generalized"
edmfx_detr_model: "Generalized"
Expand Down
2 changes: 1 addition & 1 deletion docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ weakdeps = ["SparseArrays"]
ChainRulesCoreSparseArraysExt = "SparseArrays"

[[deps.ClimaAtmos]]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "DocStringExtensions", "FastGaussQuadrature", "Insolation", "Interpolations", "IntervalSets", "Krylov", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "Pkg", "Printf", "RRTMGP", "Random", "RootSolvers", "SciMLBase", "StaticArrays", "Statistics", "StatsBase", "SurfaceFluxes", "Thermodynamics", "YAML"]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "BlockArrays", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "DocStringExtensions", "FastGaussQuadrature", "ForwardDiff", "Insolation", "Interpolations", "IntervalSets", "Krylov", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "Pkg", "Printf", "RRTMGP", "Random", "RootSolvers", "SciMLBase", "StaticArrays", "Statistics", "StatsBase", "SurfaceFluxes", "Thermodynamics", "YAML"]
path = ".."
uuid = "b2c96348-7fb7-4fe0-8da9-78d88439e717"
version = "0.27.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ version = "0.5.6"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"

[[deps.ClimaAtmos]]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "DocStringExtensions", "FastGaussQuadrature", "Insolation", "Interpolations", "IntervalSets", "Krylov", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "Pkg", "Printf", "RRTMGP", "Random", "RootSolvers", "SciMLBase", "StaticArrays", "Statistics", "StatsBase", "SurfaceFluxes", "Thermodynamics", "YAML"]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "BlockArrays", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "DocStringExtensions", "FastGaussQuadrature", "ForwardDiff", "Insolation", "Interpolations", "IntervalSets", "Krylov", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "Pkg", "Printf", "RRTMGP", "Random", "RootSolvers", "SciMLBase", "StaticArrays", "Statistics", "StatsBase", "SurfaceFluxes", "Thermodynamics", "YAML"]
path = ".."
uuid = "b2c96348-7fb7-4fe0-8da9-78d88439e717"
version = "0.27.4"
Expand Down
2 changes: 1 addition & 1 deletion perf/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ version = "0.5.6"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"

[[deps.ClimaAtmos]]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "DocStringExtensions", "FastGaussQuadrature", "Insolation", "Interpolations", "IntervalSets", "Krylov", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "Pkg", "Printf", "RRTMGP", "Random", "RootSolvers", "SciMLBase", "StaticArrays", "Statistics", "StatsBase", "SurfaceFluxes", "Thermodynamics", "YAML"]
deps = ["Adapt", "ArgParse", "ArtifactWrappers", "Artifacts", "AtmosphericProfilesLibrary", "BlockArrays", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "DiffEqBase", "DocStringExtensions", "FastGaussQuadrature", "ForwardDiff", "Insolation", "Interpolations", "IntervalSets", "Krylov", "LazyArtifacts", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "Pkg", "Printf", "RRTMGP", "Random", "RootSolvers", "SciMLBase", "StaticArrays", "Statistics", "StatsBase", "SurfaceFluxes", "Thermodynamics", "YAML"]
path = ".."
uuid = "b2c96348-7fb7-4fe0-8da9-78d88439e717"
version = "0.27.4"
Expand Down
4 changes: 4 additions & 0 deletions src/ClimaAtmos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ include(joinpath("prognostic_equations", "zero_tendency.jl"))

include(joinpath("prognostic_equations", "implicit", "implicit_tendency.jl"))
include(joinpath("prognostic_equations", "implicit", "implicit_solver.jl"))
include(joinpath("prognostic_equations", "implicit", "approx_jacobian.jl"))
include(joinpath("prognostic_equations", "implicit", "exact_jacobian.jl"))
include(joinpath("prognostic_equations", "implicit", "debug_jacobian.jl"))
include(joinpath("prognostic_equations", "implicit", "dual_fixes.jl"))

include(joinpath("prognostic_equations", "remaining_tendency.jl"))
include(joinpath("prognostic_equations", "forcing", "large_scale_advection.jl")) # TODO: should this be in tendencies/?
Expand Down
175 changes: 123 additions & 52 deletions src/cache/precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@
import Thermodynamics as TD
import ClimaCore: Spaces, Fields

function implicit_precomputed_quantities(Y, atmos)
FT = eltype(Y)
TST = thermo_state_type(atmos.moisture_model, FT)
n = n_mass_flux_subdomains(atmos.turbconv_model)
gs_quantities = (;
ᶜspecific = specific_gs.(Y.c),
ᶠuₕ³ = similar(Y.f, CT3{FT}),
ᶜu = similar(Y.c, C123{FT}),
ᶠu³ = similar(Y.f, CT3{FT}),
ᶜK = similar(Y.c, FT),
ᶜts = similar(Y.c, TST),
ᶜp = similar(Y.c, FT),
ᶜh_tot = similar(Y.c, FT),
)
advective_sgs_quantities =
atmos.turbconv_model isa PrognosticEDMFX ?
(;
ᶜtke⁰ = similar(Y.c, FT),
ᶜρa⁰ = similar(Y.c, FT),
ᶜmse⁰ = similar(Y.c, FT),
ᶜq_tot⁰ = similar(Y.c, FT),
ᶠu₃⁰ = similar(Y.f, C3{FT}),
ᶜu⁰ = similar(Y.c, C123{FT}),
ᶠu³⁰ = similar(Y.f, CT3{FT}),
ᶜK⁰ = similar(Y.c, FT),
ᶜts⁰ = similar(Y.c, TST),
ᶜρ⁰ = similar(Y.c, FT),
ᶜuʲs = similar(Y.c, NTuple{n, C123{FT}}),
ᶠu³ʲs = similar(Y.f, NTuple{n, CT3{FT}}),
ᶜKʲs = similar(Y.c, NTuple{n, FT}),
ᶠKᵥʲs = similar(Y.f, NTuple{n, FT}),
ᶜtsʲs = similar(Y.c, NTuple{n, TST}),
ᶜρʲs = similar(Y.c, NTuple{n, FT}),
) : (;)
return (; gs_quantities..., advective_sgs_quantities...)
end

"""
precomputed_quantities(Y, atmos)
Expand Down Expand Up @@ -42,16 +79,8 @@ function precomputed_quantities(Y, atmos)
TST = thermo_state_type(atmos.moisture_model, FT)
SCT = SurfaceConditions.surface_conditions_type(atmos, FT)
cspace = axes(Y.c)
fspace = axes(Y.f)
n = n_mass_flux_subdomains(atmos.turbconv_model)
gs_quantities = (;
ᶜspecific = specific_gs.(Y.c),
ᶜu = similar(Y.c, C123{FT}),
ᶠu³ = similar(Y.f, CT3{FT}),
ᶜK = similar(Y.c, FT),
ᶜts = similar(Y.c, TST),
ᶜp = similar(Y.c, FT),
ᶜh_tot = similar(Y.c, FT),
ᶜmixing_length = similar(Y.c, FT),
ᶜlinear_buoygrad = similar(Y.c, FT),
ᶜstrain_rate_norm = similar(Y.c, FT),
Expand All @@ -76,41 +105,25 @@ function precomputed_quantities(Y, atmos)
advective_sgs_quantities =
atmos.turbconv_model isa PrognosticEDMFX ?
(;
ᶜtke⁰ = similar(Y.c, FT),
ᶜρa⁰ = similar(Y.c, FT),
ᶠu₃⁰ = similar(Y.f, C3{FT}),
ᶜu⁰ = similar(Y.c, C123{FT}),
ᶠu³⁰ = similar(Y.f, CT3{FT}),
ᶜK⁰ = similar(Y.c, FT),
ᶜmse⁰ = similar(Y.c, FT),
ᶜq_tot⁰ = similar(Y.c, FT),
ᶜts⁰ = similar(Y.c, TST),
ᶜρ⁰ = similar(Y.c, FT),
ᶜmixing_length_tuple = similar(Y.c, MixingLength{FT}),
ᶜK_u = similar(Y.c, FT),
ᶜK_h = similar(Y.c, FT),
ρatke_flux = similar(Fields.level(Y.f, half), C3{FT}),
ᶜuʲs = similar(Y.c, NTuple{n, C123{FT}}),
ᶠu³ʲs = similar(Y.f, NTuple{n, CT3{FT}}),
ᶜKʲs = similar(Y.c, NTuple{n, FT}),
ᶠKᵥʲs = similar(Y.f, NTuple{n, FT}),
ᶜtsʲs = similar(Y.c, NTuple{n, TST}),
bdmr_l = similar(Y.c, BidiagonalMatrixRow{FT}),
bdmr_r = similar(Y.c, BidiagonalMatrixRow{FT}),
bdmr = similar(Y.c, BidiagonalMatrixRow{FT}),
ᶜρʲs = similar(Y.c, NTuple{n, FT}),
ᶜentrʲs = similar(Y.c, NTuple{n, FT}),
ᶜdetrʲs = similar(Y.c, NTuple{n, FT}),
ᶠnh_pressure₃ʲs = similar(Y.f, NTuple{n, C3{FT}}),
ᶜgradᵥ_θ_virt⁰ = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_q_tot⁰ = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_θ_liq_ice⁰ = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_θ_virt⁰ = similar(Y.c, C3{FT}),
ᶜgradᵥ_q_tot⁰ = similar(Y.c, C3{FT}),
ᶜgradᵥ_θ_liq_ice⁰ = similar(Y.c, C3{FT}),
precipitation_sgs_quantities...,
) : (;)
sgs_quantities = (;
ᶜgradᵥ_θ_virt = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_q_tot = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_θ_liq_ice = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_θ_virt = similar(Y.c, C3{FT}),
ᶜgradᵥ_q_tot = similar(Y.c, C3{FT}),
ᶜgradᵥ_θ_liq_ice = similar(Y.c, C3{FT}),
)

diagnostic_sgs_quantities =
Expand Down Expand Up @@ -155,6 +168,7 @@ function precomputed_quantities(Y, atmos)
ᶜqₛ = similar(Y.c, FT),
) : (;)
return (;
implicit_precomputed_quantities(Y, atmos)...,
gs_quantities...,
sgs_quantities...,
advective_sgs_quantities...,
Expand Down Expand Up @@ -326,14 +340,14 @@ end
function eddy_diffusivity_coefficient(
z::FT,
z₀,
f_b::FT,
h::FT,
f_b,
h,
uₐ,
C_E::FT,
Ri::FT,
Ri_a::FT,
Ri_c::FT,
κ::FT,
C_E,
Ri,
Ri_a,
Ri_c,
κ,
) where {FT}
# Equations (17), (18)
if z <= f_b * h
Expand Down Expand Up @@ -412,12 +426,12 @@ end

function compute_surface_layer_diffusivity(
z::FT,
z₀::FT,
κ::FT,
C_E::FT,
Ri::FT,
Ri_a::FT,
Ri_c::FT,
z₀,
κ,
C_E,
Ri,
Ri_a,
Ri_c,
norm_uₐ,
) where {FT}
# Equations (19), (20)
Expand Down Expand Up @@ -452,15 +466,19 @@ function instead of recomputing the value yourself. Otherwise, it will be
difficult to ensure that the duplicated computations are consistent.
"""
NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
set_implicit_precomputed_quantities!(Y, p, t)
set_explicit_precomputed_quantities!(Y, p, t)
end
function set_implicit_precomputed_quantities!(Y, p, t)
(; moisture_model, turbconv_model, vert_diff, precip_model, cloud_model) =
p.atmos
(; call_cloud_diagnostics_per_stage) = p.atmos
thermo_params = CAP.thermodynamics_params(p.params)
turbconv_params = CAP.turbconv_params(p.params)
n = n_mass_flux_subdomains(turbconv_model)
thermo_args = (thermo_params, moisture_model)
(; ᶜΦ) = p.core
(; ᶜspecific, ᶜu, ᶠu³, ᶜK, ᶜts, ᶜp) = p.precomputed
ᶠuₕ³ = p.scratch.ᶠtemp_CT3
(; ᶜspecific, ᶠuₕ³, ᶜu, ᶠu³, ᶜK, ᶜts, ᶜp, ᶜh_tot) = p.precomputed

@. ᶜspecific = specific_gs(Y.c)
set_ᶠuₕ³!(ᶠuₕ³, Y)
Expand Down Expand Up @@ -488,6 +506,63 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
end
@. ᶜts = ts_gs(thermo_args..., ᶜspecific, ᶜK, ᶜΦ, Y.c.ρ)
@. ᶜp = TD.air_pressure(thermo_params, ᶜts)
@. ᶜh_tot = TD.total_specific_enthalpy(thermo_params, ᶜts, ᶜspecific.e_tot)

if turbconv_model isa PrognosticEDMFX
@assert !(moisture_model isa DryModel)
(; ᶜuʲs, ᶠu³ʲs, ᶜKʲs, ᶠKᵥʲs, ᶜtsʲs, ᶜρʲs) = p.precomputed
(; ᶜtke⁰, ᶜρa⁰, ᶜmse⁰, ᶜq_tot⁰, ᶠu₃⁰, ᶜu⁰, ᶠu³⁰, ᶜK⁰, ᶜts⁰, ᶜρ⁰) =
p.precomputed

for j in 1:n
ᶠu₃ʲ = Y.f.sgsʲs.:($j).u₃
ᶜmseʲ = Y.c.sgsʲs.:($j).mse
ᶜq_totʲ = Y.c.sgsʲs.:($j).q_tot

ᶜuʲ = ᶜuʲs.:($j)
ᶠu³ʲ = ᶠu³ʲs.:($j)
ᶜKʲ = ᶜKʲs.:($j)
ᶠKᵥʲ = ᶠKᵥʲs.:($j)
ᶜtsʲ = ᶜtsʲs.:($j)
ᶜρʲ = ᶜρʲs.:($j)

set_velocity_quantities!(ᶜuʲ, ᶠu³ʲ, ᶜKʲ, ᶠu₃ʲ, Y.c.uₕ, ᶠuₕ³)
@. ᶠKᵥʲ = (adjoint(CT3(ᶠu₃ʲ)) * ᶠu₃ʲ) / 2
@. ᶜtsʲ = TD.PhaseEquil_phq(thermo_params, ᶜp, ᶜmseʲ - ᶜΦ, ᶜq_totʲ)
@. ᶜρʲ = TD.air_density(thermo_params, ᶜtsʲ)
end

@. ᶜρa⁰ = ρa⁰(Y.c)
@. ᶜtke⁰ = divide_by_ρa(Y.c.sgs⁰.ρatke, ᶜρa⁰, 0, Y.c.ρ, turbconv_model)
@. ᶜmse⁰ = divide_by_ρa(
Y.c.ρ * (ᶜh_tot - ᶜK) - ρamse⁺(Y.c.sgsʲs),
ᶜρa⁰,
Y.c.ρ * (ᶜh_tot - ᶜK),
Y.c.ρ,
turbconv_model,
)
@. ᶜq_tot⁰ = divide_by_ρa(
Y.c.ρq_tot - ρaq_tot⁺(Y.c.sgsʲs),
ᶜρa⁰,
Y.c.ρq_tot,
Y.c.ρ,
turbconv_model,
)
set_sgs_ᶠu₃!(u₃⁰, ᶠu₃⁰, Y, turbconv_model)
set_velocity_quantities!(ᶜu⁰, ᶠu³⁰, ᶜK⁰, ᶠu₃⁰, Y.c.uₕ, ᶠuₕ³)
# @. ᶜK⁰ += ᶜtke⁰
@. ᶜts⁰ = TD.PhaseEquil_phq(thermo_params, ᶜp, ᶜmse⁰ - ᶜΦ, ᶜq_tot⁰)
@. ᶜρ⁰ = TD.air_density(thermo_params, ᶜts⁰)
end

return nothing
end
function set_explicit_precomputed_quantities!(Y, p, t)
(; moisture_model, turbconv_model, vert_diff, precip_model, cloud_model) =
p.atmos
(; call_cloud_diagnostics_per_stage) = p.atmos
thermo_params = CAP.thermodynamics_params(p.params)
(; ᶠuₕ³, ᶜts, ᶜp) = p.precomputed

if turbconv_model isa AbstractEDMF
@. p.precomputed.ᶜgradᵥ_θ_virt =
Expand All @@ -498,9 +573,6 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
ᶜgradᵥ(ᶠinterp(TD.liquid_ice_pottemp(thermo_params, ᶜts)))
end

(; ᶜh_tot) = p.precomputed
@. ᶜh_tot = TD.total_specific_enthalpy(thermo_params, ᶜts, ᶜspecific.e_tot)

if !isnothing(p.sfc_setup)
SurfaceConditions.update_surface_conditions!(Y, p, t)
end
Expand All @@ -517,12 +589,11 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)

if turbconv_model isa PrognosticEDMFX
set_prognostic_edmf_precomputed_quantities_draft_and_bc!(Y, p, ᶠuₕ³, t)
set_prognostic_edmf_precomputed_quantities_environment!(Y, p, ᶠuₕ³, t)
set_prognostic_edmf_precomputed_quantities_closures!(Y, p, t)
set_prognostic_edmf_precomputed_quantities_precipitation!(
Y,
p,
p.atmos.precip_model,
precip_model,
)
end

Expand All @@ -535,7 +606,7 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
Y,
p,
t,
p.atmos.precip_model,
precip_model,
)
end

Expand All @@ -544,7 +615,7 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
interior_uₕ = Fields.level(Y.c.uₕ, 1)
ᶜΔz_surface = Fields.Δz_field(interior_uₕ)
@. ᶜK_h = eddy_diffusivity_coefficient(
p.atmos.vert_diff.C_E,
vert_diff.C_E,
norm(interior_uₕ),
ᶜΔz_surface / 2,
ᶜp,
Expand Down
Loading

0 comments on commit 1dc4033

Please sign in to comment.