diff --git a/src/history.jl b/src/history.jl index 4fa0eb2..b5d4e0a 100644 --- a/src/history.jl +++ b/src/history.jl @@ -1,7 +1,7 @@ """ ```julia -porewaterhistory!(sc::SedimentColumn, p::Proposal, k::Constants, climhist::NamedTuple, seawater::Water, basalwater::Water ka_dt::Int) +porewaterhistory!(sc::SedimentColumn, p::Proposal, k::Constants, climhist::NamedTuple, seawater::Water, ka_dt::Int) ``` In-place version of [`porewaterhistory`](@ref), which takes every input as an arg (rather than some defaults as kwargs). It also requires you to provide `ka_dt` -- the number of diffusion timesteps in each thousand-year climate timestep. @@ -9,10 +9,10 @@ In-place version of [`porewaterhistory`](@ref), which takes every input as an ar see also: [`porewaterhistory`](@ref) """ -function porewaterhistory!(sc::SedimentColumn, p::Proposal, k::Constants, climhist::ClimateHistory, sw::Water, bw::Water, ka_dt::Int) +function porewaterhistory!(sc::SedimentColumn, p::Proposal, k::Constants, climhist::ClimateHistory, sw::Water, ka_dt::Int) #sc.Cl.p .= sc.Cl.o .= sw.Cl #sc.O.p .= sc.O.o .= sw.O - equilibratecolumn!(sc,sw,bw,k.z,k.depth) + equilibratecolumn!(sc,sw,water(p.basalCl,p.basalO),k.z,k.depth) isd = searchsortedfirst(climhist.t, p.onset, rev=true) #isd = ifelse(isd 1.0949056480096304 +@test PorewaterDiffusion.proposaljump(Proposal(ones(7)...), Proposal(ones(7)...), rng=StableRNG(2580))[1].dfrz ≈ 1.090668193354693 # if lognormal -> 1.0949056480096304 -@test PorewaterDiffusion.proposaljump(Proposal(ones(5)...), Proposal(ones(5)...), rng=StableRNG(10))[1].onset ≈ 0.23064139237391934 +@test PorewaterDiffusion.proposaljump(Proposal(ones(7)...), Proposal(ones(7)...), rng=StableRNG(10))[1].onset ≈ 0.23064139237391934 # stopwatch @test "0% |■■□□□□□□□□| 100% || step: 27 / 100 || time: 0.0 m" == PorewaterDiffusion.stopwatch(27,100,time()) \ No newline at end of file diff --git a/test/param.jl b/test/param.jl index 0f4fb58..9e95875 100644 --- a/test/param.jl +++ b/test/param.jl @@ -35,10 +35,11 @@ ktest = Constants(k=0.1, dz=5, dt=10, depth=2000) @test last(ktest.k2w) ≈ 0.0030695870568939743 -proposaltest = Proposal(1,1,1,1,1) -@test update(proposaltest, :onset, 2.) == Proposal(2,1,1,1,1) -@test update(proposaltest, :dfrz, 2.) == Proposal(1,2,1,1,1) -@test update(proposaltest, :dmlt, 2.) == Proposal(1,1,2,1,1) -@test update(proposaltest, :sea2frz, 2.) == Proposal(1,1,1,2,1) -@test update(proposaltest, :frz2mlt, 2.) == Proposal(1,1,1,1,2) - +proposaltest = Proposal(1,1,1,1,1,1,1) +@test update(proposaltest, :onset, 2.) == Proposal(2,1,1,1,1,1,1) +@test update(proposaltest, :dfrz, 2.) == Proposal(1,2,1,1,1,1,1) +@test update(proposaltest, :dmlt, 2.) == Proposal(1,1,2,1,1,1,1) +@test update(proposaltest, :sea2frz, 2.) == Proposal(1,1,1,2,1,1,1) +@test update(proposaltest, :frz2mlt, 2.) == Proposal(1,1,1,1,2,1,1) +@test update(proposaltest, :basalCl, 2.) == Proposal(1,1,1,1,1,2,1) +@test update(proposaltest, :basalO, 2.) == Proposal(1,1,1,1,1,1,2) \ No newline at end of file