Skip to content

Commit

Permalink
Add surface_setup to AtmosModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo committed Oct 26, 2023
1 parent 9be6b4e commit 5c485b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cache/cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# The model also depends on f_plane_coriolis_frequency(params)
# This is a constant Coriolis frequency that is only used if space is flat
function build_cache(Y, atmos, params, surface_setup, simulation)
function build_cache(Y, atmos, params, simulation)
FT = eltype(params)

ᶜcoord = Fields.local_geometry_field(Y.c).coordinates
Expand Down Expand Up @@ -50,7 +50,7 @@ function build_cache(Y, atmos, params, surface_setup, simulation)
is_init = Ref(true),
simulation,
atmos,
sfc_setup = surface_setup(params),
sfc_setup = atmos.surface_setup(params),
ᶜΦ,
ᶠgradᵥ_ᶜΦ = ᶠgradᵥ.(ᶜΦ),
ᶜρ_ref,
Expand Down
4 changes: 2 additions & 2 deletions src/solver/type_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function get_atmos(config::AtmosConfig, params)
rayleigh_sponge = get_rayleigh_sponge_model(parsed_args, params, FT),
sfc_temperature = get_sfc_temperature_form(parsed_args),
surface_model = get_surface_model(parsed_args),
surface_setup = get_surface_setup(parsed_args),
numerics = get_numerics(parsed_args),
)

Expand Down Expand Up @@ -720,7 +721,6 @@ function get_integrator(config::AtmosConfig)
CP.log_parameter_information(config.toml_dict, filepath)
end
initial_condition = get_initial_condition(config.parsed_args)
surface_setup = get_surface_setup(config.parsed_args)

s = @timed_str begin
if simulation.restart
Expand All @@ -740,7 +740,7 @@ function get_integrator(config::AtmosConfig)
@info "Allocating Y: $s"

s = @timed_str begin
p = build_cache(Y, atmos, params, surface_setup, simulation)
p = build_cache(Y, atmos, params, simulation)
end
@info "Allocating cache (p): $s"

Expand Down
2 changes: 2 additions & 0 deletions src/solver/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ Base.@kwdef struct AtmosModel{
RS,
ST,
SM,
SS,
NUM,
}
model_config::MC = nothing
Expand Down Expand Up @@ -362,6 +363,7 @@ Base.@kwdef struct AtmosModel{
rayleigh_sponge::RS = nothing
sfc_temperature::ST = nothing
surface_model::SM = nothing
surface_setup::SS = nothing
numerics::NUM = nothing
end

Expand Down

0 comments on commit 5c485b8

Please sign in to comment.