Skip to content

Commit

Permalink
cleanup [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Sep 5, 2024
1 parent 6960e13 commit 4ba3370
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/standalone/Soil/freezing_front.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ boundary_fluxes = (;
# Sources are added as elements of a list of sources. Here we just add freezing
# and thawing.

sources = (PhaseChange{FT}(FT(3600)),);
sources = (PhaseChange{FT}(),);

# Now we can package this up in the
# [`EnergyHydrology`](@ref ClimaLand.Soil.EnergyHydrology) model
Expand Down
2 changes: 1 addition & 1 deletion experiments/long_runs/soil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))

soil_args = (domain = domain, parameters = soil_params)
soil_model_type = Soil.EnergyHydrology{FT}
sources = (Soil.PhaseChange{FT}(FT(3600)),)# sublimation and subsurface runoff are added automatically
sources = (Soil.PhaseChange{FT}(),)# sublimation and subsurface runoff are added automatically
top_bc = ClimaLand.Soil.AtmosDrivenFluxBC(atmos, radiation, runoff_model)
zero_flux = Soil.HeatFluxBC((p, t) -> 0.0)
boundary_conditions = (;
Expand Down
11 changes: 2 additions & 9 deletions src/standalone/Soil/energy_hydrology.jl
Original file line number Diff line number Diff line change
Expand Up @@ -573,16 +573,9 @@ end
"""
PhaseChange{FT} <: AbstractSoilSource{FT}
PhaseChange source type
PhaseChange source type.
"""
struct PhaseChange{FT} <: AbstractSoilSource{FT}
Δt::FT
end

function PhaseChange{FT}() where {FT}
return PhaseChange{FT}(FT(0))
end

struct PhaseChange{FT} <: AbstractSoilSource{FT} end

"""
source!(dY::ClimaCore.Fields.FieldVector,
Expand Down
9 changes: 3 additions & 6 deletions src/standalone/Soil/soil_heat_parameterizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ export volumetric_internal_energy,
phase_change_source

"""
thermal_time(ρc::FT, Δz::FT, κ::FT, τ_min) where {FT}
thermal_time(ρc::FT, Δz::FT, κ::FT) where {FT}
Returns the thermal timescale for temperature differences across
a typical thickness Δz to equilibrate.
Clip to a minimum timescale in order to respect CFL condition,
given that phase change is stepped explicitly.
"""
function thermal_time(ρc::FT, Δz::FT, κ::FT, τ_min::FT) where {FT}
return max(ρc * Δz^2 / κ, τ_min)
function thermal_time(ρc::FT, Δz::FT, κ::FT) where {FT}
return ρc * Δz^2 / κ
end

"""
Expand Down
4 changes: 2 additions & 2 deletions test/standalone/Soil/soiltest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,8 @@ for FT in (Float32, Float64)
heat = zero_heat_flux_bc,
),
)
Δt = FT(1000)# doesnt matter what this is here, we are checking dY.liquid water and dY.ice are in sync
sources = (PhaseChange{FT}(Δt),)

sources = (PhaseChange{FT}(),)

###
hyd_off_en_on = Soil.EnergyHydrologyParameters(
Expand Down

0 comments on commit 4ba3370

Please sign in to comment.