Skip to content

Commit

Permalink
update results following reduced nt
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelforget committed Oct 19, 2024
1 parent 3b26c72 commit 38ceeb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
20 changes: 6 additions & 14 deletions src/mountain_glacier.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ using Enzyme
end

"""
forward_problem(xx::Array, dx::Float64, nx::Int, dt::Float64, nt::Int)
forward_problem(M0=0.004; dt=1/12.0, nt=6*5000, dx = 1.0, nx = 30)
Simple, 1D mountain glacier model inspired from the book Fundamentals of Glacier Dynamics,
by CJ van der Veen, and which was translated to Julia by S Gaikwad.
See https://sicopolis.readthedocs.io/en/latest/AD/tutorial_tapenade.html#mountain-glacier-model
```
V=ECCO.glacier_model.forward_problem(0.002)
```
"""
function forward_problem(M0=0.004;
dt=1/12.0, nt=6*5000, dx = 1.0, nx = 30)
function forward_problem(M0=0.004; dt=1/12.0, nt=6*5000, dx = 1.0, nx = 30)
rho = 920.0
g = 9.2
n = 3
Expand Down Expand Up @@ -62,17 +65,6 @@ function forward_problem(M0=0.004;
return V
end

"""
integrate()
```
V=ECCO.glacier_model.integrate()
```
"""
function integrate(M0=.004)
forward_problem(M0)
end

adjoint_problem(x)=autodiff(Reverse, forward_problem, Active(x[1]))

end
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ using Test

##

V=ECCO.glacier_model.integrate()
@test isapprox(V,12.364982412145055)
V=ECCO.glacier_model.forward_problem()
@test isapprox(V,12.36497768703625)

store=ECCO.Lorenz_models.L96()
@test isapprox(store[1,end],-1.334792006090324)
Expand Down

0 comments on commit 38ceeb9

Please sign in to comment.