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

Strip AD types in steady state T init

parent 92530d2d
No related branches found
No related tags found
No related merge requests found
...@@ -67,14 +67,19 @@ function steadystate!(sub::SubSurface, state, T0, Qgeo, maxiters::Int, convergen ...@@ -67,14 +67,19 @@ function steadystate!(sub::SubSurface, state, T0, Qgeo, maxiters::Int, convergen
z = cells(state.grid) z = cells(state.grid)
ΔT = Inf ΔT = Inf
while i < maxiters && ΔT > convergence_thresh while i < maxiters && ΔT > convergence_thresh
T_new = T0 .+ z*Qgeo ./ state.kc T_new = adstrip.(T0 .+ z*Qgeo ./ state.kc)
ΔT = maximum(abs.(T_new .- state.T)) ΔT = maximum(abs.(T_new .- state.T))
state.T .= T_new state.T .= one(eltype(state.T))*T_new
# recompute initial condition and diagnostic state # recompute initial condition and diagnostic state variables
initialcondition!(sub, state) initialcondition!(sub, state)
computediagnostic!(sub, state) computediagnostic!(sub, state)
i += 1 i += 1
end end
# compute final temperature profile
@. state.T = T0 + z*Qgeo / state.kc
# recompute initial condition and diagnostic state variables
initialcondition!(sub, state)
computediagnostic!(sub, state)
# return temperature profile # return temperature profile
return state.T return state.T
end 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