From ca355145f6f9140310010d25b44b3ca4c3339c5c Mon Sep 17 00:00:00 2001 From: "James P. Fairbanks" Date: Wed, 4 Dec 2024 11:20:54 -0700 Subject: [PATCH] update copy on EBM melt docs page --- Project.toml | 1 - docs/make.jl | 2 +- docs/src/ebm_melt/ebm_melt.md | 23 ++++++++++++++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Project.toml b/Project.toml index f0c3102e..33c87ef4 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/docs/make.jl b/docs/make.jl index 6762c18c..90492dcd 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -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 diff --git a/docs/src/ebm_melt/ebm_melt.md b/docs/src/ebm_melt/ebm_melt.md index ec19a956..e3ab8dc5 100644 --- a/docs/src/ebm_melt/ebm_melt.md +++ b/docs/src/ebm_melt/ebm_melt.md @@ -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 @@ -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 @@ -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 @@ -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, @@ -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...)