Skip to content

Commit

Permalink
Merge #6
Browse files Browse the repository at this point in the history
6: Wyujie r=Yujie-W a=Yujie-W



Co-authored-by: Yujie Wang <jesiner@gmail.com>
  • Loading branch information
bors[bot] and Yujie-W committed Feb 7, 2022
2 parents 56c6123 + 1647e57 commit 4c5ea58
Show file tree
Hide file tree
Showing 12 changed files with 287 additions and 118 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimaCache"
uuid = "781d2db2-48ae-11ec-81d3-0242ac130003"
authors = ["Yujie Wang <jesiner@gmail.com>"]
version = "0.1.0"
version = "0.1.1"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand All @@ -16,7 +16,7 @@ WaterPhysics = "20dd5ee6-61da-454b-ac5d-c09c2977e03a"
[compat]
DocStringExtensions = "0.8.6"
MAT = "0.10.1"
PkgUtility = "0.1.13"
PkgUtility = "0.1.13, 0.2"
UnPack = "1.0.2"
WaterPhysics = "0.1.3"
julia = "1.6"
90 changes: 21 additions & 69 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,12 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[deps.Blosc]]
deps = ["Blosc_jll"]
git-tree-sha1 = "575bdd70552dd9a7eaeba08ef2533226cdc50779"
uuid = "a74b3585-a348-5f62-a45c-50e91977d574"
version = "0.7.2"

[[deps.Blosc_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Pkg", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "91d6baa911283650df649d0aea7c28639273ae7b"
uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9"
version = "1.21.1+0"

[[deps.BufferedStreams]]
deps = ["Compat", "Test"]
git-tree-sha1 = "5d55b9486590fdda5905c275bb21ce1f0754020f"
uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
version = "1.0.0"

[[deps.CFTime]]
deps = ["Dates", "Printf"]
git-tree-sha1 = "bca6cb6ee746e6485ca4535f6cc29cf3579a0f20"
uuid = "179af706-886a-5703-950a-314cd64e0468"
version = "0.1.1"

[[deps.CLIMAParameters]]
deps = ["Test"]
git-tree-sha1 = "95bfba52e0e514336d506a6eb3488eb7d2145ad6"
Expand All @@ -55,9 +37,9 @@ version = "0.10.2"

[[deps.ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "54fc4400de6e5c3e27be6047da2ef6ba355511f8"
git-tree-sha1 = "f9982ef575e19b0e5c7a98c6e75ee496c0f73a93"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.11.6"
version = "1.12.0"

[[deps.ChangesOfVariables]]
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
Expand All @@ -69,7 +51,7 @@ version = "0.1.2"
deps = ["DocStringExtensions", "LazyArtifacts", "MAT", "PkgUtility", "Statistics", "Test", "UnPack", "WaterPhysics"]
path = ".."
uuid = "781d2db2-48ae-11ec-81d3-0242ac130003"
version = "0.1.0"
version = "0.1.1"

[[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
Expand Down Expand Up @@ -159,16 +141,16 @@ deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"

[[deps.HDF5]]
deps = ["Blosc", "Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires"]
git-tree-sha1 = "698c099c6613d7b7f151832868728f426abe698b"
deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires"]
git-tree-sha1 = "ed6c28c220375a214d07fba0e3d3382d8edd779e"
uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
version = "0.15.7"
version = "0.16.2"

[[deps.HDF5_jll]]
deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "fd83fa0bde42e01952757f01149dd968c06c4dba"
git-tree-sha1 = "bab67c0d1c4662d2c4be8c6007751b0b6111de5c"
uuid = "0234f1f7-429e-5d53-9886-15a909be8d59"
version = "1.12.0+1"
version = "1.12.1+0"

[[deps.IOCapture]]
deps = ["Logging", "Random"]
Expand All @@ -178,9 +160,9 @@ version = "0.2.2"

[[deps.InlineStrings]]
deps = ["Parsers"]
git-tree-sha1 = "8d70835a3759cdd75881426fced1508bb7b7e1b6"
git-tree-sha1 = "61feba885fac3a407465726d0c330b3055df897f"
uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
version = "1.1.1"
version = "1.1.2"

[[deps.InteractiveUtils]]
deps = ["Markdown"]
Expand Down Expand Up @@ -209,9 +191,9 @@ version = "1.0.0"

[[deps.JLLWrappers]]
deps = ["Preferences"]
git-tree-sha1 = "22df5b96feef82434b07327e2d3c770a9b21e023"
git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.4.0"
version = "1.4.1"

[[deps.JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
Expand Down Expand Up @@ -255,17 +237,11 @@ version = "0.3.6"
[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[deps.Lz4_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "5d494bc6e85c4c9b626ee0cab05daa4085486ab1"
uuid = "5ced341a-0733-55b8-9ab6-a4889d929147"
version = "1.9.3+0"

[[deps.MAT]]
deps = ["BufferedStreams", "CodecZlib", "HDF5", "SparseArrays"]
git-tree-sha1 = "37d418e2f20f0fcdc78214f763f1066b74ca1e1b"
git-tree-sha1 = "971be550166fe3f604d28715302b58a3f7293160"
uuid = "23992714-dd62-5051-b70f-ba57cb901cac"
version = "0.10.2"
version = "0.10.3"

[[deps.Markdown]]
deps = ["Base64"]
Expand All @@ -287,24 +263,6 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804"
[[deps.MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"

[[deps.NCDatasets]]
deps = ["CFTime", "DataStructures", "Dates", "NetCDF_jll", "Printf"]
git-tree-sha1 = "17e39eb5bbe564f48bdbefbd103bd3f49fcfcb9b"
uuid = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
version = "0.11.9"

[[deps.NetCDF_jll]]
deps = ["Artifacts", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Pkg", "Zlib_jll", "nghttp2_jll"]
git-tree-sha1 = "0cf4d1bf2ef45156aed85c9ac5f8c7e697d9288c"
uuid = "7243133f-43d8-5620-bbf4-c2c921802cf3"
version = "400.702.400+0"

[[deps.NetcdfIO]]
deps = ["DataFrames", "DocStringExtensions", "NCDatasets", "Test"]
git-tree-sha1 = "24d46a3001701f303756f9d31cdcd66f25ee3332"
uuid = "6a36f34d-89cf-423a-87c4-84549e82f670"
version = "0.1.2"

[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"

Expand All @@ -325,19 +283,19 @@ version = "1.4.1"

[[deps.Parsers]]
deps = ["Dates"]
git-tree-sha1 = "92f91ba9e5941fc781fecf5494ac1da87bdac775"
git-tree-sha1 = "0b5cfbb704034b5b4c1869e36634438a047df065"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "2.2.0"
version = "2.2.1"

[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[deps.PkgUtility]]
deps = ["CLIMAParameters", "CSV", "DataFrames", "Dates", "DocStringExtensions", "LazyArtifacts", "NetcdfIO", "Pkg", "Statistics", "StatsBase", "Test"]
git-tree-sha1 = "b6cfa5cbe4806d230e698237a1da5b34e316de3f"
deps = ["CLIMAParameters", "CSV", "DataFrames", "Dates", "DocStringExtensions", "LazyArtifacts", "Pkg", "Statistics", "StatsBase", "Test"]
git-tree-sha1 = "3cbe2b4556b1746ad2db9d8f4d3eb218039efe78"
uuid = "0d262f2c-28e9-492c-8e19-d7a5c4f11611"
version = "0.1.14"
version = "0.2.0"

[[deps.PooledArrays]]
deps = ["DataAPI", "Future"]
Expand Down Expand Up @@ -468,9 +426,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[deps.WaterPhysics]]
deps = ["DocStringExtensions", "PkgUtility", "Test", "UnPack"]
git-tree-sha1 = "54cda0d2b76e76342430ebdb9442cc12a53e11be"
git-tree-sha1 = "621ddd55a029c81fa3e776d3ee1383b1d51287c8"
uuid = "20dd5ee6-61da-454b-ac5d-c09c2977e03a"
version = "0.1.3"
version = "0.1.4"

[[deps.WeakRefStrings]]
deps = ["DataAPI", "InlineStrings", "Parsers"]
Expand All @@ -482,12 +440,6 @@ version = "1.4.1"
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"

[[deps.Zstd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "cc4bf3fdde8b7e3e9fa0351bdeedba1cf3b7f6e6"
uuid = "3161d3a3-bdf6-5164-811a-617609db77b4"
version = "1.5.0+0"

[[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
Expand Down
6 changes: 1 addition & 5 deletions src/ClimaCache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ using UnPack: @unpack
using WaterPhysics: saturation_vapor_pressure


# export public types and constructors
export AirLayer, Arrhenius, ArrheniusPeak, C3CytochromeModel, C3VJPModel, C4VJPModel, CytochromeFluorescenceModel, CytochromeReactionCenter, GCO₂Mode, Leaf, LeafBiophysics, MinimumColimit, PCO₂Mode,
Q10, QuadraticColimit, VJPReactionCenter, VanDerTolFluorescenceModel, WaveLengthSet


#######################################################################################################################################################################################################
#
# Changes to these constants
Expand Down Expand Up @@ -60,6 +55,7 @@ include("plant/leaf_biophysics.jl")
include("plant/leaf_fluorescence.jl")
include("plant/leaf_photosynthesis.jl")
include("plant/leaf_reaction_center.jl")
include("plant/vulnerability.jl")
include("plant/leaf.jl")

# include the soil types and structures
Expand Down
6 changes: 3 additions & 3 deletions src/plant/leaf_fluorescence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract type AbstractFluorescenceModel{FT<:AbstractFloat} end

#######################################################################################################################################################################################################
#
# Changes to the type
# Changes to the struct
# General
# 2022-Jan-14: add van der Tol model struct
# 2022-Jan-24: fix documentation
Expand Down Expand Up @@ -50,7 +50,7 @@ end

#######################################################################################################################################################################################################
#
# Changes to the constructors
# Changes to the constructor
# General
# 2022-Jan-14: migrate from Photosynthesis.jl
# Sources
Expand Down Expand Up @@ -82,7 +82,7 @@ VanDerTolFluorescenceModel{FT}(drought::Bool = false) where {FT<:AbstractFloat}

#######################################################################################################################################################################################################
#
# Changes to the structure
# Changes to the struct
# General
# 2022-Jan-24: add an empty structure for Cytochrome based fluorescence model
# 2022-Jan-24: fix documentation
Expand Down
73 changes: 72 additions & 1 deletion src/plant/leaf_photosynthesis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ abstract type AbstractPhotosynthesisModel{FT<:AbstractFloat} end
# General
# 2022-Jan-18: add C3CytochromeModel structure for C₃ photosynthesis system
# 2022-Jan-25: fix documentation
# 2022-Feb-07: add more fields to use with Photosynthesis v0.3.1
# To do
# TODO: add TD in Photosynthesis.jl
#
Expand All @@ -49,14 +50,40 @@ mutable struct C3CytochromeModel{FT<:AbstractFloat} <: AbstractPhotosynthesisMod
EFF_1::FT
"Coefficient 8.0/10.5 for NADPH/ATP requirement stochiometry, respectively"
EFF_2::FT
"[`AbstractTemperatureDependency`](@ref) type Kc temperature dependency"
TD_KC::AbstractTemperatureDependency{FT}
"[`AbstractTemperatureDependency`](@ref) type Ko temperature dependency"
TD_KO::AbstractTemperatureDependency{FT}
"[`AbstractTemperatureDependency`](@ref) type respiration temperature dependency"
TD_R::AbstractTemperatureDependency{FT}
"[`AbstractTemperatureDependency`](@ref) type Vcmax temperature dependency"
TD_VCMAX::AbstractTemperatureDependency{FT}
"[`AbstractTemperatureDependency`](@ref) type Γ* temperature dependency"
TD_Γ::AbstractTemperatureDependency{FT}

# prognostic variables that change with time
"Total concentration of Cytochrome b₆f `[μmol m⁻²]`"
b₆f::FT
"Maximal turnover rate of Cytochrome b₆f `[e⁻ s⁻¹]`"
k_q::FT
"Respiration rate at 298.15 K `[μmol m⁻² s⁻¹]`"
r_d25::FT
"Maximal carboxylation rate at 298.15 K `[μmol m⁻² s⁻¹]`"
v_cmax25::FT

# dignostic variables that change with time
"RubisCO limited photosynthetic rate `[μmol m⁻² s⁻¹]`"
a_c::FT
"Gross photosynthetic rate `[μmol m⁻² s⁻¹]`"
a_gross::FT
"Light limited photosynthetic rate `[μmol m⁻² s⁻¹]`"
a_j::FT
"Net photosynthetic rate `[μmol m⁻² s⁻¹]`"
a_net::FT
"Product limited photosynthetic rate `[μmol m⁻² s⁻¹]`"
a_p::FT
"Electron to CO₂ coefficient"
e_to_c::FT
"PS II electron transport rate `[μmol e⁻ m⁻² s⁻¹]`"
j_p680_a::FT
"Rubisco limited PS II electron transport rate `[μmol e⁻ m⁻² s⁻¹]`"
Expand All @@ -73,6 +100,16 @@ mutable struct C3CytochromeModel{FT<:AbstractFloat} <: AbstractPhotosynthesisMod
j_p700_j::FT
"Product limited PS I electron transport rate `[μmol e⁻ m⁻² s⁻¹]`"
j_p700_p::FT
"RubisCO coefficient Kc `[Pa]`"
k_c::FT
"Michaelis-Menten's coefficient `[Pa]`"
k_m::FT
"RubisCO coefficient Ko `[Pa]`"
k_o::FT
"Respiration rate at leaf temperature `[μmol m⁻² s⁻¹]`"
r_d::FT
"Maximal carboxylation rate at leaf temperature `[μmol m⁻² s⁻¹]`"
v_cmax::FT
"Maximal Cytochrome b₆f activity `[μmol e⁻ m⁻² s⁻¹]`"
v_qmax::FT
"ratio between J_P700 and J_P680"
Expand Down Expand Up @@ -106,7 +143,41 @@ cy = C3CytochromeModel{Float64}(v_cmax25 = 30, r_d25 = 1);
```
"""
C3CytochromeModel{FT}(; v_cmax25::Number = 50, r_d25::Number = 0.75) where {FT<:AbstractFloat} = (
return C3CytochromeModel{FT}(MinimumColimit{FT}(), 4, 8, 350 / 300, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
return C3CytochromeModel{FT}(
MinimumColimit{FT}(), # COLIMIT
4, # EFF_1
8, # EFF_2
KcTDCLM(FT), # TD_KC
KoTDCLM(FT), # TD_KO
RespirationTDCLM(FT), # TD_R
VcmaxTDCLM(FT), # TD_VCMAX
ΓStarTDCLM(FT), # TD_Γ
350 / 300, # b₆f
300, # k_q
r_d25, # r_d25
v_cmax25, # v_cmax25,
0, # a_c
0, # a_gross
0, # a_j
-r_d25, # a_net
0, # a_p
0, # e_to_c
0, # j_p680_a
0, # j_p680_c
0, # j_p680_j
0, # j_p680_p
0, # j_p700_a
0, # j_p700_c
0, # j_p700_j
0, # j_p700_p
0, # k_c
0, # k_m
0, # k_o
r_d25, # r_d
v_cmax25, # v_cmax
0, # v_qmax
0, # η
0) # γ_star
);


Expand Down

0 comments on commit 4c5ea58

Please sign in to comment.