diff --git a/Project.toml b/Project.toml index b8f397b5c7..4184554013 100644 --- a/Project.toml +++ b/Project.toml @@ -19,7 +19,6 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" SurfaceFluxes = "49b00bb7-8bd4-4f2b-b78c-51cd0450215f" Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c" -UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" [compat] ArtifactWrappers = "0.2" @@ -37,5 +36,4 @@ SciMLBase = "1, 2" StaticArrays = "1" SurfaceFluxes = "0.8" Thermodynamics = "0.9, 0.10, 0.11" -UnPack = "1" julia = "1.8" diff --git a/docs/Manifest.toml b/docs/Manifest.toml index 6e91feb35e..943d2173b7 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -227,7 +227,7 @@ uuid = "d934ef94-cdd4-4710-83d6-720549644b70" version = "0.3.11" [[deps.ClimaLSM]] -deps = ["ArtifactWrappers", "CFTime", "ClimaComms", "ClimaCore", "ClimaCoreTempestRemap", "Dates", "DocStringExtensions", "IntervalSets", "JLD2", "LinearAlgebra", "NCDatasets", "SciMLBase", "StaticArrays", "SurfaceFluxes", "Thermodynamics", "UnPack"] +deps = ["ArtifactWrappers", "CFTime", "ClimaComms", "ClimaCore", "ClimaCoreTempestRemap", "Dates", "DocStringExtensions", "IntervalSets", "JLD2", "LinearAlgebra", "NCDatasets", "SciMLBase", "StaticArrays", "SurfaceFluxes", "Thermodynamics"] path = ".." uuid = "7884a58f-fab6-4fd0-82bb-ecfedb2d8430" version = "0.4.0" diff --git a/experiments/Manifest.toml b/experiments/Manifest.toml index a42af2bddd..2cf2f94250 100644 --- a/experiments/Manifest.toml +++ b/experiments/Manifest.toml @@ -217,7 +217,7 @@ uuid = "d934ef94-cdd4-4710-83d6-720549644b70" version = "0.3.11" [[deps.ClimaLSM]] -deps = ["ArtifactWrappers", "CFTime", "ClimaComms", "ClimaCore", "ClimaCoreTempestRemap", "Dates", "DocStringExtensions", "IntervalSets", "JLD2", "LinearAlgebra", "NCDatasets", "SciMLBase", "StaticArrays", "SurfaceFluxes", "Thermodynamics", "UnPack"] +deps = ["ArtifactWrappers", "CFTime", "ClimaComms", "ClimaCore", "ClimaCoreTempestRemap", "Dates", "DocStringExtensions", "IntervalSets", "JLD2", "LinearAlgebra", "NCDatasets", "SciMLBase", "StaticArrays", "SurfaceFluxes", "Thermodynamics"] path = ".." uuid = "7884a58f-fab6-4fd0-82bb-ecfedb2d8430" version = "0.4.0" diff --git a/src/ClimaLSM.jl b/src/ClimaLSM.jl index bb89012cf2..34e3f349db 100644 --- a/src/ClimaLSM.jl +++ b/src/ClimaLSM.jl @@ -1,5 +1,4 @@ module ClimaLSM -using UnPack using DocStringExtensions using ClimaCore diff --git a/src/integrated/pond_soil_model.jl b/src/integrated/pond_soil_model.jl index 61f3a8e4cb..1e7255210d 100644 --- a/src/integrated/pond_soil_model.jl +++ b/src/integrated/pond_soil_model.jl @@ -56,7 +56,7 @@ function LandHydrology{FT}(; SW <: Pond.AbstractSurfaceWaterModel{FT}, } - @unpack precip = land_args + (; precip) = land_args sources = () surface_runoff = PrognosticRunoff{FT}(precip) diff --git a/src/standalone/Bucket/Bucket.jl b/src/standalone/Bucket/Bucket.jl index d4c6c721d6..7281b3b5af 100644 --- a/src/standalone/Bucket/Bucket.jl +++ b/src/standalone/Bucket/Bucket.jl @@ -1,5 +1,4 @@ module Bucket -using UnPack using DocStringExtensions using Thermodynamics using Dates @@ -437,7 +436,7 @@ Creates the compute_exp_tendency! function for the bucket model. """ function make_compute_exp_tendency(model::BucketModel{FT}) where {FT} function compute_exp_tendency!(dY, Y, p, t) - @unpack κ_soil, ρc_soil, σS_c, W_f = model.parameters + (; κ_soil, ρc_soil, σS_c, W_f) = model.parameters #Currently, the entire surface is assumed to be # snow covered entirely or not at all. @@ -452,7 +451,7 @@ function make_compute_exp_tendency(model::BucketModel{FT}) where {FT} # The below is NOT CORRECT if we want the snow # cover fraction to be intermediate between 0 and 1. - @unpack turbulent_energy_flux, R_n, evaporation = p.bucket + (; turbulent_energy_flux, R_n, evaporation) = p.bucket F_sfc = @. (R_n + turbulent_energy_flux) # Eqn (15) _T_freeze = LSMP.T_freeze(model.parameters.earth_param_set) diff --git a/src/standalone/Snow/Snow.jl b/src/standalone/Snow/Snow.jl index bdd9341db8..d135a55554 100644 --- a/src/standalone/Snow/Snow.jl +++ b/src/standalone/Snow/Snow.jl @@ -1,6 +1,5 @@ module Snow -using UnPack using DocStringExtensions import ...Parameters as LSMP export SnowParameters diff --git a/src/standalone/Soil/Biogeochemistry/Biogeochemistry.jl b/src/standalone/Soil/Biogeochemistry/Biogeochemistry.jl index dc9f7575fd..ff29fe9426 100644 --- a/src/standalone/Soil/Biogeochemistry/Biogeochemistry.jl +++ b/src/standalone/Soil/Biogeochemistry/Biogeochemistry.jl @@ -1,6 +1,5 @@ module Biogeochemistry using ClimaLSM -using UnPack using DocStringExtensions using ClimaCore import ...Parameters as LSMP diff --git a/src/standalone/Soil/Biogeochemistry/co2_parameterizations.jl b/src/standalone/Soil/Biogeochemistry/co2_parameterizations.jl index bd93e4b2e1..e7835a54f1 100644 --- a/src/standalone/Soil/Biogeochemistry/co2_parameterizations.jl +++ b/src/standalone/Soil/Biogeochemistry/co2_parameterizations.jl @@ -1,4 +1,3 @@ -using UnPack export volumetric_air_content, co2_diffusivity, microbe_source @@ -19,20 +18,12 @@ function microbe_source( Csom::FT, params::SoilCO2ModelParameters{FT}, ) where {FT} - @unpack α_sx, - Ea_sx, - kM_sx, - kM_o2, - ν, - D_liq, - p_sx, - D_oa, - O2_a, - earth_param_set = params + (; α_sx, Ea_sx, kM_sx, kM_o2, ν, D_liq, p_sx, D_oa, O2_a, earth_param_set) = + params R = FT(LSMP.gas_constant(earth_param_set)) Vmax = α_sx * exp(-Ea_sx / (R * T_soil)) # Maximum potential rate of respiration Sx = p_sx * Csom * D_liq * θ_l^3 # All soluble substrate, kgC m⁻³ - MM_sx = Sx / (kM_sx + Sx) # Availability of substrate factor, 0-1 + MM_sx = Sx / (kM_sx + Sx) # Availability of substrate factor, 0-1 O2 = D_oa * O2_a * ((ν - θ_l)^(FT(4 / 3))) # Oxygen concentration MM_o2 = O2 / (kM_o2 + O2) # Oxygen limitation factor, 0-1 R_sm = Vmax * MM_sx * MM_o2 # Respiration, kg C m⁻³ s⁻¹ @@ -44,9 +35,9 @@ end volumetric_air_content(θ_w::FT, params::SoilCO2ModelParameters{FT} ) where {FT} - -Computes the volumetric air content (`θ_a`) in the soil, -which is related to the total soil porosity (`ν`) and + +Computes the volumetric air content (`θ_a`) in the soil, +which is related to the total soil porosity (`ν`) and volumetric soil water content (`θ_w = θ_l+θ_i`). """ function volumetric_air_content( @@ -67,11 +58,11 @@ end Computes the diffusivity of CO₂ within the soil (D). -First, D0 is computed using the temperature within the soil (`T_soil` in K) and +First, D0 is computed using the temperature within the soil (`T_soil` in K) and pressure at the surface of the soil (`P_sfc` in Pa), using reference -values of `T_ref` and `P_ref` (273 K and 101325 Pa). Here, `θ_a` is the -volumetric air content and `θ_a100` is the volumetric air content -at a soil water potential of +values of `T_ref` and `P_ref` (273 K and 101325 Pa). Here, `θ_a` is the +volumetric air content and `θ_a100` is the volumetric air content +at a soil water potential of 100cm, and b is the pore size distribution of the soil. """ function co2_diffusivity( @@ -80,7 +71,7 @@ function co2_diffusivity( P_sfc::FT, params::SoilCO2ModelParameters{FT}, ) where {FT} - @unpack D_ref, θ_a100, b, ν, earth_param_set = params + (; D_ref, θ_a100, b, ν, earth_param_set) = params T_ref = FT(LSMP.T_0(earth_param_set)) P_ref = FT(LSMP.P_ref(earth_param_set)) θ_a = volumetric_air_content(θ_w, params) diff --git a/src/standalone/SurfaceWater/Pond.jl b/src/standalone/SurfaceWater/Pond.jl index 40abdb65b3..1cebf0adad 100644 --- a/src/standalone/SurfaceWater/Pond.jl +++ b/src/standalone/SurfaceWater/Pond.jl @@ -1,7 +1,6 @@ module Pond using ClimaLSM using ClimaCore -using UnPack using DocStringExtensions import ClimaCore: Fields diff --git a/src/standalone/Vegetation/Canopy.jl b/src/standalone/Vegetation/Canopy.jl index b4ae382a71..894fbf7b71 100644 --- a/src/standalone/Vegetation/Canopy.jl +++ b/src/standalone/Vegetation/Canopy.jl @@ -405,7 +405,7 @@ function ClimaLSM.make_update_aux( ϑ_l = Y.canopy.hydraulics.ϑ_l fa = p.canopy.hydraulics.fa - #unpack parameters + # unpack parameters area_index = p.canopy.hydraulics.area_index LAI = area_index.leaf RAI = area_index.root