Skip to content

Commit

Permalink
update copy on EBM melt docs page
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfairbanks committed Dec 4, 2024
1 parent 82d2bd5 commit ca35514
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ DecapodesCUDAExt = "CUDA"
ACSets = "0.2"
Aqua = "0.8"
CUDA = "5.2"
CombinatorialSpaces = "0.6.3"
ComponentArrays = "0.15"
DiagrammaticEquations = "0.1.7"
Distributions = "0.25"
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ makedocs(
sitename = "Decapodes.jl",
doctest = false,
checkdocs = :none,
draft = false;
draft = true;
pagesonly = true,
linkcheck = true,
linkcheck_ignore = [r"agupubs\.onlinelibrary\.wiley\.com", # This gives a 403 Forbidden
Expand Down
23 changes: 16 additions & 7 deletions docs/src/ebm_melt/ebm_melt.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ ice_dynamics = apex(oapply(ice_dynamics_composition_diagram,
[Open(halfar_eq2, [:Γ,:n]),
Open(glens_law, [:Γ,:n])]))
to_graphviz(ice_dynamics_composition_diagram)
```

The composition pattern tells you how to couple the variables and introduces namespaces that we will use later when supplying initial conditions.

The following code creates the Budyko-Sellers model as a composite of individual terms.

```@example DEC
energy_balance = @decapode begin
(Tₛ, ASR, OLR, HT)::Form0
C::Constant
Expand Down Expand Up @@ -156,9 +165,12 @@ budyko_sellers = apex(oapply(budyko_sellers_composition_diagram,
Open(outgoing_longwave_radiation, [:Tₛ, :OLR]),
Open(heat_transfer, [:Tₛ, :HT, :cosϕᵖ]),
Open(insolation, [:Q, :cosϕᵖ])]))
nothing # hide
to_graphviz(budyko_sellers_composition_diagram)
```

Our full model can then be composed by adding terms for melting of water. We will assume that the meltwater is transported by diffusion because the transport of meltwater is so much faster than the melting process itself. If you wanted to increase the physical realism of this model, using a different model of melting and water transport would be a good place to start.

``` @example DEC
warming = @decapode begin
Tₛ::Form0
Expand All @@ -177,14 +189,12 @@ end
budyko_sellers_halfar_water_composition_diagram = @relation () begin
budyko_sellers(Tₛ)
warming(A, Tₛ)
melting(Tₛ, h, melt)
halfar(A, h, melt)
end
nothing # hide
to_graphviz(budyko_sellers_halfar_water_composition_diagram)
```

``` @example DEC
Expand Down Expand Up @@ -246,6 +256,7 @@ u₀ = ComponentArray(
h = h₀,
melting_water = water)
# the underscore sparate words are the namespaces that were introduced with oapply.
constants_and_parameters = (
budyko_sellers_absorbed_radiation_α = α,
budyko_sellers_outgoing_radiation_A = A,
Expand All @@ -270,8 +281,6 @@ function generate(sd, my_symbol; hodge=GeometricHodge())
:mag => x -> begin
norm.(x)
end
:^ => (x,y) -> x .^ y
:* => (x,y) -> x .* y
x => error("Unmatched operator $my_symbol")
end
return (args...) -> op(args...)
Expand Down

0 comments on commit ca35514

Please sign in to comment.