From 4ba3370b72d381375bb740dcdbc399e05015a35d Mon Sep 17 00:00:00 2001 From: kmdeck Date: Thu, 5 Sep 2024 09:47:09 -0700 Subject: [PATCH] cleanup [skip ci] --- docs/tutorials/standalone/Soil/freezing_front.jl | 2 +- experiments/long_runs/soil.jl | 2 +- src/standalone/Soil/energy_hydrology.jl | 11 ++--------- src/standalone/Soil/soil_heat_parameterizations.jl | 9 +++------ test/standalone/Soil/soiltest.jl | 4 ++-- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/docs/tutorials/standalone/Soil/freezing_front.jl b/docs/tutorials/standalone/Soil/freezing_front.jl index 285bae1032..be1d05109c 100644 --- a/docs/tutorials/standalone/Soil/freezing_front.jl +++ b/docs/tutorials/standalone/Soil/freezing_front.jl @@ -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 diff --git a/experiments/long_runs/soil.jl b/experiments/long_runs/soil.jl index a78e0a04dc..c918ee602f 100644 --- a/experiments/long_runs/soil.jl +++ b/experiments/long_runs/soil.jl @@ -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 = (; diff --git a/src/standalone/Soil/energy_hydrology.jl b/src/standalone/Soil/energy_hydrology.jl index 0ad5042e64..622dc59241 100644 --- a/src/standalone/Soil/energy_hydrology.jl +++ b/src/standalone/Soil/energy_hydrology.jl @@ -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, diff --git a/src/standalone/Soil/soil_heat_parameterizations.jl b/src/standalone/Soil/soil_heat_parameterizations.jl index 21442d7862..dc6fb35427 100644 --- a/src/standalone/Soil/soil_heat_parameterizations.jl +++ b/src/standalone/Soil/soil_heat_parameterizations.jl @@ -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 """ diff --git a/test/standalone/Soil/soiltest.jl b/test/standalone/Soil/soiltest.jl index b73fc37816..e51e9a1053 100644 --- a/test/standalone/Soil/soiltest.jl +++ b/test/standalone/Soil/soiltest.jl @@ -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(