Skip to content
Snippets Groups Projects
Commit e18c53f1 authored by Brian Groenke's avatar Brian Groenke
Browse files

Inline boundary flux functions

parent 46415faa
No related branches found
No related tags found
1 merge request!63Fixes recent regressions in heat initialization and refactors soil state variables
...@@ -110,9 +110,9 @@ function prognosticstep!(::SubSurface, ::Heat{<:FreezeCurve,Temperature}, state) ...@@ -110,9 +110,9 @@ function prognosticstep!(::SubSurface, ::Heat{<:FreezeCurve,Temperature}, state)
@inbounds @. state.dT = state.dH / state.Ceff @inbounds @. state.dT = state.dH / state.Ceff
return nothing return nothing
end end
boundaryflux(::Neumann, bc::BoundaryProcess, top::Top, heat::Heat, sub::SubSurface, stop, ssub) = boundaryvalue(bc,top,heat,sub,stop,ssub) @inline boundaryflux(::Neumann, bc::BoundaryProcess, top::Top, heat::Heat, sub::SubSurface, stop, ssub) = boundaryvalue(bc,top,heat,sub,stop,ssub)
boundaryflux(::Neumann, bc::BoundaryProcess, bot::Bottom, heat::Heat, sub::SubSurface, sbot, ssub) = boundaryvalue(bc,bot,heat,sub,sbot,ssub) @inline boundaryflux(::Neumann, bc::BoundaryProcess, bot::Bottom, heat::Heat, sub::SubSurface, sbot, ssub) = boundaryvalue(bc,bot,heat,sub,sbot,ssub)
function boundaryflux(::Dirichlet, bc::BoundaryProcess, top::Top, heat::Heat, sub::SubSurface, stop, ssub) @inline function boundaryflux(::Dirichlet, bc::BoundaryProcess, top::Top, heat::Heat, sub::SubSurface, stop, ssub)
Δk = Δ(ssub.grids.k) Δk = Δ(ssub.grids.k)
@inbounds let Tupper=boundaryvalue(bc,top,heat,sub,stop,ssub), @inbounds let Tupper=boundaryvalue(bc,top,heat,sub,stop,ssub),
Tsub=ssub.T[1], Tsub=ssub.T[1],
...@@ -122,7 +122,7 @@ function boundaryflux(::Dirichlet, bc::BoundaryProcess, top::Top, heat::Heat, su ...@@ -122,7 +122,7 @@ function boundaryflux(::Dirichlet, bc::BoundaryProcess, top::Top, heat::Heat, su
-k*(Tsub-Tupper)/δ₀/d -k*(Tsub-Tupper)/δ₀/d
end end
end end
function boundaryflux(::Dirichlet, bc::BoundaryProcess, bot::Bottom, heat::Heat, sub::SubSurface, sbot, ssub) @inline function boundaryflux(::Dirichlet, bc::BoundaryProcess, bot::Bottom, heat::Heat, sub::SubSurface, sbot, ssub)
Δk = Δ(ssub.grids.k) Δk = Δ(ssub.grids.k)
@inbounds let Tlower=boundaryvalue(bc,bot,heat,sub,sbot,ssub), @inbounds let Tlower=boundaryvalue(bc,bot,heat,sub,sbot,ssub),
Tsub=ssub.T[end], Tsub=ssub.T[end],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment