Skip to content

Commit 0bd8ec2

Browse files
committed
improve feedback-example
1 parent 620e73a commit 0bd8ec2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/subglacial-routing-feedback.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ function melting(uparea, ij, dir)
8383
rho_i = 910 # density ice (repeat because non-const)
8484

8585
dirij = dir[ij]
86-
Q = uparea[1]
86+
Q_total, Q_extra_melt = uparea[1], uparea[2]
8787
ds = iseven(dirij) ? dx : sqrt(2)*dx
8888
phi2 = phi_[ij + WWF.dir2ind(dirij)]
8989
phi1 = phi_[ij]
9090
∇phi = isnan(phi2) ? 0.0 : (phi2 - phi1) / ds
91-
melt = -Q*∇phi / rho_w / L
92-
return Q+melt, uparea[2]+melt, melt/dx^2
91+
melt = -Q_total*∇phi / rho_w / L
92+
return Q_total+melt, Q_extra_melt+melt, melt/dx^2
9393
end
9494

9595

@@ -101,6 +101,8 @@ area, slen, dir, nout, nin, pits, c, bnds = WWF.waterflows(phi, drain_pits=true
101101
# Plot it
102102
plotyes && WWF.plotit(x, y, phi)
103103
plotyes && WWF.plotarea(x, y, area[1], pits)
104+
plotyes && WWF.plotarea(x, y, area[2], pits)
105+
@show extrema(area[3])
104106

105107
plotyes && WWF.heatmap(x, y, c)
106108

0 commit comments

Comments
 (0)