Skip to content

Commit

Permalink
Remove callback spq
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Sep 29, 2023
1 parent 2fc38b1 commit 5e40d4a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
5 changes: 0 additions & 5 deletions src/callbacks/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ NVTX.@annotate function turb_conv_affect_filter!(integrator)
Y = integrator.u
tc_params = CAP.turbconv_params(param_set)

set_precomputed_quantities!(Y, p, t) # sets ᶜts for set_edmf_surface_bc
Fields.bycolumn(axes(Y.c)) do colidx
state = TC.tc_column_state(Y, p, nothing, colidx, t)
grid = TC.Grid(state)
Expand All @@ -76,8 +75,6 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator)
p = integrator.p
t = integrator.t

set_precomputed_quantities!(Y, p, t) # sets ᶜts and sfc_conditions

(; ᶜts, sfc_conditions, params, env_thermo_quad) = p
(; idealized_insolation, idealized_h2o, idealized_clouds) = p
(; insolation_tuple, ᶠradiation_flux, radiation_model) = p
Expand Down Expand Up @@ -255,8 +252,6 @@ NVTX.@annotate function compute_diagnostics(integrator)
FT = eltype(params)
thermo_params = CAP.thermodynamics_params(params)

set_precomputed_quantities!(Y, p, t) # sets ᶜu, ᶜK, ᶜts, ᶜp, & SGS analogues

(; ᶜu, ᶜK, ᶜts, ᶜp, sfc_conditions) = p
dycore_diagnostic = (;
common_diagnostics(p, ᶜu, ᶜts)...,
Expand Down
8 changes: 1 addition & 7 deletions src/solver/type_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -892,18 +892,12 @@ function get_integrator(config::AtmosConfig)

# We need to ensure the precomputed quantities are indeed precomputed

# TODO: Remove this when we can assume that the precomputed_quantities are in sync with
# the state
sync_precomputed = call_every_n_steps(
(int) -> set_precomputed_quantities!(int.u, int.p, int.t),
)

# The generic constructor for SciMLBase.CallbackSet has to split callbacks into discrete
# and continuous. This is not hard, but can introduce significant latency. However, all
# the callbacks in ClimaAtmos are discrete_callbacks, so we directly pass this
# information to the constructor
continuous_callbacks = tuple()
discrete_callbacks = (callback..., sync_precomputed, diagnostic_callbacks)
discrete_callbacks = (callback..., diagnostic_callbacks)

s = @timed_str begin
all_callbacks =
Expand Down

0 comments on commit 5e40d4a

Please sign in to comment.