Skip to content

Commit

Permalink
modified: src/cache/cache.jl
Browse files Browse the repository at this point in the history
	modified:   src/surface_conditions/surface_conditions.jl
  • Loading branch information
akshaysridhar committed Apr 8, 2024
1 parent 99d2578 commit 4632f7b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
4 changes: 0 additions & 4 deletions src/cache/cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ function build_cache(Y, atmos, params, surface_setup, sim_info, aerosol_names)
precomputing_arguments =
(; atmos, core, params, sfc_setup, precomputed, scratch, dt, SG_quad)

# Coupler compatibility
isnothing(precomputing_arguments.sfc_setup) &&
SurfaceConditions.set_dummy_surface_conditions!(precomputing_arguments)

set_precomputed_quantities!(Y, precomputing_arguments, FT(0))

radiation_args =
Expand Down
28 changes: 0 additions & 28 deletions src/surface_conditions/surface_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,6 @@ surface_state(
t,
) = wrapped_sfc_setup(sfc_local_geometry_values.coordinates, int_z_values, t)

# This is a hack for meeting the August 7th deadline. It is to ensure that the
# coupler will be able to construct an integrator before overwriting its surface
# conditions, but without throwing an error during the computation of
# precomputed quantities for diagnostic EDMF due to uninitialized surface
# conditions.
# TODO: Refactor the surface conditions API to avoid needing to do this.
function set_dummy_surface_conditions!(p)
(; params, atmos) = p
(; sfc_conditions) = p.precomputed
FT = eltype(params)
thermo_params = CAP.thermodynamics_params(params)
@. sfc_conditions.ustar = FT(0.2)
@. sfc_conditions.obukhov_length = FT(1e-4)
@. sfc_conditions.buoyancy_flux = FT(0)
if atmos.moisture_model isa DryModel
@. sfc_conditions.ts = TD.PhaseDry_ρT(thermo_params, FT(1), FT(300))
else
@. sfc_conditions.ts = TD.PhaseNonEquil_ρTq(
thermo_params,
FT(1),
FT(300),
TD.PhasePartition(FT(0)),
)
@. sfc_conditions.ρ_flux_q_tot = C3(FT(0))
end
@. sfc_conditions.ρ_flux_h_tot = C3(FT(0))
end

"""
set_surface_conditions!(p, surface_conditions, surface_ts)
Expand Down

0 comments on commit 4632f7b

Please sign in to comment.