Skip to content

Commit

Permalink
Merge branch 'main' into gb/logos
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo authored Mar 5, 2024
2 parents 03bfb45 + 9bdf85d commit 7f2d330
Show file tree
Hide file tree
Showing 73 changed files with 2,611 additions and 732 deletions.
4 changes: 4 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ steps:
command: "julia --color=yes --project=experiments experiments/integrated/fluxnet/run_fluxnet.jl US-Ha1"
artifact_paths: "experiments/integrated/fluxnet/US-Ha1/out/*png"

- label: "ozark_pft"
command: "julia --color=yes --project=experiments experiments/integrated/fluxnet/ozark_pft.jl"
artifact_paths: "experiments/integrated/fluxnet/US-MOz/out/pft/*png"

- label: "ozark_conservation"
command: "julia --color=yes --project=experiments experiments/integrated/ozark/conservation/ozark_conservation.jl"
artifact_paths: "experiments/integrated/ozark/conservation/*png"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.txt
*#
*~
*.nc
*.png
*.mp4
*.pdf
Expand Down
12 changes: 6 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"

[weakdeps]
CLIMAParameters = "6eacf6c3-8458-43b9-ae03-caf5306d3d53"
ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c"

[extensions]
CreateParametersExt = "CLIMAParameters"
CreateParametersExt = "ClimaParams"

[compat]
Adapt = "3, 4"
ArtifactWrappers = "0.2"
CFTime = "0.1"
CLIMAParameters = "0.9"
ClimaParams = "0.10"
CSV = "0.10"
CUDA = "5"
ClimaComms = "0.5.6"
Expand All @@ -49,14 +49,14 @@ Dates = "1"
DocStringExtensions = "0.8, 0.9"
Flux = "0.14"
HTTP = "1.10"
Insolation = "=0.9.1"
Insolation = "0.9.2"
IntervalSets = "0.5, 0.6, 0.7"
LinearAlgebra = "1"
NCDatasets = "0.11, 0.12, 0.13, 0.14"
SciMLBase = "1, 2"
StaticArrays = "1"
StatsBase = "0.34"
SurfaceFluxes = "0.9"
Thermodynamics = "=0.12.3"
SurfaceFluxes = "0.10"
Thermodynamics = "0.12"
cuDNN = "1"
julia = "1.9"
52 changes: 26 additions & 26 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.10.0"
julia_version = "1.10.1"
manifest_format = "2.0"
project_hash = "f930dc7ba66e23f2de897f17dbbdfb065b27141e"
project_hash = "5f713b750235cf07465e21e92a6bd2f152ad3358"

[[deps.ADTypes]]
git-tree-sha1 = "41c37aa88889c171f1300ceac1313c06e891d245"
Expand Down Expand Up @@ -192,12 +192,6 @@ git-tree-sha1 = "5afb5c5ba2688ca43a9ad2e5a91cbb93921ccfa1"
uuid = "179af706-886a-5703-950a-314cd64e0468"
version = "0.1.3"

[[deps.CLIMAParameters]]
deps = ["DocStringExtensions", "TOML", "Test"]
git-tree-sha1 = "9fcb37be791b4762943cbbf15ccf35c99d91460c"
uuid = "6eacf6c3-8458-43b9-ae03-caf5306d3d53"
version = "0.9.1"

[[deps.CPUSummary]]
deps = ["CpuId", "IfElse", "PrecompileTools", "Static"]
git-tree-sha1 = "601f7e7b3d36f18790e2caf83a882d88e9b71ff1"
Expand Down Expand Up @@ -294,10 +288,16 @@ deps = ["Adapt", "ArtifactWrappers", "CFTime", "CSV", "CUDA", "ClimaComms", "Cli
path = ".."
uuid = "08f4d4ce-cf43-44bb-ad95-9d2d5f413532"
version = "0.10.0"
weakdeps = ["CLIMAParameters"]
weakdeps = ["ClimaParams"]

[deps.ClimaLand.extensions]
CreateParametersExt = "CLIMAParameters"
CreateParametersExt = "ClimaParams"

[[deps.ClimaParams]]
deps = ["DocStringExtensions", "TOML", "Test"]
git-tree-sha1 = "284afdfa1e8a3d42809ffaab8e411d20d4804560"
uuid = "5c42b081-d73a-476f-9059-fd94b934656c"
version = "0.10.1"

[[deps.ClimaTimeSteppers]]
deps = ["ClimaComms", "Colors", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "KernelAbstractions", "Krylov", "LinearAlgebra", "LinearOperators", "NVTX", "SciMLBase", "StaticArrays"]
Expand Down Expand Up @@ -375,7 +375,7 @@ weakdeps = ["Dates", "LinearAlgebra"]
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.0.5+1"
version = "1.1.0+0"

[[deps.CompositionsBase]]
git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad"
Expand Down Expand Up @@ -835,9 +835,9 @@ version = "1.3.1"

[[deps.Git_jll]]
deps = ["Artifacts", "Expat_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "Libiconv_jll", "OpenSSL_jll", "PCRE2_jll", "Zlib_jll"]
git-tree-sha1 = "99f27817475017260f1ff24c771a5efef5765e34"
git-tree-sha1 = "12945451c5d0e2d0dca0724c3a8d6448b46bbdf9"
uuid = "f8c6e375-362e-5223-8a59-34ff63f689eb"
version = "2.44.0+0"
version = "2.44.0+1"

[[deps.Glib_jll]]
deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE2_jll", "Zlib_jll"]
Expand Down Expand Up @@ -926,13 +926,13 @@ version = "1.4.0"

[[deps.Insolation]]
deps = ["Artifacts", "Dates", "DelimitedFiles", "Interpolations"]
git-tree-sha1 = "e5bd2e08d94737b3acd1c1c4e6ab737d2494571c"
git-tree-sha1 = "1a2a8e1f202523619225fb54adf458b9345cee9b"
uuid = "e98cc03f-d57e-4e3c-b70c-8d51efe9e0d8"
version = "0.9.1"
weakdeps = ["CLIMAParameters"]
version = "0.9.2"
weakdeps = ["ClimaParams"]

[deps.Insolation.extensions]
CreateParametersExt = "CLIMAParameters"
CreateParametersExt = "ClimaParams"

[[deps.IntelOpenMP_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
Expand Down Expand Up @@ -1486,7 +1486,7 @@ version = "0.3.24+0"
[[deps.OpenBLAS_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
version = "0.3.23+2"
version = "0.3.23+4"

[[deps.OpenLibm_jll]]
deps = ["Artifacts", "Libdl"]
Expand Down Expand Up @@ -2002,13 +2002,13 @@ version = "7.2.1+1"

[[deps.SurfaceFluxes]]
deps = ["DocStringExtensions", "RootSolvers", "Thermodynamics"]
git-tree-sha1 = "c2329f2ba04cfd7d93b1fa00d43822b1ccacaa4e"
git-tree-sha1 = "24086f7e46de40dbd32a49d3fd51a534a5a9bcb0"
uuid = "49b00bb7-8bd4-4f2b-b78c-51cd0450215f"
version = "0.9.4"
weakdeps = ["CLIMAParameters"]
version = "0.10.0"
weakdeps = ["ClimaParams"]

[deps.SurfaceFluxes.extensions]
CreateParametersExt = "CLIMAParameters"
CreateParametersExt = "ClimaParams"

[[deps.SymbolicIndexingInterface]]
git-tree-sha1 = "251bb311585143931a306175c3b7ced220300578"
Expand Down Expand Up @@ -2067,13 +2067,13 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[deps.Thermodynamics]]
deps = ["DocStringExtensions", "KernelAbstractions", "Random", "RootSolvers"]
git-tree-sha1 = "9c9ccbdb2ecb490fc69a0392c98766dcc2024eae"
git-tree-sha1 = "a539e258008ed9275a91e0a374aa1d073e80e2bf"
uuid = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
version = "0.12.3"
weakdeps = ["CLIMAParameters"]
version = "0.12.4"
weakdeps = ["ClimaParams"]

[deps.Thermodynamics.extensions]
CreateParametersExt = "CLIMAParameters"
CreateParametersExt = "ClimaParams"

[[deps.ThreadingUtilities]]
deps = ["ManualMemory"]
Expand Down
4 changes: 1 addition & 3 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[deps]
ArtifactWrappers = "a14bc488-3040-4b00-9dc1-f6467924858a"
CLIMAParameters = "6eacf6c3-8458-43b9-ae03-caf5306d3d53"
ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884"
ClimaLand = "08f4d4ce-cf43-44bb-ad95-9d2d5f413532"
Expand Down Expand Up @@ -32,8 +32,6 @@ ClimaTimeSteppers = "0.7"
DataFrames = "1.6"
Flux = "0.14"
HTTP = "1.10"
Insolation = "=0.9.1"
InteractiveUtils = "1"
StatsBase = "0.34"
cuDNN = "1"
Thermodynamics = "=0.12.3"
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ tutorials = [
"standalone/Bucket/coupled_bucket.jl",
],
"Soil modeling" => [
"Boundary conditions" => "standalone/Soil/boundary_conditions.jl",
"Richards Equation" => "standalone/Soil/richards_equation.jl",
"Energy and Hydrology" => "standalone/Soil/soil_energy_hydrology.jl",
"Phase Changes" => "standalone/Soil/freezing_front.jl",
Expand Down
9 changes: 4 additions & 5 deletions docs/src/APIs/Soil.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,15 @@ ClimaLand.Soil.soil_surface_infiltration
## Soil BC Methods and Types

```@docs
ClimaLand.Soil.AbstractSoilBC
ClimaLand.Soil.MoistureStateBC
ClimaLand.Soil.FluxBC
ClimaLand.Soil.HeatFluxBC
ClimaLand.Soil.WaterFluxBC
ClimaLand.Soil.TemperatureStateBC
ClimaLand.Soil.FreeDrainage
ClimaLand.Soil.RichardsAtmosDrivenFluxBC
ClimaLand.Soil.AtmosDrivenFluxBC
ClimaLand.Soil.boundary_vars
ClimaLand.Soil.boundary_var_domain_names
ClimaLand.Soil.boundary_var_types
ClimaLand.Soil.WaterHeatBC
ClimaLand.Soil.soil_boundary_fluxes!
```

## Soil Source Types
Expand Down
4 changes: 4 additions & 0 deletions docs/src/APIs/shared_utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ ClimaLand.BottomBoundary
ClimaLand.boundary_flux
ClimaLand.diffusive_flux
ClimaLand.get_Δz
ClimaLand.boundary_vars
ClimaLand.boundary_var_domain_names
ClimaLand.boundary_var_types
ClimaLand.make_tendency_jacobian
ClimaLand.make_update_jacobian
ClimaLand.∂tendencyBC∂Y
Expand All @@ -64,6 +67,7 @@ ClimaLand.get_drivers
## Drivers
```@docs
ClimaLand.PrescribedAtmosphere
ClimaLand.PrescribedPrecipitation
ClimaLand.PrescribedRadiativeFluxes
ClimaLand.CoupledAtmosphere
ClimaLand.CoupledRadiativeFluxes
Expand Down
7 changes: 3 additions & 4 deletions docs/tutorials/integrated/soil_canopy_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ using Insolation
# Load CliMA Packages and ClimaLand Modules:

using ClimaCore
import CLIMAParameters as CP
import ClimaParams as CP
import ClimaTimeSteppers as CTS
using ClimaLand
using ClimaLand.Domains: Column, obtain_surface_domain
Expand All @@ -67,7 +67,7 @@ zmax = FT(0)
f_root_to_shoot = FT(3.5)
SAI = FT(0.00242)
maxLAI = FT(4.2)
capacity = FT(10) # kg/m^2
plant_ν = FT(2.46e-4)
n_stem = Int64(1)
n_leaf = Int64(1)
h_stem = FT(9)
Expand Down Expand Up @@ -209,8 +209,7 @@ soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
soilco2_bot_bc = Soil.Biogeochemistry.SoilCO2StateBC((p, t) -> 0.0);
soilco2_sources = (MicrobeProduction{FT}(),);

soilco2_boundary_conditions =
(; top = (CO2 = soilco2_top_bc,), bottom = (CO2 = soilco2_bot_bc,));
soilco2_boundary_conditions = (; top = soilco2_top_bc, bottom = soilco2_bot_bc);

soilco2_drivers = Soil.Biogeochemistry.SoilDrivers(
Soil.Biogeochemistry.PrognosticMet{FT}(),
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/shared_utilities/driver_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ using Dates
using Insolation # for computing zenith angle given lat, lon, time.
using ClimaLand
import ClimaLand.Parameters as LP
import CLIMAParameters
import ClimaParams

# Assume the local_datetime array is read in from the data file.
local_datetime = DateTime(2013):Dates.Hour(1):DateTime(2013, 1, 7); # one week, hourly data
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/standalone/Bucket/bucket_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ import ClimaTimeSteppers as CTS
# in advance for running distributed simulations.
using ClimaCore

# We also use CLIMAParameters, which strives to ensure a common set of
# We also use ClimaParams, which strives to ensure a common set of
# parameters across all Clima models, and to make parameter estimation
# more seamless.
import CLIMAParameters as CP
import ClimaParams as CP

# We also use Insolation to calculate solar zenith angle and solar insolation.

Expand All @@ -160,7 +160,7 @@ using Dates

FT = Float32;

# As mentioned we use CLIMAParameters for earth parameters that are
# As mentioned we use ClimaParams for earth parameters that are
# required across models (e.g. the density of water and ice, the latent
# heat of fusion at a reference temperature, etc). The land model requires
# additional parameters as described in the text above. These two sets
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/standalone/Canopy/canopy_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ using Insolation
# Load CliMA Packages and ClimaLand Modules:

using ClimaCore
import CLIMAParameters as CP
import ClimaParams as CP
import ClimaTimeSteppers as CTS
using StaticArrays
using ClimaLand
Expand Down Expand Up @@ -83,7 +83,7 @@ zmax = FT(0)
f_root_to_shoot = FT(3.5)
SAI = FT(0.00242)
maxLAI = FT(4.2)
capacity = FT(10) # kg/m^2
plant_ν = FT(2.46e-4) # kg/m^2
n_stem = Int64(1)
n_leaf = Int64(1)
h_stem = FT(9)
Expand Down
31 changes: 31 additions & 0 deletions docs/tutorials/standalone/Soil/boundary_conditions.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# # Boundary conditions for the soil model

# In general, you must supply two boundary conditions for each PDE being
# solved. These are passed to the model as a NamedTuple
# of the form `(; top = top_bc, bottom = bottom_bc)`, where both `top_bc`
# and `bottom_bc` are of type `ClimaLand.AbstractBC`.

# Flux boundary conditions are always passed as the (scalar)
# z-component of the flux `f`, i.e. F⃗ = f ẑ.

# # Boundary conditions for Richards equation
# 1. `FreeDrainage <: AbstractWaterBC`: this only can be used at the bottom of the domain.

# 2. `WaterFluxBC <: AbstractWaterBC`: this accepts a prescribed analytic function of the cache `p` and simulation time `t` which returns the flux value. e.g: `WaterFluxBC((p,t) -> 0.0)`.

# 3. `MoistureStateBC <: AbstractWaterBC`: this accepts a prescribed analytic function of the cache `p` and simulation time `t` which returns the value of `ϑ_l` at the boundary . e.g: `MoistureStateBC((p,t) -> 0.2)`.

# 4. `RichardsAtmosDrivenFluxBC <: AbstractWaterBC`: this requires a single argument of abstract type `AbstractTimeVaryingInput`. Under the hood, this specifies the precipitation as a function of space and time (using data read in from a file, or an analytic function) and applies this a flux BC, optionally accounting for surface/subsurface runoff.

# # Boundary conditions for the soil heat equation

# 1. `HeatFluxBC <: AbstractHeatBC`: this accepts a prescribed analytic function of the cache `p` and simulation time `t` which returns the flux value. e.g: `HeatFluxBC((p,t) -> 0.0)`.

# 2. `TemperatureStateBC <: AbstractHeatBC`: this accepts a prescribed analytic function of the cache `p` and simulation time `t` which returns the value of `T` at the boundary . e.g: `TemperatureStateBC((p,t) -> 273.15)`.

# # Boundary conditions for the soil heat + water equations (EnergyHydrology model)
# The full soil model requires boundary conditions for both Richards equation and the soil heat equation.

# 1. `WaterHeatBC <: AbstractEnergyHydrologyBC`: In many cases, the two boundary conditions can be treated independently. The `WaterHeatBC` requires a boundary condition of abstract type `AbstractWaterBC` and one of type `AbstractHeatBC`, for example, `top = WaterHeatBC(; water = MoistureBC(ϑ_l(p,t)), heat = TemperatureBC(T(p,t)))`.

# 2. `AtmosDrivenFluxBC <: AbstractEnergyHydrologyBC`: This is an example of a set of boundary conditions for the full soil model which cannot be decomposed into two independent boundary conditions for water and heat. In this case, we compute the turbulent surface fluxes with the atmosphere, obtaining a sensible heat, latent heat, and water vapor flux. We also take into account the net radiation at the surface and any precipitation or runoff. This is the BC type used in most land simulations.
15 changes: 9 additions & 6 deletions docs/tutorials/standalone/Soil/freezing_front.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ using DelimitedFiles
using Plots

using ClimaCore
import CLIMAParameters as CP
import ClimaParams as CP

using ClimaLand
using ClimaLand.Domains: Column
Expand Down Expand Up @@ -128,7 +128,7 @@ nelems = 20
soil_domain = Column(; zlim = (zmin, zmax), nelements = nelems);

# Set the boundary conditions:
zero_flux_bc = FluxBC((p, t) -> 0.0)
zero_water_flux_bc = WaterFluxBC((p, t) -> 0.0)
function top_heat_flux(p, t)
FT = eltype(p.soil.T)
p_len = ClimaCore.Spaces.nlevels(axes(p.soil.T))
Expand All @@ -140,11 +140,14 @@ function bottom_heat_flux(p, t)
T_c = ClimaCore.Fields.level(p.soil.T, 1)
return @. FT(-3 * (T_c - 279.85))
end
top_heat_flux_bc = FluxBC(top_heat_flux)
bottom_heat_flux_bc = FluxBC(bottom_heat_flux)
top_heat_flux_bc = HeatFluxBC(top_heat_flux)
bottom_heat_flux_bc = HeatFluxBC(bottom_heat_flux)
boundary_fluxes = (;
top = (water = zero_flux_bc, heat = top_heat_flux_bc),
bottom = (water = zero_flux_bc, heat = bottom_heat_flux_bc),
top = WaterHeatBC(; water = zero_water_flux_bc, heat = top_heat_flux_bc),
bottom = WaterHeatBC(;
water = zero_water_flux_bc,
heat = bottom_heat_flux_bc,
),
);

# Create the source term instance. Our phase change model requires
Expand Down
Loading

0 comments on commit 7f2d330

Please sign in to comment.