diff --git a/experiments/standalone/Vegetation/timestep_test.jl b/experiments/standalone/Vegetation/timestep_test.jl index 8b2e3a11e3..14a6632aff 100644 --- a/experiments/standalone/Vegetation/timestep_test.jl +++ b/experiments/standalone/Vegetation/timestep_test.jl @@ -176,14 +176,14 @@ Y.canopy.hydraulics.ϑ_l.:2 .= augmented_liquid_fraction.(ν, S_l_ini[2]) seconds_per_day = 3600 * 24.0 t0 = 150seconds_per_day -N_days = 0.5 +N_days = 0.0417 tf = t0 + N_days * seconds_per_day evaluate!(Y.canopy.energy.T, atmos.T, t0) set_initial_cache! = make_set_initial_cache(canopy) set_initial_cache!(p, Y, t0); -saveat = Array(t0:(3 * 3600):tf) -updateat = Array(t0:(3600 * 3):tf) +saveat = Array(t0:(0.5 * 3600):tf) +updateat = Array(t0:(3600 * 0.5):tf) drivers = ClimaLand.get_drivers(canopy) updatefunc = ClimaLand.make_update_drivers(drivers) cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc) @@ -209,23 +209,23 @@ prob = SciMLBase.ODEProblem( savedir = joinpath(pkgdir(ClimaLand), "experiments/standalone/Vegetation"); ref_dt = 0.001 -# ref_sol = -# SciMLBase.solve(prob, ode_algo; dt = ref_dt, callback = cb, saveat = saveat); -# ref_T = [parent(ref_sol.u[k].canopy.energy.T)[1] for k in 1:length(ref_sol.t)] -# open(joinpath(savedir, "exp_T_dt$(ref_dt)_$(N_days)days.txt"), "w") do io -# writedlm(io, ref_T, ',') -# end; +ref_sol = + SciMLBase.solve(prob, ode_algo; dt = ref_dt, callback = cb, saveat = saveat); +ref_T = [parent(ref_sol.u[k].canopy.energy.T)[1] for k in 1:length(ref_sol.t)] +open(joinpath(savedir, "exp_T_dt$(ref_dt)_$(N_days)days.txt"), "w") do io + writedlm(io, ref_T, ',') +end; -ref_T = readdlm(joinpath(savedir, "exp_T_dt$(ref_dt)_$(N_days)days.txt")) +# ref_T = readdlm(joinpath(savedir, "exp_T_dt$(ref_dt)_$(N_days)days.txt")) dts = [1.0, 0.1, 0.01] sols = [] for dt in dts @info dt - saveat = Array(t0:(3 * 3600):tf) + saveat = Array(t0:(0.5 * 3600):tf) evaluate!(Y.canopy.energy.T, atmos.T, t0) - updateat = Array(t0:(3600 * 3):tf) + updateat = Array(t0:(3600 * 0.5):tf) updatefunc = ClimaLand.make_update_drivers(drivers) cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)