ECCO.Budyko_Sellers_models.paramsECCO.Budyko_Sellers_models.adjoint_demoECCO.Budyko_Sellers_models.dTdt_demoECCO.Budyko_Sellers_models.dTdt_loop_optimECCO.Budyko_Sellers_models.dTdt_solve_optimECCO.Budyko_Sellers_models.optim_demoECCO.Budyko_Sellers_models.optim_demo_loopECCO.Budyko_Sellers_models.the_main_loopECCO.Lorenz_models.L63ECCO.Lorenz_models.L96ECCO.Zygote_examples.Zygote_ex1ECCO.glacier_model.forward_problemECCO.toy_problems.Enzyme_ex1ECCO.toy_problems.Enzyme_ex2ECCO.toy_problems.Enzyme_ex3ECCO.toy_problems.Enzyme_ex4ECCO.toy_problems.ForwardDiff_ex1ECCO.toy_problems.optim_ex1ECCO.toy_problems.optim_ex2ECCO.toy_problems.optim_ex3
ECCO.toy_problems.Enzyme_ex1 — Method
toy_problems.Enzyme_ex1()Simple air sea flux calculation and it's adjoint, obtained via Enzyme.
ECCO.toy_problems.Enzyme_ex2 — Method
toy_problems.Enzyme_ex2()- air sea flux calculation derived using standard bulk formulae algorithm.
- it's adjoint, obtained via Enzyme.
using ECCO
(f,f_ad,x)=toy_problems.Enzyme_ex2()
f(x...)
f_ad(x...)ECCO.toy_problems.Enzyme_ex3 — Method
toy_problems.Enzyme_ex3()using ECCO
(f,f_ad,x,y)=toy_problems.Enzyme_ex3()
f(x,y)
f_ad(x,y)ECCO.toy_problems.Enzyme_ex4 — Method
toy_problems.Enzyme_ex4()using ECCO
(f,f_ad,x,y)=toy_problems.Enzyme_ex4()
f(x,y)
f_ad(x,y)ECCO.toy_problems.ForwardDiff_ex1 — Method
toy_problems.ForwardDiff_ex1()using ECCO
(x,adx)=toy_problems.ForwardDiff_ex1()ECCO.toy_problems.optim_ex1 — Method
toy_problems.optim_ex1()using ECCO
(f,x0,x1,result)=toy_problems.optim_ex1()ECCO.toy_problems.optim_ex2 — Method
toy_problems.optim_ex2()ECCO.toy_problems.optim_ex3 — Method
toy_problems.optim_ex3()ECCO.Zygote_examples.Zygote_ex1 — Method
toy_problems.Zygote_ex1()using ECCO
(x,adx)=Zygote_examples.Zygote_ex1()ECCO.glacier_model.forward_problem — Function
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=glacier_model.forward_problem(0.002)ECCO.Lorenz_models.L63 — Method
L63(; nt=10000)See https://en.wikipedia.org/wiki/Lorenz_system
using ECCO, CairoMakie
x,y,z=Lorenz_models.L63()
lines(x,y,z)ECCO.Lorenz_models.L96 — Method
L96(; N=5, F=8)See https://en.wikipedia.org/wiki/Lorenz96model
using ECCO, CairoMakie
xyz=Lorenz_models.L96()
lines(xyz[1,:],xyz[2,:],xyz[end,:])ECCO.Budyko_Sellers_models.params — Constant
Budyko-Sellers Energy Balance Model
Parameter Choices
From B. Rose notebook :
R = 10^7 J/m2/K
From Walsh and Rackauckas :
- Figure 3. Equilibrium solutions (7) with albedo function (9) for five η-values. Note T∗ ηi (ηi) = Tc only for i = 2,5.
- Parameters: Q = 343, A = 202, B = 1.9, C = 3.04, αw = 0.32, αs = 0.62, Tc =−10.
- Figure 9. Equilibrium solutions of (2) with albedo function (34). Solid: η= 0.1. Dashed: η= 0.25. Dash-Dot: η= 0.4.
- Parameters: Q = 321,A = 167,B = 1.5,C = 2.25,M = 50,αw = 0.32,αi = 0.46,αs = 0.72,ρ= 0.35.
ECCO.Budyko_Sellers_models.adjoint_demo — Function
adjoint_demo(par=[Q])- generate obs for cost function with
fake_obs. - call
the_main_loop_costandadthe_main_loop_cost - return gradient check result
grdchk=adjoint_demo([Q])
ECCO.Budyko_Sellers_models.dTdt_demo — Function
dTdt_demo(par=[Q])using ECCO, CairoMakie
(; Q, y) = Budyko_Sellers_models.params
Tsol,Tini,dTdt_ini,incr_t,incr=Budyko_Sellers_models.dTdt_demo(Q)
fig=Figure()
Axis(fig[1,1]); lines!(y,dTdt_ini)
Axis(fig[2,1]); lines!(y,Tini); lines!(y,Tsol,color=:red)
Axis(fig[3,1]); lines!(incr_t,incr)
figECCO.Budyko_Sellers_models.dTdt_loop_optim — Method
dTdt_loop_optim()Call the_main_loop and then Optim.optimize.
f,x0,x1,result=dTdt_loop_optim()
ECCO.Budyko_Sellers_models.dTdt_solve_optim — Method
dTdt_solve_optim(Tobs)Call dTdt_solve and then Optim.optimize (adjoint free).
f,x0,x1,result=dTdt_solve_optim(Tobs)
ECCO.Budyko_Sellers_models.optim_demo — Function
optim_demo(Q=Q; verbose=false)Call dTdt_solve and then dTdt_solve_optim.
optim_demo()
ECCO.Budyko_Sellers_models.optim_demo_loop — Method
optim_demo_loop()Call dTdt_loop_optim.
ECCO.Budyko_Sellers_models.the_main_loop — Method
the_main_loop(x; nt=10000)Do nt time steps of dt*dTdt(result,Q=x).